@xemahq/kernel-contracts 0.5.1 → 0.6.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.
Files changed (65) hide show
  1. package/dist/agent-composition/lib/capability-layer.d.ts +6 -6
  2. package/dist/agent-composition/lib/capability-layer.d.ts.map +1 -1
  3. package/dist/agent-composition/lib/capability-layer.js +3 -3
  4. package/dist/agent-composition/lib/capability-layer.js.map +1 -1
  5. package/dist/agent-composition/lib/composition-limits-schema.d.ts +2 -2
  6. package/dist/agent-composition/lib/composition-limits-schema.d.ts.map +1 -1
  7. package/dist/agent-composition/lib/composition-limits-schema.js +2 -2
  8. package/dist/agent-composition/lib/composition-limits-schema.js.map +1 -1
  9. package/dist/agent-composition/lib/composition-workspace.d.ts +9 -9
  10. package/dist/agent-composition/lib/composition-workspace.d.ts.map +1 -1
  11. package/dist/agent-composition/lib/composition-workspace.js +6 -6
  12. package/dist/agent-composition/lib/composition-workspace.js.map +1 -1
  13. package/dist/agent-composition/lib/composition.d.ts +22 -22
  14. package/dist/agent-composition/lib/composition.d.ts.map +1 -1
  15. package/dist/agent-composition/lib/composition.js +15 -15
  16. package/dist/agent-composition/lib/composition.js.map +1 -1
  17. package/dist/agent-workspace/awp-spec.json +1 -1
  18. package/dist/contribution/lib/contribution-kind.d.ts +1 -1
  19. package/dist/contribution/lib/contribution-kind.d.ts.map +1 -1
  20. package/dist/contribution/lib/contribution-kind.js +1 -1
  21. package/dist/contribution/lib/contribution-kind.js.map +1 -1
  22. package/dist/invocation/lib/invocation-record.d.ts +1 -1
  23. package/dist/invocation/lib/invocation-record.d.ts.map +1 -1
  24. package/dist/invocation/lib/invocation-record.js +1 -1
  25. package/dist/invocation/lib/invocation-record.js.map +1 -1
  26. package/dist/invocation/lib/invoke-request.d.ts +3 -3
  27. package/dist/invocation/lib/invoke-request.d.ts.map +1 -1
  28. package/dist/invocation/lib/invoke-request.js +3 -3
  29. package/dist/invocation/lib/invoke-request.js.map +1 -1
  30. package/dist/invocation/lib/invoke-response.d.ts +2 -2
  31. package/dist/invocation/lib/invoke-response.d.ts.map +1 -1
  32. package/dist/invocation/lib/invoke-response.js +2 -2
  33. package/dist/invocation/lib/invoke-response.js.map +1 -1
  34. package/dist/object/lib/xema-object-kind.d.ts +1 -1
  35. package/dist/object/lib/xema-object-kind.d.ts.map +1 -1
  36. package/dist/object/lib/xema-object-kind.js +1 -1
  37. package/dist/object/lib/xema-object-kind.js.map +1 -1
  38. package/dist/workflow/lib/mount-plan.d.ts +1 -1
  39. package/dist/workflow/lib/mount-plan.d.ts.map +1 -1
  40. package/package.json +1 -1
  41. package/src/agent-composition/index.ts +2 -2
  42. package/src/agent-composition/lib/capability-layer.ts +9 -9
  43. package/src/agent-composition/lib/composition-limits-schema.ts +4 -4
  44. package/src/agent-composition/lib/composition-workspace.ts +18 -18
  45. package/src/agent-composition/lib/composition.ts +28 -28
  46. package/src/agent-composition/lib/invocation-overlay.ts +1 -1
  47. package/src/agent-workspace/lib/working-file.ts +1 -1
  48. package/src/agent-workspace/lib/workspace-spec.ts +3 -3
  49. package/src/biome-availability/lib/biome-availability.ts +3 -3
  50. package/src/contribution/lib/contribution-kind.ts +1 -1
  51. package/src/contribution/lib/contribution-source.ts +1 -1
  52. package/src/distribution/lib/distribution.ts +1 -1
  53. package/src/document-templates/lib/document-template.ts +1 -1
  54. package/src/invocation/lib/execution-requirements.ts +1 -1
  55. package/src/invocation/lib/invocation-mode.ts +1 -1
  56. package/src/invocation/lib/invocation-record.ts +2 -2
  57. package/src/invocation/lib/invoke-request.ts +7 -7
  58. package/src/invocation/lib/invoke-response.ts +3 -3
  59. package/src/object/lib/object-lifecycle.ts +1 -1
  60. package/src/object/lib/xema-object-kind.ts +2 -2
  61. package/src/object/lib/xema-object.ts +2 -2
  62. package/src/workflow/lib/compiled-run.ts +3 -3
  63. package/src/workflow/lib/compiled-workspace-manifest.ts +1 -1
  64. package/src/workflow/lib/model-ref.ts +1 -1
  65. package/src/workflow/lib/mount-plan.ts +1 -1
