@eddyskywalker/dsh-chatgpt-subscription 0.37.0 → 0.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +9 -6
- package/lib/client.js +263 -87
- package/lib/client.js.map +1 -1
- package/lib/index.js +213 -15
- package/lib/types/client/kimi-code/KimiCodeSection.d.ts.map +1 -1
- package/lib/types/client/kimi-code/KimiModelCapabilities.d.ts.map +1 -1
- package/lib/types/client/kimi-code/labels.d.ts +66 -0
- package/lib/types/client/kimi-code/labels.d.ts.map +1 -0
- package/lib/types/client/kimi-code/locales.d.ts +52 -11
- package/lib/types/client/kimi-code/locales.d.ts.map +1 -1
- package/lib/types/client/locales-ru/kimi-code.d.ts.map +1 -1
- package/lib/types/host/kimi-code/adapter.d.ts.map +1 -1
- package/lib/types/host/kimi-code/client.d.ts.map +1 -1
- package/lib/types/host/kimi-code/mapper.d.ts +89 -1
- package/lib/types/host/kimi-code/mapper.d.ts.map +1 -1
- package/lib/types/host/kimi-code/model-catalog.d.ts +20 -4
- package/lib/types/host/kimi-code/model-catalog.d.ts.map +1 -1
- package/lib/types/host/kimi-code/routes.d.ts.map +1 -1
- package/lib/types/host/kimi-code/types.d.ts +50 -6
- package/lib/types/host/kimi-code/types.d.ts.map +1 -1
- package/lib/types/shared/kimi-code-contracts.d.ts +30 -6
- package/lib/types/shared/kimi-code-contracts.d.ts.map +1 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -23623,7 +23623,7 @@ var OllamaAccountPool = class extends AccountPoolCore {
|
|
|
23623
23623
|
//#endregion
|
|
23624
23624
|
//#region src/host/kimi-code/model-catalog.ts
|
|
23625
23625
|
/**
|
|
23626
|
-
* The
|
|
23626
|
+
* The ids the subscription serves today.
|
|
23627
23627
|
*
|
|
23628
23628
|
* `kimi-for-coding` is the alias that never changes: Moonshot upgrades the model
|
|
23629
23629
|
* behind it in place (K2.7 Code became K2.8 Preview without a config change), so
|
|
@@ -23721,6 +23721,58 @@ const KIMI_CODE_MODELS = [
|
|
|
23721
23721
|
supportsDynamicTools: false,
|
|
23722
23722
|
quotaMultiplier: 3,
|
|
23723
23723
|
speed: "highspeed"
|
|
23724
|
+
},
|
|
23725
|
+
{
|
|
23726
|
+
id: "k3.1-pro",
|
|
23727
|
+
name: "K3.1 Pro",
|
|
23728
|
+
version: "K3.1 Pro",
|
|
23729
|
+
contextWindow: 262144,
|
|
23730
|
+
maxContextWindow: 1048576,
|
|
23731
|
+
maxTokens: 32768,
|
|
23732
|
+
inputModalities: [
|
|
23733
|
+
"text",
|
|
23734
|
+
"image",
|
|
23735
|
+
"video"
|
|
23736
|
+
],
|
|
23737
|
+
reasoningEfforts: [
|
|
23738
|
+
"low",
|
|
23739
|
+
"high",
|
|
23740
|
+
"max"
|
|
23741
|
+
],
|
|
23742
|
+
defaultReasoningEffort: "max",
|
|
23743
|
+
thinkingType: "only",
|
|
23744
|
+
minimumPlan: "Moderato",
|
|
23745
|
+
contextPlan: "Allegretto",
|
|
23746
|
+
description: "The K3.1 Pro flagship: 3T parameters, a 256K context window on Plus/Moderato and 1M on Pro/Allegretto and above. Thinking runs at low/high/max, defaults to max, and cannot be disabled.",
|
|
23747
|
+
supportsDynamicTools: true,
|
|
23748
|
+
quotaMultiplier: null,
|
|
23749
|
+
speed: "regular"
|
|
23750
|
+
},
|
|
23751
|
+
{
|
|
23752
|
+
id: "k3.1-pro-highspeed",
|
|
23753
|
+
name: "K3.1 Pro Highspeed",
|
|
23754
|
+
version: "K3.1 Pro Highspeed",
|
|
23755
|
+
contextWindow: 1048576,
|
|
23756
|
+
maxContextWindow: null,
|
|
23757
|
+
maxTokens: 32768,
|
|
23758
|
+
inputModalities: [
|
|
23759
|
+
"text",
|
|
23760
|
+
"image",
|
|
23761
|
+
"video"
|
|
23762
|
+
],
|
|
23763
|
+
reasoningEfforts: [
|
|
23764
|
+
"low",
|
|
23765
|
+
"high",
|
|
23766
|
+
"max"
|
|
23767
|
+
],
|
|
23768
|
+
defaultReasoningEffort: "max",
|
|
23769
|
+
thinkingType: "only",
|
|
23770
|
+
minimumPlan: "Allegretto",
|
|
23771
|
+
contextPlan: null,
|
|
23772
|
+
description: "The high-speed K3.1 Pro with a 1M context window and faster output, at about twice the quota of the regular version. Requires the Pro/Allegretto plan or above.",
|
|
23773
|
+
supportsDynamicTools: true,
|
|
23774
|
+
quotaMultiplier: null,
|
|
23775
|
+
speed: "highspeed"
|
|
23724
23776
|
}
|
|
23725
23777
|
];
|
|
23726
23778
|
const BY_ID$1 = new Map(KIMI_CODE_MODELS.map((model) => [model.id, model]));
|
|
@@ -24357,17 +24409,79 @@ function maxRequestImageBytes$1(env = process.env) {
|
|
|
24357
24409
|
/**
|
|
24358
24410
|
* Which wire dialect a model id is served over.
|
|
24359
24411
|
*
|
|
24360
|
-
*
|
|
24361
|
-
*
|
|
24362
|
-
*
|
|
24363
|
-
*
|
|
24412
|
+
* Always the OpenAI-compatible chat completions dialect: this line uses that one
|
|
24413
|
+
* protocol for every model, K3.1 Pro included, which is what the official agent
|
|
24414
|
+
* configures for the managed provider (`type = "kimi"`). The Anthropic Messages
|
|
24415
|
+
* dialect remains reachable only when a live listing declares it for an id
|
|
24416
|
+
* (see `wireForCatalogEntry`), so the answer here is a constant rather than a
|
|
24417
|
+
* per-model table.
|
|
24364
24418
|
*/
|
|
24365
24419
|
function wireForModel(_modelId) {
|
|
24366
24420
|
return "openai";
|
|
24367
24421
|
}
|
|
24368
|
-
/**
|
|
24422
|
+
/**
|
|
24423
|
+
* Thinking levels one model advertises, from the static registry.
|
|
24424
|
+
*
|
|
24425
|
+
* A registry row that declares `thinkingType: 'only'` cannot be asked to stop
|
|
24426
|
+
* reasoning — the service answers HTTP 400 for a disabled-thinking request — so
|
|
24427
|
+
* `none` is filtered out of the list it publishes.
|
|
24428
|
+
*/
|
|
24369
24429
|
function reasoningEffortsFor(modelId) {
|
|
24370
|
-
|
|
24430
|
+
const declared = kimiCodeModelDef(modelId)?.reasoningEfforts ?? [];
|
|
24431
|
+
if (kimiCodeModelDef(modelId)?.thinkingType === "only") return declared.filter((effort) => effort !== "none");
|
|
24432
|
+
return [...declared];
|
|
24433
|
+
}
|
|
24434
|
+
/**
|
|
24435
|
+
* Thinking level one model uses when the conversation does not pick one.
|
|
24436
|
+
*
|
|
24437
|
+
* A declared default that the resolved effort list no longer contains is
|
|
24438
|
+
* dropped rather than carried through: with `only` in force the list can lose
|
|
24439
|
+
* `none`, and a default naming a level the model can no longer be asked for
|
|
24440
|
+
* would fail on the first turn that relied on it.
|
|
24441
|
+
*/
|
|
24442
|
+
function defaultReasoningEffortFor(modelId) {
|
|
24443
|
+
const declared = kimiCodeModelDef(modelId)?.defaultReasoningEffort ?? void 0;
|
|
24444
|
+
if (declared === null || declared === void 0) return void 0;
|
|
24445
|
+
return reasoningEffortsFor(modelId).includes(declared) ? declared : void 0;
|
|
24446
|
+
}
|
|
24447
|
+
/**
|
|
24448
|
+
* How a model handles thinking, from the static registry.
|
|
24449
|
+
*
|
|
24450
|
+
* Exposed so the request builder and the settings card read the same row rather
|
|
24451
|
+
* than each re-deriving the rule; `undefined` means the registry says nothing
|
|
24452
|
+
* about this id, which is not the same as "thinking can be switched off".
|
|
24453
|
+
*/
|
|
24454
|
+
function thinkingTypeFor(modelId) {
|
|
24455
|
+
return kimiCodeModelDef(modelId)?.thinkingType;
|
|
24456
|
+
}
|
|
24457
|
+
/**
|
|
24458
|
+
* Raise a disabled-thinking request to a level the model can actually run.
|
|
24459
|
+
*
|
|
24460
|
+
* Asking a thinking-only model for `none` is refused by the service with
|
|
24461
|
+
* HTTP 400 ("K3.1 Pro does not support disabled thinking mode"), and the user's
|
|
24462
|
+
* real intent there is "don't spend my quota on thinking", not "fail the turn".
|
|
24463
|
+
* So the effort is lifted to the model's own default — `max` for the K3.1 pair —
|
|
24464
|
+
* and the lift is REPORTED through `coercedFrom` so a caller can tell the user
|
|
24465
|
+
* what happened instead of silently spending more than they asked for.
|
|
24466
|
+
*
|
|
24467
|
+
* A model that does not declare `only`, and any effort other than `none`, is
|
|
24468
|
+
* returned untouched. When a thinking-only row declares no default the effort
|
|
24469
|
+
* becomes `undefined`, which sends no level at all and leaves the service on its
|
|
24470
|
+
* own default — still never a disabled-thinking request.
|
|
24471
|
+
*/
|
|
24472
|
+
function coerceThinkingEffort(modelId, effort) {
|
|
24473
|
+
if (effort !== "none") return {
|
|
24474
|
+
effort,
|
|
24475
|
+
coercedFrom: null
|
|
24476
|
+
};
|
|
24477
|
+
if (thinkingTypeFor(modelId) !== "only") return {
|
|
24478
|
+
effort,
|
|
24479
|
+
coercedFrom: null
|
|
24480
|
+
};
|
|
24481
|
+
return {
|
|
24482
|
+
effort: defaultReasoningEffortFor(modelId),
|
|
24483
|
+
coercedFrom: "none"
|
|
24484
|
+
};
|
|
24371
24485
|
}
|
|
24372
24486
|
/**
|
|
24373
24487
|
* Accepted request modalities for one model.
|
|
@@ -25757,7 +25871,7 @@ function wireForCatalogEntry(modelId, catalog) {
|
|
|
25757
25871
|
function reasoningEffortsForEntry(modelId, catalog) {
|
|
25758
25872
|
const entry = catalog.find((model) => model.id === modelId);
|
|
25759
25873
|
const declared = entry?.reasoningEfforts ?? reasoningEffortsFor(modelId);
|
|
25760
|
-
switch (entry?.thinkingType) {
|
|
25874
|
+
switch (entry?.thinkingType ?? thinkingTypeFor(modelId)) {
|
|
25761
25875
|
case "no": return [];
|
|
25762
25876
|
case "only": return declared.filter((effort) => effort !== "none");
|
|
25763
25877
|
default: return [...declared];
|
|
@@ -25830,6 +25944,7 @@ function buildModelOptions(catalog, enabledModelIds, contextWindowOverrides) {
|
|
|
25830
25944
|
const contextWindow = typeof override === "number" && Number.isFinite(override) && override > 0 ? override : model.contextWindow ?? 262144;
|
|
25831
25945
|
const efforts = reasoningEffortsForEntry(model.id, catalog);
|
|
25832
25946
|
const defaultEffort = defaultReasoningEffortForEntry(model.id, catalog);
|
|
25947
|
+
const thinkingType = model.thinkingType ?? thinkingTypeFor(model.id);
|
|
25833
25948
|
const declaredInputCap = maxInputTokensForEntry(model.id, catalog);
|
|
25834
25949
|
const promptBudget = declaredInputCap === void 0 ? contextWindow : Math.min(contextWindow, declaredInputCap);
|
|
25835
25950
|
return {
|
|
@@ -25843,6 +25958,7 @@ function buildModelOptions(catalog, enabledModelIds, contextWindowOverrides) {
|
|
|
25843
25958
|
defaultMaxTokens: maxOutputTokensFor$4(model.id, contextWindow),
|
|
25844
25959
|
...efforts.length === 0 ? {} : { reasoningEfforts: [...efforts] },
|
|
25845
25960
|
...defaultEffort === void 0 ? {} : { defaultReasoningEffort: defaultEffort },
|
|
25961
|
+
...thinkingType === void 0 ? {} : { thinkingType },
|
|
25846
25962
|
wire: model.protocol ?? wireForModel(model.id),
|
|
25847
25963
|
description: model.description ?? kimiCodeModelDef(model.id)?.description ?? null,
|
|
25848
25964
|
supportsVideo: model.supportsVideo ?? kimiCodeModelDef(model.id)?.inputModalities.includes("video") ?? false,
|
|
@@ -27757,6 +27873,8 @@ function createStreamState$4(wire, sessionId) {
|
|
|
27757
27873
|
outputTokens: 0,
|
|
27758
27874
|
cacheReadTokens: 0,
|
|
27759
27875
|
cacheWriteTokens: 0,
|
|
27876
|
+
cacheWrite5mTokens: 0,
|
|
27877
|
+
cacheWrite1hTokens: 0,
|
|
27760
27878
|
reasoningTokens: 0,
|
|
27761
27879
|
sawUsage: false,
|
|
27762
27880
|
toolCallIds: new ToolCallIdNormalizer()
|
|
@@ -27847,8 +27965,10 @@ function processOpenAIStreamLine(line, state) {
|
|
|
27847
27965
|
const prompt = numberOr$7(usage.prompt_tokens, 0);
|
|
27848
27966
|
const details = isRecord$34(usage.prompt_tokens_details) ? usage.prompt_tokens_details : void 0;
|
|
27849
27967
|
const cached = details ? numberOr$7(details.cached_tokens, 0) : 0;
|
|
27850
|
-
|
|
27968
|
+
const written = details ? numberOr$7(details.cache_write_tokens, 0) : 0;
|
|
27969
|
+
state.inputTokens = Math.max(0, prompt - cached - written);
|
|
27851
27970
|
state.cacheReadTokens = cached;
|
|
27971
|
+
state.cacheWriteTokens = written;
|
|
27852
27972
|
state.outputTokens = numberOr$7(usage.completion_tokens, state.outputTokens);
|
|
27853
27973
|
if (isRecord$34(usage.completion_tokens_details)) state.reasoningTokens = numberOr$7(usage.completion_tokens_details.reasoning_tokens, state.reasoningTokens);
|
|
27854
27974
|
}
|
|
@@ -28228,6 +28348,63 @@ function recordDriftCause(cause, sessionId) {
|
|
|
28228
28348
|
function getLastDriftCause(sessionId) {
|
|
28229
28349
|
return driftCauses.get(cacheScopeKey(sessionId));
|
|
28230
28350
|
}
|
|
28351
|
+
/** Last lift per session. */
|
|
28352
|
+
const thinkingCoercions = /* @__PURE__ */ new Map();
|
|
28353
|
+
/**
|
|
28354
|
+
* Record one lift, and make it visible.
|
|
28355
|
+
*
|
|
28356
|
+
* `process.emitWarning` rather than a thrown error or a silently swallowed
|
|
28357
|
+
* value: the request must still go out (that is the whole point of the lift),
|
|
28358
|
+
* but a diagnostic that reaches stderr with a stable code is what keeps it from
|
|
28359
|
+
* being invisible. It is emitted once per turn, and only for a model that
|
|
28360
|
+
* actually declares thinking-only, so a deployment that never asks for 'none'
|
|
28361
|
+
* never sees one.
|
|
28362
|
+
*/
|
|
28363
|
+
function recordThinkingCoercion(coercion, sessionId) {
|
|
28364
|
+
rememberScoped(thinkingCoercions, cacheScopeKey(sessionId), coercion);
|
|
28365
|
+
const target = coercion.to === void 0 ? "the service default" : "\"" + coercion.to + "\"";
|
|
28366
|
+
process.emitWarning("[kimi-code] model \"" + coercion.model + "\" cannot disable thinking; sending " + target + " instead of \"none\" on the " + coercion.wire + " wire.", { code: "KIMI_CODE_THINKING_COERCED" });
|
|
28367
|
+
}
|
|
28368
|
+
/**
|
|
28369
|
+
* Response headers that split a cache write across its two TTL tiers.
|
|
28370
|
+
*
|
|
28371
|
+
* The service states the write TOTAL in 'usage' and the per-tier split only in
|
|
28372
|
+
* these headers, so the split has to be read off the HTTP response — there is no
|
|
28373
|
+
* body field for it. Both are decimal integers; a missing or non-numeric value
|
|
28374
|
+
* means the header said nothing, which is recorded as 0 rather than guessed at
|
|
28375
|
+
* (see KimiCodeCacheStatsDto.cacheWrite5mTokens: an absent header is silence,
|
|
28376
|
+
* not a claim that nothing was written to that tier).
|
|
28377
|
+
*/
|
|
28378
|
+
const CACHE_WRITE_5M_HEADER = "Msh-Usage-Cache-Write-Tokens-5m";
|
|
28379
|
+
const CACHE_WRITE_1H_HEADER = "Msh-Usage-Cache-Write-Tokens-1h";
|
|
28380
|
+
/** Decimal whole-token count from one response header, or 0 when it is silent. */
|
|
28381
|
+
function headerCount(headers, name) {
|
|
28382
|
+
const raw = headers.get(name);
|
|
28383
|
+
if (raw === null) return 0;
|
|
28384
|
+
const text = raw.trim();
|
|
28385
|
+
if (!/^\d+$/.test(text)) return 0;
|
|
28386
|
+
const value = Number(text);
|
|
28387
|
+
return Number.isSafeInteger(value) ? value : 0;
|
|
28388
|
+
}
|
|
28389
|
+
/** The two tier counts one response's headers state. */
|
|
28390
|
+
function cacheWriteTiers(headers) {
|
|
28391
|
+
return {
|
|
28392
|
+
write5m: headerCount(headers, CACHE_WRITE_5M_HEADER),
|
|
28393
|
+
write1h: headerCount(headers, CACHE_WRITE_1H_HEADER)
|
|
28394
|
+
};
|
|
28395
|
+
}
|
|
28396
|
+
/**
|
|
28397
|
+
* File one response's tier counts on the stream state that will close it.
|
|
28398
|
+
*
|
|
28399
|
+
* Called by the adapter on the Response itself, which is the only place the
|
|
28400
|
+
* headers exist; the totals are then filed with the rest of the usage when the
|
|
28401
|
+
* stream closes, so one turn's numbers stay one turn's numbers.
|
|
28402
|
+
*/
|
|
28403
|
+
function applyCacheWriteTiers(state, headers) {
|
|
28404
|
+
const tiers = cacheWriteTiers(headers);
|
|
28405
|
+
state.cacheWrite5mTokens = tiers.write5m;
|
|
28406
|
+
state.cacheWrite1hTokens = tiers.write1h;
|
|
28407
|
+
}
|
|
28231
28408
|
/**
|
|
28232
28409
|
* Rolling cache totals per session.
|
|
28233
28410
|
*
|
|
@@ -28241,7 +28418,9 @@ const EMPTY_CACHE_STATS = {
|
|
|
28241
28418
|
cachedTokens: 0,
|
|
28242
28419
|
freshTokens: 0,
|
|
28243
28420
|
outputTokens: 0,
|
|
28244
|
-
cacheWriteTokens: 0
|
|
28421
|
+
cacheWriteTokens: 0,
|
|
28422
|
+
cacheWrite5mTokens: 0,
|
|
28423
|
+
cacheWrite1hTokens: 0
|
|
28245
28424
|
};
|
|
28246
28425
|
/** Record one request's usage into its own session's totals. */
|
|
28247
28426
|
function recordCacheStats(state, sessionId, accountId) {
|
|
@@ -28253,7 +28432,9 @@ function recordCacheStats(state, sessionId, accountId) {
|
|
|
28253
28432
|
cachedTokens: previous.cachedTokens + state.cacheReadTokens,
|
|
28254
28433
|
freshTokens: previous.freshTokens + state.inputTokens,
|
|
28255
28434
|
outputTokens: previous.outputTokens + state.outputTokens,
|
|
28256
|
-
cacheWriteTokens: previous.cacheWriteTokens + state.cacheWriteTokens
|
|
28435
|
+
cacheWriteTokens: previous.cacheWriteTokens + state.cacheWriteTokens,
|
|
28436
|
+
cacheWrite5mTokens: previous.cacheWrite5mTokens + state.cacheWrite5mTokens,
|
|
28437
|
+
cacheWrite1hTokens: previous.cacheWrite1hTokens + state.cacheWrite1hTokens
|
|
28257
28438
|
});
|
|
28258
28439
|
}
|
|
28259
28440
|
/** Add one entry into an accumulator. */
|
|
@@ -28263,6 +28444,8 @@ function accumulate(totals, stats) {
|
|
|
28263
28444
|
totals.freshTokens += stats.freshTokens;
|
|
28264
28445
|
totals.outputTokens += stats.outputTokens;
|
|
28265
28446
|
totals.cacheWriteTokens += stats.cacheWriteTokens;
|
|
28447
|
+
totals.cacheWrite5mTokens += stats.cacheWrite5mTokens;
|
|
28448
|
+
totals.cacheWrite1hTokens += stats.cacheWrite1hTokens;
|
|
28266
28449
|
}
|
|
28267
28450
|
/**
|
|
28268
28451
|
* Totals for one account's share of a session, one whole session, or every
|
|
@@ -28821,7 +29004,19 @@ var KimiCodeAdapter = class extends LlmAdapter {
|
|
|
28821
29004
|
const entry = catalog.find((model) => model.id === options.model);
|
|
28822
29005
|
const normalized = normalizeGenerateOptions(options);
|
|
28823
29006
|
const images = await resolveRequestImages$1(normalized, this.options.attachments, signal);
|
|
28824
|
-
const
|
|
29007
|
+
const imageTrimmed = offloadOldestRequestImages$1(normalized, maxRequestImageBytes$1(), images);
|
|
29008
|
+
const gatedEffort = coerceThinkingEffort(options.model, mapReasoningEffort(options.reasoningEffort === void 0 || options.reasoningEffort === null ? void 0 : String(options.reasoningEffort)));
|
|
29009
|
+
if (gatedEffort.coercedFrom !== null) recordThinkingCoercion({
|
|
29010
|
+
model: options.model,
|
|
29011
|
+
wire,
|
|
29012
|
+
from: gatedEffort.coercedFrom,
|
|
29013
|
+
to: gatedEffort.effort
|
|
29014
|
+
}, options.sessionId);
|
|
29015
|
+
const videoTrimmed = offloadOldestRequestVideos(imageTrimmed, MAX_REQUEST_VIDEO_BYTES$1);
|
|
29016
|
+
const requestOptions = gatedEffort.effort === void 0 ? videoTrimmed : {
|
|
29017
|
+
...videoTrimmed,
|
|
29018
|
+
reasoningEffort: ReasoningEffortId(gatedEffort.effort)
|
|
29019
|
+
};
|
|
28825
29020
|
const videos = await resolveRequestVideos(requestOptions, this.options.videos, signal);
|
|
28826
29021
|
const settings = await this.settings();
|
|
28827
29022
|
const media = {
|
|
@@ -28934,6 +29129,7 @@ var KimiCodeAdapter = class extends LlmAdapter {
|
|
|
28934
29129
|
const reader = response.body.getReader();
|
|
28935
29130
|
const decoder = new TextDecoder();
|
|
28936
29131
|
const state = createStreamState$4(wire, requestOptions.sessionId);
|
|
29132
|
+
applyCacheWriteTiers(state, response.headers);
|
|
28937
29133
|
markSessionActive(requestOptions.sessionId);
|
|
28938
29134
|
let buffer = "";
|
|
28939
29135
|
/**
|
|
@@ -29399,7 +29595,9 @@ function cacheStatsOrNull(sessionId) {
|
|
|
29399
29595
|
return {
|
|
29400
29596
|
...stats,
|
|
29401
29597
|
...lastDrift === void 0 ? {} : { lastDrift },
|
|
29402
|
-
|
|
29598
|
+
cacheWriteTokens: stats.cacheWriteTokens,
|
|
29599
|
+
cacheWrite5mTokens: stats.cacheWrite5mTokens,
|
|
29600
|
+
cacheWrite1hTokens: stats.cacheWrite1hTokens
|
|
29403
29601
|
};
|
|
29404
29602
|
}
|
|
29405
29603
|
/**
|
|
@@ -29992,7 +30190,7 @@ async function assertVideoCapableRoute(ctx, exec, source) {
|
|
|
29992
30190
|
const llm = ctx.get("llm");
|
|
29993
30191
|
if (llm === void 0) throw new HarnessError(`cannot attach "${source}": the LLM service is unavailable`, "KIMI_VIDEO_NO_LLM");
|
|
29994
30192
|
const active = await llm.resolveModelInfo(provider, model, exec.signal);
|
|
29995
|
-
if (active.inputModalities === void 0 || !active.inputModalities.includes("video")) throw new HarnessError(`cannot attach "${source}": model "${model}" does not accept video input; switch to k3 or kimi-for-coding`, "KIMI_VIDEO_MODEL_UNSUPPORTED");
|
|
30193
|
+
if (active.inputModalities === void 0 || !active.inputModalities.includes("video")) throw new HarnessError(`cannot attach "${source}": model "${model}" does not accept video input; switch to k3, k3.1-pro, kimi-for-coding or kimi-for-coding-highspeed`, "KIMI_VIDEO_MODEL_UNSUPPORTED");
|
|
29996
30194
|
}
|
|
29997
30195
|
function humanBytes$1(bytes) {
|
|
29998
30196
|
return bytes < 1024 * 1024 ? `${(bytes / 1024).toFixed(1)} KB` : `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
@@ -30055,7 +30253,7 @@ function createKimiVideoTool(ctx, options = {}) {
|
|
|
30055
30253
|
const fetchFn = options.fetchFn ?? fetch;
|
|
30056
30254
|
return defineTool({
|
|
30057
30255
|
name: KIMI_VIDEO_TOOL_NAME,
|
|
30058
|
-
description: "Attach a video to the conversation for models that accept video input (Kimi k3 and kimi-for-coding). Use this when the user asks about a video file or a video URL: pass an absolute local path or an http(s) URL. The video is sent to the model on the next request; it does not work on image-only models such as k3-256k.",
|
|
30256
|
+
description: "Attach a video to the conversation for models that accept video input (Kimi k3, k3.1-pro, kimi-for-coding and kimi-for-coding-highspeed). Use this when the user asks about a video file or a video URL: pass an absolute local path or an http(s) URL. The video is sent to the model on the next request; it does not work on image-only models such as k3-256k.",
|
|
30059
30257
|
parameters: {
|
|
30060
30258
|
source: {
|
|
30061
30259
|
type: "string",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KimiCodeSection.d.ts","sourceRoot":"","sources":["../../../../src/client/kimi-code/KimiCodeSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAA;AAuBvE,UAAU,KAAK;IACb,aAAa,CAAC,EAAE,MAAM,IAAI,CAAA;IAC1B,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAA;CAChC;
|
|
1
|
+
{"version":3,"file":"KimiCodeSection.d.ts","sourceRoot":"","sources":["../../../../src/client/kimi-code/KimiCodeSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAA;AAuBvE,UAAU,KAAK;IACb,aAAa,CAAC,EAAE,MAAM,IAAI,CAAA;IAC1B,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAA;CAChC;AAwCD,wBAAgB,eAAe,CAAC,EAAE,aAAa,EAAE,kBAAkB,EAAE,EAAE,KAAK,GAAG,KAAK,CAAC,YAAY,CAqtBhG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KimiModelCapabilities.d.ts","sourceRoot":"","sources":["../../../../src/client/kimi-code/KimiModelCapabilities.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAA;
|
|
1
|
+
{"version":3,"file":"KimiModelCapabilities.d.ts","sourceRoot":"","sources":["../../../../src/client/kimi-code/KimiModelCapabilities.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAA;AAe9E,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,mBAAmB,EAAE,CAAA;CAC9B;AAED,wBAAgB,qBAAqB,CAAC,EAAE,MAAM,EAAE,EAAE,0BAA0B,GAAG,KAAK,CAAC,YAAY,CAsFhG"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Labels and ladders the two Kimi Code cards must agree on.
|
|
3
|
+
*
|
|
4
|
+
* The model checklist and the capability table both name a model's wire, and
|
|
5
|
+
* both used to carry their own copy of the same two-way switch, so a new value
|
|
6
|
+
* could be labelled one place and not the other. The wire and the thinking
|
|
7
|
+
* ladder are facts about the model, not about the card, so they live here once
|
|
8
|
+
* and are rendered from the same dictionary key everywhere.
|
|
9
|
+
*/
|
|
10
|
+
import type { KimiCodeModelOption, KimiCodeReasoningEffort, KimiCodeWire } from '../../shared/kimi-code-contracts.ts';
|
|
11
|
+
import type { KimiCodeDict } from './locales.ts';
|
|
12
|
+
/**
|
|
13
|
+
* Name of the request/response dialect a model is served over.
|
|
14
|
+
*
|
|
15
|
+
* @param wire - dialect the adapter reports for this model.
|
|
16
|
+
* @param t - dictionary of the card rendering it.
|
|
17
|
+
*/
|
|
18
|
+
export declare function wireLabel(wire: KimiCodeWire, t: KimiCodeDict): string;
|
|
19
|
+
/** Human label for one thinking level. */
|
|
20
|
+
export declare function effortLabel(effort: KimiCodeReasoningEffort, t: KimiCodeDict): string;
|
|
21
|
+
/**
|
|
22
|
+
* Thinking levels one model publishes, in the order the card renders them.
|
|
23
|
+
*
|
|
24
|
+
* The ladder is read, never assumed: a model that declares no levels gets an
|
|
25
|
+
* empty list, and the picker then offers none of them rather than the generic
|
|
26
|
+
* four. `none` is dropped for a thinking-only model — the host already strips
|
|
27
|
+
* it, and filtering again is what keeps an older host, or a live catalog that
|
|
28
|
+
* says nothing about thinking, from putting "thinking off" back on a menu whose
|
|
29
|
+
* request the service answers with HTTP 400.
|
|
30
|
+
*
|
|
31
|
+
* @param model - one entry from the model directory.
|
|
32
|
+
*/
|
|
33
|
+
export declare function effortLadder(model: KimiCodeModelOption): KimiCodeReasoningEffort[];
|
|
34
|
+
/**
|
|
35
|
+
* Whether one model may be asked to stop reasoning.
|
|
36
|
+
*
|
|
37
|
+
* Read from the model's own declaration rather than assumed: `only` is the one
|
|
38
|
+
* value that makes the question a hard no — the service answers a
|
|
39
|
+
* disabled-thinking request with HTTP 400 and names the model — while `no`
|
|
40
|
+
* describes a model that never reasons, so there is no switch to offer either.
|
|
41
|
+
* `both`, and a registry that says nothing about the id, keep the switch,
|
|
42
|
+
* because that is what this line offered before the flag existed and the
|
|
43
|
+
* service, not the card, is the authority on refusing a level.
|
|
44
|
+
*
|
|
45
|
+
* @param model - one entry from the model directory.
|
|
46
|
+
*/
|
|
47
|
+
export declare function canDisableThinking(model: KimiCodeModelOption): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Thinking levels a conversation can actually be set to.
|
|
50
|
+
*
|
|
51
|
+
* The setting is one level for the whole line, so the three thinking levels are
|
|
52
|
+
* the union of what the CHECKED models declare: a level no checked model
|
|
53
|
+
* declares would be stored and then rejected on the first turn. "Thinking off"
|
|
54
|
+
* is not one of those declared levels on most rows — it is a switch, not a
|
|
55
|
+
* ladder rung — so it is decided by {@link canDisableThinking} instead, and it
|
|
56
|
+
* disappears exactly when every checked model refuses to be switched off.
|
|
57
|
+
*
|
|
58
|
+
* With nothing checked there is no model to narrow it down and the full ladder
|
|
59
|
+
* is offered.
|
|
60
|
+
*
|
|
61
|
+
* @param models - every model in the directory, checked or not.
|
|
62
|
+
*/
|
|
63
|
+
export declare function effortOptions(models: readonly KimiCodeModelOption[]): KimiCodeReasoningEffort[];
|
|
64
|
+
/** Models that reason at every level, and so have no "thinking off". */
|
|
65
|
+
export declare function thinkingOnlyModels(models: readonly KimiCodeModelOption[]): KimiCodeModelOption[];
|
|
66
|
+
//# sourceMappingURL=labels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"labels.d.ts","sourceRoot":"","sources":["../../../../src/client/kimi-code/labels.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EACV,mBAAmB,EACnB,uBAAuB,EACvB,YAAY,EACb,MAAM,qCAAqC,CAAA;AAE5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAEhD;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,YAAY,EAAE,CAAC,EAAE,YAAY,GAAG,MAAM,CAErE;AAED,0CAA0C;AAC1C,wBAAgB,WAAW,CAAC,MAAM,EAAE,uBAAuB,EAAE,CAAC,EAAE,YAAY,GAAG,MAAM,CAQpF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,mBAAmB,GAAG,uBAAuB,EAAE,CAMlF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAEtE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,mBAAmB,EAAE,GAAG,uBAAuB,EAAE,CAO/F;AAED,wEAAwE;AACxE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,mBAAmB,EAAE,GAAG,mBAAmB,EAAE,CAEhG"}
|
|
@@ -46,10 +46,13 @@ export declare const zh: {
|
|
|
46
46
|
readonly wireAnthropic: "Anthropic";
|
|
47
47
|
readonly wireOpenai: "OpenAI";
|
|
48
48
|
readonly capVideo: "视频*";
|
|
49
|
+
readonly capThinkingOnly: "只支持思考";
|
|
50
|
+
readonly capEfforts: "档位 {list}";
|
|
49
51
|
readonly capDynamicTools: "动态工具";
|
|
50
52
|
readonly capImageOnly: "仅图片";
|
|
51
53
|
readonly capNone: "—";
|
|
52
54
|
readonly capVideoFootnote: "* 视频输入需先由 kimi_attach_video 工具挂载(本地绝对路径或 http(s) 链接);直接粘贴的上传路径仍只支持图片。";
|
|
55
|
+
readonly capThinkingOnlyFootnote: "* 「只支持思考」的模型不能关闭思考:请求里带 none 会被服务端拒绝(400),所以它的档位里没有「关闭思考」。";
|
|
53
56
|
readonly capabilitiesTitle: "模型能力";
|
|
54
57
|
readonly capColMedia: "多模态";
|
|
55
58
|
readonly capColTools: "动态工具";
|
|
@@ -60,13 +63,16 @@ export declare const zh: {
|
|
|
60
63
|
readonly speedRegular: "标准";
|
|
61
64
|
readonly speedHighspeed: "高速 (约 6×)";
|
|
62
65
|
readonly quotaCost: "额度倍率";
|
|
66
|
+
readonly quotaUnknown: "未公布";
|
|
63
67
|
readonly minimumPlan: "所需套餐";
|
|
64
68
|
readonly enhanced: "思考设置";
|
|
65
69
|
readonly defaultReasoningEffort: "默认思考档位";
|
|
66
|
-
readonly defaultReasoningEffortHint: "
|
|
70
|
+
readonly defaultReasoningEffortHint: "可用档位跟随勾选的模型自己声明的能力(一个都没勾时按 low / high / max / none 全列);none 表示关闭思考,只对允许关闭的模型有效。切换档位会使上下文缓存失效,建议在同一会话中保持一致。";
|
|
71
|
+
readonly effortThinkingOnlyNote: "勾选的模型里有只支持思考模式的:{models}。它们没有「关闭思考」这一档,请求关闭思考会被服务端拒绝(400),所以这里不提供。";
|
|
72
|
+
readonly effortNotOffered: "当前勾选的模型不接受";
|
|
67
73
|
readonly cacheTtl: "上下文缓存时长";
|
|
68
|
-
readonly cacheTtlHint: "Kimi
|
|
69
|
-
readonly cacheTtlDefault: "
|
|
74
|
+
readonly cacheTtlHint: "Kimi 按前缀自动缓存,这里选择写入档位(只有 5m / 1h 两档)。不传时服务端按 5 分钟档写入。1h 写入单价约为 5m 的两倍,只有当同一前缀会在一小时内被反复读取才划算。档位在首次写入时锁定,之后命中按原 TTL 续期,无法改写。依据回合间隔选:间隔通常短于约 30 分钟选 5 分钟;调度、等子代理这类会出现长空闲的会话选 1 小时。";
|
|
75
|
+
readonly cacheTtlDefault: "不传(服务端按 5 分钟档写入)";
|
|
70
76
|
readonly cacheTtl5m: "5 分钟";
|
|
71
77
|
readonly cacheTtl1h: "1 小时";
|
|
72
78
|
readonly defaultEffortAuto: "使用模型默认值";
|
|
@@ -92,6 +98,11 @@ export declare const zh: {
|
|
|
92
98
|
readonly cacheFresh: "新处理 tokens";
|
|
93
99
|
readonly cacheOutput: "输出 tokens";
|
|
94
100
|
readonly cacheRequests: "请求数";
|
|
101
|
+
readonly cacheWrite: "缓存写入";
|
|
102
|
+
readonly cacheWrite5m: "5 分钟档";
|
|
103
|
+
readonly cacheWrite1h: "1 小时档";
|
|
104
|
+
readonly cacheWriteHint: "写入是独立计费项:1h 写入单价约为 5m 的两倍,命中后会按原 TTL 续期。分档显示 0 表示服务端没有回报该档的写入数(响应头缺失就是静默),不等于该档确实没写入。";
|
|
105
|
+
readonly unknownMetric: "暂无";
|
|
95
106
|
readonly cacheHint: "同一会话内:系统提示与工具列表一旦变化会使缓存整体失效,因此保持工具集合稳定、把新增内容追加在末尾,命中率最高。";
|
|
96
107
|
readonly cacheExpired: "本会话已空闲超过缓存有效期,下一轮将重新处理约 {tokens} 个 token。";
|
|
97
108
|
readonly cacheDrift: "最近前缀状态";
|
|
@@ -201,10 +212,13 @@ export declare const dictionaries: {
|
|
|
201
212
|
readonly wireAnthropic: "Anthropic";
|
|
202
213
|
readonly wireOpenai: "OpenAI";
|
|
203
214
|
readonly capVideo: "视频*";
|
|
215
|
+
readonly capThinkingOnly: "只支持思考";
|
|
216
|
+
readonly capEfforts: "档位 {list}";
|
|
204
217
|
readonly capDynamicTools: "动态工具";
|
|
205
218
|
readonly capImageOnly: "仅图片";
|
|
206
219
|
readonly capNone: "—";
|
|
207
220
|
readonly capVideoFootnote: "* 视频输入需先由 kimi_attach_video 工具挂载(本地绝对路径或 http(s) 链接);直接粘贴的上传路径仍只支持图片。";
|
|
221
|
+
readonly capThinkingOnlyFootnote: "* 「只支持思考」的模型不能关闭思考:请求里带 none 会被服务端拒绝(400),所以它的档位里没有「关闭思考」。";
|
|
208
222
|
readonly capabilitiesTitle: "模型能力";
|
|
209
223
|
readonly capColMedia: "多模态";
|
|
210
224
|
readonly capColTools: "动态工具";
|
|
@@ -215,13 +229,16 @@ export declare const dictionaries: {
|
|
|
215
229
|
readonly speedRegular: "标准";
|
|
216
230
|
readonly speedHighspeed: "高速 (约 6×)";
|
|
217
231
|
readonly quotaCost: "额度倍率";
|
|
232
|
+
readonly quotaUnknown: "未公布";
|
|
218
233
|
readonly minimumPlan: "所需套餐";
|
|
219
234
|
readonly enhanced: "思考设置";
|
|
220
235
|
readonly defaultReasoningEffort: "默认思考档位";
|
|
221
|
-
readonly defaultReasoningEffortHint: "
|
|
236
|
+
readonly defaultReasoningEffortHint: "可用档位跟随勾选的模型自己声明的能力(一个都没勾时按 low / high / max / none 全列);none 表示关闭思考,只对允许关闭的模型有效。切换档位会使上下文缓存失效,建议在同一会话中保持一致。";
|
|
237
|
+
readonly effortThinkingOnlyNote: "勾选的模型里有只支持思考模式的:{models}。它们没有「关闭思考」这一档,请求关闭思考会被服务端拒绝(400),所以这里不提供。";
|
|
238
|
+
readonly effortNotOffered: "当前勾选的模型不接受";
|
|
222
239
|
readonly cacheTtl: "上下文缓存时长";
|
|
223
|
-
readonly cacheTtlHint: "Kimi
|
|
224
|
-
readonly cacheTtlDefault: "
|
|
240
|
+
readonly cacheTtlHint: "Kimi 按前缀自动缓存,这里选择写入档位(只有 5m / 1h 两档)。不传时服务端按 5 分钟档写入。1h 写入单价约为 5m 的两倍,只有当同一前缀会在一小时内被反复读取才划算。档位在首次写入时锁定,之后命中按原 TTL 续期,无法改写。依据回合间隔选:间隔通常短于约 30 分钟选 5 分钟;调度、等子代理这类会出现长空闲的会话选 1 小时。";
|
|
241
|
+
readonly cacheTtlDefault: "不传(服务端按 5 分钟档写入)";
|
|
225
242
|
readonly cacheTtl5m: "5 分钟";
|
|
226
243
|
readonly cacheTtl1h: "1 小时";
|
|
227
244
|
readonly defaultEffortAuto: "使用模型默认值";
|
|
@@ -247,6 +264,11 @@ export declare const dictionaries: {
|
|
|
247
264
|
readonly cacheFresh: "新处理 tokens";
|
|
248
265
|
readonly cacheOutput: "输出 tokens";
|
|
249
266
|
readonly cacheRequests: "请求数";
|
|
267
|
+
readonly cacheWrite: "缓存写入";
|
|
268
|
+
readonly cacheWrite5m: "5 分钟档";
|
|
269
|
+
readonly cacheWrite1h: "1 小时档";
|
|
270
|
+
readonly cacheWriteHint: "写入是独立计费项:1h 写入单价约为 5m 的两倍,命中后会按原 TTL 续期。分档显示 0 表示服务端没有回报该档的写入数(响应头缺失就是静默),不等于该档确实没写入。";
|
|
271
|
+
readonly unknownMetric: "暂无";
|
|
250
272
|
readonly cacheHint: "同一会话内:系统提示与工具列表一旦变化会使缓存整体失效,因此保持工具集合稳定、把新增内容追加在末尾,命中率最高。";
|
|
251
273
|
readonly cacheExpired: "本会话已空闲超过缓存有效期,下一轮将重新处理约 {tokens} 个 token。";
|
|
252
274
|
readonly cacheDrift: "最近前缀状态";
|
|
@@ -354,10 +376,13 @@ export declare const dictionaries: {
|
|
|
354
376
|
readonly wireAnthropic: "Anthropic";
|
|
355
377
|
readonly wireOpenai: "OpenAI";
|
|
356
378
|
readonly capVideo: "视频*";
|
|
379
|
+
readonly capThinkingOnly: "只支持思考";
|
|
380
|
+
readonly capEfforts: "档位 {list}";
|
|
357
381
|
readonly capDynamicTools: "动态工具";
|
|
358
382
|
readonly capImageOnly: "仅图片";
|
|
359
383
|
readonly capNone: "—";
|
|
360
384
|
readonly capVideoFootnote: "* 视频输入需先由 kimi_attach_video 工具挂载(本地绝对路径或 http(s) 链接);直接粘贴的上传路径仍只支持图片。";
|
|
385
|
+
readonly capThinkingOnlyFootnote: "* 「只支持思考」的模型不能关闭思考:请求里带 none 会被服务端拒绝(400),所以它的档位里没有「关闭思考」。";
|
|
361
386
|
readonly capabilitiesTitle: "模型能力";
|
|
362
387
|
readonly capColMedia: "多模态";
|
|
363
388
|
readonly capColTools: "动态工具";
|
|
@@ -368,13 +393,16 @@ export declare const dictionaries: {
|
|
|
368
393
|
readonly speedRegular: "标准";
|
|
369
394
|
readonly speedHighspeed: "高速 (约 6×)";
|
|
370
395
|
readonly quotaCost: "额度倍率";
|
|
396
|
+
readonly quotaUnknown: "未公布";
|
|
371
397
|
readonly minimumPlan: "所需套餐";
|
|
372
398
|
readonly enhanced: "思考设置";
|
|
373
399
|
readonly defaultReasoningEffort: "默认思考档位";
|
|
374
|
-
readonly defaultReasoningEffortHint: "
|
|
400
|
+
readonly defaultReasoningEffortHint: "可用档位跟随勾选的模型自己声明的能力(一个都没勾时按 low / high / max / none 全列);none 表示关闭思考,只对允许关闭的模型有效。切换档位会使上下文缓存失效,建议在同一会话中保持一致。";
|
|
401
|
+
readonly effortThinkingOnlyNote: "勾选的模型里有只支持思考模式的:{models}。它们没有「关闭思考」这一档,请求关闭思考会被服务端拒绝(400),所以这里不提供。";
|
|
402
|
+
readonly effortNotOffered: "当前勾选的模型不接受";
|
|
375
403
|
readonly cacheTtl: "上下文缓存时长";
|
|
376
|
-
readonly cacheTtlHint: "Kimi
|
|
377
|
-
readonly cacheTtlDefault: "
|
|
404
|
+
readonly cacheTtlHint: "Kimi 按前缀自动缓存,这里选择写入档位(只有 5m / 1h 两档)。不传时服务端按 5 分钟档写入。1h 写入单价约为 5m 的两倍,只有当同一前缀会在一小时内被反复读取才划算。档位在首次写入时锁定,之后命中按原 TTL 续期,无法改写。依据回合间隔选:间隔通常短于约 30 分钟选 5 分钟;调度、等子代理这类会出现长空闲的会话选 1 小时。";
|
|
405
|
+
readonly cacheTtlDefault: "不传(服务端按 5 分钟档写入)";
|
|
378
406
|
readonly cacheTtl5m: "5 分钟";
|
|
379
407
|
readonly cacheTtl1h: "1 小时";
|
|
380
408
|
readonly defaultEffortAuto: "使用模型默认值";
|
|
@@ -400,6 +428,11 @@ export declare const dictionaries: {
|
|
|
400
428
|
readonly cacheFresh: "新处理 tokens";
|
|
401
429
|
readonly cacheOutput: "输出 tokens";
|
|
402
430
|
readonly cacheRequests: "请求数";
|
|
431
|
+
readonly cacheWrite: "缓存写入";
|
|
432
|
+
readonly cacheWrite5m: "5 分钟档";
|
|
433
|
+
readonly cacheWrite1h: "1 小时档";
|
|
434
|
+
readonly cacheWriteHint: "写入是独立计费项:1h 写入单价约为 5m 的两倍,命中后会按原 TTL 续期。分档显示 0 表示服务端没有回报该档的写入数(响应头缺失就是静默),不等于该档确实没写入。";
|
|
435
|
+
readonly unknownMetric: "暂无";
|
|
403
436
|
readonly cacheHint: "同一会话内:系统提示与工具列表一旦变化会使缓存整体失效,因此保持工具集合稳定、把新增内容追加在末尾,命中率最高。";
|
|
404
437
|
readonly cacheExpired: "本会话已空闲超过缓存有效期,下一轮将重新处理约 {tokens} 个 token。";
|
|
405
438
|
readonly cacheDrift: "最近前缀状态";
|
|
@@ -460,8 +493,16 @@ export declare const dictionaries: {
|
|
|
460
493
|
readonly quotaFactsScope: string;
|
|
461
494
|
readonly composerLabel: string;
|
|
462
495
|
};
|
|
463
|
-
en: Record<"account" | "rotationStrategy" | "accountId" | "relogin" | "tokens" | "title" | "signedOut" | "signedIn" | "plan" | "expires" | "signIn" | "signInAgain" | "signOut" | "loading" | "connection" | "testConnection" | "selectAll" | "unselectAll" | "modelsHint" | "contextWindowReset" | "contextWindowResetAll" | "contextWindowResetAllConfirm" | "save" | "refreshQuota" | "accountPool" | "addAccount" | "accountCount" | "primaryAccount" | "activeAccount" | "setPrimary" | "deleteAccount" | "cooling" | "cooldownLeft" | "cooldownRemaining" | "cooldownRemainingSeconds" | "clearCooldown" | "needsRelogin" | "strategySequential" | "strategyRoundRobin" | "strategySticky" | "noAccounts" | "email" | "lastUsed" | "accountQuota" | "quotaNone" | "quotaSnapshot" | "quotaResets" | "quotaExhausted" | "quotaWindow" | "quotaUsed" | "quotaFactsScope" | "composerLabel" | "pageDesc" | "signingIn" | "modelsSection" | "enhanced" | "defaultReasoningEffort" | "defaultReasoningEffortHint" | "defaultEffortAuto" | "contextWindowSection" | "contextWindowHint" | "contextWindowNoneEnabled" | "saved" | "saving" | "cacheSection" | "cacheDesc" | "cacheEmpty" | "cacheHitRatio" | "cacheCached" | "cacheFresh" | "cacheRequests" | "cacheDriftTools" | "quotaSection" | "quotaDesc" | "refreshingQuota" | "quotaEmpty" | "updatedAt" | "loginFailed" | "planUnknown" | "cancelSignIn" | "testingConnection" | "testSuccess" | "testFailed" | "routeOwned" | "routeConflict" | "refreshCatalog" | "refreshingCatalog" | "cacheTtl" | "cacheTtlHint" | "cacheTtl1h" | "cacheTtl5m" | "effortLow" | "effortHigh" | "effortMax" | "resetAt" | "copied" | "region" | "quotaPlan" | "authenticatedAt" | "openSignInPage" | "wireAnthropic" | "wireOpenai" | "nickname" | "regionMainland" | "regionGlobal" | "refreshRejected" | "deviceCodeSection" | "deviceCodeHint" | "copyCode" | "userCode" | "codeExpires" | "waitingAuthorization" | "requestingCode" | "oauthHost" | "codingEndpoint" | "capVideo" | "capDynamicTools" | "capImageOnly" | "capNone" | "capVideoFootnote" | "capabilitiesTitle" | "capColMedia" | "capColTools" | "capColNotes" | "capPlan" | "capInputCap" | "capNoTools" | "speedRegular" | "speedHighspeed" | "quotaCost" | "minimumPlan" | "cacheTtlDefault" | "effortNone" | "contextWindowPlan" | "cacheOutput" | "cacheHint" | "cacheExpired" | "cacheDrift" | "cacheDriftFirst" | "cacheDriftStable" | "cacheDriftSystemPrompt" | "cacheDriftCacheKey" | "cacheDriftColdKey" | "preserveThinking" | "preserveOn" | "preserveOff" | "outputCap" | "quotaWallet" | "quotaWalletLimit" | "quotaWalletUsed" | "requests", string>;
|
|
464
|
-
'en-US': Record<"account" | "rotationStrategy" | "accountId" | "relogin" | "tokens" | "title" | "signedOut" | "signedIn" | "plan" | "expires" | "signIn" | "signInAgain" | "signOut" | "loading" | "connection" | "testConnection" | "selectAll" | "unselectAll" | "modelsHint" | "contextWindowReset" | "contextWindowResetAll" | "contextWindowResetAllConfirm" | "save" | "refreshQuota" | "accountPool" | "addAccount" | "accountCount" | "primaryAccount" | "activeAccount" | "setPrimary" | "deleteAccount" | "cooling" | "cooldownLeft" | "cooldownRemaining" | "cooldownRemainingSeconds" | "clearCooldown" | "needsRelogin" | "strategySequential" | "strategyRoundRobin" | "strategySticky" | "noAccounts" | "email" | "lastUsed" | "accountQuota" | "quotaNone" | "quotaSnapshot" | "quotaResets" | "quotaExhausted" | "quotaWindow" | "quotaUsed" | "quotaFactsScope" | "composerLabel" | "pageDesc" | "signingIn" | "modelsSection" | "enhanced" | "defaultReasoningEffort" | "defaultReasoningEffortHint" | "defaultEffortAuto" | "contextWindowSection" | "contextWindowHint" | "contextWindowNoneEnabled" | "saved" | "saving" | "cacheSection" | "cacheDesc" | "cacheEmpty" | "cacheHitRatio" | "cacheCached" | "cacheFresh" | "cacheRequests" | "cacheDriftTools" | "quotaSection" | "quotaDesc" | "refreshingQuota" | "quotaEmpty" | "updatedAt" | "loginFailed" | "planUnknown" | "cancelSignIn" | "testingConnection" | "testSuccess" | "testFailed" | "routeOwned" | "routeConflict" | "refreshCatalog" | "refreshingCatalog" | "cacheTtl" | "cacheTtlHint" | "cacheTtl1h" | "cacheTtl5m" | "effortLow" | "effortHigh" | "effortMax" | "resetAt" | "copied" | "region" | "quotaPlan" | "authenticatedAt" | "openSignInPage" | "wireAnthropic" | "wireOpenai" | "nickname" | "regionMainland" | "regionGlobal" | "refreshRejected" | "deviceCodeSection" | "deviceCodeHint" | "copyCode" | "userCode" | "codeExpires" | "waitingAuthorization" | "requestingCode" | "oauthHost" | "codingEndpoint" | "capVideo" | "capDynamicTools" | "capImageOnly" | "capNone" | "capVideoFootnote" | "capabilitiesTitle" | "capColMedia" | "capColTools" | "capColNotes" | "capPlan" | "capInputCap" | "capNoTools" | "speedRegular" | "speedHighspeed" | "quotaCost" | "minimumPlan" | "cacheTtlDefault" | "effortNone" | "contextWindowPlan" | "cacheOutput" | "cacheHint" | "cacheExpired" | "cacheDrift" | "cacheDriftFirst" | "cacheDriftStable" | "cacheDriftSystemPrompt" | "cacheDriftCacheKey" | "cacheDriftColdKey" | "preserveThinking" | "preserveOn" | "preserveOff" | "outputCap" | "quotaWallet" | "quotaWalletLimit" | "quotaWalletUsed" | "requests", string>;
|
|
496
|
+
en: Record<"account" | "rotationStrategy" | "accountId" | "relogin" | "tokens" | "title" | "signedOut" | "signedIn" | "plan" | "expires" | "signIn" | "signInAgain" | "signOut" | "loading" | "connection" | "testConnection" | "selectAll" | "unselectAll" | "modelsHint" | "contextWindowReset" | "contextWindowResetAll" | "contextWindowResetAllConfirm" | "save" | "refreshQuota" | "accountPool" | "addAccount" | "accountCount" | "primaryAccount" | "activeAccount" | "setPrimary" | "deleteAccount" | "cooling" | "cooldownLeft" | "cooldownRemaining" | "cooldownRemainingSeconds" | "clearCooldown" | "needsRelogin" | "strategySequential" | "strategyRoundRobin" | "strategySticky" | "noAccounts" | "email" | "lastUsed" | "accountQuota" | "quotaNone" | "quotaSnapshot" | "quotaResets" | "quotaExhausted" | "quotaWindow" | "quotaUsed" | "quotaFactsScope" | "composerLabel" | "pageDesc" | "signingIn" | "modelsSection" | "enhanced" | "defaultReasoningEffort" | "defaultReasoningEffortHint" | "defaultEffortAuto" | "contextWindowSection" | "contextWindowHint" | "contextWindowNoneEnabled" | "saved" | "saving" | "cacheSection" | "cacheDesc" | "cacheEmpty" | "cacheHitRatio" | "cacheCached" | "cacheFresh" | "cacheRequests" | "cacheDriftTools" | "quotaSection" | "quotaDesc" | "refreshingQuota" | "quotaEmpty" | "updatedAt" | "loginFailed" | "planUnknown" | "cancelSignIn" | "testingConnection" | "testSuccess" | "testFailed" | "routeOwned" | "routeConflict" | "refreshCatalog" | "refreshingCatalog" | "cacheTtl" | "cacheTtlHint" | "cacheTtl1h" | "cacheTtl5m" | "effortLow" | "effortHigh" | "effortMax" | "quotaUnknown" | "resetAt" | "copied" | "region" | "quotaPlan" | "authenticatedAt" | "openSignInPage" | "wireAnthropic" | "wireOpenai" | "nickname" | "regionMainland" | "regionGlobal" | "refreshRejected" | "deviceCodeSection" | "deviceCodeHint" | "copyCode" | "userCode" | "codeExpires" | "waitingAuthorization" | "requestingCode" | "oauthHost" | "codingEndpoint" | "capVideo" | "capThinkingOnly" | "capEfforts" | "capDynamicTools" | "capImageOnly" | "capNone" | "capVideoFootnote" | "capThinkingOnlyFootnote" | "capabilitiesTitle" | "capColMedia" | "capColTools" | "capColNotes" | "capPlan" | "capInputCap" | "capNoTools" | "speedRegular" | "speedHighspeed" | "quotaCost" | "minimumPlan" | "effortThinkingOnlyNote" | "effortNotOffered" | "cacheTtlDefault" | "effortNone" | "contextWindowPlan" | "cacheOutput" | "cacheWrite" | "cacheWrite5m" | "cacheWrite1h" | "cacheWriteHint" | "unknownMetric" | "cacheHint" | "cacheExpired" | "cacheDrift" | "cacheDriftFirst" | "cacheDriftStable" | "cacheDriftSystemPrompt" | "cacheDriftCacheKey" | "cacheDriftColdKey" | "preserveThinking" | "preserveOn" | "preserveOff" | "outputCap" | "quotaWallet" | "quotaWalletLimit" | "quotaWalletUsed" | "requests", string>;
|
|
497
|
+
'en-US': Record<"account" | "rotationStrategy" | "accountId" | "relogin" | "tokens" | "title" | "signedOut" | "signedIn" | "plan" | "expires" | "signIn" | "signInAgain" | "signOut" | "loading" | "connection" | "testConnection" | "selectAll" | "unselectAll" | "modelsHint" | "contextWindowReset" | "contextWindowResetAll" | "contextWindowResetAllConfirm" | "save" | "refreshQuota" | "accountPool" | "addAccount" | "accountCount" | "primaryAccount" | "activeAccount" | "setPrimary" | "deleteAccount" | "cooling" | "cooldownLeft" | "cooldownRemaining" | "cooldownRemainingSeconds" | "clearCooldown" | "needsRelogin" | "strategySequential" | "strategyRoundRobin" | "strategySticky" | "noAccounts" | "email" | "lastUsed" | "accountQuota" | "quotaNone" | "quotaSnapshot" | "quotaResets" | "quotaExhausted" | "quotaWindow" | "quotaUsed" | "quotaFactsScope" | "composerLabel" | "pageDesc" | "signingIn" | "modelsSection" | "enhanced" | "defaultReasoningEffort" | "defaultReasoningEffortHint" | "defaultEffortAuto" | "contextWindowSection" | "contextWindowHint" | "contextWindowNoneEnabled" | "saved" | "saving" | "cacheSection" | "cacheDesc" | "cacheEmpty" | "cacheHitRatio" | "cacheCached" | "cacheFresh" | "cacheRequests" | "cacheDriftTools" | "quotaSection" | "quotaDesc" | "refreshingQuota" | "quotaEmpty" | "updatedAt" | "loginFailed" | "planUnknown" | "cancelSignIn" | "testingConnection" | "testSuccess" | "testFailed" | "routeOwned" | "routeConflict" | "refreshCatalog" | "refreshingCatalog" | "cacheTtl" | "cacheTtlHint" | "cacheTtl1h" | "cacheTtl5m" | "effortLow" | "effortHigh" | "effortMax" | "quotaUnknown" | "resetAt" | "copied" | "region" | "quotaPlan" | "authenticatedAt" | "openSignInPage" | "wireAnthropic" | "wireOpenai" | "nickname" | "regionMainland" | "regionGlobal" | "refreshRejected" | "deviceCodeSection" | "deviceCodeHint" | "copyCode" | "userCode" | "codeExpires" | "waitingAuthorization" | "requestingCode" | "oauthHost" | "codingEndpoint" | "capVideo" | "capThinkingOnly" | "capEfforts" | "capDynamicTools" | "capImageOnly" | "capNone" | "capVideoFootnote" | "capThinkingOnlyFootnote" | "capabilitiesTitle" | "capColMedia" | "capColTools" | "capColNotes" | "capPlan" | "capInputCap" | "capNoTools" | "speedRegular" | "speedHighspeed" | "quotaCost" | "minimumPlan" | "effortThinkingOnlyNote" | "effortNotOffered" | "cacheTtlDefault" | "effortNone" | "contextWindowPlan" | "cacheOutput" | "cacheWrite" | "cacheWrite5m" | "cacheWrite1h" | "cacheWriteHint" | "unknownMetric" | "cacheHint" | "cacheExpired" | "cacheDrift" | "cacheDriftFirst" | "cacheDriftStable" | "cacheDriftSystemPrompt" | "cacheDriftCacheKey" | "cacheDriftColdKey" | "preserveThinking" | "preserveOn" | "preserveOff" | "outputCap" | "quotaWallet" | "quotaWalletLimit" | "quotaWalletUsed" | "requests", string>;
|
|
465
498
|
};
|
|
466
499
|
export type KimiCodeLocaleKey = keyof typeof zh;
|
|
500
|
+
/**
|
|
501
|
+
* The dictionary shape a card renders from.
|
|
502
|
+
*
|
|
503
|
+
* Kept structural rather than `typeof zh` so a live locale view (whose values
|
|
504
|
+
* are resolved per read) still satisfies it, and so a helper that only needs
|
|
505
|
+
* one key cannot depend on the literal type of every other one.
|
|
506
|
+
*/
|
|
507
|
+
export type KimiCodeDict = Record<KimiCodeLocaleKey, string>;
|
|
467
508
|
//# sourceMappingURL=locales.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../../../src/client/kimi-code/locales.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,kBAAkB,CAAA;AAE3C,eAAO,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../../../src/client/kimi-code/locales.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,kBAAkB,CAAA;AAE3C,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsIL,CAAA;AAEV,eAAO,MAAM,EAAE,EAAE,MAAM,CAAC,MAAM,OAAO,EAAE,EAAE,MAAM,CAqIrC,CAAA;AAEV,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKxB,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,EAAE,CAAA;AAE/C;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kimi-code.d.ts","sourceRoot":"","sources":["../../../../src/client/locales-ru/kimi-code.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAGhE,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"kimi-code.d.ts","sourceRoot":"","sources":["../../../../src/client/locales-ru/kimi-code.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAGhE,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAsIxD,CAAA"}
|