@xemahq/kernel-contracts 0.5.1 → 0.7.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 (69) 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-composition/lib/invocation-overlay.d.ts.map +1 -1
  18. package/dist/agent-workspace/awp-spec.json +1 -1
  19. package/dist/contribution/lib/contribution-kind.d.ts +1 -1
  20. package/dist/contribution/lib/contribution-kind.d.ts.map +1 -1
  21. package/dist/contribution/lib/contribution-kind.js +1 -1
  22. package/dist/contribution/lib/contribution-kind.js.map +1 -1
  23. package/dist/invocation/lib/invocation-record.d.ts +1 -1
  24. package/dist/invocation/lib/invocation-record.d.ts.map +1 -1
  25. package/dist/invocation/lib/invocation-record.js +1 -1
  26. package/dist/invocation/lib/invocation-record.js.map +1 -1
  27. package/dist/invocation/lib/invoke-request.d.ts +3 -3
  28. package/dist/invocation/lib/invoke-request.d.ts.map +1 -1
  29. package/dist/invocation/lib/invoke-request.js +3 -3
  30. package/dist/invocation/lib/invoke-request.js.map +1 -1
  31. package/dist/invocation/lib/invoke-response.d.ts +2 -2
  32. package/dist/invocation/lib/invoke-response.d.ts.map +1 -1
  33. package/dist/invocation/lib/invoke-response.js +2 -2
  34. package/dist/invocation/lib/invoke-response.js.map +1 -1
  35. package/dist/object/lib/xema-object-kind.d.ts +1 -1
  36. package/dist/object/lib/xema-object-kind.d.ts.map +1 -1
  37. package/dist/object/lib/xema-object-kind.js +1 -1
  38. package/dist/object/lib/xema-object-kind.js.map +1 -1
  39. package/dist/workflow/lib/compiled-run.d.ts +0 -4
  40. package/dist/workflow/lib/compiled-run.d.ts.map +1 -1
  41. package/dist/workflow/lib/mount-plan.d.ts +1 -1
  42. package/dist/workflow/lib/mount-plan.d.ts.map +1 -1
  43. package/package.json +1 -1
  44. package/src/agent-composition/index.ts +2 -2
  45. package/src/agent-composition/lib/capability-layer.ts +9 -9
  46. package/src/agent-composition/lib/composition-limits-schema.ts +4 -4
  47. package/src/agent-composition/lib/composition-workspace.ts +18 -18
  48. package/src/agent-composition/lib/composition.ts +28 -28
  49. package/src/agent-composition/lib/invocation-overlay.ts +2 -3
  50. package/src/agent-workspace/lib/working-file.ts +1 -1
  51. package/src/agent-workspace/lib/workspace-spec.ts +3 -3
  52. package/src/biome-availability/lib/biome-availability.ts +3 -3
  53. package/src/contribution/lib/contribution-kind.ts +1 -1
  54. package/src/contribution/lib/contribution-source.ts +1 -1
  55. package/src/distribution/lib/distribution.ts +1 -1
  56. package/src/document-templates/lib/document-template.ts +1 -1
  57. package/src/invocation/lib/execution-requirements.ts +1 -1
  58. package/src/invocation/lib/invocation-mode.ts +1 -1
  59. package/src/invocation/lib/invocation-record.ts +2 -2
  60. package/src/invocation/lib/invoke-request.ts +7 -7
  61. package/src/invocation/lib/invoke-response.ts +3 -3
  62. package/src/object/lib/object-lifecycle.ts +1 -1
  63. package/src/object/lib/xema-object-kind.ts +2 -2
  64. package/src/object/lib/xema-object.ts +2 -2
  65. package/src/workflow/lib/compiled-run.ts +9 -17
  66. package/src/workflow/lib/compiled-workspace-manifest.ts +1 -1
  67. package/src/workflow/lib/errors.ts +2 -2
  68. package/src/workflow/lib/model-ref.ts +1 -1
  69. package/src/workflow/lib/mount-plan.ts +1 -1
@@ -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
  */
@@ -1,5 +1,3 @@
1
- import type { CompiledWorkspaceManifest } from './compiled-workspace-manifest';
2
-
3
1
  import type { BiomeAvailabilityScoped } from '../../biome-availability';
4
2
  import type { ActionRef } from './action-ref';
5
3
  import type { Briefcase } from './briefcase';
@@ -11,30 +9,24 @@ import type { TriggerPayload } from './trigger-payload';
11
9
  import type { WorkflowVariableRequirement } from './variable-requirement';
12
10
 
