@claudexor/schema 3.20.1 → 3.23.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 (147) hide show
  1. package/dist/agent-capabilities.d.ts +9 -9
  2. package/dist/agent-capabilities.d.ts.map +1 -1
  3. package/dist/agent-capabilities.js +2 -1
  4. package/dist/agent-capabilities.js.map +1 -1
  5. package/dist/command-list.d.ts +108 -37
  6. package/dist/command-list.d.ts.map +1 -1
  7. package/dist/command-list.js +17 -35
  8. package/dist/command-list.js.map +1 -1
  9. package/dist/command-summary.d.ts +8 -0
  10. package/dist/command-summary.d.ts.map +1 -0
  11. package/dist/command-summary.js +33 -0
  12. package/dist/command-summary.js.map +1 -0
  13. package/dist/continuation-admission.d.ts +41 -0
  14. package/dist/continuation-admission.d.ts.map +1 -0
  15. package/dist/continuation-admission.js +136 -0
  16. package/dist/continuation-admission.js.map +1 -0
  17. package/dist/control-operation-responses.d.ts +357 -0
  18. package/dist/control-operation-responses.d.ts.map +1 -1
  19. package/dist/control-operation-responses.js +2 -0
  20. package/dist/control-operation-responses.js.map +1 -1
  21. package/dist/control-run-detail.d.ts +726 -0
  22. package/dist/control-run-detail.d.ts.map +1 -1
  23. package/dist/control-run-execution.js +1 -1
  24. package/dist/control-run-execution.js.map +1 -1
  25. package/dist/control-thread-requests.d.ts +17 -3
  26. package/dist/control-thread-requests.d.ts.map +1 -1
  27. package/dist/control-thread-requests.js +24 -1
  28. package/dist/control-thread-requests.js.map +1 -1
  29. package/dist/control.d.ts +347 -22
  30. package/dist/control.d.ts.map +1 -1
  31. package/dist/control.js +32 -4
  32. package/dist/control.js.map +1 -1
  33. package/dist/credential-profile-snapshot.d.ts +144 -0
  34. package/dist/credential-profile-snapshot.d.ts.map +1 -1
  35. package/dist/credential-profile.d.ts +1 -1
  36. package/dist/credential-profile.js +1 -1
  37. package/dist/daemon-status.d.ts +177 -0
  38. package/dist/daemon-status.d.ts.map +1 -0
  39. package/dist/daemon-status.js +27 -0
  40. package/dist/daemon-status.js.map +1 -0
  41. package/dist/decision.d.ts +12 -0
  42. package/dist/decision.d.ts.map +1 -1
  43. package/dist/effort.d.ts +33 -12
  44. package/dist/effort.d.ts.map +1 -1
  45. package/dist/effort.js +43 -13
  46. package/dist/effort.js.map +1 -1
  47. package/dist/events.d.ts +4 -4
  48. package/dist/events.d.ts.map +1 -1
  49. package/dist/events.js +11 -0
  50. package/dist/events.js.map +1 -1
  51. package/dist/harness.d.ts +16 -9
  52. package/dist/harness.d.ts.map +1 -1
  53. package/dist/harness.js +3 -3
  54. package/dist/index.d.ts +6 -0
  55. package/dist/index.d.ts.map +1 -1
  56. package/dist/index.js +6 -0
  57. package/dist/index.js.map +1 -1
  58. package/dist/mcp-run-result.d.ts +155 -0
  59. package/dist/mcp-run-result.d.ts.map +1 -1
  60. package/dist/mcp-run-result.js +38 -0
  61. package/dist/mcp-run-result.js.map +1 -1
  62. package/dist/project.d.ts +2 -2
  63. package/dist/project.d.ts.map +1 -1
  64. package/dist/project.js +3 -3
  65. package/dist/project.js.map +1 -1
  66. package/dist/quota.d.ts +252 -0
  67. package/dist/quota.d.ts.map +1 -1
  68. package/dist/quota.js +42 -17
  69. package/dist/quota.js.map +1 -1
  70. package/dist/raw.d.ts +1 -1
  71. package/dist/raw.d.ts.map +1 -1
  72. package/dist/raw.js +0 -1
  73. package/dist/raw.js.map +1 -1
  74. package/dist/run-continuation.d.ts +166 -0
  75. package/dist/run-continuation.d.ts.map +1 -0
  76. package/dist/run-continuation.js +65 -0
  77. package/dist/run-continuation.js.map +1 -0
  78. package/dist/run-continuity.d.ts +215 -0
  79. package/dist/run-continuity.d.ts.map +1 -0
  80. package/dist/run-continuity.js +170 -0
  81. package/dist/run-continuity.js.map +1 -0
  82. package/dist/run-facts.d.ts +7 -0
  83. package/dist/run-facts.d.ts.map +1 -1
  84. package/dist/run-list-page.d.ts +74 -0
  85. package/dist/run-list-page.d.ts.map +1 -0
  86. package/dist/run-list-page.js +85 -0
  87. package/dist/run-list-page.js.map +1 -0
  88. package/dist/run-strategy.d.ts +18 -0
  89. package/dist/run-strategy.d.ts.map +1 -1
  90. package/dist/run-strategy.js +15 -0
  91. package/dist/run-strategy.js.map +1 -1
  92. package/dist/status-projection.d.ts +8 -1
  93. package/dist/status-projection.d.ts.map +1 -1
  94. package/dist/status-projection.js +22 -1
  95. package/dist/status-projection.js.map +1 -1
  96. package/dist/telemetry.d.ts +33 -3
  97. package/dist/telemetry.d.ts.map +1 -1
  98. package/dist/telemetry.js +3 -3
  99. package/dist/telemetry.js.map +1 -1
  100. package/dist/thread.d.ts +24 -10
  101. package/dist/thread.d.ts.map +1 -1
  102. package/dist/thread.js +14 -4
  103. package/dist/thread.js.map +1 -1
  104. package/dist/work-report.d.ts +18 -4
  105. package/dist/work-report.d.ts.map +1 -1
  106. package/dist/work-report.js +26 -5
  107. package/dist/work-report.js.map +1 -1
  108. package/generated/AgentCapabilityCatalog.schema.json +5 -4
  109. package/generated/CommandListQuery.schema.json +204 -0
  110. package/generated/ControlCredentialProfilesQueryResponse.schema.json +21 -6
  111. package/generated/ControlCredentialProfilesSnapshotResponse.schema.json +21 -6
  112. package/generated/ControlDaemonStatus.schema.json +150 -0
  113. package/generated/ControlHarnessListResponse.schema.json +1 -1
  114. package/generated/ControlHarnessSettingsPatch.schema.json +1 -1
  115. package/generated/ControlProjectRemoveReceipt.schema.json +1 -1
  116. package/generated/ControlQuotaResponse.schema.json +20 -5
  117. package/generated/ControlRetainedEnvelope.schema.json +63 -0
  118. package/generated/ControlRunAgainDraft.schema.json +17 -1
  119. package/generated/ControlRunDetail.schema.json +406 -1
  120. package/generated/ControlRunListResponse.schema.json +406 -1
  121. package/generated/ControlRunStartRequest.schema.json +17 -1
  122. package/generated/ControlRunSummary.schema.json +406 -1
  123. package/generated/ControlSettingsSnapshot.schema.json +1 -1
  124. package/generated/ControlSettingsUpdateRequest.schema.json +1 -1
  125. package/generated/ControlThread.schema.json +11 -2
  126. package/generated/ControlThreadCreateRequest.schema.json +7 -2
  127. package/generated/ControlThreadDetail.schema.json +25 -3
  128. package/generated/ControlThreadListResponse.schema.json +11 -2
  129. package/generated/ControlThreadTurnRequest.schema.json +4 -0
  130. package/generated/DecisionRecord.schema.json +14 -1
  131. package/generated/EnvelopeCustody.schema.json +195 -0
  132. package/generated/GlobalConfig.schema.json +1 -1
  133. package/generated/HarnessEvent.schema.json +7 -2
  134. package/generated/HarnessManifest.schema.json +1 -1
  135. package/generated/HarnessStatusDto.schema.json +1 -1
  136. package/generated/McpRunHandleResult.schema.json +109 -1
  137. package/generated/McpRunToolResult.schema.json +14 -1
  138. package/generated/RunContinuityReceipt.schema.json +182 -0
  139. package/generated/RunEvent.schema.json +3 -1
  140. package/generated/RunFacts.schema.json +14 -1
  141. package/generated/RunListQuery.schema.json +66 -0
  142. package/generated/RunResumable.schema.json +153 -0
  143. package/generated/RunTelemetry.schema.json +14 -1
  144. package/generated/SessionCapsule.schema.json +78 -0
  145. package/generated/TaskContract.schema.json +1 -1
  146. package/generated/Thread.schema.json +12 -3
  147. package/package.json +2 -2
