@xemahq/kernel-contracts 0.3.7 → 0.5.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 +1 -1
- package/dist/agent-composition/lib/composition.d.ts +3 -2
- package/dist/agent-composition/lib/composition.d.ts.map +1 -1
- package/dist/agent-composition/lib/composition.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/biome-availability/index.d.ts +2 -0
- package/dist/biome-availability/index.d.ts.map +1 -0
- package/dist/biome-availability/index.js +18 -0
- package/dist/biome-availability/index.js.map +1 -0
- package/dist/biome-availability/lib/biome-availability.d.ts +9 -0
- package/dist/biome-availability/lib/biome-availability.d.ts.map +1 -0
- package/dist/biome-availability/lib/biome-availability.js +21 -0
- package/dist/biome-availability/lib/biome-availability.js.map +1 -0
- package/dist/llm-gateway/lib/caller.d.ts +1 -1
- package/dist/workflow/lib/compiled-run.d.ts +2 -1
- package/dist/workflow/lib/compiled-run.d.ts.map +1 -1
- package/dist/workflow/lib/compiled-workspace-manifest.d.ts +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 +4 -4
- package/src/agent-composition/lib/composition.ts +7 -2
- package/src/agent-composition/lib/model-resolution-matrix.ts +9 -9
- package/src/agent-workspace/lib/context-json.ts +1 -1
- package/src/biome-availability/index.ts +9 -0
- package/src/biome-availability/lib/biome-availability.ts +114 -0
- package/src/llm-gateway/lib/caller.ts +4 -4
- package/src/workflow/lib/compiled-run.ts +3 -2
- package/src/workflow/lib/compiled-workspace-manifest.ts +1 -1
- package/src/workflow/lib/mount-plan.ts +3 -3
- package/src/workflow/lib/workflow-stage.ts +2 -2
|
@@ -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
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ToolSelectionEntry } from '../../mcp-tool';
|
|
2
2
|
import type { NodeOverlayFragment } from '../../workflow';
|
|
3
3
|
import type { SkillRef } from '../../skill';
|
|
4
|
+
import type { BiomeAvailabilityScoped } from '../../biome-availability';
|
|
4
5
|
import type { CapabilityLayer } from './capability-layer';
|
|
5
6
|
import type { CompositionWorkspace } from './composition-workspace';
|
|
6
7
|
export interface AgentRef {
|
|
@@ -25,7 +26,7 @@ export interface CompositionLimits {
|
|
|
25
26
|
readonly maxSpawns: number;
|
|
26
27
|
readonly tokenBudget?: number | undefined;
|
|
27
28
|
}
|
|
28
|
-
export interface CompositionNode extends NodeOverlayFragment {
|
|
29
|
+
export interface CompositionNode extends NodeOverlayFragment, BiomeAvailabilityScoped {
|
|
29
30
|
readonly agent: AgentRef;
|
|
30
31
|
readonly alias?: string;
|
|
31
32
|
readonly skills: readonly SkillRef[];
|
|
@@ -44,7 +45,7 @@ export interface Composition {
|
|
|
44
45
|
readonly capability?: CapabilityLayer;
|
|
45
46
|
readonly workspace?: CompositionWorkspace;
|
|
46
47
|
}
|
|
47
|
-
export interface ResolvedCompositionNode extends NodeOverlayFragment {
|
|
48
|
+
export interface ResolvedCompositionNode extends NodeOverlayFragment, BiomeAvailabilityScoped {
|
|
48
49
|
readonly agent: Required<AgentRef>;
|
|
49
50
|
readonly alias?: string;
|
|
50
51
|
readonly skills: readonly SkillRef[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composition.d.ts","sourceRoot":"","sources":["../../../src/agent-composition/lib/composition.ts"],"names":[],"mapp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9B,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC;IACjC,QAAQ,CAAC,SAAS,EAAE,oBAAoB,CAAC;IAEzC,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAE/B,QAAQ,CAAC,UAAU,CAAC,EAAE,eAAe,CAAC;IAStC,QAAQ,CAAC,SAAS,CAAC,EAAE,oBAAoB,CAAC;CAC3C;AAWD,MAAM,WAAW,uBACf,SAAQ,mBAAmB,EACzB,uBAAuB;IAEzB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACnC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAExB,QAAQ,CAAC,MAAM,EAAE,SAAS,QAAQ,EAAE,CAAC;IAErC,QAAQ,CAAC,KAAK,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAM9C,QAAQ,CAAC,QAAQ,EAAE,SAAS,uBAAuB,EAAE,CAAC;IAQtD,QAAQ,CAAC,MAAM,CAAC,EAAE,iBAAiB,CAAC;CACrC;AAMD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC;IAEjC,QAAQ,CAAC,IAAI,EAAE,uBAAuB,CAAC;IAEvC,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAC;IAOrC,QAAQ,CAAC,SAAS,CAAC,EAAE,oBAAoB,CAAC;CAC3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composition.js","sourceRoot":"","sources":["../../../src/agent-composition/lib/composition.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"composition.js","sourceRoot":"","sources":["../../../src/agent-composition/lib/composition.ts"],"names":[],"mappings":";;;AAoCA,IAAY,gBAMX;AAND,WAAY,gBAAgB;IAC1B,qCAAiB,CAAA;IACjB,mCAAe,CAAA;IACf,+BAAW,CAAA;IACX,uCAAmB,CAAA;IACnB,iCAAa,CAAA;AACf,CAAC,EANW,gBAAgB,gCAAhB,gBAAgB,QAM3B;AAQD,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,uCAAe,CAAA;IACf,+CAAuB,CAAA;IACvB,6CAAqB,CAAA;AACvB,CAAC,EAJW,oBAAoB,oCAApB,oBAAoB,QAI/B"}
|
|
@@ -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 {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/biome-availability/index.ts"],"names":[],"mappings":"AAQA,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./lib/biome-availability"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/biome-availability/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAQA,2DAAyC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface BiomeAvailabilityFilter {
|
|
2
|
+
readonly include?: readonly string[];
|
|
3
|
+
readonly exclude?: readonly string[];
|
|
4
|
+
}
|
|
5
|
+
export interface BiomeAvailabilityScoped {
|
|
6
|
+
readonly biomeAvailability?: BiomeAvailabilityFilter;
|
|
7
|
+
}
|
|
8
|
+
export declare function isBiomeContributionAllowed(biomeId: string | null | undefined, filter: BiomeAvailabilityFilter | undefined): boolean;
|
|
9
|
+
//# sourceMappingURL=biome-availability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"biome-availability.d.ts","sourceRoot":"","sources":["../../../src/biome-availability/lib/biome-availability.ts"],"names":[],"mappings":"AAsCA,MAAM,WAAW,uBAAuB;IAOtC,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAMrC,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC;AAQD,MAAM,WAAW,uBAAuB;IAKtC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,uBAAuB,CAAC;CACtD;AAuBD,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAClC,MAAM,EAAE,uBAAuB,GAAG,SAAS,GAC1C,OAAO,CAqBT"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isBiomeContributionAllowed = isBiomeContributionAllowed;
|
|
4
|
+
function isBiomeContributionAllowed(biomeId, filter) {
|
|
5
|
+
if (biomeId === null || biomeId === undefined || biomeId.length === 0) {
|
|
6
|
+
return true;
|
|
7
|
+
}
|
|
8
|
+
if (filter === undefined) {
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
11
|
+
const exclude = filter.exclude ?? [];
|
|
12
|
+
const include = filter.include ?? [];
|
|
13
|
+
if (exclude.includes(biomeId)) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
if (include.length > 0 && !include.includes(biomeId)) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=biome-availability.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"biome-availability.js","sourceRoot":"","sources":["../../../src/biome-availability/lib/biome-availability.ts"],"names":[],"mappings":";;AAyFA,gEAwBC;AAxBD,SAAgB,0BAA0B,CACxC,OAAkC,EAClC,MAA2C;IAG3C,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtE,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC;IACrC,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC;IAErC,IAAI,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QACrD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CompiledWorkspaceManifest } from './compiled-workspace-manifest';
|
|
2
|
+
import type { BiomeAvailabilityScoped } from '../../biome-availability';
|
|
2
3
|
import type { ActionRef } from './action-ref';
|
|
3
4
|
import type { Briefcase } from './briefcase';
|
|
4
5
|
import type { ConcurrencyGroup } from './concurrency-group';
|
|
@@ -72,7 +73,7 @@ export interface CompiledRetryPolicy {
|
|
|
72
73
|
readonly maximumIntervalMs: number;
|
|
73
74
|
readonly nonRetryableErrorTypes: readonly string[];
|
|
74
75
|
}
|
|
75
|
-
export interface CompiledJob {
|
|
76
|
+
export interface CompiledJob extends BiomeAvailabilityScoped {
|
|
76
77
|
readonly jobKey: string;
|
|
77
78
|
readonly title: string | null;
|
|
78
79
|
readonly needs: readonly string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compiled-run.d.ts","sourceRoot":"","sources":["../../../src/workflow/lib/compiled-run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAE/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,KAAK,kBAAkB,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC;AAC5F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAwB1E,MAAM,MAAM,sBAAsB,GAC9B;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAC9C;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,yBAAyB,CAAA;CAAE,GACzE;IAAE,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAA;CAAE,CAAC;A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C,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC,MAAM,CAAC;CAC1C;AAMD,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC,MAAM,CAAC;IACzC,QAAQ,CAAC,OAAO,EAAE,SAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;IAC/D,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AASD,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC,OAAO,CAAC;IAC1C,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAE5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAQ7B,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAMD,YAAY,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -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;
|
|
@@ -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.5.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/",
|
|
@@ -93,17 +93,17 @@ export interface CompositionOutputSurface {
|
|
|
93
93
|
/**
|
|
94
94
|
* The agent run-config the composer needs that is NOT carried by the
|
|
95
95
|
* `CompositionNode` tree. The node tree pins WHICH agent runs; these
|
|
96
|
-
* three fields pin the run FRAMING (
|
|
96
|
+
* three fields pin the run FRAMING (stage + role + deliverable
|
|
97
97
|
* contract) the renderer + system-overlay are driven by.
|
|
98
98
|
*
|
|
99
|
-
* `role` is the canonical {@link AgentRunRole}. `
|
|
99
|
+
* `role` is the canonical {@link AgentRunRole}. `stage` /
|
|
100
100
|
* `deliverableSpecRef` are carried verbatim from the source manifest's
|
|
101
101
|
* `spec.agent` block — they MAY still hold a `${input.x}` token, which
|
|
102
102
|
* the workspace pipeline resolves against the run's bind inputs (the
|
|
103
103
|
* same fail-fast interpolation grammar `env` values use).
|
|
104
104
|
*/
|
|
105
105
|
export interface CompositionAgentRunConfig {
|
|
106
|
-
readonly
|
|
106
|
+
readonly stage: string;
|
|
107
107
|
readonly role: AgentRunRole;
|
|
108
108
|
readonly deliverableSpecRef?: string;
|
|
109
109
|
}
|
|
@@ -143,7 +143,7 @@ export interface CompositionMountLayout {
|
|
|
143
143
|
* slots are NEVER present — the composer auto-emits them.
|
|
144
144
|
*/
|
|
145
145
|
readonly mounts: Readonly<Record<string, unknown>>;
|
|
146
|
-
/** Agent run-config (
|
|
146
|
+
/** Agent run-config (stage + role + deliverable contract). */
|
|
147
147
|
readonly agentRunConfig: CompositionAgentRunConfig;
|
|
148
148
|
/**
|
|
149
149
|
* Raw `spec.seedFiles` array — manifest DSL `ManifestSeedFile`
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
import type { ToolSelectionEntry } from '../../mcp-tool';
|
|
17
17
|
import type { NodeOverlayFragment } from '../../workflow';
|
|
18
18
|
import type { SkillRef } from '../../skill';
|
|
19
|
+
import type { BiomeAvailabilityScoped } from '../../biome-availability';
|
|
19
20
|
import type { CapabilityLayer } from './capability-layer';
|
|
20
21
|
import type { CompositionWorkspace } from './composition-workspace';
|
|
21
22
|
|
|
@@ -99,7 +100,9 @@ export interface CompositionLimits {
|
|
|
99
100
|
* `skills` / `tools` / `modelOverride` attach AT this node — they extend or
|
|
100
101
|
* override what the referenced agent definition declares intrinsically.
|
|
101
102
|
*/
|
|
102
|
-
export interface CompositionNode
|
|
103
|
+
export interface CompositionNode
|
|
104
|
+
extends NodeOverlayFragment,
|
|
105
|
+
BiomeAvailabilityScoped {
|
|
103
106
|
/** The agent definition this node runs. */
|
|
104
107
|
readonly agent: AgentRef;
|
|
105
108
|
/** Optional alias when the same agent appears more than once in the tree. */
|
|
@@ -159,7 +162,9 @@ export interface Composition {
|
|
|
159
162
|
* Distinct from `CompositionNode` (the AUTHORED form): a resolved node
|
|
160
163
|
* has its agent reference fully version-pinned, never `latest`.
|
|
161
164
|
*/
|
|
162
|
-
export interface ResolvedCompositionNode
|
|
165
|
+
export interface ResolvedCompositionNode
|
|
166
|
+
extends NodeOverlayFragment,
|
|
167
|
+
BiomeAvailabilityScoped {
|
|
163
168
|
/** Fully version-pinned agent reference. */
|
|
164
169
|
readonly agent: Required<AgentRef>;
|
|
165
170
|
readonly alias?: string;
|
|
@@ -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.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
2
|
+
// ── Biome Availability Contracts — Barrel Export ──
|
|
3
|
+
//
|
|
4
|
+
// Kernel (Layer-0) leaf: the per-definition biome opt-in/opt-out POST-scope
|
|
5
|
+
// filter (DBM.2). Zero cross-subpath deps so agent-composition / skill /
|
|
6
|
+
// capability / workflow / action resolvers can all import it without a cycle.
|
|
7
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
8
|
+
|
|
9
|
+
export * from './lib/biome-availability';
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
2
|
+
// ── Biome Availability Filter — per-definition opt-in/opt-out (DBM.2) ──
|
|
3
|
+
//
|
|
4
|
+
// A definition (an Agent Composition node, an Agent definition, a workflow
|
|
5
|
+
// job, a Session) MAY declare which biomes' contributions it wants in or out.
|
|
6
|
+
// This is a POST-SCOPE FILTER applied AFTER implicit-by-scope resolution
|
|
7
|
+
// (the 5-tier `SkillScope`/`CompositionScope` precedence): it NARROWS the
|
|
8
|
+
// already-visible set; it never widens it and it is NOT a parallel
|
|
9
|
+
// availability/binding table (see `.claude/rules/skills-and-composition.md`).
|
|
10
|
+
//
|
|
11
|
+
// Why a filter and not a binding table: the ownership model is implicit-by-
|
|
12
|
+
// scope — a contribution is available because its owning biome is installed
|
|
13
|
+
// and enabled for the org. This filter lets ONE definition say "even though
|
|
14
|
+
// biome X is installed, I don't want its contributions" (exclude) or "only
|
|
15
|
+
// honor biomes Y and Z, ignore everything else" (allow-list include). It is
|
|
16
|
+
// authored on the definition, additive + optional, and absent ⇒ no filtering
|
|
17
|
+
// (every implicitly-visible contribution passes).
|
|
18
|
+
//
|
|
19
|
+
// Fail-fast is unchanged: this filter decides VISIBILITY, not lifecycle. A
|
|
20
|
+
// reference that survives the filter and is still unavailable degrades only
|
|
21
|
+
// when its `MissingReferencePolicy` is `Optional` (see `reference-resolution`).
|
|
22
|
+
//
|
|
23
|
+
// Pure Layer-0 leaf: zero cross-subpath imports so every resolver
|
|
24
|
+
// (agent-composition / skill / capability / workflow / action) can import it
|
|
25
|
+
// without creating a cycle.
|
|
26
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Per-definition opt-in / opt-out over biome-contributed references.
|
|
30
|
+
* Additive + optional everywhere it is attached. Both fields are
|
|
31
|
+
* independent and may be combined; an empty/absent filter never narrows.
|
|
32
|
+
*
|
|
33
|
+
* Precedence when both are set is encoded by {@link isBiomeContributionAllowed}:
|
|
34
|
+
* an explicit {@link exclude} ALWAYS wins (a biome in both lists is excluded),
|
|
35
|
+
* and a non-empty {@link include} turns the filter into an allow-list (any
|
|
36
|
+
* biome not listed is dropped). Non-biome contributions (no owning biome) are
|
|
37
|
+
* never affected.
|
|
38
|
+
*/
|
|
39
|
+
export interface BiomeAvailabilityFilter {
|
|
40
|
+
/**
|
|
41
|
+
* Allow-list. When non-empty, ONLY contributions whose owning biome id is
|
|
42
|
+
* in this list survive the filter (plus non-biome contributions, which are
|
|
43
|
+
* never filtered). When omitted/empty, every biome is allowed unless
|
|
44
|
+
* {@link exclude}d.
|
|
45
|
+
*/
|
|
46
|
+
readonly include?: readonly string[];
|
|
47
|
+
/**
|
|
48
|
+
* Deny-list. A contribution whose owning biome id is in this list is
|
|
49
|
+
* always dropped, even if it also appears in {@link include}. Omitted/empty
|
|
50
|
+
* ⇒ nothing is force-excluded.
|
|
51
|
+
*/
|
|
52
|
+
readonly exclude?: readonly string[];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The shape a definition mixes in to gain the optional biome opt-in/opt-out
|
|
57
|
+
* knob. Mixed into `CompositionNode`, the Agent definition contract, the
|
|
58
|
+
* workflow job/stage contract, and the Session shape so the field has ONE
|
|
59
|
+
* declaration site (no per-shape restating).
|
|
60
|
+
*/
|
|
61
|
+
export interface BiomeAvailabilityScoped {
|
|
62
|
+
/**
|
|
63
|
+
* Optional per-definition biome opt-in/opt-out. POST-scope filter applied
|
|
64
|
+
* after implicit-by-scope resolution. Absent ⇒ no filtering.
|
|
65
|
+
*/
|
|
66
|
+
readonly biomeAvailability?: BiomeAvailabilityFilter;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* The single predicate every resolver calls to decide whether a
|
|
71
|
+
* biome-contributed reference survives a definition's
|
|
72
|
+
* {@link BiomeAvailabilityFilter}. Implemented in exactly one place so the
|
|
73
|
+
* include/exclude precedence is never re-derived (and never silently
|
|
74
|
+
* diverges) per resolver.
|
|
75
|
+
*
|
|
76
|
+
* Rules, in order:
|
|
77
|
+
* 1. A contribution with no owning biome (`biomeId` null/undefined) is
|
|
78
|
+
* NEVER filtered — it is not biome-attributed, so opt-in/opt-out does
|
|
79
|
+
* not apply. Returns `true`.
|
|
80
|
+
* 2. No filter, or an empty filter ⇒ everything is allowed. Returns `true`.
|
|
81
|
+
* 3. `exclude` wins: a biome present in `exclude` is dropped. Returns `false`.
|
|
82
|
+
* 4. A non-empty `include` makes the filter an allow-list: a biome NOT in
|
|
83
|
+
* `include` is dropped. Returns `false`.
|
|
84
|
+
* 5. Otherwise allowed. Returns `true`.
|
|
85
|
+
*
|
|
86
|
+
* @param biomeId the owning biome of the contribution, or null/undefined for
|
|
87
|
+
* a non-biome (system/org/user/project-authored) contribution.
|
|
88
|
+
* @param filter the definition's optional filter; absent ⇒ allow all.
|
|
89
|
+
*/
|
|
90
|
+
export function isBiomeContributionAllowed(
|
|
91
|
+
biomeId: string | null | undefined,
|
|
92
|
+
filter: BiomeAvailabilityFilter | undefined,
|
|
93
|
+
): boolean {
|
|
94
|
+
// (1) Non-biome contributions are out of scope for this filter.
|
|
95
|
+
if (biomeId === null || biomeId === undefined || biomeId.length === 0) {
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
// (2) No filter ⇒ allow all.
|
|
99
|
+
if (filter === undefined) {
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
const exclude = filter.exclude ?? [];
|
|
103
|
+
const include = filter.include ?? [];
|
|
104
|
+
// (3) exclude always wins.
|
|
105
|
+
if (exclude.includes(biomeId)) {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
// (4) non-empty include ⇒ allow-list semantics.
|
|
109
|
+
if (include.length > 0 && !include.includes(biomeId)) {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
// (5) allowed.
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
@@ -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
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CompiledWorkspaceManifest } from './compiled-workspace-manifest';
|
|
2
2
|
|
|
3
|
+
import type { BiomeAvailabilityScoped } from '../../biome-availability';
|
|
3
4
|
import type { ActionRef } from './action-ref';
|
|
4
5
|
import type { Briefcase } from './briefcase';
|
|
5
6
|
import type { ConcurrencyGroup } from './concurrency-group';
|
|
@@ -19,7 +20,7 @@ import type { WorkflowVariableRequirement } from './variable-requirement';
|
|
|
19
20
|
* :ref`, reconstructing the compiled workspace manifest from the
|
|
20
21
|
* resolved composition's `workspace.mountLayout` block.
|
|
21
22
|
* • `inline` — short-form `with.mounts` whose agent metadata
|
|
22
|
-
* (`agentSlug`, `
|
|
23
|
+
* (`agentSlug`, `stageKey`, `deliverableSpecRef`, every entry in
|
|
23
24
|
* `mounts`) is fully literal at compile time. The compiler runs
|
|
24
25
|
* `compileManifest()` once and embeds the result so the worker
|
|
25
26
|
* skips both the DB round-trip and the runtime synthesis step.
|
|
@@ -210,7 +211,7 @@ export interface CompiledRetryPolicy {
|
|
|
210
211
|
readonly nonRetryableErrorTypes: readonly string[];
|
|
211
212
|
}
|
|
212
213
|
|
|
213
|
-
export interface CompiledJob {
|
|
214
|
+
export interface CompiledJob extends BiomeAvailabilityScoped {
|
|
214
215
|
/** Stable logical key (as authored in YAML). Unique per CompiledRun. */
|
|
215
216
|
readonly jobKey: string;
|
|
216
217
|
/** Optional human-readable title; falls back to jobKey in UIs. */
|
|
@@ -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
|
|
@@ -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 {
|