@sema-agent/core 7.5.1 → 7.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/dist/agents/cascade.d.ts +2 -2
  3. package/dist/agents/cascade.js +12 -10
  4. package/dist/agents/repair-loop.d.ts +5 -3
  5. package/dist/agents/repair-loop.js +13 -15
  6. package/dist/agents/subagent.d.ts +24 -42
  7. package/dist/agents/subagent.js +119 -105
  8. package/dist/agents/suspend-guard.d.ts +31 -19
  9. package/dist/agents/suspend-guard.js +14 -8
  10. package/dist/agents/teacher.js +9 -9
  11. package/dist/agents/team.d.ts +4 -3
  12. package/dist/agents/team.js +10 -8
  13. package/dist/agents/verify.d.ts +3 -3
  14. package/dist/agents/verify.js +17 -17
  15. package/dist/core/a2a.js +2 -1
  16. package/dist/core/ask-origin.d.ts +60 -7
  17. package/dist/core/ask-origin.js +26 -1
  18. package/dist/core/checkpoint-store.d.ts +78 -76
  19. package/dist/core/checkpoint-store.js +17 -1
  20. package/dist/core/gate-outcome.d.ts +189 -0
  21. package/dist/core/gate-outcome.js +70 -0
  22. package/dist/core/hooks.d.ts +18 -92
  23. package/dist/core/hooks.js +88 -85
  24. package/dist/core/mcp-failure.d.ts +104 -0
  25. package/dist/core/mcp-failure.js +128 -0
  26. package/dist/core/mcp.d.ts +21 -77
  27. package/dist/core/mcp.js +76 -150
  28. package/dist/core/pause-registry.d.ts +131 -0
  29. package/dist/core/pause-registry.js +27 -0
  30. package/dist/core/protocol-table.d.ts +5 -0
  31. package/dist/core/protocol-table.js +1 -0
  32. package/dist/core/runner/abort-race.d.ts +41 -0
  33. package/dist/core/runner/abort-race.js +38 -0
  34. package/dist/core/runner/assemble-result.d.ts +32 -41
  35. package/dist/core/runner/assemble-result.js +55 -74
  36. package/dist/core/runner/checkpoint-scope.d.ts +15 -3
  37. package/dist/core/runner/checkpoint-scope.js +3 -0
  38. package/dist/core/runner/compaction-call-options.d.ts +1 -1
  39. package/dist/core/runner/content-ask-bindings.d.ts +27 -0
  40. package/dist/core/runner/content-ask-bindings.js +1 -0
  41. package/dist/core/runner/contracts.d.ts +144 -50
  42. package/dist/core/runner/denial-limit-arms.d.ts +24 -1
  43. package/dist/core/runner/denial-limit-arms.js +24 -3
  44. package/dist/core/runner/gate-exit.d.ts +74 -0
  45. package/dist/core/runner/gate-exit.js +55 -0
  46. package/dist/core/runner/inherited-ask-grants.d.ts +46 -0
  47. package/dist/core/runner/inherited-ask-grants.js +29 -0
  48. package/dist/core/runner/park-commit.d.ts +102 -0
  49. package/dist/core/runner/park-commit.js +31 -0
  50. package/dist/core/runner/{prepare-permission-rules.d.ts → permission-rule-lanes.d.ts} +109 -3
  51. package/dist/core/runner/{prepare-permission-rules.js → permission-rule-lanes.js} +47 -1
  52. package/dist/core/runner/prepare-ask-lane.d.ts +107 -0
  53. package/dist/core/runner/prepare-ask-lane.js +131 -0
  54. package/dist/core/runner/prepare-boundary-parks.d.ts +102 -0
  55. package/dist/core/runner/prepare-boundary-parks.js +169 -0
  56. package/dist/core/runner/prepare-caps-and-workflow.js +1 -1
  57. package/dist/core/runner/prepare-context-lane.d.ts +119 -0
  58. package/dist/core/runner/prepare-context-lane.js +230 -0
  59. package/dist/core/runner/prepare-gate-stations.d.ts +174 -0
  60. package/dist/core/runner/prepare-gate-stations.js +265 -0
  61. package/dist/core/runner/prepare-hands-readface.d.ts +4 -4
  62. package/dist/core/runner/prepare-inherited-gate.d.ts +4 -4
  63. package/dist/core/runner/prepare-inherited-gate.js +1 -1
  64. package/dist/core/runner/prepare-memory-engine-session.d.ts +84 -0
  65. package/dist/core/runner/prepare-memory-engine-session.js +233 -0
  66. package/dist/core/runner/prepare-memory.d.ts +44 -26
  67. package/dist/core/runner/prepare-park-ask.d.ts +162 -0
  68. package/dist/core/runner/prepare-park-ask.js +377 -0
  69. package/dist/core/runner/prepare-policy-chain.d.ts +208 -0
  70. package/dist/core/runner/prepare-policy-chain.js +584 -0
  71. package/dist/core/runner/prepare-project-context.d.ts +1 -13
  72. package/dist/core/runner/prepare-project-context.js +1 -3
  73. package/dist/core/runner/prepare-prompt-assembly.d.ts +95 -0
  74. package/dist/core/runner/prepare-prompt-assembly.js +162 -0
  75. package/dist/core/runner/prepare-prompt-inputs.d.ts +1 -20
  76. package/dist/core/runner/prepare-protocol-tools.d.ts +3 -3
  77. package/dist/core/runner/prepare-protocol-tools.js +0 -3
  78. package/dist/core/runner/prepare-question-face.d.ts +3 -21
  79. package/dist/core/runner/prepare-question-face.js +2 -1
  80. package/dist/core/runner/prepare-safety-scan.d.ts +0 -5
  81. package/dist/core/runner/prepare-safety-scan.js +1 -2
  82. package/dist/core/runner/prepare-suspend-saga.d.ts +170 -0
  83. package/dist/core/runner/prepare-suspend-saga.js +308 -0
  84. package/dist/core/runner/prepare-task.d.ts +9 -136
  85. package/dist/core/runner/prepare-task.js +47 -2745
  86. package/dist/core/runner/prepare-turn-wiring.d.ts +154 -0
  87. package/dist/core/runner/prepare-turn-wiring.js +201 -0
  88. package/dist/core/runner/prepare-wiring-manifest.d.ts +17 -17
  89. package/dist/core/runner/prepare-wiring-manifest.js +16 -10
  90. package/dist/core/runner/prepare-workspace-restore.d.ts +2 -29
  91. package/dist/core/runner/prepare-workspace-restore.js +3 -16
  92. package/dist/core/runner/prompt-hash-salt.d.ts +1 -0
  93. package/dist/core/runner/prompt-hash-salt.js +2 -0
  94. package/dist/core/runner/remote-env-retry.d.ts +29 -0
  95. package/dist/core/runner/remote-env-retry.js +16 -0
  96. package/dist/core/runner/runtask.d.ts +16 -31
  97. package/dist/core/runner/runtask.js +110 -121
  98. package/dist/core/runner/terminal-projection.d.ts +22 -0
  99. package/dist/core/runner/terminal-projection.js +28 -0
  100. package/dist/core/session.d.ts +12 -0
  101. package/dist/core/session.js +3 -0
  102. package/dist/core/store-contracts/checkpoint-store-contract.d.ts +4 -1
  103. package/dist/core/store-contracts/checkpoint-store-contract.js +8 -2
  104. package/dist/core/terminal-cause.d.ts +137 -0
  105. package/dist/core/terminal-cause.js +9 -0
  106. package/dist/core/tool-policy.d.ts +43 -139
  107. package/dist/core/tool-policy.js +79 -112
  108. package/dist/core/types.d.ts +67 -164
  109. package/dist/core/wiring-manifest.d.ts +6 -3
  110. package/dist/core/workflow-journal-store.js +3 -4
  111. package/dist/engine/harness/agent-harness.d.ts +1 -1
  112. package/dist/index.d.ts +10 -7
  113. package/dist/index.js +8 -5
  114. package/dist/orchestration/builtin-workflows.d.ts +2 -2
  115. package/dist/orchestration/builtin-workflows.js +1 -1
  116. package/dist/orchestration/goal.js +8 -7
  117. package/dist/orchestration/run-spec.js +5 -3
  118. package/dist/orchestration/run-workflow-tool.d.ts +1 -1
  119. package/dist/orchestration/run-workflow-tool.js +4 -4
  120. package/dist/orchestration/workflow-governance.d.ts +4 -4
  121. package/dist/orchestration/workflow-governance.js +4 -2
  122. package/dist/orchestration/workflow-primitives.d.ts +1 -1
  123. package/dist/orchestration/workflow-primitives.js +1 -1
  124. package/dist/orchestration/workflow.d.ts +11 -0
  125. package/dist/orchestration/workflow.js +64 -39
  126. package/dist/prompts/supervisor.d.ts +1 -1
  127. package/dist/prompts/supervisor.js +3 -3
  128. package/dist/scenarios/scenario-registry.js +1 -1
  129. package/package.json +3 -1
  130. package/test/export-surface.snapshot.json +74 -22
  131. /package/dist/core/runner/{prepare-announce-once.d.ts → announce-once-ledger.d.ts} +0 -0
  132. /package/dist/core/runner/{prepare-announce-once.js → announce-once-ledger.js} +0 -0
@@ -1113,11 +1113,11 @@ export interface ToolExecuteContext {
1113
1113
  ttlMs?: number;
1114
1114
  };