@@ -25,7 +25,7 @@ import { ModeKind } from "./primitives.js";
25
25
  * because the daemon-internal enqueue params still carry it (the turn route
26
26
  * fills it in), exactly like turnId.
27
27
  */
28
- export declare const RUN_START_CLIENT_REJECTED_KEYS: readonly ["threadId", "turnId", "planRunId", "planRef", "retryOf", "parentRunId", "delegatedFromRunId"];
28
+ export declare const RUN_START_CLIENT_REJECTED_KEYS: readonly ["threadId", "turnId", "planRunId", "planRef", "retryOf", "parentRunId", "delegatedFromRunId", "continueModelInherited"];
29
29
  /**
30
30
  * Mode -> tree mutability. ask/plan are read-only BY CONSTRUCTION
31
31
  * (Bible invariant); agent writes. The catalog derives its
@@ -296,7 +296,7 @@ export declare const CatalogMutabilityMatrix: z.ZodObject<{
296
296
  readOnlyModes: z.ZodArray<z.ZodEnum<["ask", "plan", "agent"]>, "many">;
297
297
  writeModes: z.ZodArray<z.ZodEnum<["ask", "plan", "agent"]>, "many">;
298
298
  isolationKinds: z.ZodArray<z.ZodEnum<["envelope", "live"]>, "many">;
299
- workspaceModes: z.ZodArray<z.ZodEnum<["in_place", "isolated"]>, "many">;
299
+ workspaceModes: z.ZodArray<z.ZodEnum<["in_place", "isolated", "delegated"]>, "many">;
300
300
  accessProfiles: z.ZodArray<z.ZodEnum<["readonly", "workspace_write", "full", "inherit_native"]>, "many">;
301
301
  applyModes: z.ZodArray<z.ZodEnum<["apply", "commit", "branch", "pr"]>, "many">;
302
302
  }, "strip", z.ZodTypeAny, {
@@ -304,7 +304,7 @@ export declare const CatalogMutabilityMatrix: z.ZodObject<{
304
304
  readOnlyModes: ("agent" | "ask" | "plan")[];
305
305
  writeModes: ("agent" | "ask" | "plan")[];
306
306
  isolationKinds: ("envelope" | "live")[];
307
- workspaceModes: ("in_place" | "isolated")[];
307
+ workspaceModes: ("delegated" | "in_place" | "isolated")[];
308
308
  accessProfiles: ("full" | "inherit_native" | "readonly" | "workspace_write")[];
309
309
  applyModes: ("apply" | "branch" | "commit" | "pr")[];
310
310
  }, {
@@ -312,7 +312,7 @@ export declare const CatalogMutabilityMatrix: z.ZodObject<{
312
312
  readOnlyModes: ("agent" | "ask" | "plan")[];
313
313
  writeModes: ("agent" | "ask" | "plan")[];
314
314
  isolationKinds: ("envelope" | "live")[];
315
- workspaceModes: ("in_place" | "isolated")[];
315
+ workspaceModes: ("delegated" | "in_place" | "isolated")[];
316
316
  accessProfiles: ("full" | "inherit_native" | "readonly" | "workspace_write")[];
317
317
  applyModes: ("apply" | "branch" | "commit" | "pr")[];
318
318
  }>;
@@ -598,7 +598,7 @@ export declare const AgentCapabilityCatalog: z.ZodObject<{
598
598
  readOnlyModes: z.ZodArray<z.ZodEnum<["ask", "plan", "agent"]>, "many">;
599
599
  writeModes: z.ZodArray<z.ZodEnum<["ask", "plan", "agent"]>, "many">;
600
600
  isolationKinds: z.ZodArray<z.ZodEnum<["envelope", "live"]>, "many">;
601
- workspaceModes: z.ZodArray<z.ZodEnum<["in_place", "isolated"]>, "many">;
601
+ workspaceModes: z.ZodArray<z.ZodEnum<["in_place", "isolated", "delegated"]>, "many">;
602
602
  accessProfiles: z.ZodArray<z.ZodEnum<["readonly", "workspace_write", "full", "inherit_native"]>, "many">;
603
603
  applyModes: z.ZodArray<z.ZodEnum<["apply", "commit", "branch", "pr"]>, "many">;
604
604
  }, "strip", z.ZodTypeAny, {
@@ -606,7 +606,7 @@ export declare const AgentCapabilityCatalog: z.ZodObject<{
606
606
  readOnlyModes: ("agent" | "ask" | "plan")[];
607
607
  writeModes: ("agent" | "ask" | "plan")[];
608
608
  isolationKinds: ("envelope" | "live")[];
609
- workspaceModes: ("in_place" | "isolated")[];
609
+ workspaceModes: ("delegated" | "in_place" | "isolated")[];
610
610
  accessProfiles: ("full" | "inherit_native" | "readonly" | "workspace_write")[];
611
611
  applyModes: ("apply" | "branch" | "commit" | "pr")[];
612
612
  }, {
@@ -614,7 +614,7 @@ export declare const AgentCapabilityCatalog: z.ZodObject<{
614
614
  readOnlyModes: ("agent" | "ask" | "plan")[];
615
615
  writeModes: ("agent" | "ask" | "plan")[];
616
616
  isolationKinds: ("envelope" | "live")[];
617
- workspaceModes: ("in_place" | "isolated")[];
617
+ workspaceModes: ("delegated" | "in_place" | "isolated")[];
618
618
  accessProfiles: ("full" | "inherit_native" | "readonly" | "workspace_write")[];
619
619
  applyModes: ("apply" | "branch" | "commit" | "pr")[];
620
620
  }>;
@@ -711,7 +711,7 @@ export declare const AgentCapabilityCatalog: z.ZodObject<{
711
711
  readOnlyModes: ("agent" | "ask" | "plan")[];
712
712
  writeModes: ("agent" | "ask" | "plan")[];
713
713
  isolationKinds: ("envelope" | "live")[];
714
- workspaceModes: ("in_place" | "isolated")[];
714
+ workspaceModes: ("delegated" | "in_place" | "isolated")[];
715
715
  accessProfiles: ("full" | "inherit_native" | "readonly" | "workspace_write")[];
716
716
  applyModes: ("apply" | "branch" | "commit" | "pr")[];
717
717
  };
@@ -798,7 +798,7 @@ export declare const AgentCapabilityCatalog: z.ZodObject<{
798
798
  readOnlyModes: ("agent" | "ask" | "plan")[];
799
799
  writeModes: ("agent" | "ask" | "plan")[];
800
800
  isolationKinds: ("envelope" | "live")[];
801
- workspaceModes: ("in_place" | "isolated")[];
801
+ workspaceModes: ("delegated" | "in_place" | "isolated")[];
802
802
  accessProfiles: ("full" | "inherit_native" | "readonly" | "workspace_write")[];
803
803
  applyModes: ("apply" | "branch" | "commit" | "pr")[];
804
804
  };
@@ -1 +1 @@
1
- {"version":3,"file":"agent-capabilities.d.ts","sourceRoot":"","sources":["../src/agent-capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAiB,QAAQ,EAAkB,MAAM,iBAAiB,CAAC;AAkB1E;;;;;;;;GAQG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,8BAA8B,YACzC,UAAU,EACV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,SAAS,EACT,aAAa,EACb,oBAAoB,CACZ,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAI9E,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;EAmBkE,CAAC;AACnG,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEtE,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;EA0BjC,CAAC;AACJ,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE9E,eAAO,MAAM,0BAA0B;;;;;;;;;;;;EAQ4C,CAAC;AACpF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAEpF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2ChC,CAAC;AACJ,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
@@ -43,6 +43,7 @@ export const RUN_START_CLIENT_REJECTED_KEYS = [
43
43
  "retryOf",
44
44
  "parentRunId",
45
45
  "delegatedFromRunId",
46
+ "continueModelInherited",
46
47
  ];
47
48
  /**
48
49
  * Mode -> tree mutability. ask/plan are read-only BY CONSTRUCTION
@@ -148,7 +149,7 @@ export const CatalogMutabilityMatrix = z
148
149
  .describe("Run isolation: envelope = isolated worktree in the external per-project runtime namespace (default), live = the project tree itself."),
149
150
  workspaceModes: z
150
151
  .array(WorkspaceMode)
151
- .describe("Thread workspace modes (in_place | isolated)."),
152
+ .describe("Thread workspace modes (in_place | isolated | delegated)."),
152
153
  accessProfiles: z
153
154
  .array(AccessProfile)
154
155
  .describe("Access vocabulary; `full` additionally requires the per-repo trust allow (claudexor trust --allow-full-access) for a run an operator starts at a surface, not for an execution.delegated run."),
@@ -1 +1 @@
1
- {"version":3,"file":"agent-capabilities.js","sourceRoot":"","sources":["../src/agent-capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EACL,aAAa,EACb,UAAU,EACV,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;;;;;;;GAQG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,UAAU;IACV,QAAQ;IACR,WAAW;IACX,SAAS;IACT,SAAS;IACT,aAAa;IACb,oBAAoB;CACZ,CAAC;AAEX;;;;;GAKG;AACH,MAAM,CAAC,MAAM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AC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,QAAQ,CAAC,gDAAgD,CAAC;IAC7F,kBAAkB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,yCAAyC,CAAC;IAC3F,KAAK,EAAE,CAAC;SACL,KAAK,CAAC,QAAQ,CAAC;SACf,QAAQ,CACP,uFAAuF,CACxF;IACH,cAAc,EAAE,CAAC;SACd,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SACjB,QAAQ,CACP,uIAAuI,CACxI;IACH,oBAAoB,EAAE,CAAC;SACpB,KAAK,CAAC,0BAA0B,CAAC;SACjC,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CAAC,8EAA8E,CAAC;IAC3F,UAAU,EAAE,uBAAuB;IACnC,WAAW,EAAE,CAAC;SACX,KAAK,CAAC,iBAAiB,CAAC;SACxB,QAAQ,CACP,qFAAqF,CACtF;IACH,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,+CAA+C,CAAC;IACvF,cAAc,EAAE,CAAC;SACd,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SACjB,QAAQ,CACP,gMAAgM,CACjM;CACJ,CAAC;KACD,QAAQ,CACP,2FAA2F,CAC5F,CAAC"}
@@ -1,40 +1,111 @@
1
1
  import { z } from "zod/v3";
2
- /**
3
- * How a caller ADDRESSES the daemon's retained product commands.
4
- *
5
- * The unqualified read (no query, or an empty one) still returns every retained
6
- * product command — the daemon's historical behavior. A qualified read names
7
- * exactly ONE subject, and the daemon selects it BEFORE the public projection
8
- * runs, so an addressed read never redacts, traverses, or serializes the params
9
- * of unrelated runs:
10
- *
11
- * - `id` — one run, matched on the job id OR the bound run id, the same rule
12
- * the control plane's run lookup applies. A miss is an empty selection, not
13
- * an error: absence is the caller's answer to report, never a transport fact.
14
- * - `delegatedFromRunId` — the bounded, deterministically ordered direct
15
- * Delegate children of one parent run (`MAX_DELEGATED_CHILDREN`).
16
- *
17
- * The two are mutually exclusive: a query carrying both addresses no single
18
- * subject and is refused at the RPC boundary instead of silently preferring
19
- * one (INV-021). An engine that predates this query ignores it and answers with
20
- * the full list, so every caller re-applies its own selection on the result and
21
- * a version skew costs work, never correctness.
22
- */
23
- export declare const CommandListQuery: z.ZodEffects<z.ZodObject<{
24
- id: z.ZodOptional<z.ZodString>;
25
- delegatedFromRunId: z.ZodOptional<z.ZodString>;
26
- }, "strict", z.ZodTypeAny, {
27
- id?: string | undefined;
28
- delegatedFromRunId?: string | undefined;
29
- }, {
30
- id?: string | undefined;
31
- delegatedFromRunId?: string | undefined;
32
- }>, {
33
- id?: string | undefined;
34
- delegatedFromRunId?: string | undefined;
35
- }, {
36
- id?: string | undefined;
37
- delegatedFromRunId?: string | undefined;
38
- }>;
2
+ /** Every retained-command read names its subject before public projection.
3
+ * Single id/turn reads retain full params; collections contain summary facts.
4
+ * No omitted, empty, mixed or unknown selector can request all history. */
5
+ export declare const CommandListQuery: z.ZodUnion<[z.ZodObject<{
6
+ id: z.ZodString;
7
+ }, "strict", z.ZodTypeAny, {
8
+ id: string;
9
+ }, {
10
+ id: string;
11
+ }>, z.ZodObject<{
12
+ delegatedFromRunId: z.ZodString;
13
+ }, "strict", z.ZodTypeAny, {
14
+ delegatedFromRunId: string;
15
+ }, {
16
+ delegatedFromRunId: string;
17
+ }>, z.ZodObject<{
18
+ ids: z.ZodArray<z.ZodString, "many">;
19
+ }, "strict", z.ZodTypeAny, {
20
+ ids: string[];
21
+ }, {
22
+ ids: string[];
23
+ }>, z.ZodObject<{
24
+ continuationChainOf: z.ZodString;
25
+ }, "strict", z.ZodTypeAny, {
26
+ continuationChainOf: string;
27
+ }, {
28
+ continuationChainOf: string;
29
+ }>, z.ZodObject<{
30
+ delegatedDescendantsOf: z.ZodString;
31
+ }, "strict", z.ZodTypeAny, {
32
+ delegatedDescendantsOf: string;
33
+ }, {
34
+ delegatedDescendantsOf: string;
35
+ }>, z.ZodObject<{
36
+ threadId: z.ZodString;
37
+ activeOnly: z.ZodOptional<z.ZodBoolean>;
38
+ }, "strict", z.ZodTypeAny, {
39
+ threadId: string;
40
+ activeOnly?: boolean | undefined;
41
+ }, {
42
+ threadId: string;
43
+ activeOnly?: boolean | undefined;
44
+ }>, z.ZodObject<{
45
+ threadIds: z.ZodArray<z.ZodString, "many">;
46
+ }, "strict", z.ZodTypeAny, {
47
+ threadIds: string[];
48
+ }, {
49
+ threadIds: string[];
50
+ }>, z.ZodObject<{
51
+ turnId: z.ZodString;
52
+ }, "strict", z.ZodTypeAny, {
53
+ turnId: string;
54
+ }, {
55
+ turnId: string;
56
+ }>, z.ZodObject<{
57
+ activeOnly: z.ZodLiteral<true>;
58
+ }, "strict", z.ZodTypeAny, {
59
+ activeOnly: true;
60
+ }, {
61
+ activeOnly: true;
62
+ }>, z.ZodObject<{
63
+ page: z.ZodObject<{
64
+ limit: z.ZodNumber;
65
+ state: z.ZodNullable<z.ZodEnum<["queued", "running", "succeeded", "failed", "cancelled", "interrupted"]>>;
66
+ cursor: z.ZodNullable<z.ZodObject<{
67
+ createdAt: z.ZodString;
68
+ id: z.ZodString;
69
+ }, "strict", z.ZodTypeAny, {
70
+ createdAt: string;
71
+ id: string;
72
+ }, {
73
+ createdAt: string;
74
+ id: string;
75
+ }>>;
76
+ }, "strict", z.ZodTypeAny, {
77
+ limit: number;
78
+ state: "cancelled" | "failed" | "interrupted" | "queued" | "running" | "succeeded" | null;
79
+ cursor: {
80
+ createdAt: string;
81
+ id: string;
82
+ } | null;
83
+ }, {
84
+ limit: number;
85
+ state: "cancelled" | "failed" | "interrupted" | "queued" | "running" | "succeeded" | null;
86
+ cursor: {
87
+ createdAt: string;
88
+ id: string;
89
+ } | null;
90
+ }>;
91
+ }, "strict", z.ZodTypeAny, {
92
+ page: {
93
+ limit: number;
94
+ state: "cancelled" | "failed" | "interrupted" | "queued" | "running" | "succeeded" | null;
95
+ cursor: {
96
+ createdAt: string;
97
+ id: string;
98
+ } | null;
99
+ };
100
+ }, {
101
+ page: {
102
+ limit: number;
103
+ state: "cancelled" | "failed" | "interrupted" | "queued" | "running" | "succeeded" | null;
104
+ cursor: {
105
+ createdAt: string;
106
+ id: string;
107
+ } | null;
108
+ };
109
+ }>]>;
39
110
  export type CommandListQuery = z.infer<typeof CommandListQuery>;
