@eddyskywalker/dsh-chatgpt-subscription 0.38.0 → 0.39.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.
Files changed (115) hide show
  1. package/CHANGELOG.md +142 -1
  2. package/README.md +48 -11
  3. package/lib/client.js +805 -151
  4. package/lib/client.js.map +1 -1
  5. package/lib/index.js +2174 -700
  6. package/lib/types/client/CodexSubscriptionSection.d.ts +1 -1
  7. package/lib/types/client/CodexSubscriptionSection.d.ts.map +1 -1
  8. package/lib/types/client/api.d.ts +16 -1
  9. package/lib/types/client/api.d.ts.map +1 -1
  10. package/lib/types/client/cline-pass/ClinePassSection.d.ts.map +1 -1
  11. package/lib/types/client/cline-pass/api.d.ts +16 -1
  12. package/lib/types/client/cline-pass/api.d.ts.map +1 -1
  13. package/lib/types/client/cline-pass/locales.d.ts +144 -18
  14. package/lib/types/client/cline-pass/locales.d.ts.map +1 -1
  15. package/lib/types/client/cline-pass/styles.d.ts.map +1 -1
  16. package/lib/types/client/kimi-code/KimiCodeSection.d.ts.map +1 -1
  17. package/lib/types/client/kimi-code/locales.d.ts +8 -17
  18. package/lib/types/client/kimi-code/locales.d.ts.map +1 -1
  19. package/lib/types/client/locales-ru/cline-pass.d.ts.map +1 -1
  20. package/lib/types/client/locales-ru/hub.d.ts.map +1 -1
  21. package/lib/types/client/locales-ru/kimi-code.d.ts.map +1 -1
  22. package/lib/types/client/locales.d.ts +43 -1
  23. package/lib/types/client/locales.d.ts.map +1 -1
  24. package/lib/types/client/minimax-code/commands-contract.d.ts +14 -4
  25. package/lib/types/client/minimax-code/commands-contract.d.ts.map +1 -1
  26. package/lib/types/client/minimax-code/locales.d.ts +2 -2
  27. package/lib/types/client/progress-updates/settings-binding.d.ts +8 -1
  28. package/lib/types/client/progress-updates/settings-binding.d.ts.map +1 -1
  29. package/lib/types/client/progress-updates/settings-section.d.ts.map +1 -1
  30. package/lib/types/client/styles.d.ts.map +1 -1
  31. package/lib/types/compat.d.ts +33 -0
  32. package/lib/types/compat.d.ts.map +1 -1
  33. package/lib/types/host/agent-preset.d.ts +5 -0
  34. package/lib/types/host/agent-preset.d.ts.map +1 -1
  35. package/lib/types/host/antigravity/account-pool.d.ts.map +1 -1
  36. package/lib/types/host/antigravity/mapper.d.ts +0 -1
  37. package/lib/types/host/antigravity/mapper.d.ts.map +1 -1
  38. package/lib/types/host/antigravity/types.d.ts +1 -2
  39. package/lib/types/host/antigravity/types.d.ts.map +1 -1
  40. package/lib/types/host/claude/mapper.d.ts +5 -7
  41. package/lib/types/host/claude/mapper.d.ts.map +1 -1
  42. package/lib/types/host/claude/model-catalog.d.ts.map +1 -1
  43. package/lib/types/host/cline-pass/adapter.d.ts +1 -1
  44. package/lib/types/host/cline-pass/adapter.d.ts.map +1 -1
  45. package/lib/types/host/cline-pass/client.d.ts +16 -3
  46. package/lib/types/host/cline-pass/client.d.ts.map +1 -1
  47. package/lib/types/host/cline-pass/engine.d.ts +11 -3
  48. package/lib/types/host/cline-pass/engine.d.ts.map +1 -1
  49. package/lib/types/host/cline-pass/line.d.ts +1 -1
  50. package/lib/types/host/cline-pass/line.d.ts.map +1 -1
  51. package/lib/types/host/cline-pass/protocol.d.ts +18 -0
  52. package/lib/types/host/cline-pass/protocol.d.ts.map +1 -1
  53. package/lib/types/host/cline-pass/routes.d.ts +2 -0
  54. package/lib/types/host/cline-pass/routes.d.ts.map +1 -1
  55. package/lib/types/host/cline-pass/store.d.ts +2 -0
  56. package/lib/types/host/cline-pass/store.d.ts.map +1 -1
  57. package/lib/types/host/cline-pass/token-store.d.ts +11 -0
  58. package/lib/types/host/cline-pass/token-store.d.ts.map +1 -1
  59. package/lib/types/host/cline-pass/tools.d.ts.map +1 -1
  60. package/lib/types/host/cline-pass/types.d.ts +24 -2
  61. package/lib/types/host/cline-pass/types.d.ts.map +1 -1
  62. package/lib/types/host/codex-account-pool.d.ts +3 -0
  63. package/lib/types/host/codex-account-pool.d.ts.map +1 -1
  64. package/lib/types/host/common/account-pool.d.ts +59 -5
  65. package/lib/types/host/common/account-pool.d.ts.map +1 -1
  66. package/lib/types/host/common/credential-read-cache.d.ts +11 -1
  67. package/lib/types/host/common/credential-read-cache.d.ts.map +1 -1
  68. package/lib/types/host/common/credentials-compat.d.ts +73 -0
  69. package/lib/types/host/common/credentials-compat.d.ts.map +1 -0
  70. package/lib/types/host/common/pool-storage-settings.d.ts +41 -0
  71. package/lib/types/host/common/pool-storage-settings.d.ts.map +1 -0
  72. package/lib/types/host/common/pool-storage.d.ts +143 -0
  73. package/lib/types/host/common/pool-storage.d.ts.map +1 -0
  74. package/lib/types/host/credential-store-secret-service.d.ts +27 -0
  75. package/lib/types/host/credential-store-secret-service.d.ts.map +1 -1
  76. package/lib/types/host/kimi-code/adapter.d.ts.map +1 -1
  77. package/lib/types/host/kimi-code/cache-hint.d.ts +29 -15
  78. package/lib/types/host/kimi-code/cache-hint.d.ts.map +1 -1
  79. package/lib/types/host/kimi-code/mapper.d.ts +34 -31
  80. package/lib/types/host/kimi-code/mapper.d.ts.map +1 -1
  81. package/lib/types/host/kimi-code/model-catalog.d.ts +32 -0
  82. package/lib/types/host/kimi-code/model-catalog.d.ts.map +1 -1
  83. package/lib/types/host/kimi-code/routes.d.ts.map +1 -1
  84. package/lib/types/host/kimi-code/token-store.d.ts +1 -11
  85. package/lib/types/host/kimi-code/token-store.d.ts.map +1 -1
  86. package/lib/types/host/kimi-code/types.d.ts +38 -14
  87. package/lib/types/host/kimi-code/types.d.ts.map +1 -1
  88. package/lib/types/host/oauth-service.d.ts +83 -1
  89. package/lib/types/host/oauth-service.d.ts.map +1 -1
  90. package/lib/types/host/preset-sync.d.ts +2 -2
  91. package/lib/types/host/preset-sync.d.ts.map +1 -1
  92. package/lib/types/host/qoder/account-pool.d.ts +4 -0
  93. package/lib/types/host/qoder/account-pool.d.ts.map +1 -1
  94. package/lib/types/host/qoder/client.d.ts +24 -2
  95. package/lib/types/host/qoder/client.d.ts.map +1 -1
  96. package/lib/types/host/qoder/oauth.d.ts +17 -0
  97. package/lib/types/host/qoder/oauth.d.ts.map +1 -1
  98. package/lib/types/host/qoder/routes.d.ts.map +1 -1
  99. package/lib/types/host/routes.d.ts +10 -0
  100. package/lib/types/host/routes.d.ts.map +1 -1
  101. package/lib/types/host/subagent-model-authorization.d.ts +20 -5
  102. package/lib/types/host/subagent-model-authorization.d.ts.map +1 -1
  103. package/lib/types/host/token-store-linux.d.ts.map +1 -1
  104. package/lib/types/host/token-store.d.ts +16 -0
  105. package/lib/types/host/token-store.d.ts.map +1 -1
  106. package/lib/types/index.d.ts +26 -1
  107. package/lib/types/index.d.ts.map +1 -1
  108. package/lib/types/shared/cline-pass-contracts.d.ts +48 -2
  109. package/lib/types/shared/cline-pass-contracts.d.ts.map +1 -1
  110. package/lib/types/shared/contracts.d.ts +86 -0
  111. package/lib/types/shared/contracts.d.ts.map +1 -1
  112. package/lib/types/shared/kimi-code-contracts.d.ts +0 -16
  113. package/lib/types/shared/kimi-code-contracts.d.ts.map +1 -1
  114. package/package.json +37 -37
  115. package/presets/dispatch/agent.cordis.yml +25 -11
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Where the account-pool storage choice is remembered between restarts.
3
+ *
4
+ * The profile's `poolStorage` is the deployment's default, and the settings card
5
+ * writes the operator's own answer here instead of rewriting `cordis.yml`: that
6
+ * file is the harness composition, and a card that edited it would be rewriting
7
+ * the deployment to change a preference. The document lives beside the plugin's
8
+ * other storage under the harness home, is written atomically, validated with the
9
+ * same schema machinery as the preferences, and — because it stores `null` until
10
+ * somebody chooses — the profile's value keeps winning until a card actually says
11
+ * otherwise.
12
+ * @module dsh-chatgpt-subscription/pool-storage-settings
13
+ */
14
+ import type { PoolStorageMode } from '../../shared/contracts.ts';
15
+ /** Where the card's choice is kept. */
16
+ export declare function poolStorageSettingsPath(): string;
17
+ /** The choice the settings card writes, and the pools read. */
18
+ export declare class PoolStorageSettings {
19
+ private readonly store;
20
+ constructor(filePath?: string);
21
+ /** Load the document once; a missing or corrupt one counts as "nothing chosen". */
22
+ hydrate(): Promise<void>;
23
+ /** The chosen mode, or `null` while the profile's value stands. */
24
+ chosen(): PoolStorageMode | null;
25
+ /**
26
+ * The mode to use: the card's choice, else the profile's value, else the default.
27
+ *
28
+ * @param configured - `poolStorage` from the profile, when it carries one.
29
+ */
30
+ effective(configured?: PoolStorageMode): PoolStorageMode;
31
+ /**
32
+ * Persist one choice and tell the pools to resolve their backend again.
33
+ *
34
+ * The announcement is part of the write rather than the route's job: a caller
35
+ * that stores a mode without invalidating the caches would leave every pool on
36
+ * the old store until the host restarted, which is the one failure this whole
37
+ * option exists to avoid — reading and writing in different places.
38
+ */
39
+ update(mode: PoolStorageMode): Promise<void>;
40
+ }
41
+ //# sourceMappingURL=pool-storage-settings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pool-storage-settings.d.ts","sourceRoot":"","sources":["../../../../src/host/common/pool-storage-settings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAOH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAEhE,uCAAuC;AACvC,wBAAgB,uBAAuB,IAAI,MAAM,CAEhD;AAYD,+DAA+D;AAC/D,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA2C;gBAErD,QAAQ,SAA4B;IAIhD,mFAAmF;IACnF,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAIxB,mEAAmE;IACnE,MAAM,IAAI,eAAe,GAAG,IAAI;IAIhC;;;;OAIG;IACH,SAAS,CAAC,UAAU,CAAC,EAAE,eAAe,GAAG,eAAe;IAIxD;;;;;;;OAOG;IACG,MAAM,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;CAInD"}
@@ -0,0 +1,143 @@
1
+ import { type CredentialStore } from '../token-store.ts';
2
+ import { type CredentialsRecordSeam } from './credentials-compat.ts';
3
+ import type { PoolStorageBackend, PoolStorageDto, PoolStorageMode } from '../../shared/contracts.ts';
4
+ /** Store a deployment gets when no `poolStorage` is configured anywhere. */
5
+ export declare const DEFAULT_POOL_STORAGE_MODE: PoolStorageMode;
6
+ /**
7
+ * The deployment-wide choice, as the runtime sees it.
8
+ *
9
+ * One plugin instance serves every provider line and one profile carries one
10
+ * `poolStorage`, so the value is read where the lines are built and consulted
11
+ * here. Module state rather than a constructor argument on eleven pools: a
12
+ * parameter would have to be threaded through ten provider constructors (one of
13
+ * which takes no options at all) to describe one deployment-wide decision.
14
+ */
15
+ export interface PoolStorageDefaults {
16
+ /** Where the configured value comes from; read on every resolve. */
17
+ mode?: () => PoolStorageMode;
18
+ /** Awaited before the mode is read, so a choice stored on disk is in place. */
19
+ ready?: () => Promise<void>;
20
+ /**
21
+ * `ctx.credentials`, read on EVERY resolve rather than captured once.
22
+ *
23
+ * A getter because the service is deliberately not in `inject`: nothing orders
24
+ * it before this plugin's `apply`, and a value captured there would send every
25
+ * pool of the process down the "no ctx.credentials service" branch for the rest
26
+ * of the process's life — `poolStorage: 'credentials'` reporting an unusable
27
+ * store on a host that has one.
28
+ */
29
+ credentials?: () => CredentialsRecordSeam | undefined;
30
+ logger?: Pick<Console, 'info' | 'warn'>;
31
+ }
32
+ /** Record the deployment-wide storage choice; call once, before any pool is built. */
33
+ export declare function configurePoolStorage(next: PoolStorageDefaults): void;
34
+ /**
35
+ * Announce that the stored choice changed.
36
+ *
37
+ * Called by the settings route after the new value is on disk; every pool drops
38
+ * the backend it cached and resolves again on its next read.
39
+ */
40
+ export declare function poolStorageChanged(): void;
41
+ /** The revision the current choice stands at. */
42
+ export declare function poolStorageRevision(): number;
43
+ /** The configured mode, without resolving a backend. */
44
+ export declare function poolStorageMode(): PoolStorageMode;
45
+ /** Clear the deployment-wide choice, so one test cannot leak into the next. */
46
+ export declare function resetPoolStorage(): void;
47
+ /** The keyring store as this module needs it: a credential store that can be asked whether it answers. */
48
+ export interface ProbeableKeyringStore<T> extends CredentialStore<T> {
49
+ ping(): Promise<{
50
+ available: boolean;
51
+ reason?: string;
52
+ }>;
53
+ }
54
+ export interface PoolStorageRequest<T> {
55
+ /** Configured choice; defaults to the process-wide {@link configurePoolStorage} value. */
56
+ mode?: PoolStorageMode;
57
+ /** Defaults to `process.platform`; explicit so every branch is testable. */
58
+ platform?: NodeJS.Platform;
59
+ /** Provider label, used only in the error raised on an unsupported platform. */
60
+ displayName: string;
61
+ /** Plain path of the pool document the keyring entry is derived from. */
62
+ poolFile: string;
63
+ /** Keychain / Secret Service service name, as the desktop backends already use it. */
64
+ keychainService: string;
65
+ /** Per-pool keychain account name (the digest of {@link poolFile}). */
66
+ account: string;
67
+ /** Validates and normalizes one whole pool document. */
68
+ parsePoolData: (value: unknown) => T;
69
+ /** `ctx.credentials` when the harness has one; absent otherwise. */
70
+ credentials?: CredentialsRecordSeam;
71
+ logger?: Pick<Console, 'info' | 'warn'>;
72
+ /** Test seam: the Secret Service backend, so a probe result can be supplied. */
73
+ keyring?: ProbeableKeyringStore<T>;
74
+ /**
75
+ * Test seam: the store a Windows or macOS host would use.
76
+ *
77
+ * DPAPI and the Keychain constructors refuse to exist on another platform, so
78
+ * without this the desktop branches could only ever be tested on the desks they
79
+ * belong to — which is how a platform branch ends up untested in CI.
80
+ */
81
+ desktopStore?: CredentialStore<T>;
82
+ }
83
+ export interface PoolStorageResolution<T> {
84
+ store: CredentialStore<T>;
85
+ storage: PoolStorageDto;
86
+ }
87
+ /** Human label of one backend, for the log line and for diagnostics. */
88
+ export declare function poolStorageBackendLabel(backend: PoolStorageBackend): string;
89
+ /** Whether the backend encrypts the document at rest. */
90
+ export declare function poolStorageEncrypted(backend: PoolStorageBackend): boolean;
91
+ /**
92
+ * The pool document as a record in DSH's own credential store.
93
+ *
94
+ * Stored through the seam's record half (see `credentials-compat.ts`): the
95
+ * document is this plugin's own format, and a `grant` payload is exactly the slot
96
+ * the seam keeps for a value only its owner can interpret.
97
+ *
98
+ * Writes are LAST-WRITER-WINS, and honestly so. `modifyRecord` is the seam's only
99
+ * write path and it does hand back the record as it stands under its lock, but a
100
+ * whole pool document is written from one in-memory copy: a second process that
101
+ * saved between this process's read and this write is overwritten. The lock makes
102
+ * the write atomic, not the transaction. This is the same guarantee the keyring
103
+ * backend has always given, and exactly what the `keyring` option gives — one
104
+ * process is the normal case (one `DSH_HOME`, one host), and it is stated here
105
+ * rather than implied away.
106
+ */
107
+ export declare class CredentialsRecordStore<T> implements CredentialStore<T> {
108
+ private readonly seam;
109
+ private readonly key;
110
+ private readonly parse;
111
+ constructor(seam: CredentialsRecordSeam, key: string, parse: (value: unknown) => T);
112
+ /** The `<scope>/<id>` address this pool occupies; a location, never a credential. */
113
+ recordKey(): string;
114
+ load(): Promise<T | null>;
115
+ save(value: T): Promise<void>;
116
+ clear(): Promise<void>;
117
+ }
118
+ /**
119
+ * Resolve the pool store for one line.
120
+ *
121
+ * Async because `credentials` availability is a runtime fact and the configured
122
+ * value may still be loading from disk; callers hold the promise rather than the
123
+ * store (see `AccountPoolCore`).
124
+ */
125
+ export declare function resolvePoolStorage<T>(request: PoolStorageRequest<T>): Promise<PoolStorageResolution<T>>;
126
+ /**
127
+ * The store a caller-supplied backend stands in for, on this platform.
128
+ *
129
+ * `AccountPoolHooks.backend` replaces the STORE, not the choice, and adoption
130
+ * harnesses use it without a `storage` to go with it. Falling back to
131
+ * `{ backend: 'keyring', encrypted: false }` there described a backend that cannot
132
+ * exist (the platform keyring is encrypted on every platform it exists on) and the
133
+ * wrong one on Windows or macOS.
134
+ */
135
+ export declare function poolStorageBackendForPlatform(platform: NodeJS.Platform): PoolStorageBackend;
136
+ /**
137
+ * Human description of where a resolved pool lives, for diagnostics.
138
+ *
139
+ * A location, never a credential: the sentence the pool printed before, now
140
+ * derived from the backend that actually won.
141
+ */
142
+ export declare function describePoolStoragePath(platform: NodeJS.Platform, poolFile: string, storage: PoolStorageDto, keychainService: string, account: string): string;
143
+ //# sourceMappingURL=pool-storage.d.ts.map
@@ -0,0 +1 @@
1
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K,EAAE,OAAO,KAAK,CAAC;IAG/C,qFAAqF;IACrF,SAAS,IAAI,MAAM;IAIb,IAAI,IAAI,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAczB,IAAI,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAa7B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAG7B;AAsCD;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CAAC,CAAC,EAAE,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAkD7G;AAED;;;;;;;;GAQG;AACH,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,GAAG,kBAAkB,CAI3F;AA4BD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,cAAc,EACvB,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,MAAM,GACd,MAAM,CAIR"}
@@ -1,4 +1,10 @@
1
1
  import type { CredentialStore } from './token-store.ts';
