@rynfar/meridian 1.62.2 → 1.62.4
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/{cli-7jgse65q.js → cli-n1jsth00.js} +262 -166
- package/dist/cli.js +1 -1
- package/dist/proxy/concurrency.d.ts +19 -2
- package/dist/proxy/concurrency.d.ts.map +1 -1
- package/dist/proxy/messages.d.ts +0 -28
- package/dist/proxy/messages.d.ts.map +1 -1
- package/dist/proxy/passthroughEarlyStop.d.ts +45 -42
- package/dist/proxy/passthroughEarlyStop.d.ts.map +1 -1
- package/dist/proxy/query.d.ts +3 -2
- package/dist/proxy/query.d.ts.map +1 -1
- package/dist/proxy/server.d.ts.map +1 -1
- package/dist/proxy/session/cache.d.ts +1 -1
- package/dist/proxy/session/cache.d.ts.map +1 -1
- package/dist/proxy/session/lineage.d.ts +12 -2
- package/dist/proxy/session/lineage.d.ts.map +1 -1
- package/dist/proxy/sessionStore.d.ts +6 -3
- package/dist/proxy/sessionStore.d.ts.map +1 -1
- package/dist/server.js +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -11,10 +11,22 @@ export declare function requestCancelledError(reason?: unknown): Error;
|
|
|
11
11
|
export declare function resolveMaxConcurrent(source?: NodeJS.ProcessEnv, warn?: (message: string) => void): number;
|
|
12
12
|
/** FIFO semaphore whose queued acquisitions can be cancelled safely. */
|
|
13
13
|
export declare class AbortableSemaphore {
|
|
14
|
-
readonly limit: number;
|
|
15
14
|
private activeCount;
|
|
15
|
+
private currentLimit;
|
|
16
16
|
private readonly waiters;
|
|
17
17
|
constructor(limit: number);
|
|
18
|
+
get limit(): number;
|
|
19
|
+
/**
|
|
20
|
+
* Change the budget in place.
|
|
21
|
+
*
|
|
22
|
+
* Mutating beats swapping the instance: queued waiters and in-flight leases
|
|
23
|
+
* belong to this object, so replacing it would strand them holding permits
|
|
24
|
+
* nobody counts. Raising the limit immediately grants whoever is already
|
|
25
|
+
* waiting; lowering it never revokes a live lease — the extra permits simply
|
|
26
|
+
* stop being reissued as the current holders release, so the semaphore
|
|
27
|
+
* converges on the new budget without killing work already underway.
|
|
28
|
+
*/
|
|
29
|
+
setLimit(next: number): void;
|
|
18
30
|
get snapshot(): SemaphoreSnapshot;
|
|
19
31
|
acquire(signal?: AbortSignal): Promise<SemaphoreLease>;
|
|
20
32
|
private createLease;
|
|
@@ -22,7 +34,12 @@ export declare class AbortableSemaphore {
|
|
|
22
34
|
}
|
|
23
35
|
/**
|
|
24
36
|
* One SDK subprocess budget per process, shared by every ProxyServer instance.
|
|
25
|
-
*
|
|
37
|
+
*
|
|
38
|
+
* The identity of the semaphore is stable — every caller gets the same object,
|
|
39
|
+
* which is the whole point of a shared budget — but its limit is reconciled
|
|
40
|
+
* against the environment on each call. Caching the limit at first use made the
|
|
41
|
+
* value depend on which proxy happened to start first, so a later instance (or
|
|
42
|
+
* a test that set MERIDIAN_MAX_CONCURRENT) was silently ignored.
|
|
26
43
|
*/
|
|
27
44
|
export declare function getProcessSdkSemaphore(): AbortableSemaphore;
|
|
28
45
|
/** Reset process-scoped state between tests that override concurrency env vars. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"concurrency.d.ts","sourceRoot":"","sources":["../../src/proxy/concurrency.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,OAAO,IAAI,IAAI,CAAA;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB;AAcD,wBAAgB,qBAAqB,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,KAAK,CAM7D;AAED,wBAAgB,oBAAoB,CAClC,MAAM,GAAE,MAAM,CAAC,UAAwB,EACvC,IAAI,GAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAmB,GAC7C,MAAM,CAcR;
|
|
1
|
+
{"version":3,"file":"concurrency.d.ts","sourceRoot":"","sources":["../../src/proxy/concurrency.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,OAAO,IAAI,IAAI,CAAA;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB;AAcD,wBAAgB,qBAAqB,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,KAAK,CAM7D;AAED,wBAAgB,oBAAoB,CAClC,MAAM,GAAE,MAAM,CAAC,UAAwB,EACvC,IAAI,GAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAmB,GAC7C,MAAM,CAcR;AASD,wEAAwE;AACxE,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,WAAW,CAAI;IACvB,OAAO,CAAC,YAAY,CAAQ;IAC5B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAe;gBAE3B,KAAK,EAAE,MAAM;IAIzB,IAAI,KAAK,IAAI,MAAM,CAElB;IAED;;;;;;;;;OASG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAQ5B,IAAI,QAAQ,IAAI,iBAAiB,CAEhC;IAED,OAAO,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC;IAwBtD,OAAO,CAAC,WAAW;IAanB,OAAO,CAAC,SAAS;CAelB;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,IAAI,kBAAkB,CAQ3D;AAED,mFAAmF;AACnF,wBAAgB,gCAAgC,IAAI,IAAI,CAGvD"}
|
package/dist/proxy/messages.d.ts
CHANGED
|
@@ -100,34 +100,6 @@ export declare function frameReplayTurns(turns: Array<{
|
|
|
100
100
|
role: string;
|
|
101
101
|
text: string;
|
|
102
102
|
}>): string;
|
|
103
|
-
/**
|
|
104
|
-
* Lead-in for a passthrough continuation that forks from a deny boundary.
|
|
105
|
-
*
|
|
106
|
-
* Every forwarded tool call is denied with "do not generate further text —
|
|
107
|
-
* end your turn now" (the nudge that stops the model fabricating results for
|
|
108
|
-
* calls the client will execute). That deny is persisted as the tool_result,
|
|
109
|
-
* and the deny boundary fork puts it IMMEDIATELY before the continuation's
|
|
110
|
-
* user turn. So the last instruction in the model's context tells it to emit
|
|
111
|
-
* no text — and the next thing it must do is answer. Observed live: the model
|
|
112
|
-
* obeys the nearer instruction and returns thinking plus an EMPTY text block
|
|
113
|
-
* with stop_reason "end_turn"; the CLI's own "previous response had no visible
|
|
114
|
-
* output" nudge does not help, because the deny is still there. The proxy
|
|
115
|
-
* forwards zero text deltas, reports 200, and the client's run goes quiet with
|
|
116
|
-
* the tool results unanswered (three occurrences in 500 requests, all on a
|
|
117
|
-
* session's second turn — where the deny is the largest thing in context).
|
|
118
|
-
*
|
|
119
|
-
* The deny cannot be rewritten after the fact: it lives in the CLI's session
|
|
120
|
-
* file. So the continuation says plainly that the instruction is spent. Framing
|
|
121
|
-
* only — no transcript markers, nothing for the model to imitate (#496/#619).
|
|
122
|
-
*/
|
|
123
|
-
export declare const PASSTHROUGH_CONTINUATION_LEAD_IN: string;
|
|
124
|
-
/**
|
|
125
|
-
* Prefix a passthrough continuation delta with the lead-in above.
|
|
126
|
-
*
|
|
127
|
-
* An empty delta is returned unchanged — there is nothing to answer, so the
|
|
128
|
-
* lead-in would be the only content and would read as the user's own turn.
|
|
129
|
-
*/
|
|
130
|
-
export declare function framePassthroughContinuation(delta: string): string;
|
|
131
103
|
/**
|
|
132
104
|
* Remove fields the Claude Agent SDK attaches to streamed events that are not
|
|
133
105
|
* part of the public Anthropic streaming schema.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/proxy/messages.ts"],"names":[],"mappings":"AAAA;;GAEG;AAcH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,wBAAwB,aAA6C,CAAA;AAElF;;;GAGG;AACH,eAAO,MAAM,wBAAwB,aAA+C,CAAA;AAEpF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,2BAA2B,aAYtC,CAAA;AAEF;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,GAAG,GAAG,MAAM,CAmBrD;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAUtE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,CAM7D;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,GAAG,CAAA;CAAE,CAAC,GAAG,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,GAAG,CAAA;CAAE,CAAC,CAKzH;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,MAAM,CAerF;AAED
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/proxy/messages.ts"],"names":[],"mappings":"AAAA;;GAEG;AAcH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,wBAAwB,aAA6C,CAAA;AAElF;;;GAGG;AACH,eAAO,MAAM,wBAAwB,aAA+C,CAAA;AAEpF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,2BAA2B,aAYtC,CA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AA4FD;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,GAAG,CAAA;CAAE,CAAC,GAC9C,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAyB3B;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAO3D;AA6BD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAQzD"}
|
|
@@ -8,22 +8,25 @@
|
|
|
8
8
|
* thinking pass per tool step, roughly doubling per-step output spend and
|
|
9
9
|
* adding a full model round-trip of latency.
|
|
10
10
|
*
|
|
11
|
-
* The
|
|
12
|
-
* the
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
11
|
+
* The SDK emits each denied call's tool_result as a `user` message before it
|
|
12
|
+
* fires the hidden digest turn. Those messages identify a stable assistant
|
|
13
|
+
* checkpoint, but they are NOT a durability acknowledgement: a live PTY E2E
|
|
14
|
+
* observed the assistant and deny in the iterator while neither existed in the
|
|
15
|
+
* session JSONL after an immediate abort. The proxy therefore freezes the
|
|
16
|
+
* assistant UUID/tool IDs at deny settlement, drains the hidden digest without
|
|
17
|
+
* forwarding it, and stores the checkpoint only after the SDK's canonical
|
|
18
|
+
* terminal result commits the transcript.
|
|
19
19
|
*
|
|
20
20
|
* Pure module — no I/O, no imports from server.ts or session/.
|
|
21
21
|
*/
|
|
22
22
|
export interface EarlyStopTracker {
|
|
23
|
-
/** tool_use ids of client-forwarded calls awaiting
|
|
23
|
+
/** tool_use ids of client-forwarded calls awaiting an iterator-observed deny */
|
|
24
24
|
expected: Set<string>;
|
|
25
25
|
/** subset of `expected` whose tool_result has been observed in the stream */
|
|
26
26
|
resolved: Set<string>;
|
|
27
|
+
/** Last assistant message containing a forwarded tool_use.
|
|
28
|
+
* The SDK's resumeSessionAt option only accepts assistant UUIDs. */
|
|
29
|
+
toolCallAssistantUuid?: string;
|
|
27
30
|
/** true once shouldEarlyStop has returned true — it fires at most once */
|
|
28
31
|
fired: boolean;
|
|
29
32
|
}
|
|
@@ -42,7 +45,17 @@ export declare function isClientForwardedToolUse(block: unknown): boolean;
|
|
|
42
45
|
*/
|
|
43
46
|
export declare function noteAssistantContent(tracker: EarlyStopTracker, content: unknown): void;
|
|
44
47
|
/**
|
|
45
|
-
* Record
|
|
48
|
+
* Record one SDK assistant message and remember the only boundary type the
|
|
49
|
+
* Agent SDK supports for resumeSessionAt: an SDKAssistantMessage UUID.
|
|
50
|
+
*
|
|
51
|
+
* The SDK may surface parallel tool calls as multiple assistant messages. The
|
|
52
|
+
* final such message is an ancestor containing the complete tool-use turn, so
|
|
53
|
+
* updating the boundary for every forwarded call leaves the correct stable
|
|
54
|
+
* checkpoint.
|
|
55
|
+
*/
|
|
56
|
+
export declare function noteAssistantMessage(tracker: EarlyStopTracker, message: unknown): void;
|
|
57
|
+
/**
|
|
58
|
+
* Record iterator-observed tool_results from a user message's content.
|
|
46
59
|
*
|
|
47
60
|
* Records EVERY tool_result id, not just already-expected ones: the CLI
|
|
48
61
|
* dispatches hooks per-block while later blocks are still streaming, and it
|
|
@@ -54,15 +67,25 @@ export declare function noteAssistantContent(tracker: EarlyStopTracker, content:
|
|
|
54
67
|
export declare function noteUserContent(tracker: EarlyStopTracker, content: unknown): void;
|
|
55
68
|
/**
|
|
56
69
|
* True exactly once: when at least one client tool call was forwarded and
|
|
57
|
-
* every forwarded call's deny has been observed in the stream.
|
|
58
|
-
* the
|
|
70
|
+
* every forwarded call's deny has been observed in the stream. The caller may
|
|
71
|
+
* freeze the checkpoint then, but must drain to a canonical SDK result before
|
|
72
|
+
* treating the UUID as durably resumable.
|
|
59
73
|
*/
|
|
74
|
+
export declare function allForwardedCallsResolved(tracker: EarlyStopTracker): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Verify that a resumed tool-result delta settles exactly the tool calls at the
|
|
77
|
+
* stored assistant checkpoint. Tool results must precede any ordinary user
|
|
78
|
+
* content, matching the Anthropic Messages protocol.
|
|
79
|
+
*/
|
|
80
|
+
export declare function isCompleteToolResultContinuation(messages: Array<{
|
|
81
|
+
role?: unknown;
|
|
82
|
+
content?: unknown;
|
|
83
|
+
}>, expectedIds: readonly string[]): boolean;
|
|
84
|
+
/** The cache-stable assistant boundary after every forwarded call settled. */
|
|
85
|
+
export declare function settledToolCallAssistantUuid(tracker: EarlyStopTracker): string | undefined;
|
|
60
86
|
export declare function shouldEarlyStop(tracker: EarlyStopTracker): boolean;
|
|
61
87
|
/** What a client-aborted stream must do with its session mapping. */
|
|
62
88
|
export type ClientAbortDisposition = {
|
|
63
|
-
action: "store";
|
|
64
|
-
resumeUuid: string;
|
|
65
|
-
} | {
|
|
66
89
|
action: "evict";
|
|
67
90
|
} | {
|
|
68
91
|
action: "none";
|
|
@@ -71,39 +94,19 @@ export type ClientAbortDisposition = {
|
|
|
71
94
|
* Decide the fate of a session whose stream the CLIENT aborted (the user hit
|
|
72
95
|
* stop, or the connection dropped).
|
|
73
96
|
*
|
|
74
|
-
* A client abort leaves the SDK session ending in an interrupted tail
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* never recovers on its own: every following turn comes back empty until the
|
|
80
|
-
* lineage is discarded.
|
|
81
|
-
*
|
|
82
|
-
* An early stop is meridian's own doing and always has a persisted deny to
|
|
83
|
-
* fork from; a user interrupt is not an early stop and may have none. So:
|
|
84
|
-
*
|
|
85
|
-
* - a boundary was persisted → store it, and the next continuation forks
|
|
86
|
-
* there (lineage and prompt cache survive);
|
|
87
|
-
* - no boundary → nothing is safe to resume from, so drop the mapping and let
|
|
88
|
-
* the next request replay into a fresh SDK session. A cache-miss replay is
|
|
89
|
-
* the cost of not wedging the conversation.
|
|
90
|
-
*
|
|
91
|
-
* `sawDuplicateToolUse` keeps the #552 rule: such a history holds a dangling
|
|
92
|
-
* dropped call that diverges from the client's view and is never resumable.
|
|
97
|
+
* A client abort leaves the SDK session ending in an interrupted tail. Even an
|
|
98
|
+
* assistant UUID already seen in the iterator is not known durable until the
|
|
99
|
+
* canonical result: the live PTY regression yielded that UUID but never wrote
|
|
100
|
+
* it to JSONL after abort. Therefore every owned mapping is evicted; a replay
|
|
101
|
+
* costs one cache miss but cannot wedge on a missing or interrupted boundary.
|
|
93
102
|
*/
|
|
94
103
|
export declare function clientAbortDisposition(input: {
|
|
95
104
|
isIndependentSession: boolean;
|
|
96
105
|
profileSessionId?: string;
|
|
97
106
|
currentSessionId?: string;
|
|
98
107
|
sawDuplicateToolUse: boolean;
|
|
99
|
-
|
|
100
|
-
/** Only passthrough turns
|
|
108
|
+
toolCallAssistantUuid?: string;
|
|
109
|
+
/** Only passthrough turns create synthetic denial side branches. */
|
|
101
110
|
passthrough: boolean;
|
|
102
111
|
}): ClientAbortDisposition;
|
|
103
|
-
/**
|
|
104
|
-
* Resume boundary of an early-stopped session: the uuid of a persisted `user`
|
|
105
|
-
* message carrying tool_results. The last one before the abort is the final
|
|
106
|
-
* deny — continuations fork there instead of resuming the interrupted tail.
|
|
107
|
-
*/
|
|
108
|
-
export declare function resumeBoundaryUuid(message: unknown): string | undefined;
|
|
109
112
|
//# sourceMappingURL=passthroughEarlyStop.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"passthroughEarlyStop.d.ts","sourceRoot":"","sources":["../../src/proxy/passthroughEarlyStop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAUH,MAAM,WAAW,gBAAgB;IAC/B,
|
|
1
|
+
{"version":3,"file":"passthroughEarlyStop.d.ts","sourceRoot":"","sources":["../../src/proxy/passthroughEarlyStop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAUH,MAAM,WAAW,gBAAgB;IAC/B,g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MAAM,CAAA;CAAE,CAAA;AAEtB;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE;IAC5C,oBAAoB,EAAE,OAAO,CAAA;IAC7B,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,mBAAmB,EAAE,OAAO,CAAA;IAC5B,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,oEAAoE;IACpE,WAAW,EAAE,OAAO,CAAA;CACrB,GAAG,sBAAsB,CAMzB"}
|
package/dist/proxy/query.d.ts
CHANGED
|
@@ -43,8 +43,9 @@ export interface QueryContext {
|
|
|
43
43
|
resumeSessionId?: string;
|
|
44
44
|
/** Whether this is an undo operation */
|
|
45
45
|
isUndo: boolean;
|
|
46
|
-
/**
|
|
47
|
-
*
|
|
46
|
+
/** Resume at this SDK assistant-message UUID (undo rollback point or
|
|
47
|
+
* passthrough tool-use boundary). Maps to resumeSessionAt, which accepts
|
|
48
|
+
* SDKAssistantMessage UUIDs only; forkSession separately chooses a new ID. */
|
|
48
49
|
resumeSessionAtUuid?: string;
|
|
49
50
|
/** Fork the resumed session instead of attaching to it (#630 busy-session
|
|
50
51
|
* fallback — the original stays registered as a bg agent; the fork gets a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/proxy/query.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAW,aAAa,EAAE,MAAM,gCAAgC,CAAA;AAEnG,OAAO,EAAE,0BAA0B,EAAwB,MAAM,oBAAoB,CAAA;AAErF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AA6CtC,MAAM,WAAW,YAAY;IAC3B,iEAAiE;IACjE,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC,GAAG,CAAC,CAAA;IACnC,iCAAiC;IACjC,KAAK,EAAE,MAAM,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CACjB;AA2CD;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAkBvE;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,0BAA0B,QAWnB,CAAA;AAiCpB,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,YAAY,EAAE,eAAe,CAAC,EAAE,eAAe,GAAG,gBAAgB,CAoJxG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/proxy/server.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACtE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,CAAA;AAGvD,YAAY,EACV,SAAS,EACT,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,WAAW,GACZ,MAAM,aAAa,CAAA;AAKpB,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAoDnG,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,oBAAoB,
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/proxy/server.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACtE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,CAAA;AAGvD,YAAY,EACV,SAAS,EACT,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,WAAW,GACZ,MAAM,aAAa,CAAA;AAKpB,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAoDnG,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,oBAAoB,EAGpB,KAAK,aAAa,EAGnB,MAAM,mBAAmB,CAAA;AAI1B,OAAO,EAA+B,iBAAiB,EAAE,mBAAmB,EAAsC,MAAM,iBAAiB,CAAA;AAIzI,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAA;AAChE,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,CAAA;AACjD,YAAY,EAAE,aAAa,EAAE,CAAA;AA0W7B,wBAAgB,iBAAiB,CAAC,MAAM,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,WAAW,CA28JhF;AAWD,wBAAgB,gCAAgC,IAAI,IAAI,CAavD;AAED,wBAAsB,gBAAgB,CAAC,MAAM,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAqHhG"}
|
|
@@ -33,5 +33,5 @@ export declare function getSessionByClaudeId(claudeSessionId: string): SessionSt
|
|
|
33
33
|
export declare function storeSession(sessionId: string | undefined, messages: Array<{
|
|
34
34
|
role: string;
|
|
35
35
|
content: unknown;
|
|
36
|
-
}>, claudeSessionId: string, workingDirectory?: string, sdkMessageUuids?: Array<string | null>, contextUsage?: TokenUsage,
|
|
36
|
+
}>, claudeSessionId: string, workingDirectory?: string, sdkMessageUuids?: Array<string | null>, contextUsage?: TokenUsage, passthroughToolCallAssistantUuid?: string | null, passthroughToolCallIds?: string[] | null): void;
|
|
37
37
|
//# sourceMappingURL=cache.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../src/proxy/session/cache.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAYH,OAAO,EAML,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,aAAa,EACnB,MAAM,WAAW,CA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E,CAAC,EAC/C,gBAAgB,CAAC,EAAE,MAAM,GACxB,aAAa,CA6Df;AAED;;uFAEuF;AACvF,wBAAgB,oBAAoB,CAAC,eAAe,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CA8BtF;AAED;;;yFAGyF;AACzF,wBAAgB,YAAY,CAC1B,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,QAAQ,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,EACnD,eAAe,EAAE,MAAM,EACvB,gBAAgB,CAAC,EAAE,MAAM,EACzB,eAAe,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,EACtC,YAAY,CAAC,EAAE,UAAU,EACzB,gCAAgC,CAAC,EAAE,MAAM,GAAG,IAAI,EAChD,sBAAsB,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,QA4CzC"}
|
|
@@ -43,11 +43,21 @@ export interface SessionState {
|
|
|
43
43
|
* Only assistant messages have UUIDs (user messages are null).
|
|
44
44
|
* Used to find the rollback point for undo. */
|
|
45
45
|
sdkMessageUuids?: Array<string | null>;
|
|
46
|
-
/**
|
|
47
|
-
|
|
46
|
+
/** SDK assistant UUID immediately before synthetic passthrough denials.
|
|
47
|
+
* Must be an assistant UUID: the Agent SDK rejects other resumeSessionAt boundaries. */
|
|
48
|
+
passthroughToolCallAssistantUuid?: string;
|
|
49
|
+
/** Forwarded tool IDs that must be settled together at the checkpoint. */
|
|
50
|
+
passthroughToolCallIds?: string[];
|
|
48
51
|
/** Last observed token usage for this session (from SDK message_start / message_delta events) */
|
|
49
52
|
contextUsage?: TokenUsage;
|
|
50
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Associate SDK assistant events from the current upstream run with the single
|
|
56
|
+
* assistant message the Anthropic client will append after this request.
|
|
57
|
+
* Multiple SDK fragments overwrite the same future slot, leaving the final
|
|
58
|
+
* assistant UUID as the undo checkpoint for the consolidated client turn.
|
|
59
|
+
*/
|
|
60
|
+
export declare function withClientAssistantUuid(existing: Array<string | null>, clientMessageCount: number, uuid: unknown): Array<string | null>;
|
|
51
61
|
/**
|
|
52
62
|
* Result of lineage verification — classifies the mutation and provides
|
|
53
63
|
* the information needed to take the correct SDK action.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lineage.d.ts","sourceRoot":"","sources":["../../../src/proxy/session/lineage.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,4EAA4E;AAC5E,MAAM,WAAW,mBAAmB;IAClC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,uBAAuB,CAAC,EAAE,MAAM,CAAA;IAChC,2BAA2B,CAAC,EAAE,MAAM,CAAA;IACpC,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,kFAAkF;AAClF,MAAM,WAAW,UAAW,SAAQ,mBAAmB;IACrD,UAAU,CAAC,EAAE,mBAAmB,EAAE,CAAA;CACnC;AAED;;6DAE6D;AAC7D,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,UAAU,GAAG,mBAAmB,CAG5E;AAED;0EAC0E;AAC1E,eAAO,MAAM,yBAAyB,IAAI,CAAA;AAE1C,MAAM,WAAW,YAAY;IAC3B,eAAe,EAAE,MAAM,CAAA;IACvB,UAAU,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,MAAM,CAAA;IACpB;;qDAEiD;IACjD,WAAW,EAAE,MAAM,CAAA;IACnB;;kCAE8B;IAC9B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB;;iDAE6C;IAC7C,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAAE,CAAA;IAC/B;;oDAEgD;IAChD,eAAe,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;IACtC,
|
|
1
|
+
{"version":3,"file":"lineage.d.ts","sourceRoot":"","sources":["../../../src/proxy/session/lineage.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,GAAG,MAAM,CA6B7F;AAyBD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,GAAG,CAAA;CAAE,CAAC,GAC9C,aAAa,CAkKf"}
|
|
@@ -23,8 +23,11 @@ export interface StoredSession {
|
|
|
23
23
|
messageBlockHashes?: string[][];
|
|
24
24
|
/** Per-message SDK assistant UUIDs for undo rollback (null for user messages) */
|
|
25
25
|
sdkMessageUuids?: Array<string | null>;
|
|
26
|
-
/**
|
|
27
|
-
|
|
26
|
+
/** SDK assistant UUID immediately before synthetic passthrough denials.
|
|
27
|
+
* Continuations resume the same session here, preserving the stable prefix. */
|
|
28
|
+
passthroughToolCallAssistantUuid?: string;
|
|
29
|
+
/** Forwarded tool IDs pending at the stored assistant checkpoint. */
|
|
30
|
+
passthroughToolCallIds?: string[];
|
|
28
31
|
/** Last observed token usage for this Claude session */
|
|
29
32
|
contextUsage?: TokenUsage;
|
|
30
33
|
/** Previous Claude session ID preserved when the session mapping is replaced.
|
|
@@ -40,7 +43,7 @@ export declare function setSessionStoreDir(dir: string | null, opts?: {
|
|
|
40
43
|
}): void;
|
|
41
44
|
export declare function lookupSharedSession(key: string): StoredSession | undefined;
|
|
42
45
|
export declare function lookupSharedSessionByClaudeId(claudeSessionId: string): StoredSession | undefined;
|
|
43
|
-
export declare function storeSharedSession(key: string, claudeSessionId: string, messageCount?: number, lineageHash?: string, messageHashes?: string[], sdkMessageUuids?: Array<string | null>, contextUsage?: TokenUsage, messageBlockHashes?: string[][],
|
|
46
|
+
export declare function storeSharedSession(key: string, claudeSessionId: string, messageCount?: number, lineageHash?: string, messageHashes?: string[], sdkMessageUuids?: Array<string | null>, contextUsage?: TokenUsage, messageBlockHashes?: string[][], passthroughToolCallAssistantUuid?: string | null, passthroughToolCallIds?: string[] | null): void;
|
|
44
47
|
/** Remove a single session from the shared file store.
|
|
45
48
|
* Used when a session is detected as stale (e.g. expired upstream). */
|
|
46
49
|
export declare function evictSharedSession(key: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessionStore.d.ts","sourceRoot":"","sources":["../../src/proxy/sessionStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAeH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAEnD,MAAM,WAAW,aAAa;IAC5B,eAAe,EAAE,MAAM,CAAA;IACvB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,MAAM,CAAA;IACpB,gFAAgF;IAChF,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,6EAA6E;IAC7E,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB,mFAAmF;IACnF,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAAE,CAAA;IAC/B,iFAAiF;IACjF,eAAe,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;IACtC,
|
|
1
|
+
{"version":3,"file":"sessionStore.d.ts","sourceRoot":"","sources":["../../src/proxy/sessionStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAeH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAEnD,MAAM,WAAW,aAAa;IAC5B,eAAe,EAAE,MAAM,CAAA;IACvB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,MAAM,CAAA;IACpB,gFAAgF;IAChF,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,6EAA6E;IAC7E,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB,mFAAmF;IACnF,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAAE,CAAA;IAC/B,iFAAiF;IACjF,eAAe,CAAC,EAAE,KAAK,CAAC,MAAM,GAA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