40
111
  //# sourceMappingURL=command-list.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"command-list.d.ts","sourceRoot":"","sources":["../src/command-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAG3B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;EAgBqD,CAAC;AACnF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
1
+ {"version":3,"file":"command-list.d.ts","sourceRoot":"","sources":["../src/command-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAI3B;;2EAE2E;AAC3E,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAasE,CAAC;AACpG,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
@@ -1,39 +1,21 @@
1
1
  import { z } from "zod/v3";
2
2
  import { Id } from "./primitives.js";
3
- /**
4
- * How a caller ADDRESSES the daemon's retained product commands.
5
- *
6
- * The unqualified read (no query, or an empty one) still returns every retained
7
- * product command — the daemon's historical behavior. A qualified read names
8
- * exactly ONE subject, and the daemon selects it BEFORE the public projection
9
- * runs, so an addressed read never redacts, traverses, or serializes the params
10
- * of unrelated runs:
11
- *
12
- * - `id` — one run, matched on the job id OR the bound run id, the same rule
13
- * the control plane's run lookup applies. A miss is an empty selection, not
14
- * an error: absence is the caller's answer to report, never a transport fact.
15
- * - `delegatedFromRunId` — the bounded, deterministically ordered direct
16
- * Delegate children of one parent run (`MAX_DELEGATED_CHILDREN`).
17
- *
18
- * The two are mutually exclusive: a query carrying both addresses no single
19
- * subject and is refused at the RPC boundary instead of silently preferring
20
- * one (INV-021). An engine that predates this query ignores it and answers with
21
- * the full list, so every caller re-applies its own selection on the result and
22
- * a version skew costs work, never correctness.
23
- */
3
+ import { RunListQuery } from "./run-list-page.js";
4
+ /** Every retained-command read names its subject before public projection.
5
+ * Single id/turn reads retain full params; collections contain summary facts.
6
+ * No omitted, empty, mixed or unknown selector can request all history. */
24
7
  export const CommandListQuery = z
25
- .object({
26
- id: Id.optional().describe("Select the single command whose job id or run id equals this."),
27
- delegatedFromRunId: Id.optional().describe("Select the bounded direct Delegate children of this parent run id."),
28
- })
29
- .strict()
30
- .superRefine((value, ctx) => {
31
- if (value.id !== undefined && value.delegatedFromRunId !== undefined) {
32
- ctx.addIssue({
33
- code: z.ZodIssueCode.custom,
34
- message: "a command list query addresses either one id or one Delegate parent, never both",
35
- });
36
- }
37
- })
38
- .describe("Addressed selection for the daemon's retained product command list.");
8
+ .union([
9
+ z.object({ id: Id }).strict(),
10
+ z.object({ delegatedFromRunId: Id }).strict(),
11
+ z.object({ ids: z.array(Id).min(1).max(1000) }).strict(),
12
+ z.object({ continuationChainOf: Id }).strict(),
13
+ z.object({ delegatedDescendantsOf: Id }).strict(),
14
+ z.object({ threadId: Id, activeOnly: z.boolean().optional() }).strict(),
15
+ z.object({ threadIds: z.array(Id).min(1).max(1000) }).strict(),
16
+ z.object({ turnId: Id }).strict(),
17
+ z.object({ activeOnly: z.literal(true) }).strict(),
18
+ z.object({ page: RunListQuery }).strict(),
19
+ ])
20
+ .describe("Required addressed selection for retained product commands; collections are compact.");
39
21
  //# sourceMappingURL=command-list.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"command-list.js","sourceRoot":"","sources":["../src/command-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC;KAC9B,MAAM,CAAC;IACN,EAAE,EAAE,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,+DAA+D,CAAC;IAC3F,kBAAkB,EAAE,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CACxC,oEAAoE,CACrE;CACF,CAAC;KACD,MAAM,EAAE;KACR,WAAW,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IAC1B,IAAI,KAAK,CAAC,EAAE,KAAK,SAAS,IAAI,KAAK,CAAC,kBAAkB,KAAK,SAAS,EAAE,CAAC;QACrE,GAAG,CAAC,QAAQ,CAAC;YACX,IAAI,EAAE,CAAC,CAAC,YAAY,CAAC,MAAM;YAC3B,OAAO,EAAE,iFAAiF;SAC3F,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC;KACD,QAAQ,CAAC,qEAAqE,CAAC,CAAC"}
1
+ {"version":3,"file":"command-list.js","sourceRoot":"","sources":["../src/command-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD;;2EAE2E;AAC3E,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC;KAC9B,KAAK,CAAC;IACL,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IAC7B,CAAC,CAAC,MAAM,CAAC,EAAE,kBAAkB,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IAC7C,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE;IACxD,CAAC,CAAC,MAAM,CAAC,EAAE,mBAAmB,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IAC9C,CAAC,CAAC,MAAM,CAAC,EAAE,sBAAsB,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACjD,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACvE,CAAC,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE;IAC9D,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACjC,CAAC,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE;IAClD,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;CAC1C,CAAC;KACD,QAAQ,CAAC,sFAAsF,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { RecordedControlRunStartRequest } from "./control.js";
2
+ /** The complete request-derived whitelist consumed by run summaries, thread
3
+ * activity/delivery and continuation admission. Prompts, instructions and
4
+ * arbitrary request extensions never travel with collection answers.
5
+ * Historical malformed values remain readable by the consumer's safe parsers. */
6
+ export declare const COMMAND_SUMMARY_PARAM_KEYS: readonly ["mode", "routingGoal", "access", "reviewerPanel", "protectedPathApprovals", "tests", "untilClean", "attempts", "create", "deepScan", "n", "council", "delegate", "harnesses", "primaryHarness", "model", "models", "review", "paidBudget", "parentRunId", "delegatedFromRunId", "continueFrom", "threadId", "turnId", "scope", "execution"];
7
+ export type CommandSummaryParams = Partial<Pick<RecordedControlRunStartRequest, (typeof COMMAND_SUMMARY_PARAM_KEYS)[number]>>;
8
+ //# sourceMappingURL=command-summary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-summary.d.ts","sourceRoot":"","sources":["../src/command-summary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,cAAc,CAAC;AAEnE;;;iFAGiF;AACjF,eAAO,MAAM,0BAA0B,uVA2B+B,CAAC;AACvE,MAAM,MAAM,oBAAoB,GAAG,OAAO,CACxC,IAAI,CAAC,8BAA8B,EAAE,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC,CAClF,CAAC"}
@@ -0,0 +1,33 @@
1
+ /** The complete request-derived whitelist consumed by run summaries, thread
2
+ * activity/delivery and continuation admission. Prompts, instructions and
3
+ * arbitrary request extensions never travel with collection answers.
4
+ * Historical malformed values remain readable by the consumer's safe parsers. */
5
+ export const COMMAND_SUMMARY_PARAM_KEYS = [
6
+ "mode",
7
+ "routingGoal",
8
+ "access",
9
+ "reviewerPanel",
10
+ "protectedPathApprovals",
11
+ "tests",
12
+ "untilClean",
13
+ "attempts",
14
+ "create",
15
+ "deepScan",
16
+ "n",
17
+ "council",
18
+ "delegate",
19
+ "harnesses",
20
+ "primaryHarness",
21
+ "model",
22
+ "models",
23
+ "review",
24
+ "paidBudget",
25
+ "parentRunId",
26
+ "delegatedFromRunId",
27
+ "continueFrom",
28
+ "threadId",
29
+ "turnId",
30
+ "scope",
31
+ "execution",
32
+ ];
33
+ //# sourceMappingURL=command-summary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-summary.js","sourceRoot":"","sources":["../src/command-summary.ts"],"names":[],"mappings":"AAEA;;;iFAGiF;AACjF,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,MAAM;IACN,aAAa;IACb,QAAQ;IACR,eAAe;IACf,wBAAwB;IACxB,OAAO;IACP,YAAY;IACZ,UAAU;IACV,QAAQ;IACR,UAAU;IACV,GAAG;IACH,SAAS;IACT,UAAU;IACV,WAAW;IACX,gBAAgB;IAChB,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,YAAY;IACZ,aAAa;IACb,oBAAoB;IACpB,cAAc;IACd,UAAU;IACV,QAAQ;IACR,OAAO;IACP,WAAW;CACyD,CAAC"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * The ONE admission rule of the `continueFrom` run chain (INTERFACES §1),
3
+ * shared by the daemon (the atomic guard inside the enqueue RPC, where the
4
+ * accepted successor command is the durable claim) and the control API (the
5
+ * same verdict answered with its typed context before enqueue). Both the
6
+ * daemon's `JobRecord` and the control plane's `DaemonRunRecord` satisfy the
7
+ * minimal record shape, so neither package depends on the other.
8
+ */
9
+ export interface ContinuationRecord {
10
+ id: string;
11
+ state: string;
12
+ runId?: string;
13
+ params?: unknown;
14
+ }
15
+ export type ContinuationRefusalCode = "continue_from_with_thread" | "predecessor_unknown" | "predecessor_live" | "continuation_superseded" | "continue_from_unsupported";
16
+ export interface ContinuationRefusal {
17
+ code: ContinuationRefusalCode;
18
+ status: 400 | 404 | 409;
19
+ message: string;
20
+ requiredAction: string;
21
+ context?: {
22
+ runId: string;
23
+ state?: string;
24
+ head?: string;
25
+ };
26
+ }
27
+ /** The predecessor a request continues (`continueFrom`), or null. */
28
+ export declare function continuedRunOf(params: unknown): string | null;
29
+ /** The record `continueFrom` names (by run id or job id), or undefined. */
30
+ export declare function continuationPredecessor<R extends ContinuationRecord>(from: string, records: readonly R[]): R | undefined;
31
+ /**
32
+ * Why `request` may not be admitted as a successor now, or null when it may
33
+ * (or when it is no continuation at all). One accepted successor per
34
+ * predecessor: a second request is refused with the chain head it should
35
+ * continue instead; an exact idempotent replay never reaches this rule
36
+ * because replay lookup precedes admission on every ingress.
37
+ */
38
+ export declare function continuationRefusal<R extends ContinuationRecord>(request: unknown, records: readonly R[]): ContinuationRefusal | null;
39
+ /** The typed error a surface throws for a refusal (problem-response shape). */
40
+ export declare function continuationRefusalError(refusal: ContinuationRefusal): Error;
41
+ //# sourceMappingURL=continuation-admission.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"continuation-admission.d.ts","sourceRoot":"","sources":["../src/continuation-admission.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,MAAM,uBAAuB,GAC/B,2BAA2B,GAC3B,qBAAqB,GACrB,kBAAkB,GAClB,yBAAyB,GACzB,2BAA2B,CAAC;AAEhC,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,uBAAuB,CAAC;IAC9B,MAAM,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC5D;AAQD,qEAAqE;AACrE,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAE7D;AAED,2EAA2E;AAC3E,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,kBAAkB,EAClE,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,SAAS,CAAC,EAAE,GACpB,CAAC,GAAG,SAAS,CAEf;AA+CD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,kBAAkB,EAC9D,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,SAAS,CAAC,EAAE,GACpB,mBAAmB,GAAG,IAAI,CA6D5B;AAED,+EAA+E;AAC/E,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,mBAAmB,GAAG,KAAK,CAQ5E"}
@@ -0,0 +1,136 @@
1
+ import { isTerminalLifecycle } from "./status-projection.js";
2
+ function stringParam(params, key) {
3
+ if (!params || typeof params !== "object" || Array.isArray(params))
4
+ return null;
5
+ const value = params[key];
6
+ return typeof value === "string" && value.length > 0 ? value : null;
7
+ }
8
+ /** The predecessor a request continues (`continueFrom`), or null. */
9
+ export function continuedRunOf(params) {
10
+ return stringParam(params, "continueFrom");
11
+ }
12
+ /** The record `continueFrom` names (by run id or job id), or undefined. */
13
+ export function continuationPredecessor(from, records) {
14
+ return records.find((record) => record.runId === from || record.id === from);
15
+ }
16
+ /** The successor holding `predecessor`'s claim, or null. A successor that
17
+ * settled before its run started (a typed refusal before spawn) touched none
18
+ * of the predecessor's work and holds no claim. */
19
+ function successorOf(predecessor, records) {
20
+ return (records.find((record) => {
21
+ const from = continuedRunOf(record.params);
22
+ if (from === null || (from !== predecessor.runId && from !== predecessor.id))
23
+ return false;
24
+ return !(isTerminalLifecycle(record.state) && !record.runId);
25
+ }) ?? null);
26
+ }
27
+ /** The newest link of a continuation chain: what a caller continues instead
28
+ * of a superseded predecessor (a run id, or the job id while still queued). */
29
+ function chainHead(successor, records) {
30
+ let head = successor;
31
+ const seen = new Set([head.id]);
32
+ for (let next = successorOf(head, records); next && !seen.has(next.id);) {
33
+ head = next;
34
+ seen.add(head.id);
35
+ next = successorOf(head, records);
36
+ }
37
+ return head.runId ?? head.id;
38
+ }
39
+ const THREAD_ACTION = "Continue a thread through POST /v2/threads/:id/turns; continueFrom continues one-shot runs.";
40
+ /** The run shape a successor request names, when its first try cannot carry
41
+ * the predecessor's work: the engine plans one session for the first
42
+ * candidate attempt of an Agent or Ask run, so several racing candidates, a
43
+ * repair loop, a research sweep or a plan would run without it. */
44
+ function unsupportedShape(request) {
45
+ const p = (request ?? {});
46
+ if (p["mode"] === "plan")
47
+ return "plan";
48
+ if (typeof p["n"] === "number" && p["n"] > 1)
49
+ return "best-of";
50
+ if (typeof p["attempts"] === "number" || p["untilClean"] === true)
51
+ return "repair-loop";
52
+ if (p["deepScan"] === true)
53
+ return "deep-scan";
54
+ return p["council"] === true ? "council" : null;
55
+ }
56
+ /**
57
+ * Why `request` may not be admitted as a successor now, or null when it may
58
+ * (or when it is no continuation at all). One accepted successor per
59
+ * predecessor: a second request is refused with the chain head it should
60
+ * continue instead; an exact idempotent replay never reaches this rule
61
+ * because replay lookup precedes admission on every ingress.
62
+ */
63
+ export function continuationRefusal(request, records) {
64
+ const from = continuedRunOf(request);
65
+ if (from === null)
66
+ return null;
67
+ if (stringParam(request, "threadId") !== null) {
68
+ return {
69
+ code: "continue_from_with_thread",
70
+ status: 400,
71
+ message: "continueFrom and threadId are mutually exclusive",
72
+ requiredAction: THREAD_ACTION,
73
+ };
74
+ }
75
+ const shape = unsupportedShape(request);
76
+ if (shape !== null) {
77
+ return {
78
+ code: "continue_from_unsupported",
79
+ status: 400,
80
+ message: `continueFrom continues single-candidate Agent and Ask runs, not a ${shape} run`,
81
+ requiredAction: "Continue with a single-candidate Agent or Ask run (omit n, attempts, untilClean, deepScan and council; pass mode explicitly when the predecessor was a plan), or start a new run.",
82
+ };
83
+ }
84
+ const predecessor = continuationPredecessor(from, records);
85
+ // A queued job has no run yet but will: it is live, not unknown.
86
+ if (predecessor && !isTerminalLifecycle(predecessor.state)) {
87
+ const runId = predecessor.runId ?? predecessor.id;
88
+ return {
89
+ code: "predecessor_live",
90
+ status: 409,
91
+ message: `run ${runId} is still ${predecessor.state}; it can be continued once it is terminal`,
92
+ requiredAction: "Wait for the run to finish or cancel it, then continue it.",
93
+ context: { runId, state: predecessor.state },
94
+ };
95
+ }
96
+ if (!predecessor?.runId) {
97
+ return {
98
+ code: "predecessor_unknown",
99
+ status: 404,
100
+ message: `no run ${from} owned by this daemon can be continued`,
101
+ requiredAction: "Pass the id of a run this daemon started (GET /v2/runs lists them).",
102
+ };
103
+ }
104
+ const runId = predecessor.runId;
105
+ if (stringParam(predecessor.params, "threadId") !== null) {
106
+ return {
107
+ code: "continue_from_with_thread",
108
+ status: 400,
109
+ message: `run ${runId} is a thread turn`,
110
+ requiredAction: THREAD_ACTION,
111
+ context: { runId },
112
+ };
113
+ }
114
+ const successor = successorOf(predecessor, records);
115
+ if (!successor)
116
+ return null;
117
+ const head = chainHead(successor, records);
118
+ return {
119
+ code: "continuation_superseded",
120
+ status: 409,
121
+ message: `run ${runId} was already continued; continue its head ${head} instead`,
122
+ requiredAction: `Continue ${head}, the newest run of this continuation chain.`,
123
+ context: { runId, head },
124
+ };
125
+ }
126
+ /** The typed error a surface throws for a refusal (problem-response shape). */
127
+ export function continuationRefusalError(refusal) {
128
+ return Object.assign(new Error(refusal.message), {
129
+ code: refusal.code,
130
+ status: refusal.status,
131
+ retryable: false,
132
+ requiredActions: [refusal.requiredAction],
133
+ ...(refusal.context ? { context: refusal.context } : {}),
134
+ });
135
+ }
136
+ //# sourceMappingURL=continuation-admission.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"continuation-admission.js","sourceRoot":"","sources":["../src/continuation-admission.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAgC7D,SAAS,WAAW,CAAC,MAAe,EAAE,GAAW;IAC/C,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;QAAE,OAAO,IAAI,CAAC;IAChF,MAAM,KAAK,GAAI,MAAkC,CAAC,GAAG,CAAC,CAAC;IACvD,OAAO,OAAO,KAAK,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