@@ -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'
@@ -166,7 +166,7 @@ const MAX_COMPILED_ATTACHMENT_BYTES = 5 * 1024 * 1024
166166 * (see {@link isStaticFileHidden}).
167167 */
168168let staticComponentFiles : Map < string , string > | null = null
169- let staticFunctionSchemaWithoutSimSandboxes : string | null = null
169+ let staticFunctionSchemaWithRestrictedSimSandboxes : string | null = null
170170
171171/**
172172 * Owning block for each `components/integrations/**` file, recorded at build
@@ -363,9 +363,9 @@ function getStaticComponentFiles(): Map<string, string> {
363363 const path = `components/blocks/${ block . type } .json`
364364 files . set ( path , serializeBlockSchema ( block , { toolConfigs } ) )
365365 if ( block . type === 'function' ) {
366- staticFunctionSchemaWithoutSimSandboxes = serializeBlockSchema ( block , {
366+ staticFunctionSchemaWithRestrictedSimSandboxes = serializeBlockSchema ( block , {
367367 toolConfigs,
368- hiddenInputIds : new Set ( [ 'sandboxId' ] ) ,
368+ restrictedInputs : RESTRICTED_SIM_SANDBOX_INPUTS ,
369369 } )
370370 }
371371 }
@@ -572,9 +572,6 @@ export class WorkspaceVFS {
572572 > ( )
573573 private deploymentCache = new Map < string , Promise < DeploymentData | null > > ( )
574574 private _workspaceId = ''
575- // Defaults to hidden so partial/failed materialization cannot leak a gated
576- // Function input. Set from the live Sim entitlement before the VFS is used.
577- private _simSandboxEntitled = false
578575 /**
579576 * Types of the org's CURRENT custom blocks (enabled + disabled — a disabled block
580577 * still resolves/renders). Populated by {@link materializeCustomBlocks}; used to
@@ -817,8 +814,6 @@ export class WorkspaceVFS {
817814 // prompt prefix), so nothing is destructured from this one.
818815 timed ( 'tasks' , this . materializeTasks ( workspaceId , userId ) ) ,
819816 ] )
820- this . _simSandboxEntitled = sandboxEntitled
821-
822817 const workspaceMdData : WorkspaceMdData = {
823818 workspace : wsRow ,
824819 members,
@@ -853,7 +848,7 @@ export class WorkspaceVFS {
853848 if ( isStaticFileHidden ( path , blockVisibility , allowedIntegrationTypes ) ) continue
854849 const projectedContent =
855850 path === 'components/blocks/function.json' && ! sandboxEntitled
856- ? ( staticFunctionSchemaWithoutSimSandboxes ?? content )
851+ ? ( staticFunctionSchemaWithRestrictedSimSandboxes ?? content )
857852 : content
858853 this . files . set ( path , projectedContent )
859854 }
@@ -1546,15 +1541,12 @@ export class WorkspaceVFS {
15461541 // workflow; it still exists and must be readable, so emit an
15471542 // empty-but-valid state.json rather than a 404.
15481543 const sanitized = normalized
1549- ? sanitizeForCopilot (
1550- {
1551- blocks : normalized . blocks ,
1552- edges : normalized . edges ,
1553- loops : normalized . loops ,
1554- parallels : normalized . parallels ,
1555- } as any ,
1556- this . _simSandboxEntitled ? undefined : HIDE_SIM_SANDBOX_INPUTS
1557- )
1544+ ? sanitizeForCopilot ( {
1545+ blocks : normalized . blocks ,
1546+ edges : normalized . edges ,
1547+ loops : normalized . loops ,
1548+ parallels : normalized . parallels ,
1549+ } as any )
15581550 : sanitizeForCopilot ( { blocks : { } , edges : [ ] , loops : { } , parallels : { } } as any )
15591551 return JSON . stringify ( sanitized , null , 2 )
15601552 } )
0 commit comments