@dipoleml/dcode-cli 1.2.2 → 1.2.3

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 (31) hide show
  1. package/dist/dcode.cjs +2190 -1877
  2. package/dist/packages/browser-use-plugin/.dcode-plugin/plugin.json +8 -8
  3. package/dist/packages/dcode-cua-plugin/.dcode-plugin/plugin.json +10 -0
  4. package/dist/packages/dcode-cua-plugin/docs/computer-use.md +470 -0
  5. package/dist/packages/dcode-cua-plugin/package.json +12 -0
  6. package/dist/packages/dcode-cua-plugin/scripts/bump-dcode-cua-producer.mjs +305 -0
  7. package/dist/packages/dcode-cua-plugin/scripts/check-cua-baseline.mjs +155 -0
  8. package/dist/packages/dcode-cua-plugin/scripts/check-sdk.mjs +4 -0
  9. package/dist/packages/dcode-cua-plugin/scripts/check-version-coherence.mjs +478 -0
  10. package/dist/packages/dcode-cua-plugin/scripts/computer-use-client.mjs +1208 -0
  11. package/dist/packages/dcode-cua-plugin/scripts/resolve-pnpm-invocation.mjs +26 -0
  12. package/dist/packages/dcode-cua-plugin/scripts/sync-cache.mjs +116 -0
  13. package/dist/packages/dcode-cua-plugin/scripts/sync-skill-from-dcode-cua.mjs +115 -0
  14. package/dist/packages/dcode-cua-plugin/skills/computer-use/SKILL.md +306 -0
  15. package/dist/packages/node-repl-host/dist/mcp/server.js +3 -3
  16. package/dist/packages/node-repl-host/package.json +1 -1
  17. package/dist/provider/dcode-builtin.json +6748 -6748
  18. package/node_modules/@dcode/contracts/dist/events/event-reducer-helpers.d.ts +1 -1
  19. package/node_modules/@dcode/contracts/dist/events/event-reducer-helpers.js +5 -1
  20. package/node_modules/@dcode/contracts/dist/events/event-reducer.js +26 -5
  21. package/node_modules/@dcode/contracts/dist/interfaces/session.port.d.ts +5 -1
  22. package/node_modules/@dcode/contracts/dist/tools/bash.js +4 -1
  23. package/node_modules/@dcode/i18n/dist/locales/en-US.js +11 -23
  24. package/node_modules/@dcode/i18n/dist/locales/fr-CA.js +9 -21
  25. package/node_modules/@dcode/i18n/dist/types.d.ts +0 -12
  26. package/node_modules/@dcode/model-option-map/package.json +1 -1
  27. package/node_modules/@dcode/shared/package.json +1 -1
  28. package/node_modules/@dcode/tui/dist/app-model-ref.js +9 -2
  29. package/node_modules/@dcode/tui/dist/index.js +57 -65
  30. package/node_modules/@dcode/tui/dist/theme/defaults.js +21 -15
  31. package/package.json +3 -3
