@xemahq/dsl 0.8.1 → 0.8.3

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 (80) hide show
  1. package/dist/payload-codec/index.d.ts.map +1 -1
  2. package/dist/payload-codec/index.js.map +1 -1
  3. package/dist/payload-codec/lib/codec.d.ts.map +1 -1
  4. package/dist/payload-codec/lib/codec.js +2 -1
  5. package/dist/payload-codec/lib/codec.js.map +1 -1
  6. package/dist/payload-codec/lib/payload.d.ts.map +1 -1
  7. package/dist/schema/action.schema.json +205 -39
  8. package/dist/schema/workflow.schema.json +335 -88
  9. package/dist/workflow/index.d.ts.map +1 -1
  10. package/dist/workflow/index.js.map +1 -1
  11. package/dist/workflow/lib/compiler/compile.js +1 -1
  12. package/dist/workflow/lib/compiler/compile.js.map +1 -1
  13. package/package.json +2 -18
  14. package/schema/action.schema.json +205 -39
  15. package/schema/workflow.schema.json +335 -88
  16. package/dist/payload-codec/temporal/index.d.ts +0 -5
  17. package/dist/payload-codec/temporal/index.d.ts.map +0 -1
  18. package/dist/payload-codec/temporal/index.js +0 -7
  19. package/dist/payload-codec/temporal/index.js.map +0 -1
  20. package/src/deliverable-spec/index.ts +0 -19
  21. package/src/deliverable-spec/lib/schema.ts +0 -270
  22. package/src/deliverable-spec/lib/types.ts +0 -26
  23. package/src/payload-codec/index.ts +0 -44
  24. package/src/payload-codec/lib/blob-store.ts +0 -176
  25. package/src/payload-codec/lib/codec-context.ts +0 -38
  26. package/src/payload-codec/lib/codec.ts +0 -605
  27. package/src/payload-codec/lib/enums.ts +0 -58
  28. package/src/payload-codec/lib/errors.ts +0 -54
  29. package/src/payload-codec/lib/http-blob-store.ts +0 -267
  30. package/src/payload-codec/lib/lru-cache.ts +0 -81
  31. package/src/payload-codec/lib/payload.ts +0 -26
  32. package/src/payload-codec/temporal/index.ts +0 -36
  33. package/src/workflow/index.ts +0 -108
  34. package/src/workflow/lib/action-input-validator.ts +0 -160
  35. package/src/workflow/lib/compiler/action-shape.ts +0 -71
  36. package/src/workflow/lib/compiler/canonical-json.ts +0 -66
  37. package/src/workflow/lib/compiler/compile.ts +0 -1742
  38. package/src/workflow/lib/compiler/concurrency.ts +0 -223
  39. package/src/workflow/lib/compiler/dag.ts +0 -108
  40. package/src/workflow/lib/compiler/gate-defaults.ts +0 -153
  41. package/src/workflow/lib/compiler/index.ts +0 -11
  42. package/src/workflow/lib/compiler/inputs.ts +0 -254
  43. package/src/workflow/lib/compiler/installation-resource-validator.ts +0 -114
  44. package/src/workflow/lib/compiler/manifest-source.ts +0 -71
  45. package/src/workflow/lib/compiler/matrix.ts +0 -135
  46. package/src/workflow/lib/compiler/mount-plan.ts +0 -190
  47. package/src/workflow/lib/compiler/payload-reach-in.ts +0 -497
  48. package/src/workflow/lib/compiler/permissions.ts +0 -64
  49. package/src/workflow/lib/compiler/retry-timeout.ts +0 -105
  50. package/src/workflow/lib/compiler/review-step.ts +0 -548
  51. package/src/workflow/lib/compiler/types.ts +0 -172
  52. package/src/workflow/lib/compiler/variable-requirements.ts +0 -208
  53. package/src/workflow/lib/deliverable-spec-introspection-error.ts +0 -63
  54. package/src/workflow/lib/deliverable-spec-keys.ts +0 -147
  55. package/src/workflow/lib/deliverable-spec-source-scan.ts +0 -280
  56. package/src/workflow/lib/dispatch-inputs/index.ts +0 -160
  57. package/src/workflow/lib/dispatch-inputs/to-json-schema.ts +0 -60
  58. package/src/workflow/lib/duration.ts +0 -43
  59. package/src/workflow/lib/errors.ts +0 -37
  60. package/src/workflow/lib/expression/ast.ts +0 -108
  61. package/src/workflow/lib/expression/context.ts +0 -148
  62. package/src/workflow/lib/expression/evaluator.ts +0 -492
  63. package/src/workflow/lib/expression/index.ts +0 -28
  64. package/src/workflow/lib/expression/interpolation.ts +0 -84
  65. package/src/workflow/lib/expression/parser.ts +0 -264
  66. package/src/workflow/lib/expression/template.ts +0 -117
  67. package/src/workflow/lib/expression/tokenizer.ts +0 -200
  68. package/src/workflow/lib/expression/tokens.ts +0 -30
  69. package/src/workflow/lib/expression/walk-artifact-refs.ts +0 -232
  70. package/src/workflow/lib/installation-resource-kind.ts +0 -107
  71. package/src/workflow/lib/schemas-loader.ts +0 -64
  72. package/src/workflow/lib/serializer.ts +0 -30
  73. package/src/workflow/lib/types.ts +0 -417
  74. package/src/workflow/lib/validate.ts +0 -199
  75. package/src/workspace-manifest/index.ts +0 -27
  76. package/src/workspace-manifest/lib/compile.ts +0 -619
  77. package/src/workspace-manifest/lib/interpolate.ts +0 -166
  78. package/src/workspace-manifest/lib/resolve-extends.ts +0 -260
  79. package/src/workspace-manifest/lib/schema.ts +0 -692
  80. package/src/workspace-manifest/lib/types.ts +0 -446