1115
1115
  /**
1116
- * Ruled 2026-08-04 — the host run set {@link TaskSpec.checkpointStore} to `null` (the per-run off
1117
- * switch for the durable machine). Runner-filled, read-only, NEVER a model/tool argument; absent on
1118
- * every other run, so a deployment that does not use the off switch sees no change at all.
1116
+ * Ruled 2026-08-04 — the host run set {@link TaskSpec.checkpointStore} to `"disabled"` (the per-run
1117
+ * off switch for the durable machine). Runner-filled, read-only, NEVER a model/tool argument; absent
1118
+ * on every other run, so a deployment that does not use the off switch sees no change at all.
1119
1119
  *
1120
- * A delegation tool MUST copy `checkpointStore: null` onto every child spec it builds (sync,
1120
+ * A delegation tool MUST copy `checkpointStore: "disabled"` onto every child spec it builds (sync,
1121
1121
  * background and fork alike). Without that copy the off switch is a ONE-LEVEL guarantee: the child
1122
1122
  * runs on the same Runner, so it resolves `RunnerDeps.checkpointStore` on its own and re-arms every
1123
1123
  * suspend leg the parent just disarmed — a machine-started run would then park in its subtree, which
@@ -2546,10 +2546,15 @@ export interface TaskSpec {
2546
2546
  * run {@link Runner.preempt} is a documented no-op — there is no suspend to preempt into, so the
2547
2547
  * request is dropped with the existing `preempt.ignored` trace instead of pausing the run.
2548
2548
  *
2549
- * Delegated children inherit it: the sync / background / fork spawn lanes copy the `null` into every
2550
- * child spec (same discipline as `principal`), so a store-null run's whole tree stays store-less.
2549
+ * Delegated children inherit it: the sync / background / fork spawn lanes copy the `"disabled"` word
2550
+ * into every child spec (same discipline as `principal`), so a store-less run's whole tree stays
2551
+ * store-less.
2552
+ *
2553
+ * The off switch is the WORD `"disabled"`, never `null`: a string is not nullish, so the ordinary
2554
+ * `spec ?? deps` coalesce is the whole resolution rule and no reader has to remember a special
2555
+ * null test (the retired `null` spelling is refused loudly at the first read, with the word to write).
2551
2556
  */
2552
- checkpointStore?: import("./checkpoint-store.js").CheckpointStore | null;
2557
+ checkpointStore?: import("./checkpoint-store.js").CheckpointStore | "disabled";
2553
2558
  /**
2554
2559
  * Restrict the injected "hand" band (design/44) to its effect:read tools for this task — read_file /
2555
2560
  * grep / glob (+ `bash_readonly` when a shell is available); edit_file / write_file / `bash` are not
@@ -3231,6 +3236,8 @@ export interface TaskSpec {
3231
3236
  * hard-boundary way (it is, like `suspended`, only safe at the top-level `runTask` boundary).
3232
3237
  */
3233
3238
  export type TaskStatus = "completed" | "blocked" | "failed" | "suspended" | "needs_review";
3239
+ import type { TerminalCause } from "./terminal-cause.js";
3240
+ export type { TerminalCause, PausedCause } from "./terminal-cause.js";
3234
3241
  /**
3235
3242
  * RB-439-a — one remote-workspace lifecycle failure, reported as data on {@link TaskResult.remoteEnvFailures}.
3236
3243
  * See that field for why the eleven-code taxonomy needed a structured channel to reach a caller at all.
@@ -3349,7 +3356,17 @@ export interface TaskResult {
3349
3356
  runId?: string;
3350
3357
  /** Use this to continue the same conversation on the next call. */
3351
3358
  sessionId: string;
3352
- status: TaskStatus;
3359
+ /**
3360
+ * WHY the run ended — the ONE tagged cause ({@link TerminalCause}), and the ONLY terminal record on this
3361
+ * result: there is no `status` word and no `errorCode`/`errorMessage`/`blockedReason`/`checkpointToken`/
3362
+ * `checkpointId`/`checkpointGate`/`workspaceRestoreMode` beside it (a second spelling of the same fact
3363
+ * would be the one a reader reaches for, and the two would have to be kept equal forever). Branch on
3364
+ * `terminal.kind`: `"paused"` carries the token and the gate together (a suspended run with no token
3365
+ * cannot be constructed), `"failed"` carries the code and the message together, `"blocked"` its reason.
3366
+ * A face that still speaks the five-word {@link TaskStatus} derives it with
3367
+ * {@link import("./runner/terminal-projection.js").terminalProjection} — the one cause→word derivation.
3368
+ */
3369
+ terminal: TerminalCause;
3353
3370
  /** design/99 MF-25: the EFFECTIVE model id that served this task — the RESOLVED `Model.id`, not the requested
3354
3371
  * `TaskSpec.model` ref (which may be a role / name / `@mention`). Lets a UI echo "served by X" instead of the
3355
3372
  * requested ref. A mid-run degradation is observed separately (see the degraded-model fields). */