@@ -9,7 +9,7 @@ export declare const initialSessionProjection: {
9
9
  turnCount: number;
10
10
  totalTokenCount: number;
11
11
  contextUsed: number;
12
- contextWindow: number;
12
+ contextWindow: number | undefined;
13
13
  pendingPermissions: PendingPermission[];
14
14
  pendingSteerInputs: PendingSteerInputInfo[];
15
15
  activeToolCalls: ActiveToolCall[];
@@ -10,7 +10,11 @@ export const initialSessionProjection = {
10
10
  turnCount: 0,
11
11
  totalTokenCount: 0,
12
12
  contextUsed: 0,
13
- contextWindow: 200000,
13
+ // 不能合成默认窗口:写死 200000 会让 1M 上下文模型的 headless JSON usage 显示成 200000、
14
+ // TUI context meter 也拿错分母。Producer 才是真值来源(ModelSelected / ModelComplete 携带
15
+ // model.properties.contextWindow),这里只做「尚无任何模型事件」的未知占位,由 reducer
16
+ // 在收到事件时覆写;无事件时保持未知(JSON 输出 null)而不是报一个错数。
17
+ contextWindow: undefined,
14
18
  pendingPermissions: [],
15
19
  pendingSteerInputs: [],
16
20
  activeToolCalls: [],
@@ -5,7 +5,24 @@ import { SessionEventType as EventTypes } from "./session.events.js";
5
5
  import { getModelUsageContextTokens } from "../model/index.js";
6
6
  import { parseCheckpointCreatedPayload, parseRewindTriggeredPayload } from "../rewind/index.js";
7
7
  import { GOAL_COMPLETION_VERIFICATION_QUERY_SOURCE, failedGoalCompletionVerification, parseGoalCompletionVerificationText, } from "../tools/target.js";
8
- import { applyBackgroundTaskCompleted, applyBackgroundTaskStarted, applyBackgroundTaskUpdated, applyCompactBoundary, applyStreamRecoveryAnchorCreated, applyStreamingToolLedgerUpdate, initialSessionProjection, } from "./event-reducer-helpers.js";
8
+ import { applyBackgroundTaskCompleted, applyBackgroundTaskStarted, applyBackgroundTaskUpdated, applyCompactBoundary, applyStreamRecoveryAnchorCreated, applyStreamingToolLedgerUpdate, initialSessionProjection, positiveInteger, } from "./event-reducer-helpers.js";
9
+ /**
10
+ * 上下文窗口的唯一真值来源是携带窗口的模型事件(ModelSelected / ModelComplete 的
11
+ * contextWindow,都由 producer 从 model.properties.contextWindow 读出)。
12
+ * 旧版 reducer 只从 SessionCreated 读窗口、且 it 之外再无人更新,于是初始默认值
13
+ * 200000 永远滑块不回正——1M 模型在 headless JSON 与 TUI 里都显示成 200000。
14
+ * 这里只在 payload 给出有效正数时覆写;缺失/null/非正数一律保留现值(null 的
15
+ * 「显式清除」语义由 v4 投影自己处理,v3 投影不做无值猜测)。
16
+ */
17
+ function withContextWindow(projection, payload) {
18
+ const raw = payload.contextWindow;
19
+ if (raw === undefined || raw === null)
20
+ return projection;
21
+ const contextWindow = positiveInteger(raw);
22
+ if (contextWindow === undefined)
23
+ return projection;
24
+ return { ...projection, contextWindow };
25
+ }
9
26
  function shouldModelCompleteUpdateContextUsed(payload) {
10
27
  if (payload.querySource !== undefined) {
11
28
  return payload.querySource === "main_turn";
@@ -38,16 +55,20 @@ export class EventReducer {
38
55
  [EventTypes.SessionCreated]: (p, e) => {
39
56
  const payload = e.payload;
40
57
  return {
41
- ...p,
58
+ ...withContextWindow(p, payload),
42
59
  id: e.sessionId,
43
60
  mode: payload.mode,
44
61
  planEnabled: payload.planEnabled ?? payload.mode === "plan",
45
- contextWindow: payload.contextWindow,
46
62
  createdAt: e.timestamp,
47
63
  updatedAt: e.timestamp,
48
64
  status: "idle",
49
65
  };
50
66
  },
67
+ [EventTypes.ModelSelected]: (p, e) => {
68
+ // 模型切换是窗口变化的第一现场:producer 从本次 Active Model 读窗口(steering.ts),
69
+ // 冷恢复也从 hydration 携带。旧版没有这个 case,切到 1M 模型后投影仍显示 200000。
70
+ return withContextWindow(p, e.payload);
71
+ },
51
72
  [EventTypes.TurnStarted]: (p, e) => {
52
73
  return {
53
74
  ...p,
@@ -122,7 +143,7 @@ export class EventReducer {
122
143
  [EventTypes.TurnComplete]: (p, e) => {
123
144
  const payload = e.payload;
124
145
  return {
125
- ...p,
146
+ ...withContextWindow(p, payload),
126
147
  status: "idle",
127
148
  totalTokenCount: p.totalTokenCount + payload.tokenCount,
128
149
  updatedAt: e.timestamp,
@@ -153,7 +174,7 @@ export class EventReducer {
153
174
  // 这里通过统一 helper 计算 context used,避免各处重复理解 cache breakdown。
154
175
  const contextUsed = getModelUsageContextTokens(payload.usage);
155
176
  return {
156
- ...p,
177
+ ...withContextWindow(p, payload),
157
178
  ...(contextUsed !== undefined ? { contextUsed } : {}),
158
179
  updatedAt: e.timestamp,
159
180
  };
@@ -53,7 +53,11 @@ export interface SessionProjection {
53
53
  turnCount: number;
54
54
  totalTokenCount: number;
55
55
  contextUsed: number;
56
- contextWindow: number;
56
+ /**
57
+ * 当前模型上下文窗口。undefined = 尚未收到任何携带窗口的模型事件(旧版写死 200000 会导致
58
+ * 1M 模型被显示成 200000;见 event-reducer-helpers.ts initialSessionProjection 注释)。
59
+ */
60
+ contextWindow?: number;
57
61
  pendingPermissions: PendingPermission[];
58
62
  pendingSteerInputs: PendingSteerInputInfo[];
59
63
  activeToolCalls: ActiveToolCall[];
@@ -30,7 +30,10 @@ export const BashInputSchema = z
30
30
  /**
31
31
  * Optional timeout in milliseconds (max 600000)
32
32
  */
33
- timeout: semanticNumber(z.number().int().positive().max(MAX_BASH_TIMEOUT_MS))
33
+ // 0 是合法输入:运行时 resolver 把 0/缺省一并解释为「用策略默认值」,
34
+ // 因此这里只拦负数,不拦 0。.int() 之外不用 positive(),否则模型传
35
+ // timeout: 0 会在 Zod 层直接报错,根本走不到上面那个兜底。
36
+ timeout: semanticNumber(z.number().int().min(0).max(MAX_BASH_TIMEOUT_MS))
34
37
  .optional()
35
38
  .describe(`Optional timeout in milliseconds (max ${MAX_BASH_TIMEOUT_MS})`),
36
39
  /**
@@ -2,7 +2,7 @@ export const enUS = {
2
2
  locale: "en-US",
3
3
  cli: {
4
4
  errors: {
5
- localeUnsupported: (value) => `Unsupported --locale value: ${value}. Supported locales: en-US, zh-CN, auto.`,
5
+ localeUnsupported: (value) => `Unsupported --locale value: ${value}. Supported locales: en-US, fr-CA, auto.`,
6
6
  },
7
7
  help: (version) => `dcode ${version}
8
8
 
@@ -15,8 +15,8 @@ Commands:
15
15
  app-server Run the DCode Protocol stdio app server
16
16
  commands List custom slash commands (\`commands list\`)
17
17
  doctor Inspect runtime and packaging assumptions
18
- login [dcode|bigmodel] Sign in through browser authorization
19
- logout Remove the shared DipoleML login credentials
18
+ login [dcode] Sign in through browser authorization
19
+ logout Remove the shared Dipole ML Inc. login credentials
20
20
  plugins Manage plugins and marketplaces (\`plugins list|install|uninstall|enable|disable|update|validate|marketplace ...\`; alias: plugin)
21
21
  skills List local skills (\`skills list\`)
22
22
  tui Open the terminal UI
@@ -36,7 +36,7 @@ Options:
36
36
  Remove whole tools for this prompt/TUI run only; saved settings are unchanged.
37
37
  Comma or space-separated tool names, e.g. "Bash Edit".
38
38
  "Bash(git *)" removes all of Bash; command patterns are not matched.
39
- --force-mcs Force mid-conversation system projection for Anthropic providers
39
+ --force-mcs Force mid-conversation system projection for compatible providers
40
40
  --locale <locale> UI locale: en-US, fr-CA, or auto
41
41
  --mode <mode> Permission mode for prompts: build, edit, plan, yolo, or guarded (default: yolo for --prompt)
42
42
  --resume <sessionId> Resume a persisted session by sessionId (sess_...)
@@ -51,8 +51,8 @@ Options:
51
51
 
52
52
  Slash Commands:
53
53
  /help [command] Show slash command help
54
- /login Choose DipoleML or BigModel browser login
55
- /logout Remove the shared DipoleML login credentials
54
+ /login Sign in with your DipoleML account (browser)
55
+ /logout Remove the shared Dipole ML Inc. login credentials
56
56
  /compact [instructions] Compact the current conversation
57
57
  /expert [status|resume|stop|<task>] Run or manage the expert workflow
58
58
  /dwf [list|cancel|resume] List, cancel, or resume dynamic workflow runs
@@ -102,28 +102,16 @@ Slash Commands:
102
102
  emptyMessage: "No login options are available.",
103
103
  help: "Use Up/Down to choose, Enter to select.",
104
104
  options: {
105
- bigmodelApiKey: {
106
- inputPrimary: "Enter BigModel Coding Plan API Key",
107
- inputSecondary: "Paste the key here. It is hidden while typing.",
108
- primary: "BigModel Coding Plan API Key",
109
- secondary: "Paste a Coding Plan API key manually.",
110
- },
111
- bigmodelOauth: {
112
- pendingPrimary: "Waiting for BigModel authorization",
113
- pendingSecondary: "Complete sign-in in your browser. Authorization is detected automatically.",
114
- primary: "BigModel Coding Plan",
115
- secondary: "Open browser login; authorization is detected automatically.",
116
- },
117
105
  dcodeApiKey: {
118
- inputPrimary: "Enter DipoleML Coding Plan API Key",
106
+ inputPrimary: "Enter DCode Coding Plan API key",
119
107
  inputSecondary: "Paste the key here. It is hidden while typing.",
120
- primary: "DipoleML Coding Plan API Key",
108
+ primary: "DCode Coding Plan API key",
121
109
  secondary: "Paste a Coding Plan API key manually.",
122
110
  },
123
111
  dcodeOauth: {
124
- pendingPrimary: "Waiting for DipoleML authorization",
112
+ pendingPrimary: "Waiting for browser authorization",
125
113
  pendingSecondary: "Complete sign-in in your browser. I will continue when authorization finishes.",
126
- primary: "DipoleML Coding Plan",
114
+ primary: "DCode Coding Plan",
127
115
  secondary: "Open browser login and create a Coding Plan API key.",
128
116
  },
129
117
  },
@@ -163,7 +151,7 @@ Slash Commands:
163
151
  unavailable: "Subagent output unavailable.",
164
152
  retry: "Retry",
165
153
  more: "Load more",
166
- pendingMain: "Main conversation needs your input, return to respond",
154
+ pendingMain: "Main conversation needs your input: return to respond",
167
155
  ended: (count) => `Ended (${count})`,
168
156
  status: {
169
157
  running: "running",
@@ -15,8 +15,8 @@ Commandes :
15
15
  app-server Exécuter le serveur app stdio du DCode Protocol
16
16
  commands Lister les commandes slash personnalisées (\`commands list\`)
17
17
  doctor Vérifier les hypothèses d'exécution et d'empaquetage
18
- login [dcode|bigmodel] Se connecter par autorisation navigateur
19
- logout Supprimer les identifiants de connexion DipoleML partagés
18
+ login [dcode] Se connecter par autorisation navigateur
19
+ logout Supprimer les identifiants de connexion Dipole ML Inc. partagés
20
20
  plugins Gérer les plugins et les marchés (\`plugins list|install|uninstall|enable|disable|update|validate|marketplace ...\` ; alias : plugin)
21
21
  skills Lister les skills locaux (\`skills list\`)
22
22
  tui Ouvrir l'interface terminal
@@ -37,7 +37,7 @@ Options :
37
37
  Retirer des outils entiers de l'ensemble disponible pour ce prompt/cette session TUI ; les réglages enregistrés ne changent pas.
38
38
  Noms d'outils séparés par des virgules ou des espaces, p. ex. "Bash Edit".
39
39
  "Bash(git *)" retire tout l'outil Bash ; le contenu des commandes n'est pas filtré.
40
- --force-mcs Forcer la projection system en cours de conversation pour les fournisseurs Anthropic
40
+ --force-mcs Forcer la projection system en cours de conversation pour les fournisseurs compatibles
41
41
  --locale <locale> Langue de l'UI : en-US, fr-CA ou auto
42
42
  --mode <mode> Mode de permission des prompts : build, edit, plan, yolo ou guarded (par défaut : yolo pour --prompt)
43
43
  --resume <sessionId> Reprendre une session persistée par sessionId (sess_...)
@@ -52,8 +52,8 @@ Options :
52
52
 
53
53
  Commandes slash :
54
54
  /help [commande] Afficher l'aide des commandes slash
55
- /login Choisir la connexion navigateur DipoleML ou BigModel
56
- /logout Supprimer les identifiants de connexion DipoleML partagés
55
+ /login Se connecter avec votre compte DipoleML (navigateur)
56
+ /logout Supprimer les identifiants de connexion Dipole ML Inc. partagés
57
57
  /compact [instructions] Compacter la conversation en cours
58
58
  /expert [status|resume|stop|<tâche>] Exécuter ou gérer le workflow expert
59
59
  /dwf [list|cancel|resume] Lister, annuler ou reprendre les runs de workflow dynamiques
@@ -103,28 +103,16 @@ Commandes slash :
103
103
  emptyMessage: "Aucune option de connexion disponible.",
104
104
  help: "Haut/Bas pour choisir, Entrée pour valider.",
105
105
  options: {
106
- bigmodelApiKey: {
107
- inputPrimary: "Saisir la clé API BigModel Coding Plan",
108
- inputSecondary: "Collez la clé ici. Elle est masquée pendant la saisie.",
109
- primary: "Clé API BigModel Coding Plan",
110
- secondary: "Coller manuellement une clé API Coding Plan.",
111
- },
112
- bigmodelOauth: {
113
- pendingPrimary: "En attente de l'autorisation BigModel",
114
- pendingSecondary: "Terminez la connexion dans votre navigateur. L'autorisation est détectée automatiquement.",
115
- primary: "BigModel Coding Plan",
116
- secondary: "Ouvrir la connexion navigateur ; l'autorisation est détectée automatiquement.",
117
- },
118
106
  dcodeApiKey: {
119
- inputPrimary: "Saisir la clé API DipoleML Coding Plan",
107
+ inputPrimary: "Saisir la clé API DCode Coding Plan",
120
108
  inputSecondary: "Collez la clé ici. Elle est masquée pendant la saisie.",
121
- primary: "Clé API DipoleML Coding Plan",
109
+ primary: "Clé API DCode Coding Plan",
122
110
  secondary: "Coller manuellement une clé API Coding Plan.",
123
111
  },
124
112
  dcodeOauth: {
125
- pendingPrimary: "En attente de l'autorisation DipoleML",
113
+ pendingPrimary: "En attente de l'autorisation navigateur",
126
114
  pendingSecondary: "Terminez la connexion dans votre navigateur. La configuration se poursuit dès que l'autorisation aboutit.",
127
- primary: "DipoleML Coding Plan",
115
+ primary: "DCode Coding Plan",
128
116
  secondary: "Ouvrir la connexion navigateur et créer une clé API Coding Plan.",
129
117
  },
130
118
  },
@@ -46,18 +46,6 @@ export interface TuiCopy {
46
46
  emptyMessage: string;
47
47
  help: string;
48
48
  options: {
49
- bigmodelApiKey: {
50
- inputPrimary: string;
51
- inputSecondary: string;
52
- primary: string;
53
- secondary: string;
54
- };
55
- bigmodelOauth: {
56
- pendingPrimary: string;
57
- pendingSecondary: string;
58
- primary: string;
59
- secondary: string;
60
- };
61
49
  dcodeApiKey: {
62
50
  inputPrimary: string;
63
51
  inputSecondary: string;
@@ -5,5 +5,5 @@
5
5
  "exports": {
6
6
  ".": "./dist/index.js"
7
7
  },
8
- "version": "1.2.2"
8
+ "version": "1.2.3"
9
9
  }
@@ -30,5 +30,5 @@
30
30
  "@dcode/model-option-map": "workspace:*",
31
31
  "zod": "4.6.5"
32
32
  },
33
- "version": "1.2.2"
33
+ "version": "1.2.3"
34
34
  }
@@ -1,5 +1,11 @@
1
1
  const MODEL_REF_SEPARATOR = "/";
2
2
  export const UNKNOWN_MODEL_FIELD = "-";
3
+ // 模型展示名(品牌规则):用户可见界面一律用品牌名,原始 modelId 只留在 ref 与
4
+ // /model <provider>/<id> 的输入语义里。未知 id 原样透传,便于第三方 provider 模型。
5
+ const MODEL_DISPLAY_NAMES = {
6
+ "raven-max": "Raven Max",
7
+ "raven-flash": "Raven Flash",
8
+ };
3
9
  export function modelDisplayParts(modelSelection) {
4
10
  const value = modelSelection.trim();
5
11
  if (!value) {
@@ -11,12 +17,13 @@ export function modelDisplayParts(modelSelection) {
11
17
  const separatorIndex = value.indexOf(MODEL_REF_SEPARATOR);
12
18
  if (separatorIndex <= 0) {
13
19
  return {
14
- model: value,
20
+ model: MODEL_DISPLAY_NAMES[value] ?? value,
15
21
  provider: UNKNOWN_MODEL_FIELD,
16
22
  };
17
23
  }
24
+ const modelId = value.slice(separatorIndex + MODEL_REF_SEPARATOR.length).trim();
18
25
  return {
19
- model: value.slice(separatorIndex + MODEL_REF_SEPARATOR.length).trim() || UNKNOWN_MODEL_FIELD,
26
+ model: (modelId ? MODEL_DISPLAY_NAMES[modelId] : undefined) ?? modelId ?? UNKNOWN_MODEL_FIELD,
20
27
  provider: value.slice(0, separatorIndex).trim() || UNKNOWN_MODEL_FIELD,
21
28
  };
22
29
  }
@@ -13,7 +13,7 @@ var enUS = {
13
13
  locale: "en-US",
14
14
  cli: {
15
15
  errors: {
16
- localeUnsupported: (value) => `Unsupported --locale value: ${value}. Supported locales: en-US, zh-CN, auto.`
16
+ localeUnsupported: (value) => `Unsupported --locale value: ${value}. Supported locales: en-US, fr-CA, auto.`
17
17
  },
18
18
  help: (version2) => `dcode ${version2}
19
19
 
@@ -26,8 +26,8 @@ Commands:
26
26
  app-server Run the DCode Protocol stdio app server
27
27
  commands List custom slash commands (\`commands list\`)
28
28
  doctor Inspect runtime and packaging assumptions
29
- login [dcode|bigmodel] Sign in through browser authorization
30
- logout Remove the shared DipoleML login credentials
29
+ login [dcode] Sign in through browser authorization
30
+ logout Remove the shared Dipole ML Inc. login credentials
31
31
  plugins Manage plugins and marketplaces (\`plugins list|install|uninstall|enable|disable|update|validate|marketplace ...\`; alias: plugin)
32
32
  skills List local skills (\`skills list\`)
33
33
  tui Open the terminal UI
@@ -47,7 +47,7 @@ Options:
47
47
  Remove whole tools for this prompt/TUI run only; saved settings are unchanged.
48
48
  Comma or space-separated tool names, e.g. "Bash Edit".
49
49
  "Bash(git *)" removes all of Bash; command patterns are not matched.
50
- --force-mcs Force mid-conversation system projection for Anthropic providers
50
+ --force-mcs Force mid-conversation system projection for compatible providers
51
51
  --locale <locale> UI locale: en-US, fr-CA, or auto
52
52
  --mode <mode> Permission mode for prompts: build, edit, plan, yolo, or guarded (default: yolo for --prompt)
53
53
  --resume <sessionId> Resume a persisted session by sessionId (sess_...)
@@ -62,8 +62,8 @@ Options:
62
62
 
63
63
  Slash Commands:
64
64
  /help [command] Show slash command help
65
- /login Choose DipoleML or BigModel browser login
66
- /logout Remove the shared DipoleML login credentials
65
+ /login Sign in with your DipoleML account (browser)
66
+ /logout Remove the shared Dipole ML Inc. login credentials
67
67
  /compact [instructions] Compact the current conversation
68
68
  /expert [status|resume|stop|<task>] Run or manage the expert workflow
69
69
  /dwf [list|cancel|resume] List, cancel, or resume dynamic workflow runs
@@ -113,28 +113,16 @@ Slash Commands:
113
113
  emptyMessage: "No login options are available.",
114
114
  help: "Use Up/Down to choose, Enter to select.",
115
115
  options: {
116
- bigmodelApiKey: {
117
- inputPrimary: "Enter BigModel Coding Plan API Key",
118
- inputSecondary: "Paste the key here. It is hidden while typing.",
119
- primary: "BigModel Coding Plan API Key",
120
- secondary: "Paste a Coding Plan API key manually."
121
- },
122
- bigmodelOauth: {
123
- pendingPrimary: "Waiting for BigModel authorization",
124
- pendingSecondary: "Complete sign-in in your browser. Authorization is detected automatically.",
125
- primary: "BigModel Coding Plan",
126
- secondary: "Open browser login; authorization is detected automatically."
127
- },
128
116
  dcodeApiKey: {
129
- inputPrimary: "Enter DipoleML Coding Plan API Key",
117
+ inputPrimary: "Enter DCode Coding Plan API key",
130
118
  inputSecondary: "Paste the key here. It is hidden while typing.",
131
- primary: "DipoleML Coding Plan API Key",
119
+ primary: "DCode Coding Plan API key",
132
120
  secondary: "Paste a Coding Plan API key manually."
133
121
  },
134
122
  dcodeOauth: {
135
- pendingPrimary: "Waiting for DipoleML authorization",
123
+ pendingPrimary: "Waiting for browser authorization",
136
124
  pendingSecondary: "Complete sign-in in your browser. I will continue when authorization finishes.",
137
- primary: "DipoleML Coding Plan",
125
+ primary: "DCode Coding Plan",
138
126
  secondary: "Open browser login and create a Coding Plan API key."
139
127
  }
140
128
  },
@@ -174,7 +162,7 @@ Slash Commands:
174
162
  unavailable: "Subagent output unavailable.",
175
163
  retry: "Retry",
176
164
  more: "Load more",
177
- pendingMain: "Main conversation needs your input \u2014 return to respond",
165
+ pendingMain: "Main conversation needs your input: return to respond",
178
166
  ended: (count2) => `Ended (${count2})`,
179
167
  status: {
180
168
  running: "running",
@@ -379,8 +367,8 @@ Commandes :
379
367
  app-server Ex\xE9cuter le serveur app stdio du DCode Protocol
380
368
  commands Lister les commandes slash personnalis\xE9es (\`commands list\`)
381
369
  doctor V\xE9rifier les hypoth\xE8ses d'ex\xE9cution et d'empaquetage
382
- login [dcode|bigmodel] Se connecter par autorisation navigateur
383
- logout Supprimer les identifiants de connexion DipoleML partag\xE9s
370
+ login [dcode] Se connecter par autorisation navigateur
371
+ logout Supprimer les identifiants de connexion Dipole ML Inc. partag\xE9s
384
372
  plugins G\xE9rer les plugins et les march\xE9s (\`plugins list|install|uninstall|enable|disable|update|validate|marketplace ...\` ; alias : plugin)
385
373
  skills Lister les skills locaux (\`skills list\`)
386
374
  tui Ouvrir l'interface terminal
@@ -401,7 +389,7 @@ Options :
401
389
  Retirer des outils entiers de l'ensemble disponible pour ce prompt/cette session TUI ; les r\xE9glages enregistr\xE9s ne changent pas.
402
390
  Noms d'outils s\xE9par\xE9s par des virgules ou des espaces, p. ex. "Bash Edit".
403
391
  "Bash(git *)" retire tout l'outil Bash ; le contenu des commandes n'est pas filtr\xE9.
404
- --force-mcs Forcer la projection system en cours de conversation pour les fournisseurs Anthropic
392
+ --force-mcs Forcer la projection system en cours de conversation pour les fournisseurs compatibles
405
393
  --locale <locale> Langue de l'UI : en-US, fr-CA ou auto
406
394
  --mode <mode> Mode de permission des prompts : build, edit, plan, yolo ou guarded (par d\xE9faut : yolo pour --prompt)
407
395
  --resume <sessionId> Reprendre une session persist\xE9e par sessionId (sess_...)
@@ -416,8 +404,8 @@ Options :
416
404
 
417
405
  Commandes slash :
418
406
  /help [commande] Afficher l'aide des commandes slash
419
- /login Choisir la connexion navigateur DipoleML ou BigModel
420
- /logout Supprimer les identifiants de connexion DipoleML partag\xE9s
407
+ /login Se connecter avec votre compte DipoleML (navigateur)
408
+ /logout Supprimer les identifiants de connexion Dipole ML Inc. partag\xE9s
421
409
  /compact [instructions] Compacter la conversation en cours
422
410
  /expert [status|resume|stop|<t\xE2che>] Ex\xE9cuter ou g\xE9rer le workflow expert
423
411
  /dwf [list|cancel|resume] Lister, annuler ou reprendre les runs de workflow dynamiques
@@ -467,28 +455,16 @@ Commandes slash :
467
455
  emptyMessage: "Aucune option de connexion disponible.",
468
456
  help: "Haut/Bas pour choisir, Entr\xE9e pour valider.",
469
457
  options: {
470
- bigmodelApiKey: {
471
- inputPrimary: "Saisir la cl\xE9 API BigModel Coding Plan",
472
- inputSecondary: "Collez la cl\xE9 ici. Elle est masqu\xE9e pendant la saisie.",
473
- primary: "Cl\xE9 API BigModel Coding Plan",
474
- secondary: "Coller manuellement une cl\xE9 API Coding Plan."
475
- },
476
- bigmodelOauth: {
477
- pendingPrimary: "En attente de l'autorisation BigModel",
478
- pendingSecondary: "Terminez la connexion dans votre navigateur. L'autorisation est d\xE9tect\xE9e automatiquement.",
479
- primary: "BigModel Coding Plan",
480
- secondary: "Ouvrir la connexion navigateur ; l'autorisation est d\xE9tect\xE9e automatiquement."
481
- },
482
458
  dcodeApiKey: {
483
- inputPrimary: "Saisir la cl\xE9 API DipoleML Coding Plan",
459
+ inputPrimary: "Saisir la cl\xE9 API DCode Coding Plan",
484
460
  inputSecondary: "Collez la cl\xE9 ici. Elle est masqu\xE9e pendant la saisie.",
485
- primary: "Cl\xE9 API DipoleML Coding Plan",
461
+ primary: "Cl\xE9 API DCode Coding Plan",
486
462
  secondary: "Coller manuellement une cl\xE9 API Coding Plan."
487
463
  },
488
464
  dcodeOauth: {
489
- pendingPrimary: "En attente de l'autorisation DipoleML",
465
+ pendingPrimary: "En attente de l'autorisation navigateur",
490
466
  pendingSecondary: "Terminez la connexion dans votre navigateur. La configuration se poursuit d\xE8s que l'autorisation aboutit.",
491
- primary: "DipoleML Coding Plan",
467
+ primary: "DCode Coding Plan",
492
468
  secondary: "Ouvrir la connexion navigateur et cr\xE9er une cl\xE9 API Coding Plan."
493
469
  }
494
470
  },
@@ -770,15 +746,18 @@ import React2 from "react";
770
746
 
771
747
  // src/theme/defaults.ts
772
748
  var DEFAULT_TUI_THEME_MODE = "dark";
749
+ var BRAND_BLUE = "#0050df";
750
+ var BRAND_BLUE_DARK_FG = "#7fb0ff";
751
+ var BRAND_BLUE_DARK_SOFT = "#9db8ff";
773
752
  var DARK_TUI_THEME = {
774
753
  mode: "dark",
775
- primary: "#7dd3fc",
754
+ primary: BRAND_BLUE,
776
755
  secondary: "#c4b5fd",
777
- accent: "#7dd3fc",
756
+ accent: BRAND_BLUE_DARK_FG,
778
757
  error: "#fca5a5",
779
758
  warning: "#fbbf24",
780
759
  success: "#86efac",
781
- info: "#93c5fd",
760
+ info: BRAND_BLUE_DARK_SOFT,
782
761
  text: "#e5e7eb",
783
762
  textMuted: "#94a3b8",
784
763
  selectedListItemText: "#f8fafc",
@@ -788,7 +767,7 @@ var DARK_TUI_THEME = {
788
767
  backgroundMenu: "#161b22",
789
768
  backgroundMessageUser: "#30363d",
790
769
  border: "#3b4450",
791
- borderActive: "#7dd3fc",
770
+ borderActive: BRAND_BLUE,
792
771
  borderSubtle: "#26313d",
793
772
  diffAdded: "#86efac",
794
773
  diffRemoved: "#fca5a5",
@@ -804,21 +783,21 @@ var DARK_TUI_THEME = {
804
783
  diffRemovedLineNumberBg: "#7f1d1d",
805
784
  markdownText: "#e5e7eb",
806
785
  markdownHeading: "#e5e7eb",
807
- markdownLink: "#7dd3fc",
786
+ markdownLink: BRAND_BLUE_DARK_FG,
808
787
  markdownLinkText: "#86efac",
809
788
  markdownCode: "#86efac",
810
789
  markdownBlockQuote: "#fbbf24",
811
790
  markdownEmph: "#fbbf24",
812
791
  markdownStrong: "#e5e7eb",
813
792
  markdownHorizontalRule: "#3b4450",
814
- markdownListItem: "#7dd3fc",
815
- markdownListEnumeration: "#7dd3fc",
793
+ markdownListItem: BRAND_BLUE_DARK_FG,
794
+ markdownListEnumeration: BRAND_BLUE_DARK_FG,
816
795
  markdownImage: "#c4b5fd",
817
796
  markdownImageText: "#86efac",
818
797
  markdownCodeBlock: "#86efac",
819
798
  syntaxComment: "#94a3b8",
820
- syntaxKeyword: "#7dd3fc",
821
- syntaxFunction: "#7dd3fc",
799
+ syntaxKeyword: BRAND_BLUE_DARK_FG,
800
+ syntaxFunction: BRAND_BLUE_DARK_FG,
822
801
  syntaxVariable: "#e5e7eb",
823
802
  syntaxString: "#86efac",
824
803
  syntaxNumber: "#fbbf24",
@@ -829,9 +808,9 @@ var DARK_TUI_THEME = {
829
808
  };
830
809
  var LIGHT_TUI_THEME = {
831
810
  mode: "light",
832
- primary: "#0369a1",
811
+ primary: BRAND_BLUE,
833
812
  secondary: "#7c3aed",
834
- accent: "#0369a1",
813
+ accent: BRAND_BLUE,
835
814
  error: "#b91c1c",
836
815
  warning: "#a16207",
837
816
  success: "#15803d",
@@ -845,7 +824,7 @@ var LIGHT_TUI_THEME = {
845
824
  backgroundMenu: "#ffffff",
846
825
  backgroundMessageUser: "#e0f2fe",
847
826
  border: "#cbd5e1",
848
- borderActive: "#0284c7",
827
+ borderActive: BRAND_BLUE,
849
828
  borderSubtle: "#e5e7eb",
850
829
  diffAdded: "#166534",
851
830
  diffRemoved: "#991b1b",
@@ -861,7 +840,7 @@ var LIGHT_TUI_THEME = {
861
840
  diffRemovedLineNumberBg: "#fecaca",
862
841
  markdownText: "#111827",
863
842
  markdownHeading: "#111827",
864
- markdownLink: "#0369a1",
843
+ markdownLink: BRAND_BLUE,
865
844
  markdownLinkText: "#15803d",
866
845
  markdownCode: "#15803d",
867
846
  markdownBlockQuote: "#a16207",
@@ -874,8 +853,8 @@ var LIGHT_TUI_THEME = {
874
853
  markdownImageText: "#15803d",
875
854
  markdownCodeBlock: "#15803d",
876
855
  syntaxComment: "#64748b",
877
- syntaxKeyword: "#0369a1",
878
- syntaxFunction: "#0369a1",
856
+ syntaxKeyword: BRAND_BLUE,
857
+ syntaxFunction: BRAND_BLUE,
879
858
  syntaxVariable: "#111827",
880
859
  syntaxString: "#15803d",
881
860
  syntaxNumber: "#a16207",
@@ -28213,7 +28192,9 @@ var dcodeSessionGoalStatsSchema = external_exports.object({
28213
28192
  tokensUsed: external_exports.number().int().nonnegative(),
28214
28193
  tokenBudget: external_exports.number().int().positive().nullable(),
28215
28194
  contextUsed: external_exports.number().int().nonnegative(),
28216
- contextWindow: external_exports.number().int().nonnegative(),
28195
+ // 尚无任何模型事件时窗口未知(投影不再合成 200000 默认值,见 core 的
28196
+ // initialSessionProjection 注释);与 v4 usage.contextWindow.maxTokens 的 optional 语义对齐。
28197
+ contextWindow: external_exports.number().int().nonnegative().optional(),
28217
28198
  toolCallCount: external_exports.number().int().nonnegative(),
28218
28199
  iterationCount: external_exports.number().int().nonnegative()
28219
28200
  }).strict();
@@ -28271,7 +28252,8 @@ var dcodeSessionProjectionSchema = external_exports.object({
28271
28252
  turnCount: external_exports.number().int().nonnegative(),
28272
28253
  totalTokenCount: external_exports.number().int().nonnegative(),
28273
28254
  contextUsed: external_exports.number().int().nonnegative(),
28274
- contextWindow: external_exports.number().int().nonnegative(),
28255
+ // 首个模型事件前窗口未知(旧版投影写死 200000,会把 1M 模型显示错);缺席即未知。
28256
+ contextWindow: external_exports.number().int().nonnegative().optional(),
28275
28257
  currentTurnId: nonEmptyString5.optional(),
28276
28258
  pendingPermissions: external_exports.array(dcodePendingPermissionSchema),
28277
28259
  activeToolCalls: external_exports.array(dcodeActiveToolCallSchema),
@@ -28428,7 +28410,9 @@ var dcodeProtocolErrorDetailSchema = external_exports.object({
28428
28410
  }).strict();
28429
28411
  var dcodeSessionCreatedEventPayloadSchema = external_exports.object({
28430
28412
  mode: dcodeSessionModeSchema,
28431
- contextWindow: external_exports.number().int().nonnegative()
28413
+ // 冷恢复 hydrate 不知道历史窗口时保持未知,不合成默认分母(见 contracts 的
28414
+ // initialSessionProjection 注释)。
28415
+ contextWindow: external_exports.number().int().nonnegative().optional()
28432
28416
  }).strict();
28433
28417
  var dcodeSessionResumedEventPayloadSchema = external_exports.object({
28434
28418
  directory: nonEmptyString5,
@@ -32543,6 +32527,10 @@ var locationSchema = external_exports.object({
32543
32527
  // src/app-model-ref.ts
32544
32528
  var MODEL_REF_SEPARATOR = "/";
32545
32529
  var UNKNOWN_MODEL_FIELD = "-";
32530
+ var MODEL_DISPLAY_NAMES = {
32531
+ "raven-max": "Raven Max",
32532
+ "raven-flash": "Raven Flash"
32533
+ };
32546
32534
  function modelDisplayParts(modelSelection) {
32547
32535
  const value = modelSelection.trim();
32548
32536
  if (!value) {
@@ -32554,12 +32542,13 @@ function modelDisplayParts(modelSelection) {
32554
32542
  const separatorIndex = value.indexOf(MODEL_REF_SEPARATOR);
32555
32543
  if (separatorIndex <= 0) {
32556
32544
  return {
32557
- model: value,
32545
+ model: MODEL_DISPLAY_NAMES[value] ?? value,
32558
32546
  provider: UNKNOWN_MODEL_FIELD
32559
32547
  };
32560
32548
  }
32549
+ const modelId = value.slice(separatorIndex + MODEL_REF_SEPARATOR.length).trim();
32561
32550
  return {
32562
- model: value.slice(separatorIndex + MODEL_REF_SEPARATOR.length).trim() || UNKNOWN_MODEL_FIELD,
32551
+ model: (modelId ? MODEL_DISPLAY_NAMES[modelId] : void 0) ?? modelId ?? UNKNOWN_MODEL_FIELD,
32563
32552
  provider: value.slice(0, separatorIndex).trim() || UNKNOWN_MODEL_FIELD
32564
32553
  };
32565
32554
  }
@@ -53241,7 +53230,10 @@ var BashInputSchema = external_exports2.object({
53241
53230
  /**
53242
53231
  * Optional timeout in milliseconds (max 600000)
53243
53232
  */
53244
- timeout: semanticNumber(external_exports2.number().int().positive().max(MAX_BASH_TIMEOUT_MS)).optional().describe(`Optional timeout in milliseconds (max ${MAX_BASH_TIMEOUT_MS})`),
53233
+ // 0 是合法输入:运行时 resolver 把 0/缺省一并解释为「用策略默认值」,
53234
+ // 因此这里只拦负数,不拦 0。.int() 之外不用 positive(),否则模型传
53235
+ // timeout: 0 会在 Zod 层直接报错,根本走不到上面那个兜底。
53236
+ timeout: semanticNumber(external_exports2.number().int().min(0).max(MAX_BASH_TIMEOUT_MS)).optional().describe(`Optional timeout in milliseconds (max ${MAX_BASH_TIMEOUT_MS})`),
53245
53237
  /**
53246
53238
  * Clear, concise description of what this command does in active voice.
53247
53239
  * Never use words like "complex" or "risk" in the description - just describe what it does.