@rynfar/meridian 1.40.0 → 1.41.1
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-3azh7s3k.js → cli-51a9sav0.js} +811 -93
- package/dist/{cli-m9pfb7h9.js → cli-e289rj3k.js} +79 -46
- package/dist/cli.js +3 -3
- package/dist/{profilePage-77z05e0r.js → profilePage-k0faye28.js} +196 -4
- package/dist/proxy/adapters/droid.d.ts.map +1 -1
- package/dist/proxy/agentDefs.d.ts +2 -0
- package/dist/proxy/agentDefs.d.ts.map +1 -1
- package/dist/proxy/errors.d.ts +42 -0
- package/dist/proxy/errors.d.ts.map +1 -1
- package/dist/proxy/models.d.ts +26 -0
- package/dist/proxy/models.d.ts.map +1 -1
- package/dist/proxy/oauthUsage.d.ts +67 -0
- package/dist/proxy/oauthUsage.d.ts.map +1 -0
- package/dist/proxy/openai.d.ts +140 -14
- package/dist/proxy/openai.d.ts.map +1 -1
- package/dist/proxy/query.d.ts.map +1 -1
- package/dist/proxy/sdkFeatures.d.ts.map +1 -1
- package/dist/proxy/server.d.ts.map +1 -1
- package/dist/proxy/tokenRefresh.d.ts +33 -1
- package/dist/proxy/tokenRefresh.d.ts.map +1 -1
- package/dist/proxy/tools.d.ts.map +1 -1
- package/dist/proxy/transforms/droid.d.ts.map +1 -1
- package/dist/server.js +2 -2
- package/dist/telemetry/profilePage.d.ts.map +1 -1
- package/dist/telemetry/profileUsage.d.ts +57 -0
- package/dist/telemetry/profileUsage.d.ts.map +1 -0
- package/dist/tokenRefresh-psq94r54.js +19 -0
- package/package.json +3 -3
- package/dist/tokenRefresh-y7d1qvb3.js +0 -11
package/dist/proxy/openai.d.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* This is intentional — OpenAI-format clients replay full history themselves
|
|
16
16
|
* and don't benefit from Meridian's session resumption.
|
|
17
17
|
*/
|
|
18
|
-
export type OpenAiRole = "system" | "user" | "assistant";
|
|
18
|
+
export type OpenAiRole = "system" | "user" | "assistant" | "tool";
|
|
19
19
|
export interface OpenAiTextPart {
|
|
20
20
|
type: "text";
|
|
21
21
|
text?: string;
|
|
@@ -35,8 +35,23 @@ export interface OpenAiContentPart {
|
|
|
35
35
|
}
|
|
36
36
|
export interface OpenAiMessage {
|
|
37
37
|
role: OpenAiRole;
|
|
38
|
+
tool_call_id?: string;
|
|
38
39
|
content: string | OpenAiContentPart[];
|
|
40
|
+
tool_calls?: OpenAiCompletionToolCall[];
|
|
39
41
|
}
|
|
42
|
+
export interface OpenAiChatToolFunction {
|
|
43
|
+
type: "function";
|
|
44
|
+
function: {
|
|
45
|
+
name: string;
|
|
46
|
+
description?: string;
|
|
47
|
+
parameters: unknown;
|
|
48
|
+
strict?: boolean;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export interface OpenAiChatToolCustom {
|
|
52
|
+
type: "custom";
|
|
53
|
+
}
|
|
54
|
+
export type OpenAiChatTool = OpenAiChatToolFunction | OpenAiChatToolCustom;
|
|
40
55
|
export interface OpenAiChatRequest {
|
|
41
56
|
model?: string;
|
|
42
57
|
messages?: OpenAiMessage[];
|
|
@@ -45,6 +60,7 @@ export interface OpenAiChatRequest {
|
|
|
45
60
|
max_completion_tokens?: number;
|
|
46
61
|
temperature?: number;
|
|
47
62
|
top_p?: number;
|
|
63
|
+
tools?: OpenAiChatTool[];
|
|
48
64
|
}
|
|
49
65
|
export interface AnthropicTextBlock {
|
|
50
66
|
type: "text";
|
|
@@ -58,10 +74,15 @@ export interface AnthropicImageBlock {
|
|
|
58
74
|
data: string;
|
|
59
75
|
};
|
|
60
76
|
}
|
|
61
|
-
export type AnthropicInputContentBlock = AnthropicTextBlock | AnthropicImageBlock;
|
|
62
77
|
export interface AnthropicMessage {
|
|
63
78
|
role: "user" | "assistant";
|
|
64
|
-
content: string |
|
|
79
|
+
content: string | AnthropicContentBlock[];
|
|
80
|
+
}
|
|
81
|
+
export interface AnthropicTool {
|
|
82
|
+
name: string;
|
|
83
|
+
description: string;
|
|
84
|
+
input_schema: unknown;
|
|
85
|
+
strict?: boolean;
|
|
65
86
|
}
|
|
66
87
|
export interface AnthropicRequestBody {
|
|
67
88
|
model: string;
|
|
@@ -71,20 +92,56 @@ export interface AnthropicRequestBody {
|
|
|
71
92
|
system?: string;
|
|
72
93
|
temperature?: number;
|
|
73
94
|
top_p?: number;
|
|
95
|
+
tools?: AnthropicTool[];
|
|
74
96
|
}
|
|
75
97
|
export interface AnthropicUsage {
|
|
76
98
|
input_tokens?: number;
|
|
77
99
|
output_tokens?: number;
|
|
78
100
|
}
|
|
79
|
-
export interface
|
|
80
|
-
type:
|
|
101
|
+
export interface AnthropicContentBlockText {
|
|
102
|
+
type: "text";
|
|
81
103
|
text?: string;
|
|
82
104
|
}
|
|
105
|
+
export interface AnthropicToolUseBlock {
|
|
106
|
+
type: "tool_use";
|
|
107
|
+
id: string;
|
|
108
|
+
name: string;
|
|
109
|
+
input: Record<string, unknown>;
|
|
110
|
+
}
|
|
111
|
+
export interface AnthropicToolResultBlock {
|
|
112
|
+
type: "tool_result";
|
|
113
|
+
tool_use_id: string;
|
|
114
|
+
content: string | AnthropicContentBlock[];
|
|
115
|
+
}
|
|
116
|
+
export interface AnthropicThinkingBlock {
|
|
117
|
+
type: "thinking";
|
|
118
|
+
thinking: string;
|
|
119
|
+
}
|
|
120
|
+
export type AnthropicContentBlock = AnthropicTextBlock | AnthropicImageBlock | AnthropicThinkingBlock | AnthropicToolResultBlock | AnthropicToolUseBlock;
|
|
83
121
|
export interface AnthropicResponse {
|
|
84
122
|
content?: AnthropicContentBlock[];
|
|
85
123
|
stop_reason?: string;
|
|
86
124
|
usage?: AnthropicUsage;
|
|
87
125
|
}
|
|
126
|
+
/**
|
|
127
|
+
* Streaming tool-call delta as emitted in chat.completion.chunk events.
|
|
128
|
+
*
|
|
129
|
+
* The OpenAI streaming protocol splits a single tool call across multiple
|
|
130
|
+
* chunks: a "start" chunk announces the call (id + function name), and
|
|
131
|
+
* subsequent "args" chunks append `function.arguments` fragments. `index`
|
|
132
|
+
* correlates fragments back to their parent call. Fields are optional rather
|
|
133
|
+
* than `DeepPartial<OpenAiCompletionToolCall>` so the type can't represent
|
|
134
|
+
* nonsense like `{ function: { arguments: undefined } }`.
|
|
135
|
+
*/
|
|
136
|
+
export interface OpenAiStreamingToolCallDelta {
|
|
137
|
+
index: number;
|
|
138
|
+
type?: "function";
|
|
139
|
+
id?: string;
|
|
140
|
+
function?: {
|
|
141
|
+
name?: string;
|
|
142
|
+
arguments?: string;
|
|
143
|
+
};
|
|
144
|
+
}
|
|
88
145
|
export interface OpenAiStreamChunk {
|
|
89
146
|
id: string;
|
|
90
147
|
object: "chat.completion.chunk";
|
|
@@ -95,10 +152,25 @@ export interface OpenAiStreamChunk {
|
|
|
95
152
|
delta: {
|
|
96
153
|
role?: "assistant";
|
|
97
154
|
content?: string;
|
|
155
|
+
tool_calls?: OpenAiStreamingToolCallDelta[];
|
|
156
|
+
reasoning_content?: string;
|
|
98
157
|
};
|
|
99
|
-
finish_reason: "stop" | "length" | null;
|
|
158
|
+
finish_reason: "stop" | "length" | "tool_calls" | null;
|
|
100
159
|
}>;
|
|
101
160
|
}
|
|
161
|
+
export interface OpenAiCompletionFunctionToolCall {
|
|
162
|
+
type: "function";
|
|
163
|
+
index?: number;
|
|
164
|
+
id: string;
|
|
165
|
+
function: {
|
|
166
|
+
name: string;
|
|
167
|
+
arguments: string;
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
export interface OpenAiCompletionCustomToolCall {
|
|
171
|
+
type: "custom";
|
|
172
|
+
}
|
|
173
|
+
export type OpenAiCompletionToolCall = OpenAiCompletionFunctionToolCall | OpenAiCompletionCustomToolCall;
|
|
102
174
|
export interface OpenAiCompletion {
|
|
103
175
|
id: string;
|
|
104
176
|
object: "chat.completion";
|
|
@@ -108,9 +180,11 @@ export interface OpenAiCompletion {
|
|
|
108
180
|
index: 0;
|
|
109
181
|
message: {
|
|
110
182
|
role: "assistant";
|
|
111
|
-
content: string;
|
|
183
|
+
content: string | null;
|
|
184
|
+
reasoning_content?: string;
|
|
185
|
+
tool_calls?: OpenAiCompletionToolCall[];
|
|
112
186
|
};
|
|
113
|
-
finish_reason: "stop" | "length";
|
|
187
|
+
finish_reason: "stop" | "length" | "tool_calls";
|
|
114
188
|
}>;
|
|
115
189
|
usage: {
|
|
116
190
|
prompt_tokens: number;
|
|
@@ -142,29 +216,81 @@ export declare function extractOpenAiContent(content: string | OpenAiContentPart
|
|
|
142
216
|
export declare function translateOpenAiToAnthropic(body: OpenAiChatRequest): AnthropicRequestBody | null;
|
|
143
217
|
/**
|
|
144
218
|
* Translate a complete Anthropic /v1/messages response to OpenAI format.
|
|
145
|
-
*
|
|
219
|
+
* Currently supports only text, thinking and function call blocks.
|
|
220
|
+
*
|
|
221
|
+
* When `thinkingPassthrough` is false, thinking blocks are not
|
|
222
|
+
* mapped to `reasoning_content` (stripped from the response).
|
|
146
223
|
*/
|
|
147
|
-
export declare function translateAnthropicToOpenAi(response: AnthropicResponse, completionId: string, model: string, created: number
|
|
148
|
-
|
|
224
|
+
export declare function translateAnthropicToOpenAi(response: AnthropicResponse, completionId: string, model: string, created: number, options?: {
|
|
225
|
+
thinkingPassthrough?: boolean;
|
|
226
|
+
}): OpenAiCompletion;
|
|
227
|
+
/**
|
|
228
|
+
* Wire-format SSE event from Anthropic's `/v1/messages` streaming API.
|
|
229
|
+
*
|
|
230
|
+
* `content_block` may describe a text block, a tool_use block, or a thinking
|
|
231
|
+
* block depending on the stream position — only `type` is guaranteed.
|
|
232
|
+
*/
|
|
233
|
+
export interface AnthropicSseEvent {
|
|
149
234
|
type: string;
|
|
235
|
+
index?: number;
|
|
150
236
|
delta?: {
|
|
151
237
|
type?: string;
|
|
152
238
|
text?: string;
|
|
153
239
|
stop_reason?: string;
|
|
240
|
+
partial_json?: string;
|
|
241
|
+
thinking?: string;
|
|
154
242
|
};
|
|
243
|
+
content_block?: {
|
|
244
|
+
type: "text";
|
|
245
|
+
text?: string;
|
|
246
|
+
} | {
|
|
247
|
+
type: "thinking";
|
|
248
|
+
thinking?: string;
|
|
249
|
+
} | AnthropicToolUseBlock;
|
|
155
250
|
message?: {
|
|
156
251
|
id?: string;
|
|
157
252
|
};
|
|
158
253
|
}
|
|
254
|
+
export interface SseTranslator {
|
|
255
|
+
(event: AnthropicSseEvent): OpenAiStreamChunk | null;
|
|
256
|
+
}
|
|
257
|
+
export interface SseTranslatorContext {
|
|
258
|
+
completionId: string;
|
|
259
|
+
model: string;
|
|
260
|
+
created: number;
|
|
261
|
+
/** When false, thinking blocks are stripped from the response */
|
|
262
|
+
thinkingPassthrough?: boolean;
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* A stateful translator for one OpenAI streaming response.
|
|
266
|
+
*
|
|
267
|
+
* Each completion stream gets its own translator instance to keep state out
|
|
268
|
+
* of server.ts. Internally tracks the current tool-call index so that
|
|
269
|
+
* `content_block_start` (tool_use) events are emitted as OpenAI tool_call
|
|
270
|
+
* deltas with monotonically increasing `index` values, matching how
|
|
271
|
+
* `function.arguments` fragments must correlate back to their parent call.
|
|
272
|
+
*
|
|
273
|
+
* Anthropic's wire format signals start/end of each content block; OpenAI's
|
|
274
|
+
* does not, so we manufacture an index per stream.
|
|
275
|
+
*/
|
|
276
|
+
export declare function createSseTranslator(ctx: SseTranslatorContext): SseTranslator;
|
|
159
277
|
/**
|
|
160
278
|
* Translate one parsed Anthropic SSE event into an OpenAI stream chunk.
|
|
161
|
-
* Returns null for events that should be skipped (pings,
|
|
279
|
+
* Returns null for events that should be skipped (pings, message_stop,
|
|
280
|
+
* content_block_stop, text-block content_block_start, etc).
|
|
281
|
+
*
|
|
282
|
+
* `toolCallNum` is the OpenAI `tool_calls[].index` value to emit on tool-call
|
|
283
|
+
* chunks. Callers tracking multiple tools per stream must increment it on
|
|
284
|
+
* each `content_block_start` with `type: "tool_use"` *before* calling this
|
|
285
|
+
* function. Use `createSseTranslator` to handle this automatically.
|
|
286
|
+
*
|
|
287
|
+
* When `thinkingPassthrough` is false, thinking_delta events are skipped
|
|
288
|
+
* so the client does not receive reasoning_content.
|
|
162
289
|
*/
|
|
163
|
-
export declare function translateAnthropicSseEvent(event: AnthropicSseEvent, completionId: string, model: string, created: number): OpenAiStreamChunk | null;
|
|
290
|
+
export declare function translateAnthropicSseEvent(event: AnthropicSseEvent, completionId: string, model: string, created: number, toolCallNum: number, thinkingPassthrough?: boolean): OpenAiStreamChunk | null;
|
|
164
291
|
/**
|
|
165
292
|
* Return the static list of available Claude models in OpenAI format.
|
|
166
293
|
* Context windows reflect subscription capabilities.
|
|
167
294
|
*/
|
|
168
295
|
export declare function buildModelList(isMaxSubscription: boolean, now?: number): OpenAiModel[];
|
|
169
|
-
export {};
|
|
170
296
|
//# sourceMappingURL=openai.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openai.d.ts","sourceRoot":"","sources":["../../src/proxy/openai.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"openai.d.ts","sourceRoot":"","sources":["../../src/proxy/openai.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,CAAA;AAEjE,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,WAAW,CAAA;IACjB,SAAS,CAAC,EAAE;QACV,GAAG,CAAC,EAAE,MAAM,CAAA;KACb,CAAA;CACF;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;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CA2H1B;AAMD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,iBAAiB,EAAE,OAAO,EAAE,GAAG,SAAgC,GAAG,WAAW,EAAE,CAmC7G"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/proxy/query.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/proxy/query.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAW,aAAa,EAAE,MAAM,gCAAgC,CAAA;AAErF,OAAO,EAAE,0BAA0B,EAAwB,MAAM,oBAAoB,CAAA;AAerF,MAAM,WAAW,YAAY;IAC3B,iEAAiE;IACjE,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC,GAAG,CAAC,CAAA;IACnC,iCAAiC;IACjC,KAAK,EAAE,MAAM,CAAA;IACb,uEAAuE;IACvE,gBAAgB,EAAE,MAAM,CAAA;IACxB;;;;;OAKG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,yCAAyC;IACzC,aAAa,EAAE,MAAM,CAAA;IACrB,gCAAgC;IAChC,gBAAgB,EAAE,MAAM,CAAA;IACxB,0CAA0C;IAC1C,WAAW,EAAE,OAAO,CAAA;IACpB,0CAA0C;IAC1C,MAAM,EAAE,OAAO,CAAA;IACf,6DAA6D;IAC7D,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC9B,mEAAmE;IACnE,cAAc,CAAC,EAAE,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAA;IAC9D,wDAAwD;IACxD,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;IAC5C,yDAAyD;IACzD,gBAAgB,EAAE,OAAO,CAAA;IACzB,0DAA0D;IAC1D,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,wCA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OAAO,GAAG,OAAO,CAAC,eAAe,CAAC,CAgC5E;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,IAAI,CAInG;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAI9D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/proxy/server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/proxy/server.ts"],"names":[],"mappings":"AAYA,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;AAgCnG,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,oBAAoB,EAEpB,KAAK,aAAa,EAGnB,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EAA+B,iBAAiB,EAAE,mBAAmB,EAAsC,MAAM,iBAAiB,CAAA;AAGzI,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAA;AAChE,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,CAAA;AACjD,YAAY,EAAE,aAAa,EAAE,CAAA;AA+N7B,wBAAgB,iBAAiB,CAAC,MAAM,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,WAAW,CA2gFhF;AAED,wBAAsB,gBAAgB,CAAC,MAAM,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAoEhG"}
|
|
@@ -13,6 +13,18 @@
|
|
|
13
13
|
* already in flight, subsequent callers wait for the same promise rather than
|
|
14
14
|
* issuing a second network request and racing on the write.
|
|
15
15
|
*/
|
|
16
|
+
/**
|
|
17
|
+
* Map a `claudeConfigDir` to the keychain service name claude-code uses
|
|
18
|
+
* for that directory.
|
|
19
|
+
*
|
|
20
|
+
* Default `~/.claude` uses the bare service name `Claude Code-credentials`.
|
|
21
|
+
* Any other directory uses `Claude Code-credentials-<sha256(absPath).slice(0,8)>` —
|
|
22
|
+
* matching claude-code's own convention so we can read OAuth tokens for
|
|
23
|
+
* additional Meridian profiles without prompting the user.
|
|
24
|
+
*/
|
|
25
|
+
export declare function configDirToKeychainService(claudeConfigDir: string): string;
|
|
26
|
+
/** Map `claudeConfigDir` to the file-based credentials path. */
|
|
27
|
+
export declare function configDirToCredentialsFile(claudeConfigDir: string): string;
|
|
16
28
|
interface OAuthCredentials {
|
|
17
29
|
accessToken: string;
|
|
18
30
|
refreshToken: string;
|
|
@@ -29,10 +41,30 @@ export interface CredentialStore {
|
|
|
29
41
|
read(): Promise<CredentialsFile | null>;
|
|
30
42
|
write(credentials: CredentialsFile): Promise<boolean>;
|
|
31
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Serialize a credentials object to the on-disk / Keychain format Claude Code
|
|
46
|
+
* expects.
|
|
47
|
+
*
|
|
48
|
+
* MUST be compact (no whitespace) — Claude Code's credential parser cannot
|
|
49
|
+
* read pretty-printed JSON and treats the user as logged out when it
|
|
50
|
+
* encounters one. See issue #452.
|
|
51
|
+
*
|
|
52
|
+
* Exported so the regression test can pin the output format directly.
|
|
53
|
+
*/
|
|
54
|
+
export declare function serializeCredentials(credentials: CredentialsFile): string;
|
|
32
55
|
/**
|
|
33
56
|
* Returns the appropriate credential store for the current platform.
|
|
57
|
+
*
|
|
58
|
+
* If `claudeConfigDir` is provided, returns a profile-specific store that
|
|
59
|
+
* reads from the matching keychain entry (macOS) or `<dir>/.credentials.json`
|
|
60
|
+
* (Linux). Default behaviour (no opts) is unchanged — reads from the
|
|
61
|
+
* standard `~/.claude` location.
|
|
34
62
|
*/
|
|
35
|
-
export declare function createPlatformCredentialStore(
|
|
63
|
+
export declare function createPlatformCredentialStore(opts?: {
|
|
64
|
+
claudeConfigDir?: string;
|
|
65
|
+
}): CredentialStore;
|
|
66
|
+
/** Look up the appropriate file path for a profile (Linux convention even on macOS for inspection). */
|
|
67
|
+
export declare function credentialsFilePathForProfile(claudeConfigDir?: string): string;
|
|
36
68
|
/**
|
|
37
69
|
* Refresh the Claude Code OAuth access token.
|
|
38
70
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokenRefresh.d.ts","sourceRoot":"","sources":["../../src/proxy/tokenRefresh.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"tokenRefresh.d.ts","sourceRoot":"","sources":["../../src/proxy/tokenRefresh.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAkBH;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAK1E;AAED,gEAAgE;AAChE,wBAAgB,0BAA0B,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAE1E;AAED,UAAU,gBAAgB;IACxB,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,UAAU,eAAe;IACvB,aAAa,EAAE,gBAAgB,CAAA;IAC/B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAMD,MAAM,WAAW,eAAe;IAC9B,IAAI,IAAI,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAAA;IACvC,KAAK,CAAC,WAAW,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;CACtD;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,eAAe,GAAG,MAAM,CAEzE;AAuGD;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,CAAC,EAAE;IAAE,eAAe,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,eAAe,CAQlG;AAED,uGAAuG;AACvG,wBAAgB,6BAA6B,CAAC,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAE9E;AASD;;;;;;;;;;GAUG;AACH,wBAAsB,iBAAiB,CAAC,KAAK,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,CAQjF;AAiED,gDAAgD;AAChD,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/proxy/tools.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,eAAO,MAAM,qBAAqB,UAIjC,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/proxy/tools.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,eAAO,MAAM,qBAAqB,UAIjC,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,UAuBlC,CAAA;AAED,gDAAgD;AAChD,eAAO,MAAM,eAAe,aAAa,CAAA;AAEzC,iEAAiE;AACjE,eAAO,MAAM,iBAAiB,UAO7B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"droid.d.ts","sourceRoot":"","sources":["../../../src/proxy/transforms/droid.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"droid.d.ts","sourceRoot":"","sources":["../../../src/proxy/transforms/droid.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,cAAc,CAAA;AA6B7D,eAAO,MAAM,eAAe,EAAE,SAAS,EAgBtC,CAAA"}
|
package/dist/server.js
CHANGED
|
@@ -10,13 +10,13 @@ import {
|
|
|
10
10
|
runObserveHook,
|
|
11
11
|
runTransformHook,
|
|
12
12
|
startProxyServer
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-51a9sav0.js";
|
|
14
14
|
import"./cli-vdp9s10c.js";
|
|
15
15
|
import"./cli-sry5aqdj.js";
|
|
16
16
|
import"./cli-4rqtm83g.js";
|
|
17
17
|
import"./cli-340h1chz.js";
|
|
18
18
|
import"./cli-rtab0qa6.js";
|
|
19
|
-
import"./cli-
|
|
19
|
+
import"./cli-e289rj3k.js";
|
|
20
20
|
import"./cli-p9swy5t3.js";
|
|
21
21
|
export {
|
|
22
22
|
startProxyServer,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profilePage.d.ts","sourceRoot":"","sources":["../../src/telemetry/profilePage.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"profilePage.d.ts","sourceRoot":"","sources":["../../src/telemetry/profilePage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,eAAO,MAAM,eAAe,QAqbpB,CAAA"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure helpers for rendering OAuth usage data on the profile page.
|
|
3
|
+
*
|
|
4
|
+
* Lives outside the inline-HTML template in profilePage.ts so the labeling
|
|
5
|
+
* and formatting logic can be unit-tested. The same logic is mirrored in
|
|
6
|
+
* the page's inline browser script — see profilePage.ts.
|
|
7
|
+
*
|
|
8
|
+
* Why duplicate at all? profilePage.ts is one big template literal that
|
|
9
|
+
* runs in the browser, so we can't directly import these at runtime. We
|
|
10
|
+
* inline the constants (via JSON.stringify) and re-implement the small
|
|
11
|
+
* format functions in the template, with these TS versions guarding the
|
|
12
|
+
* behavior via tests.
|
|
13
|
+
*/
|
|
14
|
+
/** Friendly labels for Anthropic's raw window keys. */
|
|
15
|
+
export declare const WINDOW_LABELS: Record<string, string>;
|
|
16
|
+
/**
|
|
17
|
+
* Map a raw window type (e.g. "five_hour", "seven_day_opus") to a short
|
|
18
|
+
* human label. Falls back to a prettified version of the key for any
|
|
19
|
+
* type we haven't named (Anthropic adds new windows occasionally).
|
|
20
|
+
*/
|
|
21
|
+
export declare function labelForWindow(type: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* Bucket a 0..1 utilization value into a status used for color coding.
|
|
24
|
+
* Mirrors pylon's three-tier scheme: comfortable / warning / hot.
|
|
25
|
+
*/
|
|
26
|
+
export type UsageStatus = "ok" | "warn" | "high";
|
|
27
|
+
export declare function classifyUtilization(utilization: number | null | undefined): UsageStatus;
|
|
28
|
+
/**
|
|
29
|
+
* Format the time-until-reset for a window.
|
|
30
|
+
*
|
|
31
|
+
* `resetsAt` is a Unix epoch in milliseconds (matching Meridian's own
|
|
32
|
+
* /v1/usage/quota response shape) — null when the window has no known
|
|
33
|
+
* reset time.
|
|
34
|
+
*
|
|
35
|
+
* `now` is injectable so tests don't depend on Date.now(); production
|
|
36
|
+
* callers omit it and the function uses the current time.
|
|
37
|
+
*/
|
|
38
|
+
export declare function formatResetCountdown(resetsAt: number | null | undefined, now?: number): string;
|
|
39
|
+
/**
|
|
40
|
+
* Format an extra-usage block. Returns null when the profile has no
|
|
41
|
+
* extra-usage info worth showing (disabled or missing data) — caller
|
|
42
|
+
* should hide the section entirely in that case.
|
|
43
|
+
*/
|
|
44
|
+
export interface ExtraUsageDisplay {
|
|
45
|
+
used: string;
|
|
46
|
+
limit: string;
|
|
47
|
+
utilizationPct: number;
|
|
48
|
+
status: UsageStatus;
|
|
49
|
+
}
|
|
50
|
+
export declare function formatExtraUsage(eu: {
|
|
51
|
+
isEnabled: boolean;
|
|
52
|
+
monthlyLimit: number;
|
|
53
|
+
usedCredits: number;
|
|
54
|
+
utilization: number | null;
|
|
55
|
+
currency: string;
|
|
56
|
+
} | null | undefined): ExtraUsageDisplay | null;
|
|
57
|
+
//# sourceMappingURL=profileUsage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profileUsage.d.ts","sourceRoot":"","sources":["../../src/telemetry/profileUsage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,uDAAuD;AACvD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAQhD,CAAA;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOnD;AAED;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,CAAA;AAChD,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,WAAW,CAKvF;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,GAAG,GAAE,MAAmB,GAAG,MAAM,CAY1G;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,cAAc,EAAE,MAAM,CAAA;IACtB,MAAM,EAAE,WAAW,CAAA;CACpB;AACD,wBAAgB,gBAAgB,CAAC,EAAE,EAAE;IACnC,SAAS,EAAE,OAAO,CAAA;IAClB,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,QAAQ,EAAE,MAAM,CAAA;CACjB,GAAG,IAAI,GAAG,SAAS,GAAG,iBAAiB,GAAG,IAAI,CAiB9C"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
configDirToCredentialsFile,
|
|
3
|
+
configDirToKeychainService,
|
|
4
|
+
createPlatformCredentialStore,
|
|
5
|
+
credentialsFilePathForProfile,
|
|
6
|
+
refreshOAuthToken,
|
|
7
|
+
resetInflightRefresh,
|
|
8
|
+
serializeCredentials
|
|
9
|
+
} from "./cli-e289rj3k.js";
|
|
10
|
+
import"./cli-p9swy5t3.js";
|
|
11
|
+
export {
|
|
12
|
+
serializeCredentials,
|
|
13
|
+
resetInflightRefresh,
|
|
14
|
+
refreshOAuthToken,
|
|
15
|
+
credentialsFilePathForProfile,
|
|
16
|
+
createPlatformCredentialStore,
|
|
17
|
+
configDirToKeychainService,
|
|
18
|
+
configDirToCredentialsFile
|
|
19
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rynfar/meridian",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.41.1",
|
|
4
4
|
"description": "Local Anthropic API powered by your Claude Max subscription. One subscription, every agent.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/server.js",
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
"start": "./bin/claude-proxy-supervisor.sh",
|
|
23
23
|
"proxy": "./bin/claude-proxy-supervisor.sh",
|
|
24
24
|
"build": "rm -rf dist && bun build bin/cli.ts src/proxy/server.ts --outdir dist --target node --splitting --external @anthropic-ai/claude-agent-sdk --entry-naming '[name].js' && tsc -p tsconfig.build.json",
|
|
25
|
-
"postbuild": "node --check dist/cli.js && node --check dist/server.js && test -f dist/proxy/server.d.ts",
|
|
25
|
+
"postbuild": "node scripts/fix-bun-exports.mjs && node --check dist/cli.js && node --check dist/server.js && test -f dist/proxy/server.d.ts",
|
|
26
26
|
"postinstall": "node ./node_modules/@anthropic-ai/claude-code/install.cjs 2>/dev/null || true",
|
|
27
27
|
"prepublishOnly": "bun run build",
|
|
28
|
-
"test": "bun test --path-ignore-patterns '**/*session-store*' --path-ignore-patterns '**/*proxy-async-ops*' --path-ignore-patterns '**/*proxy-extra-usage-fallback*' --path-ignore-patterns '**/*models-auth-status*' --path-ignore-patterns '**/*proxy-context-usage-store*' --path-ignore-patterns '**/*proxy-passthrough-thinking*' --path-ignore-patterns '**/*profile-switch-integration*' --path-ignore-patterns '**/*session-recovery*' --path-ignore-patterns '**/*models.test*' --path-ignore-patterns '**/*proxy-health-degraded*' --path-ignore-patterns '**/*proxy-subagent-model-selection*' && bun test src/__tests__/profile-switch-integration.test.ts && bun test src/__tests__/proxy-extra-usage-fallback.test.ts && bun test src/__tests__/proxy-async-ops.test.ts && bun test src/__tests__/proxy-session-store.test.ts && bun test src/__tests__/session-store-pruning.test.ts && bun test src/__tests__/proxy-session-store-locking.test.ts && bun test src/__tests__/proxy-context-usage-store.test.ts && bun test src/__tests__/models-auth-status.test.ts && bun test src/__tests__/proxy-passthrough-thinking.test.ts && bun test src/__tests__/proxy-session-recovery.test.ts && bun test src/__tests__/models.test.ts && bun test src/__tests__/proxy-health-degraded.test.ts && bun test src/__tests__/proxy-subagent-model-selection.test.ts",
|
|
28
|
+
"test": "bun test --path-ignore-patterns '**/*session-store*' --path-ignore-patterns '**/*proxy-async-ops*' --path-ignore-patterns '**/*proxy-extra-usage-fallback*' --path-ignore-patterns '**/*models-auth-status*' --path-ignore-patterns '**/*proxy-context-usage-store*' --path-ignore-patterns '**/*proxy-passthrough-thinking*' --path-ignore-patterns '**/*profile-switch-integration*' --path-ignore-patterns '**/*session-recovery*' --path-ignore-patterns '**/*models.test*' --path-ignore-patterns '**/*proxy-health-degraded*' --path-ignore-patterns '**/*proxy-subagent-model-selection*' --path-ignore-patterns '**/*oauth-usage*' && bun test src/__tests__/profile-switch-integration.test.ts && bun test src/__tests__/proxy-extra-usage-fallback.test.ts && bun test src/__tests__/proxy-async-ops.test.ts && bun test src/__tests__/proxy-session-store.test.ts && bun test src/__tests__/session-store-pruning.test.ts && bun test src/__tests__/proxy-session-store-locking.test.ts && bun test src/__tests__/proxy-context-usage-store.test.ts && bun test src/__tests__/models-auth-status.test.ts && bun test src/__tests__/proxy-passthrough-thinking.test.ts && bun test src/__tests__/proxy-session-recovery.test.ts && bun test src/__tests__/models.test.ts && bun test src/__tests__/proxy-health-degraded.test.ts && bun test src/__tests__/proxy-subagent-model-selection.test.ts && bun test src/__tests__/oauth-usage.test.ts",
|
|
29
29
|
"nix:lock": "bun2nix -o bun.nix",
|
|
30
30
|
"typecheck": "tsc --noEmit",
|
|
31
31
|
"proxy:direct": "bun run ./bin/cli.ts"
|