@sema-agent/core 7.56.0 → 7.57.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 +541 -0
- package/LICENSE +1 -1
- package/dist/agents/org-delivery-gate.js +3 -4
- package/dist/agents/peer-held-queue.d.ts +69 -49
- package/dist/agents/peer-held-queue.js +255 -106
- package/dist/agents/peer-session-drain.js +63 -43
- package/dist/agents/send-message-tool.js +3 -2
- package/dist/agents/subagent.js +8 -8
- package/dist/brain/anthropic.js +16 -8
- package/dist/brain/open-responses.js +10 -8
- package/dist/brain/openai.js +11 -9
- package/dist/brain/provider-dialect.d.ts +3 -2
- package/dist/brain/provider-dialect.js +2 -2
- package/dist/brain/request-params.d.ts +6 -0
- package/dist/brain/request-params.js +14 -1
- package/dist/brain/stream-engine.d.ts +9 -0
- package/dist/brain/stream-engine.js +24 -10
- package/dist/brain/stream-shared.d.ts +5 -4
- package/dist/brain/stream-shared.js +4 -4
- package/dist/core/allow-entry.d.ts +3 -10
- package/dist/core/allow-entry.js +17 -25
- package/dist/core/approval-object.d.ts +21 -5
- package/dist/core/approval-object.js +44 -17
- package/dist/core/ask-origin.d.ts +2 -2
- package/dist/core/auto-compaction.d.ts +71 -6
- package/dist/core/auto-compaction.js +42 -26
- package/dist/core/background-agent-store.d.ts +6 -2
- package/dist/core/background-agent-store.js +1 -1
- package/dist/core/checkpoint-requirements.d.ts +7 -1
- package/dist/core/checkpoint-requirements.js +2 -0
- package/dist/core/checkpoint-store.d.ts +17 -29
- package/dist/core/checkpoint-store.js +19 -11
- package/dist/core/cross-boundary-taint.js +4 -2
- package/dist/core/engine-notice.d.ts +3 -2
- package/dist/core/engine-notice.js +6 -0
- package/dist/core/file-history-store.d.ts +14 -8
- package/dist/core/file-history-store.js +14 -4
- package/dist/core/gate-lanes.js +2 -3
- package/dist/core/hooks.d.ts +2 -2
- package/dist/core/mailbox-store.d.ts +62 -1
- package/dist/core/mailbox-store.js +59 -0
- package/dist/core/mcp-name-judge.d.ts +46 -0
- package/dist/core/mcp-name-judge.js +61 -0
- package/dist/core/mcp-probe.d.ts +1 -1
- package/dist/core/mcp-probe.js +2 -5
- package/dist/core/mcp.js +10 -30
- package/dist/core/memory-engine/consolidation-driver.js +4 -3
- package/dist/core/memory-engine/distiller.js +26 -17
- package/dist/core/memory-engine/layout.js +5 -2
- package/dist/core/park-selfcheck.js +2 -0
- package/dist/core/permission-rule-consent.d.ts +5 -3
- package/dist/core/permission-rule-consent.js +20 -15
- package/dist/core/permission-rule-model.d.ts +43 -2
- package/dist/core/permission-rule-model.js +52 -8
- package/dist/core/permission-rule-org.js +1 -1
- package/dist/core/protocol-http-auth.d.ts +16 -2
- package/dist/core/protocol-http-auth.js +42 -11
- package/dist/core/protocol-naming.d.ts +20 -0
- package/dist/core/protocol-naming.js +20 -3
- package/dist/core/read-only-shell.d.ts +20 -5
- package/dist/core/read-only-shell.js +29 -14
- package/dist/core/remote-env.d.ts +37 -1
- package/dist/core/remote-env.js +11 -0
- package/dist/core/resume-startup-cause.d.ts +24 -2
- package/dist/core/resume-startup-cause.js +20 -1
- package/dist/core/roles.js +50 -7
- package/dist/core/runner/compact-session.d.ts +10 -0
- package/dist/core/runner/compact-session.js +202 -0
- package/dist/core/runner/compaction-call-options.d.ts +2 -2
- package/dist/core/runner/compaction-seams.d.ts +21 -1
- package/dist/core/runner/compaction-seams.js +11 -8
- package/dist/core/runner/contracts.d.ts +23 -16
- package/dist/core/runner/derived-route-fallback.d.ts +13 -0
- package/dist/core/runner/derived-route-fallback.js +6 -0
- package/dist/core/runner/env-capability-census.d.ts +3 -2
- package/dist/core/runner/env-capability-census.js +9 -3
- package/dist/core/runner/permission-rule-lanes.d.ts +7 -7
- package/dist/core/runner/permission-rule-lanes.js +17 -11
- package/dist/core/runner/prepare-acquire-reconcile.d.ts +3 -0
- package/dist/core/runner/prepare-acquire-reconcile.js +2 -1
- package/dist/core/runner/prepare-config-doors.d.ts +6 -0
- package/dist/core/runner/prepare-config-doors.js +4 -3
- package/dist/core/runner/prepare-hands-readface.d.ts +3 -1
- package/dist/core/runner/prepare-hands-readface.js +2 -0
- package/dist/core/runner/prepare-park-ask.d.ts +2 -0
- package/dist/core/runner/prepare-park-ask.js +2 -2
- package/dist/core/runner/prepare-policy-chain.js +2 -4
- package/dist/core/runner/prepare-task.d.ts +4 -1
- package/dist/core/runner/prepare-task.js +23 -27
- package/dist/core/runner/prepare-tool-disclosure-mount.d.ts +13 -0
- package/dist/core/runner/prepare-tool-disclosure-mount.js +13 -7
- package/dist/core/runner/rewind-files.d.ts +2 -5
- package/dist/core/runner/rewind-files.js +9 -51
- package/dist/core/runner/run-leg.js +10 -21
- package/dist/core/runner/run-notification-lane.d.ts +2 -0
- package/dist/core/runner/run-notification-lane.js +2 -2
- package/dist/core/runner/run-recovery-lanes.js +3 -4
- package/dist/core/runner/run-settle-and-teardown.js +5 -11
- package/dist/core/runner/run-terminal-adoption.js +3 -4
- package/dist/core/runner/run-turn-boundary.js +3 -5
- package/dist/core/runner/runtask.d.ts +8 -1
- package/dist/core/runner/runtask.js +28 -34
- package/dist/core/runner/send-message-continuation.js +1 -1
- package/dist/core/runner/session-verb-doors.d.ts +28 -0
- package/dist/core/runner/session-verb-doors.js +48 -0
- package/dist/core/runner/session-write-ledger.d.ts +30 -0
- package/dist/core/runner/session-write-ledger.js +101 -0
- package/dist/core/runner/stream-settle-backstop.js +11 -14
- package/dist/core/runner/sub-agent-deny-lists.d.ts +25 -3
- package/dist/core/runner/sub-agent-deny-lists.js +21 -10
- package/dist/core/runner/teardown-bounded.d.ts +1 -0
- package/dist/core/runner/teardown-bounded.js +1 -0
- package/dist/core/runner-deps.d.ts +2 -2
- package/dist/core/secret-env.d.ts +4 -0
- package/dist/core/secret-env.js +3 -0
- package/dist/core/session-policy-store.d.ts +7 -2
- package/dist/core/session-policy-store.js +1 -1
- package/dist/core/shell-wrapper-projection.d.ts +1 -1
- package/dist/core/store-contracts/background-agent-store-contract.js +1 -0
- package/dist/core/store-contracts/checkpoint-store-contract.js +2 -1
- package/dist/core/store-contracts/file-history-store-contract.js +9 -0
- package/dist/core/store-contracts/mailbox-store-contract.js +49 -1
- package/dist/core/task-registry-agent.d.ts +8 -4
- package/dist/core/task-registry-agent.js +14 -8
- package/dist/core/task-registry-shared.d.ts +35 -6
- package/dist/core/task-registry-shared.js +11 -0
- package/dist/core/task-registry.d.ts +1 -1
- package/dist/core/task-registry.js +1 -1
- package/dist/core/tool-catalog-entries.d.ts +6 -0
- package/dist/core/tool-catalog-entries.js +1 -0
- package/dist/core/tool-name-aliases.d.ts +32 -2
- package/dist/core/tool-name-aliases.js +23 -0
- package/dist/core/tool-name-readings.d.ts +4 -0
- package/dist/core/tool-name-readings.js +1 -0
- package/dist/core/tool-policy.d.ts +10 -6
- package/dist/core/tool-policy.js +4 -7
- package/dist/core/trace.d.ts +4 -1
- package/dist/core/trace.js +2 -1
- package/dist/core/untrusted-egress.d.ts +20 -0
- package/dist/core/untrusted-egress.js +77 -3
- package/dist/engine/harness/agent-harness.d.ts +7 -5
- package/dist/engine/harness/agent-harness.js +11 -2
- package/dist/engine/loop/agent-loop.d.ts +1 -4
- package/dist/engine/loop/agent-loop.js +26 -4
- package/dist/index.d.ts +12 -7
- package/dist/index.js +7 -4
- package/dist/internal/harness.d.ts +2 -1
- package/dist/internal/harness.js +1 -0
- package/dist/primitives/credential-ref.d.ts +89 -0
- package/dist/primitives/credential-ref.js +125 -0
- package/dist/primitives/index.d.ts +2 -0
- package/dist/primitives/index.js +1 -0
- package/dist/stores/file/checkpoint-store.d.ts +0 -4
- package/dist/stores/file/checkpoint-store.js +0 -1
- package/dist/stores/file/file-history-store.js +12 -4
- package/dist/stores/file/mailbox-store.d.ts +2 -1
- package/dist/stores/file/mailbox-store.js +26 -1
- package/dist/tools/fs/bash-readonly-classifier.d.ts +15 -19
- package/dist/tools/fs/bash-readonly-classifier.js +5 -10
- package/dist/tools/fs/fs-bash.js +10 -3
- package/dist/tools/fs/pattern-kill-guard.d.ts +3 -2
- package/dist/tools/fs/pattern-kill-guard.js +68 -36
- package/dist/tools/fs/shell-read-check.d.ts +10 -0
- package/dist/tools/fs/shell-read-check.js +7 -1
- package/dist/tools/fs/shell-read-identity.d.ts +12 -9
- package/dist/tools/fs/shell-read-identity.js +9 -4
- package/dist/tools/web.js +9 -7
- package/package.json +1 -1
- package/test/export-surface.snapshot.json +79 -3
- package/wire-changes/core-stores-sql@7.57.0.json +29 -0
- package/wire-changes/core@7.57.0.json +1487 -0
- package/wire-changes/mods-kernel@7.57.0.json +29 -0
- package/wire-changes/primitives@7.57.0.json +245 -0
package/LICENSE
CHANGED
|
@@ -5,7 +5,7 @@ Parameters
|
|
|
5
5
|
Licensor: clay (github.com/clayboby)
|
|
6
6
|
Licensed Work: @sema-agent/core (sema-core) and the satellite packages
|
|
7
7
|
published from this repository (currently
|
|
8
|
-
@sema-agent/mods-kernel)
|
|
8
|
+
@sema-agent/mods-kernel, @sema-agent/primitives and @sema-agent/core-stores-sql)
|
|
9
9
|
(formerly published as @sema-ai/core)
|
|
10
10
|
The Licensed Work is (c) 2026 clay.
|
|
11
11
|
Additional Use Grant: You may make production use of the Licensed Work for
|
|
@@ -7,9 +7,8 @@ export function principalInboxConsumerOf(deps) {
|
|
|
7
7
|
const raw = deps.principalInboxConsumer;
|
|
8
8
|
if (raw === undefined)
|
|
9
9
|
return { kind: "none" };
|
|
10
|
-
if (raw === "terminals")
|
|
11
|
-
|
|
12
|
-
}
|
|
10
|
+
if (raw === "terminals")
|
|
11
|
+
return { kind: "terminals" };
|
|
13
12
|
if (raw !== null && typeof raw === "object" && !Array.isArray(raw) && Object.getPrototypeOf(raw) === Object.prototype) {
|
|
14
13
|
const keys = Reflect.ownKeys(raw);
|
|
15
14
|
const handle = raw.assistant;
|
|
@@ -32,7 +31,7 @@ export function isOrgDeliveryRefusalCode(value) {
|
|
|
32
31
|
export function mintCrossPrincipalRecord(input) {
|
|
33
32
|
const { from, body, receiptId, sentAt, consumer } = input;
|
|
34
33
|
if (consumer?.kind !== "terminals" && consumer?.kind !== "assistant") {
|
|
35
|
-
throw consumerRefusal(`an organization delivery gate is minting a principal-inbox letter, but the deployment declares no principal-inbox consumer (RunnerDeps.principalInboxConsumer is absent): nobody would ever read it. Declare { assistant: "<agent handle>" }.`, "no_consumer");
|
|
34
|
+
throw consumerRefusal(`an organization delivery gate is minting a principal-inbox letter, but the deployment declares no principal-inbox consumer (RunnerDeps.principalInboxConsumer is absent): nobody would ever read it. Declare "terminals" or { assistant: "<agent handle>" }.`, "no_consumer");
|
|
36
35
|
}
|
|
37
36
|
if (typeof body.content !== "string")
|
|
38
37
|
throw new TypeError("mintCrossPrincipalRecord: body.content must be a string");
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type MailboxPeerMeta, type MailboxDecisionOutcome, type MailboxDecision } from "../core/mailbox-store.js";
|
|
2
2
|
import type { CrossSessionHoldCause, CrossSessionInboundVerdict } from "./cross-session-judge.js";
|
|
3
3
|
import { type PeerDeliveryReceiptState } from "./peer-notices.js";
|
|
4
4
|
/** The `cause` vocabulary of a `peer.inbound_disposition{disposition:"held"}` notice: the parity
|
|
5
5
|
* judge's causes plus the drain-stage gate's TRANSIENT `rate_limited` (a bucket-wait, not a review
|
|
6
6
|
* hold — it never enters the held queue; the drain stops at that seq and re-judges next pass). */
|
|
7
7
|
export type PeerInboundHoldCause = CrossSessionHoldCause | "rate_limited";
|
|
8
|
+
/** The decisions a card can stand for: held, approved, or handed over but not yet injected. */
|
|
9
|
+
export type PeerCardDecision = Extract<MailboxDecision, "held" | "approved" | "delivered">;
|
|
8
10
|
export interface PeerHeldEntry {
|
|
9
11
|
/** The recipient box seq of the held record (its identity for the review face). */
|
|
10
12
|
readonly seq: number;
|
|
@@ -21,12 +23,16 @@ export interface PeerHeldEntry {
|
|
|
21
23
|
readonly heldAt: number;
|
|
22
24
|
/** The cause last announced for this entry (re-judgment may move it). */
|
|
23
25
|
cause: CrossSessionHoldCause;
|
|
24
|
-
/**
|
|
25
|
-
*
|
|
26
|
-
|
|
26
|
+
/** The record's decision as this queue last read or wrote it: `held`; `approved` (deliverable,
|
|
27
|
+
* waiting for a lease-holding pass — a re-judgment that now refuses still wins); `delivered` (this
|
|
28
|
+
* queue took the hand-over move and the injection is still owed; a policy that now refuses ends it as `dropped`). */
|
|
29
|
+
decision: PeerCardDecision;
|
|
27
30
|
}
|
|
28
|
-
|
|
29
|
-
|
|
31
|
+
/** How an entry left this queue. `retired` — the CARD left this process but no decision was taken: the
|
|
32
|
+
* record stays held in its box for the next consumer (a queue-local event no receipt announced,
|
|
33
|
+
* or a record another consumer settled). Every other word is the record's own final fate. */
|
|
34
|
+
export type PeerHeldSettlement = "expired" | "delivered" | "refused" | "denied" | "dropped" | "retired";
|
|
35
|
+
export type PeerHeldSettleReason = "evicted" | "deadline" | "shutdown" | "rejudge" | "approved" | "denied" | "cancelled" | "inject_failed" | "superseded" | "decided_elsewhere";
|
|
30
36
|
/** The clock/timer seam (tests inject a virtual one). Handles are opaque. */
|
|
31
37
|
export interface PeerClock {
|
|
32
38
|
now(): number;
|
|
@@ -36,81 +42,95 @@ export interface PeerClock {
|
|
|
36
42
|
export declare const realPeerClock: PeerClock;
|
|
37
43
|
/** The live seats a bound run gives the queue. `inject` is the ONLY member that is run-scoped (a run's
|
|
38
44
|
* own injection lane); the others survive the run (the receipt route rides the mailbox, the judge
|
|
39
|
-
* reads the deployment's settings getter) and are what a headless
|
|
45
|
+
* reads the deployment's settings getter, the decision seat is the store) and are what a headless
|
|
46
|
+
* deadline settles through. */
|
|
40
47
|
export interface PeerHeldQueueSink {
|
|
41
48
|
/** Re-judge an entry against the recipient's CURRENT settings and mode class (CC `M`). */
|
|
42
49
|
judge: (entry: PeerHeldEntry) => CrossSessionInboundVerdict;
|
|
43
|
-
/** Deliver a
|
|
44
|
-
* the lane refused the frame
|
|
45
|
-
*
|
|
46
|
-
* pass's flush (the same wait a run-less approval takes). */
|
|
50
|
+
/** Deliver a deliverable entry into the live run's model context. Absent ⇒ no run is live. Throws ⇒
|
|
51
|
+
* the lane refused the frame. Returns `"deferred"` ⇒ the run is live but this pass's delivery budget
|
|
52
|
+
* is spent: the entry stays deliverable and goes at the next pass's flush (unless the policy refuses it first). */
|
|
47
53
|
inject?: (entry: PeerHeldEntry) => void | "deferred";
|
|
54
|
+
/** Would {@link inject} take this entry NOW (a live pass that holds this box's lease, with budget left)?
|
|
55
|
+
* Asked BEFORE the hand-over move (and before a refusal ends a handed-over card), so a process that cannot
|
|
56
|
+
* deliver never takes a move out of `delivered`. Absent ⇒
|
|
57
|
+
* the presence of `inject` decides. */
|
|
58
|
+
canInject?: (entry: PeerHeldEntry) => boolean;
|
|
48
59
|
/** The receipt to the sender (the binding routes it into the sender's box). */
|
|
49
60
|
receipt: (entry: PeerHeldEntry, state: PeerDeliveryReceiptState) => void;
|
|
61
|
+
/** Does a receipt about this entry reach a sender? A queue-local event (eviction, shutdown, a refused
|
|
62
|
+
* release) is a decision about the record exactly when it does — the sender is told it is final. */
|
|
63
|
+
tellsSender: (entry: PeerHeldEntry) => boolean;
|
|
64
|
+
/** THE decision seat: the store's compare-and-set of this entry's record (`MailboxStore.moveDecision`). */
|
|
65
|
+
decide: (entry: PeerHeldEntry, expect: MailboxDecision | undefined, next: MailboxDecision) => Promise<MailboxDecisionOutcome>;
|
|
50
66
|
/** Announce an entry entering the queue (or its cause changing on re-judgment). */
|
|
51
67
|
onHeld?: (entry: PeerHeldEntry, heldCount: number, cause: CrossSessionHoldCause, reannounce: boolean) => void;
|
|
52
68
|
/** Announce an entry leaving the queue. */
|
|
53
69
|
onSettled?: (entry: PeerHeldEntry, settlement: PeerHeldSettlement, reason: PeerHeldSettleReason, heldCount: number) => void;
|
|
70
|
+
/** A decision move the store could not take (it threw): the card stays as it was and is tried again later. */
|
|
71
|
+
onFault?: (entry: PeerHeldEntry, error: unknown) => void;
|
|
54
72
|
}
|
|
55
73
|
export interface PeerHeldQueueConfig {
|
|
56
74
|
sink: PeerHeldQueueSink;
|
|
57
75
|
/** The resolved `dialogExpiry`: ms before a REVIEW-cause hold expires; `null` = never. */
|
|
58
76
|
dialogExpiryMs: number | null;
|
|
59
77
|
}
|
|
60
|
-
|
|
78
|
+
/** The approval face's answer. `decided_elsewhere` — another consumer's move won the record first (the
|
|
79
|
+
* card now shows that state, or left the queue when it was final); `released_pending` — approved, and a
|
|
80
|
+
* lease-holding pass delivers it. */
|
|
81
|
+
export type PeerHeldSettleOutcome = "gone" | "delivered" | "released_pending" | "dropped" | "dropped_by_policy" | "denied" | "expired" | "decided_elsewhere";
|
|
82
|
+
/** What {@link PeerHeldQueue.hold} did with a record the judgment holds: `held` — this call held it
|
|
83
|
+
* (card + `held` receipt); `adopted` — it was already held (or deliverable) and this queue now shows it
|
|
84
|
+
* without a receipt; `uncarded` — held, but this queue is full and no card it carries can be settled to
|
|
85
|
+
* make room (none would tell its sender); a final word — another consumer settled it; `gone` —
|
|
86
|
+
* no such record any more; `fault` — the store refused the move (reported through `onFault`). */
|
|
87
|
+
export type PeerHoldOutcome = "held" | "adopted" | "uncarded" | "denied" | "expired" | "refused" | "dropped" | "gone" | "fault";
|
|
61
88
|
export interface PeerHeldQueue {
|
|
62
89
|
/** The registry key (scope + box). */
|
|
63
90
|
readonly key: string;
|
|
64
91
|
/** Bind (or re-bind) the live seats. Idempotent per run; a later bind replaces an earlier one. */
|
|
65
92
|
configure(cfg: PeerHeldQueueConfig): void;
|
|
66
|
-
/** The bound run ended: approvals now
|
|
93
|
+
/** The bound run ended: approvals now wait as `approved`; deadlines and receipts keep working. */
|
|
67
94
|
detachLeg(): void;
|
|
68
95
|
/** `true` once {@link configure} ran at least once (the queue can route receipts). */
|
|
69
96
|
configured(): boolean;
|
|
70
|
-
/**
|
|
71
|
-
*
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
|
|
97
|
+
/**
|
|
98
|
+
* Hold a record (CC `v` hold arm). `decision` is the record's decision in the snapshot the caller judged:
|
|
99
|
+
* absent ⇒ the move absent → `held` is taken (its winner sends the `held` receipt); `held` / `approved` ⇒
|
|
100
|
+
* the record is already held elsewhere and this queue only shows it (an approved card is not announced).
|
|
101
|
+
* At the cap, settles the oldest held card that tells its sender (it is then a decision); arms the
|
|
102
|
+
* deadline for a hold cause a person could answer.
|
|
103
|
+
*/
|
|
104
|
+
hold(entry: Omit<PeerHeldEntry, "heldAt" | "decision">, decision?: PeerCardDecision): Promise<PeerHoldOutcome>;
|
|
105
|
+
/** Re-judge every entry against current settings (CC `D`): deliverable ⇒ handed over (or kept with no
|
|
106
|
+
* live run), refused ⇒ refused with a receipt, still held ⇒ re-announced only when the cause moved.
|
|
107
|
+
* Every move goes through the decision seat. */
|
|
108
|
+
rejudge(): Promise<{
|
|
77
109
|
released: number;
|
|
78
110
|
refused: number;
|
|
79
111
|
held: number;
|
|
80
|
-
}
|
|
112
|
+
}>;
|
|
81
113
|
/**
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
114
|
+
* Bring the cards in line with the box a lease-holding drain just read, seq → the record's decision
|
|
115
|
+
* (every unacked record of the box is in it, so absence is absence): a card whose record is gone was
|
|
116
|
+
* settled by whoever held the lease meanwhile — it leaves as `retired` / `superseded`, with no receipt;
|
|
117
|
+
* a card whose record another consumer settled leaves as that final state / `decided_elsewhere`, with no
|
|
118
|
+
* receipt (the winner sent it); a card whose record another consumer approved now shows `approved`.
|
|
119
|
+
* Returns how many cards left.
|
|
88
120
|
*/
|
|
89
|
-
reconcile(
|
|
90
|
-
/** The review face (CC `l0e`): approve re-judges then delivers (or
|
|
91
|
-
* run), deny/cancel
|
|
92
|
-
|
|
121
|
+
reconcile(snapshot: ReadonlyMap<number, MailboxDecision | undefined>): number;
|
|
122
|
+
/** The review face (CC `l0e`): approve re-judges then delivers (or answers `released_pending` with no
|
|
123
|
+
* live run), deny/cancel settle with the matching receipt. `"gone"` when nothing is held under that
|
|
124
|
+
* seq. The answer is the store's: a move another consumer won answers `decided_elsewhere`. */
|
|
125
|
+
settle(seq: number, decision: "approve" | "deny" | "cancel"): Promise<PeerHeldSettleOutcome>;
|
|
126
|
+
/** Is a card for this seq in the queue? */
|
|
127
|
+
has(seq: number): boolean;
|
|
93
128
|
list(): readonly PeerHeldEntry[];
|
|
94
129
|
size(): number;
|
|
95
|
-
/** CC `HBe` — a graceful shutdown settles everything still held as `expired` with receipts
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
* #1036 — the TERMINAL DECISIONS this queue has taken about records that are still parked in
|
|
99
|
-
* the box, seq → the settlement word. Since a held record now stays in its durable box (the box is
|
|
100
|
-
* this queue's durable seat), a decision taken BETWEEN runs — a human's deny, a deadline, an
|
|
101
|
-
* eviction — has to survive the run whose ledger recorded it, or the session's next run re-judges
|
|
102
|
-
* the record from scratch and can deliver a message a person already refused. A decision is kept
|
|
103
|
-
* only until a drain that holds the lease acks past it ({@link PeerHeldQueue.forgetDecisions}); it
|
|
104
|
-
* is process-level, like the queue itself, and a crash loses it exactly as it loses the queue.
|
|
105
|
-
*/
|
|
106
|
-
decisions(): ReadonlyMap<number, PeerHeldSettlement>;
|
|
107
|
-
/** #1036 — a lease-owning drain acked these seqs out of the box: their decisions are spent. */
|
|
108
|
-
forgetDecisions(seqs: Iterable<number>): void;
|
|
130
|
+
/** CC `HBe` — a graceful shutdown settles everything still held as `expired` with receipts (where a
|
|
131
|
+
* receipt reaches a sender; elsewhere the cards just leave this process). */
|
|
132
|
+
shutdown(): Promise<void>;
|
|
109
133
|
}
|
|
110
|
-
/** #1036 — how many terminal decisions about still-parked records one box's queue remembers
|
|
111
|
-
* (see {@link PeerHeldQueue.decisions}). Several times the queue's own cap: the queue bounds what is
|
|
112
|
-
* LIVE, this bounds what has been decided and not yet observed as consumed. */
|
|
113
|
-
export declare const PEER_HELD_DECISION_MEMORY: number;
|
|
114
134
|
export declare function createPeerHeldQueue(key: string, opts?: {
|
|
115
135
|
cap?: number;
|
|
116
136
|
clock?: PeerClock;
|