@eddyskywalker/dsh-chatgpt-subscription 0.86.0 → 0.87.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 (84) hide show
  1. package/README.md +1 -0
  2. package/lib/client.js +1413 -354
  3. package/lib/client.js.map +1 -1
  4. package/lib/codemode.js +6 -5
  5. package/lib/index.js +5687 -2532
  6. package/lib/types/client/common/model-checklist-labels.d.ts +1 -1
  7. package/lib/types/client/features/progress-updates/locales.d.ts +3 -3
  8. package/lib/types/client/features/session-quota/adapters.d.ts +4 -0
  9. package/lib/types/client/features/session-quota/adapters.d.ts.map +1 -1
  10. package/lib/types/client/hub/HubOverview.d.ts +1 -1
  11. package/lib/types/client/hub/HubOverview.d.ts.map +1 -1
  12. package/lib/types/client/hub/HubProviderRow.d.ts +4 -0
  13. package/lib/types/client/hub/HubProviderRow.d.ts.map +1 -1
  14. package/lib/types/client/hub/brand-icons.d.ts +1 -1
  15. package/lib/types/client/hub/brand-icons.d.ts.map +1 -1
  16. package/lib/types/client/hub/hub-styles.d.ts.map +1 -1
  17. package/lib/types/client/hub/providers.d.ts.map +1 -1
  18. package/lib/types/client/index.d.ts +2 -0
  19. package/lib/types/client/index.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/index.d.ts.map +1 -1
  22. package/lib/types/client/locales-ru/opencode-go.d.ts +3 -0
  23. package/lib/types/client/locales-ru/opencode-go.d.ts.map +1 -0
  24. package/lib/types/client/providers/codex-chatgpt/locales.d.ts +3 -1
  25. package/lib/types/client/providers/codex-chatgpt/locales.d.ts.map +1 -1
  26. package/lib/types/client/providers/opencode-go/OpenCodeGoComposerQuota.d.ts +14 -0
  27. package/lib/types/client/providers/opencode-go/OpenCodeGoComposerQuota.d.ts.map +1 -0
  28. package/lib/types/client/providers/opencode-go/OpenCodeGoQuotaCard.d.ts +12 -0
  29. package/lib/types/client/providers/opencode-go/OpenCodeGoQuotaCard.d.ts.map +1 -0
  30. package/lib/types/client/providers/opencode-go/OpenCodeGoSection.d.ts +8 -0
  31. package/lib/types/client/providers/opencode-go/OpenCodeGoSection.d.ts.map +1 -0
  32. package/lib/types/client/providers/opencode-go/locales.d.ts +318 -0
  33. package/lib/types/client/providers/opencode-go/locales.d.ts.map +1 -0
  34. package/lib/types/client/providers/opencode-go/styles.d.ts +4 -0
  35. package/lib/types/client/providers/opencode-go/styles.d.ts.map +1 -0
  36. package/lib/types/compat.d.ts +1 -1
  37. package/lib/types/host/common/account-pool.d.ts +17 -7
  38. package/lib/types/host/common/account-pool.d.ts.map +1 -1
  39. package/lib/types/host/common/model-request-control.d.ts +1 -1
  40. package/lib/types/host/common/model-request-control.d.ts.map +1 -1
  41. package/lib/types/host/common/prompt-cache-policy.d.ts.map +1 -1
  42. package/lib/types/host/common/request-diagnostics.d.ts +1 -1
  43. package/lib/types/host/common/request-diagnostics.d.ts.map +1 -1
  44. package/lib/types/host/providers/minimax-code/media-files.d.ts +29 -0
  45. package/lib/types/host/providers/minimax-code/media-files.d.ts.map +1 -0
  46. package/lib/types/host/providers/minimax-code/media-tool.d.ts +20 -0
  47. package/lib/types/host/providers/minimax-code/media-tool.d.ts.map +1 -0
  48. package/lib/types/host/providers/opencode-go/account-pool.d.ts +50 -0
  49. package/lib/types/host/providers/opencode-go/account-pool.d.ts.map +1 -0
  50. package/lib/types/host/providers/opencode-go/adapter.d.ts +36 -0
  51. package/lib/types/host/providers/opencode-go/adapter.d.ts.map +1 -0
  52. package/lib/types/host/providers/opencode-go/client.d.ts +13 -0
  53. package/lib/types/host/providers/opencode-go/client.d.ts.map +1 -0
  54. package/lib/types/host/providers/opencode-go/mapper-gemini.d.ts +13 -0
  55. package/lib/types/host/providers/opencode-go/mapper-gemini.d.ts.map +1 -0
  56. package/lib/types/host/providers/opencode-go/mapper-messages.d.ts +8 -0
  57. package/lib/types/host/providers/opencode-go/mapper-messages.d.ts.map +1 -0
  58. package/lib/types/host/providers/opencode-go/mapper-responses.d.ts +9 -0
  59. package/lib/types/host/providers/opencode-go/mapper-responses.d.ts.map +1 -0
  60. package/lib/types/host/providers/opencode-go/mapper.d.ts +38 -0
  61. package/lib/types/host/providers/opencode-go/mapper.d.ts.map +1 -0
  62. package/lib/types/host/providers/opencode-go/model-catalog.d.ts +57 -0
  63. package/lib/types/host/providers/opencode-go/model-catalog.d.ts.map +1 -0
  64. package/lib/types/host/providers/opencode-go/native-shared.d.ts +31 -0
  65. package/lib/types/host/providers/opencode-go/native-shared.d.ts.map +1 -0
  66. package/lib/types/host/providers/opencode-go/protocol.d.ts +13 -0
  67. package/lib/types/host/providers/opencode-go/protocol.d.ts.map +1 -0
  68. package/lib/types/host/providers/opencode-go/routes.d.ts +13 -0
  69. package/lib/types/host/providers/opencode-go/routes.d.ts.map +1 -0
  70. package/lib/types/host/providers/opencode-go/token-store.d.ts +29 -0
  71. package/lib/types/host/providers/opencode-go/token-store.d.ts.map +1 -0
  72. package/lib/types/host/providers/opencode-go/types.d.ts +20 -0
  73. package/lib/types/host/providers/opencode-go/types.d.ts.map +1 -0
  74. package/lib/types/host/providers/workbuddy/account-pool.d.ts.map +1 -1
  75. package/lib/types/host/runtime/codemode/rules.d.ts +1 -1
  76. package/lib/types/index.d.ts +6 -0
  77. package/lib/types/index.d.ts.map +1 -1
  78. package/lib/types/shared/contracts.d.ts +1 -1
  79. package/lib/types/shared/contracts.d.ts.map +1 -1
  80. package/lib/types/shared/opencode-go-contracts.d.ts +80 -0
  81. package/lib/types/shared/opencode-go-contracts.d.ts.map +1 -0
  82. package/package.json +1 -1
  83. package/presets/dispatch/README.md +2 -2
  84. package/presets/dispatch/agent.cordis.yml +1 -1
