botmux 3.11.0 → 3.12.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/dist/.runtime-build-id +1 -1
- package/dist/adapters/backend/riff-backend.d.ts.map +1 -1
- package/dist/adapters/backend/riff-backend.js +11 -2
- package/dist/adapters/backend/riff-backend.js.map +1 -1
- package/dist/adapters/cli/coco.js +3 -3
- package/dist/adapters/cli/coco.js.map +1 -1
- package/dist/adapters/cli/codex.js +2 -2
- package/dist/adapters/cli/codex.js.map +1 -1
- package/dist/cli/dashboard-command.d.ts +23 -0
- package/dist/cli/dashboard-command.d.ts.map +1 -0
- package/dist/cli/dashboard-command.js +61 -0
- package/dist/cli/dashboard-command.js.map +1 -0
- package/dist/cli/dashboard-endpoint.d.ts +3 -3
- package/dist/cli/dashboard-endpoint.d.ts.map +1 -1
- package/dist/cli/dashboard-endpoint.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +36 -22
- package/dist/cli.js.map +1 -1
- package/dist/codex-rpc-engine.d.ts +33 -3
- package/dist/codex-rpc-engine.d.ts.map +1 -1
- package/dist/codex-rpc-engine.js +182 -20
- package/dist/codex-rpc-engine.js.map +1 -1
- package/dist/codex-rpc-lifecycle.d.ts +42 -7
- package/dist/codex-rpc-lifecycle.d.ts.map +1 -1
- package/dist/codex-rpc-lifecycle.js +73 -7
- package/dist/codex-rpc-lifecycle.js.map +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.js +1 -1
- package/dist/core/command-handler.d.ts +3 -2
- package/dist/core/command-handler.d.ts.map +1 -1
- package/dist/core/command-handler.js +3 -2
- package/dist/core/command-handler.js.map +1 -1
- package/dist/core/dashboard-ipc-server.d.ts.map +1 -1
- package/dist/core/dashboard-ipc-server.js +15 -10
- package/dist/core/dashboard-ipc-server.js.map +1 -1
- package/dist/core/dispatch.d.ts +9 -10
- package/dist/core/dispatch.d.ts.map +1 -1
- package/dist/core/dispatch.js +17 -10
- package/dist/core/dispatch.js.map +1 -1
- package/dist/core/role-resolver.d.ts +5 -2
- package/dist/core/role-resolver.d.ts.map +1 -1
- package/dist/core/role-resolver.js +55 -23
- package/dist/core/role-resolver.js.map +1 -1
- package/dist/core/session-manager.d.ts +2 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +20 -18
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/terminal-write-auth.d.ts +4 -4
- package/dist/core/terminal-write-auth.d.ts.map +1 -1
- package/dist/core/terminal-write-auth.js +18 -6
- package/dist/core/terminal-write-auth.js.map +1 -1
- package/dist/daemon.d.ts +1 -0
- package/dist/daemon.d.ts.map +1 -1
- package/dist/daemon.js +101 -12
- package/dist/daemon.js.map +1 -1
- package/dist/dashboard/auth.d.ts +21 -11
- package/dist/dashboard/auth.d.ts.map +1 -1
- package/dist/dashboard/auth.js +39 -25
- package/dist/dashboard/auth.js.map +1 -1
- package/dist/dashboard/bot-payload.d.ts +0 -1
- package/dist/dashboard/bot-payload.d.ts.map +1 -1
- package/dist/dashboard/bot-payload.js +0 -1
- package/dist/dashboard/bot-payload.js.map +1 -1
- package/dist/dashboard/dashboard-summary-endpoint.d.ts +39 -0
- package/dist/dashboard/dashboard-summary-endpoint.d.ts.map +1 -0
- package/dist/dashboard/dashboard-summary-endpoint.js +50 -0
- package/dist/dashboard/dashboard-summary-endpoint.js.map +1 -0
- package/dist/dashboard/dashboard-summary.d.ts +62 -0
- package/dist/dashboard/dashboard-summary.d.ts.map +1 -0
- package/dist/dashboard/dashboard-summary.js +106 -0
- package/dist/dashboard/dashboard-summary.js.map +1 -0
- package/dist/dashboard/web/feed-group-picker.d.ts +13 -0
- package/dist/dashboard/web/feed-group-picker.d.ts.map +1 -0
- package/dist/dashboard/web/feed-group-picker.js +45 -0
- package/dist/dashboard/web/feed-group-picker.js.map +1 -0
- package/dist/dashboard/web/groups-page.d.ts.map +1 -1
- package/dist/dashboard/web/groups-page.js +2 -5
- package/dist/dashboard/web/groups-page.js.map +1 -1
- package/dist/dashboard/web/i18n.d.ts.map +1 -1
- package/dist/dashboard/web/i18n.js +8 -14
- package/dist/dashboard/web/i18n.js.map +1 -1
- package/dist/dashboard/web/roles-page.d.ts.map +1 -1
- package/dist/dashboard/web/roles-page.js +36 -4
- package/dist/dashboard/web/roles-page.js.map +1 -1
- package/dist/dashboard/web/roles.d.ts +3 -1
- package/dist/dashboard/web/roles.d.ts.map +1 -1
- package/dist/dashboard/web/roles.js +10 -2
- package/dist/dashboard/web/roles.js.map +1 -1
- package/dist/dashboard/web/schedules-page.d.ts.map +1 -1
- package/dist/dashboard/web/schedules-page.js +8 -2
- package/dist/dashboard/web/schedules-page.js.map +1 -1
- package/dist/dashboard/web/sessions-page.d.ts.map +1 -1
- package/dist/dashboard/web/sessions-page.js +2 -2
- package/dist/dashboard/web/sessions-page.js.map +1 -1
- package/dist/dashboard-web/app.js +1 -1
- package/dist/dashboard-web/chunks/{bot-defaults-page-GED4FEMS.js → bot-defaults-page-USC6EZXP.js} +1 -1
- package/dist/dashboard-web/chunks/chunk-6ALR252E.js +1 -0
- package/dist/dashboard-web/chunks/{chunk-VBXJOJFH.js → chunk-A7VC4BXR.js} +1 -1
- package/dist/dashboard-web/chunks/{chunk-HK7NIBJG.js → chunk-KOPISPHN.js} +1 -1
- package/dist/dashboard-web/chunks/{chunk-6J5LS5AU.js → chunk-M6BHWQFO.js} +6 -6
- package/dist/dashboard-web/chunks/{chunk-KRHWZEXU.js → chunk-RXRJB5SO.js} +1 -1
- package/dist/dashboard-web/chunks/{connectors-page-EELM66G3.js → connectors-page-4Z76HWRH.js} +1 -1
- package/dist/dashboard-web/chunks/groups-page-C6NSDTIN.js +8 -0
- package/dist/dashboard-web/chunks/{insights-page-54UBPPOC.js → insights-page-UTOVYLLY.js} +1 -1
- package/dist/dashboard-web/chunks/{monitor-room-PORHVKRH.js → monitor-room-UKTJYTA2.js} +1 -1
- package/dist/dashboard-web/chunks/{monitoring-page-XGA7AXNL.js → monitoring-page-Q3CEZIVX.js} +1 -1
- package/dist/dashboard-web/chunks/{office-page-AO3AFG45.js → office-page-GYCZOOVJ.js} +1 -1
- package/dist/dashboard-web/chunks/{overview-page-F5BUTYR6.js → overview-page-W2VBJ6OH.js} +1 -1
- package/dist/dashboard-web/chunks/roles-page-U4SHER4K.js +1 -0
- package/dist/dashboard-web/chunks/schedules-page-TNPW3N3Q.js +1 -0
- package/dist/dashboard-web/chunks/{sessions-page-YFRPSTIL.js → sessions-page-YWWDDV57.js} +3 -3
- package/dist/dashboard-web/chunks/{settings-page-OJAZLZQT.js → settings-page-VKW5ZK5K.js} +1 -1
- package/dist/dashboard-web/chunks/{skills-page-EFZQPWV4.js → skills-page-ZCEDFGZZ.js} +1 -1
- package/dist/dashboard-web/chunks/{team-federation-page-ZJVAP7HW.js → team-federation-page-OMFGGBT2.js} +1 -1
- package/dist/dashboard-web/chunks/{v3-page-GYWTRGO2.js → v3-page-PLXWK4KO.js} +1 -1
- package/dist/dashboard-web/chunks/{whiteboards-page-MSDAG6P7.js → whiteboards-page-NJQOEO2P.js} +1 -1
- package/dist/dashboard-web/style.css +112 -0
- package/dist/dashboard.js +116 -31
- package/dist/dashboard.js.map +1 -1
- package/dist/desktop/main/ipc.js +1 -1
- package/dist/desktop/main/runtime-service.js +2 -2
- package/dist/desktop/main/runtime-service.js.map +1 -1
- package/dist/desktop/shared/types.d.ts +1 -1
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +3 -1
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/zh.d.ts.map +1 -1
- package/dist/i18n/zh.js +3 -1
- package/dist/i18n/zh.js.map +1 -1
- package/dist/services/adopt-input-sequence.d.ts +52 -0
- package/dist/services/adopt-input-sequence.d.ts.map +1 -0
- package/dist/services/adopt-input-sequence.js +50 -0
- package/dist/services/adopt-input-sequence.js.map +1 -0
- package/dist/services/bridge-fallback-gate.d.ts.map +1 -1
- package/dist/services/bridge-fallback-gate.js +34 -11
- package/dist/services/bridge-fallback-gate.js.map +1 -1
- package/dist/services/codex-bridge-queue.d.ts +103 -7
- package/dist/services/codex-bridge-queue.d.ts.map +1 -1
- package/dist/services/codex-bridge-queue.js +291 -17
- package/dist/services/codex-bridge-queue.js.map +1 -1
- package/dist/services/codex-transcript.d.ts +4 -3
- package/dist/services/codex-transcript.d.ts.map +1 -1
- package/dist/services/codex-transcript.js.map +1 -1
- package/dist/services/structured-bridge-clis.d.ts +8 -1
- package/dist/services/structured-bridge-clis.d.ts.map +1 -1
- package/dist/services/structured-bridge-clis.js +13 -0
- package/dist/services/structured-bridge-clis.js.map +1 -1
- package/dist/services/submit-confirmation.d.ts +50 -0
- package/dist/services/submit-confirmation.d.ts.map +1 -1
- package/dist/services/submit-confirmation.js +82 -0
- package/dist/services/submit-confirmation.js.map +1 -1
- package/dist/utils/async-serial-queue.d.ts +9 -0
- package/dist/utils/async-serial-queue.d.ts.map +1 -0
- package/dist/utils/async-serial-queue.js +13 -0
- package/dist/utils/async-serial-queue.js.map +1 -0
- package/dist/utils/runtime-screen-status.d.ts +52 -0
- package/dist/utils/runtime-screen-status.d.ts.map +1 -0
- package/dist/utils/runtime-screen-status.js +60 -0
- package/dist/utils/runtime-screen-status.js.map +1 -0
- package/dist/worker.js +1642 -452
- package/dist/worker.js.map +1 -1
- package/package.json +1 -1
- package/dist/dashboard-web/chunks/groups-page-WKUV6E42.js +0 -8
- package/dist/dashboard-web/chunks/roles-page-M5GIASJU.js +0 -1
- package/dist/dashboard-web/chunks/schedules-page-O232WQRR.js +0 -1
|
@@ -10,17 +10,21 @@
|
|
|
10
10
|
* Rules:
|
|
11
11
|
* - Non-adopt + sentinel terminator: the model ended its final with a
|
|
12
12
|
* standalone `BOTMUX_NOTHING_TO_SEND` (or the legacy `BOTMUX_NO_REPLY`)
|
|
13
|
-
* line.
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* · PROSE remains
|
|
19
|
-
*
|
|
20
|
-
* with the sentinel
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
13
|
+
* line. Sub-cases:
|
|
14
|
+
* · NOTHING remains after stripping the sentinel → genuine silence (#554):
|
|
15
|
+
* the model was triggered but deliberately produced no answer (ambient
|
|
16
|
+
* group chatter, or a message addressed to another bot). Suppress the
|
|
17
|
+
* whole turn. isBridgeNothingToSendFinal.
|
|
18
|
+
* · PROSE remains AND the model ALREADY sent ≥1 message in-window → the
|
|
19
|
+
* trailing prose is narration / thinking the model kept out of chat and
|
|
20
|
+
* then ended with the sentinel. SUPPRESS (do not re-post it as a new
|
|
21
|
+
* answer — the length heuristic would otherwise mistake longer narration
|
|
22
|
+
* for a substantive final). This is the "already sent, then narrated,
|
|
23
|
+
* ended with sentinel" leak the send-marker branch guards.
|
|
24
|
+
* · PROSE remains AND the model sent NOTHING in-window → the prose is a
|
|
25
|
+
* real answer produced but never sent (ghosting). Do NOT drop it: callers
|
|
26
|
+
* strip the sentinel line and forward the prose (empty marker set → not
|
|
27
|
+
* suppressed).
|
|
24
28
|
* A token that only appears inline (mid-sentence, or with prose after it) is
|
|
25
29
|
* a normal answer and is left untouched.
|
|
26
30
|
* - Adopt mode never suppresses: in /adopt the model in the adopted
|
|
@@ -228,6 +232,25 @@ export function shouldSuppressBridgeEmit(turn, nextBoundaryMs, markers, adoptMod
|
|
|
228
232
|
const lower = turn.markTimeMs;
|
|
229
233
|
const upper = nextBoundaryMs ?? Number.POSITIVE_INFINITY;
|
|
230
234
|
const markersInWindow = markers.filter(m => m.sentAtMs >= lower && m.sentAtMs < upper);
|
|
235
|
+
// A trailing sentinel line is the model's explicit "I have nothing more to
|
|
236
|
+
// send" signal. Split the two prose+sentinel cases by whether the model
|
|
237
|
+
// ALREADY sent this turn:
|
|
238
|
+
// · sent ≥1 in-window + trailing sentinel → the trailing prose is narration
|
|
239
|
+
// / thinking the model deliberately kept out of chat (it explicitly ended
|
|
240
|
+
// with the sentinel after sending). SUPPRESS — do NOT let the length
|
|
241
|
+
// heuristic below mistake longer narration for a new substantive answer
|
|
242
|
+
// and re-post it. This is the "already sent, then narrated, ended with
|
|
243
|
+
// sentinel" leak.
|
|
244
|
+
// · zero sends in-window + trailing sentinel → the prose is a real answer
|
|
245
|
+
// the model produced but never sent (ghosting). Fall through: the
|
|
246
|
+
// stripped prose is forwarded by the length check below (markers empty →
|
|
247
|
+
// markerSetCoversFinal=false → not suppressed → caller posts it).
|
|
248
|
+
// A final WITHOUT a trailing sentinel keeps the pure length-based behavior.
|
|
249
|
+
if (turn.finalText !== undefined
|
|
250
|
+
&& hasTrailingBridgeSentinelLine(turn.finalText)
|
|
251
|
+
&& markersInWindow.length > 0) {
|
|
252
|
+
return true;
|
|
253
|
+
}
|
|
231
254
|
// Compare the SENTINEL-STRIPPED final against send markers: a prose+sentinel
|
|
232
255
|
// final is delivered as the stripped prose (callers strip before send), so the
|
|
233
256
|
// length used for the material-longer check must match what actually posts —
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge-fallback-gate.js","sourceRoot":"","sources":["../../src/services/bridge-fallback-gate.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"bridge-fallback-gate.js","sourceRoot":"","sources":["../../src/services/bridge-fallback-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,MAAM,2BAA2B,GAAG,CAAC,CAAC;AACtC,MAAM,8BAA8B,GAAG,GAAG,CAAC;AAE3C,MAAM,CAAC,MAAM,+BAA+B,GAAG,wBAAwB,CAAC;AACxE;;;;;iDAKiD;AACjD,MAAM,CAAC,MAAM,+BAA+B,GAAG,iBAAiB,CAAC;AAEjE,MAAM,sBAAsB,GAAsB;IAChD,+BAA+B;IAC/B,+BAA+B;CAChC,CAAC;AAEF,MAAM,UAAU,0B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AC;AAC7E,CAAC"}
|
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
import type { CodexBridgeEvent } from './codex-transcript.js';
|
|
2
|
+
/** A verified submit may be parked in a type-ahead queue before its transcript
|
|
3
|
+
* user event is written. Keep that hand-off busy for a bounded interval: long
|
|
4
|
+
* enough for the active turn to finish and dequeue it, but never forever if
|
|
5
|
+
* the CLI accepted the keypress without producing a structured event. */
|
|
6
|
+
export declare const STRUCTURED_SUBMIT_START_GRACE_MS = 20000;
|
|
7
|
+
/** Maximum time an unconfirmed worker mark may remain at the attribution
|
|
8
|
+
* head after the adapter write/verification path stops. This lease never
|
|
9
|
+
* contributes to lifecycle busy: it exists only so a late transcript user
|
|
10
|
+
* event can still claim the mark without allowing a silent write to wedge
|
|
11
|
+
* every later turn forever. */
|
|
12
|
+
export declare const STRUCTURED_UNCONFIRMED_ATTRIBUTION_GRACE_MS = 20000;
|
|
13
|
+
/** Maximum time a worker may wait for an adapter/history verification call.
|
|
14
|
+
* This covers Codex/CoCo's in-band polling plus the 20s deferred recheck,
|
|
15
|
+
* while remaining bounded if an adapter promise or recheck is stranded. */
|
|
16
|
+
export declare const STRUCTURED_SUBMIT_VERIFICATION_GRACE_MS = 30000;
|
|
2
17
|
export interface CodexPendingTurn {
|
|
3
18
|
turnId: string;
|
|
4
19
|
dispatchAttempt?: number;
|
|
@@ -8,6 +23,17 @@ export interface CodexPendingTurn {
|
|
|
8
23
|
* the lower bound of the "did `botmux send` happen for this turn?"
|
|
9
24
|
* window. Optional only for legacy / test-injected turns. */
|
|
10
25
|
markTimeMs?: number;
|
|
26
|
+
/** Wall-clock millis when an authoritative adapter/history check confirmed
|
|
27
|
+
* the submit. Unverified writes deliberately leave this unset. */
|
|
28
|
+
submitConfirmedAtMs?: number;
|
|
29
|
+
/** Wall-clock millis anchoring the bounded attribution-only lease for an
|
|
30
|
+
* unconfirmed mark. Unlike verification/confirmation leases, this never
|
|
31
|
+
* gates screen-ready or reports the CLI busy. */
|
|
32
|
+
unconfirmedAttributionStartedAtMs?: number;
|
|
33
|
+
/** Wall-clock millis when worker-side authoritative submit verification
|
|
34
|
+
* began. This closes the race where screen-ready arrives while writeInput
|
|
35
|
+
* is still polling history, before it can return `submitted: true`. */
|
|
36
|
+
submitVerificationStartedAtMs?: number;
|
|
11
37
|
/** Set once an assistant_final event closes this turn. */
|
|
12
38
|
finalText?: string;
|
|
13
39
|
/** Explicit transcript terminal semantics. Undefined keeps the historical
|
|
@@ -24,8 +50,17 @@ export interface CodexPendingTurn {
|
|
|
24
50
|
* assistant reply so the Lark thread sees both sides of the exchange. */
|
|
25
51
|
userText?: string;
|
|
26
52
|
sourceSessionId?: string;
|
|
53
|
+
/** True when the turn was delivered via Codex RPC (turn/start) and the
|
|
54
|
+
* app-server has acknowledged it. RPC turns have no local transcript to
|
|
55
|
+
* ingest, so they can never reach the started state; this flag keeps the
|
|
56
|
+
* lifecycle gate asserted for the full server-side execution instead of
|
|
57
|
+
* letting the bounded 20s confirmation lease expire mid-turn (which would
|
|
58
|
+
* falsely release idle and prune a still-running turn). Cleared by the
|
|
59
|
+
* terminal edge or an explicit stop. */
|
|
60
|
+
rpcActive?: boolean;
|
|
27
61
|
}
|
|
28
62
|
export declare class CodexBridgeQueue {
|
|
63
|
+
private readonly now;
|
|
29
64
|
private seen;
|
|
30
65
|
private queue;
|
|
31
66
|
private collecting;
|
|
@@ -36,6 +71,7 @@ export declare class CodexBridgeQueue {
|
|
|
36
71
|
* fresh-empty attach replaying historical iTerm conversation as
|
|
37
72
|
* "live" local input. Typically set to the moment adopt was wired up. */
|
|
38
73
|
private localLowerBoundMs;
|
|
74
|
+
constructor(now?: () => number);
|
|
39
75
|
/** Register events as historical without producing pending-turn side
|
|
40
76
|
* effects. Used at attach time when resume mode wants to swallow prior
|
|
41
77
|
* conversation as already-processed. */
|
|
@@ -53,22 +89,82 @@ export declare class CodexBridgeQueue {
|
|
|
53
89
|
/** Drop all pending turns. Used when the worker decides it can't reliably
|
|
54
90
|
* attribute future events (e.g. a teardown). */
|
|
55
91
|
clearPending(): CodexPendingTurn[];
|
|
56
|
-
/** Remove one exact worker delivery attempt
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
|
|
92
|
+
/** Remove one exact worker delivery attempt. Submit-confirmation cleanup is
|
|
93
|
+
* pre-start-only by default: once the transcript has started a turn, only a
|
|
94
|
+
* structured terminal may retire it. An authoritative failed/ambiguous
|
|
95
|
+
* terminal may opt into removing a started attempt via `allowStarted`.
|
|
96
|
+
* Matching dispatchAttempt keeps a replay of the same turnId isolated from
|
|
97
|
+
* the retired delivery attempt. */
|
|
98
|
+
dropPendingTurn(turnId: string, dispatchAttempt?: number, allowStarted?: boolean): CodexPendingTurn | null;
|
|
99
|
+
/** Remove expired pre-start queue heads that never reached transcript
|
|
100
|
+
* start, whether positively confirmed or only retained for attribution.
|
|
101
|
+
* Only the first unresolved fingerprint(s) are eligible, and never
|
|
102
|
+
* while an earlier started turn is still running: that predecessor's final
|
|
103
|
+
* is the dequeue boundary that refreshes the next legitimate type-ahead
|
|
104
|
+
* lease. Dropping a stale head replays buffered events immediately, so a
|
|
105
|
+
* later real turn can become started instead of remaining hidden behind a
|
|
106
|
+
* dead fingerprint. */
|
|
107
|
+
pruneExpiredPreStartHeads(nowMs?: number): CodexPendingTurn[];
|
|
108
|
+
/** Record positive submit evidence from an adapter/history check. The turn
|
|
109
|
+
* can still be waiting in the CLI's type-ahead queue, so this starts a
|
|
110
|
+
* bounded hand-off lease until its transcript user event appears. */
|
|
111
|
+
confirmPendingTurn(turnId: string, confirmedAtMs?: number, dispatchAttempt?: number): boolean;
|
|
112
|
+
/** Mark a turn as actively running server-side via Codex RPC. The app-server
|
|
113
|
+
* ack for turn/start is authoritative confirmation that execution has begun,
|
|
114
|
+
* but no local transcript event will follow to flip started. This flag keeps
|
|
115
|
+
* the lifecycle gate asserted and protects the turn from lease expiry pruning
|
|
116
|
+
* until the terminal edge (or an explicit stop) clears it. */
|
|
117
|
+
markRpcActive(turnId: string, dispatchAttempt?: number): boolean;
|
|
118
|
+
/** Clear the server-side active flag when an RPC turn reaches a terminal edge
|
|
119
|
+
* or is otherwise retired. Without this, a completed RPC turn would keep the
|
|
120
|
+
* lifecycle gate asserted forever (permanent false-busy). */
|
|
121
|
+
stopRpcActive(turnId: string, dispatchAttempt?: number): boolean;
|
|
122
|
+
/** Start bounded adapter/history verification before awaiting writeInput. */
|
|
123
|
+
beginSubmitVerification(turnId: string, startedAtMs?: number, dispatchAttempt?: number): boolean;
|
|
124
|
+
/** Finish verification without positive submit evidence. A bare mark remains
|
|
125
|
+
* available for transcript attribution but no longer gates screen-ready. */
|
|
126
|
+
finishSubmitVerification(turnId: string, finishedAtMs?: number, dispatchAttempt?: number): boolean;
|
|
127
|
+
/** Exact-attempt existence check for deferred callbacks. A replay reuses
|
|
128
|
+
* turnId with a higher dispatchAttempt, so an old timer must treat that as
|
|
129
|
+
* a missing target rather than mutating the new delivery generation. */
|
|
130
|
+
hasPendingTurn(turnId: string, dispatchAttempt?: number): boolean;
|
|
131
|
+
/** True when buffered transcript replay has already closed this exact turn
|
|
132
|
+
* before its RPC turn/start continuation installs rpcActive. */
|
|
133
|
+
hasTerminalTurn(turnId: string, dispatchAttempt?: number): boolean;
|
|
134
|
+
/** True while the transcript proves a turn is running, or while a verified
|
|
135
|
+
* submit is in the bounded pre-start hand-off window. A bare worker mark is
|
|
136
|
+
* never authoritative, preventing a dropped Enter from causing permanent
|
|
137
|
+
* false-busy. */
|
|
138
|
+
hasBlockingTurn(nowMs?: number): boolean;
|
|
139
|
+
/** Remaining bounded pre-start verification/confirmation lease. The worker
|
|
140
|
+
* uses this to re-drive a previously rejected ready signal once every active
|
|
141
|
+
* lease expires. Started turns return undefined because their eventual
|
|
142
|
+
* assistant_final is the authoritative re-drive. */
|
|
143
|
+
preStartLeaseRemainingMs(nowMs?: number): number | undefined;
|
|
61
144
|
/** Process newly-appended events. Idempotent on uuid: events with seen
|
|
62
145
|
* uuids are skipped, so callers can replay safely. */
|
|
63
146
|
ingest(events: CodexBridgeEvent[]): void;
|
|
64
147
|
private replayBufferedUnmatched;
|
|
65
148
|
private rememberUnmatched;
|
|
149
|
+
/** Refresh the next queued submit from the locally-observed terminal edge.
|
|
150
|
+
* External transcript clocks may be skewed, so lease boundedness must use
|
|
151
|
+
* this process's clock for both successful and aborted predecessors. */
|
|
152
|
+
private refreshNextPreStartLease;
|
|
66
153
|
private ingestOne;
|
|
67
|
-
/** Pop FIFO any leading turn that is started AND observed
|
|
68
|
-
* Empty final text
|
|
154
|
+
/** Pop FIFO any leading turn that is started AND observed a terminal edge.
|
|
155
|
+
* Empty final text closes a durable turn without producing final_output. */
|
|
69
156
|
drainEmittable(): CodexPendingTurn[];
|
|
70
157
|
size(): number;
|
|
71
158
|
/** Test helper — peek the queue without mutating. */
|
|
72
159
|
peek(): readonly CodexPendingTurn[];
|
|
73
160
|
}
|
|
161
|
+
/** Explicit mutation boundary for lease expiry. Pruning can replay a buffered
|
|
162
|
+
* successor user+final pair, so callers must drain/emit in the same call
|
|
163
|
+
* stack; keeping that invariant here prevents a status/query path from
|
|
164
|
+
* silently creating an unconsumed completion. */
|
|
165
|
+
export declare function pruneExpiredPreStartHeadsAndEmit(queue: CodexBridgeQueue, emitReady: () => void, nowMs?: number,
|
|
166
|
+
/** Settle exact durable attempts before a replayed successor is emitted.
|
|
167
|
+
* The queue removal can expose buffered successor user/final events, so
|
|
168
|
+
* running this after emitReady would publish N+1 ahead of N's terminal. */
|
|
169
|
+
onDropped?: (dropped: readonly CodexPendingTurn[]) => void): CodexPendingTurn[];
|
|
74
170
|
//# sourceMappingURL=codex-bridge-queue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex-bridge-queue.d.ts","sourceRoot":"","sources":["../../src/services/codex-bridge-queue.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"codex-bridge-queue.d.ts","sourceRoot":"","sources":["../../src/services/codex-bridge-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