@xemahq/kernel-contracts 0.13.2 → 0.13.4
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-limits-schema.d.ts +4 -0
- package/dist/agent-composition/lib/composition-limits-schema.d.ts.map +1 -0
- package/dist/agent-composition/lib/composition-limits-schema.js +13 -0
- package/dist/agent-composition/lib/composition-limits-schema.js.map +1 -0
- package/dist/agent-composition/lib/composition-workspace.d.ts +37 -0
- package/dist/agent-composition/lib/composition-workspace.d.ts.map +1 -0
- package/dist/agent-composition/lib/composition-workspace.js +9 -0
- package/dist/agent-composition/lib/composition-workspace.js.map +1 -0
- package/dist/agent-composition/lib/composition.d.ts +65 -0
- package/dist/agent-composition/lib/composition.d.ts.map +1 -0
- package/dist/agent-composition/lib/composition.js +18 -0
- package/dist/agent-composition/lib/composition.js.map +1 -0
- package/dist/agent-composition/lib/model-resolution-matrix.d.ts +3 -0
- package/dist/agent-composition/lib/model-resolution-matrix.d.ts.map +1 -1
- package/dist/agent-composition/lib/model-resolution-matrix.js +1 -0
- package/dist/agent-composition/lib/model-resolution-matrix.js.map +1 -1
- package/dist/agent-workspace/awp-spec.json +1 -1
- package/dist/agent-workspace/lib/awp-v1.d.ts +15 -0
- package/dist/agent-workspace/lib/awp-v1.d.ts.map +1 -0
- package/dist/agent-workspace/lib/awp-v1.js +197 -0
- package/dist/agent-workspace/lib/awp-v1.js.map +1 -0
- package/dist/space/index.d.ts +1 -0
- package/dist/space/index.d.ts.map +1 -1
- package/dist/space/index.js +1 -0
- package/dist/space/index.js.map +1 -1
- package/dist/space/lib/skill-mirror-path.d.ts +4 -0
- package/dist/space/lib/skill-mirror-path.d.ts.map +1 -0
- package/dist/space/lib/skill-mirror-path.js +37 -0
- package/dist/space/lib/skill-mirror-path.js.map +1 -0
- package/package.json +1 -1
- package/src/agent-composition/lib/model-resolution-matrix.ts +8 -0
- package/src/biome/lib/biome-manifest.ts +1 -1
- package/src/space/index.ts +1 -0
- package/src/space/lib/skill-mirror-path.ts +82 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composition-limits-schema.d.ts","sourceRoot":"","sources":["../../../src/agent-composition/lib/composition-limits-schema.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AASjD,eAAO,MAAM,iBAAiB,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAO1C,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AgentLimitsSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.AgentLimitsSchema = zod_1.z
|
|
6
|
+
.object({
|
|
7
|
+
maxDepth: zod_1.z.number().int().positive(),
|
|
8
|
+
maxFanout: zod_1.z.number().int().positive(),
|
|
9
|
+
maxSpawns: zod_1.z.number().int().positive(),
|
|
10
|
+
tokenBudget: zod_1.z.number().int().positive().optional(),
|
|
11
|
+
})
|
|
12
|
+
.strict();
|
|
13
|
+
//# sourceMappingURL=composition-limits-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composition-limits-schema.js","sourceRoot":"","sources":["../../../src/agent-composition/lib/composition-limits-schema.ts"],"names":[],"mappings":";;;AAmBA,6BAAwB;AAWX,QAAA,iBAAiB,GAA2B,OAAC;KACvD,MAAM,CAAC;IACN,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACrC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACtC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACtC,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CACpD,CAAC;KACD,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { WorkingFileBinding, WorkspaceEnvVar, WorkspacePersistenceSpec } from '../../agent-workspace';
|
|
2
|
+
import type { AgentRunRole, CompiledManifestCredential, CompiledManifestPermissions, OutputSurfaceKind } from '../../workflow';
|
|
3
|
+
export type { WorkingFileBinding, WorkspaceEnvVar, WorkspacePersistenceSpec, } from '../../agent-workspace';
|
|
4
|
+
export declare enum AgentOutputSurfaceMode {
|
|
5
|
+
Single = "single",
|
|
6
|
+
Multi = "multi"
|
|
7
|
+
}
|
|
8
|
+
export interface AgentOutputSurface {
|
|
9
|
+
readonly kind: OutputSurfaceKind;
|
|
10
|
+
readonly port?: number;
|
|
11
|
+
readonly healthPath?: string;
|
|
12
|
+
readonly autoOpen?: boolean;
|
|
13
|
+
readonly mode?: AgentOutputSurfaceMode;
|
|
14
|
+
readonly root?: string;
|
|
15
|
+
readonly defaultDocument?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface AgentRunConfig {
|
|
18
|
+
readonly stage: string;
|
|
19
|
+
readonly role: AgentRunRole;
|
|
20
|
+
readonly deliverableSpecRef?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface AgentMountLayout {
|
|
23
|
+
readonly mounts: Readonly<Record<string, unknown>>;
|
|
24
|
+
readonly agentRunConfig: AgentRunConfig;
|
|
25
|
+
readonly seedFiles: readonly Readonly<Record<string, unknown>>[];
|
|
26
|
+
readonly inputs: Readonly<Record<string, unknown>>;
|
|
27
|
+
}
|
|
28
|
+
export interface AgentWorkspaceConfig {
|
|
29
|
+
readonly persistence?: WorkspacePersistenceSpec;
|
|
30
|
+
readonly env?: readonly WorkspaceEnvVar[];
|
|
31
|
+
readonly outputSurface?: AgentOutputSurface;
|
|
32
|
+
readonly mountLayout?: AgentMountLayout;
|
|
33
|
+
readonly workingFiles?: readonly WorkingFileBinding[];
|
|
34
|
+
readonly credentials?: readonly CompiledManifestCredential[];
|
|
35
|
+
readonly permissions?: CompiledManifestPermissions;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=composition-workspace.d.ts.map
|
|
@@ -0,0 +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,0BAA0B,EAC1B,2BAA2B,EAC3B,iBAAiB,EAClB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EACV,kBAAkB,EAClB,eAAe,EACf,wBAAwB,GACzB,MAAM,uBAAuB,CAAC;AAQ/B,oBAAY,sBAAsB;IAChC,MAAM,WAAW;IACjB,KAAK,UAAU;CAChB;AAsBD,MAAM,WAAW,kBAAkB;IACjC,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,QAAQ,CAAC,IAAI,CAAC,EAAE,sBAAsB,CAAC;IAMvC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAMvB,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;CACnC;AAcD,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;CACtC;AA6BD,MAAM,WAAW,gBAAgB;IAO/B,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAEnD,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IAOxC,QAAQ,CAAC,SAAS,EAAE,SAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;IAOjE,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACpD;AAQD,MAAM,WAAW,oBAAoB;IAKnC,QAAQ,CAAC,WAAW,CAAC,EAAE,wBAAwB,CAAC;IAOhD,QAAQ,CAAC,GAAG,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;IAK1C,QAAQ,CAAC,aAAa,CAAC,EAAE,kBAAkB,CAAC;IAQ5C,QAAQ,CAAC,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAgBxC,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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AgentOutputSurfaceMode = void 0;
|
|
4
|
+
var AgentOutputSurfaceMode;
|
|
5
|
+
(function (AgentOutputSurfaceMode) {
|
|
6
|
+
AgentOutputSurfaceMode["Single"] = "single";
|
|
7
|
+
AgentOutputSurfaceMode["Multi"] = "multi";
|
|
8
|
+
})(AgentOutputSurfaceMode || (exports.AgentOutputSurfaceMode = AgentOutputSurfaceMode = {}));
|
|
9
|
+
//# sourceMappingURL=composition-workspace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composition-workspace.js","sourceRoot":"","sources":["../../../src/agent-composition/lib/composition-workspace.ts"],"names":[],"mappings":";;;AA6CA,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAChC,2CAAiB,CAAA;IACjB,yCAAe,CAAA;AACjB,CAAC,EAHW,sBAAsB,sCAAtB,sBAAsB,QAGjC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { ToolSelectionEntry } from '../../mcp-tool';
|
|
2
|
+
import type { NodeOverlayFragment } from '../../workflow';
|
|
3
|
+
import type { SkillRef } from '../../skill';
|
|
4
|
+
import type { BiomeAvailabilityScoped } from '../../biome-availability';
|
|
5
|
+
import type { CapabilityLayer } from './capability-layer';
|
|
6
|
+
import type { AgentWorkspaceConfig } from './composition-workspace';
|
|
7
|
+
export interface AgentKernelRef {
|
|
8
|
+
readonly slug: string;
|
|
9
|
+
readonly version?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare enum AgentSpace {
|
|
12
|
+
System = "system",
|
|
13
|
+
Biome = "biome",
|
|
14
|
+
Org = "org",
|
|
15
|
+
Project = "project",
|
|
16
|
+
User = "user"
|
|
17
|
+
}
|
|
18
|
+
export declare enum AgentLifecycle {
|
|
19
|
+
Draft = "draft",
|
|
20
|
+
Published = "published",
|
|
21
|
+
Archived = "archived"
|
|
22
|
+
}
|
|
23
|
+
export interface AgentLimits {
|
|
24
|
+
readonly maxDepth: number;
|
|
25
|
+
readonly maxFanout: number;
|
|
26
|
+
readonly maxSpawns: number;
|
|
27
|
+
readonly tokenBudget?: number | undefined;
|
|
28
|
+
}
|
|
29
|
+
export interface AgentNode extends NodeOverlayFragment, BiomeAvailabilityScoped {
|
|
30
|
+
readonly kernel: AgentKernelRef;
|
|
31
|
+
readonly alias?: string;
|
|
32
|
+
readonly skills: readonly SkillRef[];
|
|
33
|
+
readonly tools: readonly ToolSelectionEntry[];
|
|
34
|
+
readonly children: readonly AgentNode[];
|
|
35
|
+
readonly limits?: AgentLimits;
|
|
36
|
+
}
|
|
37
|
+
export interface Agent {
|
|
38
|
+
readonly slug: string;
|
|
39
|
+
readonly version: string;
|
|
40
|
+
readonly displayName: string;
|
|
41
|
+
readonly description?: string;
|
|
42
|
+
readonly scope: AgentSpace;
|
|
43
|
+
readonly lifecycle: AgentLifecycle;
|
|
44
|
+
readonly root: AgentNode;
|
|
45
|
+
readonly capability?: CapabilityLayer;
|
|
46
|
+
readonly workspace?: AgentWorkspaceConfig;
|
|
47
|
+
}
|
|
48
|
+
export interface ResolvedAgentNode extends NodeOverlayFragment, BiomeAvailabilityScoped {
|
|
49
|
+
readonly kernel: Required<AgentKernelRef>;
|
|
50
|
+
readonly alias?: string;
|
|
51
|
+
readonly skills: readonly SkillRef[];
|
|
52
|
+
readonly tools: readonly ToolSelectionEntry[];
|
|
53
|
+
readonly children: readonly ResolvedAgentNode[];
|
|
54
|
+
readonly limits?: AgentLimits;
|
|
55
|
+
}
|
|
56
|
+
export interface ResolvedAgent {
|
|
57
|
+
readonly slug: string;
|
|
58
|
+
readonly version: string;
|
|
59
|
+
readonly displayName: string;
|
|
60
|
+
readonly scope: AgentSpace;
|
|
61
|
+
readonly root: ResolvedAgentNode;
|
|
62
|
+
readonly capability: CapabilityLayer;
|
|
63
|
+
readonly workspace?: AgentWorkspaceConfig;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=composition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composition.d.ts","sourceRoot":"","sources":["../../../src/agent-composition/lib/composition.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO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,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC;IAEnC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAEzB,QAAQ,CAAC,UAAU,CAAC,EAAE,eAAe,CAAC;IAStC,QAAQ,CAAC,SAAS,CAAC,EAAE,oBAAoB,CAAC;CAC3C;AAWD,MAAM,WAAW,iBACf,SAAQ,mBAAmB,EACzB,uBAAuB;IAEzB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC;IAC1C,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,iBAAiB,EAAE,CAAC;IAQhD,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;CAC/B;AAMD,MAAM,WAAW,aAAa;IAC5B,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,UAAU,CAAC;IAE3B,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IAEjC,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAC;IAOrC,QAAQ,CAAC,SAAS,CAAC,EAAE,oBAAoB,CAAC;CAC3C"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AgentLifecycle = exports.AgentSpace = void 0;
|
|
4
|
+
var AgentSpace;
|
|
5
|
+
(function (AgentSpace) {
|
|
6
|
+
AgentSpace["System"] = "system";
|
|
7
|
+
AgentSpace["Biome"] = "biome";
|
|
8
|
+
AgentSpace["Org"] = "org";
|
|
9
|
+
AgentSpace["Project"] = "project";
|
|
10
|
+
AgentSpace["User"] = "user";
|
|
11
|
+
})(AgentSpace || (exports.AgentSpace = AgentSpace = {}));
|
|
12
|
+
var AgentLifecycle;
|
|
13
|
+
(function (AgentLifecycle) {
|
|
14
|
+
AgentLifecycle["Draft"] = "draft";
|
|
15
|
+
AgentLifecycle["Published"] = "published";
|
|
16
|
+
AgentLifecycle["Archived"] = "archived";
|
|
17
|
+
})(AgentLifecycle || (exports.AgentLifecycle = AgentLifecycle = {}));
|
|
18
|
+
//# sourceMappingURL=composition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composition.js","sourceRoot":"","sources":["../../../src/agent-composition/lib/composition.ts"],"names":[],"mappings":";;;AAoCA,IAAY,UAMX;AAND,WAAY,UAAU;IACpB,+BAAiB,CAAA;IACjB,6BAAe,CAAA;IACf,yBAAW,CAAA;IACX,iCAAmB,CAAA;IACnB,2BAAa,CAAA;AACf,CAAC,EANW,UAAU,0BAAV,UAAU,QAMrB;AAQD,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,yCAAuB,CAAA;IACvB,uCAAqB,CAAA;AACvB,CAAC,EAJW,cAAc,8BAAd,cAAc,QAIzB"}
|
|
@@ -4,6 +4,7 @@ export declare enum ResolutionDimension {
|
|
|
4
4
|
Skill = "skill",
|
|
5
5
|
Project = "project",
|
|
6
6
|
Stage = "stage",
|
|
7
|
+
ModelClass = "modelClass",
|
|
7
8
|
Purpose = "purpose"
|
|
8
9
|
}
|
|
9
10
|
export interface ModelMatrixSelector {
|
|
@@ -11,6 +12,7 @@ export interface ModelMatrixSelector {
|
|
|
11
12
|
readonly skill?: string;
|
|
12
13
|
readonly project?: string;
|
|
13
14
|
readonly stage?: string;
|
|
15
|
+
readonly modelClass?: string;
|
|
14
16
|
readonly purpose?: string;
|
|
15
17
|
readonly extra?: Readonly<Record<string, string>>;
|
|
16
18
|
}
|
|
@@ -25,6 +27,7 @@ export interface ModelResolutionContext {
|
|
|
25
27
|
readonly projectId?: string;
|
|
26
28
|
readonly skillSlug?: string;
|
|
27
29
|
readonly stageKey?: string;
|
|
30
|
+
readonly modelClass?: string;
|
|
28
31
|
readonly purpose?: string;
|
|
29
32
|
readonly extra?: Readonly<Record<string, string>>;
|
|
30
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-resolution-matrix.d.ts","sourceRoot":"","sources":["../../../src/agent-composition/lib/model-resolution-matrix.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAY/C,oBAAY,mBAAmB;IAC7B,KAAK,UAAU;IACf,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,OAAO,YAAY;CACpB;AAMD,MAAM,WAAW,mBAAmB;IAElC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAExB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAExB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAM1B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"model-resolution-matrix.d.ts","sourceRoot":"","sources":["../../../src/agent-composition/lib/model-resolution-matrix.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAY/C,oBAAY,mBAAmB;IAC7B,KAAK,UAAU;IACf,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,UAAU,eAAe;IACzB,OAAO,YAAY;CACpB;AAMD,MAAM,WAAW,mBAAmB;IAElC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAExB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAExB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAM1B,QAAQ,CAAC,KAAK,CA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ill"] = "skill";
|
|
8
8
|
ResolutionDimension["Project"] = "project";
|
|
9
9
|
ResolutionDimension["Stage"] = "stage";
|
|
10
|
+
ResolutionDimension["ModelClass"] = "modelClass";
|
|
10
11
|
ResolutionDimension["Purpose"] = "purpose";
|
|
11
12
|
})(ResolutionDimension || (exports.ResolutionDimension = ResolutionDimension = {}));
|
|
12
13
|
//# sourceMappingURL=model-resolution-matrix.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-resolution-matrix.js","sourceRoot":"","sources":["../../../src/agent-composition/lib/model-resolution-matrix.ts"],"names":[],"mappings":";;;AA6BA,IAAY,
|
|
1
|
+
{"version":3,"file":"model-resolution-matrix.js","sourceRoot":"","sources":["../../../src/agent-composition/lib/model-resolution-matrix.ts"],"names":[],"mappings":";;;AA6BA,IAAY,mBAOX;AAPD,WAAY,mBAAmB;IAC7B,sCAAe,CAAA;IACf,sCAAe,CAAA;IACf,0CAAmB,CAAA;IACnB,sCAAe,CAAA;IACf,gDAAyB,CAAA;IACzB,0CAAmB,CAAA;AACrB,CAAC,EAPW,mBAAmB,mCAAnB,mBAAmB,QAO9B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { GitPushBranchSuffix, GitPushConcurrencyMode, type WorkspaceSpec } from './workspace-spec';
|
|
2
|
+
export declare const AWP_V1_SPEC: WorkspaceSpec;
|
|
3
|
+
export declare function findSlot(spec: WorkspaceSpec, key: string): import("./workspace-spec").SlotDefinition | undefined;
|
|
4
|
+
export declare function isKnownSlotKey(spec: WorkspaceSpec, key: string): boolean;
|
|
5
|
+
export declare function listAlwaysOnSlotKeys(spec: WorkspaceSpec): readonly string[];
|
|
6
|
+
export declare function listTarballPersistedRelPaths(spec: WorkspaceSpec): readonly string[];
|
|
7
|
+
export interface ResolvedGitPushSlot {
|
|
8
|
+
readonly key: string;
|
|
9
|
+
readonly path: string;
|
|
10
|
+
readonly branchPrefix: string;
|
|
11
|
+
readonly branchSuffix: GitPushBranchSuffix;
|
|
12
|
+
readonly concurrencyMode: GitPushConcurrencyMode;
|
|
13
|
+
}
|
|
14
|
+
export declare function listGitPushPersistedSlots(spec: WorkspaceSpec): readonly ResolvedGitPushSlot[];
|
|
15
|
+
//# sourceMappingURL=awp-v1.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"awp-v1.d.ts","sourceRoot":"","sources":["../../../src/agent-workspace/lib/awp-v1.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EAEtB,KAAK,aAAa,EACnB,MAAM,kBAAkB,CAAC;AAgB1B,eAAO,MAAM,WAAW,EAAE,aAwMzB,CAAC;AAMF,wBAAgB,QAAQ,CAAC,IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,yDAExD;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAExE;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,aAAa,GAAG,SAAS,MAAM,EAAE,CAE3E;AAQD,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,aAAa,GAAG,SAAS,MAAM,EAAE,CAInF;AAQD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,YAAY,EAAE,mBAAmB,CAAC;IAC3C,QAAQ,CAAC,eAAe,EAAE,sBAAsB,CAAC;CAClD;AAOD,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,aAAa,GAClB,SAAS,mBAAmB,EAAE,CAgBhC"}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AWP_V1_SPEC = void 0;
|
|
4
|
+
exports.findSlot = findSlot;
|
|
5
|
+
exports.isKnownSlotKey = isKnownSlotKey;
|
|
6
|
+
exports.listAlwaysOnSlotKeys = listAlwaysOnSlotKeys;
|
|
7
|
+
exports.listTarballPersistedRelPaths = listTarballPersistedRelPaths;
|
|
8
|
+
exports.listGitPushPersistedSlots = listGitPushPersistedSlots;
|
|
9
|
+
const workspace_spec_1 = require("./workspace-spec");
|
|
10
|
+
exports.AWP_V1_SPEC = {
|
|
11
|
+
id: 'awp/v1',
|
|
12
|
+
version: '1.2.0',
|
|
13
|
+
slots: [
|
|
14
|
+
{
|
|
15
|
+
key: 'inputs',
|
|
16
|
+
path: '/workspace/inputs',
|
|
17
|
+
presence: 'always',
|
|
18
|
+
allowedModes: [workspace_spec_1.SlotMode.ReadOnly],
|
|
19
|
+
defaultMode: workspace_spec_1.SlotMode.ReadOnly,
|
|
20
|
+
ownership: 'user',
|
|
21
|
+
humanDescription: "Read-only inputs supplied at session/run start (the workflow's `with:` block or the session's customConfig). The DSL input bag lands at `inputs.json`.",
|
|
22
|
+
persistencePolicy: { kind: 'none' },
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
key: 'tmp',
|
|
26
|
+
path: '/workspace/tmp',
|
|
27
|
+
presence: 'always',
|
|
28
|
+
allowedModes: [workspace_spec_1.SlotMode.ReadWrite],
|
|
29
|
+
defaultMode: workspace_spec_1.SlotMode.ReadWrite,
|
|
30
|
+
ownership: 'user',
|
|
31
|
+
humanDescription: 'Your scratch space — drafts, intermediate computation, working notes. Snapshot-persisted so retries see prior state. Never harvested.',
|
|
32
|
+
persistencePolicy: { kind: 'tarball' },
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
key: 'uploads',
|
|
36
|
+
path: '/workspace/uploads',
|
|
37
|
+
presence: 'optional',
|
|
38
|
+
allowedModes: [workspace_spec_1.SlotMode.ReadOnly],
|
|
39
|
+
defaultMode: workspace_spec_1.SlotMode.ReadOnly,
|
|
40
|
+
ownership: 'user',
|
|
41
|
+
humanDescription: 'User-uploaded files (briefs, screenshots, sketches). Read-only — never write here.',
|
|
42
|
+
persistencePolicy: { kind: 'tarball' },
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
key: 'references',
|
|
46
|
+
path: '/workspace/references',
|
|
47
|
+
presence: 'optional',
|
|
48
|
+
allowedModes: [workspace_spec_1.SlotMode.ReadOnly],
|
|
49
|
+
defaultMode: workspace_spec_1.SlotMode.ReadOnly,
|
|
50
|
+
ownership: 'user',
|
|
51
|
+
humanDescription: 'Curated evidence library (knowledge-base spaces, prior artifacts, external project mounts). Read-only.',
|
|
52
|
+
persistencePolicy: { kind: 'none' },
|
|
53
|
+
subSlots: [
|
|
54
|
+
{
|
|
55
|
+
key: 'kb',
|
|
56
|
+
path: '/workspace/references/kb',
|
|
57
|
+
allowedModes: [workspace_spec_1.SlotMode.ReadOnly],
|
|
58
|
+
defaultMode: workspace_spec_1.SlotMode.ReadOnly,
|
|
59
|
+
ownership: 'user',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
key: 'external-projects',
|
|
63
|
+
path: '/workspace/references/external-projects',
|
|
64
|
+
allowedModes: [workspace_spec_1.SlotMode.ReadOnly],
|
|
65
|
+
defaultMode: workspace_spec_1.SlotMode.ReadOnly,
|
|
66
|
+
ownership: 'user',
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
key: 'deliverable-specs',
|
|
72
|
+
path: '/workspace/deliverable-specs',
|
|
73
|
+
presence: 'optional',
|
|
74
|
+
allowedModes: [workspace_spec_1.SlotMode.ReadOnly],
|
|
75
|
+
defaultMode: workspace_spec_1.SlotMode.ReadOnly,
|
|
76
|
+
ownership: 'user',
|
|
77
|
+
humanDescription: 'Schemas + metadata for the deliverable spec(s) this run targets. Read-only — consult before writing under deliverables/.',
|
|
78
|
+
persistencePolicy: { kind: 'none' },
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
key: 'deliverables',
|
|
82
|
+
path: '/workspace/deliverables',
|
|
83
|
+
presence: 'optional',
|
|
84
|
+
allowedModes: [workspace_spec_1.SlotMode.ReadOnly, workspace_spec_1.SlotMode.ReadWrite],
|
|
85
|
+
defaultMode: workspace_spec_1.SlotMode.ReadWrite,
|
|
86
|
+
ownership: 'user',
|
|
87
|
+
humanDescription: "Your writable output area. Files written here are harvested by the runtime per the deliverable spec's contract.",
|
|
88
|
+
persistencePolicy: { kind: 'tarball' },
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
key: 'repos',
|
|
92
|
+
path: '/workspace/repos',
|
|
93
|
+
presence: 'optional',
|
|
94
|
+
allowedModes: [workspace_spec_1.SlotMode.ReadOnly, workspace_spec_1.SlotMode.ReadWrite],
|
|
95
|
+
defaultMode: workspace_spec_1.SlotMode.ReadOnly,
|
|
96
|
+
ownership: 'user',
|
|
97
|
+
humanDescription: 'Project repositories. Read-only unless the workflow explicitly granted write authority (engineer roles only).',
|
|
98
|
+
persistencePolicy: { kind: 'git-push', branchPrefix: 'xema/session/' },
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
key: 'agents-md',
|
|
102
|
+
path: '/workspace/AGENTS.md',
|
|
103
|
+
presence: 'always',
|
|
104
|
+
allowedModes: [workspace_spec_1.SlotMode.ReadOnly],
|
|
105
|
+
defaultMode: workspace_spec_1.SlotMode.ReadOnly,
|
|
106
|
+
singleFile: true,
|
|
107
|
+
ownership: 'platform',
|
|
108
|
+
persistencePolicy: { kind: 'none' },
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
key: 'context-json',
|
|
112
|
+
path: '/workspace/context.json',
|
|
113
|
+
presence: 'always',
|
|
114
|
+
allowedModes: [workspace_spec_1.SlotMode.ReadOnly],
|
|
115
|
+
defaultMode: workspace_spec_1.SlotMode.ReadOnly,
|
|
116
|
+
singleFile: true,
|
|
117
|
+
ownership: 'platform',
|
|
118
|
+
persistencePolicy: { kind: 'none' },
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
key: 'system-overlay',
|
|
122
|
+
path: '/workspace/.xema/system-overlay.md',
|
|
123
|
+
presence: 'always',
|
|
124
|
+
allowedModes: [workspace_spec_1.SlotMode.ReadOnly],
|
|
125
|
+
defaultMode: workspace_spec_1.SlotMode.ReadOnly,
|
|
126
|
+
singleFile: true,
|
|
127
|
+
ownership: 'platform',
|
|
128
|
+
persistencePolicy: { kind: 'none' },
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
key: 'agent-bundles',
|
|
132
|
+
path: '/workspace/.opencode/agents',
|
|
133
|
+
presence: 'always',
|
|
134
|
+
allowedModes: [workspace_spec_1.SlotMode.ReadOnly],
|
|
135
|
+
defaultMode: workspace_spec_1.SlotMode.ReadOnly,
|
|
136
|
+
ownership: 'platform',
|
|
137
|
+
persistencePolicy: { kind: 'none' },
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
key: 'skill-bundles',
|
|
141
|
+
path: '/workspace/.opencode/skills',
|
|
142
|
+
presence: 'optional',
|
|
143
|
+
allowedModes: [workspace_spec_1.SlotMode.ReadOnly],
|
|
144
|
+
defaultMode: workspace_spec_1.SlotMode.ReadOnly,
|
|
145
|
+
ownership: 'platform',
|
|
146
|
+
persistencePolicy: { kind: 'none' },
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
key: 'commands',
|
|
150
|
+
path: '/workspace/.opencode/command',
|
|
151
|
+
presence: 'optional',
|
|
152
|
+
allowedModes: [workspace_spec_1.SlotMode.ReadOnly],
|
|
153
|
+
defaultMode: workspace_spec_1.SlotMode.ReadOnly,
|
|
154
|
+
ownership: 'platform',
|
|
155
|
+
persistencePolicy: { kind: 'none' },
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
key: 'instructions',
|
|
159
|
+
path: '/workspace/.xema/instructions',
|
|
160
|
+
presence: 'optional',
|
|
161
|
+
allowedModes: [workspace_spec_1.SlotMode.ReadOnly],
|
|
162
|
+
defaultMode: workspace_spec_1.SlotMode.ReadOnly,
|
|
163
|
+
ownership: 'platform',
|
|
164
|
+
persistencePolicy: { kind: 'none' },
|
|
165
|
+
},
|
|
166
|
+
],
|
|
167
|
+
};
|
|
168
|
+
function findSlot(spec, key) {
|
|
169
|
+
return spec.slots.find((s) => s.key === key);
|
|
170
|
+
}
|
|
171
|
+
function isKnownSlotKey(spec, key) {
|
|
172
|
+
return spec.slots.some((s) => s.key === key);
|
|
173
|
+
}
|
|
174
|
+
function listAlwaysOnSlotKeys(spec) {
|
|
175
|
+
return spec.slots.filter((s) => s.presence === 'always').map((s) => s.key);
|
|
176
|
+
}
|
|
177
|
+
function listTarballPersistedRelPaths(spec) {
|
|
178
|
+
return spec.slots
|
|
179
|
+
.filter((s) => s.persistencePolicy?.kind === 'tarball')
|
|
180
|
+
.map((s) => s.path.replace(/^\/workspace\//, ''));
|
|
181
|
+
}
|
|
182
|
+
function listGitPushPersistedSlots(spec) {
|
|
183
|
+
const out = [];
|
|
184
|
+
for (const slot of spec.slots) {
|
|
185
|
+
if (slot.persistencePolicy?.kind === 'git-push') {
|
|
186
|
+
out.push({
|
|
187
|
+
key: slot.key,
|
|
188
|
+
path: slot.path,
|
|
189
|
+
branchPrefix: slot.persistencePolicy.branchPrefix,
|
|
190
|
+
branchSuffix: slot.persistencePolicy.branchSuffix ?? workspace_spec_1.GitPushBranchSuffix.SessionId,
|
|
191
|
+
concurrencyMode: slot.persistencePolicy.concurrencyMode ?? workspace_spec_1.GitPushConcurrencyMode.Force,
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
return out;
|
|
196
|
+
}
|
|
197
|
+
//# sourceMappingURL=awp-v1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"awp-v1.js","sourceRoot":"","sources":["../../../src/agent-workspace/lib/awp-v1.ts"],"names":[],"mappings":";;;AAmOA,4BAEC;AAED,wCAEC;AAED,oDAEC;AAQD,oEAIC;AAqBD,8DAkBC;AAhSD,qDAK0B;A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G,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAC7E,CAAC;AAQD,SAAgB,4BAA4B,CAAC,IAAmB;IAC9D,OAAO,IAAI,CAAC,KAAK;SACd,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,iBAAiB,EAAE,IAAI,KAAK,SAAS,CAAC;SACtD,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC,CAAC;AACtD,CAAC;AAqBD,SAAgB,yBAAyB,CACvC,IAAmB;IAEnB,MAAM,GAAG,GAA0B,EAAE,CAAC;IACtC,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;QAC9B,IAAI,IAAI,CAAC,iBAAiB,EAAE,IAAI,KAAK,UAAU,EAAE,CAAC;YAChD,GAAG,CAAC,IAAI,CAAC;gBACP,GAAG,EAAE,IAAI,CAAC,GAAG;gBACb,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,YAAY,EAAE,IAAI,CAAC,iBAAiB,CAAC,YAAY;gBACjD,YAAY,EACV,IAAI,CAAC,iBAAiB,CAAC,YAAY,IAAI,oCAAmB,CAAC,SAAS;gBACtE,eAAe,EACb,IAAI,CAAC,iBAAiB,CAAC,eAAe,IAAI,uCAAsB,CAAC,KAAK;aACzE,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/dist/space/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/space/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/space/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC"}
|
package/dist/space/index.js
CHANGED
|
@@ -17,4 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./lib/space"), exports);
|
|
18
18
|
__exportStar(require("./lib/space-ref-parser"), exports);
|
|
19
19
|
__exportStar(require("./lib/space-traversal"), exports);
|
|
20
|
+
__exportStar(require("./lib/skill-mirror-path"), exports);
|
|
20
21
|
//# sourceMappingURL=index.js.map
|
package/dist/space/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/space/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,yDAAuC;AACvC,wDAAsC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/space/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,yDAAuC;AACvC,wDAAsC;AACtC,0DAAwC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type SpaceRef } from './space';
|
|
2
|
+
export declare function skillMirrorAllocationSubPath(scope: SpaceRef): string | null;
|
|
3
|
+
export declare function skillMirrorBundleDir(scope: SpaceRef, slug: string, contentHash: string): string | null;
|
|
4
|
+
//# sourceMappingURL=skill-mirror-path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-mirror-path.d.ts","sourceRoot":"","sources":["../../../src/space/lib/skill-mirror-path.ts"],"names":[],"mappings":"AAcA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAC;AA6BnD,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,GAAG,IAAI,CAqB3E;AAQD,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,QAAQ,EACf,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,GAClB,MAAM,GAAG,IAAI,CAKf"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.skillMirrorAllocationSubPath = skillMirrorAllocationSubPath;
|
|
4
|
+
exports.skillMirrorBundleDir = skillMirrorBundleDir;
|
|
5
|
+
const space_1 = require("./space");
|
|
6
|
+
const TEMPLATES_SYSTEM_SUBPATH = 'templates/system';
|
|
7
|
+
const TEMPLATES_ORG_SUBPATH_PREFIX = 'templates/orgs';
|
|
8
|
+
const MIRROR_SUBPATH = 'mirror/skills';
|
|
9
|
+
const SKILL_KIND_SEGMENT = 'skill';
|
|
10
|
+
function skillMirrorAllocationSubPath(scope) {
|
|
11
|
+
switch (scope.tier) {
|
|
12
|
+
case space_1.SpaceKind.System:
|
|
13
|
+
return `${TEMPLATES_SYSTEM_SUBPATH}/${MIRROR_SUBPATH}/system`;
|
|
14
|
+
case space_1.SpaceKind.Biome:
|
|
15
|
+
return scope.biomeId
|
|
16
|
+
? `${TEMPLATES_SYSTEM_SUBPATH}/${MIRROR_SUBPATH}/biome/${scope.biomeId}`
|
|
17
|
+
: null;
|
|
18
|
+
case space_1.SpaceKind.Org:
|
|
19
|
+
return scope.orgId
|
|
20
|
+
? `${TEMPLATES_ORG_SUBPATH_PREFIX}/${scope.orgId}/${MIRROR_SUBPATH}/org`
|
|
21
|
+
: null;
|
|
22
|
+
case space_1.SpaceKind.Project:
|
|
23
|
+
return scope.orgId && scope.projectId
|
|
24
|
+
? `${TEMPLATES_ORG_SUBPATH_PREFIX}/${scope.orgId}/${MIRROR_SUBPATH}/` +
|
|
25
|
+
`project/${scope.projectId}`
|
|
26
|
+
: null;
|
|
27
|
+
default:
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function skillMirrorBundleDir(scope, slug, contentHash) {
|
|
32
|
+
const base = skillMirrorAllocationSubPath(scope);
|
|
33
|
+
return base === null
|
|
34
|
+
? null
|
|
35
|
+
: `${base}/${SKILL_KIND_SEGMENT}/${slug}/${contentHash}`;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=skill-mirror-path.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-mirror-path.js","sourceRoot":"","sources":["../../../src/space/lib/skill-mirror-path.ts"],"names":[],"mappings":";;AA2CA,oEAqBC;AAQD,oDASC;AAnED,mCAAmD;AAGnD,MAAM,wBAAwB,GAAG,kBAAkB,CAAC;AAEpD,MAAM,4BAA4B,GAAG,gBAAgB,CAAC;AAEtD,MAAM,cAAc,GAAG,eAAe,CAAC;AAEvC,MAAM,kBAAkB,GAAG,OAAO,CAAC;AAoBnC,SAAgB,4BAA4B,CAAC,KAAe;IAC1D,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,iBAAS,CAAC,MAAM;YACnB,OAAO,GAAG,wBAAwB,IAAI,cAAc,SAAS,CAAC;QAChE,KAAK,iBAAS,CAAC,KAAK;YAClB,OAAO,KAAK,CAAC,OAAO;gBAClB,CAAC,CAAC,GAAG,wBAAwB,IAAI,cAAc,UAAU,KAAK,CAAC,OAAO,EAAE;gBACxE,CAAC,CAAC,IAAI,CAAC;QACX,KAAK,iBAAS,CAAC,GAAG;YAChB,OAAO,KAAK,CAAC,KAAK;gBAChB,CAAC,CAAC,GAAG,4BAA4B,IAAI,KAAK,CAAC,KAAK,IAAI,cAAc,MAAM;gBACxE,CAAC,CAAC,IAAI,CAAC;QACX,KAAK,iBAAS,CAAC,OAAO;YACpB,OAAO,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,SAAS;gBACnC,CAAC,CAAC,GAAG,4BAA4B,IAAI,KAAK,CAAC,KAAK,IAAI,cAAc,GAAG;oBACjE,WAAW,KAAK,CAAC,SAAS,EAAE;gBAChC,CAAC,CAAC,IAAI,CAAC;QACX;YAEE,OAAO,IAAI,CAAC;IAChB,CAAC;AACH,CAAC;AAQD,SAAgB,oBAAoB,CAClC,KAAe,EACf,IAAY,EACZ,WAAmB;IAEnB,MAAM,IAAI,GAAG,4BAA4B,CAAC,KAAK,CAAC,CAAC;IACjD,OAAO,IAAI,KAAK,IAAI;QAClB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,GAAG,IAAI,IAAI,kBAAkB,IAAI,IAAI,IAAI,WAAW,EAAE,CAAC;AAC7D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xemahq/kernel-contracts",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.4",
|
|
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/",
|
|
@@ -32,6 +32,7 @@ export enum ResolutionDimension {
|
|
|
32
32
|
Skill = 'skill',
|
|
33
33
|
Project = 'project',
|
|
34
34
|
Stage = 'stage',
|
|
35
|
+
ModelClass = 'modelClass',
|
|
35
36
|
Purpose = 'purpose',
|
|
36
37
|
}
|
|
37
38
|
|
|
@@ -52,6 +53,8 @@ export interface ModelMatrixSelector {
|
|
|
52
53
|
* is mapped onto this dimension by the DSL compiler.
|
|
53
54
|
*/
|
|
54
55
|
readonly stage?: string;
|
|
56
|
+
/** Match when the resolving agent's modelClass equals this value. */
|
|
57
|
+
readonly modelClass?: string;
|
|
55
58
|
/**
|
|
56
59
|
* Match when the invocation's non-agent purpose equals this value. Used
|
|
57
60
|
* for system flows that route LLM calls outside the agent/skill model —
|
|
@@ -85,6 +88,11 @@ export interface ModelResolutionContext {
|
|
|
85
88
|
readonly projectId?: string;
|
|
86
89
|
readonly skillSlug?: string;
|
|
87
90
|
readonly stageKey?: string;
|
|
91
|
+
/**
|
|
92
|
+
* The resolving agent's modelClass — populated at agent-invocation build
|
|
93
|
+
* sites; undefined for non-agent purposes.
|
|
94
|
+
*/
|
|
95
|
+
readonly modelClass?: string;
|
|
88
96
|
/**
|
|
89
97
|
* Non-agent invocation purpose (e.g. memory summarization/embedding).
|
|
90
98
|
* Optional — agent and skill invocations leave this undefined.
|
|
@@ -187,7 +187,7 @@ export type BiomeDatabaseDeclaration = z.infer<typeof BiomeDatabaseDeclarationSc
|
|
|
187
187
|
/**
|
|
188
188
|
* Per-API declaration shipped under `xema.ships.apis[]` (Phase 9).
|
|
189
189
|
* Each entry becomes one subdomain (`<name>.api.<base-domain>`)
|
|
190
|
-
* served by a biome-shipped
|
|
190
|
+
* served by a biome-shipped API service. biome-host-api applies
|
|
191
191
|
* the Helm sub-chart at install time and writes a route-registry
|
|
192
192
|
* entry the ingress shim consults. Validated structurally here;
|
|
193
193
|
* detailed contract semantics live in `@xemahq/biome-api-sdk`.
|
package/src/space/index.ts
CHANGED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
2
|
+
// Skill mirror path convention — SHARED by the orchestrator (writes the
|
|
3
|
+
// content-addressed skill mirror) and the worker (reads it at launch). Keeping
|
|
4
|
+
// it here, in kernel-contracts, means the path convention has EXACTLY ONE
|
|
5
|
+
// source of truth across both repos — the orchestrator and worker can never
|
|
6
|
+
// drift apart on where a mirrored skill bundle lives.
|
|
7
|
+
//
|
|
8
|
+
// Runtime-NEUTRAL: a skill bundle (SKILL.md + resources) is identical across
|
|
9
|
+
// every runtime; only WHERE it is finally placed inside the workspace differs
|
|
10
|
+
// (`.opencode/skills`, `.qwen/skills`, `.claude/skills`, `.hermes/skills`), and
|
|
11
|
+
// that placement is owned by the worker's RuntimeLayout — NOT by this path.
|
|
12
|
+
// This module describes the STORAGE location of the pre-staged bytes only, so
|
|
13
|
+
// it works for OpenCode / Qwen / Claude / Hermes / any future runtime alike.
|
|
14
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
15
|
+
import { SpaceKind, type SpaceRef } from './space';
|
|
16
|
+
|
|
17
|
+
/** Templates subtree a worker mounts RO for system + biome (platform-wide) skills. */
|
|
18
|
+
const TEMPLATES_SYSTEM_SUBPATH = 'templates/system';
|
|
19
|
+
/** Per-org templates subtree prefix — `<prefix>/<orgId>` is mounted RO per worker. */
|
|
20
|
+
const TEMPLATES_ORG_SUBPATH_PREFIX = 'templates/orgs';
|
|
21
|
+
/** Mirror segment appended under the chosen templates subtree. */
|
|
22
|
+
const MIRROR_SUBPATH = 'mirror/skills';
|
|
23
|
+
/** Kind segment under the allocation subPath (matches the materializer's `<kind>`). */
|
|
24
|
+
const SKILL_KIND_SEGMENT = 'skill';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Pool-relative allocation subPath under which a skill's content-addressed
|
|
28
|
+
* mirror is written/read, keyed by the skill's scope — the parent of
|
|
29
|
+
* `<kind>/<slug>/<contentHash>`:
|
|
30
|
+
*
|
|
31
|
+
* • System / Biome → `templates/system/mirror/skills/<seg>`
|
|
32
|
+
* platform-wide; EVERY worker mounts `templates/system` RO.
|
|
33
|
+
* • Org / Project → `templates/orgs/<orgId>/mirror/skills/<seg>`
|
|
34
|
+
* the org's own RO mount; another org's worker never mounts it.
|
|
35
|
+
*
|
|
36
|
+
* Returns `null` when the scope is not mirrorable from the ref alone:
|
|
37
|
+
* • User — the ref is org-less (`xema://user/<userId>`), so it can't be
|
|
38
|
+
* placed under any org's templates subtree.
|
|
39
|
+
* • App / Session — runtime spaces, never own a skill bundle.
|
|
40
|
+
* • a mirrorable tier whose required id segment is absent (malformed ref).
|
|
41
|
+
* A `null` result means "not pre-staged" — the caller resolves it via the live
|
|
42
|
+
* fetch (an explicit, logged miss; never silently-stale content).
|
|
43
|
+
*/
|
|
44
|
+
export function skillMirrorAllocationSubPath(scope: SpaceRef): string | null {
|
|
45
|
+
switch (scope.tier) {
|
|
46
|
+
case SpaceKind.System:
|
|
47
|
+
return `${TEMPLATES_SYSTEM_SUBPATH}/${MIRROR_SUBPATH}/system`;
|
|
48
|
+
case SpaceKind.Biome:
|
|
49
|
+
return scope.biomeId
|
|
50
|
+
? `${TEMPLATES_SYSTEM_SUBPATH}/${MIRROR_SUBPATH}/biome/${scope.biomeId}`
|
|
51
|
+
: null;
|
|
52
|
+
case SpaceKind.Org:
|
|
53
|
+
return scope.orgId
|
|
54
|
+
? `${TEMPLATES_ORG_SUBPATH_PREFIX}/${scope.orgId}/${MIRROR_SUBPATH}/org`
|
|
55
|
+
: null;
|
|
56
|
+
case SpaceKind.Project:
|
|
57
|
+
return scope.orgId && scope.projectId
|
|
58
|
+
? `${TEMPLATES_ORG_SUBPATH_PREFIX}/${scope.orgId}/${MIRROR_SUBPATH}/` +
|
|
59
|
+
`project/${scope.projectId}`
|
|
60
|
+
: null;
|
|
61
|
+
default:
|
|
62
|
+
// User / App / Session — not mirrorable (see doc comment).
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Full mirror BUNDLE dir relative to the pool root:
|
|
69
|
+
* `<allocationSubPath>/skill/<slug>/<contentHash>`. This is exactly where the
|
|
70
|
+
* materializer writes a skill bundle (SKILL.md + resources). Returns `null`
|
|
71
|
+
* when the scope is not mirrorable (see {@link skillMirrorAllocationSubPath}).
|
|
72
|
+
*/
|
|
73
|
+
export function skillMirrorBundleDir(
|
|
74
|
+
scope: SpaceRef,
|
|
75
|
+
slug: string,
|
|
76
|
+
contentHash: string,
|
|
77
|
+
): string | null {
|
|
78
|
+
const base = skillMirrorAllocationSubPath(scope);
|
|
79
|
+
return base === null
|
|
80
|
+
? null
|
|
81
|
+
: `${base}/${SKILL_KIND_SEGMENT}/${slug}/${contentHash}`;
|
|
82
|
+
}
|