2
+ /** The verdict of {@link SecretServiceCredentialStore.ping}: usable, or why not. */
3
+ export interface SecretServiceAvailability {
4
+ available: boolean;
5
+ /** Why the keyring cannot be used, present exactly when `available` is false. */
6
+ reason?: string;
7
+ }
2
8
  /** Secrets travel over stdin/stdout; command arguments contain only lookup attributes. */
3
9
  export declare class SecretServiceCredentialStore<T> implements CredentialStore<T> {
4
10
  private readonly service;
@@ -6,6 +12,16 @@ export declare class SecretServiceCredentialStore<T> implements CredentialStore<
6
12
  private readonly parse;
7
13
  private readonly cache;
8
14
  constructor(service: string, account: string, parse: (value: unknown) => T);
15
+ /**
16
+ * Label the desktop keyring manager shows for this entry.
17
+ *
18
+ * Derived from the entry's own `service` attribute: it used to be a hardcoded
19
+ * 'DSH Antigravity OAuth' for every caller, so the ChatGPT, Claude, Qoder and
20
+ * Minimax pools all appeared in seahorse under Antigravity's name and a user
21
+ * could not tell which secret they were looking at. The label is display-only,
22
+ * so entries stored under the old one keep working.
23
+ */
24
+ private get label();
9
25
  private attributes;
10
26
  /**
11
27
  * Lookup attributes of one shard entry. Secret Service matching is exact on
@@ -13,6 +29,17 @@ export declare class SecretServiceCredentialStore<T> implements CredentialStore<
13
29
  * shard and vice versa.
14
30
  */
15
31
  private shardAttributes;
32
+ /**
33
+ * Whether this host has a usable Secret Service at all.
34
+ *
35
+ * One lookup is the whole question, and its ANSWER is not the point: an entry
36
+ * that is not there exits 1 with empty stderr, which still proves the daemon
37
+ * answered. A host with no `secret-tool`, no session bus, no
38
+ * `org.freedesktop.secrets` or a locked keyring fails instead — by refusing the
39
+ * spawn, or by exiting non-zero with a message. Never throws, because it is
40
+ * asked by a fallback chain whose next step is the answer to "no".
41
+ */
42
+ ping(): Promise<SecretServiceAvailability>;
16
43
  load(): Promise<T | null>;
17
44
  save(value: T): Promise<void>;
18
45
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"credential-store-secret-service.d.ts","sourceRoot":"","sources":["../../../src/host/credential-store-secret-service.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAyEvD,0FAA0F;AAC1F,qBAAa,4BAA4B,CAAC,CAAC,CAAE,YAAW,eAAe,CAAC,CAAC,CAAC;IAMtE,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,KAAK;IAPxB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAErB;gBAGkB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,CAAC;IAG/C,OAAO,CAAC,UAAU;IAIlB;;;;OAIG;IACH,OAAO,CAAC,eAAe;IAIjB,IAAI,IAAI,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAqCzB,IAAI,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBnC;;;;;;OAMG;YACW,WAAW;IA2BzB;;;;OAIG;YACW,cAAc;IAU5B;;;;;OAKG;YACW,WAAW;IAWnB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAmB7B"}
1
+ {"version":3,"file":"credential-store-secret-service.d.ts","sourceRoot":"","sources":["../../../src/host/credential-store-secret-service.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAKvD,oFAAoF;AACpF,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,OAAO,CAAA;IAClB,iFAAiF;IACjF,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAsED,0FAA0F;AAC1F,qBAAa,4BAA4B,CAAC,CAAC,CAAE,YAAW,eAAe,CAAC,CAAC,CAAC;IAMtE,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,KAAK;IAPxB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAErB;gBAGkB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,CAAC;IAG/C;;;;;;;;OAQG;IACH,OAAO,KAAK,KAAK,GAEhB;IAED,OAAO,CAAC,UAAU;IAIlB;;;;OAIG;IACH,OAAO,CAAC,eAAe;IAIvB;;;;;;;;;OASG;IACG,IAAI,IAAI,OAAO,CAAC,yBAAyB,CAAC;IAU1C,IAAI,IAAI,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAqCzB,IAAI,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBnC;;;;;;OAMG;YACW,WAAW;IA2BzB;;;;OAIG;YACW,cAAc;IAU5B;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AAmB,IAAI,SAAS;IAIhC,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB;;;;;IAI/E,OAAO,CAAC,QAAQ;IAIhB;;;OAGG;YACW,OAAO;IA0BrB;;;;;;;;;;;;;;;;;;OAkBG;IACH,OAAO,CAAC,gBAAgB;IAYlB,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;IAkCpG,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;IAsW5B;;;;;;;;;;;;;;;OAeG;YACW,mBAAmB;IA6DjC;;;;;;;;OAQG;YACW,mBAAmB;CASlC;AAyCD,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,WAAW,EAAE,CAAA"}
@@ -3,25 +3,41 @@
3
3
  *
4
4
  * Kimi's cache is automatic and content-hash based, so a client gets no marker
5
5
  * that it is no longer being reused — the only evidence is the read ratio in
6
- * the usage stream. A conversation that sat idle past the cache TTL pays the
7
- * full prompt again on its next turn, and it is large enough on a real
6
+ * the usage stream. A conversation that sat idle past the cache lifetime pays
7
+ * the full prompt again on its next turn, and it is large enough on a real
8
8
  * codebase to be worth a sentence.
9
9
  *
10
- * The trigger mirrors the official client's: idle beyond the tier's lifetime
11
- * AND a context large enough that reprocessing it actually costs something.
12
- * The upstream rules arrive from a remote config that a private deployment
13
- * cannot reach, so the thresholds here are the documented defaults; the
14
- * decision function itself is written to take them, so swapping the source
15
- * later changes only where the numbers come from.
10
+ * The trigger mirrors the official client's: idle beyond the cache lifetime AND
11
+ * a context large enough that reprocessing it actually costs something. The
12
+ * upstream rules arrive from a remote config that a private deployment cannot
13
+ * reach, so the lifetime here is the measured one; the decision function stays
14
+ * a pure function of its inputs so swapping the source later changes only where
15
+ * the number comes from.
16
16
  */
17
- import type { KimiCodeCacheTtl } from '../../shared/kimi-code-contracts.ts';
18
17
  /**
19
- * How long an entry written at each tier survives.
18
+ * How long an entry survives, in milliseconds.
20
19
  *
21
- * The tier is LOCKED when the prefix is first written, so this is the lifetime
22
- * of the entry a request actually created rather than of the tier as a name.
20
+ * MEASURED, not documented. The coding endpoint publishes no cache lifetime and
21
+ * its `5m`/`1h` write tiers cannot be selected from any official client, so the
22
+ * only figure available is the survival curve: 30 minutes, derived from the
23
+ * endpoint's own measured behaviour.
24
+ *
25
+ * The measurement (2026-10-02/03, three replicas per age, one fresh prefix per
26
+ * age so the probe does not renew what it is timing) put Kimi's coding plan at
27
+ * 3/3 warm through 25 minutes, 1/3 at 30 minutes, and 0/3 at 35 minutes — a
28
+ * 25–35 minute bracket around a fuzzy edge.
29
+ *
30
+ * 30 minutes is the first age at which most replicas are already cold, which is
31
+ * what this notice needs: it must not fire while the entry is reliably alive.
32
+ * The alternative — the last fully-warm age of 25 minutes — would warn during
33
+ * the five minutes in which the entry still survives more often than not, and a
34
+ * notice that cries wolf is worse than a late one.
35
+ *
36
+ * The old value was 5 minutes, taken from the `5m` write tier's NAME. On this
37
+ * endpoint the name is not the lifetime: that estimate warned from minute 6
38
+ * onward while the entry was still warm for another 19.
23
39
  */
24
- export declare const CACHE_TTL_MS: Record<KimiCodeCacheTtl, number>;
40
+ export declare const CACHE_TTL_MS: number;
25
41
  /**
26
42
  * Context below which a cold cache is not worth mentioning.
27
43
  *
@@ -54,8 +70,6 @@ export interface CacheHintInput {
54
70
  readonly lastActiveAt?: number;
55
71
  /** Context currently loaded, in tokens. Absent means no local estimate. */
56
72
  readonly totalTokens?: number;
57
- /** Tier the conversation's entries were written at. */
58
- readonly cacheTtl?: KimiCodeCacheTtl | null;
59
73
  }
60
74
  export type CacheHintDecision = {
61
75
  readonly kind: 'skip';
@@ -1 +1 @@
1
- {"version":3,"file":"cache-hint.d.ts","sourceRoot":"","sources":["../../../../src/host/kimi-code/cache-hint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAA;AAE3E;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAGzD,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,SAAU,CAAA;AAiBzC;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,GAAE,MAAmB,GAAG,IAAI,CAS/F;AAED,yEAAyE;AACzE,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAGrF;AAED,2EAA2E;AAC3E,wBAAgB,oBAAoB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAM7D;AAED,MAAM,WAAW,cAAc;IAC7B,8BAA8B;IAC9B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB;;;;;OAKG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAA;IAC9B,2EAA2E;IAC3E,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,uDAAuD;IACvD,QAAQ,CAAC,QAAQ,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAA;CAC5C;AAED,MAAM,MAAM,iBAAiB,GACzB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACzB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,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EAAE,cAAc,GAAG,iBAAiB,CAW1E"}
@@ -32,7 +32,6 @@ import { estimatedInputTokens } from '../common/prompt-estimate.ts';
32
32
  export { estimatedInputTokens, normalizeKimiToolSchema };
33
33
  import { MAX_MESSAGE_BODY_BYTES, MAX_REQUEST_IMAGE_BYTES, MAX_REQUEST_VIDEO_BYTES, MAX_VIDEO_MESSAGE_BODY_BYTES, NO_RESOLVED_IMAGES, REQUEST_IMAGE_MAX_EDGE, offloadOldestRequestImages, requestImageTarget, resolveRequestImages, type AttachmentImageReader, type ResolvedRequestImage, type ResolvedRequestImages } from '../common/request-images.ts';
34
34
  export { MAX_MESSAGE_BODY_BYTES, MAX_REQUEST_IMAGE_BYTES, MAX_REQUEST_VIDEO_BYTES, MAX_VIDEO_MESSAGE_BODY_BYTES, NO_RESOLVED_IMAGES, REQUEST_IMAGE_MAX_EDGE, offloadOldestRequestImages, requestImageTarget, resolveRequestImages, type AttachmentImageReader, type ResolvedRequestImage, type ResolvedRequestImages, };
35
- import { type KimiCacheTtl } from './types.ts';
36
35
  import { offloadOldestRequestVideos as offloadVideosWithinBudget, requestHasVideo, resolveRequestVideos, type AttachmentVideoReader, type ResolvedRequestVideos } from '../common/video-request.ts';
37
36
  export { offloadVideosWithinBudget as offloadOldestRequestVideos, requestHasVideo, resolveRequestVideos, type AttachmentVideoReader, type ResolvedRequestVideos, };
38
37
  import type { KimiCodeReasoningEffort, KimiCodeWire } from '../../shared/kimi-code-contracts.ts';
@@ -151,6 +150,12 @@ export declare function mapReasoningEffort(effort: string | undefined | null): K
151
150
  * derived from the same three levels the OpenAI surface uses.
152
151
  */
153
152
  export declare function thinkingBudgetFor(effort: KimiCodeReasoningEffort | undefined, maxTokens: number): number | undefined;
153
+ /**
154
+ * Media a single request build may carry.
155
+ *
156
+ * Passed as one object so adding a media kind never grows a positional
157
+ * signature the existing callers already bind.
158
+ */
154
159
  export interface RequestMediaOptions {
155
160
  /** Videos read for this request; absent means none are readable. */
156
161
  videos?: ResolvedRequestVideos;
@@ -161,17 +166,6 @@ export interface RequestMediaOptions {
161
166
  * (`messages[].tools`), Kimi's `dynamically_loaded_tools` capability.
162
167
  */
163
168
  messageTools?: boolean;
164
- /**
165
- * Prompt-cache tier to request, or `null` to leave the service default.
166
- *
167
- * Kimi documents two separate fields for this and they are NOT interchangeable:
168
- * the OpenAI-compatible wire takes `prompt_cache_options`, and the
169
- * Anthropic wire takes a TOP-LEVEL `cache_control` (a marker inside a message
170
- * is explicitly ignored by the service). `null` sends neither, which is what
171
- * this line did before and remains the safe default: a caller that states
172
- * nothing gets the service's own 5m behaviour.
173
- */
174
- cacheTtl?: KimiCacheTtl | null;
175
169
  }
176
170
  /**
177
171
  * One complete tool definition, in the shape the function-calling wire wants.
@@ -252,7 +246,22 @@ export declare function buildAnthropicRequest(options: GenerateOptions, images?:
252
246
  /** Build the body for whichever endpoint serves `wire`. */
253
247
  export declare function buildRequest(options: GenerateOptions, wire: KimiCodeWire, images?: ResolvedRequestImages, preserveThinking?: boolean, media?: RequestMediaOptions): Record<string, unknown>;
254
248
  /**
255
- * Reject a request the service would answer with its 2 MB body 400.
249
+ * What the body-fit loop actually did, so the remedy can describe it.
250
+ *
251
+ * Optional by design: a caller that has not run the loop leaves it undefined and
252
+ * gets the composition-based message, so every direct assertion of this guard
253
+ * keeps its exact text.
254
+ */
255
+ export interface BodyFitContext {
256
+ /** How many image occurrences the loop already replaced with a placeholder. */
257
+ readonly droppedImages: number;
258
+ /** How many sendable image occurrences the body still carries. */
259
+ readonly sendableImagesRemaining: number;
260
+ /** The overflow that remained after the last drop. */
261
+ readonly excessBytes: number;
262
+ }
263
+ /**
264
+ * Reject a request the service would refuse for its size.
256
265
  *
257
266
  * This is the most frequently reported 400 on the coding endpoint, and it is
258
267
  * worth catching locally for two reasons: the message can name the actual
@@ -260,6 +269,10 @@ export declare function buildRequest(options: GenerateOptions, wire: KimiCodeWir
260
269
  * sent at all. The measured size is the real serialized body, so it accounts
261
270
  * for tool schemas and inlined images the caller cannot easily estimate.
262
271
  *
272
+ * The ceiling is the caller's when it passes one, because the text/image tier is
273
+ * graded by model and only the caller knows which model the turn is for; omitted,
274
+ * the guard resolves the model-less default (or the video tier) itself.
275
+ *
263
276
  * The error code is CONTEXT_OVERFLOW_CODE, not PROVIDER_ERROR, because naming the
264
277
  * remedy in prose is not the same as being able to act on it: DSH forces a
265
278
  * compaction and retries the same step only for that one code, and every other
@@ -268,30 +281,20 @@ export declare function buildRequest(options: GenerateOptions, wire: KimiCodeWir
268
281
  * body of the message stays as specific as it was while the code becomes one the
269
282
  * host can recover from.
270
283
  *
284
+ * @param body the request body about to be serialized and sent.
285
+ * @param carriesVideo whether the request attaches video, which has its own tier.
286
+ * @param context what the body-fit loop already did, when it ran.
287
+ * @param limit the ceiling already resolved for this request's model.
271
288
  * @returns the serialized body, so a caller that is about to send it does not
272
289
  * serialize a body of up to tens of megabytes a second time.
273
290
  */
274
- /**
275
- * What the body-fit loop actually did, so the remedy can describe it.
276
- *
277
- * Optional by design: a caller that has not run the loop leaves it undefined and
278
- * gets the composition-based message, so every direct assertion of this guard
279
- * keeps its exact text.
280
- */
281
- export interface BodyFitContext {
282
- /** How many image occurrences the loop already replaced with a placeholder. */
283
- readonly droppedImages: number;
284
- /** How many sendable image occurrences the body still carries. */
285
- readonly sendableImagesRemaining: number;
286
- /** The overflow that remained after the last drop. */
287
- readonly excessBytes: number;
288
- }
289
- export declare function assertRequestBodyFits(body: Record<string, unknown>, carriesVideo?: boolean, context?: BodyFitContext): string;
291
+ export declare function assertRequestBodyFits(body: Record<string, unknown>, carriesVideo?: boolean, context?: BodyFitContext, limit?: number): string;
290
292
  /**
291
293
  * How a request body splits into the parts that share the ceiling.
292
294
  *
293
- * The 2 MB limit covers images, conversation text, tool schemas and the system
294
- * prompt together, but only the first is compressible by dropping something. A
295
+ * The body ceiling — 2 MB on the 256K tier, larger on the 1M tier — covers
296
+ * images, conversation text, tool schemas and the system prompt together, but
297
+ * only the first is compressible by dropping something. A
295
298
  * message that names which part dominates is the difference between a user who
296
299
  * compacts the conversation and a user who deletes images and fails again.
297
300
  */
@@ -1 +1 @@
1
- {"version":3,"file":"mapper.d.ts","sourceRoot":"","sources":["../../../../src/host/kimi-code/mapper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EAGL,KAAK,oBAAoB,EAEzB,KAAK,eAAe,EACpB,KAAK,OAAO,EACZ,KAAK,WAAW,EAEjB,MAAM,yBAAyB,CAAA;AAKhC,OAAO,EAAE,uBAAuB,EAAmB,MAAM,0BAA0B,CAAA;AACnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AAEnE,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,CAAA;AACxD,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,4BAA4B,EAC5B,kBAAkB,EAClB,sBAAsB,EAItB,0BAA0B,EAC1B,kBAAkB,EAClB,oBAAoB,EAEpB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC3B,MAAM,6BAA6B,CAAA;AAGpC,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,4BAA4B,EAC5B,kBAAkB,EAClB,sBAAsB,EACtB,0BAA0B,EAC1B,kBAAkB,EAClB,oBAAoB,EACpB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,GAC3B,CAAA;AACD,OAAO,EAA2C,KAAK,YAAY,EAAE,MAAM,YAAY,CAAA;AAIvF,OAAO,EACL,0BAA0B,IAAI,yBAAyB,EACvD,eAAe,EACf,oBAAoB,EAEpB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC3B,MAAM,4BAA4B,CAAA;AAInC,OAAO,EACL,yBAAyB,IAAI,0BAA0B,EACvD,eAAe,EACf,oBAAoB,EACpB,KAAK,qBAAqB,EAC1B,KAAK,qBAA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,CAIvF;AAED;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC,oCAAoC;IACpC,QAAQ,EAAE,MAAM,CAAA;IAChB,iDAAiD;IACjD,YAAY,EAAE,MAAM,CAAA;IACpB,oDAAoD;IACpD,WAAW,EAAE,MAAM,CAAA;IACnB,wDAAwD;IACxD,YAAY,EAAE,MAAM,CAAA;IACpB;;;;;;;OAOG;IACH,gBAAgB,EAAE,MAAM,CAAA;IACxB,iFAAiF;IACjF,kBAAkB,EAAE,MAAM,CAAA;IAC1B,iFAAiF;IACjF,kBAAkB,EAAE,MAAM,CAAA;CAC3B;AAqBD,gEAAgE;AAChE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,mBAAmB,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAazG;AAaD;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAC3B,SAAS,CAAC,EAAE,MAAM,EAClB,SAAS,CAAC,EAAE,MAAM,GACjB,kBAAkB,GAAG;IAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAmBlD;AASD,oFAAoF;AACpF,wBAAgB,eAAe,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAYxD;AAmBD,uEAAuE;AACvE,wBAAgB,WAAW,CAAC,KAAK,EAAE,mBAAmB,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,WAAW,EAAE,CAWzF;AAED,kEAAkE;AAClE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI,CAUrE"}
@@ -7,6 +7,28 @@
7
7
  * a request body, or the service answers 401 "Your model id does not exist".
8
8
  */
9
9
  import type { KimiCodeReasoningEffort, KimiCodeThinkingType } from '../../shared/kimi-code-contracts.ts';
10
+ /**
11
+ * Request-body ceiling the 1M-context tier defaults to.
12
+ *
13
+ * The 2 MB figure this line used to apply to every model comes from the gateway's
14
+ * generic error example and was never measured against a 1M window, while a real
15
+ * 1M session (3-4 MB of Chinese prose) hits it long before the window is full.
16
+ * The official kimi-cli ships no byte guard at all, so the ceiling is this
17
+ * plugin's own safety net rather than a client requirement.
18
+ *
19
+ * 8 MiB is sized so bytes never become the binding limit for a 1M session: that
20
+ * window's body is roughly 4 MB of English or 4.5 MB of dense Chinese, so 8 MiB
21
+ * leaves nearly double the headroom. What binds first is the model's own token
22
+ * window — the service answers "Your request exceeded model token limit", which
23
+ * common/context-overflow.ts already normalizes to CONTEXT_WINDOW_EXCEEDED, so
24
+ * compaction and retry behave exactly as they did before.
25
+ *
26
+ * The number is still an UPPER BOUND pending measurement, not a documented
27
+ * gateway limit: a deployment that has measured its own gateway pins the real
28
+ * figure with DSH_KIMI_CODE_MAX_BODY_BYTES. The 256K tier keeps 2 MB, where the
29
+ * old ceiling and the window line up.
30
+ */
31
+ export declare const LONG_CONTEXT_MESSAGE_BODY_BYTES: number;
10
32
  /** One model the Kimi Code endpoint serves to subscription accounts. */
11
33
  export interface KimiCodeCatalogModel {
12
34
  /** Exact model id to put on the wire. */
@@ -29,6 +51,16 @@ export interface KimiCodeCatalogModel {
29
51
  maxContextWindow: number | null;
30
52
  /** Floor for the dynamic wire budget, NOT a ceiling or DSH defaultMaxTokens. */
31
53
  maxTokens: number;
54
+ /**
55
+ * Local default for the gateway request-body ceiling, graded by context tier.
56
+ *
57
+ * This is the per-model default {@link maxRequestBodyBytesFor} returns when no
58
+ * environment override is set. It is NOT a documented gateway limit: the 1M
59
+ * tier's 8 MiB is a still-unmeasured upper bound (see
60
+ * {@link LONG_CONTEXT_MESSAGE_BODY_BYTES}), and the 256K tier keeps the 2 MiB
61
+ * figure this line applied to every model before the split.
62
+ */
63
+ maxRequestBodyBytes: number;
32
64
  /** Input the model accepts; DSH only maps the text and image entries. */
33
65
  inputModalities: readonly ('text' | 'image' | 'video')[];
34
66
  /** Thinking levels the model accepts, in escalating order. */
@@ -1 +1 @@
1
- {"version":3,"file":"model-catalog.d.ts","sourceRoot":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eReasoningEffort, KimiCodeRegion, KimiCodeThinkingType } from '../../shared/kimi-code-contracts.ts';
2
2
  import type { CredentialStore } from '../token-store.ts';
3
3
  import { type ContextWindowOverridePatch } from '../common/context-window-overrides.ts';
4
- import { DEFAULT_OAUTH_HOST, type KimiCacheTtl } from './types.ts';
4
+ import { DEFAULT_OAUTH_HOST } from './types.ts';
5
5
  export declare const KIMI_CODE_PREFERENCES_NAMESPACE = "dsh-kimi-code";
6
6
  export type { KimiCodeReasoningEffort };
7
7
  /**
@@ -95,12 +95,6 @@ export interface KimiCodeModelSettings {
95
95
  catalogModels: KimiCodeCatalogModel[];
96
96
  contextWindowOverrides: Record<string, number>;
97
97
  defaultReasoningEffort: KimiCodeReasoningEffort | null;
98
- /**
99
- * Prompt-cache tier this line asks for. `null` sends no cache field at all,
100
- * which leaves the service on its own default behaviour — the request this
101
- * line sent before the setting existed, byte for byte.
102
- */
103
- cacheTtl: KimiCacheTtl | null;
104
98
  }
105
99
  export interface KimiCodePreferenceStore {
106
100
  status(): KimiCodeModelSettings;
@@ -110,8 +104,6 @@ export interface KimiCodePreferenceStore {
110
104
  /** `null` deletes one override and falls back to the catalog default. */
111
105
  contextWindowOverrides?: ContextWindowOverridePatch;
112
106
  defaultReasoningEffort?: KimiCodeReasoningEffort | null;
113
- /** `null` clears the tier, returning to "send no cache field". */
114
- cacheTtl?: KimiCacheTtl | null;
115
107
  }): Promise<KimiCodeModelSettings>;
116
108
  }
117
109
  /**
@@ -158,8 +150,6 @@ export declare class FileModelSettingsStore {
158
150
  /** `null` deletes one override and falls back to the catalog default. */
159
151
  contextWindowOverrides?: ContextWindowOverridePatch;
160
152
  defaultReasoningEffort?: KimiCodeReasoningEffort | null;
161
- /** `null` clears the tier, returning to "send no cache field". */
162
- cacheTtl?: KimiCacheTtl | null;
163
153
  }): Promise<KimiCodeModelSettings>;
164
154
  setCatalogModels(catalogModels: KimiCodeCatalogModel[], options?: {
165
155
  enabledModelIds?: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"token-store.d.ts","sourceRoot":"","sources":["../../../../src/host/kimi-code/token-store.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,uBAAuB,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAA;AAExH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAExD,OAAO,EAA+B,KAAK,0BAA0B,EAAE,MAAM,uCAAuC,CAAA;AAKpH,OAAO,EACL,kBAAkB,EAOlB,KAAK,YAAY,EAClB,MAAM,YAAY,CAAA;AAEnB,eAAO,MAAM,+BAA+B,kBAAkB,CAAA;AAE9D,YAAY,EAAE,uBAAuB,EAAE,CAAA;AAOvC;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAmB;IAClC,kFAAkF;IAClF,WAAW,EAAE,MAAM,CAAA;IACnB,yCAAyC;IACzC,YAAY,EAAE,MAAM,CAAA;IACpB,4DAA4D;IAC5D,SAAS,EAAE,MAAM,CAAA;IACjB,wDAAwD;IACxD,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,yEAAyE;IACzE,MAAM,EAAE,cAAc,CAAA;IACtB,8EAA8E;IAC9E,SAAS,EAAE,MAAM,CAAA;IACjB,sEAAsE;IACtE,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,qDAAqD;IACrD,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB;AAED,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAA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