@@ -1,7 +1,7 @@
1
1
  // ═══════════════════════════════════════════════════════════════════════════
2
2
  // ── CapabilityLayer ──
3
3
  //
4
- // The capability envelope attached to an Agent Composition: what the
4
+ // The capability envelope attached to an Agent: what the
5
5
  // composition is allowed to do at runtime (write policy, repo access,
6
6
  // knowledge-base writes, allowed Xema-namespaced tools).
7
7
  //
@@ -16,30 +16,30 @@
16
16
  * - `own-pages-only`: may only write declared deliverable files.
17
17
  * - `full-write`: may write anywhere the workspace permits.
18
18
  */
19
- export const COMPOSITION_WRITE_POLICIES = [
19
+ export const AGENT_WRITE_POLICIES = [
20
20
  'read-only',
21
21
  'own-pages-only',
22
22
  'full-write',
23
23
  ] as const;
24
- export type CompositionWritePolicy =
25
- (typeof COMPOSITION_WRITE_POLICIES)[number];
24
+ export type AgentWritePolicy =
25
+ (typeof AGENT_WRITE_POLICIES)[number];
26
26
 
27
27
  /**
28
28
  * Repo-write capability.
29
29
  * - `never`: blanket deny repo writes.
30
30
  * - `when-granted`: repo writes allowed iff the dispatch supplied repo slugs.
31
31
  */
32
- export const COMPOSITION_REPO_POLICIES = ['never', 'when-granted'] as const;
33
- export type CompositionRepoPolicy =
34
- (typeof COMPOSITION_REPO_POLICIES)[number];
32
+ export const AGENT_REPO_POLICIES = ['never', 'when-granted'] as const;
33
+ export type AgentRepoPolicy =
34
+ (typeof AGENT_REPO_POLICIES)[number];
35
35
 
36
36
  /**
37
37
  * The capability envelope of a composition node. Resolved into each
38
38
  * invocation's `context.json` authority block.
39
39
  */
40
40
  export interface CapabilityLayer {
41
- readonly writePolicy: CompositionWritePolicy;
42
- readonly mayEditRepos: CompositionRepoPolicy;
41
+ readonly writePolicy: AgentWritePolicy;
42
+ readonly mayEditRepos: AgentRepoPolicy;
43
43
  readonly mayWriteKnowledgeBase: boolean;
44
44
  /** Closed allowlist of Xema-namespaced tools (e.g. `xema_memory_set`). */
45
45
  readonly allowedXemaTools: readonly string[];
@@ -1,5 +1,5 @@
1
1
  // ═══════════════════════════════════════════════════════════════════════════
2
- // ── CompositionLimits — Zod schema ──
2
+ // ── AgentLimits — Zod schema ──
3
3
  //
4
4
  // Validates the runtime envelope a coordinator-style composition node
5
5
  // declares on itself (and inherits to descendants). Used by:
@@ -19,16 +19,16 @@
19
19
 
20
20
  import { z } from 'zod';
21
21
 
22
- import type { CompositionLimits } from './composition';
22
+ import type { AgentLimits } from './composition';
23
23
 
24
24
  /**
25
- * Zod schema for {@link CompositionLimits}. Structural counters
25
+ * Zod schema for {@link AgentLimits}. Structural counters
26
26
  * (`maxDepth` / `maxFanout` / `maxSpawns`) are strict positive integers.
27
27
  * `tokenBudget` is optional; when omitted, the enforcer treats it as
28
28
  * unlimited (no token-budget check). Authors who want NO enforcement at
29
29
  * all must omit the entire `limits` block.
30
30
  */
31
- export const CompositionLimitsSchema: z.ZodType<CompositionLimits> = z
31
+ export const AgentLimitsSchema: z.ZodType<AgentLimits> = z
32
32
  .object({
33
33
  maxDepth: z.number().int().positive(),
34
34
  maxFanout: z.number().int().positive(),
@@ -1,20 +1,20 @@
1
1
  // ═══════════════════════════════════════════════════════════════════════════
2
- // ── Composition Workspace block ──
2
+ // ── Agent Workspace block ──
3
3
  //
4
4
  // The AUTHORED source of the workspace's filesystem-layout / persistence /
5
- // environment configuration. A `Composition` arms an agent with skills +
6
- // tools (the recursive `CompositionNode` tree); the `workspace` block
5
+ // environment configuration. A `Agent` arms an agent with skills +
6
+ // tools (the recursive `AgentNode` tree); the `workspace` block
7
7
  // declares the SHAPE of `/workspace/` that agent runs inside —
8
8
  // persist-paths, env vars, and the live output-surface.
9
9
  //
10
10
  // `WorkspaceSpec` (`@xemahq/agent-workspace-contracts`) is a DERIVED
11
- // projection: the resolution service projects `Composition.workspace`
11
+ // projection: the resolution service projects `Agent.workspace`
12
12
  // onto the resolved `WorkspaceSpec` so workspace-tree consumers read one
13
13
  // resolved spec without re-resolving the composition.
14
14
  //
15
15
  // This block absorbs the layout/persistence/env portion of the retiring
16
16
  // `WorkspaceManifest` — the agent/skill/tool-selection portion already
17
- // moved to `CompositionNode`. Templates (the manifest's Handlebars
17
+ // moved to `AgentNode`. Templates (the manifest's Handlebars
18
18
  // seed-files) become skill-bundle resources served by skill-registry-api,
19
19
  // so they are NOT modelled here.
20
20
  // ═══════════════════════════════════════════════════════════════════════════
@@ -43,7 +43,7 @@ export type {
43
43
  * target and emit one gateway route per app — used by webapp studios
44
44
  * that scaffold N apps under one composition.
45
45
  */
46
- export enum CompositionOutputSurfaceMode {
46
+ export enum AgentOutputSurfaceMode {
47
47
  Single = 'single',
48
48
  Multi = 'multi',
49
49
  }
@@ -68,14 +68,14 @@ export enum CompositionOutputSurfaceMode {
68
68
  * - `app` / `tunnel`: reserved for future surface kinds; field set
69
69
  * mirrors `web`.
70
70
  */
71
- export interface CompositionOutputSurface {
71
+ export interface AgentOutputSurface {
72
72
  readonly kind: OutputSurfaceKind;
73
73
  readonly port?: number;
74
74
  readonly healthPath?: string;
75
75
  /** Auto-open the preview pane on first ready signal. */
76
76
  readonly autoOpen?: boolean;
77
77
  /** Single-port (default) vs. multi-app output surface. */
78
- readonly mode?: CompositionOutputSurfaceMode;
78
+ readonly mode?: AgentOutputSurfaceMode;
79
79
  /**
80
80
  * Workspace-relative directory served as a static site. Required and
81
81
  * only meaningful when `kind === 'static'`. The DSL schema enforces
@@ -92,7 +92,7 @@ export interface CompositionOutputSurface {
92
92
 
93
93
  /**
94
94
  * The agent run-config the composer needs that is NOT carried by the
95
- * `CompositionNode` tree. The node tree pins WHICH agent runs; these
95
+ * `AgentNode` tree. The node tree pins WHICH agent runs; these
96
96
  * three fields pin the run FRAMING (stage + role + deliverable
97
97
  * contract) the renderer + system-overlay are driven by.
98
98
  *
@@ -102,7 +102,7 @@ export interface CompositionOutputSurface {
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
- export interface CompositionAgentRunConfig {
105
+ export interface AgentRunConfig {
106
106
  readonly stage: string;
107
107
  readonly role: AgentRunRole;
108
108
  readonly deliverableSpecRef?: string;
@@ -135,7 +135,7 @@ export interface CompositionAgentRunConfig {
135
135
  * fragments with the DSL's `WorkspaceManifestSchema` when it
136
136
  * reconstructs + compiles the manifest.
137
137
  */
138
- export interface CompositionMountLayout {
138
+ export interface AgentMountLayout {
139
139
  /**
140
140
  * Raw `spec.mounts` block — user-data mount declarations keyed by AWP
141
141
  * slot key. Each value is the manifest DSL `ManifestMountDeclaration`
@@ -144,7 +144,7 @@ export interface CompositionMountLayout {
144
144
  */
145
145
  readonly mounts: Readonly<Record<string, unknown>>;
146
146
  /** Agent run-config (stage + role + deliverable contract). */
147
- readonly agentRunConfig: CompositionAgentRunConfig;
147
+ readonly agentRunConfig: AgentRunConfig;
148
148
  /**
149
149
  * Raw `spec.seedFiles` array — manifest DSL `ManifestSeedFile`
150
150
  * entries (`{ path, slot?, template?, content?, vars? }`). `vars` may
@@ -162,12 +162,12 @@ export interface CompositionMountLayout {
162
162
  }
163
163
 
164
164
  /**
165
- * Authored workspace-layout config carried on a `Composition`. Every
165
+ * Authored workspace-layout config carried on a `Agent`. Every
166
166
  * field is optional + additive — a composition that declares no
167
167
  * `workspace` block produces a `WorkspaceSpec` with no projected
168
168
  * `persistence` / `env` (the AWP base slots still apply).
169
169
  */
170
- export interface CompositionWorkspace {
170
+ export interface AgentWorkspaceConfig {
171
171
  /**
172
172
  * Workspace-relative persist-paths + per-slot policy overrides.
173
173
  * Authoritative SOURCE projected onto `WorkspaceSpec.persistence`.
@@ -184,15 +184,15 @@ export interface CompositionWorkspace {
184
184
  * Output-surface declaration. Optional — omitted for
185
185
  * compositions that do not expose an output surface.
186
186
  */
187
- readonly outputSurface?: CompositionOutputSurface;
187
+ readonly outputSurface?: AgentOutputSurface;
188
188
  /**
189
189
  * The user-data mount layout — which AWP slots the profile enables,
190
190
  * per-slot mode, the agent run-config, and seed files. The residual
191
- * the Agent Composition primitive absorbed from `WorkspaceManifest`
191
+ * the Agent primitive absorbed from `WorkspaceManifest`
192
192
  * in Phase 10, Step 3d. Optional + additive — a composition with no
193
193
  * `mountLayout` runs on the AWP base slots alone with no seed files.
194
194
  */
195
- readonly mountLayout?: CompositionMountLayout;
195
+ readonly mountLayout?: AgentMountLayout;
196
196
  /**
197
197
  * Working files the platform materialises for this session.
198
198
  *
@@ -226,7 +226,7 @@ export interface CompositionWorkspace {
226
226
  * manifest. Same seed → compose → resolve path as {@link credentials};
227
227
  * consumed by the environment resolver + resume drift detection.
228
228
  * Optional + additive. Distinct from the per-node
229
- * {@link CompositionNode.permission} overlay — this is the workspace
229
+ * {@link AgentNode.permission} overlay — this is the workspace
230
230
  * toolset policy, not the agent's permission map. Was silently DROPPED
231
231
  * at seed before (BUG-1).
232
232
  */
@@ -1,5 +1,5 @@
1
1
  // ═══════════════════════════════════════════════════════════════════════════
2
- // ── Agent Composition ──
2
+ // ── Agent ──
3
3
  //
4
4
  // The recursive "workflow-as-agent" primitive: an Agent armed with Skills
5
5
  // and Tools, whose sub-agents are themselves fully-armed composition nodes
@@ -18,12 +18,12 @@ import type { NodeOverlayFragment } from '../../workflow';
18
18
  import type { SkillRef } from '../../skill';
19
19
  import type { BiomeAvailabilityScoped } from '../../biome-availability';
20
20
  import type { CapabilityLayer } from './capability-layer';
21
- import type { CompositionWorkspace } from './composition-workspace';
21
+ import type { AgentWorkspaceConfig } from './composition-workspace';
22
22
 
23
23
  /**
24
24
  * A stable reference to an agent definition, optionally version-pinned.
25
25
  */
26
- export interface AgentRef {
26
+ export interface AgentKernelRef {
27
27
  readonly slug: string;
28
28
  /** Pinned version; omitted = latest. */
29
29
  readonly version?: string;
@@ -34,7 +34,7 @@ export interface AgentRef {
34
34
  * is reusable. Mirrors `SkillSpace`; compositions are org-scoped so they
35
35
  * are authored once and reused across projects.
36
36
  */
37
- export enum CompositionSpace {
37
+ export enum AgentSpace {
38
38
  System = 'system',
39
39
  Biome = 'biome',
40
40
  Org = 'org',
@@ -48,7 +48,7 @@ export enum CompositionSpace {
48
48
  * - `published`: immutable; the only state resolution will serve.
49
49
  * - `archived`: retired; kept for lineage but never resolved.
50
50
  */
51
- export enum CompositionLifecycle {
51
+ export enum AgentLifecycle {
52
52
  Draft = 'draft',
53
53
  Published = 'published',
54
54
  Archived = 'archived',
@@ -64,7 +64,7 @@ export enum CompositionLifecycle {
64
64
  * declares the budget once and the whole subtree shares it.
65
65
  *
66
66
  * **Breach semantics — IMPORTANT:** any breach aborts the SSE stream and
67
- * throws a non-retryable `ApplicationFailure(COMPOSITION_BUDGET_EXCEEDED)`.
67
+ * throws a non-retryable `ApplicationFailure(AGENT_BUDGET_EXCEEDED)`.
68
68
  * The activity ends without emitting a deliverable; the harvester never
69
69
  * runs. All in-flight work is lost — HITL re-dispatches from the prior
70
70
  * gate. This is the right semantics for *structural* runaways (depth /
@@ -76,7 +76,7 @@ export enum CompositionLifecycle {
76
76
  * unlimited. `maxDepth` / `maxFanout` / `maxSpawns` are the load-bearing
77
77
  * structural caps.
78
78
  */
79
- export interface CompositionLimits {
79
+ export interface AgentLimits {
80
80
  /** Recursion depth ceiling — root = depth 0, first sub-agent = 1, etc. */
81
81
  readonly maxDepth: number;
82
82
  /** Concurrent `task()` spawns allowed per node within a single turn. */
@@ -100,11 +100,11 @@ export interface CompositionLimits {
100
100
  * `skills` / `tools` / `modelOverride` attach AT this node — they extend or
101
101
  * override what the referenced agent definition declares intrinsically.
102
102
  */
103
- export interface CompositionNode
103
+ export interface AgentNode
104
104
  extends NodeOverlayFragment,
105
105
  BiomeAvailabilityScoped {
106
106
  /** The agent definition this node runs. */
107
- readonly agent: AgentRef;
107
+ readonly kernel: AgentKernelRef;
108
108
  /** Optional alias when the same agent appears more than once in the tree. */
109
109
  readonly alias?: string;
110
110
  /** Skills attached at this node. */
@@ -116,7 +116,7 @@ export interface CompositionNode
116
116
  // OVERRIDE the model, APPEND to the base prompt, and RESTRICT-merge the
117
117
  // permission for this node only.
118
118
  /** Sub-agents — themselves fully-armed composition nodes (recursive). */
119
- readonly children: readonly CompositionNode[];
119
+ readonly children: readonly AgentNode[];
120
120
  /**
121
121
  * Hard budget the runtime enforces against `task()` spawn telemetry
122
122
  * for THIS node and every descendant it produces at runtime. Inherited
@@ -124,22 +124,22 @@ export interface CompositionNode
124
124
  * limits once at the root. Absent root + absent descendants = no
125
125
  * enforcement (today's pre-coordinator workflows).
126
126
  */
127
- readonly limits?: CompositionLimits;
127
+ readonly limits?: AgentLimits;
128
128
  }
129
129
 
130
130
  /**
131
- * A named, versioned, reusable Agent Composition.
131
+ * A named, versioned, reusable Agent.
132
132
  */
133
- export interface Composition {
133
+ export interface Agent {
134
134
  /** Stable slug; the identity within the registry. */
135
135
  readonly slug: string;
136
136
  readonly version: string;
137
137
  readonly displayName: string;
138
138
  readonly description?: string;
139
- readonly scope: CompositionSpace;
140
- readonly lifecycle: CompositionLifecycle;
139
+ readonly scope: AgentSpace;
140
+ readonly lifecycle: AgentLifecycle;
141
141
  /** The root (primary) agent node. */
142
- readonly root: CompositionNode;
142
+ readonly root: AgentNode;
143
143
  /** Capability envelope applied to the composition at runtime. */
144
144
  readonly capability?: CapabilityLayer;
145
145
  /**
@@ -150,23 +150,23 @@ export interface Composition {
150
150
  * alone. Absorbs the layout/persistence/env portion of the retiring
151
151
  * `WorkspaceManifest`.
152
152
  */
153
- readonly workspace?: CompositionWorkspace;
153
+ readonly workspace?: AgentWorkspaceConfig;
154
154
  }
155
155
 
156
156
  /**
157
157
  * The flattened, runtime-facing form of one resolved composition node.
158
- * The resolution service produces this tree from a stored `Composition`;
158
+ * The resolution service produces this tree from a stored `Agent`;
159
159
  * the workspace/composer pipeline consumes it. Sub-agent nodes appear
160
160
  * as `children` (still recursive) — each child is itself fully armed.
161
161
  *
162
- * Distinct from `CompositionNode` (the AUTHORED form): a resolved node
162
+ * Distinct from `AgentNode` (the AUTHORED form): a resolved node
163
163
  * has its agent reference fully version-pinned, never `latest`.
164
164
  */
165
- export interface ResolvedCompositionNode
165
+ export interface ResolvedAgentNode
166
166
  extends NodeOverlayFragment,
167
167
  BiomeAvailabilityScoped {
168
168
  /** Fully version-pinned agent reference. */
169
- readonly agent: Required<AgentRef>;
169
+ readonly kernel: Required<AgentKernelRef>;
170
170
  readonly alias?: string;
171
171
  /** Skill references attached at this node (version-pinned). */
172
172
  readonly skills: readonly SkillRef[];
@@ -177,28 +177,28 @@ export interface ResolvedCompositionNode
177
177
  // composer layers instructions onto the base systemPrompt and deep-merges
178
178
  // permission over the agent's authored permission before the system tiers.
179
179
  /** Resolved sub-agent nodes (recursive). */
180
- readonly children: readonly ResolvedCompositionNode[];
180
+ readonly children: readonly ResolvedAgentNode[];
181
181
  /**
182
182
  * Resolved budget for this node. The resolver propagates the nearest
183
- * declared `limits` from the source `CompositionNode` (root usually
183
+ * declared `limits` from the source `AgentNode` (root usually
184
184
  * carries it; descendants inherit). Absent = no enforcement on this
185
185
  * node and its descendants — preserves today's pre-coordinator
186
186
  * workflow behaviour where no budget was declared.
187
187
  */
188
- readonly limits?: CompositionLimits;
188
+ readonly limits?: AgentLimits;
189
189
  }
190
190
 
191
191
  /**
192
192
  * The resolution service's output: a composition resolved against a task
193
193
  * context, ready for the composer/workspace pipeline to consume.
194
194
  */
195
- export interface ResolvedComposition {
195
+ export interface ResolvedAgent {
196
196
  readonly slug: string;
197
197
  readonly version: string;
198
198
  readonly displayName: string;
199
- readonly scope: CompositionSpace;
199
+ readonly scope: AgentSpace;
200
200
  /** Resolved root node — the primary agent. */
201
- readonly root: ResolvedCompositionNode;
201
+ readonly root: ResolvedAgentNode;
202
202
  /** Capability envelope applied to the whole composition at runtime. */
203
203
  readonly capability: CapabilityLayer;
204
204
  /**
@@ -207,5 +207,5 @@ export interface ResolvedComposition {
207
207
  * interpolation in `env` values is already resolved here. The
208
208
  * workspace pipeline projects this onto the run's `WorkspaceSpec`.
209
209
  */
210
- readonly workspace?: CompositionWorkspace;
210
+ readonly workspace?: AgentWorkspaceConfig;
211
211
  }
@@ -18,7 +18,7 @@
18
18
  // - skills : ADD-only (identity skills are the floor)
19
19
  //
20
20
  // Agent SELECTION (which agent runs) is deliberately NOT part of this overlay:
21
- // in a workflow that is `agentSlug`/`agentRef`, and `compositionRef` selects a
21
+ // in a workflow that is `agentSlug` (short form); `agentRef` selects a published Agent
22
22
  // workspace SOURCE, not the agent (see plan audit A5). The overlay only SHAPES
23
23
  // the already-selected agent.
24
24
  // ═══════════════════════════════════════════════════════════════════════════
@@ -123,7 +123,7 @@ export type WorkingFileSourceKind = string;
123
123
 
124
124
  /**
125
125
  * Resolved working-file declaration projected onto the WorkspaceSpec and
126
- * carried into the session bundle. Composition authors declare the
126
+ * carried into the session bundle. Agent authors declare the
127
127
  * authored shape (with `${input.x}` templating); resolution produces this
128
128
  * concrete form with the bind inputs interpolated.
129
129
  *
@@ -147,7 +147,7 @@ export interface SlotDefinition {
147
147
  /**
148
148
  * Workspace-relative paths captured on session pause and restored on
149
149
  * resume, plus per-slot policy overrides. The authoritative SOURCE of
150
- * these values is the authored `Composition.workspace.persistence` block
150
+ * these values is the authored `Agent.workspace.persistence` block
151
151
  * (`@xemahq/agent-composition-contracts`); they are projected onto
152
152
  * `WorkspaceSpec` so workspace-tree consumers (session lifecycle,
153
153
  * workspace-proxy snapshot pipeline) read them off one resolved spec
@@ -185,7 +185,7 @@ export interface WorkspaceSpec {
185
185
  readonly slots: readonly SlotDefinition[];
186
186
  /**
187
187
  * Workspace-relative persist-paths + per-slot policy overrides.
188
- * Projected from `Composition.workspace.persistence`. Optional — when
188
+ * Projected from `Agent.workspace.persistence`. Optional — when
189
189
  * absent the workspace persists only what the slots' own
190
190
  * `persistencePolicy` fields declare. Additive: pre-existing consumers
191
191
  * that never read this field keep compiling.
@@ -193,7 +193,7 @@ export interface WorkspaceSpec {
193
193
  readonly persistence?: WorkspacePersistenceSpec;
194
194
  /**
195
195
  * Environment variables applied to the agent runtime before dispatch.
196
- * Projected from `Composition.workspace.env`. Optional / additive —
196
+ * Projected from `Agent.workspace.env`. Optional / additive —
197
197
  * absent means the composition declared no env block.
198
198
  */
199
199
  readonly env?: readonly WorkspaceEnvVar[];
@@ -1,10 +1,10 @@
1
1
  // ═══════════════════════════════════════════════════════════════════════════
2
2
  // ── Biome Availability Filter — per-definition opt-in/opt-out (DBM.2) ──
3
3
  //
4
- // A definition (an Agent Composition node, an Agent definition, a workflow
4
+ // A definition (an Agent node, an Agent definition, a workflow
5
5
  // job, a Session) MAY declare which biomes' contributions it wants in or out.
6
6
  // This is a POST-SCOPE FILTER applied AFTER implicit-by-scope resolution
7
- // (the 5-tier `SkillScope`/`CompositionScope` precedence): it NARROWS the
7
+ // (the 5-tier `SkillScope`/`AgentSpace` precedence): it NARROWS the
8
8
  // already-visible set; it never widens it and it is NOT a parallel
9
9
  // availability/binding table (see `.claude/rules/skills-and-composition.md`).
10
10
  //
@@ -54,7 +54,7 @@ export interface BiomeAvailabilityFilter {
54
54
 
55
55
  /**
56
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
57
+ * knob. Mixed into `AgentNode`, the Agent definition contract, the
58
58
  * workflow job/stage contract, and the Session shape so the field has ONE
59
59
  * declaration site (no per-shape restating).
60
60
  */
@@ -25,7 +25,7 @@ export enum ContributionKind {
25
25
  ChartRuntime = 'chart-runtime',
26
26
  PresentationRuntime = 'presentation-runtime',
27
27
  AgentSkill = 'agent-skill',
28
- AgentDefinition = 'agent-definition',
28
+ AgentKernel = 'agent-kernel',
29
29
  ModelResolutionDimension = 'model-resolution-dimension',
30
30
  WidgetKind = 'widget-kind',
31
31
 
@@ -2,7 +2,7 @@ import { z } from 'zod';
2
2
 
3
3
  /**
4
4
  * `ContributionSource` is the 5-tier scope at which a Contribution lives.
5
- * Value-identical to `SkillSpace` and `CompositionSpace` (see
5
+ * Value-identical to `SkillSpace` and `AgentSpace` (see
6
6
  * `.claude/rules/skills-and-composition.md`) — the three enums share ONE
7
7
  * ownership / scope model and must not drift.
8
8
  *
@@ -53,7 +53,7 @@ export const DistributionPlatformServiceSchema = z.object({
53
53
  * is deployed (the deployment plane). It contains PACKAGING fields only — no
54
54
  * infra/deploy/values config (that lives in the deployment overlay).
55
55
  *
56
- * Composition: `extends` names a parent distribution; the resolver composes
56
+ * Agent: `extends` names a parent distribution; the resolver composes
57
57
  * parent → child, with the child's `include`/`exclude` overriding. The resolver
58
58
  * enforces (fail-fast): kernel-tier biomes are always included and cannot be
59
59
  * excluded; an included biome whose `requires` are absent is an error; selectors
@@ -51,7 +51,7 @@ export enum DocumentTemplateScope {
51
51
  * not interpret the strings, just hands them to skill-registry-api.
52
52
  *
53
53
  * `subAgents` are agent slugs delegated as sub-agents on the session's
54
- * Agent Composition. The bar for declaring one is "needs its own model,
54
+ * Agent. The bar for declaring one is "needs its own model,
55
55
  * tools, or context"; most templates leave this empty and rely on
56
56
  * sub-skills (cheap, shared context).
57
57
  *
@@ -10,7 +10,7 @@ import {
10
10
  * Per-invocation hard limits. None are required at the contract level; an
11
11
  * absent field means "no caller-declared limit on this axis" (the platform may
12
12
  * still apply its own). These map directly onto the existing `composition.limits`
13
- * consumed by `CompositionBudgetEnforcer` — no new enforcement engine.
13
+ * consumed by `AgentBudgetEnforcer` — no new enforcement engine.
14
14
  */
15
15
  export interface InvocationLimits {
16
16
  readonly maxDurationMs?: number;
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
 
3
3
  /**
4
- * How the Composition Invocation Runtime executes an invocation.
4
+ * How the Agent Invocation Runtime executes an invocation.
5
5
  *
6
6
  * The platform owns mode selection (deterministic `selectMode`): a biome MAY
7
7
  * hint a mode via `ExecutionRequirements.mode`, but policy may override it.
@@ -16,7 +16,7 @@ import {
16
16
  */
17
17
  export interface InvocationRecord {
18
18
  readonly id: string;
19
- readonly compositionRef: string;
19
+ readonly agentRef: string;
20
20
  readonly orgId: string;
21
21
  readonly projectId: string | null;
22
22
  readonly threadKey: string;
@@ -38,7 +38,7 @@ export interface InvocationRecord {
38
38
 
39
39
  export const InvocationRecordSchema = z.object({
40
40
  id: z.string().min(1),
41
- compositionRef: z.string().min(1),
41
+ agentRef: z.string().min(1),
42
42
  orgId: z.string().min(1),
43
43
  projectId: z.string().min(1).nullable(),
44
44
  threadKey: z.string().min(1),
@@ -8,12 +8,12 @@ import {
8
8
  * The wire body for `composition:invoke@1` — what a caller sends through the
9
9
  * capability funnel to execute a published composition.
10
10
  *
11
- * `CompositionInvokeRequestSchema` is the fail-fast validator the runtime
11
+ * `AgentInvokeRequestSchema` is the fail-fast validator the runtime
12
12
  * applies at the wire boundary before any execution.
13
13
  */
14
- export interface CompositionInvokeRequest {
15
- /** Composition slug or `slug@version`. */
16
- readonly compositionRef: string;
14
+ export interface AgentInvokeRequest {
15
+ /** Agent slug or `slug@version`. */
16
+ readonly agentRef: string;
17
17
  readonly orgId: string;
18
18
  readonly projectId?: string;
19
19
  /** Stable execution-context key — org+mailbox+emailThreadId for mail. */
@@ -23,12 +23,12 @@ export interface CompositionInvokeRequest {
23
23
  readonly requirements: ExecutionRequirements;
24
24
  }
25
25
 
26
- export const CompositionInvokeRequestSchema = z.object({
27
- compositionRef: z.string().min(1),
26
+ export const AgentInvokeRequestSchema = z.object({
27
+ agentRef: z.string().min(1),
28
28
  orgId: z.string().min(1),
29
29
  projectId: z.string().min(1).optional(),
30
30
  threadKey: z.string().min(1),
31
31
  correlationId: z.string().min(1).optional(),
32
32
  input: z.record(z.string(), z.unknown()),
33
33
  requirements: ExecutionRequirementsSchema,
34
- }) as z.ZodType<CompositionInvokeRequest>;
34
+ }) as z.ZodType<AgentInvokeRequest>;
@@ -13,7 +13,7 @@ import {
13
13
  * `Event` mode `output` is omitted and the consumer subscribes to the result
14
14
  * completion event instead.
15
15
  */
16
- export interface CompositionInvokeResponse {
16
+ export interface AgentInvokeResponse {
17
17
  readonly invocationId: string;
18
18
  readonly status: InvocationStatus;
19
19
  readonly mode: InvocationMode;
@@ -26,7 +26,7 @@ export interface CompositionInvokeResponse {
26
26
  readonly auditId?: string;
27
27
  }
28
28
 
29
- export const CompositionInvokeResponseSchema = z.object({
29
+ export const AgentInvokeResponseSchema = z.object({
30
30
  invocationId: z.string().min(1),
31
31
  status: InvocationStatusSchema,
32
32
  mode: InvocationModeSchema,
@@ -36,4 +36,4 @@ export const CompositionInvokeResponseSchema = z.object({
36
36
  durationMs: z.number().optional(),
37
37
  modelRef: z.string().min(1).optional(),
38
38
  auditId: z.string().min(1).optional(),
39
- }) as z.ZodType<CompositionInvokeResponse>;
39
+ }) as z.ZodType<AgentInvokeResponse>;
@@ -2,7 +2,7 @@ import { z } from 'zod';
2
2
 
3
3
  /**
4
4
  * Lifecycle every versioned XemaObject moves through. Mirrors
5
- * `CompositionLifecycle` from `@xemahq/agent-composition-contracts` —
5
+ * `AgentLifecycle` from `@xemahq/agent-composition-contracts` —
6
6
  * the two enums MUST stay value-identical (one ownership model across
7
7
  * the four primitives + every other XemaObject kind, per
8
8
  * `.claude/rules/skills-and-composition.md`).
@@ -19,9 +19,9 @@ export enum XemaObjectKind {
19
19
  ExternalSubject = 'external-subject',
20
20
  DelegatedSession = 'delegated-session',
21
21
 
22
- // Agent runtime primitives + composition
22
+ // Agent runtime primitives a base kernel armed into an Agent
23
+ AgentKernel = 'agent-kernel',
23
24
  Agent = 'agent',
24
- AgentComposition = 'agent-composition',
25
25
  Skill = 'skill',
26
26
  Tool = 'tool',
27
27
  Model = 'model',
@@ -35,11 +35,11 @@ export const SubjectRefSchema = z.object({
35
35
  * - `ref` is the wire-stable address (`XemaObjectRef`).
36
36
  * - `kind` is the closed `XemaObjectKind` enum value.
37
37
  * - `scope` is the 5-tier ownership reference (single ownership model
38
- * shared with `SkillSpace` / `CompositionSpace`).
38
+ * shared with `SkillSpace` / `AgentSpace`).
39
39
  * - `owner` is the subject that owns the object.
40
40
  * - `version` is a semver string. Resolution serves only `Published`
41
41
  * versions per `ObjectLifecycle` semantics.
42
- * - `lifecycle` mirrors `CompositionLifecycle` (draft/published/archived).
42
+ * - `lifecycle` mirrors `AgentLifecycle` (draft/published/archived).
43
43
  * - `payload` is kind-specific; the resolved schema is supplied by the
44
44
  * owning domain contract package.
45
45
  */
@@ -14,9 +14,9 @@ import type { WorkflowVariableRequirement } from './variable-requirement';
14
14
  * Pre-resolved manifest source for `xema/agent`-shaped jobs. The
15
15
  * workflow-dsl compiler emits exactly one variant per agent step:
16
16
  *
17
- * • `ref` — long-form `with.compositionRef: <slug>` (or
17
+ * • `ref` — long-form `with.agentRef: <slug>` (or
18
18
  * `<slug>@<version>`) that the activity resolves at boot via
19
- * llm-registry-api's Agent Composition `GET /compositions/resolve/
19
+ * llm-registry-api's Agent `GET /compositions/resolve/
20
20
  * :ref`, reconstructing the compiled workspace manifest from the
21
21
  * resolved composition's `workspace.mountLayout` block.
22
22
  * • `inline` — short-form `with.mounts` whose agent metadata
@@ -30,7 +30,7 @@ import type { WorkflowVariableRequirement } from './variable-requirement';
30
30
  *
31
31
  * `null` for non-agent actions (compileManifestSource short-circuits
32
32
  * when the action manifest's `inputs.properties` lacks both
33
- * `compositionRef` and `mounts`).
33
+ * `agentRef` and `mounts`).
34
34
  */
35
35
  export type CompiledManifestSource =
36
36
  | { readonly kind: 'ref'; readonly ref: string }