@eddyskywalker/dsh-chatgpt-subscription 0.10.15 → 0.10.20
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/CHANGELOG.md +36 -1
- package/README.md +8 -4
- package/lib/client.js +641 -121
- package/lib/client.js.map +1 -1
- package/lib/index.js +2029 -299
- package/lib/types/client/ProviderHubSection.d.ts.map +1 -1
- package/lib/types/client/command-code/CommandCodeSection.d.ts.map +1 -1
- package/lib/types/client/index.d.ts +1 -0
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/locales.d.ts +4 -4
- package/lib/types/client/ollama/OllamaSection.d.ts +25 -0
- package/lib/types/client/ollama/OllamaSection.d.ts.map +1 -0
- package/lib/types/client/ollama/api.d.ts +36 -0
- package/lib/types/client/ollama/api.d.ts.map +1 -0
- package/lib/types/client/ollama/locales.d.ts +413 -0
- package/lib/types/client/ollama/locales.d.ts.map +1 -0
- package/lib/types/host/antigravity/adapter.d.ts.map +1 -1
- package/lib/types/host/claude/adapter.d.ts +3 -5
- package/lib/types/host/claude/adapter.d.ts.map +1 -1
- package/lib/types/host/claude/model-catalog.d.ts +30 -16
- package/lib/types/host/claude/model-catalog.d.ts.map +1 -1
- package/lib/types/host/command-code/adapter.d.ts.map +1 -1
- package/lib/types/host/command-code/mapper.d.ts.map +1 -1
- package/lib/types/host/command-code/model-catalog.d.ts +19 -2
- package/lib/types/host/command-code/model-catalog.d.ts.map +1 -1
- package/lib/types/host/command-code/types.d.ts +29 -1
- package/lib/types/host/command-code/types.d.ts.map +1 -1
- package/lib/types/host/common/output-reservation.d.ts +11 -0
- package/lib/types/host/common/output-reservation.d.ts.map +1 -0
- package/lib/types/host/kimi-code/adapter.d.ts.map +1 -1
- package/lib/types/host/kimi-code/model-catalog.d.ts +1 -1
- package/lib/types/host/kimi-code/model-catalog.d.ts.map +1 -1
- package/lib/types/host/minimax-code/adapter.d.ts +2 -3
- package/lib/types/host/minimax-code/adapter.d.ts.map +1 -1
- package/lib/types/host/model-catalog.d.ts.map +1 -1
- package/lib/types/host/ollama/account-pool.d.ts +65 -0
- package/lib/types/host/ollama/account-pool.d.ts.map +1 -0
- package/lib/types/host/ollama/adapter.d.ts +47 -0
- package/lib/types/host/ollama/adapter.d.ts.map +1 -0
- package/lib/types/host/ollama/client.d.ts +101 -0
- package/lib/types/host/ollama/client.d.ts.map +1 -0
- package/lib/types/host/ollama/mapper.d.ts +44 -0
- package/lib/types/host/ollama/mapper.d.ts.map +1 -0
- package/lib/types/host/ollama/routes.d.ts +22 -0
- package/lib/types/host/ollama/routes.d.ts.map +1 -0
- package/lib/types/host/ollama/token-store.d.ts +73 -0
- package/lib/types/host/ollama/token-store.d.ts.map +1 -0
- package/lib/types/host/ollama/types.d.ts +115 -0
- package/lib/types/host/ollama/types.d.ts.map +1 -0
- package/lib/types/host/responses-mapper.d.ts +0 -2
- package/lib/types/host/responses-mapper.d.ts.map +1 -1
- package/lib/types/host/search-provider-switcher.d.ts +12 -0
- package/lib/types/host/search-provider-switcher.d.ts.map +1 -1
- package/lib/types/host/workbuddy/adapter.d.ts.map +1 -1
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/shared/command-code-contracts.d.ts +10 -4
- package/lib/types/shared/command-code-contracts.d.ts.map +1 -1
- package/lib/types/shared/model-catalog.d.ts +58 -1
- package/lib/types/shared/model-catalog.d.ts.map +1 -1
- package/lib/types/shared/ollama-contracts.d.ts +36 -0
- package/lib/types/shared/ollama-contracts.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -176,17 +176,29 @@
|
|
|
176
176
|
* LOCAL ADDITIONS — the rows the reference snapshot predates
|
|
177
177
|
* ---------------------------------------------------------------------------
|
|
178
178
|
*
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
* row
|
|
189
|
-
*
|
|
179
|
+
* TWO KINDS OF ROW ARE NOT FULLY TRANSCRIBED, and they are different things.
|
|
180
|
+
* Do not collapse them.
|
|
181
|
+
*
|
|
182
|
+
* 1. `claude-sonnet-5-5` — the snapshot this table was copied from has no
|
|
183
|
+
* entry for it, so the whole row is CURATED: every value below comes from
|
|
184
|
+
* the vendor's own documentation and no snapshot field can check it. The
|
|
185
|
+
* mirror list in the test is `LOCALLY_CURATED_MODEL_IDS`.
|
|
186
|
+
*
|
|
187
|
+
* 2. `claude-opus-5-5` — a NEWER snapshot (pi-ai >= 0.87.1) does carry it, so
|
|
188
|
+
* the row sits in the snapshot's own position and EVERY field is checked
|
|
189
|
+
* against that snapshot. Exactly one field is not: `thinkingMode`, recorded
|
|
190
|
+
* in the test as `SNAPSHOT_AGREES_BUT_CURATED_WINS`. The snapshot would
|
|
191
|
+
* classify it 'mid-convo', whose form forces `output_config.effort = 'high'`
|
|
192
|
+
* when the caller names none, while the vendor documents this model's
|
|
193
|
+
* default effort as MEDIUM. Transcribing it would silently outrank the user
|
|
194
|
+
* and think — and bill — harder than asked, so the documented 'adaptive'
|
|
195
|
+
* stands. The test asserts the row still disagrees with the snapshot, so a
|
|
196
|
+
* future snapshot that agrees fails loudly and retires the entry.
|
|
197
|
+
*
|
|
198
|
+
* Both must be changed together with the mirror list in the test. An invented
|
|
199
|
+
* row that mimics the format of a checked one is worse than a missing row: it
|
|
200
|
+
* is unverifiable and it looks verified. So each row is marked at the row
|
|
201
|
+
* itself, the test asserts the id is on the curated list, and the test
|
|
190
202
|
* asserts the curated list is exactly the ids the snapshot lacks — which keeps
|
|
191
203
|
* the lock narrow instead of merely weaker.
|
|
192
204
|
*
|
|
@@ -211,10 +223,12 @@
|
|
|
211
223
|
* 2. `thinkingMode: 'adaptive'`, NOT `'mid-convo'`. The two are easy to confuse
|
|
212
224
|
* here because every model in this line that refuses a temperature is also,
|
|
213
225
|
* so far, a managed-effort model. That is a coincidence of `compat`, not a
|
|
214
|
-
* rule
|
|
226
|
+
* rule. A newer snapshot DOES flag this row `supportsMidConvoEffort` and
|
|
227
|
+
* would therefore classify it 'mid-convo' — which is exactly why this is the
|
|
228
|
+
* one declared exception rather than a transcription: 'mid-convo'
|
|
215
229
|
* additionally forces `output_config = { effort: 'high' }` when the caller
|
|
216
|
-
* names no effort. That forced high is correct for the rows
|
|
217
|
-
*
|
|
230
|
+
* names no effort. That forced high is correct for the rows whose documented
|
|
231
|
+
* default effort is high, and wrong for this one; this model's
|
|
218
232
|
* documented default effort is `medium`. Labelling it 'mid-convo' would
|
|
219
233
|
* silently override the vendor's own default and make every request think —
|
|
220
234
|
* and cost — harder than the user asked for.
|
|
@@ -307,8 +321,8 @@ export interface ClaudeModelEntry {
|
|
|
307
321
|
bindsThinkingToPrefix?: boolean;
|
|
308
322
|
}
|
|
309
323
|
/**
|
|
310
|
-
* Sixteen rows: the snapshot's own
|
|
311
|
-
* followed by the
|
|
324
|
+
* Sixteen rows: the snapshot's own 15, in the snapshot's own declaration order,
|
|
325
|
+
* followed by the one row the snapshot still predates (see LOCAL ADDITIONS above).
|
|
312
326
|
*
|
|
313
327
|
* The order matters and is not cosmetic. The test asserts the snapshot's ids
|
|
314
328
|
* appear in the table as a SUBSEQUENCE, so a curated row may be appended or
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-catalog.d.ts","sourceRoot":"","sources":["../../../../src/host/claude/model-catalog.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"model-catalog.d.ts","sourceRoot":"","sources":["../../../../src/host/claude/model-catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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qDAAqD;AACrD,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,sBAAsB,GAAG,WAAW,EAAE,CAgKrG;AAmBD,uEAAuE;AACvE,wBAAgB,WAAW,CAAC,KAAK,EAAE,sBAAsB,GAAG,WAAW,EAAE,CAOxE;AAED,kEAAkE;AAClE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,sBAAsB,GAAG,IAAI,CAIxE"}
|
|
@@ -1,16 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Command Code model capability table.
|
|
3
3
|
*
|
|
4
|
-
* Transcribed from the official CLI's own model registry
|
|
5
|
-
* `createModelRegistry` over
|
|
4
|
+
* Transcribed from the official CLI's own model registry — the table it builds
|
|
5
|
+
* `createModelRegistry` over — which is the only authoritative source for which
|
|
6
6
|
* models accept image input and which reasoning levels each one exposes: the
|
|
7
7
|
* public `/provider/v1/models` listing carries an id, a display name, and a
|
|
8
8
|
* context length, but says nothing about modalities or reasoning.
|
|
9
9
|
*
|
|
10
|
+
* Transcribing means the whole table, not the entries someone happened to use.
|
|
11
|
+
* An id the table omits is not treated as merely unknown by the adapter: it
|
|
12
|
+
* falls back to text-only with NO reasoning ladder, so a real model missing
|
|
13
|
+
* from here silently loses its image input and its effort selector. That is how
|
|
14
|
+
* `deepseek/deepseek-v4.1-flash-fast` shipped with no thinking control while
|
|
15
|
+
* the live catalog had been serving it, and how `gpt-6-sol`, `gpt-6-luna`,
|
|
16
|
+
* `gpt-6.1-sol`, `claude-sonnet-5-5`, `claude-opus-5-5`, `xai/grok-4.7`,
|
|
17
|
+
* `z-ai/glm-5.3-flashx` and others went missing at once.
|
|
18
|
+
*
|
|
10
19
|
* Family heuristics are not a substitute. Within one vendor the split is not
|
|
11
20
|
* derivable from the id: `deepseek/deepseek-v4-flash` is text-only while
|
|
12
21
|
* `deepseek/deepseek-v4.1-flash` and `deepseek/deepseek-v4-flash-vision-exp` take
|
|
13
22
|
* images, and `z-ai/glm-5.3-flash` takes images while `zai-org/GLM-5.3` does not.
|
|
23
|
+
*
|
|
24
|
+
* The registry's `off` level is NOT carried through verbatim. Command Code
|
|
25
|
+
* spells "do not think" as an effort named `off`; DSH spells the same thing as
|
|
26
|
+
* `none`. The translation happens in {@link reasoningEffortsFor}, so the table
|
|
27
|
+
* below stays a faithful transcription of the source and keeps `off` where the
|
|
28
|
+
* registry puts it. Sending the literal `off` would be wrong in the other
|
|
29
|
+
* direction too: the OpenAI-family wire has no such level, so it is dropped
|
|
30
|
+
* rather than transmitted (see the request builders in `./mapper.ts`).
|
|
14
31
|
*/
|
|
15
32
|
export interface CommandCodeModelDef {
|
|
16
33
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-catalog.d.ts","sourceRoot":"","sources":["../../../../src/host/command-code/model-catalog.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"model-catalog.d.ts","sourceRoot":"","sources":["../../../../src/host/command-code/model-catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,0EAA0E;IAC1E,eAAe,EAAE,KAAK,CAAC,MAAM,GAAG,OAAO,CAAC,CAAA;IACxC,sEAAsE;IACtE,gBAAgB,EAAE,MAAM,EAAE,CAAA;IAC1B,kEAAkE;IAClE,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,8DAA8D;IAC9D,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB;AAED,0EAA0E;AAC1E,eAAO,MAAM,mBAAmB,EAAE,SAAS,mBAAmB,EAyqB7D,CAAA;AAED,qFAAqF;AACrF,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS,CAEpF"}
|
|
@@ -90,7 +90,7 @@ export declare function providerUrl(env?: CommandCodeApiEnv): string;
|
|
|
90
90
|
*/
|
|
91
91
|
export declare function wireForModel(modelId: string): CommandCodeWire;
|
|
92
92
|
/**
|
|
93
|
-
* Reasoning levels one model advertises.
|
|
93
|
+
* Reasoning levels one model advertises, in DSH's vocabulary.
|
|
94
94
|
*
|
|
95
95
|
* The registry is the authority: a model it describes but gives no
|
|
96
96
|
* `reasoningEfforts` is a non-reasoning model, which is why that answers with an
|
|
@@ -98,8 +98,36 @@ export declare function wireForModel(modelId: string): CommandCodeWire;
|
|
|
98
98
|
* describe declares nothing either — guessing from the family name is exactly
|
|
99
99
|
* how `deepseek-v4-flash` got treated as a reasoner with image input when it is
|
|
100
100
|
* text-only with a different effort set.
|
|
101
|
+
*
|
|
102
|
+
* One level is translated rather than copied. Command Code names the
|
|
103
|
+
* "do not think" level `off`; DSH names the same level `none` (as the Kimi and
|
|
104
|
+
* Anthropic lines here already do). Both spellings are accepted on the way in —
|
|
105
|
+
* a stored selection or a session started elsewhere may carry either — but the
|
|
106
|
+
* adapter only ever advertises `none`, so the picker shows the level DSH
|
|
107
|
+
* understands.
|
|
108
|
+
*
|
|
109
|
+
* `off` is also what the CLI's `thinkingHook` keys on to send no reasoning
|
|
110
|
+
* field at all, and the OpenAI-family wire has no such level, so
|
|
111
|
+
* {@link wireReasoningEffort} drops it before the request is built rather than
|
|
112
|
+
* transmitting a value the endpoint would reject.
|
|
101
113
|
*/
|
|
102
114
|
export declare function reasoningEffortsFor(modelId: string): string[];
|
|
115
|
+
/**
|
|
116
|
+
* The level that means "think as little as possible" on this route.
|
|
117
|
+
*
|
|
118
|
+
* DSH's spelling, matching the Kimi and Claude lines. Kept as a constant
|
|
119
|
+
* because three separate places compare against it — the catalog translation,
|
|
120
|
+
* the wire filter below, and the Anthropic thinking budget.
|
|
121
|
+
*/
|
|
122
|
+
export declare const DISABLED_THINKING_EFFORT = "none";
|
|
123
|
+
/**
|
|
124
|
+
* Whether one effort survives onto the provider wire.
|
|
125
|
+
*
|
|
126
|
+
* `none` is a real DSH level but not a Command Code one: it is expressed by
|
|
127
|
+
* OMITTING the field, which is exactly what the official CLI does when its
|
|
128
|
+
* effort is `off`. Every other level this route advertises passes through.
|
|
129
|
+
*/
|
|
130
|
+
export declare function wireReasoningEffort(effort: string | undefined | null): string | undefined;
|
|
103
131
|
/**
|
|
104
132
|
* Accepted request modalities for one model.
|
|
105
133
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/host/command-code/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAA;AAGhG,eAAO,MAAM,WAAW,iBAAiB,CAAA;AACzC,eAAO,MAAM,aAAa,iBAAiB,CAAA;AAE3C,oFAAoF;AACpF,eAAO,MAAM,WAAW,qBAAqB,CAAA;AAC7C,iFAAiF;AACjF,eAAO,MAAM,qBAAqB,aAAa,CAAA;AAC/C,sEAAsE;AACtE,eAAO,MAAM,aAAa,QAAQ,CAAA;AAElC,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAI3D,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAI9D,CAAA;AAED,+EAA+E;AAC/E,eAAO,MAAM,mBAAmB,iBAAiB,CAAA;AAEjD,0EAA0E;AAC1E,eAAO,MAAM,WAAW,kBAAkB,CAAA;AAC1C,gDAAgD;AAChD,eAAO,MAAM,oBAAoB,2BAA2B,CAAA;AAC5D,2DAA2D;AAC3D,eAAO,MAAM,0BAA0B,iCAAiC,CAAA;AACxE,0DAA0D;AAC1D,eAAO,MAAM,kBAAkB,yBAAyB,CAAA;AAExD,oFAAoF;AACpF,eAAO,MAAM,qBAAqB,OAAO,CAAA;AACzC,oFAAoF;AACpF,eAAO,MAAM,sBAAsB,KAAK,CAAA;AACxC,e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AE,MAAM,GAAG,MAAM,EAAE,CAG7D;AAED;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,SAAS,CAAA;AAE9C;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAKzF;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,GAAG,OAAO,CAAC,CAE3E;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAUrE;AA6CD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAI1D;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,EAAE,aAAa,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAGQ,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keep fixed defaults only when they fit DSH compaction-basic's default policy.
|
|
3
|
+
* This is host metadata, NEVER a wire cap. Callers must retain their original
|
|
4
|
+
* wire fallback when the metadata is omitted. Explicit request caps still win.
|
|
5
|
+
* Custom compaction policies and windows too small even at zero reservation
|
|
6
|
+
* require deployment configuration; do not invent a larger context window.
|
|
7
|
+
*/
|
|
8
|
+
export declare function outputReservation(contextWindow: number, maxTokens: number): {
|
|
9
|
+
defaultMaxTokens?: number;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=output-reservation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output-reservation.d.ts","sourceRoot":"","sources":["../../../../src/host/common/output-reservation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,aAAa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I,SAAS;IAIhC,OAAO,CAAC,QAAQ;IAIhB;;;OAGG;YACW,OAAO;IA0BrB,OAAO,CAAC,gBAAgB;IAUlB,UAAU,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,YAAY,EAAE,CAAC;IAmB/D,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAgCpG,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAO/F,MAAM,CAAC,OAAO,EAAE,eAAe,GAAG,aAAa,CAAC,WAAW,CAAC;YAgBpD,aAAa;CAuL7B;AAQD,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -27,7 +27,7 @@ export interface KimiCodeCatalogModel {
|
|
|
27
27
|
contextWindow: number;
|
|
28
28
|
/** Context the highest tier unlocks, when it is larger than {@link contextWindow}. */
|
|
29
29
|
maxContextWindow: number | null;
|
|
30
|
-
/**
|
|
30
|
+
/** Floor for the dynamic wire budget, NOT a ceiling or DSH defaultMaxTokens. */
|
|
31
31
|
maxTokens: number;
|
|
32
32
|
/** Input the model accepts; DSH only maps the text and image entries. */
|
|
33
33
|
inputModalities: readonly ('text' | 'image' | 'video')[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-catalog.d.ts","sourceRoot":"","sources":["../../../../src/host/kimi-code/model-catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAA;AAElF,wEAAwE;AACxE,MAAM,WAAW,oBAAoB;IACnC,yCAAyC;IACzC,EAAE,EAAE,MAAM,CAAA;IACV,wCAAwC;IACxC,IAAI,EAAE,MAAM,CAAA;IACZ,iDAAiD;IACjD,OAAO,EAAE,MAAM,CAAA;IACf;;;;;;;;OAQG;IACH,aAAa,EAAE,MAAM,CAAA;IACrB,sFAAsF;IACtF,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,
|
|
1
|
+
{"version":3,"file":"model-catalog.d.ts","sourceRoot":"","sources":["../../../../src/host/kimi-code/model-catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAA;AAElF,wEAAwE;AACxE,MAAM,WAAW,oBAAoB;IACnC,yCAAyC;IACzC,EAAE,EAAE,MAAM,CAAA;IACV,wCAAwC;IACxC,IAAI,EAAE,MAAM,CAAA;IACZ,iDAAiD;IACjD,OAAO,EAAE,MAAM,CAAA;IACf;;;;;;;;OAQG;IACH,aAAa,EAAE,MAAM,CAAA;IACrB,sFAAsF;IACtF,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,gFAAgF;IAChF,SAAS,EAAE,MAAM,CAAA;IACjB,yEAAyE;IACzE,eAAe,EAAE,SAAS,CAAC,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC,EAAE,CAAA;IACxD,8DAA8D;IAC9D,gBAAgB,EAAE,SAAS,uBAAuB,EAAE,CAAA;IACpD,mEAAmE;IACnE,sBAAsB,EAAE,uBAAuB,GAAG,IAAI,CAAA;IACtD,iFAAiF;IACjF,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,6EAA6E;IAC7E,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,oDAAoD;IACpD,WAAW,EAAE,MAAM,CAAA;IACnB;;;;;;;;;;;;OAYG;IACH,oBAAoB,EAAE,OAAO,CAAA;IAC7B,kEAAkE;IAClE,eAAe,EAAE,MAAM,CAAA;IACvB,uCAAuC;IACvC,KAAK,EAAE,SAAS,GAAG,WAAW,CAAA;CAC/B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAAS,oBAAoB,EAwE3D,CAAA;AAID,4EAA4E;AAC5E,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS,CAElF;AAED,8CAA8C;AAC9C,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAEzD;AAED,sFAAsF;AACtF,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEzD"}
|
|
@@ -144,9 +144,8 @@ export declare class MinimaxCodeAdapter extends LlmAdapter {
|
|
|
144
144
|
* One model's resolved metadata, read through the current selection.
|
|
145
145
|
*
|
|
146
146
|
* The effective context window is the override when one is saved, and the
|
|
147
|
-
* output cap is sized against that same number
|
|
148
|
-
*
|
|
149
|
-
* this single resolver exists to prevent.
|
|
147
|
+
* wire output cap is sized against that same number in requestStream. It is
|
|
148
|
+
* deliberately not exposed as a fixed defaultMaxTokens reservation here.
|
|
150
149
|
*/
|
|
151
150
|
resolveModel(provider: string, modelId: string, signal?: AbortSignal): Promise<LlmResolvedModelInfo>;
|
|
152
151
|
prepareCall(provider: string, model: string, signal?: AbortSignal): Promise<PreparedAdapterCall>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../../src/host/minimax-code/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EACL,UAAU,EAIV,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAEL,WAAW,EAMZ,MAAM,YAAY,CAAA;AASnB,OAAO,EACL,0BAA0B,EAC1B,6BAA6B,EAG7B,KAAK,0BAA0B,EAChC,MAAM,kBAAkB,CA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G;IACG,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC;IA6BpG,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAOtG;;;;;;;;;OASG;IACI,MAAM,CAAC,OAAO,EAAE,eAAe,GAAG,aAAa,CAAC,WAAW,CAAC;YAiBpD,aAAa;CA6K7B;AAED,OAAO,EAAE,WAAW,EAAE,0BAA0B,EAAE,CAAA;AAClD,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-catalog.d.ts","sourceRoot":"","sources":["../../../src/host/model-catalog.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"model-catalog.d.ts","sourceRoot":"","sources":["../../../src/host/model-catalog.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAG9E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAA;AAEnE,eAAO,MAAM,WAAW,iBAA4B,CAAA;AACpD,eAAO,MAAM,aAAa,EAAG,uCAA4B,CAAA;AAEzD,wBAAgB,eAAe,CAC7B,WAAW,CAAC,EAAE,2BAA2B,EACzC,IAAI,CAAC,EAAE,SAAS,iBAAiB,EAAE,GAClC,YAAY,EAAE,CA0BhB;AAOD,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,EACb,WAAW,CAAC,EAAE,2BAA2B,EACzC,IAAI,CAAC,EAAE,SAAS,iBAAiB,EAAE,GAClC,oBAAoB,CA8CtB"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { AccountPoolCore, type PoolAccountShape, type PoolData } from '../common/account-pool.ts';
|
|
2
|
+
import type { CredentialStore } from '../token-store.ts';
|
|
3
|
+
import { FileCredentialStore, type OllamaCredentials } from './token-store.ts';
|
|
4
|
+
import type { AccountPoolStatusDto } from '../../shared/account-pool-contracts.ts';
|
|
5
|
+
import type { OllamaAccountSummaryDto } from '../../shared/ollama-contracts.ts';
|
|
6
|
+
/** One pooled Ollama key: the bearer key plus the display facts the card renders. */
|
|
7
|
+
export interface OllamaPoolAccount extends PoolAccountShape<OllamaCredentials> {
|
|
8
|
+
/** Model id this account last served, for the card's detail line. */
|
|
9
|
+
lastModelId?: string;
|
|
10
|
+
usage?: {
|
|
11
|
+
inputTokens: number;
|
|
12
|
+
outputTokens: number;
|
|
13
|
+
requestCount: number;
|
|
14
|
+
/** Unix milliseconds the last completed turn was counted. */
|
|
15
|
+
lastCountedAt?: number;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export type { OllamaAccountSummaryDto };
|
|
19
|
+
export type OllamaPoolStatusDto = AccountPoolStatusDto;
|
|
20
|
+
/** Encrypted pool file this line owns. */
|
|
21
|
+
export declare function ollamaPoolPath(): string;
|
|
22
|
+
/**
|
|
23
|
+
* Stable identity of one key.
|
|
24
|
+
*
|
|
25
|
+
* Ollama hands the user a bare key and nothing else — no account id, no email —
|
|
26
|
+
* so the key's own digest is the only identity available. It is never written
|
|
27
|
+
* anywhere: it exists to tell two pasted keys apart inside the pool document,
|
|
28
|
+
* and it is not a credential and cannot be used as one.
|
|
29
|
+
*/
|
|
30
|
+
export declare function ollamaAccountKey(credentials: OllamaCredentials): string;
|
|
31
|
+
/** Validate and normalize one whole pool document. */
|
|
32
|
+
export declare function parseOllamaPoolData(value: unknown): PoolData<OllamaPoolAccount>;
|
|
33
|
+
export interface OllamaAccountPoolOptions {
|
|
34
|
+
/** Pre-pool credential file the pool mirrors its primary account into. */
|
|
35
|
+
store?: FileCredentialStore;
|
|
36
|
+
/** Test seam; production builds the platform backend from the pool path. */
|
|
37
|
+
backend?: CredentialStore<PoolData<OllamaPoolAccount>>;
|
|
38
|
+
maxAccounts?: number;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Ollama's account pool.
|
|
42
|
+
*
|
|
43
|
+
* An Ollama credential is a static key that never expires, so this wrapper
|
|
44
|
+
* supplies identity, the display alias a user chose, and the mirror of the
|
|
45
|
+
* single-credential file — no refresh logic is needed anywhere.
|
|
46
|
+
*/
|
|
47
|
+
export declare class OllamaAccountPool extends AccountPoolCore<OllamaCredentials, OllamaPoolAccount, OllamaAccountSummaryDto> {
|
|
48
|
+
private readonly store;
|
|
49
|
+
constructor(options?: OllamaAccountPoolOptions);
|
|
50
|
+
/**
|
|
51
|
+
* Pick the key for the next request, skipping accounts already tried.
|
|
52
|
+
*
|
|
53
|
+
* Ollama's credential carries no deployment dimension - there is one cloud
|
|
54
|
+
* endpoint and every key is valid for it - so the account and its key are
|
|
55
|
+
* returned together and nothing has to be attached to the credential.
|
|
56
|
+
*/
|
|
57
|
+
getEffectiveCredential(excludeIds?: ReadonlySet<string>, fetchFn?: typeof fetch): Promise<{
|
|
58
|
+
account: OllamaPoolAccount;
|
|
59
|
+
credentials: OllamaCredentials;
|
|
60
|
+
}>;
|
|
61
|
+
/** The pre-pool credential file this pool mirrors its primary account into. */
|
|
62
|
+
mirrorStore(): FileCredentialStore;
|
|
63
|
+
recordUsage(accountId: string, inputTokens: number, outputTokens: number): Promise<void>;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=account-pool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-pool.d.ts","sourceRoot":"","sources":["../../../../src/host/ollama/account-pool.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,eAAe,EAGf,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EACd,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,eAAe,EAAE,MAA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wBAA6B;IAuDlD;;;;;;OAMG;IACG,sBAAsB,CAC1B,UAAU,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,EAChC,OAAO,GAAE,OAAO,KAAa,GAC5B,OAAO,CAAC;QAAE,OAAO,EAAE,iBAAiB,CAAC;QAAC,WAAW,EAAE,iBAAiB,CAAA;KAAE,CAAC;IAI1E,+EAA+E;IAC/E,WAAW,IAAI,mBAAmB;IAU5B,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAe/F"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { LlmAdapter, type GenerateOptions, type LlmModelInfo, type LlmProviderInfo, type LlmResolvedModelInfo, type PreparedAdapterCall, type ResolvedRetryPolicy, type StreamChunk } from '@deepseek-ai/dsh-llm';
|
|
2
|
+
import { type OllamaCatalogModel } from './types.ts';
|
|
3
|
+
import { FileCredentialStore, FileModelSettingsStore, type OllamaCredentials } from './token-store.ts';
|
|
4
|
+
import { OllamaAccountPool } from './account-pool.ts';
|
|
5
|
+
import { type OllamaRequest } from './client.ts';
|
|
6
|
+
export interface OllamaAdapterOptions {
|
|
7
|
+
fetchFn?: typeof fetch;
|
|
8
|
+
/** Test seam; production reads `/api/tags` with the active account's key. */
|
|
9
|
+
loadCatalog?: (fetchFn: typeof fetch, credentials: OllamaCredentials) => Promise<OllamaCatalogModel[]>;
|
|
10
|
+
}
|
|
11
|
+
export declare class OllamaAdapter extends LlmAdapter {
|
|
12
|
+
private readonly store;
|
|
13
|
+
private readonly modelSettings;
|
|
14
|
+
private readonly options;
|
|
15
|
+
/**
|
|
16
|
+
* Rotation pool, or null for the single stored key.
|
|
17
|
+
*
|
|
18
|
+
* Only the plugin entry installs it, because the entry owns the storage; an
|
|
19
|
+
* adapter built without one must keep reading the one credential file rather
|
|
20
|
+
* than minting pool state that would outlive the process.
|
|
21
|
+
*/
|
|
22
|
+
private readonly accountPool;
|
|
23
|
+
constructor(store?: FileCredentialStore, modelSettings?: FileModelSettingsStore, options?: OllamaAdapterOptions, accountPool?: OllamaAccountPool);
|
|
24
|
+
providerInfo(provider: string): LlmProviderInfo;
|
|
25
|
+
providerRetryPolicy(): ResolvedRetryPolicy;
|
|
26
|
+
imageRequestPricing(): undefined;
|
|
27
|
+
private settings;
|
|
28
|
+
/**
|
|
29
|
+
* Catalog for the picker: the live `/api/tags` listing when a key can reach it,
|
|
30
|
+
* the shipped fallback otherwise, narrowed by the user's enabled selection.
|
|
31
|
+
*
|
|
32
|
+
* Ollama's model set moves quickly, so a stale local table would be the wrong
|
|
33
|
+
* default; the fallback exists only so the line is usable before the first
|
|
34
|
+
* successful sync.
|
|
35
|
+
*/
|
|
36
|
+
private catalog;
|
|
37
|
+
/** Any usable key, for the catalog call; the pool decides real routing later. */
|
|
38
|
+
private anyCredentials;
|
|
39
|
+
listModels(provider?: string): Promise<readonly LlmModelInfo[]>;
|
|
40
|
+
resolveModel(provider: string, modelId: string, signal?: AbortSignal): Promise<LlmResolvedModelInfo>;
|
|
41
|
+
prepareCall(provider: string, model: string, signal?: AbortSignal): Promise<PreparedAdapterCall>;
|
|
42
|
+
stream(options: GenerateOptions): AsyncIterable<StreamChunk>;
|
|
43
|
+
private requestStream;
|
|
44
|
+
}
|
|
45
|
+
/** Project DSH's request shape onto Ollama's, per surface. */
|
|
46
|
+
export declare function toOllamaRequest(options: GenerateOptions): Omit<OllamaRequest, 'signal'>;
|
|
47
|
+
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../../src/host/ollama/adapter.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EAGV,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,WA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AW,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAO/F,MAAM,CAAC,OAAO,EAAE,eAAe,GAAG,aAAa,CAAC,WAAW,CAAC;YAUpD,aAAa;CAoH7B;AAED,8DAA8D;AAC9D,wBAAgB,eAAe,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAqCvF"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { type OllamaCatalogModel, type OllamaWire } from './types.ts';
|
|
2
|
+
import type { OllamaCredentials } from './token-store.ts';
|
|
3
|
+
/** One message on the wire, in either surface's shape. */
|
|
4
|
+
export interface OllamaChatMessage {
|
|
5
|
+
role: 'system' | 'user' | 'assistant' | 'tool';
|
|
6
|
+
content: string;
|
|
7
|
+
/** Tool call id a `tool` result answers. */
|
|
8
|
+
toolCallId?: string;
|
|
9
|
+
/** Assistant tool calls that produced this turn. */
|
|
10
|
+
toolCalls?: OllamaToolCall[];
|
|
11
|
+
}
|
|
12
|
+
export interface OllamaToolCall {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
/** Raw JSON the model produced for the arguments. */
|
|
16
|
+
arguments: string;
|
|
17
|
+
}
|
|
18
|
+
export interface OllamaRequest {
|
|
19
|
+
model: string;
|
|
20
|
+
messages: OllamaChatMessage[];
|
|
21
|
+
tools?: {
|
|
22
|
+
name: string;
|
|
23
|
+
description?: string;
|
|
24
|
+
parameters: unknown;
|
|
25
|
+
}[];
|
|
26
|
+
maxOutputTokens?: number;
|
|
27
|
+
temperature?: number;
|
|
28
|
+
signal?: AbortSignal;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Token accounting one completed turn reports.
|
|
32
|
+
*
|
|
33
|
+
* These are the counts Ollama's own OpenAPI documents on the chat response
|
|
34
|
+
* (`prompt_eval_count` and `eval_count`), so they measure what this key has
|
|
35
|
+
* actually spent rather than anything inferred from the text.
|
|
36
|
+
*
|
|
37
|
+
* They are NOT a quota. The service publishes no account limit, no remaining
|
|
38
|
+
* balance and no reset time anywhere in its API: upstream issues #15132 and
|
|
39
|
+
* #15663 asked for one and both were closed. So nothing here can say how much
|
|
40
|
+
* is left - only what has been consumed.
|
|
41
|
+
*/
|
|
42
|
+
export interface OllamaUsage {
|
|
43
|
+
inputTokens: number;
|
|
44
|
+
outputTokens: number;
|
|
45
|
+
}
|
|
46
|
+
export type OllamaStreamEvent = {
|
|
47
|
+
type: 'text';
|
|
48
|
+
text: string;
|
|
49
|
+
} | {
|
|
50
|
+
type: 'tool_call';
|
|
51
|
+
call: OllamaToolCall;
|
|
52
|
+
} | {
|
|
53
|
+
type: 'done';
|
|
54
|
+
finishReason?: string;
|
|
55
|
+
} | {
|
|
56
|
+
type: 'usage';
|
|
57
|
+
usage: OllamaUsage;
|
|
58
|
+
} | {
|
|
59
|
+
type: 'error';
|
|
60
|
+
message: string;
|
|
61
|
+
};
|
|
62
|
+
export interface OllamaCallResult {
|
|
63
|
+
events: AsyncGenerator<OllamaStreamEvent>;
|
|
64
|
+
/** Resolves the HTTP status once the response headers arrive. */
|
|
65
|
+
status: Promise<number>;
|
|
66
|
+
}
|
|
67
|
+
/** Headers both surfaces require, per docs/api/authentication. */
|
|
68
|
+
export declare function headersFor(credentials: OllamaCredentials, accept: string): Record<string, string>;
|
|
69
|
+
/**
|
|
70
|
+
* Build the request body for one wire shape.
|
|
71
|
+
*
|
|
72
|
+
* The two surfaces are not translations of each other — the native API nests the
|
|
73
|
+
* assistant's tool calls under `message.tool_calls` and expects results under a
|
|
74
|
+
* `tool` role without ids, while the OpenAI surface uses `tool_calls` and
|
|
75
|
+
* `tool_call_id`. Mapping them through one shared builder would have to guess at
|
|
76
|
+
* the fields the other surface does not carry, so each is written out where its
|
|
77
|
+
* own rules stay visible.
|
|
78
|
+
*/
|
|
79
|
+
export declare function buildBody(wire: OllamaWire, request: OllamaRequest): unknown;
|
|
80
|
+
/** The endpoint one request goes to. */
|
|
81
|
+
export declare function chatUrl(wire: OllamaWire): string;
|
|
82
|
+
/**
|
|
83
|
+
* Start one streaming chat call.
|
|
84
|
+
*
|
|
85
|
+
* The HTTP status is surfaced through a promise rather than by handing back the
|
|
86
|
+
* Response, because the caller has to decide between retrying this account and
|
|
87
|
+
* failing the turn, and both need the status before any body is read.
|
|
88
|
+
*/
|
|
89
|
+
export declare function startChat(fetchFn: typeof fetch, credentials: OllamaCredentials, wire: OllamaWire, request: OllamaRequest): OllamaCallResult;
|
|
90
|
+
/**
|
|
91
|
+
* Read the model catalog.
|
|
92
|
+
*
|
|
93
|
+
* `/api/tags` is the native surface's own list and needs no translation; the
|
|
94
|
+
* OpenAI `/models` endpoint would be a subset of it. Returns an empty list rather
|
|
95
|
+
* than throwing, so a failed sync degrades to the cached selection instead of
|
|
96
|
+
* making the line unusable.
|
|
97
|
+
*/
|
|
98
|
+
export declare function loadCatalog(fetchFn: typeof fetch, credentials: OllamaCredentials): Promise<OllamaCatalogModel[]>;
|
|
99
|
+
/** The OpenAI-compatible model list, for callers that prefer that surface's view. */
|
|
100
|
+
export declare function loadOpenAIModels(fetchFn: typeof fetch, credentials: OllamaCredentials): Promise<string[]>;
|
|
101
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/host/ollama/client.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,kBAAkB,EACvB,KAAK,UAAU,EAChB,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAEzD,0DAA0D;AAC1D,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,CAAA;IAC9C,OAAO,EAAE,MAAM,CAAA;IACf,4CAA4C;IAC5C,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xB;AAED,kEAAkE;AAClE,wBAAgB,UAAU,CAAC,WAAW,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAEjG;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAG3E;AAqED,wCAAwC;AACxC,wBAAgB,OAAO,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAIhD;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CACvB,OAAO,EAAE,OAAO,KAAK,EACrB,WAAW,EAAE,iBAAiB,EAC9B,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,aAAa,GACrB,gBAAgB,CAsClB;AA0LD;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,OAAO,KAAK,EACrB,WAAW,EAAE,iBAAiB,GAC7B,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAsB/B;AAED,qFAAqF;AACrF,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,OAAO,KAAK,EACrB,WAAW,EAAE,iBAAiB,GAC7B,OAAO,CAAC,MAAM,EAAE,CAAC,CAkBnB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { StreamChunk } from '../common/llm-compat.ts';
|
|
2
|
+
import type { OllamaStreamEvent, OllamaToolCall } from './client.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Translate Ollama's stream events into DSH's block protocol.
|
|
5
|
+
*
|
|
6
|
+
* DSH wants a block opened, filled with deltas, then closed with the assembled
|
|
7
|
+
* content. Ollama's surface streams text and tool calls as two interleaved
|
|
8
|
+
* kinds of delta with no block framing of its own, so this state machine owns
|
|
9
|
+
* the framing: one text block at a time, and one block per tool call that is
|
|
10
|
+
* closed only once its arguments are complete.
|
|
11
|
+
*
|
|
12
|
+
* Closing a tool call late is the point. An arguments string arrives in pieces,
|
|
13
|
+
* and a block closed on the first piece would hand the agent a truncated tool
|
|
14
|
+
* invocation - which fails as a JSON parse error inside the model loop rather
|
|
15
|
+
* than as anything that names the real cause.
|
|
16
|
+
*/
|
|
17
|
+
export interface OllamaStreamState {
|
|
18
|
+
/** Index the next opened block takes. */
|
|
19
|
+
nextBlockIndex: number;
|
|
20
|
+
/** The open text block, or null when the stream is on a tool call. */
|
|
21
|
+
textBlock: {
|
|
22
|
+
index: number;
|
|
23
|
+
text: string;
|
|
24
|
+
} | null;
|
|
25
|
+
/** Call id -> the call being accumulated, with the block it will close. */
|
|
26
|
+
toolCalls: Map<string, {
|
|
27
|
+
call: OllamaToolCall;
|
|
28
|
+
blockIndex: number;
|
|
29
|
+
}>;
|
|
30
|
+
/** True once any content has been produced. */
|
|
31
|
+
hasContent: boolean;
|
|
32
|
+
}
|
|
33
|
+
export declare function createStreamState(): OllamaStreamState;
|
|
34
|
+
/** Fold one event into chunks, opening and closing blocks as the stream needs. */
|
|
35
|
+
export declare function applyEvent(state: OllamaStreamState, event: OllamaStreamEvent): StreamChunk[];
|
|
36
|
+
/**
|
|
37
|
+
* Close the turn.
|
|
38
|
+
*
|
|
39
|
+
* A stream that ends while a text block is still open is a real possibility - the
|
|
40
|
+
* model can be cut off mid-sentence - so the block is closed with what arrived
|
|
41
|
+
* rather than dropped, and the text the user sees is the text that streamed.
|
|
42
|
+
*/
|
|
43
|
+
export declare function closeStream(state: OllamaStreamState): StreamChunk[];
|
|
44
|
+
//# sourceMappingURL=mapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapper.d.ts","sourceRoot":"","sources":["../../../../src/host/ollama/mapper.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAwB,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAChF,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEpE;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,iBAAiB;IAChC,yCAAyC;IACzC,cAAc,EAAE,MAAM,CAAA;IACtB,sEAAsE;IACtE,SAAS,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;IACjD,2EAA2E;IAC3E,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,cAAc,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACpE,+CAA+C;IAC/C,UAAU,EAAE,OAAO,CAAA;CACpB;AAED,wBAAgB,iBAAiB,IAAI,iBAAiB,CAErD;AAED,kFAAkF;AAClF,wBAAgB,UAAU,CAAC,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,iBAAiB,GAAG,WAAW,EAAE,CAI5F;AAuED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,iBAAiB,GAAG,WAAW,EAAE,CASnE"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { OllamaAccountPool } from './account-pool.ts';
|
|
3
|
+
import type { FileModelSettingsStore } from './token-store.ts';
|
|
4
|
+
import type { OllamaWebStatus } from '../../shared/ollama-contracts.ts';
|
|
5
|
+
/** Where a user creates the keys this line stores. */
|
|
6
|
+
export declare const OLLAMA_KEYS_URL = "https://ollama.com/settings/keys";
|
|
7
|
+
export interface OllamaRouteOptions {
|
|
8
|
+
accountPool: OllamaAccountPool;
|
|
9
|
+
modelSettings: FileModelSettingsStore;
|
|
10
|
+
fetchFn?: typeof fetch;
|
|
11
|
+
}
|
|
12
|
+
/** Assemble the whole status payload the Ollama tab renders. */
|
|
13
|
+
export declare function getOllamaWebStatus(options: OllamaRouteOptions): Promise<OllamaWebStatus>;
|
|
14
|
+
/**
|
|
15
|
+
* Register the Ollama settings API.
|
|
16
|
+
*
|
|
17
|
+
* The surface is deliberately the same one every other line exposes - status,
|
|
18
|
+
* accounts, models - so the shared settings card and the client API helper
|
|
19
|
+
* work against it without a per-provider special case.
|
|
20
|
+
*/
|
|
21
|
+
export declare function registerOllamaRoutes(ctx: Context, options: OllamaRouteOptions): () => void;
|
|
22
|
+
//# sourceMappingURL=routes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../../src/host/ollama/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAGlD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAE1D,OAAO,KAAK,EAAE,sBAAsB,EAAqB,MAAM,kBAAkB,CAAA;AAEjF,OAAO,KAAK,EAAuB,eAAe,EAAE,MAAM,kCAAkC,CAAA;AAI5F,sDAAsD;AACtD,eAAO,MAAM,eAAe,qCAAqC,CAAA;AA+BjE,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,iBAAiB,CAAA;IAC9B,aAAa,EAAE,sBAAsB,CAAA;IACrC,OAAO,CAAC,EAAE,OAAO,KAAK,CAAA;CACvB;AASD,gEAAgE;AAChE,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,eAAe,CAAC,CAsB9F;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,kBAAkB,GAAG,MAAM,IAAI,CA8H1F"}
|