@eddyskywalker/dsh-chatgpt-subscription 0.48.3 → 0.49.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 +21 -0
- package/lib/client.js +2381 -179
- package/lib/client.js.map +1 -1
- package/lib/index.js +875 -33
- package/lib/types/client/index.d.ts +2 -0
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/kimi-code/KimiCodeSection.d.ts.map +1 -1
- package/lib/types/client/kimi-code/locales.d.ts +14 -2
- 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/client/subagent/SubagentCard.d.ts +35 -0
- package/lib/types/client/subagent/SubagentCard.d.ts.map +1 -0
- package/lib/types/client/subagent/index.d.ts +28 -0
- package/lib/types/client/subagent/index.d.ts.map +1 -0
- package/lib/types/client/subagent/locales.d.ts +172 -0
- package/lib/types/client/subagent/locales.d.ts.map +1 -0
- package/lib/types/client/subagent/styles.d.ts +20 -0
- package/lib/types/client/subagent/styles.d.ts.map +1 -0
- package/lib/types/client/subagent/subagent-card-controller.d.ts +329 -0
- package/lib/types/client/subagent/subagent-card-controller.d.ts.map +1 -0
- package/lib/types/compat.d.ts +1 -1
- package/lib/types/host/common/llm-compat.d.ts +3 -1
- package/lib/types/host/common/llm-compat.d.ts.map +1 -1
- package/lib/types/host/common/request-images.d.ts +66 -0
- package/lib/types/host/common/request-images.d.ts.map +1 -1
- package/lib/types/host/kimi-code/adapter.d.ts.map +1 -1
- package/lib/types/host/kimi-code/mapper.d.ts +53 -3
- package/lib/types/host/kimi-code/mapper.d.ts.map +1 -1
- package/lib/types/host/kimi-code/routes.d.ts.map +1 -1
- package/lib/types/host/kimi-code/session-cache-state.d.ts +14 -0
- package/lib/types/host/kimi-code/session-cache-state.d.ts.map +1 -1
- package/lib/types/host/kimi-code/types.d.ts +29 -4
- package/lib/types/host/kimi-code/types.d.ts.map +1 -1
- package/lib/types/host/preferences.d.ts.map +1 -1
- package/lib/types/host/routes.d.ts.map +1 -1
- package/lib/types/host/subagent-model-authorization.d.ts +130 -2
- package/lib/types/host/subagent-model-authorization.d.ts.map +1 -1
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/shared/contracts.d.ts +28 -0
- package/lib/types/shared/contracts.d.ts.map +1 -1
- package/lib/types/shared/kimi-code-contracts.d.ts +10 -1
- package/lib/types/shared/kimi-code-contracts.d.ts.map +1 -1
- package/lib/types/shared/preferences.d.ts +52 -1
- package/lib/types/shared/preferences.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CodexOutputVerbosity, CodexReasoningSummary, ProxyMode, SearchProviderPreference, SubscriptionPreferencesDto } from './contracts.ts';
|
|
1
|
+
import type { CodexOutputVerbosity, CodexReasoningSummary, ProxyMode, SearchProviderPreference, SubagentModelRouteDto, SubagentModelsByMainModelDto, SubscriptionPreferencesDto } from './contracts.ts';
|
|
2
2
|
export declare const PREFERENCES_NAMESPACE = "dsh-chatgpt-subscription";
|
|
3
3
|
export declare const DEFAULT_PREFERENCES: Omit<SubscriptionPreferencesDto, 'writable'>;
|
|
4
4
|
export declare const SEARCH_PROVIDER_DSH: SearchProviderPreference;
|
|
@@ -7,6 +7,57 @@ export declare function isSearchProviderPreference(value: unknown): value is Sea
|
|
|
7
7
|
export declare function isCodexOutputVerbosity(value: unknown): value is CodexOutputVerbosity;
|
|
8
8
|
export declare function isCodexReasoningSummary(value: unknown): value is CodexReasoningSummary;
|
|
9
9
|
export declare function isProxyMode(value: unknown): value is ProxyMode;
|
|
10
|
+
/**
|
|
11
|
+
* Whether one value is a complete `{ provider, model }` route.
|
|
12
|
+
*
|
|
13
|
+
* Both halves are trimmed and must be non-empty: a route with a blank provider
|
|
14
|
+
* names no adapter, and a blank model names no model, so neither can ever be
|
|
15
|
+
* authorized. Stored documents are untrusted JSON, which is why this narrows
|
|
16
|
+
* rather than asserts.
|
|
17
|
+
* @param value - Candidate route.
|
|
18
|
+
* @returns whether the value is a usable route.
|
|
19
|
+
*/
|
|
20
|
+
export declare function isSubagentModelRoute(value: unknown): value is SubagentModelRouteDto;
|
|
21
|
+
/**
|
|
22
|
+
* Normalize one route list, deduplicating it without reordering.
|
|
23
|
+
*
|
|
24
|
+
* Order is preserved because it is the order the settings card shows and the
|
|
25
|
+
* order `list_subagent_models` prints: a set would silently reshuffle the list
|
|
26
|
+
* a user arranged.
|
|
27
|
+
* @param value - Candidate route list from stored JSON.
|
|
28
|
+
* @returns the trimmed, deduplicated routes, or null when the value is not an
|
|
29
|
+
* array of well-formed routes.
|
|
30
|
+
*/
|
|
31
|
+
export declare function normalizeSubagentModelRoutes(value: unknown): SubagentModelRouteDto[] | null;
|
|
32
|
+
/**
|
|
33
|
+
* Whether one key names a main agent route as `provider/model`.
|
|
34
|
+
*
|
|
35
|
+
* The split is at the FIRST slash, so a model id that legally contains a slash
|
|
36
|
+
* (`command-code` + `deepseek/deepseek-v4.1-flash`) still round-trips: the
|
|
37
|
+
* provider half ends at the first separator and the model half keeps the rest.
|
|
38
|
+
* @param key - Candidate map key.
|
|
39
|
+
* @returns whether the key carries a non-empty provider and a non-empty model.
|
|
40
|
+
*/
|
|
41
|
+
export declare function isValidMainModelKey(key: string): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Merge one `subagentModelsByMainModel` patch into the stored map.
|
|
44
|
+
*
|
|
45
|
+
* A merge rather than a replace, so the card can clear or set one main model
|
|
46
|
+
* without resending every other entry — and `null` (or `[]`) is how one entry
|
|
47
|
+
* is cleared, since a stored map has no other way to say "no override".
|
|
48
|
+
* @param current - Map already stored in the preferences document.
|
|
49
|
+
* @param patch - Incoming patch from a settings card or a route body.
|
|
50
|
+
* @returns the merged map, or null when any key or value is malformed.
|
|
51
|
+
*/
|
|
52
|
+
export declare function mergeSubagentModelsByMainModel(current: SubagentModelsByMainModelDto | undefined, patch: unknown): SubagentModelsByMainModelDto | null;
|
|
53
|
+
/**
|
|
54
|
+
* Read one main model's routes out of a stored map.
|
|
55
|
+
* @param byMainModel - Stored map, when the document carries one.
|
|
56
|
+
* @param provider - Main agent provider id.
|
|
57
|
+
* @param model - Main agent model id.
|
|
58
|
+
* @returns that main model's authorized routes, or undefined when it has none.
|
|
59
|
+
*/
|
|
60
|
+
export declare function subagentModelsForMainModel(byMainModel: SubagentModelsByMainModelDto | undefined, provider: string | undefined, model: string | undefined): SubagentModelRouteDto[] | undefined;
|
|
10
61
|
/** Re-exported so the host parsers share one definition with the DTO. */
|
|
11
62
|
export { isCompactionRouteTarget } from './compaction-route.ts';
|
|
12
63
|
//# sourceMappingURL=preferences.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preferences.d.ts","sourceRoot":"","sources":["../../../src/shared/preferences.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"preferences.d.ts","sourceRoot":"","sources":["../../../src/shared/preferences.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,oBAAoB,EACpB,qBAAqB,EACrB,SAAS,EACT,wBAAwB,EACxB,qBAAqB,EACrB,4BAA4B,EAC5B,0BAA0B,EAC3B,MAAM,gBAAgB,CAAA;AAEvB,eAAO,MAAM,qBAAqB,6BAA6B,CAAA;AAE/D,eAAO,MAAM,mBAAmB,EAAE,IAAI,CAAC,0BAA0B,EAAE,UAAU,CAoB5E,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,wBAAgC,CAAA;AAClE,eAAO,MAAM,qBAAqB,EAAE,wBAAkC,CAAA;AAEtE,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,wBAAwB,CAE5F;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,oBAAoB,CAEpF;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,qBAAqB,CA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