owenloop 0.5.8 → 0.5.9

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 (87) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +4 -2
  3. package/dist/packages/work/src/agent/loop.d.ts +23 -8
  4. package/dist/packages/work/src/agent/loop.js +48 -6
  5. package/dist/packages/work/src/consumed-verifier.js +6 -17
  6. package/dist/packages/work/src/exec/loop.d.ts +1 -1
  7. package/dist/packages/work/src/exec/loop.js +181 -32
  8. package/dist/packages/work/src/exec/receipt.d.ts +7 -7
  9. package/dist/packages/work/src/exec/receipt.js +6 -6
  10. package/dist/packages/work/src/harness/claude.js +100 -0
  11. package/dist/packages/work/src/hub/client.d.ts +19 -4
  12. package/dist/packages/work/src/hub/client.js +7 -3
  13. package/dist/packages/work/src/hub/types.d.ts +84 -0
  14. package/dist/packages/work/src/main.js +1 -0
  15. package/dist/packages/work/src/roles/agent-run.js +19 -22
  16. package/dist/packages/work/src/roles/exec.js +2 -0
  17. package/dist/packages/work/src/roles/settings.js +2 -0
  18. package/dist/packages/work/src/roles/shift.js +14 -2
  19. package/dist/packages/work/src/roles/util.d.ts +1 -0
  20. package/dist/packages/work/src/roles/util.js +10 -0
  21. package/dist/packages/work/src/settings/hub-roster-cache.d.ts +68 -0
  22. package/dist/packages/work/src/settings/hub-roster-cache.js +370 -0
  23. package/dist/packages/work/src/settings/roster.d.ts +84 -0
  24. package/dist/packages/work/src/settings/roster.js +364 -5
  25. package/dist/packages/work/src/settings/serving.d.ts +17 -0
  26. package/dist/packages/work/src/settings/serving.js +79 -0
  27. package/dist/packages/work/src/settings/settings.d.ts +14 -1
  28. package/dist/packages/work/src/settings/settings.js +14 -0
  29. package/dist/packages/work/src/shift/loop.d.ts +108 -5
  30. package/dist/packages/work/src/shift/loop.js +299 -51
  31. package/dist/packages/work/src/shift/protocol.d.ts +7 -5
  32. package/dist/packages/work/src/shift/runtime.d.ts +15 -0
  33. package/dist/packages/work/src/shift/runtime.js +94 -4
  34. package/dist/packages/work/src/shift/server.js +2 -0
  35. package/dist/packages/work/src/shift/spawn.d.ts +17 -2
  36. package/dist/packages/work/src/shift/spawn.js +16 -13
  37. package/dist/packages/work/src/shift/state.d.ts +29 -2
  38. package/dist/packages/work/src/shift/state.js +45 -15
  39. package/dist/packages/work/src/usage.d.ts +1 -1
  40. package/dist/packages/work/src/usage.js +7 -1
  41. package/dist/packages/work/src/util/modifier-init.d.ts +7 -0
  42. package/dist/packages/work/src/util/modifier-init.js +73 -0
  43. package/dist/src/bundle/tar.d.ts +9 -4
  44. package/dist/src/bundle/tar.js +9 -4
  45. package/dist/src/capabilities.d.ts +6 -0
  46. package/dist/src/cli.d.ts +14 -1
  47. package/dist/src/cli.js +687 -75
  48. package/dist/src/config-dir.d.ts +1 -1
  49. package/dist/src/config-dir.js +1 -1
  50. package/dist/src/crypto/index.d.ts +1 -1
  51. package/dist/src/crypto/index.js +1 -1
  52. package/dist/src/crypto/org-root.d.ts +30 -12
  53. package/dist/src/crypto/org-root.js +162 -14
  54. package/dist/src/crypto/records.d.ts +2 -0
  55. package/dist/src/crypto/records.js +2 -0
  56. package/dist/src/defs.d.ts +6 -1
  57. package/dist/src/defs.js +203 -8
  58. package/dist/src/engine.d.ts +42 -7
  59. package/dist/src/engine.js +158 -16
  60. package/dist/src/index.d.ts +4 -4
  61. package/dist/src/index.js +2 -2
  62. package/dist/src/mcp/serve.d.ts +22 -0
  63. package/dist/src/mcp/serve.js +88 -8
  64. package/dist/src/model.d.ts +2 -0
  65. package/dist/src/model.js +32 -25
  66. package/dist/src/order-resolver.d.ts +1 -0
  67. package/dist/src/order-resolver.js +8 -1
  68. package/dist/src/schemas/index.d.ts +11 -0
  69. package/dist/src/schemas/order.v1.schema.json +7 -1
  70. package/dist/src/store.d.ts +5 -0
  71. package/dist/src/store.js +43 -8
  72. package/dist/src/types.d.ts +40 -3
  73. package/docs/authoring.md +90 -2
  74. package/docs/bundles.md +26 -2
  75. package/docs/cli.md +170 -28
  76. package/docs/crypto.md +19 -3
  77. package/docs/design.md +70 -1
  78. package/docs/routing.md +189 -34
  79. package/docs/shift-logs.md +20 -9
  80. package/docs/wire-contracts.md +50 -7
  81. package/examples/workflows/delivery.yaml +31 -14
  82. package/examples/workflows/ship.yaml +10 -2
  83. package/package.json +1 -1
  84. package/plugins/claude-code/plugin/.claude-plugin/plugin.json +1 -1
  85. package/plugins/claude-code/plugin/.mcp.json +1 -1
  86. package/plugins/codex/plugins/owenloop/.codex-plugin/plugin.json +1 -1
  87. package/plugins/codex/plugins/owenloop/.mcp.json +1 -1
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * The ONE resolver for owenloop's own user-level config directory — the
3
3
  * directory that directly holds `settings.json`, `credentials.json`,
