@chatcode/chatcode-cli 3.0.2 → 3.0.4-rc.1
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 +10 -10
- package/README.md +26 -1
- package/README.zh.md +26 -1
- package/lib/bin.js +70 -75
- package/lib/{command-errors-CIYn1nnW.js → command-errors-BkCHTQHj.js} +12 -12
- package/lib/{command-trees-8o99Bws7.js → command-trees-5HFyC5sI.js} +2 -2
- package/lib/{component-identity-CnmIKHEF.js → component-identity-De91VHwW.js} +3 -3
- package/lib/{dist-DxjlHHph.js → dist-CsDWUvQ4.js} +238 -232
- 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-BcH-VYuv.js} +5 -5
- package/lib/dump-config-CyopmD85.js +2 -0
- package/lib/{dump-config-schema-Cz4A13GB.js → dump-config-schema-DM0fb6Ns.js} +2 -2
- package/lib/{extension-events-DciGPKJa.js → extension-events-CdYCRP0o.js} +26 -26
- package/lib/{frames-7PAg0Q9b.js → frames-DOX-Jgk8.js} +4 -4
- package/lib/headless-compat.js +2 -2
- package/lib/{home-migration-DLaSvmfn.js → home-migration-BjDmRwBB.js} +23 -4
- package/lib/{host-access-CmD27uhQ.js → host-access-Bk4xps5E.js} +1 -1
- package/lib/{keymap-CFChEJ2W.js → keymap-CJ1kvLR2.js} +17 -16
- package/lib/{plugin-jvd9PCVt.js → plugin-XR7ncbnW.js} +3767 -2331
- package/lib/{plugin-DYHtreEd.js → plugin-eJjD6r12.js} +1 -1
- package/lib/{profile-boot-Blq7uqhx.js → profile-boot-BNQry1NM.js} +109 -14
- package/lib/profile-boot.js +2 -2
- package/lib/{scenes-ai_8sHDs.js → scenes-CAmWncZD.js} +3 -3
- package/lib/{settings-sections-QQ1-2lhL.js → settings-sections-CakcvBv9.js} +7 -3
- package/lib/startup-diagnostics-C_hRCp-q.js +91 -0
- package/lib/statusBarSettings-BPPS_Usm.js +382 -0
- package/lib/{supports-color-CcW-FGjr.js → supports-color-DyChQwlI.js} +2 -2
- package/lib/{themes-DTzG_9I_.js → themes-OjcUpZzw.js} +13 -13
- 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 +4 -4
- package/lib/tui-compat-workspaces.js +1 -1
- package/lib/tui-compat.js +44 -29
- package/lib/types/args.d.ts +2 -0
- package/lib/types/home-migration.d.ts +8 -0
- package/lib/types/permission-bypass.d.ts +16 -0
- package/lib/types/profile-boot.d.ts +12 -0
- package/lib/types/startup-diagnostics.d.ts +13 -0
- package/lib/types/tui-compat.d.ts +6 -0
- package/lib/types/web-browser.d.ts +6 -0
- package/lib/types/web-instance.d.ts +42 -0
- package/lib/web-browser-Vcgfdsv_.js +46 -0
- package/lib/web-instance-B0jec7cq.js +2 -0
- package/lib/web-instance-DbP7IHPv.js +280 -0
- package/lib/{workspaces-CznCgVHv.js → workspaces-XY7UdfXp.js} +2 -2
- package/package.json +40 -32
- package/runtime/manifest.json +4 -6
- package/runtime/node_modules/@deepseek-ai/dsh-agent-default-model/lib/index.js +34 -4
- package/runtime/node_modules/@deepseek-ai/dsh-agent-default-model/lib/types/index.d.ts +9 -0
- package/runtime/node_modules/@deepseek-ai/dsh-agent-preset/skills/cordis-composition-reference/references/packages.md +2 -1
- package/runtime/node_modules/@deepseek-ai/dsh-api-gateway/lib/client.js +2 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-gateway/lib/types/client/remote-stream.js +4 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-remotes/lib/client.js +39 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/index.js +6 -1
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.host.js +10 -3
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.remote-client.js +7 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/catalog.js +8 -1
- package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/types.d.ts +10 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-settings-controller/lib/index.js +28 -1
- package/runtime/node_modules/@deepseek-ai/dsh-api-settings-controller/lib/typert.host.js +39 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-settings-controller/lib/typert.remote-client.d.ts +2 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-settings-controller/lib/typert.remote-client.js +32 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-settings-controller/lib/types/index.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-settings-controller/lib/types/index.js +19 -1
- package/runtime/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/index.js +28 -0
- package/runtime/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/types/feed.js +17 -0
- package/runtime/node_modules/@deepseek-ai/dsh-app-boot/lib/index.js +67 -19
- package/runtime/node_modules/@deepseek-ai/dsh-app-boot/lib/types/index.d.ts +1 -1
- package/runtime/node_modules/@deepseek-ai/dsh-app-boot/lib/types/profile-context.d.ts +11 -1
- package/runtime/node_modules/@deepseek-ai/dsh-app-boot/lib/worker/profile-resolution-bootstrap.js +22 -3
- package/runtime/node_modules/@deepseek-ai/dsh-base/cordis.patch.yml +9 -3
- package/runtime/node_modules/@deepseek-ai/dsh-base/package.json +2 -1
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/client.js +3 -2
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/types/index.d.ts +2 -2
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/client.js +1 -1
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-goal/lib/client.js +1 -1
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-model-selection/lib/client.js +60 -12
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-model-selection/lib/types/client/directory.d.ts +3 -1
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-model-selection/lib/types/client/locales.d.ts +6 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/markdown/CodeBlock.module.css +3 -5
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/markdown/MarkdownText.module.css +23 -27
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings/lib/types/client/contract/slots.d.ts +3 -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-account/lib/types/index.d.ts +2 -2
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/client.js +8 -7
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/types/client/SettingsDocumentAction.d.ts +1 -1
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/types/client/settings-document-store.d.ts +2 -1
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-models/lib/client.js +33 -12
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-models/lib/types/client/locales.d.ts +2 -0
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-plugin-inventory/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-client-ui-theme/lib/client.js +1 -1
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/client.js +8 -1
- package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/locales.d.ts +2 -0
- 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-computer-use/lib/index.js +35 -0
- package/runtime/node_modules/@deepseek-ai/dsh-computer-use/lib/types/brand.d.ts +11 -0
- package/runtime/node_modules/@deepseek-ai/dsh-computer-use/lib/types/brand.js +10 -0
- package/runtime/node_modules/@deepseek-ai/dsh-computer-use/lib/types/index.d.ts +28 -0
- package/runtime/node_modules/@deepseek-ai/dsh-computer-use/lib/types/index.js +36 -0
- package/runtime/node_modules/@deepseek-ai/dsh-computer-use/package.json +42 -0
- package/runtime/node_modules/@deepseek-ai/dsh-config-editor/lib/index.js +102 -14
- package/runtime/node_modules/@deepseek-ai/dsh-config-editor/lib/types/index.d.ts +34 -4
- package/runtime/node_modules/@deepseek-ai/dsh-config-editor/package.json +1 -0
- package/runtime/node_modules/@deepseek-ai/dsh-host-webserver/lib/index.js +2 -1
- package/runtime/node_modules/@deepseek-ai/dsh-native-command/lib/index.js +21 -8
- package/runtime/node_modules/@deepseek-ai/dsh-native-command/lib/types/path-opener.d.ts +4 -6
- package/runtime/node_modules/@deepseek-ai/dsh-native-command/lib/types/path-opener.js +18 -7
- 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-settings/lib/index.js +5 -4
- package/runtime/node_modules/@deepseek-ai/dsh-settings/lib/types/index.d.ts +4 -3
- package/runtime/node_modules/@deepseek-ai/dsh-settings/lib/types/index.js +4 -3
- 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-storage/lib/types/backend.d.ts +4 -0
- package/runtime/node_modules/@deepseek-ai/dsh-storage-domain/lib/index.js +60 -0
- package/runtime/node_modules/@deepseek-ai/dsh-storage-domain/lib/types/domain.d.ts +15 -0
- package/runtime/node_modules/@deepseek-ai/dsh-storage-json/lib/index.js +25 -0
- package/runtime/node_modules/@deepseek-ai/dsh-storage-json/package.json +1 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/index.js +5472 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/command-args.d.ts +17 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/commands/tianti/cicd.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/commands/tianti/tianti.d.ts +7 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/commands/tianti-deliver/tianti-deliver.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/config.d.ts +27 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/index.d.ts +12 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/memory-config.d.ts +10 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/runtime.d.ts +105 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/tianti/aliases.d.ts +11 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/tianti/auth.d.ts +20 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/tianti/client.d.ts +206 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/tianti/config.d.ts +20 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/tianti/index.d.ts +6 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/tianti/log.d.ts +16 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/tianti/types.d.ts +136 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/codebase.d.ts +19 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/dynamicWorkflow.d.ts +10 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/engine.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/executor.d.ts +11 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/executors.d.ts +15 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/index.d.ts +23 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/memorySuggestions.d.ts +12 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/openspec.d.ts +31 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/recommend.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/render.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/requirementContext.d.ts +12 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/scenarioUpgrade.d.ts +24 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/state.d.ts +16 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/store.d.ts +33 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/templates.d.ts +8 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/types.d.ts +385 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/wanmaDevelopmentWorkflow/writeReviewSync.d.ts +6 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/writeReview/index.d.ts +29 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/writeReview/store.d.ts +20 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/writeReview/types.d.ts +49 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/tools.d.ts +12 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tianti/package.json +55 -0
- package/runtime/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/api-catalog.js +57 -13
- 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/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-D5kpKf--.css +1 -0
- package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-Dz_cDcce.js +133 -0
- package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-Dz_cDcce.js.map +1 -0
- package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/chatcode-apple-touch-icon.png +0 -0
- package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/chatcode-icon-32.png +0 -0
- package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/chatcode-mask-icon.svg +1 -0
- package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/favicon-dark.svg +1 -3
- package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/favicon.ico +0 -0
- package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/favicon.svg +1 -3
- package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/index.html +8 -4
- package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/preview.html +8 -4
- package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/package.json +2 -1
- package/runtime/node_modules/@deepseek-ai/dsh-workspace/lib/index.js +110 -33
- package/runtime/node_modules/@deepseek-ai/dsh-workspace/lib/types/entity.d.ts +6 -0
- package/runtime/node_modules/@deepseek-ai/dsh-workspace/lib/types/entity.js +23 -17
- package/runtime/node_modules/@deepseek-ai/dsh-workspace/lib/types/index.d.ts +10 -0
- package/runtime/node_modules/@deepseek-ai/dsh-workspace/lib/types/index.js +95 -21
- package/lib/dump-config-DBW7YLx-.js +0 -2
- package/lib/tuiDisplayPrefs-BCHRRcfe.js +0 -162
- package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-DUvMhLle.css +0 -1
- package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-Q6zc2uHV.js +0 -127
- package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-Q6zc2uHV.js.map +0 -1
- 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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as INSTALL_ANCHOR, t as CHATCODE_PROFILE_TEMPLATES } from "./profile-boot-
|
|
1
|
+
import { r as INSTALL_ANCHOR, t as CHATCODE_PROFILE_TEMPLATES } from "./profile-boot-BNQry1NM.js";
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
3
|
import { DEFAULT_PROFILE_BUNDLES, initProfile, readProfileCompatibility, resolveProfileDir } from "@deepseek-ai/dsh-app-boot";
|
|
4
4
|
import { join } from "node:path";
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { i as synchronizeLegacyHomeEnvironment, r as resolveChatCodeCliHome } from "./chatcode-home-B93iESZd.js";
|
|
2
|
+
import { n as startStartupPhase, r as traceStartupPlugins } from "./startup-diagnostics-C_hRCp-q.js";
|
|
3
|
+
import { n as registerWebInstance } from "./web-instance-DbP7IHPv.js";
|
|
2
4
|
import { createRequire } from "node:module";
|
|
3
|
-
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
5
|
+
import { existsSync, mkdirSync, readFileSync, realpathSync, rmSync, writeFileSync } from "node:fs";
|
|
4
6
|
import { fileURLToPath } from "node:url";
|
|
5
|
-
import { PROFILE_PATCH_FILENAME, PROFILE_TEMPLATES, PluginPackages, boot, bundlePatchPaths, createRuntimeResolution, getDshRuntimeVersion, initProfile, installFailLoud, loadOverlayPatches, loadProfile, readProfilePatches, reportSkippedBundles, resolveProfileDir } from "@deepseek-ai/dsh-app-boot";
|
|
7
|
+
import { PROFILE_PATCH_FILENAME, PROFILE_TEMPLATES, PluginPackages, boot, bundlePatchPaths, createRuntimeResolution, getDshRuntimeVersion, initProfile, installFailLoud, loadOverlayPatches, loadProfile, readProfileManifest, readProfilePatches, reportSkippedBundles, resolveProfileDir, writeProfileManifest } from "@deepseek-ai/dsh-app-boot";
|
|
6
8
|
import { dirname, extname, join, resolve } from "node:path";
|
|
7
9
|
import { installProxyFromEnvironment } from "@deepseek-ai/dsh-http-proxy";
|
|
8
10
|
import { DSH_LAUNCH_ENVIRONMENT_KEY } from "@deepseek-ai/dsh-launch-environment";
|
|
@@ -71,6 +73,40 @@ function createProcessShutdown(dispose, forceExit = (code) => {
|
|
|
71
73
|
};
|
|
72
74
|
}
|
|
73
75
|
//#endregion
|
|
76
|
+
//#region lib/types/permission-bypass.js
|
|
77
|
+
/** Process-local permission overrides for explicitly unrestricted CLI launches. */
|
|
78
|
+
/**
|
|
79
|
+
* Allow tool approval requests and remove file confinement until this root is disposed.
|
|
80
|
+
* Session permission events and saved profile settings remain unchanged, including on resume.
|
|
81
|
+
* ApprovalService still records its asked/decided pair and honors cancellation.
|
|
82
|
+
* @param ctx - profile root, before application plugins mount.
|
|
83
|
+
*/
|
|
84
|
+
function installPermissionBypass(ctx) {
|
|
85
|
+
ctx.provide("chatcodePermissionBypass", true);
|
|
86
|
+
ctx.inject(["sandboxPolicy", "approval"], (child) => {
|
|
87
|
+
child.effect(() => {
|
|
88
|
+
const sandbox = child.sandboxPolicy;
|
|
89
|
+
const approval = child.approval;
|
|
90
|
+
const resolveDescriptor = Object.getOwnPropertyDescriptor(sandbox, "resolve");
|
|
91
|
+
const policyDescriptor = Object.getOwnPropertyDescriptor(approval, "overrideOf");
|
|
92
|
+
const resolve = sandbox.resolve.bind(sandbox);
|
|
93
|
+
sandbox.resolve = (request) => ({
|
|
94
|
+
...resolve(request),
|
|
95
|
+
mode: "danger-full-access"
|
|
96
|
+
});
|
|
97
|
+
approval.overrideOf = () => "ask";
|
|
98
|
+
const releaseAnswerer = child.on("approval/request", (request) => Promise.resolve(request.signal?.aborted ? "cancelled" : "allowed-once"), { prepend: true });
|
|
99
|
+
return () => {
|
|
100
|
+
releaseAnswerer();
|
|
101
|
+
if (resolveDescriptor === void 0) Reflect.deleteProperty(sandbox, "resolve");
|
|
102
|
+
else Object.defineProperty(sandbox, "resolve", resolveDescriptor);
|
|
103
|
+
if (policyDescriptor === void 0) Reflect.deleteProperty(approval, "overrideOf");
|
|
104
|
+
else Object.defineProperty(approval, "overrideOf", policyDescriptor);
|
|
105
|
+
};
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
//#endregion
|
|
74
110
|
//#region lib/types/profile-boot.js
|
|
75
111
|
/**
|
|
76
112
|
* Shared profile boot for every ChatCode CLI surface: resolve the profile, stack its
|
|
@@ -90,13 +126,15 @@ const CHATCODE_PROFILE_TEMPLATES = {
|
|
|
90
126
|
web: { bundles: [
|
|
91
127
|
"@deepseek-ai/dsh-base",
|
|
92
128
|
"@deepseek-ai/dsh-web-app",
|
|
93
|
-
"dshmarket"
|
|
129
|
+
"dshmarket",
|
|
130
|
+
"dsh-computer-use"
|
|
94
131
|
] },
|
|
95
132
|
cli: { bundles: [
|
|
96
133
|
"@deepseek-ai/dsh-base",
|
|
97
134
|
"@deepseek-harness-tui/dsh-tui",
|
|
98
135
|
"dsh-llm-chatcode-config",
|
|
99
|
-
"dshmarket"
|
|
136
|
+
"dshmarket",
|
|
137
|
+
"dsh-computer-use"
|
|
100
138
|
] }
|
|
101
139
|
};
|
|
102
140
|
/** Exact compatibility bridge for ChatCode-owned releases qualified against this upstream runtime. */
|
|
@@ -110,6 +148,7 @@ const CHATCODE_PACKAGE_ALIASES = {
|
|
|
110
148
|
"@chatcode/cco-better-sidebar": "dsh-better-sidebar",
|
|
111
149
|
"@chatcode/cco-builtin-browser": "dsh-builtin-browser",
|
|
112
150
|
"@chatcode/cco-chat-import": "dsh-chat-import",
|
|
151
|
+
"@chatcode/cco-computer-use": "dsh-computer-use",
|
|
113
152
|
"@chatcode/cco-llm-chatcode-config": "dsh-llm-chatcode-config",
|
|
114
153
|
"@chatcode/cco-market": "dshmarket"
|
|
115
154
|
};
|
|
@@ -199,12 +238,20 @@ function homePatchPath() {
|
|
|
199
238
|
}
|
|
200
239
|
/** Absolute path of this dsh installation's package.json (both anchors: src/ and lib/ sit one level under apps/cli). */
|
|
201
240
|
const INSTALL_ANCHOR = fileURLToPath(new URL("../package.json", import.meta.url));
|
|
202
|
-
/**
|
|
203
|
-
function
|
|
241
|
+
/** Read the installation mode once per embedded-runtime lookup or traversal. */
|
|
242
|
+
function embeddedRuntimeRoot(installAnchor) {
|
|
204
243
|
if (JSON.parse(readFileSync(installAnchor, "utf8")).dependencies?.["@deepseek-ai/dsh-app-boot"]?.startsWith("workspace:") === true) return void 0;
|
|
205
|
-
|
|
244
|
+
return join(dirname(installAnchor), "runtime", "node_modules");
|
|
245
|
+
}
|
|
246
|
+
function embeddedPackageDir(packageName, runtimeRoot) {
|
|
247
|
+
const packageDir = join(runtimeRoot, ...packageName.split("/"));
|
|
206
248
|
return existsSync(join(packageDir, "package.json")) ? packageDir : void 0;
|
|
207
249
|
}
|
|
250
|
+
/** Return one fork-owned package staged inside the published launcher. */
|
|
251
|
+
function embeddedRuntimePackageDir(packageName, installAnchor = INSTALL_ANCHOR) {
|
|
252
|
+
const runtimeRoot = embeddedRuntimeRoot(installAnchor);
|
|
253
|
+
return runtimeRoot === void 0 ? void 0 : embeddedPackageDir(packageName, runtimeRoot);
|
|
254
|
+
}
|
|
208
255
|
/** Prefer a staged fork manifest while retaining source-checkout and old-package compatibility. */
|
|
209
256
|
function installedPackageManifest(packageName, installAnchor) {
|
|
210
257
|
const embedded = embeddedRuntimePackageDir(packageName, installAnchor);
|
|
@@ -213,8 +260,10 @@ function installedPackageManifest(packageName, installAnchor) {
|
|
|
213
260
|
}
|
|
214
261
|
/** Re-anchor shipped bundle patches at their staged fork implementations. */
|
|
215
262
|
function preferEmbeddedProfileLayers(profile, installAnchor = INSTALL_ANCHOR) {
|
|
263
|
+
const runtimeRoot = embeddedRuntimeRoot(installAnchor);
|
|
264
|
+
if (runtimeRoot === void 0) return profile;
|
|
216
265
|
const layers = profile.layers.map((layer) => {
|
|
217
|
-
const packageDir =
|
|
266
|
+
const packageDir = embeddedPackageDir(layer.packageName, runtimeRoot);
|
|
218
267
|
if (packageDir === void 0 || packageDir === layer.packageDir) return layer;
|
|
219
268
|
const declaredPatch = JSON.parse(readFileSync(join(packageDir, "package.json"), "utf8")).dsh?.bundle?.patch;
|
|
220
269
|
if (declaredPatch === void 0) return layer;
|
|
@@ -233,9 +282,11 @@ function preferEmbeddedProfileLayers(profile, installAnchor = INSTALL_ANCHOR) {
|
|
|
233
282
|
}
|
|
234
283
|
/** Point the loader interception table at staged fork packages. */
|
|
235
284
|
function preferEmbeddedRuntimeResolution(resolution, installAnchor = INSTALL_ANCHOR) {
|
|
285
|
+
const runtimeRoot = embeddedRuntimeRoot(installAnchor);
|
|
286
|
+
if (runtimeRoot === void 0) return resolution;
|
|
236
287
|
let changed = false;
|
|
237
288
|
const entries = resolution.entries.map((entry) => {
|
|
238
|
-
const packageDir =
|
|
289
|
+
const packageDir = embeddedPackageDir(entry.name, runtimeRoot);
|
|
239
290
|
if (packageDir === void 0) return entry;
|
|
240
291
|
const declarer = join(packageDir, "package.json");
|
|
241
292
|
if (packageDir === entry.packageDir && entry.declarer === declarer && entry.scope === "installation") return entry;
|
|
@@ -257,7 +308,7 @@ function preferEmbeddedRuntimeResolution(resolution, installAnchor = INSTALL_ANC
|
|
|
257
308
|
const embeddedEntries = [];
|
|
258
309
|
for (const name of packageNames) {
|
|
259
310
|
if (known.has(name)) continue;
|
|
260
|
-
const packageDir =
|
|
311
|
+
const packageDir = embeddedPackageDir(name, runtimeRoot);
|
|
261
312
|
if (packageDir === void 0) continue;
|
|
262
313
|
const manifest = JSON.parse(readFileSync(join(packageDir, "package.json"), "utf8"));
|
|
263
314
|
embeddedEntries.push(Object.freeze({
|
|
@@ -349,6 +400,21 @@ function chatCodeProfilePatchFiles(profile, installAnchor = INSTALL_ANCHOR) {
|
|
|
349
400
|
return path;
|
|
350
401
|
});
|
|
351
402
|
}
|
|
403
|
+
/**
|
|
404
|
+
* Deduplicate overlay files shared by startup, YAML dumps, and schema dumps.
|
|
405
|
+
* @param files - product and command-line overlay paths, in application order.
|
|
406
|
+
* @returns absolute paths in first-occurrence order, preserving relative-resource bases;
|
|
407
|
+
* missing files remain in the result for the patch loader to diagnose.
|
|
408
|
+
*/
|
|
409
|
+
function uniqueProfilePatchFiles(files) {
|
|
410
|
+
const unique = /* @__PURE__ */ new Map();
|
|
411
|
+
for (const patchFile of files) {
|
|
412
|
+
const file = resolve(patchFile);
|
|
413
|
+
const identity = existsSync(file) ? realpathSync(file) : file;
|
|
414
|
+
if (!unique.has(identity)) unique.set(identity, file);
|
|
415
|
+
}
|
|
416
|
+
return [...unique.values()];
|
|
417
|
+
}
|
|
352
418
|
/** Resolve embedded compatibility plugins from the active source or built CLI tree. */
|
|
353
419
|
function resolveEmbeddedHeadlessCompat(patches) {
|
|
354
420
|
const extension = extname(fileURLToPath(import.meta.url)) === ".ts" ? ".ts" : ".js";
|
|
@@ -427,6 +493,20 @@ function prepareProfile(name, userLayer = true, fromDefaultProfile) {
|
|
|
427
493
|
const dir = resolveProfileDir(name, home);
|
|
428
494
|
const template = Object.hasOwn(CHATCODE_PROFILE_TEMPLATES, name) ? CHATCODE_PROFILE_TEMPLATES[name] : void 0;
|
|
429
495
|
if (template !== void 0 && !existsSync(join(dir, "package.json"))) initProfile(dir, template.bundles);
|
|
496
|
+
if (name === "web" || name === "cli") {
|
|
497
|
+
const manifest = readProfileManifest(NAME, dir);
|
|
498
|
+
const bundles = manifest.dsh?.profile?.bundles;
|
|
499
|
+
if (bundles?.includes("@deepseek-ai/dsh-base") && !bundles.includes("dsh-computer-use")) writeProfileManifest(dir, {
|
|
500
|
+
...manifest,
|
|
501
|
+
dsh: {
|
|
502
|
+
...manifest.dsh,
|
|
503
|
+
profile: {
|
|
504
|
+
...manifest.dsh?.profile,
|
|
505
|
+
bundles: [...bundles, "dsh-computer-use"]
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
});
|
|
509
|
+
}
|
|
430
510
|
const profile = preferEmbeddedProfileLayers(restoreTrustedTuiLayer(loadProfile(NAME, name, INSTALL_ANCHOR, home, {
|
|
431
511
|
pluginCommand: "chatcode-cli",
|
|
432
512
|
trustedVersionExemptions: CHATCODE_TRUSTED_VERSION_EXEMPTIONS,
|
|
@@ -457,8 +537,7 @@ async function composeProfile(name, patchFiles, fromDefaultProfile, resolvedProf
|
|
|
457
537
|
profile
|
|
458
538
|
};
|
|
459
539
|
const resolution = preferEmbeddedRuntimeResolution(await createRuntimeResolution(resolutionOptions), resolutionOptions.installAnchor);
|
|
460
|
-
const
|
|
461
|
-
const uniquePatchFiles = [...new Set([...productPatchFiles, ...patchFiles].map((file) => resolve(file)))];
|
|
540
|
+
const uniquePatchFiles = uniqueProfilePatchFiles([...resolvedProfile === void 0 ? chatCodeProfilePatchFiles(name, INSTALL_ANCHOR) : [], ...patchFiles]);
|
|
462
541
|
const ownCompatPatch = resolve(join(dirname(INSTALL_ANCHOR), "headless-compat.cordis.patch.yml"));
|
|
463
542
|
return {
|
|
464
543
|
profile,
|
|
@@ -478,9 +557,11 @@ async function composeProfile(name, patchFiles, fromDefaultProfile, resolvedProf
|
|
|
478
557
|
*/
|
|
479
558
|
async function runProfile(options) {
|
|
480
559
|
synchronizeLegacyHomeEnvironment();
|
|
560
|
+
const finishProxy = startStartupPhase("proxy-setup");
|
|
481
561
|
const disposeProxy = await installProxyFromEnvironment(options.environment, (message) => {
|
|
482
562
|
process.stderr.write(`${NAME}: ${message}\n`);
|
|
483
563
|
});
|
|
564
|
+
finishProxy();
|
|
484
565
|
const app = {};
|
|
485
566
|
let disposal;
|
|
486
567
|
const dispose = () => disposal ??= (async () => {
|
|
@@ -494,7 +575,9 @@ async function runProfile(options) {
|
|
|
494
575
|
if (failures.length > 1) throw new AggregateError(failures, "dsh: profile cleanup failed");
|
|
495
576
|
})();
|
|
496
577
|
try {
|
|
578
|
+
const finishComposition = startStartupPhase("profile-composition");
|
|
497
579
|
const composed = await composeProfile(options.profile, options.patchFiles, options.fromDefaultProfile, options.resolvedProfile);
|
|
580
|
+
finishComposition();
|
|
498
581
|
const appReady = createAppReady();
|
|
499
582
|
const shutdown = createProcessShutdown(dispose);
|
|
500
583
|
const signalShutdown = new AbortController();
|
|
@@ -522,12 +605,18 @@ async function runProfile(options) {
|
|
|
522
605
|
cwd: process.cwd(),
|
|
523
606
|
home: resolveChatCodeCliHome(),
|
|
524
607
|
overlays: composed.overlays,
|
|
608
|
+
transformPatches: resolveChatCodePackageAliases,
|
|
525
609
|
trustedVersionExemptions: CHATCODE_TRUSTED_VERSION_EXEMPTIONS,
|
|
526
610
|
telemetryDisabledEnv: process.env.DSH_TELEMETRY_DISABLED
|
|
527
611
|
};
|
|
528
|
-
const
|
|
612
|
+
const patches = readProfilePatches(NAME, profileContext, composed.profile);
|
|
613
|
+
const finishActivation = startStartupPhase("plugin-activation");
|
|
614
|
+
let stopPluginTrace;
|
|
615
|
+
const ctx = await boot(NAME, rootConfig, patches, async (hostCtx) => {
|
|
616
|
+
stopPluginTrace = traceStartupPlugins(hostCtx);
|
|
529
617
|
app.current = hostCtx;
|
|
530
618
|
installProfileInvocationAccessor(hostCtx);
|
|
619
|
+
if (options.dangerouslySkipPermissions === true) installPermissionBypass(hostCtx);
|
|
531
620
|
hostCtx.provide("profileContext", profileContext);
|
|
532
621
|
hostCtx.provide(DSH_LAUNCH_ENVIRONMENT_KEY, options.environment);
|
|
533
622
|
await hostCtx.plugin(PluginPackages, { resolution: composed.resolution });
|
|
@@ -536,9 +625,15 @@ async function runProfile(options) {
|
|
|
536
625
|
exit: (code) => void shutdown.shutdown(code),
|
|
537
626
|
ready: appReady.service
|
|
538
627
|
});
|
|
628
|
+
}).finally(() => {
|
|
629
|
+
stopPluginTrace?.();
|
|
539
630
|
});
|
|
631
|
+
finishActivation();
|
|
540
632
|
app.current = ctx;
|
|
541
633
|
if (!signalShutdown.signal.aborted && ctx.fiber.state === 2 && ctx.get("loader") !== void 0) appReady.commit();
|
|
634
|
+
if (options.webInstance !== void 0 && !signalShutdown.signal.aborted) await registerWebInstance(ctx, options.webInstance, () => {
|
|
635
|
+
shutdown.interrupt(0);
|
|
636
|
+
});
|
|
542
637
|
return {
|
|
543
638
|
ctx,
|
|
544
639
|
shutdown
|
|
@@ -553,4 +648,4 @@ async function runProfile(options) {
|
|
|
553
648
|
}
|
|
554
649
|
}
|
|
555
650
|
//#endregion
|
|
556
|
-
export { chatCodeProfilePatchFiles as a, initializeProfileFromDefault as c, preferEmbeddedRuntimeResolution as d, prepareProfile as f, runProfile as h, PROFILE_ROOT_FILENAME as i, installProfileInvocationAccessor as l, restoreTrustedTuiLayer as m, CHATCODE_TRUSTED_VERSION_EXEMPTIONS as n, embeddedRuntimePackageDir as o, resolveChatCodePackageAliases as p, INSTALL_ANCHOR as r, homePatchPath as s, CHATCODE_PROFILE_TEMPLATES as t, preferEmbeddedProfileLayers as u };
|
|
651
|
+
export { chatCodeProfilePatchFiles as a, initializeProfileFromDefault as c, preferEmbeddedRuntimeResolution as d, prepareProfile as f, uniqueProfilePatchFiles as g, runProfile as h, PROFILE_ROOT_FILENAME as i, installProfileInvocationAccessor as l, restoreTrustedTuiLayer as m, CHATCODE_TRUSTED_VERSION_EXEMPTIONS as n, embeddedRuntimePackageDir as o, resolveChatCodePackageAliases as p, INSTALL_ANCHOR as r, homePatchPath as s, CHATCODE_PROFILE_TEMPLATES as t, preferEmbeddedProfileLayers as u };
|
package/lib/profile-boot.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as chatCodeProfilePatchFiles, c as initializeProfileFromDefault, d as preferEmbeddedRuntimeResolution, f as prepareProfile, h as runProfile, i as PROFILE_ROOT_FILENAME, l as installProfileInvocationAccessor, m as restoreTrustedTuiLayer, n as CHATCODE_TRUSTED_VERSION_EXEMPTIONS, o as embeddedRuntimePackageDir, p as resolveChatCodePackageAliases, r as INSTALL_ANCHOR, s as homePatchPath, t as CHATCODE_PROFILE_TEMPLATES, u as preferEmbeddedProfileLayers } from "./profile-boot-
|
|
2
|
-
export { CHATCODE_PROFILE_TEMPLATES, CHATCODE_TRUSTED_VERSION_EXEMPTIONS, INSTALL_ANCHOR, PROFILE_ROOT_FILENAME, chatCodeProfilePatchFiles, embeddedRuntimePackageDir, homePatchPath, initializeProfileFromDefault, installProfileInvocationAccessor, preferEmbeddedProfileLayers, preferEmbeddedRuntimeResolution, prepareProfile, resolveChatCodePackageAliases, restoreTrustedTuiLayer, runProfile };
|
|
1
|
+
import { a as chatCodeProfilePatchFiles, c as initializeProfileFromDefault, d as preferEmbeddedRuntimeResolution, f as prepareProfile, g as uniqueProfilePatchFiles, h as runProfile, i as PROFILE_ROOT_FILENAME, l as installProfileInvocationAccessor, m as restoreTrustedTuiLayer, n as CHATCODE_TRUSTED_VERSION_EXEMPTIONS, o as embeddedRuntimePackageDir, p as resolveChatCodePackageAliases, r as INSTALL_ANCHOR, s as homePatchPath, t as CHATCODE_PROFILE_TEMPLATES, u as preferEmbeddedProfileLayers } from "./profile-boot-BNQry1NM.js";
|
|
2
|
+
export { CHATCODE_PROFILE_TEMPLATES, CHATCODE_TRUSTED_VERSION_EXEMPTIONS, INSTALL_ANCHOR, PROFILE_ROOT_FILENAME, chatCodeProfilePatchFiles, embeddedRuntimePackageDir, homePatchPath, initializeProfileFromDefault, installProfileInvocationAccessor, preferEmbeddedProfileLayers, preferEmbeddedRuntimeResolution, prepareProfile, resolveChatCodePackageAliases, restoreTrustedTuiLayer, runProfile, uniqueProfilePatchFiles };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as compositionRoot, i as bindCallerEffect, n as activationFiber, o as concreteService, s as requirePluginCaller } from "./host-access-
|
|
2
|
-
import { n as componentIdentityOf } from "./component-identity-
|
|
1
|
+
import { a as compositionRoot, i as bindCallerEffect, n as activationFiber, o as concreteService, s as requirePluginCaller } from "./host-access-Bk4xps5E.js";
|
|
2
|
+
import { n as componentIdentityOf } from "./component-identity-De91VHwW.js";
|
|
3
3
|
import { Service } from "@deepseek-ai/cordis";
|
|
4
|
-
//#region
|
|
4
|
+
//#region ../../../dsh-TUI/lib/types/dsh-adapter/scenes.js
|
|
5
5
|
/** Provider-neutral full-screen scene registry for terminal front doors. */
|
|
6
6
|
const name = "dsh-tui-scenes";
|
|
7
7
|
/**
|
|
@@ -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-Bk4xps5E.js";
|
|
2
2
|
import { Service } from "@deepseek-ai/cordis";
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../../../dsh-TUI/lib/types/dsh-adapter/credentialRefGuard.js
|
|
4
4
|
/**
|
|
5
5
|
* Credential-ref reservation guard for the plugin settings-section seam.
|
|
6
6
|
*
|
|
@@ -49,7 +49,7 @@ function vetSectionSecretRefs(section) {
|
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
//#endregion
|
|
52
|
-
//#region
|
|
52
|
+
//#region ../../../dsh-TUI/lib/types/dsh-adapter/settings-sections.js
|
|
53
53
|
/**
|
|
54
54
|
* Plugin settings-section extension seam for terminal front doors.
|
|
55
55
|
*
|
|
@@ -157,6 +157,10 @@ function registerSection(runtime, section, owner) {
|
|
|
157
157
|
path: Object.freeze([...field.path]),
|
|
158
158
|
descriptions: field.descriptions === void 0 ? void 0 : Object.freeze({ ...field.descriptions }),
|
|
159
159
|
hintDescriptions: field.hintDescriptions === void 0 ? void 0 : Object.freeze({ ...field.hintDescriptions }),
|
|
160
|
+
confirmEnable: field.confirmEnable === void 0 ? void 0 : Object.freeze({
|
|
161
|
+
...field.confirmEnable,
|
|
162
|
+
descriptions: field.confirmEnable.descriptions === void 0 ? void 0 : Object.freeze({ ...field.confirmEnable.descriptions })
|
|
163
|
+
}),
|
|
160
164
|
options: field.options === void 0 ? void 0 : Object.freeze(field.options.map((option) => Object.freeze({
|
|
161
165
|
...option,
|
|
162
166
|
descriptions: option.descriptions === void 0 ? void 0 : Object.freeze({ ...option.descriptions })
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { randomUUID } from "node:crypto";
|
|
3
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
4
|
+
import { inspect } from "node:util";
|
|
5
|
+
//#region lib/types/startup-diagnostics.js
|
|
6
|
+
/** Save original startup diagnostics while keeping the terminal report concise. */
|
|
7
|
+
/**
|
|
8
|
+
* Trace one startup phase to stderr when CHATCODE_CLI_STARTUP_TRACE=1.
|
|
9
|
+
* @param phase - launcher-owned label; exclude paths, arguments and configuration values.
|
|
10
|
+
* @returns a callback recording the elapsed milliseconds when the phase completes.
|
|
11
|
+
*/
|
|
12
|
+
function startStartupPhase(phase) {
|
|
13
|
+
if (process.env.CHATCODE_CLI_STARTUP_TRACE !== "1") return () => {};
|
|
14
|
+
const started = performance.now();
|
|
15
|
+
process.stderr.write(`[cco-startup] ${phase}: begin\n`);
|
|
16
|
+
return () => {
|
|
17
|
+
process.stderr.write(`[cco-startup] ${phase}: ${(performance.now() - started).toFixed(1)} ms\n`);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Trace plugin activation until the launcher's initial boot settles.
|
|
22
|
+
* @param ctx - the root context before profile entries mount.
|
|
23
|
+
* @returns the listener disposer; call before handing control to the interactive surface.
|
|
24
|
+
*/
|
|
25
|
+
function traceStartupPlugins(ctx) {
|
|
26
|
+
if (process.env.CHATCODE_CLI_STARTUP_TRACE !== "1") return () => {};
|
|
27
|
+
const pending = /* @__PURE__ */ new Map();
|
|
28
|
+
return ctx.on("internal/status", (fiber) => {
|
|
29
|
+
if (fiber.state === 1) pending.set(fiber, startStartupPhase(`plugin/${fiber.name}`));
|
|
30
|
+
else {
|
|
31
|
+
pending.get(fiber)?.();
|
|
32
|
+
pending.delete(fiber);
|
|
33
|
+
}
|
|
34
|
+
}, { global: true });
|
|
35
|
+
}
|
|
36
|
+
/** Wait for stderr to finish the write before the failed process exits. */
|
|
37
|
+
function writeStderr(text) {
|
|
38
|
+
return new Promise((resolve, reject) => {
|
|
39
|
+
process.stderr.write(text, (error) => {
|
|
40
|
+
if (error) reject(error);
|
|
41
|
+
else resolve();
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Print the startup summary and save a private, uniquely named report under DSH_HOME/logs.
|
|
47
|
+
* Failed writes print the complete report to stderr instead of claiming a saved path.
|
|
48
|
+
* @param error - startup audit failure retaining plugin metadata and original errors.
|
|
49
|
+
* @param context - resolved Harness home, application version, and selected profile.
|
|
50
|
+
* @param write - terminal output sink; awaited before returning, defaults to stderr.
|
|
51
|
+
* @returns after saving or printing the report and completing terminal writes.
|
|
52
|
+
*/
|
|
53
|
+
async function reportStartupFailure(error, context, write = writeStderr) {
|
|
54
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
55
|
+
const report = "WARNING: Raw diagnostics may contain configuration or credential values from plugin errors. Review before sharing.\n\n" + inspect({
|
|
56
|
+
timestamp: now,
|
|
57
|
+
dshVersion: context.version,
|
|
58
|
+
nodeVersion: process.version,
|
|
59
|
+
platform: process.platform,
|
|
60
|
+
arch: process.arch,
|
|
61
|
+
profile: context.profile,
|
|
62
|
+
error
|
|
63
|
+
}, {
|
|
64
|
+
depth: null,
|
|
65
|
+
maxArrayLength: null,
|
|
66
|
+
maxStringLength: null,
|
|
67
|
+
showHidden: true,
|
|
68
|
+
customInspect: false,
|
|
69
|
+
getters: false,
|
|
70
|
+
colors: false
|
|
71
|
+
}) + "\n";
|
|
72
|
+
await write(`${error.message}\n`);
|
|
73
|
+
const logDir = join(context.home, "logs");
|
|
74
|
+
const logPath = join(logDir, `startup-${now.replaceAll(":", "-")}-${randomUUID()}.log`);
|
|
75
|
+
try {
|
|
76
|
+
await mkdir(logDir, {
|
|
77
|
+
recursive: true,
|
|
78
|
+
mode: 448
|
|
79
|
+
});
|
|
80
|
+
await writeFile(logPath, report, {
|
|
81
|
+
flag: "wx",
|
|
82
|
+
mode: 384
|
|
83
|
+
});
|
|
84
|
+
} catch (writeError) {
|
|
85
|
+
await write(`\ndsh: warning: could not write startup diagnostics: ${String(writeError)}\nFull diagnostics:\n${report}`);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
await write(`\nFull diagnostics: ${logPath}\n`);
|
|
89
|
+
}
|
|
90
|
+
//#endregion
|
|
91
|
+
export { startStartupPhase as n, traceStartupPlugins as r, reportStartupFailure as t };
|