@sema-agent/core 7.62.0 → 7.64.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.
- package/CHANGELOG.md +936 -0
- package/dist/agents/cc-peer-directory.js +1 -0
- package/dist/agents/cc-peer-wire.d.ts +4 -0
- package/dist/agents/cc-peer-wire.js +1 -0
- package/dist/agents/cc-uds-peer-channel.js +5 -0
- package/dist/agents/cross-session-judge.d.ts +3 -1
- package/dist/agents/cross-session-judge.js +4 -1
- package/dist/agents/peer-directory.d.ts +8 -0
- package/dist/agents/peer-directory.js +4 -0
- package/dist/agents/peer-held-queue.d.ts +9 -3
- package/dist/agents/peer-held-queue.js +12 -9
- package/dist/agents/peer-idle.d.ts +20 -1
- package/dist/agents/peer-idle.js +23 -12
- package/dist/agents/peer-notice-route.d.ts +16 -5
- package/dist/agents/peer-notice-route.js +11 -9
- package/dist/agents/peer-notices.d.ts +25 -8
- package/dist/agents/peer-notices.js +6 -1
- package/dist/agents/peer-session-drain.d.ts +32 -6
- package/dist/agents/peer-session-drain.js +100 -26
- package/dist/agents/send-message-tool.d.ts +7 -0
- package/dist/agents/send-message-tool.js +18 -6
- package/dist/agents/subagent-transcript-placement.d.ts +23 -0
- package/dist/agents/subagent-transcript-placement.js +14 -0
- package/dist/agents/subagent.js +102 -54
- package/dist/brain/route-adjudicator.js +9 -4
- package/dist/core/allow-entry.d.ts +4 -0
- package/dist/core/approval-object.js +1 -1
- package/dist/core/arg-summary.js +1 -1
- package/dist/core/ask-origin.d.ts +1 -1
- package/dist/core/ask-origin.js +2 -2
- package/dist/core/ask-question.d.ts +2 -2
- package/dist/core/ask-unresolvable-notice.d.ts +13 -4
- package/dist/core/ask-unresolvable-notice.js +10 -3
- package/dist/core/auto-compaction.d.ts +7 -5
- package/dist/core/background-agent-store.d.ts +7 -0
- package/dist/core/background-agent-store.js +3 -0
- package/dist/core/canonical-json.d.ts +23 -13
- package/dist/core/canonical-json.js +4 -4
- package/dist/core/checkpoint-queries.d.ts +50 -4
- package/dist/core/checkpoint-queries.js +42 -17
- package/dist/core/checkpoint-requirements.d.ts +3 -3
- package/dist/core/checkpoint-requirements.js +2 -1
- package/dist/core/checkpoint-row-verdict.d.ts +15 -4
- package/dist/core/checkpoint-row-verdict.js +22 -2
- package/dist/core/checkpoint-store.d.ts +28 -11
- package/dist/core/checkpoint-store.js +45 -4
- package/dist/core/compliance.d.ts +6 -2
- package/dist/core/compliance.js +3 -3
- package/dist/core/context-settings.d.ts +40 -9
- package/dist/core/context-settings.js +32 -10
- package/dist/core/engine-attestation.d.ts +27 -7
- package/dist/core/engine-attestation.js +5 -1
- package/dist/core/engine-notice.d.ts +43 -5
- package/dist/core/extension-requester.d.ts +9 -0
- package/dist/core/extension-requester.js +7 -0
- package/dist/core/file-history-store.d.ts +28 -0
- package/dist/core/file-history-store.js +48 -5
- package/dist/core/fs-write-gate-policy.js +1 -1
- package/dist/core/gate-fold.js +2 -0
- package/dist/core/gate-lanes.js +2 -0
- package/dist/core/gate-outcome.d.ts +39 -2
- package/dist/core/gate-outcome.js +20 -1
- package/dist/core/git-worktree-env.d.ts +62 -3
- package/dist/core/git-worktree-env.js +91 -30
- package/dist/core/governance-codes.d.ts +9 -3
- package/dist/core/governance-codes.js +17 -3
- package/dist/core/leg-identity.d.ts +19 -1
- package/dist/core/leg-identity.js +12 -0
- package/dist/core/mailbox-store.d.ts +39 -4
- package/dist/core/mailbox-store.js +14 -2
- package/dist/core/memory-engine/consolidation-driver.d.ts +32 -17
- package/dist/core/memory-engine/consolidation-driver.js +99 -98
- package/dist/core/memory-engine/consolidation.d.ts +74 -10
- package/dist/core/memory-engine/consolidation.js +183 -11
- package/dist/core/memory-engine/control-objects.d.ts +25 -0
- package/dist/core/memory-engine/control-objects.js +151 -0
- package/dist/core/memory-engine/control-plane-adoption.d.ts +48 -0
- package/dist/core/memory-engine/control-plane-adoption.js +159 -0
- package/dist/core/memory-engine/data-plane.d.ts +8 -4
- package/dist/core/memory-engine/data-plane.js +11 -6
- package/dist/core/memory-engine/delegation-settlement.d.ts +58 -40
- package/dist/core/memory-engine/delegation-settlement.js +270 -85
- package/dist/core/memory-engine/dual-root.d.ts +12 -6
- package/dist/core/memory-engine/dual-root.js +11 -7
- package/dist/core/memory-engine/engine.d.ts +136 -58
- package/dist/core/memory-engine/engine.js +491 -394
- package/dist/core/memory-engine/entry-scan.d.ts +8 -0
- package/dist/core/memory-engine/entry-scan.js +3 -0
- package/dist/core/memory-engine/file-backend.d.ts +62 -60
- package/dist/core/memory-engine/file-backend.js +122 -198
- package/dist/core/memory-engine/index.d.ts +8 -7
- package/dist/core/memory-engine/index.js +7 -6
- package/dist/core/memory-engine/landing-admission.d.ts +5 -3
- package/dist/core/memory-engine/landing-admission.js +3 -3
- package/dist/core/memory-engine/layout.d.ts +127 -46
- package/dist/core/memory-engine/layout.js +264 -109
- package/dist/core/memory-engine/memory-backend-contract.d.ts +26 -1
- package/dist/core/memory-engine/memory-backend-contract.js +476 -0
- package/dist/core/memory-engine/memory-deployment.d.ts +42 -11
- package/dist/core/memory-engine/memory-deployment.js +54 -15
- package/dist/core/memory-engine/origin-clearance.d.ts +12 -3
- package/dist/core/memory-engine/origin-clearance.js +68 -9
- package/dist/core/memory-engine/scope-contract.d.ts +52 -11
- package/dist/core/memory-engine/scope-contract.js +68 -19
- package/dist/core/memory-engine/session-write-home.d.ts +37 -2
- package/dist/core/memory-engine/session-write-home.js +38 -11
- package/dist/core/memory-engine/sync-client.d.ts +3 -1
- package/dist/core/memory-engine/sync-client.js +7 -0
- package/dist/core/memory-engine/sync-report.d.ts +3 -2
- package/dist/core/memory-engine/sync-report.js +6 -2
- package/dist/core/memory-engine/tools.d.ts +2 -2
- package/dist/core/memory-engine/tools.js +10 -10
- package/dist/core/memory-engine/types.d.ts +155 -19
- package/dist/core/memory-engine/types.js +2 -0
- package/dist/core/memory.js +15 -6
- package/dist/core/mode-policy.js +3 -3
- package/dist/core/mods/agent-stations.d.ts +18 -0
- package/dist/core/mods/agent-stations.js +8 -6
- package/dist/core/mods/extension-call.d.ts +4 -0
- package/dist/core/mods/extension-call.js +8 -0
- package/dist/core/mods/stations.d.ts +20 -1
- package/dist/core/mods/stations.js +21 -2
- package/dist/core/mods/tool-call.js +3 -4
- package/dist/core/parent-spec-seat.d.ts +2 -2
- package/dist/core/park-selfcheck.js +2 -2
- package/dist/core/pause-registry.d.ts +2 -0
- package/dist/core/pause-registry.js +3 -0
- package/dist/core/peer-channel.d.ts +5 -0
- package/dist/core/permission-rule-consent.d.ts +26 -8
- package/dist/core/permission-rule-consent.js +76 -36
- package/dist/core/permission-rule-store.d.ts +72 -13
- package/dist/core/permission-rule-store.js +29 -8
- package/dist/core/read-only-shell.js +3 -2
- package/dist/core/redaction-marks.d.ts +8 -0
- package/dist/core/redaction-marks.js +6 -0
- package/dist/core/refusal-echo.d.ts +20 -0
- package/dist/core/refusal-echo.js +33 -0
- package/dist/core/remote-env.d.ts +12 -1
- package/dist/core/remote-env.js +3 -0
- package/dist/core/retention.d.ts +180 -10
- package/dist/core/retention.js +45 -0
- package/dist/core/retired-keys.d.ts +5 -0
- package/dist/core/retired-keys.js +3 -0
- package/dist/core/rule-offer-read.d.ts +0 -4
- package/dist/core/rule-offer-read.js +2 -18
- package/dist/core/runner/child-tree.d.ts +29 -3
- package/dist/core/runner/child-tree.js +39 -16
- package/dist/core/runner/classifier-ladder.d.ts +7 -1
- package/dist/core/runner/classifier-ladder.js +4 -2
- package/dist/core/runner/compact-session.js +10 -7
- package/dist/core/runner/compaction-call-options.d.ts +7 -7
- package/dist/core/runner/compaction-call-options.js +3 -2
- package/dist/core/runner/contracts.d.ts +39 -11
- package/dist/core/runner/delegation-owner.d.ts +10 -3
- package/dist/core/runner/delegation-owner.js +4 -1
- package/dist/core/runner/gate-exit.d.ts +6 -0
- package/dist/core/runner/gate-exit.js +13 -4
- package/dist/core/runner/inherited-ask-grants.js +1 -1
- package/dist/core/runner/memory-consolidation-driver.d.ts +10 -5
- package/dist/core/runner/memory-consolidation-driver.js +12 -9
- package/dist/core/runner/memory-consolidation-write-judge.d.ts +2 -1
- package/dist/core/runner/memory-consolidation-write-judge.js +3 -2
- package/dist/core/runner/person-path-rows.d.ts +8 -3
- package/dist/core/runner/person-path-rows.js +5 -1
- package/dist/core/runner/placement-fence.d.ts +12 -0
- package/dist/core/runner/placement-fence.js +20 -6
- package/dist/core/runner/prepare-ask-lane.js +5 -5
- package/dist/core/runner/prepare-caps-and-workflow.d.ts +7 -2
- package/dist/core/runner/prepare-caps-and-workflow.js +7 -4
- package/dist/core/runner/prepare-config-doors.js +4 -0
- package/dist/core/runner/prepare-delegation-surface.d.ts +3 -0
- package/dist/core/runner/prepare-delegation-surface.js +2 -2
- package/dist/core/runner/prepare-execution-env.js +17 -6
- package/dist/core/runner/prepare-gate-stations.d.ts +5 -0
- package/dist/core/runner/prepare-gate-stations.js +5 -5
- package/dist/core/runner/prepare-hands-readface.d.ts +2 -1
- package/dist/core/runner/prepare-hands-readface.js +5 -4
- package/dist/core/runner/prepare-inherited-gate.d.ts +13 -9
- package/dist/core/runner/prepare-inherited-gate.js +12 -6
- package/dist/core/runner/prepare-memory-engine-session.d.ts +2 -4
- package/dist/core/runner/prepare-memory-engine-session.js +4 -4
- package/dist/core/runner/prepare-memory.d.ts +7 -2
- package/dist/core/runner/prepare-memory.js +41 -39
- package/dist/core/runner/prepare-park-ask.js +4 -3
- package/dist/core/runner/prepare-policy-chain.js +7 -7
- package/dist/core/runner/prepare-prompt-inputs.js +1 -1
- package/dist/core/runner/prepare-task.js +26 -18
- package/dist/core/runner/prepare-wiring-manifest.d.ts +3 -1
- package/dist/core/runner/prepare-wiring-manifest.js +3 -2
- package/dist/core/runner/prepare-workspace-restore.js +3 -6
- package/dist/core/runner/resume-admission.d.ts +2 -2
- package/dist/core/runner/resume-admission.js +2 -23
- package/dist/core/runner/role-resolution-table.d.ts +98 -0
- package/dist/core/runner/role-resolution-table.js +62 -0
- package/dist/core/runner/run-compaction-machinery.js +2 -2
- package/dist/core/runner/run-identity-wiring.js +12 -9
- package/dist/core/runner/run-leg.js +9 -5
- package/dist/core/runner/run-notification-lane.js +22 -22
- package/dist/core/runner/run-recovery-lanes.js +3 -3
- package/dist/core/runner/run-settle-and-teardown.js +3 -2
- package/dist/core/runner/run-terminal-adoption.js +1 -1
- package/dist/core/runner/run-turn-boundary.js +14 -15
- package/dist/core/runner/runtask.js +1 -1
- package/dist/core/runner/terminal-account.js +1 -1
- package/dist/core/runner/tool-occurrence.d.ts +4 -2
- package/dist/core/runner/tool-occurrence.js +2 -2
- package/dist/core/runner-deps.d.ts +7 -3
- package/dist/core/secret-env.d.ts +1 -1
- package/dist/core/secret-env.js +4 -4
- package/dist/core/session-checkout.d.ts +168 -0
- package/dist/core/session-checkout.js +579 -0
- package/dist/core/session-store.d.ts +12 -4
- package/dist/core/session-store.js +23 -3
- package/dist/core/session.d.ts +16 -2
- package/dist/core/session.js +3 -0
- package/dist/core/shell-read-silence.js +8 -0
- package/dist/core/store-contracts/checkpoint-store-contract.d.ts +0 -12
- package/dist/core/store-contracts/checkpoint-store-contract.js +6 -7
- package/dist/core/store-contracts/peer-directory-contract.js +8 -1
- package/dist/core/store-contracts/session-store-contract.js +39 -0
- package/dist/core/task-event.d.ts +30 -5
- package/dist/core/task-notification.d.ts +119 -32
- package/dist/core/task-notification.js +186 -100
- package/dist/core/task-registry-agent.d.ts +25 -2
- package/dist/core/task-registry-agent.js +56 -22
- package/dist/core/task-registry-shared.d.ts +33 -11
- package/dist/core/task-registry.d.ts +33 -9
- package/dist/core/task-registry.js +36 -18
- package/dist/core/task-spec-members.js +1 -1
- package/dist/core/task-spec.d.ts +27 -2
- package/dist/core/tool-errors.d.ts +14 -6
- package/dist/core/tool-errors.js +1 -1
- package/dist/core/tool-policy.d.ts +32 -13
- package/dist/core/tool-policy.js +27 -17
- package/dist/core/tool-result-store.d.ts +20 -0
- package/dist/core/tool-spec.d.ts +42 -19
- package/dist/core/trace.d.ts +3 -2
- package/dist/core/types.d.ts +1 -1
- package/dist/core/untrusted-egress.d.ts +15 -4
- package/dist/core/untrusted-egress.js +23 -22
- package/dist/core/workflow-journal-store.d.ts +11 -0
- package/dist/core/workflow-journal-store.js +7 -0
- package/dist/core/workflow-run-store.d.ts +9 -0
- package/dist/core/workflow-run-store.js +6 -0
- package/dist/core/workspace-snapshot.d.ts +3 -1
- package/dist/core/workspace-snapshot.js +1 -0
- package/dist/engine/compaction/compaction.d.ts +2 -1
- package/dist/engine/harness/types.d.ts +67 -1
- package/dist/engine/harness/types.js +108 -0
- package/dist/engine/session/import-validate.js +6 -1
- package/dist/engine/session/session.d.ts +30 -1
- package/dist/engine/session/session.js +48 -1
- package/dist/index.d.ts +12 -7
- package/dist/index.js +12 -7
- package/dist/internal/harness-types.d.ts +1 -1
- package/dist/orchestration/run-workflow-tool.d.ts +8 -1
- package/dist/orchestration/run-workflow-tool.js +8 -0
- package/dist/orchestration/workflow-types.d.ts +2 -1
- package/dist/orchestration/workflow.d.ts +6 -0
- package/dist/orchestration/workflow.js +5 -2
- package/dist/stores/file/checkpoint-store.d.ts +6 -0
- package/dist/stores/file/checkpoint-store.js +4 -1
- package/dist/stores/file/file-history-store.d.ts +13 -0
- package/dist/stores/file/file-history-store.js +75 -13
- package/dist/stores/file/index.d.ts +11 -1
- package/dist/stores/file/index.js +7 -11
- package/dist/stores/file/permission-rule-store.d.ts +23 -0
- package/dist/stores/file/permission-rule-store.js +75 -7
- package/dist/stores/file/session-store.js +2 -1
- package/dist/stores/file/tool-result-store.d.ts +14 -0
- package/dist/stores/file/tool-result-store.js +39 -2
- package/dist/stores/file/workflow-journal-store.d.ts +4 -0
- package/dist/stores/file/workflow-journal-store.js +17 -0
- package/dist/stores/file/workflow-run-store.d.ts +3 -0
- package/dist/stores/file/workflow-run-store.js +15 -0
- package/dist/tools/fs/bash-program-position.js +3 -3
- package/dist/tools/fs/program-read-model.d.ts +34 -10
- package/dist/tools/fs/program-read-model.js +37 -7
- package/dist/tools/fs/program-read-model.rows.js +13 -2
- package/dist/tools/fs/read-deny.d.ts +28 -3
- package/dist/tools/fs/read-deny.js +18 -2
- package/dist/tools/fs/removal-targets.js +3 -3
- package/dist/tools/fs/safety.d.ts +2 -0
- package/dist/tools/fs/safety.js +1 -1
- package/dist/tools/fs/shell-read-argv.d.ts +8 -1
- package/dist/tools/fs/shell-read-argv.js +34 -29
- package/dist/tools/fs/shell-read-bindings.d.ts +2 -0
- package/dist/tools/fs/shell-read-bindings.js +5 -1
- package/dist/tools/fs/shell-read-brace.d.ts +18 -0
- package/dist/tools/fs/shell-read-brace.js +79 -0
- package/dist/tools/fs/shell-read-check.d.ts +8 -2
- package/dist/tools/fs/shell-read-check.js +16 -14
- package/dist/tools/fs/shell-read-establish.js +23 -16
- package/dist/tools/fs/shell-read-judge.d.ts +11 -0
- package/dist/tools/fs/shell-read-judge.js +3 -3
- package/dist/tools/fs/shell-read-plan.d.ts +10 -0
- package/dist/tools/fs/shell-read-plan.js +189 -93
- package/dist/tools/fs/shell-read-start.d.ts +19 -9
- package/dist/tools/fs/shell-read-start.js +20 -12
- package/dist/tools/fs/shell-read-word.d.ts +10 -0
- package/dist/tools/fs/shell-read-word.js +9 -5
- package/dist/tools/fs/shell-read-workdir.d.ts +26 -7
- package/dist/tools/fs/shell-read-workdir.js +73 -12
- package/dist/tools/fs/shell-read-write-targets.js +13 -8
- package/dist/tools/worktree.d.ts +3 -2
- package/dist/tools/worktree.js +7 -35
- package/package.json +3 -2
- package/test/export-surface.snapshot.json +135 -11
- package/wire-changes/core-stores-sql@7.63.0.json +30 -0
- package/wire-changes/core-stores-sql@7.64.0.json +30 -0
- package/wire-changes/core@7.63.0.json +3523 -0
- package/wire-changes/core@7.64.0.json +2653 -0
- package/wire-changes/mods-kernel@7.63.0.json +30 -0
- package/wire-changes/mods-kernel@7.64.0.json +30 -0
- package/wire-changes/primitives@7.63.0.json +445 -0
- package/wire-changes/primitives@7.64.0.json +30 -0
- package/dist/core/credential-vocabulary.d.ts +0 -176
- package/dist/core/credential-vocabulary.js +0 -190
- package/dist/core/redaction-passes.d.ts +0 -82
- package/dist/core/redaction-passes.js +0 -377
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { MailboxAppendMessage, MailboxStore } from "./mailbox-store.js";
|
|
2
|
+
import { type EngineNotice } from "./engine-notice.js";
|
|
2
3
|
/** The TERMINAL words of {@link TaskNotificationStatus}: the one table every "is this frame a completion?"
|
|
3
4
|
* reading asks, exported as a value so a consumer outside the package reads these words rather than its own list. */
|
|
4
5
|
export declare const TASK_NOTIFICATION_TERMINAL_STATUSES: readonly ["completed", "failed", "killed", "cancelled"];
|
|
@@ -13,7 +14,7 @@ export type SystemInjectionPriority = "now" | "next" | "later";
|
|
|
13
14
|
* · `parked` — no live lane; pended IN PROCESS on {@link PendingSessionNotifications} for the
|
|
14
15
|
* session's next run in this process (a process restart loses it);
|
|
15
16
|
* · `parked_durably` — no live lane; appended to the session's DURABLE box
|
|
16
|
-
* ({@link PendingSessionNotifications.
|
|
17
|
+
* ({@link PendingSessionNotifications.admit}) — the next run drains it, in any process;
|
|
17
18
|
* · `dropped_duplicate` — the session already delivered this exact frame;
|
|
18
19
|
* · `refused` — a live lane took it and the session's receiving station did not hand it over: an extension consumed it,
|
|
19
20
|
* or a handler there failed ({@link FrameReceiver}). The model never saw it, and it is not owed again.
|
|
@@ -260,7 +261,7 @@ export interface TaskNotificationPayload {
|
|
|
260
261
|
};
|
|
261
262
|
/**
|
|
262
263
|
* design/385 §4.4 / §5.2 (slice 4) — the CROSS-SESSION NOTICE carrier: a delivery receipt about one of
|
|
263
|
-
* THIS session's own outbound messages (held / denied / expired / delivered / refused / dropped) or an
|
|
264
|
+
* THIS session's own outbound messages (held / held_by_policy / denied / expired / delivered / refused / dropped) or an
|
|
264
265
|
* idle notice for a `notify_when_idle` ask (idle / exited / unavailable / expired), drained from this
|
|
265
266
|
* session's own box as a notice-kind record. Its PRESENCE is the render discriminator: the model reads
|
|
266
267
|
* the engine-rendered notice line as-is (CC injects `[Cross-session delivery notice] …` /
|
|
@@ -500,6 +501,37 @@ export declare const MAX_PENDING_SESSIONS = 100;
|
|
|
500
501
|
* a long-lived leader's binding is not evicted by parked traffic (eviction = the park backend degrades
|
|
501
502
|
* to in-process, which the receipt then says). */
|
|
502
503
|
export declare const MAX_SESSION_BOX_BINDINGS = 4096;
|
|
504
|
+
/**
|
|
505
|
+
* WHERE a frame for one session goes: the session id and the occupant of its row — `SessionMetadata.incarnation`, as the
|
|
506
|
+
* run that names the address acquired the row (`undefined` = no token: a row written before occupants were minted, or a
|
|
507
|
+
* read that failed). A session id can be deleted and created again under the same spelling, by another principal or the
|
|
508
|
+
* same one; the new row is another occupant, and a frame addressed to the one before it is never delivered to it
|
|
509
|
+
* ({@link sameOccupant}). Every seat of {@link PendingSessionNotifications} — its live lanes, its durable box, its
|
|
510
|
+
* parked records — is held for one address.
|
|
511
|
+
*/
|
|
512
|
+
export interface SessionAddress {
|
|
513
|
+
readonly sessionId: string;
|
|
514
|
+
readonly occupant: string | undefined;
|
|
515
|
+
/** The leg could not read its occupant (the read threw): `occupant` is then no answer, and the address is nobody's. The store
|
|
516
|
+
* takes the leg as no admission, drains it nothing, registers no live lane for it, and discards (announced) what is routed
|
|
517
|
+
* to it ({@link PendingSessionNotifications.admit}, {@link PendingSessionNotifications.discardsStale}). */
|
|
518
|
+
readonly unread?: true;
|
|
519
|
+
}
|
|
520
|
+
/** A run leg's own session address — the session it prepared and the occupant its acquire read (the one construction). */
|
|
521
|
+
export declare function sessionAddressOf(leg: {
|
|
522
|
+
readonly sessionId: string;
|
|
523
|
+
readonly sessionIncarnation?: string;
|
|
524
|
+
readonly sessionIncarnationUnread?: true;
|
|
525
|
+
}): SessionAddress;
|
|
526
|
+
/** Which seat a frame addressed to an earlier occupant of a session would have reached under the occupant the session
|
|
527
|
+
* holds now: that occupant's live run, its durable box, or its next run's turn-open drain. */
|
|
528
|
+
export type DiscardedDeliveryPath = "live" | "box" | "drain";
|
|
529
|
+
/**
|
|
530
|
+
* The account of a frame discarded because its address names an occupant the session no longer holds — the one mint of
|
|
531
|
+
* `delegation.delivery_discarded`. Counts and words only: the frame's text (a child's summary, a peer's words) never
|
|
532
|
+
* rides it, nor either occupant token (only whether each side had one).
|
|
533
|
+
*/
|
|
534
|
+
export declare function deliveryDiscardedNotice(address: Pick<SessionAddress, "sessionId" | "occupant">, current: string | undefined, payload: TaskNotificationPayload, path: DiscardedDeliveryPath): EngineNotice;
|
|
503
535
|
/**
|
|
504
536
|
* A session's DURABLE box, bound to the park seat by the leg that mounts its session-box drain — one
|
|
505
537
|
* mint (the drain mount judgment), two readers (the drain and {@link routeOrParkNotification}), so
|
|
@@ -597,9 +629,9 @@ export type EngineFrameDecode = {
|
|
|
597
629
|
* writer must never have encoded is dropped rather than trusted. */
|
|
598
630
|
export declare function decodeEngineFrame(content: string): EngineFrameDecode;
|
|
599
631
|
/** The durable form of an engine frame: the codec text under `kind: "engine_frame"`, stamped with
|
|
600
|
-
* the box owner as `fromRoot` (the park seat's own fact, as for a peer-words record)
|
|
601
|
-
* it is not a peer message and is never admitted as one. */
|
|
602
|
-
export declare function engineFrameRecordOf(payload: TaskNotificationPayload, priority: SystemInjectionPriority,
|
|
632
|
+
* the box owner as `fromRoot` (the park seat's own fact, as for a peer-words record) and with the occupant the frame is
|
|
633
|
+
* addressed to (`occupant`, when the address has one); no hop chain — it is not a peer message and is never admitted as one. */
|
|
634
|
+
export declare function engineFrameRecordOf(payload: TaskNotificationPayload, priority: SystemInjectionPriority, to: Pick<SessionAddress, "sessionId" | "occupant">): MailboxAppendMessage;
|
|
603
635
|
/**
|
|
604
636
|
* RB-375 A2 (ruled 2026-08-03) — is this frame the TERMINAL of a delegated background agent?
|
|
605
637
|
*
|
|
@@ -629,7 +661,8 @@ export declare function isTerminalTaskNotification(n: Pick<TaskNotificationPaylo
|
|
|
629
661
|
* agent, a workflow run: the run lane the call carries (`ToolExecuteContext.onTaskNotification`) when there is one, else
|
|
630
662
|
* the mount's own sink. One value per launch: the producer judges "will a completion reach the model" by it, delivers
|
|
631
663
|
* through it, and owes its terminal frame to it ({@link oweTerminalDelivery}) — never one sink for the judgment and
|
|
632
|
-
* another for the delivery.
|
|
664
|
+
* another for the delivery. A parked agent's redemption is the cycle its park left owed: its lane is the one that park
|
|
665
|
+
* recorded (`TaskRegistry.parkedCompletionSink`) when the call carries none of its own.
|
|
633
666
|
*/
|
|
634
667
|
export declare function resolveCompletionSink<C, M>(callSink: C | undefined, mountSink: M | undefined): C | M | undefined;
|
|
635
668
|
/**
|
|
@@ -656,6 +689,10 @@ export declare function admitsBackgroundLaunch(sink: unknown, deploymentChannel:
|
|
|
656
689
|
* task by the frame it delivers, so a frame of another lane carrying the same `task_id` settles nothing here. A background
|
|
657
690
|
* command or a Monitor watch never enters: its lifetime is its process's (it may never end), and a one-shot ending treats
|
|
658
691
|
* it by the run's teardown rules without waiting. A sink no lane bound (a host's own) owes nothing.
|
|
692
|
+
*
|
|
693
|
+
* A cycle that PARKS on an approval sends no frame: its debt stays where it was booked, and the redemption that resumes
|
|
694
|
+
* it is the same cycle continuing — it books nothing new, and its frame settles that debt. Where the redemption completes
|
|
695
|
+
* into another lane, the debt moves there when the approval is consumed ({@link moveTerminalDelivery}) — one handle, one debt.
|
|
659
696
|
*/
|
|
660
697
|
export declare class DeliveryObligations {
|
|
661
698
|
/** lane key → admitted cycles whose terminal frame has not reached the sink. */
|
|
@@ -693,6 +730,9 @@ export declare function bindDeliveryObligations(sink: object, book: DeliveryObli
|
|
|
693
730
|
export declare function oweTerminalDelivery(sink: unknown, task: Pick<TaskNotificationPayload, "task_id" | "task_type">): void;
|
|
694
731
|
/** A cycle whose terminal frame will never reach `sink` (it was voided) releases its debt there (no-op for an unbound sink). */
|
|
695
732
|
export declare function retireTerminalDelivery(sink: unknown, task: Pick<TaskNotificationPayload, "task_id" | "task_type">): void;
|
|
733
|
+
/** A parked cycle's debt follows its redemption: released on the lane the park left it owed to (`from`, absent when this
|
|
734
|
+
* process holds no park of it), owed on the lane the redemption completes into (`to`) — nothing moves when they are one. */
|
|
735
|
+
export declare function moveTerminalDelivery(from: unknown, to: unknown, task: Pick<TaskNotificationPayload, "task_id" | "task_type">): void;
|
|
696
736
|
export interface DrainedPendingNotifications {
|
|
697
737
|
/** Payloads still held when the session's next run drained. design/373 §3.5: batch order is
|
|
698
738
|
* PRIORITY-MAJOR (now < next < later; a record with no carried priority ranks AS later —
|
|
@@ -801,20 +841,26 @@ export declare function createLiveNotificationLane(seat: {
|
|
|
801
841
|
* run" — and every lane is tried once, so a lane that has stopped, or that has already handed this very
|
|
802
842
|
* frame away, is passed over rather than swallowing it. A lane that refused a frame therefore cannot be
|
|
803
843
|
* reached by it again, which is what makes a route of any length terminate on the parked store.
|
|
844
|
+
*
|
|
845
|
+
* A lane sits under its run's {@link SessionAddress}: a frame is offered only to the lanes of the occupant it is
|
|
846
|
+
* addressed to ({@link sameOccupant}). A run of another occupant of the same id — the id deleted and created again,
|
|
847
|
+
* by another principal or the same one — is never a destination for it.
|
|
804
848
|
*/
|
|
805
849
|
export declare class SessionLiveNotificationLanes {
|
|
806
850
|
private readonly lanes;
|
|
807
|
-
register(
|
|
851
|
+
register(address: SessionAddress, lane: LiveNotificationLane): void;
|
|
808
852
|
/** Idempotent (a lane withdraws at its stop AND again at its outermost teardown). The key is dropped
|
|
809
853
|
* with its last lane so an idle process holds no per-session entry. */
|
|
810
|
-
unregister(
|
|
854
|
+
unregister(address: SessionAddress, lane: LiveNotificationLane): void;
|
|
811
855
|
/**
|
|
812
|
-
* Offer the payload to the
|
|
856
|
+
* Offer the payload to the addressed occupant's live lanes, newest first. The caller's OWN lane is not
|
|
813
857
|
* special-cased: a lane that just refused this frame reports `"unavailable"` for it from then on.
|
|
814
858
|
*/
|
|
815
|
-
deliver(
|
|
859
|
+
deliver(address: SessionAddress, payload: TaskNotificationPayload, priority: SystemInjectionPriority, opts?: {
|
|
816
860
|
onDisposition?: (d: NotificationDisposition) => void;
|
|
817
861
|
}): "taken" | "pending" | "duplicate" | "unavailable";
|
|
862
|
+
/** Does the addressed occupant hold a live lane here? */
|
|
863
|
+
holds(address: SessionAddress): boolean;
|
|
818
864
|
/** Sessions holding at least one live lane (observability + the tests' rollback detector). */
|
|
819
865
|
get size(): number;
|
|
820
866
|
}
|
|
@@ -828,12 +874,26 @@ export interface SessionBoxDebt {
|
|
|
828
874
|
readonly box: SessionBoxBinding;
|
|
829
875
|
readonly record: MailboxAppendMessage;
|
|
830
876
|
}
|
|
877
|
+
/**
|
|
878
|
+
* Where a notification addressed to a session goes ({@link SessionAddress}): its live lanes, its durable box, its parked
|
|
879
|
+
* records — every seat held for ONE occupant of the session id. The session's CURRENT occupant is the one its latest leg in
|
|
880
|
+
* this process acquired ({@link admit}): an acquire answers the row as it stands, a row created again under the id is
|
|
881
|
+
* another occupant, and an occupant once replaced never stands again. So from an admission on, whatever is addressed to,
|
|
882
|
+
* or kept for, another occupant of that id is discarded — announced `delegation.delivery_discarded` (operator), never
|
|
883
|
+
* delivered and never silent. A session no leg of which was admitted here (or whose seat aged out of the bound) has no
|
|
884
|
+
* current occupant on record: its frames park under their own address and are judged by the leg that drains them.
|
|
885
|
+
*/
|
|
831
886
|
export declare class PendingSessionNotifications {
|
|
832
887
|
private readonly sessions;
|
|
888
|
+
/** Where a discard is announced: the deployment's notice sink, read when the discard happens (absent ⇒ the process default seat). */
|
|
889
|
+
private readonly noticeSeat;
|
|
890
|
+
constructor(seats?: {
|
|
891
|
+
readonly onNotice?: () => ((notice: EngineNotice) => void) | undefined;
|
|
892
|
+
});
|
|
833
893
|
/**
|
|
834
894
|
* The LIVE half of the same question this store answers. Together they are one seat — "where does a
|
|
835
895
|
* notification addressed to session S go?" — with two answers: the session's live lane when it has
|
|
836
|
-
* one, this parked queue when it does not. One object, one lifetime, one key (the session
|
|
896
|
+
* one, this parked queue when it does not. One object, one lifetime, one key (the session address).
|
|
837
897
|
*/
|
|
838
898
|
readonly liveLanes: SessionLiveNotificationLanes;
|
|
839
899
|
/** Whole sessions evicted by {@link MAX_PENDING_SESSIONS} (their pendings were never delivered). */
|
|
@@ -851,16 +911,35 @@ export declare class PendingSessionNotifications {
|
|
|
851
911
|
/** Whole-session losses whose tombstone was itself evicted — the count survives, the attribution
|
|
852
912
|
* does not. Surfaced on the next session-level disclosure so it is never simply forgotten. */
|
|
853
913
|
private unattributedDrops;
|
|
854
|
-
/**
|
|
855
|
-
private readonly
|
|
914
|
+
/** Each session's current occupant and its durable park backend ({@link SessionBoxBinding}); insertion-ordered, bounded. */
|
|
915
|
+
private readonly seats;
|
|
916
|
+
/**
|
|
917
|
+
* A leg of the session has acquired its row as `address.occupant` — its current occupant from now on — and binds (or, with
|
|
918
|
+
* `undefined`, unbinds) the session's durable box. Written at EVERY drain mount of a session's leg, so the binding tracks the
|
|
919
|
+
* deployment's current seats (a mailbox swapped out unbinds at the next mount); a re-admission refreshes the entry's LRU
|
|
920
|
+
* position. What this store still keeps for another occupant of the id — parked frames, their tombstone, their delivered and
|
|
921
|
+
* durable keys — is addressed to a row that will never stand again: the frames are discarded, each announced.
|
|
922
|
+
* A leg that could not read its occupant (`address.unread`) is no admission: the current occupant on record and what is kept
|
|
923
|
+
* for it stand for the next leg that reads its own. A seat is aged out only while the store keeps no record for its session,
|
|
924
|
+
* so a parked record is always judged against the occupant that parked it, never against whichever frame arrives next.
|
|
925
|
+
*/
|
|
926
|
+
admit(address: SessionAddress, box: SessionBoxBinding | undefined): void;
|
|
927
|
+
/** The addressed occupant's durable box: the one its own leg in this process bound, never another occupant's. */
|
|
928
|
+
sessionBoxFor(address: SessionAddress): SessionBoxBinding | undefined;
|
|
856
929
|
/**
|
|
857
|
-
*
|
|
858
|
-
*
|
|
859
|
-
*
|
|
930
|
+
* Is `address` an earlier occupant of a session whose current occupant is another? Then the frame is discarded here —
|
|
931
|
+
* announced with the seat it would have reached under the current occupant — and the answer is `true`: nothing routes,
|
|
932
|
+
* parks or folds it. `false` for the current occupant, and for a session with no current occupant on record. An unread
|
|
933
|
+
* address (a leg that could not read its occupant) is nobody's: its frames are discarded the same way, whatever the seat.
|
|
860
934
|
*/
|
|
861
|
-
|
|
862
|
-
/** The
|
|
863
|
-
|
|
935
|
+
discardsStale(address: SessionAddress, payload: TaskNotificationPayload): boolean;
|
|
936
|
+
/** The one place a discarded frame is announced. */
|
|
937
|
+
private announceDiscard;
|
|
938
|
+
/** Discard a record parked for an occupant the session no longer holds: every frame in it is announced; the record's own
|
|
939
|
+
* bookkeeping (its eviction counts, its box debts) belongs to that occupant and goes with it. */
|
|
940
|
+
private discardRecord;
|
|
941
|
+
/** The session's record when it is parked for the addressed occupant. */
|
|
942
|
+
private recordOf;
|
|
864
943
|
/**
|
|
865
944
|
* Settle what the session's pending copies owe their boxes ({@link SessionBoxDebt}): each is asked of its own box once
|
|
866
945
|
* more, under its record, in pend order. A box that answers took the record — it holds it, or received it already —
|
|
@@ -871,17 +950,22 @@ export declare class PendingSessionNotifications {
|
|
|
871
950
|
* unasked, stays owed — and a copy that owes its box is never drained ({@link drain} keeps it back) — until a later
|
|
872
951
|
* leg's settlement asks.
|
|
873
952
|
*/
|
|
874
|
-
settleBoxDebts(
|
|
953
|
+
settleBoxDebts(address: SessionAddress, signal?: AbortSignal): Promise<void> | undefined;
|
|
875
954
|
/** What a drain hands out of a parked record: everything but the copies that still owe their box — those go back
|
|
876
|
-
* into the store as the session's record (with their keys, tiers and debts) for the leg that settles them. */
|
|
955
|
+
* into the store as the session's record (with their occupant, keys, tiers and debts) for the leg that settles them. */
|
|
877
956
|
private keepBackOwing;
|
|
878
957
|
private settleBoxDebt;
|
|
879
|
-
|
|
958
|
+
/** Park a frame for the addressed occupant's next run. A frame addressed to an occupant the session no longer holds is
|
|
959
|
+
* discarded ({@link discardsStale}); a record kept for another occupant of an id no leg of which this process admitted (a
|
|
960
|
+
* record-holding seat is never aged out) names one of the two only — the newer arrival's record replaces it, its frames
|
|
961
|
+
* announced as discarded. `true` = the frame is
|
|
962
|
+
* parked for the address (a repeat of a parked key folds into it); `false` = discarded. */
|
|
963
|
+
pend(address: SessionAddress, n: TaskNotificationPayload, priority?: SystemInjectionPriority, debt?: SessionBoxDebt): boolean;
|
|
880
964
|
/** Remove and return the session's pendings (one-shot — the next run consumes them exactly once); a copy that
|
|
881
965
|
* still owes its box stays parked for the leg that settles it ({@link settleBoxDebts}).
|
|
882
966
|
* design/373 §3.5: the batch comes out PRIORITY-MAJOR (stable sort — pend order within a class;
|
|
883
967
|
* a no-priority record ranks as later), the idle-dequeue min-value-first form. */
|
|
884
|
-
drain(
|
|
968
|
+
drain(address: SessionAddress): DrainedPendingNotifications | undefined;
|
|
885
969
|
/**
|
|
886
970
|
* Keys a live lane of this session has already put in front of a model (the delivered half of the
|
|
887
971
|
* ledger below). Kept beside the parked keys because the WINDOW is the session's, not any one run's:
|
|
@@ -891,23 +975,23 @@ export declare class PendingSessionNotifications {
|
|
|
891
975
|
*/
|
|
892
976
|
private readonly routed;
|
|
893
977
|
/**
|
|
894
|
-
* Does this session ALREADY own this exact frame — parked, or routed onto a live lane? Only one of
|
|
978
|
+
* Does this session's addressed occupant ALREADY own this exact frame — parked, or routed onto a live lane? Only one of
|
|
895
979
|
* the two may hold a key: a producer retrying a frame the session has already taken must FOLD rather
|
|
896
980
|
* than be handed to whichever run has since gone live, which would deliver it there and again at the
|
|
897
|
-
* next drain. Callers ask BEFORE routing and BEFORE parking.
|
|
981
|
+
* next drain. Callers ask BEFORE routing and BEFORE parking. Another occupant's keys answer nothing here.
|
|
898
982
|
*/
|
|
899
|
-
holdsKey(
|
|
983
|
+
holdsKey(address: SessionAddress, dedupKey: string): boolean;
|
|
900
984
|
/** Keys the session's DURABLE box took ({@link routeOrParkNotification}'s durable arm) — the third holder
|
|
901
985
|
* {@link holdsKey} consults, so a retry of a frame the box already holds folds exactly as one the
|
|
902
986
|
* in-process store holds. Bounded like {@link routed}; a key is released when the append faulted and
|
|
903
987
|
* the frame took the in-process park instead (that store then owns it). */
|
|
904
988
|
private readonly durable;
|
|
905
|
-
noteDurablePark(
|
|
906
|
-
forgetDurablePark(
|
|
907
|
-
/** Record that this session has DELIVERED this frame — see {@link routed}. Written at ONE place, the
|
|
989
|
+
noteDurablePark(address: SessionAddress, dedupKey: string): void;
|
|
990
|
+
forgetDurablePark(address: SessionAddress, dedupKey: string): void;
|
|
991
|
+
/** Record that this session's addressed occupant has DELIVERED this frame — see {@link routed}. Written at ONE place, the
|
|
908
992
|
* harness's consumption sink (the step where a queued frame enters the model's input), so the record
|
|
909
993
|
* can never run ahead of the delivery it claims. */
|
|
910
|
-
markDelivered(
|
|
994
|
+
markDelivered(address: SessionAddress, dedupKey: string): void;
|
|
911
995
|
get size(): number;
|
|
912
996
|
}
|
|
913
997
|
/**
|
|
@@ -938,8 +1022,11 @@ export declare class DurableAppendObligations {
|
|
|
938
1022
|
* then, so only the lane that actually delivers writes ownership
|
|
939
1023
|
* ({@link LiveNotificationLaneSeat.markDelivered});
|
|
940
1024
|
* · nothing can take it ⇒ park, carrying the tier, for the session's next run.
|
|
1025
|
+
* The address names the session's occupant ({@link SessionAddress}): every one of the three is that occupant's — its keys,
|
|
1026
|
+
* its live lanes, its box, its record — and a frame addressed to an occupant the session no longer holds is discarded
|
|
1027
|
+
* before any of them ({@link PendingSessionNotifications.discardsStale}); its receipt says `"refused"`.
|
|
941
1028
|
*/
|
|
942
|
-
export declare function routeOrParkNotification(store: PendingSessionNotifications,
|
|
1029
|
+
export declare function routeOrParkNotification(store: PendingSessionNotifications, address: SessionAddress, payload: TaskNotificationPayload, priority: SystemInjectionPriority, onDisposition?: (d: NotificationDisposition) => void): void;
|
|
943
1030
|
/**
|
|
944
1031
|
* The durable form of a parked peer-words frame: the SAME `peer_message` record the cross-session lane
|
|
945
1032
|
* appends (the recipient's drain renders it through the one envelope and judges it through the one
|
|
@@ -952,7 +1039,7 @@ export declare function sessionBoxRecordOf(payload: TaskNotificationPayload & {
|
|
|
952
1039
|
from: string;
|
|
953
1040
|
body: string;
|
|
954
1041
|
};
|
|
955
|
-
},
|
|
1042
|
+
}, to: Pick<SessionAddress, "sessionId" | "occupant">): MailboxAppendMessage;
|
|
956
1043
|
/**
|
|
957
1044
|
* Delivery-side overflow disclosure: fold the per-task drop counts into the drained payloads. Two
|
|
958
1045
|
* carrier shapes, chosen per survivor:
|