@@ -3416,44 +3433,6 @@ export interface TaskResult {
3416
3433
  * Undefined on every other terminal and when there was nothing to salvage.
3417
3434
  */
3418
3435
  salvagedOutput?: string;
3419
- /** Set when status is "blocked": why the agent could not finish. */
3420
- blockedReason?: string;
3421
- /**
3422
- * Set when `status === "suspended"` (design/45) OR `status === "needs_review"` (design/76 §2.5 dry-run /
3423
- * design/80 D-B plan-gate): the durable-checkpoint token to resume this task with via
3424
- * `runner.resume(checkpointToken, outcome)` (a `policy_ask` outcome for `suspended`; for `needs_review`, a
3425
- * `dry_run_review` outcome on a `needs_review` gate or a `plan_review` outcome on a `plan_review` gate —
3426
- * read `checkpointGate.kind` to pick). Also passed up by an
3427
- * orchestrator that mapped an unexpected `suspended` to `failed` (errorCode `"unexpected.suspended"`) so the
3428
- * top-level caller can still resume. Branded `CheckpointToken`; **never log it or put it in a URL** (it is
3429
- * the resume capability, §6). Undefined for every other status.
3430
- */
3431
- checkpointToken?: import("./checkpoint-store.js").CheckpointToken;
3432
- /** The suspend's NON-SECRET stable identity ({@link import("./checkpoint-store.js").Checkpoint.checkpointId}),
3433
- * set beside `checkpointToken` on the suspended/needs_review terminals — the display/correlation key a
3434
- * consumer may log or render where the token must not travel. Absent on pre-identity checkpoints. */
3435
- checkpointId?: string;
3436
- /** Set with `checkpointToken`: who/what must resume (e.g. `{kind:"human", reason, toolName}`), so the
3437
- * caller knows what decision the suspension is awaiting. */
3438
- checkpointGate?: import("./checkpoint-store.js").CheckpointGate;
3439
- /**
3440
- * RB-439-b — HOW the suspended task's remote workspace will come back, set alongside `checkpointToken`
3441
- * whenever the suspend captured a remote workspace. The two modes bill and behave very differently and
3442
- * were previously indistinguishable from the caller's side:
3443
- *
3444
- * - `"snapshot"` — the workspace VM was `suspendVM`-paused into a snapshot. Provider billing typically
3445
- * stops; in-memory process state is captured; resume restores it.
3446
- * - `"park_only"` — the env declared itself non-suspendable (an SSH host / ADB device), so NOTHING was
3447
- * paused: the machine keeps running (and keeps costing), any in-memory process state is at the
3448
- * target's mercy, and resume simply reconnects to the still-present workspace. Deliberate and honest
3449
- * (core does not fabricate a snapshot) — but a scheduler that assumes "suspended ⇒ idle and free"
3450
- * must be able to see it.
3451
- *
3452
- * ABSENT for a process-local suspend (a static caller-owned env: no remote workspace was captured at
3453
- * all) and for every non-suspended terminal. The same discriminant rides {@link CheckpointSummary} for
3454
- * the inbox/`listByScope` face.
3455
- */
3456
- workspaceRestoreMode?: "snapshot" | "park_only";
3457
3436
  /**
3458
3437
  * RB-439-a — the remote-workspace lifecycle failures this run hit, as DATA. The seam declares eleven
3459
3438
  * distinct `RemoteExecutionErrorCode`s, but every one of them used to reach the caller as the same
@@ -3473,46 +3452,10 @@ export interface TaskResult {
3473
3452
  * - `message` — the adapter's message, for humans.
3474
3453
  *
3475
3454
  * Present only when at least one lifecycle call failed (absent = nothing to report), so a consumer that
3476
- * ignores the field is unchanged. It is DIAGNOSTIC: `status`/`errorCode` keep their existing meanings
3455
+ * ignores the field is unchanged. It is DIAGNOSTIC: {@link terminal} keeps its existing meaning
3477
3456
  * a failed suspend still ends the task the way it always did, it is just no longer anonymous.
3478
3457
  */
3479
3458
  remoteEnvFailures?: RemoteEnvFailureNote[];
3480
- /** Set when status is "failed". Human-readable. */
3481
- errorMessage?: string;
3482
- /**
3483
- * Machine-readable failure code when the failure carried one — e.g. a `SessionError.code` such as
3484
- * `"conflict"` (a cross-instance write lost the optimistic lock), or a Node error code. Lets a
3485
- * caller branch programmatically (e.g. evict a stale cache + retry on `"conflict"`) instead of
3486
- * matching `errorMessage` strings. Undefined when no code is available.
3487
- *
3488
- * 1.37+ terminal codes use a **dotted namespace** so a caller can prefix-match a whole class:
3489
- * `"limits.max_tokens_exceeded"` / `"limits.max_cost_exceeded"` / `"limits.max_turns_exceeded"` /
3490
- * `"limits.max_walltime_exceeded"` / `"config.limit_invalid"` / `"config.limit_unknown_key"` /
3491
- * `"config.attachment_invalid"` (RB-318 — a mode-valued `TaskSpec.attachments` member outside its
3492
- * closed set, refused at the same door as the limits; e.g. a near-miss `totalTokensReminderMode`
3493
- * spelling) (e.g. `errorCode.startsWith("limits.")`). 1.36 brain codes (`auth`/`network`/`rate_limit`/…)
3494
- * and `"conflict"` remain flat (unchanged, to avoid breaking existing consumers).
3495
- *
3496
- * design/164 件四/件五 added two codes for the EXTERNAL stop causes — neither is a `limits.` code,
3497
- * because neither is an allowance the task chose, and a caller that retries on `limits.*` should NOT
3498
- * treat these the same way:
3499
- * - `"env.lifetime_expired"` — the execution environment's platform lifetime ran out and the run could
3500
- * not be suspended durably. Retrying needs a NEW environment, not a smaller budget.
3501
- * - `"usage.window_exhausted"` — a deployment usage-governance window is full (see
3502
- * `RunnerDeps.usageWindows`). Reported at task ENTRY (nothing ran) or after a suspend was impossible;
3503
- * the wait hint rides the thrown error's `retryAfterMs` (delivered through `RunnerDeps.onError`) and
3504
- * the message text. Retrying before the window frees will be refused again.
3505
- * Their config-time siblings are `"config.env_lifetime_invalid"` / `"config.usage_window_invalid"`.
3506
- * A governance window with a MONEY ceiling adds two more, both of which say "the ceiling could not be
3507
- * evaluated" rather than "the ceiling was reached" — neither is retryable without a config change:
3508
- * - `"config.usage_window_unpriced"` — a `UsageWindow.maxCostUsd` over a run with no cost figure (no
3509
- * `RunnerDeps.pricing` entry and no `Model.cost`). Raised at the door for the run's own model, and at
3510
- * the accounting point when a mid-run model switch loses the price table.
3511
- * - `"usage_window.store_cost_unanswered"` — the wired ledger does not carry the money arm: it either
3512
- * dropped the cost supplied to a charge, or answered a $ window without the cost it holds. Both mean
3513
- * the ceiling was never evaluated (typically a store or decorator that predates the cost arm).
3514
- */
3515
- errorCode?: string;
3516
3459
  /**
3517
3460
  * Present when this run's terminal failure came from the PROVIDER BOUNDARY — the transport or the
3518
3461
  * provider failed the model call, as opposed to this deployment refusing to send one, a limit being
@@ -4430,12 +4373,27 @@ export type TaskEvent = ({
4430
4373
  * `errorKind` leg is what makes a LOOP-THROWN error's frame classifiable: the loop's thrown-error
4431
4374
  * fold and the resume legs write the discriminator under that name. Lifted so a consumer never
4432
4375
  * has to parse the (contract-stable) result text. Engine-minted vocabulary today includes
4433
- * `"tool.not_found"` (unknown tool name) and `"gate.parked"` (an abort short-circuit contaminated
4434
- * this call because a durable gate parked the batch — the "Operation aborted" family). Additive:
4435
- * absent on error frames minted before this field existed, and on error results whose details
4436
- * carry no string discriminator under either name.
4376
+ * `"tool.not_found"` (unknown tool name), `"gate.parked"` (an abort short-circuit contaminated
4377
+ * this call because a durable gate parked the batch — the "Operation aborted" family), and, for a
4378
+ * failed MCP tool call, the MCP failure class see {@link import("./mcp-failure.js").McpFailure.kind}
4379
+ * for the words (the same closed set the per-server status and the wiring manifest's `mcp[]` carry;
4380
+ * this frame only transports it). Additive: absent on error frames minted before this field
4381
+ * existed, and on error results whose details carry no string discriminator under either name.
4437
4382
  */
4438
4383
  errorCode?: string;
4384
+ /**
4385
+ * @contract tool_end.delivered — WHETHER THE REQUEST REACHED ITS SERVER, when this frame closes a
4386
+ * failed call whose result carried the MCP failure record: the closed
4387
+ * {@link import("./mcp-failure.js").McpDelivered} (`"yes"` / `"no"` / `"unknown"`), lifted from
4388
+ * `details.delivered` beside {@link errorCode} and read TOGETHER with it — the same `errorCode`
4389
+ * (`connection_closed`) is safe to retry at `"no"` (nothing was sent) and must be verified first at
4390
+ * `"unknown"` (the request may have executed). The meaning of each word is owned by
4391
+ * {@link import("./mcp-failure.js").McpFailure.delivered}; this frame only transports it. Screened
4392
+ * against the closed set (an out-of-vocabulary value is not lifted) and never derived from the
4393
+ * code or the text. ABSENT on every frame whose result carried no such verdict — every executed
4394
+ * call and every non-MCP failure — and a consumer must not read a semantic out of the absence.
4395
+ */
4396
+ delivered?: import("./mcp-failure.js").McpDelivered;
4439
4397
  /**
4440
4398
  * WHICH call the gate was holding, when this frame is a park-contamination frame — the tool call
4441
4399
  * id of the gated call. Three conditions, ALL required: `errorCode === "gate.parked"`, the run is
@@ -4467,78 +4425,23 @@ export type TaskEvent = ({
4467
4425
  */
4468
4426
  gatedCallId?: string;
4469
4427
  /**
4470
- * WHAT ENDED THE APPROVAL this call was waiting on, when this frame closes a gated call `"human"`
4471
- * / `"timeout"` / `"aborted"`, the vocabulary of
4472
- * {@link import("./tool-policy.js").ApprovalSettledBy}.
4473
- *
4474
- * Why it is on the FRAME and not left to the text: once an approval has ended, "a person refused
4475
- * this" and "the window closed with nobody answering" are the same `deny` carrying different
4476
- * prose, and prose is the one thing a renderer must not branch on. A card that says "denied" for
4477
- * an unanswered request tells its reader someone considered their request and said no. This is the
4478
- * machine-readable half of the same disclosure the settlement's message carries in words.
4479
- *
4480
- * WHERE IT COMES FROM never inferred here: the durable/decide lane carries it on the resume
4481
- * outcome and the settling caller fills it at each of its own settlement sites; the in-process
4482
- * approval lane fills it at the arm that ended the wait (the deadline, the abort, the approver's
4483
- * verdict). Core does not derive it from `isError`, from the decision, or from anything else.
4484
- *
4485
- * ABSENT on everything that settled no approval — which is nearly every frame, including every
4486
- * ordinary tool result — and also on a settled approval whose decider named no source (a caller
4487
- * predating the field). A consumer MUST NOT read a semantic out of the absence, and in particular
4488
- * must not treat "absent" as "a human decided".
4489
- */
4490
- settledBy?: import("./tool-policy.js").ApprovalSettledBy;
4491
- /**
4492
- * HOW the ask resolution refused, when this frame closes a call an in-process ask resolution
4493
- * DENIED — the closed vocabulary of {@link import("./tool-policy.js").AskDenyResolution}
4494
- * (`"human_refused"`, `"window_expired"`, `"no_approver"`, `"blanket_allow_refused"`,
4495
- * `"approver_unavailable"`, `"task_aborted"`, `"presentation_failed"`, `"approver_error"`,
4496
- * `"approver_contract"`). Finer-grained than {@link settledBy} (which only says what KIND of
4497
- * end a settled wait had): this classifies the REFUSAL ARM itself, minted by the resolver at
4498
- * the arm that composed the deny and carried verbatim on the engine-owned settlement sideband
4499
- * — never derived from the result text or writable by a tool/policy (an out-of-vocabulary or
4500
- * self-declared word is dropped at the screens, with a defect reported on the deployment's
4501
- * error face). ABSENT on every frame that was not such a deny — every executed call, every
4502
- * policy/hook direct deny, and the durable/decide lane's settlements (which carry their own
4503
- * `settledBy`/reason instead). A consumer must not read a semantic out of the absence.
4504
- */
4505
- resolution?: import("./tool-policy.js").AskDenyResolution;
4506
- /**
4507
- * #557 (additive) — `true` ⇔ this frame closes a call the classifier DENIAL-LIMIT fallback ask
4508
- * auto-denied itself: the ask's own window (`AskRequest.denialLimitFallback.autoDenyAfterMs`,
4509
- * 120 s by default) elapsed with nobody answering. Such a frame also reads `settledBy:"timeout"`
4510
- * + `resolution:"window_expired"` — the SAME two words the approval factory's own window
4511
- * (`createApprovalPolicy.approvalTimeoutMs`) settles with — and this bit is the discriminant: the
4512
- * factory's deadline never carries it, so a shell that sees the pair without it is looking at the
4513
- * host-configured approval window having elapsed, and with it at the classifier fallback's own
4514
- * countdown having run out. A DURABLE park's expiry is neither: it settles on the decide lane with
4515
- * its own `settledBy`/reason and carries no `resolution` word at all (see that field's doc above).
4516
- * Minted at the resolver's deadline arm and carried on
4517
- * the engine-owned settlement sideband (never read out of the tool result, never writable by a
4518
- * tool or policy — a marker on an executing call is dropped with a defect reported). ABSENT on
4519
- * everything else; a consumer must not read a semantic out of the absence.
4520
- */
4521
- autoDenied?: true;
4522
- /**
4523
- * design/252 G-7 — WHOSE settlement that was: the identifier the approval channel reported for
4524
- * the party that ended this wait, beside the {@link settledBy} word that says what KIND of end
4525
- * it was. The two are read together and neither substitutes for the other:
4526
- * `settledBy:"timeout"` with an `approver` names the queue whose window elapsed, NOT someone
4527
- * who refused.
4528
- *
4529
- * WHAT CORE PROMISES ABOUT IT — exactly one thing: it is what the settling caller said, screened
4530
- * for shape (a plain string, bounded, no control characters) and otherwise untouched. Core does
4531
- * NOT authenticate it, does not compare it to a principal, and never reads it back to decide
4532
- * anything. Identity is established by the approval channel a deployment integrates (its card,
4533
- * its signature, its console); this is the transcription that lets an audit which already knows
4534
- * a person ended a wait also say which person, without the engine growing an identity surface it
4535
- * deliberately does not have. Treat it accordingly: it is a RECORD of a claim, and its
4536
- * trustworthiness is exactly the trustworthiness of the channel that made it.
4537
- *
4538
- * ABSENT on every frame that settled no approval, and on a settled approval whose channel named
4539
- * nobody. Absence means nobody SAID — never "nobody approved this", and never "a human did".
4540
- */
4541
- approver?: string;
4428
+ * The gate's record of the pass that admitted or refused this call, when the call went through the
4429
+ * tool gate at all ({@link import("./gate-outcome.js").GateOutcome}): `disposition` (allowed, or
4430
+ * denied by which LAYER), `settlement` (how the ask this pass consumed ENDED — a person's yes or
4431
+ * no with the channel's attribution and, on a bare "no", no note; a window that elapsed and whose;
4432
+ * nobody reachable; the wait aborted…) and `origin` (who ASKED). It is the SAME object the
4433
+ * `permissionDenied` observer received and the engine's per-call sideband recorded one mint, three
4434
+ * faces so a renderer never branches on prose to tell "a person refused" from "the window closed".
4435
+ *
4436
+ * WHERE IT COMES FROM — never inferred here: the gate mints it at its exit, the decide lane mints it
4437
+ * from the host's decision facts joined with the row's persisted origin. Core does not derive it
4438
+ * from `isError`, from the result, or from anything a tool or a post-tool hook can write.
4439
+ *
4440
+ * ABSENT on every frame of a call the gate never saw (a tool call on an unarmed gate, a deferred
4441
+ * re-issue, a reconcile-recovered orphan). A gated call's frame ALWAYS carries it an absence is
4442
+ * not a fact about the call, and a consumer must not read one out of it.
4443
+ */
4444
+ gate?: import("./gate-outcome.js").GateOutcome;
4542
4445
  /**
4543
4446
  * design/99 §E1 — `true` when {@link output} was SIZE-bounded by core (the full body exceeded the cap and
4544
4447
  * was degraded to a truncated string). Lets a consumer detect truncation programmatically instead of
@@ -5805,13 +5708,13 @@ export type DelegationLifecycleEvent = {
5805
5708
  phase: "terminal";
5806
5709
  /** Same envelope as the leg's spawn frame (one mint per leg). */
5807
5710
  identity: import("./hooks.js").HookInvocationIdentity;
5808
- /** The leg's settled status — the `TaskResult.status` the spawning lane receives, verbatim
5809
- * (the sync lane's previously-void `settled` payload, made public). `"suspended"` means a
5711
+ /** The leg's settled status word — the projection of the `TaskResult.terminal` the spawning lane
5712
+ * receives (the sync lane's previously-void `settled` payload, made public). `"suspended"` means a
5810
5713
  * durable park: expect a later `"resume"`-leg spawn/terminal pair if it is redeemed. */
5811
- status: TaskResult["status"];
5714
+ status: TaskStatus;
5812
5715
  /** Turns the leg completed. */
5813
5716
  turns: number;
5814
- /** The leg's `TaskResult.errorCode`, when one was stamped. */
5717
+ /** The leg's terminal code (the failed cause's `code`), when one was stamped. */
5815
5718
  errorCode?: string;
5816
5719
  };
