@@ -38,7 +38,7 @@ import {
3838 filterSecretNamesByMountPolicy ,
3939 type SecretMountPolicy ,
4040} from '@/lib/copilot/secret-mount-policy'
41- import { HIDE_SIM_SANDBOX_INPUTS } from '@/lib/copilot/sim-sandbox-projection'
41+ import { RESTRICTED_SIM_SANDBOX_INPUTS } from '@/lib/copilot/sim-sandbox-projection'
4242import { compileDoc , getE2BDocFormat } from '@/lib/copilot/tools/server/files/doc-compile'
4343import { extractDocText , isExtractableDocExt } from '@/lib/copilot/tools/server/files/doc-extract'
4444import { runE2BCompiledCheck } from '@/lib/copilot/tools/server/files/doc-recalc'
@@ -181,7 +181,7 @@ function bindWorkspaceFileResult<T>(
181181 * (see {@link isStaticFileHidden}).
182182 */
183183let staticComponentFiles : Map < string , string > | null = null
184- let staticFunctionSchemaWithoutSimSandboxes : string | null = null
184+ let staticFunctionSchemaWithRestrictedSimSandboxes : string | null = null
185185
186186/**
187187 * Owning block for each `components/integrations/**` file, recorded at build
@@ -378,9 +378,9 @@ function getStaticComponentFiles(): Map<string, string> {
378378 const path = `components/blocks/${ block . type } .json`
379379 files . set ( path , serializeBlockSchema ( block , { toolConfigs } ) )
380380 if ( block . type === 'function' ) {
381- staticFunctionSchemaWithoutSimSandboxes = serializeBlockSchema ( block , {
381+ staticFunctionSchemaWithRestrictedSimSandboxes = serializeBlockSchema ( block , {
382382 toolConfigs,
383- hiddenInputIds : new Set ( [ 'sandboxId' ] ) ,
383+ restrictedInputs : RESTRICTED_SIM_SANDBOX_INPUTS ,
384384 } )
385385 }
386386 }
@@ -587,9 +587,6 @@ export class WorkspaceVFS {
587587 > ( )
588588 private deploymentCache = new Map < string , Promise < DeploymentData | null > > ( )
589589 private _workspaceId = ''
590- // Defaults to hidden so partial/failed materialization cannot leak a gated
591- // Function input. Set from the live Sim entitlement before the VFS is used.
592- private _simSandboxEntitled = false
593590 /**
594591 * Types of the org's CURRENT custom blocks (enabled + disabled — a disabled block
595592 * still resolves/renders). Populated by {@link materializeCustomBlocks}; used to
@@ -832,8 +829,6 @@ export class WorkspaceVFS {
832829 // prompt prefix), so nothing is destructured from this one.
833830 timed ( 'tasks' , this . materializeTasks ( workspaceId , userId ) ) ,
834831 ] )
835- this . _simSandboxEntitled = sandboxEntitled
836-
837832 const workspaceMdData : WorkspaceMdData = {
838833 workspace : wsRow ,
839834 members,
@@ -868,7 +863,7 @@ export class WorkspaceVFS {
868863 if ( isStaticFileHidden ( path , blockVisibility , allowedIntegrationTypes ) ) continue
869864 const projectedContent =
870865 path === 'components/blocks/function.json' && ! sandboxEntitled
871- ? ( staticFunctionSchemaWithoutSimSandboxes ?? content )
866+ ? ( staticFunctionSchemaWithRestrictedSimSandboxes ?? content )
872867 : content
873868 this . files . set ( path , projectedContent )
874869 }
@@ -1592,15 +1587,12 @@ export class WorkspaceVFS {
15921587 // workflow; it still exists and must be readable, so emit an
15931588 // empty-but-valid state.json rather than a 404.
15941589 const sanitized = normalized
1595- ? sanitizeForCopilot (
1596- {
1597- blocks : normalized . blocks ,
1598- edges : normalized . edges ,
1599- loops : normalized . loops ,
1600- parallels : normalized . parallels ,
1601- } as any ,
1602- this . _simSandboxEntitled ? undefined : HIDE_SIM_SANDBOX_INPUTS
1603- )
1590+ ? sanitizeForCopilot ( {
1591+ blocks : normalized . blocks ,
1592+ edges : normalized . edges ,
1593+ loops : normalized . loops ,
1594+ parallels : normalized . parallels ,
1595+ } as any )
16041596 : sanitizeForCopilot ( { blocks : { } , edges : [ ] , loops : { } , parallels : { } } as any )
16051597 return JSON . stringify ( sanitized , null , 2 )
16061598 } )
0 commit comments