@sagentlab/navarch-runtime 0.1.116 → 0.1.117
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/README.md +43 -17
- package/bin/muse-mcp-bridge.cjs +3 -0
- package/dist/adapters/index.cjs +6 -1
- package/dist/adapters/muse.cjs +433 -0
- package/dist/agent-auth.cjs +2 -1
- package/dist/config.cjs +8 -1
- package/dist/conversation/capability.cjs +1 -1
- package/dist/exit-conditions.cjs +1 -1
- package/dist/muse-mcp-bridge.cjs +167 -0
- package/dist/session.cjs +30 -8
- package/node_modules/@muse-code/sdk/LICENSE +21 -0
- package/node_modules/@muse-code/sdk/README.md +88 -0
- package/node_modules/@muse-code/sdk/dist/src/connection/connection.d.ts +149 -0
- package/node_modules/@muse-code/sdk/dist/src/connection/connection.js +581 -0
- package/node_modules/@muse-code/sdk/dist/src/connection/spawn.d.ts +188 -0
- package/node_modules/@muse-code/sdk/dist/src/connection/spawn.js +496 -0
- package/node_modules/@muse-code/sdk/dist/src/errors.d.ts +71 -0
- package/node_modules/@muse-code/sdk/dist/src/errors.js +76 -0
- package/node_modules/@muse-code/sdk/dist/src/facade/approval.d.ts +96 -0
- package/node_modules/@muse-code/sdk/dist/src/facade/approval.js +293 -0
- package/node_modules/@muse-code/sdk/dist/src/facade/client.d.ts +171 -0
- package/node_modules/@muse-code/sdk/dist/src/facade/client.js +442 -0
- package/node_modules/@muse-code/sdk/dist/src/facade/discarded.d.ts +36 -0
- package/node_modules/@muse-code/sdk/dist/src/facade/discarded.js +36 -0
- package/node_modules/@muse-code/sdk/dist/src/facade/gap-fill.d.ts +80 -0
- package/node_modules/@muse-code/sdk/dist/src/facade/gap-fill.js +388 -0
- package/node_modules/@muse-code/sdk/dist/src/facade/host-death.d.ts +139 -0
- package/node_modules/@muse-code/sdk/dist/src/facade/host-death.js +96 -0
- package/node_modules/@muse-code/sdk/dist/src/facade/host-start.d.ts +62 -0
- package/node_modules/@muse-code/sdk/dist/src/facade/host-start.js +81 -0
- package/node_modules/@muse-code/sdk/dist/src/facade/session.d.ts +309 -0
- package/node_modules/@muse-code/sdk/dist/src/facade/session.js +654 -0
- package/node_modules/@muse-code/sdk/dist/src/facade/turn-handle.d.ts +156 -0
- package/node_modules/@muse-code/sdk/dist/src/facade/turn-handle.js +271 -0
- package/node_modules/@muse-code/sdk/dist/src/facade/turn-submit.d.ts +72 -0
- package/node_modules/@muse-code/sdk/dist/src/facade/turn-submit.js +183 -0
- package/node_modules/@muse-code/sdk/dist/src/fingerprint.d.ts +37 -0
- package/node_modules/@muse-code/sdk/dist/src/fingerprint.js +54 -0
- package/node_modules/@muse-code/sdk/dist/src/fold/item-store.d.ts +110 -0
- package/node_modules/@muse-code/sdk/dist/src/fold/item-store.js +169 -0
- package/node_modules/@muse-code/sdk/dist/src/fold/session-fold.d.ts +536 -0
- package/node_modules/@muse-code/sdk/dist/src/fold/session-fold.js +427 -0
- package/node_modules/@muse-code/sdk/dist/src/fold/state-store.d.ts +68 -0
- package/node_modules/@muse-code/sdk/dist/src/fold/state-store.js +89 -0
- package/node_modules/@muse-code/sdk/dist/src/index.d.ts +65 -0
- package/node_modules/@muse-code/sdk/dist/src/index.js +57 -0
- package/node_modules/@muse-code/sdk/dist/src/msp.d.ts +3380 -0
- package/node_modules/@muse-code/sdk/dist/src/pending/pending-command-set.d.ts +361 -0
- package/node_modules/@muse-code/sdk/dist/src/pending/pending-command-set.js +468 -0
- package/node_modules/@muse-code/sdk/package.json +47 -0
- package/package.json +8 -4
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `PendingCommand`: the client-side fold over pending commands.
|
|
3
|
+
*
|
|
4
|
+
* Normative source: tdd SS4.13 (owned by decision record D-032). This module
|
|
5
|
+
* implements that subsection and does not re-derive it; every rule below
|
|
6
|
+
* quotes or cites the clause it realizes. It is **client state only** — no
|
|
7
|
+
* wire event, method, snapshot member, or durable record (INV-007), and it
|
|
8
|
+
* never crosses the wire.
|
|
9
|
+
*
|
|
10
|
+
* The full fold is `S' = f(S, server events, pending client events)`: server
|
|
11
|
+
* events remain the only source of durable truth, and a `PendingCommand`
|
|
12
|
+
* entry is a rendering of the client's own intent.
|
|
13
|
+
*
|
|
14
|
+
* The entry itself is client-local by ruling, and its join keys (`commandId`,
|
|
15
|
+
* `turnId`, `itemId`) are opaque strings by protocol rule (SS3.1.4, SS4.1).
|
|
16
|
+
* The wire vocabulary it touches is fully generated: spec 206 Phase 11
|
|
17
|
+
* (#22772) enrolled the `turn/start` ack and the `-32030` `commandRejected`
|
|
18
|
+
* registry row, so INV-001's one recorded interim exception is discharged
|
|
19
|
+
* here — nothing below restates a wire shape.
|
|
20
|
+
*
|
|
21
|
+
* Every comparison against a wire value goes through a constant ANNOTATED
|
|
22
|
+
* with the generated vocabulary (`Extract<...>`), which is what makes a
|
|
23
|
+
* misspelling a compile error. Comparing a bare literal against the open
|
|
24
|
+
* `ErrorKind`/`TurnStartDisposition` unions typechecks either way — that
|
|
25
|
+
* invisibility is precisely what the exception cost.
|
|
26
|
+
*/
|
|
27
|
+
import type { ErrorKind, MspErrorDataKind, TurnStartDisposition, TurnStartResult } from "../msp.js";
|
|
28
|
+
/**
|
|
29
|
+
* The JSON-RPC code for a durable command rejection (tdd SS3.1.2, Appendix B).
|
|
30
|
+
*
|
|
31
|
+
* `@muse-code/msp` is a types-only package, so the registry's CODE cannot be
|
|
32
|
+
* imported the way its types can. It is named exactly once, here, and
|
|
33
|
+
* `pending-command-wire-binding.test.ts` pins it to the `commandRejected` row
|
|
34
|
+
* in `schema/msp/stable/msp.schema.json` — the same pin shape
|
|
35
|
+
* `EXPECTED_SCHEMA_FINGERPRINT` uses, so a schema advance that moves the code
|
|
36
|
+
* reds this lane instead of silently leaving the SDK settling on a dead code.
|
|
37
|
+
*/
|
|
38
|
+
export declare const COMMAND_REJECTED_CODE = -32030;
|
|
39
|
+
/**
|
|
40
|
+
* The registry row's `kind`, bound to the CLOSED generated vocabulary.
|
|
41
|
+
*
|
|
42
|
+
* `ErrorKind` is open (`| (string & {})`), so a typo compared against it still
|
|
43
|
+
* typechecks. `MspErrorDataKind` is the closed registry vocabulary, so this
|
|
44
|
+
* annotation makes a misspelling fail `tsc`.
|
|
45
|
+
*/
|
|
46
|
+
export declare const COMMAND_REJECTED_KIND: Extract<MspErrorDataKind, "commandRejected">;
|
|
47
|
+
/**
|
|
48
|
+
* The ack's disposition — the generated SS3.2 vocabulary (`TurnStartDisposition`).
|
|
49
|
+
* Open: an unrecognized value is "acked, not otherwise classified" and holds
|
|
50
|
+
* like a started turn.
|
|
51
|
+
*/
|
|
52
|
+
export type PendingDisposition = TurnStartDisposition;
|
|
53
|
+
/**
|
|
54
|
+
* The ack a submit received: the turn it named, and how it was admitted.
|
|
55
|
+
*
|
|
56
|
+
* This IS the generated `turn/start` result's `turnId`/`disposition` pair, so
|
|
57
|
+
* a `TurnStartResult` off the wire is handed to `acked()` unchanged.
|
|
58
|
+
*/
|
|
59
|
+
export type PendingCommandAck = Readonly<Pick<TurnStartResult, "turnId" | "disposition">>;
|
|
60
|
+
/** An error response to a submit, or to a `commandId` replay. */
|
|
61
|
+
export interface CommandErrorResponse {
|
|
62
|
+
readonly code: number;
|
|
63
|
+
readonly kind: ErrorKind;
|
|
64
|
+
/** `commandRejected` reason, verbatim snake_case (tdd SS1.6 exemption). */
|
|
65
|
+
readonly reason?: string;
|
|
66
|
+
}
|
|
67
|
+
/** The answer to an idempotent `commandId` replay (tdd SS3.1.1). */
|
|
68
|
+
export type ReplayAnswer = {
|
|
69
|
+
readonly kind: "ack";
|
|
70
|
+
readonly ack: PendingCommandAck;
|
|
71
|
+
} | {
|
|
72
|
+
readonly kind: "error";
|
|
73
|
+
readonly error: CommandErrorResponse;
|
|
74
|
+
};
|
|
75
|
+
/** An entry, as a consumer sees it. Immutable snapshot of internal state. */
|
|
76
|
+
export interface PendingCommandEntry<I> {
|
|
77
|
+
readonly commandId: string;
|
|
78
|
+
readonly input: I;
|
|
79
|
+
readonly displayText?: string;
|
|
80
|
+
readonly ack?: PendingCommandAck;
|
|
81
|
+
/**
|
|
82
|
+
* The item the entry renders AFTER: the last item present in the client's
|
|
83
|
+
* fold at submission time (`null` = before every item). Fixed at insertion
|
|
84
|
+
* — server events folding in afterwards MUST NOT relocate it (SS4.13
|
|
85
|
+
* "Insertion point and ordering"). A snapshot join may re-anchor a kept
|
|
86
|
+
* queued entry; nothing else moves it.
|
|
87
|
+
*/
|
|
88
|
+
readonly anchorAfterItemId: string | null;
|
|
89
|
+
readonly submissionIndex: number;
|
|
90
|
+
/** Set at a snapshot join for a server-confirmed queued entry only. */
|
|
91
|
+
readonly queuedOrder?: number;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Why an entry left the set. Every retirement is triggered by a
|
|
95
|
+
* server-authored fact; the set never invents one (INV-006, SS3.1.3).
|
|
96
|
+
*/
|
|
97
|
+
export type PendingRetirement<I> =
|
|
98
|
+
/**
|
|
99
|
+
* The command materialized. `matchedBy: "userMessage"` — the
|
|
100
|
+
* `commandId`-bearing `userMessage` folded in and `itemId` is that item's
|
|
101
|
+
* OWN id (item ids and command ids are separate namespaces on the wire).
|
|
102
|
+
* `matchedBy: "activeTurn"` — a snapshot's `activeTurn.commandId` matched;
|
|
103
|
+
* no user-message item id is in hand, so `itemId` is absent and the caller
|
|
104
|
+
* renders from the snapshot's items.
|
|
105
|
+
*/
|
|
106
|
+
{
|
|
107
|
+
readonly kind: "materialized";
|
|
108
|
+
readonly commandId: string;
|
|
109
|
+
readonly matchedBy: "userMessage";
|
|
110
|
+
readonly itemId: string;
|
|
111
|
+
} | {
|
|
112
|
+
readonly kind: "materialized";
|
|
113
|
+
readonly commandId: string;
|
|
114
|
+
readonly matchedBy: "activeTurn";
|
|
115
|
+
}
|
|
116
|
+
/** Durably rejected (-32030). Nothing happened; restore the input. */
|
|
117
|
+
| {
|
|
118
|
+
readonly kind: "rejected";
|
|
119
|
+
readonly commandId: string;
|
|
120
|
+
readonly reason: string;
|
|
121
|
+
readonly input: I;
|
|
122
|
+
readonly restoreToComposer: true;
|
|
123
|
+
}
|
|
124
|
+
/** Reclaimed (D-024): the turn never launched. Restore the input. */
|
|
125
|
+
| {
|
|
126
|
+
readonly kind: "reclaimed";
|
|
127
|
+
readonly commandId: string;
|
|
128
|
+
readonly input: I;
|
|
129
|
+
readonly restoreToComposer: true;
|
|
130
|
+
}
|
|
131
|
+
/** Restart recovery settled the intake `abandoned` (SS3.1.3). */
|
|
132
|
+
| {
|
|
133
|
+
readonly kind: "abandoned";
|
|
134
|
+
readonly commandId: string;
|
|
135
|
+
readonly input: I;
|
|
136
|
+
readonly restoreToComposer: true;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* The client itself stopped retrying a nothing-admitted error. SS4.13:
|
|
140
|
+
* "a client that stops retrying MUST retire the entry back to its composer
|
|
141
|
+
* rather than leave a durable-looking echo behind."
|
|
142
|
+
*/
|
|
143
|
+
| {
|
|
144
|
+
readonly kind: "retryAbandonedByClient";
|
|
145
|
+
readonly commandId: string;
|
|
146
|
+
readonly input: I;
|
|
147
|
+
readonly restoreToComposer: true;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Ephemeral-profile host death (SS2.13 / SS4.4.3 carve-out): the client
|
|
151
|
+
* does not know what happened and MUST NOT invent it.
|
|
152
|
+
*/
|
|
153
|
+
| {
|
|
154
|
+
readonly kind: "terminalUnknown";
|
|
155
|
+
readonly commandId: string;
|
|
156
|
+
readonly input: I;
|
|
157
|
+
};
|
|
158
|
+
/** Facts a snapshot supplies for the join (tdd SS4.9.1 `state` members). */
|
|
159
|
+
export interface SnapshotJoinFacts {
|
|
160
|
+
readonly activeTurn: {
|
|
161
|
+
readonly turnId: string;
|
|
162
|
+
readonly commandId: string;
|
|
163
|
+
} | null;
|
|
164
|
+
/** Admitted-but-not-launched submits, in launch order. */
|
|
165
|
+
readonly queuedTurns: readonly {
|
|
166
|
+
readonly turnId: string;
|
|
167
|
+
readonly commandId: string;
|
|
168
|
+
}[];
|
|
169
|
+
/**
|
|
170
|
+
* `commandId`-bearing `userMessage` items in `state.items`, each paired
|
|
171
|
+
* with the item's OWN id — the caller holds both when building the facts,
|
|
172
|
+
* and the pair keeps the materialized retirement's `itemId` a real item id
|
|
173
|
+
* on the resume/reconnect path exactly as on the live path.
|
|
174
|
+
*/
|
|
175
|
+
readonly userMessageCommandIds: Iterable<{
|
|
176
|
+
readonly commandId: string;
|
|
177
|
+
readonly itemId: string;
|
|
178
|
+
}>;
|
|
179
|
+
/** The last item of the reconciled fold — where kept queued entries re-anchor. */
|
|
180
|
+
readonly lastItemId: string | null;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* The work a join leaves for the caller. The set is transport-less: it names
|
|
184
|
+
* the I/O the SS4.13 MUSTs require and the caller performs it, then feeds the
|
|
185
|
+
* answers back through `replayAnswered` / `acked`.
|
|
186
|
+
*/
|
|
187
|
+
export interface PendingJoinPlan<I> {
|
|
188
|
+
readonly retirements: readonly PendingRetirement<I>[];
|
|
189
|
+
/** Acked entries the caller MUST resolve by replaying the `commandId`. */
|
|
190
|
+
readonly mustReplay: readonly string[];
|
|
191
|
+
/**
|
|
192
|
+
* Unacked entries the caller MUST resubmit with the SAME `commandId`
|
|
193
|
+
* before any retire-to-composer — demanded once per plan (the single
|
|
194
|
+
* ordered pass that builds a plan visits each entry once), re-demanded on
|
|
195
|
+
* each new join; SS3.1.1 idempotency makes the re-demand safe. A
|
|
196
|
+
* fresh-`commandId` re-send is the double execution this ordering
|
|
197
|
+
* prevents.
|
|
198
|
+
*/
|
|
199
|
+
readonly mustResubmit: readonly string[];
|
|
200
|
+
/** Entries kept as server-confirmed pending, in their new render order. */
|
|
201
|
+
readonly kept: readonly string[];
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* The client-local pending-command set.
|
|
205
|
+
*
|
|
206
|
+
* A client that never renders optimistically simply holds no entries and the
|
|
207
|
+
* fold degenerates to SS4.1 — that is a supported mode, not a degraded one.
|
|
208
|
+
*/
|
|
209
|
+
export interface PendingCommandSetOptions {
|
|
210
|
+
/**
|
|
211
|
+
* Where `discardEphemeral()` records the ids it retired, and where every
|
|
212
|
+
* replay guard reads (SS2.13.3b "do not replay the session's `commandId`s").
|
|
213
|
+
*
|
|
214
|
+
* Injected BY REFERENCE so one client can share a single set across the
|
|
215
|
+
* sessions it opens: the clause constrains what this CLIENT does next, and a
|
|
216
|
+
* per-instance set let a FRESH `Session` replay a dead host's ids at a new
|
|
217
|
+
* host. Omitted, the set owns a private one and behaves exactly as before.
|
|
218
|
+
*/
|
|
219
|
+
readonly discardedCommandIds?: Set<string>;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Tracks the commands you have submitted that the server has not yet woven
|
|
223
|
+
* into the view: their optimistic display order, acknowledgements, replay
|
|
224
|
+
* answers at reconnect, and retirements. `Session` owns and drives one per
|
|
225
|
+
* conversation; read it through the session's pending view.
|
|
226
|
+
*/
|
|
227
|
+
export declare class PendingCommandSet<I = unknown> {
|
|
228
|
+
#private;
|
|
229
|
+
constructor(options?: PendingCommandSetOptions);
|
|
230
|
+
/**
|
|
231
|
+
* Record a submission. `anchorAfterItemId` is the last item present in the
|
|
232
|
+
* client's fold right now (SS4.13 insertion point).
|
|
233
|
+
*/
|
|
234
|
+
submitted(params: {
|
|
235
|
+
commandId: string;
|
|
236
|
+
input: I;
|
|
237
|
+
displayText?: string;
|
|
238
|
+
anchorAfterItemId?: string | null;
|
|
239
|
+
}): void;
|
|
240
|
+
/** The submit (or a replay) was acked. */
|
|
241
|
+
acked(commandId: string, ack: PendingCommandAck): void;
|
|
242
|
+
/**
|
|
243
|
+
* The submit (or a replay) answered with an error.
|
|
244
|
+
*
|
|
245
|
+
* Only a durable `commandRejected` (-32030) is a settlement. Every other
|
|
246
|
+
* error admits nothing — the other SS3.1.2 admission errors and SS1's
|
|
247
|
+
* envelope errors, `inputTooLarge` among them — so the entry HOLDS while
|
|
248
|
+
* the client retries with the same `commandId` (SS4.13 "Nothing-admitted
|
|
249
|
+
* errors are not settlements").
|
|
250
|
+
*/
|
|
251
|
+
ackErrored(commandId: string, error: CommandErrorResponse): PendingRetirement<I> | "held";
|
|
252
|
+
/**
|
|
253
|
+
* The client has decided to stop retrying a nothing-admitted error. The
|
|
254
|
+
* entry must not linger as a durable-looking echo (SS4.13).
|
|
255
|
+
*/
|
|
256
|
+
stopRetrying(commandId: string): PendingRetirement<I> | undefined;
|
|
257
|
+
/**
|
|
258
|
+
* A `userMessage` item carrying this `commandId` folded in: the entry
|
|
259
|
+
* materialized and the item replaces it at the item's own transcript
|
|
260
|
+
* position (SS4.13 "Materialized").
|
|
261
|
+
*
|
|
262
|
+
* Multi-client echo de-duplication falls out of the same join: a
|
|
263
|
+
* `userMessage` with no matching local entry is another client's
|
|
264
|
+
* submission — this returns `undefined` and the caller renders it plainly.
|
|
265
|
+
*/
|
|
266
|
+
observedUserMessage(commandId: string, itemId: string): PendingRetirement<I> | undefined;
|
|
267
|
+
/**
|
|
268
|
+
* A reclaim this client actually observed (its own reclaim ack, or any live
|
|
269
|
+
* fold D-024's lane charters). Retire immediately — same composer restore,
|
|
270
|
+
* without waiting for a snapshot join (SS4.13 "Reclaimed").
|
|
271
|
+
*/
|
|
272
|
+
observedReclaim(commandId: string): PendingRetirement<I> | undefined;
|
|
273
|
+
/**
|
|
274
|
+
* Queue movement: a `turn/started` or `turn/completed` for a turn that is
|
|
275
|
+
* NOT the entry's own.
|
|
276
|
+
*
|
|
277
|
+
* SS4.3 carries no view event for a command-intake settlement, so a
|
|
278
|
+
* post-ack rejection reaches a live client only by replay: on each such
|
|
279
|
+
* event a client holding an acked-QUEUED entry MUST re-verify it by
|
|
280
|
+
* replaying its `commandId`. Queue movement is the trigger precisely
|
|
281
|
+
* because a queued turn's fate is decided at its launch boundary — no
|
|
282
|
+
* polling loop and no invented timeout (SS3.1.3 stays intact).
|
|
283
|
+
*
|
|
284
|
+
* @returns the `commandId`s the caller must replay.
|
|
285
|
+
*/
|
|
286
|
+
observedQueueMovement(turnId: string): readonly string[];
|
|
287
|
+
/**
|
|
288
|
+
* Feed back a `commandId` replay answer (SS3.1.1 — always safe).
|
|
289
|
+
*
|
|
290
|
+
* Three shapes, per SS4.13's rejected/abandoned arms:
|
|
291
|
+
* - a durable rejection: retire (reason `"abandoned"` → Abandoned arm,
|
|
292
|
+
* any other reason → Rejected arm);
|
|
293
|
+
* - the original ack, still pending: keep waiting;
|
|
294
|
+
* - an ack whose staleness only a snapshot can prove: keep waiting — the
|
|
295
|
+
* reclaimed signature needs `queuedTurns` in hand (`joinSnapshot`).
|
|
296
|
+
*/
|
|
297
|
+
replayAnswered(commandId: string, answer: ReplayAnswer): PendingRetirement<I> | "held";
|
|
298
|
+
/**
|
|
299
|
+
* Reconnect with NO snapshot (`history.mode: "none"`, the default
|
|
300
|
+
* cursor-resume path). There is no join to run, so reconnect itself is the
|
|
301
|
+
* trigger: replay each ACKED entry's `commandId` once; resubmit each
|
|
302
|
+
* UNACKED entry's same `commandId` once before any retire-to-composer.
|
|
303
|
+
*
|
|
304
|
+
* Without `queuedTurns` in hand the reclaimed signature is undecidable, so
|
|
305
|
+
* a stale `"queued"` ack waits for the next snapshot join or queue
|
|
306
|
+
* movement — never a locally invented terminal.
|
|
307
|
+
*/
|
|
308
|
+
reconnectedWithoutSnapshot(): PendingJoinPlan<I>;
|
|
309
|
+
/**
|
|
310
|
+
* Join local entries against an authoritative snapshot (SS4.9), by
|
|
311
|
+
* `commandId`. The five arms, in the order SS4.13 states them.
|
|
312
|
+
*/
|
|
313
|
+
joinSnapshot(facts: SnapshotJoinFacts): PendingJoinPlan<I>;
|
|
314
|
+
/**
|
|
315
|
+
* The reclaimed signature, decidable only with a snapshot in hand: an
|
|
316
|
+
* acked-queued entry ABSENT from the snapshot's `queuedTurns` whose replay
|
|
317
|
+
* still answers the stale `"queued"` ack retires as *reclaimed* at the
|
|
318
|
+
* snapshot join (SS4.13 "Reclaimed").
|
|
319
|
+
*
|
|
320
|
+
* Call this with the replay answer for a `mustReplay` entry produced by
|
|
321
|
+
* `joinSnapshot`, passing the same snapshot's `queuedTurns` commandIds.
|
|
322
|
+
*/
|
|
323
|
+
resolveReplayAtJoin(commandId: string, answer: ReplayAnswer, snapshotQueuedCommandIds: Iterable<string>): PendingRetirement<I> | "held";
|
|
324
|
+
/**
|
|
325
|
+
* Abnormal death of an EPHEMERAL-profile host (SS2.13, SS4.4.3 carve-out):
|
|
326
|
+
* nothing is ever settled, replaying a `commandId` at a new host is
|
|
327
|
+
* forbidden, and every entry falls under the discard obligation as
|
|
328
|
+
* terminal-unknown — a client-side annotation, never a wire fact.
|
|
329
|
+
*/
|
|
330
|
+
discardEphemeral(): readonly PendingRetirement<I>[];
|
|
331
|
+
/** Has the ephemeral discard closed this set? */
|
|
332
|
+
get discarded(): boolean;
|
|
333
|
+
/**
|
|
334
|
+
* Entries in render order.
|
|
335
|
+
*
|
|
336
|
+
* Before any join this is submission order. After a join, entries the
|
|
337
|
+
* server confirmed queued are re-anchored to the end of the reconciled
|
|
338
|
+
* fold and ordered among themselves by `queuedTurns` — so they sort after
|
|
339
|
+
* the submission-anchored entries (steers and unacked), which keep their
|
|
340
|
+
* own anchors. That is SS4.13's "entries render in submission order, and
|
|
341
|
+
* for queued submits the server-confirmed order wins whenever it is
|
|
342
|
+
* observed".
|
|
343
|
+
*/
|
|
344
|
+
list(): readonly PendingCommandEntry<I>[];
|
|
345
|
+
get(commandId: string): PendingCommandEntry<I> | undefined;
|
|
346
|
+
has(commandId: string): boolean;
|
|
347
|
+
get size(): number;
|
|
348
|
+
/**
|
|
349
|
+
* Only a durable `commandRejected` (-32030) settles a command. Everything
|
|
350
|
+
* else admitted nothing (SS4.13).
|
|
351
|
+
*
|
|
352
|
+
* The registry binds `-32030` <-> `commandRejected` one-to-one (SS3.1.2
|
|
353
|
+
* Appendix B), so a response where the two fields DISAGREE is a server
|
|
354
|
+
* fault in which one field still asserts the durable rejection. Either
|
|
355
|
+
* signal settles (OR): SS3.1.2's stated bias for unfamiliar vocabulary is
|
|
356
|
+
* toward terminal ("treat unknown reasons as terminal rejections"), and
|
|
357
|
+
* holding forever on a half-asserted rejection strands the entry as the
|
|
358
|
+
* durable-looking echo SS4.13 forbids.
|
|
359
|
+
*/
|
|
360
|
+
static isSettlement(error: CommandErrorResponse): boolean;
|
|
361
|
+
}
|