5817
5720
  /** Test seam (mirrors `__resetMalformedNoticeSeatAnnouncement`): never called by production code. */
@@ -6007,7 +5910,7 @@ export interface EngineNotice {
6007
5910
  * it through the sink as always). Once per prepared task leg — a resume or a delegated child
6008
5911
  * is its own leg and says so again; `detail: { sessionId, runId, principal?, cause, liveApprover,
6009
5912
  * liveQuestionFace }` — `cause` is `"no_deployment_store"` (the deployment wired none) or
6010
- * `"task_store_null"` (`TaskSpec.checkpointStore: null`, the per-run off switch, on a leg
5913
+ * `"task_store_disabled"` (`TaskSpec.checkpointStore: "disabled"`, the per-run off switch, on a leg
6011
5914
  * whose deployment may well have a store: the fix is the task's); `liveApprover` /
6012
5915
  * `liveQuestionFace`: whether a live seat will EFFECTIVELY answer the leg's permission asks /
6013
5916
  * questions in-stream (a delegated child under an inherited content mandate reads `false`
@@ -22,7 +22,7 @@
22
22
  */
23
23
  import type { RunnerDeps, TaskSpec } from "./types.js";
24
24
  import { type StoreDurability } from "./checkpoint-store.js";
25
- import type { McpFailureCode } from "./mcp.js";
25
+ import type { McpDelivered, McpFailureKind } from "./mcp-failure.js";
26
26
  export type { StoreDurability };
27
27
  /** The manifest-face projection of {@link StoreDurability}: `"declared_durable"` (the name says it —
28
28
  * a DECLARATION relayed, not a verification) vs `"process_local"` (declared so, or fail-closed
@@ -84,7 +84,8 @@ export type AutoModeArmReason = (typeof AUTO_MODE_ARM_REASONS)[number];
84
84
  * read face on {@link WiringManifest.mcp}. `status` is the connect-time verdict of this leg's
85
85
  * materialize (a snapshot, never a heartbeat — the same semantics as `MaterializedMcp.statuses`,
86
86
  * which it is projected from): `connected` (tools listed; `toolCount` = the mounted roster size after
87
- * intake), `failed` (the connect or the tool listing threw — `errorCode` names the class, `error` the
87
+ * intake), `failed` (the connect or the tool listing threw — `errorCode`/`delivered`/`httpStatus` are the
88
+ * failure record spread flat (see the MCP failure vocabulary's `McpFailure`), `error` the
88
89
  * neutralized, length-bounded remote text), `skipped` (declared on the spec but this leg produced no
89
90
  * status for it — the materialization did not reach it). `source` is the DECLARING side's own label
90
91
  * (`McpServerSpec.source`: plugin / user / project / local, or anything the deployment writes),
@@ -95,7 +96,9 @@ export interface WiringManifestMcpEntry {
95
96
  name: string;
96
97
  source?: string;
97
98
  status: "connected" | "failed" | "skipped";
98
- errorCode?: McpFailureCode;
99
+ errorCode?: McpFailureKind;
100
+ delivered?: McpDelivered;
101
+ httpStatus?: number;
99
102
  error?: string;
100
103
  toolCount: number;
101
104
  }
@@ -1,3 +1,4 @@
1
+ import { terminalProjection } from "./runner/terminal-projection.js";
1
2
  export const MAX_JOURNAL_RESULT_BYTES = 5 * 1024 * 1024;
2
3
  export function oversizeJournalResult(serialized) {
3
4
  return Buffer.byteLength(serialized, "utf8") > MAX_JOURNAL_RESULT_BYTES;
@@ -10,14 +11,12 @@ export function callKeyOrdinal(callKey) {
10
11
  export const JOURNAL_OVERSIZE_ERROR_CODE = "workflow.journal_oversize";
11
12
  export function journalOversizeTombstone(result, bytes) {
12
13
  const message = `[journal] result omitted: ${bytes} bytes exceeds the ${MAX_JOURNAL_RESULT_BYTES}-byte per-entry journal cap; ` +
13
- `the agent's real terminal status was "${result.status}". A resume re-runs this agent (and everything after it) live.`;
14
+ `the agent's real terminal status was "${terminalProjection(result.terminal).status}". A resume re-runs this agent (and everything after it) live.`;
14
15
  return {
15
16
  taskId: result.taskId,
16
17
  sessionId: result.sessionId,
17
- status: "failed",
18
+ terminal: { kind: "failed", code: JOURNAL_OVERSIZE_ERROR_CODE, message },
18
19
  result: message,
19
- errorCode: JOURNAL_OVERSIZE_ERROR_CODE,
20
- errorMessage: message,
21
20
  stats: result.stats,
22
21
  };
23
22
  }
@@ -431,7 +431,7 @@ export declare class AgentHarness<TSkill extends Skill = Skill, TPromptTemplate
431
431
  setTools(tools: TTool[], activeToolNames?: string[]): Promise<void>;
432
432
  /**
433
433
  * design/74 R3-A: request a CLEAN stop at the next turn boundary. Unlike {@link abort} (a hard
434
- * AbortController cancel that — with no `suspendRef` — drives the orphan-[INTERRUPTED] session reconcile),
434
+ * AbortController cancel that — with no committed pause — drives the orphan-[INTERRUPTED] session reconcile),
435
435
  * this sets a one-way flag the loop reads via its `shouldStopAfterTurn` callback: the current turn finishes
436
436
  * its tool calls, the loop emits `agent_end`, and returns. The runner uses it for a resource-slice suspend
437
437
  * so the suspended session is left clean (resumable), never reconciled as interrupted. Idempotent.
package/dist/index.d.ts CHANGED
@@ -9,6 +9,7 @@ export { Runner, runTask } from "./core/runner/runtask.js";
9
9
  export { resolveTaskLimits } from "./core/runner/prepare-task.js";
10
10
  export type { RunInternals, ResolvedWorkspace } from "./core/runner/prepare-task.js";
11
11
  export type { BudgetAxis } from "./core/runner/assemble-result.js";
12
+ export { terminalProjection } from "./core/runner/terminal-projection.js";
12
13
  export { SESSION_LOG_DIGEST_SCHEME, sessionEntryDigest, sessionLogDigest, sessionLogDigestsComparable, } from "./engine/session/log-digest.js";
13
14
  export type { ResumeTaskConfig } from "./core/runner/runtask.js";
14
15
  export { defineTool } from "./core/tools.js";
@@ -50,7 +51,7 @@ export { decideAutoPromote, deriveTripwire, FROZEN_DENYLIST_FLOOR, type AutoProm
50
51
  export { runCascade, type CascadeRung, type CascadeConfig, type CascadeAttempt, type CascadeRunResult, type GateVerdict, } from "./agents/cascade.js";
51
52
  export { pgQuery, mysqlQuery, sqliteQuery } from "./tools/sql-adapters.js";
52
53
  export { materializeMcpTools, MCP_PREFIX, type MaterializedMcp, type McpServerStatus, type McpRefreshResult } from "./core/mcp.js";
53
- export { MCP_FAILURE_CODES, mcpFailureCodeOf, type McpFailureCode } from "./core/mcp.js";
54
+ export { MCP_FAILURE_KINDS, MCP_DELIVERY_VERDICTS, classifyMcpFailure, type McpFailure, type McpFailureKind, type McpDelivered } from "./core/mcp-failure.js";
54
55
  export { materializeA2aTools, A2aRpcError, type MaterializedA2a, type A2aPeerStatus, type A2aRefreshResult, type A2aToolAxis } from "./core/a2a.js";
55
56
  export { PROTOCOL_TABLE, MCP_NAMESPACE, A2A_NAMESPACE, protocolOf, type ProtocolNamespace, type ProtocolId } from "./core/protocol-table.js";
56
57
  export { InMemorySessionPolicyStore, SessionPolicyError, loosenReasons, normalizeRules, stripRev, type SessionPolicyStore, type SessionPermissionRules, type StoredSessionRules, type SessionRulesRecord, type PutRulesOptions, } from "./core/session-policy-store.js";
@@ -96,7 +97,8 @@ export { READ_FACE_DEFAULT_DENY_ENTRIES, READ_FACE_BUILTIN_DENY_TABLE, READ_DENY
96
97
  export { deploymentReadFaceClampNotice, resolveReadFace, type ReadFace, type ReadFaceInputs } from "./tools/fs/index.js";
97
98
  export { WRITE_PROTECTED_DEFAULT_TABLE, resolveWriteProtectedTable, compileWriteProtection, type WriteProtectedEntry, type WriteProtectedRow, type WriteProtectedKind, type WriteProtectedHit, type WriteProtectionMatcher, } from "./core/write-protect.js";
98
99
  export { InMemoryToolResultStore, OFFLOAD_TOOL_NAME, DEFAULT_TOOL_RESULT_THRESHOLD_CHARS, assertSafeToolResultRef, buildToolResultRef, toolResultContentSegment, MAX_MINTED_TOOL_RESULT_REF_CHARS, type ToolResultProvenance, assertToolResultProvenanceMatch, normalizeToolResultProvenance, toolResultProvenanceOf, ToolResultRefConflictError, TOOL_RESULT_REF_CONFLICT_CODE, type ToolResultStore, type ToolResultSlice, type ToolResultDeletionReport, } from "./core/tool-result-store.js";
99
- export { InMemoryCheckpointStore, CheckpointError, mintCheckpointId, mintCheckpointToken, checkpointVersionOf, CURRENT_CHECKPOINT_VERSION, MAX_SUPPORTED_CHECKPOINT_VERSION, ORG_ADMISSION_CHECKPOINT_VERSION, F012_CHECKPOINT_VERSION, REAL_APPROVAL_CHECKPOINT_VERSION, RESOURCE_CHECKPOINT_VERSION, TOKEN_CHECKPOINT_VERSION, debitLedger, remainingBudgetMicroUsd, remainingTokens, winnerFromOutcome, validatePendingSteer, readPendingSteerQueue, appendPendingSteer, MAX_PENDING_STEER_CHARS, MAX_PENDING_STEER_ENTRIES, PENDING_STEER_QUEUE_BYTE_BUDGET_BYTES, PENDING_STEER_FROZEN_FIELDS, ACTOR_ASSERTION_FROZEN_FIELDS, MAX_ACTOR_FIELD_CHARS, MAX_STEER_INPUT_ID_CHARS, LEGACY_PENDING_STEER_INPUT_ID, type ActorAssertion, type PendingSteerEntry, type PendingSteerInput, riskSeverity, buildRiskDescriptor, summarizeCheckpoint, type RiskDescriptor, type ProbeCause, type ProbeCauseOperands, type CheckpointStore, type CheckpointSummary, type Checkpoint, type CheckpointToken, type CheckpointGate, type CheckpointState, type SerializedCheckpointState, type CheckpointFaultMode, type PendingAction, type ResumeOutcome, type ResolvedOutcome, type ReopenReason, type ResolveExpectation, type TerminalClaimIntent, type TerminalClaimOutcome, type SafetyAxis, type RealApprovalGateBit, type ResourceLedger, type ResourceLimitReason, type PlatformLimitReason, } from "./core/checkpoint-store.js";
100
+ export { InMemoryCheckpointStore, CheckpointError, mintCheckpointId, mintCheckpointToken, checkpointVersionOf, CURRENT_CHECKPOINT_VERSION, MAX_SUPPORTED_CHECKPOINT_VERSION, ORG_ADMISSION_CHECKPOINT_VERSION, F012_CHECKPOINT_VERSION, REAL_APPROVAL_CHECKPOINT_VERSION, RESOURCE_CHECKPOINT_VERSION, TOKEN_CHECKPOINT_VERSION, debitLedger, remainingBudgetMicroUsd, remainingTokens, winnerFromOutcome, validatePendingSteer, readPendingSteerQueue, appendPendingSteer, MAX_PENDING_STEER_CHARS, MAX_PENDING_STEER_ENTRIES, PENDING_STEER_QUEUE_BYTE_BUDGET_BYTES, PENDING_STEER_FROZEN_FIELDS, ACTOR_ASSERTION_FROZEN_FIELDS, MAX_ACTOR_FIELD_CHARS, MAX_STEER_INPUT_ID_CHARS, LEGACY_PENDING_STEER_INPUT_ID, type ActorAssertion, type PendingSteerEntry, type PendingSteerInput, riskSeverity, buildRiskDescriptor, summarizeCheckpoint, type RiskDescriptor, type ProbeCause, type ProbeCauseOperands, type CheckpointStore, type CheckpointSummary, type Checkpoint, type CheckpointToken, type CheckpointGate, type CheckpointState, type SerializedCheckpointState, type CheckpointFaultMode, type PendingAction, type ResumeOutcome, type ResolvedOutcome, type ReopenReason, type ResolveExpectation, type TerminalClaimIntent, type TerminalClaimOutcome, type SafetyAxis, type RealApprovalGateBit, type ResourceLedger, type ResourceLimitReason, type PlatformLimitReason, type CheckpointRow, realApprovalOrgFact, resolveCheckpointStore, } from "./core/checkpoint-store.js";
101
+ export { PAUSE_REGISTRY, type GateKind, type PendingKind, type ResumeGate, isGateKind, resumeGateMatches, type CheckpointPause, type CheckpointFields, pauseOf, checkpointFrom } from "./core/pause-registry.js";
100
102
  export { InMemoryUsageWindowStore, GLOBAL_USAGE_KEY, EMPTY_USAGE_WINDOW_RECORD, chargeUsageRecord, readUsageRecord, usageRetryAfterMs, resolveUsageWindows, type UsageWindow, type UsageWindowStore, type UsageWindowReading, type UsageWindowRecord, type UsageSlot, type UsageBucketRow, } from "./core/usage-window-store.js";
101
103
  export { FileUsageWindowStore } from "./stores/file/usage-window-store.js";
102
104
  export { ENV_LIFETIME_SUSPEND_MARGIN_MS, USAGE_WINDOW_REAP_MARGIN_MS } from "./core/runner/prepare-task.js";
@@ -145,8 +147,9 @@ export type { SchedulerCapability, SchedulerErrorCode, ScheduledIntent, Schedule
145
147
  export { createSchedulerTools, type SchedulerToolContext, SCHEDULE_WAKEUP_TOOL_NAME, AUTONOMOUS_LOOP_SENTINEL, AUTONOMOUS_LOOP_DYNAMIC_SENTINEL, } from "./tools/scheduler-tools.js";
146
148
  export { resolveAutonomousLoopPrompt, AUTONOMOUS_LOOP_PREAMBLE, AUTONOMOUS_LOOP_PREAMBLE_PERSISTENT, type AutonomousLoopPromptOptions, } from "./tools/loop-tick.js";
147
149
  export { tightenTaskSpec, TaskSpecTightenError } from "./core/tighten-task-spec.js";
148
- export { createAllowDenyPolicy, createApprovalPolicy, COARSE_SHELL_TOOLS, createCoarseCommandNamePolicy, createTranscriptIntegrityPolicy, createUnverifiableDeletePolicy, findUnverifiableRecursiveDelete, combinePolicies, decisionText, resolveAsk, toolPolicyNameSets, type ToolPolicyNameSets, type NamedToolPolicy, type ToolPolicyProjection, type ToolPolicyProjectionComponent, type ConstraintChainEntry, checkToolPolicyProjection, constraintChainEntryOf, constraintChainDigest, type ToolPolicy, type ToolCallRequest, type PermissionResult, type DecisionReason, type ApprovalSettledBy, APPROVAL_SETTLED_BY_VALUES, isApprovalSettledBy, type AskDenyResolution, ASK_DENY_RESOLUTION_VALUES, isAskDenyResolution, screenApproverAttribution, APPROVER_ATTRIBUTION_MAX_CHARS, type OnAsk, type AskOutcome, type ResolvedAsk, type AskRequest, type AskDelegationProvenance, type AskRuleEvidence, type AskEvidenceAbsence, ASK_EVIDENCE_ABSENCE_VALUES, } from "./core/tool-policy.js";
149
- export { type AskOrigin, ASK_ORIGINS, isAskOrigin, classifierMayAnswer } from "./core/ask-origin.js";
150
+ export { createAllowDenyPolicy, createApprovalPolicy, COARSE_SHELL_TOOLS, createCoarseCommandNamePolicy, createTranscriptIntegrityPolicy, createUnverifiableDeletePolicy, findUnverifiableRecursiveDelete, combinePolicies, decisionText, resolveAsk, toolPolicyNameSets, type ToolPolicyNameSets, type NamedToolPolicy, type ToolPolicyProjection, type ToolPolicyProjectionComponent, type ConstraintChainEntry, checkToolPolicyProjection, constraintChainEntryOf, constraintChainDigest, type ToolPolicy, type ToolCallRequest, type PermissionResult, type DecisionReason, screenApproverAttribution, APPROVER_ATTRIBUTION_MAX_CHARS, type OnAsk, type AskOutcome, type ResolvedAsk, type AskRequest, type AskDelegationProvenance, type AskRuleEvidence, type AskEvidenceAbsence, ASK_EVIDENCE_ABSENCE_VALUES, } from "./core/tool-policy.js";
151
+ export { type AskOrigin, ASK_ORIGINS, isAskOrigin, classifierMayAnswer, ORIGIN_IMPLIES_REAL_APPROVAL } from "./core/ask-origin.js";
152
+ export { SETTLEMENT_KINDS, type SettlementKind, isSettlementKind, type Settlement, SETTLEMENT_IS_REFUSAL, DENIED_BY_VALUES, type DeniedBy, isDeniedBy, DENIED_BY_MAY_VETO, type GateDisposition, type GateOutcome, screenGateOutcome } from "./core/gate-outcome.js";
150
153
  export { type AskCarry } from "./core/hooks.js";
151
154
  export { parseAutoModeResponse, createAutoModeDecider, type AutoModeVerdict, type AutoModeDecider, type AutoModeDeciderOptions, type AutoModeClassifyFn, type AutoModeClassifyInput, createAutoModeDenialTracker, denialLimitFallbackMessage, denialLimitSentence, unarmedWindow, type AutoModeDenialTracker, type AutoModeDenialLimitOptions, type DenialLimitCounts, type DenialLimitFallbackFace, type UnarmedDenialLimitFallback, type DenialLimitFallback, type DenialLimitVerdict, } from "./core/auto-mode.js";
152
155
  export { AUTO_MODE_DENIAL_LIMIT_DEFAULTS, AUTO_MODE_DENIAL_AUTO_DENY_DEFAULT_MS } from "./core/auto-mode-defaults.js";
@@ -182,7 +185,7 @@ export { FileDurableRulePartitionProvider, ORG_STATE_FILE } from "./stores/file/
182
185
  export { adoptFilePermissionRuleStore, type AdoptFileRuleStoreResult } from "./stores/file/permission-rule-adopt.js";
183
186
  export { AdoptionError, assertAdoptionBootGate, readRootAdoptionFile, writeRootAdoptionFile, ROOT_ADOPTION_FILE, type AdoptionErrorCode, type AdoptionSource, type AdoptionReport, type AdoptionReceipt, type AdoptionLegReport, type AffectedDeploymentConfig, type RootAdoptionFile, } from "./stores/file/adoption/marker.js";
184
187
  export { adoptLocalDataRoot, ackAdoptionConfig, witnessAdoptionConfig, listAdoptionQuarantine, readAdoptionStatus, type AdoptionStatus, type AdoptLocalDataRootOptions, type AdoptLocalDataRootResult, type AdoptionCarriageLeg, type AdoptionCarriageLegContext, type AdoptionConfigWitnessReceipt, } from "./stores/file/adoption/adopt.js";
185
- export { formatHookFeedback, runToolGate, createHookEnvCapabilities, createPreToolUseConstraintPolicy, type PersistedRuleHit, type PersistedRuleHitRule, type PersistedRuleUnreadable, type PersistedRuleCoverage, type PersistedRuleAnswer, normalizePersistedRuleHit, type Hooks, type HookToolContext, type HookInvocationIdentity, type UserPromptSubmitContext, type PostToolBatchContext, type HookEnvCapabilities, type HookToolOutput, type PreToolUseResult, type PostToolUseResult, type UserPromptSubmitResult, type HookToolFailure, type PostToolUseFailureResult, type PostToolBatchCall, type PostToolBatchResult, type PreCompactContext, type PreCompactResult, type PostCompactContext, type StopFailureContext, type PermissionDeniedPayload, type PermissionDeniedSource, } from "./core/hooks.js";
188
+ export { formatHookFeedback, runToolGate, createHookEnvCapabilities, createPreToolUseConstraintPolicy, type PersistedRuleHit, type PersistedRuleHitRule, type PersistedRuleUnreadable, type PersistedRuleCoverage, type PersistedRuleAnswer, normalizePersistedRuleHit, type Hooks, type HookToolContext, type HookInvocationIdentity, type UserPromptSubmitContext, type PostToolBatchContext, type HookEnvCapabilities, type HookToolOutput, type PreToolUseResult, type PostToolUseResult, type UserPromptSubmitResult, type HookToolFailure, type PostToolUseFailureResult, type PostToolBatchCall, type PostToolBatchResult, type PreCompactContext, type PreCompactResult, type PostCompactContext, type StopFailureContext, type PermissionDeniedPayload, } from "./core/hooks.js";
186
189
  export { InMemoryMemoryStore, composeMemoryBlock, composeLayeredMemoryBlock, normalizeMemorySpec, type NormalizedMemorySpec, type MemorySpecInput, supportsConsolidation, supportsPeriodicConsolidation, firstSentence, expandLexicalTerms, lexicalSearchMatch, type Embedder, classifyPromotable, enforcePromotableWriteGate, guardedMemoryStore, MemoryGateError, detectSecret, enforceSecretWriteGate, enforceStructuredNoteSecretGate, type UtilityGate, type MemoryStore, type MemoryVectorMode, type ScoredMemory, type MemoryNoteHeader, type MemoryNoteRecord, type MemoryNoteType, type StructuredNoteInput, } from "./core/memory.js";
187
190
  export { MemoryEngine, FileMemoryEngineBackend, memoryBackendContract, assertMemoryBackendSearchEquivalence, type MemoryBackendContractHooks, buildMemoryInstruction, truncateIndex, scanEntryFiles, deriveRepoKey, deriveRepoMemoryDir, deriveControlPlaneDir, deriveRepoControlPlaneDir, resolveMemoryEngineRoot, scopeDirName, ControlPlaneCorruptError, parseEntryFile, serializeEntryFile, computeEntryRev, entryFromFile, MEMORY_ORIGIN_CAUSES, committedOriginOf, originEquals, consolidationExposedFrontmatter, ambiguousOriginRepresentation, type OriginClearanceRow, type OriginClearanceEvent, type OriginClearanceShadow, committedDistilledOf, distilledEquals, type MemoryEntryDistilled, type MemoryEntryDistilledInput, CONSOLIDATION_DEFAULTS, ConsolidationRefusedError, MEMORY_SEARCH_SUPERSEDED_TAG, consolidationTypeEligible, deriveSupersededSet, memorySupersededNote, readIntentCredentials, supersessionFuseCeiling, memoryConsolidationRecommendedNotice, memoryConsolidationCommittedNotice, memoryConsolidationConflictNotice, memoryConsolidationIncompleteNotice, memoryConsolidationRefusedNotice, memoryConsolidationWithheldNotice, type ConsolidationGateRead, type ConsolidationGateRow, type ConsolidationIntent, type ConsolidationIntentCredentialRow, type ConsolidationLeaseSeat, type ConsolidationProductProposal, type ConsolidationProposal, type MemoryConsolidationOptions, type ConsolidationCommitReceipt, type ConsolidationReconcileReport, type ConsolidationResolveReceipt, type ConsolidationPlanSummary, type ConsolidationPlanFoldEvidence, type SessionMemoryStatus, DISTILLER_DEFAULT_MAX_INPUTS_PER_PRODUCT, LLM_DISTILLER_CONTRACT, LLM_DISTILLER_CONTRACT_DL2, LLM_DISTILLER_CONTRACT_DL3, LLM_DISTILLER_CONTRACTS, MEMORY_DISTILLER_CONTRACT_V1, contractGroupingDiff, driveConsolidationToFixpoint, isAliasModelId, llmPlanDistiller, mintExposurePartitionedPlan, mintLlmConsolidationPlan, MEMORY_DISTILLER_PURITY_CONTRACT_V1, detectCleanArmVerbatimLeak, type CleanArmLeakFinding, type CleanArmLeakVerdict, type MemoryDistillerPurityContract, openAiCompatChatSeat, parseJsonAnswer, planParseRepairs, sanitizeLlmGroups, scheduleUnderFuse, type ConsolidationDistillFn, type ConsolidationDriveCycleRow, type ConsolidationDriveEngine, type ConsolidationDriveResult, type ConsolidationFoldState, type DistillerCandidate, type DistillerChatAnswer, type DistillerChatFn, type DistillerChatRequest, type FuseSchedule, type LlmConsolidationPlan, type LlmConsolidationPlanArm, type LlmConsolidationPlanProduct, type LlmDistillerContract, type MintLlmConsolidationPlanResult, type PlanParseRepairs, type SanitizedLlmGroups, CONSOLIDATION_DRIVER_PLANS_DIR, CONSOLIDATION_DRIVER_RUNS_FILE, CONSOLIDATION_RUN_STOP_REASONS, archiveDistillerPlan, readConsolidationDriverRun, runMemoryConsolidationDriver, type ConsolidationDriverEngine, type ConsolidationDriverRunRow, type ConsolidationRunReceipt, type ConsolidationRunStopReason, type RunMemoryConsolidationOptions, isInstructionEntry, type MemoryEntryOrigin, type MemoryOriginCause, MEMORY_INSTRUCTION_TEMPLATE, MEMORY_RECALL_DISCIPLINE, MEMORY_PREFERENCE_DISCIPLINE, MEMORY_READONLY_NOTICE, MEMORY_CAPTURE_OPTOUT_NOTICE, memoryCaptureOptedOutNotice, memoryCaptureOptOutUnpersistedNotice, SESSION_CAPTURE_OPTOUT_DIR, markSessionCaptureOptOut, readSessionCaptureOptOut, listSessionCaptureOptOut, fileSessionCaptureRecordStore, type SessionCaptureOptOutRecord, type SessionCaptureOptOutMarkOutcome, type SessionCaptureRecordStore, readV2HeaderHints, type V2HeaderHints, LINEAGE_FILE, CHALLENGES_FILE, CHALLENGED_HISTORY_FILE, CHALLENGE_LEDGER_MAX_EVENTS, rebuildStrictControlPlaneLedger, type ControlPlaneRebuildReceipt, type StrictControlPlaneLedger, type ChallengeAssignment, type ChallengeEvent, type ChallengedHistoryRow, type LineagePendingTxn, type LineagePromotion, MEMORY_INDEX_FILENAME, MEMORY_INDEX_MAX_LINES, MEMORY_INDEX_MAX_BYTES, MEMORY_SEARCH_TOOL_NAME, MEMORY_GET_TOOL_NAME, MEMORY_INDEX_TOOL_NAME, MEMORY_ENGINE_TOOL_NAMES, type MemorySearchDetails, type MemorySearchHit, type CleanMemorySearchHit, type ExposedMemorySearchHit, MEMORY_EXPOSURE_BANNER, MEMORY_EXPOSURE_HANDLE_TAG, memoryExposureIndexRow, type MemoryGetDetails, type MemoryIndexDetails, type MemoryIndexRow, type CleanMemoryIndexRow, type ExposedMemoryIndexRow, STUB_ARCHIVED_LINE, DEFAULT_MAX_MEMORY_FILES, DEFAULT_MAX_ENTRY_DEPTH, DEFAULT_HARVEST_DEADLINE_MS, DEFAULT_HARVEST_FILE_BUDGET, MASS_DELETION_FUSE_RATIO, scanMemoryWrite, scanMemoryFileName, scanRemediation, MEMORY_FILENAME_SEGMENT_RE, renderAnnouncements, enqueueMemoryAnnouncement, drainMemoryAnnouncements, peekMemoryAnnouncements, bumpScanFuse, scanFuseCount, clearScanFuse, ANNOUNCEMENTS_FILE, MEMORY_ANNOUNCEMENTS_MAX, SCAN_FUSE_FILE, SCAN_FUSE_THRESHOLD, type MemoryAnnouncement, type ScanFinding, type MemoryEngineOptions, type MemoryInjection, type EntryProvenanceAccount, type TransferEvidence, type CommittedBinding, type CommittedEntrySnapshot, type CommittedScopeSnapshots, type EntryCustodyReport, erasureSelectHash, type EraseMemoryEntriesInput, type ErasureSelect, type ErasedBinding, type MemoryErasureAttestation, computeMemoryBundleHash, type MemoryExportBundle, type MemoryImportReport, type MemoryExportSnapshot, type MemoryBundleImportPlan, type BundleChallengeRow, type BundleLineageRow, type BundlePollutedSession, type MemoryBackend, type MemoryEntry, type MemoryEntryFrontmatter, type MemoryEntryHeader, type MemoryScopeEnumeration, type ScoredMemoryEntry, type NotePatch, type PatchReport, type MaterializedFile, type MemorySessionHandle, type HarvestReport, type HarvestRejection, type HarvestRejectionCode, type ParsedEntryFile, type ScannedEntryFile, SCOPE_SEGMENT_MAX_ENCODED, PROJECT_MARKER_PATH, encodeScopeSegment, decodeScopeSegment, parseScopeKey, formatUserScope, formatOrgScope, formatProjScope, formatUserProjScope, isPersonalScope, assertScopeContractPlacement, formatProjectMarker, parseProjectMarker, resolveProjectId, PROJECT_ID_REGEX, type ParsedScopeKey, migrateScope, type MigrateScopeReport, materializeEntriesToFiles, harvestFilesToPatches, projectionsToWriteBack, screenInboundEntries, REMOTE_HARVEST_PER_FILE_BYTES, REMOTE_MASS_DELETION_FUSE_RATIO, type RemoteMemoryFile, type RemoteMemoryBaseline, type RemoteMaterialization, type RemoteHarvestResult, type InboundEntryFinding, deriveProjectMemoryDir, deriveProjectControlDir, recordProjectIdHint, lookupProjectIdHint, PROJECT_ID_HINTS_FILE, reconcileMemoryEntries, nextSyncBaseline, mergeRecallHits, type MemorySyncCursor, type MemorySyncConflict, type MemorySyncPlan, type RecallSource, syncMemoryScope, type MemorySyncTransport, type MemorySyncRequestBody, type MemorySyncResponseBody, type MemorySyncClientConflict, type SyncMemoryScopeOptions, type MemorySyncClientResult, } from "./core/memory-engine/index.js";
188
191
  export { SHARED_MEMORY_READ_CAP_BYTES, SHARED_MEMORY_LIST_PAGE_SIZE, SharedMemoryStoreError, type SharedMemoryStoreProvider, type SharedMemoryStoreReader, type SharedMemoryPagedList, type SharedMemoryStoreInfo, type SharedMemoryDocumentEntry, type SharedMemorySnapshot, type SharedMemoryRequestContext, type MemoryListDetails, type MemoryReadDetails, } from "./core/shared-memory/types.js";
@@ -220,7 +223,7 @@ export { devWorkflowScriptRunner } from "./orchestration/dev-vm-script-runner.js
220
223
  export { parseWorkflowMeta, splitWorkflowMeta, WorkflowScriptError, workflowScriptReadsClockOrRandom } from "./orchestration/workflow-meta.js";
221
224
  export { assertWorkflowSandboxConformance, assertWorkflowPrimitivesWiring, assertWorkflowDeterminism } from "./orchestration/workflow-sandbox-conformance.js";
222
225
  export { WorkflowModelNotAllowedError, type WorkflowAgentSpec } from "./orchestration/workflow-governance.js";
223
- export { WorkflowMaxAgentsError, WorkflowResultTooLargeError } from "./orchestration/workflow.js";
226
+ export { WorkflowMaxAgentsError, WorkflowResultTooLargeError, WorkflowJournalIncompatibleError } from "./orchestration/workflow.js";
224
227
  export { createFileWorkflowScriptStore, mergeWorkflowArgs, type WorkflowScriptStore, type NamedWorkflowResolution, type NamedWorkflowListing, } from "./orchestration/workflow-script-store.js";
225
228
  export { DISCUSSION_WORKFLOW_NAME, DISCUSSION_SCRIPT, TEAM_DISCUSSION_WORKFLOW_NAME, TEAM_DISCUSSION_SCRIPT, canonicalWorkflowName, retiredWorkflowNameAliases, builtinWorkflowDefinitions, builtinWorkflowListings, resolveBuiltinWorkflow, type BuiltinWorkflowDefinition, } from "./orchestration/builtin-workflows.js";
226
229
  export { WORKFLOW_AGENT_STALL_MS, WORKFLOW_AGENT_MAX_RETRIES, WORKFLOW_AGENT_THROTTLE_BACKOFF_MS } from "./orchestration/workflow.js";
@@ -293,7 +296,7 @@ export { ROUTE_ADJUDICATION_CONFORMANCE_CORPUS, type RouteAdjudicationVector } f
293
296
  export { type BrainTimeoutConfig } from "./brain/timeout.js";
294
297
  export { createAssistantMessageEventStream } from "./internal/llm.js";
295
298
  export type { AssistantMessage, AssistantMessageEvent, CompleteSimpleFn, Context, DocumentContent, ImageContent, Message, StopReason, StreamFn, TextContent, ThinkingContent, ToolCall, ToolResultMessage, Usage, UserMessage, } from "./internal/llm.js";
296
- export type { AgentDefinition, BeforeWriteHook, BeforeWriteRequest, BeforeWriteResult, TrackFileEditHook, TrackEditRequest, TrackEditResult, FileEditedHook, FileEditedNotice, HandsBandOptions, Brain, BrainStatus, BrainStatusPhase, BrainRetryErrClass, ImageInput, McpElicitRequest, McpElicitResponse, McpServerSpec, A2aServerSpec, OnElicit, Model, ModelRef, ProjectMemoryLoad, RunnerDeps, ResumePreflightInfo, ResumePreflightVerdict, EngineNotice, RuntimeCaps, BackgroundChildEvent, DelegationLifecycleEvent, SkillManifest, SkillSpec, TaskEvent, TaskEventIdentity, ToolActivity, TaskLimits, StaleToolResultOffloadOptions, TaskResult, EffectiveMemoryScopes, RemoteEnvFailureNote, TaskSpec, TaskStatus, TaskStream, CompactOutcome, ThinkingLevel, ToolExecuteContext, ToolReturn, ToolSpec, ToolInputVerdict, ToolInputValidationContext, ReversibilityVerdict, ToolEffect, ToolContentOrigin, WorkflowGovernanceBaseline, DelegationTaskType, } from "./core/types.js";
299
+ export type { AgentDefinition, BeforeWriteHook, BeforeWriteRequest, BeforeWriteResult, TrackFileEditHook, TrackEditRequest, TrackEditResult, FileEditedHook, FileEditedNotice, HandsBandOptions, Brain, BrainStatus, BrainStatusPhase, BrainRetryErrClass, ImageInput, McpElicitRequest, McpElicitResponse, McpServerSpec, A2aServerSpec, OnElicit, Model, ModelRef, ProjectMemoryLoad, RunnerDeps, ResumePreflightInfo, ResumePreflightVerdict, EngineNotice, RuntimeCaps, BackgroundChildEvent, DelegationLifecycleEvent, SkillManifest, SkillSpec, TaskEvent, TaskEventIdentity, ToolActivity, TaskLimits, StaleToolResultOffloadOptions, TaskResult, TerminalCause, PausedCause, EffectiveMemoryScopes, RemoteEnvFailureNote, TaskSpec, TaskStatus, TaskStream, CompactOutcome, ThinkingLevel, ToolExecuteContext, ToolReturn, ToolSpec, ToolInputVerdict, ToolInputValidationContext, ReversibilityVerdict, ToolEffect, ToolContentOrigin, WorkflowGovernanceBaseline, DelegationTaskType, } from "./core/types.js";
297
300
  export { Type } from "typebox";
298
301
  export type { TSchema, Static } from "typebox";
299
302
  export { explainPromptAssembly, describeDefaultPack, type DefaultPackDescription, type ExplainInput } from "./prompt-assembly/explain.js";
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  export { Runner, runTask } from "./core/runner/runtask.js";
2
2
  export { resolveTaskLimits } from "./core/runner/prepare-task.js";
3
+ export { terminalProjection } from "./core/runner/terminal-projection.js";
3
4
  export { SESSION_LOG_DIGEST_SCHEME, sessionEntryDigest, sessionLogDigest, sessionLogDigestsComparable, } from "./engine/session/log-digest.js";
4
5
  export { defineTool } from "./core/tools.js";
5
6
  export { SKILL_TOOL_NAME } from "./core/runner/synthetic-tools.js";
@@ -38,7 +39,7 @@ export { decideAutoPromote, deriveTripwire, FROZEN_DENYLIST_FLOOR, } from "./cor
38
39
  export { runCascade, } from "./agents/cascade.js";
39
40
  export { pgQuery, mysqlQuery, sqliteQuery } from "./tools/sql-adapters.js";
40
41
  export { materializeMcpTools, MCP_PREFIX } from "./core/mcp.js";
41
- export { MCP_FAILURE_CODES, mcpFailureCodeOf } from "./core/mcp.js";
42
+ export { MCP_FAILURE_KINDS, MCP_DELIVERY_VERDICTS, classifyMcpFailure } from "./core/mcp-failure.js";
42
43
  export { materializeA2aTools, A2aRpcError } from "./core/a2a.js";
43
44
  export { PROTOCOL_TABLE, MCP_NAMESPACE, A2A_NAMESPACE, protocolOf } from "./core/protocol-table.js";
44
45
  export { InMemorySessionPolicyStore, SessionPolicyError, loosenReasons, normalizeRules, stripRev, } from "./core/session-policy-store.js";
@@ -76,7 +77,8 @@ export { READ_FACE_DEFAULT_DENY_ENTRIES, READ_FACE_BUILTIN_DENY_TABLE, READ_DENY
76
77
  export { deploymentReadFaceClampNotice, resolveReadFace } from "./tools/fs/index.js";
77
78
  export { WRITE_PROTECTED_DEFAULT_TABLE, resolveWriteProtectedTable, compileWriteProtection, } from "./core/write-protect.js";
78
79
  export { InMemoryToolResultStore, OFFLOAD_TOOL_NAME, DEFAULT_TOOL_RESULT_THRESHOLD_CHARS, assertSafeToolResultRef, buildToolResultRef, toolResultContentSegment, MAX_MINTED_TOOL_RESULT_REF_CHARS, assertToolResultProvenanceMatch, normalizeToolResultProvenance, toolResultProvenanceOf, ToolResultRefConflictError, TOOL_RESULT_REF_CONFLICT_CODE, } from "./core/tool-result-store.js";
79
- export { InMemoryCheckpointStore, CheckpointError, mintCheckpointId, mintCheckpointToken, checkpointVersionOf, CURRENT_CHECKPOINT_VERSION, MAX_SUPPORTED_CHECKPOINT_VERSION, ORG_ADMISSION_CHECKPOINT_VERSION, F012_CHECKPOINT_VERSION, REAL_APPROVAL_CHECKPOINT_VERSION, RESOURCE_CHECKPOINT_VERSION, TOKEN_CHECKPOINT_VERSION, debitLedger, remainingBudgetMicroUsd, remainingTokens, winnerFromOutcome, validatePendingSteer, readPendingSteerQueue, appendPendingSteer, MAX_PENDING_STEER_CHARS, MAX_PENDING_STEER_ENTRIES, PENDING_STEER_QUEUE_BYTE_BUDGET_BYTES, PENDING_STEER_FROZEN_FIELDS, ACTOR_ASSERTION_FROZEN_FIELDS, MAX_ACTOR_FIELD_CHARS, MAX_STEER_INPUT_ID_CHARS, LEGACY_PENDING_STEER_INPUT_ID, riskSeverity, buildRiskDescriptor, summarizeCheckpoint, } from "./core/checkpoint-store.js";
80
+ export { InMemoryCheckpointStore, CheckpointError, mintCheckpointId, mintCheckpointToken, checkpointVersionOf, CURRENT_CHECKPOINT_VERSION, MAX_SUPPORTED_CHECKPOINT_VERSION, ORG_ADMISSION_CHECKPOINT_VERSION, F012_CHECKPOINT_VERSION, REAL_APPROVAL_CHECKPOINT_VERSION, RESOURCE_CHECKPOINT_VERSION, TOKEN_CHECKPOINT_VERSION, debitLedger, remainingBudgetMicroUsd, remainingTokens, winnerFromOutcome, validatePendingSteer, readPendingSteerQueue, appendPendingSteer, MAX_PENDING_STEER_CHARS, MAX_PENDING_STEER_ENTRIES, PENDING_STEER_QUEUE_BYTE_BUDGET_BYTES, PENDING_STEER_FROZEN_FIELDS, ACTOR_ASSERTION_FROZEN_FIELDS, MAX_ACTOR_FIELD_CHARS, MAX_STEER_INPUT_ID_CHARS, LEGACY_PENDING_STEER_INPUT_ID, riskSeverity, buildRiskDescriptor, summarizeCheckpoint, realApprovalOrgFact, resolveCheckpointStore, } from "./core/checkpoint-store.js";
81
+ export { PAUSE_REGISTRY, isGateKind, resumeGateMatches, pauseOf, checkpointFrom } from "./core/pause-registry.js";
80
82
  export { InMemoryUsageWindowStore, GLOBAL_USAGE_KEY, EMPTY_USAGE_WINDOW_RECORD, chargeUsageRecord, readUsageRecord, usageRetryAfterMs, resolveUsageWindows, } from "./core/usage-window-store.js";
81
83
  export { FileUsageWindowStore } from "./stores/file/usage-window-store.js";
82
84
  export { ENV_LIFETIME_SUSPEND_MARGIN_MS, USAGE_WINDOW_REAP_MARGIN_MS } from "./core/runner/prepare-task.js";
@@ -120,8 +122,9 @@ export { hasScheduler, isValidCronExpr, SchedulerError } from "./core/scheduler.
120
122
  export { createSchedulerTools, SCHEDULE_WAKEUP_TOOL_NAME, AUTONOMOUS_LOOP_SENTINEL, AUTONOMOUS_LOOP_DYNAMIC_SENTINEL, } from "./tools/scheduler-tools.js";
121
123
  export { resolveAutonomousLoopPrompt, AUTONOMOUS_LOOP_PREAMBLE, AUTONOMOUS_LOOP_PREAMBLE_PERSISTENT, } from "./tools/loop-tick.js";
122
124
  export { tightenTaskSpec, TaskSpecTightenError } from "./core/tighten-task-spec.js";
123
- export { createAllowDenyPolicy, createApprovalPolicy, COARSE_SHELL_TOOLS, createCoarseCommandNamePolicy, createTranscriptIntegrityPolicy, createUnverifiableDeletePolicy, findUnverifiableRecursiveDelete, combinePolicies, decisionText, resolveAsk, toolPolicyNameSets, checkToolPolicyProjection, constraintChainEntryOf, constraintChainDigest, APPROVAL_SETTLED_BY_VALUES, isApprovalSettledBy, ASK_DENY_RESOLUTION_VALUES, isAskDenyResolution, screenApproverAttribution, APPROVER_ATTRIBUTION_MAX_CHARS, ASK_EVIDENCE_ABSENCE_VALUES, } from "./core/tool-policy.js";
124
- export { ASK_ORIGINS, isAskOrigin, classifierMayAnswer } from "./core/ask-origin.js";
125
+ export { createAllowDenyPolicy, createApprovalPolicy, COARSE_SHELL_TOOLS, createCoarseCommandNamePolicy, createTranscriptIntegrityPolicy, createUnverifiableDeletePolicy, findUnverifiableRecursiveDelete, combinePolicies, decisionText, resolveAsk, toolPolicyNameSets, checkToolPolicyProjection, constraintChainEntryOf, constraintChainDigest, screenApproverAttribution, APPROVER_ATTRIBUTION_MAX_CHARS, ASK_EVIDENCE_ABSENCE_VALUES, } from "./core/tool-policy.js";
126
+ export { ASK_ORIGINS, isAskOrigin, classifierMayAnswer, ORIGIN_IMPLIES_REAL_APPROVAL } from "./core/ask-origin.js";
127
+ export { SETTLEMENT_KINDS, isSettlementKind, SETTLEMENT_IS_REFUSAL, DENIED_BY_VALUES, isDeniedBy, DENIED_BY_MAY_VETO, screenGateOutcome } from "./core/gate-outcome.js";
125
128
  export {} from "./core/hooks.js";
126
129
  export { parseAutoModeResponse, createAutoModeDecider, createAutoModeDenialTracker, denialLimitFallbackMessage, denialLimitSentence, unarmedWindow, } from "./core/auto-mode.js";
127
130
  export { AUTO_MODE_DENIAL_LIMIT_DEFAULTS, AUTO_MODE_DENIAL_AUTO_DENY_DEFAULT_MS } from "./core/auto-mode-defaults.js";
@@ -179,7 +182,7 @@ export { devWorkflowScriptRunner } from "./orchestration/dev-vm-script-runner.js
179
182
  export { parseWorkflowMeta, splitWorkflowMeta, WorkflowScriptError, workflowScriptReadsClockOrRandom } from "./orchestration/workflow-meta.js";
180
183
  export { assertWorkflowSandboxConformance, assertWorkflowPrimitivesWiring, assertWorkflowDeterminism } from "./orchestration/workflow-sandbox-conformance.js";
181
184
  export { WorkflowModelNotAllowedError } from "./orchestration/workflow-governance.js";
182
- export { WorkflowMaxAgentsError, WorkflowResultTooLargeError } from "./orchestration/workflow.js";
185
+ export { WorkflowMaxAgentsError, WorkflowResultTooLargeError, WorkflowJournalIncompatibleError } from "./orchestration/workflow.js";
183
186
  export { createFileWorkflowScriptStore, mergeWorkflowArgs, } from "./orchestration/workflow-script-store.js";
184
187
  export { DISCUSSION_WORKFLOW_NAME, DISCUSSION_SCRIPT, TEAM_DISCUSSION_WORKFLOW_NAME, TEAM_DISCUSSION_SCRIPT, canonicalWorkflowName, retiredWorkflowNameAliases, builtinWorkflowDefinitions, builtinWorkflowListings, resolveBuiltinWorkflow, } from "./orchestration/builtin-workflows.js";
185
188
  export { WORKFLOW_AGENT_STALL_MS, WORKFLOW_AGENT_MAX_RETRIES, WORKFLOW_AGENT_THROTTLE_BACKOFF_MS } from "./orchestration/workflow.js";