@xemahq/agent-session-runtime 0.7.0 → 0.9.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/dist/lib/agent-resolution.d.ts.map +1 -1
- package/dist/lib/agent-resolution.js.map +1 -1
- package/dist/lib/composer.d.ts +25 -2
- package/dist/lib/composer.d.ts.map +1 -1
- package/dist/lib/composer.js +237 -81
- package/dist/lib/composer.js.map +1 -1
- package/dist/lib/launch-identity/canonical-contract.d.ts +1 -0
- package/dist/lib/launch-identity/canonical-contract.d.ts.map +1 -1
- package/dist/lib/launch-identity/canonical-contract.js +14 -2
- package/dist/lib/launch-identity/canonical-contract.js.map +1 -1
- package/dist/lib/launch-identity/compiled-session-launch-plan.d.ts.map +1 -1
- package/dist/lib/launch-identity/compiled-session-launch-plan.js +1 -5
- package/dist/lib/launch-identity/compiled-session-launch-plan.js.map +1 -1
- package/dist/lib/launch-identity/index.d.ts +2 -0
- package/dist/lib/launch-identity/index.d.ts.map +1 -1
- package/dist/lib/launch-identity/index.js +2 -0
- package/dist/lib/launch-identity/index.js.map +1 -1
- package/dist/lib/launch-identity/preparation-generation.d.ts +26 -0
- package/dist/lib/launch-identity/preparation-generation.d.ts.map +1 -0
- package/dist/lib/launch-identity/preparation-generation.js +88 -0
- package/dist/lib/launch-identity/preparation-generation.js.map +1 -0
- package/dist/lib/launch-identity/prepared-launch-variant.d.ts +46 -0
- package/dist/lib/launch-identity/prepared-launch-variant.d.ts.map +1 -0
- package/dist/lib/launch-identity/prepared-launch-variant.js +118 -0
- package/dist/lib/launch-identity/prepared-launch-variant.js.map +1 -0
- package/dist/lib/launch-identity/runtime-template-key.d.ts.map +1 -1
- package/dist/lib/launch-identity/runtime-template-key.js +1 -5
- package/dist/lib/launch-identity/runtime-template-key.js.map +1 -1
- package/package.json +21 -20
- package/src/lib/agent-resolution.ts +15 -4
- package/src/lib/composer.ts +396 -135
- package/src/lib/launch-identity/canonical-contract.ts +36 -2
- package/src/lib/launch-identity/compiled-session-launch-plan.ts +2 -10
- package/src/lib/launch-identity/index.ts +2 -0
- package/src/lib/launch-identity/preparation-generation.ts +171 -0
- package/src/lib/launch-identity/prepared-launch-variant.ts +263 -0
- package/src/lib/launch-identity/runtime-template-key.ts +2 -7
- package/LICENSE +0 -176
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-resolution.d.ts","sourceRoot":"","sources":["../../src/lib/agent-resolution.ts"],"names":[],"mappings":"AA4BA,OAAO,EAIL,KAAK,QAAQ,EACb,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,eAAe,EACrB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EACV,aAAa,EACb,iBAAiB,EAClB,MAAM,4CAA4C,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAC/E,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,mCAAmC,CAAC;AAU3C,qBAAa,oBAAqB,SAAQ,KAAK;gBACjC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAI5C;AAWD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,aAAa,CAAC,EAAE,QAAQ,CAAC;IAClC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC;CACrC;AAGD,MAAM,WAAW,mBAAmB;IAKlC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAClC;AAOD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAElC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,GAAG,IA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AAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAIzC;AAOD,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,iBAAiB,GACtB,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAIpC;AA2CD,wBAAgB,kBAAkB,CAChC,gBAAgB,EAAE,MAAM,EACxB,gBAAgB,EAAE,MAAM,GAAG,IAAI,GAC9B,MAAM,CAWR;AAWD,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAM5E;AAQD,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,aAAa,GAAG,SAAS,GAC7B,aAAa,GAAG,IAAI,CAKtB;AAOD,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,QAAQ,GAAG,SAAS,EACzB,OAAO,EAAE,MAAM,GACd,QAAQ,GAAG,IAAI,CA4BjB;AAqGD,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,aAAa,EACvB,OAAO,CAAC,EAAE,mBAAmB,GAC5B,kBAAkB,CA2CpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-resolution.js","sourceRoot":"","sources":["../../src/lib/agent-resolution.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"agent-resolution.js","sourceRoot":"","sources":["../../src/lib/agent-resolution.ts"],"names":[],"mappings":";;;AAiJA,4CA4BC;AAQD,sCA0BC;AAQD,oCAkBC;AAOD,8DAMC;AAOD,0DAIC;AAMD,4DAMC;AAOD,kEAMC;AA2CD,gDAcC;AAWD,sDAMC;AAQD,kDAOC;AAOD,oDA+BC;AAqGD,kEA8CC;AAhhBD,gEAQ2C;AAM3C,gEAG2C;AAU3C,MAAa,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,OAAe,EAAE,MAAc;QACzC,KAAK,CAAC,gCAAgC,OAAO,MAAM,MAAM,EAAE,CAAC,CAAC;QAC7D,IAAI,CAAC,I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ist/lib/composer.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type WorkspaceMountPlan } from '@xemahq/kernel-contracts/agent-workspace';
|
|
1
|
+
import { LogicalWorkspaceSlot, type LogicalMountPlanEntry, type WorkspaceMountPlan } from '@xemahq/kernel-contracts/agent-workspace';
|
|
2
|
+
import { WorkerRuntimeKind, type RuntimeLayoutAdapter, type UnsupportedPlacement } from '@xemahq/kernel-contracts/worker-runtime';
|
|
2
3
|
import type { ComposeWorkspaceImageRequest, WorkspaceImageComposer } from './types';
|
|
3
4
|
export interface InputArtifactRef {
|
|
4
5
|
readonly artifactId: string;
|
|
@@ -8,7 +9,29 @@ export interface InputArtifactRef {
|
|
|
8
9
|
readonly payloadField?: string;
|
|
9
10
|
readonly contentType?: string;
|
|
10
11
|
}
|
|
12
|
+
export interface ExplicitlyUnsupportedOptionalEntry {
|
|
13
|
+
readonly mountKey: string;
|
|
14
|
+
readonly slot: LogicalWorkspaceSlot;
|
|
15
|
+
readonly placement: UnsupportedPlacement;
|
|
16
|
+
}
|
|
17
|
+
export interface RuntimeAssessedWorkspaceMountPlan extends WorkspaceMountPlan {
|
|
18
|
+
readonly runtimeKind: WorkerRuntimeKind;
|
|
19
|
+
readonly runtimeLayoutRevision: string;
|
|
20
|
+
readonly runtimeLayoutProfileRef: string;
|
|
21
|
+
readonly staticDependencyClosureHash: string;
|
|
22
|
+
readonly unsupportedOptionalEntries: readonly ExplicitlyUnsupportedOptionalEntry[];
|
|
23
|
+
}
|
|
11
24
|
export declare class DefaultWorkspaceImageComposer implements WorkspaceImageComposer {
|
|
12
|
-
|
|
25
|
+
private readonly runtimeLayout;
|
|
26
|
+
private readonly optionalMountKeys;
|
|
27
|
+
constructor(runtimeLayout: RuntimeLayoutAdapter, optionalMountKeys?: ReadonlySet<string>);
|
|
28
|
+
compose(req: ComposeWorkspaceImageRequest): Promise<RuntimeAssessedWorkspaceMountPlan>;
|
|
29
|
+
}
|
|
30
|
+
export interface CompileLogicalWorkspacePlanInput {
|
|
31
|
+
readonly applySeed: string;
|
|
32
|
+
readonly entries: readonly LogicalMountPlanEntry[];
|
|
33
|
+
readonly runtimeLayout: RuntimeLayoutAdapter;
|
|
34
|
+
readonly optionalMountKeys?: ReadonlySet<string>;
|
|
13
35
|
}
|
|
36
|
+
export declare function compileLogicalWorkspacePlan(input: CompileLogicalWorkspacePlanInput): RuntimeAssessedWorkspaceMountPlan;
|
|
14
37
|
//# sourceMappingURL=composer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composer.d.ts","sourceRoot":"","sources":["../../src/lib/composer.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"composer.d.ts","sourceRoot":"","sources":["../../src/lib/composer.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,oBAAoB,EAGpB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACxB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAGL,iBAAiB,EACjB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EAC1B,MAAM,yCAAyC,CAAC;AAajD,OAAO,KAAK,EACV,4BAA4B,EAC5B,sBAAsB,EACvB,MAAM,SAAS,CAAC;AAmFjB,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,kCAAkC;IACjD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,oBAAoB,CAAC;IACpC,QAAQ,CAAC,SAAS,EAAE,oBAAoB,CAAC;CAC1C;AAED,MAAM,WAAW,iCAAkC,SAAQ,kBAAkB;IAC3E,QAAQ,CAAC,WAAW,EAAE,iBAAiB,CAAC;IACxC,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAC;IACvC,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;IACzC,QAAQ,CAAC,2BAA2B,EAAE,MAAM,CAAC;IAC7C,QAAQ,CAAC,0BAA0B,EAAE,SAAS,kCAAkC,EAAE,CAAC;CACpF;AAED,qBAAa,6BAA8B,YAAW,sBAAsB;IAExE,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;gBADjB,aAAa,EAAE,oBAAoB,EACnC,iBAAiB,GAAE,WAAW,CAAC,MAAM,CAAa;IAG/D,OAAO,CACX,GAAG,EAAE,4BAA4B,GAChC,OAAO,CAAC,iCAAiC,CAAC;CAmc9C;AAsDD,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,SAAS,qBAAqB,EAAE,CAAC;IACnD,QAAQ,CAAC,aAAa,EAAE,oBAAoB,CAAC;IAC7C,QAAQ,CAAC,iBAAiB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAClD;AAED,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,gCAAgC,GACtC,iCAAiC,CAqDnC"}
|
package/dist/lib/composer.js
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DefaultWorkspaceImageComposer = void 0;
|
|
4
|
+
exports.compileLogicalWorkspacePlan = compileLogicalWorkspacePlan;
|
|
4
5
|
const node_crypto_1 = require("node:crypto");
|
|
5
6
|
const agent_workspace_1 = require("@xemahq/kernel-contracts/agent-workspace");
|
|
7
|
+
const worker_runtime_1 = require("@xemahq/kernel-contracts/worker-runtime");
|
|
6
8
|
const workflow_1 = require("@xemahq/kernel-contracts/workflow");
|
|
7
9
|
const errors_1 = require("./errors");
|
|
8
10
|
class DefaultWorkspaceImageComposer {
|
|
11
|
+
runtimeLayout;
|
|
12
|
+
optionalMountKeys;
|
|
13
|
+
constructor(runtimeLayout, optionalMountKeys = new Set()) {
|
|
14
|
+
this.runtimeLayout = runtimeLayout;
|
|
15
|
+
this.optionalMountKeys = optionalMountKeys;
|
|
16
|
+
}
|
|
9
17
|
async compose(req) {
|
|
10
18
|
const hasWorkflow = req.workflowRun !== undefined;
|
|
11
19
|
const hasInteractive = req.interactive !== undefined;
|
|
@@ -32,6 +40,7 @@ class DefaultWorkspaceImageComposer {
|
|
|
32
40
|
const deliverableSpecRef = req.agentOverrides?.deliverableSpecRef ??
|
|
33
41
|
req.manifest.agent.deliverableSpecRef ??
|
|
34
42
|
ctx.deliverableSpecRef;
|
|
43
|
+
assertNoSecretOrBindingMaterial(req);
|
|
35
44
|
const entries = [];
|
|
36
45
|
const workflowInputs = isWorkflowSurface
|
|
37
46
|
? pickWorkflowInputs(req.agentContext)
|
|
@@ -46,8 +55,12 @@ class DefaultWorkspaceImageComposer {
|
|
|
46
55
|
stageKey: req.manifest.agent.stageKey,
|
|
47
56
|
role,
|
|
48
57
|
...(deliverableSpecRef === undefined ? {} : { deliverableSpecRef }),
|
|
49
|
-
...(req.workflowRun?.runId === undefined
|
|
50
|
-
|
|
58
|
+
...(req.workflowRun?.runId === undefined
|
|
59
|
+
? {}
|
|
60
|
+
: { runId: req.workflowRun.runId }),
|
|
61
|
+
...(req.workflowRun?.jobRunId === undefined
|
|
62
|
+
? {}
|
|
63
|
+
: { jobRunId: req.workflowRun.jobRunId }),
|
|
51
64
|
...(req.interactive?.sessionId === undefined
|
|
52
65
|
? {}
|
|
53
66
|
: { sessionId: req.interactive.sessionId }),
|
|
@@ -61,75 +74,81 @@ class DefaultWorkspaceImageComposer {
|
|
|
61
74
|
: { workingFiles: renderedWorkingFiles }),
|
|
62
75
|
};
|
|
63
76
|
entries.push(buildEntry({
|
|
64
|
-
slot: agent_workspace_1.
|
|
77
|
+
slot: agent_workspace_1.LogicalWorkspaceSlot.AgentContext,
|
|
65
78
|
relPath: '',
|
|
66
79
|
mode: agent_workspace_1.WorkspaceMountMode.ReadOnly,
|
|
67
80
|
mountKey: 'agents-md',
|
|
68
81
|
source: { kind: 'rendered-agents-md', ...renderedSourceParams },
|
|
69
82
|
}));
|
|
83
|
+
if (ctx.runtimeConfig !== undefined) {
|
|
84
|
+
assertRuntimeConfigExcludesImageOwnedContent(ctx.runtimeConfig);
|
|
85
|
+
entries.push(buildCanonicalConfigEntry(agent_workspace_1.LogicalWorkspaceSlot.RuntimeConfig, 'runtime-config', 'runtime-config.json', ctx.runtimeConfig));
|
|
86
|
+
}
|
|
87
|
+
if (ctx.mcpConfig !== undefined) {
|
|
88
|
+
entries.push(buildCanonicalConfigEntry(agent_workspace_1.LogicalWorkspaceSlot.McpConfig, 'mcp-config', 'mcp-config.json', ctx.mcpConfig));
|
|
89
|
+
}
|
|
70
90
|
entries.push(buildEntry({
|
|
71
|
-
slot: agent_workspace_1.
|
|
91
|
+
slot: agent_workspace_1.LogicalWorkspaceSlot.AgentContext,
|
|
72
92
|
relPath: '',
|
|
73
93
|
mode: agent_workspace_1.WorkspaceMountMode.ReadOnly,
|
|
74
94
|
mountKey: 'context-json',
|
|
75
95
|
source: { kind: 'rendered-context-json', ...renderedSourceParams },
|
|
76
96
|
}));
|
|
77
97
|
entries.push(buildEntry({
|
|
78
|
-
slot: agent_workspace_1.
|
|
98
|
+
slot: agent_workspace_1.LogicalWorkspaceSlot.SystemOverlay,
|
|
79
99
|
relPath: '',
|
|
80
100
|
mode: agent_workspace_1.WorkspaceMountMode.ReadOnly,
|
|
81
101
|
mountKey: 'system-overlay',
|
|
82
102
|
source: { kind: 'rendered-system-overlay', ...renderedSourceParams },
|
|
83
103
|
}));
|
|
84
104
|
entries.push(buildEntry({
|
|
85
|
-
slot: agent_workspace_1.
|
|
105
|
+
slot: agent_workspace_1.LogicalWorkspaceSlot.Temporary,
|
|
86
106
|
relPath: '.keep',
|
|
87
107
|
mode: agent_workspace_1.WorkspaceMountMode.ReadWrite,
|
|
88
108
|
mountKey: 'tmp:seed',
|
|
89
109
|
source: {
|
|
90
110
|
kind: 'static-literal',
|
|
91
|
-
pathWithinWorkspace: '
|
|
111
|
+
pathWithinWorkspace: '.keep',
|
|
92
112
|
bytes: '',
|
|
93
113
|
},
|
|
94
114
|
}));
|
|
95
|
-
|
|
115
|
+
entries.push(buildEntry({
|
|
116
|
+
slot: agent_workspace_1.LogicalWorkspaceSlot.AgentDefinitions,
|
|
117
|
+
relPath: `${req.manifest.agent.slug}.md`,
|
|
118
|
+
mode: agent_workspace_1.WorkspaceMountMode.ReadOnly,
|
|
119
|
+
mountKey: `agent-bundle:${req.manifest.agent.slug}`,
|
|
120
|
+
source: {
|
|
121
|
+
kind: 'agent-kernel',
|
|
122
|
+
orgId: req.orgId,
|
|
123
|
+
agentSlug: req.manifest.agent.slug,
|
|
124
|
+
stageKey: req.manifest.agent.stageKey,
|
|
125
|
+
agentMode: 'primary',
|
|
126
|
+
},
|
|
127
|
+
}));
|
|
128
|
+
for (const sub of dedupe(ctx.delegatedSubAgents ?? [])) {
|
|
129
|
+
if (sub === req.manifest.agent.slug) {
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
96
132
|
entries.push(buildEntry({
|
|
97
|
-
slot: agent_workspace_1.
|
|
98
|
-
relPath: `${
|
|
133
|
+
slot: agent_workspace_1.LogicalWorkspaceSlot.AgentDefinitions,
|
|
134
|
+
relPath: `${sub}.md`,
|
|
99
135
|
mode: agent_workspace_1.WorkspaceMountMode.ReadOnly,
|
|
100
|
-
mountKey: `agent-bundle:${
|
|
136
|
+
mountKey: `agent-bundle:${sub}`,
|
|
101
137
|
source: {
|
|
102
138
|
kind: 'agent-kernel',
|
|
103
139
|
orgId: req.orgId,
|
|
104
|
-
agentSlug:
|
|
140
|
+
agentSlug: sub,
|
|
105
141
|
stageKey: req.manifest.agent.stageKey,
|
|
106
|
-
agentMode: '
|
|
142
|
+
agentMode: 'subagent',
|
|
107
143
|
},
|
|
108
144
|
}));
|
|
109
|
-
for (const sub of ctx.delegatedSubAgents ?? []) {
|
|
110
|
-
if (sub === req.manifest.agent.slug)
|
|
111
|
-
continue;
|
|
112
|
-
entries.push(buildEntry({
|
|
113
|
-
slot: agent_workspace_1.WorkspaceMount.AgentBundles,
|
|
114
|
-
relPath: `${sub}.md`,
|
|
115
|
-
mode: agent_workspace_1.WorkspaceMountMode.ReadOnly,
|
|
116
|
-
mountKey: `agent-bundle:${sub}`,
|
|
117
|
-
source: {
|
|
118
|
-
kind: 'agent-kernel',
|
|
119
|
-
orgId: req.orgId,
|
|
120
|
-
agentSlug: sub,
|
|
121
|
-
stageKey: req.manifest.agent.stageKey,
|
|
122
|
-
agentMode: 'subagent',
|
|
123
|
-
},
|
|
124
|
-
}));
|
|
125
|
-
}
|
|
126
145
|
}
|
|
127
146
|
for (const skillKey of dedupe([
|
|
128
147
|
...(req.systemSkillSlugs ?? []),
|
|
129
148
|
...(ctx.skills ?? []),
|
|
130
149
|
])) {
|
|
131
150
|
entries.push(buildEntry({
|
|
132
|
-
slot: agent_workspace_1.
|
|
151
|
+
slot: agent_workspace_1.LogicalWorkspaceSlot.SkillBundles,
|
|
133
152
|
relPath: skillKey,
|
|
134
153
|
mode: agent_workspace_1.WorkspaceMountMode.ReadOnly,
|
|
135
154
|
mountKey: `skill-bundle:${skillKey}`,
|
|
@@ -140,20 +159,22 @@ class DefaultWorkspaceImageComposer {
|
|
|
140
159
|
}));
|
|
141
160
|
const commandRelPath = `${skillKey}.md`;
|
|
142
161
|
entries.push(buildEntry({
|
|
143
|
-
slot: agent_workspace_1.
|
|
162
|
+
slot: agent_workspace_1.LogicalWorkspaceSlot.SkillCommands,
|
|
144
163
|
relPath: commandRelPath,
|
|
145
164
|
mode: agent_workspace_1.WorkspaceMountMode.ReadOnly,
|
|
146
165
|
mountKey: `skill-command:${skillKey}`,
|
|
147
|
-
source:
|
|
148
|
-
kind: '
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
166
|
+
source: this.runtimeLayout.runtimeKind === worker_runtime_1.WorkerRuntimeKind.Qwen
|
|
167
|
+
? { kind: 'skill-bundle', skillKey }
|
|
168
|
+
: {
|
|
169
|
+
kind: 'static-literal',
|
|
170
|
+
pathWithinWorkspace: commandRelPath,
|
|
171
|
+
bytes: Buffer.from(renderSkillCommand(skillKey), 'utf8').toString('base64'),
|
|
172
|
+
},
|
|
152
173
|
}));
|
|
153
174
|
}
|
|
154
175
|
for (const sectionKey of dedupe(ctx.instructions ?? [])) {
|
|
155
176
|
entries.push(buildEntry({
|
|
156
|
-
slot: agent_workspace_1.
|
|
177
|
+
slot: agent_workspace_1.LogicalWorkspaceSlot.Instructions,
|
|
157
178
|
relPath: `${sectionKey}.md`,
|
|
158
179
|
mode: agent_workspace_1.WorkspaceMountMode.ReadOnly,
|
|
159
180
|
mountKey: `instruction:${sectionKey}`,
|
|
@@ -175,16 +196,15 @@ class DefaultWorkspaceImageComposer {
|
|
|
175
196
|
throw new Error(`WorkspaceImageComposer: agentContext.inputArtifacts targets slot '${slotKey}' but the manifest '${req.manifest.slug}@${req.manifest.version}' does not enable it. ` +
|
|
176
197
|
`Enable the slot in the agent manifest or change the inputArtifact's 'slot' to one of: [${[...enabledSlots].join(', ') || '(none)'}].`);
|
|
177
198
|
}
|
|
178
|
-
const slotDef =
|
|
179
|
-
if (!slotDef) {
|
|
180
|
-
throw new errors_1.UnknownSlotError(slotKey, 'inputArtifacts', req.manifest.slug, req.manifest.version);
|
|
181
|
-
}
|
|
199
|
+
const slotDef = requireLogicalSlot(slotKey, 'inputArtifacts', req.manifest.slug, req.manifest.version);
|
|
182
200
|
const fileName = ia.fileName.trim();
|
|
183
|
-
if (fileName.length === 0 ||
|
|
201
|
+
if (fileName.length === 0 ||
|
|
202
|
+
fileName.includes('..') ||
|
|
203
|
+
fileName.startsWith('/')) {
|
|
184
204
|
throw new Error(`WorkspaceImageComposer: inputArtifact fileName '${ia.fileName}' is invalid — must be a non-empty relative path without '..' segments.`);
|
|
185
205
|
}
|
|
186
206
|
entries.push(buildEntry({
|
|
187
|
-
slot: slotDef.
|
|
207
|
+
slot: slotDef.slot,
|
|
188
208
|
relPath: fileName,
|
|
189
209
|
mode: agent_workspace_1.WorkspaceMountMode.ReadOnly,
|
|
190
210
|
mountKey: `input-artifact:${ia.artifactId}:v${ia.version}:${fileName}`,
|
|
@@ -193,24 +213,27 @@ class DefaultWorkspaceImageComposer {
|
|
|
193
213
|
artifactId: ia.artifactId,
|
|
194
214
|
version: ia.version,
|
|
195
215
|
fileName,
|
|
196
|
-
...(ia.payloadField !== undefined && {
|
|
197
|
-
|
|
216
|
+
...(ia.payloadField !== undefined && {
|
|
217
|
+
payloadField: ia.payloadField,
|
|
218
|
+
}),
|
|
219
|
+
...(ia.contentType !== undefined && {
|
|
220
|
+
contentType: ia.contentType,
|
|
221
|
+
}),
|
|
198
222
|
},
|
|
199
223
|
}));
|
|
200
224
|
}
|
|
201
225
|
for (const [slotKey, decl] of Object.entries(req.manifest.mounts)) {
|
|
202
226
|
if (!decl.enabled)
|
|
203
227
|
continue;
|
|
204
|
-
const slotDef =
|
|
205
|
-
if (!slotDef) {
|
|
206
|
-
throw new errors_1.UnknownSlotError(slotKey, 'manifest.mounts', req.manifest.slug, req.manifest.version);
|
|
207
|
-
}
|
|
228
|
+
const slotDef = requireLogicalSlot(slotKey, 'manifest.mounts', req.manifest.slug, req.manifest.version);
|
|
208
229
|
const mode = decl.mode ?? slotDef.defaultMode;
|
|
209
|
-
const mountMode = mode === 'read-write'
|
|
230
|
+
const mountMode = mode === 'read-write'
|
|
231
|
+
? agent_workspace_1.WorkspaceMountMode.ReadWrite
|
|
232
|
+
: agent_workspace_1.WorkspaceMountMode.ReadOnly;
|
|
210
233
|
const sources = extractMountSourcesForSlot(slotKey, decl, ctx, deliverableSpecRef, req.briefcase, isWorkflowSurface);
|
|
211
234
|
for (const { source, relPath, mountKey } of sources) {
|
|
212
235
|
entries.push(buildEntry({
|
|
213
|
-
slot: slotDef.
|
|
236
|
+
slot: slotDef.slot,
|
|
214
237
|
relPath,
|
|
215
238
|
mode: mountMode,
|
|
216
239
|
mountKey,
|
|
@@ -224,10 +247,7 @@ class DefaultWorkspaceImageComposer {
|
|
|
224
247
|
`[${req.manifest.requiredTemplateNames.join(', ')}] but no templateResolver was supplied.`);
|
|
225
248
|
}
|
|
226
249
|
for (const sf of req.manifest.seedFiles) {
|
|
227
|
-
const slotDef =
|
|
228
|
-
if (!slotDef) {
|
|
229
|
-
throw new errors_1.UnknownSlotError(sf.slot, 'manifest.seedFiles', req.manifest.slug, req.manifest.version);
|
|
230
|
-
}
|
|
250
|
+
const slotDef = requireLogicalSlot(sf.slot, 'manifest.seedFiles', req.manifest.slug, req.manifest.version);
|
|
231
251
|
let bytesBase64;
|
|
232
252
|
if (sf.source.kind === 'inline') {
|
|
233
253
|
bytesBase64 = sf.source.bytesBase64;
|
|
@@ -237,7 +257,7 @@ class DefaultWorkspaceImageComposer {
|
|
|
237
257
|
bytesBase64 = Buffer.from(rendered, 'utf8').toString('base64');
|
|
238
258
|
}
|
|
239
259
|
entries.push(buildEntry({
|
|
240
|
-
slot: slotDef.
|
|
260
|
+
slot: slotDef.slot,
|
|
241
261
|
relPath: sf.relPath,
|
|
242
262
|
mode: agent_workspace_1.WorkspaceMountMode.ReadOnly,
|
|
243
263
|
mountKey: `seed:${sf.slot}:${sf.relPath}`,
|
|
@@ -248,10 +268,7 @@ class DefaultWorkspaceImageComposer {
|
|
|
248
268
|
},
|
|
249
269
|
}));
|
|
250
270
|
}
|
|
251
|
-
return
|
|
252
|
-
applyId: deriveApplyId(req),
|
|
253
|
-
entries,
|
|
254
|
-
};
|
|
271
|
+
return finalizeLogicalPlan(req, entries, this.runtimeLayout, this.optionalMountKeys);
|
|
255
272
|
}
|
|
256
273
|
}
|
|
257
274
|
exports.DefaultWorkspaceImageComposer = DefaultWorkspaceImageComposer;
|
|
@@ -277,6 +294,87 @@ function deriveApplyId(req) {
|
|
|
277
294
|
];
|
|
278
295
|
return (0, node_crypto_1.createHash)('sha256').update(components.join(':')).digest('hex');
|
|
279
296
|
}
|
|
297
|
+
function finalizeLogicalPlan(req, entries, runtimeLayout, optionalMountKeys) {
|
|
298
|
+
return compileLogicalWorkspacePlan({
|
|
299
|
+
applySeed: deriveApplyId(req),
|
|
300
|
+
entries,
|
|
301
|
+
runtimeLayout,
|
|
302
|
+
optionalMountKeys,
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
function compileLogicalWorkspacePlan(input) {
|
|
306
|
+
const { applySeed, entries, runtimeLayout } = input;
|
|
307
|
+
const optionalMountKeys = input.optionalMountKeys ?? new Set();
|
|
308
|
+
const ordered = [...entries].sort(compareLogicalEntries);
|
|
309
|
+
const seenMountKeys = new Set();
|
|
310
|
+
const supported = [];
|
|
311
|
+
const unsupportedOptionalEntries = [];
|
|
312
|
+
for (const entry of ordered) {
|
|
313
|
+
assertNoSecretOrBindingMaterial(entry.source);
|
|
314
|
+
agent_workspace_1.LogicalMountPlanEntrySchema.parse(entry);
|
|
315
|
+
if (seenMountKeys.has(entry.mountKey)) {
|
|
316
|
+
throw new Error(`DUPLICATE_LOGICAL_MOUNT_KEY:${entry.mountKey}`);
|
|
317
|
+
}
|
|
318
|
+
seenMountKeys.add(entry.mountKey);
|
|
319
|
+
const placement = runtimeLayout.assess(entry);
|
|
320
|
+
if (placement.assessment === worker_runtime_1.RuntimePlacementAssessment.Unsupported) {
|
|
321
|
+
if (!optionalMountKeys.has(entry.mountKey)) {
|
|
322
|
+
throw new worker_runtime_1.UnsupportedRuntimePlacementError(placement);
|
|
323
|
+
}
|
|
324
|
+
unsupportedOptionalEntries.push({
|
|
325
|
+
mountKey: entry.mountKey,
|
|
326
|
+
slot: entry.slot,
|
|
327
|
+
placement,
|
|
328
|
+
});
|
|
329
|
+
continue;
|
|
330
|
+
}
|
|
331
|
+
supported.push(entry);
|
|
332
|
+
}
|
|
333
|
+
const closure = {
|
|
334
|
+
schemaVersion: 1,
|
|
335
|
+
runtimeKind: runtimeLayout.runtimeKind,
|
|
336
|
+
runtimeLayoutRevision: runtimeLayout.revision,
|
|
337
|
+
runtimeLayoutProfileRef: runtimeLayout.profileRef,
|
|
338
|
+
entries: supported,
|
|
339
|
+
unsupportedOptionalEntries,
|
|
340
|
+
};
|
|
341
|
+
const staticDependencyClosureHash = (0, node_crypto_1.createHash)('sha256')
|
|
342
|
+
.update(JSON.stringify(stableSort(closure)))
|
|
343
|
+
.digest('hex');
|
|
344
|
+
const applyId = (0, node_crypto_1.createHash)('sha256')
|
|
345
|
+
.update(`${applySeed}:${staticDependencyClosureHash}`)
|
|
346
|
+
.digest('hex');
|
|
347
|
+
return {
|
|
348
|
+
applyId,
|
|
349
|
+
entries: supported,
|
|
350
|
+
runtimeKind: runtimeLayout.runtimeKind,
|
|
351
|
+
runtimeLayoutRevision: runtimeLayout.revision,
|
|
352
|
+
runtimeLayoutProfileRef: runtimeLayout.profileRef,
|
|
353
|
+
staticDependencyClosureHash,
|
|
354
|
+
unsupportedOptionalEntries,
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
function compareLogicalEntries(left, right) {
|
|
358
|
+
const leftKey = `${left.slot}\u0000${left.relPath}\u0000${left.mountKey}`;
|
|
359
|
+
const rightKey = `${right.slot}\u0000${right.relPath}\u0000${right.mountKey}`;
|
|
360
|
+
return leftKey === rightKey ? 0 : leftKey < rightKey ? -1 : 1;
|
|
361
|
+
}
|
|
362
|
+
const FORBIDDEN_MATERIAL_KEY = /(?:secret|password|accessToken|refreshToken|credentialLease|runtimeBinding|sessionBinding)/i;
|
|
363
|
+
function assertNoSecretOrBindingMaterial(value, path = 'input') {
|
|
364
|
+
if (value === null || typeof value !== 'object') {
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
if (Array.isArray(value)) {
|
|
368
|
+
value.forEach((member, index) => assertNoSecretOrBindingMaterial(member, `${path}[${index}]`));
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
371
|
+
for (const [key, member] of Object.entries(value)) {
|
|
372
|
+
if (FORBIDDEN_MATERIAL_KEY.test(key) && member !== undefined) {
|
|
373
|
+
throw new Error(`FORBIDDEN_RUNTIME_MATERIAL:${path}.${key}`);
|
|
374
|
+
}
|
|
375
|
+
assertNoSecretOrBindingMaterial(member, `${path}.${key}`);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
280
378
|
function deriveManifestContentHash(manifest) {
|
|
281
379
|
const projection = {
|
|
282
380
|
agent: manifest.agent,
|
|
@@ -323,6 +421,27 @@ function buildEntry(args) {
|
|
|
323
421
|
source: args.source,
|
|
324
422
|
};
|
|
325
423
|
}
|
|
424
|
+
function buildCanonicalConfigEntry(slot, mountKey, sourceName, value) {
|
|
425
|
+
assertNoSecretOrBindingMaterial(value, mountKey);
|
|
426
|
+
return buildEntry({
|
|
427
|
+
slot,
|
|
428
|
+
relPath: '',
|
|
429
|
+
mode: agent_workspace_1.WorkspaceMountMode.ReadOnly,
|
|
430
|
+
mountKey,
|
|
431
|
+
source: {
|
|
432
|
+
kind: 'static-literal',
|
|
433
|
+
pathWithinWorkspace: sourceName,
|
|
434
|
+
bytes: Buffer.from(JSON.stringify(stableSort(value)), 'utf8').toString('base64'),
|
|
435
|
+
},
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
function assertRuntimeConfigExcludesImageOwnedContent(config) {
|
|
439
|
+
for (const key of ['plugins', 'tools']) {
|
|
440
|
+
if (config[key] !== undefined) {
|
|
441
|
+
throw new Error(`RUNTIME_IMAGE_OWNED_CONTENT:${key}`);
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
}
|
|
326
445
|
function extractMountSourcesForSlot(slotKey, _decl, ctx, deliverableSpecRef, briefcase, isWorkflowSurface) {
|
|
327
446
|
switch (slotKey) {
|
|
328
447
|
case 'inputs':
|
|
@@ -395,7 +514,10 @@ function extractMountSourcesForSlot(slotKey, _decl, ctx, deliverableSpecRef, bri
|
|
|
395
514
|
return [];
|
|
396
515
|
return [
|
|
397
516
|
{
|
|
398
|
-
source: {
|
|
517
|
+
source: {
|
|
518
|
+
kind: 'deliverable-specs',
|
|
519
|
+
contractKey: deliverableSpecRef,
|
|
520
|
+
},
|
|
399
521
|
relPath: deliverableSpecRef,
|
|
400
522
|
mountKey: `deliverable-specs:${deliverableSpecRef}`,
|
|
401
523
|
},
|
|
@@ -433,7 +555,9 @@ function extractBriefcaseUploadMounts(uploads) {
|
|
|
433
555
|
return [];
|
|
434
556
|
return uploads.map((u) => {
|
|
435
557
|
const fileName = u.filename.trim();
|
|
436
|
-
if (fileName.length === 0 ||
|
|
558
|
+
if (fileName.length === 0 ||
|
|
559
|
+
fileName.includes('..') ||
|
|
560
|
+
fileName.startsWith('/')) {
|
|
437
561
|
throw new Error(`WorkspaceImageComposer: briefcase upload filename '${u.filename}' is invalid — must be a non-empty relative path without '..' segments.`);
|
|
438
562
|
}
|
|
439
563
|
return {
|
|
@@ -520,15 +644,44 @@ function briefcaseReferenceToMount(ref) {
|
|
|
520
644
|
throw new Error(`Unhandled briefcase reference kind '${ref.kind}'.`);
|
|
521
645
|
}
|
|
522
646
|
}
|
|
523
|
-
|
|
524
|
-
|
|
647
|
+
const MANIFEST_LOGICAL_SLOTS = Object.freeze({
|
|
648
|
+
inputs: { slot: agent_workspace_1.LogicalWorkspaceSlot.Inputs, defaultMode: 'read-only' },
|
|
649
|
+
tmp: { slot: agent_workspace_1.LogicalWorkspaceSlot.Temporary, defaultMode: 'read-write' },
|
|
650
|
+
deliverables: {
|
|
651
|
+
slot: agent_workspace_1.LogicalWorkspaceSlot.Deliverables,
|
|
652
|
+
defaultMode: 'read-write',
|
|
653
|
+
},
|
|
654
|
+
'deliverable-specs': {
|
|
655
|
+
slot: agent_workspace_1.LogicalWorkspaceSlot.DeliverableSpecs,
|
|
656
|
+
defaultMode: 'read-only',
|
|
657
|
+
},
|
|
658
|
+
references: {
|
|
659
|
+
slot: agent_workspace_1.LogicalWorkspaceSlot.References,
|
|
660
|
+
defaultMode: 'read-only',
|
|
661
|
+
},
|
|
662
|
+
repos: {
|
|
663
|
+
slot: agent_workspace_1.LogicalWorkspaceSlot.Repositories,
|
|
664
|
+
defaultMode: 'read-write',
|
|
665
|
+
},
|
|
666
|
+
uploads: {
|
|
667
|
+
slot: agent_workspace_1.LogicalWorkspaceSlot.Uploads,
|
|
668
|
+
defaultMode: 'read-only',
|
|
669
|
+
},
|
|
670
|
+
});
|
|
671
|
+
function requireLogicalSlot(key, source, manifestSlug, manifestVersion) {
|
|
672
|
+
const slot = MANIFEST_LOGICAL_SLOTS[key];
|
|
673
|
+
if (!slot) {
|
|
674
|
+
throw new errors_1.UnknownSlotError(key, source, manifestSlug, manifestVersion);
|
|
675
|
+
}
|
|
676
|
+
return slot;
|
|
525
677
|
}
|
|
526
|
-
void _assertSlotsCover;
|
|
527
678
|
function pickWorkflowInputs(agentContext) {
|
|
528
679
|
const COMPOSER_RESERVED = new Set([
|
|
529
680
|
'delegatedSubAgents',
|
|
530
681
|
'skills',
|
|
531
682
|
'instructions',
|
|
683
|
+
'runtimeConfig',
|
|
684
|
+
'mcpConfig',
|
|
532
685
|
'inputsJsonBase64',
|
|
533
686
|
'kbSpaceIds',
|
|
534
687
|
'kbPageMounts',
|
|
@@ -556,11 +709,11 @@ function buildRenderedInputArtifacts(inputArtifacts) {
|
|
|
556
709
|
const out = [];
|
|
557
710
|
for (const ia of inputArtifacts) {
|
|
558
711
|
const slotKey = ia.slot ?? 'inputs';
|
|
559
|
-
const slotDef =
|
|
712
|
+
const slotDef = MANIFEST_LOGICAL_SLOTS[slotKey];
|
|
560
713
|
if (!slotDef)
|
|
561
714
|
continue;
|
|
562
715
|
out.push({
|
|
563
|
-
path: `${slotDef.
|
|
716
|
+
path: `${slotDef.slot}/${ia.fileName}`,
|
|
564
717
|
...(ia.contentType !== undefined && { contentType: ia.contentType }),
|
|
565
718
|
sourceArtifactId: ia.artifactId,
|
|
566
719
|
sourceVersion: ia.version,
|
|
@@ -571,26 +724,29 @@ function buildRenderedInputArtifacts(inputArtifacts) {
|
|
|
571
724
|
function buildRenderedWorkingFiles(workingFiles) {
|
|
572
725
|
if (!workingFiles || workingFiles.length === 0)
|
|
573
726
|
return [];
|
|
574
|
-
return workingFiles.map((wf) =>
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
727
|
+
return workingFiles.map((wf) => {
|
|
728
|
+
if (wf.path.startsWith('/') ||
|
|
729
|
+
/(^|\/)\.(?:opencode|qwen|claude|hermes)(\/|$)/.test(wf.path)) {
|
|
730
|
+
throw new Error(`NON_LOGICAL_WORKING_FILE_PATH:${wf.slug}:${wf.path}`);
|
|
731
|
+
}
|
|
732
|
+
return {
|
|
733
|
+
slug: wf.slug,
|
|
734
|
+
path: wf.path,
|
|
735
|
+
format: wf.format,
|
|
736
|
+
syncDirection: wf.syncDirection,
|
|
737
|
+
sourceKind: wf.sourceKind,
|
|
738
|
+
sourceRef: wf.sourceRef,
|
|
739
|
+
};
|
|
740
|
+
});
|
|
582
741
|
}
|
|
583
742
|
function buildRenderedMounts(mounts, manifestSlug, manifestVersion) {
|
|
584
743
|
const out = [];
|
|
585
744
|
for (const [slotKey, decl] of Object.entries(mounts)) {
|
|
586
745
|
if (!decl.enabled)
|
|
587
746
|
continue;
|
|
588
|
-
const slotDef =
|
|
589
|
-
if (!slotDef) {
|
|
590
|
-
throw new errors_1.UnknownSlotError(slotKey, 'rendered.mounts', manifestSlug, manifestVersion);
|
|
591
|
-
}
|
|
747
|
+
const slotDef = requireLogicalSlot(slotKey, 'rendered.mounts', manifestSlug, manifestVersion);
|
|
592
748
|
const mode = decl.mode ?? slotDef.defaultMode;
|
|
593
|
-
out.push({ mount: slotDef.
|
|
749
|
+
out.push({ mount: slotDef.slot, mode });
|
|
594
750
|
}
|
|
595
751
|
return out;
|
|
596
752
|
}
|