@eddyskywalker/dsh-chatgpt-subscription 0.76.1 → 0.78.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 (72) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +9 -7
  3. package/lib/client.js +1404 -512
  4. package/lib/client.js.map +1 -1
  5. package/lib/index.js +3829 -2190
  6. package/lib/tool-result-pruner.js +5 -1
  7. package/lib/types/client/hub/brand-icons.d.ts +1 -1
  8. package/lib/types/client/hub/brand-icons.d.ts.map +1 -1
  9. package/lib/types/client/hub/providers.d.ts.map +1 -1
  10. package/lib/types/client/index.d.ts +2 -0
  11. package/lib/types/client/index.d.ts.map +1 -1
  12. package/lib/types/client/kimi-code/locales.d.ts +2 -2
  13. package/lib/types/client/locales-ru/hub.d.ts.map +1 -1
  14. package/lib/types/client/locales-ru/index.d.ts.map +1 -1
  15. package/lib/types/client/locales-ru/qianwen-token-plan.d.ts +3 -0
  16. package/lib/types/client/locales-ru/qianwen-token-plan.d.ts.map +1 -0
  17. package/lib/types/client/locales.d.ts +3 -1
  18. package/lib/types/client/locales.d.ts.map +1 -1
  19. package/lib/types/client/qianwen-token-plan/QianwenComposerQuota.d.ts +14 -0
  20. package/lib/types/client/qianwen-token-plan/QianwenComposerQuota.d.ts.map +1 -0
  21. package/lib/types/client/qianwen-token-plan/QianwenTokenPlanSection.d.ts +4 -0
  22. package/lib/types/client/qianwen-token-plan/QianwenTokenPlanSection.d.ts.map +1 -0
  23. package/lib/types/client/qianwen-token-plan/api.d.ts +5 -0
  24. package/lib/types/client/qianwen-token-plan/api.d.ts.map +1 -0
  25. package/lib/types/client/qianwen-token-plan/locales.d.ts +158 -0
  26. package/lib/types/client/qianwen-token-plan/locales.d.ts.map +1 -0
  27. package/lib/types/client/qianwen-token-plan/styles.d.ts +3 -0
  28. package/lib/types/client/qianwen-token-plan/styles.d.ts.map +1 -0
  29. package/lib/types/client/qianwen-token-plan/useQianwenSection.d.ts +32 -0
  30. package/lib/types/client/qianwen-token-plan/useQianwenSection.d.ts.map +1 -0
  31. package/lib/types/compat.d.ts +1 -1
  32. package/lib/types/entry-tool-result-pruner.d.ts.map +1 -1
  33. package/lib/types/host/cache-warmup/budget.d.ts.map +1 -1
  34. package/lib/types/host/cache-warmup/contracts.d.ts +4 -0
  35. package/lib/types/host/cache-warmup/contracts.d.ts.map +1 -1
  36. package/lib/types/host/cache-warmup/usage.d.ts.map +1 -1
  37. package/lib/types/host/common/i18n/en.d.ts.map +1 -1
  38. package/lib/types/host/common/i18n/ru.d.ts.map +1 -1
  39. package/lib/types/host/common/i18n/zh.d.ts +4 -0
  40. package/lib/types/host/common/i18n/zh.d.ts.map +1 -1
  41. package/lib/types/host/common/model-request-control.d.ts +1 -1
  42. package/lib/types/host/common/model-request-control.d.ts.map +1 -1
  43. package/lib/types/host/common/prompt-cache-policy.d.ts.map +1 -1
  44. package/lib/types/host/common/request-diagnostics.d.ts +1 -1
  45. package/lib/types/host/common/request-diagnostics.d.ts.map +1 -1
  46. package/lib/types/host/ptc-sdk-cache-guard.d.ts.map +1 -1
  47. package/lib/types/host/qianwen-token-plan/adapter.d.ts +39 -0
  48. package/lib/types/host/qianwen-token-plan/adapter.d.ts.map +1 -0
  49. package/lib/types/host/qianwen-token-plan/cache-stats.d.ts +17 -0
  50. package/lib/types/host/qianwen-token-plan/cache-stats.d.ts.map +1 -0
  51. package/lib/types/host/qianwen-token-plan/client.d.ts +5 -0
  52. package/lib/types/host/qianwen-token-plan/client.d.ts.map +1 -0
  53. package/lib/types/host/qianwen-token-plan/mapper.d.ts +71 -0
  54. package/lib/types/host/qianwen-token-plan/mapper.d.ts.map +1 -0
  55. package/lib/types/host/qianwen-token-plan/model-catalog.d.ts +28 -0
  56. package/lib/types/host/qianwen-token-plan/model-catalog.d.ts.map +1 -0
  57. package/lib/types/host/qianwen-token-plan/routes.d.ts +12 -0
  58. package/lib/types/host/qianwen-token-plan/routes.d.ts.map +1 -0
  59. package/lib/types/host/qianwen-token-plan/token-store.d.ts +56 -0
  60. package/lib/types/host/qianwen-token-plan/token-store.d.ts.map +1 -0
  61. package/lib/types/host/qianwen-token-plan/types.d.ts +13 -0
  62. package/lib/types/host/qianwen-token-plan/types.d.ts.map +1 -0
  63. package/lib/types/host/timeline-cache-guard.d.ts.map +1 -1
  64. package/lib/types/index.d.ts +5 -0
  65. package/lib/types/index.d.ts.map +1 -1
  66. package/lib/types/shared/contracts.d.ts +1 -1
  67. package/lib/types/shared/contracts.d.ts.map +1 -1
  68. package/lib/types/shared/model-catalog.d.ts +25 -1
  69. package/lib/types/shared/model-catalog.d.ts.map +1 -1
  70. package/lib/types/shared/qianwen-token-plan-contracts.d.ts +94 -0
  71. package/lib/types/shared/qianwen-token-plan-contracts.d.ts.map +1 -0
  72. package/package.json +1 -1