@@ -0,0 +1,80 @@
1
+ import type { AccountRotationStrategy, PoolAccountQuotaDto, PoolAccountSummaryDto } from './account-pool-contracts.ts';
2
+ /** Public settings contracts for the OpenCode Go subscription line. No secrets cross this module. */
3
+ export declare const OPENCODE_GO_PROVIDER_ID = "opencode-go";
4
+ export declare const OPENCODE_GO_PROVIDER_NAME = "OpenCode Go\uFF08\u8BA2\u9605\uFF09";
5
+ export declare const OPENCODE_GO_ROUTE_PREFIX = "/opencode-go/api";
6
+ export declare const OPENCODE_GO_CONSOLE_URL = "https://opencode.ai/console";
7
+ export declare const OPENCODE_GO_REASONING_EFFORTS: readonly ["none", "minimal", "low", "medium", "high", "xhigh", "max"];
8
+ export type OpenCodeGoReasoningEffort = typeof OPENCODE_GO_REASONING_EFFORTS[number];
9
+ export declare function isOpenCodeGoReasoningEffort(value: unknown): value is OpenCodeGoReasoningEffort;
10
+ export type OpenCodeGoProtocol = 'chat-completions' | 'responses' | 'messages' | 'generate-content';
11
+ export type OpenCodeGoPlanId = 'go' | 'go-plus' | 'go-teams';
12
+ export type OpenCodeGoMonthlyUsage = Partial<Record<OpenCodeGoPlanId, number>>;
13
+ export type OpenCodeGoQuotaWindowKey = 'rolling' | 'weekly' | 'monthly';
14
+ export interface OpenCodeGoQuotaWindowDto {
15
+ key: OpenCodeGoQuotaWindowKey;
16
+ usedPercent: number;
17
+ resetsAt: number | null;
18
+ }
19
+ export interface OpenCodeGoQuotaSnapshotDto {
20
+ windows: OpenCodeGoQuotaWindowDto[];
21
+ planName: string | null;
22
+ fetchedAt: number;
23
+ }
24
+ export interface OpenCodeGoModelOption {
25
+ id: string;
26
+ name: string;
27
+ hint: string;
28
+ enabled: boolean;
29
+ defaultContextWindow: number;
30
+ contextWindow: number;
31
+ defaultMaxTokens: number;
32
+ reasoningEfforts: readonly OpenCodeGoReasoningEffort[];
33
+ supportsTools: boolean;
34
+ supportsImages: boolean;
35
+ description: string | null;
36
+ canonicalId: string | null;
37
+ training: boolean | null;
38
+ zdr: boolean | null;
39
+ limitedRegions: boolean | null;
40
+ protocol: OpenCodeGoProtocol;
41
+ }
42
+ export interface OpenCodeGoAccountSummaryDto extends PoolAccountSummaryDto {
43
+ authKind: 'api-key';
44
+ planName?: string;
45
+ region?: string;
46
+ }
47
+ export interface OpenCodeGoConnectionDto {
48
+ connected: boolean;
49
+ latencyMs: number;
50
+ model: string | null;
51
+ checkedAt: number;
52
+ error?: string;
53
+ }
54
+ export interface OpenCodeGoWebStatus {
55
+ enabled: boolean;
56
+ providerId: string;
57
+ serving: boolean;
58
+ conflict: string | null;
59
+ authenticated: boolean;
60
+ accounts: OpenCodeGoAccountSummaryDto[];
61
+ activeAccountId?: string;
62
+ rotationStrategy: AccountRotationStrategy;
63
+ selectedAccountId: string | null;
64
+ models: OpenCodeGoModelOption[];
65
+ contextWindowOverrides: Record<string, number>;
66
+ defaultReasoningEffort: OpenCodeGoReasoningEffort | null;
67
+ catalogSynced: boolean;
68
+ catalogCount: number;
69
+ quotaError: string | null;
70
+ connection: OpenCodeGoConnectionDto | null;
71
+ }
72
+ export interface OpenCodeGoSettingsUpdateDto {
73
+ enabled?: boolean;
74
+ enabledModelIds?: string[];
75
+ contextWindowOverrides?: Record<string, number | null>;
76
+ defaultReasoningEffort?: OpenCodeGoReasoningEffort | null;
77
+ selectedAccountId?: string | null;
78
+ }
79
+ export type { AccountRotationStrategy, PoolAccountQuotaDto };
80
+ //# sourceMappingURL=opencode-go-contracts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"opencode-go-contracts.d.ts","sourceRoot":"","sources":["../../../src/shared/opencode-go-contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AAEtH,qGAAqG;AACrG,eAAO,MAAM,uBAAuB,gBAAgB,CAAA;AACpD,eAAO,MAAM,yBAAyB,wCAAoB,CAAA;AAC1D,eAAO,MAAM,wBAAwB,qBAAqB,CAAA;AAC1D,eAAO,MAAM,uBAAuB,gCAAgC,CAAA;AAEpE,eAAO,MAAM,6BAA6B,uEAAwE,CAAA;AAClH,MAAM,MAAM,yBAAyB,GAAG,OAAO,6BAA6B,CAAC,MAAM,CAAC,CAAA;AACpF,wBAAgB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,sBAAsB,CAAC,EAAE,yBAAyB,GAAG,IAAI,CAAA;IACzD,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAClC;AAED,YAAY,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eddyskywalker/dsh-chatgpt-subscription",
3
- "version": "0.86.0",
3
+ "version": "0.87.0",
4
4
  "description": "Multi-provider subscription hub and agent runtime enhancements for DeepSeek Harness (DSH).",