13
11
  /**
14
- * Pre-resolved manifest source for `xema/agent`-shaped jobs. The
15
- * workflow-dsl compiler emits exactly one variant per agent step:
12
+ * Pre-resolved manifest source for `xema/agent`-shaped jobs. `agentRef`
13
+ * is the SOLE way a workflow names its agent — the workflow-dsl compiler
14
+ * emits exactly one variant per agent step:
16
15
  *
17
- * • `ref` — long-form `with.compositionRef: <slug>` (or
16
+ * • `ref` — `with.agentRef` is a literal `<slug>` (or
18
17
  * `<slug>@<version>`) that the activity resolves at boot via
19
- * llm-registry-api's Agent Composition `GET /compositions/resolve/
18
+ * llm-registry-api's Agent `GET /compositions/resolve/
20
19
  * :ref`, reconstructing the compiled workspace manifest from the
21
20
  * resolved composition's `workspace.mountLayout` block.
22
- * • `inline` — short-form `with.mounts` whose agent metadata
23
- * (`agentSlug`, `stageKey`, `deliverableSpecRef`, every entry in
24
- * `mounts`) is fully literal at compile time. The compiler runs
25
- * `compileManifest()` once and embeds the result so the worker
26
- * skips both the DB round-trip and the runtime synthesis step.
27
- * • `inline-deferred` — short-form whose agent metadata still
28
- * contains `${{ … }}` expressions; the worker synthesizes the
29
- * inline manifest after expression evaluation.
21
+ * • `inline-deferred` — `with.agentRef` is a `${{ … }}` expression
22
+ * that resolves per dispatch; the worker resolves the named Agent
23
+ * after expression evaluation.
30
24
  *
31
25
  * `null` for non-agent actions (compileManifestSource short-circuits
32
- * when the action manifest's `inputs.properties` lacks both
33
- * `compositionRef` and `mounts`).
26
+ * when the action manifest's `inputs.properties` lacks `agentRef`).
34
27
  */
35
28
  export type CompiledManifestSource =
36
29
  | { readonly kind: 'ref'; readonly ref: string }
37
- | { readonly kind: 'inline'; readonly compiled: CompiledWorkspaceManifest }
38
30
  | { readonly kind: 'inline-deferred' };
39
31
 
40
32
  /**
@@ -80,7 +80,7 @@ export interface CompiledManifestAgent {
80
80
  * manifest's `spec.agent.instructions` (WS5 Phase B: author a migrated
81
81
  * agent as `base agent slug + instructions`). A prompt fragment the
82
82
  * runtime layers ONTO the referenced base agent's intrinsic system
83
- * prompt — semantically the same as `CompositionNode.instructions`.
83
+ * prompt — semantically the same as `AgentNode.instructions`.
84
84
  * Absent = the base agent's prompt passes through unchanged.
85
85
  */
86
86
  readonly instructions?: string;
@@ -18,9 +18,9 @@ export enum WorkflowErrorCode {
18
18
  DSL_UNKNOWN_ACTION = 'DSL_UNKNOWN_ACTION',
19
19
  DSL_UNKNOWN_REUSABLE_WORKFLOW = 'DSL_UNKNOWN_REUSABLE_WORKFLOW',
20
20
  /**
21
- * A literal `with.agentSlug` (or `with.reviewers[].agentSlug`) value
21
+ * A literal `with.agentRef` (or `with.reviewers[].agentRef`) value
22
22
  * does not appear in the resolvedAgents map the engine passed to the
23
- * compiler. Indicates a typo, a stale slug, or a new agent that was
23
+ * compiler. Indicates a typo, a stale ref, or a new agent that was
24
24
  * never seeded into llm-registry.
25
25
  */
26
26
  DSL_UNKNOWN_AGENT = 'DSL_UNKNOWN_AGENT',
@@ -148,7 +148,7 @@ export function isStrategyModelRef(ref: ModelRef): ref is StrategyModelRef {
148
148
  * The INVOCATION-overlay fragment shared by EVERY "agent node" shape — the
149
149
  * genuinely-identical trio that specializes a referenced agent WITHOUT
150
150
  * authoring a new definition. Single declaration site (the
151
- * `ModelRef`/`PermissionMap` reuse pattern): `CompositionNode`,
151
+ * `ModelRef`/`PermissionMap` reuse pattern): `AgentNode`,
152
152
  * `SubAgentBinding`, the compiled manifest agent block, and the typed
153
153
  * workflow/session invocation overlays all `extends` this — the trio is
154
154
  * never restated per shape.
@@ -113,7 +113,7 @@ export type MountSource =
113
113
  | { readonly kind: 'static-literal'; readonly pathWithinWorkspace: string; readonly bytes: string }
114
114
  // Platform-rendered (PR 1 of unified-workspace-image refactor):
115
115
  | {
116
- readonly kind: 'agent-definition';
116
+ readonly kind: 'agent-kernel';
117
117
  readonly orgId: string;
118
118
  readonly agentSlug: string;
119
119
  readonly stageKey: string;