@chatcode/chatcode-cli 3.0.2-rc.3 → 3.0.2-rc.5
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 +4 -4
- package/README.md +10 -0
- package/README.zh.md +10 -0
- package/lib/bin.js +11 -67
- package/lib/{command-errors-CIYn1nnW.js → command-errors-B-jCwfLt.js} +12 -12
- package/lib/{command-trees-8o99Bws7.js → command-trees-CdgUsoW4.js} +2 -2
- package/lib/{component-identity-CnmIKHEF.js → component-identity-ax93NpoH.js} +3 -3
- 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-DJTP1cCG.js} +20 -20
- package/lib/{home-migration-DLaSvmfn.js → home-migration-BjDmRwBB.js} +23 -4
- package/lib/{host-access-CmD27uhQ.js → host-access-D3lpiaUY.js} +1 -1
- package/lib/{keymap-CFChEJ2W.js → keymap-DAr6MX8m.js} +2 -2
- package/lib/{plugin-ChwScT9e.js → plugin-BGw2QmPK.js} +1357 -680
- 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-BeuL5ow2.js} +3 -3
- package/lib/{settings-sections-QQ1-2lhL.js → settings-sections-dGk8gNU7.js} +3 -3
- package/lib/startup-diagnostics-C_hRCp-q.js +91 -0
- package/lib/{themes-DTzG_9I_.js → themes-O-UQAfC7.js} +12 -12
- package/lib/tui-compat-command-trees.js +1 -1
- package/lib/tui-compat-extensions.js +3 -3
- 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-DdU4O_sF.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-CE18wA21.js} +2 -2
- package/package.json +29 -29
- package/runtime/manifest.json +1 -1
- 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 -4
- package/runtime/node_modules/@deepseek-ai/dsh-session-log-export/lib/types/client/HeaderAction.d.ts +1 -1
- package/lib/dump-config-DBW7YLx-.js +0 -2
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,8 +12,8 @@
|
|
|
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
|
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
|
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
|
## 可选覆盖层
|
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-D3lpiaUY.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-ax93NpoH.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-DJTP1cCG.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.14_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.14_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.14_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.14_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.14_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.14_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.14_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.14_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.14_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-D3lpiaUY.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.14_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-D3lpiaUY.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.14_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.14_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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as chatCodeProfilePatchFiles, f as prepareProfile, i as PROFILE_ROOT_FILENAME, s as homePatchPath } from "./profile-boot-
|
|
1
|
+
import { a as chatCodeProfilePatchFiles, f as prepareProfile, i as PROFILE_ROOT_FILENAME, s as homePatchPath } from "./profile-boot-SJGbpLgN.js";
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
3
|
import { loadOptionalPatches, loadOverlayPatches, renderConfigDump } from "@deepseek-ai/dsh-app-boot";
|
|
4
4
|
import { join, resolve } from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { f as prepareProfile, r as INSTALL_ANCHOR } from "./profile-boot-
|
|
2
|
-
import { t as collectConfigDumpLayers } from "./dump-config-
|
|
1
|
+
import { f as prepareProfile, r as INSTALL_ANCHOR } from "./profile-boot-SJGbpLgN.js";
|
|
2
|
+
import { t as collectConfigDumpLayers } from "./dump-config-CauO75nE.js";
|
|
3
3
|
import { generateConfigSchema } from "@deepseek-ai/dsh-app-boot";
|
|
4
4
|
//#region lib/types/dump-config-schema.js
|
|
5
5
|
/**
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { i as __toESM, t as __commonJSMin } from "./rolldown-runtime-2rV9d50f.js";
|
|
2
|
-
import { a as compositionRoot, i as bindCallerEffect } from "./host-access-
|
|
3
|
-
import { c as requiresDecisionEvents, d as normalizePermissionScope, f as permissionScopeCovers, l as INTERCEPT_EVENT_SCOPE_BY_PERMISSION, n as componentIdentityOf } from "./component-identity-
|
|
2
|
+
import { a as compositionRoot, i as bindCallerEffect } from "./host-access-D3lpiaUY.js";
|
|
3
|
+
import { c as requiresDecisionEvents, d as normalizePermissionScope, f as permissionScopeCovers, l as INTERCEPT_EVENT_SCOPE_BY_PERMISSION, n as componentIdentityOf } from "./component-identity-ax93NpoH.js";
|
|
4
4
|
import { existsSync, readFileSync } from "node:fs";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
import { homedir } from "node:os";
|
|
7
7
|
import { dirname, join, resolve } from "node:path";
|
|
8
8
|
import { createHash } from "node:crypto";
|
|
9
|
-
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.
|
|
9
|
+
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.14_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/node_modules/@dsh-std/core/lib/index.js
|
|
10
10
|
function protocolKey(reference) {
|
|
11
11
|
return `${reference.apiVersion}\0${reference.kind}`;
|
|
12
12
|
}
|
|
@@ -408,7 +408,7 @@ function comparePrerelease(left, right) {
|
|
|
408
408
|
return 0;
|
|
409
409
|
}
|
|
410
410
|
//#endregion
|
|
411
|
-
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.
|
|
411
|
+
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.14_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/node_modules/@dsh-std/manifest/lib/index.js
|
|
412
412
|
const COMPONENT_API_VERSION = "manifest.dsh/internal/v1alpha1";
|
|
413
413
|
const COMMUNITY_PERMISSION_API_VERSION = "community.dsh/v1alpha1";
|
|
414
414
|
const COMMUNITY_PERMISSION_KIND = "Permission";
|
|
@@ -1012,7 +1012,7 @@ function canonical(value) {
|
|
|
1012
1012
|
return JSON.stringify(value) ?? "null";
|
|
1013
1013
|
}
|
|
1014
1014
|
//#endregion
|
|
1015
|
-
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.
|
|
1015
|
+
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.14_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js
|
|
1016
1016
|
/** Reusable RPC-shaped protocol definition. Domain packages opt into these semantics explicitly. */
|
|
1017
1017
|
function defineCapabilityProtocol(options) {
|
|
1018
1018
|
const definition = {
|
|
@@ -1068,7 +1068,7 @@ function isConnectionPolicy(value) {
|
|
|
1068
1068
|
return typeof value === "object" && value !== null && typeof value.endpointByParticipant === "object" && value.endpointByParticipant !== null;
|
|
1069
1069
|
}
|
|
1070
1070
|
//#endregion
|
|
1071
|
-
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.
|
|
1071
|
+
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.14_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/node_modules/@dsh-std/presentation/lib/callback.js
|
|
1072
1072
|
const EXTERNAL_REDIRECT_KIND = "ExternalRedirect";
|
|
1073
1073
|
const emptySpec$3 = (value) => {
|
|
1074
1074
|
if (value !== void 0) throw new TypeError("ExternalRedirect does not accept spec in v1alpha1");
|
|
@@ -1084,7 +1084,7 @@ Object.freeze({
|
|
|
1084
1084
|
kind: EXTERNAL_REDIRECT_KIND
|
|
1085
1085
|
});
|
|
1086
1086
|
//#endregion
|
|
1087
|
-
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.
|
|
1087
|
+
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.14_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/node_modules/@dsh-std/presentation/lib/index.js
|
|
1088
1088
|
const API_VERSION$3 = "presentation.dsh/v1alpha1";
|
|
1089
1089
|
const OPEN_EXTERNAL_KIND = "OpenExternal";
|
|
1090
1090
|
const COPY_TEXT_KIND = "CopyText";
|
|
@@ -1261,7 +1261,7 @@ function deepFreeze(value) {
|
|
|
1261
1261
|
return value;
|
|
1262
1262
|
}
|
|
1263
1263
|
//#endregion
|
|
1264
|
-
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.
|
|
1264
|
+
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.14_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/node_modules/@dsh-std/command/lib/index.js
|
|
1265
1265
|
const API_VERSION$2 = "commands.dsh/v1alpha1";
|
|
1266
1266
|
const KIND$2 = "Command";
|
|
1267
1267
|
const RUNTIME_KIND = "CommandRuntime";
|
|
@@ -1455,7 +1455,7 @@ function exact(value, allowed, label) {
|
|
|
1455
1455
|
if (unknown.length > 0) throw new TypeError(`${label} contains unknown field ${JSON.stringify(unknown[0])}`);
|
|
1456
1456
|
}
|
|
1457
1457
|
//#endregion
|
|
1458
|
-
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.
|
|
1458
|
+
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.14_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/node_modules/@dsh-std/messages/lib/index.js
|
|
1459
1459
|
const API_VERSION$1 = "messages.dsh/v1alpha1";
|
|
1460
1460
|
const KIND$1 = "MessageObserver";
|
|
1461
1461
|
const EVENT_TYPE = "messages.observe";
|
|
@@ -1588,7 +1588,7 @@ function record(value) {
|
|
|
1588
1588
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1589
1589
|
}
|
|
1590
1590
|
//#endregion
|
|
1591
|
-
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.
|
|
1591
|
+
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.14_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/node_modules/@dsh-std/storage/lib/index.js
|
|
1592
1592
|
const API_VERSION = "storage.dsh/v1alpha1";
|
|
1593
1593
|
const KIND = "LocalStorage";
|
|
1594
1594
|
const protocol = Object.freeze({
|
|
@@ -1687,7 +1687,7 @@ function key(value, label) {
|
|
|
1687
1687
|
if (typeof value !== "string" || value.length === 0) throw new TypeError(`${label} must be a non-empty string`);
|
|
1688
1688
|
}
|
|
1689
1689
|
//#endregion
|
|
1690
|
-
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.
|
|
1690
|
+
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.14_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/dsh-ecosystem-spec/protocols/tui-channel.js
|
|
1691
1691
|
const TUI_CHANNEL = Object.freeze({
|
|
1692
1692
|
apiVersion: "tui.dsh/v1alpha1",
|
|
1693
1693
|
kind: "Channel"
|
|
@@ -1759,7 +1759,7 @@ function nonEmpty(value, label) {
|
|
|
1759
1759
|
if (typeof value !== "string" || value.trim() === "") throw new TypeError(`${label} must be a non-empty string`);
|
|
1760
1760
|
}
|
|
1761
1761
|
//#endregion
|
|
1762
|
-
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.
|
|
1762
|
+
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.14_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/plugin-spec/tui-extension.js
|
|
1763
1763
|
/** ChatCode CLI TUI private protocol registration on the shared dsh-std catalog. */
|
|
1764
1764
|
const TUI_EXTENSION_API_VERSION = "tui.dsh/v1alpha1";
|
|
1765
1765
|
const DECISION_EVENTS_COORDINATE = Object.freeze({
|
|
@@ -1828,7 +1828,7 @@ function createAdmissionCatalog() {
|
|
|
1828
1828
|
};
|
|
1829
1829
|
}
|
|
1830
1830
|
//#endregion
|
|
1831
|
-
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.
|
|
1831
|
+
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.14_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/plugin-spec/registry.js
|
|
1832
1832
|
/** Load and verify the pinned ChatCode CLI TUI admission profile. */
|
|
1833
1833
|
const REGISTRY_FILE = join("registry", "registry-0.15.json");
|
|
1834
1834
|
const EXPECTED_PROFILE_VERSION = "tui-admission/0.15";
|
|
@@ -2043,7 +2043,7 @@ function verifyContractProfiles(data) {
|
|
|
2043
2043
|
return failures;
|
|
2044
2044
|
}
|
|
2045
2045
|
//#endregion
|
|
2046
|
-
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.
|
|
2046
|
+
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.14_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/utils/paths.js
|
|
2047
2047
|
const CHATCODE_CLI_HOME_ENV = "CHATCODE_CLI_HOME";
|
|
2048
2048
|
const LEGACY_DSH_HOME_ENV = "DSH_HOME";
|
|
2049
2049
|
const CHATCODE_CLI_TUI_ENV_PREFIX = "CHATCODE_CLI_TUI_";
|
|
@@ -2145,7 +2145,7 @@ function detectLegacyEnv(env = process.env) {
|
|
|
2145
2145
|
return Object.keys(RENAMED_ENV).filter((name) => env[name] !== void 0);
|
|
2146
2146
|
}
|
|
2147
2147
|
//#endregion
|
|
2148
|
-
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.
|
|
2148
|
+
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.14_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/grants.js
|
|
2149
2149
|
/** Live, scoped plugin grant evaluation. */
|
|
2150
2150
|
const EXTENSION_GRANTS_FILE = "extension-grants.json";
|
|
2151
2151
|
function parseRule(value) {
|
|
@@ -3020,7 +3020,7 @@ function stripAnsi(string) {
|
|
|
3020
3020
|
return string.replace(regex, "");
|
|
3021
3021
|
}
|
|
3022
3022
|
//#endregion
|
|
3023
|
-
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.
|
|
3023
|
+
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.14_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/utils/intl.js
|
|
3024
3024
|
let graphemeSegmenter;
|
|
3025
3025
|
/**
|
|
3026
3026
|
* Memoized `Intl.Segmenter` with grapheme granularity, used by the ported Ink
|
|
@@ -3031,7 +3031,7 @@ function getGraphemeSegmenter() {
|
|
|
3031
3031
|
return graphemeSegmenter ??= new Intl.Segmenter("en", { granularity: "grapheme" });
|
|
3032
3032
|
}
|
|
3033
3033
|
//#endregion
|
|
3034
|
-
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.
|
|
3034
|
+
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.14_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/ink/stringWidth.js
|
|
3035
3035
|
const EMOJI_REGEX = (0, import_emoji_regex.default)();
|
|
3036
3036
|
/**
|
|
3037
3037
|
* Fallback JavaScript implementation of stringWidth when Bun.stringWidth is not available.
|
|
@@ -3253,7 +3253,7 @@ const BUN_STRING_WIDTH_OPTS = { ambiguousIsNarrow: true };
|
|
|
3253
3253
|
*/
|
|
3254
3254
|
const stringWidth = bunStringWidth ? (str) => bunStringWidth(str, BUN_STRING_WIDTH_OPTS) : stringWidthJavaScript;
|
|
3255
3255
|
//#endregion
|
|
3256
|
-
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.
|
|
3256
|
+
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.14_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/sanitize.js
|
|
3257
3257
|
/**
|
|
3258
3258
|
* The render-path sanitization contract for plugin-supplied text — the
|
|
3259
3259
|
* single implementation behind every managed-UI seam (dialogs, status line,
|
|
@@ -3312,7 +3312,7 @@ function flattenInline(value) {
|
|
|
3312
3312
|
return value.replace(/[\x00-\x1f\x7f-\x9f]/g, " ");
|
|
3313
3313
|
}
|
|
3314
3314
|
//#endregion
|
|
3315
|
-
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.
|
|
3315
|
+
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.14_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/decision-guard.js
|
|
3316
3316
|
/**
|
|
3317
3317
|
* RFC 0005 D-7 enforcement: subscribing to an intercept-class (decision)
|
|
3318
3318
|
* event requires an explicit host-side grant — default deny.
|
|
@@ -3564,7 +3564,7 @@ function installDecisionGuard(ctx, grants) {
|
|
|
3564
3564
|
});
|
|
3565
3565
|
}
|
|
3566
3566
|
//#endregion
|
|
3567
|
-
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.
|
|
3567
|
+
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.14_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/extension-events.js
|
|
3568
3568
|
/**
|
|
3569
3569
|
* Decision-point events the TUI fires on the cordis bus so plugins can
|
|
3570
3570
|
* intercept, cancel, or customize interactive flows — the `session_before_*`
|
|
@@ -68,9 +68,28 @@ function resolveHomeMigrationRoots(env = process.env) {
|
|
|
68
68
|
tuiDestination: join(destination, "tui")
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
|
-
/**
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
/**
|
|
72
|
+
* Probe the legacy roots for a startup reminder without descending or reading file contents.
|
|
73
|
+
* A positive result reports legacy data, not a claim that it still needs copying;
|
|
74
|
+
* the explicit migration command owns destination comparison and fingerprinting.
|
|
75
|
+
* @param roots - legacy directories and their canonical destinations.
|
|
76
|
+
* @returns whether either distinct, readable legacy root contains a durable entry.
|
|
77
|
+
*/
|
|
78
|
+
async function hasLegacyHomeData(roots) {
|
|
79
|
+
for (const [source, destination] of [[roots.source, roots.destination], [roots.tuiSource, roots.tuiDestination]]) {
|
|
80
|
+
if (resolve(source) === resolve(destination)) continue;
|
|
81
|
+
try {
|
|
82
|
+
if (await pathKind(source) !== "directory") continue;
|
|
83
|
+
if ((await readdir(source, { withFileTypes: true })).some((child) => {
|
|
84
|
+
const kind = child.isDirectory() ? "directory" : child.isFile() ? "file" : "other";
|
|
85
|
+
return kind !== "other" && !isTransientMigrationPath(child.name, kind);
|
|
86
|
+
})) return true;
|
|
87
|
+
} catch (error) {
|
|
88
|
+
const code = error.code;
|
|
89
|
+
if (code !== "ENOENT" && code !== "ENOTDIR" && code !== "EACCES" && code !== "EPERM") throw error;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return false;
|
|
74
93
|
}
|
|
75
94
|
function createPlanId(plan) {
|
|
76
95
|
return createHash("sha256").update(JSON.stringify(plan)).digest("hex").slice(0, 24);
|
|
@@ -304,4 +323,4 @@ function formatHomeMigrationPlan(plan) {
|
|
|
304
323
|
].join("\n");
|
|
305
324
|
}
|
|
306
325
|
//#endregion
|
|
307
|
-
export { applyHomeMigration,
|
|
326
|
+
export { applyHomeMigration, formatHomeMigrationPlan, hasLegacyHomeData, planHomeMigration, resolveHomeMigrationRoots };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Context, Fiber } from "@deepseek-ai/cordis";
|
|
2
2
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
3
|
-
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.
|
|
3
|
+
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.14_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/host-access.js
|
|
4
4
|
/**
|
|
5
5
|
* Recover the concrete Cordis service for host-only adapters.
|
|
6
6
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.
|
|
1
|
+
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.14_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/utils/modifiers.js
|
|
2
2
|
/**
|
|
3
3
|
* Cross-platform modifier-key helpers. Windows/Linux muscle memory uses
|
|
4
4
|
* Ctrl+<key>; on macOS the same action maps to Cmd+<key>. Terminals deliver
|
|
@@ -39,7 +39,7 @@ function isPlainReturnInput(input, key) {
|
|
|
39
39
|
return /^[\r\n]+$/u.test(input) && !key.ctrl && !key.meta && !key.shift && !key.super;
|
|
40
40
|
}
|
|
41
41
|
//#endregion
|
|
42
|
-
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.
|
|
42
|
+
//#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.14_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/utils/keymap.js
|
|
43
43
|
/**
|
|
44
44
|
* Built-in keyboard-shortcut keymap: the shared combo grammar, the action
|
|
45
45
|
* registry, and the live override cache behind `/settings` customization.
|