@letta-ai/letta-code 0.34.5 → 0.34.6
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/gateway-core.js +5 -5
- package/dist/gateway-core.js.map +3 -3
- package/dist/mcp-client.js +2 -2
- package/dist/mcp-client.js.map +1 -1
- package/dist/mcp-oauth.js +2 -2
- package/dist/mcp-oauth.js.map +1 -1
- package/dist/types/agent/acting-user.d.ts +10 -0
- package/dist/types/agent/acting-user.d.ts.map +1 -1
- package/dist/types/agent/approval-execution.d.ts +5 -1
- package/dist/types/agent/approval-execution.d.ts.map +1 -1
- package/dist/types/agent/message.d.ts +3 -1
- package/dist/types/agent/message.d.ts.map +1 -1
- package/dist/types/agent/subagents/manager.d.ts +1 -1
- package/dist/types/agent/subagents/manager.d.ts.map +1 -1
- package/dist/types/agent/subagents/subagent-launcher.d.ts.map +1 -1
- package/dist/types/agent/subagents/subagent-stream.d.ts.map +1 -1
- package/dist/types/backend/api/agent-message.d.ts +1 -1
- package/dist/types/backend/api/agent-message.d.ts.map +1 -1
- package/dist/types/backend/api/conversation-enqueue.d.ts +4 -2
- package/dist/types/backend/api/conversation-enqueue.d.ts.map +1 -1
- package/dist/types/channels/gateway-core.d.ts +1 -1
- package/dist/types/channels/gateway-core.d.ts.map +1 -1
- package/dist/types/headless-listener-launch.d.ts.map +1 -1
- package/dist/types/queue/queue-runtime.d.ts +11 -2
- package/dist/types/queue/queue-runtime.d.ts.map +1 -1
- package/dist/types/runtime-context.d.ts +4 -0
- package/dist/types/runtime-context.d.ts.map +1 -1
- package/dist/types/tools/external-tool-background-eligibility.d.ts +1 -0
- package/dist/types/tools/external-tool-background-eligibility.d.ts.map +1 -1
- package/dist/types/tools/external-tool-background.d.ts +1 -0
- package/dist/types/tools/external-tool-background.d.ts.map +1 -1
- package/dist/types/tools/impl/claude-stream-session.d.ts +1 -0
- package/dist/types/tools/impl/claude-stream-session.d.ts.map +1 -1
- package/dist/types/tools/impl/codex-app-server.d.ts +1 -0
- package/dist/types/tools/impl/codex-app-server.d.ts.map +1 -1
- package/dist/types/tools/impl/external-coding-agent-task.d.ts +4 -2
- package/dist/types/tools/impl/external-coding-agent-task.d.ts.map +1 -1
- package/dist/types/tools/impl/external-coding-agent.d.ts +1 -1
- package/dist/types/tools/impl/external-coding-agent.d.ts.map +1 -1
- package/dist/types/tools/impl/memory-task-lifecycle.d.ts +1 -1
- package/dist/types/tools/impl/memory-task-lifecycle.d.ts.map +1 -1
- package/dist/types/tools/impl/monitor.d.ts +1 -1
- package/dist/types/tools/impl/monitor.d.ts.map +1 -1
- package/dist/types/tools/impl/native-session-capture.d.ts +16 -3
- package/dist/types/tools/impl/native-session-capture.d.ts.map +1 -1
- package/dist/types/tools/impl/process_manager.d.ts +2 -2
- package/dist/types/tools/impl/process_manager.d.ts.map +1 -1
- package/dist/types/tools/impl/send-agent-message.d.ts.map +1 -1
- package/dist/types/tools/impl/shell-env.d.ts.map +1 -1
- package/dist/types/tools/impl/task.d.ts +2 -1
- package/dist/types/tools/impl/task.d.ts.map +1 -1
- package/dist/types/tools/toolset.d.ts +1 -0
- package/dist/types/tools/toolset.d.ts.map +1 -1
- package/dist/types/types/protocol_v2.d.ts +5 -4
- package/dist/types/types/protocol_v2.d.ts.map +1 -1
- package/dist/types/types/turn-finished-protocol.d.ts +13 -0
- package/dist/types/types/turn-finished-protocol.d.ts.map +1 -0
- package/dist/types/utils/message-queue-bridge.d.ts +2 -1
- package/dist/types/utils/message-queue-bridge.d.ts.map +1 -1
- package/dist/types/utils/task-notifications.d.ts +1 -1
- package/dist/types/utils/task-notifications.d.ts.map +1 -1
- package/dist/types/websocket/listener/connection.d.ts +6 -2
- package/dist/types/websocket/listener/connection.d.ts.map +1 -1
- package/dist/types/websocket/listener/constants.d.ts +1 -0
- package/dist/types/websocket/listener/constants.d.ts.map +1 -1
- package/dist/types/websocket/listener/conversation-runtime.d.ts +31 -0
- package/dist/types/websocket/listener/conversation-runtime.d.ts.map +1 -1
- package/dist/types/websocket/listener/durable-file-lock.d.ts +46 -0
- package/dist/types/websocket/listener/durable-file-lock.d.ts.map +1 -0
- package/dist/types/websocket/listener/failed-teleport-cleanup.d.ts +16 -0
- package/dist/types/websocket/listener/failed-teleport-cleanup.d.ts.map +1 -0
- package/dist/types/websocket/listener/inbound-queue.d.ts +3 -1
- package/dist/types/websocket/listener/inbound-queue.d.ts.map +1 -1
- package/dist/types/websocket/listener/input-disposition-capacity.d.ts +8 -0
- package/dist/types/websocket/listener/input-disposition-capacity.d.ts.map +1 -0
- package/dist/types/websocket/listener/input-disposition-expiry.d.ts +3 -0
- package/dist/types/websocket/listener/input-disposition-expiry.d.ts.map +1 -0
- package/dist/types/websocket/listener/input-disposition-path.d.ts +2 -0
- package/dist/types/websocket/listener/input-disposition-path.d.ts.map +1 -0
- package/dist/types/websocket/listener/input-disposition-retention.d.ts +9 -0
- package/dist/types/websocket/listener/input-disposition-retention.d.ts.map +1 -0
- package/dist/types/websocket/listener/input-disposition-validation.d.ts +2 -0
- package/dist/types/websocket/listener/input-disposition-validation.d.ts.map +1 -0
- package/dist/types/websocket/listener/input-disposition.d.ts +68 -0
- package/dist/types/websocket/listener/input-disposition.d.ts.map +1 -0
- package/dist/types/websocket/listener/input-terminal-journal.d.ts +60 -0
- package/dist/types/websocket/listener/input-terminal-journal.d.ts.map +1 -0
- package/dist/types/websocket/listener/interrupted-turn-input-ownership.d.ts +27 -0
- package/dist/types/websocket/listener/interrupted-turn-input-ownership.d.ts.map +1 -0
- package/dist/types/websocket/listener/interrupted-turn-record.d.ts +132 -0
- package/dist/types/websocket/listener/interrupted-turn-record.d.ts.map +1 -0
- package/dist/types/websocket/listener/interrupted-turn-schema.d.ts +5 -0
- package/dist/types/websocket/listener/interrupted-turn-schema.d.ts.map +1 -0
- package/dist/types/websocket/listener/interrupted-turn-storage.d.ts +5 -0
- package/dist/types/websocket/listener/interrupted-turn-storage.d.ts.map +1 -0
- package/dist/types/websocket/listener/interrupted-turn-types.d.ts +59 -0
- package/dist/types/websocket/listener/interrupted-turn-types.d.ts.map +1 -0
- package/dist/types/websocket/listener/legacy-authority-quarantine.d.ts +13 -0
- package/dist/types/websocket/listener/legacy-authority-quarantine.d.ts.map +1 -0
- package/dist/types/websocket/listener/lifecycle-message.d.ts +7 -0
- package/dist/types/websocket/listener/lifecycle-message.d.ts.map +1 -0
- package/dist/types/websocket/listener/outbound-delivery.d.ts +21 -0
- package/dist/types/websocket/listener/outbound-delivery.d.ts.map +1 -0
- package/dist/types/websocket/listener/outbound-wire.d.ts +11 -1
- package/dist/types/websocket/listener/outbound-wire.d.ts.map +1 -1
- package/dist/types/websocket/listener/protocol-outbound.d.ts +8 -10
- package/dist/types/websocket/listener/protocol-outbound.d.ts.map +1 -1
- package/dist/types/websocket/listener/protocol-validation.d.ts +7 -0
- package/dist/types/websocket/listener/protocol-validation.d.ts.map +1 -0
- package/dist/types/websocket/listener/queue.d.ts.map +1 -1
- package/dist/types/websocket/listener/recorded-tool-results.d.ts +5 -0
- package/dist/types/websocket/listener/recorded-tool-results.d.ts.map +1 -0
- package/dist/types/websocket/listener/recovery-authority-guard.d.ts +24 -0
- package/dist/types/websocket/listener/recovery-authority-guard.d.ts.map +1 -0
- package/dist/types/websocket/listener/recovery-lineage-sidecar.d.ts +57 -0
- package/dist/types/websocket/listener/recovery-lineage-sidecar.d.ts.map +1 -0
- package/dist/types/websocket/listener/remote-settings-lock.d.ts.map +1 -1
- package/dist/types/websocket/listener/remote-settings.d.ts.map +1 -1
- package/dist/types/websocket/listener/runtime.d.ts +3 -0
- package/dist/types/websocket/listener/runtime.d.ts.map +1 -1
- package/dist/types/websocket/listener/scope.d.ts.map +1 -1
- package/dist/types/websocket/listener/startup-frame-buffer.d.ts +26 -0
- package/dist/types/websocket/listener/startup-frame-buffer.d.ts.map +1 -0
- package/dist/types/websocket/listener/startup-ingress.d.ts +44 -0
- package/dist/types/websocket/listener/startup-ingress.d.ts.map +1 -0
- package/dist/types/websocket/listener/teleport-protocol-inbound.d.ts +5 -0
- package/dist/types/websocket/listener/teleport-protocol-inbound.d.ts.map +1 -0
- package/dist/types/websocket/listener/turn-correlation.d.ts +8 -0
- package/dist/types/websocket/listener/turn-correlation.d.ts.map +1 -1
- package/dist/types/websocket/listener/turn-finished-replay.d.ts +90 -0
- package/dist/types/websocket/listener/turn-finished-replay.d.ts.map +1 -0
- package/dist/types/websocket/listener/turn-lifecycle.d.ts +9 -1
- package/dist/types/websocket/listener/turn-lifecycle.d.ts.map +1 -1
- package/dist/types/websocket/listener/types.d.ts +252 -6
- package/dist/types/websocket/listener/types.d.ts.map +1 -1
- package/letta.js +13157 -4646
- package/npm-shrinkwrap.json +5763 -0
- package/package.json +11 -4
- package/scripts/check.js +1 -0
- package/scripts/runtime-graph.test.ts +112 -0
- package/scripts/runtime-graph.ts +366 -0
- package/scripts/source-file-size-baseline.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"durable-file-lock.d.ts","sourceRoot":"","sources":["../../../../src/websocket/listener/durable-file-lock.ts"],"names":[],"mappings":"AA4BA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,OAAO,CAAC;IACpD,+EAA+E;IAC/E,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,yEAAyE;IACzE,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,iFAAiF;IACjF,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,M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AsB,EAC3D,KAAK,GAAE,YAA4C,GAClD,OAAO,CAgBT;AAwRD;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,sBAA2B,GACnC,MAAM,IAAI,CAqOZ"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createInterruptedTurnStore } from "./interrupted-turn-record";
|
|
2
|
+
import type { ListenerRuntime, PendingTeleport } from "./types";
|
|
3
|
+
export declare const FAILED_TELEPORT_CLEANUP_MAX_ATTEMPTS = 8;
|
|
4
|
+
export declare const FAILED_TELEPORT_CLEANUP_PENDING_LIMIT = 64;
|
|
5
|
+
type InterruptedTurnStore = ReturnType<typeof createInterruptedTurnStore>;
|
|
6
|
+
export type FailedTeleportCleanupDependencies = {
|
|
7
|
+
store?: InterruptedTurnStore;
|
|
8
|
+
retryDelayMs?: number;
|
|
9
|
+
maxAttempts?: number;
|
|
10
|
+
pendingLimit?: number;
|
|
11
|
+
};
|
|
12
|
+
export declare function clearAcceptedFailedTeleportBounded(listener: ListenerRuntime, pending: PendingTeleport, dependencies?: FailedTeleportCleanupDependencies): void;
|
|
13
|
+
export declare function cancelFailedTeleportCleanup(listener: ListenerRuntime): void;
|
|
14
|
+
export declare function getFailedTeleportCleanupPendingCount(listener: ListenerRuntime): number;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=failed-teleport-cleanup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"failed-teleport-cleanup.d.ts","sourceRoot":"","sources":["../../../../src/websocket/listener/failed-teleport-cleanup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAEhE,eAAO,MAAM,oCAAoC,IAAI,CAAC;AACtD,eAAO,MAAM,qCAAqC,KAAK,CAAC;AAIxD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAoG1E,MAAM,MAAM,iCAAiC,GAAG;IAC9C,KAAK,CAAC,EAAE,oBAAoB,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,wBAAgB,kCAAkC,CAChD,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE,eAAe,EACxB,YAAY,GAAE,iCAAsC,GACnD,IAAI,CAwCN;AAED,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI,CAO3E;AAED,wBAAgB,oCAAoC,CAClD,QAAQ,EAAE,eAAe,GACxB,MAAM,CAER"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ConversationRuntime, IncomingMessage } from "./types";
|
|
2
2
|
export declare function getInboundClientMessageId(incoming: IncomingMessage): string | undefined;
|
|
3
3
|
export declare function getInboundClientMessageIds(incoming: IncomingMessage): string[];
|
|
4
|
-
export declare function enqueueInboundUserMessage(runtime: ConversationRuntime, incoming: IncomingMessage, actingUserId?: string
|
|
4
|
+
export declare function enqueueInboundUserMessage(runtime: ConversationRuntime, incoming: IncomingMessage, actingUserId?: string, options?: {
|
|
5
|
+
preserveExisting?: boolean;
|
|
6
|
+
}): boolean;
|
|
5
7
|
//# sourceMappingURL=inbound-queue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inbound-queue.d.ts","sourceRoot":"","sources":["../../../../src/websocket/listener/inbound-queue.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAEpE,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,eAAe,GACxB,MAAM,GAAG,SAAS,CAEpB;AAED,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,eAAe,GACxB,MAAM,EAAE,CAQV;AAED,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,mBAAmB,EAC5B,QAAQ,EAAE,eAAe,EACzB,YAAY,CAAC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"inbound-queue.d.ts","sourceRoot":"","sources":["../../../../src/websocket/listener/inbound-queue.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAEpE,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,eAAe,GACxB,MAAM,GAAG,SAAS,CAEpB;AAED,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,eAAe,GACxB,MAAM,EAAE,CAQV;AAED,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,mBAAmB,EAC5B,QAAQ,EAAE,eAAe,EACzB,YAAY,CAAC,EAAE,MAAM,EACrB,OAAO,GAAE;IAAE,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAAO,GAC3C,OAAO,CAmCT"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AcceptedInputDispositionEntry, AcceptedInputDispositionLedger } from "./types";
|
|
2
|
+
export declare function rebuildDispositionCapacityCounts(ledger: AcceptedInputDispositionLedger): void;
|
|
3
|
+
export declare function removeDispositionCapacityEntry(ledger: AcceptedInputDispositionLedger, entry: AcceptedInputDispositionEntry): void;
|
|
4
|
+
export declare function countCapacityEntries(entries: readonly AcceptedInputDispositionEntry[]): number;
|
|
5
|
+
export declare function activeDispositionCount(ledger: AcceptedInputDispositionLedger): number;
|
|
6
|
+
export declare function compactDispositionExpiryQueue(ledger: AcceptedInputDispositionLedger): void;
|
|
7
|
+
export declare function rebuildDispositionExpiryQueue(ledger: AcceptedInputDispositionLedger): void;
|
|
8
|
+
//# sourceMappingURL=input-disposition-capacity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-disposition-capacity.d.ts","sourceRoot":"","sources":["../../../../src/websocket/listener/input-disposition-capacity.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,6BAA6B,EAC7B,8BAA8B,EAC/B,MAAM,SAAS,CAAC;AAEjB,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,8BAA8B,GACrC,IAAI,CAWN;AAED,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,8BAA8B,EACtC,KAAK,EAAE,6BAA6B,GACnC,IAAI,CAQN;AAED,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,SAAS,6BAA6B,EAAE,GAChD,MAAM,CAER;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,8BAA8B,GACrC,MAAM,CAER;AAED,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,8BAA8B,GACrC,IAAI,CAUN;AAED,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,8BAA8B,GACrC,IAAI,CAQN"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { AcceptedInputDispositionLedger } from "./types";
|
|
2
|
+
export declare function expireDispositionEntries(ledger: AcceptedInputDispositionLedger, now: number, ttlMs: number, deleteCurrent: (key: string, generation: number) => boolean): void;
|
|
3
|
+
//# sourceMappingURL=input-disposition-expiry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-disposition-expiry.d.ts","sourceRoot":"","sources":["../../../../src/websocket/listener/input-disposition-expiry.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,SAAS,CAAC;AAE9D,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,8BAA8B,EACtC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,GAC1D,IAAI,CA4CN"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-disposition-path.d.ts","sourceRoot":"","sources":["../../../../src/websocket/listener/input-disposition-path.ts"],"names":[],"mappings":"AAIA,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAYxE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AcceptedInputDispositionEntry } from "./types";
|
|
2
|
+
export declare const PERMANENT_LEGACY_AUTHORITY_QUARANTINE_EXPIRY: number;
|
|
3
|
+
export declare function buildLegacyAuthorityReferenceIndex(entries: Iterable<AcceptedInputDispositionEntry>): ReadonlySet<string>;
|
|
4
|
+
export declare function buildLegacyAuthorityQuarantineIndex(entries: Iterable<AcceptedInputDispositionEntry>): ReadonlySet<string>;
|
|
5
|
+
export declare function preparedTerminalMatchesLegacyAuthorityIndex(entry: AcceptedInputDispositionEntry, references: ReadonlySet<string>): boolean;
|
|
6
|
+
export declare function settleExpiredQuarantineJournals(entries: Iterable<[string, AcceptedInputDispositionEntry]>, now: number, discard: (key: string, entry: AcceptedInputDispositionEntry) => void): boolean;
|
|
7
|
+
export declare function isLegacyAuthorityQuarantine(entry: AcceptedInputDispositionEntry): boolean;
|
|
8
|
+
export declare function shouldRetainDisposition(entry: AcceptedInputDispositionEntry, references: () => ReadonlySet<string>): boolean;
|
|
9
|
+
//# sourceMappingURL=input-disposition-retention.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-disposition-retention.d.ts","sourceRoot":"","sources":["../../../../src/websocket/listener/input-disposition-retention.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,SAAS,CAAC;AAE7D,eAAO,MAAM,4CAA4C,QAChC,CAAC;AAc1B,wBAAgB,kCAAkC,CAChD,OAAO,EAAE,QAAQ,CAAC,6BAA6B,CAAC,GAC/C,WAAW,CAAC,MAAM,CAAC,CAgBrB;AAED,wBAAgB,mCAAmC,CACjD,OAAO,EAAE,QAAQ,CAAC,6BAA6B,CAAC,GAC/C,WAAW,CAAC,MAAM,CAAC,CAcrB;AAuBD,wBAAgB,2CAA2C,CACzD,KAAK,EAAE,6BAA6B,EACpC,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,GAC9B,OAAO,CAcT;AAED,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,QAAQ,CAAC,CAAC,MAAM,EAAE,6BAA6B,CAAC,CAAC,EAC1D,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,6BAA6B,KAAK,IAAI,GACnE,OAAO,CA+DT;AAED,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,6BAA6B,GACnC,OAAO,CAET;AAED,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,6BAA6B,EACpC,UAAU,EAAE,MAAM,WAAW,CAAC,MAAM,CAAC,GACpC,OAAO,CAkBT"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-disposition-validation.d.ts","sourceRoot":"","sources":["../../../../src/websocket/listener/input-disposition-validation.ts"],"names":[],"mappings":"AAEA,wBAAgB,qCAAqC,CACnD,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,UAAU,EAAE,MAAM,GACjB,OAAO,CAwBT"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { type DurableLockOwner } from "./durable-file-lock";
|
|
2
|
+
import type { AcceptedInputDisposition, AcceptedInputDispositionEntry, AcceptedInputDispositionLedger, ConversationRuntime, DurableQueuedInput, InputDispositionReservation, InputIdentity, ListenerRuntime } from "./types";
|
|
3
|
+
export declare const ACCEPTED_INPUT_DISPOSITION_TTL_MS: number;
|
|
4
|
+
export declare const MAX_ACCEPTED_INPUT_DISPOSITIONS_PER_SCOPE = 4096;
|
|
5
|
+
export declare const MAX_ACCEPTED_INPUT_DISPOSITIONS = 65536;
|
|
6
|
+
export declare const MAX_DURABLE_QUEUED_INPUT_BYTES: number;
|
|
7
|
+
export declare const MAX_INPUT_DISPOSITION_STORE_BYTES: number;
|
|
8
|
+
export declare function ordinaryInputIdentity(clientMessageId: string | undefined): InputIdentity | undefined;
|
|
9
|
+
export declare function teleportInputIdentity(teleportId: string): InputIdentity;
|
|
10
|
+
export declare function dispositionKey(runtimeKey: string, identity: InputIdentity): string;
|
|
11
|
+
export { inputDispositionPersistentPath } from "./input-disposition-path";
|
|
12
|
+
export declare function createAcceptedInputDispositionLedger(options?: {
|
|
13
|
+
persistentPath?: string | null;
|
|
14
|
+
}): AcceptedInputDispositionLedger;
|
|
15
|
+
export declare function getLedger(listener: ListenerRuntime): AcceptedInputDispositionLedger;
|
|
16
|
+
export declare function deleteCurrentEntry(ledger: AcceptedInputDispositionLedger, key: string, generation?: number): boolean;
|
|
17
|
+
export declare function expireAcceptedInputDispositions(ledger: AcceptedInputDispositionLedger, now: number): void;
|
|
18
|
+
type ProcessOwner = DurableLockOwner;
|
|
19
|
+
type DurableReservation = ProcessOwner & {
|
|
20
|
+
runtimeKey: string;
|
|
21
|
+
generation: number;
|
|
22
|
+
};
|
|
23
|
+
export type DurableStore = {
|
|
24
|
+
version: 4;
|
|
25
|
+
nextGeneration: number;
|
|
26
|
+
entries: Record<string, AcceptedInputDispositionEntry>;
|
|
27
|
+
reservations: Record<string, DurableReservation>;
|
|
28
|
+
};
|
|
29
|
+
declare function currentProcessOwner(): ProcessOwner;
|
|
30
|
+
declare function acquireLock(path: string, waitMs?: number): () => void;
|
|
31
|
+
export declare function durableTransaction<T>(path: string, transaction: (store: DurableStore) => {
|
|
32
|
+
result: T;
|
|
33
|
+
changed: boolean;
|
|
34
|
+
}): T;
|
|
35
|
+
export declare function syncMemoryFromDurable(ledger: AcceptedInputDispositionLedger, store: DurableStore): void;
|
|
36
|
+
export type InputDispositionAdmission = {
|
|
37
|
+
kind: "untracked";
|
|
38
|
+
} | {
|
|
39
|
+
kind: "duplicate";
|
|
40
|
+
disposition: AcceptedInputDisposition;
|
|
41
|
+
} | {
|
|
42
|
+
kind: "reserved";
|
|
43
|
+
reservation: InputDispositionReservation;
|
|
44
|
+
} | {
|
|
45
|
+
kind: "full";
|
|
46
|
+
};
|
|
47
|
+
export declare function reserveInputDisposition(runtime: ConversationRuntime, identity: InputIdentity | undefined): InputDispositionAdmission;
|
|
48
|
+
export declare function commitInputDisposition(runtime: ConversationRuntime, reservation: InputDispositionReservation | undefined, disposition: AcceptedInputDisposition, queuedInput?: Omit<DurableQueuedInput, "scope" | "identity">): boolean;
|
|
49
|
+
export declare function getInputDisposition(runtime: ConversationRuntime, identity: InputIdentity | undefined): AcceptedInputDisposition | undefined;
|
|
50
|
+
export declare function rememberInputDisposition(runtime: ConversationRuntime, identity: InputIdentity | undefined, disposition: AcceptedInputDisposition, queuedInput?: Omit<DurableQueuedInput, "scope" | "identity">): boolean;
|
|
51
|
+
export declare function forgetQueuedInputDisposition(runtime: ConversationRuntime, identity: InputIdentity | undefined): boolean;
|
|
52
|
+
/** Atomically discard a queue mutation's complete set of durable payloads. */
|
|
53
|
+
export declare function forgetQueuedInputDispositions(runtime: ConversationRuntime, identities: readonly InputIdentity[]): boolean;
|
|
54
|
+
/** Atomically transition queued dispositions while retaining crash-replay payloads. */
|
|
55
|
+
export declare function markQueuedInputDispositionsStarted(runtime: ConversationRuntime, identities: readonly InputIdentity[]): boolean;
|
|
56
|
+
/** Return a destructively dequeued input to durable queued ownership. */
|
|
57
|
+
export declare function requeueStartedInputDispositions(runtime: ConversationRuntime, identities: readonly InputIdentity[]): boolean;
|
|
58
|
+
/** Read every replay payload under the store lock for startup restore. */
|
|
59
|
+
export declare function loadDurableQueuedInputs(listener: ListenerRuntime): DurableQueuedInput[];
|
|
60
|
+
export declare function loadDurableQueuedInputEntries(listener: ListenerRuntime): Array<{
|
|
61
|
+
disposition: AcceptedInputDisposition;
|
|
62
|
+
payload: DurableQueuedInput;
|
|
63
|
+
}>;
|
|
64
|
+
export declare const __inputDispositionTestUtils: {
|
|
65
|
+
acquireLock: typeof acquireLock;
|
|
66
|
+
currentProcessOwner: typeof currentProcessOwner;
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=input-disposition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-disposition.d.ts","sourceRoot":"","sources":["../../../../src/websocket/listener/input-disposition.ts"],"names":[],"mappings":"AAgBA,OAAO,EAGL,KAAK,gBAAgB,EAGtB,MAAM,qBAAqB,CAAC;AAiB7B,OAAO,KAAK,EACV,wBAAwB,EACxB,6BAA6B,EAC7B,8BAA8B,EAC9B,mBAAmB,EACnB,kBAAkB,EAClB,2BAA2B,EAC3B,aAAa,EACb,eAAe,EAChB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,iCAAiC,QAAiB,CAAC;AAChE,eAAO,MAAM,yCAAyC,OAAO,CAAC;AAC9D,eAAO,MAAM,+BAA+B,QAAS,CAAC;AACtD,eAAO,MAAM,8BAA8B,QAAc,CAAC;AAC1D,eAAO,MAAM,iCAAiC,QAAmB,CAAC;AAGlE,wBAAgB,qBAAqB,CACnC,eAAe,EAAE,MAAM,GAAG,SAAS,GAClC,aAAa,GAAG,SAAS,CAE3B;AAED,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,aAAa,CAEvE;AAED,wBAAgB,cAAc,CAC5B,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,aAAa,GACtB,MAAM,CAER;AAmBD,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAa1E,wBAAgB,oCAAoC,CAAC,OAAO,CAAC,EAAE;IAC7D,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,GAAG,8BAA8B,CAcjC;AAED,wBAAgB,SAAS,CACvB,QAAQ,EAAE,eAAe,GACxB,8BAA8B,CAIhC;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,8BAA8B,EACtC,GAAG,EAAE,MAAM,EACX,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAST;AAED,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,8BA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AO,MAAM,2BAA2B;;;CAGvC,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { AcceptedInputDispositionEntry, ConversationRuntime, DurablePreparedInputTerminal, InputIdentity, InterruptedTerminalAuthority, ListenerRuntime } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Atomically replace replayable input with its terminal intent. A restart may
|
|
4
|
+
* promote this journal entry to the terminal replay store, but must never run
|
|
5
|
+
* the accepted input again after its side effects have completed.
|
|
6
|
+
*/
|
|
7
|
+
export declare function prepareInputTerminal(runtime: ConversationRuntime, identities: readonly InputIdentity[], terminal: DurablePreparedInputTerminal): boolean;
|
|
8
|
+
/** Clear a journal only after its terminal has another durable home. */
|
|
9
|
+
export declare function completePreparedInputTerminal(runtime: ConversationRuntime, identities: readonly InputIdentity[], turnId: string): boolean;
|
|
10
|
+
/** Read deduplicated terminal journals under the same lock as input replay. */
|
|
11
|
+
export declare function loadPreparedInputTerminals(listener: ListenerRuntime): DurablePreparedInputTerminal[];
|
|
12
|
+
export declare function hasCompetingCompletedPublicationClaim(terminal: DurablePreparedInputTerminal, completedAuthorities: readonly {
|
|
13
|
+
runtimeKey: string;
|
|
14
|
+
authority: InterruptedTerminalAuthority;
|
|
15
|
+
}[]): boolean;
|
|
16
|
+
type RecoveryAuthorityGuard = {
|
|
17
|
+
withRecoveryAuthority?: (params: {
|
|
18
|
+
agentId: string;
|
|
19
|
+
conversationId: string;
|
|
20
|
+
lineageId: string;
|
|
21
|
+
expectedRevision: string;
|
|
22
|
+
action: () => boolean;
|
|
23
|
+
}) => boolean;
|
|
24
|
+
};
|
|
25
|
+
export declare function claimPreparedInputTerminalIfCurrent(listener: ListenerRuntime, terminal: DurablePreparedInputTerminal, validatedCompletedAuthorities?: readonly {
|
|
26
|
+
runtimeKey: string;
|
|
27
|
+
authority: InterruptedTerminalAuthority;
|
|
28
|
+
}[], authorityGuard?: RecoveryAuthorityGuard): boolean;
|
|
29
|
+
export declare function publishPreparedInputTerminalIfCurrent(listener: ListenerRuntime, terminal: DurablePreparedInputTerminal, publish: () => void, validatedCompletedAuthorities?: readonly {
|
|
30
|
+
runtimeKey: string;
|
|
31
|
+
authority: InterruptedTerminalAuthority;
|
|
32
|
+
}[], authorityGuard?: RecoveryAuthorityGuard): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Convert unresolved predecessor journals into a stable migration fence.
|
|
35
|
+
* Only pre-sequence/pre-identity authorities can reach this path, so its
|
|
36
|
+
* cardinality is bounded by the already-capped pre-upgrade ledger.
|
|
37
|
+
*/
|
|
38
|
+
export declare function quarantinePreparedTerminalAuthority(listener: ListenerRuntime, scope: {
|
|
39
|
+
agentId: string | null;
|
|
40
|
+
conversationId: string;
|
|
41
|
+
}, authority: NonNullable<AcceptedInputDispositionEntry["completedTerminalAuthority"]>): boolean;
|
|
42
|
+
export declare function loadCompletedTerminalAuthorities(listener: ListenerRuntime): Array<{
|
|
43
|
+
runtimeKey: string;
|
|
44
|
+
expiresAt: number;
|
|
45
|
+
authority: NonNullable<AcceptedInputDispositionEntry["completedTerminalAuthority"]>;
|
|
46
|
+
}>;
|
|
47
|
+
export declare function loadLegacyAuthorityQuarantines(listener: ListenerRuntime): NonNullable<AcceptedInputDispositionEntry["legacyAuthorityQuarantine"]>[];
|
|
48
|
+
export declare function hasPreparedInputTerminalRevision(listener: ListenerRuntime, scope: DurablePreparedInputTerminal["scope"], interruptedRevision: string): boolean;
|
|
49
|
+
export declare function hasPreparedInputTerminalAuthority(listener: ListenerRuntime, scope: DurablePreparedInputTerminal["scope"], authority: {
|
|
50
|
+
interruptedRevision: string;
|
|
51
|
+
authorityRevision: string;
|
|
52
|
+
recoveryLineageId?: string;
|
|
53
|
+
}): boolean;
|
|
54
|
+
export declare function clearPreparedInputTerminal(listener: ListenerRuntime, scope: DurablePreparedInputTerminal["scope"], turnId: string, terminalIdentity?: string): boolean;
|
|
55
|
+
/** Drop stale prepared evidence without claiming it completed a newer authority. */
|
|
56
|
+
export declare function discardPreparedInputTerminal(listener: ListenerRuntime, scope: DurablePreparedInputTerminal["scope"], terminalIdentity: string | undefined, turnId: string): boolean;
|
|
57
|
+
/** Atomically retain disposition tombstones while retiring replay payloads. */
|
|
58
|
+
export declare function completeInputReplay(runtime: ConversationRuntime, identities: readonly InputIdentity[]): boolean;
|
|
59
|
+
export {};
|
|
60
|
+
//# sourceMappingURL=input-terminal-journal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-terminal-journal.d.ts","sourceRoot":"","sources":["../../../../src/websocket/listener/input-terminal-journal.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EACV,6BAA6B,EAC7B,mBAAmB,EACnB,4BAA4B,EAC5B,aAAa,EACb,4BAA4B,EAC5B,eAAe,EAChB,MAAM,SAAS,CAAC;AA0EjB;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,mBAAmB,EAC5B,UAAU,EAAE,SAAS,aAAa,EAAE,EACpC,QAAQ,EAAE,4BAA4B,GACrC,OAAO,CAgFT;AAED,wEAAwE;AACxE,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,mBAAmB,EAC5B,UAAU,EAAE,SAAS,aAAa,EAAE,EACpC,MAAM,EAAE,MAAM,GACb,OAAO,CAuCT;AAED,+EAA+E;AAC/E,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,eAAe,GACxB,4BAA4B,EAAE,CAmHhC;AAoBD,wBAAgB,qCAAqC,CACnD,QAAQ,EAAE,4BAA4B,EACtC,oBAAoB,EAAE,SAAS;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,4BAA4B,CAAC;CACzC,EAAE,GACF,OAAO,CAkBT;AAED,KAAK,sBAAsB,GAAG;IAC5B,qBAAqB,CAAC,EAAE,CAAC,MAAM,EAAE;QAC/B,OAAO,EAAE,MAAM,CAAC;QAChB,cAAc,EAAE,MAAM,CAAC;QACvB,SAAS,EAAE,MAAM,CAAC;QAClB,gBAAgB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,CAAC,EAC5C,mBAAmB,EAAE,MAAM,GAC1B,OAAO,CAOT;AAED,wBAAgB,iCAAiC,CAC/C,QAAQ,EAAE,eAAe,EACzB,KAAK,EAAE,4BAA4B,CAAC,OAAO,CAAC,EAC5C,SAAS,EAAE;IACT,mBAAmB,EAAE,MAAM,CAAC;IAC5B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,GACA,OAAO,CAUT;AAED,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,eAAe,EACzB,KAAK,EAAE,4BAA4B,CAAC,OAAO,CAAC,EAC5C,MAAM,EAAE,MAAM,EACd,gBAAgB,CAAC,EAAE,MAAM,GACxB,OAAO,CAmDT;AAED,oFAAoF;AACpF,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,eAAe,EACzB,KAAK,EAAE,4BAA4B,CAAC,OAAO,CAAC,EAC5C,gBAAgB,EAAE,MAAM,GAAG,SAAS,EACpC,MAAM,EAAE,MAAM,GACb,OAAO,CAkCT;AAED,+EAA+E;AAC/E,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,mBAAmB,EAC5B,UAAU,EAAE,SAAS,aAAa,EAAE,GACnC,OAAO,CAuCT"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { InterruptedTurnRecord } from "./interrupted-turn-types";
|
|
2
|
+
import type { InputIdentity } from "./types";
|
|
3
|
+
export type InterruptedTurnInputOwnership = {
|
|
4
|
+
agentId: string;
|
|
5
|
+
conversationId: string;
|
|
6
|
+
durableInputIdentities: InputIdentity[];
|
|
7
|
+
quarantined: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type InterruptedTurnMainSnapshot = {
|
|
10
|
+
records: InterruptedTurnRecord[];
|
|
11
|
+
unreadableScopes: Array<{
|
|
12
|
+
agentId: string;
|
|
13
|
+
conversationId: string;
|
|
14
|
+
}>;
|
|
15
|
+
};
|
|
16
|
+
export declare function listInterruptedTurnMainSnapshot(directory: string, readRecord: (file: string) => InterruptedTurnRecord | null): InterruptedTurnMainSnapshot;
|
|
17
|
+
/** Build a replay fence from validated main JSON without trusting its sidecar. */
|
|
18
|
+
export declare function collectInterruptedTurnInputOwnership(records: InterruptedTurnRecord[], readMainView: (record: InterruptedTurnRecord) => InterruptedTurnRecord): InterruptedTurnInputOwnership[];
|
|
19
|
+
export declare function collectInterruptedTurnInputOwnershipWithSidecars(records: InterruptedTurnRecord[], readMainView: (record: InterruptedTurnRecord) => InterruptedTurnRecord, sidecars: Array<{
|
|
20
|
+
agentId: string;
|
|
21
|
+
conversationId: string;
|
|
22
|
+
durableInputIdentities?: InputIdentity[];
|
|
23
|
+
}>, mainExists: (agentId: string, conversationId: string) => boolean, unreadableMainScopes?: Array<{
|
|
24
|
+
agentId: string;
|
|
25
|
+
conversationId: string;
|
|
26
|
+
}>): InterruptedTurnInputOwnership[];
|
|
27
|
+
//# sourceMappingURL=interrupted-turn-input-ownership.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interrupted-turn-input-ownership.d.ts","sourceRoot":"","sources":["../../../../src/websocket/listener/interrupted-turn-input-ownership.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,MAAM,MAAM,6BAA6B,GAAG;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,sBAAsB,EAAE,aAAa,EAAE,CAAC;IACxC,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACxC,OAAO,EAAE,qBAAqB,EAAE,CAAC;IACjC,gBAAgB,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACtE,CAAC;AA6BF,wBAAgB,+BAA+B,CAC7C,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,qBAAqB,GAAG,IAAI,GACzD,2BAA2B,CA6B7B;AAED,kFAAkF;AAClF,wBAAgB,oCAAoC,CAClD,OAAO,EAAE,qBAAqB,EAAE,EAChC,YAAY,EAAE,CAAC,MAAM,EAAE,qBAAqB,KAAK,qBAAqB,GACrE,6BAA6B,EAAE,CAsBjC;AAED,wBAAgB,gDAAgD,CAC9D,OAAO,EAAE,qBAAqB,EAAE,EAChC,YAAY,EAAE,CAAC,MAAM,EAAE,qBAAqB,KAAK,qBAAqB,EACtE,QAAQ,EAAE,KAAK,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,sBAAsB,CAAC,EAAE,aAAa,EAAE,CAAC;CAC1C,CAAC,EACF,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,KAAK,OAAO,EAChE,oBAAoB,GAAE,KAAK,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,CAAM,GAC5E,6BAA6B,EAAE,CAuCjC"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import type { ApprovalResult } from "../../agent/approval-execution";
|
|
2
|
+
import type { InterruptedTurnRecord } from "./interrupted-turn-types";
|
|
3
|
+
import { type RecoveryLineageSidecar } from "./recovery-lineage-sidecar";
|
|
4
|
+
import type { ConversationRuntime } from "./types";
|
|
5
|
+
export type { InterruptedTurnRecord } from "./interrupted-turn-types";
|
|
6
|
+
export { allRecordedResults, recordedToolResults, } from "./recorded-tool-results";
|
|
7
|
+
export type ListenerStateWritePhase = "run_observed" | "before_tool_execution" | "after_tool_execution";
|
|
8
|
+
export declare function createInterruptedTurnStore(directory?: string, dependencies?: {
|
|
9
|
+
fsyncDirectory?: (directory: string) => void;
|
|
10
|
+
lockWaitMs?: number;
|
|
11
|
+
}): {
|
|
12
|
+
list(): InterruptedTurnRecord[];
|
|
13
|
+
listDurableInputOwnership(): import("./interrupted-turn-input-ownership").InterruptedTurnInputOwnership[];
|
|
14
|
+
read(agentId: string, conversationId: string): InterruptedTurnRecord | null;
|
|
15
|
+
readRecoveryView(agentId: string, conversationId: string, lineageId: string): InterruptedTurnRecord | null;
|
|
16
|
+
readRecoverySnapshot: (agentId: string, conversationId: string, lineageId: string) => {
|
|
17
|
+
record: InterruptedTurnRecord;
|
|
18
|
+
revisionToken: string;
|
|
19
|
+
} | null;
|
|
20
|
+
withRecoveryAuthority: (params: {
|
|
21
|
+
agentId: string;
|
|
22
|
+
conversationId: string;
|
|
23
|
+
lineageId: string;
|
|
24
|
+
expectedRevision: string;
|
|
25
|
+
action: () => boolean;
|
|
26
|
+
}) => boolean;
|
|
27
|
+
readRetiredRecoveryAuthority: (agentId: string, conversationId: string, lineageId: string) => {
|
|
28
|
+
interruptedRevision: string;
|
|
29
|
+
authorityRevision?: string;
|
|
30
|
+
} | null;
|
|
31
|
+
listRecoverySidecars: () => RecoveryLineageSidecar[];
|
|
32
|
+
compactRetiredRecoverySidecar(sidecar: RecoveryLineageSidecar): boolean;
|
|
33
|
+
removeRetiredRecoverySidecar(sidecar: RecoveryLineageSidecar): boolean;
|
|
34
|
+
write(record: InterruptedTurnRecord, expectedRevision?: string | null): InterruptedTurnRecord;
|
|
35
|
+
writeRecoveryLineageSnapshot(params: {
|
|
36
|
+
agentId: string;
|
|
37
|
+
conversationId: string;
|
|
38
|
+
lineageId: string;
|
|
39
|
+
update: Partial<Pick<InterruptedTurnRecord, "runId" | "toolCallIds" | "unstartedToolCallIds" | "results" | "requestOtid" | "actingUserId" | "durableInputIdentities" | "terminalConsumerIds" | "teleport">>;
|
|
40
|
+
expectedSidecarRevision?: string;
|
|
41
|
+
}): {
|
|
42
|
+
mainRevision: string;
|
|
43
|
+
sidecarRevision: string;
|
|
44
|
+
};
|
|
45
|
+
mergeSettledRecoveryResult(params: {
|
|
46
|
+
agentId: string;
|
|
47
|
+
conversationId: string;
|
|
48
|
+
lineageId: string;
|
|
49
|
+
result: ApprovalResult;
|
|
50
|
+
}): {
|
|
51
|
+
revision: string;
|
|
52
|
+
independentSuccessor: boolean;
|
|
53
|
+
};
|
|
54
|
+
markRecoveryClaimCompletionPending(params: {
|
|
55
|
+
agentId: string;
|
|
56
|
+
conversationId: string;
|
|
57
|
+
lineageId: string;
|
|
58
|
+
expectedRevision: string;
|
|
59
|
+
}): InterruptedTurnRecord | null;
|
|
60
|
+
retireRecoveryClaimCompletion(params: {
|
|
61
|
+
agentId: string;
|
|
62
|
+
conversationId: string;
|
|
63
|
+
lineageId: string;
|
|
64
|
+
pendingRevision: string;
|
|
65
|
+
}): "removed" | "preserved" | "stale";
|
|
66
|
+
remove(agentId: string, conversationId: string, expectedRevision?: string | null): boolean;
|
|
67
|
+
};
|
|
68
|
+
export declare function recordListenerWork(runtime: ConversationRuntime, update: Partial<Pick<InterruptedTurnRecord, "runId" | "toolCallIds" | "unstartedToolCallIds" | "results" | "requestOtid" | "actingUserId" | "recoveryClaimCompletion" | "durableInputIdentities" | "terminalConsumerIds" | "teleport">>, phase: ListenerStateWritePhase, expectedRevision?: string | null, recoveryLineageId?: string, store?: {
|
|
69
|
+
list(): InterruptedTurnRecord[];
|
|
70
|
+
listDurableInputOwnership(): import("./interrupted-turn-input-ownership").InterruptedTurnInputOwnership[];
|
|
71
|
+
read(agentId: string, conversationId: string): InterruptedTurnRecord | null;
|
|
72
|
+
readRecoveryView(agentId: string, conversationId: string, lineageId: string): InterruptedTurnRecord | null;
|
|
73
|
+
readRecoverySnapshot: (agentId: string, conversationId: string, lineageId: string) => {
|
|
74
|
+
record: InterruptedTurnRecord;
|
|
75
|
+
revisionToken: string;
|
|
76
|
+
} | null;
|
|
77
|
+
withRecoveryAuthority: (params: {
|
|
78
|
+
agentId: string;
|
|
79
|
+
conversationId: string;
|
|
80
|
+
lineageId: string;
|
|
81
|
+
expectedRevision: string;
|
|
82
|
+
action: () => boolean;
|
|
83
|
+
}) => boolean;
|
|
84
|
+
readRetiredRecoveryAuthority: (agentId: string, conversationId: string, lineageId: string) => {
|
|
85
|
+
interruptedRevision: string;
|
|
86
|
+
authorityRevision?: string;
|
|
87
|
+
} | null;
|
|
88
|
+
listRecoverySidecars: () => RecoveryLineageSidecar[];
|
|
89
|
+
compactRetiredRecoverySidecar(sidecar: RecoveryLineageSidecar): boolean;
|
|
90
|
+
removeRetiredRecoverySidecar(sidecar: RecoveryLineageSidecar): boolean;
|
|
91
|
+
write(record: InterruptedTurnRecord, expectedRevision?: string | null): InterruptedTurnRecord;
|
|
92
|
+
writeRecoveryLineageSnapshot(params: {
|
|
93
|
+
agentId: string;
|
|
94
|
+
conversationId: string;
|
|
95
|
+
lineageId: string;
|
|
96
|
+
update: Partial<Pick<InterruptedTurnRecord, "runId" | "toolCallIds" | "unstartedToolCallIds" | "results" | "requestOtid" | "actingUserId" | "durableInputIdentities" | "terminalConsumerIds" | "teleport">>;
|
|
97
|
+
expectedSidecarRevision?: string;
|
|
98
|
+
}): {
|
|
99
|
+
mainRevision: string;
|
|
100
|
+
sidecarRevision: string;
|
|
101
|
+
};
|
|
102
|
+
mergeSettledRecoveryResult(params: {
|
|
103
|
+
agentId: string;
|
|
104
|
+
conversationId: string;
|
|
105
|
+
lineageId: string;
|
|
106
|
+
result: ApprovalResult;
|
|
107
|
+
}): {
|
|
108
|
+
revision: string;
|
|
109
|
+
independentSuccessor: boolean;
|
|
110
|
+
};
|
|
111
|
+
markRecoveryClaimCompletionPending(params: {
|
|
112
|
+
agentId: string;
|
|
113
|
+
conversationId: string;
|
|
114
|
+
lineageId: string;
|
|
115
|
+
expectedRevision: string;
|
|
116
|
+
}): InterruptedTurnRecord | null;
|
|
117
|
+
retireRecoveryClaimCompletion(params: {
|
|
118
|
+
agentId: string;
|
|
119
|
+
conversationId: string;
|
|
120
|
+
lineageId: string;
|
|
121
|
+
pendingRevision: string;
|
|
122
|
+
}): "removed" | "preserved" | "stale";
|
|
123
|
+
remove(agentId: string, conversationId: string, expectedRevision?: string | null): boolean;
|
|
124
|
+
}): string | undefined;
|
|
125
|
+
export declare function recordListenerWorkRetriably(runtime: ConversationRuntime, update: Parameters<typeof recordListenerWork>[1], phase: ListenerStateWritePhase, expectedRevision?: string | null, recoveryLineageId?: string, options?: {
|
|
126
|
+
shouldContinue?: () => boolean;
|
|
127
|
+
retryDelayMs?: number;
|
|
128
|
+
lockWaitMs?: number;
|
|
129
|
+
store?: ReturnType<typeof createInterruptedTurnStore>;
|
|
130
|
+
}): Promise<string | undefined>;
|
|
131
|
+
export declare function forgetListenerWork(runtime: ConversationRuntime, expectedRevision?: string | null): void;
|
|
132
|
+
//# sourceMappingURL=interrupted-turn-record.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interrupted-turn-record.d.ts","sourceRoot":"","sources":["../../../../src/websocket/listener/interrupted-turn-record.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAcjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAGtE,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,YAAY,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EACL,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,MAAM,uBAAuB,GAC/B,cAAc,GACd,uBAAuB,GACvB,sBAAsB,CAAC;AAC3B,wBAAgB,0BAA0B,CACxC,SAAS,SAAoC,EAC7C,YAAY,GAAE;IACZ,cAAc,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;CAChB;YAkFI,q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OAAO,CAAA;KAAE;+CA+EZ;QACzC,OAAO,EAAE,MAAM,CAAC;QAChB,cAAc,EAAE,MAAM,CAAC;QACvB,SAAS,EAAE,MAAM,CAAC;QAClB,gBAAgB,EAAE,MAAM,CAAC;KAC1B,GAAG,qBAAqB,GAAG,IAAI;0CAyDM;QACpC,OAAO,EAAE,MAAM,CAAC;QAChB,cAAc,EAAE,MAAM,CAAC;QACvB,SAAS,EAAE,MAAM,CAAC;QAClB,eAAe,EAAE,MAAM,CAAC;KACzB,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO;oBAsF1B,MAAM,kBACC,MAAM,qBACH,MAAM,GAAG,IAAI,GAC/B,OAAO;CA0DwB,GACnC,MAAM,GAAG,SAAS,CA8KpB;AAED,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,mBAAmB,EAC5B,MAAM,EAAE,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC,CAAC,CAAC,EAChD,KAAK,EAAE,uBAAuB,EAC9B,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,EAChC,iBAAiB,CAAC,EAAE,MAAM,EAC1B,OAAO,GAAE;IACP,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAC;CAClD,GACL,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CA2D7B;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,mBAAmB,EAC5B,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,GAC/B,IAAI,CAeN"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { InterruptedTurnRecord } from "./interrupted-turn-types";
|
|
2
|
+
export declare function isInputIdentity(value: unknown): boolean;
|
|
3
|
+
export declare function isTeleportIntent(value: unknown): value is NonNullable<InterruptedTurnRecord["teleport"]>;
|
|
4
|
+
export declare function isInterruptedTurnRecord(value: unknown, file: string, path: (agentId: string, conversationId: string) => string): value is InterruptedTurnRecord;
|
|
5
|
+
//# sourceMappingURL=interrupted-turn-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interrupted-turn-schema.d.ts","sourceRoot":"","sources":["../../../../src/websocket/listener/interrupted-turn-schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAGtE,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAQvD;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,WAAW,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC,CAmBzD;AAED,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,KAAK,MAAM,GACxD,KAAK,IAAI,qBAAqB,CAiFhC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { InterruptedTurnRecord } from "./interrupted-turn-types";
|
|
2
|
+
export declare function writeInterruptedTurnRecordFile(temporary: string, destination: string, directory: string, record: InterruptedTurnRecord, syncDirectory: (directory: string) => void): void;
|
|
3
|
+
export declare function fsyncInterruptedTurnDirectory(directory: string, platform?: NodeJS.Platform): void;
|
|
4
|
+
export declare function defaultInterruptedTurnDirectory(): string;
|
|
5
|
+
//# sourceMappingURL=interrupted-turn-storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interrupted-turn-storage.d.ts","sourceRoot":"","sources":["../../../../src/websocket/listener/interrupted-turn-storage.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEtE,wBAAgB,8BAA8B,CAC5C,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,qBAAqB,EAC7B,aAAa,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,GACzC,IAAI,CAON;AAED,wBAAgB,6BAA6B,CAC3C,SAAS,EAAE,MAAM,EACjB,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAC3C,IAAI,CAUN;AAED,wBAAgB,+BAA+B,IAAI,MAAM,CAaxD"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { ApprovalResult } from "../../agent/approval-execution";
|
|
2
|
+
import type { TeleportContinuation } from "../../types/protocol_v2";
|
|
3
|
+
import type { InputIdentity } from "./types";
|
|
4
|
+
export interface InterruptedTurnRecord {
|
|
5
|
+
revision?: string;
|
|
6
|
+
teleportId?: string;
|
|
7
|
+
teleport?: {
|
|
8
|
+
teleportId: string;
|
|
9
|
+
connectionId: string;
|
|
10
|
+
connectionGeneration?: string;
|
|
11
|
+
activeTurn: boolean;
|
|
12
|
+
continuation?: TeleportContinuation;
|
|
13
|
+
ready: boolean;
|
|
14
|
+
/** Revision created when this exact intent was first journaled. */
|
|
15
|
+
intentRevision?: string;
|
|
16
|
+
/** Interrupted-record revision captured by the durable terminal owner. */
|
|
17
|
+
committedRevision?: string;
|
|
18
|
+
/** Exact record revision which first published this ready handoff. */
|
|
19
|
+
readyRevision?: string;
|
|
20
|
+
};
|
|
21
|
+
actingUserId?: string;
|
|
22
|
+
recoveryClaimCompletion?: {
|
|
23
|
+
lineageId: string;
|
|
24
|
+
state: "running" | "pending";
|
|
25
|
+
/** Exact predecessor revision whose completed effects this marker covers. */
|
|
26
|
+
effectRevision?: string;
|
|
27
|
+
/** Input identities owned by that predecessor, retained across a successor write. */
|
|
28
|
+
effectInputIdentities?: InputIdentity[];
|
|
29
|
+
/** Complete tool namespace owned by that predecessor recovery lineage. */
|
|
30
|
+
effectToolCallIds?: string[];
|
|
31
|
+
effectRunId?: string | null;
|
|
32
|
+
effectRequestOtid?: string;
|
|
33
|
+
effectWorkingDirectory?: string;
|
|
34
|
+
effectActingUserId?: string | null;
|
|
35
|
+
effectResults?: ApprovalResult[];
|
|
36
|
+
effectUnstartedToolCallIds?: string[];
|
|
37
|
+
effectTerminalConsumerIds?: string[];
|
|
38
|
+
effectTeleport?: InterruptedTurnRecord["teleport"];
|
|
39
|
+
/** A write outside this recovery lineage has added genuine successor work. */
|
|
40
|
+
independentSuccessor?: boolean;
|
|
41
|
+
};
|
|
42
|
+
agentId: string;
|
|
43
|
+
conversationId: string;
|
|
44
|
+
runId: string | null;
|
|
45
|
+
toolCallIds: string[];
|
|
46
|
+
/** Approved tools which have not crossed their own execution boundary. */
|
|
47
|
+
unstartedToolCallIds?: string[];
|
|
48
|
+
results: ApprovalResult[];
|
|
49
|
+
/** Exact settled effects that survive an independent successor snapshot. */
|
|
50
|
+
settledRecoveryEffects?: Array<{
|
|
51
|
+
lineageId: string;
|
|
52
|
+
result: ApprovalResult;
|
|
53
|
+
}>;
|
|
54
|
+
requestOtid: string;
|
|
55
|
+
workingDirectory: string;
|
|
56
|
+
durableInputIdentities?: InputIdentity[];
|
|
57
|
+
terminalConsumerIds?: string[];
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=interrupted-turn-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interrupted-turn-types.d.ts","sourceRoot":"","sources":["../../../../src/websocket/listener/interrupted-turn-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC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AM,EAAE,CAAC;IACtB,0EAA0E;IAC1E,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,4EAA4E;IAC5E,sBAAsB,CAAC,EAAE,KAAK,CAAC;QAC7B,SAAS,EAAE,MAAM,CAAC;QAClB,MAAM,EAAE,cAAc,CAAC;KACxB,CAAC,CAAC;IACH,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,sBAAsB,CAAC,EAAE,aAAa,EAAE,CAAC;IACzC,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;CAChC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { RecoveryLineageSidecar } from "./recovery-lineage-sidecar";
|
|
2
|
+
import type { AcceptedInputDispositionEntry } from "./types";
|
|
3
|
+
export declare function quarantineReferencesRetiredSidecar(quarantine: NonNullable<AcceptedInputDispositionEntry["legacyAuthorityQuarantine"]>, retired: RecoveryLineageSidecar, interruptedRevision: string): boolean;
|
|
4
|
+
export declare function findRetiredSidecarQuarantine(quarantines: readonly NonNullable<AcceptedInputDispositionEntry["legacyAuthorityQuarantine"]>[], retired: RecoveryLineageSidecar, interruptedRevision: string): {
|
|
5
|
+
scope: {
|
|
6
|
+
agentId: string | null;
|
|
7
|
+
conversationId: string;
|
|
8
|
+
};
|
|
9
|
+
recoveryLineageId: string;
|
|
10
|
+
interruptedRevision: string;
|
|
11
|
+
expiresAt: number;
|
|
12
|
+
} | undefined;
|
|
13
|
+
//# sourceMappingURL=legacy-authority-quarantine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-authority-quarantine.d.ts","sourceRoot":"","sources":["../../../../src/websocket/listener/legacy-authority-quarantine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,SAAS,CAAC;AAE7D,wBAAgB,kCAAkC,CAChD,UAAU,EAAE,WAAW,CACrB,6BAA6B,CAAC,2BAA2B,CAAC,CAC3D,EACD,OAAO,EAAE,sBAAsB,EAC/B,mBAAmB,EAAE,MAAM,GAC1B,OAAO,CAOT;AAED,wBAAgB,4BAA4B,CAC1C,WAAW,EAAE,SAAS,WAAW,CAC/B,6BAA6B,CAAC,2BAA2B,CAAC,CAC3D,EAAE,EACH,OAAO,EAAE,sBAAsB,EAC/B,mBAAmB,EAAE,MAAM;;;;;;;;cAS5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle-message.d.ts","sourceRoot":"","sources":["../../../../src/websocket/listener/lifecycle-message.ts"],"names":[],"mappings":"AAAA,wBAAgB,0BAA0B,CAAC,YAAY,SAAS,MAAM,EACpE,WAAW,EAAE,YAAY,EACzB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GACpB;IACD,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,YAAY,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAOA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { OutboundFrameSettlement } from "./outbound-wire";
|
|
2
|
+
export interface OutboundMessageDelivery {
|
|
3
|
+
receipts: Array<{
|
|
4
|
+
connectionId: string | null;
|
|
5
|
+
settlement: Promise<OutboundFrameSettlement>;
|
|
6
|
+
cancel(): void;
|
|
7
|
+
}>;
|
|
8
|
+
replayTo(connectionId: string): OutboundMessageDelivery;
|
|
9
|
+
}
|
|
10
|
+
export declare function createOutboundMessageDelivery(receipts: OutboundMessageDelivery["receipts"], replayTo: (connectionId: string) => OutboundMessageDelivery): OutboundMessageDelivery;
|
|
11
|
+
type DeliveryWaitResult = "sent" | "interrupted";
|
|
12
|
+
/** Deliver every terminal prefix to one current owner before advancing. */
|
|
13
|
+
export declare function awaitOrderedOutboundDeliveries(params: {
|
|
14
|
+
deliveries: OutboundMessageDelivery[];
|
|
15
|
+
getOwnerId(): string | null;
|
|
16
|
+
shouldInterrupt(): boolean;
|
|
17
|
+
receiptMatchesOwner?(receipt: OutboundMessageDelivery["receipts"][number], ownerId: string): boolean;
|
|
18
|
+
ownerWaitTimeoutMs?: number;
|
|
19
|
+
}): Promise<DeliveryWaitResult>;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=outbound-delivery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outbound-delivery.d.ts","sourceRoot":"","sources":["../../../../src/websocket/listener/outbound-delivery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE/D,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,KAAK,CAAC;QACd,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;QAC5B,UAAU,EAAE,OAAO,CAAC,uBAAuB,CAAC,CAAC;QAC7C,MAAM,IAAI,IAAI,CAAC;KAChB,CAAC,CAAC;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,uBAAuB,CAAC;CACzD;AAED,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,uBAAuB,CAAC,UAAU,CAAC,EAC7C,QAAQ,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,uBAAuB,GAC1D,uBAAuB,CAEzB;AAED,KAAK,kBAAkB,GAAG,MAAM,GAAG,aAAa,CAAC;AA8CjD,2EAA2E;AAC3E,wBAAsB,8BAA8B,CAAC,MAAM,EAAE;IAC3D,UAAU,EAAE,uBAAuB,EAAE,CAAC;IACtC,UAAU,IAAI,MAAM,GAAG,IAAI,CAAC;IAC5B,eAAe,IAAI,OAAO,CAAC;IAC3B,mBAAmB,CAAC,CAClB,OAAO,EAAE,uBAAuB,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,EACpD,OAAO,EAAE,MAAM,GACd,OAAO,CAAC;IACX,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAgF9B"}
|
|
@@ -49,6 +49,13 @@ export interface OutboundFrame {
|
|
|
49
49
|
} | null;
|
|
50
50
|
/** Called if the socket write throws. */
|
|
51
51
|
onSendError?(error: unknown): void;
|
|
52
|
+
/** Called when this frame is known not to have reached transport.send(). */
|
|
53
|
+
onDropped?(): void;
|
|
54
|
+
}
|
|
55
|
+
export type OutboundFrameSettlement = "sent" | "dropped";
|
|
56
|
+
export interface OutboundFrameReceipt {
|
|
57
|
+
settlement: Promise<OutboundFrameSettlement>;
|
|
58
|
+
cancel(): void;
|
|
52
59
|
}
|
|
53
60
|
/**
|
|
54
61
|
* Queue and watermark limits.
|
|
@@ -64,18 +71,21 @@ export declare const OUTBOUND_QUEUE_LIMITS: {
|
|
|
64
71
|
readonly HIGH_WATERMARK_BUFFERED_BYTES: number;
|
|
65
72
|
readonly KILL_THRESHOLD_BUFFERED_BYTES: number;
|
|
66
73
|
readonly DRAIN_POLL_MS: 50;
|
|
74
|
+
readonly MAX_BACKPRESSURE_MS: 5000;
|
|
67
75
|
};
|
|
68
76
|
/**
|
|
69
77
|
* Enqueue a frame and drain as far as the socket allows. When the socket is
|
|
70
78
|
* healthy this sends synchronously in the same tick (identical behavior to
|
|
71
79
|
* the pre-queue direct send); the queue only forms under backpressure.
|
|
72
80
|
*/
|
|
73
|
-
export declare function enqueueOutboundFrame(transport: ListenerTransport, frame: OutboundFrame):
|
|
81
|
+
export declare function enqueueOutboundFrame(transport: ListenerTransport, frame: OutboundFrame): OutboundFrameReceipt;
|
|
74
82
|
/** Test/diagnostic visibility into a transport's queue. */
|
|
75
83
|
export declare function getOutboundQueueStats(transport: ListenerTransport): {
|
|
76
84
|
queuedFrames: number;
|
|
77
85
|
killed: boolean;
|
|
78
86
|
};
|
|
87
|
+
/** Settle every queued frame when its owning connection closes. */
|
|
88
|
+
export declare function closeOutboundTransportQueue(transport: ListenerTransport): void;
|
|
79
89
|
export declare const __outboundWireTestUtils: {
|
|
80
90
|
clearTransportQueue(transport: ListenerTransport): void;
|
|
81
91
|
};
|