@@ -1,446 +0,0 @@
1
- // ═══════════════════════════════════════════════════════════════════════════
2
- // ── AgentWorkspaceSpec types ──
3
- //
4
- // A AgentWorkspaceSpec declares the SHAPE of `/workspace/` for an agent
5
- // invocation: which user-data mounts (inputs, references, repos, …) the
6
- // agent expects, which platform-rendered slots the composer should
7
- // auto-emit (agents-md, context-json, agent-bundles, …), and which
8
- // per-profile seed files to drop in.
9
- //
10
- // Workflows reference manifests by `agentRef:` on the `xema/agent`
11
- // action — the named Agent carries the manifest on its
12
- // `workspace.mountLayout` block; interactive sessions reference them via
13
- // the session's composition. The composer in `@xemahq/agent-session-runtime`
14
- // turns a (manifest, bindInputs) pair into a `WorkspaceMountPlan` and
15
- // posts it to `/workspace/mounts/apply`.
16
- //
17
- // Manifests are shipped by biomes as `*.workspace.yaml` content;
18
- // on install each is compiled and projected into a published Agent
19
- // Agent. Customers author them with the same ergonomics as
20
- // workflow YAMLs.
21
- // ═══════════════════════════════════════════════════════════════════════════
22
-
23
- /**
24
- * Top-level manifest envelope. `apiVersion: xema.dev/workspace/v1`,
25
- * `kind: AgentWorkspaceSpec`. Versioning is at the spec level —
26
- * manifests are stored by `(slug, version)` so old workflow runs always
27
- * resolve to the manifest they were authored against.
28
- *
29
- * `extends:` (optional) names a base manifest to inherit from.
30
- * Resolution is single-level: the base manifest itself MUST NOT carry
31
- * its own `extends:`. The resolver merges the base's spec into the
32
- * child's spec deterministically (see {@link MANIFEST_MERGE_RULES}):
33
- * • `mounts` and `inputs` are unioned key-by-key; child's per-slot
34
- * declaration wins on conflict.
35
- * • `seedFiles` and `env` are concatenated (base first, child after);
36
- * duplicates by `path` / `name` keep the LAST occurrence (child wins).
37
- * • `agent` block is fully replaced by the child (it's the agent's
38
- * identity, not inheritable).
39
- *
40
- * The reference is a `xema://manifest/<slug>@<version>` URI. The
41
- * resolver in {@link resolveManifestExtends} fetches the base via a
42
- * caller-supplied lookup function — the kernel package stays runtime-
43
- * dep-free.
44
- */
45
- export interface AgentWorkspaceSpec {
46
- readonly apiVersion: 'xema.dev/workspace/v1';
47
- readonly kind: 'WorkspaceManifest';
48
- readonly extends?: string;
49
- readonly metadata: WorkspaceManifestMetadata;
50
- readonly spec: WorkspaceManifestSpec;
51
- }
52
-
53
- /**
54
- * Slugs of the kernel-shipped manifest templates. Biomes/orgs may
55
- * register their own templates with their own slugs; these four are
56
- * always available at the system tier.
57
- *
58
- * `primary-agent-base` — coordinator/lead/executor shape with
59
- * inputs RO, references RO, attachments
60
- * RO, deliverables RW.
61
- * `subagent-base` — same as primary-agent-base minus
62
- * attachments.
63
- * `reviewer-base` — adds `prior-artifacts`, `review-brief`,
64
- * `findings` slots for review flows.
65
- * `agent-session-base` — adds session-attachments slot for
66
- * chat-driven runs.
67
- */
68
- export const KERNEL_MANIFEST_TEMPLATE_SLUGS = [
69
- 'primary-agent-base',
70
- 'subagent-base',
71
- 'reviewer-base',
72
- 'agent-session-base',
73
- ] as const;
74
-
75
- export type KernelManifestTemplateSlug = (typeof KERNEL_MANIFEST_TEMPLATE_SLUGS)[number];
76
-
77
- export interface WorkspaceManifestMetadata {
78
- readonly slug: string;
79
- readonly version: string;
80
- /**
81
- * `system` (xema-internal), or any string identifying the org. The
82
- * `biome:<id>` source tier is stored separately on the row, not in
83
- * the manifest YAML itself.
84
- */
85
- readonly org?: string;
86
- readonly description?: string;
87
- /**
88
- * Execution surfaces this manifest is compatible with. Optional in
89
- * YAML for additive rollout; the compiler defaults absent values to
90
- * `[workflow, agent-session]` so existing manifests keep
91
- * compiling. Validated against {@link ManifestSurface}. Pairs with
92
- * the workflow action manifest's `consumes[].surfaces` and the
93
- * agent-session runtime — a manifest with
94
- * `surfaceCompat: [workflow]` cannot boot an interactive session,
95
- * and the runtime fails fast at resolve time.
96
- */
97
- readonly surfaceCompat?: readonly ManifestSurface[];
98
- /** Optional UX framing — drives Studio tiles, picker grouping. */
99
- readonly display?: ManifestDisplayMetadata;
100
- }
101
-
102
- export interface ManifestDisplayMetadata {
103
- readonly title?: string;
104
- readonly blurb?: string;
105
- /** Icon slug (frontend maps it to a glyph). */
106
- readonly icon?: string;
107
- /** Picker grouping. Free-form; kernel-shipped manifests prefer a closed set. */
108
- readonly category?: string;
109
- readonly badges?: readonly string[];
110
- readonly sortOrder?: number;
111
- readonly hidden?: boolean;
112
- /** Call-to-action shown on the session-start tile. */
113
- readonly ctaText?: string;
114
- /** Marks a kernel-curated manifest (set by the kernel biome seeder). */
115
- readonly curated?: boolean;
116
- }
117
-
118
- export interface WorkspaceManifestSpec {
119
- /** Runtime parameters the manifest accepts at bind time. */
120
- readonly inputs?: Record<string, ManifestInputDeclaration>;
121
- /** User-data mounts (resolved from bind inputs). */
122
- readonly mounts?: ManifestMountsBlock;
123
- /** Agent runtime config — composer auto-derives the .opencode/* slots. */
124
- readonly agent: ManifestAgentBlock;
125
- /** Skill bundles auto-mounted at session/workflow boot. */
126
- readonly skills?: readonly ManifestSkillRef[];
127
- /**
128
- * Default MCP tool selection inherited by every session/run booted on
129
- * this manifest. Resolved at boot via mcp-gateway-api `POST /mcp-resolve`
130
- * and merged into `opencode.json:mcp`. Sessions may override per-instance
131
- * via `PATCH /sessions/:id/tools`.
132
- */
133
- readonly toolSelection?: readonly ToolSelectionEntry[];
134
- /** Credential bindings resolved before agent dispatch. */
135
- readonly credentials?: readonly ManifestCredential[];
136
- /** Tool permissions overlay (allow/deny lists over agent's intrinsic floor). */
137
- readonly permissions?: ManifestPermissions;
138
- /** Workspace-relative paths captured on pause and restored on resume. */
139
- readonly persistence?: ManifestPersistence;
140
- /** Output-surface declaration (consumed by workspace-proxy). */
141
- readonly outputSurface?: ManifestOutputSurface;
142
- /** Profile-specific seed files (rendered via Handlebars or inlined). */
143
- readonly seedFiles?: readonly ManifestSeedFile[];
144
- /** Env vars applied via `PATCH /env/variables`. */
145
- readonly env?: readonly ManifestEnvVar[];
146
- /**
147
- * Working files the platform materialises before the agent's first
148
- * turn. Each entry binds a `<workspace-relative-path>.<ext>` to a
149
- * source (`kb-page`, `git-file`, …) the platform keeps in sync for
150
- * the lifetime of the session. The compiled output's `path` and
151
- * `sourceRef` carry `${input.x}`-interpolated values; the worker's
152
- * working-file engine dispatches by `sourceKind`.
153
- */
154
- readonly workingFiles?: readonly ManifestWorkingFile[];
155
- }
156
-
157
- /**
158
- * Single working-file declaration in the manifest YAML. The schema's
159
- * `path` regex requires a workspace-relative path (no leading `/`, no
160
- * `..` segments); `slug` mirrors the file basename so the agent's
161
- * mental model of `<slug>` and the on-disk file stay aligned. `format`
162
- * + `syncDirection` are closed enums.
163
- *
164
- * `sourceRef` is a kind-specific string map (e.g. `{ pageId, versionId }`
165
- * for `kb-page`). Values may carry `${input.x}` tokens — the compile
166
- * step interpolates them against the bind inputs.
167
- */
168
- export interface ManifestWorkingFile {
169
- readonly slug: string;
170
- readonly path: string;
171
- readonly format: 'markdown' | 'html' | 'json' | 'yaml' | 'text';
172
- readonly syncDirection: 'down-only' | 'up-only' | 'bidirectional';
173
- readonly sourceKind: string;
174
- readonly sourceRef: Readonly<Record<string, string>>;
175
- }
176
-
177
- export interface ManifestSkillRef {
178
- readonly slug: string;
179
- /** Optional semver range pin (`^1`, `~1.2.3`, etc.). */
180
- readonly version?: string;
181
- }
182
-
183
- export interface ManifestCredential {
184
- /** Stable name — UPPER_SNAKE_CASE; referenced from `env[].value`. */
185
- readonly name: string;
186
- readonly kind: CredentialBackendKind;
187
- /** Backend-specific reference. Interpreted by the credential fetcher. */
188
- readonly sourceRef: string;
189
- /** Required = resolve failure fails the bootstrap; optional = drift warning. */
190
- readonly required?: boolean;
191
- }
192
-
193
- export interface ManifestPermissions {
194
- readonly tools: {
195
- readonly allow?: readonly ToolsetKey[];
196
- readonly deny?: readonly ToolsetKey[];
197
- };
198
- }
199
-
200
- /**
201
- * Per-slot persistence policy override. Currently only `git-push` is
202
- * overridable — `tarball`/`none` have no fields biomes need to tune.
203
- * Mirrors `SlotPersistencePolicy.git-push` in
204
- * `@xemahq/kernel-contracts/agent-workspace`, plus the contract-mirror enums
205
- * (`ManifestGitPushBranchSuffix`, `ManifestGitPushConcurrencyMode`)
206
- * imported below.
207
- */
208
- export interface ManifestSlotPersistenceOverride {
209
- readonly kind: 'git-push';
210
- readonly branchPrefix: string;
211
- readonly branchSuffix?: import('@xemahq/kernel-contracts/workflow').ManifestGitPushBranchSuffix;
212
- readonly concurrencyMode?: import('@xemahq/kernel-contracts/workflow').ManifestGitPushConcurrencyMode;
213
- /**
214
- * Fully-qualified long-lived branch the per-session branch auto-merges
215
- * into on pause (per-session-branch + auto-merge model). Mirrors
216
- * `SlotPersistencePolicy.git-push.mergeTarget` in
217
- * `@xemahq/kernel-contracts/agent-workspace`.
218
- */
219
- readonly mergeTarget?: string;
220
- }
221
-
222
- export interface ManifestPersistence {
223
- /** Workspace-relative paths. No leading `/`, no `..`. */
224
- readonly paths: readonly string[];
225
- /**
226
- * Per-slot persistence policy overrides. Keyed by AWP slot key
227
- * (`repos`, etc.). Compile-time-validated against the kernel spec —
228
- * unknown slot keys and overrides of non-`git-push` slots fail
229
- * compilation.
230
- */
231
- readonly overrides?: Readonly<Record<string, ManifestSlotPersistenceOverride>>;
232
- }
233
-
234
- export type ManifestOutputSurfaceMode = 'single' | 'multi';
235
-
236
- export interface ManifestOutputSurface {
237
- readonly kind: OutputSurfaceKind;
238
- readonly port?: number;
239
- readonly healthPath?: string;
240
- /** Auto-open the preview pane on first ready signal. */
241
- readonly autoOpen?: boolean;
242
- /**
243
- * Single-port (default) vs. multi-app output surface. `multi` lets
244
- * workspace-proxy's output-surface supervisor allocate a port per detected
245
- * app target and emit one gateway route per app — used by webapp
246
- * studios that scaffold N apps under one session.
247
- */
248
- readonly mode?: ManifestOutputSurfaceMode;
249
- /**
250
- * Workspace-relative directory served as a static site. Required by
251
- * the schema when `kind === 'static'` and rejected for other kinds.
252
- * The baked `static-artifact-server.mjs` serves this directory at the
253
- * supervisor-assigned port.
254
- */
255
- readonly root?: string;
256
- /**
257
- * Default document name for directory requests in a `static` surface.
258
- * Defaults to `index.html` at compile time. Schema rejects the field
259
- * for non-`static` kinds.
260
- */
261
- readonly defaultDocument?: string;
262
- }
263
-
264
- export interface ManifestInputDeclaration {
265
- readonly type: 'string' | 'string[]' | 'boolean' | 'number' | 'object[]';
266
- readonly required?: boolean;
267
- readonly default?:
268
- | string
269
- | number
270
- | boolean
271
- | readonly string[]
272
- | readonly Readonly<Record<string, unknown>>[];
273
- /** Closed-set values; if omitted any value of the right type is allowed. */
274
- readonly enum?: readonly string[];
275
- readonly description?: string;
276
- }
277
-
278
- /**
279
- * User-data mount declarations. Each key matches a slot in
280
- * `AWP_V1_SPEC` (inputs, references, repos, deliverable-specs,
281
- * deliverables, attachments). Values can be `true`/`false` (use
282
- * defaults), a mode override (`{ mode: 'read-write' }`), or per-slot
283
- * config (e.g. `references: { kbSpaces: ${input.x} }`).
284
- *
285
- * Platform slots (agents-md, context-json, agent-bundles, etc.) are
286
- * NEVER declared here — the composer auto-emits them based on
287
- * `spec.agent`.
288
- */
289
- export type ManifestMountsBlock = Record<string, ManifestMountDeclaration>;
290
-
291
- export type ManifestMountDeclaration =
292
- | boolean
293
- | { readonly mode?: 'read-only' | 'read-write' }
294
- | { readonly kbSpaces: ReadonlyArray<string> | string }
295
- | { readonly externalProjects: ReadonlyArray<string> | string }
296
- | { readonly mode?: 'read-only' | 'read-write'; readonly [key: string]: unknown };
297
-
298
- export interface ManifestAgentBlock {
299
- /** Agent slug to compose. May reference `${input.x}`. */
300
- readonly slug: string;
301
- /** Stage key (e.g. `engineering`, `interactive`). */
302
- readonly stage: string;
303
- /**
304
- * Worker role — drives AGENTS.md rendering and the system-overlay
305
- * `authority` block surfaced to the agent.
306
- * Validated by `ManifestAgentBlockSchema` against
307
- * `AGENT_RUN_ROLES` from `@xemahq/kernel-contracts/workflow`, so
308
- * `compileManifest` returns a strongly-typed `AgentRunRole`.
309
- */
310
- readonly role: AgentRunRole;
311
- /** Optional deliverable spec ref. May reference `${input.x}`. */
312
- readonly deliverableSpecRef?: string;
313
- /**
314
- * Optional default model suggestion for the primary agent. Concrete or
315
- * strategy ref (`@xemahq/workflow-contracts:ModelRef`). Step/session
316
- * overrides take precedence; this is the manifest's recommended pick
317
- * when no override is supplied. Validated as a discriminated union by
318
- * `ManifestAgentBlockSchema`.
319
- */
320
- readonly defaultModel?: ManifestModelRef;
321
- /**
322
- * Optional node-level instructions. A prompt
323
- * fragment layered ONTO the referenced base agent's intrinsic system
324
- * prompt — the same lever as `AgentNode.instructions`, exposed here
325
- * so a AgentWorkspaceSpec can author a migrated agent as
326
- * `base agent slug + instructions` without minting a new agent definition.
327
- * May reference `${input.x}`. Bounded by `MAX_AGENT_INSTRUCTIONS_LENGTH`
328
- * and validated fail-fast by `ManifestAgentBlockSchema`.
329
- */
330
- readonly instructions?: string;
331
- /**
332
- * How `instructions` combine with the referenced base agent's
333
- * `systemPrompt`. Absent ⇒ {@link PromptMergeMode.Append}. `Replace` makes
334
- * `instructions` the system prompt while still inheriting the base agent's
335
- * CONFIG. Validated by `ManifestAgentBlockSchema`.
336
- */
337
- readonly promptMode?: PromptMergeMode;
338
- /**
339
- * Optional per-agent permission override. A partial
340
- * OpenCode-style `PermissionMap` deep-merged (per top-level key) over the
341
- * referenced base agent's authored permission before the system tiers run.
342
- * Lets a generic base agent be specialized into a bounded role (read-only
343
- * reviewer, scoped `task` allowlist) without minting a new agent
344
- * definition. Validated by `ManifestAgentBlockSchema`.
345
- */
346
- readonly permission?: PermissionMap;
347
- /**
348
- * Optional sub-agent delegates the manifest bundles with the primary
349
- * agent. Layered ON TOP of the primary's intrinsic delegates (declared
350
- * in its source `permission.task` allowlist); step/session overrides
351
- * add more on top. Bindings only ADD or refine model overrides — they
352
- * never remove an intrinsic delegate.
353
- */
354
- readonly subAgents?: readonly ManifestSubAgent[];
355
- }
356
-
357
- export type ManifestModelRef =
358
- | {
359
- readonly kind: 'concrete';
360
- readonly modelId: string;
361
- readonly providerSlug?: string;
362
- readonly temperature?: number;
363
- }
364
- | {
365
- readonly kind: 'strategy';
366
- readonly modelClass: ModelClass;
367
- readonly temperature?: number;
368
- };
369
-
370
- export interface ManifestSubAgent {
371
- readonly slug: string;
372
- readonly alias?: string;
373
- readonly defaultModel?: ManifestModelRef;
374
- /**
375
- * Optional node-level instructions for this delegate. Same
376
- * `base agent slug + instructions` lever as the primary agent block;
377
- * layered onto the referenced agent's intrinsic system prompt. May
378
- * reference `${input.x}`. Bounded by `MAX_AGENT_INSTRUCTIONS_LENGTH`.
379
- */
380
- readonly instructions?: string;
381
- /**
382
- * How `instructions` combine with the referenced base agent's
383
- * `systemPrompt`. Absent ⇒ {@link PromptMergeMode.Append}.
384
- */
385
- readonly promptMode?: PromptMergeMode;
386
- /**
387
- * Optional per-delegate permission override. Deep-merged (per top-level
388
- * key) over the referenced base agent's authored permission before the
389
- * system tiers run — the lever that turns a generic base agent into a
390
- * bounded delegate. Validated by `ManifestSubAgentSchema`.
391
- */
392
- readonly permission?: PermissionMap;
393
- }
394
-
395
- export interface ManifestSeedFile {
396
- /** Path relative to `/workspace/`. No leading `/`, no `..`. */
397
- readonly path: string;
398
- /** Mount slot to land in. Defaults to `inputs` if omitted. */
399
- readonly slot?: string;
400
- /** Named template — resolved at composition time from a skill-bundle
401
- * resource (`assets/templates/<name>.hbs`) served by `skill-registry-api`. */
402
- readonly template?: string;
403
- /** Inline content — alternative to `template`. */
404
- readonly content?: string;
405
- /** Variables passed to the template renderer. May reference `${input.x}`. */
406
- readonly vars?: Record<string, unknown>;
407
- }
408
-
409
- export interface ManifestEnvVar {
410
- readonly name: string;
411
- readonly value: string;
412
- }
413
-
414
- export type {
415
- CompiledWorkspaceManifest,
416
- CompiledMountDeclaration,
417
- CompiledSeedFile,
418
- CompiledSeedFileSource,
419
- } from '@xemahq/kernel-contracts/workflow';
420
-
421
- import type {
422
- AgentRunRole,
423
- CompiledWorkspaceManifest,
424
- CredentialBackendKind,
425
- ManifestSurface,
426
- ModelClass,
427
- OutputSurfaceKind,
428
- PromptMergeMode,
429
- ToolsetKey,
430
- } from '@xemahq/kernel-contracts/workflow';
431
- import type { ToolSelectionEntry } from '@xemahq/kernel-contracts/mcp-tool';
432
- import type { PermissionMap } from '@xemahq/kernel-contracts/agent-workspace';
433
-
434
- export interface ManifestIssue {
435
- readonly path: string;
436
- readonly message: string;
437
- }
438
-
439
- /**
440
- * Result envelope for `compileManifest()`. Validation never throws —
441
- * callers pattern-match on the discriminator. Lets the editor + preview
442
- * flow surface every issue at once without try/catch ceremony.
443
- */
444
- export type CompileResult =
445
- | { readonly ok: true; readonly compiled: CompiledWorkspaceManifest }
446
- | { readonly ok: false; readonly errors: readonly ManifestIssue[] };