eve 0.45.2 → 0.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/src/channel/types.d.ts +2 -0
- package/dist/src/cli/dev/tui/agent-header.d.ts +5 -14
- package/dist/src/cli/dev/tui/agent-header.js +1 -1
- package/dist/src/cli/dev/tui/runner.d.ts +4 -5
- package/dist/src/cli/dev/tui/terminal-renderer.d.ts +3 -3
- package/dist/src/cli/run.js +3 -3
- package/dist/src/compiler/channel-route-plan.d.ts +2 -2
- package/dist/src/compiler/instrumentation-layout-config.d.ts +3 -0
- package/dist/src/compiler/instrumentation-layout-config.js +1 -0
- package/dist/src/compiler/load-binding-namespace.d.ts +5 -3
- package/dist/src/compiler/load-binding-namespace.js +1 -1
- package/dist/src/compiler/manifest.d.ts +2 -2
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/module-lifecycle.d.ts +14 -0
- package/dist/src/compiler/module-lifecycle.js +1 -0
- package/dist/src/compiler/module-map.d.ts +2 -2
- package/dist/src/compiler/module-map.js +2 -2
- package/dist/src/compiler/node-source-state.d.ts +6 -3
- package/dist/src/compiler/node-source-state.js +1 -1
- package/dist/src/compiler/normalize-agent-config.d.ts +2 -2
- package/dist/src/compiler/normalize-helpers.d.ts +4 -4
- package/dist/src/compiler/normalize-manifest-helpers.js +1 -1
- package/dist/src/compiler/normalize-manifest.js +1 -1
- package/dist/src/compiler/remote-agent-node.js +1 -1
- package/dist/src/compiler/source-graph.d.ts +12 -2
- package/dist/src/compiler/source-graph.js +1 -1
- package/dist/src/compiler/validate-artifact.js +1 -1
- package/dist/src/context/keys.d.ts +2 -0
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/framework/sources/registry.js +1 -1
- package/dist/src/harness/channel-delivery-instrumentation.js +1 -1
- package/dist/src/harness/instrumentation/content-policy.d.ts +3 -2
- package/dist/src/harness/instrumentation/content-policy.js +1 -1
- package/dist/src/harness/instrumentation/content.d.ts +11 -0
- package/dist/src/harness/instrumentation/content.js +1 -1
- package/dist/src/harness/tool-loop.js +2 -2
- package/dist/src/internal/application/compiled-artifacts.d.ts +7 -7
- package/dist/src/internal/application/compiled-artifacts.js +2 -3
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-asset-import-plugin.d.ts +6 -2
- package/dist/src/internal/authored-asset-import-plugin.js +1 -1
- package/dist/src/internal/authored-module-loader.js +3 -3
- package/dist/src/internal/authored-module-map-loader.js +1 -1
- package/dist/src/internal/authored-runtime-modules.d.ts +15 -0
- package/dist/src/internal/authored-runtime-modules.js +1 -0
- package/dist/src/internal/materialized-authored-modules.d.ts +2 -18
- package/dist/src/internal/materialized-authored-modules.js +1 -1
- package/dist/src/internal/nitro/development-generation.js +1 -1
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js +1 -1
- package/dist/src/public/channels/slack/inbound-content.js +2 -2
- package/dist/src/public/instrumentation/otel.d.ts +1 -1
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/shared/instrumentation-content.d.ts +6 -0
- package/dist/src/shared/instrumentation-content.js +1 -0
- package/dist/src/shared/instrumentation-decision.d.ts +8 -0
- package/dist/src/shared/instrumentation-decision.js +1 -0
- package/dist/src/tracing/agent-trace-context-store.d.ts +3 -3
- package/dist/src/tracing/agent-trace-context-store.js +1 -1
- package/dist/src/tracing/otel-declaration.d.ts +14 -3
- package/dist/src/tracing/sampled-trace.d.ts +8 -1
- package/dist/src/tracing/sampled-trace.js +1 -1
- package/docs/agent-config.md +2 -0
- package/docs/channels/slack.mdx +2 -0
- package/docs/guides/dynamic-capabilities.md +2 -0
- package/docs/instructions.mdx +3 -1
- package/docs/reference/typescript-api.md +25 -0
- package/docs/schedules.mdx +2 -0
- package/docs/skills.mdx +2 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{compileChannelDefinition}from"#compiler/normalize-channel.js";import{createCompiledBindingNamespaceLoader}from"#compiler/load-binding-namespace.js";import{ROOT_COMPILED_AGENT_NODE_ID,createCompiledAgentManifest,createCompiledAgentNodeManifest,createCompiledAgentResources,createCompiledSubagentNodeId}from"#compiler/manifest.js";import{summarizeCompilerDiagnostics}from"#compiler/diagnostics.js";import{canonicalSourceSlot,composeAgentModuleCandidates,createCompiledModuleBinding,createProgrammaticModuleCandidates,describeAgentSourceCandidate,disableComposedCandidate,instantiateProgrammaticTemplate}from"#compiler/source-graph.js";import{frameworkAgentSourceRegistry,memoryWrapperTemplate}from"#framework/sources/registry.js";import{assertApplicationOverlayCanApplyToAllNodes,assertNonExtensionSpecialTool,assertRootOnlyConfig,assertRootOwnedSpecialTool,assertUniqueBy,assertUniqueRegistryIds,collectSelectedSourceIds,compileExtensionMounts,createCompiledRemoteAgent,expectSubagentDescription,mergeExternalDependencies,withExtensionNamespace}from"#compiler/normalize-manifest-helpers.js";import{loadModuleBackedDefinition}from"#compiler/normalize-helpers.js";import{assertRemoteAgentDefinitionHasNoLocalPackageEntries,normalizeSubagentConfig}from"#compiler/normalize-subagent.js";import{createCompiledRuntimeModelCatalogLoader}from"#compiler/model-catalog.js";import{compileAgentConfig}from"#compiler/normalize-agent-config.js";import{compileConnectionDefinition}from"#compiler/normalize-connection.js";import{compileHookEntry}from"#compiler/normalize-hook.js";import{compileInstructionsEntry}from"#compiler/normalize-instructions.js";import{compileMemoryDefinition,deriveMemorySlot}from"#compiler/normalize-memory.js";import{compileSandboxDefinition}from"#compiler/normalize-sandbox.js";import{compileScheduleDefinition}from"#compiler/normalize-schedule.js";import{compileSkillSource}from"#compiler/normalize-skill.js";import{compileToolEntry}from"#compiler/normalize-tool.js";import{createCompiledChannelRoutePlan}from"#compiler/channel-route-plan.js";import{finalizeNodeSourceState}from"#compiler/node-source-state.js";import{projectAgentSources,projectSelectedSources}from"#compiler/project-sources.js";async function compileAgentManifest(e,t={}){let i=[frameworkAgentSourceRegistry,...t.sourceRegistries??[]];assertUniqueRegistryIds(i);let a={modelCatalog:createCompiledRuntimeModelCatalogLoader(e.appRoot),registries:i},o=t.diagnostics??[],c=await new AgentGraphCompiler(a,i,o).compileStaticNode({inheritedExternalDependencies:[],isRoot:!0,layer:`application`,manifest:e,nodeId:ROOT_COMPILED_AGENT_NODE_ID,owner:{kind:`application`}}),l=[c.manifest,...c.descendants.map(e=>e.agent)].flatMap(e=>e.tools).find(e=>e.execution===`background`);if(l!==void 0&&c.manifest.config.experimental?.tasks!==!0)throw Error(`Background tool "${l.name}" requires experimental.tasks: true in the root agent config.`);let u=summarizeCompilerDiagnostics(o),d=c.descendants.map(e=>(e.configResolver,{...e,agent:{...e.agent,diagnosticsSummary:u}}));return createCompiledAgentManifest({...c.manifest,diagnosticsSummary:u,subagents:d})}var AgentGraphCompiler=class{context;registries;diagnostics;constructor(e,t,n){this.context=e,this.registries=t,this.diagnostics=n}async compileStaticNode(e){let t=await this.createPhaseOneNodeSourceState(e,e.inheritedExternalDependencies),n=await compileAgentConfig(e.manifest,this.context,{binding:t.selectedConfig.binding,definition:t.selectedConfig.definition,source:t.selectedConfig.source});assertRootOnlyConfig(n,e.isRoot,e.manifest.agentId);let r=mergeExternalDependencies(e.inheritedExternalDependencies,n.build?.externalDependencies,e.manifest.resolvedExtensions.flatMap(e=>e.externalDependencies));r.length>0&&(n={...n,build:{...n.build,externalDependencies:r}});let a=finalizeNodeSourceState(t,r);assertInstrumentationLayoutConfig(n,a);let o=await this.compileResources(e,a),s=await this.compileChildren(e,a,r),c=createCompiledAgentNodeManifest({...o,config:n,remoteAgents:s.remoteAgents});return{descendants:s.nodes,manifest:c}}async compileChildren(e,t,n){let r=[],s=[],c=collectSelectedSourceIds(t.composed),l=t.projected.subagents.filter(e=>c.has(e.candidate.sourceId));for(let t of l){let c=t.source,l=createCompiledSubagentNodeId(e.nodeId,c.sourceId),u={extensionScope:t.extensionScope??e.extensionScope,inheritedExternalDependencies:n,isRoot:!1,layer:t.candidate.layer,manifest:c.manifest,nodeId:l,owner:t.owner,parentNodeId:e.nodeId},d=await this.createPhaseOneNodeSourceState(u,n),f=normalizeSubagentConfig(d.selectedConfig.definition,`Expected the subagent config export "${d.selectedConfig.source.exportName??`default`}" from "${c.entryPath}" to match the public eve shape.`);if(f.kind===`remote`){assertRemoteAgentDefinitionHasNoLocalPackageEntries(c),s.push(createCompiledRemoteAgent({binding:d.selectedConfig.binding,definition:f,nodeId:l,owner:t.owner,parentNodeId:e.nodeId,source:c,sourceRef:d.selectedConfig.source}));continue}let p,m;f.kind===`local`?(p=await compileAgentConfig(c.manifest,this.context,{binding:d.selectedConfig.binding,definition:f.definition,source:d.selectedConfig.source}),assertRootOnlyConfig(p,!1,c.manifest.agentId)):m=f.build?.externalDependencies;let h=mergeExternalDependencies(n,p?.build?.externalDependencies,m,c.manifest.resolvedExtensions.flatMap(e=>e.externalDependencies));p!==void 0&&h.length>0&&(p={...p,build:{...p.build,externalDependencies:h}});let g=finalizeNodeSourceState(d,h);p!==void 0&&assertInstrumentationLayoutConfig(p,g);let _=await this.compileResources(u,g),v=await this.compileChildren(u,g,h),b={backing:t.candidate.backing,entryPath:c.entryPath,logicalPath:c.logicalPath,name:c.subagentId,nodeId:l,owner:t.owner,parentNodeId:e.nodeId,rootPath:c.rootPath,sourceId:c.sourceId,sourceKind:`module`},x;x=p===void 0?{...b,agent:createCompiledAgentResources({..._,remoteAgents:v.remoteAgents}),configResolver:{build:f.kind===`dynamic`?f.build:void 0,eventNames:f.kind===`dynamic`?f.eventNames:[],exportName:d.selectedConfig.source.exportName,logicalPath:d.selectedConfig.source.logicalPath,sourceId:d.selectedConfig.source.sourceId,sourceKind:`module`}}:{...b,agent:createCompiledAgentNodeManifest({..._,config:p,remoteAgents:v.remoteAgents}),description:expectSubagentDescription(p,c)},r.push(x,...v.nodes)}return{nodes:r,remoteAgents:s}}composeNodeSources(e,t){let n=projectAgentSources({externalDependencies:t,extensionScope:e.extensionScope,layer:e.layer,manifest:e.manifest,nodeId:e.nodeId,owner:e.owner}),r=[],i=[];for(let t of this.registries){let n=t===frameworkAgentSourceRegistry;for(let a of t.registrations){if(a.applyTo===`root`&&!e.isRoot)continue;!n&&a.applyTo===`all-local-nodes`&&assertApplicationOverlayCanApplyToAllNodes(a.source.modules.map(e=>e.logicalPath));let t=createProgrammaticModuleCandidates({layer:n?`framework-default`:`application`,nodeId:e.nodeId,owner:n?{feature:a.source.id,kind:`framework`}:{kind:`application`},registration:a});(n?r:i).push(...t)}}let a=[...n.candidates,...i].filter(e=>e.backing.kind!==`resource`&&(canonicalSourceSlot(e.logicalPath)===`memory`||canonicalSourceSlot(e.logicalPath).startsWith(`memory/`))).map(e=>{let t=deriveMemorySlot(e.logicalPath);return instantiateProgrammaticTemplate({anchor:e,dependencies:{memory:e},logicalPath:`tools/${t}.ts`,owner:{feature:`memory`,kind:`framework`},parameters:{memoryExportName:e.exportName??`default`,memoryLogicalPath:e.logicalPath,slot:t},template:memoryWrapperTemplate})}),o=[...r,...n.candidates,...a,...i],s=composeAgentModuleCandidates(o),u=projectSelectedSources({candidates:s.selected.values(),resources:n.resources});return{composed:s,orderedCandidates:o,projected:n,sourcesBySourceId:new Map(u.map(e=>[e.candidate.sourceId,e])),subagentsBySourceId:new Map(n.subagents.map(e=>[e.candidate.sourceId,e]))}}async createPhaseOneNodeSourceState(e,t){let n=this.composeNodeSources(e,t);return{graph:n,selectedConfig:await this.loadSelectedConfig(n)}}async loadSelectedConfig(e){let n=e.composed.selected.get(`agent`);if(n===void 0||!isModuleCandidate(n))throw Error(`Every local agent node requires a selected module-backed agent.ts source.`);let r=createCompiledModuleBinding(n),i=e.sourcesBySourceId.get(n.sourceId);if(i?.source.sourceKind!==`module`)throw Error(`Selected agent config source "${n.sourceId}" was not projected.`);let a=i.source;return{binding:r,candidate:n,definition:await loadModuleBackedDefinition({binding:r,kind:`agent config`,loadNamespace:createCompiledBindingNamespaceLoader({bindings:{[n.sourceId]:r},registries:this.registries}),source:a}),source:a}}async compileResources(n,r){let i=[],o=[],c=[],l=[],u=[],d=[],m=[],h=[],g=[],_=[],y=[],S,C,w,T,E=collectSelectedSourceIds(r.composed),D=createCompiledBindingNamespaceLoader({bindings:r.bindings,registries:this.registries});for(let t of r.orderedCandidates){if(!E.has(t.sourceId))continue;let a=r.sourcesBySourceId.get(t.sourceId);if(a===void 0)continue;let s=r.bindings[t.sourceId],f={binding:s,loadNamespace:D,owner:t.owner};switch(a.kind){case`config`:case`extension`:break;case`channel`:{let i=await compileChannelDefinition(n.manifest.agentRoot,a.source,{binding:s,loadNamespace:D});i.kind===`disabled`?(r.composed=disableComposedCandidate({candidate:t,composed:r.composed}),delete r.bindings[t.sourceId],E.delete(t.sourceId)):y.push(...i.definitions);break}case`connection`:m.push(await compileConnectionDefinition(n.manifest.agentRoot,a.source,{binding:s,loadNamespace:D}));break;case`hook`:g.push(await compileHookEntry(a.source,{binding:s,loadNamespace:D}));break;case`instructions`:{let e=await compileInstructionsEntry(n.manifest.agentRoot,a.source,f);e.kind===`instructions`?u.push(e.definition):d.push(e.definition);break}case`instrumentation`:C=a.source;break;case`memory`:h.push(await compileMemoryDefinition(a.source,{binding:s,loadNamespace:D}));break;case`sandbox`:S=await compileSandboxDefinition(n.manifest.agentRoot,a.source,{binding:s,loadNamespace:D});break;case`schedule`:_.push(await compileScheduleDefinition(n.manifest.agentRoot,a.source,f));break;case`skill`:{let e=await compileSkillSource(n.manifest.agentRoot,a.source,f);e.kind===`skill`?c.push(e.definition):l.push(withExtensionNamespace(e.definition,t.owner));break}case`tool`:{let e=await compileToolEntry(n.manifest.agentRoot,a.source,{binding:s,loadNamespace:D});e.kind===`disabled`?(r.composed=disableComposedCandidate({candidate:t,composed:r.composed}),delete r.bindings[t.sourceId],E.delete(t.sourceId)):e.kind===`tool`?i.push(e.definition):e.kind===`dynamic-tool`?o.push(withExtensionNamespace(e.definition,t.owner)):e.kind===`workflow-tool`?(assertRootOwnedSpecialTool(t,`Workflow`),w={...a.source,maxSubagents:e.maxSubagents}):(assertNonExtensionSpecialTool(t,`Web search`),i.push(e.definition),T=e.provider);break}}}if(S===void 0)throw Error(`Agent node "${n.nodeId}" has no selected sandbox source.`);assertUniqueBy(i,e=>e.name,`tool name`),assertUniqueBy(o,e=>e.slug,`dynamic tool slug`),assertUniqueBy(m,e=>e.connectionName,`connection name`),assertUniqueBy(c,e=>e.name,`skill name`);let O=createCompiledChannelRoutePlan({bindings:r.bindings,channels:y,diagnostics:this.diagnostics,nodeId:n.nodeId,sources:Object.fromEntries(r.orderedCandidates.map(e=>[e.sourceId,describeAgentSourceCandidate(e)]))});return createCompiledAgentResources({agentRoot:n.manifest.agentRoot,appRoot:n.manifest.appRoot,bindings:r.bindings,channelRoutes:O,connections:m,diagnosticsSummary:summarizeCompilerDiagnostics(this.diagnostics),dynamicInstructions:d,dynamicSkills:l,dynamicTools:o,extensionMounts:compileExtensionMounts(n.manifest,r.composed),hooks:g,memories:h,instructions:u,instrumentation:C,sandbox:S,sandboxWorkspaces:n.manifest.sandboxWorkspaces.map(e=>({logicalPath:e.logicalPath,rootEntries:[...e.rootEntries],sourceId:e.sourceId,sourcePath:e.sourcePath})),schedules:_,skills:c,sourceComposition:r.composed.composition,tools:i,webSearchProvider:T,workflowTool:w})}};function isModuleCandidate(e){return e.backing.kind!==`resource`}function assertInstrumentationLayoutConfig(e,t){if(e.experimental?.instrumentationProviders===!0&&t.composed.selected.has(`instrumentation`))throw Error(`A selected instrumentation.ts source cannot be used with experimental.instrumentationProviders. Move the declaration into the instrumentation/ provider directory.`)}export{compileAgentManifest};
|
|
1
|
+
import{compileChannelDefinition}from"#compiler/normalize-channel.js";import{ROOT_COMPILED_AGENT_NODE_ID,createCompiledAgentManifest,createCompiledAgentNodeManifest,createCompiledAgentResources,createCompiledSubagentNodeId}from"#compiler/manifest.js";import{summarizeCompilerDiagnostics}from"#compiler/diagnostics.js";import{canonicalSourceSlot,composeAgentModuleCandidates,createAgentModuleBinding,createProgrammaticModuleCandidates,describeAgentSourceCandidate,disableComposedCandidate,instantiateProgrammaticTemplate,isAgentModuleCandidate}from"#compiler/source-graph.js";import{frameworkAgentSourceRegistry,memoryWrapperTemplate}from"#framework/sources/registry.js";import{assertApplicationOverlayCanApplyToAllNodes,assertNonExtensionSpecialTool,assertRootOnlyConfig,assertRootOwnedSpecialTool,assertUniqueBy,assertUniqueRegistryIds,collectSelectedSourceIds,compileExtensionMounts,createCompiledRemoteAgent,expectSubagentDescription,mergeExternalDependencies,withExtensionNamespace}from"#compiler/normalize-manifest-helpers.js";import{loadModuleBackedDefinition}from"#compiler/normalize-helpers.js";import{assertRemoteAgentDefinitionHasNoLocalPackageEntries,normalizeSubagentConfig}from"#compiler/normalize-subagent.js";import{createCompiledRuntimeModelCatalogLoader}from"#compiler/model-catalog.js";import{NodeModuleEvaluationContext,markConfigRuntimeEntries}from"#compiler/module-lifecycle.js";import{assertInstrumentationLayoutConfig}from"#compiler/instrumentation-layout-config.js";import{compileAgentConfig}from"#compiler/normalize-agent-config.js";import{compileConnectionDefinition}from"#compiler/normalize-connection.js";import{compileHookEntry}from"#compiler/normalize-hook.js";import{compileInstructionsEntry}from"#compiler/normalize-instructions.js";import{compileMemoryDefinition,deriveMemorySlot}from"#compiler/normalize-memory.js";import{compileSandboxDefinition}from"#compiler/normalize-sandbox.js";import{compileScheduleDefinition}from"#compiler/normalize-schedule.js";import{compileSkillSource}from"#compiler/normalize-skill.js";import{compileToolEntry}from"#compiler/normalize-tool.js";import{createCompiledChannelRoutePlan}from"#compiler/channel-route-plan.js";import{finalizeNodeSourceState}from"#compiler/node-source-state.js";import{projectAgentSources,projectSelectedSources}from"#compiler/project-sources.js";async function compileAgentManifest(e,r={}){let i=[frameworkAgentSourceRegistry,...r.sourceRegistries??[]];assertUniqueRegistryIds(i);let a={modelCatalog:createCompiledRuntimeModelCatalogLoader(e.appRoot),registries:i},s=r.diagnostics??[],c=await new AgentGraphCompiler(a,i,s).compileStaticNode({inheritedExternalDependencies:[],isRoot:!0,layer:`application`,manifest:e,nodeId:ROOT_COMPILED_AGENT_NODE_ID,owner:{kind:`application`}}),l=[c.manifest,...c.descendants.map(e=>e.agent)].flatMap(e=>e.tools).find(e=>e.execution===`background`);if(l!==void 0&&c.manifest.config.experimental?.tasks!==!0)throw Error(`Background tool "${l.name}" requires experimental.tasks: true in the root agent config.`);let u=summarizeCompilerDiagnostics(s),d=c.descendants.map(e=>(e.configResolver,{...e,agent:{...e.agent,diagnosticsSummary:u}}));return createCompiledAgentManifest({...c.manifest,diagnosticsSummary:u,subagents:d})}var AgentGraphCompiler=class{context;registries;diagnostics;constructor(e,t,n){this.context=e,this.registries=t,this.diagnostics=n}async compileStaticNode(e){let t=await this.createPhaseOneNodeSourceState(e,e.inheritedExternalDependencies),n=await compileAgentConfig(e.manifest,this.context,{binding:t.selectedConfig.binding,definition:t.selectedConfig.definition,source:t.selectedConfig.source});assertRootOnlyConfig(n,e.isRoot,e.manifest.agentId);let i=mergeExternalDependencies(e.inheritedExternalDependencies,n.build?.externalDependencies,e.manifest.resolvedExtensions.flatMap(e=>e.externalDependencies));i.length>0&&(n={...n,build:{...n.build,externalDependencies:i}});let a=finalizeNodeSourceState(t,i);markConfigRuntimeEntries(n,a.evaluation),assertInstrumentationLayoutConfig(n,a);let o=await this.compileResources(e,a),s=await this.compileChildren(e,a,i),c=createCompiledAgentNodeManifest({...o,config:n,remoteAgents:s.remoteAgents});return{descendants:s.nodes,manifest:c}}async compileChildren(e,t,n){let o=[],s=[],c=collectSelectedSourceIds(t.composed),l=t.projected.subagents.filter(e=>c.has(e.candidate.sourceId));for(let t of l){let c=t.source,l=createCompiledSubagentNodeId(e.nodeId,c.sourceId),u={extensionScope:t.extensionScope??e.extensionScope,inheritedExternalDependencies:n,isRoot:!1,layer:t.candidate.layer,manifest:c.manifest,nodeId:l,owner:t.owner,parentNodeId:e.nodeId},d=await this.createPhaseOneNodeSourceState(u,n),f=normalizeSubagentConfig(d.selectedConfig.definition,`Expected the subagent config export "${d.selectedConfig.source.exportName??`default`}" from "${c.entryPath}" to match the public eve shape.`);if(f.kind===`remote`){assertRemoteAgentDefinitionHasNoLocalPackageEntries(c);let n=d.selectedConfig.source.sourceId;d.evaluation.setBindings({[n]:d.selectedConfig.binding}),d.evaluation.requireRuntimeEntry(n);let r=d.evaluation.finalizeBindings()[n];if(r===void 0)throw Error(`Remote subagent "${l}" has no finalized config binding.`);s.push(createCompiledRemoteAgent({binding:r,definition:f,nodeId:l,owner:t.owner,parentNodeId:e.nodeId,source:c,sourceRef:d.selectedConfig.source}));continue}let p,m;f.kind===`local`?(p=await compileAgentConfig(c.manifest,this.context,{binding:d.selectedConfig.binding,definition:f.definition,source:d.selectedConfig.source}),assertRootOnlyConfig(p,!1,c.manifest.agentId)):m=f.build?.externalDependencies;let h=mergeExternalDependencies(n,p?.build?.externalDependencies,m,c.manifest.resolvedExtensions.flatMap(e=>e.externalDependencies));p!==void 0&&h.length>0&&(p={...p,build:{...p.build,externalDependencies:h}});let g=finalizeNodeSourceState(d,h);p===void 0?g.evaluation.requireRuntimeEntry(d.selectedConfig.source.sourceId):markConfigRuntimeEntries(p,g.evaluation),p!==void 0&&assertInstrumentationLayoutConfig(p,g);let _=await this.compileResources(u,g),v=await this.compileChildren(u,g,h),b={backing:t.candidate.backing,entryPath:c.entryPath,logicalPath:c.logicalPath,name:c.subagentId,nodeId:l,owner:t.owner,parentNodeId:e.nodeId,rootPath:c.rootPath,sourceId:c.sourceId,sourceKind:`module`},x;x=p===void 0?{...b,agent:createCompiledAgentResources({..._,remoteAgents:v.remoteAgents}),configResolver:{build:f.kind===`dynamic`?f.build:void 0,eventNames:f.kind===`dynamic`?f.eventNames:[],exportName:d.selectedConfig.source.exportName,logicalPath:d.selectedConfig.source.logicalPath,sourceId:d.selectedConfig.source.sourceId,sourceKind:`module`}}:{...b,agent:createCompiledAgentNodeManifest({..._,config:p,remoteAgents:v.remoteAgents}),description:expectSubagentDescription(p,c)},o.push(x,...v.nodes)}return{nodes:o,remoteAgents:s}}composeNodeSources(e,t){let n=projectAgentSources({externalDependencies:t,extensionScope:e.extensionScope,layer:e.layer,manifest:e.manifest,nodeId:e.nodeId,owner:e.owner}),r=[],i=[];for(let t of this.registries){let n=t===frameworkAgentSourceRegistry;for(let a of t.registrations){if(a.applyTo===`root`&&!e.isRoot)continue;!n&&a.applyTo===`all-local-nodes`&&assertApplicationOverlayCanApplyToAllNodes(a.source.modules.map(e=>e.logicalPath));let t=createProgrammaticModuleCandidates({layer:n?`framework-default`:`application`,nodeId:e.nodeId,owner:n?{feature:a.source.id,kind:`framework`}:{kind:`application`},registration:a});(n?r:i).push(...t)}}let a=[...n.candidates,...i].filter(e=>e.backing.kind!==`resource`&&(canonicalSourceSlot(e.logicalPath)===`memory`||canonicalSourceSlot(e.logicalPath).startsWith(`memory/`))).map(e=>{let t=deriveMemorySlot(e.logicalPath);return instantiateProgrammaticTemplate({anchor:e,dependencies:{memory:e},logicalPath:`tools/${t}.ts`,owner:{feature:`memory`,kind:`framework`},parameters:{memoryExportName:e.exportName??`default`,memoryLogicalPath:e.logicalPath,slot:t},template:memoryWrapperTemplate})}),o=[...r,...n.candidates,...a,...i],l=composeAgentModuleCandidates(o),d=projectSelectedSources({candidates:l.selected.values(),resources:n.resources});return{composed:l,orderedCandidates:o,projected:n,sourcesBySourceId:new Map(d.map(e=>[e.candidate.sourceId,e])),subagentsBySourceId:new Map(n.subagents.map(e=>[e.candidate.sourceId,e]))}}async createPhaseOneNodeSourceState(e,t){let n=this.composeNodeSources(e,t),r=new NodeModuleEvaluationContext(this.registries);return r.setBindings(Object.fromEntries([...n.composed.selected.values()].filter(isAgentModuleCandidate).map(e=>[e.sourceId,createAgentModuleBinding(e)]))),{evaluation:r,graph:n,selectedConfig:await this.loadSelectedConfig(n,r)}}async loadSelectedConfig(e,t){let n=e.composed.selected.get(`agent`);if(n===void 0||!isAgentModuleCandidate(n))throw Error(`Every local agent node requires a selected module-backed agent.ts source.`);let r=createAgentModuleBinding(n),i=e.sourcesBySourceId.get(n.sourceId);if(i?.source.sourceKind!==`module`)throw Error(`Selected agent config source "${n.sourceId}" was not projected.`);let a=i.source;return{binding:r,candidate:n,definition:await loadModuleBackedDefinition({binding:r,kind:`agent config`,loadNamespace:t.loadNamespace,source:a}),source:a}}async compileResources(t,n){let r=[],a=[],s=[],c=[],l=[],u=[],p=[],m=[],h=[],g=[],_=[],y,S,C,w,T=collectSelectedSourceIds(n.composed),E=n.evaluation.loadNamespace;for(let i of n.orderedCandidates){if(!T.has(i.sourceId))continue;let o=n.sourcesBySourceId.get(i.sourceId);if(o===void 0)continue;let d=n.bindings[i.sourceId],x={binding:d,loadNamespace:E,owner:i.owner};switch(o.kind){case`config`:case`extension`:break;case`channel`:{let r=await compileChannelDefinition(t.manifest.agentRoot,o.source,{binding:d,loadNamespace:E});r.kind===`disabled`?(n.composed=disableComposedCandidate({candidate:i,composed:n.composed}),delete n.bindings[i.sourceId],T.delete(i.sourceId)):_.push(...r.definitions);break}case`connection`:p.push(await compileConnectionDefinition(t.manifest.agentRoot,o.source,{binding:d,loadNamespace:E})),n.evaluation.requireRuntimeEntry(i.sourceId);break;case`hook`:h.push(await compileHookEntry(o.source,{binding:d,loadNamespace:E})),n.evaluation.requireRuntimeEntry(i.sourceId);break;case`instructions`:{let e=await compileInstructionsEntry(t.manifest.agentRoot,o.source,x);e.kind===`instructions`?l.push(e.definition):(u.push(e.definition),n.evaluation.requireRuntimeEntry(i.sourceId));break}case`instrumentation`:S=o.source,n.evaluation.requireRuntimeEntry(i.sourceId);break;case`memory`:m.push(await compileMemoryDefinition(o.source,{binding:d,loadNamespace:E})),n.evaluation.requireRuntimeEntry(i.sourceId);break;case`sandbox`:y=await compileSandboxDefinition(t.manifest.agentRoot,o.source,{binding:d,loadNamespace:E}),y.inheritsParent||n.evaluation.requireRuntimeEntry(i.sourceId);break;case`schedule`:{let e=await compileScheduleDefinition(t.manifest.agentRoot,o.source,x);g.push(e),e.sourceKind===`module`&&e.hasRun&&n.evaluation.requireRuntimeEntry(i.sourceId);break}case`skill`:{let e=await compileSkillSource(t.manifest.agentRoot,o.source,x);e.kind===`skill`?s.push(e.definition):(c.push(withExtensionNamespace(e.definition,i.owner)),n.evaluation.requireRuntimeEntry(i.sourceId));break}case`tool`:{let e=await compileToolEntry(t.manifest.agentRoot,o.source,{binding:d,loadNamespace:E});e.kind===`disabled`?(n.composed=disableComposedCandidate({candidate:i,composed:n.composed}),delete n.bindings[i.sourceId],T.delete(i.sourceId)):e.kind===`tool`?(r.push(e.definition),n.evaluation.requireRuntimeEntry(i.sourceId)):e.kind===`dynamic-tool`?(a.push(withExtensionNamespace(e.definition,i.owner)),n.evaluation.requireRuntimeEntry(i.sourceId)):e.kind===`workflow-tool`?(assertRootOwnedSpecialTool(i,`Workflow`),C={...o.source,maxSubagents:e.maxSubagents}):(assertNonExtensionSpecialTool(i,`Web search`),r.push(e.definition),w=e.provider);break}}}if(y===void 0)throw Error(`Agent node "${t.nodeId}" has no selected sandbox source.`);assertUniqueBy(r,e=>e.name,`tool name`),assertUniqueBy(a,e=>e.slug,`dynamic tool slug`),assertUniqueBy(p,e=>e.connectionName,`connection name`),assertUniqueBy(s,e=>e.name,`skill name`);let D=createCompiledChannelRoutePlan({bindings:n.bindings,channels:_,diagnostics:this.diagnostics,nodeId:t.nodeId,sources:Object.fromEntries(n.orderedCandidates.map(e=>[e.sourceId,describeAgentSourceCandidate(e)]))});for(let e of D.effective)n.evaluation.requireRuntimeEntry(e.sourceId);let O=compileExtensionMounts(t.manifest,n.composed);for(let e of O)n.evaluation.requireRuntimeEntry(e.mountSourceId);let k=n.evaluation.finalizeBindings();return createCompiledAgentResources({agentRoot:t.manifest.agentRoot,appRoot:t.manifest.appRoot,bindings:k,channelRoutes:D,connections:p,diagnosticsSummary:summarizeCompilerDiagnostics(this.diagnostics),dynamicInstructions:u,dynamicSkills:c,dynamicTools:a,extensionMounts:O,hooks:h,memories:m,instructions:l,instrumentation:S,sandbox:y,sandboxWorkspaces:t.manifest.sandboxWorkspaces.map(e=>({logicalPath:e.logicalPath,rootEntries:[...e.rootEntries],sourceId:e.sourceId,sourcePath:e.sourcePath})),schedules:g,skills:s,sourceComposition:n.composed.composition,tools:r,webSearchProvider:w,workflowTool:C})}};export{compileAgentManifest};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z}from"#compiled/zod/index.js";import{jsonObjectSchema}from"#shared/json-schemas.js";const compiledRemoteAgentNodeSchema=z.object({backing:z.object({kind:z.literal(`resource`),sourcePath:z.string()}).strict(),binding:z.object({backing:z.discriminatedUnion(`kind`,[z.object({externalDependencies:z.array(z.string()).readonly(),extensionScope:z.object({namespace:z.string(),sourceRoot:z.string()}).strict().optional(),kind:z.literal(`filesystem`),sourcePath:z.string()}).strict(),z.object({kind:z.literal(`programmatic`),moduleId:z.string(),registryId:z.string(),revision:z.string(),semanticRevision:z.string().optional()}).strict()]),logicalPath:z.string(),owner:z.discriminatedUnion(`kind`,[z.object({kind:z.literal(`application`)}).strict(),z.object({feature:z.string(),kind:z.literal(`framework`)}).strict(),z.object({kind:z.literal(`extension`),namespace:z.string(),packageName:z.string()}).strict()])}).strict(),description:z.string(),entryPath:z.string(),exportName:z.string().optional(),logicalPath:z.string(),name:z.string(),nodeId:z.string(),owner:z.discriminatedUnion(`kind`,[z.object({kind:z.literal(`application`)}).strict(),z.object({feature:z.string(),kind:z.literal(`framework`)}).strict(),z.object({kind:z.literal(`extension`),namespace:z.string(),packageName:z.string()}).strict()]),parentNodeId:z.string(),outputSchema:jsonObjectSchema.optional(),path:z.string(),rootPath:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`),url:z.string().optional()}).strict();export{compiledRemoteAgentNodeSchema};
|
|
1
|
+
import{z}from"#compiled/zod/index.js";import{jsonObjectSchema}from"#shared/json-schemas.js";const compiledRemoteAgentNodeSchema=z.object({backing:z.object({kind:z.literal(`resource`),sourcePath:z.string()}).strict(),binding:z.object({backing:z.discriminatedUnion(`kind`,[z.object({externalDependencies:z.array(z.string()).readonly(),extensionScope:z.object({namespace:z.string(),sourceRoot:z.string()}).strict().optional(),kind:z.literal(`filesystem`),sourcePath:z.string()}).strict(),z.object({kind:z.literal(`programmatic`),moduleId:z.string(),registryId:z.string(),revision:z.string(),semanticRevision:z.string().optional()}).strict()]),logicalPath:z.string(),owner:z.discriminatedUnion(`kind`,[z.object({kind:z.literal(`application`)}).strict(),z.object({feature:z.string(),kind:z.literal(`framework`)}).strict(),z.object({kind:z.literal(`extension`),namespace:z.string(),packageName:z.string()}).strict()]),usage:z.object({compile:z.boolean(),runtimeEntry:z.boolean()}).strict()}).strict(),description:z.string(),entryPath:z.string(),exportName:z.string().optional(),logicalPath:z.string(),name:z.string(),nodeId:z.string(),owner:z.discriminatedUnion(`kind`,[z.object({kind:z.literal(`application`)}).strict(),z.object({feature:z.string(),kind:z.literal(`framework`)}).strict(),z.object({kind:z.literal(`extension`),namespace:z.string(),packageName:z.string()}).strict()]),parentNodeId:z.string(),outputSchema:jsonObjectSchema.optional(),path:z.string(),rootPath:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`),url:z.string().optional()}).strict();export{compiledRemoteAgentNodeSchema};
|
|
@@ -76,11 +76,20 @@ export interface AgentModuleCandidate {
|
|
|
76
76
|
readonly owner: AgentSourceOwner;
|
|
77
77
|
readonly sourceId: string;
|
|
78
78
|
}
|
|
79
|
-
export interface
|
|
79
|
+
export interface AgentModuleBinding {
|
|
80
80
|
readonly backing: AgentModuleBacking;
|
|
81
81
|
readonly logicalPath: string;
|
|
82
82
|
readonly owner: AgentSourceOwner;
|
|
83
83
|
}
|
|
84
|
+
export interface CompiledModuleBinding extends AgentModuleBinding {
|
|
85
|
+
/** Compiler-owned namespace usage for this selected binding. */
|
|
86
|
+
readonly usage: {
|
|
87
|
+
/** The compiler evaluated this namespace while normalizing the node. */
|
|
88
|
+
readonly compile: boolean;
|
|
89
|
+
/** The namespace is an entry in the runtime module map. */
|
|
90
|
+
readonly runtimeEntry: boolean;
|
|
91
|
+
};
|
|
92
|
+
}
|
|
84
93
|
export interface AgentSourceDescriptor {
|
|
85
94
|
readonly backing: AgentSourceBacking;
|
|
86
95
|
readonly form: AgentSourceForm;
|
|
@@ -101,6 +110,7 @@ export interface AgentResourceCandidate {
|
|
|
101
110
|
readonly sourceId: string;
|
|
102
111
|
}
|
|
103
112
|
export type AgentSourceCandidate = AgentModuleCandidate | AgentResourceCandidate;
|
|
113
|
+
export declare function isAgentModuleCandidate(candidate: AgentSourceCandidate): candidate is AgentModuleCandidate;
|
|
104
114
|
export type AgentSourceCompositionEntry = {
|
|
105
115
|
readonly kind: "shadowed";
|
|
106
116
|
readonly source: AgentSourceDescriptor;
|
|
@@ -137,7 +147,7 @@ export declare function disableComposedCandidate(input: {
|
|
|
137
147
|
readonly candidate: AgentSourceCandidate;
|
|
138
148
|
readonly composed: ComposedAgentModuleCandidates;
|
|
139
149
|
}): ComposedAgentModuleCandidates;
|
|
140
|
-
export declare function
|
|
150
|
+
export declare function createAgentModuleBinding(candidate: AgentModuleCandidate): AgentModuleBinding;
|
|
141
151
|
export declare function loadProgrammaticModuleNamespace(input: {
|
|
142
152
|
readonly backing: Extract<AgentModuleBacking, {
|
|
143
153
|
readonly kind: "programmatic";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isAbsolute,posix}from"node:path";import{getSupportedModuleBaseName,normalizeLogicalPath,stripLogicalPathExtension}from"#discover/filesystem.js";import{parseJsonObject}from"#shared/json.js";function memoizeModuleNamespaceFactories(e){return Object.freeze(Object.fromEntries(Object.entries(e).map(([e,t])=>{if(typeof t!=`function`)return[e,t];let n;return[e,new Proxy(t,{apply(e,t,r){return r.length>0?Reflect.apply(e,t,r):(n??=Promise.resolve().then(()=>Reflect.apply(e,t,r)),n)}})]})))}var ImmutableProgrammaticSourceMap=class{#e;constructor(e){this.#e=new Map(e),Object.freeze(this)}get size(){return this.#e.size}get[Symbol.toStringTag](){return`ImmutableProgrammaticSourceMap`}[Symbol.iterator](){return this.#e[Symbol.iterator]()}entries(){return this.#e.entries()}forEach(e,t){this.#e.forEach((n,r)=>e.call(t,n,r,this))}get(e){return this.#e.get(e)}has(e){return this.#e.has(e)}keys(){return this.#e.keys()}values(){return this.#e.values()}};const LAYER_PRECEDENCE={"framework-default":0,"extension-package":1,"extension-override":2,application:3},FORM_PRECEDENCE={derived:0,direct:1},registeredProgrammaticTemplates=new WeakSet;function defineProgrammaticAgentSource(e){let t=expectNonEmpty(e.id,`Programmatic agent source id`),n=expectNonEmpty(e.revision,`Programmatic agent source "${t}" revision`),r=new Set,i=e.modules.map(e=>{let n=validateProgrammaticLogicalPath(e.logicalPath);if(r.has(n))throw Error(`Programmatic agent source "${t}" declares "${n}" more than once.`);r.add(n);let i=e.semanticRevision===void 0?void 0:expectNonEmpty(e.semanticRevision,`Programmatic module "${t}:${n}" semanticRevision`);return Object.freeze({exportName:e.exportName,loadNamespace:e.loadNamespace,logicalPath:n,semanticRevision:i})});return Object.freeze({id:t,modules:Object.freeze(i),revision:n})}function createAgentSourceRegistry(e,t={}){let n=new Map,r=new Map,addSource=e=>{let t=defineProgrammaticAgentSource(e);if(n.has(t.id))throw Error(`Programmatic agent source id "${t.id}" is registered more than once.`);return n.set(t.id,t),t},i=e.map(e=>{let t=addSource(e.source);return Object.freeze({applyTo:e.applyTo,source:t})});for(let e of t.templates??[]){let t=addSource(e);if(t.modules.length!==1)throw Error(`Programmatic template source "${t.id}" must register exactly one module.`);let n=Object.freeze({module:t.modules[0],source:t});registeredProgrammaticTemplates.add(n),r.set(t.id,n)}return Object.freeze({registrations:Object.freeze(i),sources:new ImmutableProgrammaticSourceMap(n),templates:new ImmutableProgrammaticSourceMap(r)})}function createProgrammaticModuleCandidates(e){return e.registration.source.modules.map(t=>{let n=`${e.registration.source.id}:${t.logicalPath}`;return Object.freeze({backing:Object.freeze({kind:`programmatic`,moduleId:t.logicalPath,registryId:e.registration.source.id,revision:e.registration.source.revision,semanticRevision:t.semanticRevision}),exportName:t.exportName,form:`direct`,layer:e.layer,logicalPath:t.logicalPath,nodeId:e.nodeId,owner:e.owner,sourceId:n})})}function instantiateProgrammaticTemplate(e){if(!registeredProgrammaticTemplates.has(e.template))throw Error(`Derived programmatic modules require a registered template.`);let t=validateProgrammaticLogicalPath(e.logicalPath),n=expectNonEmpty(e.anchor.sourceId,`Derived programmatic module anchor source id`),r=`${e.template.source.id}:${t}:from:${n}`;if(!Object.values(e.dependencies).some(e=>e.sourceId===n))throw Error(`Derived programmatic module "${r}" must include its anchor source as a dependency.`);let i=Object.freeze(Object.fromEntries(Object.entries(e.dependencies).sort(([e],[t])=>e.localeCompare(t)).map(([t,n])=>{if(expectNonEmpty(t,`Derived programmatic module dependency alias`),n.nodeId!==e.anchor.nodeId)throw Error(`Derived programmatic module "${r}" cannot depend on source "${n.sourceId}" from another node.`);return[t,n.sourceId]}))),o=Object.freeze(parseJsonObject(e.parameters??{}));return Object.freeze({backing:Object.freeze({dependencies:i,kind:`programmatic`,moduleId:e.template.module.logicalPath,parameters:o,registryId:e.template.source.id,revision:e.template.source.revision,semanticRevision:e.template.module.semanticRevision}),exportName:e.template.module.exportName,form:`derived`,layer:e.anchor.layer,logicalPath:t,nodeId:e.anchor.nodeId,owner:e.owner,sourceId:r})}function composeAgentModuleCandidates(e){let t=new Map,n=new Set;for(let r of e){if(n.has(r.sourceId))throw Error(`Agent source id "${r.sourceId}" is declared more than once in node "${r.nodeId}".`);n.add(r.sourceId);let e=canonicalSourceSlot(r.logicalPath),i=t.get(e)??[];i.push(r),t.set(e,i)}let r=new Map,i=[];for(let[e,n]of[...t].sort(([e],[t])=>e.localeCompare(t))){let t=new Set;for(let r of n){let n=`${r.layer}:${r.form}`;if(t.has(n))throw Error(`Agent source slot "${e}" has more than one ${r.layer} ${r.form} candidate.`);t.add(n)}let a=[...n].sort((e,t)=>LAYER_PRECEDENCE[t.layer]-LAYER_PRECEDENCE[e.layer]||FORM_PRECEDENCE[t.form]-FORM_PRECEDENCE[e.form]),c=a[0];r.set(e,c);for(let e of a.slice(1))i.push({kind:`shadowed`,source:describeAgentSourceCandidate(e),winnerSourceId:c.sourceId})}return validateSelectedCandidateDependencies(r),{composition:{entries:Object.freeze(i)},selected:r}}function disableComposedCandidate(e){let t=canonicalSourceSlot(e.candidate.logicalPath),n=new Map(e.composed.selected);if(n.get(t)?.sourceId!==e.candidate.sourceId)throw Error(`Only the selected source for "${t}" can disable that slot.`);if(!e.composed.composition.entries.some(t=>t.kind===`shadowed`&&t.winnerSourceId===e.candidate.sourceId))throw Error(`Source "${e.candidate.logicalPath}" disables a slot with no lower-precedence source.`);return n.delete(t),{composition:{entries:Object.freeze([...e.composed.composition.entries,{kind:`disabled`,source:describeAgentSourceCandidate(e.candidate)}])},selected:n}}function
|
|
1
|
+
import{isAbsolute,posix}from"node:path";import{getSupportedModuleBaseName,normalizeLogicalPath,stripLogicalPathExtension}from"#discover/filesystem.js";import{parseJsonObject}from"#shared/json.js";function memoizeModuleNamespaceFactories(e){return Object.freeze(Object.fromEntries(Object.entries(e).map(([e,t])=>{if(typeof t!=`function`)return[e,t];let n;return[e,new Proxy(t,{apply(e,t,r){return r.length>0?Reflect.apply(e,t,r):(n??=Promise.resolve().then(()=>Reflect.apply(e,t,r)),n)}})]})))}var ImmutableProgrammaticSourceMap=class{#e;constructor(e){this.#e=new Map(e),Object.freeze(this)}get size(){return this.#e.size}get[Symbol.toStringTag](){return`ImmutableProgrammaticSourceMap`}[Symbol.iterator](){return this.#e[Symbol.iterator]()}entries(){return this.#e.entries()}forEach(e,t){this.#e.forEach((n,r)=>e.call(t,n,r,this))}get(e){return this.#e.get(e)}has(e){return this.#e.has(e)}keys(){return this.#e.keys()}values(){return this.#e.values()}};function isAgentModuleCandidate(e){return e.backing.kind!==`resource`}const LAYER_PRECEDENCE={"framework-default":0,"extension-package":1,"extension-override":2,application:3},FORM_PRECEDENCE={derived:0,direct:1},registeredProgrammaticTemplates=new WeakSet;function defineProgrammaticAgentSource(e){let t=expectNonEmpty(e.id,`Programmatic agent source id`),n=expectNonEmpty(e.revision,`Programmatic agent source "${t}" revision`),r=new Set,i=e.modules.map(e=>{let n=validateProgrammaticLogicalPath(e.logicalPath);if(r.has(n))throw Error(`Programmatic agent source "${t}" declares "${n}" more than once.`);r.add(n);let i=e.semanticRevision===void 0?void 0:expectNonEmpty(e.semanticRevision,`Programmatic module "${t}:${n}" semanticRevision`);return Object.freeze({exportName:e.exportName,loadNamespace:e.loadNamespace,logicalPath:n,semanticRevision:i})});return Object.freeze({id:t,modules:Object.freeze(i),revision:n})}function createAgentSourceRegistry(e,t={}){let n=new Map,r=new Map,addSource=e=>{let t=defineProgrammaticAgentSource(e);if(n.has(t.id))throw Error(`Programmatic agent source id "${t.id}" is registered more than once.`);return n.set(t.id,t),t},i=e.map(e=>{let t=addSource(e.source);return Object.freeze({applyTo:e.applyTo,source:t})});for(let e of t.templates??[]){let t=addSource(e);if(t.modules.length!==1)throw Error(`Programmatic template source "${t.id}" must register exactly one module.`);let n=Object.freeze({module:t.modules[0],source:t});registeredProgrammaticTemplates.add(n),r.set(t.id,n)}return Object.freeze({registrations:Object.freeze(i),sources:new ImmutableProgrammaticSourceMap(n),templates:new ImmutableProgrammaticSourceMap(r)})}function createProgrammaticModuleCandidates(e){return e.registration.source.modules.map(t=>{let n=`${e.registration.source.id}:${t.logicalPath}`;return Object.freeze({backing:Object.freeze({kind:`programmatic`,moduleId:t.logicalPath,registryId:e.registration.source.id,revision:e.registration.source.revision,semanticRevision:t.semanticRevision}),exportName:t.exportName,form:`direct`,layer:e.layer,logicalPath:t.logicalPath,nodeId:e.nodeId,owner:e.owner,sourceId:n})})}function instantiateProgrammaticTemplate(e){if(!registeredProgrammaticTemplates.has(e.template))throw Error(`Derived programmatic modules require a registered template.`);let t=validateProgrammaticLogicalPath(e.logicalPath),n=expectNonEmpty(e.anchor.sourceId,`Derived programmatic module anchor source id`),r=`${e.template.source.id}:${t}:from:${n}`;if(!Object.values(e.dependencies).some(e=>e.sourceId===n))throw Error(`Derived programmatic module "${r}" must include its anchor source as a dependency.`);let i=Object.freeze(Object.fromEntries(Object.entries(e.dependencies).sort(([e],[t])=>e.localeCompare(t)).map(([t,n])=>{if(expectNonEmpty(t,`Derived programmatic module dependency alias`),n.nodeId!==e.anchor.nodeId)throw Error(`Derived programmatic module "${r}" cannot depend on source "${n.sourceId}" from another node.`);return[t,n.sourceId]}))),o=Object.freeze(parseJsonObject(e.parameters??{}));return Object.freeze({backing:Object.freeze({dependencies:i,kind:`programmatic`,moduleId:e.template.module.logicalPath,parameters:o,registryId:e.template.source.id,revision:e.template.source.revision,semanticRevision:e.template.module.semanticRevision}),exportName:e.template.module.exportName,form:`derived`,layer:e.anchor.layer,logicalPath:t,nodeId:e.anchor.nodeId,owner:e.owner,sourceId:r})}function composeAgentModuleCandidates(e){let t=new Map,n=new Set;for(let r of e){if(n.has(r.sourceId))throw Error(`Agent source id "${r.sourceId}" is declared more than once in node "${r.nodeId}".`);n.add(r.sourceId);let e=canonicalSourceSlot(r.logicalPath),i=t.get(e)??[];i.push(r),t.set(e,i)}let r=new Map,i=[];for(let[e,n]of[...t].sort(([e],[t])=>e.localeCompare(t))){let t=new Set;for(let r of n){let n=`${r.layer}:${r.form}`;if(t.has(n))throw Error(`Agent source slot "${e}" has more than one ${r.layer} ${r.form} candidate.`);t.add(n)}let a=[...n].sort((e,t)=>LAYER_PRECEDENCE[t.layer]-LAYER_PRECEDENCE[e.layer]||FORM_PRECEDENCE[t.form]-FORM_PRECEDENCE[e.form]),c=a[0];r.set(e,c);for(let e of a.slice(1))i.push({kind:`shadowed`,source:describeAgentSourceCandidate(e),winnerSourceId:c.sourceId})}return validateSelectedCandidateDependencies(r),{composition:{entries:Object.freeze(i)},selected:r}}function disableComposedCandidate(e){let t=canonicalSourceSlot(e.candidate.logicalPath),n=new Map(e.composed.selected);if(n.get(t)?.sourceId!==e.candidate.sourceId)throw Error(`Only the selected source for "${t}" can disable that slot.`);if(!e.composed.composition.entries.some(t=>t.kind===`shadowed`&&t.winnerSourceId===e.candidate.sourceId))throw Error(`Source "${e.candidate.logicalPath}" disables a slot with no lower-precedence source.`);return n.delete(t),{composition:{entries:Object.freeze([...e.composed.composition.entries,{kind:`disabled`,source:describeAgentSourceCandidate(e.candidate)}])},selected:n}}function createAgentModuleBinding(e){return Object.freeze({backing:e.backing,logicalPath:e.logicalPath,owner:e.owner})}async function loadProgrammaticModuleNamespace(e){let t=e.registries.map(t=>t.sources.get(e.backing.registryId)).filter(e=>e!==void 0);if(t.length!==1)throw Error(`Expected exactly one registered programmatic source "${e.backing.registryId}", found ${t.length}.`);let n=t[0];if(n.revision!==e.backing.revision)throw Error(`Programmatic source "${n.id}" revision mismatch: artifact requires "${e.backing.revision}", registry provides "${n.revision}".`);let r=n.modules.find(t=>t.logicalPath===e.backing.moduleId);if(r===void 0)throw Error(`Programmatic source "${n.id}" does not register module "${e.backing.moduleId}".`);if(r.semanticRevision!==e.backing.semanticRevision)throw Error(`Programmatic module "${n.id}:${r.logicalPath}" semantic revision does not match the compiled binding.`);let i=Object.fromEntries(Object.entries(e.backing.dependencies??{}).map(([t,i])=>{let a=e.dependencyNamespaces?.[t];if(a===void 0)throw Error(`Programmatic module "${n.id}:${r.logicalPath}" requires unresolved binding "${i}" as dependency "${t}".`);return[t,a]})),a=await r.loadNamespace({dependencies:Object.freeze(i),parameters:Object.freeze(e.backing.parameters??{})});if(typeof a!=`object`||!a)throw Error(`Programmatic module "${n.id}:${r.logicalPath}" loader must return a module namespace object.`);return a}function canonicalModuleSlot(e){return validateProgrammaticLogicalPath(e),canonicalSourceSlot(e)}function canonicalSourceSlot(e){let n=normalizeLogicalPath(e);if(n.length===0||n===`.`||n.startsWith(`../`)||n.includes(`/../`)||posix.normalize(n)!==n)throw Error(`Agent source logical path "${e}" is invalid.`);let a=stripLogicalPathExtension(n),o=a.match(/^connections\/([^/]+)\/connection$/);if(o!==null)return`connections/${o[1]}`;if(a===`sandbox/sandbox`)return`sandbox`;let s=a.match(/^skills\/([^/]+)\/SKILL$/);return s===null?a:`skills/${s[1]}`}function validateProgrammaticLogicalPath(a){if(a.length===0||isAbsolute(a)||a.includes(`\\`))throw Error(`Programmatic module logical path "${a}" must be a relative POSIX path.`);let o=normalizeLogicalPath(a);if(o===`.`||o.startsWith(`../`)||o.includes(`/../`)||posix.normalize(o)!==o)throw Error(`Programmatic module logical path "${a}" may not traverse directories.`);let s=o.split(`/`),c=s.at(-1);if(getSupportedModuleBaseName(c)===null)throw Error(`Programmatic module logical path "${a}" must use a supported JavaScript or TypeScript extension.`);let l=s[0],u=stripLogicalPathExtension(o);if(!(s.length===1&&[`agent`,`memory`,`sandbox`,`instrumentation`].includes(u)||l===`sandbox`&&s.length===2&&getSupportedModuleBaseName(c)===`sandbox`||[`channels`,`connections`,`hooks`,`instructions`,`memory`,`schedules`,`skills`,`tools`].includes(l)&&s.length>=2))throw Error(`Programmatic module logical path "${a}" does not select an eve module slot.`);return o}function describeAgentSourceCandidate(e){return Object.freeze({backing:e.backing,form:e.form,layer:e.layer,logicalPath:e.logicalPath,owner:e.owner,sourceId:e.sourceId})}function validateSelectedCandidateDependencies(e){let t=new Set([...e.values()].map(e=>e.sourceId));for(let n of e.values())if(n.backing.kind===`programmatic`){for(let e of Object.values(n.backing.dependencies??{}))if(!t.has(e))throw Error(`Derived programmatic source "${n.sourceId}" depends on unselected source "${e}".`)}}function expectNonEmpty(e,t){if(e.trim().length===0)throw Error(`${t} must be non-empty.`);return e}export{canonicalModuleSlot,canonicalSourceSlot,composeAgentModuleCandidates,createAgentModuleBinding,createAgentSourceRegistry,createProgrammaticModuleCandidates,defineProgrammaticAgentSource,describeAgentSourceCandidate,disableComposedCandidate,instantiateProgrammaticTemplate,isAgentModuleCandidate,loadProgrammaticModuleNamespace,memoizeModuleNamespaceFactories,validateProgrammaticLogicalPath};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ROOT_COMPILED_AGENT_NODE_ID}from"#compiler/manifest.js";import{
|
|
1
|
+
import{ROOT_COMPILED_AGENT_NODE_ID}from"#compiler/manifest.js";import{collectRuntimeModuleBindingsForManifest}from"#compiler/module-map.js";import{HOST_HTTP_INVENTORY}from"#framework/host-inventory.js";function validateCompiledAgentManifest(t){let n=new Map([[ROOT_COMPILED_AGENT_NODE_ID,t]]);for(let e of t.subagents)n.has(e.nodeId)&&fail(`subagent node id "${e.nodeId}" is duplicated`),n.set(e.nodeId,e.agent),validateSubagentRecord(e);validateSubagentTree(t,n),validateCompiledAgentResources(t,{activeResourceSourceIds:t.subagents.filter(t=>t.parentNodeId===ROOT_COMPILED_AGENT_NODE_ID).map(e=>e.sourceId)});for(let e of t.subagents)validateCompiledAgentResources(e.agent,{additionalModuleSources:e.configResolver===void 0?[]:[e.configResolver],activeResourceSourceIds:t.subagents.filter(t=>t.parentNodeId===e.nodeId).map(e=>e.sourceId)});for(let[e,r]of n)validateUniqueIdentities([...r.tools.map(e=>({identity:e.name,kind:`tool`})),...r.remoteAgents.map(e=>({identity:e.name,kind:`remote agent`})),...t.subagents.filter(t=>t.parentNodeId===e).map(e=>({identity:e.name,kind:`local agent`}))],`tool and subagent public name`)}function validateSubagentTree(t,n){let r=new Map(t.subagents.map(e=>[e.nodeId,e.parentNodeId]));for(let i of t.subagents){n.has(i.parentNodeId)||fail(`subagent node "${i.nodeId}" has missing parent "${i.parentNodeId}"`);let t=new Set,a=i.nodeId;for(;a!==ROOT_COMPILED_AGENT_NODE_ID;){t.has(a)&&fail(`subagent graph contains a cycle at node "${a}"`),t.add(a);let e=r.get(a);e===void 0&&fail(`subagent node "${i.nodeId}" is not reachable from the root`),a=e}}}function validateCompiledModuleMap(e,n){let r=new Map([[`__root__`,new Set(collectRuntimeModuleBindingsForManifest(e).map(e=>e.sourceId))],...e.subagents.map(e=>[e.nodeId,new Set(collectRuntimeModuleBindingsForManifest(e.agent).map(e=>e.sourceId))])]),i=Object.keys(n.nodes);(i.length!==r.size||i.some(e=>!r.has(e)))&&fail(`compiled module map node set does not match the manifest`);for(let[e,t]of r){let r=n.nodes[e];r===void 0&&fail(`compiled module map node "${e}" is missing`);let i=Object.keys(r.modules);(i.length!==t.size||i.some(e=>!t.has(e)))&&fail(`compiled module map sources for node "${e}" do not match its bindings`)}}function validateCompiledAgentResources(e,t={}){validateUniqueIdentities(e.tools.map(e=>({identity:e.name,kind:`tool`})),`tool name`),validateUniqueIdentities(e.dynamicTools.map(e=>({identity:e.slug,kind:`dynamic tool`})),`dynamic tool slug`),validateUniqueIdentities(e.skills.map(e=>({identity:e.name,kind:`skill`})),`skill name`),validateUniqueIdentities(e.dynamicSkills.map(e=>({identity:e.slug,kind:`dynamic skill`})),`dynamic skill slug`),validateUniqueIdentities(e.instructions.map(e=>({identity:e.name,kind:`instructions`})),`instructions name`),validateUniqueIdentities(e.dynamicInstructions.map(e=>({identity:e.slug,kind:`dynamic instructions`})),`dynamic instructions slug`),validateUniqueIdentities(e.connections.map(e=>({identity:e.connectionName,kind:`connection`})),`connection name`),validateUniqueIdentities(e.hooks.map(e=>({identity:e.slug,kind:`hook`})),`hook slug`),validateUniqueIdentities(e.memories.map(e=>({identity:e.slot,kind:`memory`})),`memory slot`),validateUniqueIdentities(e.schedules.map(e=>({identity:e.name,kind:`schedule`})),`schedule name`);let n=collectReferencedModuleSources(e);for(let e of t.additionalModuleSources??[])n.set(e.sourceId,{logicalPath:e.logicalPath});for(let[t,r]of n){let n=e.bindings[t];n===void 0&&fail(`module source "${t}" has no compiled binding`),validateBinding(t,r.logicalPath,n)}for(let t of Object.keys(e.bindings))n.has(t)||fail(`compiled binding "${t}" is not referenced by its node manifest`);validateProgrammaticBindingDependencies(e.bindings);let r=new Set([...n.keys(),...collectActiveResourceSourceIds(e),...e.remoteAgents.map(e=>e.sourceId),...t.activeResourceSourceIds??[]]),i=new Set;for(let n of e.sourceComposition.entries){if(n.kind===`disabled`){i.has(n.source.sourceId)&&fail(`disabled composition source "${n.source.sourceId}" is duplicated`),i.add(n.source.sourceId),e.bindings[n.source.sourceId]!==void 0&&fail(`disabled source "${n.source.sourceId}" retains an active binding`);continue}!r.has(n.winnerSourceId)&&!i.has(n.winnerSourceId)&&!e.sourceComposition.entries.some(e=>e.kind===`disabled`&&e.source.sourceId===n.winnerSourceId)&&t.allowUnknownResourceWinners!==!0&&fail(`shadowed source "${n.source.sourceId}" has dangling winner "${n.winnerSourceId}"`)}validateChannelRoutePlan(e);for(let t of e.remoteAgents)validateBinding(t.sourceId,t.logicalPath,t.binding),t.parentNodeId.length===0&&fail(`remote agent "${t.sourceId}" has no parent`)}function validateSubagentRecord(e){if((e.backing.kind!==`resource`||e.backing.sourcePath.length===0)&&fail(`subagent "${e.nodeId}" has no physical resource backing`),e.parentNodeId.length===0&&fail(`subagent "${e.nodeId}" has no parent`),e.configResolver!==void 0){let t=e.agent.bindings[e.configResolver.sourceId];t===void 0&&fail(`dynamic subagent "${e.nodeId}" config resolver has no binding`),validateBinding(e.configResolver.sourceId,e.configResolver.logicalPath,t)}}function validateBinding(e,t,n){!n.usage.compile&&!n.usage.runtimeEntry&&fail(`compiled binding "${e}" has no compile or runtime usage`),n.logicalPath!==t&&fail(`compiled binding "${e}" targets "${n.logicalPath}", not "${t}"`),n.owner.kind===`extension`&&n.backing.kind===`filesystem`&&n.backing.extensionScope===void 0&&fail(`extension-owned filesystem binding "${e}" has no extension scope`)}function validateProgrammaticBindingDependencies(e){let t=new Set,n=new Set,visit=r=>{if(n.has(r))return;t.has(r)&&fail(`programmatic binding dependency cycle includes "${r}"`);let i=e[r];if(i===void 0&&fail(`programmatic binding dependency "${r}" is missing`),t.add(r),i.backing.kind===`programmatic`)for(let[t,n]of Object.entries(i.backing.dependencies??{}))t.trim().length===0&&fail(`programmatic binding "${r}" has an empty dependency alias`),e[n]===void 0&&fail(`programmatic binding "${r}" depends on missing binding "${n}"`),i.usage.runtimeEntry&&e[n]?.usage.runtimeEntry!==!0&&fail(`runtime binding "${r}" depends on non-runtime binding "${n}"`),visit(n);t.delete(r),n.add(r)};for(let t of Object.keys(e))visit(t)}function collectReferencedModuleSources(e){let t=new Map,add=e=>{let n=t.get(e.sourceId);n!==void 0&&n.logicalPath!==e.logicalPath&&fail(`module source "${e.sourceId}" is referenced with two logical paths`),t.set(e.sourceId,{logicalPath:e.logicalPath})};`config`in e&&(add(e.config.source),e.config.model?.source!==void 0&&add(e.config.model.source),e.config.dynamicModel!==void 0&&add(e.config.dynamicModel));for(let t of e.channelRoutes.effective)add(t);for(let t of e.channelRoutes.shadowed)t.source.backing.kind!==`resource`&&add(t.source);for(let t of e.connections)add(t);for(let t of e.tools)add(t);for(let t of e.dynamicInstructions)add(t);for(let t of e.dynamicSkills)add(t);for(let t of e.dynamicTools)add(t);for(let t of e.hooks)add(t);for(let t of e.memories)add(t);for(let t of e.instructions)t.sourceKind===`module`&&add(t);e.instrumentation!==void 0&&add(e.instrumentation),e.workflowTool!==void 0&&add(e.workflowTool);for(let t of e.skills)t.sourceKind===`module`&&add(t);for(let t of e.schedules)t.sourceKind===`module`&&add(t);add(e.sandbox);for(let t of e.extensionMounts)add({logicalPath:t.mountLogicalPath,sourceId:t.mountSourceId});return t}function collectActiveResourceSourceIds(e){return[...e.instructions.filter(e=>e.sourceKind!==`module`).map(e=>e.sourceId),...e.skills.filter(e=>e.sourceKind!==`module`).map(e=>e.sourceId),...e.schedules.filter(e=>e.sourceKind!==`module`).map(e=>e.sourceId),...e.sandboxWorkspaces.map(e=>e.sourceId)]}function validateChannelRoutePlan(e){let t=new Set,r=new Set;for(let i of e.channelRoutes.effective){let a=routeIdentity(i);t.has(a)&&fail(`effective channel route "${a}" is duplicated`),t.add(a),r.add(i.sourceId),e.bindings[i.sourceId]===void 0&&fail(`effective channel route source "${i.sourceId}" has no binding`),HOST_HTTP_INVENTORY.find(e=>methodsOverlap(i.method,e.method)&&patternsOverlap(i.urlPath,e.path))!==void 0&&fail(`effective route ${i.method} ${i.urlPath} overlaps reserved host route`)}for(let t of e.channelRoutes.shadowed)r.has(t.winnerSourceId)||fail(`shadowed channel route has dangling winner "${t.winnerSourceId}"`);let i=new Set;for(let t of e.channelRoutes.preflight){let n=normalizePattern(t.urlPath);i.has(n)&&fail(`generated preflight "${n}" is duplicated`),i.add(n),t.sourceIds.length===0&&fail(`generated preflight "${n}" has no causes`);for(let r of t.sourceIds)e.channelRoutes.effective.find(e=>e.sourceId===r&&e.cors!==void 0&&e.method!==`WEBSOCKET`&&patternsOverlap(e.urlPath,t.urlPath))===void 0&&fail(`generated preflight "${n}" has invalid cause "${r}"`)}}function routeIdentity(e){return`${e.method} ${normalizePattern(e.urlPath)}`}function normalizePattern(e){return splitPath(e).map(e=>isParameter(e)?`:`:e).join(`/`)}function patternsOverlap(e,t){let n=splitPath(e),r=splitPath(t);return n.length===r.length&&n.every((e,t)=>e===r[t]||isParameter(e)||isParameter(r[t]))}function splitPath(e){return e.replace(/^\/+|\/+$/g,``).split(`/`)}function isParameter(e){return e.startsWith(`:`)||/^\[[^\]]+\]$/.test(e)}function methodsOverlap(e,t){return e===`ALL`||t===`ALL`||e===t}function validateUniqueIdentities(e,t){let n=new Map;for(let r of e){let e=n.get(r.identity);e!==void 0&&fail(`${t} "${r.identity}" is shared by ${e} and ${r.kind}`),n.set(r.identity,r.kind)}}function fail(e){throw Error(`Invalid compiled eve artifact: ${e}.`)}export{validateCompiledAgentManifest,validateCompiledAgentResources,validateCompiledModuleMap};
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { LanguageModel, ModelMessage, SystemModelMessage } from "ai";
|
|
7
7
|
import type { JsonObject } from "#shared/json.js";
|
|
8
|
+
import type { InstrumentationDecision } from "#shared/instrumentation-decision.js";
|
|
8
9
|
import type { ChannelInstrumentationProjection, ChannelDeliveryMetadata, SessionAuthContext, SessionCallback, SessionCapabilities, SessionParent, SessionTraceContext, SessionTurn } from "#channel/types.js";
|
|
9
10
|
import { ContextKey } from "#context/key.js";
|
|
10
11
|
import type { InstrumentationChannelDeliveryRef } from "#harness/instrumentation/lifecycle.js";
|
|
@@ -67,6 +68,7 @@ export declare const ParentSessionKey: ContextKey<SessionParent>;
|
|
|
67
68
|
/** Separate from {@link ParentSessionKey} so it stays out of what extensions read. */
|
|
68
69
|
export declare const ParentTraceContextKey: ContextKey<SessionTraceContext>;
|
|
69
70
|
export interface SessionTraceSeed {
|
|
71
|
+
readonly decision?: InstrumentationDecision;
|
|
70
72
|
readonly traceId: string;
|
|
71
73
|
readonly spanId: string;
|
|
72
74
|
readonly traceFlags: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createLogger,logError}from"#internal/logging.js";import{RuntimeSessionOwnershipConflictError}from"#execution/runtime-errors.js";import{sessionCommandHookToken}from"#execution/session-command-token.js";import{normalizeChannelAudience}from"#shared/channel-audience.js";import{ChannelInstrumentationKey,OtelTraceEnabledKey,SessionTraceSeedKey}from"#context/keys.js";import{resolveInstalledPackageInfo}from"#internal/application/package.js";import{walkCauseChain}from"#shared/errors.js";import{isEveDevEnvironment}from"#internal/application/dev-environment.js";import{serializeContext}from"#context/serialize.js";import{getHookByToken,getRun,start}from"#internal/workflow/runtime.js";import{getCompiledRuntimeAgentBundle}from"#runtime/sessions/compiled-agent-cache.js";import{resolveEffectiveAgentRuntime}from"#execution/effective-agent-config.js";import{EntityConflictError,HookNotFoundError,RunExpiredError,WorkflowRunNotFoundError}from"#compiled/@workflow/errors/index.js";import{buildSessionAttributes,buildSubagentRootAttributes,readParentLineage}from"#execution/eve-workflow-attributes.js";import{normalizeEveAttributes}from"#runtime/attributes/normalize.js";import{
|
|
1
|
+
import{createLogger,logError}from"#internal/logging.js";import{RuntimeSessionOwnershipConflictError}from"#execution/runtime-errors.js";import{sessionCommandHookToken}from"#execution/session-command-token.js";import{normalizeChannelAudience}from"#shared/channel-audience.js";import{ChannelInstrumentationKey,OtelTraceEnabledKey,SessionTraceSeedKey}from"#context/keys.js";import{resolveInstalledPackageInfo}from"#internal/application/package.js";import{walkCauseChain}from"#shared/errors.js";import{isEveDevEnvironment}from"#internal/application/dev-environment.js";import{serializeContext}from"#context/serialize.js";import{getHookByToken,getRun,start}from"#internal/workflow/runtime.js";import{getCompiledRuntimeAgentBundle}from"#runtime/sessions/compiled-agent-cache.js";import{resolveEffectiveAgentRuntime}from"#execution/effective-agent-config.js";import{EntityConflictError,HookNotFoundError,RunExpiredError,WorkflowRunNotFoundError}from"#compiled/@workflow/errors/index.js";import{buildSessionAttributes,buildSubagentRootAttributes,readParentLineage}from"#execution/eve-workflow-attributes.js";import{normalizeEveAttributes}from"#runtime/attributes/normalize.js";import{isSampledTrace,resolveTracePolicy,resolveTracePolicyDecision}from"#tracing/sampled-trace.js";import{getInstrumentationRuntime}from"#harness/instrumentation/runtime.js";import{resumeSessionInbox}from"#execution/wire/session-inbox-resume.js";import{ROOT_RUNTIME_AGENT_NODE_ID}from"#runtime/graph.js";import{buildRunContext}from"#execution/runtime-context.js";import{parseNdjsonStream}from"#execution/ndjson-stream.js";import{buildInvocationAttributes}from"#internal/invocation/metadata.js";const WORKFLOW_ENTRY_NAME=`workflowEntry`,TURN_WORKFLOW_NAME=`turnWorkflow`,SESSION_TIMEOUT_WORKFLOW_NAME=`sessionTimeoutWorkflow`,TASK_RUN_WORKFLOW_NAME=`taskRunWorkflow`,EVE_PACKAGE_INFO=resolveInstalledPackageInfo(),COMMAND_HOOK_READY_TIMEOUT_MS=3e4,LATEST_DEPLOYMENT_UNSUPPORTED_MESSAGE=`deploymentId 'latest' requires a World that implements resolveLatestDeploymentId()`,STABLE_WORKFLOW_NAMES=new Set([WORKFLOW_ENTRY_NAME,TURN_WORKFLOW_NAME,SESSION_TIMEOUT_WORKFLOW_NAME,TASK_RUN_WORKFLOW_NAME]),STABLE_ID_BASE=EVE_PACKAGE_INFO.name,log=createLogger(`execution.workflow-runtime`),workflowEntryReference={workflowId:`workflow//${STABLE_ID_BASE}//${WORKFLOW_ENTRY_NAME}`},turnWorkflowReference={workflowId:`workflow//${STABLE_ID_BASE}//${TURN_WORKFLOW_NAME}`},sessionTimeoutWorkflowReference={workflowId:`workflow//${STABLE_ID_BASE}//${SESSION_TIMEOUT_WORKFLOW_NAME}`},taskRunWorkflowReference={workflowId:`workflow//${STABLE_ID_BASE}//${TASK_RUN_WORKFLOW_NAME}`};function createWorkflowRuntime(e){return{async createSession(a){let o=await getCompiledRuntimeAgentBundle({compiledArtifactsSource:e.compiledArtifactsSource,nodeId:e.nodeId}),s=buildRunContext({bundle:o,dynamicSubagentAgentConfig:e.dynamicSubagentAgentConfig,run:a}),c=resolveEffectiveAgentRuntime(o,s),l=s.get(ChannelInstrumentationKey),u=allocateSessionTraceSeed({agentName:c.turnAgent.id,audience:normalizeChannelAudience(l?.metadata.audience),channelType:l?.channelType,parentTraceContext:a.parentTraceContext});u!==void 0&&s.set(SessionTraceSeedKey,u),s.set(OtelTraceEnabledKey,getInstrumentationRuntime()?.prepareSessionTrace!==void 0);let d=serializeContext(s),f=readParentLineage(d),p=c.limits?.sessionTimeoutMs,m={input:a.input,limits:a.limits,serializedContext:d};p!==void 0&&(m.sessionTimeoutMs=p);let h={...f.sessionId===void 0?buildSessionAttributes({inputMessage:a.title??a.input.message,serializedContext:d}):buildSubagentRootAttributes({identity:{nodeId:o.nodeId??ROOT_RUNTIME_AGENT_NODE_ID},parentCallId:f.callId,parentSessionId:f.sessionId,parentTurnId:f.turnId,rootSessionId:f.rootSessionId??f.sessionId,serializedContext:d}),...a.externalInvocation===void 0?{}:buildInvocationAttributes(a.externalInvocation)},g;try{g=await startWorkflowPreferLatest(workflowEntryReference,[m],{allowReservedAttributes:!0,attributes:normalizeEveAttributes(h)})}catch(e){throw logError(log,`failed to start workflow run`,e,{continuationToken:a.continuationToken}),e}if(a.continuationToken){let e=await waitForCommandHookOwner(a.continuationToken);if(e.runId!==g.runId)throw new RuntimeSessionOwnershipConflictError({continuationToken:a.continuationToken,ownerSessionId:e.runId,sessionId:g.runId})}await waitForOwnedCommandHook(sessionCommandHookToken(g.runId),g.runId);let _,getEvents=()=>(_??=parseNdjsonStream(()=>getRun(g.runId).getReadable()),_);return{get events(){return getEvents()},sessionId:g.runId}},async dispatchContinuation(e){return await dispatchWorkflowCommand(e.continuationToken,e.command)},async dispatchSession(e){return await dispatchWorkflowCommand(sessionCommandHookToken(e.sessionId),e.command)},async getEventStream(e,t){return parseNdjsonStream(()=>getRun(e).getReadable({startIndex:t?.startIndex}))},async getStreamTailIndex(e){let t=getRun(e).getReadable();try{return await t.getTailIndex()}finally{await t.cancel().catch(()=>{})}},async resolveContinuation(e){try{return{sessionId:(await getHookByToken(e)).runId}}catch(n){if(HookNotFoundError.is(n))return;throw logError(log,`failed to resolve session by continuation token`,n,{continuationToken:e}),n}}}}async function dispatchWorkflowCommand(e,n){let i;try{i=normalizeWorkflowHook(await resumeSessionInbox(e,n))}catch(r){if(isInactiveCommandTarget(r))return inactiveCommandResult(n);throw logError(log,`failed to dispatch session command`,r,{command:n.kind,token:e}),r}return n.kind===`reset`&&await waitForCommandHookRelease(sessionCommandHookToken(i.runId),i.runId),activeCommandResult(n,i.runId)}function activeCommandResult(e,t){return e.kind===`reset`?{previousSessionId:t,status:`reset`}:(e.kind,{sessionId:t,status:`accepted`})}function inactiveCommandResult(e){return e.kind===`send`?{status:`session_not_active`}:e.kind===`cancel`?{status:`no_active_turn`}:{status:`no_active_session`}}async function requestWorkflowTurnCancellation(e){let t={kind:`cancel`};return e.taskId!==void 0&&(t.taskId=e.taskId),e.turnId!==void 0&&(t.turnId=e.turnId),await dispatchWorkflowCommand(sessionCommandHookToken(e.sessionId),t)}function isInactiveCommandTarget(e){if(HookNotFoundError.is(e))return!0;for(let t of walkCauseChain(e))if(WorkflowRunNotFoundError.is(t)||RunExpiredError.is(t)||EntityConflictError.is(t))return!0;return!1}async function waitForOwnedCommandHook(e,t){let r=await waitForCommandHookOwner(e);if(r.runId!==t)throw new RuntimeSessionOwnershipConflictError({continuationToken:e,ownerSessionId:r.runId,sessionId:t})}async function waitForCommandHookOwner(e){let t=Date.now()+COMMAND_HOOK_READY_TIMEOUT_MS;for(;;)try{return normalizeWorkflowHook(await getHookByToken(e))}catch(e){if(!HookNotFoundError.is(e)||Date.now()>=t)throw e;await new Promise(e=>setTimeout(e,20))}}async function waitForCommandHookRelease(e,t){let n=Date.now()+COMMAND_HOOK_READY_TIMEOUT_MS;for(;;){try{if(normalizeWorkflowHook(await getHookByToken(e)).runId!==t)return}catch(e){if(HookNotFoundError.is(e))return;throw e}if(Date.now()>=n)throw Error(`Timed out waiting for session "${t}" to release its command inbox.`);await new Promise(e=>setTimeout(e,20))}}async function startWorkflowPreferLatest(e,t,n){if(!shouldRouteToLatestDeployment())return n===void 0?await start(e,t):await start(e,t,n);try{return await start(e,t,{...n,deploymentId:`latest`})}catch(r){if(!isLatestDeploymentUnsupportedError(r))throw r;return n===void 0?await start(e,t):await start(e,t,n)}}function shouldRouteToLatestDeployment(){return process.env.VERCEL_ENV===`production`||isEveDevEnvironment()}function isLatestDeploymentUnsupportedError(e){return e instanceof Error&&e.message.includes(`deploymentId 'latest' requires a World that implements resolveLatestDeploymentId()`)}function normalizeWorkflowHook(e){if(typeof e!=`object`||!e||!(`runId`in e))throw Error(`Workflow hook did not include a run id.`);let t=e.runId;if(typeof t!=`string`||t.length===0)throw Error(`Workflow hook did not include a run id.`);return{runId:t}}function allocateSessionTraceSeed(e){if(e.parentTraceContext!==void 0)return{decision:e.parentTraceContext.decision??resolveTracePolicyDecision(isSampledTrace(e.parentTraceContext),e.audience),spanId:e.parentTraceContext.spanId,traceFlags:e.parentTraceContext.traceFlags,traceId:e.parentTraceContext.traceId};let t=getInstrumentationRuntime();if(t?.prepareSessionTrace===void 0||t.idGenerator===void 0)return;let n=resolveTracePolicy(t.otelSettings?.tracePolicy,{agentName:e.agentName,audience:e.audience,channelType:e.channelType});return{decision:n,spanId:t.idGenerator.allocateSpanId(),traceFlags:+(n.action===`record`),traceId:t.idGenerator.generateTraceId()}}export{LATEST_DEPLOYMENT_UNSUPPORTED_MESSAGE,STABLE_WORKFLOW_NAMES,createWorkflowRuntime,requestWorkflowTurnCancellation,sessionTimeoutWorkflowReference,startWorkflowPreferLatest,taskRunWorkflowReference,turnWorkflowReference,waitForCommandHookOwner,workflowEntryReference};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{resolveInstalledPackageInfo}from"#internal/application/package.js";import{createAgentSourceRegistry,defineProgrammaticAgentSource,loadProgrammaticModuleNamespace,memoizeModuleNamespaceFactories}from"#compiler/source-graph.js";const revision=`eve@${resolveInstalledPackageInfo().version}:compiled-manifest-
|
|
1
|
+
import{resolveInstalledPackageInfo}from"#internal/application/package.js";import{createAgentSourceRegistry,defineProgrammaticAgentSource,loadProgrammaticModuleNamespace,memoizeModuleNamespaceFactories}from"#compiler/source-graph.js";const revision=`eve@${resolveInstalledPackageInfo().version}:compiled-manifest-v44`,localDefaults=defineProgrammaticAgentSource({id:`eve:defaults`,revision,modules:[{logicalPath:`agent.ts`,loadNamespace:()=>import(`#framework/sources/modules/agent.js`)},{logicalPath:`sandbox.ts`,semanticRevision:`eve:default-sandbox:v1`,loadNamespace:()=>import(`#framework/sources/modules/sandbox.js`)},{logicalPath:`tools/bash.ts`,loadNamespace:()=>import(`#tools/provided/bash.js`)},{logicalPath:`tools/read_file.ts`,loadNamespace:()=>import(`#tools/provided/read-file.js`)},{logicalPath:`tools/write_file.ts`,loadNamespace:()=>import(`#tools/provided/write-file.js`)},{logicalPath:`tools/todo.ts`,loadNamespace:()=>import(`#tools/provided/todo.js`)},{logicalPath:`tools/web_fetch.ts`,loadNamespace:()=>import(`#tools/provided/web-fetch.js`)},{logicalPath:`tools/load_skill.ts`,loadNamespace:()=>import(`#tools/provided/load-skill.js`)},{logicalPath:`tools/connection_search.ts`,loadNamespace:()=>import(`#tools/framework/connection-search.js`)},{logicalPath:`tools/ask_question.ts`,loadNamespace:()=>import(`#tools/framework/ask-question.js`)},{logicalPath:`tools/web_search.ts`,loadNamespace:()=>import(`#tools/provided/web-search.js`)}]}),rootDefaults=defineProgrammaticAgentSource({id:`eve:root-defaults`,revision,modules:[{logicalPath:`tools/agent.ts`,loadNamespace:()=>import(`#tools/framework/agent.js`)},{logicalPath:`tools/task_update.ts`,loadNamespace:()=>import(`#tools/framework/task-update.js`)},{logicalPath:`tools/task_cancel.ts`,loadNamespace:()=>import(`#tools/framework/task-cancel.js`)},{logicalPath:`channels/eve.ts`,loadNamespace:()=>import(`#framework/sources/modules/eve-channel.js`)},{logicalPath:`channels/home.ts`,loadNamespace:()=>import(`#framework/sources/modules/home-channel.js`)}]}),memoryWrapperTemplateSource=defineProgrammaticAgentSource({id:`eve:memory-wrapper`,revision,modules:[{logicalPath:`tools/memory-wrapper.ts`,loadNamespace:async e=>{let{loadMemoryWrapperNamespace:t}=await import(`#framework/sources/modules/memory-wrapper.js`);return await t(e)}}]}),frameworkAgentSourceRegistry=createAgentSourceRegistry([{applyTo:`all-local-nodes`,source:localDefaults},{applyTo:`root`,source:rootDefaults}],{templates:[memoryWrapperTemplateSource]}),memoryWrapperTemplate=frameworkAgentSourceRegistry.templates.get(memoryWrapperTemplateSource.id);async function loadFrameworkProgrammaticModule(e,t){return memoizeModuleNamespaceFactories(await loadProgrammaticModuleNamespace({backing:e,dependencyNamespaces:t,registries:[frameworkAgentSourceRegistry]}))}export{frameworkAgentSourceRegistry,loadFrameworkProgrammaticModule,memoryWrapperTemplate};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{normalizeChannelAudience}from"#shared/channel-audience.js";import{ActiveChannelDeliveriesKey,ChannelInstrumentationKey,ParentTraceContextKey,SessionTraceSeedKey}from"#context/keys.js";import{instrumentationHooksForAudience}from"#harness/instrumentation/content-policy.js";import{channelDeliveryIdempotencyKey}from"#harness/instrumentation/lifecycle.js";async function instrumentChannelDelivery(
|
|
1
|
+
import{normalizeChannelAudience}from"#shared/channel-audience.js";import{ActiveChannelDeliveriesKey,ChannelInstrumentationKey,ParentTraceContextKey,SessionTraceSeedKey}from"#context/keys.js";import{instrumentationHooksForAudience,instrumentationHooksForDecision}from"#harness/instrumentation/content-policy.js";import{channelDeliveryIdempotencyKey}from"#harness/instrumentation/lifecycle.js";async function instrumentChannelDelivery(i){if(!(`delivery`in i)){let n=i.ctx.get(ActiveChannelDeliveriesKey);if(n===void 0||i.hooks===void 0)return;let r=`channel.delivery.${i.outcome}`;for(let t of n)await hooksForContext(i.ctx,i.hooks,normalizeChannelAudience(t.delivery.channelAudience))?.publish({agentName:t.agentName,delivery:t.delivery,error:i.error,errorCode:i.errorCode,idempotencyKey:channelDeliveryIdempotencyKey(t.sessionId,t.delivery.deliveryId),outcome:i.outcome,rootSessionId:t.rootSessionId,sequence:i.includeTurn?t.sequence:void 0,sessionId:t.sessionId,turnId:i.includeTurn?t.turnId:void 0,type:r});i.ctx.delete(ActiveChannelDeliveriesKey);return}if(i.hooks===void 0||i.delivery.deliveryMetadata===void 0)return;let a=[],o=normalizeChannelAudience(i.ctx.get(ChannelInstrumentationKey)?.metadata.audience),s=hooksForContext(i.ctx,i.hooks,o);for(let e of i.delivery.deliveryMetadata){let t=i.delivery.payloads[e.payloadIndex],n={channelAudience:o,channelKind:e.channelKind,channelName:e.channelName,deliveryId:e.deliveryId,requestId:e.requestId,requestTraceContext:e.requestTraceContext},c=!s?.capturesContent||t===void 0?void 0:projectDeliveryInput(t),l={agentName:i.agentName,delivery:n,rootSessionId:i.rootSessionId,sequence:i.sequence,sessionId:i.sessionId,turnId:i.turnId};a.push(l),await s?.publish({agentName:l.agentName,delivery:n,idempotencyKey:channelDeliveryIdempotencyKey(i.sessionId,n.deliveryId),input:c,parentTraceContext:i.ctx.get(ParentTraceContextKey),rootSessionId:i.rootSessionId,sessionId:i.sessionId,traceSeed:i.ctx.get(SessionTraceSeedKey),type:`channel.delivery.started`})}a.length>0&&i.ctx.set(ActiveChannelDeliveriesKey,a)}function hooksForContext(e,t,n){let r=e.get(SessionTraceSeedKey)?.decision;return r===void 0?instrumentationHooksForAudience(t,n):instrumentationHooksForDecision(t,r,n)}function projectDeliveryInput(e){let t={};return e.context!==void 0&&(t.context=e.context),e.message!==void 0&&(t.message=e.message),e.outputSchema!==void 0&&(t.outputSchema=e.outputSchema),e.inputResponses!==void 0&&(t.inputResponses=e.inputResponses.map(e=>{let t={};return e.optionId!==void 0&&(t.optionId=e.optionId),e.text!==void 0&&(t.text=e.text),t})),t}function channelDeliveryErrorCode(e){if(typeof e==`object`&&e&&`code`in e){let t=e.code;if(typeof t==`string`&&t.length>0)return t}return`CHANNEL_DELIVERY_FAILED`}export{channelDeliveryErrorCode,instrumentChannelDelivery};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { InstrumentationHooks } from "#harness/instrumentation/lifecycle.js";
|
|
2
2
|
import type { ChannelAudience } from "#shared/channel-audience.js";
|
|
3
|
-
|
|
4
|
-
export
|
|
3
|
+
import type { InstrumentationDecision } from "#shared/instrumentation-decision.js";
|
|
4
|
+
export { shouldCaptureInstrumentationContent } from "#shared/instrumentation-content.js";
|
|
5
|
+
export declare function instrumentationHooksForDecision(hooks: InstrumentationHooks | undefined, decision: InstrumentationDecision, audience: ChannelAudience): InstrumentationHooks | undefined;
|
|
5
6
|
/** Applies the audience ceiling before any content-capable provider sees an event. */
|
|
6
7
|
export declare function instrumentationHooksForAudience(hooks: InstrumentationHooks | undefined, audience: ChannelAudience): InstrumentationHooks | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{withInstrumentationDecision,withoutInstrumentationContent}from"#harness/instrumentation/content.js";import{applyAudienceCeiling,shouldCaptureInstrumentationContent,shouldCaptureInstrumentationContent as shouldCaptureInstrumentationContent$1}from"#shared/instrumentation-content.js";function instrumentationHooksForDecision(t,r,i){if(r.action===`drop`)return instrumentationHooksForAudience(t,i);let a=applyAudienceCeiling(r,i);return a.action===`drop`||t===void 0||!t.capturesContent||a.recordInputs&&a.recordOutputs?t:{capturesContent:a.recordInputs||a.recordOutputs,publish:n=>t.publish(withInstrumentationDecision(n,a))}}function instrumentationHooksForAudience(e,n){return e===void 0||!e.capturesContent||shouldCaptureInstrumentationContent$1(n)?e:{capturesContent:!1,publish:n=>e.publish(withoutInstrumentationContent(n))}}export{instrumentationHooksForAudience,instrumentationHooksForDecision,shouldCaptureInstrumentationContent};
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import type { InstrumentationEvent } from "#harness/instrumentation/lifecycle.js";
|
|
2
|
+
import type { InstrumentationDecision } from "#shared/instrumentation-decision.js";
|
|
2
3
|
/** Returns an immutable event projection with conversation content removed. */
|
|
3
4
|
export declare function withoutInstrumentationContent(event: InstrumentationEvent): InstrumentationEvent;
|
|
5
|
+
/**
|
|
6
|
+
* Projects lifecycle content by direction.
|
|
7
|
+
*
|
|
8
|
+
* Inputs are data entering the agent: delivery/action/tool/model starts and a
|
|
9
|
+
* resolved user's response. Outputs are data produced by the agent: requests
|
|
10
|
+
* for user input, action/tool/model terminals, provider metadata, and errors.
|
|
11
|
+
*/
|
|
12
|
+
export declare function withInstrumentationDecision(event: InstrumentationEvent, decision: Extract<InstrumentationDecision, {
|
|
13
|
+
action: "record";
|
|
14
|
+
}>): InstrumentationEvent;
|
|
4
15
|
/** Provider metadata fields that describe cost/identity rather than content. */
|
|
5
16
|
export declare function structuralProviderMetadata(metadata: Readonly<Record<string, unknown>>): Readonly<Record<string, unknown>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function withoutInstrumentationContent(e){switch(e.type){case`channel.delivery.started`:return Object.freeze({...e,input:void 0});case`action.started`:return Object.freeze({...e,input:void 0});case`action.completed`:return Object.freeze({...e,output:Object.freeze({type:e.output.type})});case`input.requested`:return Object.freeze({...e,request:void 0});case`input.resolved`:return Object.freeze({...e,error:void 0,response:void 0});case`tool.call.started`:return Object.freeze({...e,input:void 0});case`tool.call.completed`:return Object.freeze({...e,output:Object.freeze({type:e.output.type})});case`model.call.started`:return Object.freeze({...e,input:void 0});case`model.call.completed`:return Object.freeze({...e,content:void 0});case`step.attempt.metadata`:return Object.freeze({...e,providerMetadata:structuralProviderMetadata(e.providerMetadata)});case`action.failed`:case`model.call.failed`:case`session.failed`:case`step.attempt.failed`:case`tool.call.failed`:case`turn.failed`:case`channel.delivery.failed`:return Object.freeze({...e,error:void 0});default:return e}}function structuralProviderMetadata(e){let t=e.gateway;if(typeof t!=`object`||!t||Array.isArray(t))return Object.freeze({});let n=t,r={};for(let e of[`cost`,`generationId`]){let t=n[e];(typeof t==`string`||typeof t==`number`)&&(r[e]=t)}return Object.freeze(Object.keys(r).length===0?{}:{gateway:Object.freeze(r)})}export{structuralProviderMetadata,withoutInstrumentationContent};
|
|
1
|
+
function withoutInstrumentationContent(e){return withInstrumentationDecision(e,{action:`record`,recordInputs:!1,recordOutputs:!1})}function withInstrumentationDecision(e,t){switch(e.type){case`channel.delivery.started`:return t.recordInputs?e:Object.freeze({...e,input:void 0});case`action.started`:return t.recordInputs?e:Object.freeze({...e,input:void 0});case`action.completed`:return t.recordOutputs?e:Object.freeze({...e,output:Object.freeze({type:e.output.type})});case`input.requested`:return t.recordOutputs?e:Object.freeze({...e,request:void 0});case`input.resolved`:return t.recordInputs&&t.recordOutputs?e:Object.freeze({...e,error:t.recordOutputs?e.error:void 0,response:t.recordInputs?e.response:void 0});case`tool.call.started`:return t.recordInputs?e:Object.freeze({...e,input:void 0});case`tool.call.completed`:return t.recordOutputs?e:Object.freeze({...e,output:Object.freeze({type:e.output.type})});case`model.call.started`:return t.recordInputs?e:Object.freeze({...e,input:void 0});case`model.call.completed`:return t.recordOutputs?e:Object.freeze({...e,content:void 0});case`step.attempt.metadata`:return t.recordOutputs?e:Object.freeze({...e,providerMetadata:structuralProviderMetadata(e.providerMetadata)});case`action.failed`:case`model.call.failed`:case`session.failed`:case`step.attempt.failed`:case`tool.call.failed`:case`turn.failed`:case`channel.delivery.failed`:return t.recordOutputs?e:Object.freeze({...e,error:void 0});default:return e}}function structuralProviderMetadata(e){let t=e.gateway;if(typeof t!=`object`||!t||Array.isArray(t))return Object.freeze({});let n=t,r={};for(let e of[`cost`,`generationId`]){let t=n[e];(typeof t==`string`||typeof t==`number`)&&(r[e]=t)}return Object.freeze(Object.keys(r).length===0?{}:{gateway:Object.freeze(r)})}export{structuralProviderMetadata,withInstrumentationDecision,withoutInstrumentationContent};
|