@chatcode/chatcode-cli 3.0.2 → 3.0.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.
- package/README.i18n.yaml +6 -6
- package/README.md +11 -1
- package/README.zh.md +11 -1
- package/lib/bin.js +11 -67
- package/lib/{command-errors-CIYn1nnW.js → command-errors-CBJRI2gy.js} +12 -12
- package/lib/{command-trees-8o99Bws7.js → command-trees-Dvq4C7a4.js} +2 -2
- package/lib/{component-identity-CnmIKHEF.js → component-identity-DPdJglJO.js} +3 -3
- package/lib/{dist-DxjlHHph.js → dist-w_sIm4VD.js} +203 -197
- package/lib/dsh-ecosystem-spec/protocols/profile-definitions.d.ts +13 -0
- package/lib/dsh-ecosystem-spec/protocols/profile-definitions.js +59 -0
- package/lib/dsh-ecosystem-spec/protocols/tui-channel-http.d.ts +15 -0
- package/lib/dsh-ecosystem-spec/protocols/tui-channel-http.js +32 -0
- package/lib/dsh-ecosystem-spec/protocols/tui-channel.d.ts +59 -0
- package/lib/dsh-ecosystem-spec/protocols/tui-channel.js +166 -0
- package/lib/dsh-ecosystem-spec/protocols/tui-contributions.d.ts +42 -0
- package/lib/dsh-ecosystem-spec/protocols/tui-contributions.js +143 -0
- package/lib/dsh-ecosystem-spec/registry/README.md +14 -0
- package/lib/dsh-ecosystem-spec/registry/contracts/decision-events-v1alpha1.json +13 -0
- package/lib/dsh-ecosystem-spec/registry/contracts/scene-v1alpha1.json +13 -0
- package/lib/dsh-ecosystem-spec/registry/contracts/settings-section-v1alpha1.json +13 -0
- package/lib/dsh-ecosystem-spec/registry/contracts/tui-channel-v1alpha1.json +30 -0
- package/lib/dsh-ecosystem-spec/registry/contracts/workspace-provider-v1alpha1.json +6 -0
- package/lib/dsh-ecosystem-spec/registry/host-descriptor.tui.example.json +56 -0
- package/lib/dsh-ecosystem-spec/registry/permissions-0.1.json +13 -0
- package/lib/dsh-ecosystem-spec/registry/registry-0.15.json +149 -0
- package/lib/dsh-ecosystem-spec/schemas/conformance-claim.schema.json +15 -0
- package/lib/dsh-ecosystem-spec/schemas/effect-ledger-record.schema.json +16 -0
- package/lib/dsh-ecosystem-spec/schemas/host-descriptor.schema.json +26 -0
- package/lib/{dump-config-BSTrhTT_.js → dump-config-CauO75nE.js} +1 -1
- package/lib/dump-config-CijLv_kn.js +2 -0
- package/lib/{dump-config-schema-Cz4A13GB.js → dump-config-schema-CObLWWaW.js} +2 -2
- package/lib/{extension-events-DciGPKJa.js → extension-events-Be9LWvHD.js} +20 -20
- package/lib/{home-migration-DLaSvmfn.js → home-migration-BjDmRwBB.js} +23 -4
- package/lib/{host-access-CmD27uhQ.js → host-access-DeCjoRQP.js} +1 -1
- package/lib/{keymap-CFChEJ2W.js → keymap-CRUxM_qn.js} +2 -2
- package/lib/{plugin-jvd9PCVt.js → plugin-CDFSDE_y.js} +1491 -743
- package/lib/{plugin-DYHtreEd.js → plugin-Cn-hyYY8.js} +1 -1
- package/lib/{profile-boot-Blq7uqhx.js → profile-boot-SJGbpLgN.js} +13 -1
- package/lib/profile-boot.js +1 -1
- package/lib/{scenes-ai_8sHDs.js → scenes-D6jV1EEi.js} +3 -3
- package/lib/{settings-sections-QQ1-2lhL.js → settings-sections-DJQRNBo9.js} +3 -3
- package/lib/startup-diagnostics-C_hRCp-q.js +91 -0
- package/lib/{themes-DTzG_9I_.js → themes-BCly4_y9.js} +12 -12
- package/lib/tui-compat-command-trees.js +1 -1
- package/lib/tui-compat-extensions.js +4 -4
- package/lib/tui-compat-plugin-host.js +5 -5
- package/lib/tui-compat-scenes.js +1 -1
- package/lib/tui-compat-settings-sections.js +1 -1
- package/lib/tui-compat-working-activity.js +1 -1
- package/lib/tui-compat-workspaces.js +1 -1
- package/lib/tui-compat.js +41 -9
- package/lib/{tuiDisplayPrefs-BCHRRcfe.js → tuiDisplayPrefs-Dm_fULiR.js} +44 -2
- package/lib/types/home-migration.d.ts +8 -0
- package/lib/types/startup-diagnostics.d.ts +13 -0
- package/lib/types/tui-compat.d.ts +2 -0
- package/lib/{workspaces-CznCgVHv.js → workspaces-Bb3kCAFb.js} +2 -2
- package/package.json +40 -34
- package/runtime/manifest.json +2 -6
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/client.js +2 -2
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/client.js +1 -1
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/client.js +1 -1
- package/runtime/node_modules/@deepseek-ai/dsh-compaction-basic/lib/index.js +84 -8
- package/runtime/node_modules/@deepseek-ai/dsh-compaction-basic/lib/types/region.d.ts +9 -0
- package/runtime/node_modules/@deepseek-ai/dsh-compaction-basic/lib/types/summarizer.d.ts +7 -0
- package/runtime/node_modules/@deepseek-ai/dsh-session-log-export/lib/client.js +3 -8
- package/runtime/node_modules/@deepseek-ai/dsh-session-log-export/lib/types/client/HeaderAction.d.ts +1 -1
- package/runtime/node_modules/@deepseek-ai/dsh-skill/lib/types/index.d.ts +1 -1
- package/runtime/node_modules/@deepseek-ai/dsh-skill-filesystem/lib/index.js +7 -1
- package/runtime/node_modules/@deepseek-ai/dsh-web-app/presets/cordis.patch.yml +2 -1
- package/runtime/node_modules/@deepseek-ai/dsh-web-app/presets/ptc.patch.yml +2 -1
- package/runtime/node_modules/@deepseek-ai/dsh-web-app/presets/standard.patch.yml +2 -1
- package/lib/dump-config-DBW7YLx-.js +0 -2
- package/runtime/node_modules/@deepseek-ai/node-addon-system-darwin-arm64/README.md +0 -9
- package/runtime/node_modules/@deepseek-ai/node-addon-system-darwin-arm64/bin/system.node +0 -0
- package/runtime/node_modules/@deepseek-ai/node-addon-system-darwin-arm64/package.json +0 -31
- package/runtime/node_modules/@deepseek-ai/node-addon-system-darwin-arm64/prebuilds.json +0 -6
- package/runtime/node_modules/@deepseek-ai/node-addon-system-darwin-x64/README.md +0 -9
- package/runtime/node_modules/@deepseek-ai/node-addon-system-darwin-x64/package.json +0 -31
- package/runtime/node_modules/@deepseek-ai/node-addon-system-darwin-x64/prebuilds.json +0 -6
- package/runtime/node_modules/@deepseek-ai/node-addon-system-linux-arm64/README.md +0 -11
- package/runtime/node_modules/@deepseek-ai/node-addon-system-linux-arm64/package.json +0 -31
- package/runtime/node_modules/@deepseek-ai/node-addon-system-linux-arm64/prebuilds.json +0 -24
- package/runtime/node_modules/@deepseek-ai/node-addon-system-linux-x64/README.md +0 -11
- package/runtime/node_modules/@deepseek-ai/node-addon-system-linux-x64/package.json +0 -31
- package/runtime/node_modules/@deepseek-ai/node-addon-system-linux-x64/prebuilds.json +0 -24
package/README.i18n.yaml
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
# After editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write apps/cli/README.md
|
|
5
5
|
/chatcode-chatcode-cli:
|
|
6
|
-
en:
|
|
7
|
-
zh:
|
|
6
|
+
en: 5fe3726943c8a3e3
|
|
7
|
+
zh: f536c264e5300f4c
|
|
8
8
|
/chatcode-chatcode-cli/entry-modes:
|
|
9
9
|
en: 7ce3e97e896c5faa
|
|
10
10
|
zh: c78d6da95592692d
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
en: 6267304ad0acefab
|
|
13
13
|
zh: cd0dd269d0608a46
|
|
14
14
|
/chatcode-chatcode-cli/profiles:
|
|
15
|
-
en:
|
|
16
|
-
zh:
|
|
15
|
+
en: 0277909432b9078b
|
|
16
|
+
zh: 56b369c075a65aba
|
|
17
17
|
/chatcode-chatcode-cli/optional-overlays:
|
|
18
18
|
en: 3a40ddc44e55f79c
|
|
19
19
|
zh: 8d3949132e1ef93c
|
|
20
20
|
/chatcode-chatcode-cli/development:
|
|
21
|
-
en:
|
|
22
|
-
zh:
|
|
21
|
+
en: 60435baa6e089453
|
|
22
|
+
zh: 1e602590c259b6eb
|
package/README.md
CHANGED
|
@@ -4,6 +4,8 @@ English | [中文](README.zh.md)
|
|
|
4
4
|
|
|
5
5
|
`chatcode-cli` is the formal launcher and `cco` is its short form; both commands share one parser and start the TUI/CLI profile when invoked without arguments. Profiles are ordered stacks of plugin-bundle patch layers under the user's own overrides. SDK and ACP are profiles, not separate public bins. The Python runtime wheel packages the same launcher; the SDK defaults to `sdk`, and the minimal example selects `sdk-minimal`. [`src/args.ts`](src/args.ts) owns the command grammar, and [`src/bin.ts`](src/bin.ts) loads only the selected runner. Invalid commands, options from another mode, and fatal configuration or boot failures exit nonzero.
|
|
6
6
|
|
|
7
|
+
The pinned TUI supports Harness live-Config settings directly: `/settings`, `/statusline`, `/keybindings`, and provider configuration use the active profile settings service, with live display changes preserving the current session. No separate TUI dependency patch is required.
|
|
8
|
+
|
|
7
9
|
## Entry modes
|
|
8
10
|
|
|
9
11
|
| Command | Purpose |
|
|
@@ -57,8 +59,16 @@ Bundles named in `dsh.profile.bundles` resolve from the ChatCode CLI installatio
|
|
|
57
59
|
|
|
58
60
|
On Harness 0.1.7, the default `cli` profile uses the declarative Agent preset registry and reuses the shipped `standard`, `ptc`, `minimal`, and `cordis` definitions. Only the TUI's directory-backed compatibility row for older Harness lines is disabled in that composition; the Web profile, user patches, and other plugin layers are unchanged.
|
|
59
61
|
|
|
62
|
+
After sign-in succeeds, an empty model catalog still opens the CLI for history and settings. Select a model with `/model` or configure a provider with `/provider` before sending.
|
|
63
|
+
|
|
64
|
+
The TUI waits for the shared model-default service before creating its first session. The ChatCode model bundle supplies the first runnable CodingPlan model for a fresh installation; saved choices and explicit model overrides retain precedence.
|
|
65
|
+
|
|
60
66
|
Use `--dump-default-config` and `--dump-config` to inspect the composed tree without booting it. `--dump-config-schema` imports the composed tree's declared plugin schemas and prints JSON Schema for entries and patches instead of configuration values; read the [schema-dump safety and scope](reference/README.md#config-schema-dump) before inspecting untrusted plugins.
|
|
61
67
|
|
|
68
|
+
The legacy-data startup reminder checks only the top-level entries of the old homes. It does not traverse sessions or plugin dependencies, read their contents, or compute migration fingerprints. Retained legacy data can still trigger the reminder after copying; `chatcode-cli migrate --dry-run` performs the full destination comparison.
|
|
69
|
+
|
|
70
|
+
Set `CHATCODE_CLI_STARTUP_TRACE=1` to print phase and plugin activation durations to stderr for either `cco` or `cco web`. A `begin` line without a matching duration identifies unfinished work. Tracing is off by default and records labels and elapsed times, not environment values or plugin configuration.
|
|
71
|
+
|
|
62
72
|
The [CLI behavior reference](reference/README.md) owns exact layer precedence, flags, shutdown behavior, deployment defaults, and source execution. The [startup and reload failure table](../../packages/boot/app-boot/README.md#startup-and-reload-failures) compares optional and required plugin failures with configuration HMR.
|
|
63
73
|
|
|
64
74
|
## Optional overlays
|
|
@@ -71,7 +81,7 @@ Production runs require built package and frontend artifacts. From the repositor
|
|
|
71
81
|
|
|
72
82
|
The published CLI directly pins every Harness runtime package referenced by the base/Web bundles and every required peer of its bundled ChatCode plugins. Keep those entries on the same Harness release when publishing: npm's global installer does not preserve pnpm workspace peer unification, and otherwise may hoist an older ABI beside the current runtime.
|
|
73
83
|
|
|
74
|
-
The npm artifact carries fork-owned packages under `runtime/node_modules` and lists them in `runtime/manifest.json`. Profile startup includes
|
|
84
|
+
The npm artifact carries fork-owned JavaScript packages under `runtime/node_modules` and lists them in `runtime/manifest.json`. Platform-specific `node-addon-system` binaries remain exact-version optional npm dependencies, selected for the installation host; they are excluded from the embedded runtime. It also carries the TUI admission registry, protocols, and schemas under `lib/dsh-ecosystem-spec`, where command authorization reads its permission defaults before applying the user's grants file. Profile startup includes the complete runtime package list when resolving presets and plugins, including packages absent from the slim npm dependency list. The launcher resolves embedded packages in memory for both ESM and CommonJS, including imports from external plugins. Startup does not modify the installation directory, so a root-owned installation can be launched by an ordinary user with read access; the user still needs a writable ChatCode CLI home. CLI and Web share the [startup model preference](../../packages/core/agent-default-model/README.md); already running frontends do not switch each other's model.
|
|
75
85
|
|
|
76
86
|
The `@chatcode/chatcode-cli/profile-boot` export provides the shared profile lifecycle to the Desktop host. A resolved application profile supplies its own installation anchor for runtime package resolution while retaining the ChatCode CLI home patch, proxy environment, telemetry switch, patch reload, and bounded shutdown.
|
|
77
87
|
|
package/README.zh.md
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
`chatcode-cli` 是正式启动命令,`cco` 是其简写;两者共用同一解析器,且无参数时都启动 TUI/CLI profile。profile 由多个插件组合包 patch 层按顺序叠加而成,其上再应用用户自己的覆盖配置。SDK 与 ACP(Agent Client Protocol)都是 profile,而不是独立的公开可执行命令。Python 运行时 wheel 包中也包含同一个启动器;SDK 默认使用 `sdk`,极简示例选择 `sdk-minimal`。[`src/args.ts`](src/args.ts) 负责命令语法,[`src/bin.ts`](src/bin.ts) 只加载选中的运行器。无效命令、来自其他模式的选项,以及致命的配置或启动错误都会以非零状态退出。
|
|
6
6
|
|
|
7
|
+
固定版本的 TUI 直接支持 Harness 动态配置设置:`/settings`、`/statusline`、`/keybindings` 及供应商配置使用当前 profile 的设置服务,显示偏好即时更新且保留当前会话。无需额外的 TUI 依赖补丁。
|
|
8
|
+
|
|
7
9
|
## 入口模式
|
|
8
10
|
|
|
9
11
|
| 命令 | 用途 |
|
|
@@ -57,8 +59,16 @@ profile 目录包含一个 `package.json`,其中记录树外插件依赖,以
|
|
|
57
59
|
|
|
58
60
|
默认 `cli` profile 在 Harness 0.1.7 上使用声明式 Agent 预设注册器,并复用随附的 `standard`、`ptc`、`minimal` 与 `cordis` 四套预设定义。旧版 TUI 中用于兼容早期 Harness 的目录式预设行只在该组合中停用;Web profile、用户 patch 与其他插件层不受影响。
|
|
59
61
|
|
|
62
|
+
登录验证通过后,即使模型目录为空也能进入 CLI 查看历史和修改设置;发送前通过 `/model` 选择模型或通过 `/provider` 配置提供方。
|
|
63
|
+
|
|
64
|
+
TUI 等待共用默认模型服务就绪后才创建首个会话。ChatCode 模型组合包为首次安装提供第一个可调用的 CodingPlan 模型;已保存的选择和显式模型覆盖仍然优先。
|
|
65
|
+
|
|
60
66
|
使用 `--dump-default-config` 和 `--dump-config` 可在不启动的情况下检查组合后的配置树。`--dump-config-schema` 会导入组合树中插件声明的 schema,并打印描述 entry 与 patch 的 JSON Schema,而不是配置值;检查不受信任的插件前,请阅读 [schema dump 的安全性与范围](reference/README.zh.md#config-schema-dump)。
|
|
61
67
|
|
|
68
|
+
启动时的旧数据提醒只检查旧 home 目录的顶层条目,不遍历会话或插件依赖、不读取其文件内容,也不计算迁移指纹。复制后保留的旧数据仍可能触发提醒;`chatcode-cli migrate --dry-run` 才执行完整的目标目录对比。
|
|
69
|
+
|
|
70
|
+
设置 `CHATCODE_CLI_STARTUP_TRACE=1`,即可在运行 `cco` 或 `cco web` 时向 stderr 输出启动阶段与插件激活耗时。只有 `begin` 而没有对应耗时的条目表示尚未完成的工作。默认不启用诊断;日志只记录标签与耗时,不记录环境变量值或插件配置。
|
|
71
|
+
|
|
62
72
|
层的确切优先级、flag、关闭行为、部署默认值和源码执行方式,以 [CLI 行为参考](reference/README.zh.md)为准。[启动与重载失败表](../../packages/boot/app-boot/README.zh.md#startup-and-reload-failures)对比 optional、required 插件启动失败与配置 HMR 的行为。
|
|
63
73
|
|
|
64
74
|
## 可选覆盖层
|
|
@@ -71,7 +81,7 @@ profile 目录包含一个 `package.json`,其中记录树外插件依赖,以
|
|
|
71
81
|
|
|
72
82
|
发布版 CLI 会直接固定 base/Web 组合包实际引用的所有 Harness 运行时包,以及随附 ChatCode 插件的全部必需 peer。发布时必须让这些依赖保持在同一个 Harness 版本:npm 全局安装不会保留 pnpm workspace 对 peer 的统一解析,否则可能把旧 ABI 提升到顶层并与当前运行时混用。
|
|
73
83
|
|
|
74
|
-
npm
|
|
84
|
+
npm 产物把分支自有的 JavaScript 包放在 `runtime/node_modules`,并通过 `runtime/manifest.json` 列出它们。各平台的 `node-addon-system` 二进制使用固定版本的 npm 可选依赖,由安装器按目标机器的平台选择,不加入内嵌 runtime。产物还在 `lib/dsh-ecosystem-spec` 中携带 TUI 准入注册表、协议和 schema;命令授权先从该目录读取权限默认值,再应用用户的授权文件。Profile 启动解析预设和插件时使用完整的运行时包列表,包括精简 npm 依赖列表中没有的包。启动器在内存中统一解析内嵌包的 ESM 与 CommonJS 导入,也覆盖外部插件的导入。启动不会修改安装目录,因此普通用户只需对 root 安装的目录具有读取权限;用户自己的 ChatCode CLI home 仍须可写。CLI 与 Web 共用[启动模型偏好](../../packages/core/agent-default-model/README.zh.md);已运行的两端不会互相切换模型。
|
|
75
85
|
|
|
76
86
|
`@chatcode/chatcode-cli/profile-boot` 导出向 Desktop Host 提供共享 profile 生命周期。已解析的应用 profile 为运行时包解析指定自己的安装锚点,同时沿用 ChatCode CLI home patch、代理环境、遥测开关、patch 热重载和有界关闭。
|
|
77
87
|
|
package/lib/bin.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { i as synchronizeLegacyHomeEnvironment, r as resolveChatCodeCliHome } from "./chatcode-home-B93iESZd.js";
|
|
3
|
+
import { n as startStartupPhase, t as reportStartupFailure } from "./startup-diagnostics-C_hRCp-q.js";
|
|
3
4
|
import { readFileSync } from "node:fs";
|
|
4
5
|
import { fileURLToPath } from "node:url";
|
|
5
6
|
import { StartupError, loadLayeredEnv } from "@deepseek-ai/dsh-app-boot";
|
|
6
7
|
import { Command, CommanderError, InvalidArgumentError } from "commander";
|
|
7
|
-
import { join } from "node:path";
|
|
8
|
-
import { randomUUID } from "node:crypto";
|
|
9
|
-
import { mkdir, writeFile } from "node:fs/promises";
|
|
10
|
-
import { inspect } from "node:util";
|
|
11
8
|
//#region lib/types/args.js
|
|
12
9
|
/**
|
|
13
10
|
* Commander adapter for the ChatCode CLI launcher.
|
|
@@ -197,63 +194,6 @@ function parseChatCodeCliArgs(argv, version) {
|
|
|
197
194
|
return routeLegacyPrint(resolved, argv);
|
|
198
195
|
}
|
|
199
196
|
//#endregion
|
|
200
|
-
//#region lib/types/startup-diagnostics.js
|
|
201
|
-
/** Save original startup diagnostics while keeping the terminal report concise. */
|
|
202
|
-
/** Wait for stderr to finish the write before the failed process exits. */
|
|
203
|
-
function writeStderr(text) {
|
|
204
|
-
return new Promise((resolve, reject) => {
|
|
205
|
-
process.stderr.write(text, (error) => {
|
|
206
|
-
if (error) reject(error);
|
|
207
|
-
else resolve();
|
|
208
|
-
});
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
/**
|
|
212
|
-
* Print the startup summary and save a private, uniquely named report under DSH_HOME/logs.
|
|
213
|
-
* Failed writes print the complete report to stderr instead of claiming a saved path.
|
|
214
|
-
* @param error - startup audit failure retaining plugin metadata and original errors.
|
|
215
|
-
* @param context - resolved Harness home, application version, and selected profile.
|
|
216
|
-
* @param write - terminal output sink; awaited before returning, defaults to stderr.
|
|
217
|
-
* @returns after saving or printing the report and completing terminal writes.
|
|
218
|
-
*/
|
|
219
|
-
async function reportStartupFailure(error, context, write = writeStderr) {
|
|
220
|
-
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
221
|
-
const report = "WARNING: Raw diagnostics may contain configuration or credential values from plugin errors. Review before sharing.\n\n" + inspect({
|
|
222
|
-
timestamp: now,
|
|
223
|
-
dshVersion: context.version,
|
|
224
|
-
nodeVersion: process.version,
|
|
225
|
-
platform: process.platform,
|
|
226
|
-
arch: process.arch,
|
|
227
|
-
profile: context.profile,
|
|
228
|
-
error
|
|
229
|
-
}, {
|
|
230
|
-
depth: null,
|
|
231
|
-
maxArrayLength: null,
|
|
232
|
-
maxStringLength: null,
|
|
233
|
-
showHidden: true,
|
|
234
|
-
customInspect: false,
|
|
235
|
-
getters: false,
|
|
236
|
-
colors: false
|
|
237
|
-
}) + "\n";
|
|
238
|
-
await write(`${error.message}\n`);
|
|
239
|
-
const logDir = join(context.home, "logs");
|
|
240
|
-
const logPath = join(logDir, `startup-${now.replaceAll(":", "-")}-${randomUUID()}.log`);
|
|
241
|
-
try {
|
|
242
|
-
await mkdir(logDir, {
|
|
243
|
-
recursive: true,
|
|
244
|
-
mode: 448
|
|
245
|
-
});
|
|
246
|
-
await writeFile(logPath, report, {
|
|
247
|
-
flag: "wx",
|
|
248
|
-
mode: 384
|
|
249
|
-
});
|
|
250
|
-
} catch (writeError) {
|
|
251
|
-
await write(`\ndsh: warning: could not write startup diagnostics: ${String(writeError)}\nFull diagnostics:\n${report}`);
|
|
252
|
-
return;
|
|
253
|
-
}
|
|
254
|
-
await write(`\nFull diagnostics: ${logPath}\n`);
|
|
255
|
-
}
|
|
256
|
-
//#endregion
|
|
257
197
|
//#region lib/types/bin.js
|
|
258
198
|
/**
|
|
259
199
|
* Command-line entry for ChatCode CLI.
|
|
@@ -287,13 +227,17 @@ async function runCli() {
|
|
|
287
227
|
const invocation = parseChatCodeCliArgs(process.argv.slice(2), version);
|
|
288
228
|
switch (invocation.mode) {
|
|
289
229
|
case "profile": {
|
|
230
|
+
const finishLegacyProbe = startStartupPhase("legacy-home-probe");
|
|
290
231
|
const legacyHome = process.env.DSH_HOME?.trim();
|
|
291
232
|
if (!isLegacyPrintInvocation(invocation) && (process.env.CHATCODE_CLI_HOME?.trim() || legacyHome === void 0 || legacyHome === "")) {
|
|
292
|
-
const {
|
|
293
|
-
if (
|
|
233
|
+
const { hasLegacyHomeData, resolveHomeMigrationRoots } = await import("./home-migration-BjDmRwBB.js");
|
|
234
|
+
if (await hasLegacyHomeData(resolveHomeMigrationRoots())) process.stderr.write("ChatCode CLI detected legacy user data. Preview the non-destructive migration with \"chatcode-cli migrate --dry-run\"; nothing is migrated automatically.\n");
|
|
294
235
|
}
|
|
236
|
+
finishLegacyProbe();
|
|
295
237
|
synchronizeLegacyHomeEnvironment();
|
|
238
|
+
const finishProfileImport = startStartupPhase("profile-module-import");
|
|
296
239
|
const { runProfile } = await import("./profile-boot.js");
|
|
240
|
+
finishProfileImport();
|
|
297
241
|
try {
|
|
298
242
|
await runProfile({
|
|
299
243
|
environment: loadLayeredEnv("ChatCode CLI"),
|
|
@@ -314,7 +258,7 @@ async function runCli() {
|
|
|
314
258
|
break;
|
|
315
259
|
}
|
|
316
260
|
case "migrate": {
|
|
317
|
-
const { applyHomeMigration, formatHomeMigrationPlan, planHomeMigration, resolveHomeMigrationRoots } = await import("./home-migration-
|
|
261
|
+
const { applyHomeMigration, formatHomeMigrationPlan, planHomeMigration, resolveHomeMigrationRoots } = await import("./home-migration-BjDmRwBB.js");
|
|
318
262
|
const roots = resolveHomeMigrationRoots();
|
|
319
263
|
const migrations = [[roots.source, roots.destination], [roots.tuiSource, roots.tuiDestination]];
|
|
320
264
|
if (!invocation.apply) {
|
|
@@ -332,17 +276,17 @@ async function runCli() {
|
|
|
332
276
|
break;
|
|
333
277
|
}
|
|
334
278
|
case "plugin": {
|
|
335
|
-
const { runPlugin } = await import("./plugin-
|
|
279
|
+
const { runPlugin } = await import("./plugin-Cn-hyYY8.js");
|
|
336
280
|
process.exit(await runPlugin(invocation.profile, invocation.args));
|
|
337
281
|
break;
|
|
338
282
|
}
|
|
339
283
|
case "dump-config": {
|
|
340
|
-
const { runDumpConfig } = await import("./dump-config-
|
|
284
|
+
const { runDumpConfig } = await import("./dump-config-CijLv_kn.js");
|
|
341
285
|
runDumpConfig(invocation.profile, invocation.defaultOnly, invocation.patches, invocation.fromDefaultProfile);
|
|
342
286
|
break;
|
|
343
287
|
}
|
|
344
288
|
case "dump-config-schema": {
|
|
345
|
-
const { runDumpConfigSchema } = await import("./dump-config-schema-
|
|
289
|
+
const { runDumpConfigSchema } = await import("./dump-config-schema-CObLWWaW.js");
|
|
346
290
|
await runDumpConfigSchema(invocation.profile, invocation.patches, invocation.fromDefaultProfile);
|
|
347
291
|
break;
|
|
348
292
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { a as compositionRoot, i as bindCallerEffect, o as concreteService, r as assertCallerContext, t as activationContext } from "./host-access-
|
|
2
|
-
import { a as declaresPermission, d as normalizePermissionScope, i as declaresObserverScope, m as scopeCovers, n as componentIdentityOf, o as requireComponentIdentity, p as rawScopeCovers, s as requiresContract, u as INTERCEPT_PERMISSIONS } from "./component-identity-
|
|
3
|
-
import { B as createAdmissionCatalog, G as validateSetInput, H as validateDeleteOutput, K as validateSetOutput, L as TUI_DECISION_EVENT_NAMES, M as loadSpecData, N as registryEntries, P as verifyContractProfiles, S as DATA_DIR, U as validateGetInput, V as validateDeleteInput, W as validateGetOutput, X as defineProtocolDeclaration, Y as projectManifest, j as digestFile, p as cleanScalarText, q as validateMessageEvent, x as readGrantStore } from "./extension-events-
|
|
1
|
+
import { a as compositionRoot, i as bindCallerEffect, o as concreteService, r as assertCallerContext, t as activationContext } from "./host-access-DeCjoRQP.js";
|
|
2
|
+
import { a as declaresPermission, d as normalizePermissionScope, i as declaresObserverScope, m as scopeCovers, n as componentIdentityOf, o as requireComponentIdentity, p as rawScopeCovers, s as requiresContract, u as INTERCEPT_PERMISSIONS } from "./component-identity-DPdJglJO.js";
|
|
3
|
+
import { B as createAdmissionCatalog, G as validateSetInput, H as validateDeleteOutput, K as validateSetOutput, L as TUI_DECISION_EVENT_NAMES, M as loadSpecData, N as registryEntries, P as verifyContractProfiles, S as DATA_DIR, U as validateGetInput, V as validateDeleteInput, W as validateGetOutput, X as defineProtocolDeclaration, Y as projectManifest, j as digestFile, p as cleanScalarText, q as validateMessageEvent, x as readGrantStore } from "./extension-events-Be9LWvHD.js";
|
|
4
4
|
import { appendFileSync, mkdirSync, readFileSync } from "node:fs";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
import { dirname, join } from "node:path";
|
|
7
7
|
import { Service } from "@deepseek-ai/cordis";
|
|
8
8
|
import { withFileLock, writeFileAtomic } from "@deepseek-ai/dsh-atomic-write";
|
|
9
|
-
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.
|
|
9
|
+
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.16_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/plugin-spec/validate.js
|
|
10
10
|
/** Semantic validation layered on the official manifest parser/projection. */
|
|
11
11
|
const coordinateKey$1 = (coordinate) => `${coordinate.apiVersion}#${coordinate.kind}`;
|
|
12
12
|
const groupOf = (apiVersion) => apiVersion.split("/")[0] ?? "";
|
|
@@ -124,7 +124,7 @@ function validateHost(index, host) {
|
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
//#endregion
|
|
127
|
-
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.
|
|
127
|
+
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.16_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/plugin-spec/negotiate.js
|
|
128
128
|
/** Five-state admission decision using dsh-std projection and ProtocolCatalog. */
|
|
129
129
|
const coordinateKey = (ref) => `${ref.apiVersion}#${ref.kind}`;
|
|
130
130
|
function negotiate(index, manifest, host, grants = []) {
|
|
@@ -197,7 +197,7 @@ function negotiate(index, manifest, host, grants = []) {
|
|
|
197
197
|
} : { decision: "compatible" };
|
|
198
198
|
}
|
|
199
199
|
//#endregion
|
|
200
|
-
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.
|
|
200
|
+
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.16_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/plugin-spec/schema-check.js
|
|
201
201
|
/**
|
|
202
202
|
* 零依赖 JSON Schema 校验器——上游 `conformance/tests/run.js` 的 check()
|
|
203
203
|
* 的保真 TS 移植。刻意只实现 vendored schemas 用到的子集:本地 $ref、
|
|
@@ -301,7 +301,7 @@ function check(value, schema, rootSchema = schema, where = "$") {
|
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
303
|
//#endregion
|
|
304
|
-
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.
|
|
304
|
+
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.16_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/host-descriptor.js
|
|
305
305
|
/** Build the current ChatCode CLI TUI Host Descriptor from the pinned admission profile. */
|
|
306
306
|
const HOST_SUPPORTED_CONTRACTS = Object.freeze([
|
|
307
307
|
{
|
|
@@ -453,7 +453,7 @@ function buildHostDescriptor(options) {
|
|
|
453
453
|
});
|
|
454
454
|
}
|
|
455
455
|
//#endregion
|
|
456
|
-
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.
|
|
456
|
+
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.16_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/effect-ledger.js
|
|
457
457
|
/**
|
|
458
458
|
* Effect ledger (C-060): an append-only JSONL journal of plugin-visible
|
|
459
459
|
* effects at `~/.chatcode-cli/tui/effect-ledger.jsonl`, mounted by the
|
|
@@ -645,7 +645,7 @@ function resumeSequence(file) {
|
|
|
645
645
|
return max + 1;
|
|
646
646
|
}
|
|
647
647
|
//#endregion
|
|
648
|
-
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.
|
|
648
|
+
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.16_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/plugin-storage.js
|
|
649
649
|
/**
|
|
650
650
|
* storage.local contract surface (C-040, `storage.dsh/v1alpha1#LocalStorage`):
|
|
651
651
|
* per-plugin private persistence, mounted by the dsh-tui-plugin-host row as
|
|
@@ -986,7 +986,7 @@ var TuiPluginStorageRuntime = class extends Service {
|
|
|
986
986
|
}
|
|
987
987
|
};
|
|
988
988
|
//#endregion
|
|
989
|
-
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.
|
|
989
|
+
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.16_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/message-observer.js
|
|
990
990
|
/**
|
|
991
991
|
* messages.observe contract surface (C-042,
|
|
992
992
|
* `messages.dsh/v1alpha1#MessageObserver`): the host event broker, mounted
|
|
@@ -1494,7 +1494,7 @@ function observerStateFor(runtime) {
|
|
|
1494
1494
|
return state;
|
|
1495
1495
|
}
|
|
1496
1496
|
//#endregion
|
|
1497
|
-
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.
|
|
1497
|
+
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.16_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/command-attribution.js
|
|
1498
1498
|
/**
|
|
1499
1499
|
* Command ownership attribution — the data source for the C-041 invoke
|
|
1500
1500
|
* checkpoint's per-owner grant decision.
|
|
@@ -1572,7 +1572,7 @@ function commandOwner(ctx, definition) {
|
|
|
1572
1572
|
return ownerMaps.get(key)?.get(handler);
|
|
1573
1573
|
}
|
|
1574
1574
|
//#endregion
|
|
1575
|
-
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.
|
|
1575
|
+
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.16_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/command-errors.js
|
|
1576
1576
|
/**
|
|
1577
1577
|
* commands contract error-code alignment (C-041,
|
|
1578
1578
|
* `commands.dsh/v1alpha1#Command`): the official `dsh-commands` runtime
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as compositionRoot, i as bindCallerEffect, n as activationFiber, o as concreteService, s as requirePluginCaller } from "./host-access-
|
|
1
|
+
import { a as compositionRoot, i as bindCallerEffect, n as activationFiber, o as concreteService, s as requirePluginCaller } from "./host-access-DeCjoRQP.js";
|
|
2
2
|
import { Service } from "@deepseek-ai/cordis";
|
|
3
|
-
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.
|
|
3
|
+
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.16_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/command-trees.js
|
|
4
4
|
/** Provider-neutral subcommand completion registry for terminal front doors. */
|
|
5
5
|
const name = "dsh-tui-command-trees";
|
|
6
6
|
/** Small host-only registry; command execution remains owned by dsh-commands. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as bindCallerEffect, n as activationFiber } from "./host-access-
|
|
1
|
+
import { i as bindCallerEffect, n as activationFiber } from "./host-access-DeCjoRQP.js";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
|
-
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.
|
|
3
|
+
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.16_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/plugin-spec/permission-scope.js
|
|
4
4
|
/** Permission scope normalization shared by admission and runtime checks. */
|
|
5
5
|
const STORAGE_PERMISSIONS = new Set(["storage.local.read", "storage.local.write"]);
|
|
6
6
|
const INTERCEPT_PERMISSIONS = new Set([
|
|
@@ -76,7 +76,7 @@ function rawScopeCovers(permission, declared, actual, componentId) {
|
|
|
76
76
|
return normalizedDeclared !== void 0 && normalizedActual !== void 0 && permissionScopeCovers(permission, normalizedDeclared, normalizedActual);
|
|
77
77
|
}
|
|
78
78
|
//#endregion
|
|
79
|
-
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.
|
|
79
|
+
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.16_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/component-identity.js
|
|
80
80
|
/** Verified Component identity bound to one Cordis activation owner. */
|
|
81
81
|
var ComponentIdentityError = class extends Error {
|
|
82
82
|
code;
|