4
- * `allowed_signers`, `org-root.pub`, `roster/`, and `revocations/`.
4
+ * `allowed_signers`, `org-root.pub`, `grants/`, and `revocations/`.
5
5
  *
6
6
  * WHY THIS MODULE EXISTS. Until now four call sites each re-derived the same
7
7
  * ladder, which made it too easy for each subsystem to resolve a different
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * The ONE resolver for owenloop's own user-level config directory — the
3
3
  * directory that directly holds `settings.json`, `credentials.json`,
4
- * `allowed_signers`, `org-root.pub`, `roster/`, and `revocations/`.
4
+ * `allowed_signers`, `org-root.pub`, `grants/`, and `revocations/`.
5
5
  *
6
6
  * WHY THIS MODULE EXISTS. Until now four call sites each re-derived the same
7
7
  * ladder, which made it too easy for each subsystem to resolve a different
@@ -39,7 +39,7 @@ export { validateEnrollmentChain, validateProducer, revocationTemporalConsistenc
39
39
  export type { ChainInput, ChainOptions, ChainVerdict } from './chain.ts';
40
40
  export { attenuate, axisPermits, delegationPermits, ORG_ROOT_SCOPE, scopePermits, } from './scope.ts';
41
41
  export type { ScopeAxis } from './scope.ts';
42
- export { loadRoster, loadRevocations, orgRootPrivateKeyPath, orgRootPublicKeyPath, resolveOrgRoot, revocationsDir, rosterDir, } from './org-root.ts';
42
+ export { loadGrants, loadRevocations, orgRootPrivateKeyPath, orgRootPublicKeyPath, resolveOrgRoot, revocationsDir, grantsDir, StrandedLegacyGrantsError, } from './org-root.ts';
43
43
  export type { OrgRootAbsent, OrgRootPresent, OrgRootResolution } from './org-root.ts';
44
44
  export { canonicalValueBytes, valueDigestHex } from './canonical.ts';
45
45
  export { buildSubmissionRecord, signSubmission } from './submission.ts';
@@ -36,7 +36,7 @@ export { DEFAULT_MACHINE_SCOPE, buildEnrollmentGrant, verifyRosterEntry, } from
36
36
  // ---- enrollment chain ----
37
37
  export { validateEnrollmentChain, validateProducer, revocationTemporalConsistency, } from "./chain.js";
38
38
  export { attenuate, axisPermits, delegationPermits, ORG_ROOT_SCOPE, scopePermits, } from "./scope.js";
39
- export { loadRoster, loadRevocations, orgRootPrivateKeyPath, orgRootPublicKeyPath, resolveOrgRoot, revocationsDir, rosterDir, } from "./org-root.js";
39
+ export { loadGrants, loadRevocations, orgRootPrivateKeyPath, orgRootPublicKeyPath, resolveOrgRoot, revocationsDir, grantsDir, StrandedLegacyGrantsError, } from "./org-root.js";
40
40
  // ---- WP-D2 signed submission records ----
41
41
  export { canonicalValueBytes, valueDigestHex } from "./canonical.js";
42
42
  export { buildSubmissionRecord, signSubmission } from "./submission.js";
@@ -1,11 +1,12 @@
1
1
  /**
2
2
  * Local filesystem paths and loaders for an organization's enrollment anchor.
3
3
  *
4
- * The module derives every path from an injected environment, with
5
- * XDG_CONFIG_HOME taking precedence over HOME. The loader only returns raw
6
- * envelope bytes; chain.ts remains a pure verifier and does not know this
7
- * layout. This module deliberately does not transport registrations, contact a
8
- * hub, or expose private key bytes.
4
+ * The module derives every path from an injected environment: an absolute
5
+ * OWENLOOP_CONFIG_DIR wins, otherwise paths live below $HOME/.owenloop;
6
+ * XDG_CONFIG_HOME is ignored. The loader only returns raw envelope bytes;
7
+ * chain.ts remains a pure verifier and does not know this layout. This module
8
+ * deliberately does not transport registrations, contact a hub, or expose
9
+ * private key bytes.
9
10
  */
10
11
  export interface OrgRootPresent {
11
12
  kind: 'present';
@@ -17,17 +18,34 @@ export interface OrgRootAbsent {
17
18
  path: string;
18
19
  }
19
20
  export type OrgRootResolution = OrgRootPresent | OrgRootAbsent;
20
- /** `<config>/owenloop/org-root.pub`, the public local trust anchor. */
21
+ /** `<config>/org-root.pub`, the public local trust anchor. */
21
22
  export declare function orgRootPublicKeyPath(env: Record<string, string | undefined>): string;
22
- /** `<config>/owenloop/org-root`, the private anchor path. */
23
+ /** `<config>/org-root`, the private anchor path. */
23
24
  export declare function orgRootPrivateKeyPath(env: Record<string, string | undefined>): string;
24
- /** `<config>/owenloop/roster`, containing enrollment-grant envelopes. */
25
- export declare function rosterDir(env: Record<string, string | undefined>): string;
26
- /** `<config>/owenloop/revocations`, containing revocation envelopes. */
25
+ /** `<config>/grants`, containing enrollment-grant envelopes. */
26
+ export declare function grantsDir(env: Record<string, string | undefined>): string;
27
+ interface GrantsDirectoryProblem {
28
+ path: string;
29
+ reason: string;
30
+ }
31
+ /** Thrown when legacy grants are stranded or cannot be safely inspected. */
32
+ export declare class StrandedLegacyGrantsError extends Error {
33
+ readonly name = "StrandedLegacyGrantsError";
34
+ readonly grantsPath: string;
35
+ readonly legacyPath: string;
36
+ readonly legacyCount: number;
37
+ readonly sourcePath: string | undefined;
38
+ readonly sourceReason: string | undefined;
39
+ constructor(grantsPath: string, legacyPath: string, legacyCount: number, sourceProblem?: GrantsDirectoryProblem | undefined, destinationIsAbsent?: boolean);
40
+ }
41
+ /** Refuse when legacy grants are stranded or cannot be safely inspected. */
42
+ export declare function assertNoStrandedLegacyGrants(env: Record<string, string | undefined>): void;
43
+ /** `<config>/revocations`, containing revocation envelopes. */
27
44
  export declare function revocationsDir(env: Record<string, string | undefined>): string;
28
45
  /** Resolve the public anchor without treating absence as a local-store error. */
29
46
  export declare function resolveOrgRoot(env: Record<string, string | undefined>): OrgRootResolution;
30
- /** Load sorted `.grant.dsse` bytes from the injected roster directory. */
31
- export declare function loadRoster(env: Record<string, string | undefined>): Uint8Array[];
47
+ /** Load sorted `.grant.dsse` bytes from the injected grants directory. */
48
+ export declare function loadGrants(env: Record<string, string | undefined>): Uint8Array[];
32
49
  /** Load sorted `.revocation.dsse` bytes from the injected revocation directory. */
33
50
  export declare function loadRevocations(env: Record<string, string | undefined>): Uint8Array[];
51
+ export {};
@@ -1,33 +1,180 @@
1
1
  /**
2
2
  * Local filesystem paths and loaders for an organization's enrollment anchor.
3
3
  *
4
- * The module derives every path from an injected environment, with
5
- * XDG_CONFIG_HOME taking precedence over HOME. The loader only returns raw
6
- * envelope bytes; chain.ts remains a pure verifier and does not know this
7
- * layout. This module deliberately does not transport registrations, contact a
8
- * hub, or expose private key bytes.
4
+ * The module derives every path from an injected environment: an absolute
5
+ * OWENLOOP_CONFIG_DIR wins, otherwise paths live below $HOME/.owenloop;
6
+ * XDG_CONFIG_HOME is ignored. The loader only returns raw envelope bytes;
7
+ * chain.ts remains a pure verifier and does not know this layout. This module
8
+ * deliberately does not transport registrations, contact a hub, or expose
9
+ * private key bytes.
9
10
  */
10
11
  import { lstatSync, readdirSync, readFileSync } from 'node:fs';
11
12
  import { dirname, join } from 'node:path';
12
13
  import { allowedSignersPath } from "./trust-roots.js";
13
14
  function orgRootDir(env) {
14
15
  // allowedSignersPath is the established injected-env resolver. Its dirname
15
- // is exactly <config>/owenloop for both XDG_CONFIG_HOME and HOME fallback.
16
+ // is exactly <config>.
16
17
  return dirname(allowedSignersPath(env));
17
18
  }
18
- /** `<config>/owenloop/org-root.pub`, the public local trust anchor. */
19
+ /** `<config>/org-root.pub`, the public local trust anchor. */
19
20
  export function orgRootPublicKeyPath(env) {
20
21
  return join(orgRootDir(env), 'org-root.pub');
21
22
  }
22
- /** `<config>/owenloop/org-root`, the private anchor path. */
23
+ /** `<config>/org-root`, the private anchor path. */
23
24
  export function orgRootPrivateKeyPath(env) {
24
25
  return join(orgRootDir(env), 'org-root');
25
26
  }
26
- /** `<config>/owenloop/roster`, containing enrollment-grant envelopes. */
27
- export function rosterDir(env) {
27
+ /** `<config>/grants`, containing enrollment-grant envelopes. */
28
+ export function grantsDir(env) {
29
+ return join(orgRootDir(env), 'grants');
30
+ }
31
+ /** The pre-rename grants directory. Inspected only to refuse; never read. */
32
+ function legacyGrantsDir(env) {
28
33
  return join(orgRootDir(env), 'roster');
29
34
  }
30
- /** `<config>/owenloop/revocations`, containing revocation envelopes. */
35
+ /** Count entries named `*.grant.dsse` without making the new path a loader. */
36
+ function countGrantFiles(dir) {
37
+ try {
38
+ return readdirSync(dir).filter((name) => name.endsWith('.grant.dsse')).length;
39
+ }
40
+ catch {
41
+ return 0;
42
+ }
43
+ }
44
+ function inspectionError(path, action, error) {
45
+ return {
46
+ path,
47
+ reason: `${action}: ${error instanceof Error ? error.message : String(error)}`,
48
+ };
49
+ }
50
+ /** Encode one arbitrary path as a POSIX shell argument. */
51
+ function quotePosixShellArgument(value) {
52
+ return `'${value.replaceAll("'", "'\\''")}'`;
53
+ }
54
+ /**
55
+ * Inspect the legacy source without reading envelopes. A migration command is
56
+ * safe only when its source has the regular-file structure the old loader
57
+ * accepted; otherwise an operator must repair it by hand.
58
+ */
59
+ function inspectLegacyGrantsSource(path) {
60
+ let stat;
61
+ try {
62
+ stat = lstatSync(path, { throwIfNoEntry: false });
63
+ }
64
+ catch (error) {
65
+ return { grantCount: 0, problem: inspectionError(path, 'cannot inspect legacy grants source', error) };
66
+ }
67
+ if (stat === undefined)
68
+ return { grantCount: 0, problem: undefined };
69
+ if (stat.isSymbolicLink()) {
70
+ return { grantCount: 0, problem: { path, reason: 'legacy grants source is a symlink' } };
71
+ }
72
+ if (!stat.isDirectory()) {
73
+ return { grantCount: 0, problem: { path, reason: 'legacy grants source is not a directory' } };
74
+ }
75
+ let entries;
76
+ try {
77
+ entries = readdirSync(path);
78
+ }
79
+ catch (error) {
80
+ return { grantCount: 0, problem: inspectionError(path, 'cannot inspect legacy grants source', error) };
81
+ }
82
+ let grantCount = 0;
83
+ for (const name of entries) {
84
+ const entryPath = join(path, name);
85
+ let entry;
86
+ try {
87
+ entry = lstatSync(entryPath);
88
+ }
89
+ catch (error) {
90
+ return { grantCount: 0, problem: inspectionError(entryPath, 'cannot inspect legacy grants source entry', error) };
91
+ }
92
+ if (entry.isSymbolicLink()) {
93
+ return { grantCount: 0, problem: { path: entryPath, reason: 'legacy grants source entry is a symlink' } };
94
+ }
95
+ if (!entry.isFile()) {
96
+ return { grantCount: 0, problem: { path: entryPath, reason: 'legacy grants source entry is not a regular file' } };
97
+ }
98
+ if (name.endsWith('.grant.dsse'))
99
+ grantCount += 1;
100
+ }
101
+ return { grantCount, problem: undefined };
102
+ }
103
+ /** Use lstat so a live or dangling symlink is never mistaken for absence. */
104
+ function grantsPathIsAbsent(path) {
105
+ let stat;
106
+ try {
107
+ stat = lstatSync(path, { throwIfNoEntry: false });
108
+ }
109
+ catch {
110
+ // The existing-path command begins with rmdir, which safely refuses when
111
+ // this probe cannot establish absence.
112
+ return false;
113
+ }
114
+ return stat === undefined;
115
+ }
116
+ function sourceManualRepairMessage(grantsPath, legacyPath, sourceProblem) {
117
+ return `enrollment grants cannot be safely inspected in the pre-rename directory '${legacyPath}': ` +
118
+ `${sourceProblem.reason}: '${sourceProblem.path}'. '${grantsPath}' holds no *.grant.dsse files. ` +
119
+ 'Repair that path by hand before migrating; owenloop will not move your cryptographic material for you.';
120
+ }
121
+ function migrationMessage(grantsPath, legacyPath, legacyCount, quotedGrantsPath, quotedLegacyPath, destinationIsAbsent) {
122
+ // Renaming the whole inspected source directory preserves every accepted
123
+ // filename by construction, including all dot-prefixed names. If a grants
124
+ // path already exists, rmdir permits the rename only into an empty real
125
+ // directory, preventing mv from nesting roster beneath grants.
126
+ const command = destinationIsAbsent
127
+ ? `mv ${quotedLegacyPath} ${quotedGrantsPath}`
128
+ : `rmdir ${quotedGrantsPath} && mv ${quotedLegacyPath} ${quotedGrantsPath}`;
129
+ return `enrollment grants are stranded in the pre-rename directory: '${grantsPath}' holds no *.grant.dsse files, ` +
130
+ `but '${legacyPath}' holds ${legacyCount}. owenloop reads only '${grantsPath}' and will not move your ` +
131
+ `cryptographic material for you. Run: ${command} ` +
132
+ 'then restart every running owenloop shift daemon.' +
133
+ (destinationIsAbsent
134
+ ? ''
135
+ : ` If rmdir refuses, inspect '${grantsPath}' by hand before migrating; owenloop will not move your cryptographic material for you.`);
136
+ }
137
+ /** Thrown when legacy grants are stranded or cannot be safely inspected. */
138
+ export class StrandedLegacyGrantsError extends Error {
139
+ name = 'StrandedLegacyGrantsError';
140
+ grantsPath;
141
+ legacyPath;
142
+ legacyCount;
143
+ sourcePath;
144
+ sourceReason;
145
+ constructor(grantsPath, legacyPath, legacyCount, sourceProblem = undefined, destinationIsAbsent = false) {
146
+ const quotedGrantsPath = quotePosixShellArgument(grantsPath);
147
+ const quotedLegacyPath = quotePosixShellArgument(legacyPath);
148
+ let message;
149
+ if (sourceProblem !== undefined) {
150
+ message = sourceManualRepairMessage(grantsPath, legacyPath, sourceProblem);
151
+ }
152
+ else {
153
+ message = migrationMessage(grantsPath, legacyPath, legacyCount, quotedGrantsPath, quotedLegacyPath, destinationIsAbsent);
154
+ }
155
+ super(message);
156
+ this.grantsPath = grantsPath;
157
+ this.legacyPath = legacyPath;
158
+ this.legacyCount = legacyCount;
159
+ this.sourcePath = sourceProblem?.path;
160
+ this.sourceReason = sourceProblem?.reason;
161
+ }
162
+ }
163
+ /** Refuse when legacy grants are stranded or cannot be safely inspected. */
164
+ export function assertNoStrandedLegacyGrants(env) {
165
+ const grants = grantsDir(env);
166
+ if (countGrantFiles(grants) > 0)
167
+ return;
168
+ const legacy = legacyGrantsDir(env);
169
+ const inspection = inspectLegacyGrantsSource(legacy);
170
+ if (inspection.problem !== undefined) {
171
+ throw new StrandedLegacyGrantsError(grants, legacy, inspection.grantCount, inspection.problem);
172
+ }
173
+ if (inspection.grantCount > 0) {
174
+ throw new StrandedLegacyGrantsError(grants, legacy, inspection.grantCount, undefined, grantsPathIsAbsent(grants));
175
+ }
176
+ }
177
+ /** `<config>/revocations`, containing revocation envelopes. */
31
178
  export function revocationsDir(env) {
32
179
  return join(orgRootDir(env), 'revocations');
33
180
  }
@@ -68,9 +215,10 @@ function loadEnvelopeDirectory(path, suffix, label) {
68
215
  }
69
216
  return result;
70
217
  }
71
- /** Load sorted `.grant.dsse` bytes from the injected roster directory. */
72
- export function loadRoster(env) {
73
- return loadEnvelopeDirectory(rosterDir(env), '.grant.dsse', 'roster');
218
+ /** Load sorted `.grant.dsse` bytes from the injected grants directory. */
219
+ export function loadGrants(env) {
220
+ assertNoStrandedLegacyGrants(env);
221
+ return loadEnvelopeDirectory(grantsDir(env), '.grant.dsse', 'grants');
74
222
  }
75
223
  /** Load sorted `.revocation.dsse` bytes from the injected revocation directory. */
76
224
  export function loadRevocations(env) {
@@ -288,6 +288,7 @@ export declare const ORDER_FIELDS: {
288
288
  readonly consumesProof: "optional";
289
289
  readonly cause: "optional";
290
290
  readonly capabilities: "optional";
291
+ readonly crews: "optional";
291
292
  readonly modifier: "optional";
292
293
  readonly reroutedFrom: "optional";
293
294
  readonly escalated: "optional";
@@ -310,6 +311,7 @@ export declare const ORDER_REASON_FIELDS: {
310
311
  readonly by: "required";
311
312
  readonly text: "required";
312
313
  readonly fromVersion: "optional";
314
+ readonly requested: "optional";
313
315
  };
314
316
  /** Bind every record definition in this package to a frozen DSSE media type. */
315
317
  export declare const RECORD_PAYLOAD_TYPES: {
@@ -134,6 +134,7 @@ export const ORDER_FIELDS = {
134
134
  // unmodified run on a capability-silent step carries neither, so every order
135
135
  // emitted before this field existed still validates unchanged.
136
136
  capabilities: 'optional',
137
+ crews: 'optional',
137
138
  modifier: 'optional',
138
139
  // Set only when a caller-supplied reroute rule replaced the composed offer,
139
140
  // holding what the def actually asked for. Signed like the rest of the
@@ -175,6 +176,7 @@ export const ORDER_REASON_FIELDS = {
175
176
  by: 'required',
176
177
  text: 'required',
177
178
  fromVersion: 'optional',
179
+ requested: 'optional',
178
180
  };
179
181
  /** Bind every record definition in this package to a frozen DSSE media type. */
180
182
  export const RECORD_PAYLOAD_TYPES = {
@@ -19,7 +19,7 @@
19
19
  * body: |
20
20
  * Draft a plan for ${WORKFLOW}.
21
21
  */
22
- import type { WorkflowDef } from './types.ts';
22
+ import type { StepDef, WorkflowDef } from './types.ts';
23
23
  /**
24
24
  * The engine-version contract (§27). A workflow definition may declare
25
25
  * `engine: <n>`; it must be a positive integer no greater than this constant
@@ -81,6 +81,11 @@ export declare function lintDef(def: WorkflowDef): {
81
81
  errors: string[];
82
82
  warnings: string[];
83
83
  };
84
+ /**
85
+ * The steps a def declares as cleanup-on-cancel, in definition order. The
86
+ * control plane calls this when it cancels a run.
87
+ */
88
+ export declare function cancelCleanupSteps(def: WorkflowDef): StepDef[];
84
89
  /** Stable private-map key for one installed coordinate at one verified digest. */
85
90
  export declare function digestScopedCallsTargetKey(digest: string, target: string): string;
86
91
  /**