@@ -0,0 +1,94 @@
1
+ /**
2
+ * Public host/client contract for the Qwen Token Plan line.
3
+ *
4
+ * No API key, encrypted thinking payload, or request body crosses this boundary.
5
+ * Upstream facts are sourced from the official Qianwen documentation recorded in
6
+ * docs/qianwen-token-plan-line-plan.md.
7
+ */
8
+ export declare const QIANWEN_TOKEN_PLAN_PROVIDER_ID = "qianwen-token-plan";
9
+ export declare const QIANWEN_TOKEN_PLAN_PROVIDER_NAME = "Qwen Token Plan\uFF08\u5343\u95EE\uFF09";
10
+ export declare const QIANWEN_TOKEN_PLAN_ROUTE_PREFIX = "/qianwen-token-plan/api";
11
+ export type QianwenReasoningEffort = 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max';
12
+ export declare const QIANWEN_REASONING_EFFORTS: readonly QianwenReasoningEffort[];
13
+ export declare function isQianwenReasoningEffort(value: unknown): value is QianwenReasoningEffort;
14
+ export type QianwenCacheTtl = '5m' | '1h';
15
+ export declare const QIANWEN_CACHE_TTLS: readonly QianwenCacheTtl[];
16
+ export declare function isQianwenCacheTtl(value: unknown): value is QianwenCacheTtl;
17
+ export type QianwenImageDetail = 'low' | 'auto' | 'high';
18
+ export declare const QIANWEN_IMAGE_DETAILS: readonly QianwenImageDetail[];
19
+ export declare function isQianwenImageDetail(value: unknown): value is QianwenImageDetail;
20
+ export interface QianwenModelOption {
21
+ id: string;
22
+ name: string;
23
+ availability: 'personal-and-team' | 'team-only';
24
+ automaticRouting: boolean;
25
+ hint: string;
26
+ enabled: boolean;
27
+ defaultContextWindow: number;
28
+ contextWindow: number;
29
+ defaultMaxTokens: number;
30
+ maxOutputTokens: number;
31
+ reasoningEfforts: readonly QianwenReasoningEffort[];
32
+ thinkingDisableable: boolean;
33
+ supportsImages: boolean;
34
+ supportsVideo: boolean;
35
+ supportsExplicitCache: boolean;
36
+ supportsCoTSummary: boolean;
37
+ description: string | null;
38
+ }
39
+ export interface QianwenSettingsUpdateDto {
40
+ enabled?: boolean;
41
+ /** A stored empty array is an explicit all-off selection. */
42
+ enabledModelIds?: string[];
43
+ /** Null removes one override and restores the catalog default. */
44
+ contextWindowOverrides?: Record<string, number | null>;
45
+ /** Null omits the wire field and uses the upstream default. */
46
+ defaultReasoningEffort?: QianwenReasoningEffort | null;
47
+ cacheEnabled?: boolean;
48
+ cacheTtl?: QianwenCacheTtl;
49
+ thinkingSummary?: boolean;
50
+ imageDetail?: QianwenImageDetail;
51
+ maxPixels?: number | null;
52
+ }
53
+ export interface QianwenCacheStatsDto {
54
+ requests: number;
55
+ missedInputTokens: number;
56
+ cacheReadTokens: number;
57
+ cacheWriteTokens: number;
58
+ cacheWrite5mTokens: number;
59
+ cacheWrite1hTokens: number;
60
+ outputTokens: number;
61
+ reasoningTokens: number;
62
+ encryptedReplays: number;
63
+ missingEncryptedContent: number;
64
+ }
65
+ export interface QianwenStatusDto {
66
+ providerId: typeof QIANWEN_TOKEN_PLAN_PROVIDER_ID;
67
+ enabled: boolean;
68
+ authenticated: boolean;
69
+ hasCredentials: boolean;
70
+ storagePath: string;
71
+ models: QianwenModelOption[];
72
+ contextWindowOverrides: Record<string, number>;
73
+ defaultReasoningEffort: QianwenReasoningEffort | null;
74
+ cacheEnabled: boolean;
75
+ cacheTtl: QianwenCacheTtl;
76
+ thinkingSummary: boolean;
77
+ imageDetail: QianwenImageDetail;
78
+ maxPixels: number | null;
79
+ cacheStats?: QianwenCacheStatsDto;
80
+ cacheHint?: {
81
+ idleMs: number;
82
+ totalTokens: number;
83
+ };
84
+ serving: boolean;
85
+ conflict: string | null;
86
+ }
87
+ export interface QianwenConnectionDto {
88
+ connected: boolean;
89
+ latencyMs: number;
90
+ model: string | null;
91
+ checkedAt: number;
92
+ error?: string;
93
+ }
94
+ //# sourceMappingURL=qianwen-token-plan-contracts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qianwen-token-plan-contracts.d.ts","sourceRoot":"","sources":["../../../src/shared/qianwen-token-plan-contracts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,8BAA8B,uBAAuB,CAAA;AAClE,eAAO,MAAM,gCAAgC,4CAAwB,CAAA;AACrE,eAAO,MAAM,+BAA+B,4BAA4B,CAAA;AAExE,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,SAAS,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAA;AACrG,eAAO,MAAM,yBAAyB,EAAE,SAAS,sBAAsB,EAEtE,CAAA;AACD,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,sBAAsB,CAExF;AAED,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,IAAI,CAAA;AACzC,eAAO,MAAM,kBAAkB,EAAE,SAAS,eAAe,EAAiB,CAAA;AAC1E,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe,CAE1E;AAED,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAA;AACxD,eAAO,MAAM,qBAAqB,EAAE,SAAS,kBAAkB,EAA4B,CAAA;AAC3F,wB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@@
1
1
  {
2
2
  "name": "@eddyskywalker/dsh-chatgpt-subscription",
3
- "version": "0.76.1",
3
+ "version": "0.78.0",
4
4
  "description": "DSH provider plugin for Codex access through a ChatGPT subscription.",
5
5
  "icon": "./icon.svg",
6
6
  "author": {