@xemahq/kernel-contracts 0.3.6 → 0.4.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/agent-composition/lib/composition-workspace.d.ts +4 -2
- package/dist/agent-composition/lib/composition-workspace.d.ts.map +1 -1
- package/dist/agent-composition/lib/composition-workspace.js.map +1 -1
- package/dist/agent-composition/lib/model-resolution-matrix.d.ts +3 -3
- package/dist/agent-composition/lib/model-resolution-matrix.js +1 -1
- package/dist/agent-workspace/awp-spec.json +1 -1
- package/dist/agent-workspace/lib/context-json.d.ts +1 -1
- package/dist/llm-gateway/lib/caller.d.ts +1 -1
- package/dist/workflow/lib/compiled-workspace-manifest.d.ts +1 -1
- package/dist/workflow/lib/errors.d.ts +1 -0
- package/dist/workflow/lib/errors.d.ts.map +1 -1
- package/dist/workflow/lib/errors.js +2 -0
- package/dist/workflow/lib/errors.js.map +1 -1
- package/dist/workflow/lib/mount-plan.d.ts +3 -3
- package/package.json +1 -1
- package/src/agent-composition/lib/composition-workspace.ts +28 -4
- package/src/agent-composition/lib/model-resolution-matrix.ts +9 -9
- package/src/agent-workspace/lib/context-json.ts +1 -1
- package/src/llm-gateway/lib/caller.ts +4 -4
- package/src/workflow/lib/compiled-run.ts +1 -1
- package/src/workflow/lib/compiled-workspace-manifest.ts +1 -1
- package/src/workflow/lib/errors.ts +15 -0
- package/src/workflow/lib/mount-plan.ts +3 -3
- package/src/workflow/lib/workflow-stage.ts +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { WorkingFileBinding, WorkspaceEnvVar, WorkspacePersistenceSpec } from '../../agent-workspace';
|
|
2
|
-
import type { AgentRunRole, OutputSurfaceKind } from '../../workflow';
|
|
2
|
+
import type { AgentRunRole, CompiledManifestCredential, CompiledManifestPermissions, OutputSurfaceKind } from '../../workflow';
|
|
3
3
|
export type { WorkingFileBinding, WorkspaceEnvVar, WorkspacePersistenceSpec, } from '../../agent-workspace';
|
|
4
4
|
export declare enum CompositionOutputSurfaceMode {
|
|
5
5
|
Single = "single",
|
|
@@ -15,7 +15,7 @@ export interface CompositionOutputSurface {
|
|
|
15
15
|
readonly defaultDocument?: string;
|
|
16
16
|
}
|
|
17
17
|
export interface CompositionAgentRunConfig {
|
|
18
|
-
readonly
|
|
18
|
+
readonly stage: string;
|
|
19
19
|
readonly role: AgentRunRole;
|
|
20
20
|
readonly deliverableSpecRef?: string;
|
|
21
21
|
}
|
|
@@ -31,5 +31,7 @@ export interface CompositionWorkspace {
|
|
|
31
31
|
readonly outputSurface?: CompositionOutputSurface;
|
|
32
32
|
readonly mountLayout?: CompositionMountLayout;
|
|
33
33
|
readonly workingFiles?: readonly WorkingFileBinding[];
|
|
34
|
+
readonly credentials?: readonly CompiledManifestCredential[];
|
|
35
|
+
readonly permissions?: CompiledManifestPermissions;
|
|
34
36
|
}
|
|
35
37
|
//# sourceMappingURL=composition-workspace.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composition-workspace.d.ts","sourceRoot":"","sources":["../../../src/agent-composition/lib/composition-workspace.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EACV,kBAAkB,EAClB,eAAe,EACf,wBAAwB,EACzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EAClB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EACV,kBAAkB,EAClB,eAAe,EACf,wBAAwB,GACzB,MAAM,uBAAuB,CAAC;AAQ/B,oBAAY,4BAA4B;IACtC,MAAM,WAAW;IACjB,KAAK,UAAU;CAChB;AAsBD,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACjC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAE7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAE5B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,CAAC,GAAG,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;IAK1C,QAAQ,CAAC,aAAa,CAAC,EAAE,wBAAwB,CAAC;IAQlD,QAAQ,CAAC,WAAW,CAAC,EAAE,sBAAsB,CAAC;IAgB9C,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAWtD,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,0BAA0B,EAAE,CAAC;IAW7D,QAAQ,CAAC,WAAW,CAAC,EAAE,2BAA2B,CAAC;CACpD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composition-workspace.js","sourceRoot":"","sources":["../../../src/agent-composition/lib/composition-workspace.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"composition-workspace.js","sourceRoot":"","sources":["../../../src/agent-composition/lib/composition-workspace.ts"],"names":[],"mappings":";;;AA6CA,IAAY,4BAGX;AAHD,WAAY,4BAA4B;IACtC,iDAAiB,CAAA;IACjB,+CAAe,CAAA;AACjB,CAAC,EAHW,4BAA4B,4CAA5B,4BAA4B,QAGvC"}
|
|
@@ -3,14 +3,14 @@ export declare enum ResolutionDimension {
|
|
|
3
3
|
Agent = "agent",
|
|
4
4
|
Skill = "skill",
|
|
5
5
|
Project = "project",
|
|
6
|
-
|
|
6
|
+
Stage = "stage",
|
|
7
7
|
Purpose = "purpose"
|
|
8
8
|
}
|
|
9
9
|
export interface ModelMatrixSelector {
|
|
10
10
|
readonly agent?: string;
|
|
11
11
|
readonly skill?: string;
|
|
12
12
|
readonly project?: string;
|
|
13
|
-
readonly
|
|
13
|
+
readonly stage?: string;
|
|
14
14
|
readonly purpose?: string;
|
|
15
15
|
readonly extra?: Readonly<Record<string, string>>;
|
|
16
16
|
}
|
|
@@ -24,7 +24,7 @@ export interface ModelResolutionContext {
|
|
|
24
24
|
readonly agentSlug: string;
|
|
25
25
|
readonly projectId?: string;
|
|
26
26
|
readonly skillSlug?: string;
|
|
27
|
-
readonly
|
|
27
|
+
readonly stageKey?: string;
|
|
28
28
|
readonly purpose?: string;
|
|
29
29
|
readonly extra?: Readonly<Record<string, string>>;
|
|
30
30
|
}
|
|
@@ -6,7 +6,7 @@ var ResolutionDimension;
|
|
|
6
6
|
ResolutionDimension["Agent"] = "agent";
|
|
7
7
|
ResolutionDimension["Skill"] = "skill";
|
|
8
8
|
ResolutionDimension["Project"] = "project";
|
|
9
|
-
ResolutionDimension["
|
|
9
|
+
ResolutionDimension["Stage"] = "stage";
|
|
10
10
|
ResolutionDimension["Purpose"] = "purpose";
|
|
11
11
|
})(ResolutionDimension || (exports.ResolutionDimension = ResolutionDimension = {}));
|
|
12
12
|
//# sourceMappingURL=model-resolution-matrix.js.map
|
|
@@ -8,7 +8,7 @@ export interface ContextInvocation {
|
|
|
8
8
|
readonly surface: InvocationSurface;
|
|
9
9
|
readonly attempt: number;
|
|
10
10
|
readonly runId: string | null;
|
|
11
|
-
readonly
|
|
11
|
+
readonly stageKey: string | null;
|
|
12
12
|
readonly sessionId: string | null;
|
|
13
13
|
}
|
|
14
14
|
export interface ContextAuthority {
|
|
@@ -28,7 +28,7 @@ export interface CompiledWorkspaceManifest {
|
|
|
28
28
|
}
|
|
29
29
|
export interface CompiledManifestAgent {
|
|
30
30
|
readonly slug: string;
|
|
31
|
-
readonly
|
|
31
|
+
readonly stageKey: string;
|
|
32
32
|
readonly role: AgentRunRole;
|
|
33
33
|
readonly deliverableSpecRef?: string;
|
|
34
34
|
readonly defaultModel?: ModelRef;
|
|
@@ -11,6 +11,7 @@ export declare enum WorkflowErrorCode {
|
|
|
11
11
|
DSL_UNKNOWN_DELIVERABLE_FIELD = "DSL_UNKNOWN_DELIVERABLE_FIELD",
|
|
12
12
|
DSL_VERSION_NOT_RESOLVABLE = "DSL_VERSION_NOT_RESOLVABLE",
|
|
13
13
|
DSL_PERMISSION_ESCALATION = "DSL_PERMISSION_ESCALATION",
|
|
14
|
+
DSL_VARS_BRIEFCASE_COLLISION = "DSL_VARS_BRIEFCASE_COLLISION",
|
|
14
15
|
DSL_MATRIX_KEY_NOT_DECLARED = "DSL_MATRIX_KEY_NOT_DECLARED",
|
|
15
16
|
DSL_INVALID_MATRIX_OUTPUT_ACCESS = "DSL_INVALID_MATRIX_OUTPUT_ACCESS",
|
|
16
17
|
DSL_FIELD_NOT_TYPED = "DSL_FIELD_NOT_TYPED",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/workflow/lib/errors.ts"],"names":[],"mappings":"AAUA,oBAAY,iBAAiB;IAE3B,kBAAkB,uBAAuB;IACzC,oBAAoB,yBAAyB;IAC7C,sBAAsB,2BAA2B;IACjD,kBAAkB,uBAAuB;IACzC,+BAA+B,oCAAoC;IACnE,kBAAkB,uBAAuB;IACzC,6BAA6B,kCAAkC;IAO/D,iBAAiB,sBAAsB;IAMvC,4BAA4B,iCAAiC;IAS7D,6BAA6B,kCAAkC;IAC/D,0BAA0B,+BAA+B;IACzD,yBAAyB,8BAA8B;
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/workflow/lib/errors.ts"],"names":[],"mappings":"AAUA,oBAAY,iBAAiB;IAE3B,kBAAkB,uBAAuB;IACzC,oBAAoB,yBAAyB;IAC7C,sBAAsB,2BAA2B;IACjD,kBAAkB,uBAAuB;IACzC,+BAA+B,oCAAoC;IACnE,kBAAkB,uBAAuB;IACzC,6BAA6B,kCAAkC;IAO/D,iBAAiB,sBAAsB;IAMvC,4BAA4B,iCAAiC;IAS7D,6BAA6B,kCAAkC;IAC/D,0BAA0B,+BAA+B;IACzD,yBAAyB,8BAA8B;IAcvD,4BAA4B,iCAAiC;IAO7D,2BAA2B,gCAAgC;IAS3D,gCAAgC,qCAAqC;IAWrE,mBAAmB,wBAAwB;IAM3C,uBAAuB,4BAA4B;IAGnD,gBAAgB,qBAAqB;IAOrC,2BAA2B,gCAAgC;IAG3D,qBAAqB,0BAA0B;IAC/C,yBAAyB,8BAA8B;IACvD,wBAAwB,6BAA6B;IACrD,4BAA4B,iCAAiC;IAC7D,+BAA+B,oCAAoC;IAMnE,4BAA4B,iCAAiC;IAM7D,uCAAuC,4CAA4C;IACnF,2BAA2B,gCAAgC;IAC3D,4BAA4B,iCAAiC;IAU7D,uBAAuB,4BAA4B;IASnD,6BAA6B,kCAAkC;IAS/D,0BAA0B,+BAA+B;IASzD,yBAAyB,8BAA8B;CACxD;AAGD,eAAO,MAAM,kCAAkC,EAAE,SAAS,iBAAiB,EAwBjE,CAAC"}
|
|
@@ -15,6 +15,7 @@ var WorkflowErrorCode;
|
|
|
15
15
|
WorkflowErrorCode["DSL_UNKNOWN_DELIVERABLE_FIELD"] = "DSL_UNKNOWN_DELIVERABLE_FIELD";
|
|
16
16
|
WorkflowErrorCode["DSL_VERSION_NOT_RESOLVABLE"] = "DSL_VERSION_NOT_RESOLVABLE";
|
|
17
17
|
WorkflowErrorCode["DSL_PERMISSION_ESCALATION"] = "DSL_PERMISSION_ESCALATION";
|
|
18
|
+
WorkflowErrorCode["DSL_VARS_BRIEFCASE_COLLISION"] = "DSL_VARS_BRIEFCASE_COLLISION";
|
|
18
19
|
WorkflowErrorCode["DSL_MATRIX_KEY_NOT_DECLARED"] = "DSL_MATRIX_KEY_NOT_DECLARED";
|
|
19
20
|
WorkflowErrorCode["DSL_INVALID_MATRIX_OUTPUT_ACCESS"] = "DSL_INVALID_MATRIX_OUTPUT_ACCESS";
|
|
20
21
|
WorkflowErrorCode["DSL_FIELD_NOT_TYPED"] = "DSL_FIELD_NOT_TYPED";
|
|
@@ -48,6 +49,7 @@ exports.NON_RETRYABLE_WORKFLOW_ERROR_CODES = [
|
|
|
48
49
|
WorkflowErrorCode.DSL_UNKNOWN_DELIVERABLE_FIELD,
|
|
49
50
|
WorkflowErrorCode.DSL_VERSION_NOT_RESOLVABLE,
|
|
50
51
|
WorkflowErrorCode.DSL_PERMISSION_ESCALATION,
|
|
52
|
+
WorkflowErrorCode.DSL_VARS_BRIEFCASE_COLLISION,
|
|
51
53
|
WorkflowErrorCode.DSL_MATRIX_KEY_NOT_DECLARED,
|
|
52
54
|
WorkflowErrorCode.DSL_INVALID_MATRIX_OUTPUT_ACCESS,
|
|
53
55
|
WorkflowErrorCode.DSL_FIELD_NOT_TYPED,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/workflow/lib/errors.ts"],"names":[],"mappings":";;;AAUA,IAAY,
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/workflow/lib/errors.ts"],"names":[],"mappings":";;;AAUA,IAAY,iBAoJX;AApJD,WAAY,iBAAiB;IAE3B,8DAAyC,CAAA;IACzC,kEAA6C,CAAA;IAC7C,sEAAiD,CAAA;IACjD,8DAAyC,CAAA;IACzC,wFAAmE,CAAA;IACnE,8DAAyC,CAAA;IACzC,oFAA+D,CAAA;IAO/D,4DAAuC,CAAA;IAMvC,kFAA6D,CAAA;IAS7D,oFAA+D,CAAA;IAC/D,8EAAyD,CAAA;IACzD,4EAAuD,CAAA;IAcvD,kFAA6D,CAAA;IAO7D,gFAA2D,CAAA;IAS3D,0FAAqE,CAAA;IAWrE,gEAA2C,CAAA;IAM3C,wEAAmD,CAAA;IAGnD,0DAAqC,CAAA;IAOrC,gFAA2D,CAAA;IAG3D,oEAA+C,CAAA;IAC/C,4EAAuD,CAAA;IACvD,0EAAqD,CAAA;IACrD,kFAA6D,CAAA;IAC7D,wFAAmE,CAAA;IAMnE,kFAA6D,CAAA;IAM7D,wGAAmF,CAAA;IACnF,gFAA2D,CAAA;IAC3D,kFAA6D,CAAA;IAU7D,wEAAmD,CAAA;IASnD,oFAA+D,CAAA;IAS/D,8EAAyD,CAAA;IASzD,4EAAuD,CAAA;AACzD,CAAC,EApJW,iBAAiB,iCAAjB,iBAAiB,QAoJ5B;AAGY,QAAA,kCAAkC,GAAiC;IAC9E,iBAAiB,CAAC,kBAAkB;IACpC,iBAAiB,CAAC,oBAAoB;IACtC,iBAAiB,CAAC,sBAAsB;IACxC,iBAAiB,CAAC,kBAAkB;IACpC,iBAAiB,CAAC,+BAA+B;IACjD,iBAAiB,CAAC,kBAAkB;IACpC,iBAAiB,CAAC,6BAA6B;IAC/C,iBAAiB,CAAC,iBAAiB;IACnC,iBAAiB,CAAC,4BAA4B;IAC9C,iBAAiB,CAAC,6BAA6B;IAC/C,iBAAiB,CAAC,0BAA0B;IAC5C,iBAAiB,CAAC,yBAAyB;IAC3C,iBAAiB,CAAC,4BAA4B;IAC9C,iBAAiB,CAAC,2BAA2B;IAC7C,iBAAiB,CAAC,gCAAgC;IAClD,iBAAiB,CAAC,mBAAmB;IACrC,iBAAiB,CAAC,uBAAuB;IACzC,iBAAiB,CAAC,yBAAyB;IAC3C,iBAAiB,CAAC,wBAAwB;IAC1C,iBAAiB,CAAC,+BAA+B;IACjD,iBAAiB,CAAC,4BAA4B;IAC9C,iBAAiB,CAAC,uCAAuC;IACzD,iBAAiB,CAAC,6BAA6B;CACvC,CAAC"}
|
|
@@ -53,7 +53,7 @@ export type MountSource = {
|
|
|
53
53
|
readonly kind: 'agent-definition';
|
|
54
54
|
readonly orgId: string;
|
|
55
55
|
readonly agentSlug: string;
|
|
56
|
-
readonly
|
|
56
|
+
readonly stageKey: string;
|
|
57
57
|
readonly agentMode: 'primary' | 'subagent';
|
|
58
58
|
} | {
|
|
59
59
|
readonly kind: 'skill-bundle';
|
|
@@ -63,7 +63,7 @@ export type MountSource = {
|
|
|
63
63
|
readonly orgId: string;
|
|
64
64
|
readonly sectionKey: string;
|
|
65
65
|
readonly agentSlug?: string;
|
|
66
|
-
readonly
|
|
66
|
+
readonly stageKey?: string;
|
|
67
67
|
} | ({
|
|
68
68
|
readonly kind: 'rendered-agents-md';
|
|
69
69
|
} & RenderedAgentRunContextParams) | ({
|
|
@@ -75,7 +75,7 @@ export interface RenderedAgentRunContextParams {
|
|
|
75
75
|
readonly orgId: string;
|
|
76
76
|
readonly projectId: string;
|
|
77
77
|
readonly agentSlug: string;
|
|
78
|
-
readonly
|
|
78
|
+
readonly stageKey: string;
|
|
79
79
|
readonly role: AgentRunRole;
|
|
80
80
|
readonly sessionId?: string;
|
|
81
81
|
readonly runId?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xemahq/kernel-contracts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Consolidated Xema OS kernel wire contracts — pure types + zod schemas for the 32 kernel protocol surfaces. One package, one npm scope, wildcard per-surface subpath exports. No framework/runtime deps.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/",
|
|
@@ -26,6 +26,8 @@ import type {
|
|
|
26
26
|
} from '../../agent-workspace';
|
|
27
27
|
import type {
|
|
28
28
|
AgentRunRole,
|
|
29
|
+
CompiledManifestCredential,
|
|
30
|
+
CompiledManifestPermissions,
|
|
29
31
|
OutputSurfaceKind,
|
|
30
32
|
} from '../../workflow';
|
|
31
33
|
|
|
@@ -91,17 +93,17 @@ export interface CompositionOutputSurface {
|
|
|
91
93
|
/**
|
|
92
94
|
* The agent run-config the composer needs that is NOT carried by the
|
|
93
95
|
* `CompositionNode` tree. The node tree pins WHICH agent runs; these
|
|
94
|
-
* three fields pin the run FRAMING (
|
|
96
|
+
* three fields pin the run FRAMING (stage + role + deliverable
|
|
95
97
|
* contract) the renderer + system-overlay are driven by.
|
|
96
98
|
*
|
|
97
|
-
* `role` is the canonical {@link AgentRunRole}. `
|
|
99
|
+
* `role` is the canonical {@link AgentRunRole}. `stage` /
|
|
98
100
|
* `deliverableSpecRef` are carried verbatim from the source manifest's
|
|
99
101
|
* `spec.agent` block — they MAY still hold a `${input.x}` token, which
|
|
100
102
|
* the workspace pipeline resolves against the run's bind inputs (the
|
|
101
103
|
* same fail-fast interpolation grammar `env` values use).
|
|
102
104
|
*/
|
|
103
105
|
export interface CompositionAgentRunConfig {
|
|
104
|
-
readonly
|
|
106
|
+
readonly stage: string;
|
|
105
107
|
readonly role: AgentRunRole;
|
|
106
108
|
readonly deliverableSpecRef?: string;
|
|
107
109
|
}
|
|
@@ -141,7 +143,7 @@ export interface CompositionMountLayout {
|
|
|
141
143
|
* slots are NEVER present — the composer auto-emits them.
|
|
142
144
|
*/
|
|
143
145
|
readonly mounts: Readonly<Record<string, unknown>>;
|
|
144
|
-
/** Agent run-config (
|
|
146
|
+
/** Agent run-config (stage + role + deliverable contract). */
|
|
145
147
|
readonly agentRunConfig: CompositionAgentRunConfig;
|
|
146
148
|
/**
|
|
147
149
|
* Raw `spec.seedFiles` array — manifest DSL `ManifestSeedFile`
|
|
@@ -207,4 +209,26 @@ export interface CompositionWorkspace {
|
|
|
207
209
|
* engine idle.
|
|
208
210
|
*/
|
|
209
211
|
readonly workingFiles?: readonly WorkingFileBinding[];
|
|
212
|
+
/**
|
|
213
|
+
* Authored external-credential requirements — the manifest's
|
|
214
|
+
* `spec.credentials` block, carried verbatim from the compiled
|
|
215
|
+
* manifest. The composition boot-seeder projects it from the source
|
|
216
|
+
* workspace manifest; the `agent-session-runtime` composer surfaces it
|
|
217
|
+
* onto the reconstructed manifest `spec` so the environment resolver
|
|
218
|
+
* (and resume drift detection) see the authored credential set.
|
|
219
|
+
* Optional + additive — compositions needing no credentials omit it.
|
|
220
|
+
* Was silently DROPPED at seed before (BUG-1).
|
|
221
|
+
*/
|
|
222
|
+
readonly credentials?: readonly CompiledManifestCredential[];
|
|
223
|
+
/**
|
|
224
|
+
* Authored tool allow/deny permission sets — the manifest's
|
|
225
|
+
* `spec.permissions` block, carried verbatim from the compiled
|
|
226
|
+
* manifest. Same seed → compose → resolve path as {@link credentials};
|
|
227
|
+
* consumed by the environment resolver + resume drift detection.
|
|
228
|
+
* Optional + additive. Distinct from the per-node
|
|
229
|
+
* {@link CompositionNode.permission} overlay — this is the workspace
|
|
230
|
+
* toolset policy, not the agent's permission map. Was silently DROPPED
|
|
231
|
+
* at seed before (BUG-1).
|
|
232
|
+
*/
|
|
233
|
+
readonly permissions?: CompiledManifestPermissions;
|
|
210
234
|
}
|
|
@@ -18,20 +18,20 @@
|
|
|
18
18
|
import type { ModelRef } from '../../workflow';
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
* Open registry of matrix dimensions. v1 ships agent/skill/project/
|
|
21
|
+
* Open registry of matrix dimensions. v1 ships agent/skill/project/stage;
|
|
22
22
|
* v1.1 adds `purpose` for non-agent invocations (memory summarization,
|
|
23
23
|
* embedding, reorganization). New dimensions are added here + carried in
|
|
24
24
|
* `ModelMatrixSelector.extra` (untyped) or as a typed first-class field.
|
|
25
25
|
*
|
|
26
|
-
* The `
|
|
27
|
-
* structural
|
|
28
|
-
* its `
|
|
26
|
+
* The `stage` dimension is the kernel-neutral name for a sub-app's
|
|
27
|
+
* structural workflow-stage tag on a job (e.g. the software-dev biome maps
|
|
28
|
+
* its `stageKey:` YAML field onto this dimension at compile time).
|
|
29
29
|
*/
|
|
30
30
|
export enum ResolutionDimension {
|
|
31
31
|
Agent = 'agent',
|
|
32
32
|
Skill = 'skill',
|
|
33
33
|
Project = 'project',
|
|
34
|
-
|
|
34
|
+
Stage = 'stage',
|
|
35
35
|
Purpose = 'purpose',
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -47,11 +47,11 @@ export interface ModelMatrixSelector {
|
|
|
47
47
|
/** Match when the invocation's project id equals this value. */
|
|
48
48
|
readonly project?: string;
|
|
49
49
|
/**
|
|
50
|
-
* Match when the invocation's structural
|
|
51
|
-
* Kernel-neutral name; the software-dev biome's `
|
|
50
|
+
* Match when the invocation's structural stage key equals this value.
|
|
51
|
+
* Kernel-neutral name; the software-dev biome's `stageKey:` YAML field
|
|
52
52
|
* is mapped onto this dimension by the DSL compiler.
|
|
53
53
|
*/
|
|
54
|
-
readonly
|
|
54
|
+
readonly stage?: string;
|
|
55
55
|
/**
|
|
56
56
|
* Match when the invocation's non-agent purpose equals this value. Used
|
|
57
57
|
* for system flows that route LLM calls outside the agent/skill model —
|
|
@@ -84,7 +84,7 @@ export interface ModelResolutionContext {
|
|
|
84
84
|
readonly agentSlug: string;
|
|
85
85
|
readonly projectId?: string;
|
|
86
86
|
readonly skillSlug?: string;
|
|
87
|
-
readonly
|
|
87
|
+
readonly stageKey?: string;
|
|
88
88
|
/**
|
|
89
89
|
* Non-agent invocation purpose (e.g. memory summarization/embedding).
|
|
90
90
|
* Optional — agent and skill invocations leave this undefined.
|
|
@@ -32,9 +32,9 @@ export enum LlmCallerKind {
|
|
|
32
32
|
* - `kind` + `id` together identify the originating object.
|
|
33
33
|
* - `orgId` is always present (billing/audit anchor).
|
|
34
34
|
* - `projectId` is set when the call is project-scoped (most are).
|
|
35
|
-
* - `
|
|
36
|
-
*
|
|
37
|
-
* maps its own `
|
|
35
|
+
* - `stageKey` is set when the caller is tied to a workflow's structural
|
|
36
|
+
* stage bucket. Kernel-neutral name; a sub-app biome (e.g. software-dev)
|
|
37
|
+
* maps its own `stageKey` YAML value onto this field at compile time.
|
|
38
38
|
*
|
|
39
39
|
* Adding new fields is non-breaking; renaming or repurposing existing
|
|
40
40
|
* ones is breaking and requires updates on both gateway and consumers.
|
|
@@ -44,5 +44,5 @@ export interface LlmCaller {
|
|
|
44
44
|
id: string;
|
|
45
45
|
orgId: string;
|
|
46
46
|
projectId?: string;
|
|
47
|
-
|
|
47
|
+
stageKey?: string;
|
|
48
48
|
}
|
|
@@ -19,7 +19,7 @@ import type { WorkflowVariableRequirement } from './variable-requirement';
|
|
|
19
19
|
* :ref`, reconstructing the compiled workspace manifest from the
|
|
20
20
|
* resolved composition's `workspace.mountLayout` block.
|
|
21
21
|
* • `inline` — short-form `with.mounts` whose agent metadata
|
|
22
|
-
* (`agentSlug`, `
|
|
22
|
+
* (`agentSlug`, `stageKey`, `deliverableSpecRef`, every entry in
|
|
23
23
|
* `mounts`) is fully literal at compile time. The compiler runs
|
|
24
24
|
* `compileManifest()` once and embeds the result so the worker
|
|
25
25
|
* skips both the DB round-trip and the runtime synthesis step.
|
|
@@ -66,7 +66,7 @@ export interface CompiledWorkspaceManifest {
|
|
|
66
66
|
|
|
67
67
|
export interface CompiledManifestAgent {
|
|
68
68
|
readonly slug: string;
|
|
69
|
-
readonly
|
|
69
|
+
readonly stageKey: string;
|
|
70
70
|
/**
|
|
71
71
|
* Canonical {@link AgentRunRole}. Validated by the DSL's
|
|
72
72
|
* `ManifestAgentBlockSchema` at compile time, so the runtime can
|
|
@@ -41,6 +41,20 @@ export enum WorkflowErrorCode {
|
|
|
41
41
|
DSL_UNKNOWN_DELIVERABLE_FIELD = 'DSL_UNKNOWN_DELIVERABLE_FIELD',
|
|
42
42
|
DSL_VERSION_NOT_RESOLVABLE = 'DSL_VERSION_NOT_RESOLVABLE',
|
|
43
43
|
DSL_PERMISSION_ESCALATION = 'DSL_PERMISSION_ESCALATION',
|
|
44
|
+
/**
|
|
45
|
+
* A run was dispatched whose Briefcase declares a `vars` key that
|
|
46
|
+
* collides with a top-level workflow `vars:` key. The two namespaces
|
|
47
|
+
* are distinct by design — workflow `vars:` is author-owned config
|
|
48
|
+
* surfaced in the `${{ vars.X }}` expression namespace, while
|
|
49
|
+
* Briefcase `vars` are run-scoped facts read imperatively by
|
|
50
|
+
* activities (`getVar` / `requireVar`). A key present in BOTH is an
|
|
51
|
+
* ambiguity: the expression namespace would resolve the workflow
|
|
52
|
+
* value while an activity accessor would resolve the briefcase value,
|
|
53
|
+
* silently disagreeing under the same name. The compiler fails fast at
|
|
54
|
+
* the single folding point (`compileWorkflow`) so the dispatcher must
|
|
55
|
+
* rename one side instead of getting last-wins behavior at runtime.
|
|
56
|
+
*/
|
|
57
|
+
DSL_VARS_BRIEFCASE_COLLISION = 'DSL_VARS_BRIEFCASE_COLLISION',
|
|
44
58
|
/**
|
|
45
59
|
* A consumer expression dereferences `needs.<X>.outputs.byKey[…]` but
|
|
46
60
|
* `<X>` is either not a matrix job, or is matrix without `keyBy:`
|
|
@@ -158,6 +172,7 @@ export const NON_RETRYABLE_WORKFLOW_ERROR_CODES: readonly WorkflowErrorCode[] =
|
|
|
158
172
|
WorkflowErrorCode.DSL_UNKNOWN_DELIVERABLE_FIELD,
|
|
159
173
|
WorkflowErrorCode.DSL_VERSION_NOT_RESOLVABLE,
|
|
160
174
|
WorkflowErrorCode.DSL_PERMISSION_ESCALATION,
|
|
175
|
+
WorkflowErrorCode.DSL_VARS_BRIEFCASE_COLLISION,
|
|
161
176
|
WorkflowErrorCode.DSL_MATRIX_KEY_NOT_DECLARED,
|
|
162
177
|
WorkflowErrorCode.DSL_INVALID_MATRIX_OUTPUT_ACCESS,
|
|
163
178
|
WorkflowErrorCode.DSL_FIELD_NOT_TYPED,
|
|
@@ -116,7 +116,7 @@ export type MountSource =
|
|
|
116
116
|
readonly kind: 'agent-definition';
|
|
117
117
|
readonly orgId: string;
|
|
118
118
|
readonly agentSlug: string;
|
|
119
|
-
readonly
|
|
119
|
+
readonly stageKey: string;
|
|
120
120
|
/**
|
|
121
121
|
* Frontmatter `mode` for the rendered .opencode/agents/<slug>.md
|
|
122
122
|
* file. Per OpenCode docs, primary agents and sub-agents share the
|
|
@@ -141,7 +141,7 @@ export type MountSource =
|
|
|
141
141
|
readonly orgId: string;
|
|
142
142
|
readonly sectionKey: string;
|
|
143
143
|
readonly agentSlug?: string;
|
|
144
|
-
readonly
|
|
144
|
+
readonly stageKey?: string;
|
|
145
145
|
}
|
|
146
146
|
| ({ readonly kind: 'rendered-agents-md' } & RenderedAgentRunContextParams)
|
|
147
147
|
| ({ readonly kind: 'rendered-system-overlay' } & RenderedAgentRunContextParams)
|
|
@@ -170,7 +170,7 @@ export interface RenderedAgentRunContextParams {
|
|
|
170
170
|
readonly orgId: string;
|
|
171
171
|
readonly projectId: string;
|
|
172
172
|
readonly agentSlug: string;
|
|
173
|
-
readonly
|
|
173
|
+
readonly stageKey: string;
|
|
174
174
|
readonly role: AgentRunRole;
|
|
175
175
|
readonly sessionId?: string;
|
|
176
176
|
readonly runId?: string;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
//
|
|
10
10
|
// A stage is identified by a free-form `stageKey` string. The artifact
|
|
11
11
|
// natural key already `_`-encodes this value (`{kind}:{workflowRunId}:
|
|
12
|
-
// {
|
|
12
|
+
// {stageKey|_}:{scope|_}:{slug}`), and the workflow engine sequences jobs
|
|
13
13
|
// via explicit `needs:` dependency edges — neither needs a closed enum.
|
|
14
14
|
//
|
|
15
15
|
// Biomes that DO define an ordered stage list (e.g. for a phase rail or a
|
|
@@ -33,7 +33,7 @@ export enum WorkflowStageCategory {
|
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
35
|
* A single ordered workflow stage. `stageKey` is the value that flows onto
|
|
36
|
-
* a job's `
|
|
36
|
+
* a job's `stageKey` and into the artifact natural key — a free-form
|
|
37
37
|
* string the kernel never validates against a closed set.
|
|
38
38
|
*/
|
|
39
39
|
export interface WorkflowStage {
|