5
5
  "icon": "./assets/icon.svg",
6
6
  "author": {
@@ -1,13 +1,13 @@
1
1
  # 调度模式(dispatch)
2
2
 
3
- 基于 **Code Mode** 的调度 Agent:native 工具块只保留最小白名单 `code_run`、`cache_warmup_result`、`dispatch_ledger`、`progress_update`、`structured_output`。其余工具即使由本预设注册,也不进入 native schema,只能在 `code_run` 程序里用 `code_tools_search` 现查现调;`win_bash` 也不例外,Shell 一律写成 `await tools.win_bash(...)`。工具注册本身不删除,`code_run` 的嵌套调用仍走完整原生执行管线。
3
+ 基于 **Code Mode** 的调度 Agent:native 工具块只保留最小白名单 `code_run`、`cache_warmup_result`、`dispatch_ledger`、`progress_update`、`structured_output`。其余工具即使由本预设注册,也不进入 native schema,只能在 `code_run` 程序里用 `code_tools_search` 现查现调;Shell 在 POSIX 写成 `await tools.bash(...)`,在 Windows 写成 `await tools.pwsh(...)`。工具注册本身不删除,`code_run` 的嵌套调用仍走完整原生执行管线。
4
4
 
5
5
  > 内核的 `ptc` 呈现方式只把 `run_code` 交给模型、其余名字一律硬拒,`standard` 又完全没有程序
6
6
  > 传输;「原生工具 + 程序」这个组合在内核里表达不出来,所以本预设自带一行 `code-mode`
7
7
  > (`@eddyskywalker/dsh-chatgpt-subscription/codemode`)。代次上不可用原生 executor 时,
8
8
  > `resolveDispatchPreset` 会自动退回 PTC 呈现(见 `src/host/agent-preset.ts`)。
9
9
 
10
- > `code-mode.config.nativeToolsOnly: true` 是这一白名单模式的开关,默认关闭以保持其他调用方的旧行为;dispatch 另用 `nativeTools` 显式冻结四个辅助工具,避免继承通用默认值里的原生 Shell。白名单外的顶层直呼会被拒绝,但带嵌套标记的程序内调用放行。比如 `ask_user_question` 仍由 `tool-ask-user` 注册,主控只是不再直接调用它,而是在一个 `code_run` 程序中执行 `return await tools.ask_user_question({ questions: [...] })`。全局指令点名 `read` / `glob` / `grep` / `edit` / `write` / `win_bash` 时,同样指程序内的 `tools.*`,不是顶层工具。
10
+ > `code-mode.config.nativeToolsOnly: true` 是这一白名单模式的开关,默认关闭以保持其他调用方的旧行为;dispatch 另用 `nativeTools` 显式冻结四个辅助工具,避免继承通用默认值里的原生 Shell。白名单外的顶层直呼会被拒绝,但带嵌套标记的程序内调用放行。比如 `ask_user_question` 仍由 `tool-ask-user` 注册,主控只是不再直接调用它,而是在一个 `code_run` 程序中执行 `return await tools.ask_user_question({ questions: [...] })`。全局指令点名 `read` / `glob` / `grep` / `edit` / `write` / `bash` / `pwsh` 时,同样指程序内的 `tools.*`,不是顶层工具。
11
11
 
12
12
  > **缓存前提**:Code Mode 的说明段是**恒定文本**(不含任何遮蔽计数或 namespace 清单),
13
13
  > 加上既有的 `ptc-sdk-cache-guard`,kimi-code / minimax-code 的前缀缓存不因 MCP 增删而失效。
@@ -63,7 +63,7 @@
63
63
 
64
64
  [Coordinator Identity] You are the Lead & Dispatch Agent: converge requirements, plan architecture, select R1 topology (Lead-Core / Hybrid / Fan-out), orchestrate subagents where ROI is positive, and own final acceptance.
65
65
  [Execution Pipeline] R0 Triage -> [L2-Governed only: R-G Interview -> R9 Plan Approval] -> R1 Topology -> (if delegating: R2 Routing -> R5 Brief -> R-W Wait) -> R6 Lead Acceptance.
66
- [Dispatch Native Tool Whitelist] Top-level: only code_run, cache_warmup_result, dispatch_ledger, progress_update, and structured_output. Every task tool—including win_bash—is program-only via await tools.<name>(...); ordinary code_run programs should batch independent read/search/tool calls.
66
+ [Dispatch Native Tool Whitelist] Top-level: only code_run, cache_warmup_result, dispatch_ledger, progress_update, and structured_output. Every task tool—including shell tools—is program-only via await tools.<name>(...); ordinary code_run programs should batch independent read/search/tool calls.
67
67
  [Agent Teams Board] The shared task board (team_task_create and its list/get/update siblings) is bookkeeping, not a second dispatcher (frozen declaration, not availability—confirm with team_task_list before relying on it). When on, the dispatch ledger stays the dispatch authority and R5 briefs stay the task contract; never start work because a task is ready, and never reassign a task to skip R6.
68
68
 
69
69
  ## R0 · Complexity Triage