From caa7111f28f7d60be590b3fde89166bdffb1404b Mon Sep 17 00:00:00 2001 From: turtle1999 Date: Thu, 8 Oct 2026 15:06:13 +0800 Subject: [PATCH 001/322] feat(release): publish package source, declaration maps, and documentation Every release member publishes its TypeScript source and the declaration maps that resolve into it, and @deepseek-ai/dsh publishes the repository Markdown documentation staged from docs/ at prepack time. The ./src/* export most members already declared now resolves for an installed consumer, and a consumer editor follows a declaration to the implementation. Bundled JavaScript maps stay unpublished; the vendored family and the Desktop runtime file policy are unchanged. Rationale: .agents/notes/implemented/process/2026-10-08-published-source-and-docs.md --- ...08-02-typert-remote-method-calls.i18n.yaml | 4 +- .../2026-08-02-typert-remote-method-calls.md | 2 +- ...026-08-02-typert-remote-method-calls.zh.md | 2 +- ...2026-08-10-npm-release-sequences.i18n.yaml | 4 +- .../2026-08-10-npm-release-sequences.md | 2 +- .../2026-08-10-npm-release-sequences.zh.md | 2 +- ...-10-08-published-source-and-docs.i18n.yaml | 19 ++++++ .../2026-10-08-published-source-and-docs.md | 41 +++++++++++++ ...2026-10-08-published-source-and-docs.zh.md | 41 +++++++++++++ .gitignore | 1 + apps/cli/package.json | 8 ++- apps/web/package.json | 3 +- docs/cookbook/adding-a-package.i18n.yaml | 4 +- docs/cookbook/adding-a-package.md | 2 +- docs/cookbook/adding-a-package.zh.md | 2 +- packages/acp/acp/package.json | 4 +- packages/api/account-controller/package.json | 5 +- packages/api/gateway/package.json | 4 +- packages/api/job-controller/package.json | 5 +- packages/api/remotes/package.json | 4 +- packages/api/session-controller/package.json | 5 +- packages/api/settings-controller/package.json | 5 +- packages/api/terminal-controller/package.json | 5 +- .../api/workspace-controller/package.json | 5 +- packages/api/workspace-files/package.json | 5 +- .../attachment/attachment-local/package.json | 2 +- packages/attachment/attachment/package.json | 2 +- packages/boot/app-boot/package.json | 4 +- packages/boot/cmdline/package.json | 4 +- packages/boot/config-editor/package.json | 4 +- packages/boot/hmr/package.json | 4 +- packages/boot/plugin-manager/package.json | 5 +- packages/browser-use/browser-use/package.json | 4 +- packages/bundle/acp-app/package.json | 4 +- packages/bundle/base/package.json | 4 +- packages/bundle/headless/package.json | 4 +- packages/bundle/sdk-app/package.json | 4 +- packages/bundle/sdk-minimal/package.json | 4 +- packages/bundle/web-app/package.json | 4 +- packages/client/connection/package.json | 4 +- packages/client/file-upload/package.json | 5 +- packages/client/hmr/package.json | 4 +- packages/client/locale/package.json | 4 +- packages/client/modules/package.json | 4 +- .../client/product-analytics/package.json | 5 +- packages/client/resources/package.json | 4 +- packages/client/shortcuts/package.json | 4 +- packages/client/store/package.json | 4 +- packages/client/ui-agent-preset/package.json | 4 +- packages/client/ui-approval/package.json | 4 +- packages/client/ui-attachment/package.json | 4 +- .../client/ui-brand-official/package.json | 4 +- packages/client/ui-chat/package.json | 4 +- packages/client/ui-commands/package.json | 4 +- packages/client/ui-conversation/package.json | 4 +- packages/client/ui-deliverables/package.json | 4 +- .../ui-directory-picker-browse/package.json | 4 +- .../ui-directory-picker-native/package.json | 4 +- packages/client/ui-dockkit/package.json | 4 +- packages/client/ui-goal/package.json | 4 +- packages/client/ui-input-trigger/package.json | 4 +- packages/client/ui-jobs/package.json | 4 +- packages/client/ui-layout/package.json | 4 +- .../client/ui-message-feedback/package.json | 4 +- .../client/ui-model-selection/package.json | 4 +- packages/client/ui-open-in-app/package.json | 4 +- .../client/ui-permission-presets/package.json | 4 +- packages/client/ui-plan/package.json | 4 +- .../client/ui-plugin-manager/package.json | 5 +- packages/client/ui-primitives/package.json | 4 +- packages/client/ui-reference/package.json | 4 +- packages/client/ui-renderer/package.json | 4 +- packages/client/ui-schedule/package.json | 4 +- packages/client/ui-session/package.json | 4 +- .../client/ui-settings-account/package.json | 4 +- .../ui-settings-agent-loop/package.json | 4 +- .../client/ui-settings-general/package.json | 4 +- .../client/ui-settings-models/package.json | 4 +- .../ui-settings-plugin-inventory/package.json | 4 +- .../client/ui-settings-plugins/package.json | 4 +- .../ui-settings-session-log/package.json | 4 +- .../client/ui-settings-shell/package.json | 4 +- .../client/ui-settings-subagent/package.json | 4 +- .../ui-settings-web-search/package.json | 4 +- packages/client/ui-settings/package.json | 4 +- packages/client/ui-shortcuts/package.json | 4 +- .../client/ui-sidebar-browser/package.json | 4 +- .../ui-sidebar-documentpreview/package.json | 4 +- packages/client/ui-sidebar-files/package.json | 4 +- packages/client/ui-sidebar-right/package.json | 4 +- .../client/ui-sidebar-terminal/package.json | 4 +- packages/client/ui-sidebar/package.json | 4 +- packages/client/ui-skill/package.json | 4 +- packages/client/ui-slots/package.json | 4 +- packages/client/ui-subagent/package.json | 4 +- packages/client/ui-theme/package.json | 4 +- packages/client/ui-tool/package.json | 4 +- packages/client/ui-trajectory/package.json | 4 +- .../client/ui-user-questions/package.json | 4 +- packages/client/ui-workflow-run/package.json | 4 +- packages/client/ui-workspace/package.json | 4 +- packages/client/web/package.json | 4 +- .../compaction/command-compact/package.json | 4 +- .../compaction/compaction-basic/package.json | 4 +- .../compaction-image-offload/package.json | 4 +- .../package.json | 4 +- packages/compaction/compaction/package.json | 4 +- .../computer-use/computer-use/package.json | 4 +- .../context/agent-instructions/package.json | 4 +- .../context/file-reference-local/package.json | 4 +- packages/context/file-reference/package.json | 4 +- .../context/session-reference/package.json | 5 +- packages/context/time-context/package.json | 4 +- packages/context/tmux-context/package.json | 4 +- .../core/agent-default-model/package.json | 4 +- packages/core/agent-loop/package.json | 4 +- .../core/agent-tool-presentation/package.json | 4 +- packages/core/agent/package.json | 4 +- packages/core/scope/package.json | 4 +- packages/core/session/package.json | 4 +- packages/core/system-prompt/package.json | 4 +- packages/core/tools/package.json | 4 +- .../credentials/authorization/package.json | 4 +- .../credentials-local/package.json | 4 +- packages/credentials/credentials/package.json | 4 +- .../deepseek-account-platform/package.json | 4 +- .../credentials/deepseek-account/package.json | 4 +- .../deliverables/tool-present/package.json | 4 +- .../workspace-changes/package.json | 4 +- packages/document/office-to-pdf/package.json | 5 +- .../agent-team-profile/package.json | 4 +- packages/experimental/agent-team/package.json | 4 +- .../api-speech-to-text/package.json | 5 +- .../experimental/auto-review/package.json | 4 +- .../badge-skill-bundle/package.json | 4 +- .../package.json | 4 +- .../browser-use-playwright-mcp/package.json | 4 +- .../browser-use-runtime/package.json | 4 +- .../browser-use-stagehand-native/package.json | 4 +- .../claude-code-mods/package.json | 5 +- .../client-ui-agent-team/package.json | 4 +- .../client-ui-claude-code-mods/package.json | 4 +- .../client-ui-cot-translation/package.json | 5 +- .../client-ui-voice-input/package.json | 4 +- .../computer-use-cua-driver-mcp/package.json | 4 +- .../package.json | 4 +- .../cot-translation-bundle/package.json | 4 +- .../experimental/hook-protocol/package.json | 4 +- .../hooks-claude-code/package.json | 4 +- .../experimental/hooks-codex/package.json | 4 +- .../inspector-profile/package.json | 4 +- packages/experimental/inspector/package.json | 4 +- .../ptc-runtime-python/package.json | 4 +- .../experimental/ralph-bundle/package.json | 4 +- .../session-inspector/package.json | 4 +- .../experimental/session-search/package.json | 4 +- .../package.json | 2 +- .../session-titles-bundle/package.json | 4 +- .../experimental/skill-badge/package.json | 4 +- .../speech-to-text-sensevoice/package.json | 4 +- .../experimental/speech-to-text/package.json | 4 +- .../experimental/terminal-bundle/package.json | 4 +- .../experimental/tool-agent-team/package.json | 4 +- packages/experimental/tool-ralph/package.json | 4 +- .../tool-session-query/package.json | 4 +- .../experimental/tool-terminal/package.json | 4 +- .../experimental/tool-worktree/package.json | 4 +- packages/experimental/translator/package.json | 4 +- .../voice-input-bundle/package.json | 4 +- .../experimental/webhook-github/package.json | 4 +- packages/experimental/webhook/package.json | 4 +- .../webworker-packer/package.json | 4 +- .../webworker-packer/tests/built-lib.e2e.ts | 5 +- .../webworker-runtime/package.json | 4 +- packages/experimental/worktree/package.json | 4 +- .../cordis-client-runner/package.json | 4 +- .../cordis-host-runner/package.json | 5 +- packages/extensions/tool-cordis/package.json | 4 +- packages/extensions/ui-cordis/package.json | 4 +- .../feedback/command-feedback/package.json | 5 +- .../feedback/message-feedback/package.json | 5 +- packages/fs/fs-local/package.json | 4 +- .../fs/fs-observation-policy/package.json | 4 +- packages/fs/fs-sandbox/package.json | 4 +- packages/fs/fs/package.json | 4 +- packages/fs/tool-fs-search/package.json | 4 +- packages/fs/tool-fs/package.json | 4 +- .../fs/tool-str-replace-editor/package.json | 4 +- packages/goal/command-goal/package.json | 4 +- packages/goal/goal-round-driver/package.json | 4 +- packages/goal/goal/package.json | 5 +- packages/goal/tool-goal/package.json | 4 +- .../guard/repeat-tool-reminder/package.json | 4 +- packages/guard/timeout-policy/package.json | 4 +- .../host/directory-picker-auto/package.json | 4 +- .../host/directory-picker-browse/package.json | 4 +- .../host/directory-picker-native/package.json | 4 +- packages/host/directory-picker/package.json | 4 +- packages/host/frontend-static/package.json | 4 +- packages/host/open-in-app/package.json | 4 +- packages/host/plugin-inventory/package.json | 5 +- .../host/product-telemetry-otel/package.json | 4 +- packages/host/webserver/package.json | 4 +- .../identity/anonymous-user-id/package.json | 4 +- packages/interaction/commands/package.json | 5 +- .../permission-presets/package.json | 5 +- .../interaction/tool-ask-user/package.json | 4 +- .../interaction/user-approval/package.json | 4 +- .../interaction/user-questions/package.json | 5 +- packages/jobs/jobs-local/package.json | 4 +- packages/jobs/jobs/package.json | 4 +- packages/jobs/tool-jobs/package.json | 4 +- .../deepseek-llm-api-extensions/package.json | 4 +- .../llm/llm-deepseek-account/package.json | 4 +- .../llm/llm-deepseek-api-key/package.json | 4 +- packages/llm/llm-deepseek/package.json | 4 +- packages/llm/llm-pi-ai/package.json | 4 +- packages/llm/llm-retry/package.json | 4 +- packages/llm/llm/package.json | 5 +- .../package.json | 4 +- packages/llm/token-meter/package.json | 4 +- packages/lsp/lsp-stdio/package.json | 4 +- packages/lsp/lsp/package.json | 4 +- packages/lsp/tool-lsp/package.json | 4 +- packages/mcp/mcp-client/package.json | 4 +- packages/mcp/mcp-resources/package.json | 4 +- packages/plan/plan-mode/package.json | 4 +- .../preset/agent-preset-registry/package.json | 5 +- packages/preset/agent-preset/package.json | 4 +- packages/preset/persona/package.json | 4 +- .../ptc-runtime/ptc-runtime-node/package.json | 4 +- packages/ptc-runtime/ptc-runtime/package.json | 4 +- packages/sandbox/sandbox-local/package.json | 4 +- packages/sandbox/sandbox-policy/package.json | 4 +- .../sandbox/sandbox-windows-acl/package.json | 4 +- packages/sandbox/sandbox/package.json | 4 +- packages/schedule/schedule/package.json | 5 +- packages/schedule/tool-schedule/package.json | 4 +- packages/sdk/client/package.json | 4 +- packages/sdk/protocol/package.json | 4 +- packages/sdk/server/package.json | 4 +- .../session-log-export/package.json | 4 +- .../session-query-sqlite/package.json | 4 +- .../session-query/session-query/package.json | 4 +- .../session-checkpoint-policy/package.json | 4 +- .../session-format-catalog/package.json | 4 +- .../session-format-v0-to-v1/package.json | 4 +- .../session-format-v1-to-v2/package.json | 4 +- .../session-format-v2-to-v3/package.json | 4 +- .../session-format-v3-to-v4/package.json | 4 +- packages/session/session-format/package.json | 4 +- .../session/session-log-deepseek/package.json | 4 +- .../session-persistence-jsonl/package.json | 4 +- .../session/session-persistence/package.json | 4 +- .../session-projection-cache/package.json | 4 +- .../session/session-projection/package.json | 4 +- packages/session/session-stats/package.json | 4 +- .../session-telemetry-otel/package.json | 4 +- .../session/session-telemetry/package.json | 4 +- .../package.json | 2 +- .../session/session-title-llm/package.json | 4 +- packages/session/session-title/package.json | 4 +- .../session/session-turn-outline/package.json | 4 +- .../tool-working-directory/package.json | 4 +- .../session/working-directory/package.json | 4 +- packages/settings/settings/package.json | 4 +- packages/shell/bash-local/package.json | 4 +- packages/shell/bash-sandbox/package.json | 4 +- packages/shell/pwsh-local/package.json | 4 +- packages/shell/pwsh-sandbox/package.json | 4 +- packages/shell/shell-env/package.json | 4 +- packages/shell/shell/package.json | 4 +- .../shell/tool-bash-persistent/package.json | 4 +- packages/shell/tool-bash/package.json | 4 +- .../shell/tool-pwsh-persistent/package.json | 4 +- packages/shell/tool-pwsh/package.json | 4 +- packages/skill/skill-filesystem/package.json | 4 +- packages/skill/skill-office/package.json | 4 +- packages/skill/skill/package.json | 4 +- packages/skill/tool-skill/package.json | 4 +- .../tool-workspace-dependencies/package.json | 4 +- packages/spill/spill-local/package.json | 4 +- packages/spill/spill-policy/package.json | 4 +- packages/spill/spill/package.json | 4 +- packages/ssh/fs-ssh/package.json | 4 +- packages/ssh/sandbox-ssh/package.json | 4 +- packages/ssh/ssh/package.json | 4 +- packages/ssh/subprocess-ssh/package.json | 4 +- packages/storage/storage-domain/package.json | 4 +- packages/storage/storage-json/package.json | 4 +- packages/storage/storage-sqlite/package.json | 4 +- packages/storage/storage/package.json | 4 +- packages/subagent/subagent-acp/package.json | 4 +- .../subagent-claude-code/package.json | 4 +- packages/subagent/subagent-codex/package.json | 4 +- .../subagent/subagent-dsh-sdk/package.json | 4 +- .../subagent-fork-in-process/package.json | 4 +- .../subagent-spawn-in-process/package.json | 4 +- packages/subagent/subagent/package.json | 5 +- .../tool-subagent-control/package.json | 4 +- packages/subagent/tool-subagent/package.json | 4 +- .../subprocess/subprocess-local/package.json | 4 +- packages/subprocess/subprocess/package.json | 4 +- .../subprocess/win32-process/package.json | 4 +- packages/telemetry/otel/package.json | 4 +- packages/terminal/terminal-bash/package.json | 4 +- packages/terminal/terminal/package.json | 4 +- .../agent-loop-testkit/package.json | 4 +- .../test-support/client-runtime/package.json | 4 +- .../test-support/llm-mock-server/package.json | 4 +- packages/test-support/llm-replay/package.json | 4 +- .../test-support/loader-smoke/package.json | 4 +- .../test-support/remote-mock/package.json | 4 +- .../session-snapshot/package.json | 4 +- packages/todo/tool-todo/package.json | 4 +- packages/typert/generator/package.json | 4 +- packages/typert/loader/package.json | 4 +- packages/typert/protocol/package.json | 4 +- packages/typert/registry/package.json | 4 +- packages/util/atomic-write/package.json | 4 +- packages/util/brand/package.json | 4 +- packages/util/chunked-list/package.json | 4 +- packages/util/code-language/package.json | 4 +- packages/util/crypto/package.json | 4 +- packages/util/deque/package.json | 4 +- packages/util/home-paths/package.json | 4 +- packages/util/http-proxy/package.json | 4 +- packages/util/launch-environment/package.json | 4 +- packages/util/lazy-require/package.json | 4 +- packages/util/native-command/package.json | 4 +- packages/util/output-retention/package.json | 4 +- packages/util/package-manifest/package.json | 4 +- packages/util/time/package.json | 4 +- packages/util/timeout/package.json | 4 +- packages/util/values/package.json | 4 +- packages/util/workspace-path/package.json | 4 +- packages/web/tool-web/package.json | 4 +- packages/web/web-fetch-http/package.json | 4 +- packages/web/web-search-deepseek/package.json | 4 +- packages/web/web-search-exa/package.json | 4 +- .../web/web-search-perplexity/package.json | 4 +- packages/web/web/package.json | 4 +- packages/workflow/tool-workflow/package.json | 4 +- packages/workflow/workflow-ptc/package.json | 4 +- packages/workflow/workflow/package.json | 4 +- packages/workspace/workspace/package.json | 4 +- scripts/check-workspace-constraints.spec.ts | 16 +++-- scripts/check-workspace-constraints.ts | 26 +++++---- scripts/publication-payload.spec.ts | 46 +++++++-------- scripts/publication-payload.ts | 23 +++----- scripts/release/families.spec.ts | 17 +++++- scripts/release/families.ts | 21 +++++-- scripts/release/pack.spec.ts | 6 +- scripts/stage-dsh-docs.spec.ts | 58 +++++++++++++++++++ scripts/stage-dsh-docs.ts | 49 ++++++++++++++++ scripts/translation-pairing.ts | 2 + 356 files changed, 1331 insertions(+), 415 deletions(-) create mode 100644 .agents/notes/implemented/process/2026-10-08-published-source-and-docs.i18n.yaml create mode 100644 .agents/notes/implemented/process/2026-10-08-published-source-and-docs.md create mode 100644 .agents/notes/implemented/process/2026-10-08-published-source-and-docs.zh.md create mode 100644 scripts/stage-dsh-docs.spec.ts create mode 100644 scripts/stage-dsh-docs.ts diff --git a/.agents/notes/implemented/architecture/2026-08-02-typert-remote-method-calls.i18n.yaml b/.agents/notes/implemented/architecture/2026-08-02-typert-remote-method-calls.i18n.yaml index 7afdf2c22c..9e09fd093d 100644 --- a/.agents/notes/implemented/architecture/2026-08-02-typert-remote-method-calls.i18n.yaml +++ b/.agents/notes/implemented/architecture/2026-08-02-typert-remote-method-calls.i18n.yaml @@ -36,8 +36,8 @@ en: 6ea4bddcf35a834d zh: 4af474c6818b1cf0 /agent-note-typert-gateway-targeted-method-calls/the-remote-package-entry: - en: 75e977fe0fb71d59 - zh: 00760c79da173cb7 + en: 91033aab32e4d8eb + zh: a11ada70e047af55 /agent-note-typert-gateway-targeted-method-calls/strict-consumer-api-types: en: 983f55c0ed4a8edc zh: 5a736e00e4b57e6a diff --git a/.agents/notes/implemented/architecture/2026-08-02-typert-remote-method-calls.md b/.agents/notes/implemented/architecture/2026-08-02-typert-remote-method-calls.md index 8e91598f7d..6fdd5ebd5c 100644 --- a/.agents/notes/implemented/architecture/2026-08-02-typert-remote-method-calls.md +++ b/.agents/notes/implemented/architecture/2026-08-02-typert-remote-method-calls.md @@ -238,7 +238,7 @@ import goalsRemote from '@deepseek-ai/dsh-goal/remote' This import brings the `.d.ts` map augmentation into the current TypeScript project while supplying the JS descriptor for the same contract as a value to the runtime. A business package that is not imported does not extend the current project's Remote API types. -The business package's published files must include `lib/typert.remote-client.d.ts.map`. The generated DTS refers to its adjacent map with `//# sourceMappingURL=typert.remote-client.d.ts.map`; the map source points from `lib` to the business source by a relative path such as `../src/index.ts`. The `/remote` export does not list the map separately; the package `files` field publishes it. That target is a development-time path: a workspace consumer resolves it through the package link, so the published payload keeps excluding `src` and a published map simply resolves nothing. +The business package's published files must include `lib/typert.remote-client.d.ts.map`. The generated DTS refers to its adjacent map with `//# sourceMappingURL=typert.remote-client.d.ts.map`; the map source points from `lib` to the business source by a relative path such as `../src/index.ts`. The `/remote` export does not list the map separately; the package `files` field publishes it. That target is a relative path inside the same package, and the payload publishes `src` beside the declaration map, so the navigation resolves for an installed consumer ([rationale](../process/2026-10-08-published-source-and-docs.md)). Code that needs only static types may use `import type {} from '@deepseek-ai/dsh-goal/remote'`. This import is erased at runtime, loads no JS, and cannot trigger runtime registration. An environment that makes real calls must pass the contribution from a normal value import to the Client Remote Service. diff --git a/.agents/notes/implemented/architecture/2026-08-02-typert-remote-method-calls.zh.md b/.agents/notes/implemented/architecture/2026-08-02-typert-remote-method-calls.zh.md index fd6cd2bcfc..f7d6a03abe 100644 --- a/.agents/notes/implemented/architecture/2026-08-02-typert-remote-method-calls.zh.md +++ b/.agents/notes/implemented/architecture/2026-08-02-typert-remote-method-calls.zh.md @@ -238,7 +238,7 @@ import goalsRemote from '@deepseek-ai/dsh-goal/remote' 该 import 让 `.d.ts` 的 map augmentation 进入当前 TypeScript project,同时把同一约定的 JS descriptor 作为值交给运行时。未 import 的业务包不会扩展当前 project 的 Remote API 类型。 -业务 package 的发布文件必须包含 `lib/typert.remote-client.d.ts.map`。生成 DTS 以 `//# sourceMappingURL=typert.remote-client.d.ts.map` 引用相邻 map;map 中的 source 从 `lib` 相对指向业务源码,例如 `../src/index.ts`。`/remote` export 不单独列出 map,package `files` 负责发布它。该目标是开发期路径:workspace 消费者经 package link 解析它,因此发布产物仍然不含 `src`,已发布的 map 只是解析不到东西。 +业务 package 的发布文件必须包含 `lib/typert.remote-client.d.ts.map`。生成 DTS 以 `//# sourceMappingURL=typert.remote-client.d.ts.map` 引用相邻 map;map 中的 source 从 `lib` 相对指向业务源码,例如 `../src/index.ts`。`/remote` export 不单独列出 map,package `files` 负责发布它。该目标是同一 package 内的相对路径,发布产物在声明映射旁一并发布 `src`,因此已安装的消费方也能完成这次导航([理由](../process/2026-10-08-published-source-and-docs.zh.md))。 仅需要静态类型时可以使用 `import type {} from '@deepseek-ai/dsh-goal/remote'`;这种 import 在运行时会被擦除,不会加载 JS,也不能触发任何运行时注册。需要真实调用的环境必须把普通 value import 得到的 contribution 交给 Client Remote Service。 diff --git a/.agents/notes/implemented/process/2026-08-10-npm-release-sequences.i18n.yaml b/.agents/notes/implemented/process/2026-08-10-npm-release-sequences.i18n.yaml index 531b156371..58a7f3654a 100644 --- a/.agents/notes/implemented/process/2026-08-10-npm-release-sequences.i18n.yaml +++ b/.agents/notes/implemented/process/2026-08-10-npm-release-sequences.i18n.yaml @@ -33,8 +33,8 @@ en: d83f6cf38529c5b5 zh: 4df5659b2154d3b7 /agent-note-private-npm-publication-as-three-independent-sequences/decision/release-family-objects: - en: 5bc6a83d124b682d - zh: 17383ec5c3c7e0e5 + en: 9b38e8eb8fc6ef9b + zh: 19b573c7c4f5d6e8 /agent-note-private-npm-publication-as-three-independent-sequences/decision/workflow-shape-pack-on-pr-push-publish-from-a-manual-dispatch-workflow: en: ea0acc6409da4d5c zh: ac0bd2fe41f4fe67 diff --git a/.agents/notes/implemented/process/2026-08-10-npm-release-sequences.md b/.agents/notes/implemented/process/2026-08-10-npm-release-sequences.md index 8552232363..bd50b428a4 100644 --- a/.agents/notes/implemented/process/2026-08-10-npm-release-sequences.md +++ b/.agents/notes/implemented/process/2026-08-10-npm-release-sequences.md @@ -117,7 +117,7 @@ The entity in this domain is a **release family**: a set of packages sharing one | `publish` | the three registry states above | | `process` / `tarball` | the one home for spawning commands and for reading a packed tarball, including the entry guard that keeps every script importable | -The dsh family applies the repository's publication payload policy, which rejects sources and declaration maps. The vendored family keeps upstream's payload, because those manifests export `./src/*` and dropping `src` would publish an export map pointing at absent files. +The dsh family applies the repository's publication payload policy, which rejects bundled JavaScript maps and publishes `src` with its declaration maps ([rationale](2026-10-08-published-source-and-docs.md)). The vendored family keeps upstream's payload, because upstream's manifest owns it and those manifests export `./src/*`. ### Workflow shape: pack on PR/push, publish from a manual dispatch workflow diff --git a/.agents/notes/implemented/process/2026-08-10-npm-release-sequences.zh.md b/.agents/notes/implemented/process/2026-08-10-npm-release-sequences.zh.md index 9d130478e6..325b1133eb 100644 --- a/.agents/notes/implemented/process/2026-08-10-npm-release-sequences.zh.md +++ b/.agents/notes/implemented/process/2026-08-10-npm-release-sequences.zh.md @@ -117,7 +117,7 @@ registry 的两个行为决定了「怎么尝试一次发布」。写入之间 | `publish` | 上面那三态 | | `process` / `tarball` | 启动命令、读取打包 tarball 的唯一正家,其中的入口守卫让每个脚本都可被 import | -dsh 族套用仓库的发布 payload 策略(拒绝源码与声明映射)。vendored 族保留上游 payload,因为那些 manifest 导出 `./src/*`,去掉 `src` 会发出一个导出映射指向不存在文件的包。 +dsh 族套用仓库的发布 payload 策略(拒绝打包后的 JavaScript map,随声明映射一起发布 `src`,[理由](2026-10-08-published-source-and-docs.zh.md))。vendored 族保留上游 payload,因为该 payload 由上游 manifest 拥有,且它们导出 `./src/*`。 ### workflow 形状:PR/push 上 pack,从手动 dispatch 工作流发布 diff --git a/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.i18n.yaml b/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.i18n.yaml new file mode 100644 index 0000000000..dea1726712 --- /dev/null +++ b/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.i18n.yaml @@ -0,0 +1,19 @@ +# Bilingual-pair consistency record for 2026-10-08-published-source-and-docs.md (docs/i18n/README.md): per heading +# section, a hash of its English and Chinese blocks outside code blocks and generated regions. +# After editing either side, bring the other along and re-record with: +# pnpm run verify-translation-pairing --write .agents/notes/implemented/process/2026-10-08-published-source-and-docs.md +/agent-note-published-source-and-documentation: + en: dcd10c6e1f5b6ceb + zh: 269cc2401be0f414 +/agent-note-published-source-and-documentation/problem: + en: 973cdfc5319db522 + zh: b298d546b55b77ef +/agent-note-published-source-and-documentation/decision: + en: 8c1fb9b17ef2377e + zh: fbc81e2633a61f0f +/agent-note-published-source-and-documentation/alternatives-considered: + en: 538980c8b24caee7 + zh: d076222bdbcbdebd +/agent-note-published-source-and-documentation/consequences: + en: 1df4bdcfc4bfaa5b + zh: 32f65ff4dd9c6fba diff --git a/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.md b/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.md new file mode 100644 index 0000000000..dc78150dcf --- /dev/null +++ b/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.md @@ -0,0 +1,41 @@ +# Agent Note: Published source and documentation + +Status: implemented + +English | [中文](2026-10-08-published-source-and-docs.zh.md) + +## Problem + +A published `@deepseek-ai/dsh-*` package carried declarations, bundled runtime, and locale resources, but not the TypeScript the declarations describe. Its `exports` map nevertheless declared `./src/*`, so an installed consumer resolved that subpath to files the tarball did not contain. A plugin author who wanted the implementation behind a documented API had to read the declaration, the documentation website, or a checkout at the matching `dsh-v*` tag: the first stops at the declaration, and the other two are not the installed version. The repository's Markdown documentation reached readers only through the website, which tracks the published release. + +## Decision + +Every release member publishes its TypeScript source and the declaration maps that resolve into it, and `@deepseek-ai/dsh` publishes the repository's Markdown documentation. + +[`expectedDshPackageFiles`](../../../../scripts/check-workspace-constraints.ts) lists `lib/types/**/*.d.ts.map` after the declarations and `src` last; a package with Typert Remote navigation also lists `lib/typert.remote-client.d.ts.map`, which its generated declaration references through `sourceMappingURL`. [`isForbiddenPublicationFile`](../../../../scripts/publication-payload.ts) rejects only bundled JavaScript maps, so both additions pass the static manifest check and the release family's packed-tarball check. The `./src/*` export that 315 of the 332 release members already declared resolves for an installed consumer. + +`@deepseek-ai/dsh` stages the repository `docs` tree into `apps/cli/docs` from its `prepack` lifecycle through [`scripts/stage-dsh-docs.ts`](../../../../scripts/stage-dsh-docs.ts). The staged copy omits `docs/persistence-changes/`, whose per-release migration records the current contract replaces, and the `*.i18n.yaml` consistency records the documentation gates own. Images and every other reader-facing asset ship with it. + +The vendored family keeps upstream's payload unchanged; upstream owns those manifests, and they export `./src/*` ([release sequences](2026-08-10-npm-release-sequences.md)). + +Desktop packaging keeps its own [runtime-file policy](../../../../apps/desktop/scripts/runtime-file-policy.ts), so the packaged application omits declarations and declaration maps and carries `src` and the staged `docs` tree, neither of which it loads. + +## Alternatives considered + +**Keep the payload declarations-only and send readers to the documentation website or the matching `dsh-v*` tag.** Rejected because neither is the installed version, and the website serves the latest published release rather than a prerelease. The declared `./src/*` export also has no meaning without those files. + +**Publish declaration maps without `src`.** Rejected because a map whose `sources` are absent resolves nothing, which is exactly the navigation the [Typert Remote design](../architecture/2026-08-02-typert-remote-method-calls.md) requires. + +**Publish bundled JavaScript maps alongside the runtime bundles.** Rejected because those are single-artifact builds whose maps describe a build tree that is not published. + +**Ship the documentation as a separate `@deepseek-ai/dsh-docs` package.** Rejected because it adds a public package and a release member for content that belongs beside the command every install already has. + +**Publish `docs/persistence-changes` with the rest of the documentation.** Rejected because those records answer a version-comparison question, and their 16 MB would dominate the payload. + +## Consequences + +`src` adds about 29 MB and declaration maps about 10 MB across the release set, and the staged `docs` tree adds about 6.7 MB to `@deepseek-ai/dsh`. Package tarballs grow accordingly, and the Desktop application carries `src` it never loads. + +A consumer editor now follows a declaration to the installed implementation, and a plugin author reads that version's source and documentation without a checkout. The staged copy keeps the repository's relative links, so a link from a shipped page into an unshipped tree — `../packages/**`, or the omitted `docs/persistence-changes/` records — resolves only in a checkout. The documentation payload closes the website's release skew only for the version it shipped with; a consumer still compares `dsh --version` when the difference matters. + +`pnpm run constraints` rejects a member whose `files` omits `src` or either declaration map, because the canonical list is exact. The release family's tarball validation rejects a bundled JavaScript map and requires `@deepseek-ai/dsh` to carry documentation and source, so a pack run that skips the staging hook fails instead of publishing without them. diff --git a/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.zh.md b/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.zh.md new file mode 100644 index 0000000000..cdd0788f5e --- /dev/null +++ b/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.zh.md @@ -0,0 +1,41 @@ +# Agent Note: 发布源码与文档 + +Status: implemented + +[English](2026-10-08-published-source-and-docs.md) | 中文 + +## Problem + +已发布的 `@deepseek-ai/dsh-*` 包带有声明文件、打包后的运行时和 locale 资源,却没有声明文件所描述的 TypeScript 源码。它的 `exports` 仍然声明了 `./src/*`,于是已安装的消费方把该子路径解析到 tarball 中并不存在的文件。插件作者若想看到某个已记录 API 背后的实现,只能读声明文件、文档网站,或检出匹配的 `dsh-v*` tag:第一种停在声明处,后两者都不是已安装的版本。仓库的 Markdown 文档也只能通过网站到达读者,而网站跟随的是已发布版本。 + +## Decision + +每个发布成员都发布自己的 TypeScript 源码,以及能解析到该源码的声明映射;`@deepseek-ai/dsh` 另发布仓库的 Markdown 文档。 + +[`expectedDshPackageFiles`](../../../../scripts/check-workspace-constraints.ts) 在声明之后列出 `lib/types/**/*.d.ts.map`,并把 `src` 列在最后;带 Typert Remote 导航的包还会列出 `lib/typert.remote-client.d.ts.map`,其生成的声明通过 `sourceMappingURL` 引用该映射。[`isForbiddenPublicationFile`](../../../../scripts/publication-payload.ts) 只拒绝打包后的 JavaScript map,因此这两项新增内容都能通过静态 manifest 检查与发布族的 tarball 打包检查。332 个发布成员中已有 315 个声明过 `./src/*`,该导出对已安装的消费方开始真正解析。 + +`@deepseek-ai/dsh` 通过 [`scripts/stage-dsh-docs.ts`](../../../../scripts/stage-dsh-docs.ts) 在自己的 `prepack` 生命周期里把仓库的 `docs` 树暂存到 `apps/cli/docs`。暂存副本不包含 `docs/persistence-changes/`(其中的逐版本迁移记录已被当前契约取代),也不包含由文档门禁拥有的 `*.i18n.yaml` 一致性记录。图片以及其他面向读者的资产都会一并发布。 + +vendored 族保持上游 payload 不变;那些 manifest 由上游拥有,且它们导出 `./src/*`([发布序列](2026-08-10-npm-release-sequences.zh.md))。 + +桌面打包保留自己的[运行时文件策略](../../../../apps/desktop/scripts/runtime-file-policy.ts),因此打包后的应用不含声明与声明映射,并携带它同样不会加载的 `src` 与暂存 `docs` 树。 + +## Alternatives considered + +**保持只发声明文件,把读者引向文档网站或匹配的 `dsh-v*` tag。** 否决:两者都不是已安装的版本,而网站提供的是最新已发布版本而非预发布版本。声明的 `./src/*` 导出没有这些文件也毫无意义。 + +**只发布声明映射,不发布 `src`。** 否决:`sources` 不存在的映射解析不到任何东西,而这正是 [Typert Remote 设计](../architecture/2026-08-02-typert-remote-method-calls.zh.md)所要求的导航。 + +**随运行时 bundle 一起发布打包后的 JavaScript map。** 否决:那些是单产物构建,其 map 描述的构建树并未发布。 + +**把文档做成独立的 `@deepseek-ai/dsh-docs` 包。** 否决:这些内容本来就该待在每个人都会安装的命令旁边,独立成包会多出一个公开包和一个发布成员。 + +**把 `docs/persistence-changes` 与其余文档一起发布。** 否决:那些记录回答的是版本对比问题,其 16 MB 会主导整个 payload。 + +## Consequences + +`src` 在整个发布集上增加约 29 MB,声明映射增加约 10 MB,暂存的 `docs` 树给 `@deepseek-ai/dsh` 增加约 6.7 MB。包 tarball 相应变大,桌面应用则携带它永不加载的 `src` 与 `docs`。 + +消费方编辑器现在可以从声明跳转到已安装的实现,插件作者无需检出即可读到该版本的源码与文档。暂存副本保留仓库的相对链接,因此从随包页面指向未随包目录的链接——`../packages/**`,或被排除的 `docs/persistence-changes/` 记录——只在检出中可解析。文档 payload 只对它随包发布的那个版本消除网站的版本偏差;当差异确实重要时,消费方仍应核对 `dsh --version`。 + +`pnpm run constraints` 会拒绝 `files` 中缺少 `src` 或任一声明映射的发布成员,因为该清单是精确匹配的。发布族的 tarball 校验会拒绝打包后的 JavaScript map,并要求 `@deepseek-ai/dsh` 必须带上文档与源码,因此跳过暂存钩子的打包会直接失败,而不是发出一个缺少它们的包。 diff --git a/.gitignore b/.gitignore index 3cb86ce87d..2412cde9f1 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,7 @@ python/**/__pycache__/ python/**/.pytest_cache/ packages/**/__pycache__/ apps/web/dist/ +apps/cli/docs/ .artifacts/ .dsh-build/ .dsh-report/ diff --git a/apps/cli/package.json b/apps/cli/package.json index 3da15fcad8..2749f9d735 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -16,8 +16,14 @@ }, "files": [ "lib/*.js", - "lib/types/*.d.ts" + "lib/types/*.d.ts", + "lib/types/*.d.ts.map", + "docs", + "src" ], + "scripts": { + "prepack": "tsx ../../scripts/stage-dsh-docs.ts" + }, "license": "MIT", "dependencies": { "@deepseek-ai/cordis": "workspace:~", diff --git a/apps/web/package.json b/apps/web/package.json index 6dfc75207f..f5efe2b592 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -19,7 +19,8 @@ "dist", "!dist/**/*.map", "!dist/preview.html", - "!dist/preview" + "!dist/preview", + "src" ], "scripts": { "build": "vite build", diff --git a/docs/cookbook/adding-a-package.i18n.yaml b/docs/cookbook/adding-a-package.i18n.yaml index 013ecb4344..61a6dfa7d6 100644 --- a/docs/cookbook/adding-a-package.i18n.yaml +++ b/docs/cookbook/adding-a-package.i18n.yaml @@ -6,8 +6,8 @@ en: b94bcdbebcd6355e zh: 9fd61c2b986da759 /cookbook-adding-a-workspace-package/1-create-the-package: - en: 062249fc249b2fec - zh: f6b9fe7f63c4cbad + en: 3dd23deee555ebb0 + zh: 5aa75243b67a1241 /cookbook-adding-a-workspace-package/2-register-it-in-the-root-configs: en: 12b985dee93a47a7 zh: 1027db3d251cd860 diff --git a/docs/cookbook/adding-a-package.md b/docs/cookbook/adding-a-package.md index af3547ea1f..56d3c9134f 100644 --- a/docs/cookbook/adding-a-package.md +++ b/docs/cookbook/adding-a-package.md @@ -24,7 +24,7 @@ packages/// Choose an existing group when one matches the package's role (`core`, `llm`, `shell`, `compaction`, `subagent`, `todo`, `session`, `client`/`host`, `util`, or `test-support`). A new group is allowed, but it is a pure container: no `package.json`, no source files, and packages still sit exactly one level below it. -package.json invariants (enforced by `pnpm run constraints` / `scripts/check-workspace-constraints.ts`): `private: true`, a `version` matching the root `package.json`, `type: module`, `main: "lib/index.js"`, `types: "lib/types/index.d.ts"`, `exports["."].types: "./lib/types/index.d.ts"`, `exports["."].default: "./lib/index.js"`, `@deepseek-ai/cordis` in BOTH peerDependencies and devDependencies (same range). Mirror every dsh peer dependency in devDependencies. `@deepseek-ai/schemastery` goes in `dependencies` (it is a runtime validator), matching agent-loop. The `files` list contains exactly `lib/index.js`, `lib/types/**/*.d.ts`, and package-specific runtime artifacts recognized by the gate. A package whose runtime export points into the emitted tree also includes `lib/types/**/*.js`. Do not publish `src`, declaration maps, JS maps, or stale root declaration files. CLI app packages with a package `bin` include `lib/bin.js` immediately after `lib/index.js` in `files`. +package.json invariants (enforced by `pnpm run constraints` / `scripts/check-workspace-constraints.ts`): `private: true`, a `version` matching the root `package.json`, `type: module`, `main: "lib/index.js"`, `types: "lib/types/index.d.ts"`, `exports["."].types: "./lib/types/index.d.ts"`, `exports["."].default: "./lib/index.js"`, `@deepseek-ai/cordis` in BOTH peerDependencies and devDependencies (same range). Mirror every dsh peer dependency in devDependencies. `@deepseek-ai/schemastery` goes in `dependencies` (it is a runtime validator), matching agent-loop. The `files` list contains exactly `lib/index.js`, `lib/types/**/*.d.ts`, `lib/types/**/*.d.ts.map`, `src`, and package-specific runtime artifacts recognized by the gate. A package whose runtime export points into the emitted tree also includes `lib/types/**/*.js`. Declaration maps and `src` publish together so a consumer editor and a plugin author read the implementation behind an exported declaration; do not publish JS maps or stale root declaration files. CLI app packages with a package `bin` include `lib/bin.js` immediately after `lib/index.js` in `files`. In-package relative imports use explicit `.ts` specifiers in source (for example, `export * from './types.ts'`). The compiler rewrites those to `.js` in emitted JS and leaves explicit `.ts` specifiers in declarations, which standard NodeNext/Node16 TypeScript consumers resolve to the sibling `.d.ts` files. diff --git a/docs/cookbook/adding-a-package.zh.md b/docs/cookbook/adding-a-package.zh.md index c45632d3e7..21052b5904 100644 --- a/docs/cookbook/adding-a-package.zh.md +++ b/docs/cookbook/adding-a-package.zh.md @@ -24,7 +24,7 @@ packages/// 当已有分组与包的角色匹配时,选择该分组(`core`、`llm`、`shell`、`compaction`、`subagent`、`todo`、`session`、`client`/`host`、`util` 或 `test-support`)。允许新建分组,但分组只是纯容器:没有 `package.json`,没有源文件,包仍然恰好位于其下一层。 -package.json 不变式(由 `pnpm run constraints` / `scripts/check-workspace-constraints.ts` 强制执行):`private: true`,`version` 与根 `package.json` 一致,`type: module`,`main: "lib/index.js"`,`types: "lib/types/index.d.ts"`,`exports["."].types: "./lib/types/index.d.ts"`,`exports["."].default: "./lib/index.js"`,`@deepseek-ai/cordis` 同时出现在 peerDependencies 和 devDependencies 中(相同范围)。每个 dsh 对等依赖(peer dependency)都要在 devDependencies 中镜像。`@deepseek-ai/schemastery` 放在 `dependencies` 中(它是运行时校验器),与 agent-loop 保持一致。`files` 列表精确包含 `lib/index.js`、`lib/types/**/*.d.ts` 以及门禁认可的包专用运行时产物。如果包的运行时 export 指向输出树,还要包含 `lib/types/**/*.js`。不要发布 `src`、声明映射、JS map 或陈旧的根声明文件。带有 `bin` 的 CLI 应用包在 `files` 中将 `lib/bin.js` 紧跟在 `lib/index.js` 之后。 +package.json 不变式(由 `pnpm run constraints` / `scripts/check-workspace-constraints.ts` 强制执行):`private: true`,`version` 与根 `package.json` 一致,`type: module`,`main: "lib/index.js"`,`types: "lib/types/index.d.ts"`,`exports["."].types: "./lib/types/index.d.ts"`,`exports["."].default: "./lib/index.js"`,`@deepseek-ai/cordis` 同时出现在 peerDependencies 和 devDependencies 中(相同范围)。每个 dsh 对等依赖(peer dependency)都要在 devDependencies 中镜像。`@deepseek-ai/schemastery` 放在 `dependencies` 中(它是运行时校验器),与 agent-loop 保持一致。`files` 列表精确包含 `lib/index.js`、`lib/types/**/*.d.ts`、`lib/types/**/*.d.ts.map`、`src` 以及门禁认可的包专用运行时产物。如果包的运行时 export 指向输出树,还要包含 `lib/types/**/*.js`。声明映射与 `src` 一起发布,让消费方编辑器和插件作者都能读到导出声明背后的实现;不要发布 JS map 或陈旧的根声明文件。带有 `bin` 的 CLI 应用包在 `files` 中将 `lib/bin.js` 紧跟在 `lib/index.js` 之后。 包内的相对导入在源码中使用显式 `.ts` 后缀(例如 `export * from './types.ts'`)。编译器在输出的 JS 中将其重写为 `.js`,在声明文件中保留显式 `.ts` 后缀;标准的 NodeNext/Node16 TypeScript 消费方会将其解析到同目录的 `.d.ts` 文件。 diff --git a/packages/acp/acp/package.json b/packages/acp/acp/package.json index 5a9e332ce9..292d5d3d6d 100644 --- a/packages/acp/acp/package.json +++ b/packages/acp/acp/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/api/account-controller/package.json b/packages/api/account-controller/package.json index ae3bfe24a1..c4e9a0144e 100644 --- a/packages/api/account-controller/package.json +++ b/packages/api/account-controller/package.json @@ -37,10 +37,13 @@ "lib/index.js", "lib/types/**/*.js", "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", - "lib/typert.remote-client.d.ts" + "lib/typert.remote-client.d.ts", + "lib/typert.remote-client.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/api/gateway/package.json b/packages/api/gateway/package.json index 0ee56662b0..81fa3057fc 100644 --- a/packages/api/gateway/package.json +++ b/packages/api/gateway/package.json @@ -51,7 +51,9 @@ "lib/index.js", "lib/client.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/api/job-controller/package.json b/packages/api/job-controller/package.json index f9fd59429b..a668daa6fe 100644 --- a/packages/api/job-controller/package.json +++ b/packages/api/job-controller/package.json @@ -58,10 +58,13 @@ "lib/client.js", "lib/types/**/*.js", "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", - "lib/typert.remote-client.d.ts" + "lib/typert.remote-client.d.ts", + "lib/typert.remote-client.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/api/remotes/package.json b/packages/api/remotes/package.json index f09b9a96ae..dfe5a003ba 100644 --- a/packages/api/remotes/package.json +++ b/packages/api/remotes/package.json @@ -47,7 +47,9 @@ "lib/index.js", "lib/client.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "dependencies": { "@deepseek-ai/dsh-deque": "workspace:*", diff --git a/packages/api/session-controller/package.json b/packages/api/session-controller/package.json index 3f421fe675..37a1a6da7f 100644 --- a/packages/api/session-controller/package.json +++ b/packages/api/session-controller/package.json @@ -62,10 +62,13 @@ "lib/client.js", "lib/types/**/*.js", "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", - "lib/typert.remote-client.d.ts" + "lib/typert.remote-client.d.ts", + "lib/typert.remote-client.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/api/settings-controller/package.json b/packages/api/settings-controller/package.json index ded8c8bf22..e2c7b73780 100644 --- a/packages/api/settings-controller/package.json +++ b/packages/api/settings-controller/package.json @@ -37,10 +37,13 @@ "lib/index.js", "lib/types/**/*.js", "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", - "lib/typert.remote-client.d.ts" + "lib/typert.remote-client.d.ts", + "lib/typert.remote-client.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/api/terminal-controller/package.json b/packages/api/terminal-controller/package.json index 9b67bd26cc..e903b9b030 100644 --- a/packages/api/terminal-controller/package.json +++ b/packages/api/terminal-controller/package.json @@ -88,9 +88,12 @@ "lib/client.js", "lib/types/**/*.js", "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", - "lib/typert.remote-client.d.ts" + "lib/typert.remote-client.d.ts", + "lib/typert.remote-client.d.ts.map", + "src" ] } diff --git a/packages/api/workspace-controller/package.json b/packages/api/workspace-controller/package.json index 118a4772a9..16a1fb77ee 100644 --- a/packages/api/workspace-controller/package.json +++ b/packages/api/workspace-controller/package.json @@ -62,10 +62,13 @@ "lib/client.js", "lib/types/**/*.js", "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", - "lib/typert.remote-client.d.ts" + "lib/typert.remote-client.d.ts", + "lib/typert.remote-client.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/api/workspace-files/package.json b/packages/api/workspace-files/package.json index 01a35b7da2..d2bce1d79c 100644 --- a/packages/api/workspace-files/package.json +++ b/packages/api/workspace-files/package.json @@ -78,9 +78,12 @@ "lib/client.js", "lib/types/**/*.js", "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", - "lib/typert.remote-client.d.ts" + "lib/typert.remote-client.d.ts", + "lib/typert.remote-client.d.ts.map", + "src" ] } diff --git a/packages/attachment/attachment-local/package.json b/packages/attachment/attachment-local/package.json index 810513ab0e..840ffbbff4 100644 --- a/packages/attachment/attachment-local/package.json +++ b/packages/attachment/attachment-local/package.json @@ -18,7 +18,7 @@ "./src/*": "./src/*", "./package.json": "./package.json" }, - "files": ["lib/index.js", "lib/types/**/*.d.ts"], + "files": ["lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", "src"], "license": "MIT", "peerDependencies": { "@deepseek-ai/dsh-attachment": "workspace:*", diff --git a/packages/attachment/attachment/package.json b/packages/attachment/attachment/package.json index e119eb4700..b1b5b85b42 100644 --- a/packages/attachment/attachment/package.json +++ b/packages/attachment/attachment/package.json @@ -19,7 +19,7 @@ "./src/*": "./src/*", "./package.json": "./package.json" }, - "files": ["lib/index.js", "lib/types/**/*.js", "lib/types/**/*.d.ts"], + "files": ["lib/index.js", "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", "src"], "license": "MIT", "peerDependencies": { "@deepseek-ai/dsh-brand": "workspace:*", diff --git a/packages/boot/app-boot/package.json b/packages/boot/app-boot/package.json index af2930239b..d49a7357d7 100644 --- a/packages/boot/app-boot/package.json +++ b/packages/boot/app-boot/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/worker/profile-resolution-bootstrap.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/boot/cmdline/package.json b/packages/boot/cmdline/package.json index c6ea6cb37a..5e09ffe0b3 100644 --- a/packages/boot/cmdline/package.json +++ b/packages/boot/cmdline/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/boot/config-editor/package.json b/packages/boot/config-editor/package.json index 346d9d4442..29dfca78e4 100644 --- a/packages/boot/config-editor/package.json +++ b/packages/boot/config-editor/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/boot/hmr/package.json b/packages/boot/hmr/package.json index d957e864ba..3eb72e9bcc 100644 --- a/packages/boot/hmr/package.json +++ b/packages/boot/hmr/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "author": "Shigma ", "license": "MIT", diff --git a/packages/boot/plugin-manager/package.json b/packages/boot/plugin-manager/package.json index 4a83a1781a..d6f0c4e545 100644 --- a/packages/boot/plugin-manager/package.json +++ b/packages/boot/plugin-manager/package.json @@ -49,10 +49,13 @@ "lib/index.js", "lib/types/**/*.js", "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", - "lib/typert.remote-client.d.ts" + "lib/typert.remote-client.d.ts", + "lib/typert.remote-client.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/browser-use/browser-use/package.json b/packages/browser-use/browser-use/package.json index 8178f5d01d..28f2cea1dc 100644 --- a/packages/browser-use/browser-use/package.json +++ b/packages/browser-use/browser-use/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/bundle/acp-app/package.json b/packages/bundle/acp-app/package.json index d1d12860c2..cf47a11fcb 100644 --- a/packages/bundle/acp-app/package.json +++ b/packages/bundle/acp-app/package.json @@ -25,7 +25,9 @@ "files": [ "lib/index.js", "cordis.patch.yml", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dsh": { diff --git a/packages/bundle/base/package.json b/packages/bundle/base/package.json index be152900d3..561d5271e6 100644 --- a/packages/bundle/base/package.json +++ b/packages/bundle/base/package.json @@ -25,7 +25,9 @@ "files": [ "lib/index.js", "cordis.patch.yml", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dsh": { diff --git a/packages/bundle/headless/package.json b/packages/bundle/headless/package.json index cf2dc9f38f..42dcf52c01 100644 --- a/packages/bundle/headless/package.json +++ b/packages/bundle/headless/package.json @@ -31,7 +31,9 @@ "lib/startup.js", "cordis.patch.yml", "lib/json-stream-*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dsh": { diff --git a/packages/bundle/sdk-app/package.json b/packages/bundle/sdk-app/package.json index fdfc1d2ad3..980cabaa30 100644 --- a/packages/bundle/sdk-app/package.json +++ b/packages/bundle/sdk-app/package.json @@ -25,7 +25,9 @@ "files": [ "lib/index.js", "cordis.patch.yml", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dsh": { diff --git a/packages/bundle/sdk-minimal/package.json b/packages/bundle/sdk-minimal/package.json index df59eaae4d..fc7807fc38 100644 --- a/packages/bundle/sdk-minimal/package.json +++ b/packages/bundle/sdk-minimal/package.json @@ -25,7 +25,9 @@ "files": [ "lib/index.js", "cordis.patch.yml", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dsh": { diff --git a/packages/bundle/web-app/package.json b/packages/bundle/web-app/package.json index 81c3782121..9de3952235 100644 --- a/packages/bundle/web-app/package.json +++ b/packages/bundle/web-app/package.json @@ -36,7 +36,9 @@ "presets/minimal.patch.yml", "presets/cordis.patch.yml", "lib/public-url-*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dsh": { diff --git a/packages/client/connection/package.json b/packages/client/connection/package.json index b233722f10..f84ec837ea 100644 --- a/packages/client/connection/package.json +++ b/packages/client/connection/package.json @@ -41,7 +41,9 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "peerDependencies": { "@deepseek-ai/cordis": "workspace:~", diff --git a/packages/client/file-upload/package.json b/packages/client/file-upload/package.json index eecaa28d28..ac40374cd4 100644 --- a/packages/client/file-upload/package.json +++ b/packages/client/file-upload/package.json @@ -56,10 +56,13 @@ "lib/client.js", "lib/types/**/*.js", "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", - "lib/typert.remote-client.d.ts" + "lib/typert.remote-client.d.ts", + "lib/typert.remote-client.d.ts.map", + "src" ], "dependencies": { "zod": "^4.4.3", diff --git a/packages/client/hmr/package.json b/packages/client/hmr/package.json index 373c176123..65bd8843b2 100644 --- a/packages/client/hmr/package.json +++ b/packages/client/hmr/package.json @@ -50,6 +50,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/locale/package.json b/packages/client/locale/package.json index a1577330a2..3b6bf825dd 100644 --- a/packages/client/locale/package.json +++ b/packages/client/locale/package.json @@ -62,7 +62,9 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "scripts": { "bundle": "tsdown", diff --git a/packages/client/modules/package.json b/packages/client/modules/package.json index 497adf5366..878948b7e1 100644 --- a/packages/client/modules/package.json +++ b/packages/client/modules/package.json @@ -47,7 +47,9 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "peerDependencies": { "@deepseek-ai/cordis": "workspace:~" diff --git a/packages/client/product-analytics/package.json b/packages/client/product-analytics/package.json index a7a8b4cddc..4dc26d82fe 100644 --- a/packages/client/product-analytics/package.json +++ b/packages/client/product-analytics/package.json @@ -69,10 +69,13 @@ "lib/index.js", "lib/client.js", "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", - "lib/typert.remote-client.d.ts" + "lib/typert.remote-client.d.ts", + "lib/typert.remote-client.d.ts.map", + "src" ], "dependencies": { "@deepseek-ai/dsh-typert-protocol": "workspace:*", diff --git a/packages/client/resources/package.json b/packages/client/resources/package.json index 531d64def9..5e4dbc12ff 100644 --- a/packages/client/resources/package.json +++ b/packages/client/resources/package.json @@ -52,6 +52,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/shortcuts/package.json b/packages/client/shortcuts/package.json index 76f34297ec..1aee3812c3 100644 --- a/packages/client/shortcuts/package.json +++ b/packages/client/shortcuts/package.json @@ -58,7 +58,9 @@ "lib/index.js", "lib/client.js", "lib/protocol.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "dependencies": { "@deepseek-ai/dsh-util-crypto": "workspace:*", diff --git a/packages/client/store/package.json b/packages/client/store/package.json index e6284b5e8c..058442f123 100644 --- a/packages/client/store/package.json +++ b/packages/client/store/package.json @@ -32,6 +32,8 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-agent-preset/package.json b/packages/client/ui-agent-preset/package.json index d65a284667..5eea4b7db8 100644 --- a/packages/client/ui-agent-preset/package.json +++ b/packages/client/ui-agent-preset/package.json @@ -73,7 +73,9 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "dependencies": {} } diff --git a/packages/client/ui-approval/package.json b/packages/client/ui-approval/package.json index 4d8ef679e1..6158620117 100644 --- a/packages/client/ui-approval/package.json +++ b/packages/client/ui-approval/package.json @@ -66,6 +66,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-attachment/package.json b/packages/client/ui-attachment/package.json index e37afaf50d..d0d3e9f7d1 100644 --- a/packages/client/ui-attachment/package.json +++ b/packages/client/ui-attachment/package.json @@ -61,7 +61,9 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "peerDependencies": { "@deepseek-ai/cordis": "workspace:~" diff --git a/packages/client/ui-brand-official/package.json b/packages/client/ui-brand-official/package.json index b4587a84ac..074dcec296 100644 --- a/packages/client/ui-brand-official/package.json +++ b/packages/client/ui-brand-official/package.json @@ -55,6 +55,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-chat/package.json b/packages/client/ui-chat/package.json index 432346bf9d..a0fa173ab5 100644 --- a/packages/client/ui-chat/package.json +++ b/packages/client/ui-chat/package.json @@ -101,6 +101,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-commands/package.json b/packages/client/ui-commands/package.json index ecedb1d9f8..50e41ecdd9 100644 --- a/packages/client/ui-commands/package.json +++ b/packages/client/ui-commands/package.json @@ -68,6 +68,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-conversation/package.json b/packages/client/ui-conversation/package.json index af91420381..6748ea7139 100644 --- a/packages/client/ui-conversation/package.json +++ b/packages/client/ui-conversation/package.json @@ -102,6 +102,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-deliverables/package.json b/packages/client/ui-deliverables/package.json index 174fcf3f72..d318924908 100644 --- a/packages/client/ui-deliverables/package.json +++ b/packages/client/ui-deliverables/package.json @@ -85,7 +85,9 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "dependencies": { "@deepseek-ai/dsh-typert-protocol": "workspace:*" diff --git a/packages/client/ui-directory-picker-browse/package.json b/packages/client/ui-directory-picker-browse/package.json index 557ca70801..99f5457dd8 100644 --- a/packages/client/ui-directory-picker-browse/package.json +++ b/packages/client/ui-directory-picker-browse/package.json @@ -62,6 +62,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-directory-picker-native/package.json b/packages/client/ui-directory-picker-native/package.json index 727c9f22b2..4dd2ae3e3e 100644 --- a/packages/client/ui-directory-picker-native/package.json +++ b/packages/client/ui-directory-picker-native/package.json @@ -55,6 +55,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-dockkit/package.json b/packages/client/ui-dockkit/package.json index e42a8d828f..ff5a987c91 100644 --- a/packages/client/ui-dockkit/package.json +++ b/packages/client/ui-dockkit/package.json @@ -36,7 +36,9 @@ "files": [ "lib/index.js", "lib/**/*.css", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "peerDependencies": { "@deepseek-ai/cordis": "workspace:~" diff --git a/packages/client/ui-goal/package.json b/packages/client/ui-goal/package.json index b1cac92875..d6b5791d5a 100644 --- a/packages/client/ui-goal/package.json +++ b/packages/client/ui-goal/package.json @@ -71,6 +71,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-input-trigger/package.json b/packages/client/ui-input-trigger/package.json index 280dbdaaad..4b7f05fd3a 100644 --- a/packages/client/ui-input-trigger/package.json +++ b/packages/client/ui-input-trigger/package.json @@ -65,6 +65,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-jobs/package.json b/packages/client/ui-jobs/package.json index 7cd9351e30..119051ecb3 100644 --- a/packages/client/ui-jobs/package.json +++ b/packages/client/ui-jobs/package.json @@ -53,7 +53,9 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "dsh": { "client": { diff --git a/packages/client/ui-layout/package.json b/packages/client/ui-layout/package.json index 9c04a714ca..8a6b1bf9d9 100644 --- a/packages/client/ui-layout/package.json +++ b/packages/client/ui-layout/package.json @@ -61,6 +61,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-message-feedback/package.json b/packages/client/ui-message-feedback/package.json index df6cb6895e..5e91d8d77b 100644 --- a/packages/client/ui-message-feedback/package.json +++ b/packages/client/ui-message-feedback/package.json @@ -73,6 +73,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-model-selection/package.json b/packages/client/ui-model-selection/package.json index 90a4f1dbcb..b9f51eabb4 100644 --- a/packages/client/ui-model-selection/package.json +++ b/packages/client/ui-model-selection/package.json @@ -71,6 +71,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-open-in-app/package.json b/packages/client/ui-open-in-app/package.json index e1b15cdf72..f16823d885 100644 --- a/packages/client/ui-open-in-app/package.json +++ b/packages/client/ui-open-in-app/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "scripts": { "bundle": "tsdown", diff --git a/packages/client/ui-permission-presets/package.json b/packages/client/ui-permission-presets/package.json index 48e196a2eb..703beb0f7e 100644 --- a/packages/client/ui-permission-presets/package.json +++ b/packages/client/ui-permission-presets/package.json @@ -72,6 +72,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-plan/package.json b/packages/client/ui-plan/package.json index efaa5d5869..d6be83ae67 100644 --- a/packages/client/ui-plan/package.json +++ b/packages/client/ui-plan/package.json @@ -76,6 +76,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-plugin-manager/package.json b/packages/client/ui-plugin-manager/package.json index 696e1a2f6c..2cc57af932 100644 --- a/packages/client/ui-plugin-manager/package.json +++ b/packages/client/ui-plugin-manager/package.json @@ -79,10 +79,13 @@ "lib/index.js", "lib/client.js", "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", - "lib/typert.remote-client.d.ts" + "lib/typert.remote-client.d.ts", + "lib/typert.remote-client.d.ts.map", + "src" ], "dependencies": { "@deepseek-ai/dsh-timeout": "workspace:*", diff --git a/packages/client/ui-primitives/package.json b/packages/client/ui-primitives/package.json index e8a5b84d1a..df24ffd5d1 100644 --- a/packages/client/ui-primitives/package.json +++ b/packages/client/ui-primitives/package.json @@ -55,7 +55,9 @@ "files": [ "lib/index.js", "lib/**/*.css", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "peerDependencies": { "@deepseek-ai/cordis": "workspace:~" diff --git a/packages/client/ui-reference/package.json b/packages/client/ui-reference/package.json index cee0b99508..c1ed59761c 100644 --- a/packages/client/ui-reference/package.json +++ b/packages/client/ui-reference/package.json @@ -65,6 +65,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-renderer/package.json b/packages/client/ui-renderer/package.json index 347920cc81..7422b8f82e 100644 --- a/packages/client/ui-renderer/package.json +++ b/packages/client/ui-renderer/package.json @@ -53,6 +53,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-schedule/package.json b/packages/client/ui-schedule/package.json index 0d65fc8977..f53200307d 100644 --- a/packages/client/ui-schedule/package.json +++ b/packages/client/ui-schedule/package.json @@ -85,6 +85,8 @@ "locale/*.json", "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-session/package.json b/packages/client/ui-session/package.json index e0d1b55faa..c5f71e18b1 100644 --- a/packages/client/ui-session/package.json +++ b/packages/client/ui-session/package.json @@ -60,6 +60,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-settings-account/package.json b/packages/client/ui-settings-account/package.json index ed21b99671..a6283a3186 100644 --- a/packages/client/ui-settings-account/package.json +++ b/packages/client/ui-settings-account/package.json @@ -75,7 +75,9 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "dependencies": { "@deepseek-ai/schemastery": "workspace:~" diff --git a/packages/client/ui-settings-agent-loop/package.json b/packages/client/ui-settings-agent-loop/package.json index 4ab203ecbf..c6a17d6989 100644 --- a/packages/client/ui-settings-agent-loop/package.json +++ b/packages/client/ui-settings-agent-loop/package.json @@ -60,6 +60,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-settings-general/package.json b/packages/client/ui-settings-general/package.json index ddba8ede7b..8e891050f0 100644 --- a/packages/client/ui-settings-general/package.json +++ b/packages/client/ui-settings-general/package.json @@ -77,6 +77,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-settings-models/package.json b/packages/client/ui-settings-models/package.json index 0f4aa17a27..0406435b03 100644 --- a/packages/client/ui-settings-models/package.json +++ b/packages/client/ui-settings-models/package.json @@ -66,6 +66,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-settings-plugin-inventory/package.json b/packages/client/ui-settings-plugin-inventory/package.json index b4f868e424..08fe010f98 100644 --- a/packages/client/ui-settings-plugin-inventory/package.json +++ b/packages/client/ui-settings-plugin-inventory/package.json @@ -67,6 +67,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-settings-plugins/package.json b/packages/client/ui-settings-plugins/package.json index 0f32affb06..5b63a88665 100644 --- a/packages/client/ui-settings-plugins/package.json +++ b/packages/client/ui-settings-plugins/package.json @@ -56,6 +56,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-settings-session-log/package.json b/packages/client/ui-settings-session-log/package.json index 32fb45425d..73b015a62e 100644 --- a/packages/client/ui-settings-session-log/package.json +++ b/packages/client/ui-settings-session-log/package.json @@ -62,6 +62,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-settings-shell/package.json b/packages/client/ui-settings-shell/package.json index 017b51260c..81133f38bc 100644 --- a/packages/client/ui-settings-shell/package.json +++ b/packages/client/ui-settings-shell/package.json @@ -60,6 +60,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-settings-subagent/package.json b/packages/client/ui-settings-subagent/package.json index 0899660cd8..46aaba01ed 100644 --- a/packages/client/ui-settings-subagent/package.json +++ b/packages/client/ui-settings-subagent/package.json @@ -61,6 +61,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-settings-web-search/package.json b/packages/client/ui-settings-web-search/package.json index 5cdf2fdfe7..9322cfb595 100644 --- a/packages/client/ui-settings-web-search/package.json +++ b/packages/client/ui-settings-web-search/package.json @@ -61,6 +61,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-settings/package.json b/packages/client/ui-settings/package.json index e1cc80cd17..7d61bf0286 100644 --- a/packages/client/ui-settings/package.json +++ b/packages/client/ui-settings/package.json @@ -55,7 +55,9 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "dependencies": { "@deepseek-ai/schemastery": "workspace:~" diff --git a/packages/client/ui-shortcuts/package.json b/packages/client/ui-shortcuts/package.json index 72204436f3..48810efd1d 100644 --- a/packages/client/ui-shortcuts/package.json +++ b/packages/client/ui-shortcuts/package.json @@ -63,6 +63,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-sidebar-browser/package.json b/packages/client/ui-sidebar-browser/package.json index b97e65024b..9bb1561e62 100644 --- a/packages/client/ui-sidebar-browser/package.json +++ b/packages/client/ui-sidebar-browser/package.json @@ -68,6 +68,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-sidebar-documentpreview/package.json b/packages/client/ui-sidebar-documentpreview/package.json index de0132b03f..112e221df0 100644 --- a/packages/client/ui-sidebar-documentpreview/package.json +++ b/packages/client/ui-sidebar-documentpreview/package.json @@ -92,7 +92,9 @@ "lib/index.js", "lib/client.js", "lib/client.*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "dependencies": { "@deepseek-ai/schemastery": "workspace:~" diff --git a/packages/client/ui-sidebar-files/package.json b/packages/client/ui-sidebar-files/package.json index 791ed03364..fd84e6d154 100644 --- a/packages/client/ui-sidebar-files/package.json +++ b/packages/client/ui-sidebar-files/package.json @@ -72,6 +72,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-sidebar-right/package.json b/packages/client/ui-sidebar-right/package.json index 406c3322ac..3ce4c8e314 100644 --- a/packages/client/ui-sidebar-right/package.json +++ b/packages/client/ui-sidebar-right/package.json @@ -77,6 +77,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-sidebar-terminal/package.json b/packages/client/ui-sidebar-terminal/package.json index 713c3e9c77..6279fa350a 100644 --- a/packages/client/ui-sidebar-terminal/package.json +++ b/packages/client/ui-sidebar-terminal/package.json @@ -76,6 +76,8 @@ "lib/index.js", "lib/client.js", "lib/client.*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-sidebar/package.json b/packages/client/ui-sidebar/package.json index 092797ec13..b09fd9ffa4 100644 --- a/packages/client/ui-sidebar/package.json +++ b/packages/client/ui-sidebar/package.json @@ -68,6 +68,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-skill/package.json b/packages/client/ui-skill/package.json index b4e69169b7..e5d2e84496 100644 --- a/packages/client/ui-skill/package.json +++ b/packages/client/ui-skill/package.json @@ -71,6 +71,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-slots/package.json b/packages/client/ui-slots/package.json index 7e7e9c28fb..808269b089 100644 --- a/packages/client/ui-slots/package.json +++ b/packages/client/ui-slots/package.json @@ -29,7 +29,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "peerDependencies": { "@deepseek-ai/cordis": "workspace:~" diff --git a/packages/client/ui-subagent/package.json b/packages/client/ui-subagent/package.json index 77876b327d..4ebd50f44d 100644 --- a/packages/client/ui-subagent/package.json +++ b/packages/client/ui-subagent/package.json @@ -76,6 +76,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-theme/package.json b/packages/client/ui-theme/package.json index 2e43211b92..e3310e252e 100644 --- a/packages/client/ui-theme/package.json +++ b/packages/client/ui-theme/package.json @@ -64,7 +64,9 @@ "lib/index.js", "lib/client.js", "lib/styles", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "scripts": { "bundle": "tsdown", diff --git a/packages/client/ui-tool/package.json b/packages/client/ui-tool/package.json index 6058888f57..45c3781fcd 100644 --- a/packages/client/ui-tool/package.json +++ b/packages/client/ui-tool/package.json @@ -82,6 +82,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-trajectory/package.json b/packages/client/ui-trajectory/package.json index f184db05d2..06e1f18796 100644 --- a/packages/client/ui-trajectory/package.json +++ b/packages/client/ui-trajectory/package.json @@ -74,6 +74,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-user-questions/package.json b/packages/client/ui-user-questions/package.json index 58c9a968eb..0cbe8cfa97 100644 --- a/packages/client/ui-user-questions/package.json +++ b/packages/client/ui-user-questions/package.json @@ -76,6 +76,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/ui-workflow-run/package.json b/packages/client/ui-workflow-run/package.json index 79d2efd4fb..bbe4728d52 100644 --- a/packages/client/ui-workflow-run/package.json +++ b/packages/client/ui-workflow-run/package.json @@ -46,7 +46,9 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/client/ui-workspace/package.json b/packages/client/ui-workspace/package.json index f062d8392c..05a9c77ded 100644 --- a/packages/client/ui-workspace/package.json +++ b/packages/client/ui-workspace/package.json @@ -84,6 +84,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/client/web/package.json b/packages/client/web/package.json index ceb21773d5..c43c8e3c55 100644 --- a/packages/client/web/package.json +++ b/packages/client/web/package.json @@ -49,6 +49,8 @@ "lib/index.js", "lib/**/*.css", "lib/apply-injections.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/compaction/command-compact/package.json b/packages/compaction/command-compact/package.json index 3fbfb59544..324dfef173 100644 --- a/packages/compaction/command-compact/package.json +++ b/packages/compaction/command-compact/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/compaction/compaction-basic/package.json b/packages/compaction/compaction-basic/package.json index 4eba2ada7b..2e7458d70a 100644 --- a/packages/compaction/compaction-basic/package.json +++ b/packages/compaction/compaction-basic/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/compaction/compaction-image-offload/package.json b/packages/compaction/compaction-image-offload/package.json index 67b3dc20e7..104f443ada 100644 --- a/packages/compaction/compaction-image-offload/package.json +++ b/packages/compaction/compaction-image-offload/package.json @@ -27,7 +27,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/compaction/compaction-tool-result-pruner/package.json b/packages/compaction/compaction-tool-result-pruner/package.json index b8cd3f2062..98e8bac151 100644 --- a/packages/compaction/compaction-tool-result-pruner/package.json +++ b/packages/compaction/compaction-tool-result-pruner/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/compaction/compaction/package.json b/packages/compaction/compaction/package.json index 8f9c368f70..4da7b162d0 100644 --- a/packages/compaction/compaction/package.json +++ b/packages/compaction/compaction/package.json @@ -32,7 +32,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/computer-use/computer-use/package.json b/packages/computer-use/computer-use/package.json index db8daf5fbe..2f4bd4b561 100644 --- a/packages/computer-use/computer-use/package.json +++ b/packages/computer-use/computer-use/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/context/agent-instructions/package.json b/packages/context/agent-instructions/package.json index 16f68d3634..bbb0a78028 100644 --- a/packages/context/agent-instructions/package.json +++ b/packages/context/agent-instructions/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/context/file-reference-local/package.json b/packages/context/file-reference-local/package.json index 5cb1646286..4bb0ed6609 100644 --- a/packages/context/file-reference-local/package.json +++ b/packages/context/file-reference-local/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/context/file-reference/package.json b/packages/context/file-reference/package.json index 125f4f7b10..af6f101793 100644 --- a/packages/context/file-reference/package.json +++ b/packages/context/file-reference/package.json @@ -32,7 +32,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/context/session-reference/package.json b/packages/context/session-reference/package.json index 9b8572ca85..e9897c5d0e 100644 --- a/packages/context/session-reference/package.json +++ b/packages/context/session-reference/package.json @@ -37,10 +37,13 @@ "lib/index.js", "lib/types/**/*.js", "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", - "lib/typert.remote-client.d.ts" + "lib/typert.remote-client.d.ts", + "lib/typert.remote-client.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/context/time-context/package.json b/packages/context/time-context/package.json index 0f778f8591..2f33097a13 100644 --- a/packages/context/time-context/package.json +++ b/packages/context/time-context/package.json @@ -25,7 +25,9 @@ "files": [ "locale/*.json", "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/context/tmux-context/package.json b/packages/context/tmux-context/package.json index fc3834a07d..6614e96b4f 100644 --- a/packages/context/tmux-context/package.json +++ b/packages/context/tmux-context/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/core/agent-default-model/package.json b/packages/core/agent-default-model/package.json index 7acef9bb27..95a8c6bf9a 100644 --- a/packages/core/agent-default-model/package.json +++ b/packages/core/agent-default-model/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/core/agent-loop/package.json b/packages/core/agent-loop/package.json index 1e1678594f..11e2637b19 100644 --- a/packages/core/agent-loop/package.json +++ b/packages/core/agent-loop/package.json @@ -22,7 +22,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/core/agent-tool-presentation/package.json b/packages/core/agent-tool-presentation/package.json index 99aafd9731..24222c7831 100644 --- a/packages/core/agent-tool-presentation/package.json +++ b/packages/core/agent-tool-presentation/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/core/agent/package.json b/packages/core/agent/package.json index f33481fc28..baa51e2bae 100644 --- a/packages/core/agent/package.json +++ b/packages/core/agent/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/core/scope/package.json b/packages/core/scope/package.json index 29d8d56bf0..2f0cdca10a 100644 --- a/packages/core/scope/package.json +++ b/packages/core/scope/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/core/session/package.json b/packages/core/session/package.json index 68fec8f3d6..036627d364 100644 --- a/packages/core/session/package.json +++ b/packages/core/session/package.json @@ -36,7 +36,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/core/system-prompt/package.json b/packages/core/system-prompt/package.json index 951ec3fb95..8674b12846 100644 --- a/packages/core/system-prompt/package.json +++ b/packages/core/system-prompt/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/core/tools/package.json b/packages/core/tools/package.json index 1e4fa8ba01..f08522c45a 100644 --- a/packages/core/tools/package.json +++ b/packages/core/tools/package.json @@ -32,7 +32,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/credentials/authorization/package.json b/packages/credentials/authorization/package.json index 8ceffd30dc..8086274bc9 100644 --- a/packages/credentials/authorization/package.json +++ b/packages/credentials/authorization/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/credentials/credentials-local/package.json b/packages/credentials/credentials-local/package.json index 93276c131e..2c03c980c0 100644 --- a/packages/credentials/credentials-local/package.json +++ b/packages/credentials/credentials-local/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/credentials/credentials/package.json b/packages/credentials/credentials/package.json index e6f5d79399..bbbd675062 100644 --- a/packages/credentials/credentials/package.json +++ b/packages/credentials/credentials/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/credentials/deepseek-account-platform/package.json b/packages/credentials/deepseek-account-platform/package.json index 381954457a..8327ec2ba3 100644 --- a/packages/credentials/deepseek-account-platform/package.json +++ b/packages/credentials/deepseek-account-platform/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/credentials/deepseek-account/package.json b/packages/credentials/deepseek-account/package.json index c1b7867842..27a9da1f24 100644 --- a/packages/credentials/deepseek-account/package.json +++ b/packages/credentials/deepseek-account/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/deliverables/tool-present/package.json b/packages/deliverables/tool-present/package.json index 8bbd9e427b..e9181ed2a6 100644 --- a/packages/deliverables/tool-present/package.json +++ b/packages/deliverables/tool-present/package.json @@ -29,7 +29,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "dependencies": { "@deepseek-ai/schemastery": "workspace:~" diff --git a/packages/deliverables/workspace-changes/package.json b/packages/deliverables/workspace-changes/package.json index 5fc5f7ae86..f93a7d0712 100644 --- a/packages/deliverables/workspace-changes/package.json +++ b/packages/deliverables/workspace-changes/package.json @@ -29,7 +29,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "dependencies": { "@deepseek-ai/schemastery": "workspace:~", diff --git a/packages/document/office-to-pdf/package.json b/packages/document/office-to-pdf/package.json index 26cc2f353c..bf13eaaf96 100644 --- a/packages/document/office-to-pdf/package.json +++ b/packages/document/office-to-pdf/package.json @@ -38,10 +38,13 @@ "lib/index.js", "lib/types/**/*.js", "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", - "lib/typert.remote-client.d.ts" + "lib/typert.remote-client.d.ts", + "lib/typert.remote-client.d.ts.map", + "src" ], "peerDependencies": { "@deepseek-ai/cordis": "workspace:~" diff --git a/packages/experimental/agent-team-profile/package.json b/packages/experimental/agent-team-profile/package.json index 0d907efdd8..cdcc2217b8 100644 --- a/packages/experimental/agent-team-profile/package.json +++ b/packages/experimental/agent-team-profile/package.json @@ -29,7 +29,9 @@ "locale/*.json", "lib/index.js", "cordis.patch.yml", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dsh": { diff --git a/packages/experimental/agent-team/package.json b/packages/experimental/agent-team/package.json index 12d49f07dd..cb10d380cd 100644 --- a/packages/experimental/agent-team/package.json +++ b/packages/experimental/agent-team/package.json @@ -34,7 +34,9 @@ "locale/*.json", "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/experimental/api-speech-to-text/package.json b/packages/experimental/api-speech-to-text/package.json index 2c02c9443a..0503a8c646 100644 --- a/packages/experimental/api-speech-to-text/package.json +++ b/packages/experimental/api-speech-to-text/package.json @@ -37,10 +37,13 @@ "lib/index.js", "lib/types/**/*.js", "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", - "lib/typert.remote-client.d.ts" + "lib/typert.remote-client.d.ts", + "lib/typert.remote-client.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/experimental/auto-review/package.json b/packages/experimental/auto-review/package.json index fa458f0726..d369477539 100644 --- a/packages/experimental/auto-review/package.json +++ b/packages/experimental/auto-review/package.json @@ -26,7 +26,9 @@ "locale/*.json", "lib/index.js", "cordis.patch.yml", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/experimental/badge-skill-bundle/package.json b/packages/experimental/badge-skill-bundle/package.json index 7853f04167..31e091cae6 100644 --- a/packages/experimental/badge-skill-bundle/package.json +++ b/packages/experimental/badge-skill-bundle/package.json @@ -29,7 +29,9 @@ "locale/*.json", "lib/index.js", "cordis.patch.yml", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dsh": { diff --git a/packages/experimental/browser-use-chrome-devtools-mcp/package.json b/packages/experimental/browser-use-chrome-devtools-mcp/package.json index cee92d700c..649d452d51 100644 --- a/packages/experimental/browser-use-chrome-devtools-mcp/package.json +++ b/packages/experimental/browser-use-chrome-devtools-mcp/package.json @@ -25,7 +25,9 @@ "files": [ "locale/*.json", "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/experimental/browser-use-playwright-mcp/package.json b/packages/experimental/browser-use-playwright-mcp/package.json index 8f006c5310..130fd36866 100644 --- a/packages/experimental/browser-use-playwright-mcp/package.json +++ b/packages/experimental/browser-use-playwright-mcp/package.json @@ -25,7 +25,9 @@ "files": [ "locale/*.json", "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/experimental/browser-use-runtime/package.json b/packages/experimental/browser-use-runtime/package.json index ebefaf7e56..1c2bb93a41 100644 --- a/packages/experimental/browser-use-runtime/package.json +++ b/packages/experimental/browser-use-runtime/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/experimental/browser-use-stagehand-native/package.json b/packages/experimental/browser-use-stagehand-native/package.json index ea9dd3142b..9a098ea4d8 100644 --- a/packages/experimental/browser-use-stagehand-native/package.json +++ b/packages/experimental/browser-use-stagehand-native/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/worker.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/experimental/claude-code-mods/package.json b/packages/experimental/claude-code-mods/package.json index 21b9d18317..0cea68cf83 100644 --- a/packages/experimental/claude-code-mods/package.json +++ b/packages/experimental/claude-code-mods/package.json @@ -42,10 +42,13 @@ "lib/index.js", "lib/types/**/*.js", "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", - "lib/typert.remote-client.d.ts" + "lib/typert.remote-client.d.ts", + "lib/typert.remote-client.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/experimental/client-ui-agent-team/package.json b/packages/experimental/client-ui-agent-team/package.json index d1d727a400..39095ad10f 100644 --- a/packages/experimental/client-ui-agent-team/package.json +++ b/packages/experimental/client-ui-agent-team/package.json @@ -80,6 +80,8 @@ "locale/*.json", "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/experimental/client-ui-claude-code-mods/package.json b/packages/experimental/client-ui-claude-code-mods/package.json index 0fa362cc1b..219958feb4 100644 --- a/packages/experimental/client-ui-claude-code-mods/package.json +++ b/packages/experimental/client-ui-claude-code-mods/package.json @@ -44,7 +44,9 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/experimental/client-ui-cot-translation/package.json b/packages/experimental/client-ui-cot-translation/package.json index 90117ed048..4c34f6995d 100644 --- a/packages/experimental/client-ui-cot-translation/package.json +++ b/packages/experimental/client-ui-cot-translation/package.json @@ -98,9 +98,12 @@ "lib/index.js", "lib/client.js", "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", - "lib/typert.remote-client.d.ts" + "lib/typert.remote-client.d.ts", + "lib/typert.remote-client.d.ts.map", + "src" ] } diff --git a/packages/experimental/client-ui-voice-input/package.json b/packages/experimental/client-ui-voice-input/package.json index ede23b2d00..52947344eb 100644 --- a/packages/experimental/client-ui-voice-input/package.json +++ b/packages/experimental/client-ui-voice-input/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": {}, diff --git a/packages/experimental/computer-use-cua-driver-mcp/package.json b/packages/experimental/computer-use-cua-driver-mcp/package.json index b058a5c6b8..8dc46d644c 100644 --- a/packages/experimental/computer-use-cua-driver-mcp/package.json +++ b/packages/experimental/computer-use-cua-driver-mcp/package.json @@ -25,7 +25,9 @@ "files": [ "locale/*.json", "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/experimental/computer-use-cua-driver-native/package.json b/packages/experimental/computer-use-cua-driver-native/package.json index e9055c9bb4..1ff2b78772 100644 --- a/packages/experimental/computer-use-cua-driver-native/package.json +++ b/packages/experimental/computer-use-cua-driver-native/package.json @@ -25,7 +25,9 @@ "files": [ "locale/*.json", "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/experimental/cot-translation-bundle/package.json b/packages/experimental/cot-translation-bundle/package.json index d723a94941..94adb61160 100644 --- a/packages/experimental/cot-translation-bundle/package.json +++ b/packages/experimental/cot-translation-bundle/package.json @@ -29,7 +29,9 @@ "locale/*.json", "lib/index.js", "cordis.patch.yml", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/experimental/hook-protocol/package.json b/packages/experimental/hook-protocol/package.json index 1195c9de2c..7bc2b5ccfd 100644 --- a/packages/experimental/hook-protocol/package.json +++ b/packages/experimental/hook-protocol/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/experimental/hooks-claude-code/package.json b/packages/experimental/hooks-claude-code/package.json index 9799278af9..bc53713b75 100644 --- a/packages/experimental/hooks-claude-code/package.json +++ b/packages/experimental/hooks-claude-code/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/experimental/hooks-codex/package.json b/packages/experimental/hooks-codex/package.json index e4eac2a937..db892f744b 100644 --- a/packages/experimental/hooks-codex/package.json +++ b/packages/experimental/hooks-codex/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/experimental/inspector-profile/package.json b/packages/experimental/inspector-profile/package.json index 8a043b0a09..fce0e27389 100644 --- a/packages/experimental/inspector-profile/package.json +++ b/packages/experimental/inspector-profile/package.json @@ -29,7 +29,9 @@ "locale/*.json", "lib/index.js", "cordis.patch.yml", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dsh": { diff --git a/packages/experimental/inspector/package.json b/packages/experimental/inspector/package.json index 225e54565f..d07bc8440e 100644 --- a/packages/experimental/inspector/package.json +++ b/packages/experimental/inspector/package.json @@ -42,7 +42,9 @@ "lib/client.*.js", "lib/worker.js", "lib/devtools/**", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/experimental/ptc-runtime-python/package.json b/packages/experimental/ptc-runtime-python/package.json index 026dce8443..05d6695922 100644 --- a/packages/experimental/ptc-runtime-python/package.json +++ b/packages/experimental/ptc-runtime-python/package.json @@ -20,7 +20,9 @@ "files": [ "lib/index.js", "py/**/*.py", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/experimental/ralph-bundle/package.json b/packages/experimental/ralph-bundle/package.json index f36ebb0eec..8a9ca8c122 100644 --- a/packages/experimental/ralph-bundle/package.json +++ b/packages/experimental/ralph-bundle/package.json @@ -29,7 +29,9 @@ "locale/*.json", "lib/index.js", "cordis.patch.yml", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dsh": { diff --git a/packages/experimental/session-inspector/package.json b/packages/experimental/session-inspector/package.json index 9a9b2aa39e..d72e339160 100644 --- a/packages/experimental/session-inspector/package.json +++ b/packages/experimental/session-inspector/package.json @@ -42,7 +42,9 @@ "locale/*.json", "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "scripts": { "bundle": "tsdown", diff --git a/packages/experimental/session-search/package.json b/packages/experimental/session-search/package.json index e563a02406..27b4d8a481 100644 --- a/packages/experimental/session-search/package.json +++ b/packages/experimental/session-search/package.json @@ -29,7 +29,9 @@ "locale/*.json", "lib/index.js", "cordis.patch.yml", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dsh": { diff --git a/packages/experimental/session-title-all-prompts-llm/package.json b/packages/experimental/session-title-all-prompts-llm/package.json index 0768ee82b0..3bb6b1a8a1 100644 --- a/packages/experimental/session-title-all-prompts-llm/package.json +++ b/packages/experimental/session-title-all-prompts-llm/package.json @@ -20,7 +20,7 @@ }, "./package.json": "./package.json" }, - "files": ["lib/index.js", "lib/types/**/*.d.ts"], + "files": ["lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", "src"], "license": "MIT", "peerDependencies": { "@deepseek-ai/dsh-llm": "workspace:*", diff --git a/packages/experimental/session-titles-bundle/package.json b/packages/experimental/session-titles-bundle/package.json index 5232bea10c..475f158d5e 100644 --- a/packages/experimental/session-titles-bundle/package.json +++ b/packages/experimental/session-titles-bundle/package.json @@ -29,7 +29,9 @@ "locale/*.json", "lib/index.js", "cordis.patch.yml", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dsh": { diff --git a/packages/experimental/skill-badge/package.json b/packages/experimental/skill-badge/package.json index fdc2588323..8fabfbad9f 100644 --- a/packages/experimental/skill-badge/package.json +++ b/packages/experimental/skill-badge/package.json @@ -23,7 +23,9 @@ "files": [ "lib/index.js", "assets", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/experimental/speech-to-text-sensevoice/package.json b/packages/experimental/speech-to-text-sensevoice/package.json index f5889577ec..104c4b0536 100644 --- a/packages/experimental/speech-to-text-sensevoice/package.json +++ b/packages/experimental/speech-to-text-sensevoice/package.json @@ -29,7 +29,9 @@ "lib/index.js", "lib/worker.js", "runtime/assets.json", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/experimental/speech-to-text/package.json b/packages/experimental/speech-to-text/package.json index aae9285419..a409000607 100644 --- a/packages/experimental/speech-to-text/package.json +++ b/packages/experimental/speech-to-text/package.json @@ -32,7 +32,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/experimental/terminal-bundle/package.json b/packages/experimental/terminal-bundle/package.json index 18d5e3822b..fe5c7f385b 100644 --- a/packages/experimental/terminal-bundle/package.json +++ b/packages/experimental/terminal-bundle/package.json @@ -29,7 +29,9 @@ "locale/*.json", "lib/index.js", "cordis.patch.yml", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dsh": { diff --git a/packages/experimental/tool-agent-team/package.json b/packages/experimental/tool-agent-team/package.json index 95222ce232..c87306ccfd 100644 --- a/packages/experimental/tool-agent-team/package.json +++ b/packages/experimental/tool-agent-team/package.json @@ -25,7 +25,9 @@ "files": [ "locale/*.json", "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/experimental/tool-ralph/package.json b/packages/experimental/tool-ralph/package.json index 3458cc12db..1a00b6fdfa 100644 --- a/packages/experimental/tool-ralph/package.json +++ b/packages/experimental/tool-ralph/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/experimental/tool-session-query/package.json b/packages/experimental/tool-session-query/package.json index c2708f81bc..6529b88486 100644 --- a/packages/experimental/tool-session-query/package.json +++ b/packages/experimental/tool-session-query/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/experimental/tool-terminal/package.json b/packages/experimental/tool-terminal/package.json index c3140c8ea5..77eeba7bde 100644 --- a/packages/experimental/tool-terminal/package.json +++ b/packages/experimental/tool-terminal/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/experimental/tool-worktree/package.json b/packages/experimental/tool-worktree/package.json index 80c110c98d..c190a33d11 100644 --- a/packages/experimental/tool-worktree/package.json +++ b/packages/experimental/tool-worktree/package.json @@ -23,7 +23,9 @@ "locale/*.json", "lib/index.js", "cordis.patch.yml", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "repository": { diff --git a/packages/experimental/translator/package.json b/packages/experimental/translator/package.json index 0111d23db6..0b8532d919 100644 --- a/packages/experimental/translator/package.json +++ b/packages/experimental/translator/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/experimental/voice-input-bundle/package.json b/packages/experimental/voice-input-bundle/package.json index 846db038ad..42c4b82110 100644 --- a/packages/experimental/voice-input-bundle/package.json +++ b/packages/experimental/voice-input-bundle/package.json @@ -29,7 +29,9 @@ "locale/*.json", "lib/index.js", "cordis.patch.yml", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/experimental/webhook-github/package.json b/packages/experimental/webhook-github/package.json index f1f5c2c14a..6876690a14 100644 --- a/packages/experimental/webhook-github/package.json +++ b/packages/experimental/webhook-github/package.json @@ -31,7 +31,9 @@ "examples/github-review/cordis.yml", "examples/github-review/github-ready-review-rule.mjs", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/experimental/webhook/package.json b/packages/experimental/webhook/package.json index 3674193d07..6ae1c738a3 100644 --- a/packages/experimental/webhook/package.json +++ b/packages/experimental/webhook/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/experimental/webworker-packer/package.json b/packages/experimental/webworker-packer/package.json index 27220fa0b3..d559b90127 100644 --- a/packages/experimental/webworker-packer/package.json +++ b/packages/experimental/webworker-packer/package.json @@ -29,7 +29,9 @@ "lib/bin.js", "bin.js", "lib/repository-*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/experimental/webworker-packer/tests/built-lib.e2e.ts b/packages/experimental/webworker-packer/tests/built-lib.e2e.ts index e945c60c8c..cd438f3f63 100644 --- a/packages/experimental/webworker-packer/tests/built-lib.e2e.ts +++ b/packages/experimental/webworker-packer/tests/built-lib.e2e.ts @@ -1,4 +1,4 @@ -/** Installed packer/runtime interoperability without either package's source tree. */ +/** Installed packer/runtime interoperability from published tarballs, without a workspace checkout. */ import { existsSync } from 'node:fs' import { mkdir, mkdtemp, readFile, readdir, realpath, rm, symlink, unlink, writeFile } from 'node:fs/promises' import { tmpdir } from 'node:os' @@ -54,7 +54,8 @@ it('loads both tarballs through plain Node and mounts their base image and overl const archives = (await readdir(packRoot)).filter(file => file.endsWith('.tgz')) expect(archives).toHaveLength(1) await run('tar', ['-xzf', join(packRoot, archives[0]!), '-C', directory, '--strip-components=1'], root) - expect(existsSync(join(directory, 'src'))).toBe(false) + // The published payload carries the source tree; the consumer below resolves and runs `lib` alone. + expect(existsSync(join(directory, 'src'))).toBe(true) const manifest = JSON.parse(await readFile(join(directory, 'package.json'), 'utf8')) as { dependencies?: Record peerDependencies?: Record diff --git a/packages/experimental/webworker-runtime/package.json b/packages/experimental/webworker-runtime/package.json index 2fd84363f7..8e0dd86948 100644 --- a/packages/experimental/webworker-runtime/package.json +++ b/packages/experimental/webworker-runtime/package.json @@ -70,6 +70,8 @@ "lib/index.js", "lib/worker.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/experimental/worktree/package.json b/packages/experimental/worktree/package.json index 493ddce15b..04d9bef0a9 100644 --- a/packages/experimental/worktree/package.json +++ b/packages/experimental/worktree/package.json @@ -18,7 +18,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "repository": { diff --git a/packages/extensions/cordis-client-runner/package.json b/packages/extensions/cordis-client-runner/package.json index 57f0f6e8b0..4a5969e872 100644 --- a/packages/extensions/cordis-client-runner/package.json +++ b/packages/extensions/cordis-client-runner/package.json @@ -58,6 +58,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/extensions/cordis-host-runner/package.json b/packages/extensions/cordis-host-runner/package.json index 88e037d1f7..6d7230de92 100644 --- a/packages/extensions/cordis-host-runner/package.json +++ b/packages/extensions/cordis-host-runner/package.json @@ -37,10 +37,13 @@ "lib/index.js", "lib/types/**/*.js", "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", - "lib/typert.remote-client.d.ts" + "lib/typert.remote-client.d.ts", + "lib/typert.remote-client.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/extensions/tool-cordis/package.json b/packages/extensions/tool-cordis/package.json index a9be3331b5..eeb414d4da 100644 --- a/packages/extensions/tool-cordis/package.json +++ b/packages/extensions/tool-cordis/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/extensions/ui-cordis/package.json b/packages/extensions/ui-cordis/package.json index 419b88a221..c54a7609a3 100644 --- a/packages/extensions/ui-cordis/package.json +++ b/packages/extensions/ui-cordis/package.json @@ -68,6 +68,8 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/feedback/command-feedback/package.json b/packages/feedback/command-feedback/package.json index 6886dd91c1..1fff4ede00 100644 --- a/packages/feedback/command-feedback/package.json +++ b/packages/feedback/command-feedback/package.json @@ -37,10 +37,13 @@ "lib/index.js", "lib/types/**/*.js", "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", - "lib/typert.remote-client.d.ts" + "lib/typert.remote-client.d.ts", + "lib/typert.remote-client.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/feedback/message-feedback/package.json b/packages/feedback/message-feedback/package.json index 2fbbf44e5f..7e7eb125c1 100644 --- a/packages/feedback/message-feedback/package.json +++ b/packages/feedback/message-feedback/package.json @@ -37,10 +37,13 @@ "lib/index.js", "lib/types/**/*.js", "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", - "lib/typert.remote-client.d.ts" + "lib/typert.remote-client.d.ts", + "lib/typert.remote-client.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/fs/fs-local/package.json b/packages/fs/fs-local/package.json index b61ad778c2..c35b192556 100644 --- a/packages/fs/fs-local/package.json +++ b/packages/fs/fs-local/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/fs/fs-observation-policy/package.json b/packages/fs/fs-observation-policy/package.json index 45b7115610..4fafe004a6 100644 --- a/packages/fs/fs-observation-policy/package.json +++ b/packages/fs/fs-observation-policy/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/fs/fs-sandbox/package.json b/packages/fs/fs-sandbox/package.json index 8147cfab14..0489bd3683 100644 --- a/packages/fs/fs-sandbox/package.json +++ b/packages/fs/fs-sandbox/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/fs/fs/package.json b/packages/fs/fs/package.json index 7c64b4d90d..ed24412780 100644 --- a/packages/fs/fs/package.json +++ b/packages/fs/fs/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/fs/tool-fs-search/package.json b/packages/fs/tool-fs-search/package.json index 406fa179dd..5d071328cb 100644 --- a/packages/fs/tool-fs-search/package.json +++ b/packages/fs/tool-fs-search/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/fs/tool-fs/package.json b/packages/fs/tool-fs/package.json index 87afa35ff6..d23fc7f325 100644 --- a/packages/fs/tool-fs/package.json +++ b/packages/fs/tool-fs/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/fs/tool-str-replace-editor/package.json b/packages/fs/tool-str-replace-editor/package.json index 7f5f2ac3cf..935db843f3 100644 --- a/packages/fs/tool-str-replace-editor/package.json +++ b/packages/fs/tool-str-replace-editor/package.json @@ -22,7 +22,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/goal/command-goal/package.json b/packages/goal/command-goal/package.json index 4692291dba..8768f3faea 100644 --- a/packages/goal/command-goal/package.json +++ b/packages/goal/command-goal/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/goal/goal-round-driver/package.json b/packages/goal/goal-round-driver/package.json index 268b6526ae..0c31c44ff5 100644 --- a/packages/goal/goal-round-driver/package.json +++ b/packages/goal/goal-round-driver/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/goal/goal/package.json b/packages/goal/goal/package.json index c2b217de5c..6aaf86841b 100644 --- a/packages/goal/goal/package.json +++ b/packages/goal/goal/package.json @@ -41,10 +41,13 @@ "lib/index.js", "lib/types/**/*.js", "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", - "lib/typert.remote-client.d.ts" + "lib/typert.remote-client.d.ts", + "lib/typert.remote-client.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/goal/tool-goal/package.json b/packages/goal/tool-goal/package.json index 9d38fbf653..5d435f756d 100644 --- a/packages/goal/tool-goal/package.json +++ b/packages/goal/tool-goal/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/guard/repeat-tool-reminder/package.json b/packages/guard/repeat-tool-reminder/package.json index 7d2fc8082b..768dc9fce4 100644 --- a/packages/guard/repeat-tool-reminder/package.json +++ b/packages/guard/repeat-tool-reminder/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/guard/timeout-policy/package.json b/packages/guard/timeout-policy/package.json index c716bdf1e7..0a73a9f35c 100644 --- a/packages/guard/timeout-policy/package.json +++ b/packages/guard/timeout-policy/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/host/directory-picker-auto/package.json b/packages/host/directory-picker-auto/package.json index 06ed8a4def..5cf701d404 100644 --- a/packages/host/directory-picker-auto/package.json +++ b/packages/host/directory-picker-auto/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/host/directory-picker-browse/package.json b/packages/host/directory-picker-browse/package.json index bda4a30ea5..dd7ba06db4 100644 --- a/packages/host/directory-picker-browse/package.json +++ b/packages/host/directory-picker-browse/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/host/directory-picker-native/package.json b/packages/host/directory-picker-native/package.json index a129f21a2e..0eac59940f 100644 --- a/packages/host/directory-picker-native/package.json +++ b/packages/host/directory-picker-native/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/worker.cjs", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/host/directory-picker/package.json b/packages/host/directory-picker/package.json index ddb6145f1f..25336edb88 100644 --- a/packages/host/directory-picker/package.json +++ b/packages/host/directory-picker/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/host/frontend-static/package.json b/packages/host/frontend-static/package.json index d6faa0b18d..340f90aafc 100644 --- a/packages/host/frontend-static/package.json +++ b/packages/host/frontend-static/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/host/open-in-app/package.json b/packages/host/open-in-app/package.json index 25149ca12e..4f5ac03af2 100644 --- a/packages/host/open-in-app/package.json +++ b/packages/host/open-in-app/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "scripts": { "bundle": "tsdown", diff --git a/packages/host/plugin-inventory/package.json b/packages/host/plugin-inventory/package.json index 7a09c38637..6866a73d15 100644 --- a/packages/host/plugin-inventory/package.json +++ b/packages/host/plugin-inventory/package.json @@ -37,10 +37,13 @@ "lib/index.js", "lib/types/**/*.js", "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", - "lib/typert.remote-client.d.ts" + "lib/typert.remote-client.d.ts", + "lib/typert.remote-client.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/host/product-telemetry-otel/package.json b/packages/host/product-telemetry-otel/package.json index b027a678c9..c4df33880d 100644 --- a/packages/host/product-telemetry-otel/package.json +++ b/packages/host/product-telemetry-otel/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/host/webserver/package.json b/packages/host/webserver/package.json index 407d7844e4..937e784b2f 100644 --- a/packages/host/webserver/package.json +++ b/packages/host/webserver/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/identity/anonymous-user-id/package.json b/packages/identity/anonymous-user-id/package.json index 315f77de69..343a2e0129 100644 --- a/packages/identity/anonymous-user-id/package.json +++ b/packages/identity/anonymous-user-id/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/interaction/commands/package.json b/packages/interaction/commands/package.json index cabd389d23..1438b1ba34 100644 --- a/packages/interaction/commands/package.json +++ b/packages/interaction/commands/package.json @@ -41,10 +41,13 @@ "lib/index.js", "lib/types/**/*.js", "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", - "lib/typert.remote-client.d.ts" + "lib/typert.remote-client.d.ts", + "lib/typert.remote-client.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/interaction/permission-presets/package.json b/packages/interaction/permission-presets/package.json index b387c7f877..02574196ce 100644 --- a/packages/interaction/permission-presets/package.json +++ b/packages/interaction/permission-presets/package.json @@ -41,10 +41,13 @@ "lib/index.js", "lib/types/**/*.js", "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", - "lib/typert.remote-client.d.ts" + "lib/typert.remote-client.d.ts", + "lib/typert.remote-client.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/interaction/tool-ask-user/package.json b/packages/interaction/tool-ask-user/package.json index 92b36a324f..be03b9753b 100644 --- a/packages/interaction/tool-ask-user/package.json +++ b/packages/interaction/tool-ask-user/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/interaction/user-approval/package.json b/packages/interaction/user-approval/package.json index 3eec2d2a52..892822c325 100644 --- a/packages/interaction/user-approval/package.json +++ b/packages/interaction/user-approval/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/interaction/user-questions/package.json b/packages/interaction/user-questions/package.json index 6f245a1c18..32a5e187f5 100644 --- a/packages/interaction/user-questions/package.json +++ b/packages/interaction/user-questions/package.json @@ -37,10 +37,13 @@ "lib/index.js", "lib/types/**/*.js", "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", - "lib/typert.remote-client.d.ts" + "lib/typert.remote-client.d.ts", + "lib/typert.remote-client.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/jobs/jobs-local/package.json b/packages/jobs/jobs-local/package.json index 17c6bade1a..2ec47820ee 100644 --- a/packages/jobs/jobs-local/package.json +++ b/packages/jobs/jobs-local/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/jobs/jobs/package.json b/packages/jobs/jobs/package.json index 40e47524e8..583262031c 100644 --- a/packages/jobs/jobs/package.json +++ b/packages/jobs/jobs/package.json @@ -32,7 +32,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/jobs/tool-jobs/package.json b/packages/jobs/tool-jobs/package.json index 7f696f2d42..ddb327ed01 100644 --- a/packages/jobs/tool-jobs/package.json +++ b/packages/jobs/tool-jobs/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/llm/deepseek-llm-api-extensions/package.json b/packages/llm/deepseek-llm-api-extensions/package.json index a90d7f749b..b0cfbfe34b 100644 --- a/packages/llm/deepseek-llm-api-extensions/package.json +++ b/packages/llm/deepseek-llm-api-extensions/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/llm/llm-deepseek-account/package.json b/packages/llm/llm-deepseek-account/package.json index 39938a7ebb..eb845ebf0f 100644 --- a/packages/llm/llm-deepseek-account/package.json +++ b/packages/llm/llm-deepseek-account/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/llm/llm-deepseek-api-key/package.json b/packages/llm/llm-deepseek-api-key/package.json index cf53d0831a..4f38bd175f 100644 --- a/packages/llm/llm-deepseek-api-key/package.json +++ b/packages/llm/llm-deepseek-api-key/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/llm/llm-deepseek/package.json b/packages/llm/llm-deepseek/package.json index 204e755f09..a063196db7 100644 --- a/packages/llm/llm-deepseek/package.json +++ b/packages/llm/llm-deepseek/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/llm/llm-pi-ai/package.json b/packages/llm/llm-pi-ai/package.json index ba4e7dd712..f7bd71cf67 100644 --- a/packages/llm/llm-pi-ai/package.json +++ b/packages/llm/llm-pi-ai/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/llm/llm-retry/package.json b/packages/llm/llm-retry/package.json index faf14468bb..ace74cef77 100644 --- a/packages/llm/llm-retry/package.json +++ b/packages/llm/llm-retry/package.json @@ -27,7 +27,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/llm/llm/package.json b/packages/llm/llm/package.json index e510ddbd25..fd795473b1 100644 --- a/packages/llm/llm/package.json +++ b/packages/llm/llm/package.json @@ -49,10 +49,13 @@ "lib/index.js", "lib/types/**/*.js", "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", - "lib/typert.remote-client.d.ts" + "lib/typert.remote-client.d.ts", + "lib/typert.remote-client.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/llm/plugin-package-inventory-deepseek/package.json b/packages/llm/plugin-package-inventory-deepseek/package.json index 3ab8965d38..7b44e081a0 100644 --- a/packages/llm/plugin-package-inventory-deepseek/package.json +++ b/packages/llm/plugin-package-inventory-deepseek/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/llm/token-meter/package.json b/packages/llm/token-meter/package.json index b7323e5680..b6deb61092 100644 --- a/packages/llm/token-meter/package.json +++ b/packages/llm/token-meter/package.json @@ -32,7 +32,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/lsp/lsp-stdio/package.json b/packages/lsp/lsp-stdio/package.json index c63e5b1765..c7951b7fe7 100644 --- a/packages/lsp/lsp-stdio/package.json +++ b/packages/lsp/lsp-stdio/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/lsp/lsp/package.json b/packages/lsp/lsp/package.json index 274cbd11ec..0e0fc2cd15 100644 --- a/packages/lsp/lsp/package.json +++ b/packages/lsp/lsp/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/lsp/tool-lsp/package.json b/packages/lsp/tool-lsp/package.json index 0f21928f28..fa1ae3eb6e 100644 --- a/packages/lsp/tool-lsp/package.json +++ b/packages/lsp/tool-lsp/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/mcp/mcp-client/package.json b/packages/mcp/mcp-client/package.json index dedce66e52..bede42eef5 100644 --- a/packages/mcp/mcp-client/package.json +++ b/packages/mcp/mcp-client/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/mcp/mcp-resources/package.json b/packages/mcp/mcp-resources/package.json index 2a6b1d1817..007f95b2ed 100644 --- a/packages/mcp/mcp-resources/package.json +++ b/packages/mcp/mcp-resources/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/plan/plan-mode/package.json b/packages/plan/plan-mode/package.json index d6b6bc8f4b..39506db035 100644 --- a/packages/plan/plan-mode/package.json +++ b/packages/plan/plan-mode/package.json @@ -32,7 +32,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/preset/agent-preset-registry/package.json b/packages/preset/agent-preset-registry/package.json index 783644adf6..6d4b08ce46 100644 --- a/packages/preset/agent-preset-registry/package.json +++ b/packages/preset/agent-preset-registry/package.json @@ -41,10 +41,13 @@ "lib/index.js", "lib/types/**/*.js", "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", - "lib/typert.remote-client.d.ts" + "lib/typert.remote-client.d.ts", + "lib/typert.remote-client.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/preset/agent-preset/package.json b/packages/preset/agent-preset/package.json index a54ace97aa..c81c5f53bf 100644 --- a/packages/preset/agent-preset/package.json +++ b/packages/preset/agent-preset/package.json @@ -24,7 +24,9 @@ "files": [ "lib/index.js", "skills", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/preset/persona/package.json b/packages/preset/persona/package.json index 2ac606cbf2..e075a9451c 100644 --- a/packages/preset/persona/package.json +++ b/packages/preset/persona/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/ptc-runtime/ptc-runtime-node/package.json b/packages/ptc-runtime/ptc-runtime-node/package.json index 931eb8cef3..985970c1f0 100644 --- a/packages/ptc-runtime/ptc-runtime-node/package.json +++ b/packages/ptc-runtime/ptc-runtime-node/package.json @@ -27,7 +27,9 @@ "files": [ "lib/index.js", "lib/process.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/ptc-runtime/ptc-runtime/package.json b/packages/ptc-runtime/ptc-runtime/package.json index 7550079c00..1c9b574c5f 100644 --- a/packages/ptc-runtime/ptc-runtime/package.json +++ b/packages/ptc-runtime/ptc-runtime/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/sandbox/sandbox-local/package.json b/packages/sandbox/sandbox-local/package.json index dafad4ebe0..aa62a7f346 100644 --- a/packages/sandbox/sandbox-local/package.json +++ b/packages/sandbox/sandbox-local/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/sandbox/sandbox-policy/package.json b/packages/sandbox/sandbox-policy/package.json index a6432636df..01fd4fadf2 100644 --- a/packages/sandbox/sandbox-policy/package.json +++ b/packages/sandbox/sandbox-policy/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/sandbox/sandbox-windows-acl/package.json b/packages/sandbox/sandbox-windows-acl/package.json index 873054d5b0..50bbf248f2 100644 --- a/packages/sandbox/sandbox-windows-acl/package.json +++ b/packages/sandbox/sandbox-windows-acl/package.json @@ -30,7 +30,9 @@ "lib/runner.js", "lib/types-*.js", "assets", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/sandbox/sandbox/package.json b/packages/sandbox/sandbox/package.json index eb456ae513..7832484f82 100644 --- a/packages/sandbox/sandbox/package.json +++ b/packages/sandbox/sandbox/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/schedule/schedule/package.json b/packages/schedule/schedule/package.json index 7ea453734a..06c581865d 100644 --- a/packages/schedule/schedule/package.json +++ b/packages/schedule/schedule/package.json @@ -39,10 +39,13 @@ "lib/index.js", "lib/types/**/*.js", "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", - "lib/typert.remote-client.d.ts" + "lib/typert.remote-client.d.ts", + "lib/typert.remote-client.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/schedule/tool-schedule/package.json b/packages/schedule/tool-schedule/package.json index 4e932cfd7a..f1aeace930 100644 --- a/packages/schedule/tool-schedule/package.json +++ b/packages/schedule/tool-schedule/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/sdk/client/package.json b/packages/sdk/client/package.json index 0ebd31e34c..36b69dc026 100644 --- a/packages/sdk/client/package.json +++ b/packages/sdk/client/package.json @@ -22,7 +22,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/sdk/protocol/package.json b/packages/sdk/protocol/package.json index 4c147d6e6a..015ae6f137 100644 --- a/packages/sdk/protocol/package.json +++ b/packages/sdk/protocol/package.json @@ -22,7 +22,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/sdk/server/package.json b/packages/sdk/server/package.json index 7d2ed5c36c..d22b5d50ce 100644 --- a/packages/sdk/server/package.json +++ b/packages/sdk/server/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/session-query/session-log-export/package.json b/packages/session-query/session-log-export/package.json index a57a18900e..42d5a57a5b 100644 --- a/packages/session-query/session-log-export/package.json +++ b/packages/session-query/session-log-export/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/client.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "scripts": { "bundle": "tsdown", diff --git a/packages/session-query/session-query-sqlite/package.json b/packages/session-query/session-query-sqlite/package.json index 158957833b..b870decc61 100644 --- a/packages/session-query/session-query-sqlite/package.json +++ b/packages/session-query/session-query-sqlite/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/session-query/session-query/package.json b/packages/session-query/session-query/package.json index 67fdf0490e..451e2629e9 100644 --- a/packages/session-query/session-query/package.json +++ b/packages/session-query/session-query/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/session/session-checkpoint-policy/package.json b/packages/session/session-checkpoint-policy/package.json index 9b6d62374d..5ffdd494eb 100644 --- a/packages/session/session-checkpoint-policy/package.json +++ b/packages/session/session-checkpoint-policy/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/session/session-format-catalog/package.json b/packages/session/session-format-catalog/package.json index 36e8ab8df0..3784a39249 100644 --- a/packages/session/session-format-catalog/package.json +++ b/packages/session/session-format-catalog/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/session/session-format-v0-to-v1/package.json b/packages/session/session-format-v0-to-v1/package.json index e04844f76b..725b79b2eb 100644 --- a/packages/session/session-format-v0-to-v1/package.json +++ b/packages/session/session-format-v0-to-v1/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dsh": { diff --git a/packages/session/session-format-v1-to-v2/package.json b/packages/session/session-format-v1-to-v2/package.json index b65773bf7f..479a05a5d0 100644 --- a/packages/session/session-format-v1-to-v2/package.json +++ b/packages/session/session-format-v1-to-v2/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dsh": { diff --git a/packages/session/session-format-v2-to-v3/package.json b/packages/session/session-format-v2-to-v3/package.json index c9fd5bb969..54ca6aae2d 100644 --- a/packages/session/session-format-v2-to-v3/package.json +++ b/packages/session/session-format-v2-to-v3/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dsh": { diff --git a/packages/session/session-format-v3-to-v4/package.json b/packages/session/session-format-v3-to-v4/package.json index 41704c96df..761da726bf 100644 --- a/packages/session/session-format-v3-to-v4/package.json +++ b/packages/session/session-format-v3-to-v4/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dsh": { diff --git a/packages/session/session-format/package.json b/packages/session/session-format/package.json index bfffee8f17..fb177e97e6 100644 --- a/packages/session/session-format/package.json +++ b/packages/session/session-format/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/session/session-log-deepseek/package.json b/packages/session/session-log-deepseek/package.json index 55d7e89235..6c74e725dd 100644 --- a/packages/session/session-log-deepseek/package.json +++ b/packages/session/session-log-deepseek/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/session/session-persistence-jsonl/package.json b/packages/session/session-persistence-jsonl/package.json index 8104843888..77d58cfa01 100644 --- a/packages/session/session-persistence-jsonl/package.json +++ b/packages/session/session-persistence-jsonl/package.json @@ -24,7 +24,9 @@ "files": [ "lib/index.js", "lib/worker.cjs", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/session/session-persistence/package.json b/packages/session/session-persistence/package.json index 6b9647575c..2900a4a2a3 100644 --- a/packages/session/session-persistence/package.json +++ b/packages/session/session-persistence/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/session/session-projection-cache/package.json b/packages/session/session-projection-cache/package.json index 712a587078..cf24b30d98 100644 --- a/packages/session/session-projection-cache/package.json +++ b/packages/session/session-projection-cache/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/session/session-projection/package.json b/packages/session/session-projection/package.json index 92bc24db4d..d63b56a026 100644 --- a/packages/session/session-projection/package.json +++ b/packages/session/session-projection/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/session/session-stats/package.json b/packages/session/session-stats/package.json index a6b9228458..878d543def 100644 --- a/packages/session/session-stats/package.json +++ b/packages/session/session-stats/package.json @@ -32,7 +32,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/session/session-telemetry-otel/package.json b/packages/session/session-telemetry-otel/package.json index 879c434958..175e801b56 100644 --- a/packages/session/session-telemetry-otel/package.json +++ b/packages/session/session-telemetry-otel/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/session/session-telemetry/package.json b/packages/session/session-telemetry/package.json index 079101c947..573e8f171b 100644 --- a/packages/session/session-telemetry/package.json +++ b/packages/session/session-telemetry/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/session/session-title-first-prompt-llm/package.json b/packages/session/session-title-first-prompt-llm/package.json index 6dd329f3cb..3395384ef6 100644 --- a/packages/session/session-title-first-prompt-llm/package.json +++ b/packages/session/session-title-first-prompt-llm/package.json @@ -20,7 +20,7 @@ }, "./package.json": "./package.json" }, - "files": ["lib/index.js", "lib/types/**/*.d.ts"], + "files": ["lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", "src"], "license": "MIT", "peerDependencies": { "@deepseek-ai/dsh-llm": "workspace:*", diff --git a/packages/session/session-title-llm/package.json b/packages/session/session-title-llm/package.json index e9c50790c4..95da594832 100644 --- a/packages/session/session-title-llm/package.json +++ b/packages/session/session-title-llm/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/session/session-title/package.json b/packages/session/session-title/package.json index 245844c59e..b545573984 100644 --- a/packages/session/session-title/package.json +++ b/packages/session/session-title/package.json @@ -32,7 +32,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/session/session-turn-outline/package.json b/packages/session/session-turn-outline/package.json index 6afd2081ae..ac528a90a1 100644 --- a/packages/session/session-turn-outline/package.json +++ b/packages/session/session-turn-outline/package.json @@ -32,7 +32,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/session/tool-working-directory/package.json b/packages/session/tool-working-directory/package.json index dc30eec34c..db4594b767 100644 --- a/packages/session/tool-working-directory/package.json +++ b/packages/session/tool-working-directory/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/session/working-directory/package.json b/packages/session/working-directory/package.json index 3a0f00f37d..61a4159008 100644 --- a/packages/session/working-directory/package.json +++ b/packages/session/working-directory/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/settings/settings/package.json b/packages/settings/settings/package.json index 5b9e7f78de..a02ee57b62 100644 --- a/packages/settings/settings/package.json +++ b/packages/settings/settings/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/shell/bash-local/package.json b/packages/shell/bash-local/package.json index 18682d30ef..a287353745 100644 --- a/packages/shell/bash-local/package.json +++ b/packages/shell/bash-local/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/shell/bash-sandbox/package.json b/packages/shell/bash-sandbox/package.json index 85f41305e3..c49873ba25 100644 --- a/packages/shell/bash-sandbox/package.json +++ b/packages/shell/bash-sandbox/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/shell/pwsh-local/package.json b/packages/shell/pwsh-local/package.json index 57c81122f6..1c99653f6c 100644 --- a/packages/shell/pwsh-local/package.json +++ b/packages/shell/pwsh-local/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/shell/pwsh-sandbox/package.json b/packages/shell/pwsh-sandbox/package.json index 82bdf0c17d..7e90ad4256 100644 --- a/packages/shell/pwsh-sandbox/package.json +++ b/packages/shell/pwsh-sandbox/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/shell/shell-env/package.json b/packages/shell/shell-env/package.json index 2cfa07bf5c..24275782ac 100644 --- a/packages/shell/shell-env/package.json +++ b/packages/shell/shell-env/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/shell/shell/package.json b/packages/shell/shell/package.json index 176aaae77e..64869626ec 100644 --- a/packages/shell/shell/package.json +++ b/packages/shell/shell/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/shell/tool-bash-persistent/package.json b/packages/shell/tool-bash-persistent/package.json index 9fc096e693..eadf65eead 100644 --- a/packages/shell/tool-bash-persistent/package.json +++ b/packages/shell/tool-bash-persistent/package.json @@ -22,7 +22,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/shell/tool-bash/package.json b/packages/shell/tool-bash/package.json index 5f51b174c3..1e7adb6cb2 100644 --- a/packages/shell/tool-bash/package.json +++ b/packages/shell/tool-bash/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/shell/tool-pwsh-persistent/package.json b/packages/shell/tool-pwsh-persistent/package.json index 0564de02c6..479bb85878 100644 --- a/packages/shell/tool-pwsh-persistent/package.json +++ b/packages/shell/tool-pwsh-persistent/package.json @@ -22,7 +22,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/shell/tool-pwsh/package.json b/packages/shell/tool-pwsh/package.json index 3128beaada..265abe2943 100644 --- a/packages/shell/tool-pwsh/package.json +++ b/packages/shell/tool-pwsh/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/skill/skill-filesystem/package.json b/packages/skill/skill-filesystem/package.json index 310428186a..893ca65fab 100644 --- a/packages/skill/skill-filesystem/package.json +++ b/packages/skill/skill-filesystem/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/skill/skill-office/package.json b/packages/skill/skill-office/package.json index 52e30831d8..2efa309580 100644 --- a/packages/skill/skill-office/package.json +++ b/packages/skill/skill-office/package.json @@ -23,7 +23,9 @@ "files": [ "lib/index.js", "assets", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/skill/skill/package.json b/packages/skill/skill/package.json index f8cd3704e4..59c23bb9bf 100644 --- a/packages/skill/skill/package.json +++ b/packages/skill/skill/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/skill/tool-skill/package.json b/packages/skill/tool-skill/package.json index 202e6eb998..1e12f6503f 100644 --- a/packages/skill/tool-skill/package.json +++ b/packages/skill/tool-skill/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/skill/tool-workspace-dependencies/package.json b/packages/skill/tool-workspace-dependencies/package.json index c304f1e001..db102420a0 100644 --- a/packages/skill/tool-workspace-dependencies/package.json +++ b/packages/skill/tool-workspace-dependencies/package.json @@ -22,7 +22,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/spill/spill-local/package.json b/packages/spill/spill-local/package.json index fc1537ba5c..0f05232f58 100644 --- a/packages/spill/spill-local/package.json +++ b/packages/spill/spill-local/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/spill/spill-policy/package.json b/packages/spill/spill-policy/package.json index bb903da012..37d6a0a693 100644 --- a/packages/spill/spill-policy/package.json +++ b/packages/spill/spill-policy/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/spill/spill/package.json b/packages/spill/spill/package.json index c8923dae7d..c1345ab1b1 100644 --- a/packages/spill/spill/package.json +++ b/packages/spill/spill/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/ssh/fs-ssh/package.json b/packages/ssh/fs-ssh/package.json index 85ced49f07..9688e2e05d 100644 --- a/packages/ssh/fs-ssh/package.json +++ b/packages/ssh/fs-ssh/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/ssh/sandbox-ssh/package.json b/packages/ssh/sandbox-ssh/package.json index ffd4826b2b..59491f170e 100644 --- a/packages/ssh/sandbox-ssh/package.json +++ b/packages/ssh/sandbox-ssh/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/ssh/ssh/package.json b/packages/ssh/ssh/package.json index a171ae8d8f..9dc1213d83 100644 --- a/packages/ssh/ssh/package.json +++ b/packages/ssh/ssh/package.json @@ -41,7 +41,9 @@ "lib/protocol-*.js", "lib/schemas-*.js", "lib/stream-security-*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/ssh/subprocess-ssh/package.json b/packages/ssh/subprocess-ssh/package.json index c30f8755fb..849e0fc9bc 100644 --- a/packages/ssh/subprocess-ssh/package.json +++ b/packages/ssh/subprocess-ssh/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/storage/storage-domain/package.json b/packages/storage/storage-domain/package.json index 1d585399c1..7b6af4bb26 100644 --- a/packages/storage/storage-domain/package.json +++ b/packages/storage/storage-domain/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/storage/storage-json/package.json b/packages/storage/storage-json/package.json index a1cff23fbe..e0f05739e8 100644 --- a/packages/storage/storage-json/package.json +++ b/packages/storage/storage-json/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/storage/storage-sqlite/package.json b/packages/storage/storage-sqlite/package.json index 198b865be1..4253798329 100644 --- a/packages/storage/storage-sqlite/package.json +++ b/packages/storage/storage-sqlite/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/storage/storage/package.json b/packages/storage/storage/package.json index e7f05faf0d..be52b80df7 100644 --- a/packages/storage/storage/package.json +++ b/packages/storage/storage/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/subagent/subagent-acp/package.json b/packages/subagent/subagent-acp/package.json index e6814533a2..cd86d7395c 100644 --- a/packages/subagent/subagent-acp/package.json +++ b/packages/subagent/subagent-acp/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/subagent/subagent-claude-code/package.json b/packages/subagent/subagent-claude-code/package.json index 4103fd3054..152d97544d 100644 --- a/packages/subagent/subagent-claude-code/package.json +++ b/packages/subagent/subagent-claude-code/package.json @@ -28,7 +28,9 @@ "locale/*.json", "lib/index.js", "cordis.patch.yml", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dsh": { diff --git a/packages/subagent/subagent-codex/package.json b/packages/subagent/subagent-codex/package.json index 1d3daa2d58..37bfeed7c1 100644 --- a/packages/subagent/subagent-codex/package.json +++ b/packages/subagent/subagent-codex/package.json @@ -28,7 +28,9 @@ "locale/*.json", "lib/index.js", "cordis.patch.yml", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dsh": { diff --git a/packages/subagent/subagent-dsh-sdk/package.json b/packages/subagent/subagent-dsh-sdk/package.json index 432bc66908..1eab960b7b 100644 --- a/packages/subagent/subagent-dsh-sdk/package.json +++ b/packages/subagent/subagent-dsh-sdk/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/subagent/subagent-fork-in-process/package.json b/packages/subagent/subagent-fork-in-process/package.json index 9213bcaf4e..280fd497b4 100644 --- a/packages/subagent/subagent-fork-in-process/package.json +++ b/packages/subagent/subagent-fork-in-process/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/subagent/subagent-spawn-in-process/package.json b/packages/subagent/subagent-spawn-in-process/package.json index d05dfe5fea..c29cd5d271 100644 --- a/packages/subagent/subagent-spawn-in-process/package.json +++ b/packages/subagent/subagent-spawn-in-process/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/subagent/subagent/package.json b/packages/subagent/subagent/package.json index f96d04b84b..70737dbc74 100644 --- a/packages/subagent/subagent/package.json +++ b/packages/subagent/subagent/package.json @@ -41,10 +41,13 @@ "lib/index.js", "lib/types/**/*.js", "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", - "lib/typert.remote-client.d.ts" + "lib/typert.remote-client.d.ts", + "lib/typert.remote-client.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/subagent/tool-subagent-control/package.json b/packages/subagent/tool-subagent-control/package.json index 736d54e0a9..6714e66c9e 100644 --- a/packages/subagent/tool-subagent-control/package.json +++ b/packages/subagent/tool-subagent-control/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/subagent/tool-subagent/package.json b/packages/subagent/tool-subagent/package.json index f6c8100036..20bdf140e1 100644 --- a/packages/subagent/tool-subagent/package.json +++ b/packages/subagent/tool-subagent/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/model-selection-settings.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/subprocess/subprocess-local/package.json b/packages/subprocess/subprocess-local/package.json index 75a4bb5c82..979336b1fc 100644 --- a/packages/subprocess/subprocess-local/package.json +++ b/packages/subprocess/subprocess-local/package.json @@ -35,7 +35,9 @@ "lib/runner-*.js", "lib/output.js", "scripts/ensure-spawn-helper.mjs", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "scripts": { "postinstall": "node scripts/ensure-spawn-helper.mjs" diff --git a/packages/subprocess/subprocess/package.json b/packages/subprocess/subprocess/package.json index 80d36d5586..da0acd0a67 100644 --- a/packages/subprocess/subprocess/package.json +++ b/packages/subprocess/subprocess/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/control.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/subprocess/win32-process/package.json b/packages/subprocess/win32-process/package.json index 2caabeb749..7346518259 100644 --- a/packages/subprocess/win32-process/package.json +++ b/packages/subprocess/win32-process/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/telemetry/otel/package.json b/packages/telemetry/otel/package.json index e5fd5a6ad6..0ba889e06c 100644 --- a/packages/telemetry/otel/package.json +++ b/packages/telemetry/otel/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/terminal/terminal-bash/package.json b/packages/terminal/terminal-bash/package.json index 8bef012d2d..587bb0e1f6 100644 --- a/packages/terminal/terminal-bash/package.json +++ b/packages/terminal/terminal-bash/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/terminal/terminal/package.json b/packages/terminal/terminal/package.json index 1540d795c1..c79bcc206b 100644 --- a/packages/terminal/terminal/package.json +++ b/packages/terminal/terminal/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/test-support/agent-loop-testkit/package.json b/packages/test-support/agent-loop-testkit/package.json index 557acfef7f..969308cb43 100644 --- a/packages/test-support/agent-loop-testkit/package.json +++ b/packages/test-support/agent-loop-testkit/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/test-support/client-runtime/package.json b/packages/test-support/client-runtime/package.json index 1b9912ddac..1fa8f15ec7 100644 --- a/packages/test-support/client-runtime/package.json +++ b/packages/test-support/client-runtime/package.json @@ -91,6 +91,8 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/test-support/llm-mock-server/package.json b/packages/test-support/llm-mock-server/package.json index 98c7c17c55..e244027fe4 100644 --- a/packages/test-support/llm-mock-server/package.json +++ b/packages/test-support/llm-mock-server/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/test-support/llm-replay/package.json b/packages/test-support/llm-replay/package.json index f7a38026f8..2ae6de0843 100644 --- a/packages/test-support/llm-replay/package.json +++ b/packages/test-support/llm-replay/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/test-support/loader-smoke/package.json b/packages/test-support/loader-smoke/package.json index 0470324adf..8d4561589d 100644 --- a/packages/test-support/loader-smoke/package.json +++ b/packages/test-support/loader-smoke/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/test-support/remote-mock/package.json b/packages/test-support/remote-mock/package.json index 38dd89e3d7..2238cf21b8 100644 --- a/packages/test-support/remote-mock/package.json +++ b/packages/test-support/remote-mock/package.json @@ -38,6 +38,8 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ] } diff --git a/packages/test-support/session-snapshot/package.json b/packages/test-support/session-snapshot/package.json index 51a0b989a2..13cd49e722 100644 --- a/packages/test-support/session-snapshot/package.json +++ b/packages/test-support/session-snapshot/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/todo/tool-todo/package.json b/packages/todo/tool-todo/package.json index a140cd0a49..13f5eb4cdf 100644 --- a/packages/todo/tool-todo/package.json +++ b/packages/todo/tool-todo/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/typert/generator/package.json b/packages/typert/generator/package.json index 95810252a7..8d26526401 100644 --- a/packages/typert/generator/package.json +++ b/packages/typert/generator/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/typert/loader/package.json b/packages/typert/loader/package.json index d66d99a679..48f2885ab7 100644 --- a/packages/typert/loader/package.json +++ b/packages/typert/loader/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/typert/protocol/package.json b/packages/typert/protocol/package.json index 7bc01940aa..44af00c2de 100644 --- a/packages/typert/protocol/package.json +++ b/packages/typert/protocol/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/typert/registry/package.json b/packages/typert/registry/package.json index 2e37402492..ebed2e7c1b 100644 --- a/packages/typert/registry/package.json +++ b/packages/typert/registry/package.json @@ -44,7 +44,9 @@ "lib/index.js", "lib/client.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "dependencies": { diff --git a/packages/util/atomic-write/package.json b/packages/util/atomic-write/package.json index 2455bc3780..149a1f288a 100644 --- a/packages/util/atomic-write/package.json +++ b/packages/util/atomic-write/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/util/brand/package.json b/packages/util/brand/package.json index 1e58f76b74..55896e2d6a 100644 --- a/packages/util/brand/package.json +++ b/packages/util/brand/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/util/chunked-list/package.json b/packages/util/chunked-list/package.json index 955057de01..b0e77b3eb5 100644 --- a/packages/util/chunked-list/package.json +++ b/packages/util/chunked-list/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/util/code-language/package.json b/packages/util/code-language/package.json index ddf14d11fa..a404c741a0 100644 --- a/packages/util/code-language/package.json +++ b/packages/util/code-language/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/util/crypto/package.json b/packages/util/crypto/package.json index 2caeb9b5fc..f1b53840fd 100644 --- a/packages/util/crypto/package.json +++ b/packages/util/crypto/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/util/deque/package.json b/packages/util/deque/package.json index 634a2f9025..ad1d18c407 100644 --- a/packages/util/deque/package.json +++ b/packages/util/deque/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/util/home-paths/package.json b/packages/util/home-paths/package.json index 93068e5a61..57f5e19354 100644 --- a/packages/util/home-paths/package.json +++ b/packages/util/home-paths/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/util/http-proxy/package.json b/packages/util/http-proxy/package.json index d3b2b59257..d694d3e2a9 100644 --- a/packages/util/http-proxy/package.json +++ b/packages/util/http-proxy/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/util/launch-environment/package.json b/packages/util/launch-environment/package.json index c7dc136326..fa2b81dc94 100644 --- a/packages/util/launch-environment/package.json +++ b/packages/util/launch-environment/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/util/lazy-require/package.json b/packages/util/lazy-require/package.json index 5cff0efb9e..2bdc884e7a 100644 --- a/packages/util/lazy-require/package.json +++ b/packages/util/lazy-require/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/util/native-command/package.json b/packages/util/native-command/package.json index 09ef7d1ae9..f40fc60f22 100644 --- a/packages/util/native-command/package.json +++ b/packages/util/native-command/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/util/output-retention/package.json b/packages/util/output-retention/package.json index 9f0ab57695..9697bd6c40 100644 --- a/packages/util/output-retention/package.json +++ b/packages/util/output-retention/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/util/package-manifest/package.json b/packages/util/package-manifest/package.json index c85511b79c..8d6f82551b 100644 --- a/packages/util/package-manifest/package.json +++ b/packages/util/package-manifest/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/util/time/package.json b/packages/util/time/package.json index bc27b6d943..597a7ac897 100644 --- a/packages/util/time/package.json +++ b/packages/util/time/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/util/timeout/package.json b/packages/util/timeout/package.json index a1f6e1c835..1ee6a942fc 100644 --- a/packages/util/timeout/package.json +++ b/packages/util/timeout/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/util/values/package.json b/packages/util/values/package.json index 65a13b177f..0a6f016a1c 100644 --- a/packages/util/values/package.json +++ b/packages/util/values/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/util/workspace-path/package.json b/packages/util/workspace-path/package.json index 008798f662..6179ad6c3a 100644 --- a/packages/util/workspace-path/package.json +++ b/packages/util/workspace-path/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/web/tool-web/package.json b/packages/web/tool-web/package.json index 4065557b42..8f39806314 100644 --- a/packages/web/tool-web/package.json +++ b/packages/web/tool-web/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/web/web-fetch-http/package.json b/packages/web/web-fetch-http/package.json index 066df024e9..963d32b754 100644 --- a/packages/web/web-fetch-http/package.json +++ b/packages/web/web-fetch-http/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/web/web-search-deepseek/package.json b/packages/web/web-search-deepseek/package.json index 1be9919401..cd2a8c892c 100644 --- a/packages/web/web-search-deepseek/package.json +++ b/packages/web/web-search-deepseek/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/web/web-search-exa/package.json b/packages/web/web-search-exa/package.json index 7db65adb01..2c1db818b7 100644 --- a/packages/web/web-search-exa/package.json +++ b/packages/web/web-search-exa/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/web/web-search-perplexity/package.json b/packages/web/web-search-perplexity/package.json index 8e4b78b771..28ac81ee68 100644 --- a/packages/web/web-search-perplexity/package.json +++ b/packages/web/web-search-perplexity/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/web/web/package.json b/packages/web/web/package.json index 10fbd3a665..6fb833bdd4 100644 --- a/packages/web/web/package.json +++ b/packages/web/web/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/workflow/tool-workflow/package.json b/packages/workflow/tool-workflow/package.json index 09d223f289..c712a18a52 100644 --- a/packages/workflow/tool-workflow/package.json +++ b/packages/workflow/tool-workflow/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/workflow/workflow-ptc/package.json b/packages/workflow/workflow-ptc/package.json index 6e970275c6..6b70347f39 100644 --- a/packages/workflow/workflow-ptc/package.json +++ b/packages/workflow/workflow-ptc/package.json @@ -23,7 +23,9 @@ }, "files": [ "lib/index.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/workflow/workflow/package.json b/packages/workflow/workflow/package.json index db9af7f3e0..86595ac9bd 100644 --- a/packages/workflow/workflow/package.json +++ b/packages/workflow/workflow/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/packages/workspace/workspace/package.json b/packages/workspace/workspace/package.json index e8ed63de35..af0428a440 100644 --- a/packages/workspace/workspace/package.json +++ b/packages/workspace/workspace/package.json @@ -28,7 +28,9 @@ "files": [ "lib/index.js", "lib/types/**/*.js", - "lib/types/**/*.d.ts" + "lib/types/**/*.d.ts", + "lib/types/**/*.d.ts.map", + "src" ], "license": "MIT", "peerDependencies": { diff --git a/scripts/check-workspace-constraints.spec.ts b/scripts/check-workspace-constraints.spec.ts index 6ee447873e..defce2656a 100644 --- a/scripts/check-workspace-constraints.spec.ts +++ b/scripts/check-workspace-constraints.spec.ts @@ -293,16 +293,16 @@ describe('package payload constraints', () => { [{ import: './art/icon.svg', default: './art/fallback.svg' }, ['art/icon.svg', 'art/fallback.svg']], [['./art/icon.svg', './art/icon.svg'], ['art/icon.svg']], ] as const)('includes exported icon targets in the canonical payload: %j', (icon, expected) => { - expect(expectedDshPackageFiles({ exports: { './icon': icon } })).toEqual([...expected, 'lib/index.js', 'lib/types/**/*.d.ts']) + expect(expectedDshPackageFiles({ exports: { './icon': icon } })).toEqual([...expected, 'lib/index.js', 'lib/types/**/*.d.ts', 'lib/types/**/*.d.ts.map', 'src']) }) it.each(['icon.svg', './icon.svg'])('includes and deduplicates manifest icon %s', (icon) => { - expect(expectedDshPackageFiles({ icon, exports: { './icon': './icon.svg' } })).toEqual(['icon.svg', 'lib/index.js', 'lib/types/**/*.d.ts']) + expect(expectedDshPackageFiles({ icon, exports: { './icon': './icon.svg' } })).toEqual(['icon.svg', 'lib/index.js', 'lib/types/**/*.d.ts', 'lib/types/**/*.d.ts.map', 'src']) }) it('includes manifest, root, and subpath icon targets', () => { expect(expectedDshPackageFiles({ icon: './legacy.svg', exports: { './icon': './fallback.svg', './search/icon': './search.svg' } })).toEqual([ - 'legacy.svg', 'fallback.svg', 'search.svg', 'lib/index.js', 'lib/types/**/*.d.ts', + 'legacy.svg', 'fallback.svg', 'search.svg', 'lib/index.js', 'lib/types/**/*.d.ts', 'lib/types/**/*.d.ts.map', 'src', ]) }) @@ -323,7 +323,7 @@ describe('package payload constraints', () => { { exports: { './search/locale/*.json': './z/*.json', './locale/*.json': './a/*.json' }, resources: ['a/*.json', 'z/*.json'] }, ])('includes declared locale resources in the canonical payload: $exports', ({ exports, resources }) => { expect(expectedDshPackageFiles({ name: '@deepseek-ai/dsh-localized', exports })).toEqual([ - ...resources, 'lib/index.js', 'lib/types/**/*.d.ts', + ...resources, 'lib/index.js', 'lib/types/**/*.d.ts', 'lib/types/**/*.d.ts.map', 'src', ]) }) @@ -336,7 +336,7 @@ describe('package payload constraints', () => { './locale/zh.json': null, './locale/fr.json': { types: './locale/fr.d.ts' }, }, - })).toEqual(['lib/index.js', 'lib/types/**/*.d.ts']) + })).toEqual(['lib/index.js', 'lib/types/**/*.d.ts', 'lib/types/**/*.d.ts.map', 'src']) }) it.each(['agent-team', 'agent-team-profile', 'auto-review', 'client-ui-agent-team', 'tool-agent-team'])( @@ -367,6 +367,8 @@ describe('package payload constraints', () => { 'lib/index.js', 'cordis.patch.yml', 'lib/types/**/*.d.ts', + 'lib/types/**/*.d.ts.map', + 'src', ]) expect(expectedDshPackageFiles({ name: '@deepseek-ai/dsh-private-profile', @@ -376,6 +378,8 @@ describe('package payload constraints', () => { 'cordis.patch.yml', 'layers/web.patch.yml', 'lib/types/**/*.d.ts', + 'lib/types/**/*.d.ts.map', + 'src', ]) }) @@ -392,7 +396,7 @@ it('publishes CLI runtime declarations and rejects a payload that omits them', ( const manifest = JSON.parse(readFileSync(new URL('../apps/cli/package.json', import.meta.url), 'utf8')) as WorkspaceManifest['manifest'] expect(checkWorkspaceManifest({ dir: 'apps/cli', manifest })).toEqual([]) expect(checkWorkspaceManifest({ dir: 'apps/cli', manifest: { ...manifest, files: ['lib/*.js'] } })) - .toEqual([expect.stringContaining('@deepseek-ai/dsh: package.json files must be ["lib/*.js","lib/types/*.d.ts"]')]) + .toEqual([expect.stringContaining('@deepseek-ai/dsh: package.json files must be ["lib/*.js","lib/types/*.d.ts","lib/types/*.d.ts.map","docs","src"]')]) }) it('requires the shared Web injection entry in the published payload', () => { diff --git a/scripts/check-workspace-constraints.ts b/scripts/check-workspace-constraints.ts index c670b46f2a..6e08c60aaa 100644 --- a/scripts/check-workspace-constraints.ts +++ b/scripts/check-workspace-constraints.ts @@ -49,10 +49,6 @@ const publicNativePackages = new Set([ '@deepseek-ai/node-addon-system-linux-arm64', '@deepseek-ai/node-addon-system-linux-x64', ]) -/** Deliberate source payloads whose exact bytes are part of the package's audit surface. */ -const publicationSourceAllowlist: Readonly> = { - '@deepseek-ai/node-addon-system': ['src/main.c', 'src/flock.c'], -} /** Public source home recorded in maintained package manifests. */ const publishedRepositoryUrl = 'git+https://github.com/deepseek-ai/deepseek-harness.git' /** Packages that participate in the experimental policy. */ @@ -63,14 +59,16 @@ const standardReleaseMemberDirectory = /^(?:packages\/(?!experimental\/)[^/]+\/[ const desktopApplicationDirectory = 'apps/desktop' const localArtifactDirs = new Set(['node_modules']) const appPackageFiles: Readonly> = { - '@deepseek-ai/dsh': ['lib/*.js', 'lib/types/*.d.ts'], + // `docs` carries the repository's Markdown documentation, staged by + // `scripts/stage-dsh-docs.ts` before packing. + '@deepseek-ai/dsh': ['lib/*.js', 'lib/types/*.d.ts', 'lib/types/*.d.ts.map', 'docs', 'src'], '@deepseek-ai/dsh-desktop-host': [ 'lib/index.js', 'lib/cli.js', ], - // Sourcemaps stay out by payload policy; the worker-preview surface - // (dist/preview.html and dist/preview/) backs opt-in experimental + // Bundled JavaScript maps stay out by payload policy; the worker-preview + // surface (dist/preview.html and dist/preview/) backs opt-in experimental // packages and is not published. - '@deepseek-ai/dsh-web-frontend': ['dist', '!dist/**/*.map', '!dist/preview.html', '!dist/preview'], + '@deepseek-ai/dsh-web-frontend': ['dist', '!dist/**/*.map', '!dist/preview.html', '!dist/preview', 'src'], } /** The subset of package.json fields this constraint check cares about. */ @@ -291,6 +289,10 @@ export function expectedDshPackageFiles(manifest: PackageManifest): readonly str // declarations. ...usesEmittedTreeDefaults(manifest) ? ['lib/types/**/*.js'] : [], 'lib/types/**/*.d.ts', + // A published declaration map plus `src` lets a consumer editor open the + // implementation behind an exported declaration, and lets a plugin author + // read it without a repository checkout. + 'lib/types/**/*.d.ts.map', ...hasExportPair(manifest, './typert', './lib/typert.host.d.ts', './lib/typert.host.js') ? ['lib/typert.host.js', 'lib/typert.host.d.ts'] : [], @@ -298,8 +300,11 @@ export function expectedDshPackageFiles(manifest: PackageManifest): readonly str ? ['lib/typert.client.js', 'lib/typert.client.d.ts'] : [], ...hasTypertRemoteNavigation(manifest) - ? ['lib/typert.remote-client.js', 'lib/typert.remote-client.d.ts'] + // The generated Remote declaration carries a `sourceMappingURL` its map + // resolves, and that map resolves the Host method through `src`. + ? ['lib/typert.remote-client.js', 'lib/typert.remote-client.d.ts', 'lib/typert.remote-client.d.ts.map'] : [], + 'src', ] } @@ -461,9 +466,8 @@ export function checkWorkspaceManifest({ dir, manifest }: WorkspaceManifest): st } if (manifest.name?.startsWith('@deepseek-ai/')) { - const allowedSources = publicationSourceAllowlist[manifest.name] ?? [] for (const file of manifest.files ?? []) { - if (isForbiddenPublicationFile(file) && !allowedSources.includes(file)) { + if (isForbiddenPublicationFile(file)) { errors.push(`${label}: package.json files must not publish ${JSON.stringify(file)}`) } } diff --git a/scripts/publication-payload.spec.ts b/scripts/publication-payload.spec.ts index 52c0e7da33..e65ff38dc9 100644 --- a/scripts/publication-payload.spec.ts +++ b/scripts/publication-payload.spec.ts @@ -15,47 +15,43 @@ describe('publication payload policy', () => { it.each([ 'lib/index.js', 'lib/types/index.d.ts', + 'lib/types/index.d.ts.map', + 'lib/typert.remote-client.d.ts.map', 'lib/styles/base.css', - ])('accepts %s', (file) => { - expect(isForbiddenPublicationFile(file)).toBe(false) - }) - - it.each([ 'src', './src', 'src/', 'src/index.ts', './src/index.ts', String.raw`src\index.ts`, - 'lib/types/index.d.ts.map', - './lib/types/index.d.ts.map', - 'lib/typert.remote-client.d.ts.map', + ])('accepts %s', (file) => { + expect(isForbiddenPublicationFile(file)).toBe(false) + }) + + it.each([ 'lib/client.js.map', './lib/client.js.map', + 'lib/types/index.js.map', + String.raw`lib\client.js.map`, ])('rejects static manifest path %s', (file) => { expect(isForbiddenPublicationFile(file)).toBe(true) }) - it('rejects source members in packed tarballs', () => { - expect(validateFixtureTarball([ - 'package/package.json', - 'package/src/index.ts', - ])).toThrow('fixture.tgz publishes source file package/src/index.ts') - }) - - it('rejects source maps in packed tarballs', () => { - expect(validateFixtureTarball([ - 'package/package.json', - 'package/lib/types/index.d.ts.map', - ])).toThrow('fixture.tgz publishes source map package/lib/types/index.d.ts.map') - expect(validateFixtureTarball([ - 'package/package.json', - 'package/lib/typert.remote-client.d.ts.map', - ])).toThrow('fixture.tgz publishes source map package/lib/typert.remote-client.d.ts.map') + it('rejects bundled JavaScript maps in packed tarballs', () => { expect(validateFixtureTarball([ 'package/package.json', 'package/lib/client.js.map', - ])).toThrow('fixture.tgz publishes source map package/lib/client.js.map') + ])).toThrow('fixture.tgz publishes JavaScript map package/lib/client.js.map') + }) + + it('accepts source, declaration maps, and declarations in packed tarballs', () => { + expect(validateFixtureTarball([ + 'package/package.json', + 'package/src/index.ts', + 'package/lib/types/index.d.ts', + 'package/lib/types/index.d.ts.map', + 'package/lib/typert.remote-client.d.ts.map', + ])).not.toThrow() }) it('accepts a clean packed tarball', () => { diff --git a/scripts/publication-payload.ts b/scripts/publication-payload.ts index 4ff8e6f05d..eeb64f6929 100644 --- a/scripts/publication-payload.ts +++ b/scripts/publication-payload.ts @@ -23,33 +23,24 @@ function payloadPath(file: string): string { } /** - * Whether a package payload path exposes source or map intermediates. Maps - * serve editor navigation during development, where a workspace consumer - * resolves their source through the package link; a published map resolves - * nothing, so no payload publishes one. + * Whether a package payload path exposes JavaScript map intermediates. A + * declaration map pairs with the source and the declaration a consumer + * reaches; a JavaScript map describes bundler output that no published entry + * pairs with, so no payload publishes one. * @param file - manifest path or tarball member to classify. * @returns whether publishing this path is forbidden. */ export function isForbiddenPublicationFile(file: string): boolean { - const normalized = payloadPath(file) - return normalized === 'src' - || normalized.startsWith('src/') - || normalized.endsWith('.d.ts.map') - || normalized.endsWith('.js.map') + return payloadPath(file).endsWith('.js.map') } /** - * Reject source and map members in a packed npm tarball. + * Reject bundled JavaScript map members in a packed npm tarball. * @param files - tarball members to validate. * @param context - tarball identity named in the failure. */ export function validateTarballPayload(files: readonly string[], context: string): void { for (const file of files) { - if (!isForbiddenPublicationFile(file)) continue - const normalized = payloadPath(file) - if (normalized === 'src' || normalized.startsWith('src/')) { - throw new Error(`${context} publishes source file ${file}`) - } - throw new Error(`${context} publishes source map ${file}`) + if (isForbiddenPublicationFile(file)) throw new Error(`${context} publishes JavaScript map ${file}`) } } diff --git a/scripts/release/families.spec.ts b/scripts/release/families.spec.ts index af6bcde4cf..7cfb5935d7 100644 --- a/scripts/release/families.spec.ts +++ b/scripts/release/families.spec.ts @@ -387,12 +387,25 @@ describe('release families', () => { const harness = member('packages/a/library', '@deepseek-ai/dsh-library') const vendored = member('vendor/cordis', '@deepseek-ai/cordis') - expect(() => { dsh.validatePayload(harness, ['package/lib/index.js', 'package/src/index.ts']) }) - .toThrow(/publishes source file/) + expect(() => { dsh.validatePayload(harness, ['package/lib/index.js', 'package/lib/client.js.map']) }) + .toThrow(/publishes JavaScript map/) + expect(() => { dsh.validatePayload(harness, ['package/lib/index.js', 'package/src/index.ts']) }).not.toThrow() expect(() => { vendor.validatePayload(vendored, ['package/lib/index.js', 'package/src/index.ts']) }).not.toThrow() expect(() => { vendor.validatePayload(vendored, []) }).toThrow(/empty tarball/) }) + it('requires the installed package payload the staging hook supplies', () => { + const dsh = releaseFamily('dsh') + const installed = member('apps/cli', '@deepseek-ai/dsh') + + expect(() => { dsh.validatePayload(installed, ['package/lib/index.js', 'package/src/bin.ts']) }) + .toThrow(/@deepseek-ai\/dsh packed no documentation/) + expect(() => { dsh.validatePayload(installed, ['package/lib/index.js', 'package/docs/guide.md']) }) + .toThrow(/@deepseek-ai\/dsh packed no source/) + expect(() => { dsh.validatePayload(installed, ['package/lib/index.js', 'package/docs/guide.md', 'package/src/bin.ts']) }) + .not.toThrow() + }) + it('drives the installed entry only for the family that publishes one', () => { expect(releaseFamily('dsh').installedEntry).toEqual({ packageName: '@deepseek-ai/dsh', binPath: 'lib/bin.js' }) expect(releaseFamily('vendor').installedEntry).toBeUndefined() diff --git a/scripts/release/families.ts b/scripts/release/families.ts index 1f821ffd7e..df4a1fd606 100644 --- a/scripts/release/families.ts +++ b/scripts/release/families.ts @@ -387,12 +387,22 @@ class DshFamily extends ReleaseFamily { } /** - * Reject source and declaration-map members, the repository's publication policy. + * Reject bundled JavaScript maps, and require the installed package to carry + * the documentation and source its manifest promises. `docs` exists only + * because `prepack` stages it, so a pack run that skips lifecycle scripts + * would otherwise publish the package without it. * @param member - the packed member. * @param files - every path inside its tarball. */ validatePayload(member: ReleaseMember, files: readonly string[]): void { validateTarballPayload(files, member.name) + if (member.name !== this.installedEntry.packageName) return + if (!files.some(file => file.startsWith('package/docs/') && file.endsWith('.md'))) { + throw new Error(`${member.name} packed no documentation`) + } + if (!files.some(file => file.startsWith('package/src/') && file.endsWith('.ts'))) { + throw new Error(`${member.name} packed no source`) + } } /** Publish every advertised on-demand package before the installation that offers it. */ @@ -449,11 +459,10 @@ class VendorFamily extends ReleaseFamily { * Require the payload the vendored manifest declares, including upstream's * `src` tree and declaration maps. * - * The harness policy that rejects both does not apply here: these manifests - * export `./src/*` for source navigation, so dropping `src` would publish a - * package whose export map points at absent files. What must hold instead is - * that every path the manifest selects is present, which `files` already - * decides and `pnpm pack` already enforces. + * Upstream's manifest owns that payload, so this family enforces no shape of + * its own beyond a nonempty tarball. What must hold is that every path the + * manifest selects is present, which `files` already decides and `pnpm pack` + * already enforces. * @param member - the packed member. * @param files - every path inside its tarball. */ diff --git a/scripts/release/pack.spec.ts b/scripts/release/pack.spec.ts index b7a102122f..444ce5ddf8 100644 --- a/scripts/release/pack.spec.ts +++ b/scripts/release/pack.spec.ts @@ -307,15 +307,15 @@ describe('release pack CLI', () => { it('validates every parallel tarball before recording the publish order', async () => { const root = fixture() packageFixture(root, 'packages/util/alpha', '@deepseek-ai/alpha') - packageFixture(root, 'packages/util/zebra', '@deepseek-ai/zebra', { files: ['lib/index.js', 'src/index.ts'] }) - write(join(root, 'packages/util/zebra/src/index.ts'), 'export const source = 1\n') + packageFixture(root, 'packages/util/zebra', '@deepseek-ai/zebra', { files: ['lib/index.js', 'lib/client.js.map'] }) + write(join(root, 'packages/util/zebra/lib/client.js.map'), '{"version":3}\n') write(join(root, 'apps/web/dist/index.html'), '
') writeClientBuildRecord(root, officialClientBuildEnvironment(root, { DSH_CLIENT_COMMIT_HASH: commit })) const result = await runPack(root, ['--family', 'dsh', '--concurrency', '8']) expect(result.status).not.toBe(0) - expect(result.stderr).toContain('@deepseek-ai/zebra publishes source file package/src/index.ts') + expect(result.stderr).toContain('@deepseek-ai/zebra publishes JavaScript map package/lib/client.js.map') expect(readdirSync(join(root, 'packed')).filter(name => name.endsWith('.tgz'))).toHaveLength(2) expect(existsSync(join(root, 'packed', PUBLISH_ORDER_FILE))).toBe(false) }) diff --git a/scripts/stage-dsh-docs.spec.ts b/scripts/stage-dsh-docs.spec.ts new file mode 100644 index 0000000000..e2f6d7d3fa --- /dev/null +++ b/scripts/stage-dsh-docs.spec.ts @@ -0,0 +1,58 @@ +import { existsSync, mkdtempSync, mkdirSync, rmSync, writeFileSync } from 'node:fs' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import { afterEach, describe, expect, it } from 'vitest' +import { stageDshDocs } from './stage-dsh-docs.ts' + +const roots: string[] = [] + +function temporaryRoot(): string { + const root = mkdtempSync(join(tmpdir(), 'dsh-stage-docs-')) + roots.push(root) + return root +} + +function write(root: string, path: string, contents = '# fixture\n'): void { + const target = join(root, path) + mkdirSync(join(target, '..'), { recursive: true }) + writeFileSync(target, contents) +} + +afterEach(() => { + for (const root of roots.splice(0)) rmSync(root, { recursive: true, force: true }) +}) + +describe('documentation staging', () => { + it('copies reader-facing documents and assets without the tooling-owned records', async () => { + const source = join(temporaryRoot(), 'docs') + const destination = join(temporaryRoot(), 'cli', 'docs') + write(source, 'guide/index.md') + write(source, 'guide/index.zh.md') + write(source, 'guide/index.i18n.yaml') + write(source, 'images/diagram.png', 'png') + write(source, 'persistence-changes/v1/changes.md') + write(source, 'persistence-changes/README.md') + write(source, 'AGENTS.md') + + await stageDshDocs(source, destination) + + expect(existsSync(join(destination, 'guide', 'index.md'))).toBe(true) + expect(existsSync(join(destination, 'guide', 'index.zh.md'))).toBe(true) + expect(existsSync(join(destination, 'images', 'diagram.png'))).toBe(true) + expect(existsSync(join(destination, 'AGENTS.md'))).toBe(true) + expect(existsSync(join(destination, 'guide', 'index.i18n.yaml'))).toBe(false) + expect(existsSync(join(destination, 'persistence-changes'))).toBe(false) + }) + + it('replaces a previous copy instead of merging into it', async () => { + const source = join(temporaryRoot(), 'docs') + const destination = join(temporaryRoot(), 'cli', 'docs') + write(source, 'kept.md') + write(destination, 'removed.md') + + await stageDshDocs(source, destination) + + expect(existsSync(join(destination, 'kept.md'))).toBe(true) + expect(existsSync(join(destination, 'removed.md'))).toBe(false) + }) +}) diff --git a/scripts/stage-dsh-docs.ts b/scripts/stage-dsh-docs.ts new file mode 100644 index 0000000000..ebaec604c7 --- /dev/null +++ b/scripts/stage-dsh-docs.ts @@ -0,0 +1,49 @@ +/** Stage the reader-facing documentation inside the published `dsh` package. */ + +import { cp, rm } from 'node:fs/promises' +import { join, relative, sep } from 'node:path' +import { fileURLToPath } from 'node:url' + +/** Repository root, resolved from this script rather than the invoking directory. */ +const REPOSITORY_ROOT = fileURLToPath(new URL('..', import.meta.url)) + +/** Generated per-release migration records; an installed package carries the current contract instead. */ +const EXCLUDED_DIRECTORY = 'persistence-changes' + +/** Translation alignment records the documentation gates own; a reader never opens one. */ +const EXCLUDED_SUFFIX = '.i18n.yaml' + +/** + * Replace a package's `docs` directory with the documentation a reader needs. + * + * Runs from the `prepack` lifecycle of `@deepseek-ai/dsh`, so packing the + * package and packing the release set both publish the same Markdown. + * @param source - Documentation root to copy; defaults to the repository `docs`. + * @param destination - Package directory to replace; defaults to `apps/cli/docs`. + * @returns Resolves after the destination holds the filtered copy. + */ +export async function stageDshDocs( + source: string = join(REPOSITORY_ROOT, 'docs'), + destination: string = join(REPOSITORY_ROOT, 'apps', 'cli', 'docs'), +): Promise { + await rm(destination, { recursive: true, force: true }) + await cp(source, destination, { + recursive: true, + filter: entry => !isExcluded(source, entry), + }) +} + +/** + * Whether one source path is tooling-owned or generated rather than reader-facing. + * @param source - Documentation root the entry belongs to. + * @param entry - Absolute source path offered to the copy filter. + * @returns whether the copy skips this entry. + */ +function isExcluded(source: string, entry: string): boolean { + const path = relative(source, entry).split(sep).join('/') + return path === EXCLUDED_DIRECTORY + || path.startsWith(`${EXCLUDED_DIRECTORY}/`) + || path.endsWith(EXCLUDED_SUFFIX) +} + +if (import.meta.main) await stageDshDocs() diff --git a/scripts/translation-pairing.ts b/scripts/translation-pairing.ts index 04ea0e72a6..466b39d490 100644 --- a/scripts/translation-pairing.ts +++ b/scripts/translation-pairing.ts @@ -142,6 +142,7 @@ export const TRANSLATION_SCOPE_GLOB_EXCLUDES = [ '**/__pycache__/**', '**/.pytest_cache/**', 'apps/web/dist/**', + 'apps/cli/docs/**', '.artifacts/**', 'python/sdk-runtime/src/deepseek_harness_runtime/runtime/**', 'vendor/**', @@ -154,6 +155,7 @@ function isTranslationSourceExcluded(file: string): boolean { || segment.startsWith('.doc-typecheck-') || segment.startsWith('.node-next-types-')) || file.startsWith('apps/web/dist/') + || file.startsWith('apps/cli/docs/') || file.startsWith('python/sdk-runtime/src/deepseek_harness_runtime/runtime/') } From a9fc7f9945dc004bb72a2fa8dac60c00431420b6 Mon Sep 17 00:00:00 2001 From: turtle1999 Date: Thu, 8 Oct 2026 17:04:23 +0800 Subject: [PATCH 002/322] feat(release): publish JavaScript maps and compress bundles Every emitted JavaScript map ships beside the bundle it describes, and the workspace build and the client preset compress bundles without mangling identifiers. The documentation payload now mirrors the website publication manifest and is removed again by `postpack`; Desktop and the Python executable exclude the published source, documentation, and maps; `clean` removes a staged copy. Typert's publication contract gains the Remote declaration map. --- ...2026-08-10-npm-release-sequences.i18n.yaml | 4 +- .../2026-08-10-npm-release-sequences.md | 2 +- .../2026-08-10-npm-release-sequences.zh.md | 2 +- ...-10-08-published-source-and-docs.i18n.yaml | 30 +++--- .../2026-10-08-published-source-and-docs.md | 28 +++--- ...2026-10-08-published-source-and-docs.zh.md | 28 +++--- apps/cli/README.i18n.yaml | 3 + apps/cli/README.md | 6 ++ apps/cli/README.zh.md | 6 ++ apps/cli/package.json | 4 +- apps/desktop/scripts/runtime-file-policy.ts | 6 ++ .../desktop/tests/runtime-file-policy.spec.ts | 5 + apps/web/package.json | 1 - docs/cookbook/adding-a-package.i18n.yaml | 4 +- docs/cookbook/adding-a-package.md | 2 +- docs/cookbook/adding-a-package.zh.md | 2 +- packages/acp/acp/package.json | 1 + packages/api/account-controller/package.json | 1 + packages/api/gateway/package.json | 1 + packages/api/job-controller/package.json | 1 + packages/api/remotes/package.json | 1 + packages/api/session-controller/package.json | 1 + packages/api/settings-controller/package.json | 1 + packages/api/terminal-controller/package.json | 1 + .../api/workspace-controller/package.json | 1 + packages/api/workspace-files/package.json | 1 + .../attachment/attachment-local/package.json | 2 +- packages/attachment/attachment/package.json | 2 +- packages/boot/app-boot/package.json | 1 + packages/boot/cmdline/package.json | 1 + packages/boot/config-editor/package.json | 1 + packages/boot/hmr/package.json | 1 + packages/boot/plugin-manager/package.json | 1 + packages/browser-use/browser-use/package.json | 1 + packages/bundle/acp-app/package.json | 1 + packages/bundle/base/package.json | 1 + packages/bundle/headless/package.json | 1 + packages/bundle/sdk-app/package.json | 1 + packages/bundle/sdk-minimal/package.json | 1 + packages/bundle/web-app/package.json | 1 + packages/client/connection/package.json | 1 + packages/client/file-upload/package.json | 1 + packages/client/hmr/package.json | 1 + packages/client/locale/package.json | 1 + packages/client/modules/package.json | 1 + .../client/product-analytics/package.json | 1 + packages/client/resources/package.json | 1 + packages/client/shortcuts/package.json | 1 + packages/client/store/package.json | 1 + packages/client/tsdown.client.ts | 3 + packages/client/ui-agent-preset/package.json | 1 + packages/client/ui-approval/package.json | 1 + packages/client/ui-attachment/package.json | 1 + .../client/ui-brand-official/package.json | 1 + packages/client/ui-chat/package.json | 1 + packages/client/ui-commands/package.json | 1 + packages/client/ui-conversation/package.json | 1 + packages/client/ui-deliverables/package.json | 1 + .../ui-directory-picker-browse/package.json | 1 + .../ui-directory-picker-native/package.json | 1 + packages/client/ui-dockkit/package.json | 1 + packages/client/ui-goal/package.json | 1 + packages/client/ui-input-trigger/package.json | 1 + packages/client/ui-jobs/package.json | 1 + packages/client/ui-layout/package.json | 1 + .../client/ui-message-feedback/package.json | 1 + .../client/ui-model-selection/package.json | 1 + packages/client/ui-open-in-app/package.json | 1 + .../client/ui-permission-presets/package.json | 1 + packages/client/ui-plan/package.json | 1 + .../client/ui-plugin-manager/package.json | 1 + packages/client/ui-primitives/package.json | 1 + packages/client/ui-reference/package.json | 1 + packages/client/ui-renderer/package.json | 1 + packages/client/ui-schedule/package.json | 1 + packages/client/ui-session/package.json | 1 + .../client/ui-settings-account/package.json | 1 + .../ui-settings-agent-loop/package.json | 1 + .../client/ui-settings-general/package.json | 1 + .../client/ui-settings-models/package.json | 1 + .../ui-settings-plugin-inventory/package.json | 1 + .../client/ui-settings-plugins/package.json | 1 + .../ui-settings-session-log/package.json | 1 + .../client/ui-settings-shell/package.json | 1 + .../client/ui-settings-subagent/package.json | 1 + .../ui-settings-web-search/package.json | 1 + packages/client/ui-settings/package.json | 1 + packages/client/ui-shortcuts/package.json | 1 + .../client/ui-sidebar-browser/package.json | 1 + .../ui-sidebar-documentpreview/package.json | 1 + packages/client/ui-sidebar-files/package.json | 1 + packages/client/ui-sidebar-right/package.json | 1 + .../client/ui-sidebar-terminal/package.json | 1 + packages/client/ui-sidebar/package.json | 1 + packages/client/ui-skill/package.json | 1 + packages/client/ui-slots/package.json | 1 + packages/client/ui-subagent/package.json | 1 + packages/client/ui-theme/package.json | 1 + packages/client/ui-tool/package.json | 1 + packages/client/ui-trajectory/package.json | 1 + .../client/ui-user-questions/package.json | 1 + packages/client/ui-workflow-run/package.json | 1 + packages/client/ui-workspace/package.json | 1 + packages/client/web/package.json | 1 + .../compaction/command-compact/package.json | 1 + .../compaction/compaction-basic/package.json | 1 + .../compaction-image-offload/package.json | 1 + .../package.json | 1 + packages/compaction/compaction/package.json | 1 + .../computer-use/computer-use/package.json | 1 + .../context/agent-instructions/package.json | 1 + .../context/file-reference-local/package.json | 1 + packages/context/file-reference/package.json | 1 + .../context/session-reference/package.json | 1 + packages/context/time-context/package.json | 1 + packages/context/tmux-context/package.json | 1 + .../core/agent-default-model/package.json | 1 + packages/core/agent-loop/package.json | 1 + .../core/agent-tool-presentation/package.json | 1 + packages/core/agent/package.json | 1 + packages/core/scope/package.json | 1 + packages/core/session/package.json | 1 + packages/core/system-prompt/package.json | 1 + packages/core/tools/package.json | 1 + .../credentials/authorization/package.json | 1 + .../credentials-local/package.json | 1 + packages/credentials/credentials/package.json | 1 + .../deepseek-account-platform/package.json | 1 + .../credentials/deepseek-account/package.json | 1 + .../deliverables/tool-present/package.json | 1 + .../workspace-changes/package.json | 1 + packages/document/office-to-pdf/package.json | 1 + .../agent-team-profile/package.json | 1 + packages/experimental/agent-team/package.json | 1 + .../api-speech-to-text/package.json | 1 + .../experimental/auto-review/package.json | 1 + .../badge-skill-bundle/package.json | 1 + .../package.json | 1 + .../browser-use-playwright-mcp/package.json | 1 + .../browser-use-runtime/package.json | 1 + .../browser-use-stagehand-native/package.json | 1 + .../claude-code-mods/package.json | 1 + .../client-ui-agent-team/package.json | 1 + .../client-ui-claude-code-mods/package.json | 1 + .../client-ui-cot-translation/package.json | 1 + .../client-ui-voice-input/package.json | 1 + .../computer-use-cua-driver-mcp/package.json | 1 + .../package.json | 1 + .../cot-translation-bundle/package.json | 1 + .../experimental/hook-protocol/package.json | 1 + .../hooks-claude-code/package.json | 1 + .../experimental/hooks-codex/package.json | 1 + .../inspector-profile/package.json | 1 + packages/experimental/inspector/package.json | 1 + .../ptc-runtime-python/package.json | 1 + .../experimental/ralph-bundle/package.json | 1 + .../session-inspector/package.json | 1 + .../experimental/session-search/package.json | 1 + .../package.json | 2 +- .../session-titles-bundle/package.json | 1 + .../experimental/skill-badge/package.json | 1 + .../speech-to-text-sensevoice/package.json | 1 + .../experimental/speech-to-text/package.json | 1 + .../experimental/terminal-bundle/package.json | 1 + .../experimental/tool-agent-team/package.json | 1 + packages/experimental/tool-ralph/package.json | 1 + .../tool-session-query/package.json | 1 + .../experimental/tool-terminal/package.json | 1 + .../experimental/tool-worktree/package.json | 1 + packages/experimental/translator/package.json | 1 + .../voice-input-bundle/package.json | 1 + .../experimental/webhook-github/package.json | 1 + packages/experimental/webhook/package.json | 1 + .../webworker-packer/package.json | 1 + .../webworker-runtime/package.json | 1 + packages/experimental/worktree/package.json | 1 + .../cordis-client-runner/package.json | 1 + .../cordis-host-runner/package.json | 1 + packages/extensions/tool-cordis/package.json | 1 + packages/extensions/ui-cordis/package.json | 1 + .../feedback/command-feedback/package.json | 1 + .../feedback/message-feedback/package.json | 1 + packages/fs/fs-local/package.json | 1 + .../fs/fs-observation-policy/package.json | 1 + packages/fs/fs-sandbox/package.json | 1 + packages/fs/fs/package.json | 1 + packages/fs/tool-fs-search/package.json | 1 + packages/fs/tool-fs/package.json | 1 + .../fs/tool-str-replace-editor/package.json | 1 + packages/goal/command-goal/package.json | 1 + packages/goal/goal-round-driver/package.json | 1 + packages/goal/goal/package.json | 1 + packages/goal/tool-goal/package.json | 1 + .../guard/repeat-tool-reminder/package.json | 1 + packages/guard/timeout-policy/package.json | 1 + .../host/directory-picker-auto/package.json | 1 + .../host/directory-picker-browse/package.json | 1 + .../host/directory-picker-native/package.json | 1 + packages/host/directory-picker/package.json | 1 + packages/host/frontend-static/package.json | 1 + packages/host/open-in-app/package.json | 1 + packages/host/plugin-inventory/package.json | 1 + .../host/product-telemetry-otel/package.json | 1 + packages/host/webserver/package.json | 1 + .../identity/anonymous-user-id/package.json | 1 + packages/interaction/commands/package.json | 1 + .../permission-presets/package.json | 1 + .../interaction/tool-ask-user/package.json | 1 + .../interaction/user-approval/package.json | 1 + .../interaction/user-questions/package.json | 1 + packages/jobs/jobs-local/package.json | 1 + packages/jobs/jobs/package.json | 1 + packages/jobs/tool-jobs/package.json | 1 + .../deepseek-llm-api-extensions/package.json | 1 + .../llm/llm-deepseek-account/package.json | 1 + .../llm/llm-deepseek-api-key/package.json | 1 + packages/llm/llm-deepseek/package.json | 1 + packages/llm/llm-pi-ai/package.json | 1 + packages/llm/llm-retry/package.json | 1 + packages/llm/llm/package.json | 1 + .../package.json | 1 + packages/llm/token-meter/package.json | 1 + packages/lsp/lsp-stdio/package.json | 1 + packages/lsp/lsp/package.json | 1 + packages/lsp/tool-lsp/package.json | 1 + packages/mcp/mcp-client/package.json | 1 + packages/mcp/mcp-resources/package.json | 1 + packages/plan/plan-mode/package.json | 1 + .../preset/agent-preset-registry/package.json | 1 + packages/preset/agent-preset/package.json | 1 + packages/preset/persona/package.json | 1 + .../ptc-runtime/ptc-runtime-node/package.json | 1 + packages/ptc-runtime/ptc-runtime/package.json | 1 + packages/sandbox/sandbox-local/package.json | 1 + packages/sandbox/sandbox-policy/package.json | 1 + .../sandbox/sandbox-windows-acl/package.json | 1 + packages/sandbox/sandbox/package.json | 1 + packages/schedule/schedule/package.json | 1 + packages/schedule/tool-schedule/package.json | 1 + packages/sdk/client/package.json | 1 + packages/sdk/protocol/package.json | 1 + packages/sdk/server/package.json | 1 + .../session-log-export/package.json | 1 + .../session-query-sqlite/package.json | 1 + .../session-query/session-query/package.json | 1 + .../session-checkpoint-policy/package.json | 1 + .../session-format-catalog/package.json | 1 + .../session-format-v0-to-v1/package.json | 1 + .../session-format-v1-to-v2/package.json | 1 + .../session-format-v2-to-v3/package.json | 1 + .../session-format-v3-to-v4/package.json | 1 + packages/session/session-format/package.json | 1 + .../session/session-log-deepseek/package.json | 1 + .../session-persistence-jsonl/package.json | 1 + .../session/session-persistence/package.json | 1 + .../session-projection-cache/package.json | 1 + .../session/session-projection/package.json | 1 + packages/session/session-stats/package.json | 1 + .../session-telemetry-otel/package.json | 1 + .../session/session-telemetry/package.json | 1 + .../package.json | 2 +- .../session/session-title-llm/package.json | 1 + packages/session/session-title/package.json | 1 + .../session/session-turn-outline/package.json | 1 + .../tool-working-directory/package.json | 1 + .../session/working-directory/package.json | 1 + packages/settings/settings/package.json | 1 + packages/shell/bash-local/package.json | 1 + packages/shell/bash-sandbox/package.json | 1 + packages/shell/pwsh-local/package.json | 1 + packages/shell/pwsh-sandbox/package.json | 1 + packages/shell/shell-env/package.json | 1 + packages/shell/shell/package.json | 1 + .../shell/tool-bash-persistent/package.json | 1 + packages/shell/tool-bash/package.json | 1 + .../shell/tool-pwsh-persistent/package.json | 1 + packages/shell/tool-pwsh/package.json | 1 + packages/skill/skill-filesystem/package.json | 1 + packages/skill/skill-office/package.json | 1 + packages/skill/skill/package.json | 1 + packages/skill/tool-skill/package.json | 1 + .../tool-workspace-dependencies/package.json | 1 + packages/spill/spill-local/package.json | 1 + packages/spill/spill-policy/package.json | 1 + packages/spill/spill/package.json | 1 + packages/ssh/fs-ssh/package.json | 1 + packages/ssh/sandbox-ssh/package.json | 1 + packages/ssh/ssh/package.json | 1 + packages/ssh/subprocess-ssh/package.json | 1 + packages/storage/storage-domain/package.json | 1 + packages/storage/storage-json/package.json | 1 + packages/storage/storage-sqlite/package.json | 1 + packages/storage/storage/package.json | 1 + packages/subagent/subagent-acp/package.json | 1 + .../subagent-claude-code/package.json | 1 + packages/subagent/subagent-codex/package.json | 1 + .../subagent/subagent-dsh-sdk/package.json | 1 + .../subagent-fork-in-process/package.json | 1 + .../subagent-spawn-in-process/package.json | 1 + packages/subagent/subagent/package.json | 1 + .../tool-subagent-control/package.json | 1 + packages/subagent/tool-subagent/package.json | 1 + .../subprocess/subprocess-local/package.json | 1 + packages/subprocess/subprocess/package.json | 1 + .../subprocess/win32-process/package.json | 1 + packages/telemetry/otel/package.json | 1 + packages/terminal/terminal-bash/package.json | 1 + packages/terminal/terminal/package.json | 1 + .../agent-loop-testkit/package.json | 1 + .../test-support/client-runtime/package.json | 1 + .../test-support/llm-mock-server/package.json | 1 + packages/test-support/llm-replay/package.json | 1 + .../test-support/loader-smoke/package.json | 1 + .../test-support/remote-mock/package.json | 1 + .../session-snapshot/package.json | 1 + packages/todo/tool-todo/package.json | 1 + packages/typert/generator/README.i18n.yaml | 4 +- packages/typert/generator/README.md | 2 +- packages/typert/generator/README.zh.md | 2 +- packages/typert/generator/package.json | 1 + packages/typert/generator/src/workspace.ts | 7 +- .../remote-model/packages/remote/package.json | 3 +- packages/typert/loader/package.json | 1 + packages/typert/protocol/package.json | 1 + packages/typert/registry/package.json | 1 + packages/util/atomic-write/package.json | 1 + packages/util/brand/package.json | 1 + packages/util/chunked-list/package.json | 1 + packages/util/code-language/package.json | 1 + packages/util/crypto/package.json | 1 + packages/util/deque/package.json | 1 + packages/util/home-paths/package.json | 1 + packages/util/http-proxy/package.json | 1 + packages/util/launch-environment/package.json | 1 + packages/util/lazy-require/package.json | 1 + packages/util/native-command/package.json | 1 + packages/util/output-retention/package.json | 1 + packages/util/package-manifest/package.json | 1 + packages/util/time/package.json | 1 + packages/util/timeout/package.json | 1 + packages/util/values/package.json | 1 + packages/util/workspace-path/package.json | 1 + packages/web/tool-web/package.json | 1 + packages/web/web-fetch-http/package.json | 1 + packages/web/web-search-deepseek/package.json | 1 + packages/web/web-search-exa/package.json | 1 + .../web/web-search-perplexity/package.json | 1 + packages/web/web/package.json | 1 + packages/workflow/tool-workflow/package.json | 1 + packages/workflow/workflow-ptc/package.json | 1 + packages/workflow/workflow/package.json | 1 + packages/workspace/workspace/package.json | 1 + scripts/build-exe-for-python-sdk.ts | 9 +- scripts/check-workspace-constraints.spec.ts | 14 +-- scripts/check-workspace-constraints.ts | 26 ++--- scripts/clean.ts | 2 + scripts/publication-payload.spec.ts | 67 +------------ scripts/publication-payload.ts | 31 +----- scripts/publish-npm-baseline.ts | 7 -- scripts/release/families.spec.ts | 6 +- scripts/release/families.ts | 13 +-- scripts/stage-dsh-docs.spec.ts | 40 ++++++-- scripts/stage-dsh-docs.ts | 94 ++++++++++++++----- tsdown.config.ts | 3 + 364 files changed, 567 insertions(+), 233 deletions(-) diff --git a/.agents/notes/implemented/process/2026-08-10-npm-release-sequences.i18n.yaml b/.agents/notes/implemented/process/2026-08-10-npm-release-sequences.i18n.yaml index 58a7f3654a..957d8ff349 100644 --- a/.agents/notes/implemented/process/2026-08-10-npm-release-sequences.i18n.yaml +++ b/.agents/notes/implemented/process/2026-08-10-npm-release-sequences.i18n.yaml @@ -33,8 +33,8 @@ en: d83f6cf38529c5b5 zh: 4df5659b2154d3b7 /agent-note-private-npm-publication-as-three-independent-sequences/decision/release-family-objects: - en: 9b38e8eb8fc6ef9b - zh: 19b573c7c4f5d6e8 + en: e0cdaa5aaa1f7d25 + zh: 645f0a0e43a37ddd /agent-note-private-npm-publication-as-three-independent-sequences/decision/workflow-shape-pack-on-pr-push-publish-from-a-manual-dispatch-workflow: en: ea0acc6409da4d5c zh: ac0bd2fe41f4fe67 diff --git a/.agents/notes/implemented/process/2026-08-10-npm-release-sequences.md b/.agents/notes/implemented/process/2026-08-10-npm-release-sequences.md index bd50b428a4..68b3b067a9 100644 --- a/.agents/notes/implemented/process/2026-08-10-npm-release-sequences.md +++ b/.agents/notes/implemented/process/2026-08-10-npm-release-sequences.md @@ -117,7 +117,7 @@ The entity in this domain is a **release family**: a set of packages sharing one | `publish` | the three registry states above | | `process` / `tarball` | the one home for spawning commands and for reading a packed tarball, including the entry guard that keeps every script importable | -The dsh family applies the repository's publication payload policy, which rejects bundled JavaScript maps and publishes `src` with its declaration maps ([rationale](2026-10-08-published-source-and-docs.md)). The vendored family keeps upstream's payload, because upstream's manifest owns it and those manifests export `./src/*`. +The dsh family applies the repository's publication payload policy, which publishes `src`, its declaration maps, and the JavaScript maps beside the bundles they describe ([rationale](2026-10-08-published-source-and-docs.md)). The vendored family keeps upstream's payload, because upstream's manifest owns it and those manifests export `./src/*`. ### Workflow shape: pack on PR/push, publish from a manual dispatch workflow diff --git a/.agents/notes/implemented/process/2026-08-10-npm-release-sequences.zh.md b/.agents/notes/implemented/process/2026-08-10-npm-release-sequences.zh.md index 325b1133eb..d3437eecae 100644 --- a/.agents/notes/implemented/process/2026-08-10-npm-release-sequences.zh.md +++ b/.agents/notes/implemented/process/2026-08-10-npm-release-sequences.zh.md @@ -117,7 +117,7 @@ registry 的两个行为决定了「怎么尝试一次发布」。写入之间 | `publish` | 上面那三态 | | `process` / `tarball` | 启动命令、读取打包 tarball 的唯一正家,其中的入口守卫让每个脚本都可被 import | -dsh 族套用仓库的发布 payload 策略(拒绝打包后的 JavaScript map,随声明映射一起发布 `src`,[理由](2026-10-08-published-source-and-docs.zh.md))。vendored 族保留上游 payload,因为该 payload 由上游 manifest 拥有,且它们导出 `./src/*`。 +dsh 族套用仓库的发布 payload 策略(发布 `src`、其声明映射,以及紧挨所描述 bundle 的 JavaScript map,[理由](2026-10-08-published-source-and-docs.zh.md))。vendored 族保留上游 payload,因为该 payload 由上游 manifest 拥有,且它们导出 `./src/*`。 ### workflow 形状:PR/push 上 pack,从手动 dispatch 工作流发布 diff --git a/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.i18n.yaml b/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.i18n.yaml index dea1726712..3be3da2012 100644 --- a/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.i18n.yaml +++ b/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.i18n.yaml @@ -2,18 +2,18 @@ # section, a hash of its English and Chinese blocks outside code blocks and generated regions. # After editing either side, bring the other along and re-record with: # pnpm run verify-translation-pairing --write .agents/notes/implemented/process/2026-10-08-published-source-and-docs.md -/agent-note-published-source-and-documentation: - en: dcd10c6e1f5b6ceb - zh: 269cc2401be0f414 -/agent-note-published-source-and-documentation/problem: - en: 973cdfc5319db522 - zh: b298d546b55b77ef -/agent-note-published-source-and-documentation/decision: - en: 8c1fb9b17ef2377e - zh: fbc81e2633a61f0f -/agent-note-published-source-and-documentation/alternatives-considered: - en: 538980c8b24caee7 - zh: d076222bdbcbdebd -/agent-note-published-source-and-documentation/consequences: - en: 1df4bdcfc4bfaa5b - zh: 32f65ff4dd9c6fba +/agent-note-published-source-maps-and-documentation: + en: dbec3958b6bb3a8c + zh: f17abeb0533b4191 +/agent-note-published-source-maps-and-documentation/problem: + en: 699d35bd0bb12645 + zh: c9e362c336c6b440 +/agent-note-published-source-maps-and-documentation/decision: + en: b5d394bd286b1e2d + zh: f5d3317115442caa +/agent-note-published-source-maps-and-documentation/alternatives-considered: + en: 0bcc1a6864bcb340 + zh: ff5d138040563624 +/agent-note-published-source-maps-and-documentation/consequences: + en: bd76714dd121f9aa + zh: 6d474d6ea90e1b5f diff --git a/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.md b/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.md index dc78150dcf..820f84a409 100644 --- a/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.md +++ b/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.md @@ -1,4 +1,4 @@ -# Agent Note: Published source and documentation +# Agent Note: Published source, maps, and documentation Status: implemented @@ -6,36 +6,36 @@ English | [中文](2026-10-08-published-source-and-docs.zh.md) ## Problem -A published `@deepseek-ai/dsh-*` package carried declarations, bundled runtime, and locale resources, but not the TypeScript the declarations describe. Its `exports` map nevertheless declared `./src/*`, so an installed consumer resolved that subpath to files the tarball did not contain. A plugin author who wanted the implementation behind a documented API had to read the declaration, the documentation website, or a checkout at the matching `dsh-v*` tag: the first stops at the declaration, and the other two are not the installed version. The repository's Markdown documentation reached readers only through the website, which tracks the published release. +A published `@deepseek-ai/dsh-*` package carried declarations, bundled runtime, and locale resources, but neither the TypeScript the declarations describe nor the maps that resolve into it. Its `exports` map nevertheless declared `./src/*`, so an installed consumer resolved that subpath to files the tarball did not contain. A plugin author who wanted the implementation behind a documented API had to read the declaration, the documentation website, or a checkout at the matching `dsh-v*` tag: the first stops at the declaration, and the other two are not the installed version. The repository's Markdown documentation reached readers only through the website, which tracks the published release. ## Decision -Every release member publishes its TypeScript source and the declaration maps that resolve into it, and `@deepseek-ai/dsh` publishes the repository's Markdown documentation. +Every release member publishes its TypeScript source, the declaration maps that resolve into it, and the JavaScript maps beside the bundles they describe. `@deepseek-ai/dsh` publishes the documentation website's page set, and the build compresses emitted bundles without mangling identifiers. -[`expectedDshPackageFiles`](../../../../scripts/check-workspace-constraints.ts) lists `lib/types/**/*.d.ts.map` after the declarations and `src` last; a package with Typert Remote navigation also lists `lib/typert.remote-client.d.ts.map`, which its generated declaration references through `sourceMappingURL`. [`isForbiddenPublicationFile`](../../../../scripts/publication-payload.ts) rejects only bundled JavaScript maps, so both additions pass the static manifest check and the release family's packed-tarball check. The `./src/*` export that 315 of the 332 release members already declared resolves for an installed consumer. +[`expectedDshPackageFiles`](../../../../scripts/check-workspace-constraints.ts) lists `lib/types/**/*.d.ts.map`, `lib/**/*.js.map`, and `src`; a package with Typert Remote navigation also lists `lib/typert.remote-client.d.ts.map`, which its generated declaration references through `sourceMappingURL`. No payload member is forbidden, so the static manifest check owns the exact publication list. The `./src/*` export that 315 of the 332 release members declare resolves to those files, which serves editor navigation and reading; plain Node still cannot import them without a TypeScript loader. -`@deepseek-ai/dsh` stages the repository `docs` tree into `apps/cli/docs` from its `prepack` lifecycle through [`scripts/stage-dsh-docs.ts`](../../../../scripts/stage-dsh-docs.ts). The staged copy omits `docs/persistence-changes/`, whose per-release migration records the current contract replaces, and the `*.i18n.yaml` consistency records the documentation gates own. Images and every other reader-facing asset ship with it. +The workspace build and the client preset compress every emitted bundle (`minify: { compress: true, mangle: false }`). Identifiers keep their names, so a stack frame and the published map still name the original code. -The vendored family keeps upstream's payload unchanged; upstream owns those manifests, and they export `./src/*` ([release sequences](2026-08-10-npm-release-sequences.md)). +`@deepseek-ai/dsh` stages the documentation website's page set into `apps/cli/docs` from its `prepack` lifecycle through [`scripts/stage-dsh-docs.ts`](../../../../scripts/stage-dsh-docs.ts), which reads the publication manifest in [`website/docs.ts`](../../../../website/docs.ts), and removes that copy again from `postpack`. Non-Markdown assets under `docs/` ship with those pages; the generated `docs/persistence-changes/` records and the `docs/i18n/` guidelines do not. The vendored family keeps upstream's payload unchanged ([release sequences](2026-08-10-npm-release-sequences.md)). -Desktop packaging keeps its own [runtime-file policy](../../../../apps/desktop/scripts/runtime-file-policy.ts), so the packaged application omits declarations and declaration maps and carries `src` and the staged `docs` tree, neither of which it loads. +Desktop and the Python single-file executable pay nothing for either addition. [Desktop's runtime file policy](../../../../apps/desktop/scripts/runtime-file-policy.ts) omits `src/`, `docs/`, and every map from `@deepseek-ai/dsh*` packages while keeping third-party `src` trees that some of their `main` entries reach, and [`PUBLISHED_PAYLOAD_IGNORES`](../../../../scripts/build-exe-for-python-sdk.ts) excludes the same trees from the executable, so its contents no longer depend on a staged `docs` left in the checkout. ## Alternatives considered **Keep the payload declarations-only and send readers to the documentation website or the matching `dsh-v*` tag.** Rejected because neither is the installed version, and the website serves the latest published release rather than a prerelease. The declared `./src/*` export also has no meaning without those files. -**Publish declaration maps without `src`.** Rejected because a map whose `sources` are absent resolves nothing, which is exactly the navigation the [Typert Remote design](../architecture/2026-08-02-typert-remote-method-calls.md) requires. +**Publish maps without `src`.** Rejected because a map whose `sources` are absent resolves nothing, which is exactly the navigation the [Typert Remote design](../architecture/2026-08-02-typert-remote-method-calls.md) requires. -**Publish bundled JavaScript maps alongside the runtime bundles.** Rejected because those are single-artifact builds whose maps describe a build tree that is not published. +**Publish the whole `docs/` tree.** Rejected because that publishes RFCs, postmortems, testing guides, and maintainer workflows the website manifest deliberately withholds. -**Ship the documentation as a separate `@deepseek-ai/dsh-docs` package.** Rejected because it adds a public package and a release member for content that belongs beside the command every install already has. +**Mangle the bundles as well.** Rejected because mangled identifiers break the correspondence a published map exists to provide and make an unhandled stack frame unreadable. -**Publish `docs/persistence-changes` with the rest of the documentation.** Rejected because those records answer a version-comparison question, and their 16 MB would dominate the payload. +**Compress only `lib/index.js` and `lib/client.js`.** Rejected because one workspace build configuration emits every bundle, and a per-package exception would need a second configuration for no reader-visible gain. ## Consequences -`src` adds about 29 MB and declaration maps about 10 MB across the release set, and the staged `docs` tree adds about 6.7 MB to `@deepseek-ai/dsh`. Package tarballs grow accordingly, and the Desktop application carries `src` it never loads. +`src` adds about 29 MB and declaration maps about 10 MB across the release set; JavaScript maps add about 49 MB, and the staged documentation adds 5.9 MB to `@deepseek-ai/dsh`. Compression removes roughly half of a host bundle — `dsh-session`'s `lib/index.js` falls from 95 kB to 46 kB — and about a third of a client bundle. The Desktop application and the Python executable keep their previous payload. -A consumer editor now follows a declaration to the installed implementation, and a plugin author reads that version's source and documentation without a checkout. The staged copy keeps the repository's relative links, so a link from a shipped page into an unshipped tree — `../packages/**`, or the omitted `docs/persistence-changes/` records — resolves only in a checkout. The documentation payload closes the website's release skew only for the version it shipped with; a consumer still compares `dsh --version` when the difference matters. +A consumer editor now follows a declaration to the installed implementation, and a plugin author reads that version's documentation without a checkout. The staged copy keeps the repository's relative links, so a link from a shipped page into an unshipped tree — `../packages/**`, or the omitted `persistence-changes/` records — resolves only in a checkout. `docs/` exists in the working tree only between `prepack` and `postpack`, and `pnpm run clean` removes a copy an interrupted pack left behind. -`pnpm run constraints` rejects a member whose `files` omits `src` or either declaration map, because the canonical list is exact. The release family's tarball validation rejects a bundled JavaScript map and requires `@deepseek-ai/dsh` to carry documentation and source, so a pack run that skips the staging hook fails instead of publishing without them. +`pnpm run constraints` rejects a member whose `files` omits `src` or a map, because the canonical list is exact. The release family's tarball check requires `@deepseek-ai/dsh` to carry documentation and source, so a pack run that skips the staging hook fails instead of publishing without them. diff --git a/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.zh.md b/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.zh.md index cdd0788f5e..77835c5cba 100644 --- a/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.zh.md +++ b/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.zh.md @@ -1,4 +1,4 @@ -# Agent Note: 发布源码与文档 +# Agent Note: 发布源码、映射与文档 Status: implemented @@ -6,36 +6,36 @@ Status: implemented ## Problem -已发布的 `@deepseek-ai/dsh-*` 包带有声明文件、打包后的运行时和 locale 资源,却没有声明文件所描述的 TypeScript 源码。它的 `exports` 仍然声明了 `./src/*`,于是已安装的消费方把该子路径解析到 tarball 中并不存在的文件。插件作者若想看到某个已记录 API 背后的实现,只能读声明文件、文档网站,或检出匹配的 `dsh-v*` tag:第一种停在声明处,后两者都不是已安装的版本。仓库的 Markdown 文档也只能通过网站到达读者,而网站跟随的是已发布版本。 +已发布的 `@deepseek-ai/dsh-*` 包带有声明文件、打包后的运行时和 locale 资源,却没有声明文件所描述的 TypeScript,也没有能解析到它的映射。它的 `exports` 仍然声明了 `./src/*`,于是已安装的消费方把该子路径解析到 tarball 中并不存在的文件。插件作者若想看到某个已记录 API 背后的实现,只能读声明文件、文档网站,或检出匹配的 `dsh-v*` tag:第一种停在声明处,后两者都不是已安装的版本。仓库的 Markdown 文档也只能通过网站到达读者,而网站跟随的是已发布版本。 ## Decision -每个发布成员都发布自己的 TypeScript 源码,以及能解析到该源码的声明映射;`@deepseek-ai/dsh` 另发布仓库的 Markdown 文档。 +每个发布成员都发布自己的 TypeScript 源码、能解析到该源码的声明映射,以及紧挨所描述 bundle 的 JavaScript map。`@deepseek-ai/dsh` 另发布文档网站的页面集合,构建也会压缩产出的 bundle,但不混淆标识符。 -[`expectedDshPackageFiles`](../../../../scripts/check-workspace-constraints.ts) 在声明之后列出 `lib/types/**/*.d.ts.map`,并把 `src` 列在最后;带 Typert Remote 导航的包还会列出 `lib/typert.remote-client.d.ts.map`,其生成的声明通过 `sourceMappingURL` 引用该映射。[`isForbiddenPublicationFile`](../../../../scripts/publication-payload.ts) 只拒绝打包后的 JavaScript map,因此这两项新增内容都能通过静态 manifest 检查与发布族的 tarball 打包检查。332 个发布成员中已有 315 个声明过 `./src/*`,该导出对已安装的消费方开始真正解析。 +[`expectedDshPackageFiles`](../../../../scripts/check-workspace-constraints.ts) 列出 `lib/types/**/*.d.ts.map`、`lib/**/*.js.map` 与 `src`;带 Typert Remote 导航的包还会列出 `lib/typert.remote-client.d.ts.map`,其生成的声明通过 `sourceMappingURL` 引用该映射。没有任何载荷成员被禁止,发布清单由静态 manifest 检查精确持有。332 个发布成员中已有 315 个声明过 `./src/*`,该导出现在解析到这些文件,服务于编辑器导航与阅读;纯 Node 仍需 TypeScript loader 才能 import 它们。 -`@deepseek-ai/dsh` 通过 [`scripts/stage-dsh-docs.ts`](../../../../scripts/stage-dsh-docs.ts) 在自己的 `prepack` 生命周期里把仓库的 `docs` 树暂存到 `apps/cli/docs`。暂存副本不包含 `docs/persistence-changes/`(其中的逐版本迁移记录已被当前契约取代),也不包含由文档门禁拥有的 `*.i18n.yaml` 一致性记录。图片以及其他面向读者的资产都会一并发布。 +工作区构建与 client 预设会压缩每个产出的 bundle(`minify: { compress: true, mangle: false }`)。标识符保持原名,因此栈帧与已发布的 map 仍然指向原始代码。 -vendored 族保持上游 payload 不变;那些 manifest 由上游拥有,且它们导出 `./src/*`([发布序列](2026-08-10-npm-release-sequences.zh.md))。 +`@deepseek-ai/dsh` 通过 [`scripts/stage-dsh-docs.ts`](../../../../scripts/stage-dsh-docs.ts) 在自己的 `prepack` 生命周期里把文档网站的页面集合暂存到 `apps/cli/docs`,该脚本读取 [`website/docs.ts`](../../../../website/docs.ts) 中的发布清单,并在 `postpack` 中再次删除这份副本。`docs/` 下的非 Markdown 资产随这些页面一起发布;生成的 `docs/persistence-changes/` 记录与 `docs/i18n/` 规范不发布。vendored 族保持上游 payload 不变([发布序列](2026-08-10-npm-release-sequences.zh.md))。 -桌面打包保留自己的[运行时文件策略](../../../../apps/desktop/scripts/runtime-file-policy.ts),因此打包后的应用不含声明与声明映射,并携带它同样不会加载的 `src` 与暂存 `docs` 树。 +桌面版与 Python 单文件可执行体不为这两项新增内容付出代价。桌面的[运行时文件策略](../../../../apps/desktop/scripts/runtime-file-policy.ts)会从 `@deepseek-ai/dsh*` 包中剔除 `src/`、`docs/` 与所有映射,同时保留部分第三方包 `main` 指向的 `src` 树;[`PUBLISHED_PAYLOAD_IGNORES`](../../../../scripts/build-exe-for-python-sdk.ts) 则把这些树排除出可执行体,因此其内容不再取决于检出中是否残留暂存的 `docs`。 ## Alternatives considered **保持只发声明文件,把读者引向文档网站或匹配的 `dsh-v*` tag。** 否决:两者都不是已安装的版本,而网站提供的是最新已发布版本而非预发布版本。声明的 `./src/*` 导出没有这些文件也毫无意义。 -**只发布声明映射,不发布 `src`。** 否决:`sources` 不存在的映射解析不到任何东西,而这正是 [Typert Remote 设计](../architecture/2026-08-02-typert-remote-method-calls.zh.md)所要求的导航。 +**只发布映射,不发布 `src`。** 否决:`sources` 不存在的映射解析不到任何东西,而这正是 [Typert Remote 设计](../architecture/2026-08-02-typert-remote-method-calls.zh.md)所要求的导航。 -**随运行时 bundle 一起发布打包后的 JavaScript map。** 否决:那些是单产物构建,其 map 描述的构建树并未发布。 +**发布整棵 `docs/` 树。** 否决:那会把网站清单刻意不公开的 RFC、事故复盘、测试指南与维护者工作流一并发布。 -**把文档做成独立的 `@deepseek-ai/dsh-docs` 包。** 否决:这些内容本来就该待在每个人都会安装的命令旁边,独立成包会多出一个公开包和一个发布成员。 +**连标识符一起混淆。** 否决:混淆会破坏已发布 map 本应提供的对应关系,并使未处理栈帧无法阅读。 -**把 `docs/persistence-changes` 与其余文档一起发布。** 否决:那些记录回答的是版本对比问题,其 16 MB 会主导整个 payload。 +**只压缩 `lib/index.js` 与 `lib/client.js`。** 否决:一次工作区构建配置产出所有 bundle,为单包开例外需要第二套配置,而读者看不到任何收益。 ## Consequences -`src` 在整个发布集上增加约 29 MB,声明映射增加约 10 MB,暂存的 `docs` 树给 `@deepseek-ai/dsh` 增加约 6.7 MB。包 tarball 相应变大,桌面应用则携带它永不加载的 `src` 与 `docs`。 +`src` 在整个发布集上增加约 29 MB,声明映射增加约 10 MB,JavaScript map 增加约 49 MB,暂存的文档给 `@deepseek-ai/dsh` 增加 5.9 MB。压缩让 host bundle 大约减半——`dsh-session` 的 `lib/index.js` 从 95 kB 降到 46 kB——client bundle 约减少三分之一。桌面应用与 Python 可执行体保持原有载荷。 -消费方编辑器现在可以从声明跳转到已安装的实现,插件作者无需检出即可读到该版本的源码与文档。暂存副本保留仓库的相对链接,因此从随包页面指向未随包目录的链接——`../packages/**`,或被排除的 `docs/persistence-changes/` 记录——只在检出中可解析。文档 payload 只对它随包发布的那个版本消除网站的版本偏差;当差异确实重要时,消费方仍应核对 `dsh --version`。 +消费方编辑器现在可以从声明跳转到已安装的实现,插件作者无需检出即可读到该版本的文档。暂存副本保留仓库的相对链接,因此从随包页面指向未随包目录的链接——`../packages/**`,或被排除的 `persistence-changes/` 记录——只在检出中可解析。`docs/` 只在 `prepack` 与 `postpack` 之间存在于工作树,`pnpm run clean` 会清掉被中断的打包留下的副本。 -`pnpm run constraints` 会拒绝 `files` 中缺少 `src` 或任一声明映射的发布成员,因为该清单是精确匹配的。发布族的 tarball 校验会拒绝打包后的 JavaScript map,并要求 `@deepseek-ai/dsh` 必须带上文档与源码,因此跳过暂存钩子的打包会直接失败,而不是发出一个缺少它们的包。 +`pnpm run constraints` 会拒绝 `files` 中缺少 `src` 或任一声明映射的发布成员,因为该清单是精确匹配的。发布族的 tarball 校验要求 `@deepseek-ai/dsh` 必须带上文档与源码,因此跳过暂存钩子的打包会直接失败,而不是发出一个缺少它们的包。 diff --git a/apps/cli/README.i18n.yaml b/apps/cli/README.i18n.yaml index ddde8bd95c..c62beb75bb 100644 --- a/apps/cli/README.i18n.yaml +++ b/apps/cli/README.i18n.yaml @@ -17,6 +17,9 @@ /deepseek-ai-dsh/optional-overlays: en: 3a40ddc44e55f79c zh: 8d3949132e1ef93c +/deepseek-ai-dsh/installed-payload: + en: 11b7ca48d1da9da3 + zh: 1f909f6bc2e72e14 /deepseek-ai-dsh/development: en: 0a289c1235869927 zh: a1f473f70036ad37 diff --git a/apps/cli/README.md b/apps/cli/README.md index 55e761cb8b..35a2d48424 100644 --- a/apps/cli/README.md +++ b/apps/cli/README.md @@ -53,6 +53,12 @@ The [CLI behavior reference](reference/README.md) owns exact layer precedence, f `config/examples/` ships opt-in overlays for GitHub review webhooks, memory MCP servers, and runtime Cordis tools. They are never part of a default profile; the [user guides](../../docs/user/guide/index.md) and [developer practice guides](../../docs/user/develop/practice/index.md) own setup and safety instructions. +## Installed payload + +The published tarball carries the bundled runtime under `lib/`, the TypeScript under `src/`, the declaration and JavaScript maps beside the files they describe, and the documentation website's page set under `docs/`. Only `prepack` stages `docs/`, and `postpack` removes that copy again, so a reader of the working tree sees whatever the checkout holds. + +`docs/` excludes the generated `persistence-changes/` records and the `*.i18n.yaml` consistency records. Its pages keep the repository's relative links, so a link into `../packages/**` or into the omitted `persistence-changes/` tree resolves only in a checkout. + ## Development Production runs require built package and frontend artifacts. From the repository root, run `pnpm run build` separately, then use `pnpm dsh ` to run the TypeScript entry and forward every argument; the [source-execution reference](reference/README.md#source-execution) owns the module-resolution contract. diff --git a/apps/cli/README.zh.md b/apps/cli/README.zh.md index a2cc6b8a35..38a8415371 100644 --- a/apps/cli/README.zh.md +++ b/apps/cli/README.zh.md @@ -53,6 +53,12 @@ profile 目录包含一个 `package.json`,其中记录树外插件依赖,以 `config/examples/` 交付 GitHub 评审 webhook、记忆 MCP 服务器与运行时 Cordis 工具的可选覆盖层。它们绝不属于默认 profile;设置与安全说明由[用户指南](../../docs/user/guide/index.zh.md)和[开发实战指南](../../docs/user/develop/practice/index.zh.md)负责。 +## 安装包内容 + +发布 tarball 在 `lib/` 下携带打包后的运行时,在 `src/` 下携带 TypeScript 源码,在各自描述的文件旁携带声明映射与 JavaScript map,并在 `docs/` 下携带文档网站的页面集合。只有 `prepack` 会暂存 `docs/`,`postpack` 又会删除这份副本,因此工作树里的读者看到的始终是检出当前的内容。 + +`docs/` 不包含生成的 `persistence-changes/` 记录与 `*.i18n.yaml` 一致性记录。其中的页面保留仓库的相对链接,因此指向 `../packages/**` 或指向被排除的 `persistence-changes/` 树的链接只在检出中可解析。 + ## 开发 生产运行需要已构建的包与前端产物。请在仓库根目录单独运行 `pnpm run build`,然后使用 `pnpm dsh ` 运行 TypeScript 入口并转发所有参数;模块解析约定以[源码执行参考](reference/README.zh.md#source-execution)为准。 diff --git a/apps/cli/package.json b/apps/cli/package.json index 2749f9d735..c3dc7d18d3 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -16,13 +16,15 @@ }, "files": [ "lib/*.js", + "lib/*.js.map", "lib/types/*.d.ts", "lib/types/*.d.ts.map", "docs", "src" ], "scripts": { - "prepack": "tsx ../../scripts/stage-dsh-docs.ts" + "prepack": "tsx ../../scripts/stage-dsh-docs.ts", + "postpack": "tsx ../../scripts/stage-dsh-docs.ts --clean" }, "license": "MIT", "dependencies": { diff --git a/apps/desktop/scripts/runtime-file-policy.ts b/apps/desktop/scripts/runtime-file-policy.ts index 1bc16b2a1c..b7cbc4415c 100644 --- a/apps/desktop/scripts/runtime-file-policy.ts +++ b/apps/desktop/scripts/runtime-file-policy.ts @@ -24,6 +24,12 @@ export function desktopRuntimeFileExclusion( const nameParts = packageParts[0]?.startsWith('@') ? 2 : 1 const name = packageParts.slice(0, nameParts).join('/') const entry = packageParts.slice(nameParts).join('/') + if (name.startsWith('@deepseek-ai/dsh') && (entry === 'src' || entry.startsWith('src/'))) { + return 'published source' + } + if (name === '@deepseek-ai/dsh' && (entry === 'docs' || entry.startsWith('docs/'))) { + return 'published documentation' + } if (name.startsWith('@deepseek-ai/libreoffice-kit-')) { if (name !== `@deepseek-ai/libreoffice-kit-${officeEngine}`) return 'LibreOffice other platform' } diff --git a/apps/desktop/tests/runtime-file-policy.spec.ts b/apps/desktop/tests/runtime-file-policy.spec.ts index 76f5c8d95e..c113783e55 100644 --- a/apps/desktop/tests/runtime-file-policy.spec.ts +++ b/apps/desktop/tests/runtime-file-policy.spec.ts @@ -29,6 +29,9 @@ it('omits development artifacts while preserving executable modules, assets and '@mixmark-io/domino/test/entities.html', '@deepseek-ai/libreoffice-kit-wasm/assets/soffice.data', '@deepseek-ai/libreoffice-kit-darwin-arm64/bin/libreoffice-kit', + '@deepseek-ai/dsh/src/bin.ts', '@deepseek-ai/dsh/docs/architecture.md', + '@deepseek-ai/dsh-session/src/index.ts', + '@deepseek-ai/dsh-client-ui-chat/src/client/Page.tsx', '.modules.yaml', '.pnpm-workspace-state-v1.json', '.bin/tool', '.pnpm/cache', ] const retained = [ @@ -49,6 +52,8 @@ it('omits development artifacts while preserving executable modules, assets and '@deepseek-ai/libreoffice-kit-win32-x64/bin/libreoffice-kit.exe', '@deepseek-ai/libreoffice-kit-win32-x64/sources/core-source.json', '@deepseek-ai/libreoffice-kit-win32-x64/licenses/MPL-2.0.txt', + '@deepseek-ai/dsh/lib/index.js', '@deepseek-ai/dsh/lib/bin.js', + '@deepseek-ai/dsh-session/lib/index.js', ] try { const runtime = runtimeFixture(source) diff --git a/apps/web/package.json b/apps/web/package.json index f5efe2b592..7548471a7e 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -17,7 +17,6 @@ }, "files": [ "dist", - "!dist/**/*.map", "!dist/preview.html", "!dist/preview", "src" diff --git a/docs/cookbook/adding-a-package.i18n.yaml b/docs/cookbook/adding-a-package.i18n.yaml index 61a6dfa7d6..b8195f19e5 100644 --- a/docs/cookbook/adding-a-package.i18n.yaml +++ b/docs/cookbook/adding-a-package.i18n.yaml @@ -6,8 +6,8 @@ en: b94bcdbebcd6355e zh: 9fd61c2b986da759 /cookbook-adding-a-workspace-package/1-create-the-package: - en: 3dd23deee555ebb0 - zh: 5aa75243b67a1241 + en: 8dced23a19db2c69 + zh: ad9021f9fe5e9bb2 /cookbook-adding-a-workspace-package/2-register-it-in-the-root-configs: en: 12b985dee93a47a7 zh: 1027db3d251cd860 diff --git a/docs/cookbook/adding-a-package.md b/docs/cookbook/adding-a-package.md index 56d3c9134f..7ad2a4e645 100644 --- a/docs/cookbook/adding-a-package.md +++ b/docs/cookbook/adding-a-package.md @@ -24,7 +24,7 @@ packages/// Choose an existing group when one matches the package's role (`core`, `llm`, `shell`, `compaction`, `subagent`, `todo`, `session`, `client`/`host`, `util`, or `test-support`). A new group is allowed, but it is a pure container: no `package.json`, no source files, and packages still sit exactly one level below it. -package.json invariants (enforced by `pnpm run constraints` / `scripts/check-workspace-constraints.ts`): `private: true`, a `version` matching the root `package.json`, `type: module`, `main: "lib/index.js"`, `types: "lib/types/index.d.ts"`, `exports["."].types: "./lib/types/index.d.ts"`, `exports["."].default: "./lib/index.js"`, `@deepseek-ai/cordis` in BOTH peerDependencies and devDependencies (same range). Mirror every dsh peer dependency in devDependencies. `@deepseek-ai/schemastery` goes in `dependencies` (it is a runtime validator), matching agent-loop. The `files` list contains exactly `lib/index.js`, `lib/types/**/*.d.ts`, `lib/types/**/*.d.ts.map`, `src`, and package-specific runtime artifacts recognized by the gate. A package whose runtime export points into the emitted tree also includes `lib/types/**/*.js`. Declaration maps and `src` publish together so a consumer editor and a plugin author read the implementation behind an exported declaration; do not publish JS maps or stale root declaration files. CLI app packages with a package `bin` include `lib/bin.js` immediately after `lib/index.js` in `files`. +package.json invariants (enforced by `pnpm run constraints` / `scripts/check-workspace-constraints.ts`): `private: true`, a `version` matching the root `package.json`, `type: module`, `main: "lib/index.js"`, `types: "lib/types/index.d.ts"`, `exports["."].types: "./lib/types/index.d.ts"`, `exports["."].default: "./lib/index.js"`, `@deepseek-ai/cordis` in BOTH peerDependencies and devDependencies (same range). Mirror every dsh peer dependency in devDependencies. `@deepseek-ai/schemastery` goes in `dependencies` (it is a runtime validator), matching agent-loop. The `files` list contains exactly `lib/index.js`, `lib/types/**/*.d.ts`, `lib/types/**/*.d.ts.map`, `src`, and package-specific runtime artifacts recognized by the gate. A package whose runtime export points into the emitted tree also includes `lib/types/**/*.js`. Declaration and JavaScript maps publish beside the files they describe, and `src` publishes with them, so a consumer editor and a plugin author read the implementation behind an exported declaration; do not publish stale root declaration files. CLI app packages with a package `bin` include `lib/bin.js` immediately after `lib/index.js` in `files`. In-package relative imports use explicit `.ts` specifiers in source (for example, `export * from './types.ts'`). The compiler rewrites those to `.js` in emitted JS and leaves explicit `.ts` specifiers in declarations, which standard NodeNext/Node16 TypeScript consumers resolve to the sibling `.d.ts` files. diff --git a/docs/cookbook/adding-a-package.zh.md b/docs/cookbook/adding-a-package.zh.md index 21052b5904..38fa7d55b4 100644 --- a/docs/cookbook/adding-a-package.zh.md +++ b/docs/cookbook/adding-a-package.zh.md @@ -24,7 +24,7 @@ packages/// 当已有分组与包的角色匹配时,选择该分组(`core`、`llm`、`shell`、`compaction`、`subagent`、`todo`、`session`、`client`/`host`、`util` 或 `test-support`)。允许新建分组,但分组只是纯容器:没有 `package.json`,没有源文件,包仍然恰好位于其下一层。 -package.json 不变式(由 `pnpm run constraints` / `scripts/check-workspace-constraints.ts` 强制执行):`private: true`,`version` 与根 `package.json` 一致,`type: module`,`main: "lib/index.js"`,`types: "lib/types/index.d.ts"`,`exports["."].types: "./lib/types/index.d.ts"`,`exports["."].default: "./lib/index.js"`,`@deepseek-ai/cordis` 同时出现在 peerDependencies 和 devDependencies 中(相同范围)。每个 dsh 对等依赖(peer dependency)都要在 devDependencies 中镜像。`@deepseek-ai/schemastery` 放在 `dependencies` 中(它是运行时校验器),与 agent-loop 保持一致。`files` 列表精确包含 `lib/index.js`、`lib/types/**/*.d.ts`、`lib/types/**/*.d.ts.map`、`src` 以及门禁认可的包专用运行时产物。如果包的运行时 export 指向输出树,还要包含 `lib/types/**/*.js`。声明映射与 `src` 一起发布,让消费方编辑器和插件作者都能读到导出声明背后的实现;不要发布 JS map 或陈旧的根声明文件。带有 `bin` 的 CLI 应用包在 `files` 中将 `lib/bin.js` 紧跟在 `lib/index.js` 之后。 +package.json 不变式(由 `pnpm run constraints` / `scripts/check-workspace-constraints.ts` 强制执行):`private: true`,`version` 与根 `package.json` 一致,`type: module`,`main: "lib/index.js"`,`types: "lib/types/index.d.ts"`,`exports["."].types: "./lib/types/index.d.ts"`,`exports["."].default: "./lib/index.js"`,`@deepseek-ai/cordis` 同时出现在 peerDependencies 和 devDependencies 中(相同范围)。每个 dsh 对等依赖(peer dependency)都要在 devDependencies 中镜像。`@deepseek-ai/schemastery` 放在 `dependencies` 中(它是运行时校验器),与 agent-loop 保持一致。`files` 列表精确包含 `lib/index.js`、`lib/types/**/*.d.ts`、`lib/types/**/*.d.ts.map`、`src` 以及门禁认可的包专用运行时产物。如果包的运行时 export 指向输出树,还要包含 `lib/types/**/*.js`。声明映射与 JavaScript map 随各自描述的产物一起发布,`src` 也随之发布,让消费方编辑器和插件作者都能读到导出声明背后的实现;不要发布陈旧的根声明文件。带有 `bin` 的 CLI 应用包在 `files` 中将 `lib/bin.js` 紧跟在 `lib/index.js` 之后。 包内的相对导入在源码中使用显式 `.ts` 后缀(例如 `export * from './types.ts'`)。编译器在输出的 JS 中将其重写为 `.js`,在声明文件中保留显式 `.ts` 后缀;标准的 NodeNext/Node16 TypeScript 消费方会将其解析到同目录的 `.d.ts` 文件。 diff --git a/packages/acp/acp/package.json b/packages/acp/acp/package.json index 292d5d3d6d..a491ae3e56 100644 --- a/packages/acp/acp/package.json +++ b/packages/acp/acp/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/api/account-controller/package.json b/packages/api/account-controller/package.json index c4e9a0144e..5fc1052837 100644 --- a/packages/api/account-controller/package.json +++ b/packages/api/account-controller/package.json @@ -38,6 +38,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", diff --git a/packages/api/gateway/package.json b/packages/api/gateway/package.json index 81fa3057fc..98040a54b2 100644 --- a/packages/api/gateway/package.json +++ b/packages/api/gateway/package.json @@ -53,6 +53,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/api/job-controller/package.json b/packages/api/job-controller/package.json index a668daa6fe..666fa150e5 100644 --- a/packages/api/job-controller/package.json +++ b/packages/api/job-controller/package.json @@ -59,6 +59,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", diff --git a/packages/api/remotes/package.json b/packages/api/remotes/package.json index dfe5a003ba..153dba81db 100644 --- a/packages/api/remotes/package.json +++ b/packages/api/remotes/package.json @@ -49,6 +49,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "dependencies": { diff --git a/packages/api/session-controller/package.json b/packages/api/session-controller/package.json index 37a1a6da7f..6060164c0d 100644 --- a/packages/api/session-controller/package.json +++ b/packages/api/session-controller/package.json @@ -63,6 +63,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", diff --git a/packages/api/settings-controller/package.json b/packages/api/settings-controller/package.json index e2c7b73780..568e0cca9d 100644 --- a/packages/api/settings-controller/package.json +++ b/packages/api/settings-controller/package.json @@ -38,6 +38,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", diff --git a/packages/api/terminal-controller/package.json b/packages/api/terminal-controller/package.json index e903b9b030..a03a3035c7 100644 --- a/packages/api/terminal-controller/package.json +++ b/packages/api/terminal-controller/package.json @@ -89,6 +89,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", diff --git a/packages/api/workspace-controller/package.json b/packages/api/workspace-controller/package.json index 16a1fb77ee..67844bcfe3 100644 --- a/packages/api/workspace-controller/package.json +++ b/packages/api/workspace-controller/package.json @@ -63,6 +63,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", diff --git a/packages/api/workspace-files/package.json b/packages/api/workspace-files/package.json index d2bce1d79c..87144d75f8 100644 --- a/packages/api/workspace-files/package.json +++ b/packages/api/workspace-files/package.json @@ -79,6 +79,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", diff --git a/packages/attachment/attachment-local/package.json b/packages/attachment/attachment-local/package.json index 840ffbbff4..9af4fa08dd 100644 --- a/packages/attachment/attachment-local/package.json +++ b/packages/attachment/attachment-local/package.json @@ -18,7 +18,7 @@ "./src/*": "./src/*", "./package.json": "./package.json" }, - "files": ["lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", "src"], + "files": ["lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", "lib/**/*.js.map", "src"], "license": "MIT", "peerDependencies": { "@deepseek-ai/dsh-attachment": "workspace:*", diff --git a/packages/attachment/attachment/package.json b/packages/attachment/attachment/package.json index b1b5b85b42..1a8c50129b 100644 --- a/packages/attachment/attachment/package.json +++ b/packages/attachment/attachment/package.json @@ -19,7 +19,7 @@ "./src/*": "./src/*", "./package.json": "./package.json" }, - "files": ["lib/index.js", "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", "src"], + "files": ["lib/index.js", "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", "lib/**/*.js.map", "src"], "license": "MIT", "peerDependencies": { "@deepseek-ai/dsh-brand": "workspace:*", diff --git a/packages/boot/app-boot/package.json b/packages/boot/app-boot/package.json index d49a7357d7..5ac33eaef3 100644 --- a/packages/boot/app-boot/package.json +++ b/packages/boot/app-boot/package.json @@ -30,6 +30,7 @@ "lib/worker/profile-resolution-bootstrap.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/boot/cmdline/package.json b/packages/boot/cmdline/package.json index 5e09ffe0b3..fbb190a2e7 100644 --- a/packages/boot/cmdline/package.json +++ b/packages/boot/cmdline/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/boot/config-editor/package.json b/packages/boot/config-editor/package.json index 29dfca78e4..1fe2798f67 100644 --- a/packages/boot/config-editor/package.json +++ b/packages/boot/config-editor/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/boot/hmr/package.json b/packages/boot/hmr/package.json index 3eb72e9bcc..56996edf69 100644 --- a/packages/boot/hmr/package.json +++ b/packages/boot/hmr/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "author": "Shigma ", diff --git a/packages/boot/plugin-manager/package.json b/packages/boot/plugin-manager/package.json index d6f0c4e545..7e13d96b65 100644 --- a/packages/boot/plugin-manager/package.json +++ b/packages/boot/plugin-manager/package.json @@ -50,6 +50,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", diff --git a/packages/browser-use/browser-use/package.json b/packages/browser-use/browser-use/package.json index 28f2cea1dc..58fe381489 100644 --- a/packages/browser-use/browser-use/package.json +++ b/packages/browser-use/browser-use/package.json @@ -30,6 +30,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/bundle/acp-app/package.json b/packages/bundle/acp-app/package.json index cf47a11fcb..2aa91ed8b1 100644 --- a/packages/bundle/acp-app/package.json +++ b/packages/bundle/acp-app/package.json @@ -27,6 +27,7 @@ "cordis.patch.yml", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/bundle/base/package.json b/packages/bundle/base/package.json index 561d5271e6..c8ccd95c8f 100644 --- a/packages/bundle/base/package.json +++ b/packages/bundle/base/package.json @@ -27,6 +27,7 @@ "cordis.patch.yml", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/bundle/headless/package.json b/packages/bundle/headless/package.json index 42dcf52c01..4655f48c37 100644 --- a/packages/bundle/headless/package.json +++ b/packages/bundle/headless/package.json @@ -33,6 +33,7 @@ "lib/json-stream-*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/bundle/sdk-app/package.json b/packages/bundle/sdk-app/package.json index 980cabaa30..23205a07e8 100644 --- a/packages/bundle/sdk-app/package.json +++ b/packages/bundle/sdk-app/package.json @@ -27,6 +27,7 @@ "cordis.patch.yml", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/bundle/sdk-minimal/package.json b/packages/bundle/sdk-minimal/package.json index fc7807fc38..236e7e4240 100644 --- a/packages/bundle/sdk-minimal/package.json +++ b/packages/bundle/sdk-minimal/package.json @@ -27,6 +27,7 @@ "cordis.patch.yml", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/bundle/web-app/package.json b/packages/bundle/web-app/package.json index 9de3952235..1333adb356 100644 --- a/packages/bundle/web-app/package.json +++ b/packages/bundle/web-app/package.json @@ -38,6 +38,7 @@ "lib/public-url-*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/client/connection/package.json b/packages/client/connection/package.json index f84ec837ea..881601a7df 100644 --- a/packages/client/connection/package.json +++ b/packages/client/connection/package.json @@ -43,6 +43,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "peerDependencies": { diff --git a/packages/client/file-upload/package.json b/packages/client/file-upload/package.json index ac40374cd4..c7cd4b0902 100644 --- a/packages/client/file-upload/package.json +++ b/packages/client/file-upload/package.json @@ -57,6 +57,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", diff --git a/packages/client/hmr/package.json b/packages/client/hmr/package.json index 65bd8843b2..e1b3b47cd6 100644 --- a/packages/client/hmr/package.json +++ b/packages/client/hmr/package.json @@ -52,6 +52,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/locale/package.json b/packages/client/locale/package.json index 3b6bf825dd..fbc182390b 100644 --- a/packages/client/locale/package.json +++ b/packages/client/locale/package.json @@ -64,6 +64,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "scripts": { diff --git a/packages/client/modules/package.json b/packages/client/modules/package.json index 878948b7e1..f441c356f6 100644 --- a/packages/client/modules/package.json +++ b/packages/client/modules/package.json @@ -49,6 +49,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "peerDependencies": { diff --git a/packages/client/product-analytics/package.json b/packages/client/product-analytics/package.json index 4dc26d82fe..b3a957e8a6 100644 --- a/packages/client/product-analytics/package.json +++ b/packages/client/product-analytics/package.json @@ -70,6 +70,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", diff --git a/packages/client/resources/package.json b/packages/client/resources/package.json index 5e4dbc12ff..87554f8d7d 100644 --- a/packages/client/resources/package.json +++ b/packages/client/resources/package.json @@ -54,6 +54,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/shortcuts/package.json b/packages/client/shortcuts/package.json index 1aee3812c3..fbb01628e2 100644 --- a/packages/client/shortcuts/package.json +++ b/packages/client/shortcuts/package.json @@ -60,6 +60,7 @@ "lib/protocol.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "dependencies": { diff --git a/packages/client/store/package.json b/packages/client/store/package.json index 058442f123..7ae6fd4a45 100644 --- a/packages/client/store/package.json +++ b/packages/client/store/package.json @@ -34,6 +34,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/tsdown.client.ts b/packages/client/tsdown.client.ts index 2e8c06b18e..e76c9c3fe3 100644 --- a/packages/client/tsdown.client.ts +++ b/packages/client/tsdown.client.ts @@ -486,6 +486,9 @@ function clientConfig(id: string, entry: string, clientBanner?: (fileName: strin // Plugin code is fetched outside Vite's module graph, so its own bundle // must carry the TS/TSX mapping consumed by browser profiling tools. sourcemap: true, + // Compress only: identifier names stay readable in the shipped bundle, + // and the source map still resolves through the published `src`. + minify: { compress: true, mangle: false }, clean: false, deps: { neverBundle: isRequested, diff --git a/packages/client/ui-agent-preset/package.json b/packages/client/ui-agent-preset/package.json index 5eea4b7db8..b37e353385 100644 --- a/packages/client/ui-agent-preset/package.json +++ b/packages/client/ui-agent-preset/package.json @@ -75,6 +75,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "dependencies": {} diff --git a/packages/client/ui-approval/package.json b/packages/client/ui-approval/package.json index 6158620117..81569ff26c 100644 --- a/packages/client/ui-approval/package.json +++ b/packages/client/ui-approval/package.json @@ -68,6 +68,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-attachment/package.json b/packages/client/ui-attachment/package.json index d0d3e9f7d1..55801fc185 100644 --- a/packages/client/ui-attachment/package.json +++ b/packages/client/ui-attachment/package.json @@ -63,6 +63,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "peerDependencies": { diff --git a/packages/client/ui-brand-official/package.json b/packages/client/ui-brand-official/package.json index 074dcec296..8647939e25 100644 --- a/packages/client/ui-brand-official/package.json +++ b/packages/client/ui-brand-official/package.json @@ -57,6 +57,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-chat/package.json b/packages/client/ui-chat/package.json index a0fa173ab5..b3939f1f12 100644 --- a/packages/client/ui-chat/package.json +++ b/packages/client/ui-chat/package.json @@ -103,6 +103,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-commands/package.json b/packages/client/ui-commands/package.json index 50e41ecdd9..420298e908 100644 --- a/packages/client/ui-commands/package.json +++ b/packages/client/ui-commands/package.json @@ -70,6 +70,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-conversation/package.json b/packages/client/ui-conversation/package.json index 6748ea7139..ba27bcef13 100644 --- a/packages/client/ui-conversation/package.json +++ b/packages/client/ui-conversation/package.json @@ -104,6 +104,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-deliverables/package.json b/packages/client/ui-deliverables/package.json index d318924908..1f3f253b10 100644 --- a/packages/client/ui-deliverables/package.json +++ b/packages/client/ui-deliverables/package.json @@ -87,6 +87,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "dependencies": { diff --git a/packages/client/ui-directory-picker-browse/package.json b/packages/client/ui-directory-picker-browse/package.json index 99f5457dd8..0cf7f059f4 100644 --- a/packages/client/ui-directory-picker-browse/package.json +++ b/packages/client/ui-directory-picker-browse/package.json @@ -64,6 +64,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-directory-picker-native/package.json b/packages/client/ui-directory-picker-native/package.json index 4dd2ae3e3e..e885f10d56 100644 --- a/packages/client/ui-directory-picker-native/package.json +++ b/packages/client/ui-directory-picker-native/package.json @@ -57,6 +57,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-dockkit/package.json b/packages/client/ui-dockkit/package.json index ff5a987c91..ca46a2a52a 100644 --- a/packages/client/ui-dockkit/package.json +++ b/packages/client/ui-dockkit/package.json @@ -38,6 +38,7 @@ "lib/**/*.css", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "peerDependencies": { diff --git a/packages/client/ui-goal/package.json b/packages/client/ui-goal/package.json index d6b5791d5a..b92d047aa2 100644 --- a/packages/client/ui-goal/package.json +++ b/packages/client/ui-goal/package.json @@ -73,6 +73,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-input-trigger/package.json b/packages/client/ui-input-trigger/package.json index 4b7f05fd3a..8f69365169 100644 --- a/packages/client/ui-input-trigger/package.json +++ b/packages/client/ui-input-trigger/package.json @@ -67,6 +67,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-jobs/package.json b/packages/client/ui-jobs/package.json index 119051ecb3..5873ba9d18 100644 --- a/packages/client/ui-jobs/package.json +++ b/packages/client/ui-jobs/package.json @@ -55,6 +55,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "dsh": { diff --git a/packages/client/ui-layout/package.json b/packages/client/ui-layout/package.json index 8a6b1bf9d9..7c82975f4e 100644 --- a/packages/client/ui-layout/package.json +++ b/packages/client/ui-layout/package.json @@ -63,6 +63,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-message-feedback/package.json b/packages/client/ui-message-feedback/package.json index 5e91d8d77b..68c00c0989 100644 --- a/packages/client/ui-message-feedback/package.json +++ b/packages/client/ui-message-feedback/package.json @@ -75,6 +75,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-model-selection/package.json b/packages/client/ui-model-selection/package.json index b9f51eabb4..a196c25b3d 100644 --- a/packages/client/ui-model-selection/package.json +++ b/packages/client/ui-model-selection/package.json @@ -73,6 +73,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-open-in-app/package.json b/packages/client/ui-open-in-app/package.json index f16823d885..451e3357c8 100644 --- a/packages/client/ui-open-in-app/package.json +++ b/packages/client/ui-open-in-app/package.json @@ -30,6 +30,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "scripts": { diff --git a/packages/client/ui-permission-presets/package.json b/packages/client/ui-permission-presets/package.json index 703beb0f7e..d8b6130eeb 100644 --- a/packages/client/ui-permission-presets/package.json +++ b/packages/client/ui-permission-presets/package.json @@ -74,6 +74,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-plan/package.json b/packages/client/ui-plan/package.json index d6be83ae67..a5ecbad0f7 100644 --- a/packages/client/ui-plan/package.json +++ b/packages/client/ui-plan/package.json @@ -78,6 +78,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-plugin-manager/package.json b/packages/client/ui-plugin-manager/package.json index 2cc57af932..b7fc0efe78 100644 --- a/packages/client/ui-plugin-manager/package.json +++ b/packages/client/ui-plugin-manager/package.json @@ -80,6 +80,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", diff --git a/packages/client/ui-primitives/package.json b/packages/client/ui-primitives/package.json index df24ffd5d1..d1aa264296 100644 --- a/packages/client/ui-primitives/package.json +++ b/packages/client/ui-primitives/package.json @@ -57,6 +57,7 @@ "lib/**/*.css", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "peerDependencies": { diff --git a/packages/client/ui-reference/package.json b/packages/client/ui-reference/package.json index c1ed59761c..26d5cea771 100644 --- a/packages/client/ui-reference/package.json +++ b/packages/client/ui-reference/package.json @@ -67,6 +67,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-renderer/package.json b/packages/client/ui-renderer/package.json index 7422b8f82e..b307e41e29 100644 --- a/packages/client/ui-renderer/package.json +++ b/packages/client/ui-renderer/package.json @@ -55,6 +55,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-schedule/package.json b/packages/client/ui-schedule/package.json index f53200307d..fa0326641b 100644 --- a/packages/client/ui-schedule/package.json +++ b/packages/client/ui-schedule/package.json @@ -87,6 +87,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-session/package.json b/packages/client/ui-session/package.json index c5f71e18b1..6a80f10dc2 100644 --- a/packages/client/ui-session/package.json +++ b/packages/client/ui-session/package.json @@ -62,6 +62,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-settings-account/package.json b/packages/client/ui-settings-account/package.json index a6283a3186..95b3ad65b7 100644 --- a/packages/client/ui-settings-account/package.json +++ b/packages/client/ui-settings-account/package.json @@ -77,6 +77,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "dependencies": { diff --git a/packages/client/ui-settings-agent-loop/package.json b/packages/client/ui-settings-agent-loop/package.json index c6a17d6989..138afab147 100644 --- a/packages/client/ui-settings-agent-loop/package.json +++ b/packages/client/ui-settings-agent-loop/package.json @@ -62,6 +62,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-settings-general/package.json b/packages/client/ui-settings-general/package.json index 8e891050f0..bf4b3f8d80 100644 --- a/packages/client/ui-settings-general/package.json +++ b/packages/client/ui-settings-general/package.json @@ -79,6 +79,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-settings-models/package.json b/packages/client/ui-settings-models/package.json index 0406435b03..3539985eb1 100644 --- a/packages/client/ui-settings-models/package.json +++ b/packages/client/ui-settings-models/package.json @@ -68,6 +68,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-settings-plugin-inventory/package.json b/packages/client/ui-settings-plugin-inventory/package.json index 08fe010f98..79657293be 100644 --- a/packages/client/ui-settings-plugin-inventory/package.json +++ b/packages/client/ui-settings-plugin-inventory/package.json @@ -69,6 +69,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-settings-plugins/package.json b/packages/client/ui-settings-plugins/package.json index 5b63a88665..ab73c3f23c 100644 --- a/packages/client/ui-settings-plugins/package.json +++ b/packages/client/ui-settings-plugins/package.json @@ -58,6 +58,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-settings-session-log/package.json b/packages/client/ui-settings-session-log/package.json index 73b015a62e..6ad84de315 100644 --- a/packages/client/ui-settings-session-log/package.json +++ b/packages/client/ui-settings-session-log/package.json @@ -64,6 +64,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-settings-shell/package.json b/packages/client/ui-settings-shell/package.json index 81133f38bc..5b324d5ce2 100644 --- a/packages/client/ui-settings-shell/package.json +++ b/packages/client/ui-settings-shell/package.json @@ -62,6 +62,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-settings-subagent/package.json b/packages/client/ui-settings-subagent/package.json index 46aaba01ed..4c2cdb88ed 100644 --- a/packages/client/ui-settings-subagent/package.json +++ b/packages/client/ui-settings-subagent/package.json @@ -63,6 +63,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-settings-web-search/package.json b/packages/client/ui-settings-web-search/package.json index 9322cfb595..700fe643be 100644 --- a/packages/client/ui-settings-web-search/package.json +++ b/packages/client/ui-settings-web-search/package.json @@ -63,6 +63,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-settings/package.json b/packages/client/ui-settings/package.json index 7d61bf0286..1dbb653f63 100644 --- a/packages/client/ui-settings/package.json +++ b/packages/client/ui-settings/package.json @@ -57,6 +57,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "dependencies": { diff --git a/packages/client/ui-shortcuts/package.json b/packages/client/ui-shortcuts/package.json index 48810efd1d..2764748d8d 100644 --- a/packages/client/ui-shortcuts/package.json +++ b/packages/client/ui-shortcuts/package.json @@ -65,6 +65,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-sidebar-browser/package.json b/packages/client/ui-sidebar-browser/package.json index 9bb1561e62..9058e0e49d 100644 --- a/packages/client/ui-sidebar-browser/package.json +++ b/packages/client/ui-sidebar-browser/package.json @@ -70,6 +70,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-sidebar-documentpreview/package.json b/packages/client/ui-sidebar-documentpreview/package.json index 112e221df0..5ab00bb83b 100644 --- a/packages/client/ui-sidebar-documentpreview/package.json +++ b/packages/client/ui-sidebar-documentpreview/package.json @@ -94,6 +94,7 @@ "lib/client.*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "dependencies": { diff --git a/packages/client/ui-sidebar-files/package.json b/packages/client/ui-sidebar-files/package.json index fd84e6d154..4626f5228b 100644 --- a/packages/client/ui-sidebar-files/package.json +++ b/packages/client/ui-sidebar-files/package.json @@ -74,6 +74,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-sidebar-right/package.json b/packages/client/ui-sidebar-right/package.json index 3ce4c8e314..a54139af26 100644 --- a/packages/client/ui-sidebar-right/package.json +++ b/packages/client/ui-sidebar-right/package.json @@ -79,6 +79,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-sidebar-terminal/package.json b/packages/client/ui-sidebar-terminal/package.json index 6279fa350a..cc2754520b 100644 --- a/packages/client/ui-sidebar-terminal/package.json +++ b/packages/client/ui-sidebar-terminal/package.json @@ -78,6 +78,7 @@ "lib/client.*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-sidebar/package.json b/packages/client/ui-sidebar/package.json index b09fd9ffa4..0f313e69c9 100644 --- a/packages/client/ui-sidebar/package.json +++ b/packages/client/ui-sidebar/package.json @@ -70,6 +70,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-skill/package.json b/packages/client/ui-skill/package.json index e5d2e84496..26c61bb10f 100644 --- a/packages/client/ui-skill/package.json +++ b/packages/client/ui-skill/package.json @@ -73,6 +73,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-slots/package.json b/packages/client/ui-slots/package.json index 808269b089..0998991039 100644 --- a/packages/client/ui-slots/package.json +++ b/packages/client/ui-slots/package.json @@ -31,6 +31,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "peerDependencies": { diff --git a/packages/client/ui-subagent/package.json b/packages/client/ui-subagent/package.json index 4ebd50f44d..a5c6c741fa 100644 --- a/packages/client/ui-subagent/package.json +++ b/packages/client/ui-subagent/package.json @@ -78,6 +78,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-theme/package.json b/packages/client/ui-theme/package.json index e3310e252e..9436774466 100644 --- a/packages/client/ui-theme/package.json +++ b/packages/client/ui-theme/package.json @@ -66,6 +66,7 @@ "lib/styles", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "scripts": { diff --git a/packages/client/ui-tool/package.json b/packages/client/ui-tool/package.json index 45c3781fcd..c8a5d020f2 100644 --- a/packages/client/ui-tool/package.json +++ b/packages/client/ui-tool/package.json @@ -84,6 +84,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-trajectory/package.json b/packages/client/ui-trajectory/package.json index 06e1f18796..c28ed82e65 100644 --- a/packages/client/ui-trajectory/package.json +++ b/packages/client/ui-trajectory/package.json @@ -76,6 +76,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-user-questions/package.json b/packages/client/ui-user-questions/package.json index 0cbe8cfa97..6ad654d93a 100644 --- a/packages/client/ui-user-questions/package.json +++ b/packages/client/ui-user-questions/package.json @@ -78,6 +78,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/ui-workflow-run/package.json b/packages/client/ui-workflow-run/package.json index bbe4728d52..6ddf43bb3e 100644 --- a/packages/client/ui-workflow-run/package.json +++ b/packages/client/ui-workflow-run/package.json @@ -48,6 +48,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/client/ui-workspace/package.json b/packages/client/ui-workspace/package.json index 05a9c77ded..d14bde4679 100644 --- a/packages/client/ui-workspace/package.json +++ b/packages/client/ui-workspace/package.json @@ -86,6 +86,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/client/web/package.json b/packages/client/web/package.json index c43c8e3c55..161f233048 100644 --- a/packages/client/web/package.json +++ b/packages/client/web/package.json @@ -51,6 +51,7 @@ "lib/apply-injections.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/compaction/command-compact/package.json b/packages/compaction/command-compact/package.json index 324dfef173..7afdd53c65 100644 --- a/packages/compaction/command-compact/package.json +++ b/packages/compaction/command-compact/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/compaction/compaction-basic/package.json b/packages/compaction/compaction-basic/package.json index 2e7458d70a..a2af26e156 100644 --- a/packages/compaction/compaction-basic/package.json +++ b/packages/compaction/compaction-basic/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/compaction/compaction-image-offload/package.json b/packages/compaction/compaction-image-offload/package.json index 104f443ada..687688cf56 100644 --- a/packages/compaction/compaction-image-offload/package.json +++ b/packages/compaction/compaction-image-offload/package.json @@ -29,6 +29,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/compaction/compaction-tool-result-pruner/package.json b/packages/compaction/compaction-tool-result-pruner/package.json index 98e8bac151..fc128a2a51 100644 --- a/packages/compaction/compaction-tool-result-pruner/package.json +++ b/packages/compaction/compaction-tool-result-pruner/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/compaction/compaction/package.json b/packages/compaction/compaction/package.json index 4da7b162d0..456d3058bb 100644 --- a/packages/compaction/compaction/package.json +++ b/packages/compaction/compaction/package.json @@ -34,6 +34,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/computer-use/computer-use/package.json b/packages/computer-use/computer-use/package.json index 2f4bd4b561..dc02636cf6 100644 --- a/packages/computer-use/computer-use/package.json +++ b/packages/computer-use/computer-use/package.json @@ -30,6 +30,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/context/agent-instructions/package.json b/packages/context/agent-instructions/package.json index bbb0a78028..4a80e83ede 100644 --- a/packages/context/agent-instructions/package.json +++ b/packages/context/agent-instructions/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/context/file-reference-local/package.json b/packages/context/file-reference-local/package.json index 4bb0ed6609..61a40a7102 100644 --- a/packages/context/file-reference-local/package.json +++ b/packages/context/file-reference-local/package.json @@ -30,6 +30,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/context/file-reference/package.json b/packages/context/file-reference/package.json index af6f101793..83dfd75fa4 100644 --- a/packages/context/file-reference/package.json +++ b/packages/context/file-reference/package.json @@ -34,6 +34,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/context/session-reference/package.json b/packages/context/session-reference/package.json index e9897c5d0e..38941f3a48 100644 --- a/packages/context/session-reference/package.json +++ b/packages/context/session-reference/package.json @@ -38,6 +38,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", diff --git a/packages/context/time-context/package.json b/packages/context/time-context/package.json index 2f33097a13..5d3a913680 100644 --- a/packages/context/time-context/package.json +++ b/packages/context/time-context/package.json @@ -27,6 +27,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/context/tmux-context/package.json b/packages/context/tmux-context/package.json index 6614e96b4f..0d83abf942 100644 --- a/packages/context/tmux-context/package.json +++ b/packages/context/tmux-context/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/core/agent-default-model/package.json b/packages/core/agent-default-model/package.json index 95a8c6bf9a..b21beec348 100644 --- a/packages/core/agent-default-model/package.json +++ b/packages/core/agent-default-model/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/core/agent-loop/package.json b/packages/core/agent-loop/package.json index 11e2637b19..aeb09317b5 100644 --- a/packages/core/agent-loop/package.json +++ b/packages/core/agent-loop/package.json @@ -24,6 +24,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/core/agent-tool-presentation/package.json b/packages/core/agent-tool-presentation/package.json index 24222c7831..252d99369e 100644 --- a/packages/core/agent-tool-presentation/package.json +++ b/packages/core/agent-tool-presentation/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/core/agent/package.json b/packages/core/agent/package.json index baa51e2bae..556217987b 100644 --- a/packages/core/agent/package.json +++ b/packages/core/agent/package.json @@ -30,6 +30,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/core/scope/package.json b/packages/core/scope/package.json index 2f0cdca10a..e545d43729 100644 --- a/packages/core/scope/package.json +++ b/packages/core/scope/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/core/session/package.json b/packages/core/session/package.json index 036627d364..b1556705dd 100644 --- a/packages/core/session/package.json +++ b/packages/core/session/package.json @@ -38,6 +38,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/core/system-prompt/package.json b/packages/core/system-prompt/package.json index 8674b12846..967baef5ea 100644 --- a/packages/core/system-prompt/package.json +++ b/packages/core/system-prompt/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/core/tools/package.json b/packages/core/tools/package.json index f08522c45a..92d3f98b34 100644 --- a/packages/core/tools/package.json +++ b/packages/core/tools/package.json @@ -34,6 +34,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/credentials/authorization/package.json b/packages/credentials/authorization/package.json index 8086274bc9..714cb5b15c 100644 --- a/packages/credentials/authorization/package.json +++ b/packages/credentials/authorization/package.json @@ -30,6 +30,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/credentials/credentials-local/package.json b/packages/credentials/credentials-local/package.json index 2c03c980c0..4413d85547 100644 --- a/packages/credentials/credentials-local/package.json +++ b/packages/credentials/credentials-local/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/credentials/credentials/package.json b/packages/credentials/credentials/package.json index bbbd675062..a8eef507f5 100644 --- a/packages/credentials/credentials/package.json +++ b/packages/credentials/credentials/package.json @@ -30,6 +30,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/credentials/deepseek-account-platform/package.json b/packages/credentials/deepseek-account-platform/package.json index 8327ec2ba3..cb8735c422 100644 --- a/packages/credentials/deepseek-account-platform/package.json +++ b/packages/credentials/deepseek-account-platform/package.json @@ -30,6 +30,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/credentials/deepseek-account/package.json b/packages/credentials/deepseek-account/package.json index 27a9da1f24..cd85a24e12 100644 --- a/packages/credentials/deepseek-account/package.json +++ b/packages/credentials/deepseek-account/package.json @@ -30,6 +30,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/deliverables/tool-present/package.json b/packages/deliverables/tool-present/package.json index e9181ed2a6..23c578afc6 100644 --- a/packages/deliverables/tool-present/package.json +++ b/packages/deliverables/tool-present/package.json @@ -31,6 +31,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "dependencies": { diff --git a/packages/deliverables/workspace-changes/package.json b/packages/deliverables/workspace-changes/package.json index f93a7d0712..dbef73bf4a 100644 --- a/packages/deliverables/workspace-changes/package.json +++ b/packages/deliverables/workspace-changes/package.json @@ -31,6 +31,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "dependencies": { diff --git a/packages/document/office-to-pdf/package.json b/packages/document/office-to-pdf/package.json index bf13eaaf96..b78bfac838 100644 --- a/packages/document/office-to-pdf/package.json +++ b/packages/document/office-to-pdf/package.json @@ -39,6 +39,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", diff --git a/packages/experimental/agent-team-profile/package.json b/packages/experimental/agent-team-profile/package.json index cdcc2217b8..f1b90dc051 100644 --- a/packages/experimental/agent-team-profile/package.json +++ b/packages/experimental/agent-team-profile/package.json @@ -31,6 +31,7 @@ "cordis.patch.yml", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/experimental/agent-team/package.json b/packages/experimental/agent-team/package.json index cb10d380cd..52786d25f5 100644 --- a/packages/experimental/agent-team/package.json +++ b/packages/experimental/agent-team/package.json @@ -36,6 +36,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/experimental/api-speech-to-text/package.json b/packages/experimental/api-speech-to-text/package.json index 0503a8c646..6ebb11c3e7 100644 --- a/packages/experimental/api-speech-to-text/package.json +++ b/packages/experimental/api-speech-to-text/package.json @@ -38,6 +38,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", diff --git a/packages/experimental/auto-review/package.json b/packages/experimental/auto-review/package.json index d369477539..c625c226bb 100644 --- a/packages/experimental/auto-review/package.json +++ b/packages/experimental/auto-review/package.json @@ -28,6 +28,7 @@ "cordis.patch.yml", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/experimental/badge-skill-bundle/package.json b/packages/experimental/badge-skill-bundle/package.json index 31e091cae6..3f191f403e 100644 --- a/packages/experimental/badge-skill-bundle/package.json +++ b/packages/experimental/badge-skill-bundle/package.json @@ -31,6 +31,7 @@ "cordis.patch.yml", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/experimental/browser-use-chrome-devtools-mcp/package.json b/packages/experimental/browser-use-chrome-devtools-mcp/package.json index 649d452d51..cd9f9a99b5 100644 --- a/packages/experimental/browser-use-chrome-devtools-mcp/package.json +++ b/packages/experimental/browser-use-chrome-devtools-mcp/package.json @@ -27,6 +27,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/experimental/browser-use-playwright-mcp/package.json b/packages/experimental/browser-use-playwright-mcp/package.json index 130fd36866..bf1da64375 100644 --- a/packages/experimental/browser-use-playwright-mcp/package.json +++ b/packages/experimental/browser-use-playwright-mcp/package.json @@ -27,6 +27,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/experimental/browser-use-runtime/package.json b/packages/experimental/browser-use-runtime/package.json index 1c2bb93a41..e35925b0a1 100644 --- a/packages/experimental/browser-use-runtime/package.json +++ b/packages/experimental/browser-use-runtime/package.json @@ -30,6 +30,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/experimental/browser-use-stagehand-native/package.json b/packages/experimental/browser-use-stagehand-native/package.json index 9a098ea4d8..31a1cc64a3 100644 --- a/packages/experimental/browser-use-stagehand-native/package.json +++ b/packages/experimental/browser-use-stagehand-native/package.json @@ -30,6 +30,7 @@ "lib/worker.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/experimental/claude-code-mods/package.json b/packages/experimental/claude-code-mods/package.json index 0cea68cf83..028396302f 100644 --- a/packages/experimental/claude-code-mods/package.json +++ b/packages/experimental/claude-code-mods/package.json @@ -43,6 +43,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", diff --git a/packages/experimental/client-ui-agent-team/package.json b/packages/experimental/client-ui-agent-team/package.json index 39095ad10f..ff6de22113 100644 --- a/packages/experimental/client-ui-agent-team/package.json +++ b/packages/experimental/client-ui-agent-team/package.json @@ -82,6 +82,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/experimental/client-ui-claude-code-mods/package.json b/packages/experimental/client-ui-claude-code-mods/package.json index 219958feb4..d874ed5a30 100644 --- a/packages/experimental/client-ui-claude-code-mods/package.json +++ b/packages/experimental/client-ui-claude-code-mods/package.json @@ -46,6 +46,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/experimental/client-ui-cot-translation/package.json b/packages/experimental/client-ui-cot-translation/package.json index 4c34f6995d..147fc00d6a 100644 --- a/packages/experimental/client-ui-cot-translation/package.json +++ b/packages/experimental/client-ui-cot-translation/package.json @@ -99,6 +99,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", diff --git a/packages/experimental/client-ui-voice-input/package.json b/packages/experimental/client-ui-voice-input/package.json index 52947344eb..6fb49645e6 100644 --- a/packages/experimental/client-ui-voice-input/package.json +++ b/packages/experimental/client-ui-voice-input/package.json @@ -30,6 +30,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/experimental/computer-use-cua-driver-mcp/package.json b/packages/experimental/computer-use-cua-driver-mcp/package.json index 8dc46d644c..264bd03a3a 100644 --- a/packages/experimental/computer-use-cua-driver-mcp/package.json +++ b/packages/experimental/computer-use-cua-driver-mcp/package.json @@ -27,6 +27,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/experimental/computer-use-cua-driver-native/package.json b/packages/experimental/computer-use-cua-driver-native/package.json index 1ff2b78772..d2c958a156 100644 --- a/packages/experimental/computer-use-cua-driver-native/package.json +++ b/packages/experimental/computer-use-cua-driver-native/package.json @@ -27,6 +27,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/experimental/cot-translation-bundle/package.json b/packages/experimental/cot-translation-bundle/package.json index 94adb61160..a7a7226a46 100644 --- a/packages/experimental/cot-translation-bundle/package.json +++ b/packages/experimental/cot-translation-bundle/package.json @@ -31,6 +31,7 @@ "cordis.patch.yml", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/experimental/hook-protocol/package.json b/packages/experimental/hook-protocol/package.json index 7bc2b5ccfd..5b8cbe7589 100644 --- a/packages/experimental/hook-protocol/package.json +++ b/packages/experimental/hook-protocol/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/experimental/hooks-claude-code/package.json b/packages/experimental/hooks-claude-code/package.json index bc53713b75..c2bba1f575 100644 --- a/packages/experimental/hooks-claude-code/package.json +++ b/packages/experimental/hooks-claude-code/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/experimental/hooks-codex/package.json b/packages/experimental/hooks-codex/package.json index db892f744b..903161ea0f 100644 --- a/packages/experimental/hooks-codex/package.json +++ b/packages/experimental/hooks-codex/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/experimental/inspector-profile/package.json b/packages/experimental/inspector-profile/package.json index fce0e27389..84bb5ee08b 100644 --- a/packages/experimental/inspector-profile/package.json +++ b/packages/experimental/inspector-profile/package.json @@ -31,6 +31,7 @@ "cordis.patch.yml", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/experimental/inspector/package.json b/packages/experimental/inspector/package.json index d07bc8440e..a5722a6821 100644 --- a/packages/experimental/inspector/package.json +++ b/packages/experimental/inspector/package.json @@ -44,6 +44,7 @@ "lib/devtools/**", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/experimental/ptc-runtime-python/package.json b/packages/experimental/ptc-runtime-python/package.json index 05d6695922..3a05730ee4 100644 --- a/packages/experimental/ptc-runtime-python/package.json +++ b/packages/experimental/ptc-runtime-python/package.json @@ -22,6 +22,7 @@ "py/**/*.py", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/experimental/ralph-bundle/package.json b/packages/experimental/ralph-bundle/package.json index 8a9ca8c122..27f94165f6 100644 --- a/packages/experimental/ralph-bundle/package.json +++ b/packages/experimental/ralph-bundle/package.json @@ -31,6 +31,7 @@ "cordis.patch.yml", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/experimental/session-inspector/package.json b/packages/experimental/session-inspector/package.json index d72e339160..a260aa49e3 100644 --- a/packages/experimental/session-inspector/package.json +++ b/packages/experimental/session-inspector/package.json @@ -44,6 +44,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "scripts": { diff --git a/packages/experimental/session-search/package.json b/packages/experimental/session-search/package.json index 27b4d8a481..3a04d084ea 100644 --- a/packages/experimental/session-search/package.json +++ b/packages/experimental/session-search/package.json @@ -31,6 +31,7 @@ "cordis.patch.yml", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/experimental/session-title-all-prompts-llm/package.json b/packages/experimental/session-title-all-prompts-llm/package.json index 3bb6b1a8a1..e74f6e9468 100644 --- a/packages/experimental/session-title-all-prompts-llm/package.json +++ b/packages/experimental/session-title-all-prompts-llm/package.json @@ -20,7 +20,7 @@ }, "./package.json": "./package.json" }, - "files": ["lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", "src"], + "files": ["lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", "lib/**/*.js.map", "src"], "license": "MIT", "peerDependencies": { "@deepseek-ai/dsh-llm": "workspace:*", diff --git a/packages/experimental/session-titles-bundle/package.json b/packages/experimental/session-titles-bundle/package.json index 475f158d5e..873e852787 100644 --- a/packages/experimental/session-titles-bundle/package.json +++ b/packages/experimental/session-titles-bundle/package.json @@ -31,6 +31,7 @@ "cordis.patch.yml", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/experimental/skill-badge/package.json b/packages/experimental/skill-badge/package.json index 8fabfbad9f..ef68b88b8f 100644 --- a/packages/experimental/skill-badge/package.json +++ b/packages/experimental/skill-badge/package.json @@ -25,6 +25,7 @@ "assets", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/experimental/speech-to-text-sensevoice/package.json b/packages/experimental/speech-to-text-sensevoice/package.json index 104c4b0536..b4e0ff12d4 100644 --- a/packages/experimental/speech-to-text-sensevoice/package.json +++ b/packages/experimental/speech-to-text-sensevoice/package.json @@ -31,6 +31,7 @@ "runtime/assets.json", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/experimental/speech-to-text/package.json b/packages/experimental/speech-to-text/package.json index a409000607..952b563a62 100644 --- a/packages/experimental/speech-to-text/package.json +++ b/packages/experimental/speech-to-text/package.json @@ -34,6 +34,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/experimental/terminal-bundle/package.json b/packages/experimental/terminal-bundle/package.json index fe5c7f385b..04a3362a4e 100644 --- a/packages/experimental/terminal-bundle/package.json +++ b/packages/experimental/terminal-bundle/package.json @@ -31,6 +31,7 @@ "cordis.patch.yml", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/experimental/tool-agent-team/package.json b/packages/experimental/tool-agent-team/package.json index c87306ccfd..ee4ca4b1b3 100644 --- a/packages/experimental/tool-agent-team/package.json +++ b/packages/experimental/tool-agent-team/package.json @@ -27,6 +27,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/experimental/tool-ralph/package.json b/packages/experimental/tool-ralph/package.json index 1a00b6fdfa..e7a8d4c85b 100644 --- a/packages/experimental/tool-ralph/package.json +++ b/packages/experimental/tool-ralph/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/experimental/tool-session-query/package.json b/packages/experimental/tool-session-query/package.json index 6529b88486..76203c03a5 100644 --- a/packages/experimental/tool-session-query/package.json +++ b/packages/experimental/tool-session-query/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/experimental/tool-terminal/package.json b/packages/experimental/tool-terminal/package.json index 77eeba7bde..61c1bd7e29 100644 --- a/packages/experimental/tool-terminal/package.json +++ b/packages/experimental/tool-terminal/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/experimental/tool-worktree/package.json b/packages/experimental/tool-worktree/package.json index c190a33d11..bbd3e07fb6 100644 --- a/packages/experimental/tool-worktree/package.json +++ b/packages/experimental/tool-worktree/package.json @@ -25,6 +25,7 @@ "cordis.patch.yml", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/experimental/translator/package.json b/packages/experimental/translator/package.json index 0b8532d919..5d49683137 100644 --- a/packages/experimental/translator/package.json +++ b/packages/experimental/translator/package.json @@ -30,6 +30,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/experimental/voice-input-bundle/package.json b/packages/experimental/voice-input-bundle/package.json index 42c4b82110..b28acf3d03 100644 --- a/packages/experimental/voice-input-bundle/package.json +++ b/packages/experimental/voice-input-bundle/package.json @@ -31,6 +31,7 @@ "cordis.patch.yml", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/experimental/webhook-github/package.json b/packages/experimental/webhook-github/package.json index 6876690a14..90ff38f0d8 100644 --- a/packages/experimental/webhook-github/package.json +++ b/packages/experimental/webhook-github/package.json @@ -33,6 +33,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/experimental/webhook/package.json b/packages/experimental/webhook/package.json index 6ae1c738a3..eae75821ad 100644 --- a/packages/experimental/webhook/package.json +++ b/packages/experimental/webhook/package.json @@ -30,6 +30,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/experimental/webworker-packer/package.json b/packages/experimental/webworker-packer/package.json index d559b90127..5b8052801c 100644 --- a/packages/experimental/webworker-packer/package.json +++ b/packages/experimental/webworker-packer/package.json @@ -31,6 +31,7 @@ "lib/repository-*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/experimental/webworker-runtime/package.json b/packages/experimental/webworker-runtime/package.json index 8e0dd86948..caf81bc345 100644 --- a/packages/experimental/webworker-runtime/package.json +++ b/packages/experimental/webworker-runtime/package.json @@ -72,6 +72,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/experimental/worktree/package.json b/packages/experimental/worktree/package.json index 04d9bef0a9..4e3d89dc28 100644 --- a/packages/experimental/worktree/package.json +++ b/packages/experimental/worktree/package.json @@ -20,6 +20,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/extensions/cordis-client-runner/package.json b/packages/extensions/cordis-client-runner/package.json index 4a5969e872..025c4bceb6 100644 --- a/packages/extensions/cordis-client-runner/package.json +++ b/packages/extensions/cordis-client-runner/package.json @@ -60,6 +60,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/extensions/cordis-host-runner/package.json b/packages/extensions/cordis-host-runner/package.json index 6d7230de92..9a81b3374d 100644 --- a/packages/extensions/cordis-host-runner/package.json +++ b/packages/extensions/cordis-host-runner/package.json @@ -38,6 +38,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", diff --git a/packages/extensions/tool-cordis/package.json b/packages/extensions/tool-cordis/package.json index eeb414d4da..2ee5343f2e 100644 --- a/packages/extensions/tool-cordis/package.json +++ b/packages/extensions/tool-cordis/package.json @@ -30,6 +30,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/extensions/ui-cordis/package.json b/packages/extensions/ui-cordis/package.json index c54a7609a3..c54128f3c3 100644 --- a/packages/extensions/ui-cordis/package.json +++ b/packages/extensions/ui-cordis/package.json @@ -70,6 +70,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/feedback/command-feedback/package.json b/packages/feedback/command-feedback/package.json index 1fff4ede00..3459d00427 100644 --- a/packages/feedback/command-feedback/package.json +++ b/packages/feedback/command-feedback/package.json @@ -38,6 +38,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", diff --git a/packages/feedback/message-feedback/package.json b/packages/feedback/message-feedback/package.json index 7e7eb125c1..629d3f0efe 100644 --- a/packages/feedback/message-feedback/package.json +++ b/packages/feedback/message-feedback/package.json @@ -38,6 +38,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", diff --git a/packages/fs/fs-local/package.json b/packages/fs/fs-local/package.json index c35b192556..6b56482279 100644 --- a/packages/fs/fs-local/package.json +++ b/packages/fs/fs-local/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/fs/fs-observation-policy/package.json b/packages/fs/fs-observation-policy/package.json index 4fafe004a6..25c0a03649 100644 --- a/packages/fs/fs-observation-policy/package.json +++ b/packages/fs/fs-observation-policy/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/fs/fs-sandbox/package.json b/packages/fs/fs-sandbox/package.json index 0489bd3683..12d908f154 100644 --- a/packages/fs/fs-sandbox/package.json +++ b/packages/fs/fs-sandbox/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/fs/fs/package.json b/packages/fs/fs/package.json index ed24412780..a55da0c15e 100644 --- a/packages/fs/fs/package.json +++ b/packages/fs/fs/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/fs/tool-fs-search/package.json b/packages/fs/tool-fs-search/package.json index 5d071328cb..86bd3caaa7 100644 --- a/packages/fs/tool-fs-search/package.json +++ b/packages/fs/tool-fs-search/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/fs/tool-fs/package.json b/packages/fs/tool-fs/package.json index d23fc7f325..50dba805f0 100644 --- a/packages/fs/tool-fs/package.json +++ b/packages/fs/tool-fs/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/fs/tool-str-replace-editor/package.json b/packages/fs/tool-str-replace-editor/package.json index 935db843f3..7b831e2c48 100644 --- a/packages/fs/tool-str-replace-editor/package.json +++ b/packages/fs/tool-str-replace-editor/package.json @@ -24,6 +24,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/goal/command-goal/package.json b/packages/goal/command-goal/package.json index 8768f3faea..af3503d309 100644 --- a/packages/goal/command-goal/package.json +++ b/packages/goal/command-goal/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/goal/goal-round-driver/package.json b/packages/goal/goal-round-driver/package.json index 0c31c44ff5..e3a475c7d2 100644 --- a/packages/goal/goal-round-driver/package.json +++ b/packages/goal/goal-round-driver/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/goal/goal/package.json b/packages/goal/goal/package.json index 6aaf86841b..48af188478 100644 --- a/packages/goal/goal/package.json +++ b/packages/goal/goal/package.json @@ -42,6 +42,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", diff --git a/packages/goal/tool-goal/package.json b/packages/goal/tool-goal/package.json index 5d435f756d..97dd70ce74 100644 --- a/packages/goal/tool-goal/package.json +++ b/packages/goal/tool-goal/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/guard/repeat-tool-reminder/package.json b/packages/guard/repeat-tool-reminder/package.json index 768dc9fce4..24d36a8ad9 100644 --- a/packages/guard/repeat-tool-reminder/package.json +++ b/packages/guard/repeat-tool-reminder/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/guard/timeout-policy/package.json b/packages/guard/timeout-policy/package.json index 0a73a9f35c..f45c509f20 100644 --- a/packages/guard/timeout-policy/package.json +++ b/packages/guard/timeout-policy/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/host/directory-picker-auto/package.json b/packages/host/directory-picker-auto/package.json index 5cf701d404..cf13247ba0 100644 --- a/packages/host/directory-picker-auto/package.json +++ b/packages/host/directory-picker-auto/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/host/directory-picker-browse/package.json b/packages/host/directory-picker-browse/package.json index dd7ba06db4..63c5c69623 100644 --- a/packages/host/directory-picker-browse/package.json +++ b/packages/host/directory-picker-browse/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/host/directory-picker-native/package.json b/packages/host/directory-picker-native/package.json index 0eac59940f..bb08985bd0 100644 --- a/packages/host/directory-picker-native/package.json +++ b/packages/host/directory-picker-native/package.json @@ -30,6 +30,7 @@ "lib/worker.cjs", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/host/directory-picker/package.json b/packages/host/directory-picker/package.json index 25336edb88..1f9c9c7909 100644 --- a/packages/host/directory-picker/package.json +++ b/packages/host/directory-picker/package.json @@ -30,6 +30,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/host/frontend-static/package.json b/packages/host/frontend-static/package.json index 340f90aafc..fdb1c30292 100644 --- a/packages/host/frontend-static/package.json +++ b/packages/host/frontend-static/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/host/open-in-app/package.json b/packages/host/open-in-app/package.json index 4f5ac03af2..356d760753 100644 --- a/packages/host/open-in-app/package.json +++ b/packages/host/open-in-app/package.json @@ -30,6 +30,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "scripts": { diff --git a/packages/host/plugin-inventory/package.json b/packages/host/plugin-inventory/package.json index 6866a73d15..8bb14b5536 100644 --- a/packages/host/plugin-inventory/package.json +++ b/packages/host/plugin-inventory/package.json @@ -38,6 +38,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", diff --git a/packages/host/product-telemetry-otel/package.json b/packages/host/product-telemetry-otel/package.json index c4df33880d..e91e51f4f2 100644 --- a/packages/host/product-telemetry-otel/package.json +++ b/packages/host/product-telemetry-otel/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/host/webserver/package.json b/packages/host/webserver/package.json index 937e784b2f..d8dab05ab1 100644 --- a/packages/host/webserver/package.json +++ b/packages/host/webserver/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/identity/anonymous-user-id/package.json b/packages/identity/anonymous-user-id/package.json index 343a2e0129..8e823db394 100644 --- a/packages/identity/anonymous-user-id/package.json +++ b/packages/identity/anonymous-user-id/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/interaction/commands/package.json b/packages/interaction/commands/package.json index 1438b1ba34..76f07d8b32 100644 --- a/packages/interaction/commands/package.json +++ b/packages/interaction/commands/package.json @@ -42,6 +42,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", diff --git a/packages/interaction/permission-presets/package.json b/packages/interaction/permission-presets/package.json index 02574196ce..46c7492160 100644 --- a/packages/interaction/permission-presets/package.json +++ b/packages/interaction/permission-presets/package.json @@ -42,6 +42,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", diff --git a/packages/interaction/tool-ask-user/package.json b/packages/interaction/tool-ask-user/package.json index be03b9753b..60e9061b0f 100644 --- a/packages/interaction/tool-ask-user/package.json +++ b/packages/interaction/tool-ask-user/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/interaction/user-approval/package.json b/packages/interaction/user-approval/package.json index 892822c325..5e6a9f1473 100644 --- a/packages/interaction/user-approval/package.json +++ b/packages/interaction/user-approval/package.json @@ -30,6 +30,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/interaction/user-questions/package.json b/packages/interaction/user-questions/package.json index 32a5e187f5..7cd34e2a8b 100644 --- a/packages/interaction/user-questions/package.json +++ b/packages/interaction/user-questions/package.json @@ -38,6 +38,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", diff --git a/packages/jobs/jobs-local/package.json b/packages/jobs/jobs-local/package.json index 2ec47820ee..91da4a53ce 100644 --- a/packages/jobs/jobs-local/package.json +++ b/packages/jobs/jobs-local/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/jobs/jobs/package.json b/packages/jobs/jobs/package.json index 583262031c..d567ada934 100644 --- a/packages/jobs/jobs/package.json +++ b/packages/jobs/jobs/package.json @@ -34,6 +34,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/jobs/tool-jobs/package.json b/packages/jobs/tool-jobs/package.json index ddb327ed01..c824d667f3 100644 --- a/packages/jobs/tool-jobs/package.json +++ b/packages/jobs/tool-jobs/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/llm/deepseek-llm-api-extensions/package.json b/packages/llm/deepseek-llm-api-extensions/package.json index b0cfbfe34b..7c3f186669 100644 --- a/packages/llm/deepseek-llm-api-extensions/package.json +++ b/packages/llm/deepseek-llm-api-extensions/package.json @@ -30,6 +30,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/llm/llm-deepseek-account/package.json b/packages/llm/llm-deepseek-account/package.json index eb845ebf0f..ee7238864c 100644 --- a/packages/llm/llm-deepseek-account/package.json +++ b/packages/llm/llm-deepseek-account/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/llm/llm-deepseek-api-key/package.json b/packages/llm/llm-deepseek-api-key/package.json index 4f38bd175f..8711aa3073 100644 --- a/packages/llm/llm-deepseek-api-key/package.json +++ b/packages/llm/llm-deepseek-api-key/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/llm/llm-deepseek/package.json b/packages/llm/llm-deepseek/package.json index a063196db7..89805c8de3 100644 --- a/packages/llm/llm-deepseek/package.json +++ b/packages/llm/llm-deepseek/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/llm/llm-pi-ai/package.json b/packages/llm/llm-pi-ai/package.json index f7bd71cf67..203dd57edc 100644 --- a/packages/llm/llm-pi-ai/package.json +++ b/packages/llm/llm-pi-ai/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/llm/llm-retry/package.json b/packages/llm/llm-retry/package.json index ace74cef77..7403df8116 100644 --- a/packages/llm/llm-retry/package.json +++ b/packages/llm/llm-retry/package.json @@ -29,6 +29,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/llm/llm/package.json b/packages/llm/llm/package.json index fd795473b1..fc32fb2a37 100644 --- a/packages/llm/llm/package.json +++ b/packages/llm/llm/package.json @@ -50,6 +50,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", diff --git a/packages/llm/plugin-package-inventory-deepseek/package.json b/packages/llm/plugin-package-inventory-deepseek/package.json index 7b44e081a0..2aff06d58f 100644 --- a/packages/llm/plugin-package-inventory-deepseek/package.json +++ b/packages/llm/plugin-package-inventory-deepseek/package.json @@ -30,6 +30,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/llm/token-meter/package.json b/packages/llm/token-meter/package.json index b6deb61092..da3d59b940 100644 --- a/packages/llm/token-meter/package.json +++ b/packages/llm/token-meter/package.json @@ -34,6 +34,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/lsp/lsp-stdio/package.json b/packages/lsp/lsp-stdio/package.json index c7951b7fe7..100d30ef89 100644 --- a/packages/lsp/lsp-stdio/package.json +++ b/packages/lsp/lsp-stdio/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/lsp/lsp/package.json b/packages/lsp/lsp/package.json index 0e0fc2cd15..0840b8f2ca 100644 --- a/packages/lsp/lsp/package.json +++ b/packages/lsp/lsp/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/lsp/tool-lsp/package.json b/packages/lsp/tool-lsp/package.json index fa1ae3eb6e..982c0b566d 100644 --- a/packages/lsp/tool-lsp/package.json +++ b/packages/lsp/tool-lsp/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/mcp/mcp-client/package.json b/packages/mcp/mcp-client/package.json index bede42eef5..4bf1bde51f 100644 --- a/packages/mcp/mcp-client/package.json +++ b/packages/mcp/mcp-client/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/mcp/mcp-resources/package.json b/packages/mcp/mcp-resources/package.json index 007f95b2ed..f8cf52918d 100644 --- a/packages/mcp/mcp-resources/package.json +++ b/packages/mcp/mcp-resources/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/plan/plan-mode/package.json b/packages/plan/plan-mode/package.json index 39506db035..f702b6d503 100644 --- a/packages/plan/plan-mode/package.json +++ b/packages/plan/plan-mode/package.json @@ -34,6 +34,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/preset/agent-preset-registry/package.json b/packages/preset/agent-preset-registry/package.json index 6d4b08ce46..933f0f2060 100644 --- a/packages/preset/agent-preset-registry/package.json +++ b/packages/preset/agent-preset-registry/package.json @@ -42,6 +42,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", diff --git a/packages/preset/agent-preset/package.json b/packages/preset/agent-preset/package.json index c81c5f53bf..d33f3d9f40 100644 --- a/packages/preset/agent-preset/package.json +++ b/packages/preset/agent-preset/package.json @@ -26,6 +26,7 @@ "skills", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/preset/persona/package.json b/packages/preset/persona/package.json index e075a9451c..b7898304c6 100644 --- a/packages/preset/persona/package.json +++ b/packages/preset/persona/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/ptc-runtime/ptc-runtime-node/package.json b/packages/ptc-runtime/ptc-runtime-node/package.json index 985970c1f0..a556409593 100644 --- a/packages/ptc-runtime/ptc-runtime-node/package.json +++ b/packages/ptc-runtime/ptc-runtime-node/package.json @@ -29,6 +29,7 @@ "lib/process.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/ptc-runtime/ptc-runtime/package.json b/packages/ptc-runtime/ptc-runtime/package.json index 1c9b574c5f..06656c1475 100644 --- a/packages/ptc-runtime/ptc-runtime/package.json +++ b/packages/ptc-runtime/ptc-runtime/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/sandbox/sandbox-local/package.json b/packages/sandbox/sandbox-local/package.json index aa62a7f346..449a12546c 100644 --- a/packages/sandbox/sandbox-local/package.json +++ b/packages/sandbox/sandbox-local/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/sandbox/sandbox-policy/package.json b/packages/sandbox/sandbox-policy/package.json index 01fd4fadf2..ac21da1136 100644 --- a/packages/sandbox/sandbox-policy/package.json +++ b/packages/sandbox/sandbox-policy/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/sandbox/sandbox-windows-acl/package.json b/packages/sandbox/sandbox-windows-acl/package.json index 50bbf248f2..f9f8b2d6eb 100644 --- a/packages/sandbox/sandbox-windows-acl/package.json +++ b/packages/sandbox/sandbox-windows-acl/package.json @@ -32,6 +32,7 @@ "assets", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/sandbox/sandbox/package.json b/packages/sandbox/sandbox/package.json index 7832484f82..cb67f2990c 100644 --- a/packages/sandbox/sandbox/package.json +++ b/packages/sandbox/sandbox/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/schedule/schedule/package.json b/packages/schedule/schedule/package.json index 06c581865d..a734ff99c7 100644 --- a/packages/schedule/schedule/package.json +++ b/packages/schedule/schedule/package.json @@ -40,6 +40,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", diff --git a/packages/schedule/tool-schedule/package.json b/packages/schedule/tool-schedule/package.json index f1aeace930..b46ceeb2c5 100644 --- a/packages/schedule/tool-schedule/package.json +++ b/packages/schedule/tool-schedule/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/sdk/client/package.json b/packages/sdk/client/package.json index 36b69dc026..ec5bfd9443 100644 --- a/packages/sdk/client/package.json +++ b/packages/sdk/client/package.json @@ -24,6 +24,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/sdk/protocol/package.json b/packages/sdk/protocol/package.json index 015ae6f137..9954b04ebe 100644 --- a/packages/sdk/protocol/package.json +++ b/packages/sdk/protocol/package.json @@ -24,6 +24,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/sdk/server/package.json b/packages/sdk/server/package.json index d22b5d50ce..7b12a98734 100644 --- a/packages/sdk/server/package.json +++ b/packages/sdk/server/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/session-query/session-log-export/package.json b/packages/session-query/session-log-export/package.json index 42d5a57a5b..c1b6bc868a 100644 --- a/packages/session-query/session-log-export/package.json +++ b/packages/session-query/session-log-export/package.json @@ -30,6 +30,7 @@ "lib/client.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "scripts": { diff --git a/packages/session-query/session-query-sqlite/package.json b/packages/session-query/session-query-sqlite/package.json index b870decc61..81519eb794 100644 --- a/packages/session-query/session-query-sqlite/package.json +++ b/packages/session-query/session-query-sqlite/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/session-query/session-query/package.json b/packages/session-query/session-query/package.json index 451e2629e9..58051b7e8a 100644 --- a/packages/session-query/session-query/package.json +++ b/packages/session-query/session-query/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/session/session-checkpoint-policy/package.json b/packages/session/session-checkpoint-policy/package.json index 5ffdd494eb..d93c487126 100644 --- a/packages/session/session-checkpoint-policy/package.json +++ b/packages/session/session-checkpoint-policy/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/session/session-format-catalog/package.json b/packages/session/session-format-catalog/package.json index 3784a39249..a83808e66b 100644 --- a/packages/session/session-format-catalog/package.json +++ b/packages/session/session-format-catalog/package.json @@ -30,6 +30,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/session/session-format-v0-to-v1/package.json b/packages/session/session-format-v0-to-v1/package.json index 725b79b2eb..8440b113bd 100644 --- a/packages/session/session-format-v0-to-v1/package.json +++ b/packages/session/session-format-v0-to-v1/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/session/session-format-v1-to-v2/package.json b/packages/session/session-format-v1-to-v2/package.json index 479a05a5d0..f5690db897 100644 --- a/packages/session/session-format-v1-to-v2/package.json +++ b/packages/session/session-format-v1-to-v2/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/session/session-format-v2-to-v3/package.json b/packages/session/session-format-v2-to-v3/package.json index 54ca6aae2d..f3b20ce642 100644 --- a/packages/session/session-format-v2-to-v3/package.json +++ b/packages/session/session-format-v2-to-v3/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/session/session-format-v3-to-v4/package.json b/packages/session/session-format-v3-to-v4/package.json index 761da726bf..9191699421 100644 --- a/packages/session/session-format-v3-to-v4/package.json +++ b/packages/session/session-format-v3-to-v4/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/session/session-format/package.json b/packages/session/session-format/package.json index fb177e97e6..b72cf4cd3b 100644 --- a/packages/session/session-format/package.json +++ b/packages/session/session-format/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/session/session-log-deepseek/package.json b/packages/session/session-log-deepseek/package.json index 6c74e725dd..7a73885d72 100644 --- a/packages/session/session-log-deepseek/package.json +++ b/packages/session/session-log-deepseek/package.json @@ -30,6 +30,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/session/session-persistence-jsonl/package.json b/packages/session/session-persistence-jsonl/package.json index 77d58cfa01..8a89b5beed 100644 --- a/packages/session/session-persistence-jsonl/package.json +++ b/packages/session/session-persistence-jsonl/package.json @@ -26,6 +26,7 @@ "lib/worker.cjs", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/session/session-persistence/package.json b/packages/session/session-persistence/package.json index 2900a4a2a3..d9a72e9cb0 100644 --- a/packages/session/session-persistence/package.json +++ b/packages/session/session-persistence/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/session/session-projection-cache/package.json b/packages/session/session-projection-cache/package.json index cf24b30d98..a3ebfe4e2c 100644 --- a/packages/session/session-projection-cache/package.json +++ b/packages/session/session-projection-cache/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/session/session-projection/package.json b/packages/session/session-projection/package.json index d63b56a026..ede8c2ff5c 100644 --- a/packages/session/session-projection/package.json +++ b/packages/session/session-projection/package.json @@ -30,6 +30,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/session/session-stats/package.json b/packages/session/session-stats/package.json index 878d543def..50caf46ac1 100644 --- a/packages/session/session-stats/package.json +++ b/packages/session/session-stats/package.json @@ -34,6 +34,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/session/session-telemetry-otel/package.json b/packages/session/session-telemetry-otel/package.json index 175e801b56..b0a264e209 100644 --- a/packages/session/session-telemetry-otel/package.json +++ b/packages/session/session-telemetry-otel/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/session/session-telemetry/package.json b/packages/session/session-telemetry/package.json index 573e8f171b..a34a40a12b 100644 --- a/packages/session/session-telemetry/package.json +++ b/packages/session/session-telemetry/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/session/session-title-first-prompt-llm/package.json b/packages/session/session-title-first-prompt-llm/package.json index 3395384ef6..bdc6714774 100644 --- a/packages/session/session-title-first-prompt-llm/package.json +++ b/packages/session/session-title-first-prompt-llm/package.json @@ -20,7 +20,7 @@ }, "./package.json": "./package.json" }, - "files": ["lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", "src"], + "files": ["lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", "lib/**/*.js.map", "src"], "license": "MIT", "peerDependencies": { "@deepseek-ai/dsh-llm": "workspace:*", diff --git a/packages/session/session-title-llm/package.json b/packages/session/session-title-llm/package.json index 95da594832..1a5ce3a82c 100644 --- a/packages/session/session-title-llm/package.json +++ b/packages/session/session-title-llm/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/session/session-title/package.json b/packages/session/session-title/package.json index b545573984..31e91fcc55 100644 --- a/packages/session/session-title/package.json +++ b/packages/session/session-title/package.json @@ -34,6 +34,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/session/session-turn-outline/package.json b/packages/session/session-turn-outline/package.json index ac528a90a1..2a7ae07230 100644 --- a/packages/session/session-turn-outline/package.json +++ b/packages/session/session-turn-outline/package.json @@ -34,6 +34,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/session/tool-working-directory/package.json b/packages/session/tool-working-directory/package.json index db4594b767..cb2c4cbafd 100644 --- a/packages/session/tool-working-directory/package.json +++ b/packages/session/tool-working-directory/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/session/working-directory/package.json b/packages/session/working-directory/package.json index 61a4159008..7052e756b5 100644 --- a/packages/session/working-directory/package.json +++ b/packages/session/working-directory/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/settings/settings/package.json b/packages/settings/settings/package.json index a02ee57b62..401678d966 100644 --- a/packages/settings/settings/package.json +++ b/packages/settings/settings/package.json @@ -30,6 +30,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/shell/bash-local/package.json b/packages/shell/bash-local/package.json index a287353745..895ae4b967 100644 --- a/packages/shell/bash-local/package.json +++ b/packages/shell/bash-local/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/shell/bash-sandbox/package.json b/packages/shell/bash-sandbox/package.json index c49873ba25..8b7b30f1ae 100644 --- a/packages/shell/bash-sandbox/package.json +++ b/packages/shell/bash-sandbox/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/shell/pwsh-local/package.json b/packages/shell/pwsh-local/package.json index 1c99653f6c..d9b704d72e 100644 --- a/packages/shell/pwsh-local/package.json +++ b/packages/shell/pwsh-local/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/shell/pwsh-sandbox/package.json b/packages/shell/pwsh-sandbox/package.json index 7e90ad4256..720ec3f1bc 100644 --- a/packages/shell/pwsh-sandbox/package.json +++ b/packages/shell/pwsh-sandbox/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/shell/shell-env/package.json b/packages/shell/shell-env/package.json index 24275782ac..92459b07da 100644 --- a/packages/shell/shell-env/package.json +++ b/packages/shell/shell-env/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/shell/shell/package.json b/packages/shell/shell/package.json index 64869626ec..37a4582071 100644 --- a/packages/shell/shell/package.json +++ b/packages/shell/shell/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/shell/tool-bash-persistent/package.json b/packages/shell/tool-bash-persistent/package.json index eadf65eead..15480a03f7 100644 --- a/packages/shell/tool-bash-persistent/package.json +++ b/packages/shell/tool-bash-persistent/package.json @@ -24,6 +24,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/shell/tool-bash/package.json b/packages/shell/tool-bash/package.json index 1e7adb6cb2..ff5e76ad77 100644 --- a/packages/shell/tool-bash/package.json +++ b/packages/shell/tool-bash/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/shell/tool-pwsh-persistent/package.json b/packages/shell/tool-pwsh-persistent/package.json index 479bb85878..6673e279d9 100644 --- a/packages/shell/tool-pwsh-persistent/package.json +++ b/packages/shell/tool-pwsh-persistent/package.json @@ -24,6 +24,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/shell/tool-pwsh/package.json b/packages/shell/tool-pwsh/package.json index 265abe2943..ce9e9a4b30 100644 --- a/packages/shell/tool-pwsh/package.json +++ b/packages/shell/tool-pwsh/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/skill/skill-filesystem/package.json b/packages/skill/skill-filesystem/package.json index 893ca65fab..a13a730f24 100644 --- a/packages/skill/skill-filesystem/package.json +++ b/packages/skill/skill-filesystem/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/skill/skill-office/package.json b/packages/skill/skill-office/package.json index 2efa309580..94cd3c5866 100644 --- a/packages/skill/skill-office/package.json +++ b/packages/skill/skill-office/package.json @@ -25,6 +25,7 @@ "assets", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/skill/skill/package.json b/packages/skill/skill/package.json index 59c23bb9bf..2596590c48 100644 --- a/packages/skill/skill/package.json +++ b/packages/skill/skill/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/skill/tool-skill/package.json b/packages/skill/tool-skill/package.json index 1e12f6503f..188a4474b1 100644 --- a/packages/skill/tool-skill/package.json +++ b/packages/skill/tool-skill/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/skill/tool-workspace-dependencies/package.json b/packages/skill/tool-workspace-dependencies/package.json index db102420a0..219fe9f336 100644 --- a/packages/skill/tool-workspace-dependencies/package.json +++ b/packages/skill/tool-workspace-dependencies/package.json @@ -24,6 +24,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/spill/spill-local/package.json b/packages/spill/spill-local/package.json index 0f05232f58..bc7aa42d4d 100644 --- a/packages/spill/spill-local/package.json +++ b/packages/spill/spill-local/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/spill/spill-policy/package.json b/packages/spill/spill-policy/package.json index 37d6a0a693..6623c3bbe4 100644 --- a/packages/spill/spill-policy/package.json +++ b/packages/spill/spill-policy/package.json @@ -30,6 +30,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/spill/spill/package.json b/packages/spill/spill/package.json index c1345ab1b1..3da0c77c25 100644 --- a/packages/spill/spill/package.json +++ b/packages/spill/spill/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/ssh/fs-ssh/package.json b/packages/ssh/fs-ssh/package.json index 9688e2e05d..26ef4a9c88 100644 --- a/packages/ssh/fs-ssh/package.json +++ b/packages/ssh/fs-ssh/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/ssh/sandbox-ssh/package.json b/packages/ssh/sandbox-ssh/package.json index 59491f170e..aad40d7891 100644 --- a/packages/ssh/sandbox-ssh/package.json +++ b/packages/ssh/sandbox-ssh/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/ssh/ssh/package.json b/packages/ssh/ssh/package.json index 9dc1213d83..dab89e61ad 100644 --- a/packages/ssh/ssh/package.json +++ b/packages/ssh/ssh/package.json @@ -43,6 +43,7 @@ "lib/stream-security-*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/ssh/subprocess-ssh/package.json b/packages/ssh/subprocess-ssh/package.json index 849e0fc9bc..13dbdc1332 100644 --- a/packages/ssh/subprocess-ssh/package.json +++ b/packages/ssh/subprocess-ssh/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/storage/storage-domain/package.json b/packages/storage/storage-domain/package.json index 7b6af4bb26..cc286beb47 100644 --- a/packages/storage/storage-domain/package.json +++ b/packages/storage/storage-domain/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/storage/storage-json/package.json b/packages/storage/storage-json/package.json index e0f05739e8..a4006cc8ef 100644 --- a/packages/storage/storage-json/package.json +++ b/packages/storage/storage-json/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/storage/storage-sqlite/package.json b/packages/storage/storage-sqlite/package.json index 4253798329..30588f9bf0 100644 --- a/packages/storage/storage-sqlite/package.json +++ b/packages/storage/storage-sqlite/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/storage/storage/package.json b/packages/storage/storage/package.json index be52b80df7..02effc3eba 100644 --- a/packages/storage/storage/package.json +++ b/packages/storage/storage/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/subagent/subagent-acp/package.json b/packages/subagent/subagent-acp/package.json index cd86d7395c..51a2579ac9 100644 --- a/packages/subagent/subagent-acp/package.json +++ b/packages/subagent/subagent-acp/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/subagent/subagent-claude-code/package.json b/packages/subagent/subagent-claude-code/package.json index 152d97544d..6ce6964667 100644 --- a/packages/subagent/subagent-claude-code/package.json +++ b/packages/subagent/subagent-claude-code/package.json @@ -30,6 +30,7 @@ "cordis.patch.yml", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/subagent/subagent-codex/package.json b/packages/subagent/subagent-codex/package.json index 37bfeed7c1..2c9722993a 100644 --- a/packages/subagent/subagent-codex/package.json +++ b/packages/subagent/subagent-codex/package.json @@ -30,6 +30,7 @@ "cordis.patch.yml", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/subagent/subagent-dsh-sdk/package.json b/packages/subagent/subagent-dsh-sdk/package.json index 1eab960b7b..ab961bcb08 100644 --- a/packages/subagent/subagent-dsh-sdk/package.json +++ b/packages/subagent/subagent-dsh-sdk/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/subagent/subagent-fork-in-process/package.json b/packages/subagent/subagent-fork-in-process/package.json index 280fd497b4..cc4f703cbc 100644 --- a/packages/subagent/subagent-fork-in-process/package.json +++ b/packages/subagent/subagent-fork-in-process/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/subagent/subagent-spawn-in-process/package.json b/packages/subagent/subagent-spawn-in-process/package.json index c29cd5d271..c792a40314 100644 --- a/packages/subagent/subagent-spawn-in-process/package.json +++ b/packages/subagent/subagent-spawn-in-process/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/subagent/subagent/package.json b/packages/subagent/subagent/package.json index 70737dbc74..f09178ea43 100644 --- a/packages/subagent/subagent/package.json +++ b/packages/subagent/subagent/package.json @@ -42,6 +42,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", diff --git a/packages/subagent/tool-subagent-control/package.json b/packages/subagent/tool-subagent-control/package.json index 6714e66c9e..2cc49eba6f 100644 --- a/packages/subagent/tool-subagent-control/package.json +++ b/packages/subagent/tool-subagent-control/package.json @@ -30,6 +30,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/subagent/tool-subagent/package.json b/packages/subagent/tool-subagent/package.json index 20bdf140e1..eb29ca10b3 100644 --- a/packages/subagent/tool-subagent/package.json +++ b/packages/subagent/tool-subagent/package.json @@ -30,6 +30,7 @@ "lib/model-selection-settings.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/subprocess/subprocess-local/package.json b/packages/subprocess/subprocess-local/package.json index 979336b1fc..90c8e19422 100644 --- a/packages/subprocess/subprocess-local/package.json +++ b/packages/subprocess/subprocess-local/package.json @@ -37,6 +37,7 @@ "scripts/ensure-spawn-helper.mjs", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "scripts": { diff --git a/packages/subprocess/subprocess/package.json b/packages/subprocess/subprocess/package.json index da0acd0a67..79ad4c8cbf 100644 --- a/packages/subprocess/subprocess/package.json +++ b/packages/subprocess/subprocess/package.json @@ -30,6 +30,7 @@ "lib/control.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/subprocess/win32-process/package.json b/packages/subprocess/win32-process/package.json index 7346518259..e1d2cb0016 100644 --- a/packages/subprocess/win32-process/package.json +++ b/packages/subprocess/win32-process/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/telemetry/otel/package.json b/packages/telemetry/otel/package.json index 0ba889e06c..d9ba5b65d1 100644 --- a/packages/telemetry/otel/package.json +++ b/packages/telemetry/otel/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/terminal/terminal-bash/package.json b/packages/terminal/terminal-bash/package.json index 587bb0e1f6..af15862dbe 100644 --- a/packages/terminal/terminal-bash/package.json +++ b/packages/terminal/terminal-bash/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/terminal/terminal/package.json b/packages/terminal/terminal/package.json index c79bcc206b..86b6e3b09b 100644 --- a/packages/terminal/terminal/package.json +++ b/packages/terminal/terminal/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/test-support/agent-loop-testkit/package.json b/packages/test-support/agent-loop-testkit/package.json index 969308cb43..eb4a279935 100644 --- a/packages/test-support/agent-loop-testkit/package.json +++ b/packages/test-support/agent-loop-testkit/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/test-support/client-runtime/package.json b/packages/test-support/client-runtime/package.json index 1fa8f15ec7..bb6ed76645 100644 --- a/packages/test-support/client-runtime/package.json +++ b/packages/test-support/client-runtime/package.json @@ -93,6 +93,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/test-support/llm-mock-server/package.json b/packages/test-support/llm-mock-server/package.json index e244027fe4..9822857dec 100644 --- a/packages/test-support/llm-mock-server/package.json +++ b/packages/test-support/llm-mock-server/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/test-support/llm-replay/package.json b/packages/test-support/llm-replay/package.json index 2ae6de0843..0bdaa2f44e 100644 --- a/packages/test-support/llm-replay/package.json +++ b/packages/test-support/llm-replay/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/test-support/loader-smoke/package.json b/packages/test-support/loader-smoke/package.json index 8d4561589d..0da53542a7 100644 --- a/packages/test-support/loader-smoke/package.json +++ b/packages/test-support/loader-smoke/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/test-support/remote-mock/package.json b/packages/test-support/remote-mock/package.json index 2238cf21b8..66e8fc6b85 100644 --- a/packages/test-support/remote-mock/package.json +++ b/packages/test-support/remote-mock/package.json @@ -40,6 +40,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ] } diff --git a/packages/test-support/session-snapshot/package.json b/packages/test-support/session-snapshot/package.json index 13cd49e722..c6f6376e6d 100644 --- a/packages/test-support/session-snapshot/package.json +++ b/packages/test-support/session-snapshot/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/todo/tool-todo/package.json b/packages/todo/tool-todo/package.json index 13f5eb4cdf..94f0856d5c 100644 --- a/packages/todo/tool-todo/package.json +++ b/packages/todo/tool-todo/package.json @@ -30,6 +30,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/typert/generator/README.i18n.yaml b/packages/typert/generator/README.i18n.yaml index b83e755ee4..83bf3128e8 100644 --- a/packages/typert/generator/README.i18n.yaml +++ b/packages/typert/generator/README.i18n.yaml @@ -39,8 +39,8 @@ en: a844aafcafbc27b6 zh: 8efe7d472361bbc2 /deepseek-ai-dsh-typert-generator/understand-the-implementation/emission-and-publication-contract: - en: 2f6f72eecffc33c2 - zh: ded33dbc1d9a4ea5 + en: 0b8a7adb91f66d26 + zh: 09565b09a6de5310 /deepseek-ai-dsh-typert-generator/understand-the-implementation/catalog-projection: en: e85b521a1e01ab2c zh: 4416dca569de0f61 diff --git a/packages/typert/generator/README.md b/packages/typert/generator/README.md index db2dcb1260..92a9a12aa8 100644 --- a/packages/typert/generator/README.md +++ b/packages/typert/generator/README.md @@ -85,7 +85,7 @@ Host and Client are independent TypeScript programs. Direct project references e ### Emission and publication contract -`FaceModelEmitter` emits executable JavaScript containing success-cached Zod schema factories and the `TYPERT` contribution, plus a declaration file whose factories return `z.ZodType` through the package's public export; unsupported Zod projections fail. The Host face with Remote methods additionally emits `typert.remote-client.*` projections of Host Remote contracts for the Client. `WorkspaceTypertGenerator` validates each contributor's `package.json`: `./typert` and `./client/typert` (and `./remote` when Remote methods exist) must point at the exact generated files, and the `files` list must include them. +`FaceModelEmitter` emits executable JavaScript containing success-cached Zod schema factories and the `TYPERT` contribution, plus a declaration file whose factories return `z.ZodType` through the package's public export; unsupported Zod projections fail. The Host face with Remote methods additionally emits `typert.remote-client.*` projections of Host Remote contracts for the Client, including the declaration map its generated declaration references. `WorkspaceTypertGenerator` validates each contributor's `package.json`: `./typert` and `./client/typert` (and `./remote` when Remote methods exist) must point at the exact generated files, and the `files` list must include them. [Unary binary results](../protocol/README.md) are recognized after generic type resolution. Their codecs validate the byte-array type and JSON metadata without iterating, copying, or freezing the byte payload; generated Client declarations retain the authored metadata and narrow the byte backing to `ArrayBuffer`. diff --git a/packages/typert/generator/README.zh.md b/packages/typert/generator/README.zh.md index 694df32bc0..acd7d63088 100644 --- a/packages/typert/generator/README.zh.md +++ b/packages/typert/generator/README.zh.md @@ -85,7 +85,7 @@ Host 与 Client 是两个独立的 TypeScript 程序。直接项目引用确定 ### 生成与发布约定 -`FaceModelEmitter` 输出包含只缓存成功结果的 Zod schema factory 与 `TYPERT` 贡献的可执行 JavaScript,以及把 factory 通过包的公开导出标注为返回 `z.ZodType` 的声明文件;不支持的 Zod 投影会失败。含 Remote 方法的 Host face 还会额外为 Client 生成 Host Remote 约定的 `typert.remote-client.*` 投影。`WorkspaceTypertGenerator` 校验每个贡献方的 `package.json`:`./typert` 与 `./client/typert`(存在 Remote 方法时还有 `./remote`)必须指向精确的生成文件,且 `files` 清单必须包含它们。 +`FaceModelEmitter` 输出包含只缓存成功结果的 Zod schema factory 与 `TYPERT` 贡献的可执行 JavaScript,以及把 factory 通过包的公开导出标注为返回 `z.ZodType` 的声明文件;不支持的 Zod 投影会失败。含 Remote 方法的 Host face 还会额外为 Client 生成 Host Remote 约定的 `typert.remote-client.*` 投影,其中包括生成声明所引用的声明映射。`WorkspaceTypertGenerator` 校验每个贡献方的 `package.json`:`./typert` 与 `./client/typert`(存在 Remote 方法时还有 `./remote`)必须指向精确的生成文件,且 `files` 清单必须包含它们。 [一元二进制结果](../protocol/README.zh.md)在泛型类型解析后被识别。其 codec 校验字节数组类型与 JSON 元数据,不遍历、复制或冻结字节载荷;生成的 Client 声明保留原有元数据类型,并将字节的底层缓冲区收窄为 `ArrayBuffer`。 diff --git a/packages/typert/generator/package.json b/packages/typert/generator/package.json index 8d26526401..55813c0523 100644 --- a/packages/typert/generator/package.json +++ b/packages/typert/generator/package.json @@ -30,6 +30,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/typert/generator/src/workspace.ts b/packages/typert/generator/src/workspace.ts index 50866dc8b1..b1423dbf49 100644 --- a/packages/typert/generator/src/workspace.ts +++ b/packages/typert/generator/src/workspace.ts @@ -120,12 +120,13 @@ export class WorkspaceTypertGenerator { const remoteActual = manifest.exports !== null && typeof manifest.exports === 'object' ? (manifest.exports as Record)['./remote'] : undefined - // The declaration map is emitted beside these two but never published: it - // serves editor navigation in the workspace, where the package link - // resolves its source. + // The generated declaration carries a `sourceMappingURL`, and the payload + // publishes that map beside the `src` it resolves, so an installed consumer + // navigates from the Remote method to the Host implementation. const remoteFiles = [ 'lib/typert.remote-client.js', 'lib/typert.remote-client.d.ts', + 'lib/typert.remote-client.d.ts.map', ] if (artifact.remote === undefined) { if (remoteActual !== undefined || remoteFiles.some(file => files.includes(file))) { diff --git a/packages/typert/generator/tests/fixtures/remote-model/packages/remote/package.json b/packages/typert/generator/tests/fixtures/remote-model/packages/remote/package.json index bfd57762df..b7e0631a0a 100644 --- a/packages/typert/generator/tests/fixtures/remote-model/packages/remote/package.json +++ b/packages/typert/generator/tests/fixtures/remote-model/packages/remote/package.json @@ -18,6 +18,7 @@ "lib/typert.host.js", "lib/typert.host.d.ts", "lib/typert.remote-client.js", - "lib/typert.remote-client.d.ts" + "lib/typert.remote-client.d.ts", + "lib/typert.remote-client.d.ts.map" ] } diff --git a/packages/typert/loader/package.json b/packages/typert/loader/package.json index 48f2885ab7..49c8a93387 100644 --- a/packages/typert/loader/package.json +++ b/packages/typert/loader/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/typert/protocol/package.json b/packages/typert/protocol/package.json index 44af00c2de..eb5ba0b4ff 100644 --- a/packages/typert/protocol/package.json +++ b/packages/typert/protocol/package.json @@ -30,6 +30,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/typert/registry/package.json b/packages/typert/registry/package.json index ebed2e7c1b..0a7172365a 100644 --- a/packages/typert/registry/package.json +++ b/packages/typert/registry/package.json @@ -46,6 +46,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/util/atomic-write/package.json b/packages/util/atomic-write/package.json index 149a1f288a..ecb3c2bbd8 100644 --- a/packages/util/atomic-write/package.json +++ b/packages/util/atomic-write/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/util/brand/package.json b/packages/util/brand/package.json index 55896e2d6a..5fd2eb92ef 100644 --- a/packages/util/brand/package.json +++ b/packages/util/brand/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/util/chunked-list/package.json b/packages/util/chunked-list/package.json index b0e77b3eb5..257bd708be 100644 --- a/packages/util/chunked-list/package.json +++ b/packages/util/chunked-list/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/util/code-language/package.json b/packages/util/code-language/package.json index a404c741a0..268c2b0c1a 100644 --- a/packages/util/code-language/package.json +++ b/packages/util/code-language/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/util/crypto/package.json b/packages/util/crypto/package.json index f1b53840fd..6324b31e9b 100644 --- a/packages/util/crypto/package.json +++ b/packages/util/crypto/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/util/deque/package.json b/packages/util/deque/package.json index ad1d18c407..858f00ed20 100644 --- a/packages/util/deque/package.json +++ b/packages/util/deque/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/util/home-paths/package.json b/packages/util/home-paths/package.json index 57f5e19354..807292dfcb 100644 --- a/packages/util/home-paths/package.json +++ b/packages/util/home-paths/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/util/http-proxy/package.json b/packages/util/http-proxy/package.json index d694d3e2a9..11c4ef6450 100644 --- a/packages/util/http-proxy/package.json +++ b/packages/util/http-proxy/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/util/launch-environment/package.json b/packages/util/launch-environment/package.json index fa2b81dc94..dea18e4f0a 100644 --- a/packages/util/launch-environment/package.json +++ b/packages/util/launch-environment/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/util/lazy-require/package.json b/packages/util/lazy-require/package.json index 2bdc884e7a..3ad6edba74 100644 --- a/packages/util/lazy-require/package.json +++ b/packages/util/lazy-require/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/util/native-command/package.json b/packages/util/native-command/package.json index f40fc60f22..4ff4c9f2c4 100644 --- a/packages/util/native-command/package.json +++ b/packages/util/native-command/package.json @@ -30,6 +30,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/util/output-retention/package.json b/packages/util/output-retention/package.json index 9697bd6c40..8b57900ba6 100644 --- a/packages/util/output-retention/package.json +++ b/packages/util/output-retention/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/util/package-manifest/package.json b/packages/util/package-manifest/package.json index 8d6f82551b..612c46f834 100644 --- a/packages/util/package-manifest/package.json +++ b/packages/util/package-manifest/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/util/time/package.json b/packages/util/time/package.json index 597a7ac897..381356405b 100644 --- a/packages/util/time/package.json +++ b/packages/util/time/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/util/timeout/package.json b/packages/util/timeout/package.json index 1ee6a942fc..fcfc342348 100644 --- a/packages/util/timeout/package.json +++ b/packages/util/timeout/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/util/values/package.json b/packages/util/values/package.json index 0a6f016a1c..86c6c16e0d 100644 --- a/packages/util/values/package.json +++ b/packages/util/values/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/util/workspace-path/package.json b/packages/util/workspace-path/package.json index 6179ad6c3a..eb99527e2c 100644 --- a/packages/util/workspace-path/package.json +++ b/packages/util/workspace-path/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/web/tool-web/package.json b/packages/web/tool-web/package.json index 8f39806314..8f9c8bef55 100644 --- a/packages/web/tool-web/package.json +++ b/packages/web/tool-web/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/web/web-fetch-http/package.json b/packages/web/web-fetch-http/package.json index 963d32b754..39c6fbd372 100644 --- a/packages/web/web-fetch-http/package.json +++ b/packages/web/web-fetch-http/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/web/web-search-deepseek/package.json b/packages/web/web-search-deepseek/package.json index cd2a8c892c..5e3da2a40f 100644 --- a/packages/web/web-search-deepseek/package.json +++ b/packages/web/web-search-deepseek/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/web/web-search-exa/package.json b/packages/web/web-search-exa/package.json index 2c1db818b7..6f5da9d641 100644 --- a/packages/web/web-search-exa/package.json +++ b/packages/web/web-search-exa/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/web/web-search-perplexity/package.json b/packages/web/web-search-perplexity/package.json index 28ac81ee68..5a16985870 100644 --- a/packages/web/web-search-perplexity/package.json +++ b/packages/web/web-search-perplexity/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/web/web/package.json b/packages/web/web/package.json index 6fb833bdd4..264f1e786b 100644 --- a/packages/web/web/package.json +++ b/packages/web/web/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/workflow/tool-workflow/package.json b/packages/workflow/tool-workflow/package.json index c712a18a52..d27e2e2091 100644 --- a/packages/workflow/tool-workflow/package.json +++ b/packages/workflow/tool-workflow/package.json @@ -30,6 +30,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/workflow/workflow-ptc/package.json b/packages/workflow/workflow-ptc/package.json index 6b70347f39..a6a5f2852e 100644 --- a/packages/workflow/workflow-ptc/package.json +++ b/packages/workflow/workflow-ptc/package.json @@ -25,6 +25,7 @@ "lib/index.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/workflow/workflow/package.json b/packages/workflow/workflow/package.json index 86595ac9bd..58e31de588 100644 --- a/packages/workflow/workflow/package.json +++ b/packages/workflow/workflow/package.json @@ -30,6 +30,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/packages/workspace/workspace/package.json b/packages/workspace/workspace/package.json index af0428a440..bdb4947bb7 100644 --- a/packages/workspace/workspace/package.json +++ b/packages/workspace/workspace/package.json @@ -30,6 +30,7 @@ "lib/types/**/*.js", "lib/types/**/*.d.ts", "lib/types/**/*.d.ts.map", + "lib/**/*.js.map", "src" ], "license": "MIT", diff --git a/scripts/build-exe-for-python-sdk.ts b/scripts/build-exe-for-python-sdk.ts index 3fe119d7c6..858f138fef 100644 --- a/scripts/build-exe-for-python-sdk.ts +++ b/scripts/build-exe-for-python-sdk.ts @@ -67,6 +67,13 @@ const ASSET_GLOBS = [ 'node_modules/@deepseek-ai/dsh-sandbox-windows-acl/assets/**/*', ] +/** Published source and documentation: types and maps already describe the runtime, so no load path needs them. */ +const PUBLISHED_PAYLOAD_IGNORES = [ + '**/node_modules/@deepseek-ai/dsh/src/**', + '**/node_modules/@deepseek-ai/dsh-*/src/**', + '**/node_modules/@deepseek-ai/dsh/docs/**', +] + const PLATFORMS = ['linux', 'macos', 'win'] as const const ARCHES = ['x64', 'arm64'] as const type Platform = (typeof PLATFORMS)[number] @@ -380,7 +387,7 @@ class SingleExeBuild { /** Add the executable entry and pkg assets to the staged manifest. */ async injectPkgConfig(): Promise { - const patch = { bin: ENTRY_BIN, pkg: { assets: ASSET_GLOBS, ignore: OFFICE_ASSET_IGNORES } } + const patch = { bin: ENTRY_BIN, pkg: { assets: ASSET_GLOBS, ignore: [...OFFICE_ASSET_IGNORES, ...PUBLISHED_PAYLOAD_IGNORES] } } const manifestPath = join(this.staging, 'package.json') if (this.cli.dryRun) { console.log(`build-exe-for-python-sdk: [dry-run] patch ${manifestPath} with ${JSON.stringify(patch)}`) diff --git a/scripts/check-workspace-constraints.spec.ts b/scripts/check-workspace-constraints.spec.ts index defce2656a..9fc25ea936 100644 --- a/scripts/check-workspace-constraints.spec.ts +++ b/scripts/check-workspace-constraints.spec.ts @@ -293,16 +293,16 @@ describe('package payload constraints', () => { [{ import: './art/icon.svg', default: './art/fallback.svg' }, ['art/icon.svg', 'art/fallback.svg']], [['./art/icon.svg', './art/icon.svg'], ['art/icon.svg']], ] as const)('includes exported icon targets in the canonical payload: %j', (icon, expected) => { - expect(expectedDshPackageFiles({ exports: { './icon': icon } })).toEqual([...expected, 'lib/index.js', 'lib/types/**/*.d.ts', 'lib/types/**/*.d.ts.map', 'src']) + expect(expectedDshPackageFiles({ exports: { './icon': icon } })).toEqual([...expected, 'lib/index.js', 'lib/types/**/*.d.ts', 'lib/types/**/*.d.ts.map', 'lib/**/*.js.map', 'src']) }) it.each(['icon.svg', './icon.svg'])('includes and deduplicates manifest icon %s', (icon) => { - expect(expectedDshPackageFiles({ icon, exports: { './icon': './icon.svg' } })).toEqual(['icon.svg', 'lib/index.js', 'lib/types/**/*.d.ts', 'lib/types/**/*.d.ts.map', 'src']) + expect(expectedDshPackageFiles({ icon, exports: { './icon': './icon.svg' } })).toEqual(['icon.svg', 'lib/index.js', 'lib/types/**/*.d.ts', 'lib/types/**/*.d.ts.map', 'lib/**/*.js.map', 'src']) }) it('includes manifest, root, and subpath icon targets', () => { expect(expectedDshPackageFiles({ icon: './legacy.svg', exports: { './icon': './fallback.svg', './search/icon': './search.svg' } })).toEqual([ - 'legacy.svg', 'fallback.svg', 'search.svg', 'lib/index.js', 'lib/types/**/*.d.ts', 'lib/types/**/*.d.ts.map', 'src', + 'legacy.svg', 'fallback.svg', 'search.svg', 'lib/index.js', 'lib/types/**/*.d.ts', 'lib/types/**/*.d.ts.map', 'lib/**/*.js.map', 'src', ]) }) @@ -323,7 +323,7 @@ describe('package payload constraints', () => { { exports: { './search/locale/*.json': './z/*.json', './locale/*.json': './a/*.json' }, resources: ['a/*.json', 'z/*.json'] }, ])('includes declared locale resources in the canonical payload: $exports', ({ exports, resources }) => { expect(expectedDshPackageFiles({ name: '@deepseek-ai/dsh-localized', exports })).toEqual([ - ...resources, 'lib/index.js', 'lib/types/**/*.d.ts', 'lib/types/**/*.d.ts.map', 'src', + ...resources, 'lib/index.js', 'lib/types/**/*.d.ts', 'lib/types/**/*.d.ts.map', 'lib/**/*.js.map', 'src', ]) }) @@ -336,7 +336,7 @@ describe('package payload constraints', () => { './locale/zh.json': null, './locale/fr.json': { types: './locale/fr.d.ts' }, }, - })).toEqual(['lib/index.js', 'lib/types/**/*.d.ts', 'lib/types/**/*.d.ts.map', 'src']) + })).toEqual(['lib/index.js', 'lib/types/**/*.d.ts', 'lib/types/**/*.d.ts.map', 'lib/**/*.js.map', 'src']) }) it.each(['agent-team', 'agent-team-profile', 'auto-review', 'client-ui-agent-team', 'tool-agent-team'])( @@ -368,6 +368,7 @@ describe('package payload constraints', () => { 'cordis.patch.yml', 'lib/types/**/*.d.ts', 'lib/types/**/*.d.ts.map', + 'lib/**/*.js.map', 'src', ]) expect(expectedDshPackageFiles({ @@ -379,6 +380,7 @@ describe('package payload constraints', () => { 'layers/web.patch.yml', 'lib/types/**/*.d.ts', 'lib/types/**/*.d.ts.map', + 'lib/**/*.js.map', 'src', ]) }) @@ -396,7 +398,7 @@ it('publishes CLI runtime declarations and rejects a payload that omits them', ( const manifest = JSON.parse(readFileSync(new URL('../apps/cli/package.json', import.meta.url), 'utf8')) as WorkspaceManifest['manifest'] expect(checkWorkspaceManifest({ dir: 'apps/cli', manifest })).toEqual([]) expect(checkWorkspaceManifest({ dir: 'apps/cli', manifest: { ...manifest, files: ['lib/*.js'] } })) - .toEqual([expect.stringContaining('@deepseek-ai/dsh: package.json files must be ["lib/*.js","lib/types/*.d.ts","lib/types/*.d.ts.map","docs","src"]')]) + .toEqual([expect.stringContaining('@deepseek-ai/dsh: package.json files must be ["lib/*.js","lib/*.js.map","lib/types/*.d.ts","lib/types/*.d.ts.map","docs","src"]')]) }) it('requires the shared Web injection entry in the published payload', () => { diff --git a/scripts/check-workspace-constraints.ts b/scripts/check-workspace-constraints.ts index 6e08c60aaa..ea6a7238ce 100644 --- a/scripts/check-workspace-constraints.ts +++ b/scripts/check-workspace-constraints.ts @@ -17,7 +17,7 @@ import { EXPERIMENTAL_PACKAGE_NAME_PREFIX, PRIVATE_EXPERIMENTAL_PACKAGE_DIRECTORIES, } from './experimental-package-policy.ts' -import { hasTypertRemoteNavigation, isForbiddenPublicationFile } from './publication-payload.ts' +import { hasTypertRemoteNavigation } from './publication-payload.ts' import type { DshBundleManifest } from '../packages/util/package-manifest/src/types.ts' import { OPTIONAL_BUNDLES, bundlePatchFiles } from '../packages/boot/app-boot/src/profile.ts' import { collectProjectReferenceFaceViolations } from './project-reference-faces.ts' @@ -59,16 +59,15 @@ const standardReleaseMemberDirectory = /^(?:packages\/(?!experimental\/)[^/]+\/[ const desktopApplicationDirectory = 'apps/desktop' const localArtifactDirs = new Set(['node_modules']) const appPackageFiles: Readonly> = { - // `docs` carries the repository's Markdown documentation, staged by - // `scripts/stage-dsh-docs.ts` before packing. - '@deepseek-ai/dsh': ['lib/*.js', 'lib/types/*.d.ts', 'lib/types/*.d.ts.map', 'docs', 'src'], + // Only `prepack` stages `docs`; every other reader of this directory sees + // whatever the checkout holds. + '@deepseek-ai/dsh': ['lib/*.js', 'lib/*.js.map', 'lib/types/*.d.ts', 'lib/types/*.d.ts.map', 'docs', 'src'], '@deepseek-ai/dsh-desktop-host': [ 'lib/index.js', 'lib/cli.js', ], - // Bundled JavaScript maps stay out by payload policy; the worker-preview - // surface (dist/preview.html and dist/preview/) backs opt-in experimental - // packages and is not published. - '@deepseek-ai/dsh-web-frontend': ['dist', '!dist/**/*.map', '!dist/preview.html', '!dist/preview', 'src'], + // The worker-preview surface (dist/preview.html and dist/preview/) backs + // opt-in experimental packages and is not published. + '@deepseek-ai/dsh-web-frontend': ['dist', '!dist/preview.html', '!dist/preview', 'src'], } /** The subset of package.json fields this constraint check cares about. */ @@ -293,6 +292,9 @@ export function expectedDshPackageFiles(manifest: PackageManifest): readonly str // implementation behind an exported declaration, and lets a plugin author // read it without a repository checkout. 'lib/types/**/*.d.ts.map', + // Every emitted map ships beside the JavaScript it describes, so a stack + // frame or a debugger session resolves into the published `src`. + 'lib/**/*.js.map', ...hasExportPair(manifest, './typert', './lib/typert.host.d.ts', './lib/typert.host.js') ? ['lib/typert.host.js', 'lib/typert.host.d.ts'] : [], @@ -465,14 +467,6 @@ export function checkWorkspaceManifest({ dir, manifest }: WorkspaceManifest): st return errors } - if (manifest.name?.startsWith('@deepseek-ai/')) { - for (const file of manifest.files ?? []) { - if (isForbiddenPublicationFile(file)) { - errors.push(`${label}: package.json files must not publish ${JSON.stringify(file)}`) - } - } - } - if (dir.startsWith('apps/') && dir !== desktopApplicationDirectory && manifest.name?.startsWith('@deepseek-ai/')) { const expectedFiles = appPackageFiles[manifest.name] if (expectedFiles === undefined) { diff --git a/scripts/clean.ts b/scripts/clean.ts index bb789f298c..b312577af4 100644 --- a/scripts/clean.ts +++ b/scripts/clean.ts @@ -69,6 +69,8 @@ export class RepositoryCleaner { await this.addIfPresent(targets, join(this.root, '.dsh-build'), canonicalRoot) await this.addIfPresent(targets, join(this.root, 'apps/desktop/.desktop-build'), canonicalRoot) + // The CLI package's documentation copy: `prepack` writes it, `postpack` removes it. + await this.addIfPresent(targets, join(this.root, 'apps/cli/docs'), canonicalRoot) // These checks cover legacy root-level incremental state emitted by older configs. await this.addIfPresent(targets, join(this.root, '.typecheck'), canonicalRoot) diff --git a/scripts/publication-payload.spec.ts b/scripts/publication-payload.spec.ts index e65ff38dc9..85c02d52a9 100644 --- a/scripts/publication-payload.spec.ts +++ b/scripts/publication-payload.spec.ts @@ -1,68 +1,7 @@ import { describe, expect, it } from 'vitest' -import { - hasTypertRemoteNavigation, - isForbiddenPublicationFile, - validateTarballPayload, -} from './publication-payload.ts' - -function validateFixtureTarball(files: readonly string[]): () => void { - return () => { - validateTarballPayload(files, 'fixture.tgz') - } -} - -describe('publication payload policy', () => { - it.each([ - 'lib/index.js', - 'lib/types/index.d.ts', - 'lib/types/index.d.ts.map', - 'lib/typert.remote-client.d.ts.map', - 'lib/styles/base.css', - 'src', - './src', - 'src/', - 'src/index.ts', - './src/index.ts', - String.raw`src\index.ts`, - ])('accepts %s', (file) => { - expect(isForbiddenPublicationFile(file)).toBe(false) - }) - - it.each([ - 'lib/client.js.map', - './lib/client.js.map', - 'lib/types/index.js.map', - String.raw`lib\client.js.map`, - ])('rejects static manifest path %s', (file) => { - expect(isForbiddenPublicationFile(file)).toBe(true) - }) - - it('rejects bundled JavaScript maps in packed tarballs', () => { - expect(validateFixtureTarball([ - 'package/package.json', - 'package/lib/client.js.map', - ])).toThrow('fixture.tgz publishes JavaScript map package/lib/client.js.map') - }) - - it('accepts source, declaration maps, and declarations in packed tarballs', () => { - expect(validateFixtureTarball([ - 'package/package.json', - 'package/src/index.ts', - 'package/lib/types/index.d.ts', - 'package/lib/types/index.d.ts.map', - 'package/lib/typert.remote-client.d.ts.map', - ])).not.toThrow() - }) - - it('accepts a clean packed tarball', () => { - expect(validateFixtureTarball([ - 'package/package.json', - 'package/lib/index.js', - 'package/lib/types/index.d.ts', - 'package/lib/styles/base.css', - ])).not.toThrow() - }) +import { hasTypertRemoteNavigation } from './publication-payload.ts' +describe('publication payload facts', () => { it('recognizes only the canonical Host-for-Client export pair', () => { expect(hasTypertRemoteNavigation({ exports: { @@ -73,5 +12,7 @@ describe('publication payload policy', () => { }, })).toBe(true) expect(hasTypertRemoteNavigation({ exports: { './remote': './lib/remote.js' } })).toBe(false) + expect(hasTypertRemoteNavigation({ exports: { './remote': { types: './lib/typert.remote-client.d.ts' } } })).toBe(false) + expect(hasTypertRemoteNavigation(undefined)).toBe(false) }) }) diff --git a/scripts/publication-payload.ts b/scripts/publication-payload.ts index eeb64f6929..6d61f51145 100644 --- a/scripts/publication-payload.ts +++ b/scripts/publication-payload.ts @@ -1,4 +1,4 @@ -/** Publication payload policy shared by static manifests and packed tarballs. */ +/** Publication payload facts shared by static manifests and packed tarballs. */ /** * Whether a package manifest exports generated Host-for-Client metadata. @@ -15,32 +15,3 @@ export function hasTypertRemoteNavigation(manifest: unknown): boolean { return entry.types === './lib/typert.remote-client.d.ts' && entry.default === './lib/typert.remote-client.js' } - -/** Normalize a package manifest path or npm tarball member to its payload-relative path. */ -function payloadPath(file: string): string { - const normalized = file.replaceAll('\\', '/').replace(/^\.\/+/, '').replace(/\/+$/, '') - return normalized.startsWith('package/') ? normalized.slice('package/'.length) : normalized -} - -/** - * Whether a package payload path exposes JavaScript map intermediates. A - * declaration map pairs with the source and the declaration a consumer - * reaches; a JavaScript map describes bundler output that no published entry - * pairs with, so no payload publishes one. - * @param file - manifest path or tarball member to classify. - * @returns whether publishing this path is forbidden. - */ -export function isForbiddenPublicationFile(file: string): boolean { - return payloadPath(file).endsWith('.js.map') -} - -/** - * Reject bundled JavaScript map members in a packed npm tarball. - * @param files - tarball members to validate. - * @param context - tarball identity named in the failure. - */ -export function validateTarballPayload(files: readonly string[], context: string): void { - for (const file of files) { - if (isForbiddenPublicationFile(file)) throw new Error(`${context} publishes JavaScript map ${file}`) - } -} diff --git a/scripts/publish-npm-baseline.ts b/scripts/publish-npm-baseline.ts index baf51cb112..c37c9dfde5 100644 --- a/scripts/publish-npm-baseline.ts +++ b/scripts/publish-npm-baseline.ts @@ -18,7 +18,6 @@ import { createInterface } from 'node:readline/promises' import { pathToFileURL } from 'node:url' import { parseArgs } from 'node:util' import { discoverNpmBaselineManifests } from './npm-baseline-packages.ts' -import { validateTarballPayload } from './publication-payload.ts' const DEFAULT_REGISTRY = 'https://registry.npm.harnessment.com' const DEFAULT_OUTPUT_DIRECTORY = '.artifacts/npm-baseline' @@ -317,9 +316,6 @@ class ReleaseBundle { if (expected === undefined || !missingNames.delete(artifact.name)) { throw new Error(`unexpected or duplicate packed package: ${artifact.name}`) } - if (expected.origin === 'harness') { - validateTarballPayload(artifact.files, tarball) - } if (artifact.version !== version) { throw new Error(`${tarball} has version ${artifact.version}; expected ${version}`) } @@ -393,9 +389,6 @@ class ReleaseBundle { throw new Error(`tarball checksum mismatch: ${pkg.tarball}`) } const artifact = inspectTarball(path, runner) - if (pkg.origin === 'harness') { - validateTarballPayload(artifact.files, pkg.tarball) - } if (artifact.name !== pkg.name || artifact.version !== this.manifest.version) { throw new Error(`tarball identity mismatch: ${pkg.tarball}`) } diff --git a/scripts/release/families.spec.ts b/scripts/release/families.spec.ts index 7cfb5935d7..5aed768de3 100644 --- a/scripts/release/families.spec.ts +++ b/scripts/release/families.spec.ts @@ -381,15 +381,13 @@ describe('release families', () => { ]) }) - it('applies the harness payload policy to dsh and keeps upstream payloads for vendored packages', () => { + it('accepts the harness payload and keeps upstream payloads for vendored packages', () => { const dsh = releaseFamily('dsh') const vendor = releaseFamily('vendor') const harness = member('packages/a/library', '@deepseek-ai/dsh-library') const vendored = member('vendor/cordis', '@deepseek-ai/cordis') - expect(() => { dsh.validatePayload(harness, ['package/lib/index.js', 'package/lib/client.js.map']) }) - .toThrow(/publishes JavaScript map/) - expect(() => { dsh.validatePayload(harness, ['package/lib/index.js', 'package/src/index.ts']) }).not.toThrow() + expect(() => { dsh.validatePayload(harness, ['package/lib/index.js', 'package/lib/index.js.map', 'package/src/index.ts']) }).not.toThrow() expect(() => { vendor.validatePayload(vendored, ['package/lib/index.js', 'package/src/index.ts']) }).not.toThrow() expect(() => { vendor.validatePayload(vendored, []) }).toThrow(/empty tarball/) }) diff --git a/scripts/release/families.ts b/scripts/release/families.ts index df4a1fd606..4511a95bdd 100644 --- a/scripts/release/families.ts +++ b/scripts/release/families.ts @@ -15,7 +15,6 @@ import { officialClientBuildEnvironment, readClientBuildRecord, } from '../client-build-environment.ts' -import { validateTarballPayload } from '../publication-payload.ts' import { ON_DEMAND_BUNDLES } from '../../packages/boot/app-boot/src/official-bundle-packages.ts' /** @@ -387,15 +386,14 @@ class DshFamily extends ReleaseFamily { } /** - * Reject bundled JavaScript maps, and require the installed package to carry - * the documentation and source its manifest promises. `docs` exists only - * because `prepack` stages it, so a pack run that skips lifecycle scripts - * would otherwise publish the package without it. + * Require the installed package to carry the documentation and source its + * manifest promises. `docs` exists only because `prepack` stages it, and a + * stale tree in the checkout would satisfy a weaker check, so the staged + * copy must be complete for the pack that publishes it. * @param member - the packed member. * @param files - every path inside its tarball. */ validatePayload(member: ReleaseMember, files: readonly string[]): void { - validateTarballPayload(files, member.name) if (member.name !== this.installedEntry.packageName) return if (!files.some(file => file.startsWith('package/docs/') && file.endsWith('.md'))) { throw new Error(`${member.name} packed no documentation`) @@ -456,8 +454,7 @@ class VendorFamily extends ReleaseFamily { } /** - * Require the payload the vendored manifest declares, including upstream's - * `src` tree and declaration maps. + * Accept upstream's payload. * * Upstream's manifest owns that payload, so this family enforces no shape of * its own beyond a nonempty tarball. What must hold is that every path the diff --git a/scripts/stage-dsh-docs.spec.ts b/scripts/stage-dsh-docs.spec.ts index e2f6d7d3fa..cd93267ce9 100644 --- a/scripts/stage-dsh-docs.spec.ts +++ b/scripts/stage-dsh-docs.spec.ts @@ -2,7 +2,7 @@ import { existsSync, mkdtempSync, mkdirSync, rmSync, writeFileSync } from 'node: import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, describe, expect, it } from 'vitest' -import { stageDshDocs } from './stage-dsh-docs.ts' +import { cleanStagedDshDocs, publishedDocuments, stageDshDocs } from './stage-dsh-docs.ts' const roots: string[] = [] @@ -23,25 +23,28 @@ afterEach(() => { }) describe('documentation staging', () => { - it('copies reader-facing documents and assets without the tooling-owned records', async () => { + it('copies published pages and assets without the internal trees', async () => { const source = join(temporaryRoot(), 'docs') const destination = join(temporaryRoot(), 'cli', 'docs') + const published = new Set(['guide/index.md', 'guide/index.zh.md']) write(source, 'guide/index.md') write(source, 'guide/index.zh.md') write(source, 'guide/index.i18n.yaml') write(source, 'images/diagram.png', 'png') - write(source, 'persistence-changes/v1/changes.md') - write(source, 'persistence-changes/README.md') + write(source, 'postmortem/incident.md') write(source, 'AGENTS.md') + write(source, 'persistence-changes/v1/changes.md') + write(source, 'persistence-changes/v1/record.json') + write(source, 'i18n/terminology.md') - await stageDshDocs(source, destination) + await stageDshDocs(source, destination, published) expect(existsSync(join(destination, 'guide', 'index.md'))).toBe(true) expect(existsSync(join(destination, 'guide', 'index.zh.md'))).toBe(true) expect(existsSync(join(destination, 'images', 'diagram.png'))).toBe(true) - expect(existsSync(join(destination, 'AGENTS.md'))).toBe(true) - expect(existsSync(join(destination, 'guide', 'index.i18n.yaml'))).toBe(false) - expect(existsSync(join(destination, 'persistence-changes'))).toBe(false) + for (const excluded of ['guide/index.i18n.yaml', 'postmortem', 'AGENTS.md', 'persistence-changes', 'i18n']) { + expect(existsSync(join(destination, excluded))).toBe(false) + } }) it('replaces a previous copy instead of merging into it', async () => { @@ -50,9 +53,28 @@ describe('documentation staging', () => { write(source, 'kept.md') write(destination, 'removed.md') - await stageDshDocs(source, destination) + await stageDshDocs(source, destination, new Set(['kept.md'])) expect(existsSync(join(destination, 'kept.md'))).toBe(true) expect(existsSync(join(destination, 'removed.md'))).toBe(false) }) + + it('removes a staged copy', async () => { + const destination = join(temporaryRoot(), 'cli', 'docs') + write(destination, 'architecture.md') + + await cleanStagedDshDocs(destination) + + expect(existsSync(destination)).toBe(false) + }) + + it('publishes the website manifest pages and no internal document', () => { + const published = publishedDocuments() + + expect(published.has('architecture.md')).toBe(true) + expect(published.has('architecture.zh.md')).toBe(true) + for (const excluded of ['AGENTS.md', 'testing.md', 'postmortem/README.md', 'persistence-changes/README.md', 'i18n/README.md']) { + expect(published.has(excluded)).toBe(false) + } + }) }) diff --git a/scripts/stage-dsh-docs.ts b/scripts/stage-dsh-docs.ts index ebaec604c7..90b1cb75f0 100644 --- a/scripts/stage-dsh-docs.ts +++ b/scripts/stage-dsh-docs.ts @@ -1,49 +1,95 @@ -/** Stage the reader-facing documentation inside the published `dsh` package. */ +/** Stage the documentation the website publishes inside the published `dsh` package. */ -import { cp, rm } from 'node:fs/promises' -import { join, relative, sep } from 'node:path' +import { cp, mkdir, readdir, rm } from 'node:fs/promises' +import { dirname, join } from 'node:path' import { fileURLToPath } from 'node:url' +import { docsPages } from '../website/docs.ts' /** Repository root, resolved from this script rather than the invoking directory. */ const REPOSITORY_ROOT = fileURLToPath(new URL('..', import.meta.url)) -/** Generated per-release migration records; an installed package carries the current contract instead. */ -const EXCLUDED_DIRECTORY = 'persistence-changes' +/** Directory whose contents are published, and the package directory that receives them. */ +const DOCS_DIRECTORY = join(REPOSITORY_ROOT, 'docs') +const STAGED_DIRECTORY = join(REPOSITORY_ROOT, 'apps', 'cli', 'docs') -/** Translation alignment records the documentation gates own; a reader never opens one. */ +/** Generated migration records and the translation guidelines: maintainer material no reader in an installed package needs. */ +const EXCLUDED_DIRECTORIES = ['persistence-changes', 'i18n'] as const + +/** Translation alignment records the documentation gates own. */ const EXCLUDED_SUFFIX = '.i18n.yaml' +/** + * Source-relative Markdown paths the documentation website publishes. + * + * The npm payload and the site carry the same pages, so a new internal + * document under `docs/` reaches neither until the manifest adopts it. + * @returns every manifest source and alias, relative to the documentation root. + */ +export function publishedDocuments(): ReadonlySet { + const published = new Set() + for (const page of docsPages) { + for (const file of [page.source, ...page.sourceAliases ?? []]) { + if (file.startsWith('docs/')) published.add(file.slice('docs/'.length)) + } + } + return published +} + /** * Replace a package's `docs` directory with the documentation a reader needs. * - * Runs from the `prepack` lifecycle of `@deepseek-ai/dsh`, so packing the - * package and packing the release set both publish the same Markdown. + * The copy follows the working tree, so a pack publishes the `docs/` contents + * the checkout holds rather than the committed tree. Runs from the `prepack` + * lifecycle of `@deepseek-ai/dsh`, so packing the package and packing the + * release set both publish the same pages. * @param source - Documentation root to copy; defaults to the repository `docs`. * @param destination - Package directory to replace; defaults to `apps/cli/docs`. + * @param published - Source-relative Markdown paths to keep; defaults to the website manifest. * @returns Resolves after the destination holds the filtered copy. */ export async function stageDshDocs( - source: string = join(REPOSITORY_ROOT, 'docs'), - destination: string = join(REPOSITORY_ROOT, 'apps', 'cli', 'docs'), + source: string = DOCS_DIRECTORY, + destination: string = STAGED_DIRECTORY, + published: ReadonlySet = publishedDocuments(), ): Promise { await rm(destination, { recursive: true, force: true }) - await cp(source, destination, { - recursive: true, - filter: entry => !isExcluded(source, entry), - }) + for (const file of await stagedFiles(source, published)) { + const target = join(destination, file) + await mkdir(dirname(target), { recursive: true }) + await cp(join(source, file), target) + } } /** - * Whether one source path is tooling-owned or generated rather than reader-facing. - * @param source - Documentation root the entry belongs to. - * @param entry - Absolute source path offered to the copy filter. - * @returns whether the copy skips this entry. + * Remove a staged copy, so no pack leaves a stale tree for the next one. + * @param destination - Package directory to remove; defaults to `apps/cli/docs`. + * @returns Resolves after the directory is absent. */ -function isExcluded(source: string, entry: string): boolean { - const path = relative(source, entry).split(sep).join('/') - return path === EXCLUDED_DIRECTORY - || path.startsWith(`${EXCLUDED_DIRECTORY}/`) - || path.endsWith(EXCLUDED_SUFFIX) +export async function cleanStagedDshDocs(destination: string = STAGED_DIRECTORY): Promise { + await rm(destination, { recursive: true, force: true }) } -if (import.meta.main) await stageDshDocs() +/** + * List the files one stage publishes, in stable path order. + * @param source - Documentation root to walk. + * @param published - Source-relative Markdown paths to keep. + * @returns source-relative POSIX paths of every published file. + */ +async function stagedFiles(source: string, published: ReadonlySet): Promise { + const files: string[] = [] + const walk = async (directory: string): Promise => { + for (const entry of await readdir(join(source, directory), { withFileTypes: true })) { + const path = directory === '' ? entry.name : `${directory}/${entry.name}` + if (EXCLUDED_DIRECTORIES.some(excluded => path === excluded || path.startsWith(`${excluded}/`))) continue + if (entry.isDirectory()) await walk(path) + else if (!path.endsWith(EXCLUDED_SUFFIX) && (!path.endsWith('.md') || published.has(path))) files.push(path) + } + } + await walk('') + return files.sort() +} + +if (import.meta.main) { + if (process.argv.includes('--clean')) await cleanStagedDshDocs() + else await stageDshDocs() +} diff --git a/tsdown.config.ts b/tsdown.config.ts index c378de376a..6c7396eb77 100644 --- a/tsdown.config.ts +++ b/tsdown.config.ts @@ -30,6 +30,9 @@ export default defineConfig(({ env }) => { fixedExtension: false, dts: false, clean: false, + // Published packages carry their source and its maps, so the shipped + // JavaScript is compressed for size and identifier names stay readable. + minify: { compress: true, mangle: false }, plugins: client ? [] : [typertPlugin({ mode: 'workspace', faces: ['host'] })], } }) From 8890ac370528bb8028ca3cd0c8d307b601da4b56 Mon Sep 17 00:00:00 2001 From: turtle1999 Date: Thu, 8 Oct 2026 20:20:54 +0800 Subject: [PATCH 003/322] fix(release): keep node bundles readable for the worker image The browser worker image lowers `yield*` only as a whole statement and rewrites `for await` loops by their source layout, so compressed node-side entries either fail that lowering or lower to unparseable code. Only the browser bundles keep compression, which removes about a third of their text. The bundle-purity assertion now matches the module-loader call regardless of the quote style compression picks, and the release-pack fixture exercises the installed package's new documentation requirement. --- .../2026-10-08-published-source-and-docs.i18n.yaml | 12 ++++++------ .../process/2026-10-08-published-source-and-docs.md | 6 +++--- .../2026-10-08-published-source-and-docs.zh.md | 6 +++--- packages/client/tsdown.client.ts | 9 ++++++--- scripts/client-bundle-purity.spec.ts | 5 +++-- scripts/release/pack.spec.ts | 10 ++++++---- tsdown.config.ts | 3 --- 7 files changed, 27 insertions(+), 24 deletions(-) diff --git a/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.i18n.yaml b/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.i18n.yaml index 3be3da2012..738efe10c6 100644 --- a/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.i18n.yaml +++ b/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.i18n.yaml @@ -9,11 +9,11 @@ en: 699d35bd0bb12645 zh: c9e362c336c6b440 /agent-note-published-source-maps-and-documentation/decision: - en: b5d394bd286b1e2d - zh: f5d3317115442caa + en: 7b0556c6eab6fcf9 + zh: 4788e9a4ebb9d528 /agent-note-published-source-maps-and-documentation/alternatives-considered: - en: 0bcc1a6864bcb340 - zh: ff5d138040563624 + en: a61183c5b42eddba + zh: 031679975ab1f9c7 /agent-note-published-source-maps-and-documentation/consequences: - en: bd76714dd121f9aa - zh: 6d474d6ea90e1b5f + en: 4e7510bd2a14a1bc + zh: b9eb3000268cfd51 diff --git a/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.md b/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.md index 820f84a409..010724b55e 100644 --- a/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.md +++ b/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.md @@ -14,7 +14,7 @@ Every release member publishes its TypeScript source, the declaration maps that [`expectedDshPackageFiles`](../../../../scripts/check-workspace-constraints.ts) lists `lib/types/**/*.d.ts.map`, `lib/**/*.js.map`, and `src`; a package with Typert Remote navigation also lists `lib/typert.remote-client.d.ts.map`, which its generated declaration references through `sourceMappingURL`. No payload member is forbidden, so the static manifest check owns the exact publication list. The `./src/*` export that 315 of the 332 release members declare resolves to those files, which serves editor navigation and reading; plain Node still cannot import them without a TypeScript loader. -The workspace build and the client preset compress every emitted bundle (`minify: { compress: true, mangle: false }`). Identifiers keep their names, so a stack frame and the published map still name the original code. +The client preset compresses the browser bundle's text (`minify: { compress: false, mangle: false }`). Identifiers keep their names, so a stack frame and the published map still name the original code. Node-side entries stay uncompressed: the browser worker image lowers `yield*` only as a whole statement and rewrites `for await` loops by their source layout, and compressed input breaks both. `@deepseek-ai/dsh` stages the documentation website's page set into `apps/cli/docs` from its `prepack` lifecycle through [`scripts/stage-dsh-docs.ts`](../../../../scripts/stage-dsh-docs.ts), which reads the publication manifest in [`website/docs.ts`](../../../../website/docs.ts), and removes that copy again from `postpack`. Non-Markdown assets under `docs/` ship with those pages; the generated `docs/persistence-changes/` records and the `docs/i18n/` guidelines do not. The vendored family keeps upstream's payload unchanged ([release sequences](2026-08-10-npm-release-sequences.md)). @@ -30,11 +30,11 @@ Desktop and the Python single-file executable pay nothing for either addition. [ **Mangle the bundles as well.** Rejected because mangled identifiers break the correspondence a published map exists to provide and make an unhandled stack frame unreadable. -**Compress only `lib/index.js` and `lib/client.js`.** Rejected because one workspace build configuration emits every bundle, and a per-package exception would need a second configuration for no reader-visible gain. +**Compress the node-side entries as well.** Rejected because the browser worker image refuses compressed input: the packer rejects a `yield*` a compressor moved into an expression, and it produces unparseable code for `dsh-agent-instructions`. Both are lowering constraints, not size arguments. ## Consequences -`src` adds about 29 MB and declaration maps about 10 MB across the release set; JavaScript maps add about 49 MB, and the staged documentation adds 5.9 MB to `@deepseek-ai/dsh`. Compression removes roughly half of a host bundle — `dsh-session`'s `lib/index.js` falls from 95 kB to 46 kB — and about a third of a client bundle. The Desktop application and the Python executable keep their previous payload. +`src` adds about 29 MB and declaration maps about 10 MB across the release set; JavaScript maps add about 49 MB, and the staged documentation adds 5.9 MB to `@deepseek-ai/dsh`. Compression removes about a third of a browser bundle — `ui-chat`'s `lib/client.js` falls from 591 kB to 420 kB — while node-side entries keep their size until the worker image lowering accepts compressed input. The Desktop application and the Python executable keep their previous payload. A consumer editor now follows a declaration to the installed implementation, and a plugin author reads that version's documentation without a checkout. The staged copy keeps the repository's relative links, so a link from a shipped page into an unshipped tree — `../packages/**`, or the omitted `persistence-changes/` records — resolves only in a checkout. `docs/` exists in the working tree only between `prepack` and `postpack`, and `pnpm run clean` removes a copy an interrupted pack left behind. diff --git a/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.zh.md b/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.zh.md index 77835c5cba..5b973aac37 100644 --- a/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.zh.md +++ b/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.zh.md @@ -14,7 +14,7 @@ Status: implemented [`expectedDshPackageFiles`](../../../../scripts/check-workspace-constraints.ts) 列出 `lib/types/**/*.d.ts.map`、`lib/**/*.js.map` 与 `src`;带 Typert Remote 导航的包还会列出 `lib/typert.remote-client.d.ts.map`,其生成的声明通过 `sourceMappingURL` 引用该映射。没有任何载荷成员被禁止,发布清单由静态 manifest 检查精确持有。332 个发布成员中已有 315 个声明过 `./src/*`,该导出现在解析到这些文件,服务于编辑器导航与阅读;纯 Node 仍需 TypeScript loader 才能 import 它们。 -工作区构建与 client 预设会压缩每个产出的 bundle(`minify: { compress: true, mangle: false }`)。标识符保持原名,因此栈帧与已发布的 map 仍然指向原始代码。 +client 预设会压缩浏览器 bundle 的文本(`minify: { compress: false, mangle: false }`)。标识符保持原名,因此栈帧与已发布的 map 仍然指向原始代码。Node 侧入口不压缩:浏览器 worker 镜像只把 `yield*` 当作整条语句下沉,并按源码版式重写 `for await` 循环,压缩后的输入会同时破坏这两者。 `@deepseek-ai/dsh` 通过 [`scripts/stage-dsh-docs.ts`](../../../../scripts/stage-dsh-docs.ts) 在自己的 `prepack` 生命周期里把文档网站的页面集合暂存到 `apps/cli/docs`,该脚本读取 [`website/docs.ts`](../../../../website/docs.ts) 中的发布清单,并在 `postpack` 中再次删除这份副本。`docs/` 下的非 Markdown 资产随这些页面一起发布;生成的 `docs/persistence-changes/` 记录与 `docs/i18n/` 规范不发布。vendored 族保持上游 payload 不变([发布序列](2026-08-10-npm-release-sequences.zh.md))。 @@ -30,11 +30,11 @@ Status: implemented **连标识符一起混淆。** 否决:混淆会破坏已发布 map 本应提供的对应关系,并使未处理栈帧无法阅读。 -**只压缩 `lib/index.js` 与 `lib/client.js`。** 否决:一次工作区构建配置产出所有 bundle,为单包开例外需要第二套配置,而读者看不到任何收益。 +**连 Node 侧入口一起压缩。** 否决:浏览器 worker 镜像拒绝压缩后的输入——打包器会拒绝被压缩器挪进表达式的 `yield*`,并且对 `dsh-agent-instructions` 产出无法解析的代码。这两条都是下沉变换的限制,不是体积上的理由。 ## Consequences -`src` 在整个发布集上增加约 29 MB,声明映射增加约 10 MB,JavaScript map 增加约 49 MB,暂存的文档给 `@deepseek-ai/dsh` 增加 5.9 MB。压缩让 host bundle 大约减半——`dsh-session` 的 `lib/index.js` 从 95 kB 降到 46 kB——client bundle 约减少三分之一。桌面应用与 Python 可执行体保持原有载荷。 +`src` 在整个发布集上增加约 29 MB,声明映射增加约 10 MB,JavaScript map 增加约 49 MB,暂存的文档给 `@deepseek-ai/dsh` 增加 5.9 MB。压缩让浏览器 bundle 约减少三分之一——`ui-chat` 的 `lib/client.js` 从 591 kB 降到 420 kB——而 Node 侧入口在 worker 镜像接受压缩输入之前保持原体积。桌面应用与 Python 可执行体保持原有载荷。 消费方编辑器现在可以从声明跳转到已安装的实现,插件作者无需检出即可读到该版本的文档。暂存副本保留仓库的相对链接,因此从随包页面指向未随包目录的链接——`../packages/**`,或被排除的 `persistence-changes/` 记录——只在检出中可解析。`docs/` 只在 `prepack` 与 `postpack` 之间存在于工作树,`pnpm run clean` 会清掉被中断的打包留下的副本。 diff --git a/packages/client/tsdown.client.ts b/packages/client/tsdown.client.ts index e76c9c3fe3..795ce96711 100644 --- a/packages/client/tsdown.client.ts +++ b/packages/client/tsdown.client.ts @@ -486,9 +486,12 @@ function clientConfig(id: string, entry: string, clientBanner?: (fileName: strin // Plugin code is fetched outside Vite's module graph, so its own bundle // must carry the TS/TSX mapping consumed by browser profiling tools. sourcemap: true, - // Compress only: identifier names stay readable in the shipped bundle, - // and the source map still resolves through the published `src`. - minify: { compress: true, mangle: false }, + // Compress the browser bundle's text while identifier names stay readable + // and the source map still resolves through the published `src`. The + // compressor stays off: the browser worker image lowers `yield*` only as a + // whole statement, and a compressor that folds statements into expressions + // hides it. + minify: { compress: false, mangle: false }, clean: false, deps: { neverBundle: isRequested, diff --git a/scripts/client-bundle-purity.spec.ts b/scripts/client-bundle-purity.spec.ts index b172dab5f4..a7d91d0b3d 100644 --- a/scripts/client-bundle-purity.spec.ts +++ b/scripts/client-bundle-purity.spec.ts @@ -76,8 +76,9 @@ describe('client bundle dynamic imports', () => { }) const chunks = builds.flatMap(bundle => bundle.chunks).filter(chunk => chunk.type === 'chunk') const output = chunks.find(chunk => chunk.fileName === 'client.js')?.code - expect(output).toContain('require.async("./client.terminal.js")') - expect(output).not.toContain('Promise.resolve().then(() => require("./client.terminal.js"))') + // The compressor rewrites string literals, so the quotes are not part of the contract. + expect(output).toMatch(/require\.async\((["'`])\.\/client\.terminal\.js\1\)/) + expect(output).not.toMatch(/Promise\.resolve\(\)\.then\(\(\)\s*=>\s*require\((["'`])\.\/client\.terminal\.js\1\)\)/) } finally { for (const bundle of builds) await bundle[Symbol.asyncDispose]() } diff --git a/scripts/release/pack.spec.ts b/scripts/release/pack.spec.ts index 444ce5ddf8..48a4723512 100644 --- a/scripts/release/pack.spec.ts +++ b/scripts/release/pack.spec.ts @@ -307,16 +307,18 @@ describe('release pack CLI', () => { it('validates every parallel tarball before recording the publish order', async () => { const root = fixture() packageFixture(root, 'packages/util/alpha', '@deepseek-ai/alpha') - packageFixture(root, 'packages/util/zebra', '@deepseek-ai/zebra', { files: ['lib/index.js', 'lib/client.js.map'] }) - write(join(root, 'packages/util/zebra/lib/client.js.map'), '{"version":3}\n') + packageFixture(root, 'apps/cli', '@deepseek-ai/dsh', { files: ['lib/index.js', 'src/bin.ts'] }) + packageFixture(root, 'packages/subagent/subagent-claude-code', '@deepseek-ai/dsh-subagent-claude-code') + packageFixture(root, 'packages/subagent/subagent-codex', '@deepseek-ai/dsh-subagent-codex') + write(join(root, 'apps/cli/src/bin.ts'), 'export const bin = 1\n') write(join(root, 'apps/web/dist/index.html'), '
') writeClientBuildRecord(root, officialClientBuildEnvironment(root, { DSH_CLIENT_COMMIT_HASH: commit })) const result = await runPack(root, ['--family', 'dsh', '--concurrency', '8']) expect(result.status).not.toBe(0) - expect(result.stderr).toContain('@deepseek-ai/zebra publishes JavaScript map package/lib/client.js.map') - expect(readdirSync(join(root, 'packed')).filter(name => name.endsWith('.tgz'))).toHaveLength(2) + expect(result.stderr).toContain('@deepseek-ai/dsh packed no documentation') + expect(readdirSync(join(root, 'packed')).filter(name => name.endsWith('.tgz'))).toHaveLength(4) expect(existsSync(join(root, 'packed', PUBLISH_ORDER_FILE))).toBe(false) }) diff --git a/tsdown.config.ts b/tsdown.config.ts index 6c7396eb77..c378de376a 100644 --- a/tsdown.config.ts +++ b/tsdown.config.ts @@ -30,9 +30,6 @@ export default defineConfig(({ env }) => { fixedExtension: false, dts: false, clean: false, - // Published packages carry their source and its maps, so the shipped - // JavaScript is compressed for size and identifier names stay readable. - minify: { compress: true, mangle: false }, plugins: client ? [] : [typertPlugin({ mode: 'workspace', faces: ['host'] })], } }) From 7613702164df8de2fa551c6baa0fb3ac69aa9e56 Mon Sep 17 00:00:00 2001 From: turtle1999 Date: Wed, 14 Oct 2026 12:22:20 +0800 Subject: [PATCH 004/322] feat(release): publish the whole documentation tree `@deepseek-ai/dsh` copies `docs/` in full instead of the website's page set: the maintainer documents, the generated migration records, the translation guidelines, and the `*.i18n.yaml` consistency records ship with the installed package, so the documentation's own links resolve without a checkout. --- ...-10-08-published-source-and-docs.i18n.yaml | 12 ++-- .../2026-10-08-published-source-and-docs.md | 10 +-- ...2026-10-08-published-source-and-docs.zh.md | 10 +-- apps/cli/README.i18n.yaml | 4 +- apps/cli/README.md | 4 +- apps/cli/README.zh.md | 4 +- scripts/stage-dsh-docs.spec.ts | 32 +++------- scripts/stage-dsh-docs.ts | 64 ++----------------- 8 files changed, 39 insertions(+), 101 deletions(-) diff --git a/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.i18n.yaml b/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.i18n.yaml index 738efe10c6..2ce7f727a4 100644 --- a/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.i18n.yaml +++ b/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.i18n.yaml @@ -9,11 +9,11 @@ en: 699d35bd0bb12645 zh: c9e362c336c6b440 /agent-note-published-source-maps-and-documentation/decision: - en: 7b0556c6eab6fcf9 - zh: 4788e9a4ebb9d528 + en: 6aa403f2e4bdccd0 + zh: 21d6471d50f5a859 /agent-note-published-source-maps-and-documentation/alternatives-considered: - en: a61183c5b42eddba - zh: 031679975ab1f9c7 + en: 37ed96ad5fb2c648 + zh: 2481300e7303032c /agent-note-published-source-maps-and-documentation/consequences: - en: 4e7510bd2a14a1bc - zh: b9eb3000268cfd51 + en: 3533c3f170053435 + zh: 6214628847535a3f diff --git a/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.md b/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.md index 010724b55e..2d9173c656 100644 --- a/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.md +++ b/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.md @@ -10,13 +10,13 @@ A published `@deepseek-ai/dsh-*` package carried declarations, bundled runtime, ## Decision -Every release member publishes its TypeScript source, the declaration maps that resolve into it, and the JavaScript maps beside the bundles they describe. `@deepseek-ai/dsh` publishes the documentation website's page set, and the build compresses emitted bundles without mangling identifiers. +Every release member publishes its TypeScript source, the declaration maps that resolve into it, and the JavaScript maps beside the bundles they describe. `@deepseek-ai/dsh` publishes the repository `docs/` tree, and the build compresses emitted bundles without mangling identifiers. [`expectedDshPackageFiles`](../../../../scripts/check-workspace-constraints.ts) lists `lib/types/**/*.d.ts.map`, `lib/**/*.js.map`, and `src`; a package with Typert Remote navigation also lists `lib/typert.remote-client.d.ts.map`, which its generated declaration references through `sourceMappingURL`. No payload member is forbidden, so the static manifest check owns the exact publication list. The `./src/*` export that 315 of the 332 release members declare resolves to those files, which serves editor navigation and reading; plain Node still cannot import them without a TypeScript loader. The client preset compresses the browser bundle's text (`minify: { compress: false, mangle: false }`). Identifiers keep their names, so a stack frame and the published map still name the original code. Node-side entries stay uncompressed: the browser worker image lowers `yield*` only as a whole statement and rewrites `for await` loops by their source layout, and compressed input breaks both. -`@deepseek-ai/dsh` stages the documentation website's page set into `apps/cli/docs` from its `prepack` lifecycle through [`scripts/stage-dsh-docs.ts`](../../../../scripts/stage-dsh-docs.ts), which reads the publication manifest in [`website/docs.ts`](../../../../website/docs.ts), and removes that copy again from `postpack`. Non-Markdown assets under `docs/` ship with those pages; the generated `docs/persistence-changes/` records and the `docs/i18n/` guidelines do not. The vendored family keeps upstream's payload unchanged ([release sequences](2026-08-10-npm-release-sequences.md)). +`@deepseek-ai/dsh` copies the repository `docs/` tree into `apps/cli/docs` from its `prepack` lifecycle through [`scripts/stage-dsh-docs.ts`](../../../../scripts/stage-dsh-docs.ts), and removes that copy again from `postpack`. Every file ships: the published pages, the maintainer documents, the generated `docs/persistence-changes/` records, the `docs/i18n/` guidelines, the `*.i18n.yaml` consistency records, and the referenced images. The vendored family keeps upstream's payload unchanged ([release sequences](2026-08-10-npm-release-sequences.md)). Desktop and the Python single-file executable pay nothing for either addition. [Desktop's runtime file policy](../../../../apps/desktop/scripts/runtime-file-policy.ts) omits `src/`, `docs/`, and every map from `@deepseek-ai/dsh*` packages while keeping third-party `src` trees that some of their `main` entries reach, and [`PUBLISHED_PAYLOAD_IGNORES`](../../../../scripts/build-exe-for-python-sdk.ts) excludes the same trees from the executable, so its contents no longer depend on a staged `docs` left in the checkout. @@ -26,7 +26,7 @@ Desktop and the Python single-file executable pay nothing for either addition. [ **Publish maps without `src`.** Rejected because a map whose `sources` are absent resolves nothing, which is exactly the navigation the [Typert Remote design](../architecture/2026-08-02-typert-remote-method-calls.md) requires. -**Publish the whole `docs/` tree.** Rejected because that publishes RFCs, postmortems, testing guides, and maintainer workflows the website manifest deliberately withholds. +**Publish only the website's page set.** Rejected because an installed reader is not the website's reader: the maintainer documents, the migration records, and the translation guidelines are exactly what a plugin author cannot get offline, and a catalog page's link into `persistence-changes/` resolves only when those records ship with it. **Mangle the bundles as well.** Rejected because mangled identifiers break the correspondence a published map exists to provide and make an unhandled stack frame unreadable. @@ -34,8 +34,8 @@ Desktop and the Python single-file executable pay nothing for either addition. [ ## Consequences -`src` adds about 29 MB and declaration maps about 10 MB across the release set; JavaScript maps add about 49 MB, and the staged documentation adds 5.9 MB to `@deepseek-ai/dsh`. Compression removes about a third of a browser bundle — `ui-chat`'s `lib/client.js` falls from 591 kB to 420 kB — while node-side entries keep their size until the worker image lowering accepts compressed input. The Desktop application and the Python executable keep their previous payload. +`src` adds about 29 MB and declaration maps about 10 MB across the release set; JavaScript maps add about 49 MB, and the staged documentation adds 31 MB to `@deepseek-ai/dsh`. Compression removes about a third of a browser bundle — `ui-chat`'s `lib/client.js` falls from 591 kB to 420 kB — while node-side entries keep their size until the worker image lowering accepts compressed input. The Desktop application and the Python executable keep their previous payload. -A consumer editor now follows a declaration to the installed implementation, and a plugin author reads that version's documentation without a checkout. The staged copy keeps the repository's relative links, so a link from a shipped page into an unshipped tree — `../packages/**`, or the omitted `persistence-changes/` records — resolves only in a checkout. `docs/` exists in the working tree only between `prepack` and `postpack`, and `pnpm run clean` removes a copy an interrupted pack left behind. +A consumer editor now follows a declaration to the installed implementation, and a plugin author reads that version's documentation without a checkout. The staged copy keeps the repository's relative links, so a link into `../packages/**` resolves only in a checkout while the documentation's own cross-references stay intact. `docs/` exists in the working tree only between `prepack` and `postpack`, and `pnpm run clean` removes a copy an interrupted pack left behind. `pnpm run constraints` rejects a member whose `files` omits `src` or a map, because the canonical list is exact. The release family's tarball check requires `@deepseek-ai/dsh` to carry documentation and source, so a pack run that skips the staging hook fails instead of publishing without them. diff --git a/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.zh.md b/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.zh.md index 5b973aac37..1d68df2d11 100644 --- a/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.zh.md +++ b/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.zh.md @@ -10,13 +10,13 @@ Status: implemented ## Decision -每个发布成员都发布自己的 TypeScript 源码、能解析到该源码的声明映射,以及紧挨所描述 bundle 的 JavaScript map。`@deepseek-ai/dsh` 另发布文档网站的页面集合,构建也会压缩产出的 bundle,但不混淆标识符。 +每个发布成员都发布自己的 TypeScript 源码、能解析到该源码的声明映射,以及紧挨所描述 bundle 的 JavaScript map。`@deepseek-ai/dsh` 另发布仓库的 `docs/` 树,构建也会压缩产出的 bundle,但不混淆标识符。 [`expectedDshPackageFiles`](../../../../scripts/check-workspace-constraints.ts) 列出 `lib/types/**/*.d.ts.map`、`lib/**/*.js.map` 与 `src`;带 Typert Remote 导航的包还会列出 `lib/typert.remote-client.d.ts.map`,其生成的声明通过 `sourceMappingURL` 引用该映射。没有任何载荷成员被禁止,发布清单由静态 manifest 检查精确持有。332 个发布成员中已有 315 个声明过 `./src/*`,该导出现在解析到这些文件,服务于编辑器导航与阅读;纯 Node 仍需 TypeScript loader 才能 import 它们。 client 预设会压缩浏览器 bundle 的文本(`minify: { compress: false, mangle: false }`)。标识符保持原名,因此栈帧与已发布的 map 仍然指向原始代码。Node 侧入口不压缩:浏览器 worker 镜像只把 `yield*` 当作整条语句下沉,并按源码版式重写 `for await` 循环,压缩后的输入会同时破坏这两者。 -`@deepseek-ai/dsh` 通过 [`scripts/stage-dsh-docs.ts`](../../../../scripts/stage-dsh-docs.ts) 在自己的 `prepack` 生命周期里把文档网站的页面集合暂存到 `apps/cli/docs`,该脚本读取 [`website/docs.ts`](../../../../website/docs.ts) 中的发布清单,并在 `postpack` 中再次删除这份副本。`docs/` 下的非 Markdown 资产随这些页面一起发布;生成的 `docs/persistence-changes/` 记录与 `docs/i18n/` 规范不发布。vendored 族保持上游 payload 不变([发布序列](2026-08-10-npm-release-sequences.zh.md))。 +`@deepseek-ai/dsh` 通过 [`scripts/stage-dsh-docs.ts`](../../../../scripts/stage-dsh-docs.ts) 在自己的 `prepack` 生命周期里把仓库 `docs/` 树整体复制到 `apps/cli/docs`,并在 `postpack` 中再次删除这份副本。所有文件都会发布:已上站的页面、维护者文档、生成的 `docs/persistence-changes/` 记录、`docs/i18n/` 规范、`*.i18n.yaml` 一致性记录,以及被引用的图片。vendored 族保持上游 payload 不变([发布序列](2026-08-10-npm-release-sequences.zh.md))。 桌面版与 Python 单文件可执行体不为这两项新增内容付出代价。桌面的[运行时文件策略](../../../../apps/desktop/scripts/runtime-file-policy.ts)会从 `@deepseek-ai/dsh*` 包中剔除 `src/`、`docs/` 与所有映射,同时保留部分第三方包 `main` 指向的 `src` 树;[`PUBLISHED_PAYLOAD_IGNORES`](../../../../scripts/build-exe-for-python-sdk.ts) 则把这些树排除出可执行体,因此其内容不再取决于检出中是否残留暂存的 `docs`。 @@ -26,7 +26,7 @@ client 预设会压缩浏览器 bundle 的文本(`minify: { compress: false, m **只发布映射,不发布 `src`。** 否决:`sources` 不存在的映射解析不到任何东西,而这正是 [Typert Remote 设计](../architecture/2026-08-02-typert-remote-method-calls.zh.md)所要求的导航。 -**发布整棵 `docs/` 树。** 否决:那会把网站清单刻意不公开的 RFC、事故复盘、测试指南与维护者工作流一并发布。 +**只发布网站页面集合。** 否决:已安装的读者不是网站的读者——维护者文档、迁移记录与翻译规范正是插件作者离线拿不到的部分,而且目录页指向 `persistence-changes/` 的链接只有随记录一起发布才可解析。 **连标识符一起混淆。** 否决:混淆会破坏已发布 map 本应提供的对应关系,并使未处理栈帧无法阅读。 @@ -34,8 +34,8 @@ client 预设会压缩浏览器 bundle 的文本(`minify: { compress: false, m ## Consequences -`src` 在整个发布集上增加约 29 MB,声明映射增加约 10 MB,JavaScript map 增加约 49 MB,暂存的文档给 `@deepseek-ai/dsh` 增加 5.9 MB。压缩让浏览器 bundle 约减少三分之一——`ui-chat` 的 `lib/client.js` 从 591 kB 降到 420 kB——而 Node 侧入口在 worker 镜像接受压缩输入之前保持原体积。桌面应用与 Python 可执行体保持原有载荷。 +`src` 在整个发布集上增加约 29 MB,声明映射增加约 10 MB,JavaScript map 增加约 49 MB,暂存的文档给 `@deepseek-ai/dsh` 增加 31 MB。压缩让浏览器 bundle 约减少三分之一——`ui-chat` 的 `lib/client.js` 从 591 kB 降到 420 kB——而 Node 侧入口在 worker 镜像接受压缩输入之前保持原体积。桌面应用与 Python 可执行体保持原有载荷。 -消费方编辑器现在可以从声明跳转到已安装的实现,插件作者无需检出即可读到该版本的文档。暂存副本保留仓库的相对链接,因此从随包页面指向未随包目录的链接——`../packages/**`,或被排除的 `persistence-changes/` 记录——只在检出中可解析。`docs/` 只在 `prepack` 与 `postpack` 之间存在于工作树,`pnpm run clean` 会清掉被中断的打包留下的副本。 +消费方编辑器现在可以从声明跳转到已安装的实现,插件作者无需检出即可读到该版本的文档。暂存副本保留仓库的相对链接,因此指向 `../packages/**` 的链接只在检出中可解析,而文档自身的交叉引用保持完整。`docs/` 只在 `prepack` 与 `postpack` 之间存在于工作树,`pnpm run clean` 会清掉被中断的打包留下的副本。 `pnpm run constraints` 会拒绝 `files` 中缺少 `src` 或任一声明映射的发布成员,因为该清单是精确匹配的。发布族的 tarball 校验要求 `@deepseek-ai/dsh` 必须带上文档与源码,因此跳过暂存钩子的打包会直接失败,而不是发出一个缺少它们的包。 diff --git a/apps/cli/README.i18n.yaml b/apps/cli/README.i18n.yaml index c62beb75bb..881e2c5c4b 100644 --- a/apps/cli/README.i18n.yaml +++ b/apps/cli/README.i18n.yaml @@ -18,8 +18,8 @@ en: 3a40ddc44e55f79c zh: 8d3949132e1ef93c /deepseek-ai-dsh/installed-payload: - en: 11b7ca48d1da9da3 - zh: 1f909f6bc2e72e14 + en: 9c0e0d0f4d2680e1 + zh: d0a714fe5d909f12 /deepseek-ai-dsh/development: en: 0a289c1235869927 zh: a1f473f70036ad37 diff --git a/apps/cli/README.md b/apps/cli/README.md index 35a2d48424..eb04c5db68 100644 --- a/apps/cli/README.md +++ b/apps/cli/README.md @@ -55,9 +55,9 @@ The [CLI behavior reference](reference/README.md) owns exact layer precedence, f ## Installed payload -The published tarball carries the bundled runtime under `lib/`, the TypeScript under `src/`, the declaration and JavaScript maps beside the files they describe, and the documentation website's page set under `docs/`. Only `prepack` stages `docs/`, and `postpack` removes that copy again, so a reader of the working tree sees whatever the checkout holds. +The published tarball carries the bundled runtime under `lib/`, the TypeScript under `src/`, the declaration and JavaScript maps beside the files they describe, and the repository documentation under `docs/`. Only `prepack` copies `docs/`, and `postpack` removes that copy again, so a reader of the working tree sees whatever the checkout holds. -`docs/` excludes the generated `persistence-changes/` records and the `*.i18n.yaml` consistency records. Its pages keep the repository's relative links, so a link into `../packages/**` or into the omitted `persistence-changes/` tree resolves only in a checkout. +`docs/` is the repository's documentation tree in full, including the generated `persistence-changes/` records, the `i18n/` guidelines, and the `*.i18n.yaml` consistency records. Its pages keep the repository's relative links, so a link into `../packages/**` resolves only in a checkout. ## Development diff --git a/apps/cli/README.zh.md b/apps/cli/README.zh.md index 38a8415371..c26ea2c0d0 100644 --- a/apps/cli/README.zh.md +++ b/apps/cli/README.zh.md @@ -55,9 +55,9 @@ profile 目录包含一个 `package.json`,其中记录树外插件依赖,以 ## 安装包内容 -发布 tarball 在 `lib/` 下携带打包后的运行时,在 `src/` 下携带 TypeScript 源码,在各自描述的文件旁携带声明映射与 JavaScript map,并在 `docs/` 下携带文档网站的页面集合。只有 `prepack` 会暂存 `docs/`,`postpack` 又会删除这份副本,因此工作树里的读者看到的始终是检出当前的内容。 +发布 tarball 在 `lib/` 下携带打包后的运行时,在 `src/` 下携带 TypeScript 源码,在各自描述的文件旁携带声明映射与 JavaScript map,并在 `docs/` 下携带仓库文档。只有 `prepack` 会复制 `docs/`,`postpack` 又会删除这份副本,因此工作树里的读者看到的始终是检出当前的内容。 -`docs/` 不包含生成的 `persistence-changes/` 记录与 `*.i18n.yaml` 一致性记录。其中的页面保留仓库的相对链接,因此指向 `../packages/**` 或指向被排除的 `persistence-changes/` 树的链接只在检出中可解析。 +`docs/` 是仓库文档树的完整副本,包含生成的 `persistence-changes/` 记录、`i18n/` 规范与 `*.i18n.yaml` 一致性记录。其中的页面保留仓库的相对链接,因此指向 `../packages/**` 的链接只在检出中可解析。 ## 开发 diff --git a/scripts/stage-dsh-docs.spec.ts b/scripts/stage-dsh-docs.spec.ts index cd93267ce9..ca9d5c56ab 100644 --- a/scripts/stage-dsh-docs.spec.ts +++ b/scripts/stage-dsh-docs.spec.ts @@ -2,7 +2,7 @@ import { existsSync, mkdtempSync, mkdirSync, rmSync, writeFileSync } from 'node: import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, describe, expect, it } from 'vitest' -import { cleanStagedDshDocs, publishedDocuments, stageDshDocs } from './stage-dsh-docs.ts' +import { cleanStagedDshDocs, stageDshDocs } from './stage-dsh-docs.ts' const roots: string[] = [] @@ -23,27 +23,25 @@ afterEach(() => { }) describe('documentation staging', () => { - it('copies published pages and assets without the internal trees', async () => { + it('copies the complete documentation tree', async () => { const source = join(temporaryRoot(), 'docs') const destination = join(temporaryRoot(), 'cli', 'docs') - const published = new Set(['guide/index.md', 'guide/index.zh.md']) write(source, 'guide/index.md') - write(source, 'guide/index.zh.md') write(source, 'guide/index.i18n.yaml') write(source, 'images/diagram.png', 'png') write(source, 'postmortem/incident.md') write(source, 'AGENTS.md') write(source, 'persistence-changes/v1/changes.md') write(source, 'persistence-changes/v1/record.json') - write(source, 'i18n/terminology.md') - await stageDshDocs(source, destination, published) + await stageDshDocs(source, destination) - expect(existsSync(join(destination, 'guide', 'index.md'))).toBe(true) - expect(existsSync(join(destination, 'guide', 'index.zh.md'))).toBe(true) - expect(existsSync(join(destination, 'images', 'diagram.png'))).toBe(true) - for (const excluded of ['guide/index.i18n.yaml', 'postmortem', 'AGENTS.md', 'persistence-changes', 'i18n']) { - expect(existsSync(join(destination, excluded))).toBe(false) + for (const copied of [ + 'guide/index.md', 'guide/index.i18n.yaml', 'images/diagram.png', + 'postmortem/incident.md', 'AGENTS.md', + 'persistence-changes/v1/changes.md', 'persistence-changes/v1/record.json', + ]) { + expect(existsSync(join(destination, copied)), copied).toBe(true) } }) @@ -53,7 +51,7 @@ describe('documentation staging', () => { write(source, 'kept.md') write(destination, 'removed.md') - await stageDshDocs(source, destination, new Set(['kept.md'])) + await stageDshDocs(source, destination) expect(existsSync(join(destination, 'kept.md'))).toBe(true) expect(existsSync(join(destination, 'removed.md'))).toBe(false) @@ -67,14 +65,4 @@ describe('documentation staging', () => { expect(existsSync(destination)).toBe(false) }) - - it('publishes the website manifest pages and no internal document', () => { - const published = publishedDocuments() - - expect(published.has('architecture.md')).toBe(true) - expect(published.has('architecture.zh.md')).toBe(true) - for (const excluded of ['AGENTS.md', 'testing.md', 'postmortem/README.md', 'persistence-changes/README.md', 'i18n/README.md']) { - expect(published.has(excluded)).toBe(false) - } - }) }) diff --git a/scripts/stage-dsh-docs.ts b/scripts/stage-dsh-docs.ts index 90b1cb75f0..9d16c0f455 100644 --- a/scripts/stage-dsh-docs.ts +++ b/scripts/stage-dsh-docs.ts @@ -1,9 +1,8 @@ -/** Stage the documentation the website publishes inside the published `dsh` package. */ +/** Stage the repository documentation inside the published `dsh` package. */ -import { cp, mkdir, readdir, rm } from 'node:fs/promises' -import { dirname, join } from 'node:path' +import { cp, rm } from 'node:fs/promises' +import { join } from 'node:path' import { fileURLToPath } from 'node:url' -import { docsPages } from '../website/docs.ts' /** Repository root, resolved from this script rather than the invoking directory. */ const REPOSITORY_ROOT = fileURLToPath(new URL('..', import.meta.url)) @@ -12,52 +11,23 @@ const REPOSITORY_ROOT = fileURLToPath(new URL('..', import.meta.url)) const DOCS_DIRECTORY = join(REPOSITORY_ROOT, 'docs') const STAGED_DIRECTORY = join(REPOSITORY_ROOT, 'apps', 'cli', 'docs') -/** Generated migration records and the translation guidelines: maintainer material no reader in an installed package needs. */ -const EXCLUDED_DIRECTORIES = ['persistence-changes', 'i18n'] as const - -/** Translation alignment records the documentation gates own. */ -const EXCLUDED_SUFFIX = '.i18n.yaml' - /** - * Source-relative Markdown paths the documentation website publishes. - * - * The npm payload and the site carry the same pages, so a new internal - * document under `docs/` reaches neither until the manifest adopts it. - * @returns every manifest source and alias, relative to the documentation root. - */ -export function publishedDocuments(): ReadonlySet { - const published = new Set() - for (const page of docsPages) { - for (const file of [page.source, ...page.sourceAliases ?? []]) { - if (file.startsWith('docs/')) published.add(file.slice('docs/'.length)) - } - } - return published -} - -/** - * Replace a package's `docs` directory with the documentation a reader needs. + * Replace a package's `docs` directory with the repository documentation. * * The copy follows the working tree, so a pack publishes the `docs/` contents * the checkout holds rather than the committed tree. Runs from the `prepack` * lifecycle of `@deepseek-ai/dsh`, so packing the package and packing the - * release set both publish the same pages. + * release set both publish the same files. * @param source - Documentation root to copy; defaults to the repository `docs`. * @param destination - Package directory to replace; defaults to `apps/cli/docs`. - * @param published - Source-relative Markdown paths to keep; defaults to the website manifest. - * @returns Resolves after the destination holds the filtered copy. + * @returns Resolves after the destination holds the copy. */ export async function stageDshDocs( source: string = DOCS_DIRECTORY, destination: string = STAGED_DIRECTORY, - published: ReadonlySet = publishedDocuments(), ): Promise { await rm(destination, { recursive: true, force: true }) - for (const file of await stagedFiles(source, published)) { - const target = join(destination, file) - await mkdir(dirname(target), { recursive: true }) - await cp(join(source, file), target) - } + await cp(source, destination, { recursive: true }) } /** @@ -69,26 +39,6 @@ export async function cleanStagedDshDocs(destination: string = STAGED_DIRECTORY) await rm(destination, { recursive: true, force: true }) } -/** - * List the files one stage publishes, in stable path order. - * @param source - Documentation root to walk. - * @param published - Source-relative Markdown paths to keep. - * @returns source-relative POSIX paths of every published file. - */ -async function stagedFiles(source: string, published: ReadonlySet): Promise { - const files: string[] = [] - const walk = async (directory: string): Promise => { - for (const entry of await readdir(join(source, directory), { withFileTypes: true })) { - const path = directory === '' ? entry.name : `${directory}/${entry.name}` - if (EXCLUDED_DIRECTORIES.some(excluded => path === excluded || path.startsWith(`${excluded}/`))) continue - if (entry.isDirectory()) await walk(path) - else if (!path.endsWith(EXCLUDED_SUFFIX) && (!path.endsWith('.md') || published.has(path))) files.push(path) - } - } - await walk('') - return files.sort() -} - if (import.meta.main) { if (process.argv.includes('--clean')) await cleanStagedDshDocs() else await stageDshDocs() From 91e5c46dd65910ef24482d2e2dd53436800d6378 Mon Sep 17 00:00:00 2001 From: turtle1999 Date: Wed, 14 Oct 2026 12:59:30 +0800 Subject: [PATCH 005/322] feat(release): publish the upgrade guides with the documentation The staged documentation keeps the website's page set and adds every `docs/upgrade-guide/` document, which is what an installed reader consults when a released change breaks something. The rest of the maintainer tree stays out. --- ...-10-08-published-source-and-docs.i18n.yaml | 12 +-- .../2026-10-08-published-source-and-docs.md | 10 +-- ...2026-10-08-published-source-and-docs.zh.md | 10 +-- apps/cli/README.i18n.yaml | 4 +- apps/cli/README.md | 4 +- apps/cli/README.zh.md | 4 +- scripts/stage-dsh-docs.spec.ts | 36 +++++++-- scripts/stage-dsh-docs.ts | 80 +++++++++++++++++-- 8 files changed, 124 insertions(+), 36 deletions(-) diff --git a/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.i18n.yaml b/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.i18n.yaml index 2ce7f727a4..eb021f8031 100644 --- a/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.i18n.yaml +++ b/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.i18n.yaml @@ -9,11 +9,11 @@ en: 699d35bd0bb12645 zh: c9e362c336c6b440 /agent-note-published-source-maps-and-documentation/decision: - en: 6aa403f2e4bdccd0 - zh: 21d6471d50f5a859 + en: e7afd5742d502cc4 + zh: 3d66bbf36b373b0d /agent-note-published-source-maps-and-documentation/alternatives-considered: - en: 37ed96ad5fb2c648 - zh: 2481300e7303032c + en: 953acd4b427b6698 + zh: 43426e6213773943 /agent-note-published-source-maps-and-documentation/consequences: - en: 3533c3f170053435 - zh: 6214628847535a3f + en: 9aab6e70f1d6a6a8 + zh: 9837857df3a7c146 diff --git a/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.md b/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.md index 2d9173c656..725753a6b4 100644 --- a/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.md +++ b/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.md @@ -10,13 +10,13 @@ A published `@deepseek-ai/dsh-*` package carried declarations, bundled runtime, ## Decision -Every release member publishes its TypeScript source, the declaration maps that resolve into it, and the JavaScript maps beside the bundles they describe. `@deepseek-ai/dsh` publishes the repository `docs/` tree, and the build compresses emitted bundles without mangling identifiers. +Every release member publishes its TypeScript source, the declaration maps that resolve into it, and the JavaScript maps beside the bundles they describe. `@deepseek-ai/dsh` publishes the documentation website's page set plus the upgrade guides, and the build compresses emitted bundles without mangling identifiers. [`expectedDshPackageFiles`](../../../../scripts/check-workspace-constraints.ts) lists `lib/types/**/*.d.ts.map`, `lib/**/*.js.map`, and `src`; a package with Typert Remote navigation also lists `lib/typert.remote-client.d.ts.map`, which its generated declaration references through `sourceMappingURL`. No payload member is forbidden, so the static manifest check owns the exact publication list. The `./src/*` export that 315 of the 332 release members declare resolves to those files, which serves editor navigation and reading; plain Node still cannot import them without a TypeScript loader. The client preset compresses the browser bundle's text (`minify: { compress: false, mangle: false }`). Identifiers keep their names, so a stack frame and the published map still name the original code. Node-side entries stay uncompressed: the browser worker image lowers `yield*` only as a whole statement and rewrites `for await` loops by their source layout, and compressed input breaks both. -`@deepseek-ai/dsh` copies the repository `docs/` tree into `apps/cli/docs` from its `prepack` lifecycle through [`scripts/stage-dsh-docs.ts`](../../../../scripts/stage-dsh-docs.ts), and removes that copy again from `postpack`. Every file ships: the published pages, the maintainer documents, the generated `docs/persistence-changes/` records, the `docs/i18n/` guidelines, the `*.i18n.yaml` consistency records, and the referenced images. The vendored family keeps upstream's payload unchanged ([release sequences](2026-08-10-npm-release-sequences.md)). +`@deepseek-ai/dsh` stages that set into `apps/cli/docs` from its `prepack` lifecycle through [`scripts/stage-dsh-docs.ts`](../../../../scripts/stage-dsh-docs.ts), and removes the copy again from `postpack`. The set is the website manifest's Markdown, every `docs/upgrade-guide/` document, and the non-Markdown assets those pages reference. The generated `docs/persistence-changes/` records, the `docs/i18n/` guidelines, and the `*.i18n.yaml` consistency records stay out. The vendored family keeps upstream's payload unchanged ([release sequences](2026-08-10-npm-release-sequences.md)). Desktop and the Python single-file executable pay nothing for either addition. [Desktop's runtime file policy](../../../../apps/desktop/scripts/runtime-file-policy.ts) omits `src/`, `docs/`, and every map from `@deepseek-ai/dsh*` packages while keeping third-party `src` trees that some of their `main` entries reach, and [`PUBLISHED_PAYLOAD_IGNORES`](../../../../scripts/build-exe-for-python-sdk.ts) excludes the same trees from the executable, so its contents no longer depend on a staged `docs` left in the checkout. @@ -26,7 +26,7 @@ Desktop and the Python single-file executable pay nothing for either addition. [ **Publish maps without `src`.** Rejected because a map whose `sources` are absent resolves nothing, which is exactly the navigation the [Typert Remote design](../architecture/2026-08-02-typert-remote-method-calls.md) requires. -**Publish only the website's page set.** Rejected because an installed reader is not the website's reader: the maintainer documents, the migration records, and the translation guidelines are exactly what a plugin author cannot get offline, and a catalog page's link into `persistence-changes/` resolves only when those records ship with it. +**Publish the whole `docs/` tree, or only the website's page set.** Both extremes were rejected. The whole tree publishes maintainer material an installed reader does not need — postmortems, testing guides, agent instructions, and the generated migration records — while the site's page set alone omits the upgrade guides, which are the documents an installed reader consults when a released change breaks something. **Mangle the bundles as well.** Rejected because mangled identifiers break the correspondence a published map exists to provide and make an unhandled stack frame unreadable. @@ -34,8 +34,8 @@ Desktop and the Python single-file executable pay nothing for either addition. [ ## Consequences -`src` adds about 29 MB and declaration maps about 10 MB across the release set; JavaScript maps add about 49 MB, and the staged documentation adds 31 MB to `@deepseek-ai/dsh`. Compression removes about a third of a browser bundle — `ui-chat`'s `lib/client.js` falls from 591 kB to 420 kB — while node-side entries keep their size until the worker image lowering accepts compressed input. The Desktop application and the Python executable keep their previous payload. +`src` adds about 29 MB and declaration maps about 10 MB across the release set; JavaScript maps add about 49 MB, and the staged documentation adds 6.2 MB across 269 files to `@deepseek-ai/dsh`. Compression removes about a third of a browser bundle — `ui-chat`'s `lib/client.js` falls from 591 kB to 420 kB — while node-side entries keep their size until the worker image lowering accepts compressed input. The Desktop application and the Python executable keep their previous payload. -A consumer editor now follows a declaration to the installed implementation, and a plugin author reads that version's documentation without a checkout. The staged copy keeps the repository's relative links, so a link into `../packages/**` resolves only in a checkout while the documentation's own cross-references stay intact. `docs/` exists in the working tree only between `prepack` and `postpack`, and `pnpm run clean` removes a copy an interrupted pack left behind. +A consumer editor now follows a declaration to the installed implementation, and a plugin author reads that version's documentation without a checkout. The staged copy keeps the repository's relative links, so a link into `../packages/**` or into the omitted `persistence-changes/` records resolves only in a checkout. `docs/` exists in the working tree only between `prepack` and `postpack`, and `pnpm run clean` removes a copy an interrupted pack left behind. `pnpm run constraints` rejects a member whose `files` omits `src` or a map, because the canonical list is exact. The release family's tarball check requires `@deepseek-ai/dsh` to carry documentation and source, so a pack run that skips the staging hook fails instead of publishing without them. diff --git a/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.zh.md b/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.zh.md index 1d68df2d11..a522f4d07d 100644 --- a/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.zh.md +++ b/.agents/notes/implemented/process/2026-10-08-published-source-and-docs.zh.md @@ -10,13 +10,13 @@ Status: implemented ## Decision -每个发布成员都发布自己的 TypeScript 源码、能解析到该源码的声明映射,以及紧挨所描述 bundle 的 JavaScript map。`@deepseek-ai/dsh` 另发布仓库的 `docs/` 树,构建也会压缩产出的 bundle,但不混淆标识符。 +每个发布成员都发布自己的 TypeScript 源码、能解析到该源码的声明映射,以及紧挨所描述 bundle 的 JavaScript map。`@deepseek-ai/dsh` 另发布文档网站的页面集合外加升级指南,构建也会压缩产出的 bundle,但不混淆标识符。 [`expectedDshPackageFiles`](../../../../scripts/check-workspace-constraints.ts) 列出 `lib/types/**/*.d.ts.map`、`lib/**/*.js.map` 与 `src`;带 Typert Remote 导航的包还会列出 `lib/typert.remote-client.d.ts.map`,其生成的声明通过 `sourceMappingURL` 引用该映射。没有任何载荷成员被禁止,发布清单由静态 manifest 检查精确持有。332 个发布成员中已有 315 个声明过 `./src/*`,该导出现在解析到这些文件,服务于编辑器导航与阅读;纯 Node 仍需 TypeScript loader 才能 import 它们。 client 预设会压缩浏览器 bundle 的文本(`minify: { compress: false, mangle: false }`)。标识符保持原名,因此栈帧与已发布的 map 仍然指向原始代码。Node 侧入口不压缩:浏览器 worker 镜像只把 `yield*` 当作整条语句下沉,并按源码版式重写 `for await` 循环,压缩后的输入会同时破坏这两者。 -`@deepseek-ai/dsh` 通过 [`scripts/stage-dsh-docs.ts`](../../../../scripts/stage-dsh-docs.ts) 在自己的 `prepack` 生命周期里把仓库 `docs/` 树整体复制到 `apps/cli/docs`,并在 `postpack` 中再次删除这份副本。所有文件都会发布:已上站的页面、维护者文档、生成的 `docs/persistence-changes/` 记录、`docs/i18n/` 规范、`*.i18n.yaml` 一致性记录,以及被引用的图片。vendored 族保持上游 payload 不变([发布序列](2026-08-10-npm-release-sequences.zh.md))。 +`@deepseek-ai/dsh` 通过 [`scripts/stage-dsh-docs.ts`](../../../../scripts/stage-dsh-docs.ts) 在自己的 `prepack` 生命周期里把这一集合复制到 `apps/cli/docs`,并在 `postpack` 中再次删除这份副本。集合包含:网站清单中的 Markdown、`docs/upgrade-guide/` 下的全部文档,以及这些页面引用的非 Markdown 资产。生成的 `docs/persistence-changes/` 记录、`docs/i18n/` 规范与 `*.i18n.yaml` 一致性记录不发布。vendored 族保持上游 payload 不变([发布序列](2026-08-10-npm-release-sequences.zh.md))。 桌面版与 Python 单文件可执行体不为这两项新增内容付出代价。桌面的[运行时文件策略](../../../../apps/desktop/scripts/runtime-file-policy.ts)会从 `@deepseek-ai/dsh*` 包中剔除 `src/`、`docs/` 与所有映射,同时保留部分第三方包 `main` 指向的 `src` 树;[`PUBLISHED_PAYLOAD_IGNORES`](../../../../scripts/build-exe-for-python-sdk.ts) 则把这些树排除出可执行体,因此其内容不再取决于检出中是否残留暂存的 `docs`。 @@ -26,7 +26,7 @@ client 预设会压缩浏览器 bundle 的文本(`minify: { compress: false, m **只发布映射,不发布 `src`。** 否决:`sources` 不存在的映射解析不到任何东西,而这正是 [Typert Remote 设计](../architecture/2026-08-02-typert-remote-method-calls.zh.md)所要求的导航。 -**只发布网站页面集合。** 否决:已安装的读者不是网站的读者——维护者文档、迁移记录与翻译规范正是插件作者离线拿不到的部分,而且目录页指向 `persistence-changes/` 的链接只有随记录一起发布才可解析。 +**整树发布,或只发布网站页面集合。** 两个极端都否决。整树会把已安装读者并不需要的维护者材料发出去——事故复盘、测试指南、Agent 指令与生成的迁移记录;而只发网站页面集合会漏掉升级指南,也就是已发布改动造成破坏时读者真正要查的文档。 **连标识符一起混淆。** 否决:混淆会破坏已发布 map 本应提供的对应关系,并使未处理栈帧无法阅读。 @@ -34,8 +34,8 @@ client 预设会压缩浏览器 bundle 的文本(`minify: { compress: false, m ## Consequences -`src` 在整个发布集上增加约 29 MB,声明映射增加约 10 MB,JavaScript map 增加约 49 MB,暂存的文档给 `@deepseek-ai/dsh` 增加 31 MB。压缩让浏览器 bundle 约减少三分之一——`ui-chat` 的 `lib/client.js` 从 591 kB 降到 420 kB——而 Node 侧入口在 worker 镜像接受压缩输入之前保持原体积。桌面应用与 Python 可执行体保持原有载荷。 +`src` 在整个发布集上增加约 29 MB,声明映射增加约 10 MB,JavaScript map 增加约 49 MB,暂存的文档以 269 个文件给 `@deepseek-ai/dsh` 增加 6.2 MB。压缩让浏览器 bundle 约减少三分之一——`ui-chat` 的 `lib/client.js` 从 591 kB 降到 420 kB——而 Node 侧入口在 worker 镜像接受压缩输入之前保持原体积。桌面应用与 Python 可执行体保持原有载荷。 -消费方编辑器现在可以从声明跳转到已安装的实现,插件作者无需检出即可读到该版本的文档。暂存副本保留仓库的相对链接,因此指向 `../packages/**` 的链接只在检出中可解析,而文档自身的交叉引用保持完整。`docs/` 只在 `prepack` 与 `postpack` 之间存在于工作树,`pnpm run clean` 会清掉被中断的打包留下的副本。 +消费方编辑器现在可以从声明跳转到已安装的实现,插件作者无需检出即可读到该版本的文档。暂存副本保留仓库的相对链接,因此指向 `../packages/**` 或指向被排除的 `persistence-changes/` 记录的链接只在检出中可解析。`docs/` 只在 `prepack` 与 `postpack` 之间存在于工作树,`pnpm run clean` 会清掉被中断的打包留下的副本。 `pnpm run constraints` 会拒绝 `files` 中缺少 `src` 或任一声明映射的发布成员,因为该清单是精确匹配的。发布族的 tarball 校验要求 `@deepseek-ai/dsh` 必须带上文档与源码,因此跳过暂存钩子的打包会直接失败,而不是发出一个缺少它们的包。 diff --git a/apps/cli/README.i18n.yaml b/apps/cli/README.i18n.yaml index 881e2c5c4b..aad83c226c 100644 --- a/apps/cli/README.i18n.yaml +++ b/apps/cli/README.i18n.yaml @@ -18,8 +18,8 @@ en: 3a40ddc44e55f79c zh: 8d3949132e1ef93c /deepseek-ai-dsh/installed-payload: - en: 9c0e0d0f4d2680e1 - zh: d0a714fe5d909f12 + en: da093ab26c9403fd + zh: 3c7bb7e9dcc772ac /deepseek-ai-dsh/development: en: 0a289c1235869927 zh: a1f473f70036ad37 diff --git a/apps/cli/README.md b/apps/cli/README.md index eb04c5db68..d0624e98a8 100644 --- a/apps/cli/README.md +++ b/apps/cli/README.md @@ -55,9 +55,9 @@ The [CLI behavior reference](reference/README.md) owns exact layer precedence, f ## Installed payload -The published tarball carries the bundled runtime under `lib/`, the TypeScript under `src/`, the declaration and JavaScript maps beside the files they describe, and the repository documentation under `docs/`. Only `prepack` copies `docs/`, and `postpack` removes that copy again, so a reader of the working tree sees whatever the checkout holds. +The published tarball carries the bundled runtime under `lib/`, the TypeScript under `src/`, the declaration and JavaScript maps beside the files they describe, and the documentation under `docs/`. Only `prepack` stages `docs/`, and `postpack` removes that copy again, so a reader of the working tree sees whatever the checkout holds. -`docs/` is the repository's documentation tree in full, including the generated `persistence-changes/` records, the `i18n/` guidelines, and the `*.i18n.yaml` consistency records. Its pages keep the repository's relative links, so a link into `../packages/**` resolves only in a checkout. +`docs/` holds the documentation website's pages plus every upgrade guide, with the assets those pages reference. The generated `persistence-changes/` records, the `i18n/` guidelines, and the `*.i18n.yaml` consistency records are not published. Its pages keep the repository's relative links, so a link into `../packages/**` or into the omitted `persistence-changes/` records resolves only in a checkout. ## Development diff --git a/apps/cli/README.zh.md b/apps/cli/README.zh.md index c26ea2c0d0..de139fa373 100644 --- a/apps/cli/README.zh.md +++ b/apps/cli/README.zh.md @@ -55,9 +55,9 @@ profile 目录包含一个 `package.json`,其中记录树外插件依赖,以 ## 安装包内容 -发布 tarball 在 `lib/` 下携带打包后的运行时,在 `src/` 下携带 TypeScript 源码,在各自描述的文件旁携带声明映射与 JavaScript map,并在 `docs/` 下携带仓库文档。只有 `prepack` 会复制 `docs/`,`postpack` 又会删除这份副本,因此工作树里的读者看到的始终是检出当前的内容。 +发布 tarball 在 `lib/` 下携带打包后的运行时,在 `src/` 下携带 TypeScript 源码,在各自描述的文件旁携带声明映射与 JavaScript map,并在 `docs/` 下携带文档。只有 `prepack` 会暂存 `docs/`,`postpack` 又会删除这份副本,因此工作树里的读者看到的始终是检出当前的内容。 -`docs/` 是仓库文档树的完整副本,包含生成的 `persistence-changes/` 记录、`i18n/` 规范与 `*.i18n.yaml` 一致性记录。其中的页面保留仓库的相对链接,因此指向 `../packages/**` 的链接只在检出中可解析。 +`docs/` 包含文档网站的页面与全部升级指南,以及这些页面引用的资产。生成的 `persistence-changes/` 记录、`i18n/` 规范与 `*.i18n.yaml` 一致性记录不发布。其中的页面保留仓库的相对链接,因此指向 `../packages/**` 或指向被排除的 `persistence-changes/` 记录的链接只在检出中可解析。 ## 开发 diff --git a/scripts/stage-dsh-docs.spec.ts b/scripts/stage-dsh-docs.spec.ts index ca9d5c56ab..6e83137ed6 100644 --- a/scripts/stage-dsh-docs.spec.ts +++ b/scripts/stage-dsh-docs.spec.ts @@ -2,7 +2,7 @@ import { existsSync, mkdtempSync, mkdirSync, rmSync, writeFileSync } from 'node: import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, describe, expect, it } from 'vitest' -import { cleanStagedDshDocs, stageDshDocs } from './stage-dsh-docs.ts' +import { cleanStagedDshDocs, publishedDocuments, stageDshDocs } from './stage-dsh-docs.ts' const roots: string[] = [] @@ -23,26 +23,36 @@ afterEach(() => { }) describe('documentation staging', () => { - it('copies the complete documentation tree', async () => { + it('copies published pages, assets, and upgrade guides without the internal trees', async () => { const source = join(temporaryRoot(), 'docs') const destination = join(temporaryRoot(), 'cli', 'docs') + const published = new Set(['guide/index.md', 'guide/index.zh.md']) write(source, 'guide/index.md') + write(source, 'guide/index.zh.md') write(source, 'guide/index.i18n.yaml') write(source, 'images/diagram.png', 'png') + write(source, 'upgrade-guide/v0.1.0/change/guide.md') + write(source, 'upgrade-guide/v0.1.0/change/guide.zh.md') + write(source, 'upgrade-guide/v0.1.0/change/guide.i18n.yaml') write(source, 'postmortem/incident.md') write(source, 'AGENTS.md') write(source, 'persistence-changes/v1/changes.md') - write(source, 'persistence-changes/v1/record.json') + write(source, 'i18n/terminology.md') - await stageDshDocs(source, destination) + await stageDshDocs(source, destination, published) for (const copied of [ - 'guide/index.md', 'guide/index.i18n.yaml', 'images/diagram.png', - 'postmortem/incident.md', 'AGENTS.md', - 'persistence-changes/v1/changes.md', 'persistence-changes/v1/record.json', + 'guide/index.md', 'guide/index.zh.md', 'images/diagram.png', + 'upgrade-guide/v0.1.0/change/guide.md', 'upgrade-guide/v0.1.0/change/guide.zh.md', ]) { expect(existsSync(join(destination, copied)), copied).toBe(true) } + for (const excluded of [ + 'guide/index.i18n.yaml', 'upgrade-guide/v0.1.0/change/guide.i18n.yaml', + 'postmortem', 'AGENTS.md', 'persistence-changes', 'i18n', + ]) { + expect(existsSync(join(destination, excluded)), excluded).toBe(false) + } }) it('replaces a previous copy instead of merging into it', async () => { @@ -51,7 +61,7 @@ describe('documentation staging', () => { write(source, 'kept.md') write(destination, 'removed.md') - await stageDshDocs(source, destination) + await stageDshDocs(source, destination, new Set(['kept.md'])) expect(existsSync(join(destination, 'kept.md'))).toBe(true) expect(existsSync(join(destination, 'removed.md'))).toBe(false) @@ -65,4 +75,14 @@ describe('documentation staging', () => { expect(existsSync(destination)).toBe(false) }) + + it('publishes the website manifest pages and no internal document', () => { + const published = publishedDocuments() + + expect(published.has('architecture.md')).toBe(true) + expect(published.has('architecture.zh.md')).toBe(true) + for (const excluded of ['AGENTS.md', 'testing.md', 'postmortem/README.md', 'persistence-changes/README.md', 'i18n/README.md']) { + expect(published.has(excluded)).toBe(false) + } + }) }) diff --git a/scripts/stage-dsh-docs.ts b/scripts/stage-dsh-docs.ts index 9d16c0f455..90fcdffb51 100644 --- a/scripts/stage-dsh-docs.ts +++ b/scripts/stage-dsh-docs.ts @@ -1,8 +1,9 @@ -/** Stage the repository documentation inside the published `dsh` package. */ +/** Stage the published documentation inside the published `dsh` package. */ -import { cp, rm } from 'node:fs/promises' -import { join } from 'node:path' +import { cp, mkdir, readdir, rm } from 'node:fs/promises' +import { dirname, join } from 'node:path' import { fileURLToPath } from 'node:url' +import { docsPages } from '../website/docs.ts' /** Repository root, resolved from this script rather than the invoking directory. */ const REPOSITORY_ROOT = fileURLToPath(new URL('..', import.meta.url)) @@ -11,8 +12,35 @@ const REPOSITORY_ROOT = fileURLToPath(new URL('..', import.meta.url)) const DOCS_DIRECTORY = join(REPOSITORY_ROOT, 'docs') const STAGED_DIRECTORY = join(REPOSITORY_ROOT, 'apps', 'cli', 'docs') +/** Generated migration records and the translation guidelines: maintainer material no reader in an installed package needs. */ +const EXCLUDED_DIRECTORIES = ['persistence-changes', 'i18n'] as const + +/** Translation alignment records the documentation gates own. */ +const EXCLUDED_SUFFIX = '.i18n.yaml' + +/** Upgrade guides reach an installed reader and are not on the website. */ +const ALWAYS_PUBLISHED_DIRECTORY = 'upgrade-guide' + /** - * Replace a package's `docs` directory with the repository documentation. + * Source-relative Markdown paths the documentation website publishes. + * + * The npm payload carries the same pages plus the upgrade guides, so a new + * internal document under `docs/` reaches neither surface until the manifest + * adopts it. + * @returns every manifest source and alias, relative to the documentation root. + */ +export function publishedDocuments(): ReadonlySet { + const published = new Set() + for (const page of docsPages) { + for (const file of [page.source, ...page.sourceAliases ?? []]) { + if (file.startsWith('docs/')) published.add(file.slice('docs/'.length)) + } + } + return published +} + +/** + * Replace a package's `docs` directory with the documentation a reader needs. * * The copy follows the working tree, so a pack publishes the `docs/` contents * the checkout holds rather than the committed tree. Runs from the `prepack` @@ -20,14 +48,20 @@ const STAGED_DIRECTORY = join(REPOSITORY_ROOT, 'apps', 'cli', 'docs') * release set both publish the same files. * @param source - Documentation root to copy; defaults to the repository `docs`. * @param destination - Package directory to replace; defaults to `apps/cli/docs`. - * @returns Resolves after the destination holds the copy. + * @param published - Source-relative Markdown paths to keep; defaults to the website manifest. + * @returns Resolves after the destination holds the filtered copy. */ export async function stageDshDocs( source: string = DOCS_DIRECTORY, destination: string = STAGED_DIRECTORY, + published: ReadonlySet = publishedDocuments(), ): Promise { await rm(destination, { recursive: true, force: true }) - await cp(source, destination, { recursive: true }) + for (const file of await stagedFiles(source, published)) { + const target = join(destination, file) + await mkdir(dirname(target), { recursive: true }) + await cp(join(source, file), target) + } } /** @@ -39,6 +73,40 @@ export async function cleanStagedDshDocs(destination: string = STAGED_DIRECTORY) await rm(destination, { recursive: true, force: true }) } +/** + * List the files one stage publishes, in stable path order. + * @param source - Documentation root to walk. + * @param published - Source-relative Markdown paths to keep. + * @returns source-relative POSIX paths of every published file. + */ +async function stagedFiles(source: string, published: ReadonlySet): Promise { + const files: string[] = [] + const walk = async (directory: string): Promise => { + for (const entry of await readdir(join(source, directory), { withFileTypes: true })) { + const path = directory === '' ? entry.name : `${directory}/${entry.name}` + if (EXCLUDED_DIRECTORIES.some(excluded => path === excluded || path.startsWith(`${excluded}/`))) continue + if (entry.isDirectory()) { + await walk(path) + continue + } + if (path.endsWith(EXCLUDED_SUFFIX)) continue + if (path.endsWith('.md') && !published.has(path) && !isUpgradeGuide(path)) continue + files.push(path) + } + } + await walk('') + return files.sort() +} + +/** + * Whether one path belongs to a shipped upgrade guide. + * @param path - Source-relative documentation path. + * @returns whether the path lives under the upgrade-guide tree. + */ +function isUpgradeGuide(path: string): boolean { + return path.startsWith(`${ALWAYS_PUBLISHED_DIRECTORY}/`) +} + if (import.meta.main) { if (process.argv.includes('--clean')) await cleanStagedDshDocs() else await stageDshDocs() From b64dc28edb8a388912270d6a680a2262b958f8a9 Mon Sep 17 00:00:00 2001 From: turtle1999 Date: Mon, 19 Oct 2026 23:42:30 +0800 Subject: [PATCH 006/322] feat(agent-preset): ship plugin artwork skill with creator mode --- .../dsh-official-plugin-artwork/SKILL.md | 40 +++++++------------ apps/cli/tests/web-agent-presets.e2e.ts | 6 +-- packages/preset/agent-preset/README.i18n.yaml | 4 +- packages/preset/agent-preset/README.md | 2 +- packages/preset/agent-preset/README.zh.md | 2 +- .../references/host-plugin.md | 2 +- .../templates/decoration/icon.svg | 4 +- .../templates/mcp/icon.svg | 8 ++-- .../skills/plugin-artwork/SKILL.md | 34 ++++++++++++++++ 9 files changed, 62 insertions(+), 40 deletions(-) create mode 100644 packages/preset/agent-preset/skills/plugin-artwork/SKILL.md diff --git a/.agents/skills/dsh-official-plugin-artwork/SKILL.md b/.agents/skills/dsh-official-plugin-artwork/SKILL.md index 809409c8b5..5a42030a2c 100644 --- a/.agents/skills/dsh-official-plugin-artwork/SKILL.md +++ b/.agents/skills/dsh-official-plugin-artwork/SKILL.md @@ -1,41 +1,29 @@ --- name: dsh-official-plugin-artwork -description: Draw and review official DeepSeek Harness plugin icons and optional feature previews, including experimental plugins. Use for package artwork and PluginArtwork glyphs; covers semantic references, proportions, lettering, transparency, localization, package metadata, and designer review. Not for toolbar or action icons. +description: Draw and review official DeepSeek Harness plugin icons and optional feature previews, including experimental plugins. Use for package artwork and PluginArtwork glyphs; covers official references and palettes, feature previews, package metadata gates, and designer review, and links the shared drawing rules of plugin-artwork. Not for toolbar or action icons. --- # Official plugin artwork -Draw recognizable artwork that belongs beside the existing official icons. Official and official experimental plugins share this visual language; the UI label communicates experimental status. This guidance does not replace designer approval. +Read and follow [plugin artwork](../../../packages/preset/agent-preset/skills/plugin-artwork/SKILL.md) first; Creator mode ships it for all plugins, and it owns the subject, drawing, and export rules. Its Review section describes Creator bundles installed through Plugin Manager; for official plugins, follow its comparison step and replace its other steps with [Review and verify](#review-and-verify) below. Official and official experimental plugins share one visual language; the UI label communicates experimental status. This guidance does not replace designer approval. ## Optional feature previews -Before drawing a larger image for the top of an official bundle's detail document, read and follow [adding a plugin feature preview](../../../docs/cookbook/adding-a-plugin-preview.md). It owns optionality, image count, design canvas, position, language variants, file location, and acceptance. The guide also owns the embedded-raster exception for SVG previews; small icons remain geometry-only. The icon dimensions below do not apply to previews. Inspect the real feature and preserve its produced assets. +Before drawing a larger image for the top of an official bundle's detail document, read and follow [adding a plugin feature preview](../../../docs/cookbook/adding-a-plugin-preview.md). It owns optionality, image count, design canvas, position, language variants, file location, and acceptance. The guide also owns the embedded-raster exception for SVG previews; small icons remain geometry-only. The icon dimensions in plugin artwork do not apply to previews. Inspect the real feature and preserve its produced assets. -## Establish the subject +## Official references and owners -- Inspect the actual feature, its output, and its owning manifest before drawing. A badge-producing skill may need a tag, not a medal. Reuse designer-supplied assets; do not invent a brand mark or change product names, identifiers, or unrelated icons without approval. -- Read the [existing artwork](../../../packages/client/ui-primitives/src/plugin-artwork.tsx) and the nearest relevant package SVGs. Borrow one coherent treatment, not every reference's effects. Action icons remain with [dsh-client-ui-ux](../dsh-client-ui-ux/SKILL.md#reuse-before-adding). -- Check every affected entry, list, detail, and component row. Bundle artwork and a component's name and icon can have separate metadata owners; changing one does not update the other. - -## Draw and refine - -1. **Start simple.** Use one dominant subject and only the detail needed to explain it. Related capabilities can share a metaphor; distinguish them through proportions, silhouette, or palette rather than extra panels, symbols, or badges. -2. **Judge optical size.** Use `width="36" height="36" viewBox="0 0 36 36"`. Center the artwork with deliberate margins; 18–22 units is a useful starting extent, not a requirement for every silhouette or wide text tag. The [page renderer](../../../packages/client/ui-plugin-manager/src/client/PluginManagerPage.tsx) owns display sizes and outer tile framing. Do not bake that tile into the SVG or enlarge a toolbar glyph to fill it. -3. **Keep geometry consistent.** Balance the main subject and secondary element. Align repeated marks and corners; keep tails and handles intentional. Refine one requested dimension at a time without changing approved parts. -4. **Use restrained color by default.** Balance saturation and brightness with neighboring icons; prefer existing palettes such as [Auto Authorization Review](../../../packages/experimental/auto-review/icon.svg) and [Codex subagent](../../../packages/subagent/subagent-codex/icon.svg). Reserve unusually vivid, bright, or neon colors for approved brand requirements, essential contrast, or explicit designer direction. Tune saturation separately from hue and lightness; do not make artwork gray or muddy merely to reduce saturation. Keep flat fills or short gradients and limited layering; avoid glow, drop shadows, glossy highlights, and emoji. Page CSS still uses semantic theme tokens. -5. **Align lettering by visible ink.** Use consistent letterforms, cap height, baseline, weight, and spacing. Compare rendered stroke edges, not just path coordinates: stroke caps and joins can make equal coordinates appear unequal. Export lettering as paths without a font dependency, and keep it readable at actual size. -6. **Make empty areas genuinely transparent.** A hollow lens must reveal the background, including where it overlaps another shape. Remove the underlying fill with a local mask or cutout; do not substitute a white or dark disk. Check both themes. - -## Export at the owner - -- Use the manifest's `icon` path and publish its resources. Update intentional bundle/component copies together; verify localized display names and descriptions when those are in scope. Do not change the feature's produced assets merely to change its plugin icon. -- Package images render through ``: export self-contained SVG geometry with local, uniquely named gradient, mask, and clip references. No scripts, event handlers, animation, external images/styles, fonts, or `foreignObject`. Inline React artwork needs per-instance IDs; separate image documents do not share IDs. +- Reuse designer-supplied assets. Do not invent a brand mark or change product names, identifiers, or unrelated icons without approval. +- Read the [existing artwork](../../../packages/client/ui-primitives/src/plugin-artwork.tsx) and the nearest relevant package SVGs. Prefer existing palettes such as [Auto Authorization Review](../../../packages/experimental/auto-review/icon.svg) and [Codex subagent](../../../packages/subagent/subagent-codex/icon.svg). For official plugins, the explicit direction that permits vivid colors comes from the designer, and brand requirements need approval. Action icons remain with [dsh-client-ui-ux](../dsh-client-ui-ux/SKILL.md#reuse-before-adding). +- The [page renderer](../../../packages/client/ui-plugin-manager/src/client/PluginManagerPage.tsx) owns display sizes and outer tile framing. SVG artwork may use literal colors; page CSS uses semantic theme tokens. +- Update intentional bundle/component icon copies together, check the detail page as well as rows, and verify localized display names and descriptions when those are in scope. +- Inline React artwork needs per-instance IDs; separate image documents do not share IDs. - Keep the asset change local. Do not add runtime dependencies, primitive exports, or renderer special cases just to display it. + ## Review and verify -1. Show a few numbered alternatives before polishing uncertain geometry. Preserve their labels through review and apply the chosen version; an existing file or generated draft does not establish designer approval. Keep comparison artifacts in a gitignored directory, not the product package. -2. Compare old and new artwork beside unchanged references in light and dark themes, at actual row/card sizes as well as enlarged. Check balance, lettering, empty space, clipping, and image decoding. -3. Run `pnpm run verify-package-meta` for [package metadata and SVG artwork](../../../scripts/verify-package-meta.ts), `pnpm run constraints` for the canonical package payload, and `pnpm run verify-official-bundle-catalog`. Regenerate a stale catalog with `pnpm run gen-official-bundle-catalog`, never by hand. Structural checks do not replace visual review. -4. Build affected artifacts and inspect the real page through `dsh web`. Batch approved refinements before restarting a metadata-caching Host, then verify the entry and nested component rows in both themes. -5. Follow the repository's UI testing policy and [record-browser-gif](../record-browser-gif/SKILL.md) for a GUI PR. Obtain designer approval before landing new glyphs. Record reusable drawing principles here, not the history of rejected drafts. +1. Before polishing uncertain geometry, show a few numbered alternatives and keep their numbers through designer review; existing files and generated drafts do not establish approval. Keep comparison artifacts in a gitignored directory, not the product package. +2. Run `pnpm run verify-package-meta` for [package metadata and SVG artwork](../../../scripts/verify-package-meta.ts), `pnpm run constraints` for the canonical package payload, and `pnpm run verify-official-bundle-catalog`. Regenerate a stale catalog with `pnpm run gen-official-bundle-catalog`, never by hand. Structural checks do not replace visual review. +3. Build affected artifacts and inspect the real page through `dsh web`. Batch approved refinements before restarting a metadata-caching Host, then verify the entry and nested component rows in both themes. +4. Follow the repository's UI testing policy and [record-browser-gif](../record-browser-gif/SKILL.md) for a GUI PR. Obtain designer approval before landing new glyphs. Record reusable drawing principles in [plugin artwork](../../../packages/preset/agent-preset/skills/plugin-artwork/SKILL.md), not the history of rejected drafts. diff --git a/apps/cli/tests/web-agent-presets.e2e.ts b/apps/cli/tests/web-agent-presets.e2e.ts index 9bc37e78b2..246ef778d2 100644 --- a/apps/cli/tests/web-agent-presets.e2e.ts +++ b/apps/cli/tests/web-agent-presets.e2e.ts @@ -517,10 +517,10 @@ describe('the shipped Web composition', () => { expect(tools).not.toContain('str_replace_editor') expect(ctx.commands.find(handle.agent, 'goal')).toBeDefined() - // The preset's own authoring skill registers into ITS layer of the host - // registry: the cordis agent's view carries it, the global view does not. + // The preset's own authoring skills register into ITS layer of the host + // registry: the cordis agent's view carries them, the global view does not. const scoped = (await ctx.skills.list({ scope: handle.agent })).map(skill => skill.name) - expect(scoped).toContain('editing-cordis-compositions') + expect(scoped).toEqual(expect.arrayContaining(['editing-cordis-compositions', 'plugin-artwork'])) expect((await ctx.skills.list()).map(skill => skill.name)).not.toContain('editing-cordis-compositions') // The persona is `standard`'s, pinned verbatim so the two declarations diff --git a/packages/preset/agent-preset/README.i18n.yaml b/packages/preset/agent-preset/README.i18n.yaml index a2b45603c1..1ca83596b3 100644 --- a/packages/preset/agent-preset/README.i18n.yaml +++ b/packages/preset/agent-preset/README.i18n.yaml @@ -15,8 +15,8 @@ en: d152484eb41ac6b4 zh: b3ad7867f23dad1c /deepseek-ai-dsh-agent-preset/use-this-package: - en: 3e243b0ee04dd23f - zh: 832841c35b57180a + en: bdef487baf915690 + zh: 2d697a502ba09342 /deepseek-ai-dsh-agent-preset/understand-the-implementation: en: 7ac55a3a3af4fcef zh: 95fe36abba794967 diff --git a/packages/preset/agent-preset/README.md b/packages/preset/agent-preset/README.md index 243d771ec7..b86b56c0cb 100644 --- a/packages/preset/agent-preset/README.md +++ b/packages/preset/agent-preset/README.md @@ -47,7 +47,7 @@ Define an Agent’s child plugins in ordinary Cordis YAML. Declare several prese The declaration row’s `id` addresses Loader edits; `config.id` is the preset identity saved by sessions. Child entry IDs may be omitted and assigned by Loader. -The package also ships the `skills/` directory that creator mode mounts through `skill-filesystem`: `agent-experience` (tool descriptions and efficient context loading), `cordis-plugin-development` (a short procedure with `references/` read on demand and copyable `templates/` bundles), `editing-cordis-compositions`, and `cordis-composition-reference`, whose `references/packages.md` is generated by `scripts/gen-plugin-packages.ts` and freshness-gated in `doc-sync`. The two procedure skills tell the agent to read inspection results first, then the package README under the `packageDir` that `Config.listConfigs` reports, then built `lib/` or checkout sources. Every shipped `SKILL.md`, rendered as a `skill` tool result, stays under the 8192-character threshold above which the standard preset's tool-result pruner trims results. +The package also ships the `skills/` directory that creator mode mounts through `skill-filesystem`: `agent-experience` (tool descriptions and efficient context loading), `cordis-plugin-development` (a short procedure with `references/` read on demand and copyable `templates/` bundles), `editing-cordis-compositions`, `plugin-artwork` (plugin icon drawing and review), and `cordis-composition-reference`, whose `references/packages.md` is generated by `scripts/gen-plugin-packages.ts` and freshness-gated in `doc-sync`. The two procedure skills tell the agent to read inspection results first, then the package README under the `packageDir` that `Config.listConfigs` reports, then built `lib/` or checkout sources. Every shipped `SKILL.md`, rendered as a `skill` tool result, stays under the 8192-character threshold above which the standard preset's tool-result pruner trims results. Edit `agent-experience` in [skills/agent-experience/SKILL.md](skills/agent-experience/SKILL.md). The repository discovery path, `.agents/skills/agent-experience/SKILL.md`, is a relative symbolic link to this file; the published package contains the regular file. diff --git a/packages/preset/agent-preset/README.zh.md b/packages/preset/agent-preset/README.zh.md index c7bde250e4..3ecba91769 100644 --- a/packages/preset/agent-preset/README.zh.md +++ b/packages/preset/agent-preset/README.zh.md @@ -47,7 +47,7 @@ kind: "package-reference" 声明行的 `id` 是 Loader 编辑地址;`config.id` 是会话保存的 preset 标识符。子插件可省略行 ID,由 Loader 分配。 -本包还随包出货创造模式通过 `skill-filesystem` 挂载的 `skills/` 目录:`agent-experience`(工具描述与高效上下文加载)、`cordis-plugin-development`(简短流程,配合按需读取的 `references/` 与可复制的 `templates/` 组合包)、`editing-cordis-compositions`,以及 `cordis-composition-reference`,后者的 `references/packages.md` 由 `scripts/gen-plugin-packages.ts` 生成并在 `doc-sync` 中做新鲜度门禁。两个流程 skill 让 agent 先读检查结果,再读 `Config.listConfigs` 报告的 `packageDir` 下的包 README,最后读构建后的 `lib/` 或 checkout 源码。每个出货的 `SKILL.md` 作为 `skill` 工具结果渲染后都保持在 8192 字符阈值之下,标准 preset 的工具结果修剪器超过该阈值才会裁剪。 +本包还随包出货创造模式通过 `skill-filesystem` 挂载的 `skills/` 目录:`agent-experience`(工具描述与高效上下文加载)、`cordis-plugin-development`(简短流程,配合按需读取的 `references/` 与可复制的 `templates/` 组合包)、`editing-cordis-compositions`、`plugin-artwork`(插件图标绘制与评审),以及 `cordis-composition-reference`,后者的 `references/packages.md` 由 `scripts/gen-plugin-packages.ts` 生成并在 `doc-sync` 中做新鲜度门禁。两个流程 skill 让 agent 先读检查结果,再读 `Config.listConfigs` 报告的 `packageDir` 下的包 README,最后读构建后的 `lib/` 或 checkout 源码。每个出货的 `SKILL.md` 作为 `skill` 工具结果渲染后都保持在 8192 字符阈值之下,标准 preset 的工具结果修剪器超过该阈值才会裁剪。 在 [skills/agent-experience/SKILL.md](skills/agent-experience/SKILL.md) 编辑 `agent-experience`。仓库发现路径 `.agents/skills/agent-experience/SKILL.md` 是指向该文件的相对符号链接;发布包包含普通文件。 diff --git a/packages/preset/agent-preset/skills/cordis-plugin-development/references/host-plugin.md b/packages/preset/agent-preset/skills/cordis-plugin-development/references/host-plugin.md index fe88761ae4..127dd88a8a 100644 --- a/packages/preset/agent-preset/skills/cordis-plugin-development/references/host-plugin.md +++ b/packages/preset/agent-preset/skills/cordis-plugin-development/references/host-plugin.md @@ -31,7 +31,7 @@ A Host-only bundle needs no dependencies, install scripts, or build tool: Plugin Manager and Settings read `meta.title` and `meta.description` from exported locale JSON and an icon from exported resources without activating plugins. Complete this checklist before installation: - Write a recognizable title and a description of the capability in `locale/en.json` under `meta.title` and `meta.description`. Add the same fields for the user's language and other supported locales, such as `locale/zh.json`; do not leave template copy unrelated to the delivered plugin. -- Create an original icon or use artwork whose license permits redistribution, retaining any required attribution. +- Create an original icon or use artwork whose license permits redistribution, retaining any required attribution. Load the `plugin-artwork` skill before drawing or revising an icon. - Export `./locale/*.json` and `./icon`; retain existing runtime exports. Keep the patch, locales, icon, and every runtime file in `files`, updating it whenever you add modules or assets. For a packed or published bundle, verify the actual packed file list. Local directory installation links the checkout instead, so check the files directly; `files` does not filter a linked directory. - Check that the icon is a valid image of the declared format and satisfies the path and size limits below. An accepted filename alone does not establish that its bytes render. diff --git a/packages/preset/agent-preset/skills/cordis-plugin-development/templates/decoration/icon.svg b/packages/preset/agent-preset/skills/cordis-plugin-development/templates/decoration/icon.svg index 5c7caf5c24..d73576eb5a 100644 --- a/packages/preset/agent-preset/skills/cordis-plugin-development/templates/decoration/icon.svg +++ b/packages/preset/agent-preset/skills/cordis-plugin-development/templates/decoration/icon.svg @@ -1,3 +1,3 @@ - - + + diff --git a/packages/preset/agent-preset/skills/cordis-plugin-development/templates/mcp/icon.svg b/packages/preset/agent-preset/skills/cordis-plugin-development/templates/mcp/icon.svg index 4a2710adeb..0a18ff1314 100644 --- a/packages/preset/agent-preset/skills/cordis-plugin-development/templates/mcp/icon.svg +++ b/packages/preset/agent-preset/skills/cordis-plugin-development/templates/mcp/icon.svg @@ -1,5 +1,5 @@ - - - - + + + + diff --git a/packages/preset/agent-preset/skills/plugin-artwork/SKILL.md b/packages/preset/agent-preset/skills/plugin-artwork/SKILL.md new file mode 100644 index 0000000000..9a3facb175 --- /dev/null +++ b/packages/preset/agent-preset/skills/plugin-artwork/SKILL.md @@ -0,0 +1,34 @@ +--- +name: plugin-artwork +description: Use when drawing, revising, or reviewing the icon of a plugin or bundle shown in Plugin Manager; covers the subject, proportions, color, lettering, transparency, SVG export, and visual review. Not for toolbar or action icons. +--- + +# Plugin artwork + +Draw an icon that is recognizable at row size and belongs beside the icons of installed DSH plugins. The display checklist in the `cordis-plugin-development` skill's host-plugin reference owns manifest exports, accepted formats, size limits, and installed-display checks. + +## Establish the subject + +- Inspect the feature, its output, and its manifest before drawing. A badge-producing skill may need a tag, not a medal. Reuse assets the user supplies; do not invent a brand mark for a third-party product or copy one whose license does not permit redistribution. +- Read the icons of two or three installed plugins with related purposes. `cordis_inspect_query` `Config.listConfigs` reports each entry's `packageDir`; a top-level `icon` in its `package.json`, else the `./icon` export (`.//icon` for a subpath plugin), names the file. Plugins that Plugin Manager draws itself have no icon file. Borrow one coherent treatment, not every reference's effects. +- Plugin Manager resolves the icon and display metadata separately for the bundle package and for each plugin its patch inserts; a subpath plugin or another package does not inherit the bundle's icon. Update every one you intend to change, and only those. + +## Draw and refine + +1. **Start simple.** Use one dominant subject and only the detail needed to explain it. Related capabilities can share a subject; distinguish them through proportions, silhouette, or palette rather than extra panels, symbols, or badges. +2. **Judge optical size.** Use `width="36" height="36" viewBox="0 0 36 36"`. Center the artwork with deliberate margins; 18–22 units is a useful starting extent, not a requirement for every silhouette or wide text tag. Plugin Manager chooses display sizes and draws the surrounding tile, so do not draw a tile or background in the SVG or enlarge a toolbar glyph to fill it. +3. **Keep geometry consistent.** Balance the main subject and secondary element. Align repeated marks and corners; keep tails and handles intentional. Refine one requested dimension at a time without changing approved parts. +4. **Use restrained color.** Match the saturation and brightness of neighboring installed icons. Reserve unusually vivid, bright, or neon colors for brand requirements, essential contrast, or explicit user direction. Tune saturation separately from hue and lightness; do not make artwork gray or muddy merely to reduce saturation. Keep flat fills or short gradients and limited layering; avoid glow, drop shadows, glossy highlights, and emoji. +5. **Align lettering by visible ink.** Use consistent letterforms, cap height, baseline, weight, and spacing. Compare rendered stroke edges, not just path coordinates: stroke caps and joins can make equal coordinates appear unequal. Draw lettering as paths and keep it readable at actual size. +6. **Make empty areas genuinely transparent.** A hollow lens must reveal the background, including where it overlaps another shape. Remove the underlying fill with a local mask or cutout; do not substitute a white or dark disk. Check both themes. + +## Export + +- Plugin Manager renders the icon through ``, which silently drops what it cannot load. Export self-contained SVG geometry with local, uniquely named gradient, mask, and clip references. Use no scripts, event handlers, `
+ +
+
Clipped content
+
+
+
Authored none
+
Initial
+
+
`) + expect(await computedRegion(page.locator('#owner'))).toBe('no-drag') + const inherited = await computedRegion(page.locator('#child')) + if (inherited === 'none') { + context.skip(`Chrome ${version} does not inherit app-region; this environment cannot exercise the inheritance regression`) + } + expect(inherited).toBe('no-drag') + expect(await computedRegion(page.locator('#authored-none'))).toBe('no-drag') + expect(await computedRegion(page.locator('#initial'))).toBe('none') + + await page.locator('#owner').evaluate((owner) => { owner.scrollTop = 100 }) + expect(await page.locator('#child').evaluate((child) => { + const bounds = child.getBoundingClientRect() + const owner = child.parentElement!.getBoundingClientRect() + return bounds.top < 20 && bounds.bottom > 20 && bounds.bottom < owner.top + })).toBe(true) + expect(await headerPoint(page)).toEqual({ hit: 'header', draggable: false }) + + const stylesheet = await page.addStyleTag({ content: BASE_STYLES }) + expect(await computedRegion(page.locator('#child'))).toBe('none') + expect(await computedRegion(page.locator('#authored-none'))).toBe('no-drag') + expect(await computedRegion(page.locator('#initial'))).toBe('none') + expect(await headerPoint(page)).toEqual({ hit: 'header', draggable: true }) + + // Remove only the production reset: the still-clipped child must erase the same header point. + await stylesheet.evaluate((element) => { + if (!(element instanceof HTMLStyleElement) || element.sheet === null) throw new Error('The test stylesheet is unavailable') + const rules = Array.from(element.sheet.cssRules) + const reset = rules.find(rule => rule instanceof CSSStyleRule + && rule.selectorText === ':where(html[data-platform="darwin"] *)') + if (!(reset instanceof CSSStyleRule)) throw new Error('The app-region inheritance reset is missing') + reset.style.removeProperty('-webkit-app-region') + }) + expect(await computedRegion(page.locator('#child'))).toBe('no-drag') + expect(await headerPoint(page)).toEqual({ hit: 'header', draggable: false }) +}) diff --git a/apps/web/tsconfig.json b/apps/web/tsconfig.json index ec47d94afe..7294b2fd47 100644 --- a/apps/web/tsconfig.json +++ b/apps/web/tsconfig.json @@ -250,6 +250,7 @@ "tests/composer-tab-geometry.e2e.ts", "tests/conversation-view-tabs.e2e.ts", "tests/window-drag-coverage.e2e.ts", + "tests/window-drag-inheritance.e2e.ts", "tests/complex-history.perf.ts", "tests/pwsh-terminal.e2e.ts", "tests/workflow-run.e2e.ts" diff --git a/docs/upgrade-guide/v0.2.2-alpha.2/window-drag-regions/guide.i18n.yaml b/docs/upgrade-guide/v0.2.2-alpha.2/window-drag-regions/guide.i18n.yaml new file mode 100644 index 0000000000..7f78c4bd48 --- /dev/null +++ b/docs/upgrade-guide/v0.2.2-alpha.2/window-drag-regions/guide.i18n.yaml @@ -0,0 +1,16 @@ +# Bilingual-pair consistency record for guide.md (docs/i18n/README.md): per heading +# section, a hash of its English and Chinese blocks outside code blocks and generated regions. +# After editing either side, bring the other along and re-record with: +# pnpm run verify-translation-pairing --write docs/upgrade-guide/v0.2.2-alpha.2/window-drag-regions/guide.md +/: + en: 3733ed8d0c40fb64 + zh: f886cd8c61db2bd8 +/explicit-window-regions-for-custom-client-overlays: + en: 204e72b8ba3cff5b + zh: 9ce7f4f9f82341bd +/explicit-window-regions-for-custom-client-overlays/change: + en: 0fe54065e1f871e7 + zh: 3a8cff5d8233eba0 +/explicit-window-regions-for-custom-client-overlays/migration: + en: 85182ed7759e7a18 + zh: 48b0f9de217a9087 diff --git a/docs/upgrade-guide/v0.2.2-alpha.2/window-drag-regions/guide.md b/docs/upgrade-guide/v0.2.2-alpha.2/window-drag-regions/guide.md new file mode 100644 index 0000000000..53a5a6acd1 --- /dev/null +++ b/docs/upgrade-guide/v0.2.2-alpha.2/window-drag-regions/guide.md @@ -0,0 +1,21 @@ +--- +kind: upgrade-guide +description: "Custom Client overlays that relied on global macOS no-drag exclusions must declare their window regions." +--- + +# Explicit window regions for custom Client overlays + +English | [中文](guide.zh.md) + +## Change + +After upgrading from 0.2.2-alpha.2, macOS Desktop automatically excludes interactive controls only inside `data-window-drag` rows or `data-window-drag-controls` scopes. Previously, matching controls and ARIA roles anywhere in the application received `no-drag`. Custom Client plugins that relied on that rule for content covering a draggable header must now declare an exclusion. Ordinary scrollable content without an explicit region declaration contributes no region, so content clipped above its viewport no longer blocks header dragging. + +This affects custom overlays outside those scopes that cover a drag row. Controls already inside a marked row, overlays using shared primitives with their own exclusions, and components with explicit `no-drag` declarations need no migration. The rule applies only to macOS Desktop; plain Web and Windows behavior is unchanged. + +## Migration + +1. Inspect the JSX and CSS Modules of custom Client overlays that can cover a header. Check whether their interactive content relied on the previous automatic exclusion. +2. For an interactive viewport without nested drag rows, put `data-window-no-drag` on its visible viewport element. This excludes the viewport's own rectangle and keeps clipped descendants out of the region calculation. For a container whose controls need separate exclusions, put `data-window-drag-controls` on their containing element. Overlays and containers with nested drag rows must declare their regions separately; follow the [window-region rules](../../../../packages/client/web/README.md#understand-the-implementation). +3. Keep exclusions on visible owners rather than every focusable descendant. Use a shared `Modal` or `MenuSurface` for the corresponding overlay, or explicitly exclude the custom overlay's visible box. A body portal with no layout box needs an exclusion on its visible content. +4. Load the updated plugin in macOS Desktop. Open the overlay over a header and confirm its controls act without dragging the window. Close it and confirm the header's blank area still drags; scroll the plugin's content out of view and confirm that clipped content does not block the header. diff --git a/docs/upgrade-guide/v0.2.2-alpha.2/window-drag-regions/guide.zh.md b/docs/upgrade-guide/v0.2.2-alpha.2/window-drag-regions/guide.zh.md new file mode 100644 index 0000000000..1f1cfd4570 --- /dev/null +++ b/docs/upgrade-guide/v0.2.2-alpha.2/window-drag-regions/guide.zh.md @@ -0,0 +1,21 @@ +--- +kind: upgrade-guide +description: "依赖 macOS 全局 no-drag 排除的自定义 Client 浮层必须声明自己的窗口区域。" +--- + +# 自定义 Client 浮层显式声明窗口区域 + +[English](guide.md) | 中文 + +## 变更 + +从 0.2.2-alpha.2 升级后,macOS Desktop 仅自动排除 `data-window-drag` 行或 `data-window-drag-controls` 范围内的交互控件。此前,应用中任意位置匹配的控件和 ARIA role 都会获得 `no-drag`。自定义 Client 插件若依赖该规则使覆盖可拖动页头的内容保持可交互,现在必须声明排除。未显式声明区域的普通滚动内容不贡献区域,因此被裁剪到视口上方的内容不会再阻挡页头拖动。 + +该变更影响这些范围之外、覆盖拖动行的自定义浮层。已位于标记行内的控件、使用自带排除的共享原语的浮层,以及已显式声明 `no-drag` 的组件无需迁移。规则仅适用于 macOS Desktop,普通 Web 和 Windows 行为不变。 + +## 迁移 + +1. 检查可能覆盖页头的自定义 Client 浮层的 JSX 与 CSS Modules,确认其交互内容是否依赖此前的自动排除。 +2. 对不含嵌套拖动行的交互视口,在可见视口元素上添加 `data-window-no-drag`。它仅排除视口自身矩形,使被裁剪的子元素不参与区域计算。若容器内的控件需要分别排除,在承载这些控件的元素上添加 `data-window-drag-controls`。浮层和含嵌套拖动行的容器必须单独声明区域,遵循[窗口区域规则](../../../../packages/client/web/README.zh.md#understand-the-implementation)。 +3. 在可见区域所有者上声明排除,不要逐个排除可聚焦子元素。对应浮层采用共享 `Modal` 或 `MenuSurface`,或显式排除自定义浮层的可见矩形。不产生布局矩形的 body portal 需在可见内容上声明排除。 +4. 在 macOS Desktop 加载更新后的插件,将浮层打开到页头上方,确认其控件正常生效且不会拖动窗口。关闭浮层后确认页头空白区域仍可拖动;将插件内容滚出可见区,确认被裁剪内容不会阻挡页头。 diff --git a/packages/client/ui-dockkit/src/components/dockkit.module.css b/packages/client/ui-dockkit/src/components/dockkit.module.css index 0915dfdc0b..aeb33eaff8 100644 --- a/packages/client/ui-dockkit/src/components/dockkit.module.css +++ b/packages/client/ui-dockkit/src/components/dockkit.module.css @@ -305,19 +305,13 @@ margin-left: 4px; } -/* macOS desktop: an embedder may pin this surface at the window's top edge (the - right sidebar does, in both presentations). The strip row is marked - `data-window-drag` in markup (TabPanel), so ui-web base.css's single darwin - rule drags it over its own box; the chip run, the strip-end chrome, the pane - body, and the split divider subtract their whole boxes so tabs, controls, - content, and the resize grab stay usable wherever they overlap that row. The - chip viewport uses `data-window-no-drag` so clipped chips do not contribute - their scrolled boxes. The pane also subtracts its box when floats disable the - strip's drag mark. The divider must be named here: it is a plain div, so ui-web base.css's - interactive-element subtraction never matches it. A floating pane subtracts its - own box the same way, so the strip row never drags the window over it. Hidden - surfaces contribute nothing: Blink skips non-visible boxes when it collects - draggable regions. */ +/* macOS desktop: an embedder may pin this surface at the window's top edge. + Panes always subtract their whole boxes; a marked strip adds its row back + unless floating panes disable that mark. Strip-end chrome, pane bodies, + floats, and dividers also exclude their boxes. The divider is a plain div + outside a drag row, so ui-web's scoped controls rule cannot exclude it. + Keep these selectors at (0,1,0): ui-web's inert reset at (0,2,1) must win + when an overlay makes the retained panes inactive. */ :global(:where(html[data-platform='darwin'])) .pane, :global(:where(html[data-platform='darwin'])) .stripChrome, :global(:where(html[data-platform='darwin'])) .paneBody, diff --git a/packages/client/ui-dockkit/tests/app-region-styles.client.spec.ts b/packages/client/ui-dockkit/tests/app-region-styles.client.spec.ts index 5f5d4e62b8..0d13fe6c38 100644 --- a/packages/client/ui-dockkit/tests/app-region-styles.client.spec.ts +++ b/packages/client/ui-dockkit/tests/app-region-styles.client.spec.ts @@ -3,10 +3,11 @@ * embedder may pin the surface at the window's top edge (the right sidebar does), * so the strip row marks itself `data-window-drag` in markup (TabPanel) and ui-web * base.css drags the row over its own box. Electron composes app-regions from - * geometry in DOM order — every box that must stay usable subtracts itself from - * that row. The divider must be listed explicitly: it is a plain div, so base.css's - * interactive-element subtraction never matches it, and an unsubtracted vertical - * divider's top run would drag the window instead of resizing the split. + * geometry in DOM order — pane boxes are excluded before marked strip rows add + * their geometry back. The divider must be listed explicitly: it is a plain div + * outside a drag row, so base.css's scoped controls rule cannot exclude it. An + * unsubtracted vertical divider's top run would drag the window instead of + * resizing the split. */ import { readFileSync } from 'node:fs' import { resolve } from 'node:path' diff --git a/packages/client/ui-plugin-manager/README.i18n.yaml b/packages/client/ui-plugin-manager/README.i18n.yaml index 7ac4ca91dc..6122766724 100644 --- a/packages/client/ui-plugin-manager/README.i18n.yaml +++ b/packages/client/ui-plugin-manager/README.i18n.yaml @@ -15,8 +15,8 @@ en: d152484eb41ac6b4 zh: 09388d293f9be9cb /deepseek-ai-dsh-client-ui-plugin-manager/use-this-package: - en: 0c76e6c00cc7388d - zh: e56ddb7b78111b73 + en: c38847d0d4d5a7b6 + zh: b83f29416199098a /deepseek-ai-dsh-client-ui-plugin-manager/use-this-package/installing-a-bundle: en: 1fc6c5c2a54d8db4 zh: 9e53f5164e2b7161 diff --git a/packages/client/ui-plugin-manager/README.md b/packages/client/ui-plugin-manager/README.md index 412df1b9af..1b23459a8b 100644 --- a/packages/client/ui-plugin-manager/README.md +++ b/packages/client/ui-plugin-manager/README.md @@ -33,7 +33,7 @@ Below 768px, the page uses 20px horizontal insets to align with the conversation Select **Plugins** in the sidebar. The information button uses an 11px caption-colored icon in a 20px square hover area, with a 4px gap after the subtitle. It explains that this page configures official plugins and installs or manages other plugins, while **Settings → Built-in plugins** shows the built-in inventory and runtime status. Hover or focus shows the shared tooltip; clicking keeps it open until another click, Escape, Tab, or an outside click. The page reads the inventory and the bundles through `api-remotes` when first opened; a Host without a managed profile shows the page as unavailable. **Built-in plugin settings** lists official configuration pages by their configured order: Subagent, web search and fetch, agent loop, then shell. **Experimental plugins** shows the primary optional bundles, with **More** beside its heading opening a separate page of the same title. That page lists the official bundles eligible for display, including those on the main list, with Codex and Claude Code subagents last. Its back button returns to the main list, where **Installed plugins** remains below Experimental plugins. Bundle details return to the list they were opened from. Catalog entries keep their position after installation or removal. **Installed plugins** lists other profile bundles. Installation-carried optional bundles have no uninstall action. Experimental packages retain the **Experimental** marker on both lists. Switching on a bundle that page holds back adds it to the main list in the position that page shows it, and switching it off leaves it on that page alone unless its manifest hides unselected bundles; other bundles keep their place on both. A dependency without a bundle patch is not a plugin and is not listed unless the profile selects it, in which case it carries a problem tag. Global configuration remains in the Settings **Built-in plugins** section. -As available header width decreases, Refresh and Add plugin first become icon-only controls with accessible names and tooltips; the tabs then shrink from their usual minimum width to fit their labels, and the action group wraps only when necessary. The information button follows the subtitle text. The main page header and list share one scroll container. Header controls move with the scroll position until they reach their compact positions; scrolling back follows the same coordinates. The header retains its resting layout height, so moving its controls does not change the list's scroll range. A barely scrolling list can stop before the header is fully compact. The More list's back-and-title row stays fixed, and detail pages scroll their head row with the content. The Installed/Discover tabs use the compact 34px control with a 2px inset around the selection indicator. The subtitle scrolls out of view; with tabs present, the title also scrolls out, and the tabs settle beside Refresh and Add plugin where space permits. On narrow pages, the tabs and icon actions share a row beneath the heading where they fit; otherwise the tabs stay above the actions. Their relative order stays the same throughout scrolling. The resting and compact layouts retain their 28px and 16px page-top insets respectively, with 16px below the compact controls. macOS adds the frame's titlebar clearance while resting; its compact bar keeps 16px above and below with the sidebar expanded, and with the sidebar collapsed it also clears the frame's top strip so the controls stay below the native window controls. Only on macOS, when the sidebar is collapsed, the compact controls keep 8px rather than 16px above them in addition to the unchanged frame clearance, at every width. The resting layout and compact bottom spacing stay unchanged. Windows relies on the frame's caption offset without adding it again. The divider spans the page at the bottom of the compact header; the list's initial top spacing scrolls with its content. Hover styling applies only where the pointer can hover, so a tap leaves no card, row, or menu option in its hover state; cards and icon actions answer a touch-down with the pressed fill instead. The install, registry, and filter fields take a 16px face under a coarse pointer, which keeps iOS Safari from zooming a focused field. +As available header width decreases, Refresh and Add plugin first become icon-only controls with accessible names and tooltips; the tabs then shrink from their usual minimum width to fit their labels, and the action group wraps only when necessary. The information button follows the subtitle text. The main page header and list share one scroll container. Header controls move with the scroll position until they reach their compact positions; scrolling back follows the same coordinates. The header wrapper retains its resting flow height to preserve the list's scroll range, while the draggable head's box matches its painted height so native drag geometry cannot extend into the list. A barely scrolling list can stop before the header is fully compact. The More list's back-and-title row stays fixed, and detail pages scroll their head row with the content. The Installed/Discover tabs use the compact 34px control with a 2px inset around the selection indicator. The subtitle scrolls out of view; with tabs present, the title also scrolls out, and the tabs settle beside Refresh and Add plugin where space permits. On narrow pages, the tabs and icon actions share a row beneath the heading where they fit; otherwise the tabs stay above the actions. Their relative order stays the same throughout scrolling. The resting and compact layouts retain their 28px and 16px page-top insets respectively, with 16px below the compact controls. macOS adds the frame's titlebar clearance while resting; its compact bar keeps 16px above and below with the sidebar expanded, and with the sidebar collapsed it also clears the frame's top strip so the controls stay below the native window controls. Only on macOS, when the sidebar is collapsed, the compact controls keep 8px rather than 16px above them in addition to the unchanged frame clearance, at every width. The resting layout and compact bottom spacing stay unchanged. Windows relies on the frame's caption offset without adding it again. The divider spans the page at the bottom of the compact header; the list's initial top spacing scrolls with its content. Hover styling applies only where the pointer can hover, so a tap leaves no card, row, or menu option in its hover state; cards and icon actions answer a touch-down with the pressed fill instead. The install, registry, and filter fields take a 16px face under a coarse pointer, which keeps iOS Safari from zooming a focused field. Installed bundles and their plugin rows display their own title and description in the current UI language on cards and detail pages. Each field falls back from exported locale `meta` to the accessible `package.json` of a package-root plugin; subpath plugins never read one; the final title is the full package or module name, with no package description when both sources omit it. See [Plugin display metadata](../../../docs/cookbook/adding-a-package.md#plugin-display-metadata) for the author format. Bundle cards, details, and component rows display the package root's manifest `icon` or exported `./icon`, or a subpath plugin's exported `/icon`; absent or undecodable images retain the default artwork. Installation previews still use registry or manifest information. diff --git a/packages/client/ui-plugin-manager/README.zh.md b/packages/client/ui-plugin-manager/README.zh.md index 8d945eea5b..8062b0e426 100644 --- a/packages/client/ui-plugin-manager/README.zh.md +++ b/packages/client/ui-plugin-manager/README.zh.md @@ -33,7 +33,7 @@ kind: "package-reference" 在侧栏选择**插件**。信息按钮使用 11px 的 caption 色图标和 20px 方形悬停区域,与副标题间隔 4px。它说明当前页用于配置官方插件、安装和管理其他插件,**设置 → 内置插件**则展示内置插件列表及运行状态。悬停或聚焦显示共享 tooltip;点击后保持展开,直至再次点击、Escape、Tab 或外部点击。页面首次打开时通过 `api-remotes` 读取清单与组合包;没有受管 profile 的 Host 上页面显示为不可用。**内置插件配置**按配置的顺序列出官方配置页:子智能体、网页搜索与获取、Agent 循环、终端。**实验性插件**展示主要的可选组合包,标题旁的**更多**打开同名的独立页面。该页列出符合展示条件的官方组合包,也包含主列表已有的条目,Codex 和 Claude Code 子智能体排在最后。返回按钮回到主列表,**已安装插件**保持在实验性插件下方。组合包详情返回打开它的列表。目录条目在安装或移除后保持原位置。**已安装插件**列出其他 profile 组合包。安装随附的可选组合包没有卸载操作。实验性包在两个列表中均保留**实验性**标签。开启仅在该页列出的组合包会按该页中的位置把它加入主列表,关闭后它只留在该页,但 manifest 声明默认隐藏的组合包会从该页消失;其他组合包在两个列表中均保持原位。没有组合包 patch 的依赖不是插件,除非 profile 选中了它才会带异常标签列出。全局配置仍在设置的**内置插件**分区中编辑。 -页头可用宽度缩小时,“刷新”和“添加插件”先变为保留可访问名称与 tooltip 的图标按钮;标签再从常规最小宽度收紧为文案所需宽度,仍不足时操作组才换行。信息按钮紧随副标题文字。主页面的页头和列表共用一个滚动容器。页头控件随滚动位置移动,到达紧凑态位置后停住;反向滚动沿同样的坐标返回。页头保留静止态的布局高度,因此控件移动不会改变列表的滚动范围。只能滚动少量距离的列表可能在页头完全收拢前到达底部。“更多”列表的返回与标题行固定,详情页的页头随内容滚动。“已安装/发现”标签使用总高 34px 的紧凑控件,选中指示块与外框之间留 2px。副标题随滚动离开视口;有标签时标题也随之滚出,标签在空间足够时停靠到“刷新”“添加插件”旁边。窄页面中,标签与图标操作优先在标题下方共用一行;放不下时,标签始终在操作组上方。滚动过程中两组控件的相对顺序保持不变。静止态与紧凑态分别保留 28px 和 16px 的页面顶部留白,紧凑态控件下方保留 16px。macOS 静止态保留框架的标题栏安全区;折叠态在侧栏展开时上下各留 16px,侧栏收起时再避让框架顶部安全区,使控件位于原生窗口控件下方。仅在 macOS 侧栏收起时,紧凑态控件在原有框架安全区之外的顶部留白统一由 16px 减为 8px,不受窗口宽度影响;静止态布局与紧凑态底部留白均不变。Windows 使用框架已有的标题栏偏移,不重复叠加。分隔线在紧凑页头底部横跨页面,列表初始的顶部留白随内容滚动。悬停样式只在可悬停的指针下生效,点按不会让卡片、行或菜单项停留在悬停态;卡片与图标操作改以按下填充回馈触摸。安装、注册表与筛选输入框在粗指针下使用 16px 字号,iOS Safari 不会因聚焦而放大页面。 +页头可用宽度缩小时,“刷新”和“添加插件”先变为保留可访问名称与 tooltip 的图标按钮;标签再从常规最小宽度收紧为文案所需宽度,仍不足时操作组才换行。信息按钮紧随副标题文字。主页面的页头和列表共用一个滚动容器。页头控件随滚动位置移动,到达紧凑态位置后停住;反向滚动沿同样的坐标返回。页头外层容器保留静止态的文档流高度,以保持列表滚动范围;可拖动页头的矩形与其绘制高度一致,使原生拖动区域不会延伸到列表中。只能滚动少量距离的列表可能在页头完全收拢前到达底部。“更多”列表的返回与标题行固定,详情页的页头随内容滚动。“已安装/发现”标签使用总高 34px 的紧凑控件,选中指示块与外框之间留 2px。副标题随滚动离开视口;有标签时标题也随之滚出,标签在空间足够时停靠到“刷新”“添加插件”旁边。窄页面中,标签与图标操作优先在标题下方共用一行;放不下时,标签始终在操作组上方。滚动过程中两组控件的相对顺序保持不变。静止态与紧凑态分别保留 28px 和 16px 的页面顶部留白,紧凑态控件下方保留 16px。macOS 静止态保留框架的标题栏安全区;折叠态在侧栏展开时上下各留 16px,侧栏收起时再避让框架顶部安全区,使控件位于原生窗口控件下方。仅在 macOS 侧栏收起时,紧凑态控件在原有框架安全区之外的顶部留白统一由 16px 减为 8px,不受窗口宽度影响;静止态布局与紧凑态底部留白均不变。Windows 使用框架已有的标题栏偏移,不重复叠加。分隔线在紧凑页头底部横跨页面,列表初始的顶部留白随内容滚动。悬停样式只在可悬停的指针下生效,点按不会让卡片、行或菜单项停留在悬停态;卡片与图标操作改以按下填充回馈触摸。安装、注册表与筛选输入框在粗指针下使用 16px 字号,iOS Safari 不会因聚焦而放大页面。 已安装的组合包及其插件行在卡片和详情页中,按当前界面语言显示各自的标题与描述。每个字段先读取导出的 locale `meta`,缺失时回退到包根插件可访问的 `package.json`,子路径插件从不读取;标题最终使用完整包名或模块名,两处都没有描述时不提供包描述。作者格式见[插件展示元信息](../../../docs/cookbook/adding-a-package.zh.md#plugin-display-metadata)。组合包卡片、详情和组件行显示包根的清单 `icon` 或导出的 `./icon`,或子路径插件导出的 `<子路径>/icon`;未声明或无法解码时保留默认插画。安装预览仍使用注册表或 manifest 信息。 diff --git a/packages/client/ui-plugin-manager/src/client/PluginManagerPage.module.css b/packages/client/ui-plugin-manager/src/client/PluginManagerPage.module.css index b73c906144..d24d1f08fe 100644 --- a/packages/client/ui-plugin-manager/src/client/PluginManagerPage.module.css +++ b/packages/client/ui-plugin-manager/src/client/PluginManagerPage.module.css @@ -1,4 +1,4 @@ -/* Plugin manager page: the main header and content share one scroller; the header retains its flow height. +/* Plugin manager page: the main header and content share one scroller; the header bar retains its flow height. The More list has a separate fixed head, and detail views scroll with their content. Hover affordances sit under @media (hover: hover): a tap latches :hover, which @@ -99,14 +99,18 @@ .pageBody > .pageBar[data-natural] { position: sticky; top: 0; + height: var(--plugin-header-rest-height); z-index: 2; pointer-events: none; } +/* The bar preserves scroll flow; the header owns only its painted native drag box. + Chromium collects that box without applying clip-path. */ .pageBar[data-natural] .pageHead { position: relative; - height: var(--plugin-header-rest-height); - clip-path: inset(0 0 max(0px, calc(var(--plugin-header-rest-height) - var(--plugin-header-paint-height))) 0); + height: var(--plugin-header-paint-height); + padding-top: 0; + clip-path: inset(0); pointer-events: auto; } diff --git a/packages/client/ui-plugin-manager/src/client/header-scroll.ts b/packages/client/ui-plugin-manager/src/client/header-scroll.ts index 38c74d70ee..e67be9649b 100644 --- a/packages/client/ui-plugin-manager/src/client/header-scroll.ts +++ b/packages/client/ui-plugin-manager/src/client/header-scroll.ts @@ -27,7 +27,7 @@ const PARTS = ['title', 'intro', 'toolbar', 'tabs'] as const /** * Measure the existing resting and compact CSS layouts in an inert, out-of-flow copy. * Their independent flex wrapping requires pixel measurements; interpolating only positioned - * contents leaves the real header's resting footprint and the scroll range unchanged. + * contents leaves the header bar's resting footprint and the scroll range unchanged. * @returns A ref callback that disposes its element observers and scroll listener on detachment. */ export function createPluginHeaderRef(): (element: HTMLDivElement | null) => void { diff --git a/packages/client/ui-settings-account/README.i18n.yaml b/packages/client/ui-settings-account/README.i18n.yaml index ebcb4c7149..d0cb398b89 100644 --- a/packages/client/ui-settings-account/README.i18n.yaml +++ b/packages/client/ui-settings-account/README.i18n.yaml @@ -21,8 +21,8 @@ en: 7ae4e68f9491b068 zh: f7478269bf8d28b3 /deepseek-ai-dsh-client-ui-settings-account/understand-the-implementation: - en: 186b2046cfb5ef76 - zh: 57b042a618fb612e + en: a0da9e739f2aa682 + zh: 27aa6d13dba6f4b4 /deepseek-ai-dsh-client-ui-settings-account/further-exploration: en: f5ca95916ef486dc zh: 1e238d8299e0d838 diff --git a/packages/client/ui-settings-account/README.md b/packages/client/ui-settings-account/README.md index f16fe754b3..2f1bc35161 100644 --- a/packages/client/ui-settings-account/README.md +++ b/packages/client/ui-settings-account/README.md @@ -70,7 +70,7 @@ Access: the account stream, quota notice, settings launcher, account settings se The Account section appears first in Settings only while signed in; it is hidden before account state loads and after sign-out. The plugin owns one Host snapshot stream shared through framework hooks by settings.section and settings.launcher. The launcher opens Settings and offers Sign out only while an account credential is stored. Platform failures leave the menu available for retry. It maintains no independent credential state. -The desktop controller writes progress to `ui-settings-account` through Host settings. Completion first applies `ui-chat.transcriptView` and `ui-chat.performanceUsage` together, then calls the shared Coding Tools preference to persist `ui-settings.enabled`, and finally saves the done marker; a rejected write keeps the flow available for retry. Successful completion reveals the workspace through a 180ms fade; choices and ordinary navigation preview immediately while writes run in order. A failed final queued write restores saved progress and allows retry. Completion waits for queued choices and retains the page until preferences persist; reduced motion skips the fade. Onboarding choices compact, standard, and detailed apply directly to the corresponding Chat work-detail modes. API-key entry and explicit skip select standard; onboarding does not select verbose. Complete Figma illustration layers ship as transparent, lossless 3× WebP [package assets](../AGENTS.md#dependency-declaration); welcome layers are merged with local sidebar blur; recharge uses a 70% opaque foreground window with local blur of the covered illustration, and headings use the bundled Montserrat brand font; English headings and descriptions use Light (300), except the DeepSeek Harness brand within headings uses Medium (500); card titles retain Regular (400) when selected. English footer navigation uses Light (300). Confirmed onboarding sets a 960px minimum window width and enlarges narrower windows; completion releases the minimum without restoring the previous size. Loading or already-completed onboarding does not resize the window. Empty footer navigation space passes pointer events through to the primary action. Cards exclude native window dragging and own the keyboard focus outline for their checkbox. The account package owns its onboarding overlay and control geometry. Each step and the confirmation dialog has a separate component; the flow coordinates navigation, transitions, and recharge. The overlay hides the workspace while initial account and progress state loads. Question headings and cards follow the Figma positions at 1440 × 920 and 960 × 600, independently of their action buttons. On macOS, content clears the body portal’s inherited no-drag region and a first-child drag band leaves an 8px native resize margin; interactive controls and later dialogs exclude their regions, and a native Platform page disables the underlying onboarding band. The upper workspace popup illustration has an opaque background in both languages and themes; the underlying sidebar omits its selected-row highlight. Welcome keeps its illustration at its original size, repositions and clips the artwork in narrow windows, and reveals the complete illustration on wide windows. The [historical onboarding decision](../../../.agents/notes/archived/feature/2026-09-16-desktop-onboarding.md) owns persistence and presentation trade-offs. +The desktop controller writes progress to `ui-settings-account` through Host settings. Completion first applies `ui-chat.transcriptView` and `ui-chat.performanceUsage` together, then calls the shared Coding Tools preference to persist `ui-settings.enabled`, and finally saves the done marker; a rejected write keeps the flow available for retry. Successful completion reveals the workspace through a 180ms fade; choices and ordinary navigation preview immediately while writes run in order. A failed final queued write restores saved progress and allows retry. Completion waits for queued choices and retains the page until preferences persist; reduced motion skips the fade. Onboarding choices compact, standard, and detailed apply directly to the corresponding Chat work-detail modes. API-key entry and explicit skip select standard; onboarding does not select verbose. Complete Figma illustration layers ship as transparent, lossless 3× WebP [package assets](../AGENTS.md#dependency-declaration); welcome layers are merged with local sidebar blur; recharge uses a 70% opaque foreground window with local blur of the covered illustration, and headings use the bundled Montserrat brand font; English headings and descriptions use Light (300), except the DeepSeek Harness brand within headings uses Medium (500); card titles retain Regular (400) when selected. English footer navigation uses Light (300). Confirmed onboarding sets a 960px minimum window width and enlarges narrower windows; completion releases the minimum without restoring the previous size. Loading or already-completed onboarding does not resize the window. Empty footer navigation space passes pointer events through to the primary action. Cards exclude native window dragging and own the keyboard focus outline for their checkbox. The account package owns its onboarding overlay and control geometry. Each step and the confirmation dialog has a separate component; the flow coordinates navigation, transitions, and recharge. The overlay hides the workspace while initial account and progress state loads. Question headings and cards follow the Figma positions at 1440 × 920 and 960 × 600, independently of their action buttons. On macOS, the shell resets inherited window regions on each element, and a first-child drag band leaves an 8px native resize margin. The stage’s `data-window-drag-controls` scope excludes its interactive controls, later dialogs exclude their own boxes, and a native Platform page disables the underlying onboarding band. The upper workspace popup illustration has an opaque background in both languages and themes; the underlying sidebar omits its selected-row highlight. Welcome keeps its illustration at its original size, repositions and clips the artwork in narrow windows, and reveals the complete illustration on wide windows. The [historical onboarding decision](../../../.agents/notes/archived/feature/2026-09-16-desktop-onboarding.md) owns persistence and presentation trade-offs. ## Further Exploration diff --git a/packages/client/ui-settings-account/README.zh.md b/packages/client/ui-settings-account/README.zh.md index 6599e08a22..ef91df8958 100644 --- a/packages/client/ui-settings-account/README.zh.md +++ b/packages/client/ui-settings-account/README.zh.md @@ -70,7 +70,7 @@ Desktop preload 标记在账号凭证已存储后启用引导。进度属于本 仅登录后在设置导航首位显示账号页;账号状态加载完成前以及退出登录后隐藏该页。 插件持有一条 Host 快照流,通过框架 hook 供 settings.section 和 settings.launcher 共享。入口菜单可打开设置,并仅在已存储账号凭证时提供退出登录。Platform 请求失败时保留菜单,以供重试。插件不维护独立凭证状态。 -桌面控制器通过 Host 设置将进度写入 `ui-settings-account`。完成时先一并应用 `ui-chat.transcriptView` 与 `ui-chat.performanceUsage`,再通过共享代码工作工具偏好保存 `ui-settings.enabled`,最后保存完成标记;写入被拒绝时保留引导以供重试。成功完成后通过 180ms 淡出显露工作区;选择和普通翻页立即预览,写入在后台按顺序执行。队列最后一次写入失败时恢复已保存进度,并允许重试。完成操作会等待选择队列及偏好保存成功,再关闭页面;减少动态效果偏好会跳过淡出。onboarding 选项 compact、standard、detailed 直接应用到对应的 Chat 工作过程模式。API Key 进入与显式跳过均采用 standard;onboarding 不选择 verbose。完整 Figma 示意图层以透明、无损编码的 3× WebP [包资源](../AGENTS.md#dependency-declaration)形式提供;欢迎页图层合并并烘焙侧栏局部模糊;充值页前景窗口不透明度为 70%,仅烘焙其覆盖插图区域的模糊,标题使用已打包的 Montserrat 品牌字体,英文标题和描述使用 Light(300),标题中的 DeepSeek Harness 使用 Medium(500);卡片标题选中前后均使用 Regular(400)。英文底部导航使用 Light(300)。确认进入引导后,窗口最小宽度设为 960px,较窄窗口自动放大;完成后解除宽度限制,但不恢复原尺寸。加载中或已完成引导的启动不改变窗口尺寸。底部导航空白区域透过鼠标事件,避免遮挡主操作。卡片区域不参与原生窗口拖动,复选框的键盘焦点仅在卡片外框展示。账号包负责引导覆盖层和控件尺寸样式。每个步骤和确认弹窗各有独立组件,流程组件协调导航、切换动画和充值。初始账号与进度加载期间,覆盖层隐藏工作区。答题标题和卡片独立于操作按钮,位置对齐 Figma 的 1440 × 920 和 960 × 600 断点。macOS 的内容层清除 body 浮层继承的 no-drag,位于内容之前的拖拽层保留 8px 原生缩放边缘;交互控件和后续弹窗排除自身区域;原生平台页面打开时禁用底层引导拖拽层。上方工作区弹窗插画在两种语言和主题下均使用不透明背景,下层侧边栏不绘制选中行高亮。欢迎页保持示意图的原始尺寸,在窄窗口内调整插图位置并裁切,在宽窗口内展示完整插图。[历史引导决策](../../../.agents/notes/archived/feature/2026-09-16-desktop-onboarding.md)记录持久化与展示方面的取舍。 +桌面控制器通过 Host 设置将进度写入 `ui-settings-account`。完成时先一并应用 `ui-chat.transcriptView` 与 `ui-chat.performanceUsage`,再通过共享代码工作工具偏好保存 `ui-settings.enabled`,最后保存完成标记;写入被拒绝时保留引导以供重试。成功完成后通过 180ms 淡出显露工作区;选择和普通翻页立即预览,写入在后台按顺序执行。队列最后一次写入失败时恢复已保存进度,并允许重试。完成操作会等待选择队列及偏好保存成功,再关闭页面;减少动态效果偏好会跳过淡出。onboarding 选项 compact、standard、detailed 直接应用到对应的 Chat 工作过程模式。API Key 进入与显式跳过均采用 standard;onboarding 不选择 verbose。完整 Figma 示意图层以透明、无损编码的 3× WebP [包资源](../AGENTS.md#dependency-declaration)形式提供;欢迎页图层合并并烘焙侧栏局部模糊;充值页前景窗口不透明度为 70%,仅烘焙其覆盖插图区域的模糊,标题使用已打包的 Montserrat 品牌字体,英文标题和描述使用 Light(300),标题中的 DeepSeek Harness 使用 Medium(500);卡片标题选中前后均使用 Regular(400)。英文底部导航使用 Light(300)。确认进入引导后,窗口最小宽度设为 960px,较窄窗口自动放大;完成后解除宽度限制,但不恢复原尺寸。加载中或已完成引导的启动不改变窗口尺寸。底部导航空白区域透过鼠标事件,避免遮挡主操作。卡片区域不参与原生窗口拖动,复选框的键盘焦点仅在卡片外框展示。账号包负责引导覆盖层和控件尺寸样式。每个步骤和确认弹窗各有独立组件,流程组件协调导航、切换动画和充值。初始账号与进度加载期间,覆盖层隐藏工作区。答题标题和卡片独立于操作按钮,位置对齐 Figma 的 1440 × 920 和 960 × 600 断点。在 macOS 上,Shell 为每个元素重置继承的窗口区域,位于内容之前的拖拽层保留 8px 原生缩放边缘。内容层的 `data-window-drag-controls` 范围排除交互控件,后续弹窗排除自身矩形;原生平台页面打开时禁用底层引导拖拽层。上方工作区弹窗插画在两种语言和主题下均使用不透明背景,下层侧边栏不绘制选中行高亮。欢迎页保持示意图的原始尺寸,在窄窗口内调整插图位置并裁切,在宽窗口内展示完整插图。[历史引导决策](../../../.agents/notes/archived/feature/2026-09-16-desktop-onboarding.md)记录持久化与展示方面的取舍。 ## 深入探索 diff --git a/packages/client/ui-sidebar-right/src/client/shell/SidebarRight.module.css b/packages/client/ui-sidebar-right/src/client/shell/SidebarRight.module.css index 09119e640a..94d08c4f24 100644 --- a/packages/client/ui-sidebar-right/src/client/shell/SidebarRight.module.css +++ b/packages/client/ui-sidebar-right/src/client/shell/SidebarRight.module.css @@ -83,11 +83,10 @@ --dsh-dockkit-dock-layer: 40; } -/* No whole-box subtraction here: Electron drag regions are window geometry, - not stacking, so a strip row inside this fullscreen content that marks itself - `data-window-drag` (ui-dockkit) still owns the drag over its own box, and - ui-web base.css subtracts interactive elements and portalled overlays. A - panel-wide no-drag would trade that drag affordance away. */ +/* Dockkit owns its pane exclusions and marked strip rows. Electron composes + their boxes in DOM order: a pane subtracts its box, then a marked strip adds + its row back. ui-web excludes controls within that row and body portals; + this outer panel declares no additional region. */ /* Windows keeps caption controls above fullscreen file and terminal panels. */ :global([data-windows-titlebar]) .panel[data-sidebar-right-panel='fullscreen'] { diff --git a/packages/client/ui-sidebar/src/client/SidebarRoot.module.css b/packages/client/ui-sidebar/src/client/SidebarRoot.module.css index 0a0a91ee00..a9de41653f 100644 --- a/packages/client/ui-sidebar/src/client/SidebarRoot.module.css +++ b/packages/client/ui-sidebar/src/client/SidebarRoot.module.css @@ -223,7 +223,7 @@ single darwin rule carries the drag over its own box — below the top strip (40–100px: the strip's 52px foot with the row's -12px tuck). The brand rides that box (SidebarRoot renders the wordmark as a plain span there, so the - global interactive no-drag rule never subtracts it; only the local-build + drag-row controls rule never subtracts it; only the local-build fallbacks opt out through .copyVersion); the dedicated New Session button below keeps the pointer and keyboard paths. Safe as a drag source: it precedes the sidebar's overlay slots in document order, so their diff --git a/packages/client/ui-sidebar/src/client/SidebarRoot.tsx b/packages/client/ui-sidebar/src/client/SidebarRoot.tsx index 114e258ee6..b573b19cc8 100644 --- a/packages/client/ui-sidebar/src/client/SidebarRoot.tsx +++ b/packages/client/ui-sidebar/src/client/SidebarRoot.tsx @@ -331,7 +331,7 @@ export function SidebarRoot({ {/* Expanded, the brand doubles as a New Session shortcut while the access snapshot allows `session/create` — except on macOS, where it stays part of the logo row's window-drag surface - (a button would subtract itself through the global no-drag rule); + (the drag-row controls rule would subtract a button); the collapsed rail's logo is the expand toggle below instead. Mouse clicks on the local-build fallbacks copy the version instead. */} {wide && (() => { diff --git a/packages/client/ui-sidebar/tests/sidebar-root.client.spec.tsx b/packages/client/ui-sidebar/tests/sidebar-root.client.spec.tsx index 040b994806..f6b1b391c6 100644 --- a/packages/client/ui-sidebar/tests/sidebar-root.client.spec.tsx +++ b/packages/client/ui-sidebar/tests/sidebar-root.client.spec.tsx @@ -457,7 +457,7 @@ it('keeps the macOS sidebar toggle in its top strip', () => { fireEvent.click(screen.getByRole('button', { name: en['toggle.collapse'] })) expect(shell.toggleSidebar).toHaveBeenCalledOnce() // The brand stays part of the logo row's window-drag surface: no button - // role (the global no-drag rule would subtract it); only the dedicated + // role (the drag-row controls rule would subtract it); only the dedicated // New Session capsule starts a session. expect(screen.getAllByRole('button', { name: 'New session' })).toHaveLength(1) expect(screen.getByTestId('custom-brand-mark')).toBeTruthy() diff --git a/packages/client/web/README.i18n.yaml b/packages/client/web/README.i18n.yaml index b38bd3fc98..f98fe8a099 100644 --- a/packages/client/web/README.i18n.yaml +++ b/packages/client/web/README.i18n.yaml @@ -30,8 +30,8 @@ en: 942959cb40ee31a1 zh: 9c86ac2cf6a13976 /deepseek-ai-dsh-client-web/understand-the-implementation: - en: f9c91f5242372ae9 - zh: 52bd019c4b60f296 + en: c8f7a59e69c49180 + zh: b6a7de1a91871e95 /deepseek-ai-dsh-client-web/understand-the-implementation/design-concept: en: a8e8f2e466eff0a1 zh: e0216136dcf36934 diff --git a/packages/client/web/README.md b/packages/client/web/README.md index 17ad553727..e7acd458c0 100644 --- a/packages/client/web/README.md +++ b/packages/client/web/README.md @@ -59,7 +59,7 @@ The package accepts no plugin config of its own; the generated [configuration ca Menus use the shared `MenuSurface` material, including the macOS backing for background blur; custom content follows the [menu rules](../../../docs/web-styling.md#component-rules). -On macOS, native window regions use full element boxes without overflow clipping. The shell resets inherited regions and limits automatic control exclusions to `data-window-drag` rows or explicit `data-window-drag-controls` scopes. Scrollable content outside those scopes contributes no region. A terminal interactive viewport uses `data-window-no-drag` to exclude only its own box, without nested drag rows; covering overlays and containers with their own drag rows declare their regions separately. Body portals need a real box, or an explicit exclusion on their visible content. +On macOS, native window regions use full element boxes without overflow clipping. The shell resets inherited regions and limits automatic control exclusions to `data-window-drag` rows or explicit `data-window-drag-controls` scopes. Scrollable content outside those scopes receives no automatic exclusion. An interactive viewport without nested drag rows uses `data-window-no-drag` to exclude only its own box; covering overlays and containers with their own drag rows declare their regions separately. Body portals need a real box, or an explicit exclusion on their visible content.
Implementation internals — click to expand diff --git a/packages/client/web/README.zh.md b/packages/client/web/README.zh.md index 48055afe2f..647e1521c0 100644 --- a/packages/client/web/README.zh.md +++ b/packages/client/web/README.zh.md @@ -59,7 +59,7 @@ Web 和 Desktop 的数学公式渲染要求支持 WOFF2。[Web 构建](../../../ 菜单采用共享 `MenuSurface` 材质,包括用于背景模糊的 macOS 底层;自定义内容遵循[菜单规则](../../../docs/web-styling.zh.md#component-rules)。 -在 macOS 上,原生窗口区域使用元素完整矩形,不考虑 overflow 裁剪。Shell 重置继承的区域,并将控件的自动排除限制在 `data-window-drag` 行或显式 `data-window-drag-controls` 范围内。范围外的滚动内容不贡献区域。不含嵌套拖动行的交互视口使用 `data-window-no-drag`,仅排除自身矩形;覆盖浮层和含自有拖动行的容器单独声明区域。Body portal 必须具有实际矩形,否则需在可见内容上显式声明排除。 +在 macOS 上,原生窗口区域使用元素完整矩形,不考虑 overflow 裁剪。Shell 重置继承的区域,并将控件的自动排除限制在 `data-window-drag` 行或显式 `data-window-drag-controls` 范围内。范围外的滚动内容不会获得自动排除。不含嵌套拖动行的交互视口使用 `data-window-no-drag`,仅排除自身矩形;覆盖浮层和含自有拖动行的容器单独声明区域。Body portal 必须具有实际矩形,否则需在可见内容上显式声明排除。
实现细节——点击展开 diff --git a/packages/client/web/src/base.css b/packages/client/web/src/base.css index a7a66c7255..549c64d95a 100644 --- a/packages/client/web/src/base.css +++ b/packages/client/web/src/base.css @@ -44,9 +44,9 @@ html[data-platform='darwin'] body { isolation: isolate; } -/* Chromium inherits app-region and collects full boxes without overflow clips. - Only explicit owners may contribute geometry: a clipped descendant must not - subtract a chrome row after scrolling outside its visible container. */ +/* The shipped Electron runtime inherits app-region and collects full boxes + without overflow clips. Only explicit owners contribute geometry, so clipped + descendants cannot subtract a chrome row after scrolling outside its view. */ :where(html[data-platform='darwin'] *) { -webkit-app-region: initial; } @@ -78,7 +78,8 @@ html[data-platform='darwin'] body > :not(#root) { -webkit-app-region: no-drag; } -/* A terminal interactive viewport owns one box; its clipped descendants do not. +/* An interactive viewport without nested drag rows owns one box; its clipped + descendants do not. Containers with nested drag rows must instead declare their own region. */ html[data-platform='darwin'] [data-window-no-drag] { -webkit-app-region: no-drag; @@ -99,8 +100,9 @@ html[data-platform='darwin'] :where([data-window-drag], [data-window-drag-contro -webkit-app-region: no-drag; } -/* Reset both native region types for inert content. Chromium treats the explicit - `none` keyword as `no-drag`, which would erase foreground drag rows. */ +/* Reset both native region types for inert content. In the shipped Electron + runtime, authored `none` computes to `no-drag`; `initial` computes to `none` + and contributes no box, so it cannot erase foreground drag rows. */ html[data-platform='darwin'] [inert], html[data-platform='darwin'] [inert] * { -webkit-app-region: initial; diff --git a/packages/client/web/src/window-drag/regions.ts b/packages/client/web/src/window-drag/regions.ts index dac9bd2830..28892096bd 100644 --- a/packages/client/web/src/window-drag/regions.ts +++ b/packages/client/web/src/window-drag/regions.ts @@ -2,9 +2,11 @@ * The window drag-region contract for the macOS desktop shell: Electron hands * the page's `-webkit-app-region` boxes to the native window, which hit-tests * them by geometry in DOM order, ignoring stacking and overflow clipping. - * Chromium inherits the property; base.css resets it on each element so only - * explicit owners contribute boxes. Blink collects visible layout boxes whose - * computed value is not `none`: `drag` adds geometry and `no-drag` removes it. + * The shipped Electron runtime inherits the property; base.css resets it on each + * element so only explicit owners contribute boxes. Authored `none` computes to + * `no-drag`, while `initial` computes to `none` and contributes no box. Blink + * collects visible layout boxes with computed `drag` or `no-drag` values: + * `drag` adds geometry and `no-drag` removes it. * A point is draggable when the last collected box containing it is `drag`. * * This module is the executable statement of that rule. Production CSS authors @@ -48,9 +50,10 @@ export const RECALL_MARK = 'data-window-drag-recall' /** * The interactive-element selector that subtracts controls inside marked drag - * rows or explicit controls scopes. Terminal no-drag viewports own their whole - * box instead of their clipped controls. ui-web `base.css` scopes this on darwin; - * this constant is the source that sheet and its contract spec compare against. + * rows or explicit controls scopes. Interactive viewports without nested drag + * rows own their whole box instead of their clipped controls. ui-web `base.css` + * scopes this on darwin; this constant is the source that sheet and its contract + * spec compare against. */ export const INTERACTIVE_SELECTOR = [ 'button', 'a', 'input', 'select', 'textarea', 'summary', "[contenteditable='true']", '[tabindex]', diff --git a/tsconfig.host.json b/tsconfig.host.json index dcd046e36b..a77c9d6ee2 100644 --- a/tsconfig.host.json +++ b/tsconfig.host.json @@ -237,6 +237,7 @@ "apps/web/tests/conversation-view-tabs.e2e.ts", "apps/web/tests/composer-shortcuts.e2e.ts", "apps/web/tests/window-drag-coverage.e2e.ts", + "apps/web/tests/window-drag-inheritance.e2e.ts", "apps/web/tests/complex-history.perf.ts", "apps/web/tests/pwsh-terminal.e2e.ts", "apps/web/tests/workflow-run.e2e.ts", From 630cd17b86521913466b3ba6e60e547e667ef38c Mon Sep 17 00:00:00 2001 From: Xinyu Yang Date: Wed, 4 Nov 2026 13:14:42 +0800 Subject: [PATCH 242/322] fix(client): simplify window drag exclusions and coverage --- ...19-window-drag-coverage-contract.i18n.yaml | 4 +- ...026-09-19-window-drag-coverage-contract.md | 2 +- ...-09-19-window-drag-coverage-contract.zh.md | 2 +- apps/web/tests/desktop-onboarding.e2e.ts | 11 +-- apps/web/tests/support.ts | 62 +++++++++++++++++ apps/web/tests/window-drag-coverage.e2e.ts | 68 +++++-------------- .../src/components/dockkit.module.css | 5 +- .../tests/app-region-styles.client.spec.ts | 4 +- 8 files changed, 88 insertions(+), 70 deletions(-) diff --git a/.agents/notes/implemented/architecture/2026-09-19-window-drag-coverage-contract.i18n.yaml b/.agents/notes/implemented/architecture/2026-09-19-window-drag-coverage-contract.i18n.yaml index 9519360e77..326985060c 100644 --- a/.agents/notes/implemented/architecture/2026-09-19-window-drag-coverage-contract.i18n.yaml +++ b/.agents/notes/implemented/architecture/2026-09-19-window-drag-coverage-contract.i18n.yaml @@ -18,8 +18,8 @@ en: 3fd5dae1e0e941df zh: 3d08c93ebef37e09 /agent-note-window-drag-coverage-as-a-contract/testing: - en: 52b96360a9cdb605 - zh: ed370a98e7b258e4 + en: a1ef0400a5661962 + zh: 93f508fc38e0e83c /agent-note-window-drag-coverage-as-a-contract/manual-state-matrix: en: 20a0ef140cf73bb5 zh: e66b97049abe7364 diff --git a/.agents/notes/implemented/architecture/2026-09-19-window-drag-coverage-contract.md b/.agents/notes/implemented/architecture/2026-09-19-window-drag-coverage-contract.md index b74852e142..8731b264e2 100644 --- a/.agents/notes/implemented/architecture/2026-09-19-window-drag-coverage-contract.md +++ b/.agents/notes/implemented/architecture/2026-09-19-window-drag-coverage-contract.md @@ -45,7 +45,7 @@ The native half — whether a press really drags or reaches the page — stays a - `packages/client/web/tests/window-drag-regions.client.spec.ts` — the composition rule, including order sensitivity and box edges. - `packages/client/web/tests/base-styles.client.spec.ts` — base.css declares the model's interactive selector and control scopes, element-level reset, viewport exclusion, the one darwin drag rule, and the recall mark's subtraction. - `packages/client/ui-theme/tests/app-region-styles.client.spec.ts` — drag ownership, the row manifest, and each row's mark; a mark outside the manifest or a changed row height fails. -- `packages/client/ui-dockkit/tests/app-region-styles.client.spec.ts` — panes, strip-end chrome, pane bodies, floats, and dividers exclude their boxes; strip-row drag belongs to the markup mark, so the sheet declares no drag. +- `packages/client/ui-dockkit/tests/app-region-styles.client.spec.ts` — panes, strip-end chrome, floats, and dividers exclude their boxes; a pane's exclusion covers its body. Strip-row drag belongs to the markup mark, so the sheet declares no drag. - `packages/client/web/tests/window-drag-recall.client.spec.ts` — the watcher through its two seams: what re-arms it, what it ignores, the settle loop, the shell defaults, and disposal. - `apps/web/tests/window-drag-coverage.e2e.ts` — real Chromium: controls are probed separately from region owners, clipped transcript and tab content cannot subtract headers, fullscreen right panels with floating panes retain their intended exclusions, and inert retained panels do not affect foreground rows. The compact plugin-manager header scenario checks that the marked header box does not extend over list controls. Per-row probes, detail-page body exclusion, overlays, and the right-panel recall pulse remain covered. - `apps/web/tests/window-drag-inheritance.e2e.ts` — the installed Chrome reports its version and exercises inherited exclusions, the production reset, authored `none` versus `initial`, and a removed-reset negative control. A missing Chrome installation or runtime without inheritance support explicitly skips this scenario; assertions and other startup failures fail. The regular Chromium 149 lane does not implement inheritance, so it cannot establish reset behavior by itself. diff --git a/.agents/notes/implemented/architecture/2026-09-19-window-drag-coverage-contract.zh.md b/.agents/notes/implemented/architecture/2026-09-19-window-drag-coverage-contract.zh.md index 9f2c99beb8..cdb32670e8 100644 --- a/.agents/notes/implemented/architecture/2026-09-19-window-drag-coverage-contract.zh.md +++ b/.agents/notes/implemented/architecture/2026-09-19-window-drag-coverage-contract.zh.md @@ -45,7 +45,7 @@ macOS 桌面窗口的可拖区域被写了两遍。布局决定 chrome 行在哪 - `packages/client/web/tests/window-drag-regions.client.spec.ts` —— 合成规则,含顺序敏感与盒子边界。 - `packages/client/web/tests/base-styles.client.spec.ts` —— base.css 声明模型的交互选择器和控件作用范围、逐元素重置、视口排除、唯一那条 darwin drag 规则,以及 recall 标记的减除。 - `packages/client/ui-theme/tests/app-region-styles.client.spec.ts` —— 拖拽所有权、行清单与每行的标记;清单之外的标记或行高变化即失败。 -- `packages/client/ui-dockkit/tests/app-region-styles.client.spec.ts` —— 面板、strip 末端 chrome、面板正文、浮动面板和分隔条排除自身矩形;strip 行的 drag 属于 markup 标记,因此样式表不声明 drag。 +- `packages/client/ui-dockkit/tests/app-region-styles.client.spec.ts` —— 面板、strip 末端 chrome、浮动面板和分隔条排除自身矩形;面板的排除矩形覆盖其正文。strip 行的 drag 属于 markup 标记,因此样式表不声明 drag。 - `packages/client/web/tests/window-drag-recall.client.spec.ts` —— 通过两个 seam 驱动 watcher:什么会重新启动它、什么被它忽略、收敛循环、外壳默认值,以及销毁。 - `apps/web/tests/window-drag-coverage.e2e.ts` —— 真 Chromium:控件与区域所有者分开探测,被裁剪的转录区与标签内容不能减除页头,含浮动面板的全屏右栏保留预期排除,inert 的保留面板不影响前景行。插件管理页头的紧凑态场景检查标记页头的矩形不会延伸到列表控件上方。逐行探测、详情页正文排除、浮层和右栏 recall 脉冲仍有覆盖。 - `apps/web/tests/window-drag-inheritance.e2e.ts` —— 已安装的 Chrome 报告版本,并验证继承的排除、生产重置、显式 `none` 与 `initial` 的区别,以及移除重置的负对照。未安装 Chrome 或运行时不支持属性继承时,显式跳过本场景;断言和其他启动错误正常失败。常规 Chromium 149 车道不实现继承,因此单靠该车道不能验证重置行为。 diff --git a/apps/web/tests/desktop-onboarding.e2e.ts b/apps/web/tests/desktop-onboarding.e2e.ts index ed1a41e8e8..c275135057 100644 --- a/apps/web/tests/desktop-onboarding.e2e.ts +++ b/apps/web/tests/desktop-onboarding.e2e.ts @@ -15,7 +15,7 @@ import { acknowledgeReloadConnectionLoss, captureStableAria, compareOrRefreshGolden, launchWebScaffold, watchConsole, webSnapshotMode, type WebScaffold, } from './scaffold.ts' -import { REPO_ROOT, saveFailureShot, ZH_BROWSER_LOCALE } from './support.ts' +import { collectWindowSurface, REPO_ROOT, saveFailureShot, ZH_BROWSER_LOCALE } from './support.ts' const MODE = webSnapshotMode() const EXPECTED = fileURLToPath(new URL('./expected/desktop-onboarding', import.meta.url)) @@ -255,14 +255,7 @@ describe.skipIf(MODE === 'record')('web e2e: App-only desktop onboarding', () => expect(await page.getByRole('button', { name: '开始设置', exact: true }).evaluate(element => getComputedStyle(element).getPropertyValue('-webkit-app-region'))).toBe(platform === 'darwin' ? 'no-drag' : 'none') if (platform === 'darwin') { expect(await page.locator('[data-window-drag-controls] [data-desktop-onboarding]').count()).toBe(1) - const regions = await page.evaluate(() => Array.from(document.querySelectorAll('*')).flatMap((element) => { - const style = getComputedStyle(element) - const region = style.getPropertyValue('app-region') - const rect = element.getBoundingClientRect() - if ((region !== 'drag' && region !== 'no-drag') || style.visibility === 'hidden' - || rect.width === 0 || rect.height === 0) return [] - return [{ x: rect.x, y: rect.y, width: rect.width, height: rect.height, draggable: region === 'drag' }] - })) + const { regions } = await collectWindowSurface(page) const band = await page.locator('[data-window-drag-controls]').locator('..').locator('[data-window-drag]').boundingBox() const button = await page.getByRole('button', { name: '开始设置', exact: true }).boundingBox() if (band === null || button === null) throw new Error('The onboarding drag fixture has no layout box') diff --git a/apps/web/tests/support.ts b/apps/web/tests/support.ts index 048e3e1f6d..cda15bafaf 100644 --- a/apps/web/tests/support.ts +++ b/apps/web/tests/support.ts @@ -6,12 +6,74 @@ import { join } from 'node:path' import { fileURLToPath } from 'node:url' import type { Browser, Locator, Page } from 'playwright' import { expect, vi, type MockInstance } from 'vitest' +import type { RegionRect } from '@deepseek-ai/dsh-client-web/src/window-drag/regions.ts' /** The built page under test; `pnpm run test:web` rebuilds it before running. */ export const DIST_INDEX = fileURLToPath(new URL('../dist/index.html', import.meta.url)) export const REPO_ROOT = fileURLToPath(new URL('../../..', import.meta.url)) +/** A visible control, including controls that declare no native window region. */ +interface WindowControlBox extends Omit { + /** Sample points where the browser hit test reaches this control or its content. */ + readonly hits: readonly (readonly [number, number])[] +} + +/** Native region owners and optional control probes from one browser evaluation. */ +export interface CollectedWindowSurface { + readonly regions: readonly RegionRect[] + /** Empty when no control probe was requested. */ + readonly controls: readonly WindowControlBox[] +} + +/** Controls to probe alongside the native region owners. */ +interface WindowControlProbe { + readonly selector: string + /** Containers whose nested drag rows own their pixels independently of the container. */ + readonly containersWithDragRows: string +} + +/** + * Collect visible native window regions in DOM order and optionally probe controls in the same frame. + * Controls with computed `none` contribute no native rectangle but still receive hit-test probes. + * @param page - Page whose current layout is sampled. + * @param controlProbe - Control selectors; omit when only native regions are needed. + * @returns Native regions with unclipped bounds and independently sampled controls. + */ +export async function collectWindowSurface(page: Page, controlProbe?: WindowControlProbe): Promise { + return page.evaluate((probe) => { + const regions: RegionRect[] = [] + const controls: WindowControlBox[] = [] + for (const element of document.querySelectorAll('*')) { + const style = getComputedStyle(element) + const region = style.getPropertyValue('-webkit-app-region') + if (style.visibility === 'hidden' || style.display === 'none') continue + const rect = element.getBoundingClientRect() + if (rect.width === 0 || rect.height === 0) continue + const box = { x: rect.x, y: rect.y, width: rect.width, height: rect.height } + if (region === 'drag' || region === 'no-drag') regions.push({ ...box, draggable: region === 'drag' }) + if (probe === undefined || !element.matches(probe.selector)) continue + const insetX = Math.min(2, rect.width / 4) + const insetY = Math.min(2, rect.height / 4) + const samples: [number, number][] = [ + [rect.x + rect.width / 2, rect.y + rect.height / 2], + [rect.x + insetX, rect.y + insetY], + [rect.x + rect.width - insetX, rect.y + insetY], + [rect.x + insetX, rect.y + rect.height - insetY], + [rect.x + rect.width - insetX, rect.y + rect.height - insetY], + ] + const hits = samples.filter(([x, y]) => { + const top = document.elementFromPoint(x, y) + const strip = top?.closest('[data-window-drag]') + if (element.matches(probe.containersWithDragRows) && strip != null && element.contains(strip)) return false + return top !== null && (top === element || element.contains(top)) + }) + controls.push({ ...box, hits }) + } + return { regions, controls } + }, controlProbe) +} + /** * Read the `meta.description` an experimental bundle's plugin page shows for one locale. * @param bundle - Package directory under `packages/experimental`. diff --git a/apps/web/tests/window-drag-coverage.e2e.ts b/apps/web/tests/window-drag-coverage.e2e.ts index fe519f1cee..dda904a96e 100644 --- a/apps/web/tests/window-drag-coverage.e2e.ts +++ b/apps/web/tests/window-drag-coverage.e2e.ts @@ -26,19 +26,10 @@ import { INTERACTIVE_SELECTOR, RECALL_MARK, isDraggableAt, type RegionRect, } from '@deepseek-ai/dsh-client-web/src/window-drag/regions.ts' import { launchWebScaffold, watchConsole, type WebScaffold } from './scaffold.ts' -import { connectFreshWorkspace, expandOwningTurnProcess, newEnglishPage, saveFailureShot } from './support.ts' - -/** An interactive box, including controls that declare no native region. */ -interface InteractiveBox extends Rect { - /** Sample points at which the browser's hit test reaches this element or its content. */ - readonly hits: readonly (readonly [number, number])[] -} - -/** Native region owners and hittable controls describe separate parts of the same frame. */ -interface CollectedSurface { - readonly regions: readonly RegionRect[] - readonly controls: readonly InteractiveBox[] -} +import { + collectWindowSurface, connectFreshWorkspace, expandOwningTurnProcess, newEnglishPage, saveFailureShot, + type CollectedWindowSurface, +} from './support.ts' /** A point the coverage table claims something about. */ interface CoverageProbe { @@ -85,41 +76,11 @@ async function rectOf(page: Page, selector: string): Promise { * @param selector - the interactive element selector. * @returns native region boxes and independently sampled controls. */ -async function collectedSurface(page: Page, selector: string): Promise { - return page.evaluate((interactiveSelector) => { - const regions: RegionRect[] = [] - const controls: InteractiveBox[] = [] - for (const element of Array.from(document.querySelectorAll('*'))) { - const style = getComputedStyle(element) - const region = style.getPropertyValue('-webkit-app-region') - if (style.visibility === 'hidden' || style.display === 'none') continue - const rect = element.getBoundingClientRect() - if (rect.width === 0 || rect.height === 0) continue - const box = { x: rect.x, y: rect.y, width: rect.width, height: rect.height } - if (region === 'drag' || region === 'no-drag') regions.push({ ...box, draggable: region === 'drag' }) - if (!element.matches(interactiveSelector)) continue - const insetX = Math.min(2, rect.width / 4) - const insetY = Math.min(2, rect.height / 4) - const samples: [number, number][] = [ - [rect.x + rect.width / 2, rect.y + rect.height / 2], - [rect.x + insetX, rect.y + insetY], - [rect.x + rect.width - insetX, rect.y + insetY], - [rect.x + insetX, rect.y + rect.height - insetY], - [rect.x + rect.width - insetX, rect.y + rect.height - insetY], - ] - const hits = samples.filter(([x, y]) => { - const top = document.elementFromPoint(x, y) - // Panes and the navigation dialog contain their own window-drag rows. - // Those rows own their pixels; controls inside still subtract themselves. - const strip = top?.closest('[data-window-drag]') - if (element.matches('[data-dockkit-pane][tabindex="-1"], [data-shortcut-modal="sidebar"][role="dialog"]') - && strip != null && element.contains(strip)) return false - return top !== null && (top === element || element.contains(top)) - }) - controls.push({ ...box, hits }) - } - return { regions, controls } - }, selector) +async function collectedSurface(page: Page, selector: string): Promise { + return collectWindowSurface(page, { + selector, + containersWithDragRows: '[data-dockkit-pane][tabindex="-1"], [data-shortcut-modal="sidebar"][role="dialog"]', + }) } /** @param page - the page under test. @param selector - the control selector. @returns native region owners in DOM order. */ @@ -136,7 +97,7 @@ async function collectedRegions(page: Page, selector: string): Promise region.hits.some(([x, y]) => isDraggableAt(surface.regions, x, y))) .map(region => `${Math.round(region.x)},${Math.round(region.y)} ${Math.round(region.width)}x${Math.round(region.height)}`) @@ -178,7 +139,7 @@ async function settled(page: Page): Promise { /** * Scroll a content box above its scrollport while its untrimmed bounds overlap window chrome. - * @param target - Rendered content whose geometry Electron collects without overflow clipping. + * @param target - Content whose full bounds can overlap chrome while clipped by its scrollport. * @param scrollport - The content's actual scrolling owner. * @param chrome - The chrome row that must retain its drag pixels. * @returns A point inside the clipped content box and the chrome row. @@ -364,7 +325,7 @@ describe('web e2e: macOS window drag coverage', () => { } finally { await page.close() } }) - it('keeps no-drag subtraction within pane bodies and horizontally scrolling tab viewports', async () => { + it('keeps no-drag subtraction within panes and horizontally scrolling tab viewports', async () => { const { page, tripwire } = await desktopPage() try { await connectTranscriptWorkspace(page, 'scrolled-drag-pane') @@ -387,9 +348,12 @@ describe('web e2e: macOS window drag coverage', () => { const child = body.locator('[data-drag-scroll-fixture]') const strip = await rectOf(page, '[data-dockkit-strip]') const [x, y] = await scrollBehindChrome(child, body, strip) - expect(await body.evaluate(element => getComputedStyle(element).getPropertyValue('app-region'))).toBe('no-drag') expect(await child.evaluate(element => getComputedStyle(element).getPropertyValue('app-region'))).toBe('none') const regions = await collectedRegions(page, INTERACTIVE_SELECTOR) + const bodyBox = await body.boundingBox() + if (bodyBox === null) throw new Error('The pane body has no layout box') + expect(isDraggableAt(regions, bodyBox.x + bodyBox.width / 2, bodyBox.y + bodyBox.height / 2), + 'pane content remains outside the drag surface').toBe(false) expect(isDraggableAt(regions, x, y), 'scrolled descendants do not subtract the pane tab strip').toBe(true) const tabs = panel.locator('[data-dockkit-strip-tabs]').first() diff --git a/packages/client/ui-dockkit/src/components/dockkit.module.css b/packages/client/ui-dockkit/src/components/dockkit.module.css index aeb33eaff8..7d75cec198 100644 --- a/packages/client/ui-dockkit/src/components/dockkit.module.css +++ b/packages/client/ui-dockkit/src/components/dockkit.module.css @@ -307,14 +307,13 @@ /* macOS desktop: an embedder may pin this surface at the window's top edge. Panes always subtract their whole boxes; a marked strip adds its row back - unless floating panes disable that mark. Strip-end chrome, pane bodies, - floats, and dividers also exclude their boxes. The divider is a plain div + unless floating panes disable that mark. Strip-end chrome, floats, and + dividers also exclude their boxes. The divider is a plain div outside a drag row, so ui-web's scoped controls rule cannot exclude it. Keep these selectors at (0,1,0): ui-web's inert reset at (0,2,1) must win when an overlay makes the retained panes inactive. */ :global(:where(html[data-platform='darwin'])) .pane, :global(:where(html[data-platform='darwin'])) .stripChrome, -:global(:where(html[data-platform='darwin'])) .paneBody, :global(:where(html[data-platform='darwin'])) .float, :global(:where(html[data-platform='darwin'])) .divider { -webkit-app-region: no-drag; diff --git a/packages/client/ui-dockkit/tests/app-region-styles.client.spec.ts b/packages/client/ui-dockkit/tests/app-region-styles.client.spec.ts index 0d13fe6c38..eb5b206436 100644 --- a/packages/client/ui-dockkit/tests/app-region-styles.client.spec.ts +++ b/packages/client/ui-dockkit/tests/app-region-styles.client.spec.ts @@ -43,14 +43,14 @@ it('clamps a resting floating panel\'s position and size into the viewport and b }) describe('macOS app-region ownership', () => { - it('subtracts panes, strip-end chrome, pane bodies, and dividers without declaring drag', () => { + it('subtracts panes, strip-end chrome, floats, and dividers without declaring drag', () => { // The strip row's drag is the markup mark's job: a sheet that declares it // here would drag the same box twice and hide the row from the ownership gate. expect(regionRules).toHaveLength(1) const [selector, value] = regionRules[0]! expect(value).toBe('no-drag') - for (const part of ['.pane', '.stripChrome', '.paneBody', '.float', '.divider']) { + for (const part of ['.pane', '.stripChrome', '.float', '.divider']) { expect(selector, part).toContain(`:global(:where(html[data-platform='darwin'])) ${part}`) } }) From 596bd317d62d5ae44e647783395f757218093c04 Mon Sep 17 00:00:00 2001 From: Xinyu Yang Date: Thu, 5 Nov 2026 16:09:52 +0800 Subject: [PATCH 243/322] docs: move window drag upgrade guide to current version --- .../window-drag-regions/guide.i18n.yaml | 10 +++++----- .../window-drag-regions/guide.md | 2 +- .../window-drag-regions/guide.zh.md | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) rename docs/upgrade-guide/{v0.2.2-alpha.2 => v0.2.2-rc.1}/window-drag-regions/guide.i18n.yaml (80%) rename docs/upgrade-guide/{v0.2.2-alpha.2 => v0.2.2-rc.1}/window-drag-regions/guide.md (77%) rename docs/upgrade-guide/{v0.2.2-alpha.2 => v0.2.2-rc.1}/window-drag-regions/guide.zh.md (77%) diff --git a/docs/upgrade-guide/v0.2.2-alpha.2/window-drag-regions/guide.i18n.yaml b/docs/upgrade-guide/v0.2.2-rc.1/window-drag-regions/guide.i18n.yaml similarity index 80% rename from docs/upgrade-guide/v0.2.2-alpha.2/window-drag-regions/guide.i18n.yaml rename to docs/upgrade-guide/v0.2.2-rc.1/window-drag-regions/guide.i18n.yaml index 7f78c4bd48..1ef6553300 100644 --- a/docs/upgrade-guide/v0.2.2-alpha.2/window-drag-regions/guide.i18n.yaml +++ b/docs/upgrade-guide/v0.2.2-rc.1/window-drag-regions/guide.i18n.yaml @@ -1,16 +1,16 @@ # Bilingual-pair consistency record for guide.md (docs/i18n/README.md): per heading # section, a hash of its English and Chinese blocks outside code blocks and generated regions. # After editing either side, bring the other along and re-record with: -# pnpm run verify-translation-pairing --write docs/upgrade-guide/v0.2.2-alpha.2/window-drag-regions/guide.md +# pnpm run verify-translation-pairing --write docs/upgrade-guide/v0.2.2-rc.1/window-drag-regions/guide.md /: en: 3733ed8d0c40fb64 zh: f886cd8c61db2bd8 /explicit-window-regions-for-custom-client-overlays: - en: 204e72b8ba3cff5b - zh: 9ce7f4f9f82341bd + en: bf86e50c82443b79 + zh: 4b7a14fa9c3e60b7 /explicit-window-regions-for-custom-client-overlays/change: - en: 0fe54065e1f871e7 - zh: 3a8cff5d8233eba0 + en: a3c55aed10fdeeb8 + zh: dd628088de04631f /explicit-window-regions-for-custom-client-overlays/migration: en: 85182ed7759e7a18 zh: 48b0f9de217a9087 diff --git a/docs/upgrade-guide/v0.2.2-alpha.2/window-drag-regions/guide.md b/docs/upgrade-guide/v0.2.2-rc.1/window-drag-regions/guide.md similarity index 77% rename from docs/upgrade-guide/v0.2.2-alpha.2/window-drag-regions/guide.md rename to docs/upgrade-guide/v0.2.2-rc.1/window-drag-regions/guide.md index 53a5a6acd1..11007b6753 100644 --- a/docs/upgrade-guide/v0.2.2-alpha.2/window-drag-regions/guide.md +++ b/docs/upgrade-guide/v0.2.2-rc.1/window-drag-regions/guide.md @@ -9,7 +9,7 @@ English | [中文](guide.zh.md) ## Change -After upgrading from 0.2.2-alpha.2, macOS Desktop automatically excludes interactive controls only inside `data-window-drag` rows or `data-window-drag-controls` scopes. Previously, matching controls and ARIA roles anywhere in the application received `no-drag`. Custom Client plugins that relied on that rule for content covering a draggable header must now declare an exclusion. Ordinary scrollable content without an explicit region declaration contributes no region, so content clipped above its viewport no longer blocks header dragging. +After upgrading from 0.2.2-rc.1, macOS Desktop automatically excludes interactive controls only inside `data-window-drag` rows or `data-window-drag-controls` scopes. Previously, matching controls and ARIA roles anywhere in the application received `no-drag`. Custom Client plugins that relied on that rule for content covering a draggable header must now declare an exclusion. Ordinary scrollable content without an explicit region declaration contributes no region, so content clipped above its viewport no longer blocks header dragging. This affects custom overlays outside those scopes that cover a drag row. Controls already inside a marked row, overlays using shared primitives with their own exclusions, and components with explicit `no-drag` declarations need no migration. The rule applies only to macOS Desktop; plain Web and Windows behavior is unchanged. diff --git a/docs/upgrade-guide/v0.2.2-alpha.2/window-drag-regions/guide.zh.md b/docs/upgrade-guide/v0.2.2-rc.1/window-drag-regions/guide.zh.md similarity index 77% rename from docs/upgrade-guide/v0.2.2-alpha.2/window-drag-regions/guide.zh.md rename to docs/upgrade-guide/v0.2.2-rc.1/window-drag-regions/guide.zh.md index 1f1cfd4570..2e9ade528a 100644 --- a/docs/upgrade-guide/v0.2.2-alpha.2/window-drag-regions/guide.zh.md +++ b/docs/upgrade-guide/v0.2.2-rc.1/window-drag-regions/guide.zh.md @@ -9,7 +9,7 @@ description: "依赖 macOS 全局 no-drag 排除的自定义 Client 浮层必须 ## 变更 -从 0.2.2-alpha.2 升级后,macOS Desktop 仅自动排除 `data-window-drag` 行或 `data-window-drag-controls` 范围内的交互控件。此前,应用中任意位置匹配的控件和 ARIA role 都会获得 `no-drag`。自定义 Client 插件若依赖该规则使覆盖可拖动页头的内容保持可交互,现在必须声明排除。未显式声明区域的普通滚动内容不贡献区域,因此被裁剪到视口上方的内容不会再阻挡页头拖动。 +从 0.2.2-rc.1 升级后,macOS Desktop 仅自动排除 `data-window-drag` 行或 `data-window-drag-controls` 范围内的交互控件。此前,应用中任意位置匹配的控件和 ARIA role 都会获得 `no-drag`。自定义 Client 插件若依赖该规则使覆盖可拖动页头的内容保持可交互,现在必须声明排除。未显式声明区域的普通滚动内容不贡献区域,因此被裁剪到视口上方的内容不会再阻挡页头拖动。 该变更影响这些范围之外、覆盖拖动行的自定义浮层。已位于标记行内的控件、使用自带排除的共享原语的浮层,以及已显式声明 `no-drag` 的组件无需迁移。规则仅适用于 macOS Desktop,普通 Web 和 Windows 行为不变。 From e43486ff630e7a74e29b6586d2d2c2e88ef2897e Mon Sep 17 00:00:00 2001 From: Yichen Jiang Date: Thu, 5 Nov 2026 16:15:08 +0800 Subject: [PATCH 244/322] test(terminal-panel): cover the backend's current-policy lookup without a real shell Windows CI skips the real-shell integration test, which was the only caller of the spawned session's current-policy closure, so backend.ts fell below the per-file coverage gate there. A backend test now sends on a spawned session after the Session policy changes. --- .../terminal-panel/tests/backend.spec.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/experimental/terminal-panel/tests/backend.spec.ts b/packages/experimental/terminal-panel/tests/backend.spec.ts index c333914f95..2ce701ba62 100644 --- a/packages/experimental/terminal-panel/tests/backend.spec.ts +++ b/packages/experimental/terminal-panel/tests/backend.spec.ts @@ -6,6 +6,7 @@ import type { SandboxExecutionPolicy } from '@deepseek-ai/dsh-sandbox' import { TerminalBackendCleanupError, TerminalSessionId } from '@deepseek-ai/dsh-terminal' import { Config } from '../src/config.ts' import { PanelTerminalBackend, SUBAGENT_REFUSAL, startup } from '../src/backend.ts' +import { POLICY_CHANGED } from '../src/session.ts' import type { PanelBackendServices } from '../src/backend.ts' import { agentFor } from './agent.ts' import { FakeTerminal, SHELL_PID } from './fake.ts' @@ -42,6 +43,18 @@ describe('spawn', () => { expect(session.pid).toBe(SHELL_PID) }) + it('checks each send against the policy the Session resolves at that moment', async () => { + const { terminal, services, backend: panel } = backend() + const owner = agentFor(new Context(), 'session') + const spawning = panel.spawn({ sessionId: TerminalSessionId('pty-1'), owner, type: 'shell' }) + await vi.advanceTimersByTimeAsync(300) + const session = await spawning + services.policy.mockReturnValue({ ...policy, mode: 'read-only' }) + expect(() => session.startSend({ text: 'ls', submit: true })).toThrow(POLICY_CHANGED) + expect(services.policy).toHaveBeenLastCalledWith(owner.session) + expect(terminal.write).not.toHaveBeenCalled() + }) + it('titles an unnamed terminal with its registry id and leaves the directory to the controller', async () => { const { terminal, services, backend: panel } = backend() const spawning = panel.spawn({ sessionId: TerminalSessionId('pty-2'), owner: agentFor(new Context(), 'session'), type: 'shell' }) From f2b7de9ac9c8478f2075d0429639beb42ce84c4a Mon Sep 17 00:00:00 2001 From: Yichen Jiang Date: Thu, 5 Nov 2026 16:15:08 +0800 Subject: [PATCH 245/322] test(snapshots): refresh creation-recommendations for the terminal bundle's new description The personalized-pages skill lists official plugins with their localized descriptions; only the persistent terminal bundle's description changes. --- snapshots/web/creation-recommendations/session.v4.jsonl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snapshots/web/creation-recommendations/session.v4.jsonl b/snapshots/web/creation-recommendations/session.v4.jsonl index 840db92921..79c9f340b4 100644 --- a/snapshots/web/creation-recommendations/session.v4.jsonl +++ b/snapshots/web/creation-recommendations/session.v4.jsonl @@ -16,7 +16,7 @@ {"type":"session/title","data":{"title":"I wish I had a","messageSeqs":[8],"source":{"kind":"fallback"}}} {"type":"assistant/message","data":{"turn":1,"step":1,"message":{"role":"assistant","content":[{"type":"tool-call","id":"call_creation_skill","name":"skill","arguments":"{\"name\":\"personalized-pages\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:6}}"},"stream":[{"type":"chunk","time":1792674450282,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1792674450282,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"call_creation_skill","name":"skill","arguments":"{\"name\":\"personalized-pages\"}"}}},{"type":"chunk","time":1792674450283,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"} {"type":"tool/call","data":{"turn":1,"step":1,"callId":"call_creation_skill","name":"skill","arguments":"{\"name\":\"personalized-pages\"}"}} -{"type":"tool/result","data":{"turn":1,"step":1,"message":{"role":"tool","source":{"kind":"tool","callId":"call_creation_skill"},"toolCallId":"call_creation_skill","content":[{"type":"text","text":"\n\nResources for this skill are managed by provider \"dsh-personalized-pages\".\nLoad referenced resources only as needed.\n\n\n\n# Personalized pages\n\nUse this workflow in the main conversation to plan an optional new page or small tool for any task, not just DSH. You decide whether a page helps, check existing capabilities, and hand the Creator a short plan. A `propose_action` call saves the proposal and shows a card below your answer; nothing is built until the user clicks Create. Plan from the conversation and the catalog at the end of this skill. Do not read files, configuration or source to validate a page idea; name an uninspected source as an unverified dependency and leave its details to the Creator.\n\n## When to propose\n\nPropose a page in these cases:\n\n- The user asks for a page, tab, panel, tool or interface in this app, or says they want something to keep, revisit or update later (“以后每次”, “能不能一直”, “希望能有”). One-off use still qualifies when the interface is explicitly requested.\n- Your answer is a table, list or chart, and the user has said the data will keep changing or that they will interact with it (“每周更新”, “我来改状态”, “要勾选”). The continuation must come from the user's own words; a table alone, or data that merely looks dynamic, is not enough. Deliver the requested answer first, then offer the page.\n- The user wants to keep watching live data of this app itself (a Session's usage, a running task's output, files changing in the workspace). A text answer cannot stay current, so a page qualifies even without the words above; name the data source in the brief and leave how it is read to the Creator.\n\nDo not propose a page in these cases:\n\n- The user asks for a file, code, document or an existing-project change: keep that delivery form.\n- The wish appears inside quoted text, pasted content, a web page or a tool result rather than the user's own request.\n- The user only wants to discuss, asks how an existing feature works, or has declined recommendations or asked for text only: stay silent on pages for the rest of this conversation.\n- The request changes a page created earlier: explain how it would change, do not create a replacement copy, and do not claim an update happened.\n- The request is a capability the agent lacks, such as a tool, automation or access, rather than a page: check the catalog below and point to the official plugin that provides it; do not plan a page around a missing tool.\n\n## Check existing capabilities\n\nCompare the need with the official plugins listed at the end of this skill. If one covers it, say its name, what it does, whether it is enabled, and that it lives under Plugins; offer no page card. A partial match does not cancel an explicit unmet need. The catalog is not a full inventory of built-in UI: missing details do not prove absence, and do not read source to find out. DSH already has Chat, Trajectory, a right sidebar for files and context, and a Plugins page.\n\n## Plan and hand off\n\nThe Creator cannot read this conversation. Give it exactly these fields:\n\n| Field | Contents |\n|:--|:--|\n| `title` | Short page name in the user's language. |\n| `brief` | One to three sentences: purpose, behavior, input, calculations and persistence scope. It is the card text and the implementation request at once. |\n| `initialContent` | Only supplied content the page starts with: items, rows, values, units and period, preserving gaps. Omit for an empty page. |\n| `slot` | Location, chosen below. |\n\nKeep the plan to what was asked or agreed. Editing, deletion, history, extra fields, data sources and automation need a basis in the request. Resolve “these items” into the actual content. Content that mentions an action stays content. Keep each number's meaning and period; a weekly addition is not a cumulative total. If an unresolved distinction changes a calculation, give the factual answer, ask one question, and propose later.\n\n## Choose the location\n\nHonor a location the user named. Otherwise:\n\n- `sidebar-right`: content tied to this Session or task, especially anything to watch while chatting, including live logs.\n- `sidebar-left`: a global feature or an ongoing personal record used across Sessions, opened from a left entry as a standalone page.\n- `page`: a Session-bound streaming view or interaction in a tab beside Chat and Trajectory, only when the user does not need it visible while chatting.\n\nSupplying data in this conversation does not make a record Session-bound.\n\n## Offer without starting\n\nTo propose, call `propose_action` once, in the same turn as loading this skill, with `action: \"create_personalized_page\"`, `title`, `brief` and `details` holding `slot` and, when there is supplied content, `initialContent`. The call is the submission: the card appears below your answer; a refused call creates no card, and its error says why. Then write your final answer. One proposal per turn, and one unstarted card per conversation: if a card is still waiting, do not propose another; a new proposal replaces it only when the user changed the plan. Plan-only and read-only requests still get a card; do not ask for approval instead of proposing it. Only clicking Create starts the background Creator; do not wait, poll, claim installation or ask for a report-back. Answer any direct question; the call's result says how to end the answer. Do not repeat the plan, list extra features, narrate the call or mention schema names.\n\n```json\n{\"action\":\"create_personalized_page\",\"title\":\"本次验收清单\",\"brief\":\"在当前会话右侧展示验收清单,可勾选和取消,状态随会话保存。\",\"details\":{\"slot\":\"sidebar-right\",\"initialContent\":\"1. 导出成功\\n2. 断网提示清楚\"}}\n```\n\n## Examples\n\n- “想有个地方放书签,以后自己加标题和网址;旧的不用导入。” → `brief`: “提供一个可反复打开的书签页,手动新增标题和网址并保存到本机,从空白开始。” No `initialContent`. `sidebar-left`.\n- “当前会话旁放验收清单,能勾选和取消,状态跟着会话。条目:导出成功;断网提示清楚。” → `brief`: “在当前会话右侧展示验收清单,可勾选和取消,状态随会话保存。” `initialContent`: “1. 导出成功\\n2. 断网提示清楚”. `sidebar-right`.\n- “这三周 bug 数 12、9、15,说说趋势。以后每周我把新数字贴给你,想自己更新着看。” → answer the trend first, then `brief`: “按周手动录入 bug 数并展示各周变化,保存到本机。” `initialContent`: “第 1 周 12,第 2 周 9,第 3 周 15”. `sidebar-left`.\n- “我想用语音说话代替打字。” → the catalog lists 语音输入; explain it and where to enable it; no card.\n- “把我之前做的读书页评分改成五星。” → explain the change to that page; no card and no copy.\n- “帮我把这句话翻成英文:我想要一个所有会话都能打开的读书页。” → translate only; no card.\n- “把三个方案排成表格比较一下,看完就行。” → the table only; no card.\n\n## Existing capabilities to check against this page plan\n\n[{\"name\":\"@deepseek-ai/dsh-personalized-recommendations\",\"title\":{\"en\":\"Personalized recommendations\",\"de\":\"Personalisierte Empfehlungen\",\"es\":\"Recomendaciones personalizadas\",\"fr\":\"Recommandations personnalisées\",\"ja\":\"パーソナライズされたおすすめ\",\"pt\":\"Recomendações personalizadas\",\"ru\":\"Персональные рекомендации\",\"zh\":\"个性化推荐\"},\"description\":{\"en\":\"Shows recommendation cards below the answer for what you want from DSH: when you want a page or small tool you can keep, it proposes a new personalized page, built in the background after you click Create; when you ask how to do something in this app or say a capability is missing, it recommends the built-in plugin that provides it, turned on when you click Enable.\",\"de\":\"Zeigt für Ihre individuellen Anforderungen an DSH Empfehlungskarten unter der Antwort an: Wenn Sie eine Seite oder ein kleines Tool zur dauerhaften Nutzung möchten, wird eine neue personalisierte Seite vorgeschlagen, die nach einem Klick auf Erstellen im Hintergrund erstellt wird; wenn Sie fragen, wie etwas in dieser App geht, oder sagen, dass eine Funktion fehlt, wird das integrierte Plugin empfohlen, das sie bereitstellt, und nach einem Klick auf Aktivieren eingeschaltet.\",\"es\":\"Muestra tarjetas de recomendación debajo de la respuesta para tus necesidades personalizadas en DSH: cuando quieres una página o una pequeña herramienta para conservar, propone una nueva página personalizada, que se genera en segundo plano al hacer clic en Crear; cuando preguntas cómo hacer algo en esta aplicación o dices que falta una función, recomienda el complemento integrado que la ofrece, que se activa al hacer clic en Habilitar.\",\"fr\":\"Affiche des cartes de recommandation sous la réponse pour vos besoins personnalisés dans DSH : lorsque vous voulez une page ou un petit outil à conserver, propose une nouvelle page personnalisée, générée en arrière-plan après un clic sur Créer ; lorsque vous demandez comment faire quelque chose dans cette application ou signalez qu’une fonctionnalité manque, recommande le plugin intégré qui la fournit, activé lorsque vous cliquez sur Activer.\",\"ja\":\"DSH に対するあなた個人のニーズに合わせて、回答の下におすすめカードを表示します。長く使えるページや小さなツールが欲しいときは新しいパーソナルページを提案し、「作成」をクリックするとバックグラウンドで生成します。このアプリで何かをする方法を尋ねたときや機能が足りないと言ったときは、それを提供する内蔵プラグインを推薦し、「有効にする」をクリックすると有効になります。\",\"pt\":\"Mostra cartões de recomendação abaixo da resposta para suas necessidades personalizadas no DSH: quando você quer uma página ou uma pequena ferramenta para manter, propõe uma nova página personalizada, gerada em segundo plano depois que você clica em Criar; quando você pergunta como fazer algo neste aplicativo ou diz que falta um recurso, recomenda o plug-in integrado que o oferece, ativado quando você clica em Ativar.\",\"ru\":\"Показывает карточки рекомендаций под ответом с учетом ваших индивидуальных потребностей в DSH: когда вам нужна страница или небольшой инструмент для постоянного использования, предлагает новую персональную страницу, которая создается в фоне после нажатия «Создать»; когда вы спрашиваете, как что-то сделать в этом приложении, или говорите, что не хватает какой-то возможности, рекомендует встроенный плагин, который ее предоставляет, и включает его после нажатия «Включить».\",\"zh\":\"针对你对 DSH 的个性化需求,在回答下方展示推荐卡片:想要能长期使用的页面或小工具时,提议新增个性化页面,点击创建后在后台生成;问到本应用怎么做某件事或缺少某项能力时,推荐对应的内置插件,点击启用后开启。\"},\"enabled\":true},{\"name\":\"@deepseek-ai/dsh-experimental-inspector-profile\",\"title\":{\"en\":\"Developer tools\",\"de\":\"Entwicklertools\",\"es\":\"Herramientas de desarrollador\",\"fr\":\"Outils de développement\",\"ja\":\"開発者ツール\",\"pt\":\"Ferramentas de desenvolvedor\",\"ru\":\"Инструменты разработчика\",\"zh\":\"开发者工具\"},\"description\":{\"en\":\"For troubleshooting: view what DSH recorded for a session in Session log, inspect per-turn and per-step statistics in the Statistics tab, and debug the DSH backend in Chrome DevTools.\",\"de\":\"Zur Fehlersuche: Sehen Sie in „Sitzungsprotokoll“, was DSH für eine Sitzung aufgezeichnet hat, prüfen Sie im Tab „Statistik“ Kontext, Dauer, Cache und Werkzeugkosten pro Runde und Schritt und debuggen Sie das DSH-Backend in Chrome DevTools.\",\"es\":\"Para solucionar problemas: vea en «Registro de sesión» lo que DSH registró de una sesión, consulte el contexto, los tiempos, la caché y el coste de herramientas por turno y paso en la pestaña «Estadísticas», y depure el backend de DSH en Chrome DevTools.\",\"fr\":\"Pour le dépannage : consultez dans « Journal de session » ce que DSH a enregistré pour une session, examinez le contexte, les durées, le cache et le coût des outils par tour et étape dans l’onglet « Statistiques », et déboguez le backend de DSH dans Chrome DevTools.\",\"ja\":\"トラブルシューティング用です。「セッションログ」で DSH がセッションについて記録した内容を確認し、「統計」タブでターン/ステップごとのコンテキスト、時間、キャッシュ、ツールコストを確認し、Chrome DevTools で DSH バックエンドをデバッグできます。\",\"pt\":\"Para solução de problemas: veja em «Registro da sessão» o que o DSH registrou de uma sessão, consulte contexto, tempos, cache e custo de ferramentas por turno e etapa na aba «Estatísticas» e depure o backend do DSH no Chrome DevTools.\",\"ru\":\"Для диагностики: просматривайте в «Журнале сеанса», что DSH записал для сеанса, смотрите контекст, время, кэш и стоимость инструментов по ходам и шагам на вкладке «Статистика» и отлаживайте бэкенд DSH в Chrome DevTools.\",\"zh\":\"用于排查问题:在「会话数据诊断」中查看 DSH 为会话记录的内容,在「统计」页签查看每轮/每步的上下文、耗时、缓存和工具成本,并在 Chrome DevTools 中调试 DSH 后端。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-experimental-voice-input-bundle\",\"title\":{\"en\":\"Voice input\",\"de\":\"Spracheingabe\",\"es\":\"Entrada de voz\",\"fr\":\"Saisie vocale\",\"ja\":\"音声入力\",\"pt\":\"Entrada de voz\",\"ru\":\"Голосовой ввод\",\"zh\":\"语音输入\"},\"description\":{\"en\":\"Transcribe recordings locally with SenseVoice; first use requires installing dependencies.\",\"de\":\"Transkribieren Sie Aufnahmen lokal mit SenseVoice; Für die erste Verwendung müssen Abhängigkeiten installiert werden.\",\"es\":\"Transcribe grabaciones localmente con SenseVoice; El primer uso requiere instalar dependencias.\",\"fr\":\"Transcrivez les enregistrements localement avec SenseVoice ; la première utilisation nécessite l'installation de dépendances.\",\"ja\":\"ローカルの SenseVoice で録音を文字に起こします。初回利用時には依存関係のインストールが必要です。\",\"pt\":\"Transcreva gravações localmente com SenseVoice; o primeiro uso requer a instalação de dependências.\",\"ru\":\"Транскрибируйте записи локально с помощью SenseVoice; при первом использовании требуется установка зависимостей.\",\"zh\":\"在本机使用 SenseVoice 转写录音,首次使用需安装依赖。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-experimental-auto-review\",\"title\":{\"en\":\"Auto authorization review\",\"de\":\"Automatische Autorisierungsüberprüfung\",\"es\":\"Revisión de autorización automática\",\"fr\":\"Examen des autorisations automatiques\",\"ja\":\"自動認可レビュー\",\"pt\":\"Revisão de autorização automática\",\"ru\":\"Проверка автоматической авторизации\",\"zh\":\"自动授权审查\"},\"description\":{\"en\":\"Adds an Auto review access mode: before each tool call, a model checks it against what you asked for, runs allowed calls at once, and holds denied calls for your approval.\",\"de\":\"Fügt den Zugriffsmodus „Auto review“ hinzu: Vor jedem Tool-Aufruf prüft ein Modell den Aufruf anhand Ihrer Anforderung; zugelassene Aufrufe laufen sofort, abgelehnte Aufrufe warten auf Ihre Genehmigung.\",\"es\":\"Añade el modo de acceso “Auto review”: antes de cada llamada a una herramienta, un modelo comprueba la llamada frente a lo que usted pidió; las llamadas permitidas se ejecutan de inmediato y las denegadas esperan su aprobación.\",\"fr\":\"Ajoute le mode d'accès « Auto review » : avant chaque appel d'outil, un modèle vérifie l'appel par rapport à ce que vous avez demandé ; les appels autorisés s'exécutent immédiatement et les appels refusés attendent votre approbation.\",\"ja\":\"「自動認可レビュー」アクセスモードを追加します。各ツール呼び出しの前に、モデルがその呼び出しをあなたの依頼内容と照らし合わせて確認し、許可された呼び出しは即座に実行され、拒否された呼び出しはあなたの承認を待ちます。\",\"pt\":\"Adiciona o modo de acesso “Auto review”: antes de cada chamada de ferramenta, um modelo verifica a chamada em relação ao que você pediu; as chamadas permitidas são executadas imediatamente e as negadas aguardam sua aprovação.\",\"ru\":\"Добавляет режим доступа «Auto review»: перед каждым вызовом инструмента модель сверяет вызов с вашей просьбой; разрешённые вызовы выполняются сразу, а отклонённые ждут вашего одобрения.\",\"zh\":\"提供“自动审查”访问模式:每次工具调用前,由模型对照你的要求检查,获准的调用立即运行,被拒绝的调用等你审批。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-experimental-cot-translation-bundle\",\"title\":{\"en\":\"Machine translation of reasoning\",\"de\":\"Maschinelle Übersetzung der Argumentation\",\"es\":\"Traducción automática de razonamiento\",\"fr\":\"Traduction automatique du raisonnement\",\"ja\":\"思考内容の機械翻訳\",\"pt\":\"Tradução automática de raciocínio\",\"ru\":\"Машинный перевод рассуждений\",\"zh\":\"思考过程机器翻译\"},\"description\":{\"en\":\"Translates expanded Think rows into your chosen language as the agent writes them, and View original switches back.\",\"de\":\"Übersetzt aufgeklappte „Denken Sie nach“-Zeilen, während der Agent sie schreibt, in die von Ihnen gewählte Sprache, und „Original ansehen“ wechselt zurück.\",\"es\":\"Traduce las filas “pensar” expandidas al idioma que elija mientras el agente las escribe, y “Ver original” vuelve al texto original.\",\"fr\":\"Traduit les lignes « Pensez » développées dans la langue de votre choix pendant que l'agent les écrit, et « Voir l'original » permet de revenir au texte d'origine.\",\"ja\":\"エージェントが書き出すのと同時に、展開された「思考」行を選択した言語に翻訳します。「原文を表示」で原文に戻せます。\",\"pt\":\"Traduz as linhas “Pense” expandidas para o idioma que você escolher enquanto o agente as escreve, e “Ver original” volta ao texto original.\",\"ru\":\"Переводит развёрнутые строки «Подумайте» на выбранный вами язык по мере того, как агент их пишет, а «Посмотреть оригинал» возвращает исходный текст.\",\"zh\":\"智能体输出时,把展开的“思考”行翻译成你选择的语言,点击“查看原文”可切换回原文。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-experimental-badge-skill-bundle\",\"title\":{\"en\":\"DSH badge skill\",\"de\":\"DSH-Abzeichen-Fertigkeit\",\"es\":\"Habilidad de insignia DSH\",\"fr\":\"Compétence du badge DSH\",\"ja\":\"DSH バッジスキル\",\"pt\":\"DSH habilidade de distintivo\",\"ru\":\"DSH значок навыка\",\"zh\":\"DSH 徽章技能\"},\"description\":{\"en\":\"Let agents add a “powered by dsh” badge to documents, pull requests, and other outputs.\",\"de\":\"Lassen Sie Agenten Dokumente, Pull-Requests und andere Ausgaben mit einem „powered by dsh“-Badge versehen.\",\"es\":\"Permita que los agentes agreguen una insignia \\\"con tecnología de dsh\\\" a documentos, solicitudes de extracción y otros resultados.\",\"fr\":\"Laissez les agents ajouter un badge « propulsé par dsh » aux documents, demandes d'extraction et autres sorties.\",\"ja\":\"エージェントが文書や PR などの成果物に「powered by dsh」バッジを追加できます。\",\"pt\":\"Permita que os agentes adicionem um selo “powered by dsh” a documentos, pull requests e outros resultados.\",\"ru\":\"Позвольте агентам добавлять значок «Powered by dsh» к документам, запросам на включение и другим результатам.\",\"zh\":\"让 Agent 为文档、PR 等产出添加「powered by dsh」徽章。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-experimental-ralph-bundle\",\"title\":{\"en\":\"Ralph loops\",\"de\":\"Ralph-Loops\",\"es\":\"Bucles de Ralph\",\"fr\":\"Boucles Ralph\",\"ja\":\"Ralph ループ\",\"pt\":\"Loops de Ralph\",\"ru\":\"Ральф петли\",\"zh\":\"Ralph 循环\"},\"description\":{\"en\":\"Ask for a Ralph loop with a goal, and the agent starts a fresh agent on it round after round until the goal is met, a blocker is reported, or the round limit is reached.\",\"de\":\"Bitten Sie um eine Ralph-Schleife mit einem Ziel, und der Agent startet Runde um Runde einen neuen Agenten darauf, bis das Ziel erreicht ist, ein Hindernis gemeldet wird oder das Rundenlimit erreicht ist.\",\"es\":\"Pida un bucle Ralph con un objetivo, y el agente inicia un agente nuevo sobre él ronda tras ronda hasta que se cumpla el objetivo, se informe de un bloqueo o se alcance el límite de rondas.\",\"fr\":\"Demandez une boucle Ralph avec un objectif, et l'agent lance un nouvel agent dessus, tour après tour, jusqu'à ce que l'objectif soit atteint, qu'un blocage soit signalé ou que la limite de tours soit atteinte.\",\"ja\":\"目標を指定して Ralph ループを依頼すると、エージェントは、目標が達成されるか、阻害要因が報告されるか、ラウンド数の上限に達するまで、ラウンドごとに新しいエージェントを起動してその目標に取り組ませます。\",\"pt\":\"Peça um loop Ralph com um objetivo, e o agente inicia um novo agente nele rodada após rodada até que o objetivo seja atingido, um bloqueio seja informado ou o limite de rodadas seja alcançado.\",\"ru\":\"Попросите запустить цикл Ralph с целью, и агент будет раунд за раундом запускать для неё нового агента, пока цель не будет достигнута, не будет сообщено о препятствии или не будет достигнут лимит раундов.\",\"zh\":\"要求用 Ralph 循环完成一个目标后,智能体会一轮接一轮地启动新的智能体处理它,直到目标达成、报告受阻或达到轮次上限。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-experimental-session-titles-bundle\",\"title\":{\"en\":\"Conversation-following titles\",\"de\":\"Konversationsfolgende Titel\",\"es\":\"Títulos que siguen la conversación\",\"fr\":\"Titres de suivi de conversation\",\"ja\":\"会話に追従するタイトル\",\"pt\":\"Títulos que acompanham conversas\",\"ru\":\"Заголовки, следующие за разговором\",\"zh\":\"随对话更新的标题\"},\"description\":{\"en\":\"Writes a session's title from all of your messages and updates it when the main task changes, instead of only from the first message.\",\"de\":\"Erstellt den Titel einer Sitzung aus all Ihren Nachrichten und aktualisiert ihn, wenn sich die Hauptaufgabe ändert, statt ihn nur aus der ersten Nachricht zu bilden.\",\"es\":\"Escribe el título de una sesión a partir de todos sus mensajes y lo actualiza cuando cambia la tarea principal, en lugar de basarse solo en el primer mensaje.\",\"fr\":\"Rédige le titre d'une session à partir de tous vos messages et le met à jour lorsque la tâche principale change, au lieu de se baser uniquement sur le premier message.\",\"ja\":\"最初のメッセージだけでなく、あなたのすべてのメッセージからセッションのタイトルを作成し、主なタスクが変わったときに更新します。\",\"pt\":\"Escreve o título de uma sessão a partir de todas as suas mensagens e o atualiza quando a tarefa principal muda, em vez de usar apenas a primeira mensagem.\",\"ru\":\"Составляет заголовок сеанса по всем вашим сообщениям и обновляет его при смене основной задачи, а не только по первому сообщению.\",\"zh\":\"根据你的所有消息生成会话标题,并在主要任务变化时更新,而不是只根据第一条消息生成。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-experimental-terminal-bundle\",\"title\":{\"en\":\"Persistent terminals\",\"de\":\"Persistente Terminals\",\"es\":\"Terminales persistentes\",\"fr\":\"Terminaux persistants\",\"ja\":\"永続ターミナル\",\"pt\":\"Terminais persistentes\",\"ru\":\"Постоянные терминалы\",\"zh\":\"持久终端\"},\"description\":{\"en\":\"Gives the agent terminals whose processes keep running in the background between tool calls, so it can start a dev server or REPL and come back later to read output or type input.\",\"de\":\"Stellt dem Agenten Terminals bereit, deren Prozesse zwischen Tool-Aufrufen im Hintergrund weiterlaufen, sodass er einen Entwicklungsserver oder eine REPL starten und später zurückkehren kann, um Ausgaben zu lesen oder Eingaben zu tippen.\",\"es\":\"Proporciona al agente terminales cuyos procesos siguen ejecutándose en segundo plano entre llamadas a herramientas, de modo que puede iniciar un servidor de desarrollo o un REPL y volver más tarde para leer la salida o escribir entradas.\",\"fr\":\"Fournit à l'agent des terminaux dont les processus continuent de s'exécuter en arrière-plan d'un appel d'outil à l'autre, afin qu'il puisse lancer un serveur de développement ou un REPL et revenir plus tard lire la sortie ou saisir des entrées.\",\"ja\":\"エージェントにターミナルを提供します。プロセスはツール呼び出し間もバックグラウンドで実行され続けるため、エージェントは開発サーバーや REPL を起動し、後から出力を読んだり入力したりできます。\",\"pt\":\"Fornece ao agente terminais cujos processos continuam em execução em segundo plano entre chamadas de ferramentas, para que ele possa iniciar um servidor de desenvolvimento ou um REPL e voltar depois para ler a saída ou digitar entradas.\",\"ru\":\"Предоставляет агенту терминалы, процессы которых продолжают работать в фоне между вызовами инструментов, поэтому агент может запустить сервер разработки или REPL и позже вернуться, чтобы прочитать вывод или ввести данные.\",\"zh\":\"为智能体提供终端,进程在多次工具调用之间持续在后台运行,因此它可以启动开发服务器或 REPL,稍后再读取输出或继续输入。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-experimental-liveshare\",\"title\":{\"en\":\"LiveShare Session Sharing\",\"de\":\"LiveShare-Sitzungsfreigabe\",\"es\":\"Compartir sesión de LiveShare\",\"fr\":\"Partage de session LiveShare\",\"ja\":\"LiveShare セッション共有\",\"pt\":\"Compartilhamento de sessão do LiveShare\",\"ru\":\"Совместный доступ к сеансу LiveShare\",\"zh\":\"LiveShare 会话分享\"},\"description\":{\"en\":\"Share the current Session with a colleague, who can drive it in a browser, edit files inside the granted workspace when the share allows writes, or branch their own Session from the completed history.\",\"de\":\"Teilt die aktuelle Sitzung mit einer Kollegin oder einem Kollegen, die oder der sie im Browser bedienen, bei erlaubten Schreibzugriffen Dateien im freigegebenen Arbeitsbereich bearbeiten oder aus der abgeschlossenen Historie eine eigene Sitzung abzweigen kann.\",\"es\":\"Comparte la sesión actual con un compañero, que puede dirigirla en un navegador, editar archivos dentro del espacio de trabajo concedido cuando el recurso compartido permite escritura, o crear su propia sesión a partir del historial completado.\",\"fr\":\"Partagez la session en cours avec un collègue, qui peut la piloter dans un navigateur, modifier des fichiers dans l'espace de travail accordé lorsque le partage autorise l'écriture, ou créer sa propre session à partir de l'historique terminé.\",\"ja\":\"現在のセッションを同僚と共有し、ブラウザから操作してもらう、共有が書き込みを許可する場合は付与されたワークスペース内のファイルを編集してもらう、または完了した履歴から自分のセッションを分岐してもらえます。\",\"pt\":\"Compartilhe a sessão atual com um colega, que pode conduzi-la no navegador, editar arquivos dentro do espaço de trabalho concedido quando o compartilhamento permite escrita, ou ramificar a própria sessão a partir do histórico concluído.\",\"ru\":\"Поделитесь текущим сеансом с коллегой: он сможет управлять им в браузере, редактировать файлы в предоставленном рабочем пространстве, если общий доступ разрешает запись, или ответвить собственный сеанс из завершённой истории.\",\"zh\":\"把当前会话分享给同事,对方可在浏览器中驱动该会话、在分享允许写入时修改授权工作区内的文件,或从已完成历史分支出自己的会话。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-experimental-session-search\",\"title\":{\"en\":\"Session search\",\"de\":\"Sitzungssuche\",\"es\":\"búsqueda de sesión\",\"fr\":\"Recherche de sessions\",\"ja\":\"セッション検索\",\"pt\":\"Pesquisa de sessão\",\"ru\":\"Поиск сеанса\",\"zh\":\"会话搜索\"},\"description\":{\"en\":\"Ask about earlier work, such as “How did we fix the pool leak last week?”, and the agent searches your earlier sessions in the same workspace to answer.\",\"de\":\"Fragen Sie nach früherer Arbeit, etwa „Wie haben wir letzte Woche das Pool-Leck behoben?“, und der Agent durchsucht Ihre früheren Sitzungen aus demselben Arbeitsverzeichnis, um zu antworten.\",\"es\":\"Pregunte por trabajo anterior, como “¿Cómo arreglamos la fuga del pool la semana pasada?”, y el agente busca en sus sesiones anteriores del mismo directorio de trabajo para responder.\",\"fr\":\"Posez une question sur un travail antérieur, par exemple « Comment avons-nous corrigé la fuite du pool la semaine dernière ? », et l'agent recherche dans vos sessions antérieures du même répertoire de travail pour répondre.\",\"ja\":\"「先週プールのリークをどう直した?」のように以前の作業について尋ねると、エージェントは同じ作業ディレクトリの過去のセッションを検索して回答します。\",\"pt\":\"Pergunte sobre trabalhos anteriores, como “Como corrigimos o vazamento do pool na semana passada?”, e o agente pesquisa suas sessões anteriores do mesmo diretório de trabalho para responder.\",\"ru\":\"Спросите о прошлой работе, например «Как мы исправили утечку в пуле на прошлой неделе?», и агент выполнит поиск по вашим прошлым сеансам из того же рабочего каталога, чтобы ответить.\",\"zh\":\"询问以往的工作,例如“上周我们是怎么修好连接池泄漏的?”,智能体会搜索同一工作区的历史会话来回答。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-experimental-tool-worktree\",\"title\":{\"en\":\"Git worktrees\",\"de\":\"Git-Arbeitsbäume\",\"es\":\"árboles de trabajo de git\",\"fr\":\"Arbres de travail Git\",\"ja\":\"Git ワークツリー\",\"pt\":\"Árvores de trabalho Git\",\"ru\":\"Рабочие деревья Git\",\"zh\":\"Git 工作树\"},\"description\":{\"en\":\"Ask for work on a new branch, and the agent creates a separate Git worktree and continues there, leaving your current checkout as it is.\",\"de\":\"Bitten Sie um Arbeit auf einem neuen Branch, und der Agent erstellt einen separaten Git-Worktree und arbeitet dort weiter, während Ihr aktueller Checkout unverändert bleibt.\",\"es\":\"Pida trabajar en una rama nueva, y el agente crea un worktree de Git independiente y continúa allí, dejando su checkout actual tal como está.\",\"fr\":\"Demandez à travailler sur une nouvelle branche, et l'agent crée un worktree Git distinct et y poursuit le travail, en laissant votre copie de travail actuelle telle quelle.\",\"ja\":\"新しいブランチでの作業を依頼すると、エージェントは別の Git ワークツリーを作成してそこで作業を続け、現在のチェックアウトはそのまま残します。\",\"pt\":\"Peça para trabalhar em um novo branch, e o agente cria um worktree do Git separado e continua lá, deixando seu checkout atual como está.\",\"ru\":\"Попросите поработать в новой ветке, и агент создаст отдельное рабочее дерево Git и продолжит работу там, оставив вашу текущую рабочую копию как есть.\",\"zh\":\"要求在新分支上工作时,智能体会创建单独的 Git 工作树并在其中继续,你当前的工作树保持原样。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-cua-bundle\",\"title\":{\"en\":\"Computer use\",\"de\":\"Computernutzung\",\"es\":\"Uso de la computadora\",\"fr\":\"Utilisation de l'ordinateur\",\"ja\":\"Computer Use\",\"pt\":\"Uso do computador\",\"ru\":\"Использование компьютера\",\"zh\":\"Computer Use\"},\"description\":{\"en\":\"Currently supports macOS; Windows support is in development. Loads computer use for existing and new PTC sessions. Switch to PTC mode and grant Accessibility and Screen Recording permissions to use it.\",\"de\":\"Unterstützt derzeit macOS; Die Windows-Unterstützung befindet sich in der Entwicklung. Lädt die Computernutzung für bestehende und neue PTC-Sitzungen. Wechseln Sie in den PTC-Modus und erteilen Sie die Berechtigungen für Barrierefreiheit und Bildschirmaufzeichnung, um ihn zu verwenden.\",\"es\":\"Actualmente es compatible con macOS; El soporte para Windows está en desarrollo. Carga el uso de la computadora para sesiones PTC nuevas y existentes. Cambie al modo PTC y otorgue permisos de Accesibilidad y Grabación de pantalla para usarlo.\",\"fr\":\"Prend actuellement en charge macOS ; La prise en charge de Windows est en cours de développement. Charge l'utilisation de l'ordinateur pour les sessions PTC existantes et nouvelles. Passez en mode PTC et accordez les autorisations d’accessibilité et d’enregistrement d’écran pour l’utiliser.\",\"ja\":\"現在は macOS のみ対応し、Windows 対応は開発中です。既存および新規の PTC セッションに Computer Use を読み込みます。PTC モードに切り替え、アクセシビリティと画面収録の権限を許可して使用してください。\",\"pt\":\"Atualmente suporta macOS; O suporte Windows está em desenvolvimento. Carrega o uso do computador para sessões PTC novas e existentes. Mude para o modo PTC e conceda permissões de acessibilidade e gravação de tela para usá-lo.\",\"ru\":\"В настоящее время поддерживается macOS; Поддержка Windows находится в разработке. Загружает использование компьютера для существующих и новых сеансов PTC. Переключитесь в режим PTC и предоставьте разрешения на доступность и запись экрана для его использования.\",\"zh\":\"目前仅支持 macOS,Windows 支持正在开发中。为已有及新建 PTC 会话加载 Computer Use。请切换到 PTC 模式来使用,并授予辅助功能和屏幕录制权限。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-experimental-plugin-market-bundle\",\"title\":{\"en\":\"Custom plugin indexes\",\"de\":\"Benutzerdefinierte Plugin-Indizes\",\"es\":\"Índices de complementos personalizados\",\"fr\":\"Index de plugins personnalisés\",\"ja\":\"カスタムプラグインインデックス\",\"pt\":\"Índices de plug-ins personalizados\",\"ru\":\"Пользовательские индексы плагинов\",\"zh\":\"自定义插件索引\"},\"description\":{\"en\":\"Adds a Discover tab to Plugins, where you browse and install plugins from plugin indexes you add.\",\"de\":\"Fügt unter „Plugins“ den Tab „Entdecken“ hinzu, in dem Sie Plugins aus von Ihnen hinzugefügten Plugin-Indizes durchsuchen und installieren.\",\"es\":\"Añade la pestaña “Descubrir” a “Complementos”, donde puede explorar e instalar complementos de los índices de complementos que agregue.\",\"fr\":\"Ajoute à « Plugins » un onglet « Découvrez » où vous parcourez et installez des plugins provenant des index de plugins que vous ajoutez.\",\"ja\":\"「プラグイン」に「見つける」タブを追加し、追加したプラグインインデックスからプラグインを閲覧・インストールできるようにします。\",\"pt\":\"Adiciona a guia “Descubra” a “Plug-ins”, onde você navega e instala plug-ins dos índices de plug-ins que adiciona.\",\"ru\":\"Добавляет в «Плагины» вкладку «Откройте для себя», где можно просматривать и устанавливать плагины из добавленных вами индексов плагинов.\",\"zh\":\"在插件页添加“发现”标签页,从你添加的插件索引中浏览和安装插件。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-experimental-forge-bundle\",\"title\":{\"en\":\"Change requests & worktrees\",\"de\":\"Änderungsanfragen und Arbeitsbäume\",\"es\":\"Solicitudes de cambio y árboles de trabajo\",\"fr\":\"Demandes de modification et arbres de travail\",\"ja\":\"変更リクエストとワークツリー\",\"pt\":\"Solicitações de alteração e árvores de trabalho\",\"ru\":\"Запросы на изменение и рабочие деревья\",\"zh\":\"变更请求与工作树\"},\"description\":{\"en\":\"Keep linked GitHub pull requests beside your conversation: follow checks and reviews, inspect diffs, and send feedback to the agent. Review local changes and use a separate worktree to isolate each task. GitHub features require the gh CLI installed and signed in on the host.\",\"de\":\"Verknüpfte GitHub-Pull-Requests neben der Unterhaltung verfolgen: Prüfungen und Reviews ansehen, Code vergleichen und Feedback an den Agenten senden. Lokale Änderungen prüfen und Aufgaben mit separaten Arbeitsbäumen isolieren. GitHub-Funktionen erfordern eine installierte gh-CLI und eine Anmeldung auf dem Host.\",\"es\":\"Sigue los pull requests de GitHub vinculados a la conversación: consulta comprobaciones y revisiones, compara código y envía comentarios al agente. Revisa cambios locales y aísla cada tarea en un árbol de trabajo separado. Las funciones de GitHub requieren instalar la CLI gh e iniciar sesión en el equipo anfitrión.\",\"fr\":\"Suivez les pull requests GitHub liées à votre conversation : consultez les vérifications et les revues, comparez le code et transmettez vos remarques à l’agent. Examinez les modifications locales et isolez chaque tâche dans un arbre de travail séparé. Les fonctions GitHub nécessitent la CLI gh installée et une connexion sur l’hôte.\",\"ja\":\"会話のサイドバーで関連付けられた GitHub PR をまとめて確認できます。チェックやレビューの状況、コードの差分を確認し、修正案をエージェントに渡せます。ローカルの変更確認や、独立したワークツリーによるタスクの分離にも対応します。GitHub 機能にはホストでの gh CLI のインストールとログインが必要です。\",\"pt\":\"Acompanhe os pull requests do GitHub vinculados à conversa: consulte verificações e revisões, compare código e envie comentários ao agente. Revise alterações locais e isole cada tarefa em uma árvore de trabalho separada. Os recursos do GitHub exigem a CLI gh instalada e uma sessão iniciada no host.\",\"ru\":\"Следите за связанными с беседой pull request GitHub: проверками, рецензиями и различиями в коде, а затем передавайте замечания агенту. Просматривайте локальные изменения и изолируйте задачи в отдельных рабочих деревьях. Для функций GitHub требуется установить CLI gh и войти в аккаунт на хосте.\",\"zh\":\"在会话侧栏集中跟踪关联的 GitHub PR:查看检查状态、评审意见与代码差异,并把修改建议交给智能体继续处理。也可查看本地改动,用独立工作树隔离任务。GitHub 功能需要本机安装 gh 并登录。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-subagent-claude-code\",\"title\":{\"de\":\"Claude Code-Subagent\",\"en\":\"Claude Code subagent\",\"es\":\"Subagente Claude Code\",\"fr\":\"Sous-agent Claude Code\",\"ja\":\"Claude Code サブエージェント\",\"pt\":\"Claude Code subagente\",\"ru\":\"Субагент Claude Code\",\"zh\":\"Claude Code 子智能体\"},\"description\":{\"de\":\"Delegieren Sie eine Aufgabe an Claude Code, indem Sie dessen native Authentifizierung und Einstellungen verwenden.\",\"en\":\"Delegate one task to Claude Code using its native authentication and settings.\",\"es\":\"Delegue una tarea a Claude Code utilizando su autenticación y configuración nativas.\",\"fr\":\"Déléguez une tâche à Claude Code à l’aide de son authentification et de ses paramètres natifs.\",\"ja\":\"Claude Code のネイティブの認証と設定を使用して、単独のタスクを委派します。\",\"pt\":\"Delegue uma tarefa a Claude Code usando sua autenticação e configurações nativas.\",\"ru\":\"Делегируйте одну задачу Claude Code, используя его встроенную аутентификацию и настройки.\",\"zh\":\"使用 Claude Code 原生认证和设置委派单个任务。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-subagent-codex\",\"title\":{\"de\":\"Codex-Subagent\",\"en\":\"Codex subagent\",\"es\":\"Subagente Codex\",\"fr\":\"Sous-agent Codex\",\"ja\":\"Codex サブエージェント\",\"pt\":\"Codex subagente\",\"ru\":\"Субагент Codex\",\"zh\":\"Codex 子智能体\"},\"description\":{\"de\":\"Delegieren Sie eine Aufgabe an Codex, indem Sie dessen native Authentifizierung und Einstellungen verwenden.\",\"en\":\"Delegate one task to Codex using its native authentication and settings.\",\"es\":\"Delegue una tarea a Codex utilizando su autenticación y configuración nativas.\",\"fr\":\"Déléguez une tâche à Codex à l’aide de son authentification et de ses paramètres natifs.\",\"ja\":\"Codex のネイティブの認証と設定を使用して、単独のタスクを委派します。\",\"pt\":\"Delegue uma tarefa a Codex usando sua autenticação e configurações nativas.\",\"ru\":\"Делегируйте одну задачу Codex, используя его встроенную аутентификацию и настройки.\",\"zh\":\"使用 Codex 原生认证和设置委派单个任务。\"},\"enabled\":false}]\n\n"}],"isError":false,"id":"{{message:7}}"}},"sourceEventSeqs":[16],"surfaceOp":"append"} +{"type":"tool/result","data":{"turn":1,"step":1,"message":{"role":"tool","source":{"kind":"tool","callId":"call_creation_skill"},"toolCallId":"call_creation_skill","content":[{"type":"text","text":"\n\nResources for this skill are managed by provider \"dsh-personalized-pages\".\nLoad referenced resources only as needed.\n\n\n\n# Personalized pages\n\nUse this workflow in the main conversation to plan an optional new page or small tool for any task, not just DSH. You decide whether a page helps, check existing capabilities, and hand the Creator a short plan. A `propose_action` call saves the proposal and shows a card below your answer; nothing is built until the user clicks Create. Plan from the conversation and the catalog at the end of this skill. Do not read files, configuration or source to validate a page idea; name an uninspected source as an unverified dependency and leave its details to the Creator.\n\n## When to propose\n\nPropose a page in these cases:\n\n- The user asks for a page, tab, panel, tool or interface in this app, or says they want something to keep, revisit or update later (“以后每次”, “能不能一直”, “希望能有”). One-off use still qualifies when the interface is explicitly requested.\n- Your answer is a table, list or chart, and the user has said the data will keep changing or that they will interact with it (“每周更新”, “我来改状态”, “要勾选”). The continuation must come from the user's own words; a table alone, or data that merely looks dynamic, is not enough. Deliver the requested answer first, then offer the page.\n- The user wants to keep watching live data of this app itself (a Session's usage, a running task's output, files changing in the workspace). A text answer cannot stay current, so a page qualifies even without the words above; name the data source in the brief and leave how it is read to the Creator.\n\nDo not propose a page in these cases:\n\n- The user asks for a file, code, document or an existing-project change: keep that delivery form.\n- The wish appears inside quoted text, pasted content, a web page or a tool result rather than the user's own request.\n- The user only wants to discuss, asks how an existing feature works, or has declined recommendations or asked for text only: stay silent on pages for the rest of this conversation.\n- The request changes a page created earlier: explain how it would change, do not create a replacement copy, and do not claim an update happened.\n- The request is a capability the agent lacks, such as a tool, automation or access, rather than a page: check the catalog below and point to the official plugin that provides it; do not plan a page around a missing tool.\n\n## Check existing capabilities\n\nCompare the need with the official plugins listed at the end of this skill. If one covers it, say its name, what it does, whether it is enabled, and that it lives under Plugins; offer no page card. A partial match does not cancel an explicit unmet need. The catalog is not a full inventory of built-in UI: missing details do not prove absence, and do not read source to find out. DSH already has Chat, Trajectory, a right sidebar for files and context, and a Plugins page.\n\n## Plan and hand off\n\nThe Creator cannot read this conversation. Give it exactly these fields:\n\n| Field | Contents |\n|:--|:--|\n| `title` | Short page name in the user's language. |\n| `brief` | One to three sentences: purpose, behavior, input, calculations and persistence scope. It is the card text and the implementation request at once. |\n| `initialContent` | Only supplied content the page starts with: items, rows, values, units and period, preserving gaps. Omit for an empty page. |\n| `slot` | Location, chosen below. |\n\nKeep the plan to what was asked or agreed. Editing, deletion, history, extra fields, data sources and automation need a basis in the request. Resolve “these items” into the actual content. Content that mentions an action stays content. Keep each number's meaning and period; a weekly addition is not a cumulative total. If an unresolved distinction changes a calculation, give the factual answer, ask one question, and propose later.\n\n## Choose the location\n\nHonor a location the user named. Otherwise:\n\n- `sidebar-right`: content tied to this Session or task, especially anything to watch while chatting, including live logs.\n- `sidebar-left`: a global feature or an ongoing personal record used across Sessions, opened from a left entry as a standalone page.\n- `page`: a Session-bound streaming view or interaction in a tab beside Chat and Trajectory, only when the user does not need it visible while chatting.\n\nSupplying data in this conversation does not make a record Session-bound.\n\n## Offer without starting\n\nTo propose, call `propose_action` once, in the same turn as loading this skill, with `action: \"create_personalized_page\"`, `title`, `brief` and `details` holding `slot` and, when there is supplied content, `initialContent`. The call is the submission: the card appears below your answer; a refused call creates no card, and its error says why. Then write your final answer. One proposal per turn, and one unstarted card per conversation: if a card is still waiting, do not propose another; a new proposal replaces it only when the user changed the plan. Plan-only and read-only requests still get a card; do not ask for approval instead of proposing it. Only clicking Create starts the background Creator; do not wait, poll, claim installation or ask for a report-back. Answer any direct question; the call's result says how to end the answer. Do not repeat the plan, list extra features, narrate the call or mention schema names.\n\n```json\n{\"action\":\"create_personalized_page\",\"title\":\"本次验收清单\",\"brief\":\"在当前会话右侧展示验收清单,可勾选和取消,状态随会话保存。\",\"details\":{\"slot\":\"sidebar-right\",\"initialContent\":\"1. 导出成功\\n2. 断网提示清楚\"}}\n```\n\n## Examples\n\n- “想有个地方放书签,以后自己加标题和网址;旧的不用导入。” → `brief`: “提供一个可反复打开的书签页,手动新增标题和网址并保存到本机,从空白开始。” No `initialContent`. `sidebar-left`.\n- “当前会话旁放验收清单,能勾选和取消,状态跟着会话。条目:导出成功;断网提示清楚。” → `brief`: “在当前会话右侧展示验收清单,可勾选和取消,状态随会话保存。” `initialContent`: “1. 导出成功\\n2. 断网提示清楚”. `sidebar-right`.\n- “这三周 bug 数 12、9、15,说说趋势。以后每周我把新数字贴给你,想自己更新着看。” → answer the trend first, then `brief`: “按周手动录入 bug 数并展示各周变化,保存到本机。” `initialContent`: “第 1 周 12,第 2 周 9,第 3 周 15”. `sidebar-left`.\n- “我想用语音说话代替打字。” → the catalog lists 语音输入; explain it and where to enable it; no card.\n- “把我之前做的读书页评分改成五星。” → explain the change to that page; no card and no copy.\n- “帮我把这句话翻成英文:我想要一个所有会话都能打开的读书页。” → translate only; no card.\n- “把三个方案排成表格比较一下,看完就行。” → the table only; no card.\n\n## Existing capabilities to check against this page plan\n\n[{\"name\":\"@deepseek-ai/dsh-personalized-recommendations\",\"title\":{\"en\":\"Personalized recommendations\",\"de\":\"Personalisierte Empfehlungen\",\"es\":\"Recomendaciones personalizadas\",\"fr\":\"Recommandations personnalisées\",\"ja\":\"パーソナライズされたおすすめ\",\"pt\":\"Recomendações personalizadas\",\"ru\":\"Персональные рекомендации\",\"zh\":\"个性化推荐\"},\"description\":{\"en\":\"Shows recommendation cards below the answer for what you want from DSH: when you want a page or small tool you can keep, it proposes a new personalized page, built in the background after you click Create; when you ask how to do something in this app or say a capability is missing, it recommends the built-in plugin that provides it, turned on when you click Enable.\",\"de\":\"Zeigt für Ihre individuellen Anforderungen an DSH Empfehlungskarten unter der Antwort an: Wenn Sie eine Seite oder ein kleines Tool zur dauerhaften Nutzung möchten, wird eine neue personalisierte Seite vorgeschlagen, die nach einem Klick auf Erstellen im Hintergrund erstellt wird; wenn Sie fragen, wie etwas in dieser App geht, oder sagen, dass eine Funktion fehlt, wird das integrierte Plugin empfohlen, das sie bereitstellt, und nach einem Klick auf Aktivieren eingeschaltet.\",\"es\":\"Muestra tarjetas de recomendación debajo de la respuesta para tus necesidades personalizadas en DSH: cuando quieres una página o una pequeña herramienta para conservar, propone una nueva página personalizada, que se genera en segundo plano al hacer clic en Crear; cuando preguntas cómo hacer algo en esta aplicación o dices que falta una función, recomienda el complemento integrado que la ofrece, que se activa al hacer clic en Habilitar.\",\"fr\":\"Affiche des cartes de recommandation sous la réponse pour vos besoins personnalisés dans DSH : lorsque vous voulez une page ou un petit outil à conserver, propose une nouvelle page personnalisée, générée en arrière-plan après un clic sur Créer ; lorsque vous demandez comment faire quelque chose dans cette application ou signalez qu’une fonctionnalité manque, recommande le plugin intégré qui la fournit, activé lorsque vous cliquez sur Activer.\",\"ja\":\"DSH に対するあなた個人のニーズに合わせて、回答の下におすすめカードを表示します。長く使えるページや小さなツールが欲しいときは新しいパーソナルページを提案し、「作成」をクリックするとバックグラウンドで生成します。このアプリで何かをする方法を尋ねたときや機能が足りないと言ったときは、それを提供する内蔵プラグインを推薦し、「有効にする」をクリックすると有効になります。\",\"pt\":\"Mostra cartões de recomendação abaixo da resposta para suas necessidades personalizadas no DSH: quando você quer uma página ou uma pequena ferramenta para manter, propõe uma nova página personalizada, gerada em segundo plano depois que você clica em Criar; quando você pergunta como fazer algo neste aplicativo ou diz que falta um recurso, recomenda o plug-in integrado que o oferece, ativado quando você clica em Ativar.\",\"ru\":\"Показывает карточки рекомендаций под ответом с учетом ваших индивидуальных потребностей в DSH: когда вам нужна страница или небольшой инструмент для постоянного использования, предлагает новую персональную страницу, которая создается в фоне после нажатия «Создать»; когда вы спрашиваете, как что-то сделать в этом приложении, или говорите, что не хватает какой-то возможности, рекомендует встроенный плагин, который ее предоставляет, и включает его после нажатия «Включить».\",\"zh\":\"针对你对 DSH 的个性化需求,在回答下方展示推荐卡片:想要能长期使用的页面或小工具时,提议新增个性化页面,点击创建后在后台生成;问到本应用怎么做某件事或缺少某项能力时,推荐对应的内置插件,点击启用后开启。\"},\"enabled\":true},{\"name\":\"@deepseek-ai/dsh-experimental-inspector-profile\",\"title\":{\"en\":\"Developer tools\",\"de\":\"Entwicklertools\",\"es\":\"Herramientas de desarrollador\",\"fr\":\"Outils de développement\",\"ja\":\"開発者ツール\",\"pt\":\"Ferramentas de desenvolvedor\",\"ru\":\"Инструменты разработчика\",\"zh\":\"开发者工具\"},\"description\":{\"en\":\"For troubleshooting: view what DSH recorded for a session in Session log, inspect per-turn and per-step statistics in the Statistics tab, and debug the DSH backend in Chrome DevTools.\",\"de\":\"Zur Fehlersuche: Sehen Sie in „Sitzungsprotokoll“, was DSH für eine Sitzung aufgezeichnet hat, prüfen Sie im Tab „Statistik“ Kontext, Dauer, Cache und Werkzeugkosten pro Runde und Schritt und debuggen Sie das DSH-Backend in Chrome DevTools.\",\"es\":\"Para solucionar problemas: vea en «Registro de sesión» lo que DSH registró de una sesión, consulte el contexto, los tiempos, la caché y el coste de herramientas por turno y paso en la pestaña «Estadísticas», y depure el backend de DSH en Chrome DevTools.\",\"fr\":\"Pour le dépannage : consultez dans « Journal de session » ce que DSH a enregistré pour une session, examinez le contexte, les durées, le cache et le coût des outils par tour et étape dans l’onglet « Statistiques », et déboguez le backend de DSH dans Chrome DevTools.\",\"ja\":\"トラブルシューティング用です。「セッションログ」で DSH がセッションについて記録した内容を確認し、「統計」タブでターン/ステップごとのコンテキスト、時間、キャッシュ、ツールコストを確認し、Chrome DevTools で DSH バックエンドをデバッグできます。\",\"pt\":\"Para solução de problemas: veja em «Registro da sessão» o que o DSH registrou de uma sessão, consulte contexto, tempos, cache e custo de ferramentas por turno e etapa na aba «Estatísticas» e depure o backend do DSH no Chrome DevTools.\",\"ru\":\"Для диагностики: просматривайте в «Журнале сеанса», что DSH записал для сеанса, смотрите контекст, время, кэш и стоимость инструментов по ходам и шагам на вкладке «Статистика» и отлаживайте бэкенд DSH в Chrome DevTools.\",\"zh\":\"用于排查问题:在「会话数据诊断」中查看 DSH 为会话记录的内容,在「统计」页签查看每轮/每步的上下文、耗时、缓存和工具成本,并在 Chrome DevTools 中调试 DSH 后端。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-experimental-voice-input-bundle\",\"title\":{\"en\":\"Voice input\",\"de\":\"Spracheingabe\",\"es\":\"Entrada de voz\",\"fr\":\"Saisie vocale\",\"ja\":\"音声入力\",\"pt\":\"Entrada de voz\",\"ru\":\"Голосовой ввод\",\"zh\":\"语音输入\"},\"description\":{\"en\":\"Transcribe recordings locally with SenseVoice; first use requires installing dependencies.\",\"de\":\"Transkribieren Sie Aufnahmen lokal mit SenseVoice; Für die erste Verwendung müssen Abhängigkeiten installiert werden.\",\"es\":\"Transcribe grabaciones localmente con SenseVoice; El primer uso requiere instalar dependencias.\",\"fr\":\"Transcrivez les enregistrements localement avec SenseVoice ; la première utilisation nécessite l'installation de dépendances.\",\"ja\":\"ローカルの SenseVoice で録音を文字に起こします。初回利用時には依存関係のインストールが必要です。\",\"pt\":\"Transcreva gravações localmente com SenseVoice; o primeiro uso requer a instalação de dependências.\",\"ru\":\"Транскрибируйте записи локально с помощью SenseVoice; при первом использовании требуется установка зависимостей.\",\"zh\":\"在本机使用 SenseVoice 转写录音,首次使用需安装依赖。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-experimental-auto-review\",\"title\":{\"en\":\"Auto authorization review\",\"de\":\"Automatische Autorisierungsüberprüfung\",\"es\":\"Revisión de autorización automática\",\"fr\":\"Examen des autorisations automatiques\",\"ja\":\"自動認可レビュー\",\"pt\":\"Revisão de autorização automática\",\"ru\":\"Проверка автоматической авторизации\",\"zh\":\"自动授权审查\"},\"description\":{\"en\":\"Adds an Auto review access mode: before each tool call, a model checks it against what you asked for, runs allowed calls at once, and holds denied calls for your approval.\",\"de\":\"Fügt den Zugriffsmodus „Auto review“ hinzu: Vor jedem Tool-Aufruf prüft ein Modell den Aufruf anhand Ihrer Anforderung; zugelassene Aufrufe laufen sofort, abgelehnte Aufrufe warten auf Ihre Genehmigung.\",\"es\":\"Añade el modo de acceso “Auto review”: antes de cada llamada a una herramienta, un modelo comprueba la llamada frente a lo que usted pidió; las llamadas permitidas se ejecutan de inmediato y las denegadas esperan su aprobación.\",\"fr\":\"Ajoute le mode d'accès « Auto review » : avant chaque appel d'outil, un modèle vérifie l'appel par rapport à ce que vous avez demandé ; les appels autorisés s'exécutent immédiatement et les appels refusés attendent votre approbation.\",\"ja\":\"「自動認可レビュー」アクセスモードを追加します。各ツール呼び出しの前に、モデルがその呼び出しをあなたの依頼内容と照らし合わせて確認し、許可された呼び出しは即座に実行され、拒否された呼び出しはあなたの承認を待ちます。\",\"pt\":\"Adiciona o modo de acesso “Auto review”: antes de cada chamada de ferramenta, um modelo verifica a chamada em relação ao que você pediu; as chamadas permitidas são executadas imediatamente e as negadas aguardam sua aprovação.\",\"ru\":\"Добавляет режим доступа «Auto review»: перед каждым вызовом инструмента модель сверяет вызов с вашей просьбой; разрешённые вызовы выполняются сразу, а отклонённые ждут вашего одобрения.\",\"zh\":\"提供“自动审查”访问模式:每次工具调用前,由模型对照你的要求检查,获准的调用立即运行,被拒绝的调用等你审批。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-experimental-cot-translation-bundle\",\"title\":{\"en\":\"Machine translation of reasoning\",\"de\":\"Maschinelle Übersetzung der Argumentation\",\"es\":\"Traducción automática de razonamiento\",\"fr\":\"Traduction automatique du raisonnement\",\"ja\":\"思考内容の機械翻訳\",\"pt\":\"Tradução automática de raciocínio\",\"ru\":\"Машинный перевод рассуждений\",\"zh\":\"思考过程机器翻译\"},\"description\":{\"en\":\"Translates expanded Think rows into your chosen language as the agent writes them, and View original switches back.\",\"de\":\"Übersetzt aufgeklappte „Denken Sie nach“-Zeilen, während der Agent sie schreibt, in die von Ihnen gewählte Sprache, und „Original ansehen“ wechselt zurück.\",\"es\":\"Traduce las filas “pensar” expandidas al idioma que elija mientras el agente las escribe, y “Ver original” vuelve al texto original.\",\"fr\":\"Traduit les lignes « Pensez » développées dans la langue de votre choix pendant que l'agent les écrit, et « Voir l'original » permet de revenir au texte d'origine.\",\"ja\":\"エージェントが書き出すのと同時に、展開された「思考」行を選択した言語に翻訳します。「原文を表示」で原文に戻せます。\",\"pt\":\"Traduz as linhas “Pense” expandidas para o idioma que você escolher enquanto o agente as escreve, e “Ver original” volta ao texto original.\",\"ru\":\"Переводит развёрнутые строки «Подумайте» на выбранный вами язык по мере того, как агент их пишет, а «Посмотреть оригинал» возвращает исходный текст.\",\"zh\":\"智能体输出时,把展开的“思考”行翻译成你选择的语言,点击“查看原文”可切换回原文。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-experimental-badge-skill-bundle\",\"title\":{\"en\":\"DSH badge skill\",\"de\":\"DSH-Abzeichen-Fertigkeit\",\"es\":\"Habilidad de insignia DSH\",\"fr\":\"Compétence du badge DSH\",\"ja\":\"DSH バッジスキル\",\"pt\":\"DSH habilidade de distintivo\",\"ru\":\"DSH значок навыка\",\"zh\":\"DSH 徽章技能\"},\"description\":{\"en\":\"Let agents add a “powered by dsh” badge to documents, pull requests, and other outputs.\",\"de\":\"Lassen Sie Agenten Dokumente, Pull-Requests und andere Ausgaben mit einem „powered by dsh“-Badge versehen.\",\"es\":\"Permita que los agentes agreguen una insignia \\\"con tecnología de dsh\\\" a documentos, solicitudes de extracción y otros resultados.\",\"fr\":\"Laissez les agents ajouter un badge « propulsé par dsh » aux documents, demandes d'extraction et autres sorties.\",\"ja\":\"エージェントが文書や PR などの成果物に「powered by dsh」バッジを追加できます。\",\"pt\":\"Permita que os agentes adicionem um selo “powered by dsh” a documentos, pull requests e outros resultados.\",\"ru\":\"Позвольте агентам добавлять значок «Powered by dsh» к документам, запросам на включение и другим результатам.\",\"zh\":\"让 Agent 为文档、PR 等产出添加「powered by dsh」徽章。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-experimental-ralph-bundle\",\"title\":{\"en\":\"Ralph loops\",\"de\":\"Ralph-Loops\",\"es\":\"Bucles de Ralph\",\"fr\":\"Boucles Ralph\",\"ja\":\"Ralph ループ\",\"pt\":\"Loops de Ralph\",\"ru\":\"Ральф петли\",\"zh\":\"Ralph 循环\"},\"description\":{\"en\":\"Ask for a Ralph loop with a goal, and the agent starts a fresh agent on it round after round until the goal is met, a blocker is reported, or the round limit is reached.\",\"de\":\"Bitten Sie um eine Ralph-Schleife mit einem Ziel, und der Agent startet Runde um Runde einen neuen Agenten darauf, bis das Ziel erreicht ist, ein Hindernis gemeldet wird oder das Rundenlimit erreicht ist.\",\"es\":\"Pida un bucle Ralph con un objetivo, y el agente inicia un agente nuevo sobre él ronda tras ronda hasta que se cumpla el objetivo, se informe de un bloqueo o se alcance el límite de rondas.\",\"fr\":\"Demandez une boucle Ralph avec un objectif, et l'agent lance un nouvel agent dessus, tour après tour, jusqu'à ce que l'objectif soit atteint, qu'un blocage soit signalé ou que la limite de tours soit atteinte.\",\"ja\":\"目標を指定して Ralph ループを依頼すると、エージェントは、目標が達成されるか、阻害要因が報告されるか、ラウンド数の上限に達するまで、ラウンドごとに新しいエージェントを起動してその目標に取り組ませます。\",\"pt\":\"Peça um loop Ralph com um objetivo, e o agente inicia um novo agente nele rodada após rodada até que o objetivo seja atingido, um bloqueio seja informado ou o limite de rodadas seja alcançado.\",\"ru\":\"Попросите запустить цикл Ralph с целью, и агент будет раунд за раундом запускать для неё нового агента, пока цель не будет достигнута, не будет сообщено о препятствии или не будет достигнут лимит раундов.\",\"zh\":\"要求用 Ralph 循环完成一个目标后,智能体会一轮接一轮地启动新的智能体处理它,直到目标达成、报告受阻或达到轮次上限。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-experimental-session-titles-bundle\",\"title\":{\"en\":\"Conversation-following titles\",\"de\":\"Konversationsfolgende Titel\",\"es\":\"Títulos que siguen la conversación\",\"fr\":\"Titres de suivi de conversation\",\"ja\":\"会話に追従するタイトル\",\"pt\":\"Títulos que acompanham conversas\",\"ru\":\"Заголовки, следующие за разговором\",\"zh\":\"随对话更新的标题\"},\"description\":{\"en\":\"Writes a session's title from all of your messages and updates it when the main task changes, instead of only from the first message.\",\"de\":\"Erstellt den Titel einer Sitzung aus all Ihren Nachrichten und aktualisiert ihn, wenn sich die Hauptaufgabe ändert, statt ihn nur aus der ersten Nachricht zu bilden.\",\"es\":\"Escribe el título de una sesión a partir de todos sus mensajes y lo actualiza cuando cambia la tarea principal, en lugar de basarse solo en el primer mensaje.\",\"fr\":\"Rédige le titre d'une session à partir de tous vos messages et le met à jour lorsque la tâche principale change, au lieu de se baser uniquement sur le premier message.\",\"ja\":\"最初のメッセージだけでなく、あなたのすべてのメッセージからセッションのタイトルを作成し、主なタスクが変わったときに更新します。\",\"pt\":\"Escreve o título de uma sessão a partir de todas as suas mensagens e o atualiza quando a tarefa principal muda, em vez de usar apenas a primeira mensagem.\",\"ru\":\"Составляет заголовок сеанса по всем вашим сообщениям и обновляет его при смене основной задачи, а не только по первому сообщению.\",\"zh\":\"根据你的所有消息生成会话标题,并在主要任务变化时更新,而不是只根据第一条消息生成。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-experimental-terminal-bundle\",\"title\":{\"en\":\"Persistent terminals\",\"de\":\"Persistente Terminals\",\"es\":\"Terminales persistentes\",\"fr\":\"Terminaux persistants\",\"ja\":\"永続ターミナル\",\"pt\":\"Terminais persistentes\",\"ru\":\"Постоянные терминалы\",\"zh\":\"持久终端\"},\"description\":{\"en\":\"Gives the agent terminals that open as sidebar tabs you can watch and take over by typing in them. Processes keep running between tool calls, so it can start a dev server or REPL and come back later to read output; it can also read terminals you open yourself.\",\"de\":\"Stellt dem Agenten Terminals bereit, die als Seitenleisten-Tabs geöffnet werden; Sie können zusehen und durch Tippen die Kontrolle übernehmen. Prozesse laufen zwischen Tool-Aufrufen weiter, sodass er einen Entwicklungsserver oder eine REPL starten und später die Ausgabe lesen kann; er kann auch Terminals lesen, die Sie selbst öffnen.\",\"es\":\"Proporciona al agente terminales que se abren como pestañas de la barra lateral, que puede observar y controlar escribiendo en ellas. Los procesos siguen ejecutándose entre llamadas a herramientas, de modo que puede iniciar un servidor de desarrollo o un REPL y volver más tarde para leer la salida; también puede leer los terminales que usted abra.\",\"fr\":\"Fournit à l'agent des terminaux qui s'ouvrent comme onglets de la barre latérale ; vous pouvez les observer et en prendre le contrôle en y tapant. Les processus continuent de s'exécuter d'un appel d'outil à l'autre, afin qu'il puisse lancer un serveur de développement ou un REPL et revenir plus tard lire la sortie ; il peut aussi lire les terminaux que vous ouvrez vous-même.\",\"ja\":\"エージェントに、サイドバーのタブとして開くターミナルを提供します。様子を見守ることができ、入力すれば操作を引き継げます。プロセスはツール呼び出し間も実行され続けるため、開発サーバーや REPL を起動して後から出力を読めます。あなたが自分で開いたターミナルも読み取れます。\",\"pt\":\"Fornece ao agente terminais que abrem como abas da barra lateral, que você pode acompanhar e assumir digitando neles. Os processos continuam em execução entre chamadas de ferramentas, para que ele possa iniciar um servidor de desenvolvimento ou um REPL e voltar depois para ler a saída; ele também pode ler os terminais que você mesmo abrir.\",\"ru\":\"Предоставляет агенту терминалы, которые открываются вкладками боковой панели; вы можете наблюдать за ними и взять управление, начав вводить текст. Процессы продолжают работать между вызовами инструментов, поэтому агент может запустить сервер разработки или REPL и позже прочитать вывод; он также может читать терминалы, которые вы открыли сами.\",\"zh\":\"为智能体提供以侧栏标签页打开的终端,你可以旁观,也可以直接在其中键入来接管。进程在多次工具调用之间持续运行,因此它可以启动开发服务器或 REPL,稍后再读取输出;它也能读取你自己打开的终端。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-experimental-liveshare\",\"title\":{\"en\":\"LiveShare Session Sharing\",\"de\":\"LiveShare-Sitzungsfreigabe\",\"es\":\"Compartir sesión de LiveShare\",\"fr\":\"Partage de session LiveShare\",\"ja\":\"LiveShare セッション共有\",\"pt\":\"Compartilhamento de sessão do LiveShare\",\"ru\":\"Совместный доступ к сеансу LiveShare\",\"zh\":\"LiveShare 会话分享\"},\"description\":{\"en\":\"Share the current Session with a colleague, who can drive it in a browser, edit files inside the granted workspace when the share allows writes, or branch their own Session from the completed history.\",\"de\":\"Teilt die aktuelle Sitzung mit einer Kollegin oder einem Kollegen, die oder der sie im Browser bedienen, bei erlaubten Schreibzugriffen Dateien im freigegebenen Arbeitsbereich bearbeiten oder aus der abgeschlossenen Historie eine eigene Sitzung abzweigen kann.\",\"es\":\"Comparte la sesión actual con un compañero, que puede dirigirla en un navegador, editar archivos dentro del espacio de trabajo concedido cuando el recurso compartido permite escritura, o crear su propia sesión a partir del historial completado.\",\"fr\":\"Partagez la session en cours avec un collègue, qui peut la piloter dans un navigateur, modifier des fichiers dans l'espace de travail accordé lorsque le partage autorise l'écriture, ou créer sa propre session à partir de l'historique terminé.\",\"ja\":\"現在のセッションを同僚と共有し、ブラウザから操作してもらう、共有が書き込みを許可する場合は付与されたワークスペース内のファイルを編集してもらう、または完了した履歴から自分のセッションを分岐してもらえます。\",\"pt\":\"Compartilhe a sessão atual com um colega, que pode conduzi-la no navegador, editar arquivos dentro do espaço de trabalho concedido quando o compartilhamento permite escrita, ou ramificar a própria sessão a partir do histórico concluído.\",\"ru\":\"Поделитесь текущим сеансом с коллегой: он сможет управлять им в браузере, редактировать файлы в предоставленном рабочем пространстве, если общий доступ разрешает запись, или ответвить собственный сеанс из завершённой истории.\",\"zh\":\"把当前会话分享给同事,对方可在浏览器中驱动该会话、在分享允许写入时修改授权工作区内的文件,或从已完成历史分支出自己的会话。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-experimental-session-search\",\"title\":{\"en\":\"Session search\",\"de\":\"Sitzungssuche\",\"es\":\"búsqueda de sesión\",\"fr\":\"Recherche de sessions\",\"ja\":\"セッション検索\",\"pt\":\"Pesquisa de sessão\",\"ru\":\"Поиск сеанса\",\"zh\":\"会话搜索\"},\"description\":{\"en\":\"Ask about earlier work, such as “How did we fix the pool leak last week?”, and the agent searches your earlier sessions in the same workspace to answer.\",\"de\":\"Fragen Sie nach früherer Arbeit, etwa „Wie haben wir letzte Woche das Pool-Leck behoben?“, und der Agent durchsucht Ihre früheren Sitzungen aus demselben Arbeitsverzeichnis, um zu antworten.\",\"es\":\"Pregunte por trabajo anterior, como “¿Cómo arreglamos la fuga del pool la semana pasada?”, y el agente busca en sus sesiones anteriores del mismo directorio de trabajo para responder.\",\"fr\":\"Posez une question sur un travail antérieur, par exemple « Comment avons-nous corrigé la fuite du pool la semaine dernière ? », et l'agent recherche dans vos sessions antérieures du même répertoire de travail pour répondre.\",\"ja\":\"「先週プールのリークをどう直した?」のように以前の作業について尋ねると、エージェントは同じ作業ディレクトリの過去のセッションを検索して回答します。\",\"pt\":\"Pergunte sobre trabalhos anteriores, como “Como corrigimos o vazamento do pool na semana passada?”, e o agente pesquisa suas sessões anteriores do mesmo diretório de trabalho para responder.\",\"ru\":\"Спросите о прошлой работе, например «Как мы исправили утечку в пуле на прошлой неделе?», и агент выполнит поиск по вашим прошлым сеансам из того же рабочего каталога, чтобы ответить.\",\"zh\":\"询问以往的工作,例如“上周我们是怎么修好连接池泄漏的?”,智能体会搜索同一工作区的历史会话来回答。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-experimental-tool-worktree\",\"title\":{\"en\":\"Git worktrees\",\"de\":\"Git-Arbeitsbäume\",\"es\":\"árboles de trabajo de git\",\"fr\":\"Arbres de travail Git\",\"ja\":\"Git ワークツリー\",\"pt\":\"Árvores de trabalho Git\",\"ru\":\"Рабочие деревья Git\",\"zh\":\"Git 工作树\"},\"description\":{\"en\":\"Ask for work on a new branch, and the agent creates a separate Git worktree and continues there, leaving your current checkout as it is.\",\"de\":\"Bitten Sie um Arbeit auf einem neuen Branch, und der Agent erstellt einen separaten Git-Worktree und arbeitet dort weiter, während Ihr aktueller Checkout unverändert bleibt.\",\"es\":\"Pida trabajar en una rama nueva, y el agente crea un worktree de Git independiente y continúa allí, dejando su checkout actual tal como está.\",\"fr\":\"Demandez à travailler sur une nouvelle branche, et l'agent crée un worktree Git distinct et y poursuit le travail, en laissant votre copie de travail actuelle telle quelle.\",\"ja\":\"新しいブランチでの作業を依頼すると、エージェントは別の Git ワークツリーを作成してそこで作業を続け、現在のチェックアウトはそのまま残します。\",\"pt\":\"Peça para trabalhar em um novo branch, e o agente cria um worktree do Git separado e continua lá, deixando seu checkout atual como está.\",\"ru\":\"Попросите поработать в новой ветке, и агент создаст отдельное рабочее дерево Git и продолжит работу там, оставив вашу текущую рабочую копию как есть.\",\"zh\":\"要求在新分支上工作时,智能体会创建单独的 Git 工作树并在其中继续,你当前的工作树保持原样。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-cua-bundle\",\"title\":{\"en\":\"Computer use\",\"de\":\"Computernutzung\",\"es\":\"Uso de la computadora\",\"fr\":\"Utilisation de l'ordinateur\",\"ja\":\"Computer Use\",\"pt\":\"Uso do computador\",\"ru\":\"Использование компьютера\",\"zh\":\"Computer Use\"},\"description\":{\"en\":\"Currently supports macOS; Windows support is in development. Loads computer use for existing and new PTC sessions. Switch to PTC mode and grant Accessibility and Screen Recording permissions to use it.\",\"de\":\"Unterstützt derzeit macOS; Die Windows-Unterstützung befindet sich in der Entwicklung. Lädt die Computernutzung für bestehende und neue PTC-Sitzungen. Wechseln Sie in den PTC-Modus und erteilen Sie die Berechtigungen für Barrierefreiheit und Bildschirmaufzeichnung, um ihn zu verwenden.\",\"es\":\"Actualmente es compatible con macOS; El soporte para Windows está en desarrollo. Carga el uso de la computadora para sesiones PTC nuevas y existentes. Cambie al modo PTC y otorgue permisos de Accesibilidad y Grabación de pantalla para usarlo.\",\"fr\":\"Prend actuellement en charge macOS ; La prise en charge de Windows est en cours de développement. Charge l'utilisation de l'ordinateur pour les sessions PTC existantes et nouvelles. Passez en mode PTC et accordez les autorisations d’accessibilité et d’enregistrement d’écran pour l’utiliser.\",\"ja\":\"現在は macOS のみ対応し、Windows 対応は開発中です。既存および新規の PTC セッションに Computer Use を読み込みます。PTC モードに切り替え、アクセシビリティと画面収録の権限を許可して使用してください。\",\"pt\":\"Atualmente suporta macOS; O suporte Windows está em desenvolvimento. Carrega o uso do computador para sessões PTC novas e existentes. Mude para o modo PTC e conceda permissões de acessibilidade e gravação de tela para usá-lo.\",\"ru\":\"В настоящее время поддерживается macOS; Поддержка Windows находится в разработке. Загружает использование компьютера для существующих и новых сеансов PTC. Переключитесь в режим PTC и предоставьте разрешения на доступность и запись экрана для его использования.\",\"zh\":\"目前仅支持 macOS,Windows 支持正在开发中。为已有及新建 PTC 会话加载 Computer Use。请切换到 PTC 模式来使用,并授予辅助功能和屏幕录制权限。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-experimental-plugin-market-bundle\",\"title\":{\"en\":\"Custom plugin indexes\",\"de\":\"Benutzerdefinierte Plugin-Indizes\",\"es\":\"Índices de complementos personalizados\",\"fr\":\"Index de plugins personnalisés\",\"ja\":\"カスタムプラグインインデックス\",\"pt\":\"Índices de plug-ins personalizados\",\"ru\":\"Пользовательские индексы плагинов\",\"zh\":\"自定义插件索引\"},\"description\":{\"en\":\"Adds a Discover tab to Plugins, where you browse and install plugins from plugin indexes you add.\",\"de\":\"Fügt unter „Plugins“ den Tab „Entdecken“ hinzu, in dem Sie Plugins aus von Ihnen hinzugefügten Plugin-Indizes durchsuchen und installieren.\",\"es\":\"Añade la pestaña “Descubrir” a “Complementos”, donde puede explorar e instalar complementos de los índices de complementos que agregue.\",\"fr\":\"Ajoute à « Plugins » un onglet « Découvrez » où vous parcourez et installez des plugins provenant des index de plugins que vous ajoutez.\",\"ja\":\"「プラグイン」に「見つける」タブを追加し、追加したプラグインインデックスからプラグインを閲覧・インストールできるようにします。\",\"pt\":\"Adiciona a guia “Descubra” a “Plug-ins”, onde você navega e instala plug-ins dos índices de plug-ins que adiciona.\",\"ru\":\"Добавляет в «Плагины» вкладку «Откройте для себя», где можно просматривать и устанавливать плагины из добавленных вами индексов плагинов.\",\"zh\":\"在插件页添加“发现”标签页,从你添加的插件索引中浏览和安装插件。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-experimental-forge-bundle\",\"title\":{\"en\":\"Change requests & worktrees\",\"de\":\"Änderungsanfragen und Arbeitsbäume\",\"es\":\"Solicitudes de cambio y árboles de trabajo\",\"fr\":\"Demandes de modification et arbres de travail\",\"ja\":\"変更リクエストとワークツリー\",\"pt\":\"Solicitações de alteração e árvores de trabalho\",\"ru\":\"Запросы на изменение и рабочие деревья\",\"zh\":\"变更请求与工作树\"},\"description\":{\"en\":\"Keep linked GitHub pull requests beside your conversation: follow checks and reviews, inspect diffs, and send feedback to the agent. Review local changes and use a separate worktree to isolate each task. GitHub features require the gh CLI installed and signed in on the host.\",\"de\":\"Verknüpfte GitHub-Pull-Requests neben der Unterhaltung verfolgen: Prüfungen und Reviews ansehen, Code vergleichen und Feedback an den Agenten senden. Lokale Änderungen prüfen und Aufgaben mit separaten Arbeitsbäumen isolieren. GitHub-Funktionen erfordern eine installierte gh-CLI und eine Anmeldung auf dem Host.\",\"es\":\"Sigue los pull requests de GitHub vinculados a la conversación: consulta comprobaciones y revisiones, compara código y envía comentarios al agente. Revisa cambios locales y aísla cada tarea en un árbol de trabajo separado. Las funciones de GitHub requieren instalar la CLI gh e iniciar sesión en el equipo anfitrión.\",\"fr\":\"Suivez les pull requests GitHub liées à votre conversation : consultez les vérifications et les revues, comparez le code et transmettez vos remarques à l’agent. Examinez les modifications locales et isolez chaque tâche dans un arbre de travail séparé. Les fonctions GitHub nécessitent la CLI gh installée et une connexion sur l’hôte.\",\"ja\":\"会話のサイドバーで関連付けられた GitHub PR をまとめて確認できます。チェックやレビューの状況、コードの差分を確認し、修正案をエージェントに渡せます。ローカルの変更確認や、独立したワークツリーによるタスクの分離にも対応します。GitHub 機能にはホストでの gh CLI のインストールとログインが必要です。\",\"pt\":\"Acompanhe os pull requests do GitHub vinculados à conversa: consulte verificações e revisões, compare código e envie comentários ao agente. Revise alterações locais e isole cada tarefa em uma árvore de trabalho separada. Os recursos do GitHub exigem a CLI gh instalada e uma sessão iniciada no host.\",\"ru\":\"Следите за связанными с беседой pull request GitHub: проверками, рецензиями и различиями в коде, а затем передавайте замечания агенту. Просматривайте локальные изменения и изолируйте задачи в отдельных рабочих деревьях. Для функций GitHub требуется установить CLI gh и войти в аккаунт на хосте.\",\"zh\":\"在会话侧栏集中跟踪关联的 GitHub PR:查看检查状态、评审意见与代码差异,并把修改建议交给智能体继续处理。也可查看本地改动,用独立工作树隔离任务。GitHub 功能需要本机安装 gh 并登录。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-subagent-claude-code\",\"title\":{\"de\":\"Claude Code-Subagent\",\"en\":\"Claude Code subagent\",\"es\":\"Subagente Claude Code\",\"fr\":\"Sous-agent Claude Code\",\"ja\":\"Claude Code サブエージェント\",\"pt\":\"Claude Code subagente\",\"ru\":\"Субагент Claude Code\",\"zh\":\"Claude Code 子智能体\"},\"description\":{\"de\":\"Delegieren Sie eine Aufgabe an Claude Code, indem Sie dessen native Authentifizierung und Einstellungen verwenden.\",\"en\":\"Delegate one task to Claude Code using its native authentication and settings.\",\"es\":\"Delegue una tarea a Claude Code utilizando su autenticación y configuración nativas.\",\"fr\":\"Déléguez une tâche à Claude Code à l’aide de son authentification et de ses paramètres natifs.\",\"ja\":\"Claude Code のネイティブの認証と設定を使用して、単独のタスクを委派します。\",\"pt\":\"Delegue uma tarefa a Claude Code usando sua autenticação e configurações nativas.\",\"ru\":\"Делегируйте одну задачу Claude Code, используя его встроенную аутентификацию и настройки.\",\"zh\":\"使用 Claude Code 原生认证和设置委派单个任务。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-subagent-codex\",\"title\":{\"de\":\"Codex-Subagent\",\"en\":\"Codex subagent\",\"es\":\"Subagente Codex\",\"fr\":\"Sous-agent Codex\",\"ja\":\"Codex サブエージェント\",\"pt\":\"Codex subagente\",\"ru\":\"Субагент Codex\",\"zh\":\"Codex 子智能体\"},\"description\":{\"de\":\"Delegieren Sie eine Aufgabe an Codex, indem Sie dessen native Authentifizierung und Einstellungen verwenden.\",\"en\":\"Delegate one task to Codex using its native authentication and settings.\",\"es\":\"Delegue una tarea a Codex utilizando su autenticación y configuración nativas.\",\"fr\":\"Déléguez une tâche à Codex à l’aide de son authentification et de ses paramètres natifs.\",\"ja\":\"Codex のネイティブの認証と設定を使用して、単独のタスクを委派します。\",\"pt\":\"Delegue uma tarefa a Codex usando sua autenticação e configurações nativas.\",\"ru\":\"Делегируйте одну задачу Codex, используя его встроенную аутентификацию и настройки.\",\"zh\":\"使用 Codex 原生认证和设置委派单个任务。\"},\"enabled\":false}]\n\n"}],"isError":false,"id":"{{message:7}}"}},"sourceEventSeqs":[16],"surfaceOp":"append"} {"type":"step/end","data":{"turn":1,"step":1}} {"type":"step/start","data":{"turn":1,"step":2}} {"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","ask_user_question","bash","create_goal","edit","get_goal","glob","grep","interrupt_agent","job_kill","job_list","job_output","list_agents","list_subagent_models","plugin_manager","present","propose_action","read","read_image","schedule_create","schedule_edit","schedule_list","schedule_view","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"change"}} From 873e36e18f36b7375653ebcfaff3620e8951aae2 Mon Sep 17 00:00:00 2001 From: Xinyu Yang Date: Thu, 5 Nov 2026 16:15:59 +0800 Subject: [PATCH 246/322] refactor(client): unify window drag exclusion attribute --- .../2026-09-19-window-drag-coverage-contract.i18n.yaml | 4 ++-- .../architecture/2026-09-19-window-drag-coverage-contract.md | 2 +- .../2026-09-19-window-drag-coverage-contract.zh.md | 2 +- .../v0.2.2-rc.1/window-drag-regions/guide.i18n.yaml | 4 ++-- docs/upgrade-guide/v0.2.2-rc.1/window-drag-regions/guide.md | 2 +- .../upgrade-guide/v0.2.2-rc.1/window-drag-regions/guide.zh.md | 2 +- packages/client/ui-dockkit/src/components/TabPanel.tsx | 2 +- packages/client/web/README.i18n.yaml | 4 ++-- packages/client/web/README.md | 2 +- packages/client/web/README.zh.md | 2 +- packages/client/web/src/base.css | 4 ++-- packages/client/web/tests/base-styles.client.spec.ts | 2 +- 12 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.agents/notes/implemented/architecture/2026-09-19-window-drag-coverage-contract.i18n.yaml b/.agents/notes/implemented/architecture/2026-09-19-window-drag-coverage-contract.i18n.yaml index 326985060c..abe1ee7605 100644 --- a/.agents/notes/implemented/architecture/2026-09-19-window-drag-coverage-contract.i18n.yaml +++ b/.agents/notes/implemented/architecture/2026-09-19-window-drag-coverage-contract.i18n.yaml @@ -9,8 +9,8 @@ en: e4a1c339c31fb1b5 zh: 0e9db2a9ba74e6c7 /agent-note-window-drag-coverage-as-a-contract/decision: - en: e93af84dc61d256c - zh: 07e566e5f764d6dd + en: 81dfb36a4657e6ef + zh: a45de8e3e2eb9b1e /agent-note-window-drag-coverage-as-a-contract/alternatives-considered: en: aeed84530a2bd3f2 zh: c6700d1df49e342a diff --git a/.agents/notes/implemented/architecture/2026-09-19-window-drag-coverage-contract.md b/.agents/notes/implemented/architecture/2026-09-19-window-drag-coverage-contract.md index 8731b264e2..567f579d10 100644 --- a/.agents/notes/implemented/architecture/2026-09-19-window-drag-coverage-contract.md +++ b/.agents/notes/implemented/architecture/2026-09-19-window-drag-coverage-contract.md @@ -12,7 +12,7 @@ The macOS desktop window's draggable area is authored twice. The layout decides Coverage becomes a contract with four executed parts: -1. ui-web's `window-drag/regions.ts` publishes the composition rule as an executable model — a point is draggable when the last collected app-region box containing it declares `drag`, the geometry-in-DOM-order composition the native window applies — together with `INTERACTIVE_SELECTOR`, the source for control exclusions inside `data-window-drag` rows and `data-window-drag-controls` scopes. The shell resets inherited regions on every element. A `data-window-no-drag` viewport without nested drag rows excludes only its own box, while covering overlays and containers with nested drag rows declare their regions separately. The base-styles spec holds the selector, scopes, and reset declarations together. +1. ui-web's `window-drag/regions.ts` publishes the composition rule as an executable model — a point is draggable when the last collected app-region box containing it declares `drag`, the geometry-in-DOM-order composition the native window applies — together with `INTERACTIVE_SELECTOR`, the source for control exclusions inside `data-window-drag` rows and `data-window-drag-controls` scopes. The shell resets inherited regions on every element. A `data-window-drag-exclude` viewport without nested drag rows excludes only its own box, while covering overlays and containers with nested drag rows declare their regions separately. The base-styles spec holds the selector, scopes, and reset declarations together. 2. The shell declares the darwin drag surface exactly once: `html[data-platform='darwin'] [data-window-drag]` in ui-web base.css. Every chrome row marks its own element in markup, so the row's box is the window's draggable geometry and no fixed band has to match any row's height. The ui-theme app-region gate holds a manifest that pairs each row's markup mark with its sheet, its class selector and its authored height, and refuses a mark on any element the manifest does not name — so a row that stops marking itself, an unmarked row added to the composition, and a mark on a content container all fail the same gate. 3. The browser lane gains `window-drag-coverage`, which boots the shipped composition in Chromium with `data-platform='darwin'` and probes clickable controls independently of the boxes that contribute native regions. It asserts that controls stay outside the drag surface, checks each chrome row, and covers a page whose head row marks itself while its scrollable body stays content. 4. The shell owns the one recollection watcher — ui-web's `window-drag/recall.ts`, installed by the boot kernel. It measures every marked row once per frame while the surface can be moving, sets `data-window-drag-recall` on the body for each frame whose geometry changed, and clears it once the geometry holds still through a short grace window, so a report that arrives before a CSS transition moves anything cannot end the loop on its first unchanged sample. It reports every reason the surface can move: a DOM change touching a marked row or the container holding one, a marked row's box resizing, and a transition or animation starting on an element that holds a marked row. No chrome row carries a pulse of its own. diff --git a/.agents/notes/implemented/architecture/2026-09-19-window-drag-coverage-contract.zh.md b/.agents/notes/implemented/architecture/2026-09-19-window-drag-coverage-contract.zh.md index cdb32670e8..d6090d75bf 100644 --- a/.agents/notes/implemented/architecture/2026-09-19-window-drag-coverage-contract.zh.md +++ b/.agents/notes/implemented/architecture/2026-09-19-window-drag-coverage-contract.zh.md @@ -12,7 +12,7 @@ macOS 桌面窗口的可拖区域被写了两遍。布局决定 chrome 行在哪 覆盖变成由四部分组成的、可执行的契约: -1. ui-web 的 `window-drag/regions.ts` 把合成规则发布成可执行模型:当包含某点的最后一个 app-region 盒声明 `drag` 时该点可拖,这正是原生窗口施加的按 DOM 顺序的几何合成。它还发布 `INTERACTIVE_SELECTOR`,作为 `data-window-drag` 行和 `data-window-drag-controls` 范围内控件排除的来源。Shell 为每个元素重置继承的区域。不含嵌套拖动行的 `data-window-no-drag` 视口仅排除自身矩形,覆盖浮层和含嵌套拖动行的容器单独声明区域。base-styles spec 一并检查选择器、作用范围与重置声明。 +1. ui-web 的 `window-drag/regions.ts` 把合成规则发布成可执行模型:当包含某点的最后一个 app-region 盒声明 `drag` 时该点可拖,这正是原生窗口施加的按 DOM 顺序的几何合成。它还发布 `INTERACTIVE_SELECTOR`,作为 `data-window-drag` 行和 `data-window-drag-controls` 范围内控件排除的来源。Shell 为每个元素重置继承的区域。不含嵌套拖动行的 `data-window-drag-exclude` 视口仅排除自身矩形,覆盖浮层和含嵌套拖动行的容器单独声明区域。base-styles spec 一并检查选择器、作用范围与重置声明。 2. 外壳只声明一次 darwin 拖拽面:ui-web base.css 里的 `html[data-platform='darwin'] [data-window-drag]`。每个 chrome 行在 markup 里给自己的元素打标,于是该行自己的盒子就是窗口的可拖几何,不需要任何固定 band 去匹配行高。ui-theme 的 app-region 门禁持有一份清单,把每行的 markup 标记与其样式表、类选择器和写死的高度配成一条,并拒绝清单未点名的元素上的标记——行不再打标、新增未打标的行、把标记打在内容容器上,都会在同一条门禁上失败。 3. 浏览器车道增加 `window-drag-coverage`:以 `data-platform='darwin'` 在 Chromium 里启动真实组合,将可点击控件的探测与贡献原生区域的矩形分开。它断言控件不落在拖拽面内,检查每个 chrome 行,并覆盖页头行打标、可滚动正文保持内容的页面。 4. 外壳持有唯一那个重收集 watcher——ui-web 的 `window-drag/recall.ts`,由引导内核安装。在表面可能移动期间,它每帧测量每个被打标的行,凡该帧几何发生变化就在 body 上打 `data-window-drag-recall`;几何在一段很短的宽限窗口内保持不动之后才清掉,这样在 CSS transition 真正移动任何东西之前到达的一次报告,不会在它第一帧未测到变化时就终止循环。它会报告表面可能移动的每一种原因:触及被打标行或承载它的容器的 DOM 变化、被打标行的盒子尺寸变化,以及持有被打标行的元素上开始的 transition 或 animation。任何 chrome 行都不再自带脉冲。 diff --git a/docs/upgrade-guide/v0.2.2-rc.1/window-drag-regions/guide.i18n.yaml b/docs/upgrade-guide/v0.2.2-rc.1/window-drag-regions/guide.i18n.yaml index 1ef6553300..271f5c4690 100644 --- a/docs/upgrade-guide/v0.2.2-rc.1/window-drag-regions/guide.i18n.yaml +++ b/docs/upgrade-guide/v0.2.2-rc.1/window-drag-regions/guide.i18n.yaml @@ -12,5 +12,5 @@ en: a3c55aed10fdeeb8 zh: dd628088de04631f /explicit-window-regions-for-custom-client-overlays/migration: - en: 85182ed7759e7a18 - zh: 48b0f9de217a9087 + en: cb177bbf9687f49a + zh: c39c94a2d36416b2 diff --git a/docs/upgrade-guide/v0.2.2-rc.1/window-drag-regions/guide.md b/docs/upgrade-guide/v0.2.2-rc.1/window-drag-regions/guide.md index 11007b6753..087a080183 100644 --- a/docs/upgrade-guide/v0.2.2-rc.1/window-drag-regions/guide.md +++ b/docs/upgrade-guide/v0.2.2-rc.1/window-drag-regions/guide.md @@ -16,6 +16,6 @@ This affects custom overlays outside those scopes that cover a drag row. Control ## Migration 1. Inspect the JSX and CSS Modules of custom Client overlays that can cover a header. Check whether their interactive content relied on the previous automatic exclusion. -2. For an interactive viewport without nested drag rows, put `data-window-no-drag` on its visible viewport element. This excludes the viewport's own rectangle and keeps clipped descendants out of the region calculation. For a container whose controls need separate exclusions, put `data-window-drag-controls` on their containing element. Overlays and containers with nested drag rows must declare their regions separately; follow the [window-region rules](../../../../packages/client/web/README.md#understand-the-implementation). +2. For an interactive viewport without nested drag rows, put `data-window-drag-exclude` on its visible viewport element. This excludes the viewport's own rectangle and keeps clipped descendants out of the region calculation. For a container whose controls need separate exclusions, put `data-window-drag-controls` on their containing element. Overlays and containers with nested drag rows must declare their regions separately; follow the [window-region rules](../../../../packages/client/web/README.md#understand-the-implementation). 3. Keep exclusions on visible owners rather than every focusable descendant. Use a shared `Modal` or `MenuSurface` for the corresponding overlay, or explicitly exclude the custom overlay's visible box. A body portal with no layout box needs an exclusion on its visible content. 4. Load the updated plugin in macOS Desktop. Open the overlay over a header and confirm its controls act without dragging the window. Close it and confirm the header's blank area still drags; scroll the plugin's content out of view and confirm that clipped content does not block the header. diff --git a/docs/upgrade-guide/v0.2.2-rc.1/window-drag-regions/guide.zh.md b/docs/upgrade-guide/v0.2.2-rc.1/window-drag-regions/guide.zh.md index 2e9ade528a..6bce4b60b6 100644 --- a/docs/upgrade-guide/v0.2.2-rc.1/window-drag-regions/guide.zh.md +++ b/docs/upgrade-guide/v0.2.2-rc.1/window-drag-regions/guide.zh.md @@ -16,6 +16,6 @@ description: "依赖 macOS 全局 no-drag 排除的自定义 Client 浮层必须 ## 迁移 1. 检查可能覆盖页头的自定义 Client 浮层的 JSX 与 CSS Modules,确认其交互内容是否依赖此前的自动排除。 -2. 对不含嵌套拖动行的交互视口,在可见视口元素上添加 `data-window-no-drag`。它仅排除视口自身矩形,使被裁剪的子元素不参与区域计算。若容器内的控件需要分别排除,在承载这些控件的元素上添加 `data-window-drag-controls`。浮层和含嵌套拖动行的容器必须单独声明区域,遵循[窗口区域规则](../../../../packages/client/web/README.zh.md#understand-the-implementation)。 +2. 对不含嵌套拖动行的交互视口,在可见视口元素上添加 `data-window-drag-exclude`。它仅排除视口自身矩形,使被裁剪的子元素不参与区域计算。若容器内的控件需要分别排除,在承载这些控件的元素上添加 `data-window-drag-controls`。浮层和含嵌套拖动行的容器必须单独声明区域,遵循[窗口区域规则](../../../../packages/client/web/README.zh.md#understand-the-implementation)。 3. 在可见区域所有者上声明排除,不要逐个排除可聚焦子元素。对应浮层采用共享 `Modal` 或 `MenuSurface`,或显式排除自定义浮层的可见矩形。不产生布局矩形的 body portal 需在可见内容上声明排除。 4. 在 macOS Desktop 加载更新后的插件,将浮层打开到页头上方,确认其控件正常生效且不会拖动窗口。关闭浮层后确认页头空白区域仍可拖动;将插件内容滚出可见区,确认被裁剪内容不会阻挡页头。 diff --git a/packages/client/ui-dockkit/src/components/TabPanel.tsx b/packages/client/ui-dockkit/src/components/TabPanel.tsx index 213ab58b10..cb08f80991 100644 --- a/packages/client/ui-dockkit/src/components/TabPanel.tsx +++ b/packages/client/ui-dockkit/src/components/TabPanel.tsx @@ -296,7 +296,7 @@ export function TabStrip({ state, pane, callbacks, offsets }: TabStripProps): Re // float's own subtraction and swallows the panel's header and controls.
-
+
{pane.tabs.map((tabId, index) => { const tab = getTab(state, tabId) const selected = tabId === pane.activeTabId diff --git a/packages/client/web/README.i18n.yaml b/packages/client/web/README.i18n.yaml index f98fe8a099..6667e00fa7 100644 --- a/packages/client/web/README.i18n.yaml +++ b/packages/client/web/README.i18n.yaml @@ -30,8 +30,8 @@ en: 942959cb40ee31a1 zh: 9c86ac2cf6a13976 /deepseek-ai-dsh-client-web/understand-the-implementation: - en: c8f7a59e69c49180 - zh: b6a7de1a91871e95 + en: 5c9f1d84e582b0ae + zh: a672bc4ed04b24ea /deepseek-ai-dsh-client-web/understand-the-implementation/design-concept: en: a8e8f2e466eff0a1 zh: e0216136dcf36934 diff --git a/packages/client/web/README.md b/packages/client/web/README.md index e7acd458c0..8aaabbf2cf 100644 --- a/packages/client/web/README.md +++ b/packages/client/web/README.md @@ -59,7 +59,7 @@ The package accepts no plugin config of its own; the generated [configuration ca Menus use the shared `MenuSurface` material, including the macOS backing for background blur; custom content follows the [menu rules](../../../docs/web-styling.md#component-rules). -On macOS, native window regions use full element boxes without overflow clipping. The shell resets inherited regions and limits automatic control exclusions to `data-window-drag` rows or explicit `data-window-drag-controls` scopes. Scrollable content outside those scopes receives no automatic exclusion. An interactive viewport without nested drag rows uses `data-window-no-drag` to exclude only its own box; covering overlays and containers with their own drag rows declare their regions separately. Body portals need a real box, or an explicit exclusion on their visible content. +On macOS, native window regions use full element boxes without overflow clipping. The shell resets inherited regions and limits automatic control exclusions to `data-window-drag` rows or explicit `data-window-drag-controls` scopes. Scrollable content outside those scopes receives no automatic exclusion. An interactive viewport without nested drag rows uses `data-window-drag-exclude` to exclude only its own box; covering overlays and containers with their own drag rows declare their regions separately. Body portals need a real box, or an explicit exclusion on their visible content.
Implementation internals — click to expand diff --git a/packages/client/web/README.zh.md b/packages/client/web/README.zh.md index 647e1521c0..0b94a8e60a 100644 --- a/packages/client/web/README.zh.md +++ b/packages/client/web/README.zh.md @@ -59,7 +59,7 @@ Web 和 Desktop 的数学公式渲染要求支持 WOFF2。[Web 构建](../../../ 菜单采用共享 `MenuSurface` 材质,包括用于背景模糊的 macOS 底层;自定义内容遵循[菜单规则](../../../docs/web-styling.zh.md#component-rules)。 -在 macOS 上,原生窗口区域使用元素完整矩形,不考虑 overflow 裁剪。Shell 重置继承的区域,并将控件的自动排除限制在 `data-window-drag` 行或显式 `data-window-drag-controls` 范围内。范围外的滚动内容不会获得自动排除。不含嵌套拖动行的交互视口使用 `data-window-no-drag`,仅排除自身矩形;覆盖浮层和含自有拖动行的容器单独声明区域。Body portal 必须具有实际矩形,否则需在可见内容上显式声明排除。 +在 macOS 上,原生窗口区域使用元素完整矩形,不考虑 overflow 裁剪。Shell 重置继承的区域,并将控件的自动排除限制在 `data-window-drag` 行或显式 `data-window-drag-controls` 范围内。范围外的滚动内容不会获得自动排除。不含嵌套拖动行的交互视口使用 `data-window-drag-exclude`,仅排除自身矩形;覆盖浮层和含自有拖动行的容器单独声明区域。Body portal 必须具有实际矩形,否则需在可见内容上显式声明排除。
实现细节——点击展开 diff --git a/packages/client/web/src/base.css b/packages/client/web/src/base.css index 549c64d95a..c2de24767c 100644 --- a/packages/client/web/src/base.css +++ b/packages/client/web/src/base.css @@ -81,7 +81,7 @@ html[data-platform='darwin'] body > :not(#root) { /* An interactive viewport without nested drag rows owns one box; its clipped descendants do not. Containers with nested drag rows must instead declare their own region. */ -html[data-platform='darwin'] [data-window-no-drag] { +html[data-platform='darwin'] [data-window-drag-exclude] { -webkit-app-region: no-drag; } @@ -96,7 +96,7 @@ html[data-platform='darwin'] :where([data-window-drag], [data-window-drag-contro [role='button'], [role='link'], [role='tab'], [role='menuitem'], [role='menuitemcheckbox'], [role='menuitemradio'], [role='option'], [role='checkbox'], [role='radio'], [role='switch'], [role='slider'], [role='combobox'], [role='textbox'] -):where(:not([data-window-no-drag] *)) { +):where(:not([data-window-drag-exclude] *)) { -webkit-app-region: no-drag; } diff --git a/packages/client/web/tests/base-styles.client.spec.ts b/packages/client/web/tests/base-styles.client.spec.ts index 22ea3868f9..06d638b828 100644 --- a/packages/client/web/tests/base-styles.client.spec.ts +++ b/packages/client/web/tests/base-styles.client.spec.ts @@ -51,7 +51,7 @@ describe('web shell base.css', () => { // declare the same list, so a new interactive role is added in one place // and a drift between the sheet and the composition model fails here. const scope = "html[data-platform='darwin'] :where([data-window-drag], [data-window-drag-controls])" - const rule = /:is\(([^)]*)\):where\(:not\(\[data-window-no-drag\] \*\)\)\s*\{[^}]*app-region:\s*no-drag/ + const rule = /:is\(([^)]*)\):where\(:not\(\[data-window-drag-exclude\] \*\)\)\s*\{[^}]*app-region:\s*no-drag/ .exec(normalizedCss.split(scope)[1] ?? '') expect(rule, 'base.css declares no darwin interactive no-drag rule').not.toBeNull() const declared = rule![1]!.split(',').map(part => part.trim()).join(', ') From 5991a206e4fa412c2e64b83ad408a5af7123ab7b Mon Sep 17 00:00:00 2001 From: brickmaker Date: Thu, 5 Nov 2026 16:19:27 +0800 Subject: [PATCH 247/322] docs(desktop): add unified uninstall cleanup guide (#7878) * docs(desktop): add unified uninstall cleanup guide * docs(desktop): address uninstall guide review fixes * docs(desktop): restore original cleanup commands and desktop labels * docs(desktop): clarify optional cleanup and simplify guide * docs: remove desktop uninstall link from development guide --- .../guide/desktop-uninstall-cleanup.i18n.yaml | 16 ++++++ docs/user/guide/desktop-uninstall-cleanup.md | 57 +++++++++++++++++++ .../guide/desktop-uninstall-cleanup.zh.md | 57 +++++++++++++++++++ docs/user/guide/index.i18n.yaml | 4 +- docs/user/guide/index.md | 1 + docs/user/guide/index.zh.md | 1 + website/docs.ts | 8 +++ 7 files changed, 142 insertions(+), 2 deletions(-) create mode 100644 docs/user/guide/desktop-uninstall-cleanup.i18n.yaml create mode 100644 docs/user/guide/desktop-uninstall-cleanup.md create mode 100644 docs/user/guide/desktop-uninstall-cleanup.zh.md diff --git a/docs/user/guide/desktop-uninstall-cleanup.i18n.yaml b/docs/user/guide/desktop-uninstall-cleanup.i18n.yaml new file mode 100644 index 0000000000..c550e27dc6 --- /dev/null +++ b/docs/user/guide/desktop-uninstall-cleanup.i18n.yaml @@ -0,0 +1,16 @@ +# Bilingual-pair consistency record for desktop-uninstall-cleanup.md (docs/i18n/README.md): per heading +# section, a hash of its English and Chinese blocks outside code blocks and generated regions. +# After editing either side, bring the other along and re-record with: +# pnpm run verify-translation-pairing --write docs/user/guide/desktop-uninstall-cleanup.md +/uninstall-dsh-desktop: + en: bbd616011b211905 + zh: 93b6146e97d9bb88 +/uninstall-dsh-desktop/1-uninstall-the-app: + en: 6ba6b5bc4153c3cd + zh: 36712b216d118155 +/uninstall-dsh-desktop/2-clean-up-local-data: + en: 848cdeea29e23d4c + zh: ccd2260681a94c45 +/uninstall-dsh-desktop/3-verify-cleanup: + en: 396bdba7cd24b278 + zh: 2488dc9721081aee diff --git a/docs/user/guide/desktop-uninstall-cleanup.md b/docs/user/guide/desktop-uninstall-cleanup.md new file mode 100644 index 0000000000..906cf6d280 --- /dev/null +++ b/docs/user/guide/desktop-uninstall-cleanup.md @@ -0,0 +1,57 @@ +# Uninstall DSH Desktop + +English | [中文](desktop-uninstall-cleanup.zh.md) + +Use this guide to uninstall DeepSeek Harness Desktop on macOS or Windows. Local data cleanup is optional. + +## 1. Uninstall the app + +Finish any commands using Desktop's bundled CLI. If you installed the `dsh` command through Desktop, first select **Manage dsh Command… → Remove** in the application menu. This removes Desktop's command registration without uninstalling independent CLI programs. + +Quit DeepSeek Harness, then uninstall it using your platform's procedure: + +- **macOS:** Delete the app from Applications in Finder. +- **Windows:** Uninstall it through Settings → Apps → Installed apps on Windows 11, or Control Panel → Programs → Programs and Features. + +## 2. Clean up local data + +This step is optional. If you want to clean up local data, select the script for your platform below, then paste and run it in Terminal on macOS or PowerShell on Windows. + +The scripts permanently delete the current user's default Harness home and the Desktop data paths listed below, including sessions, credentials, settings, plugins, caches, and shared CLI state. If you configured `DSH_HOME`, inspect that directory separately before deleting it; the scripts still delete the default `~/.dsh`. Isolated development and test data directories are outside this cleanup scope. + +On Windows, the uninstaller normally removes the three application-data directories listed in the script but retains the Harness home. The script also handles those directories if uninstallation left files behind or retained app data. + +::: code-group + +```bash [macOS] +rm -rf -- \ + "$HOME/.dsh" \ + "$HOME/Library/Application Support/@deepseek-ai/dsh-desktop" \ + "$HOME/Library/Application Support/DeepSeek Harness" \ + "$HOME/Library/Logs/DeepSeek Harness" \ + "$HOME/Library/Preferences/com.deepseek.dsh.plist" \ + "$HOME/Library/Caches/com.deepseek.dsh" \ + "$HOME/Library/Caches/com.deepseek.dsh.ShipIt" \ + "$HOME/Library/HTTPStorages/com.deepseek.dsh" \ + "$HOME/Library/Caches/@deepseek-aidsh-desktop-updater" +``` + +```powershell [Windows] +$ErrorActionPreference = 'Stop' +@( + (Join-Path $env:USERPROFILE '.dsh'), + (Join-Path $env:APPDATA '@deepseek-ai\dsh-desktop'), + (Join-Path $env:APPDATA 'DeepSeek Harness'), + (Join-Path $env:LOCALAPPDATA '@deepseek-aidsh-desktop-updater') +) | ForEach-Object { + if (Test-Path -LiteralPath $_) { + Remove-Item -LiteralPath $_ -Recurse -Force + } +} +``` + +::: + +## 3. Verify cleanup + +If you ran a cleanup script, confirm before reinstalling that the paths listed in it no longer exist. If the script reports an error, resolve it, rerun the script, and check all listed paths again. The Windows script stops at the first error, so later paths may remain. diff --git a/docs/user/guide/desktop-uninstall-cleanup.zh.md b/docs/user/guide/desktop-uninstall-cleanup.zh.md new file mode 100644 index 0000000000..1fa6e80d7e --- /dev/null +++ b/docs/user/guide/desktop-uninstall-cleanup.zh.md @@ -0,0 +1,57 @@ +# 卸载 DSH 桌面端 + +[English](desktop-uninstall-cleanup.md) | 中文 + +本指南介绍如何在 macOS 或 Windows 上卸载 DeepSeek Harness 桌面端。清理本地数据是可选操作。 + +## 1. 卸载应用 + +先结束使用桌面端内置 CLI(命令行界面)的命令。如果曾通过 Desktop 安装 `dsh` 命令,请先在应用菜单中选择 **管理 dsh 命令… → 移除**。此操作移除桌面端的命令注册,不卸载独立安装的 CLI 程序。 + +退出 DeepSeek Harness,然后按所在平台的方式卸载: + +- **macOS:** 在 Finder 的“应用程序”中删除应用。 +- **Windows:** 在 Windows 11 的“设置 → 应用 → 已安装的应用”,或“控制面板 → 程序 → 程序和功能”中卸载。 + +## 2. 清理本地数据 + +此步骤为可选操作。如果需要清理本地数据,请选择下方对应平台的脚本,在 macOS 的终端或 Windows 的 PowerShell 中粘贴运行。 + +脚本会永久删除当前用户默认的 Harness 主目录及下方列出的 Desktop 数据路径,包括会话、凭据、设置、插件、缓存和与 CLI 共用的状态。如果配置了 `DSH_HOME`,删除前请单独检查该目录;脚本仍会删除默认的 `~/.dsh`。隔离的开发和测试数据目录不在此清理范围内。 + +Windows 卸载程序通常会删除脚本中列出的三个应用数据目录,但保留 Harness 主目录。若卸载时有文件残留或保留了应用数据,脚本也会清理这些目录。 + +::: code-group + +```bash [macOS] +rm -rf -- \ + "$HOME/.dsh" \ + "$HOME/Library/Application Support/@deepseek-ai/dsh-desktop" \ + "$HOME/Library/Application Support/DeepSeek Harness" \ + "$HOME/Library/Logs/DeepSeek Harness" \ + "$HOME/Library/Preferences/com.deepseek.dsh.plist" \ + "$HOME/Library/Caches/com.deepseek.dsh" \ + "$HOME/Library/Caches/com.deepseek.dsh.ShipIt" \ + "$HOME/Library/HTTPStorages/com.deepseek.dsh" \ + "$HOME/Library/Caches/@deepseek-aidsh-desktop-updater" +``` + +```powershell [Windows] +$ErrorActionPreference = 'Stop' +@( + (Join-Path $env:USERPROFILE '.dsh'), + (Join-Path $env:APPDATA '@deepseek-ai\dsh-desktop'), + (Join-Path $env:APPDATA 'DeepSeek Harness'), + (Join-Path $env:LOCALAPPDATA '@deepseek-aidsh-desktop-updater') +) | ForEach-Object { + if (Test-Path -LiteralPath $_) { + Remove-Item -LiteralPath $_ -Recurse -Force + } +} +``` + +::: + +## 3. 验证清理结果 + +如果运行了清理脚本,请在重新安装前确认脚本中列出的路径已不存在。如果脚本报错,请解决错误后重跑脚本,再次检查所有列出的路径。Windows 脚本会在首次报错时停止,后续路径可能仍未清理。 diff --git a/docs/user/guide/index.i18n.yaml b/docs/user/guide/index.i18n.yaml index 1a71676270..682939bae5 100644 --- a/docs/user/guide/index.i18n.yaml +++ b/docs/user/guide/index.i18n.yaml @@ -15,5 +15,5 @@ en: e1cb5a05bf6e109d zh: 8b181b0fecbc0517 /use-the-web-ui/continue: - en: 6b244134309ca89c - zh: 971fa14939d88c6b + en: c28740683d2d9a01 + zh: daf20f18e20be97f diff --git a/docs/user/guide/index.md b/docs/user/guide/index.md index 988a4bf9bc..0761fdcdf1 100644 --- a/docs/user/guide/index.md +++ b/docs/user/guide/index.md @@ -27,5 +27,6 @@ The agent can read and edit workspace files, run commands, delegate work, and ma - [Configure models](./providers.md) - [Use the Python SDK](./python-sdk.md) - [Publish the Web UI behind a reverse proxy](./public-deployments.md) +- [Uninstall DSH Desktop](./desktop-uninstall-cleanup.md) - [Use other CLI modes](../../../apps/cli/README.md) - [Develop a plugin](../develop/basic/index.md) diff --git a/docs/user/guide/index.zh.md b/docs/user/guide/index.zh.md index 81c73a420d..c91377fb81 100644 --- a/docs/user/guide/index.zh.md +++ b/docs/user/guide/index.zh.md @@ -27,5 +27,6 @@ Agent(智能体)可以读取和编辑工作区文件、运行命令、委派 - [配置模型](./providers.zh.md) - [使用 Python SDK](./python-sdk.zh.md) - [在反向代理之后发布 Web UI](./public-deployments.zh.md) +- [卸载 DSH 桌面端](./desktop-uninstall-cleanup.zh.md) - [使用其他 CLI 模式](../../../apps/cli/README.zh.md) - [开发插件](../develop/basic/index.zh.md) diff --git a/website/docs.ts b/website/docs.ts index 6e13a68e31..9da60c2704 100644 --- a/website/docs.ts +++ b/website/docs.ts @@ -146,6 +146,14 @@ const homeAndGuide = pairedPages([ section: { root: '入门', en: 'Guide' }, order: 4, }, + { + source: 'docs/user/guide/desktop-uninstall-cleanup.md', + route: 'guide/desktop-uninstall-cleanup.md', + label: { root: '卸载 DSH 桌面端', en: 'Uninstall DSH Desktop' }, + sidebar: { root: 'zh-guide', en: 'en-guide' }, + section: { root: '入门', en: 'Guide' }, + order: 5, + }, { source: 'docs/user/guide/python-sdk.md', route: 'guide/python-sdk.md', From a012eef69a3a66f1a865e6ceb19ad418c14509dd Mon Sep 17 00:00:00 2001 From: Yichen Jiang Date: Thu, 5 Nov 2026 16:27:33 +0800 Subject: [PATCH 248/322] fix(forge): keep comment pluses reachable in unified rows and refuse stale presses In unified rows that show both line numbers, the left plus now moves past the right number into the sign column, where the right plus already sits. It paints above that number's padding, the sticky file header stays above it, and a row that shows the labeled plus offers no second hover plus. The labeled plus of a left context line is reachable again, and a deleted line's plus no longer jumps one column. A drag that starts on a hover plus extends through every row with a line on its starting side, wherever the pointer crosses the row. A press whose range is refused, such as Shift across hunks, keeps the previous selection and no longer opens the editor for it on release. The README describes the checks mark as the filled head branch end. Refs #7937 --- apps/web/tests/forge-panel.e2e.ts | 31 ++++++++++++ .../client-ui-forge/README.i18n.yaml | 4 +- .../experimental/client-ui-forge/README.md | 2 +- .../experimental/client-ui-forge/README.zh.md | 2 +- .../src/client/ChangesTab.module.css | 3 +- .../client-ui-forge/src/client/DiffFile.tsx | 34 ++++++++----- .../src/client/ReviewComposer.module.css | 5 +- .../client-ui-forge/src/client/glyphs.tsx | 2 +- .../tests/diff-review.client.spec.tsx | 49 ++++++++++++++++++- 9 files changed, 112 insertions(+), 20 deletions(-) diff --git a/apps/web/tests/forge-panel.e2e.ts b/apps/web/tests/forge-panel.e2e.ts index 05c8e6bc10..5ba38a556e 100644 --- a/apps/web/tests/forge-panel.e2e.ts +++ b/apps/web/tests/forge-panel.e2e.ts @@ -1174,9 +1174,14 @@ it.skipIf(MODE === 'record')('uses horizontal arrows to navigate files while pre it.skipIf(MODE === 'record')('opens a comment from the hover plus in one press without covering the line number or the code', async () => { const { scaffold, page, project, tripwire } = await launchPanel('web-e2e-forge-hover-plus') + // notes.txt changes into context, a deletion followed by context, and an addition, so unified rows show both numbers. + await writeFile(join(project, 'notes.txt'), ['keep 1', 'keep 2', 'drop 3', 'keep 4', 'keep 5', 'keep 6'].map(line => `${line}\n`).join('')) + await git(project, 'add', 'notes.txt') + await git(project, 'commit', '--quiet', '-m', 'notes') await git(project, 'update-ref', 'refs/remotes/origin/main', 'HEAD') await git(project, 'symbolic-ref', 'refs/remotes/origin/HEAD', 'refs/remotes/origin/main') await writeFile(join(project, 'README.md'), `changed\n${Array.from({ length: 8 }, (_, line) => `line ${line + 2}\n`).join('')}`) + await writeFile(join(project, 'notes.txt'), ['keep 1', 'keep 2', 'keep 4', 'keep 5', 'added', 'keep 6'].map(line => `${line}\n`).join('')) const { settled } = await sendPrompt(page, scaffold) await settled await page.locator('[data-forge-header]').click() @@ -1240,6 +1245,32 @@ it.skipIf(MODE === 'record')('opens a comment from the hover plus in one press w expect(await plus('R4').isVisible()).toBe(true) await number('R4').click() expect(await number('R4').getAttribute('aria-pressed')).toBe('true') + + // With both numbers shown, a deleted line's plus sits where a context line's does: in the sign column. + const notes = view.locator('[data-forge-diff-file="notes.txt"]') + const notesPlus = (name: string) => notes.locator(`[data-review-add="${name}"]`) + const notesCode = (side: 'old' | 'new', line: number) => notes.locator(`[data-review-code][data-${side}-line="${line}"]`) + await notesCode('new', 3).hover() + const contextPlus = await notesPlus('R3').boundingBox() + await notesCode('old', 3).hover() + const deletedPlus = await notesPlus('L3').boundingBox() + const nextRow = await notesCode('old', 4).boundingBox() + if (contextPlus === null || deletedPlus === null || nextRow === null) throw new Error('The pluses and the next row must be rendered') + expect(deletedPlus.x).toBe(contextPlus.x) + // A drag from the deleted line's plus extends through the context row below it on the old side. + const x = deletedPlus.x + deletedPlus.width / 2 + await page.mouse.move(x, deletedPlus.y + deletedPlus.height / 2) + await page.mouse.down() + await page.mouse.move(x, nextRow.y + nextRow.height / 2, { steps: 5 }) + await page.mouse.up() + await notes.getByRole('region', { name: '评论 L3–4', exact: true }).waitFor() + await notes.getByRole('button', { name: '取消', exact: true }).click() + await notes.getByRole('textbox').waitFor({ state: 'detached' }) + // The labeled plus of a left context line stays reachable; Playwright refuses a covered target. + await notes.getByRole('button', { name: '选择第 L2 行', exact: true }).click() + expect((await notes.getByRole('button', { name: '添加评论', exact: true }).boundingBox())?.x).toBe(contextPlus.x) + await notes.getByRole('button', { name: '添加评论', exact: true }).click() + await notes.getByRole('region', { name: '评论 L2', exact: true }).waitFor() expect(tripwire.pageErrors).toEqual([]) expect(tripwire.warnings).toEqual([]) }) diff --git a/packages/experimental/client-ui-forge/README.i18n.yaml b/packages/experimental/client-ui-forge/README.i18n.yaml index d2d5416186..5ae68e348c 100644 --- a/packages/experimental/client-ui-forge/README.i18n.yaml +++ b/packages/experimental/client-ui-forge/README.i18n.yaml @@ -15,8 +15,8 @@ en: d152484eb41ac6b4 zh: 2f8a621b991260a1 /deepseek-ai-dsh-experimental-client-ui-forge/use-this-package: - en: 36241c0198e0ad15 - zh: 289df8b50bf1f445 + en: 3f8b0e49e91d7255 + zh: 4037fa8ada444bc2 /deepseek-ai-dsh-experimental-client-ui-forge/understand-the-implementation: en: 80ba18c47e570e5e zh: 2f0fce0affa48f59 diff --git a/packages/experimental/client-ui-forge/README.md b/packages/experimental/client-ui-forge/README.md index b1254fbab6..2c5a473c42 100644 --- a/packages/experimental/client-ui-forge/README.md +++ b/packages/experimental/client-ui-forge/README.md @@ -34,7 +34,7 @@ Panel text follows the application language: Chinese, English, Japanese, Spanish - **Removed worktree** — when the worktree the Session works in has been removed outside the Session, a card above the composer says so, and a message sent meanwhile waits without starting its turn until the worktree is restored or left; the card then says that the message goes on afterwards. Restore worktree, also offered as Restore in the tab, checks the branch out again at the same directory, or creates the branch again at the commit it started from when the branch is gone too; while it runs, the card follows its two steps, preparing the worktree and checking out files, and the tab's Restore turns into a spinner. Continue in the project moves the Session to the source checkout. Meanwhile the tab's first row shows a warning glyph. - **Code review and changes** — on the right-sidebar start page, opens the same change request tab as the Session header button. - **Header button** — appears when the Session has bound change requests or its directory is inside a Git checkout, and shows or hides the tab. A red dot marks an open change request with failed checks, requested changes, or conflicts. -- **Session list** — after a Session row's time, a branch glyph shows while the Session works in the worktree the panel created for it, and a glyph shows the state of its most urgent change request: one needing attention first, then open, draft, not yet polled, merged, and closed. The glyph of an open change request keeps the row's subdued color with a dot for running, passed, or failed checks; merged and closed ones keep their state colors. The row's hover card names the worktree branch and what it started from, then up to three change requests with their number, title, state, and checks, and how many more there are. A restart shows the states known before it until the next poll. +- **Session list** — after a Session row's time, a branch glyph shows while the Session works in the worktree the panel created for it, and a glyph shows the state of its most urgent change request: one needing attention first, then open, draft, not yet polled, merged, and closed. The glyph of an open change request keeps the row's subdued color, with its head branch end filled in the color of running, passed, or failed checks; merged and closed ones keep their state colors. The row's hover card names the worktree branch and what it started from, then up to three change requests with their number, title, state, and checks, and how many more there are. A restart shows the states known before it until the next poll. - **Tab** — the first row names the checked-out branch, or the abbreviated commit on a detached HEAD, after a folder glyph for the project directory or a branch glyph for a worktree, and the kind of checkout, which is the worktree the Session created with its base, another worktree, or the project directory; its tooltip adds the path with the Host home shortened to `~`, its button copies the full path, and for a removed worktree it offers Restore. Below it, each change request card shows a glyph for its state, its title, which opens it in the browser, and its number; the glyph tells open, draft, merged, and closed apart, and marks an open one that is not a draft with failed checks, requested changes, or conflicts as needing attention, as the header button's red dot does. The card's header also offers Open in browser, Copy change request link, and Remove from this Session, whose toast offers Undo. Cancelled checks have a separate count; a collapsed card names cancellations when no listed check failed. A collapsed card adds the checks of an open change request and the most urgent of requested changes, conflicts, or draft, or when a merged or closed one ended. An expanded card shows the head and base branches, then one row per fact: for an open change request the checks, whose row opens the list of checks with failed ones first and their durations and links, the review decision with unresolved threads, and the merge state, or when a merged or closed one ended; and the changed lines, formatted in the selected UI language, whose row opens the changes view. An open draft also offers Ready for review; a change request the host would merge now offers Merge, whose menu lists the methods the repository allows with the user's usual one chosen and pins the displayed head when opened. Confirm merge uses that head; a polled head change disables confirmation until the menu is reopened after review. A toast reports each outcome, and new commits since that head stop the merge. When exactly one bound change request is open, its card starts expanded. Refresh inspects the checkout, checks sign-in, and polls every change request again; its icon turns until the inspection and the sign-in check end. A banner shows the `gh auth login` command when sign-in is missing. - **Local changes card** — whenever the `branch` scope changes files, independently of bound change requests, a card above the change requests names the ref it compares with, such as `HEAD → origin/main`, which is always the default base below, and shows the added and deleted lines and the number of files, which open the changes view; its file list, which names files as the changes view does, opens the view at one file. Create change request, offered when the code host repository is recognized and no open change request (including drafts) has the checked-out branch as its head, sends the Session a user message in the UI language that asks the Agent to create a change request for these changes, and a toast reports whether it was sent. - **Changes view** — The Changes row of an expanded change request card and the local changes card open a right-sidebar tab that lists the changed files. The local tab is named Local changes and shows Branch by default: the working tree and untracked files against the fork point. Its header names the checked-out branch, or the abbreviated commit on a detached HEAD, and the base branch, which opens a searchable menu: first Default, the base commit of the worktree the Session created, else the merge base of HEAD with the default branch of the code host remote, then remote-tracking and then local branches, each most recently committed first, without the checked-out branch and, outside a created worktree, without the remote-tracking branch Default already names. Typing filters the listed rows at once and lists the branches whose names contain the text, ignoring case, after a short pause; Enter chooses the first row. Choosing another branch compares with the merge base of HEAD and that branch. The tab keeps the choice while other scopes show; closing the tab or reloading the application returns it to Default. When the chosen branch is gone, its name is struck through, and when it shares no history with HEAD, the view says so as well; both offer Use the default base branch instead of Retry. A narrow view hides the note that uncommitted changes count, then the checked-out branch. Uncommitted compares them with HEAD, Unstaged with the index, and Staged compares the index with HEAD. A change request view shows the host's diff at its head and says how many commits the checked-out branch has beyond that head when it is the change request's head branch. The toolbar jumps to a file, totals the changed lines, refreshes, and switches between two columns and one and between wrapped and cut long lines. Visited changes tabs stay mounted across tab and Session switches, hiding the sidebar, and docking changes, preserving file folds, revealed large files, expanded context, layout, and scroll position while the diff is unchanged. Hidden changes views release their panel subscription and defer diff reads; returning reads again only when the latest head or local summary differs. A refresh that replaces the diff discards expanded context, and changed content may move the reading position. Temporary menus close when the view is hidden. Closing the tab or reloading the application discards this progress. Files are named before their directories, which use smaller subdued type and shorten first; hovering one shows its complete path, and both paths for a renamed file. Each file shows badges for a new, deleted, or renamed file, the last naming the old file name, or the old path when only the directory changed, and, in the Branch scope, an untracked one, and a menu that copies its path and opens the whole file in the sidebar for local changes or its page at the head in the browser for a change request. Unchanged lines between hunks collapse into rows that expand from the file's new side: the working tree, the index for Staged, or the head commit through the code host; a file that changed after the diff was read stays collapsed until the view reads again. A binary file and an untracked file over `maxDiffBytes` show a note instead of their lines, a file whose hunks draw more than 1,000 lines starts as one collapsed strip that names its changed lines and draws them when opened, and a file below files that change more than 5,000 lines starts collapsed. The view reads again on Refresh and the page refresh shortcut, on each navigation, when the change request's head moves, and when the Branch scope's summary changes; a change request's view first waits for the status that names its head, unless no provider serves it or that poll failed. While a read replaces changes already shown, the Refresh icon turns. A change request whose diff the code host or its provider refuses over a size limit, such as a GitHub diff over 300 files, says its changes are too large to show here and offers View in browser; another failed read offers Retry and, for a change request, View in browser. A change request's diff is downloaded once per head commit and base branch while it stays cached, so reopening, refreshing, and navigating at the same head read nothing from the host. diff --git a/packages/experimental/client-ui-forge/README.zh.md b/packages/experimental/client-ui-forge/README.zh.md index 6bbf65496d..86cd4a415f 100644 --- a/packages/experimental/client-ui-forge/README.zh.md +++ b/packages/experimental/client-ui-forge/README.zh.md @@ -34,7 +34,7 @@ kind: "package-reference" - **工作树已被删除**——Session 所在的 worktree 在 Session 之外被删除后,输入框上方的卡片会说明这一点;此期间发送的消息会等待、不开始这一轮,直到该 worktree 被恢复或离开,卡片也会说明消息之后会接着发送。“恢复工作树”(标签页中的“恢复”与之相同)在原目录重新检出该分支;分支也已删除时,从它开始时的提交重新创建分支;恢复期间卡片显示“准备工作树”“检出文件”两个步骤,标签页中的“恢复”变为加载状态。“在项目目录继续”把 Session 移回源检出。此期间标签页顶部一行显示警示图标。 - **代码审查和变更**——右侧栏起始页中的入口,与会话标题栏按钮打开同一个变更请求标签页。 - **标题栏按钮**——Session 有已绑定的变更请求、或其目录位于 Git 检出中时出现,用来显示或隐藏标签页。打开状态的变更请求存在检查失败、被要求修改或冲突时,按钮带红点。 -- **会话列表**——Session 在面板为它创建的 worktree 中工作时,会话行的时间之后显示分支图标;另有一个图标显示它最需要关注的变更请求的状态,依次为需要处理、打开、草稿、尚未轮询、已合并、已关闭。打开中的变更请求图标保持会话行的浅色,并用圆点标出检查进行中、已通过或失败;已合并与已关闭的保留各自的状态颜色。会话行的悬浮卡片写出 worktree 分支及其起点,再列出最多三个变更请求的编号、标题、状态与检查,并说明还有多少个。重启后,下次轮询之前显示重启前已知的状态。 +- **会话列表**——Session 在面板为它创建的 worktree 中工作时,会话行的时间之后显示分支图标;另有一个图标显示它最需要关注的变更请求的状态,依次为需要处理、打开、草稿、尚未轮询、已合并、已关闭。打开中的变更请求图标保持会话行的浅色,head 分支端点填充为检查进行中、已通过或失败对应的颜色;已合并与已关闭的保留各自的状态颜色。会话行的悬浮卡片写出 worktree 分支及其起点,再列出最多三个变更请求的编号、标题、状态与检查,并说明还有多少个。重启后,下次轮询之前显示重启前已知的状态。 - **标签页**——顶部一行显示当前检出的分支(分离 HEAD 时为缩写提交),项目目录前显示目录图标、worktree 前显示分支图标,并说明检出的类型(Session 创建的 worktree 及其基准、其他 worktree 或项目目录);它的提示给出路径,宿主主目录缩写为 `~`,旁边的按钮复制完整路径;worktree 已被删除时提供“恢复”。其下每张变更请求卡片显示状态图标、标题(点击在浏览器中打开)与编号;图标区分打开、草稿、已合并与已关闭,打开中的变更请求(草稿除外)检查失败、被要求修改或有冲突时显示为“需要处理”,与标题栏按钮的红点一致。卡片右上角还提供“在浏览器中打开”“复制变更请求链接”与“从本会话移除”,移除后的 toast 提供“撤销”。已取消的检查单独计数;列出的检查没有失败项时,折叠卡片显示取消数量。折叠的卡片还显示打开的变更请求的检查,以及被要求修改、冲突、草稿中最需要注意的一项;已合并或已关闭的则显示结束时间。展开的卡片显示源分支与目标分支,下面每项一行:打开的变更请求依次是检查(点击该行弹出检查列表,失败的排在前面,带耗时与链接)、评审结论与未解决讨论数、合并状态,已合并或已关闭的显示结束时间;最后是按所选界面语言格式化的变更行数,点击该行打开变更视图。打开中的草稿还提供“标记为可评审”;主机现在就会合并的变更请求提供“合并”,其菜单列出仓库允许的合并方式并选中用户常用的一种,打开时固定卡片显示的 head。“确认合并”使用这个 head;轮询发现 head 变化后禁用确认,需重新检查并打开菜单。每次操作的结果都以 toast 报告;该 head 之后有新提交时不会合并。恰好有一个已绑定的变更请求处于打开状态时,它的卡片默认展开。刷新会重新检查检出与登录状态,并立即再次轮询每个变更请求;检查与登录状态确认结束前,刷新图标持续旋转。缺少登录时,横幅显示 `gh auth login` 命令。 - **本地变更卡片**——`branch` 范围有文件变更时始终显示,不受已关联变更请求影响。变更请求列表上方的卡片显示比较的基准(例如 `HEAD → origin/main`,始终是下文的默认基准)以及新增、删除行数与文件数,点击打开变更视图;展开的文件列表像变更视图一样标出各个文件,点击某个文件时,变更视图定位到该文件。识别出代码托管仓库、且没有以当前检出分支为源分支的打开中变更请求(含草稿)时,卡片提供“创建变更请求”:它以界面语言向 Session 发送一条用户消息,请 Agent 为这些变更创建变更请求,并以 toast 报告是否已发送。 - **变更视图**——展开的变更请求卡片上的“变更”一行与本地变更卡片会打开一个右侧边栏标签页,列出所有变更的文件。本地标签页名为“本地变更”,默认显示“分支”:工作树与未跟踪文件相对于分叉点的变更。它的标题栏写出当前检出的分支(分离 HEAD 时为缩写提交)与基准分支;点击基准分支打开可搜索的菜单:最前面是“默认”,即 Session 创建的 worktree 的基准提交,否则是 HEAD 与代码托管远端默认分支的合并基准;其后依次是远程跟踪分支与本地分支,各按最近提交排序,不含当前检出的分支,不在所创建的 worktree 中时也不含“默认”已经指向的远程跟踪分支。输入文字会立即筛选已列出的行,短暂停顿后列出名称包含该文字(不区分大小写)的分支;按 Enter 选择第一行。选择其他分支后,与 HEAD 和该分支的合并基准比较。标签页切换到其他范围时仍保留这个选择;关闭标签页或重新加载应用后回到“默认”。所选分支已不存在时,它的名称显示删除线;它与 HEAD 没有共同历史时,视图同样给出说明;两种情况都提供“使用默认基准分支”而不是“重试”。视图较窄时,先隐藏“包含未提交的修改”,再隐藏当前分支。“未提交”与 HEAD 比较,“未暂存”与暂存区比较,“已暂存”比较暂存区与 HEAD。变更请求的视图显示托管平台在其 head 处的 diff;当前检出分支就是该变更请求的源分支时,还会说明本地分支比该 head 多出几个提交。工具栏可以跳到某个文件、汇总变更行数、刷新,并在左右对比与单栏对比、自动换行与截断长行之间切换。访问过的变更标签页会在切换标签页与 Session、隐藏侧边栏及调整停靠位置时保持挂载,在 diff 未改变时保留文件折叠、大文件展开、上下文展开、布局与滚动位置。隐藏的变更视图释放面板订阅并推迟 diff 读取;返回时仅在最新 head 或本地摘要不同时重新读取。刷新替换 diff 后会丢弃展开的上下文,内容变化也可能移动阅读位置。视图隐藏时关闭临时菜单。关闭标签页或重新加载应用后不保留这些进度。文件名在前,目录在后,用更小的浅色字显示,空间不够时目录先缩短;悬停时显示完整路径,重命名的文件显示新旧两条路径。每个文件带有新文件、已删除、重命名的标记(重命名标记写出原文件名,只换了目录时写出原路径),“分支”范围下的未跟踪文件还标“未提交”;文件菜单可以复制路径,本地变更可在侧边栏打开整个文件,变更请求可在浏览器中查看该文件在 head 处的页面。hunk 之间未变更的行折叠成一行,点击后从文件的新版本展开:工作树、“已暂存”时为暂存区,或经托管平台读取的 head 提交;读取 diff 之后文件又有修改时不会展开,直到视图重新读取。二进制文件与超过 `maxDiffBytes` 的未跟踪文件只显示一条说明;hunk 超过 1,000 行的文件先显示为一条写出变更行数的折叠条,点击后才绘制;前面的文件累计变更超过 5,000 行后,其后的文件默认收起。刷新与页面刷新快捷键、每次导航、变更请求的 head 变化,以及“分支”范围的摘要变化时,视图都会重新读取;变更请求的视图会先等到给出 head 的状态再读取,除非没有提供方服务它或那次轮询失败。重新读取已显示的变更时,刷新图标会旋转。托管平台或其提供方因超过大小上限拒绝给出 diff 的变更请求(例如 GitHub 上超过 300 个文件的 diff)显示“变更太大,无法在这里显示”并提供“在浏览器中查看”;其他读取失败提供“重试”,变更请求还提供“在浏览器中查看”。变更请求的 diff 在缓存期间对每个 head 提交与目标分支只下载一次,因此在同一 head 下重新打开、刷新与导航都不会再从托管平台读取。 diff --git a/packages/experimental/client-ui-forge/src/client/ChangesTab.module.css b/packages/experimental/client-ui-forge/src/client/ChangesTab.module.css index 69e2dea94a..47193f0887 100644 --- a/packages/experimental/client-ui-forge/src/client/ChangesTab.module.css +++ b/packages/experimental/client-ui-forge/src/client/ChangesTab.module.css @@ -307,10 +307,11 @@ border-bottom: 0.5px solid var(--dsw-alias-border-l3); } +/* Above the comment plus (z-index 1) of rows scrolled beneath it. */ .fileHeader { position: sticky; top: 0; - z-index: 1; + z-index: 2; display: flex; align-items: center; gap: 6px; diff --git a/packages/experimental/client-ui-forge/src/client/DiffFile.tsx b/packages/experimental/client-ui-forge/src/client/DiffFile.tsx index ec50d151aa..eb7e21e6b0 100644 --- a/packages/experimental/client-ui-forge/src/client/DiffFile.tsx +++ b/packages/experimental/client-ui-forge/src/client/DiffFile.tsx @@ -208,13 +208,22 @@ function Lines({ file, text, open, onExpand, split, wrap, review, visible, comme const prepared = useMemo(() => segmentsOf(file, lines, open).map((segment): Prepared => segment.kind === 'gap' ? segment : { ...segment, old: sideSpans(segment.rows, 'old', highlighter), new: sideSpans(segment.rows, 'new', highlighter) }), [file, lines, open, highlighter]) - const choose = (side: 'L' | 'R', line: number, extend: boolean): void => { - if (review === undefined || editing) return + // Returns whether the range was accepted; a range across hunks or outside them keeps the previous selection. + const choose = (side: 'L' | 'R', line: number, extend: boolean): boolean => { + if (review === undefined || editing) return false const from = extend && origin.current?.side === side ? origin.current.line : line const comment = selectReviewLines(file, side, from, line) - if (comment === undefined) return + if (comment === undefined) return false if (!extend || origin.current?.side !== side) origin.current = { side, line } setSelection({ source: review.source, comment }) + return true + } + // A drag that began on a hover plus extends through every row with a line on its starting side, wherever the pointer crosses that row. + const extendAdd = (buttons: number, old: number | null, next: number | null): void => { + const from = origin.current + if (dragging.current !== 'add' || buttons !== 1 || from === null) return + const line = from.side === 'L' ? old : next + if (line !== null) choose(from.side, line, true) } const selected = (side: 'L' | 'R', line: number | null): boolean => line !== null && selection !== null && selection.comment.side === side && line >= selection.comment.startLine && line <= selection.comment.endLine @@ -227,10 +236,8 @@ function Lines({ file, text, open, onExpand, split, wrap, review, visible, comme return {line ?? ''} } const plus = !selecting && !editing && selection?.comment.side === side && selection.comment.endLine === line - return { - if ((dragging.current === 'gutter' || dragging.current === 'add') && origin.current?.side === side && event.buttons === 1) choose(side, line, true) - }}> + return { if (dragging.current === 'gutter' && origin.current?.side === side && event.buttons === 1) choose(side, line, true) }}> ) } else if (columns) { for (const [index, pair] of splitRows(segment.rows).entries()) { - rows.push(
+ rows.push(
{ extendAdd(event.buttons, pair.left?.no ?? null, pair.right?.no ?? null) }}> {cell(pair.left, segment.old, 'L')}{cell(pair.right, segment.new, 'R')}
) if (!inserted && endsAt(pair.left?.no ?? null, pair.right?.no ?? null)) { @@ -322,8 +331,11 @@ function Lines({ file, text, open, onExpand, split, wrap, review, visible, comme } } else { for (const [index, row] of segment.rows.entries()) { - rows.push(
- {singleSide !== 'R' && number('L', row.old, row.kind === 'del')}{singleSide !== 'L' && number('R', row.new, row.kind !== 'del')}{SIGN[row.kind]} + // Both numbers place their plus in the sign column, so a row showing the labeled plus offers no hover plus. + const labeled = !selecting && !editing && endsAt(row.old, row.new) + rows.push(
{ extendAdd(event.buttons, row.old, row.new) }}> + {singleSide !== 'R' && number('L', row.old, row.kind === 'del' && !labeled)}{singleSide !== 'L' && number('R', row.new, row.kind !== 'del' && !labeled)}{SIGN[row.kind]}
) if (!inserted && endsAt(row.old, row.new)) { diff --git a/packages/experimental/client-ui-forge/src/client/ReviewComposer.module.css b/packages/experimental/client-ui-forge/src/client/ReviewComposer.module.css index 9df0d316c3..5ce683c482 100644 --- a/packages/experimental/client-ui-forge/src/client/ReviewComposer.module.css +++ b/packages/experimental/client-ui-forge/src/client/ReviewComposer.module.css @@ -27,7 +27,10 @@ @media (pointer: coarse) { .input { font-size: 16px; } .line { min-height: 28px; } } /* The plus starts just inside the number's padding and covers the sign column, or the empty lane side-by-side cells keep instead, so the line number and the code stay clickable. */ -.add, .hoverAdd { position: absolute; inset-inline-start: calc(100% - 4px); top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: var(--dsw-radius-xs); background: var(--dsw-alias-button-primary-fill); color: var(--dsw-alias-label-primary-foreground); cursor: pointer; user-select: none; } +.add, .hoverAdd { position: absolute; z-index: 1; inset-inline-start: calc(100% - 4px); top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: var(--dsw-radius-xs); background: var(--dsw-alias-button-primary-fill); color: var(--dsw-alias-label-primary-foreground); font: inherit; cursor: pointer; user-select: none; } +/* Unified rows that show both numbers move the left plus past the right number too; it paints over that number's padding. The plus inherits the code font because the number width is measured in `ch`. */ +[data-review]:not([data-split]):not([data-single-side]) [data-review-side="L"] .add, +[data-review]:not([data-split]):not([data-single-side]) [data-review-side="L"] .hoverAdd { inset-inline-start: calc(100% + var(--forge-number-width, 3.5em) - 4px); } /* The mouse shortcut appears only for the hovered side of a row: a split cell or a unified line. */ .hoverAdd { display: none; } @media (hover: hover) { [data-diff-side]:hover .hoverAdd, [data-diff-line]:hover .hoverAdd { display: inline-flex; } } diff --git a/packages/experimental/client-ui-forge/src/client/glyphs.tsx b/packages/experimental/client-ui-forge/src/client/glyphs.tsx index abe32e6ec3..fb9fefca87 100644 --- a/packages/experimental/client-ui-forge/src/client/glyphs.tsx +++ b/packages/experimental/client-ui-forge/src/client/glyphs.tsx @@ -65,7 +65,7 @@ const SHAPES: Record = { ), } -/** Center of each shape's head branch end, which a checks mark replaces. */ +/** Center of each shape's head branch end, which a checks mark covers. */ const HEAD: Record = { open: [12, 12.5], unknown: [12, 12.5], diff --git a/packages/experimental/client-ui-forge/tests/diff-review.client.spec.tsx b/packages/experimental/client-ui-forge/tests/diff-review.client.spec.tsx index eb4c287f8e..ba321c48fc 100644 --- a/packages/experimental/client-ui-forge/tests/diff-review.client.spec.tsx +++ b/packages/experimental/client-ui-forge/tests/diff-review.client.spec.tsx @@ -147,10 +147,15 @@ it('opens the editor from a hover plus in one press, extending the range on its fireEvent.pointerDown(plus('R3'), { button: 2 }) expect(m.line('R3').getAttribute('aria-pressed')).toBe('false') fireEvent.pointerDown(plus('R3'), { button: 0 }) + // Crossing a row extends on the starting side, even over the other column. fireEvent.pointerOver(m.line('L4'), { buttons: 1 }) expect(m.line('L4').getAttribute('aria-pressed')).toBe('false') - fireEvent.pointerOver(plus('R4'), { buttons: 1 }) expect(m.line('R4').getAttribute('aria-pressed')).toBe('true') + fireEvent.pointerOver(plus('R4'), { buttons: 0 }) + fireEvent.pointerOver(plus('R5'), { buttons: 1 }) + expect(m.line('R5').getAttribute('aria-pressed')).toBe('true') + fireEvent.pointerOver(plus('R4'), { buttons: 1 }) + expect(m.line('R5').getAttribute('aria-pressed')).toBe('false') fireEvent.pointerUp(window) expect(m.getByRole('region', { name: 'Comment on R3–4' })).toBeTruthy() expect(m.container.querySelector('[data-review-add]')).toBeNull() @@ -164,6 +169,40 @@ it('opens the editor from a hover plus in one press, extending the range on its expect(m.getByRole('region', { name: 'Comment on L2' })).toBeTruthy() }) +it('extends a unified hover-plus drag through rows with a line on its side and keeps one plus per row', () => { + // Old 1–4: keep 1, drop 2, keep 3, keep 4; new 1–4: keep 1, keep 3, added, keep 4. + const mixed: ForgeDiffFile = { ...file, additions: 1, deletions: 1, + hunks: [{ oldStart: 1, oldLines: 4, newStart: 1, newLines: 4, lines: [' keep 1', '-drop 2', ' keep 3', '+added', ' keep 4'] }] } + const m = mount({ split: false, file: mixed }) + fireEvent.pointerDown(m.container.querySelector('[data-review-add="L2"]')!, { button: 0 }) + // Over the context row the pointer meets its new number, yet the drag extends on the old side. + fireEvent.pointerOver(m.line('R2'), { buttons: 1 }) + expect(m.line('L3').getAttribute('aria-pressed')).toBe('true') + // The added row has no old line, so the range stays. + fireEvent.pointerOver(m.line('R3'), { buttons: 1 }) + expect(m.line('L3').getAttribute('aria-pressed')).toBe('true') + fireEvent.pointerOver(m.line('R4'), { buttons: 1 }) + fireEvent.pointerUp(window) + expect(m.getByRole('region', { name: 'Comment on L2–4' })).toBeTruthy() + fireEvent.click(m.getByRole('button', { name: 'Cancel' })) + // A gutter drag still extends only over numbers of its own side. + fireEvent.pointerDown(m.line('L1'), { button: 0 }) + fireEvent.pointerOver(m.line('R2'), { buttons: 1 }) + expect(m.line('L3').getAttribute('aria-pressed')).toBe('false') + fireEvent.pointerUp(window) + // The row that shows the labeled plus offers no second hover plus at the same place. + fireEvent.click(m.line('L3')) + expect(m.getByRole('button', { name: 'Add comment' })).toBeTruthy() + expect(m.container.querySelector('[data-review-add="R2"]')).toBeNull() + expect(m.container.querySelector('[data-review-add="R4"]')).not.toBeNull() + // Side by side, the deleted line's row has no new line, so a drag on the new side passes over it. + m.rerender() + fireEvent.pointerDown(m.container.querySelector('[data-review-add="R1"]')!, { button: 0 }) + fireEvent.pointerOver(m.line('L2'), { buttons: 1 }) + fireEvent.pointerUp(window) + expect(m.getByRole('region', { name: 'Comment on R1' })).toBeTruthy() +}) + it('offers one hover plus per unified row, on the side its line belongs to', () => { const m = mount({ split: false }) expect(Array.from(m.container.querySelectorAll('[data-review-add]'), element => element.getAttribute('data-review-add'))) @@ -173,7 +212,7 @@ it('offers one hover plus per unified row, on the side its line belongs to', () expect(m.getByRole('region', { name: 'Comment on L3' })).toBeTruthy() }) -it('refuses native and gutter ranges spanning collapsed context between hunks', () => { +it('refuses native, gutter, and hover-plus ranges spanning collapsed context between hunks', () => { const m = mount({ file: { ...file, hunks: [...file.hunks, { oldStart: 10, oldLines: 1, newStart: 10, newLines: 1, lines: ['-before', '+after'] }] } }) m.select('R', 4, 10) @@ -182,6 +221,12 @@ it('refuses native and gutter ranges spanning collapsed context between hunks', fireEvent.click(m.line('R10'), { shiftKey: true }) expect(m.line('R4').getAttribute('aria-pressed')).toBe('true') expect(m.line('R10').getAttribute('aria-pressed')).toBe('false') + // A refused press keeps the previous selection, and its release opens no editor for it. + fireEvent.pointerDown(m.container.querySelector('[data-review-add="R10"]')!, { button: 0, shiftKey: true }) + fireEvent.pointerUp(window) + expect(m.queryByRole('textbox')).toBeNull() + expect(m.line('R4').getAttribute('aria-pressed')).toBe('true') + expect(m.line('R10').getAttribute('aria-pressed')).toBe('false') }) it('places left and right records in unified rows and retains outdated records for hidden hunks', () => { From a5e54e99d354758a90b6f1668e19984263d3bba1 Mon Sep 17 00:00:00 2001 From: winewill Date: Thu, 5 Nov 2026 16:46:06 +0800 Subject: [PATCH 249/322] fix(desktop): stabilize update progress and explain active downloads --- apps/desktop/README.i18n.yaml | 4 +- apps/desktop/README.md | 2 + apps/desktop/README.zh.md | 2 + apps/desktop/src/locale.ts | 8 +++ apps/desktop/src/main.ts | 11 ++++ apps/desktop/tests/main-startup.spec.ts | 50 +++++++++++++++++++ .../ui-settings-general/README.i18n.yaml | 4 +- packages/client/ui-settings-general/README.md | 2 +- .../client/ui-settings-general/README.zh.md | 2 +- .../client/DesktopUpdateIndicator.module.css | 6 +++ .../src/client/DesktopUpdateIndicator.tsx | 2 +- 11 files changed, 86 insertions(+), 7 deletions(-) diff --git a/apps/desktop/README.i18n.yaml b/apps/desktop/README.i18n.yaml index dc6cb5f9e0..0d74c521bd 100644 --- a/apps/desktop/README.i18n.yaml +++ b/apps/desktop/README.i18n.yaml @@ -15,8 +15,8 @@ en: 127ea90553cb6af7 zh: 7b1c5aec8558c684 /deepseek-harness-desktop/application-overview: - en: d4afa46403997884 - zh: 9b9fe126afda70f0 + en: 2eb4f59268d09949 + zh: 68bb4f758bd35f63 /deepseek-harness-desktop/terminal-command: en: 5f2d25a1d8472647 zh: 2acb5c5d7d1917e2 diff --git a/apps/desktop/README.md b/apps/desktop/README.md index 68596d719f..c2e2b14f02 100644 --- a/apps/desktop/README.md +++ b/apps/desktop/README.md @@ -31,6 +31,8 @@ Desktop runs the Harness workspace in a native application. This reference cover ## Application overview +Selecting **Check for Updates…** during a download or verification shows the current operation and explains that installation is available after the download finishes. Closing this informational dialog leaves the download running; repeated clicks focus the open dialog. + Electron caches the last confirmed UI language in `userData/desktop/locale-cache` so startup recovery dialogs can use it before Host settings are available. Missing, invalid, or unreadable caches fall back to the system language; cache write failures do not block startup. A successful Host startup or a UI language change refreshes the cache. Until then, a changed system language may differ from the cached language. Desktop analytics follows the [product collection policy](../../packages/client/product-analytics/README.md), including its live application setting. Web usage is excluded. Update installation waits for its local analytics intake before locking API admission and stopping the Host. Intake has a one-second deadline; failure does not prevent installation, and collector delivery is not awaited. diff --git a/apps/desktop/README.zh.md b/apps/desktop/README.zh.md index 13661f0590..3050448898 100644 --- a/apps/desktop/README.zh.md +++ b/apps/desktop/README.zh.md @@ -39,6 +39,8 @@ Electron 在 `userData/desktop/locale-cache` 缓存最近确认的界面语言 Desktop 绑定 `127.0.0.1`,即 Electron 为就绪 URL 与 WebSocket 凭据过滤器拨号的地址。WebSocket 流按 Host 监听器使用 `ws:` 或 `wss:`;附加凭据要求 authority 与 scheme 均匹配。 +下载或校验期间选择“检查更新…”会显示当前操作,并说明下载完成后可安装更新。关闭此提示不会停止下载;重复点击会聚焦已打开的弹窗。 + 应用菜单第一项“**关于 DeepSeek Harness**”打开 Electron 原生关于面板,展示应用图标、产品名称和当前安装的发布版本。菜单文案跟随桌面壳的语言。macOS 的隐藏、隐藏其他、显示全部和退出条目使用本地化文案,隐藏和退出条目包含 DeepSeek Harness 产品名称。这些条目保留原生动作和快捷键。macOS 从应用包读取图标,因此未打包的开发启动会显示 Electron 图标;Windows 使用随包分发的 PNG。 Desktop 的本地原生目录流程打开绑定应用窗口的 Electron 文件夹对话框,并先恢复、显示和聚焦该窗口。并发请求共用一个对话框;取消不返回路径,失败后可以重试。普通 Web 使用 Host 选择器。浏览模式列出 Host 目录。Linux 缺少 zenity 或 kdialog 时,自动选择使用浏览模式,不使用 Electron 对话框。 diff --git a/apps/desktop/src/locale.ts b/apps/desktop/src/locale.ts index 050548e879..d06eb79ada 100644 --- a/apps/desktop/src/locale.ts +++ b/apps/desktop/src/locale.ts @@ -138,6 +138,7 @@ export const en = { updateClose: 'Close', updateAcknowledge: 'OK', updateLater: 'Update later', + updateDownloadInProgress: 'Downloading update', updateDownloading: 'Downloading {percent}%…', updateVerifying: 'Verifying update files…', updateInstalling: 'Preparing to restart…', @@ -331,6 +332,7 @@ export const zh = { updateClose: '关闭', updateAcknowledge: '确定', updateLater: '稍后更新', + updateDownloadInProgress: '正在下载更新', updateDownloading: '正在下载 {percent}%…', updateVerifying: '正在校验更新文件…', updateInstalling: '正在准备重启…', @@ -522,6 +524,7 @@ export const ja = { updateClose: '閉じる', updateAcknowledge: 'OK', updateLater: '後でアップデート', + updateDownloadInProgress: 'アップデートをダウンロード中', updateDownloading: 'ダウンロード中 {percent}%…', updateVerifying: 'アップデートファイルを検証中…', updateInstalling: '再起動の準備中…', @@ -713,6 +716,7 @@ export const es = { updateClose: 'Cerrar', updateAcknowledge: 'OK', updateLater: 'Actualizar más tarde', + updateDownloadInProgress: 'Descargando actualización', updateDownloading: 'Descargando {percent}%…', updateVerifying: 'Verificando archivos de actualización...', updateInstalling: 'Preparándose para reiniciar…', @@ -904,6 +908,7 @@ export const fr = { updateClose: 'Fermer', updateAcknowledge: 'OK', updateLater: 'Mettre à jour plus tard', + updateDownloadInProgress: 'Téléchargement de la mise à jour', updateDownloading: 'Téléchargement de {percent}%…', updateVerifying: 'Vérification des fichiers de mise à jour…', updateInstalling: 'Préparation du redémarrage…', @@ -1095,6 +1100,7 @@ export const de = { updateClose: 'Schließen', updateAcknowledge: 'OK', updateLater: 'Später aktualisieren', + updateDownloadInProgress: 'Update wird heruntergeladen', updateDownloading: '{percent}% wird heruntergeladen…', updateVerifying: 'Aktualisierungsdateien werden überprüft…', updateInstalling: 'Neustart wird vorbereitet…', @@ -1286,6 +1292,7 @@ export const ru = { updateClose: 'Закрыть', updateAcknowledge: 'OK', updateLater: 'Обновить позже', + updateDownloadInProgress: 'Загрузка обновления', updateDownloading: 'Загрузка {percent}%…', updateVerifying: 'Проверка файлов обновлений…', updateInstalling: 'Подготовка к перезапуску…', @@ -1477,6 +1484,7 @@ export const pt = { updateClose: 'Fechar', updateAcknowledge: 'OK', updateLater: 'Atualizar mais tarde', + updateDownloadInProgress: 'Baixando atualização', updateDownloading: 'Baixando {percent}%…', updateVerifying: 'Verificando arquivos de atualização…', updateInstalling: 'Preparando para reiniciar…', diff --git a/apps/desktop/src/main.ts b/apps/desktop/src/main.ts index dd3141228b..36858b3166 100644 --- a/apps/desktop/src/main.ts +++ b/apps/desktop/src/main.ts @@ -1000,6 +1000,17 @@ async function main(): Promise { if (authenticationOperation !== undefined) { policyAuth?.focus(); updateDialog.focus() } + if (manual && !isMandatory() && (updates.state.phase === 'downloading' || updates.state.phase === 'verifying')) { + if (updateDialog.isOpen) { + updateDialog.focus() + return Promise.resolve() + } + return ordinaryMessageBox({ type: 'info', title: locale.messages.updateCheckTitle, + message: updates.state.phase === 'downloading' ? locale.messages.updateDownloadInProgress : locale.messages.updateVerifying, + detail: locale.messages.updateDetail, buttons: [locale.messages.updateClose], cancelId: 0, + }).then(() => {}).catch((error: unknown) => showUpdateFailure({ phase: 'error', failedOperation: 'check', + message: desktopErrorState(error).message })) + } let failedOperation: 'check' | 'download' | 'install' = 'check' promptOperation ??= Promise.resolve().then(async () => { if (manual) updateJournal?.action('check-requested') diff --git a/apps/desktop/tests/main-startup.spec.ts b/apps/desktop/tests/main-startup.spec.ts index 69ec6c9af9..35dc745102 100644 --- a/apps/desktop/tests/main-startup.spec.ts +++ b/apps/desktop/tests/main-startup.spec.ts @@ -2189,6 +2189,18 @@ describe('desktop main startup', () => { await started.promise const repeated = invoke(DESKTOP_IPC.updatesOpen, 'app') expect(harness.dialog.showMessageBox).not.toHaveBeenCalled() + const checks = harness.updateCheck.mock.calls.length + const check = applicationMenuItems().find(item => item.label === en.checkUpdatesMenu)!.click as () => void + check() + await vi.waitFor(() => { expect(harness.dialog.showMessageBox).toHaveBeenCalledWith(expect.objectContaining({ + message: en.updateDownloadInProgress, detail: en.updateDetail, buttons: [en.updateClose], + })) }) + expect(harness.updateCheck).toHaveBeenCalledTimes(checks) + harness.shellDialog.isOpen = true + check() + expect(harness.shellDialog.focus).toHaveBeenCalled() + expect(harness.dialog.showMessageBox).toHaveBeenCalledOnce() + harness.shellDialog.isOpen = false expect(harness.updateDownload).toHaveBeenCalledExactlyOnceWith('1.0.1-nightly.1', 0) expect(harness.updateInstall).not.toHaveBeenCalled() downloading.resolve({ phase: 'ready', version: '1.0.1-nightly.1' }) @@ -2198,6 +2210,44 @@ describe('desktop main startup', () => { expect(harness.updateInstall).toHaveBeenCalledOnce() }) + it.each(['downloading', 'verifying'] as const)('explains %s when checking from the menu without another update operation', async (phase) => { + await readyForUpdate() + harness.updateState = { phase, version: '1.0.1-nightly.1', percent: 21 } + const checks = harness.updateCheck.mock.calls.length + const check = applicationMenuItems().find(item => item.label === en.checkUpdatesMenu)!.click as () => void + check() + await vi.waitFor(() => { expect(harness.dialog.showMessageBox).toHaveBeenCalledWith(expect.objectContaining({ + message: phase === 'downloading' ? en.updateDownloadInProgress : en.updateVerifying, + detail: en.updateDetail, buttons: [en.updateClose], cancelId: 0, + })) }) + expect(harness.updateCheck).toHaveBeenCalledTimes(checks) + expect(harness.updateDownload).not.toHaveBeenCalled() + expect(harness.updateInstall).not.toHaveBeenCalled() + expect(harness.updateState.phase).toBe(phase) + check() + await vi.waitFor(() => { expect(harness.dialog.showMessageBox).toHaveBeenCalledTimes(2) }) + expect(harness.updateCheck).toHaveBeenCalledTimes(checks) + expect(harness.updateDownload).not.toHaveBeenCalled() + expect(harness.updateInstall).not.toHaveBeenCalled() + expect(harness.updateState.phase).toBe(phase) + }) + + it('reports a failed download-status dialog without restarting the update', async () => { + await readyForUpdate() + harness.updateState = { phase: 'downloading', version: '1.0.1-nightly.1', percent: 21 } + const checks = harness.updateCheck.mock.calls.length + harness.dialog.showMessageBox.mockRejectedValueOnce(new Error('overlay unavailable')) + const check = applicationMenuItems().find(item => item.label === en.checkUpdatesMenu)!.click as () => void + check() + await vi.waitFor(() => { expect(harness.dialog.showMessageBox).toHaveBeenLastCalledWith(expect.objectContaining({ + type: 'error', title: en.updateFailedTitle, technicalDetails: 'overlay unavailable', + })) }) + expect(harness.updateCheck).toHaveBeenCalledTimes(checks) + expect(harness.updateDownload).not.toHaveBeenCalled() + expect(harness.updateInstall).not.toHaveBeenCalled() + expect(harness.updateState.phase).toBe('downloading') + }) + it('does not lock or stop tasks when restart confirmation is dismissed', async () => { const host = await readyForUpdate() harness.dialog.showMessageBox.mockResolvedValueOnce({ response: 1 }) diff --git a/packages/client/ui-settings-general/README.i18n.yaml b/packages/client/ui-settings-general/README.i18n.yaml index 216983e29e..dbd632c372 100644 --- a/packages/client/ui-settings-general/README.i18n.yaml +++ b/packages/client/ui-settings-general/README.i18n.yaml @@ -15,8 +15,8 @@ en: 83760d53b3ee5fb8 zh: 30dd8802d4ffdcb7 /deepseek-ai-dsh-client-ui-settings-general/use-this-package: - en: d427d20b4dab6653 - zh: 84e80592f0a30a9f + en: 11d1e170042c3de0 + zh: 0e157a95b0ca8068 /deepseek-ai-dsh-client-ui-settings-general/use-this-package/the-general-section: en: de35e867b2a56d73 zh: 6d4e5c912636f889 diff --git a/packages/client/ui-settings-general/README.md b/packages/client/ui-settings-general/README.md index bca8bb88ee..357e22f8ff 100644 --- a/packages/client/ui-settings-general/README.md +++ b/packages/client/ui-settings-general/README.md @@ -39,7 +39,7 @@ When the page reconnects to a Host running another release, a **Service version When the section navigation exceeds the panel's available height, the list scrolls independently of the settings content and keeps the Settings title fixed; in browsers below 768px the strip scrolls along its own axis the same way. -In Desktop, the account-row update control shows availability, progress, verification, readiness, and persistent retry feedback. It shares the connection indicator’s 28px height, 8px corners, 14px icon slot, 4px icon gap, and 12px medium text with an 18px line height; update-state border, fill, and text colors remain independently defined. Retry text and its dot use the same brand blue as other update labels; numeric download progress has no ellipsis. The preload carries semantic phase, version, progress, and classified failures; the component resolves every visible and accessible string from the active `settings` locale, including after an in-application language change. Selecting an available update starts downloading; installation requires a separate shell-owned confirmation. A collapsed sidebar shows the same status as a brand-blue dot on its top expand button, including failures. Connection feedback takes priority except during shell-reported installation, when the expected backend disconnect must not hide update status. Failure restores connection feedback. Both controls share one carrier subscription; browser code cannot choose packages or authorize installation. [Desktop updates](../../../apps/desktop/README.md) owns the release workflow. Checking, verifying, and preparing-to-restart tooltips show only the supplied version; without a version, they retain the state label. Desktop update tooltips preserve the complete version and prerelease suffix without adding v or V; their error summaries match the shell update dialogs, including guidance to exit fullscreen and retry after a fullscreen-transition timeout. +In Desktop, the account-row update control shows availability, progress, verification, readiness, and persistent retry feedback. It shares the connection indicator’s 28px height, 8px corners, 14px icon slot, 4px icon gap, and 12px medium text with an 18px line height; update-state border, fill, and text colors remain independently defined. Retry text and its dot use the same brand blue as other update labels; numeric download progress has no ellipsis and uses tabular digits with space for three digits and the percent sign to keep its width stable. The preload carries semantic phase, version, progress, and classified failures; the component resolves every visible and accessible string from the active `settings` locale, including after an in-application language change. Selecting an available update starts downloading; installation requires a separate shell-owned confirmation. A collapsed sidebar shows the same status as a brand-blue dot on its top expand button, including failures. Connection feedback takes priority except during shell-reported installation, when the expected backend disconnect must not hide update status. Failure restores connection feedback. Both controls share one carrier subscription; browser code cannot choose packages or authorize installation. [Desktop updates](../../../apps/desktop/README.md) owns the release workflow. Checking, verifying, and preparing-to-restart tooltips show only the supplied version; without a version, they retain the state label. Desktop update tooltips preserve the complete version and prerelease suffix without adding v or V; their error summaries match the shell update dialogs, including guidance to exit fullscreen and retry after a fullscreen-transition timeout. Settings visibility and section selection live in the shell owner store. The shell supplies the effective Settings binding to the contributed launcher for menu keycaps and `aria-keyshortcuts`; the fallback button uses the same binding for hover and keyboard-focus hints and `aria-keyshortcuts`. The Settings command (Desktop: `Mod+,`; Windows/macOS Web: `Mod+Alt+,`) toggles the dialog when Settings is in front or no modal is open; the sidebar control opens the same dialog. The command cannot open or close Settings while the shortcut reference or another modal is in front. Held-key repeats do nothing. The account menu opens General settings; closing the dialog clears the section selection. Onboarding can open a specified section. Initial focus lands on the selected section in the navigation, or on the title when no sections are available, without drawing a focus outline. The section buttons precede header actions and Close in the Tab order. Tab and directional navigation retain their visible focus indicators. `Mod+/` can open the shortcut reference above Settings; `Escape` closes the top dialog and restores focus to its invoking control. Return focus omits outlines after shortcut, Escape, or pointer dismissal. diff --git a/packages/client/ui-settings-general/README.zh.md b/packages/client/ui-settings-general/README.zh.md index e014b6f91f..9ddeb13ce2 100644 --- a/packages/client/ui-settings-general/README.zh.md +++ b/packages/client/ui-settings-general/README.zh.md @@ -39,7 +39,7 @@ kind: "package-reference" 当分区导航超出面板可用高度时,列表独立于设置内容滚动,并保持「设置」标题固定;浏览器宽度低于 768px 时,条带以同样方式沿自身轴滚动。 -在 Desktop 中,账户行更新控件显示可用版本、进度、验证、就绪和持久重试反馈。它与连接指示器共用 28px 高度、8px 圆角、14px 图标占位、4px 图文间距,以及 12px 中等字重文字和 18px 行高;更新状态的边框、填充和文字颜色独立定义。重试文字及其圆点与其他更新文案使用相同的品牌蓝色;数字下载进度不带省略号。预加载仅传递语义化阶段、版本、进度和失败类别;组件从当前 `settings` locale 解析全部可见与无障碍文案,并在应用内语言变化后同步更新。选择可用更新即开始下载;安装需要独立的壳拥有的确认。侧栏收起时,其顶部展开按钮以品牌蓝色圆点显示相同状态,包括失败状态。连接反馈通常优先展示,但壳报告正在安装时,预期的后端断开不能遮盖更新状态;失败后恢复连接反馈。两个控件共用一次载体订阅;浏览器代码不能选择安装包或授权安装。[Desktop 更新](../../../apps/desktop/README.zh.md)负责发布流程。检查中、校验中和准备重启状态的悬浮提示只显示已提供的版本号;没有版本号时保留状态文案。桌面更新提示完整保留版本号及预发布后缀,不额外添加 v 或 V;错误提示与桌面升级弹窗保持一致,包括全屏切换超时后退出全屏并重试的指引。 +在 Desktop 中,账户行更新控件显示可用版本、进度、验证、就绪和持久重试反馈。它与连接指示器共用 28px 高度、8px 圆角、14px 图标占位、4px 图文间距,以及 12px 中等字重文字和 18px 行高;更新状态的边框、填充和文字颜色独立定义。重试文字及其圆点与其他更新文案使用相同的品牌蓝色;数字下载进度不带省略号,采用等宽数字并预留三位数字及百分号的空间,使宽度保持稳定。预加载仅传递语义化阶段、版本、进度和失败类别;组件从当前 `settings` locale 解析全部可见与无障碍文案,并在应用内语言变化后同步更新。选择可用更新即开始下载;安装需要独立的壳拥有的确认。侧栏收起时,其顶部展开按钮以品牌蓝色圆点显示相同状态,包括失败状态。连接反馈通常优先展示,但壳报告正在安装时,预期的后端断开不能遮盖更新状态;失败后恢复连接反馈。两个控件共用一次载体订阅;浏览器代码不能选择安装包或授权安装。[Desktop 更新](../../../apps/desktop/README.zh.md)负责发布流程。检查中、校验中和准备重启状态的悬浮提示只显示已提供的版本号;没有版本号时保留状态文案。桌面更新提示完整保留版本号及预发布后缀,不额外添加 v 或 V;错误提示与桌面升级弹窗保持一致,包括全屏切换超时后退出全屏并重试的指引。 设置的可见状态和分区选择由 shell owner store 保存。外壳将设置命令的有效绑定传给入口贡献,用于菜单键帽和 `aria-keyshortcuts`;回退按钮使用相同绑定提供悬停、键盘聚焦提示和 `aria-keyshortcuts`。设置位于最前方或没有模态弹窗时,设置命令(Desktop 为 `Mod+,`,Windows/macOS Web 为 `Mod+Alt+,`)切换设置弹窗的开关;侧栏控件打开同一弹窗。快捷键速查或其他模态弹窗位于前方时,该命令不能打开或关闭设置。长按产生的重复按键不执行操作。账号菜单打开通用设置;关闭弹窗会清空分区选择。引导流程可以打开指定分区。初始焦点落在导航中选中的分区;没有可用分区时落在标题上,均不绘制焦点外轮廓线。Tab 顺序中,分区按钮先于头部操作和关闭按钮。Tab 和方向键导航保留可见焦点提示。`Mod+/` 可在设置上方打开快捷键速查;`Escape` 关闭最上层弹窗,焦点返回触发该弹窗的控件。通过快捷键、Esc 或鼠标关闭后的回焦均不绘制外轮廓线。 diff --git a/packages/client/ui-settings-general/src/client/DesktopUpdateIndicator.module.css b/packages/client/ui-settings-general/src/client/DesktopUpdateIndicator.module.css index b5b0eea658..2a503fb967 100644 --- a/packages/client/ui-settings-general/src/client/DesktopUpdateIndicator.module.css +++ b/packages/client/ui-settings-general/src/client/DesktopUpdateIndicator.module.css @@ -20,6 +20,12 @@ cursor: pointer; } +.progress { + min-inline-size: calc(3ch + 1em); + font-variant-numeric: tabular-nums; + text-align: end; +} + .icon { display: grid; place-items: center; diff --git a/packages/client/ui-settings-general/src/client/DesktopUpdateIndicator.tsx b/packages/client/ui-settings-general/src/client/DesktopUpdateIndicator.tsx index ae22d5c6fb..01376efb34 100644 --- a/packages/client/ui-settings-general/src/client/DesktopUpdateIndicator.tsx +++ b/packages/client/ui-settings-general/src/client/DesktopUpdateIndicator.tsx @@ -80,7 +80,7 @@ export function DesktopUpdateIndicator({ wide, hidden, t, view, onOpen }: { {error ? : busy ? : } - {label} + {label} } From 61a6d46fbe4a2a92e6a229836763c7b3ec74ca71 Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Thu, 5 Nov 2026 16:50:14 +0800 Subject: [PATCH 250/322] docs(cua): document scoped APIs and platform guidance --- ...05-cua-scoped-surfaces-and-input.i18n.yaml | 19 +++ ...026-11-05-cua-scoped-surfaces-and-input.md | 39 ++++++ ...-11-05-cua-scoped-surfaces-and-input.zh.md | 39 ++++++ .../experimental/cua-macos/README.i18n.yaml | 20 +-- packages/experimental/cua-macos/README.md | 117 ++++++++-------- packages/experimental/cua-macos/README.zh.md | 117 ++++++++-------- .../cua-macos/native/README.i18n.yaml | 16 +-- .../experimental/cua-macos/native/README.md | 32 ++--- .../cua-macos/native/README.zh.md | 32 ++--- .../experimental/cua-macos/src/guidance.ts | 14 +- .../cua-macos/tests/guidance.spec.ts | 127 ++++++++++++++++++ packages/experimental/cua/README.i18n.yaml | 24 ++-- packages/experimental/cua/README.md | 29 ++-- packages/experimental/cua/README.zh.md | 29 ++-- packages/experimental/cua/src/guidance.ts | 72 +++++----- 15 files changed, 489 insertions(+), 237 deletions(-) create mode 100644 .agents/notes/implemented/architecture/2026-11-05-cua-scoped-surfaces-and-input.i18n.yaml create mode 100644 .agents/notes/implemented/architecture/2026-11-05-cua-scoped-surfaces-and-input.md create mode 100644 .agents/notes/implemented/architecture/2026-11-05-cua-scoped-surfaces-and-input.zh.md create mode 100644 packages/experimental/cua-macos/tests/guidance.spec.ts diff --git a/.agents/notes/implemented/architecture/2026-11-05-cua-scoped-surfaces-and-input.i18n.yaml b/.agents/notes/implemented/architecture/2026-11-05-cua-scoped-surfaces-and-input.i18n.yaml new file mode 100644 index 0000000000..f3a0d8f1d3 --- /dev/null +++ b/.agents/notes/implemented/architecture/2026-11-05-cua-scoped-surfaces-and-input.i18n.yaml @@ -0,0 +1,19 @@ +# Bilingual-pair consistency record for 2026-11-05-cua-scoped-surfaces-and-input.md (docs/i18n/README.md): per heading +# section, a hash of its English and Chinese blocks outside code blocks and generated regions. +# After editing either side, bring the other along and re-record with: +# pnpm run verify-translation-pairing --write .agents/notes/implemented/architecture/2026-11-05-cua-scoped-surfaces-and-input.md +/agent-note-cua-scoped-surfaces-and-separated-input-capabilities: + en: a0a2e9d0651e212f + zh: b7a2ab4092c2595b +/agent-note-cua-scoped-surfaces-and-separated-input-capabilities/problem: + en: f72db0b79aa02fb5 + zh: b91c1f177dc93ab4 +/agent-note-cua-scoped-surfaces-and-separated-input-capabilities/decision: + en: ec115e11f96ffe60 + zh: c1fe9eb2866196d0 +/agent-note-cua-scoped-surfaces-and-separated-input-capabilities/alternatives-considered: + en: 32c970ae153e0f6c + zh: 8431be0a10ffed15 +/agent-note-cua-scoped-surfaces-and-separated-input-capabilities/consequences: + en: 5c6ec60b77f1bff0 + zh: e1ae568ef3501b7b diff --git a/.agents/notes/implemented/architecture/2026-11-05-cua-scoped-surfaces-and-input.md b/.agents/notes/implemented/architecture/2026-11-05-cua-scoped-surfaces-and-input.md new file mode 100644 index 0000000000..609e5bf901 --- /dev/null +++ b/.agents/notes/implemented/architecture/2026-11-05-cua-scoped-surfaces-and-input.md @@ -0,0 +1,39 @@ +# Agent Note: CUA scoped surfaces and separated input capabilities + +Status: implemented + +English | [中文](2026-11-05-cua-scoped-surfaces-and-input.zh.md) + +## Problem + +Application and window objects share accessibility operations, but only an explicit window can capture or deliver pointer input. Duplicating shared methods on both factories creates two implementations to keep aligned. Moving application-only capability checks into the shared base makes window behavior depend on an application-level decision. Keyboard input has the same problem at a smaller scale: a chord string combines a key and its modifiers, and a complete-keystroke method cannot express a modifier held across calls or a standalone key-up. + +## Decision + +`CuaSurface` declares operations shared by application and window objects; `CuaApp` and `CuaWindow` extend it with their own operations. One base factory builds the surface, and the derived factories inject scope parameters plus `requireAccessibility` and `requireKeyboard` checks. The shared base never branches on a capability that exists only for applications. + +Provider startup capabilities are static. Platform, supported methods, application-level accessibility, keyboard scopes, browser support, and coordinate space are fixed when the provider is installed. The native `getCapabilities` RPC reports runtime permissions and session lock only; `installCua` merges the two layers for the model-visible result. The neutral RPC is a common operation representation, not a capability inventory; provider guidance names the actions its platform supports. + +Keyboard input keeps keys and modifiers separate: `pressKey(key, modifiers?)` presses and releases one key while holding the listed modifiers, and its keyboard modifier list is a plain string array defined by the provider. `sendKeyEvent(key, direction)` sends exactly one key-down or key-up without an implicit counterpart. A caller can therefore hold a modifier or split a gesture; neither method packs a chord string, and the shared schema does not enumerate platform key names. + +Within one API instance, the object facade keeps one current accessibility snapshot per application handle, shared by every application and window object for that handle, including repeated selections of the same application. `getWindow` reads its initial tree silently; `getApp` does the same when the provider reports application-level accessibility. A later `getAccessibilityTree` read invalidates the previous snapshot before dispatch. The facade automatically attaches the latest snapshot ID to element operations; callers use element IDs from the latest tree and do not assume an older ID still identifies the same control. Element IDs are opaque provider strings. Only an explicit `CuaWindow` captures screenshots or sends pointer input. The native helper retains its own application and optional-window snapshots behind that facade; the native layer and the facade snapshot remain separate. The external runtime continues to own variable persistence and completion serialization; the facade adds no evaluator. The [native object decision](2026-09-17-experimental-cua-object-api.md) owns evaluator independence, and the [shared helper decision](2026-10-09-cua-shared-native-helper.md) owns connection lifetime. + +## Alternatives considered + +**Duplicate application and window methods** would give each factory its own implementation of the same accessibility operations. Every shared change would then need matching edits, and the two surfaces could accept different arguments or results. One `CuaSurface` implementation keeps that behavior single. + +**An application-specific branch in the shared base** would let window objects inherit decisions and capability checks that apply only to applications. Scope factories that inject their own requirements keep the shared operations independent of which scope uses them. + +**A packed chord string** requires parsing key names, separators, and plus escaping together, and it pushes platform alias normalization into the shared layer. Keystroke and direction are separate semantics: `pressKey` describes one complete keystroke, while `sendKeyEvent` describes one explicit direction. Separate key and modifier values keep those semantics without a parser. + +**Platform keyboard key enumerations in the shared schema** would couple the portable operation schema to one provider's key names and require a schema change for each platform. Provider-defined strings let the provider interpret its own names while the shared schema stays neutral. + +**Static capabilities reported by native** would duplicate provider configuration in the native helper and make the helper responsible for knowledge that is fixed before it starts. The helper reports runtime state; the provider owns its startup capabilities. + +## Consequences + +Element IDs belong to the application's current accessibility snapshot. Reading one window replaces the facade’s current snapshot for that application, so callers observe again and confirm the IDs they use. The new read does not guarantee that an old string is rejected or that an ID changes; callers must not assume an older ID still identifies the same control. Pointer input and screenshots require an explicit window object; callers enumerate windows first. + +Keyboard behavior follows the provider's supported scopes. A caller that uses `sendKeyEvent` owns the down/up pairing, because the API never sends the opposite event. Keyboard modifier names are provider-defined, so the same string may have different support across providers. + +Provider guidance owns the list of supported actions. Adding a method to the shared schema does not claim that every provider implements it, and the merged `getCapabilities` result remains the runtime source for permissions and session lock. diff --git a/.agents/notes/implemented/architecture/2026-11-05-cua-scoped-surfaces-and-input.zh.md b/.agents/notes/implemented/architecture/2026-11-05-cua-scoped-surfaces-and-input.zh.md new file mode 100644 index 0000000000..081f02986e --- /dev/null +++ b/.agents/notes/implemented/architecture/2026-11-05-cua-scoped-surfaces-and-input.zh.md @@ -0,0 +1,39 @@ +# Agent Note: CUA 作用域表面与分离的输入能力 + +Status: implemented + +[English](2026-11-05-cua-scoped-surfaces-and-input.md) | 中文 + +## 问题 + +应用对象和窗口对象共享辅助功能操作,但只有显式窗口能截图或发送指针输入。若在两个工厂上分别复制共享方法,就会出现两套需要同步的实现。把只适用于应用的能力检查放进共享基类,会让窗口行为依赖应用级判断。键盘输入也有同样的问题:组合键字符串把按键与修饰键混在一起,完整击键方法无法表达跨调用保持修饰键或单独抬起按键。 + +## 决策 + +`CuaSurface` 声明应用对象与窗口对象共享的操作;`CuaApp` 与 `CuaWindow` 通过扩展它增加各自的操作。一个基类工厂负责构建表面,派生工厂注入作用域参数以及 `requireAccessibility`、`requireKeyboard` 检查。共享基类从不为只属于应用的能力分支。 + +Provider 的启动能力是静态的。平台、支持的方法、应用级辅助功能、键盘作用域、浏览器支持和坐标空间在安装 provider 时固定。原生 `getCapabilities` RPC 只报告运行时权限和会话锁定状态;`installCua` 为模型可见结果合并两层。中立的 RPC 是通用操作表示,不是能力清单;provider 指导文本说明其平台支持的动作。 + +键盘输入把按键与修饰键分开:`pressKey(key, modifiers?)` 在按住所列修饰键时按下并释放一个键,其键盘修饰键列表是 provider 定义的普通字符串数组。`sendKeyEvent(key, direction)` 只发送一次按下或抬起,不隐式发送相反事件。因此调用方可以保持修饰键或拆分手势;两个方法都不接受组合键字符串,共享 schema 也不枚举平台按键名。 + +在单个 API 实例内,对象门面按应用句柄保存一份当前辅助功能快照,该句柄的所有应用对象和窗口对象共享这份快照,包括对同一应用的重复选择。`getWindow` 静默执行首次树读取;当 provider 报告应用级辅助功能时,`getApp` 也静默读取。之后的 `getAccessibilityTree` 读取会在分派前使上一份快照失效。门面会为元素操作自动附加最新快照 ID;调用方应使用最新树中的元素 ID,不应假定旧 ID 仍指向同一控件。元素 ID 是 provider 定义的不透明字符串。只有显式 `CuaWindow` 可以截图或发送指针输入。原生 helper 在该门面之后保留自己的应用快照和可选窗口快照;原生层与门面快照相互独立。外部运行时继续负责变量持久化和最终表达式序列化;门面不加入 evaluator。[原生对象决定](2026-09-17-experimental-cua-object-api.zh.md)负责 evaluator 独立性,[共享 helper 决定](2026-10-09-cua-shared-native-helper.zh.md)负责连接生命期。 + +## 考虑过的替代方案 + +**在应用和窗口上重复方法**会让每个工厂各自实现同一套辅助功能操作。每次共享改动都需要成对修改,两个表面还可能接受不同的参数或结果。单一 `CuaSurface` 实现让这份行为只有一处。 + +**在共享基类中加入应用专属分支**会让窗口对象继承只适用于应用的决定和能力检查。由各作用域工厂注入自己的要求,可以让共享操作不依赖使用它的作用域。 + +**打包的组合键字符串**需要一起解析按键名、分隔符和加号转义,并把平台别名归一化推入共享层。击键与方向是两种语义:`pressKey` 描述一次完整击键,`sendKeyEvent` 描述一个显式方向。分开的按键和修饰键值让这些语义无需解析器。 + +**在共享 schema 中枚举平台键盘按键**会把可移植的操作 schema 绑定到某个 provider 的按键名,并让每个平台都修改 schema。由 provider 定义字符串,平台可以解释自己的名称,共享 schema 保持中立。 + +**由原生报告静态能力**会在原生 helper 中重复 provider 配置,并让 helper 负责它在启动前就固定的知识。helper 报告运行时状态;启动能力由 provider 负责。 + +## 影响 + +元素 ID 属于应用当前的辅助功能快照。读取一个窗口会替换门面对该应用的当前快照,因此调用方需要重新观察并确认要使用的 ID。新的读取不保证拒绝旧字符串,也不保证 ID 会改变;调用方不得假定旧 ID 仍指向同一控件。指针输入和截图都要求显式的窗口对象;调用方先枚举窗口。 + +键盘行为遵循 provider 支持的作用域。使用 `sendKeyEvent` 的调用方负责按下与抬起的配对,因为 API 从不发送相反事件。键盘修饰键名称由 provider 定义,同一字符串在不同 provider 上可能支持不同。 + +Provider 指导文本负责支持动作的清单。把方法加入共享 schema 并不表示每个 provider 都已实现它;合并后的 `getCapabilities` 结果仍是权限和会话锁定状态的运行时来源。 diff --git a/packages/experimental/cua-macos/README.i18n.yaml b/packages/experimental/cua-macos/README.i18n.yaml index 07efa1a956..25a37445d2 100644 --- a/packages/experimental/cua-macos/README.i18n.yaml +++ b/packages/experimental/cua-macos/README.i18n.yaml @@ -9,20 +9,20 @@ en: 022ca213425e11ee zh: d64631748ed91cc2 /deepseek-ai-dsh-experimental-cua-macos/summary: - en: 4549f02fc53854a5 - zh: 6f74f1130b6623a8 + en: 7ffb2f01c0b05f32 + zh: 74dac288fa7f7690 /deepseek-ai-dsh-experimental-cua-macos/table-of-contents: en: 867d9ec544719acf zh: 92348599582dc33a /deepseek-ai-dsh-experimental-cua-macos/use-this-package: - en: cfc482eae08b8dc4 - zh: ff92204137be604a + en: 54dcbe1b12eb6bb2 + zh: 94eb622300fa1d91 /deepseek-ai-dsh-experimental-cua-macos/use-this-package/connect-an-external-execution-environment: - en: 786b8fd630b11e5f - zh: 55143f15486afce8 + en: 8bf27cf5a258b1f4 + zh: dba694e92bc6c091 /deepseek-ai-dsh-experimental-cua-macos/understand-the-implementation: - en: 8b9ec208ca057a4a - zh: e8dbb45891ad15b8 + en: 4e82b85a5aa72eee + zh: 4e004b7a205d8688 /deepseek-ai-dsh-experimental-cua-macos/further-exploration: en: ff9fac614001a98f zh: 329678941154aaea @@ -45,8 +45,8 @@ en: a2c9acb5a4320dda zh: e8d1586af60215c4 /deepseek-ai-dsh-experimental-cua-macos/known-limitations-and-deferred-work: - en: f501e13547fa400b - zh: 8557fb4675cfe5d8 + en: 76c21eb081807709 + zh: 3af1021741b65d07 /deepseek-ai-dsh-experimental-cua-macos/known-limitations-and-deferred-work/dev-note: en: b836f01bd0bceb4a zh: 8122fa08b2aa95fa diff --git a/packages/experimental/cua-macos/README.md b/packages/experimental/cua-macos/README.md index 17aad59a8b..0b7aa0dc0f 100644 --- a/packages/experimental/cua-macos/README.md +++ b/packages/experimental/cua-macos/README.md @@ -9,7 +9,7 @@ English | [中文](README.zh.md) ## Summary -Inspect macOS permissions, select running applications and windows, read accessibility trees, capture screenshots and send input. The object API can be retained by an external persistent execution environment. The Swift helper uses macOS frameworks directly and adapts selected MIT-licensed Cua Driver behavior. This package owns neither a PTC runtime nor variable persistence. +Inspect macOS permissions, select running applications and windows, read accessibility trees, capture screenshots from a selected window, and send input. The object API can be retained by an external persistent execution environment. The Swift helper uses macOS frameworks directly and adapts selected MIT-licensed Cua Driver behavior. This package owns neither a PTC runtime nor variable persistence. ## Table of Contents @@ -40,7 +40,7 @@ export DSH_CUA_HELPER="$cua_native_root/.build/release/dsh-cua-native" pnpm dsh headless --patch packages/experimental/cua-macos/examples/macos.cordis.yml --dump-config ``` -The dump command checks profile composition without a model request. For a real task, replace `--dump-config` with a prompt and configure the profile’s model credentials. The overlay mounts the computer-use registry and this provider; remove an existing competing provider before using it. The responsible host/helper needs Accessibility permission for AX/input and Screen Recording permission for capture. `getCapabilities` reports permissions and session lock state without opening a system dialog. Locked or unavailable desktop sessions reject UI observations and input before dispatch; the user must unlock macOS before resuming. `listApps` and `cua.getState` list running applications. `findApps(query)` searches standard macOS application directories by name, bundle ID or absolute path. `getApp` selects a unique name, bundle ID, path or running PID, obtains application consent, and launches a stopped app in the background when needed. A stopped executable is identified before approval and checked again before and after launch; unsigned code only receives session access for the selected instance. The helper waits for the launched application to finish launching before returning its PID. The returned object reads initial AX without activating the app. Launch cancellation may leave the application running. Model guidance starts with background observation and input, without activation during initialization or before each action. For hidden or minimized windows, try `app.show()` or `window.show()` and read fresh state. This requests unhide and unminimize without activation, raising or switching Spaces; app-level restoration selects the focused, main or sole AX window. The result names the selected `windowId`, or null when no window was selected, and reports `foregroundChanged` by comparing the front app and top window before and after the request. Null means foreground evidence was unavailable; later focus changes remain possible. If restoration fails or the window remains unusable, explain the needed foreground step, call `app.activate()` or an observed window’s `raise` action, then observe again. Necessary foreground access takes priority over preserving focus. Applications may change focus after input; background delivery does not guarantee an undisturbed user session. +The dump command checks profile composition without a model request. For a real task, replace `--dump-config` with a prompt and configure the profile’s model credentials. The overlay mounts the computer-use registry and this provider; remove an existing competing provider before using it. The responsible host/helper needs Accessibility permission for AX/input and Screen Recording permission for capture. `getCapabilities` reports runtime permissions and session lock state without opening a system dialog; the provider adds its fixed platform capabilities to the model-visible result. A null `sessionLocked` means no usable unlocked desktop session was verified; verify an unlocked desktop before observations or input. `listApps` and `cua.getState` list running applications. `findApps(query)` searches standard macOS application directories by name, bundle ID or absolute path. `getApp` selects a unique name, bundle ID, path or running PID, obtains application consent, and launches a stopped app in the background when needed. A stopped executable is identified before approval and checked again before and after launch; unsigned code only receives session access for the selected instance. The helper waits for the launched application to finish launching before returning its PID. The returned object reads initial AX silently without activating the app. Launch cancellation may leave the application running. Model guidance starts with background observation and input, without activation during initialization or before each action. For hidden or minimized windows, try `app.show()` or `window.show()` and read fresh state. This requests unhide and unminimize without activation, raising or switching Spaces; app-level restoration selects the focused, main or sole AX window. The result names the selected `windowId`, or null when no window was selected, and reports `foregroundChanged` by comparing the front app and top window before and after the request. Null means foreground evidence was unavailable; later focus changes remain possible. If restoration fails or the window remains unusable, explain the needed foreground step, call `app.activate()` or an observed window’s `raise` action, then observe again. Necessary foreground access takes priority over preserving focus; explain the need before the explicit activation call rather than assuming the user will activate the app manually. Applications may change focus after input; background delivery does not guarantee an undisturbed user session. | Field | Default | Meaning | | --- | --- | --- | @@ -59,23 +59,23 @@ The dump command checks profile composition without a model request. For a real | `maxElements` / `maxDepth` | `2000` / `25` | Accessibility traversal limits. | | `maxClickHoldMs` | `5000` | Maximum explicit click hold in milliseconds; accepts nonnegative integers. Zero only permits immediate release. | | `dragDurationMs` / `dragSteps` | `400` / `20` | Duration and movement segments for a drag. | -| `textEventIntervalMs` | `0.25` | Delay after each Unicode down/up event, from 0 to 999 ms. Chord timing is independent. | +| `textEventIntervalMs` | `0.25` | Delay after each Unicode down/up event, from 0 to 999 ms. Keystroke timing is independent. | -The [configuration catalog](../../../docs/config-catalog.md#deepseek-aidsh-experimental-cua-macos) lists all fields. Native tool calls use `{method, params}`; the complete method-specific schema is exposed to the model. For example, `getApp` returns the `appHandle` needed by `listWindows`, `getState` and input operations. +The [configuration catalog](../../../docs/config-catalog.md#deepseek-aidsh-experimental-cua-macos) lists all fields. Native tool calls use `{method, params}`; the complete method-specific schema is exposed to the model. `getApp` returns the `appHandle` used by every app-targeted operation, and `app.getWindow(windowId)` returns the object that owns screenshots and pointer input. -Keypad names (`KP_0` through `KP_9`, `KP_Enter`, and keypad operators) retain their physical key codes. Key chords use `+` between modifiers and the key. Use `+` for the plus key, `cmd++` for Command-plus, or the key name `plus`; an unfinished chord such as `cmd+` is rejected. +`pressKey(key, modifiers?)` presses and releases one key. Pass modifier names separately, for example `pressKey('Tab', ['shift'])` or `pressKey('+')`; an omitted modifier array means none. The macOS helper accepts `command`/`cmd`, `shift`, `option`/`alt`, `control`/`ctrl`, and `fn`, and maps them to their physical keys. Key names are platform-defined; keypad names (`KP_0` through `KP_9`, `KP_Enter`, and keypad operators) retain their physical key codes. `typeText` sends literal text, including its line breaks and tabs. Agent disposal and plugin unload cancel and await the complete tool call, including image admission and attachment storage. An image write already in progress must settle before disposal returns; a canceled call cannot return a successful screenshot. Application consent is enforced before AX reads, window-title reads, screenshots, activation, and input through the CUA tool. The first selection asks the human for session access, denial, or saved access when the application has a verifiable signature. Session access is stored by conversation and application identity and survives DSH restart and Computer Use disablement. Other conversations require their own consent. Signed application identities combine the canonical executable path and designated code-signing requirement; unverifiable applications remain bound to their process instance. Denial prevents repeated prompts in that session. Revocation reads and removes saved access in the same queue as grant creation, invalidates each affected Agent connection, and awaits its native cleanup without replaying input. Every app handle on those Agent connections becomes unusable; other applications need fresh selection, but their session and saved grants remain reusable. See the [application consent decision](../../../.agents/notes/implemented/architecture/2026-09-26-cua-application-consent.md). These checks govern CUA calls; persistent PTC and separately authorized shell tools are not an operating-system sandbox. -Raw `getState` exposes validated state fields and the complete text for the requested disclosure options. The native helper also returns structured element diagnostics for native checks; the tool projection omits that duplicate array from model text and structured tool values. +Raw `getState` exposes validated state fields and the complete text for the requested disclosure options. The native helper also returns structured element diagnostics with opaque string `elementId` values for native checks; the tool projection omits that duplicate array from model text and structured tool values. -AX observations show menu-bar entries by default. Use `app.getAXState({ includeMenus: true })` to expand menu contents and `app.getAXState({ details: true })` for identifiers, global-point bounds and complete action names. These options also apply to raw `getState` and combined AX/screenshot observations. Every observation replaces that scope's indices; obtain fresh indices from the expanded output. Details do not bypass the configured node and depth limits. Truncation identifies the reached limit. +AX observations show menu-bar entries by default. Use `app.getAccessibilityTree({ includeMenus: true })` to expand menu contents and `app.getAccessibilityTree({ details: true })` for identifiers, global-point bounds and complete action names. These options also apply to raw `getState`. Every read replaces the application's current snapshot; use element IDs from that read. Details do not bypass the configured node and depth limits. Truncation identifies the reached limit. Values and placeholders are separate. Named, stateful or actionable groups and scroll areas retain their own rows. Repeated names, descriptions and help text on one node are shown once. Values, placeholders and URLs keep their distinct meanings even when their text matches; body text shared by distinct nodes remains intact. Writability is explicit on relevant controls, including `AXIncrementor`; `unknown` means the system did not report it. Missing optional state fields do not imply false. UTF-16 ranges outside the observed value are marked unavailable. Custom action aliases omit AppKit target/selector diagnostics; ambiguous aliases require a complete name from `details:true`. -Observations emit by default and also return their value. In persistent PTC, use `void await app.getAXState()` for one emitted copy, or `emit:false` and one explicit print. Capturing a screenshot after an emitted tree can fail independently; retain the successful AX output. +Observations emit by default and also return their value. In persistent PTC, use `void await app.getAccessibilityTree()` for one emitted copy, or `emit:false` and one explicit print. Capturing a screenshot after an emitted tree can fail independently; retain the successful AX output. Screenshot diagnostics use `[cua-screenshot]` records keyed by the tool request ID. Native phase records return over the originating Agent connection and cover window/AX geometry checks, system capture, PNG/Base64 encoding and response writing. Host debug logs add dispatch, reply and cleanup timings. Each request retains at most 8192 bytes of complete diagnostic records, with explicit truncation; screenshot failures append these records to the error for Session export. Records contain stages, timings and error codes, not window titles, AX text or image bytes. @@ -89,14 +89,17 @@ To run through persistent PTC, add `--patch packages/experimental/cua-macos/exam import { connectCua } from '@deepseek-ai/dsh-cua/bridge' const cua = connectCua(() => tools.cua, text => console.log(text)) const app = await cua.getApp("com.apple.TextEdit") -void await app.getScreenshot() +const windows = await app.getWindows() +if (windows.length === 0) throw new Error("Open a TextEdit window first") +const window = await app.getWindow(windows[0].windowId) +void await window.getScreenshot() ``` -Use app methods directly for single-window tasks. `getApp` reads initial AX state, so a screenshot needs no window enumeration or additional AX read. Use `app.getWindows()` and `app.getWindow(windowId)` when the task needs a particular window or default selection is ambiguous; choose by the observed title and bounds. +Use the `cua` API to discover and select the application (`listApps`, `getState`, `findApps`, `getApp`); use the selected app to activate it, enumerate its windows, and select one. Window selection is required for screenshots and pointer input, not only when several windows exist. `getApp` and `app.getWindow(windowId)` read their initial trees silently; choose the window by its observed title and bounds. -`getWindow` emits its initial AX tree. An owned window without an AX surface returns an empty snapshot and remains available for screenshots and coordinate input. Window objects retain separate snapshots, so reading one window does not invalidate another. Re-reading the same scope invalidates old indices. An AX node removed during observation rejects the read with `STALE_SNAPSHOT` and publishes no partial tree; read again without repeating the preceding input. App-scoped screenshots and coordinates reuse the latest AX observation: its focused on-screen, nonzero-size window, otherwise the sole such window. They do not query current focus again; read `app.getAXState()` to follow a focus change. Explicit window objects retain their selected target. Keyboard methods stay on `app` because input follows the app’s current focus. +`getWindow` reads its initial tree silently. An owned window without an AX surface returns an empty snapshot and remains available for screenshots and coordinate input. Within one API instance, the facade keeps one current accessibility snapshot per application handle, shared by every app and window object for that handle, including repeated selections. Reading any window replaces that snapshot; element operations use the latest snapshot ID, so use IDs from the latest tree and do not assume an older ID still identifies the same control. A failed read publishes no partial snapshot; read again without repeating the preceding input. Window objects own screenshots and pointer input. Keyboard methods stay on `app` because input follows the app’s current focus. -`hover(target)` first reveals advertised AX alternate UI without moving the system cursor. Entering a revealed descendant preserves its parent UI, and leaving restores the default UI. When unavailable, hover moves the visible system cursor to an AX element center or window-local point without pressing a button, including over disabled controls. It requires the selected app to be foreground and the target point unobscured; otherwise `FOREGROUND_REQUIRED` requires explicit activation or raising and a fresh observation. Completion, AX reads and screenshots do not restore the previous point. Wait for the application’s hover delay, observe the revealed content, then hover into it and click; successive calls can visit intermediate points. Other input or application changes can interrupt the interaction. [Continuous-interaction rationale](../../../.agents/notes/implemented/architecture/2026-10-13-cua-continuous-hover.md). +`mouseMove(target)` first reveals advertised AX alternate UI without moving the system cursor. Entering a revealed descendant preserves its parent UI, and leaving restores the default UI. When unavailable, the call moves the visible system cursor to an AX element center or window-local point without pressing a button, including over disabled controls. It requires the selected app to be foreground and the target point unobscured; otherwise `FOREGROUND_REQUIRED` requires explicit activation or raising and a fresh observation. Completion, AX reads and screenshots do not restore the previous point. Wait for the application’s hover delay, observe the revealed content, then hover into it and click; successive calls can visit intermediate points. Other input or application changes can interrupt the interaction. [Continuous-interaction rationale](../../../.agents/notes/implemented/architecture/2026-10-13-cua-continuous-hover.md). `paste(text, { format: "text" | "html" })` temporarily publishes the requested clipboard format and invokes the application’s enabled standard Paste menu command. It keeps the temporary format until a pasteboard reader requests its data, then restores every captured original format while it still owns the clipboard, preserving a later copy. Paste operations share a cross-process lock and cancellation joins helper cleanup. A forced process exit can prevent restoration. Unsupported Paste commands fail without typing fallback; `typeText` remains separate key-event input. @@ -104,13 +107,13 @@ Use app methods directly for single-window tasks. `getApp` reads initial AX stat Screenshot capture requires an attachment store and a resolved model route declaring image input. The shared attachment admission validates canonical Base64, the raster and its configured capacity, then stores the image once. Native data remains available to programmatic callers; model content carries coordinate metadata and the durable image reference. Response byte limits apply before parsing. -Absolute coordinates for hover, click, scroll and drag use pixels in the latest returned screenshot. Pass `relative: true` for integer thousandths of window width and height, from 0 to 999; omission or `false` uses pixels. Relative input can use a successful AX read or screenshot, while absolute input requires a screenshot. The Host maps the delivered image to native points, including attachment and model-request resizing. A value of 999 remains inside the window edge. Coordinate options do not apply to AX element indices. A width or height change since the latest observation returns `WINDOW_CHANGED` before input, including raw calls without a snapshot ID; read fresh AX or take a new screenshot before proceeding. Window movement alone preserves window-local coordinates. Capture and pointer input reject known disagreement between the selected window’s accessibility frame and displayed bounds with `WINDOW_CHANGED`, before posting pointer events. This includes Stage Manager transformations when AX retains the full window frame. Read fresh state; any activation or window raise remains explicit. Advertised AX actions remain available. Missing AX geometry retains the AXless path and does not establish that a transformed window can be operated. +Absolute coordinates for `mouseMove`, `click`, and `drag` use `[x, y]` tuples; `scroll` uses named `x` and `y`. All use pixels in the latest returned screenshot. Pass `relative: true` for integer thousandths of window width and height, from 0 to 999; omission or `false` uses pixels. Relative input can use a successful AX read or screenshot, while absolute input requires a screenshot. The Host maps the delivered image to native points, including attachment and model-request resizing. A value of 999 remains inside the window edge. Coordinate options do not apply to element IDs. A width or height change since the latest observation returns `WINDOW_CHANGED` before input, including raw coordinate calls without a snapshot ID; read fresh AX or take a new screenshot before proceeding. Window movement alone preserves window-local coordinates. Capture and pointer input reject known disagreement between the selected window’s accessibility frame and displayed bounds with `WINDOW_CHANGED`, before posting pointer events. This includes Stage Manager transformations when AX retains the full window frame. Read fresh state; any activation or window raise remains explicit. Advertised AX actions remain available. Missing AX geometry retains the AXless path and does not establish that a transformed window can be operated. Retained objects resolve the current tool binding on every call. The external runtime owns persistence, imports, cancellation and completion-value serialization. Screenshots return encoded bytes with their MIME type, pixel dimensions and window ID; the standard tool pipeline admits the image attachment exactly once. `emit: false` suppresses facade output only. A host that uses another dispatcher can build objects through `createCuaApi` from `./api`. AppKit sheets are selectable by their window IDs and remain visible in their document window’s tree. Keyboard input follows a system Open/Save panel only when the application’s focused sheet identifies one Apple panel-service window and that service still focuses the same panel. Unrelated or ambiguous remote recipients fail before dispatch. -Indexed clicks support a single right/middle click or a single/double left click. Click and drag options accept a button and modifier keys; a modified click uses pointer input. Drags hold that button and carry its modifiers through every movement and release. AX text marks disabled controls, `valueWritable=true`, and available `selected` state. The helper uses an advertised accessibility action for unmodified clicks when available; pointer delivery resolves the element’s current bounds and verifies its owning window. Actions report dispatch, not application success. A visual pointer or click marker can be rendered independently of input; AX actions do not require moving the system cursor. Window-directed mouse input can still change application focus, selection or dialogs. Read state after input. `STALE_APP` requires acquiring the application again; `STALE_SNAPSHOT` requires a fresh AX read. Request timeout/cancellation waits for native acknowledgement and preserves usable handles. Missing cleanup acknowledgement closes that Agent’s connection. A screenshot RPC still awaiting its system callback occupies the single capture slot; further screenshots return `CAPTURE_BUSY`, while AX and input remain available. A late capture result is discarded, and its real completion releases that slot. Only an unresponsive operation or failed cleanup can invalidate the shared process and all its handles. Never retry uncertain input automatically. Closing an Agent releases its connection and AX references, without undoing changes to applications. +Element clicks use opaque element IDs from the current snapshot. Left clicks support a single or double click; right and middle clicks support one. Click and drag options accept a button and modifier names; a modified click uses pointer input. Drags hold that button and carry its modifiers through every movement and release. AX text marks disabled controls, `valueWritable=true`, and available `selected` state. The helper uses an advertised accessibility action for unmodified clicks when available; pointer delivery resolves the element’s current bounds and verifies its owning window. Actions report dispatch, not application success. A visual pointer or click marker can be rendered independently of input; AX actions do not require moving the system cursor. Window-directed mouse input can still change application focus, selection or dialogs. Read state after input. `STALE_APP` requires acquiring the application again; `STALE_SNAPSHOT` requires a fresh AX read. Request timeout/cancellation waits for native acknowledgement and preserves usable handles. Missing cleanup acknowledgement closes that Agent’s connection. A screenshot RPC still awaiting its system callback occupies the single capture slot; further screenshots return `CAPTURE_BUSY`, while AX and input remain available. A late capture result is discarded, and its real completion releases that slot. Only an unresponsive operation or failed cleanup can invalidate the shared process and all its handles. Never retry uncertain input automatically. Closing an Agent releases its connection and AX references, without undoing changes to applications. ----- @@ -120,13 +123,13 @@ Indexed clicks support a single right/middle click or a single/double left click
Dispatch and resource ownership -The object facade translates app/window methods into JSON operations. The bridge routes them through the normal tool pipeline, preserving authorization, nested logs and image admission. Agents and Hosts belonging to one user share a helper for the same native build. Each connection retains independent handles, snapshots, configuration and cancellation state; desktop operations use a global queue. The managed launcher transfers service lifetime to these connections, and the helper exits after the last connection finishes cleanup. Process locks cover both build identity and the real executable path, preventing duplicate startup and path collisions after a running executable is replaced. Native handles bind a process identity to its kernel start time, and snapshots retain native AX references only inside that helper. The same operation protocol can serve a future platform provider without adding platform logic to the object API. +The object facade translates app/window methods into JSON operations. Within one API instance it keeps one current accessibility snapshot per application handle, while the native helper retains its own application and optional-window snapshots behind it. The bridge routes operations through the normal tool pipeline, preserving authorization, nested logs and image admission. Agents and Hosts belonging to one user share a helper for the same native build. Each connection retains independent handles, snapshots, configuration and cancellation state; desktop operations use a global queue. The managed launcher transfers service lifetime to these connections, and the helper exits after the last connection finishes cleanup. Process locks cover both build identity and the real executable path, preventing duplicate startup and path collisions after a running executable is replaced. Native handles bind a process identity to its kernel start time, and snapshots retain native AX references only inside that helper. [Zod operation definitions](../cua/src/protocol.ts) own model parameters and separately declare Host resource fields and private continuations. Public data types derive from those definitions. `pnpm exec tsx packages/experimental/cua-macos/native/generate-protocol.ts` generates the native JSON Schema and Swift field/enum admission tables; the package test lane checks freshness and rejects Host-only fields at model admission. Native target validation, resource limits and operation behavior remain enforced at execution. -[AX text formatting](native/Sources/CuaNative/AXTextFormatter.swift) consumes already-read node data. The AX walker alone assigns indices and retains native references, so formatting owns no second snapshot or target registry. +[AX text formatting](native/Sources/CuaNative/AXTextFormatter.swift) consumes already-read node data. The AX walker alone assigns opaque element IDs and retains native references, so formatting owns no second snapshot or target registry. -Native request IDs match the logged tool call IDs. Successful activation and window-raise results retain foreground request details and immediate before/after focus observations in the raw tool result. An already-frontmost app skips redundant activation; a window raise is skipped only when the exact window is also focused, main, unminimized and first among visible normal windows. Unknown observations retain the requested operation. These observations do not establish who caused an unrelated focus change or verify completion. +Native request IDs match the logged tool call IDs. Successful activation results retain foreground request details and immediate before/after focus observations in the raw tool result. An already-frontmost app skips redundant activation. Unknown observations retain the requested operation. These observations do not establish who caused an unrelated focus change or verify completion. Node roles and metadata share one AX batch per observation. Group and scroll-area nodes contribute only children; unused metadata errors do not reject them. Unsupported batching retains individual attribute reads. AX traversal visits each native identity once, including proxy references that compare equal, so cyclic accessibility children cannot repeat whole subtrees. The [source manifest](native/upstream.json) records adapted upstream behavior and local Swift modules. AppKit runs on the main event loop; a separate serial executor owns AX references and synchronous input. A request retains exclusive execution through capture and response delivery. No invariant companion is published: there is no independently projected registry or durable evaluator state to reconcile. Protocol validation, target identity and resource cleanup are checked by their owning implementations. @@ -155,54 +158,54 @@ The plugin contributes one `cua` operation tool with method-specific parameters. ##### Operation guidance (verbatim) ```markdown -Use cua with method getCapabilities and params {} to inspect permissions and sessionLocked. If sessionLocked is true or an operation reports SESSION_LOCKED, stop UI attempts and ask the user to unlock the desktop session. A null sessionLocked means no usable console session was verified. After unlocking, read fresh state; screenshots from a locked desktop are not current observations. Use listApps or cua.getState to discover running applications, and findApps(query) to search installed applications by name or application path. getApp requests user consent before launching a stopped application in the background, or before observations and input on a running one. If access is denied or revoked, stop using that application until the user explicitly permits another authorization request. Never switch tools to bypass a refusal. Keep the returned appHandle; every app operation requires it. listWindows returns window IDs and bounds in the provider’s native units. Raw getState returns AX text and snapshotId. Menu-bar entries are shown by default; includeMenus=true expands their contents. details=true adds identifiers, global native bounds and complete action names. Both options also apply to getAXState. Each read replaces the indices for that app/window scope. Use its element indices only with that snapshotId. Raw screenshot and coordinate operations require a windowId. Coordinates are pixels in the latest returned screenshot, measured from its top-left. Set relative:true for integer thousandths from 0 to 999 instead. The Host converts both modes to native window coordinates; AX detail bounds remain global native coordinates. A verified window can expose no AX elements. Its empty snapshot permits screenshots and coordinate input; element-index actions require an element from a fresh AX observation. +macOS: accessibility tree operations are available at app or window level. Simulated keyboard input is available at app level. Simulated mouse input is available at window level. getApp also accepts bundle IDs and .app paths, and findApps searches /Applications, /System/Applications, and ~/Applications. Accessibility and Screen Recording permissions belong to the responsible launching application; use the Computer Use permission page to request access, open System Settings, and check again. Native window and AX bounds use macOS points, while delivered screenshots carry their own pixel dimensions. show does not switch Spaces, and Stage Manager can present reduced window geometry; explain any required foreground step before activate or raise. -Initialize the object API once in persistent PTC. Reuse its variables in later calls; put temporary declarations inside { ... } blocks to avoid redeclaration errors. All object methods are async. getAXState returns text, not a structured state object. Its text separates values and placeholders, and reports subroles, help, URLs, disabled/focused/selected/expanded state and UTF-16 selection ranges when available. Writability is true, false or unknown on relevant controls; omitted state fields do not assert false. selection=unavailable means the reported range exceeds the observed text. Compact output omits ordinary Press/Pick (click), ShowMenu (right click) and ScrollToVisible actions; details=true lists every available action. Use the displayed action name with performSecondaryAction; ambiguous aliases require the complete name from details=true. Truncation reports the reached provider limit. Narrow the window or increase that provider limit before reading again. +Use cua to observe and operate native applications. Always use cua.getCapabilities() to confirm whether a specific API is available on the current platform; its reported capabilities take precedence over availability statements in these instructions. All methods are async; observation options default to { emit: true }, and emit: false suppresses sink output only, leaving returned values unchanged. Actions report dispatch evidence, not verified completion. If sessionLocked is true or an operation reports SESSION_LOCKED, stop UI actions and ask the user to unlock the desktop session; null or unknown means verify a usable unlocked desktop session first. cua.getApp requests user consent; if access is denied or revoked, stop using that application until the user explicitly permits another request, and never bypass a refusal or switch tools to avoid it. Never replay uncertain input without a fresh observation. -Use app methods directly for single-window tasks; getApp already reads initial AX state. Call app.getWindows() and await app.getWindow(windowId) only to target a particular window or resolve ambiguous window selection. App screenshots and coordinate actions use the latest AX observation: its focused on-screen, nonzero-size window, otherwise the sole such window. They do not refresh focus automatically. Read app.getAXState() to follow changed focus. +In persistent PTC, use the host-provided bridge initialization once and retain the returned objects; cua comes from that bridge and is not a preinstalled global. Use void await for observations that emit, and never stringify screenshot image bytes. -CuaScreenshot contains { bytes: Uint8Array, mimeType: "image/png" | "image/jpeg" | "image/webp" | "image/gif", pixelWidth: number, pixelHeight: number, windowId: number }. Use mimeType to choose a file extension or declare an image; do not assume PNG. +Signatures show resolved return values after await. ActionResult = { dispatched: boolean, foregroundChanged?: boolean | null }; foregroundChanged is omitted when not sampled and null when the sample is unavailable. JsonValue = string | number | boolean | null | JsonValue[] | { [key: string]: JsonValue }; numbers must be finite. App is the application object with readonly app.appHandle: string (opaque) and the methods listed below for app level. Window is the window object with readonly window.windowId: number and the methods listed below for window level. Neither object carries pid. -Object API signatures (options default to { emit: true }): +Setup and discovery: +- cua.getCapabilities(options?: { emit?: boolean }) -> { platform: string, permissions: { accessibility: boolean, screenRecording: boolean }, appLevelAccessibility: boolean, keyboard: ('app' | 'window')[], sessionLocked: boolean | null, methods: string[], coordinateSpace: 'screenshot-pixels', browser: false } — inspect reported permissions, sessionLocked, methods, and keyboard scopes without requesting permissions. +- cua.listApps(options?: { emit?: boolean }) -> { id: string, displayName: string, isRunning: true, pid: number }[] — enumerate running applications. +- cua.findApps(query: string, options?: { emit?: boolean }) -> ({ id: string, displayName: string, path: string } & ({ isRunning: true, pid: number } | { isRunning: false }))[] — search installed applications, including stopped matches; only running matches carry pid. +- cua.getState(options?: { emit?: boolean }) -> { apps: { id: string, displayName: string, isRunning: true, pid: number }[], browsers: [] } — summarize running applications; this is not an accessibility observation. +- cua.getApp(selector: string) -> App — select an application by name, bundle ID, absolute path, or running PID string, obtain consent, launch in the background if needed, and read initial AX state silently; it does not activate the app. +- app.getWindows(options?: { emit?: boolean }) -> { windowId: number, appName: string, title: string, bounds: { x: number, y: number, width: number, height: number }, isOnScreen: boolean, onCurrentSpace: boolean | null }[] — enumerate windows with global native bounds; null onCurrentSpace means unknown Space membership. +- app.getWindow(windowId: number) -> Window — select one window and read its initial AX state silently; do this before any window screenshot or coordinate input. +- app.activate() -> ActionResult — request explicit foreground activation; use only when foreground access is required. +- app.show() -> { dispatched: boolean, windowId: number | null, foregroundChanged: boolean | null } — unhide the app and restore its selected, focused, main, or sole window without activation. +- window.show() -> { dispatched: boolean, windowId: number | null, foregroundChanged: boolean | null } — unhide and restore that explicit window without activation. -- cua.getCapabilities(options?) -> { platform, permissions, sessionLocked, methods, coordinateSpace, browser } -- cua.listApps(options?) -> Array<{ id, displayName, isRunning: true, pid }> -- cua.findApps(query: string, options?) -> Array<{ id, displayName, path, isRunning, pid? }> -- cua.getState(options?) -> { apps, browsers: [] } -- cua.getApp(selector: string) -> App -- app.activate() -> { dispatched: true, verified: false } -- app.getWindows(options?) -> Array<{ windowId, pid, appName, title, bounds, isOnScreen, onCurrentSpace }> -- app.getWindow(windowId: number) -> Window -- app.typeText(text: string), app.pressKey(chord: string) -> action result -- app.paste(text: string, options?: { format?: "text" | "html" }) -> action result +## Accessibility tree +Available at app or window level depending on the platform. -App and Window methods: +Element ids are opaque strings from the latest successful tree; the object facade keeps one current snapshot per app across its repeated app and window objects, a new read replaces it, and a failed read invalidates the previous one. Repeated strings can appear for different elements, so do not reuse an old id blindly, and element operations do not fall back to pointer input or typing. +- getAccessibilityTree(options?: { emit?: boolean, includeMenus?: boolean, details?: boolean, disableDiffing?: boolean }) -> string — read the full tree text; includeMenus expands menu contents and details adds identifiers, native bounds, and complete action names. +- listActions(elementId: string) -> string[] — list the actions an element advertises. +- invoke(elementId: string) -> ActionResult — invoke the element's default action; dispatched is false when it has none. +- performAction(elementId: string, action: string, argument?: JsonValue) -> ActionResult — perform an observed action with an optional direct JSON argument. +- setValue(elementId: string, value: JsonValue) -> ActionResult — write a control value. +- selectText(elementId: string, text: string, options?: { prefix?: string, suffix?: string, selectionType?: 'text' | 'cursor_before' | 'cursor_after' }) -> ActionResult — select one literal occurrence or place the cursor beside it, using adjacent context to disambiguate. -- show() -> { dispatched: true, verified: false, windowId: number | null, foregroundChanged: boolean | null } -- getAXState(options?: { emit?: boolean, disableDiffing?: boolean, includeMenus?: boolean, details?: boolean }) -> string -- getScreenshot(options?: { emit?: boolean }) -> CuaScreenshot -- getAXStateAndScreenshot(options?) -> { state: string, screenshot: CuaScreenshot } -- click(target: number | [x, y], options?: { mouseButton?: "left" | "right" | "middle", clickCount?: 1 | 2, holdMs?: number, modifiers?: Array<"command" | "control" | "option" | "shift" | "fn">, relative?: boolean }) -> action result -- hover(target: number | [x, y], options?: { relative?: boolean }) -> { dispatched, verified, hoverRoute, systemPointerMoved } -- setValue(elementIndex: number, value: string) -> action result -- selectText(elementIndex: number, text: string, options?: { prefix?: string, suffix?: string, selectionType?: "text" | "cursor_before" | "cursor_after" }) -> action result -- performSecondaryAction(elementIndex: number, action: string) -> action result -- scroll({ x, y, deltaLinesX, deltaLinesY, relative? }) -> action result -- drag(from: [x, y], to: [x, y], options?: { mouseButton?: "left" | "right" | "middle", modifiers?: Array<"command" | "control" | "option" | "shift" | "fn">, relative?: boolean }) -> action result +## Simulated mouse +Available at app or window level depending on the platform. +- getScreenshot(options?: { emit?: boolean }) -> { bytes: Uint8Array, mimeType: 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif', pixelWidth: number, pixelHeight: number, windowId: number } — capture the selected window as one encoded image; bytes is a JavaScript byte array, and mimeType identifies its encoding, so do not assume PNG. +- mouseMove(target: string | [number, number], options?: { relative?: boolean }) -> { dispatched: boolean, foregroundChanged?: boolean | null, hoverRoute: 'accessibility' | 'system-pointer', systemPointerMoved: boolean } — reveal AX alternate UI or move the system pointer without pressing; inspect hoverRoute and systemPointerMoved, and expect no automatic pointer restoration. +- click(target: string | [number, number], options?: { mouseButton?: 'left' | 'right' | 'middle', clickCount?: 1 | 2, modifiers?: ('command' | 'control' | 'option' | 'shift' | 'fn')[], holdMs?: number, relative?: boolean }) -> ActionResult — click an element id or point, or perform a left-button double-click; holdMs controls the press duration of each press. +- scroll(options: { x: number, y: number, deltaLinesX: number, deltaLinesY: number, relative?: boolean }) -> ActionResult — scroll at a point; deltas are integers from -10 to 10 with at least one nonzero, and positive values reveal content above or left. +- drag(from: [number, number], to: [number, number], options?: { mouseButton?: 'left' | 'right' | 'middle', modifiers?: ('command' | 'control' | 'option' | 'shift' | 'fn')[], relative?: boolean }) -> ActionResult — drag between two points of one window. -Raw operation tools use { method, params }, including params: {} for parameterless methods. getApp selects without activating the app. Keep applications in the background for observation and actions that the provider supports without foreground access. Do not activate or raise an app during initialization, before each action, or merely because another app is foreground. Prefer advertised AX actions. If a window is hidden or minimized, try app.show() or window.show() and read fresh state. show requests unhide and unminimize without activation or raising; it chooses the explicit, focused, main or sole AX window. A null windowId means no window was selected for restoration. foregroundChanged compares the front app and top window before and after the request; null means unavailable, and delayed focus changes remain possible. If restoration is unsupported or the window remains unusable, explain the needed foreground step, use app.activate() or an advertised raise action, and read fresh state. Completing the task takes priority when foreground access is necessary. Avoid repeated activation when the user switches away; continue background-capable steps and report what requires foreground access. Applications may still change focus in response to input. +A string target is an element id; coordinate targets are [x, y] and are pixels in the latest returned screenshot by default. With relative: true they are integer thousandths of the window width and height from 0 to 999, based on the current AX observation or screenshot. Left clicks support one or two presses; right and middle clicks support one. FOREGROUND_REQUIRED means explain the need, then explicitly activate or raise and observe again; activation is never automatic. Read fresh state after actions, and treat WINDOW_CHANGED, STALE_SNAPSHOT, and SCREENSHOT_REQUIRED as requiring the stated fresh observation or capture before any retry. -Await operations sequentially. After input, read fresh state to verify the effect. A successful action means dispatched, not verified completion. Cancellation may leave partial effects; never retry uncertain input without observing. STALE_APP requires getApp again; STALE_SNAPSHOT requires getState again. Absolute coordinate input requires a fresh screenshot of that window. Relative input can use a successful AX observation or screenshot. SCREENSHOT_REQUIRED means capture a fresh screenshot before using pixel coordinates. For coordinate input, targets must be [x, y], for example click([650, 400], {relative:true}). A bare number such as click(650) is always an AX element index. The relative option applies only to coordinate targets, not AX indices. Window resizing since the latest observation rejects coordinate input; movement alone preserves window-local coordinates. WINDOW_CHANGED requires fresh state before any retry; use an advertised AX action or explicitly restore the window before screenshot or coordinate input, then observe again. PERMISSION_DENIED requires the user to address the reported system access restriction. After granting access, observe fresh state before continuing; do not automatically replay prior input. +## Simulated keyboard +Available at app or window level depending on the platform. +- typeText(text: string) -> ActionResult — type literal text at the app's current focus; line endings send Return and tabs send Tab. +- paste(text: string, options?: { format?: 'text' | 'html' }) -> ActionResult — deliver text or HTML through the app's Paste command, restoring prior clipboard contents unless another writer changes them; a Paste failure is surfaced without substituting typeText, and PASTE_NOT_CONSUMED means inspect before any retry. +- pressKey(key: string, modifiers?: string[]) -> ActionResult — press and release one complete keystroke. For example pressKey('Tab', ['shift']) or pressKey('+'). Key and modifier names are platform-defined strings. Pass key and modifiers separately; do not pack them into a chord string. -Hover reveals alternate UI through a provider-supported accessibility action or moves the system pointer without pressing a button. Wait for the application's hover delay and observe before clicking; subsequent observations do not restore the pointer. Use successive hover calls for intermediate points. Other input and application changes can interrupt the interaction. click accepts optional holdMs, a nonnegative integer in milliseconds for each press, including double-click presses. Zero releases without an additional hold. The configured maximum is stated below. Explicit holdMs uses pointer input even for AX targets; omission preserves ordinary clicks. The operation deadline applies, and cancellation or timeout releases the button. - -Use selectText only on controls advertising selectionWritable. It selects a unique literal occurrence, or places the cursor before/after it; prefix and suffix must be immediately adjacent. AMBIGUOUS_TEXT requires more context; TEXT_NOT_FOUND or SELECTION_CHANGED requires a fresh observation before deciding on input. Left clicks support single/double clicks; right and middle clicks support single clicks. Modified clicks use pointer input. Keypad names such as KP_0 and KP_Enter retain their physical key identity. Window objects expose observation and pointer/AX actions; keyboard input remains app-scoped and follows current focus. Scroll deltas are integer lines from -10 to 10; positive values reveal content above or left. Paste delivers plain text or HTML through the system clipboard and the application's paste action. Original clipboard formats are restored if the clipboard still belongs to this paste; a later copy is preserved. Unsupported Paste commands fail without typing fallback. CLIPBOARD_CHANGED means another writer intervened; observe before deciding on further input. Browser applications can be controlled with getApp like other native apps; browser tabs are unavailable. Installed-app search covers the locations documented by the platform provider; use an absolute application path for another location. Launch does not restore a window or document, and cancellation may leave an application already started. The execution host must install the object API and own variable persistence; this plugin does not preload a cua global. In persistent PTC, use the host-provided initialization snippet below once. Its installation-owned file URL works independently of the project directory. Retain app objects between calls. Observation methods emit by default and also return their value. Use void await app.getAXState() to avoid a duplicate REPL completion, or pass emit:false and print the returned text once. End screenshot calls with void await app.getScreenshot() or void await app.getAXStateAndScreenshot() so image bytes are not serialized as the program completion value. - -macOS: getApp also accepts bundle IDs and .app paths. findApps searches /Applications, /System/Applications and ~/Applications. Accessibility and Screen Recording permissions belong to the responsible launching application. Use the Computer Use permission page to request access, open System Settings, and check again. Native window and AX bounds use macOS points. show does not switch Spaces. Stage Manager can present reduced window geometry; explain any required foreground step before activate or raise. - -Hover first uses advertised AX alternate UI without moving the system cursor, preserving revealed descendants until the pointer target leaves their region. The system-pointer fallback requires the target point to be unobscured in the foreground app. FOREGROUND_REQUIRED requires explicit activation or raising and a fresh observation before retrying. - -Paste delivers plain text or HTML through the application's enabled standard Paste menu command. Paste follows the target app's focused text input. Foreground requirements vary by application; for example, ChatGPT/Codex was observed to accept background Paste without reading clipboard data. PASTE_NOT_CONSUMED means the command was dispatched but no clipboard read was observed before the configured deadline. Inspect the target contents, explicitly activate the app and focus the intended input, then observe again before deciding whether to retry; a delayed paste may still run. +Raw tools use { method, params }: include appHandle for app calls and windowId for window calls, and use snapshotId with elementId for element routes. Object options such as emit and disableDiffing are facade-only: emit is local output control and neither is a raw RPC parameter, so raw callers must follow the raw operation schema for admitted params. getAccessibilityTree and getWindow read through raw getState; getWindows maps to listWindows; getScreenshot maps to screenshot; cua.getState maps to listApps; every other named operation uses the same method name. ``` #### Token effect @@ -219,12 +222,12 @@ The queue orders individual native requests. Holding an app object does not rese -- This provider supports macOS only and remains experimental. Browser tabs, AX diffs, unassociated system panels and accessory-only apps are unsupported. +- Element IDs belong to the application's current accessibility snapshot; a later read replaces them. Screenshots and pointer input require an explicit window object. - Coordinates use the returned screenshot pixels, including the title bar; `relative: true` selects integer thousandths. Native point conversion is Host-owned. Window movement, application changes and other desktop users can race observations and input. - macOS Stage Manager can reduce background window bounds and screenshots to thumbnails. Full-window observation and coordinate input in this state are not guaranteed; model guidance requires explaining foreground needs and avoiding repeated focus reclamation. - Background input depends on private SkyLight symbols; macOS updates can make them unavailable. Validate each target OS version. - Observed failures include dispatched Unicode text not appearing in Blender and background Command+A not selecting all text in AppKit. Inspect application state after input; a successful tool result confirms dispatch only. -- Native binaries require a local build. Signing and Desktop distribution remain future work. The [permission page](../cua/README.md) offers macOS prompts and app revocation; packaged Desktop permission attribution remains deferred. +- Native binaries require a local build; the package payload includes the prepared helper. The [permission page](../cua/README.md) offers macOS prompts and app revocation. - Persistent PTC is an external dependency assumption, not an implementation in this package. Real-model task success requires separate evaluation beyond native and protocol fixtures. ----- diff --git a/packages/experimental/cua-macos/README.zh.md b/packages/experimental/cua-macos/README.zh.md index fa93d7cbb5..c852478dc3 100644 --- a/packages/experimental/cua-macos/README.zh.md +++ b/packages/experimental/cua-macos/README.zh.md @@ -9,7 +9,7 @@ kind: "package-reference" ## 概述 -检查 macOS 权限,选择运行中的应用和窗口,读取辅助功能树、截图并发送输入。外部持久执行环境可以保留这些对象。Swift 辅助进程直接使用 macOS 框架,并改写选取的 MIT 许可 Cua Driver 行为。本包不提供 PTC 运行时或变量持久化。 +检查 macOS 权限,选择运行中的应用和窗口,读取辅助功能树,从选定窗口截图并发送输入。外部持久执行环境可以保留这些对象。Swift 辅助进程直接使用 macOS 框架,并改写选取的 MIT 许可 Cua Driver 行为。本包不提供 PTC 运行时或变量持久化。 ## 目录 @@ -40,7 +40,7 @@ export DSH_CUA_HELPER="$cua_native_root/.build/release/dsh-cua-native" pnpm dsh headless --patch packages/experimental/cua-macos/examples/macos.cordis.yml --dump-config ``` -配置输出命令不发起模型请求。执行真实任务时,将 `--dump-config` 替换为任务提示,并配置该 profile 的模型凭据。配置挂载 computer-use 注册表和本 provider;使用前需移除已有的竞争 provider。负责执行的宿主或辅助进程需要辅助功能权限来读取 AX 和输入,需要屏幕录制权限来截图。`getCapabilities` 查询权限和锁屏状态,不弹出系统授权窗口。桌面会话锁定或不可用时,界面观察与输入会在分派前拒绝,需由用户解锁 macOS 后继续。`listApps` 和 `cua.getState` 列出运行中的应用。`findApps(query)` 按名称、bundle ID 或绝对路径搜索 macOS 标准应用目录。`getApp` 按唯一名称、bundle ID、路径或运行中的 PID 选择应用,取得应用许可后,在需要时后台启动尚未运行的应用。启动前先确认可执行文件身份,授权后在启动前后再次核对;未签名代码只能取得所选实例的会话许可。helper 等待应用完成启动后才返回其 PID。返回的对象读取初始 AX,不自动激活应用。启动被取消时,应用可能已经运行。模型指引要求先在后台观察和输入,不在初始化或每次动作前激活应用。窗口隐藏或最小化时,先尝试 `app.show()` 或 `window.show()`,再重新观察。它请求取消隐藏和恢复最小化,不主动激活、抬起窗口或切换桌面空间;应用级恢复选择焦点窗口、主窗口或唯一 AX 窗口。结果通过 `windowId` 指明选中的窗口,未选中时为 null;`foregroundChanged` 比较操作前后的前台应用和最上层窗口,无法取得完整观察时为 null,返回后仍可能发生焦点变化。恢复失败或窗口仍不可用时,说明需要前台的步骤,再调用 `app.activate()` 或窗口的 `raise` 动作并重新观察。必须使用前台时,以完成任务为先。应用收到输入后仍可能改变焦点,后台投递不保证用户操作始终不受干扰。 +配置输出命令不发起模型请求。执行真实任务时,将 `--dump-config` 替换为任务提示,并配置该 profile 的模型凭据。配置挂载 computer-use 注册表和本 provider;使用前需移除已有的竞争 provider。负责执行的宿主或辅助进程需要辅助功能权限来读取 AX 和输入,需要屏幕录制权限来截图。`getCapabilities` 查询运行时权限和锁屏状态,不弹出系统授权窗口;provider 会把它固定的平台能力加入模型可见结果。`sessionLocked` 为 null 表示未能确认存在可用的未锁定桌面会话;进行观察或输入前需确认桌面已解锁。`listApps` 和 `cua.getState` 列出运行中的应用。`findApps(query)` 按名称、bundle ID 或绝对路径搜索 macOS 标准应用目录。`getApp` 按唯一名称、bundle ID、路径或运行中的 PID 选择应用,取得应用许可后,在需要时后台启动尚未运行的应用。启动前先确认可执行文件身份,授权后在启动前后再次核对;未签名代码只能取得所选实例的会话许可。helper 等待应用完成启动后才返回其 PID。返回的对象静默读取初始 AX,不自动激活应用。启动被取消时,应用可能已经运行。模型指引要求先在后台观察和输入,不在初始化或每次动作前激活应用。窗口隐藏或最小化时,先尝试 `app.show()` 或 `window.show()`,再重新观察。它请求取消隐藏和恢复最小化,不主动激活、抬起窗口或切换桌面空间;应用级恢复选择焦点窗口、主窗口或唯一 AX 窗口。结果通过 `windowId` 指明选中的窗口,未选中时为 null;`foregroundChanged` 比较操作前后的前台应用和最上层窗口,无法取得完整观察时为 null,返回后仍可能发生焦点变化。恢复失败或窗口仍不可用时,说明需要前台的步骤,再调用 `app.activate()` 或窗口的 `raise` 动作并重新观察。必须使用前台时,以完成任务为先;应先说明需求,再显式调用激活,而不是假定用户会自行激活应用。应用收到输入后仍可能改变焦点,后台投递不保证用户操作始终不受干扰。 | 字段 | 默认值 | 含义 | | --- | --- | --- | @@ -59,23 +59,23 @@ pnpm dsh headless --patch packages/experimental/cua-macos/examples/macos.cordis. | `maxElements` / `maxDepth` | `2000` / `25` | 辅助功能树遍历限制。 | | `maxClickHoldMs` | `5000` | 显式点击按住时长的上限,单位为毫秒,接受非负整数。设为 0 时只允许立即松开。 | | `dragDurationMs` / `dragSteps` | `400` / `20` | 拖动时长和移动分段数。 | -| `textEventIntervalMs` | `0.25` | 每个 Unicode 按下或抬起事件后的间隔,范围为 0 至 1000 毫秒。组合键的节奏独立。 | +| `textEventIntervalMs` | `0.25` | 每个 Unicode 按下或抬起事件后的间隔,范围为 0 至 1000 毫秒。击键节奏独立。 | -[配置目录](../../../docs/config-catalog.zh.md#deepseek-aidsh-experimental-cua-macos)列出全部字段。原生工具调用使用 `{method, params}`,模型可以看到每个方法的完整参数定义。例如,`getApp` 返回 `listWindows`、`getState` 和输入操作所需的 `appHandle`。 +[配置目录](../../../docs/config-catalog.zh.md#deepseek-aidsh-experimental-cua-macos)列出全部字段。原生工具调用使用 `{method, params}`,模型可以看到每个方法的完整参数定义。`getApp` 返回每个面向应用的操作所需的 `appHandle`,`app.getWindow(windowId)` 返回负责截图和指针输入的对象。 -数字键盘名称(`KP_0` 到 `KP_9`、`KP_Enter` 和数字键盘运算键)保留独立的物理键码。组合键用 `+` 分隔修饰键与按键。加号键写作 `+`,Command 加号写作 `cmd++`,也可以使用键名 `plus`;`cmd+` 这类缺少按键的输入会被拒绝。 +`pressKey(key, modifiers?)` 按下并释放一个键。修饰键名称单独传入,例如 `pressKey('Tab', ['shift'])` 或 `pressKey('+')`;省略修饰键数组表示不按修饰键。macOS helper 接受 `command`/`cmd`、`shift`、`option`/`alt`、`control`/`ctrl` 和 `fn`,并映射到对应物理键。按键名由平台定义;数字键盘名称(`KP_0` 到 `KP_9`、`KP_Enter` 和数字键盘运算键)保留独立的物理键码。`typeText` 发送字面文本,包括其中的换行和制表符。 Agent 销毁和插件卸载会取消并等待完整工具调用,包括图像接入检查和附件存储。已经开始的图像写入必须结束后,销毁才会返回;已取消的调用不会返回成功截图。 CUA 工具在读取 AX、窗口标题、截图、激活和输入前检查应用授权。首次选择应用时询问用户,可选择本会话允许、拒绝;签名可验证的应用还可保存长期授权。会话许可按对话和应用身份持久化,重启 DSH 或关闭 Computer Use 后仍可复用,其他对话需要单独授权。已签名应用的身份由规范化可执行文件路径和代码签名指定要求组成;签名不可验证的应用仍绑定进程实例。拒绝后,同一会话不会反复询问。撤销与长期许可的保存共用队列,在队列内读取并移除许可,然后使相关 Agent 连接失效并等待原生清理完成,不自动重放输入。同一 Agent 连接中的其他应用也需要重新选择,其他应用的会话许可和长期许可仍可复用。设计理由见[应用授权决策](../../../.agents/notes/implemented/architecture/2026-09-26-cua-application-consent.zh.md)。这些检查的范围是 CUA 调用。persistent PTC 与已授权的 shell 仍按各自执行权限运行。 -原始 `getState` 操作返回经过校验的状态字段,以及按本次披露选项生成的完整文本。原生 helper 还返回供原生检查使用的结构化元素诊断数组;工具投影会从模型文本和结构化工具值中移除这份重复数组。 +原始 `getState` 操作返回经过校验的状态字段,以及按本次披露选项生成的完整文本。原生 helper 还返回供原生检查使用的结构化元素诊断数组,其中 `elementId` 是不透明字符串;工具投影会从模型文本和结构化工具值中移除这份重复数组。 -AX 观察默认只展示菜单栏入口。使用 `app.getAXState({ includeMenus: true })` 展开菜单内容,使用 `app.getAXState({ details: true })` 读取标识符、全局 point 坐标和完整动作名。原始 `getState` 和 AX/截图组合观察也接受这两个选项。每次观察都会替换该范围的元素编号,展开后应使用新输出中的编号。详情不会绕过配置的节点数和深度上限;截断提示会指明触发的上限。 +AX 观察默认只展示菜单栏入口。使用 `app.getAccessibilityTree({ includeMenus: true })` 展开菜单内容,使用 `app.getAccessibilityTree({ details: true })` 读取标识符、全局 point 坐标和完整动作名。原始 `getState` 也接受这两个选项。每次读取都会替换应用当前的快照;应使用该次读取返回的元素 ID。详情不会绕过配置的节点数和深度上限;截断提示会指明触发的上限。 实际值与占位文字分别展示。有名称、状态或可用动作的分组和滚动区域保留独立行。同一节点中重复的名称、描述和帮助只显示一次。实际值、占位文字和 URL 即使文字相同也保留各自含义,不删除不同节点共有的正文。相关控件明确展示可写性,包括 `AXIncrementor`;`unknown` 表示系统未报告。缺少可选状态字段不代表 false。超出当前值长度的 UTF-16 选区标为不可用。自定义动作简称省略 AppKit 的 target/selector 诊断信息;同名动作需要使用 `details:true` 返回的完整名称。 -观察方法默认自动输出,同时返回结果。在 persistent PTC 中使用 `void await app.getAXState()` 输出一次,或指定 `emit:false` 后自行打印一次。AX 输出后的截图可能单独失败,已成功取得的 AX 输出仍保留。 +观察方法默认自动输出,同时返回结果。在 persistent PTC 中使用 `void await app.getAccessibilityTree()` 输出一次,或指定 `emit:false` 后自行打印一次。AX 输出后的截图可能单独失败,已成功取得的 AX 输出仍保留。 截图诊断使用带工具请求 ID 的 `[cua-screenshot]` 记录。原生阶段记录经本次 Agent 连接返回,覆盖窗口及 AX 几何检查、系统截图、PNG/Base64 编码和响应写出。Host 调试日志补充发送、响应和清理耗时。每次请求最多保留 8192 字节完整诊断记录,超限会明确标记;截图失败时附在错误中,保留到 Session trace。记录只含阶段、耗时和错误码,不含窗口标题、AX 正文或图片内容。 @@ -89,14 +89,17 @@ AX 观察默认只展示菜单栏入口。使用 `app.getAXState({ includeMenus: import { connectCua } from '@deepseek-ai/dsh-cua/bridge' const cua = connectCua(() => tools.cua, text => console.log(text)) const app = await cua.getApp("com.apple.TextEdit") -void await app.getScreenshot() +const windows = await app.getWindows() +if (windows.length === 0) throw new Error("Open a TextEdit window first") +const window = await app.getWindow(windows[0].windowId) +void await window.getScreenshot() ``` -单窗口任务直接使用 app 方法。`getApp` 已读取初始 AX,截图不需要枚举窗口或额外读取 AX。任务需要指定窗口或默认选窗存在歧义时,再调用 `app.getWindows()` 和 `app.getWindow(windowId)`,根据观察到的标题与位置选择目标。 +使用 `cua` API 发现并选择应用(`listApps`、`getState`、`findApps`、`getApp`);使用选定的应用来激活它、枚举其窗口并选择窗口。截图和指针输入都要求选择窗口,不只在存在多个窗口时才需要。`getApp` 和 `app.getWindow(windowId)` 静默读取初始树;根据观察到的标题与位置选择窗口。 -`getWindow` 会输出初始 AX 树。已确认归属但没有 AX 界面的窗口返回空快照,仍可截图和发送坐标输入。不同窗口分别保留快照,读取一个窗口不会使另一个窗口失效;重新读取同一范围会使旧索引失效。观察期间节点被移除时,该次读取返回 `STALE_SNAPSHOT`,不发布部分树;可以重新读取,但不要重复此前的输入。应用级截图和坐标操作复用最近一次 AX 观察:优先使用其中在屏幕上且尺寸非零的焦点窗口,否则要求只有一个符合条件的窗口。它们不会重新查询即时焦点;需要跟随焦点变化时,先读取 `app.getAXState()`。显式窗口对象保持选定的目标。键盘方法保留在 `app` 上,因为输入跟随应用的当前焦点。 +`getWindow` 静默读取初始树。已确认归属但没有 AX 界面的窗口返回空快照,仍可截图和发送坐标输入。在单个 API 实例内,门面按应用句柄保存一份当前辅助功能快照,该句柄的所有应用对象和窗口对象共享它,包括重复选择。读取任一窗口都会替换该快照;元素操作使用最新快照 ID,因此应使用最新树中的元素 ID,不应假定旧 ID 仍指向同一控件。读取失败不会发布部分快照;可以重新读取,但不要重复此前的输入。窗口对象负责截图和指针输入。键盘方法保留在 `app` 上,因为输入跟随应用的当前焦点。 -`hover(target)` 优先通过控件声明的 AX 动作展开替代界面,不移动系统鼠标。进入展开区域的子控件时保持父控件展开,离开后恢复默认界面。没有这条路径时,再将可见系统鼠标移到 AX 元素中心或窗口内坐标,不按鼠标按钮,也可用于禁用控件。所选应用必须在前台,且目标点未被遮挡,否则返回 `FOREGROUND_REQUIRED`,调用方需显式激活或抬起窗口并重新观察。调用结束、AX 读取和截图不恢复先前的位置。等待应用的悬停延迟后,观察出现的内容,再移入并点击;连续调用可经过中间位置。其他输入或应用自身变化可能中断交互。[连续交互的设计理由](../../../.agents/notes/implemented/architecture/2026-10-13-cua-continuous-hover.zh.md)。 +`mouseMove(target)` 优先通过控件声明的 AX 动作展开替代界面,不移动系统鼠标。进入展开区域的子控件时保持父控件展开,离开后恢复默认界面。没有这条路径时,该方法将可见系统鼠标移到 AX 元素中心或窗口内坐标,不按鼠标按钮,也可用于禁用控件。所选应用必须在前台,且目标点未被遮挡,否则返回 `FOREGROUND_REQUIRED`,调用方需显式激活或抬起窗口并重新观察。调用结束、AX 读取和截图不恢复先前的位置。等待应用的悬停延迟后,观察出现的内容,再移入并点击;连续调用可经过中间位置。其他输入或应用自身变化可能中断交互。[连续交互的设计理由](../../../.agents/notes/implemented/architecture/2026-10-13-cua-continuous-hover.zh.md)。 `paste(text, { format: "text" | "html" })` 临时提供指定格式的剪贴板内容,并调用应用已启用的标准 Paste 菜单命令。临时格式保留到剪贴板读取方请求其数据,然后只在仍持有剪贴板时恢复保存的全部原格式,保留期间产生的新复制内容。粘贴操作共用跨进程锁,取消会等待辅助进程清理。强制终止进程可能阻止恢复。应用不支持 Paste 命令时明确失败,不自动改成逐字输入;`typeText` 仍单独提供按键事件输入。 @@ -104,13 +107,13 @@ void await app.getScreenshot() 截图要求附件服务可用,并确认当前模型支持图片输入。共享附件接入校验规范 Base64、图像数据及配置容量,然后保存一次图片。程序调用方仍可取得原生数据,模型内容包含坐标元数据和持久图片引用。响应字节上限在解析前执行。 -hover、click、scroll 和 drag 的绝对坐标默认使用最近返回截图中的像素。传入 `relative: true` 时使用0~999 的千分比整数;省略或传入 `false` 时使用像素。相对坐标可基于成功的 AX 读取或截图,绝对坐标必须先截图。Host 根据实际送入模型的图片尺寸换算原生 point,包含附件归一化和模型请求阶段的缩放。999 映射到窗口边缘以内。坐标选项不适用于 AX 元素索引。窗口宽高与最近一次观察不同时,在输入前返回 `WINDOW_CHANGED`,原始调用即使不传快照 ID 也会检查;重新读取 AX 或截图后再操作。单纯移动窗口不使窗口内坐标失效。截图和鼠标输入会核对所选窗口的辅助功能框与显示边界;已知两者不一致时,在发送任何鼠标事件前返回 `WINDOW_CHANGED`。当 AX 保留完整窗口框时,这也会拦住 Stage Manager 变换后的窗口。需要重新读取状态;激活应用或抬起窗口仍须显式调用。元素声明的 AX 动作保持可用。缺少 AX 几何时保留无 AX 路径,不代表变换后的窗口一定可以操作。 +`mouseMove`、`click` 和 `drag` 的绝对坐标使用 `[x, y]` 元组;`scroll` 使用命名的 `x` 和 `y`。它们都使用最近返回截图中的像素。传入 `relative: true` 时使用 0~999 的千分比整数;省略或传入 `false` 时使用像素。相对坐标可基于成功的 AX 读取或截图,绝对坐标必须先截图。Host 根据实际送入模型的图片尺寸换算原生 point,包含附件归一化和模型请求阶段的缩放。999 映射到窗口边缘以内。坐标选项不适用于元素 ID。窗口宽高与最近一次观察不同时,在输入前返回 `WINDOW_CHANGED`,即使原始坐标调用不传快照 ID 也会检查;重新读取 AX 或截图后再操作。单纯移动窗口不使窗口内坐标失效。截图和鼠标输入会核对所选窗口的辅助功能框与显示边界;已知两者不一致时,在发送任何鼠标事件前返回 `WINDOW_CHANGED`。当 AX 保留完整窗口框时,这也会拦住 Stage Manager 变换后的窗口。需要重新读取状态;激活应用或抬起窗口仍须显式调用。元素声明的 AX 动作保持可用。缺少 AX 几何时保留无 AX 路径,不代表变换后的窗口一定可以操作。 保留的对象会在每次调用时获取当前工具绑定。外部运行时负责持久化、导入、取消和最终表达式值的序列化。截图返回编码字节及其 MIME 类型、像素尺寸和窗口 ID,标准工具链负责将图片作为附件传递一次。`emit: false` 只控制对象层的输出。使用其他分派器的宿主可以通过 `./api` 的 `createCuaApi` 创建对象。 AppKit sheet 可以通过其窗口 ID 单独选择,也会出现在所属文档窗口的控件树中。只有应用当前获得焦点的 sheet 指向唯一的 Apple 面板服务窗口,且该服务仍聚焦于同一面板时,键盘输入才转交系统打开或保存面板。无法确认或存在歧义的远端接收方会在输入前报错。 -元素索引支持右键或中键单击以及左键单击、双击。点击和拖动选项可指定按键与修饰键;带修饰键的点击使用指针输入。拖动期间保持指定按键,并在移动和释放事件中携带修饰键。AX 文本标明禁用控件、`valueWritable=true` 和可读取的 `selected` 状态。不带修饰键的点击优先使用元素声明的辅助功能动作;需要发送鼠标事件时,会重新读取元素位置并核实所属窗口。动作返回只表示输入已分派。可视指针或点击标记可以独立绘制;AX 动作无需移动系统指针。窗口定向鼠标输入仍可能改变应用焦点、选区或对话框。输入后需要读取状态确认结果。`STALE_APP` 需要重新获取应用,`STALE_SNAPSHOT` 需要重新读取 AX。请求超时或取消会等待原生停止确认,保留仍可用的句柄;无法确认清理完成时关闭该 Agent 的连接。未返回系统回调的截图 RPC 占用唯一捕获槽位,新截图立即返回 `CAPTURE_BUSY`,AX 和输入仍可使用。迟到图片被丢弃,真实回调结束后释放槽位。只有操作无法停止或清理失败时,才可能使共享进程及所有旧句柄失效。不能自动重试结果不确定的输入。关闭 Agent 会释放其连接和 AX 引用,但不会撤销应用中的修改。 +元素点击使用当前快照中的不透明元素 ID。左键支持单击或双击;右键和中键支持单击。点击和拖动选项可指定按键与修饰键名称;带修饰键的点击使用指针输入。拖动期间保持指定按键,并在移动和释放事件中携带修饰键。AX 文本标明禁用控件、`valueWritable=true` 和可读取的 `selected` 状态。不带修饰键的点击优先使用元素声明的辅助功能动作;需要发送鼠标事件时,会重新读取元素位置并核实所属窗口。动作返回只表示输入已分派。可视指针或点击标记可以独立绘制;AX 动作无需移动系统指针。窗口定向鼠标输入仍可能改变应用焦点、选区或对话框。输入后需要读取状态确认结果。`STALE_APP` 需要重新获取应用,`STALE_SNAPSHOT` 需要重新读取 AX。请求超时或取消会等待原生停止确认,保留仍可用的句柄;无法确认清理完成时关闭该 Agent 的连接。未返回系统回调的截图 RPC 占用唯一捕获槽位,新截图立即返回 `CAPTURE_BUSY`,AX 和输入仍可使用。迟到图片被丢弃,真实回调结束后释放槽位。只有操作无法停止或清理失败时,才可能使共享进程及所有旧句柄失效。不能自动重试结果不确定的输入。关闭 Agent 会释放其连接和 AX 引用,但不会撤销应用中的修改。 ----- @@ -120,13 +123,13 @@ AppKit sheet 可以通过其窗口 ID 单独选择,也会出现在所属文档
操作分派与资源归属 -对象接口将应用和窗口方法转换为 JSON 操作。适配模块通过标准工具链保留授权、嵌套日志和图片接入。同一用户的相同 helper 构建由多个 Agent 和 Host 共享。每条连接独立保存句柄、快照、配置和取消状态,桌面操作通过全局队列执行。受管启动器将服务生命期交给这些连接,最后一条连接清理完成后服务退出。进程锁覆盖构建身份及真实可执行路径,防止重复启动或覆盖运行版本后产生路径冲突。原生句柄绑定进程身份及内核启动时间,快照中的 AX 引用只保存在辅助进程内。未来平台可以实现相同操作协议,无需在对象接口中加入平台逻辑。 +对象接口将应用和窗口方法转换为 JSON 操作。在单个 API 实例内,它按应用句柄保存一份当前辅助功能快照;原生 helper 在该门面之后保留自己的应用快照和可选窗口快照。适配模块通过标准工具链保留授权、嵌套日志和图片接入。同一用户的相同 helper 构建由多个 Agent 和 Host 共享。每条连接独立保存句柄、快照、配置和取消状态,桌面操作通过全局队列执行。受管启动器将服务生命期交给这些连接,最后一条连接清理完成后服务退出。进程锁覆盖构建身份及真实可执行路径,防止重复启动或覆盖运行版本后产生路径冲突。原生句柄绑定进程身份及内核启动时间,快照中的 AX 引用只保存在辅助进程内。 [Zod 操作定义](../cua/src/protocol.ts)负责模型参数,并单独声明 Host 资源字段和内部续接操作。公共数据类型从这些定义推导。`pnpm exec tsx packages/experimental/cua-macos/native/generate-protocol.ts` 生成原生 JSON Schema 和 Swift 字段、枚举校验表;包测试检查产物是否同步,并验证模型不能提交 Host 专属字段。原生目标验证、资源上限和操作行为仍在执行处检查。 -[AX 文本格式化](native/Sources/CuaNative/AXTextFormatter.swift)只接收已读取的节点数据。AX 遍历器独自分配索引并保存原生引用,格式化不维护另一套快照或目标注册表。 +[AX 文本格式化](native/Sources/CuaNative/AXTextFormatter.swift)只接收已读取的节点数据。AX 遍历器独自分配不透明元素 ID 并保存原生引用,格式化不维护另一套快照或目标注册表。 -原生请求 ID 与工具日志中的调用 ID 一致。成功的激活和窗口抬起操作会在原始工具结果中保留前台操作信息,以及操作前后的即时焦点观察。应用已在前台时跳过重复激活;窗口抬起还要求该窗口正是焦点主窗口、未最小化且位于可见普通窗口的最前方,才会跳过。无法确认时保留原请求。这些观察不能确认其他焦点切换的发起者,也不代表操作已经完成。 +原生请求 ID 与工具日志中的调用 ID 一致。成功的激活操作会在原始工具结果中保留前台操作信息,以及操作前后的即时焦点观察。应用已在前台时跳过重复激活。无法确认时保留原请求。这些观察不能确认其他焦点切换的发起者,也不代表操作已经完成。 每次观察在同一批 AX 请求中读取节点角色和元数据。组节点和滚动区域节点只提供子节点,未使用的元数据错误不会导致它们被拒绝。不支持批量读取时保留逐个属性读取。AX 遍历对每个原生身份只访问一次,包括表示同一元素的不同代理引用,避免循环子节点重复展开整个子树。[源码清单](native/upstream.json)记录改写的上游行为和本地 Swift 模块。AppKit 使用主事件循环,独立串行执行器持有 AX 引用并发送同步输入。一条请求在截图和结果发送期间仍独占执行。本包不发布 invariant 入口,因为没有需要对照的独立注册表投影或持久执行器状态。协议验证、目标身份和资源清理由对应实现负责。 @@ -155,54 +158,54 @@ AppKit sheet 可以通过其窗口 ID 单独选择,也会出现在所属文档 ##### 操作指导文本(原文) ```markdown -Use cua with method getCapabilities and params {} to inspect permissions and sessionLocked. If sessionLocked is true or an operation reports SESSION_LOCKED, stop UI attempts and ask the user to unlock the desktop session. A null sessionLocked means no usable console session was verified. After unlocking, read fresh state; screenshots from a locked desktop are not current observations. Use listApps or cua.getState to discover running applications, and findApps(query) to search installed applications by name or application path. getApp requests user consent before launching a stopped application in the background, or before observations and input on a running one. If access is denied or revoked, stop using that application until the user explicitly permits another authorization request. Never switch tools to bypass a refusal. Keep the returned appHandle; every app operation requires it. listWindows returns window IDs and bounds in the provider’s native units. Raw getState returns AX text and snapshotId. Menu-bar entries are shown by default; includeMenus=true expands their contents. details=true adds identifiers, global native bounds and complete action names. Both options also apply to getAXState. Each read replaces the indices for that app/window scope. Use its element indices only with that snapshotId. Raw screenshot and coordinate operations require a windowId. Coordinates are pixels in the latest returned screenshot, measured from its top-left. Set relative:true for integer thousandths from 0 to 999 instead. The Host converts both modes to native window coordinates; AX detail bounds remain global native coordinates. A verified window can expose no AX elements. Its empty snapshot permits screenshots and coordinate input; element-index actions require an element from a fresh AX observation. +macOS: accessibility tree operations are available at app or window level. Simulated keyboard input is available at app level. Simulated mouse input is available at window level. getApp also accepts bundle IDs and .app paths, and findApps searches /Applications, /System/Applications, and ~/Applications. Accessibility and Screen Recording permissions belong to the responsible launching application; use the Computer Use permission page to request access, open System Settings, and check again. Native window and AX bounds use macOS points, while delivered screenshots carry their own pixel dimensions. show does not switch Spaces, and Stage Manager can present reduced window geometry; explain any required foreground step before activate or raise. -Initialize the object API once in persistent PTC. Reuse its variables in later calls; put temporary declarations inside { ... } blocks to avoid redeclaration errors. All object methods are async. getAXState returns text, not a structured state object. Its text separates values and placeholders, and reports subroles, help, URLs, disabled/focused/selected/expanded state and UTF-16 selection ranges when available. Writability is true, false or unknown on relevant controls; omitted state fields do not assert false. selection=unavailable means the reported range exceeds the observed text. Compact output omits ordinary Press/Pick (click), ShowMenu (right click) and ScrollToVisible actions; details=true lists every available action. Use the displayed action name with performSecondaryAction; ambiguous aliases require the complete name from details=true. Truncation reports the reached provider limit. Narrow the window or increase that provider limit before reading again. +Use cua to observe and operate native applications. Always use cua.getCapabilities() to confirm whether a specific API is available on the current platform; its reported capabilities take precedence over availability statements in these instructions. All methods are async; observation options default to { emit: true }, and emit: false suppresses sink output only, leaving returned values unchanged. Actions report dispatch evidence, not verified completion. If sessionLocked is true or an operation reports SESSION_LOCKED, stop UI actions and ask the user to unlock the desktop session; null or unknown means verify a usable unlocked desktop session first. cua.getApp requests user consent; if access is denied or revoked, stop using that application until the user explicitly permits another request, and never bypass a refusal or switch tools to avoid it. Never replay uncertain input without a fresh observation. -Use app methods directly for single-window tasks; getApp already reads initial AX state. Call app.getWindows() and await app.getWindow(windowId) only to target a particular window or resolve ambiguous window selection. App screenshots and coordinate actions use the latest AX observation: its focused on-screen, nonzero-size window, otherwise the sole such window. They do not refresh focus automatically. Read app.getAXState() to follow changed focus. +In persistent PTC, use the host-provided bridge initialization once and retain the returned objects; cua comes from that bridge and is not a preinstalled global. Use void await for observations that emit, and never stringify screenshot image bytes. -CuaScreenshot contains { bytes: Uint8Array, mimeType: "image/png" | "image/jpeg" | "image/webp" | "image/gif", pixelWidth: number, pixelHeight: number, windowId: number }. Use mimeType to choose a file extension or declare an image; do not assume PNG. +Signatures show resolved return values after await. ActionResult = { dispatched: boolean, foregroundChanged?: boolean | null }; foregroundChanged is omitted when not sampled and null when the sample is unavailable. JsonValue = string | number | boolean | null | JsonValue[] | { [key: string]: JsonValue }; numbers must be finite. App is the application object with readonly app.appHandle: string (opaque) and the methods listed below for app level. Window is the window object with readonly window.windowId: number and the methods listed below for window level. Neither object carries pid. -Object API signatures (options default to { emit: true }): +Setup and discovery: +- cua.getCapabilities(options?: { emit?: boolean }) -> { platform: string, permissions: { accessibility: boolean, screenRecording: boolean }, appLevelAccessibility: boolean, keyboard: ('app' | 'window')[], sessionLocked: boolean | null, methods: string[], coordinateSpace: 'screenshot-pixels', browser: false } — inspect reported permissions, sessionLocked, methods, and keyboard scopes without requesting permissions. +- cua.listApps(options?: { emit?: boolean }) -> { id: string, displayName: string, isRunning: true, pid: number }[] — enumerate running applications. +- cua.findApps(query: string, options?: { emit?: boolean }) -> ({ id: string, displayName: string, path: string } & ({ isRunning: true, pid: number } | { isRunning: false }))[] — search installed applications, including stopped matches; only running matches carry pid. +- cua.getState(options?: { emit?: boolean }) -> { apps: { id: string, displayName: string, isRunning: true, pid: number }[], browsers: [] } — summarize running applications; this is not an accessibility observation. +- cua.getApp(selector: string) -> App — select an application by name, bundle ID, absolute path, or running PID string, obtain consent, launch in the background if needed, and read initial AX state silently; it does not activate the app. +- app.getWindows(options?: { emit?: boolean }) -> { windowId: number, appName: string, title: string, bounds: { x: number, y: number, width: number, height: number }, isOnScreen: boolean, onCurrentSpace: boolean | null }[] — enumerate windows with global native bounds; null onCurrentSpace means unknown Space membership. +- app.getWindow(windowId: number) -> Window — select one window and read its initial AX state silently; do this before any window screenshot or coordinate input. +- app.activate() -> ActionResult — request explicit foreground activation; use only when foreground access is required. +- app.show() -> { dispatched: boolean, windowId: number | null, foregroundChanged: boolean | null } — unhide the app and restore its selected, focused, main, or sole window without activation. +- window.show() -> { dispatched: boolean, windowId: number | null, foregroundChanged: boolean | null } — unhide and restore that explicit window without activation. -- cua.getCapabilities(options?) -> { platform, permissions, sessionLocked, methods, coordinateSpace, browser } -- cua.listApps(options?) -> Array<{ id, displayName, isRunning: true, pid }> -- cua.findApps(query: string, options?) -> Array<{ id, displayName, path, isRunning, pid? }> -- cua.getState(options?) -> { apps, browsers: [] } -- cua.getApp(selector: string) -> App -- app.activate() -> { dispatched: true, verified: false } -- app.getWindows(options?) -> Array<{ windowId, pid, appName, title, bounds, isOnScreen, onCurrentSpace }> -- app.getWindow(windowId: number) -> Window -- app.typeText(text: string), app.pressKey(chord: string) -> action result -- app.paste(text: string, options?: { format?: "text" | "html" }) -> action result +## Accessibility tree +Available at app or window level depending on the platform. -App and Window methods: +Element ids are opaque strings from the latest successful tree; the object facade keeps one current snapshot per app across its repeated app and window objects, a new read replaces it, and a failed read invalidates the previous one. Repeated strings can appear for different elements, so do not reuse an old id blindly, and element operations do not fall back to pointer input or typing. +- getAccessibilityTree(options?: { emit?: boolean, includeMenus?: boolean, details?: boolean, disableDiffing?: boolean }) -> string — read the full tree text; includeMenus expands menu contents and details adds identifiers, native bounds, and complete action names. +- listActions(elementId: string) -> string[] — list the actions an element advertises. +- invoke(elementId: string) -> ActionResult — invoke the element's default action; dispatched is false when it has none. +- performAction(elementId: string, action: string, argument?: JsonValue) -> ActionResult — perform an observed action with an optional direct JSON argument. +- setValue(elementId: string, value: JsonValue) -> ActionResult — write a control value. +- selectText(elementId: string, text: string, options?: { prefix?: string, suffix?: string, selectionType?: 'text' | 'cursor_before' | 'cursor_after' }) -> ActionResult — select one literal occurrence or place the cursor beside it, using adjacent context to disambiguate. -- show() -> { dispatched: true, verified: false, windowId: number | null, foregroundChanged: boolean | null } -- getAXState(options?: { emit?: boolean, disableDiffing?: boolean, includeMenus?: boolean, details?: boolean }) -> string -- getScreenshot(options?: { emit?: boolean }) -> CuaScreenshot -- getAXStateAndScreenshot(options?) -> { state: string, screenshot: CuaScreenshot } -- click(target: number | [x, y], options?: { mouseButton?: "left" | "right" | "middle", clickCount?: 1 | 2, holdMs?: number, modifiers?: Array<"command" | "control" | "option" | "shift" | "fn">, relative?: boolean }) -> action result -- hover(target: number | [x, y], options?: { relative?: boolean }) -> { dispatched, verified, hoverRoute, systemPointerMoved } -- setValue(elementIndex: number, value: string) -> action result -- selectText(elementIndex: number, text: string, options?: { prefix?: string, suffix?: string, selectionType?: "text" | "cursor_before" | "cursor_after" }) -> action result -- performSecondaryAction(elementIndex: number, action: string) -> action result -- scroll({ x, y, deltaLinesX, deltaLinesY, relative? }) -> action result -- drag(from: [x, y], to: [x, y], options?: { mouseButton?: "left" | "right" | "middle", modifiers?: Array<"command" | "control" | "option" | "shift" | "fn">, relative?: boolean }) -> action result +## Simulated mouse +Available at app or window level depending on the platform. +- getScreenshot(options?: { emit?: boolean }) -> { bytes: Uint8Array, mimeType: 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif', pixelWidth: number, pixelHeight: number, windowId: number } — capture the selected window as one encoded image; bytes is a JavaScript byte array, and mimeType identifies its encoding, so do not assume PNG. +- mouseMove(target: string | [number, number], options?: { relative?: boolean }) -> { dispatched: boolean, foregroundChanged?: boolean | null, hoverRoute: 'accessibility' | 'system-pointer', systemPointerMoved: boolean } — reveal AX alternate UI or move the system pointer without pressing; inspect hoverRoute and systemPointerMoved, and expect no automatic pointer restoration. +- click(target: string | [number, number], options?: { mouseButton?: 'left' | 'right' | 'middle', clickCount?: 1 | 2, modifiers?: ('command' | 'control' | 'option' | 'shift' | 'fn')[], holdMs?: number, relative?: boolean }) -> ActionResult — click an element id or point, or perform a left-button double-click; holdMs controls the press duration of each press. +- scroll(options: { x: number, y: number, deltaLinesX: number, deltaLinesY: number, relative?: boolean }) -> ActionResult — scroll at a point; deltas are integers from -10 to 10 with at least one nonzero, and positive values reveal content above or left. +- drag(from: [number, number], to: [number, number], options?: { mouseButton?: 'left' | 'right' | 'middle', modifiers?: ('command' | 'control' | 'option' | 'shift' | 'fn')[], relative?: boolean }) -> ActionResult — drag between two points of one window. -Raw operation tools use { method, params }, including params: {} for parameterless methods. getApp selects without activating the app. Keep applications in the background for observation and actions that the provider supports without foreground access. Do not activate or raise an app during initialization, before each action, or merely because another app is foreground. Prefer advertised AX actions. If a window is hidden or minimized, try app.show() or window.show() and read fresh state. show requests unhide and unminimize without activation or raising; it chooses the explicit, focused, main or sole AX window. A null windowId means no window was selected for restoration. foregroundChanged compares the front app and top window before and after the request; null means unavailable, and delayed focus changes remain possible. If restoration is unsupported or the window remains unusable, explain the needed foreground step, use app.activate() or an advertised raise action, and read fresh state. Completing the task takes priority when foreground access is necessary. Avoid repeated activation when the user switches away; continue background-capable steps and report what requires foreground access. Applications may still change focus in response to input. +A string target is an element id; coordinate targets are [x, y] and are pixels in the latest returned screenshot by default. With relative: true they are integer thousandths of the window width and height from 0 to 999, based on the current AX observation or screenshot. Left clicks support one or two presses; right and middle clicks support one. FOREGROUND_REQUIRED means explain the need, then explicitly activate or raise and observe again; activation is never automatic. Read fresh state after actions, and treat WINDOW_CHANGED, STALE_SNAPSHOT, and SCREENSHOT_REQUIRED as requiring the stated fresh observation or capture before any retry. -Await operations sequentially. After input, read fresh state to verify the effect. A successful action means dispatched, not verified completion. Cancellation may leave partial effects; never retry uncertain input without observing. STALE_APP requires getApp again; STALE_SNAPSHOT requires getState again. Absolute coordinate input requires a fresh screenshot of that window. Relative input can use a successful AX observation or screenshot. SCREENSHOT_REQUIRED means capture a fresh screenshot before using pixel coordinates. For coordinate input, targets must be [x, y], for example click([650, 400], {relative:true}). A bare number such as click(650) is always an AX element index. The relative option applies only to coordinate targets, not AX indices. Window resizing since the latest observation rejects coordinate input; movement alone preserves window-local coordinates. WINDOW_CHANGED requires fresh state before any retry; use an advertised AX action or explicitly restore the window before screenshot or coordinate input, then observe again. PERMISSION_DENIED requires the user to address the reported system access restriction. After granting access, observe fresh state before continuing; do not automatically replay prior input. +## Simulated keyboard +Available at app or window level depending on the platform. +- typeText(text: string) -> ActionResult — type literal text at the app's current focus; line endings send Return and tabs send Tab. +- paste(text: string, options?: { format?: 'text' | 'html' }) -> ActionResult — deliver text or HTML through the app's Paste command, restoring prior clipboard contents unless another writer changes them; a Paste failure is surfaced without substituting typeText, and PASTE_NOT_CONSUMED means inspect before any retry. +- pressKey(key: string, modifiers?: string[]) -> ActionResult — press and release one complete keystroke. For example pressKey('Tab', ['shift']) or pressKey('+'). Key and modifier names are platform-defined strings. Pass key and modifiers separately; do not pack them into a chord string. -Hover reveals alternate UI through a provider-supported accessibility action or moves the system pointer without pressing a button. Wait for the application's hover delay and observe before clicking; subsequent observations do not restore the pointer. Use successive hover calls for intermediate points. Other input and application changes can interrupt the interaction. click accepts optional holdMs, a nonnegative integer in milliseconds for each press, including double-click presses. Zero releases without an additional hold. The configured maximum is stated below. Explicit holdMs uses pointer input even for AX targets; omission preserves ordinary clicks. The operation deadline applies, and cancellation or timeout releases the button. - -Use selectText only on controls advertising selectionWritable. It selects a unique literal occurrence, or places the cursor before/after it; prefix and suffix must be immediately adjacent. AMBIGUOUS_TEXT requires more context; TEXT_NOT_FOUND or SELECTION_CHANGED requires a fresh observation before deciding on input. Left clicks support single/double clicks; right and middle clicks support single clicks. Modified clicks use pointer input. Keypad names such as KP_0 and KP_Enter retain their physical key identity. Window objects expose observation and pointer/AX actions; keyboard input remains app-scoped and follows current focus. Scroll deltas are integer lines from -10 to 10; positive values reveal content above or left. Paste delivers plain text or HTML through the system clipboard and the application's paste action. Original clipboard formats are restored if the clipboard still belongs to this paste; a later copy is preserved. Unsupported Paste commands fail without typing fallback. CLIPBOARD_CHANGED means another writer intervened; observe before deciding on further input. Browser applications can be controlled with getApp like other native apps; browser tabs are unavailable. Installed-app search covers the locations documented by the platform provider; use an absolute application path for another location. Launch does not restore a window or document, and cancellation may leave an application already started. The execution host must install the object API and own variable persistence; this plugin does not preload a cua global. In persistent PTC, use the host-provided initialization snippet below once. Its installation-owned file URL works independently of the project directory. Retain app objects between calls. Observation methods emit by default and also return their value. Use void await app.getAXState() to avoid a duplicate REPL completion, or pass emit:false and print the returned text once. End screenshot calls with void await app.getScreenshot() or void await app.getAXStateAndScreenshot() so image bytes are not serialized as the program completion value. - -macOS: getApp also accepts bundle IDs and .app paths. findApps searches /Applications, /System/Applications and ~/Applications. Accessibility and Screen Recording permissions belong to the responsible launching application. Use the Computer Use permission page to request access, open System Settings, and check again. Native window and AX bounds use macOS points. show does not switch Spaces. Stage Manager can present reduced window geometry; explain any required foreground step before activate or raise. - -Hover first uses advertised AX alternate UI without moving the system cursor, preserving revealed descendants until the pointer target leaves their region. The system-pointer fallback requires the target point to be unobscured in the foreground app. FOREGROUND_REQUIRED requires explicit activation or raising and a fresh observation before retrying. - -Paste delivers plain text or HTML through the application's enabled standard Paste menu command. Paste follows the target app's focused text input. Foreground requirements vary by application; for example, ChatGPT/Codex was observed to accept background Paste without reading clipboard data. PASTE_NOT_CONSUMED means the command was dispatched but no clipboard read was observed before the configured deadline. Inspect the target contents, explicitly activate the app and focus the intended input, then observe again before deciding whether to retry; a delayed paste may still run. +Raw tools use { method, params }: include appHandle for app calls and windowId for window calls, and use snapshotId with elementId for element routes. Object options such as emit and disableDiffing are facade-only: emit is local output control and neither is a raw RPC parameter, so raw callers must follow the raw operation schema for admitted params. getAccessibilityTree and getWindow read through raw getState; getWindows maps to listWindows; getScreenshot maps to screenshot; cua.getState maps to listApps; every other named operation uses the same method name. ``` #### Token 影响 @@ -219,12 +222,12 @@ Paste delivers plain text or HTML through the application's enabled standard Pas -- 本提供方仅支持 macOS,并保持实验性状态。不支持浏览器标签、AX 差分、无法确认应用归属的系统面板,以及仅后台辅助类型的应用。 +- 元素 ID 只对应用当前的辅助功能快照有效;之后的读取会替换它们。截图和指针输入都要求显式的窗口对象。 - 坐标使用包含标题栏的返回截图像素;`relative: true` 使用千分比整数,由 Host 换算原生 point。窗口移动、应用变化及其他桌面使用者的操作可能与观察和输入交错。 - macOS 台前调度可能将后台窗口的尺寸与截图变为缩略图,当前无法保证这种状态下的完整画面与坐标输入;模型指引要求说明前台需求并避免反复抢回焦点。 - 后台输入依赖私有 SkyLight 符号,macOS 升级可能使其不可用,需在目标系统版本验证。 - 实测 Blender Unicode 输入曾出现分派成功但界面未显示文本,后台 AppKit 的 Command+A 曾未选中全文。输入后必须检查应用状态;工具返回成功只表示已分派。 -- 原生二进制需要本地构建,签名和桌面分发留待后续。[权限页面](../cua/README.zh.md)提供 macOS 申请入口和应用授权撤销;桌面安装包的权限归属留待后续处理。 +- 原生二进制需要本地构建;发布包包含准备好的 helper。[权限页面](../cua/README.zh.md)提供 macOS 申请入口和应用授权撤销。 - 持久 PTC 是对外部运行环境的假设,本包不实现它。真实模型任务成功率需要在原生测试和协议测试之外单独评估。 ----- diff --git a/packages/experimental/cua-macos/native/README.i18n.yaml b/packages/experimental/cua-macos/native/README.i18n.yaml index b25c409fb1..daba8a6e03 100644 --- a/packages/experimental/cua-macos/native/README.i18n.yaml +++ b/packages/experimental/cua-macos/native/README.i18n.yaml @@ -9,8 +9,8 @@ en: dd53c24d4b95e89e zh: 361d6704c41a155f /dsh-cua-native-helper/summary: - en: 9aeb574bf09a3de2 - zh: 7df2def6acb71ac3 + en: 77932e97f4675ccd + zh: 7ea800f4f0b3a45d /dsh-cua-native-helper/table-of-contents: en: e8cbc43d38786c40 zh: 52b3ba85d98011b9 @@ -18,14 +18,14 @@ en: 02b25ac1126b6094 zh: 3995a1f46354531b /dsh-cua-native-helper/request-protocol: - en: c8ad13843989b314 - zh: 2a42acb2faee8803 + en: f5b0cad954cf1939 + zh: c6ebeefee87e4eeb /dsh-cua-native-helper/observation-and-input: - en: c527eedc3a0ee968 - zh: ce8cc12d5a62e8ae + en: 63c20ce51bd55a9c + zh: 84d44a8b20d02a0f /dsh-cua-native-helper/verification: - en: a2ac6f2d581a1e8b - zh: f82c7d0c13539421 + en: 5404db2d1bbfc14f + zh: d19ceb000d1e3522 /dsh-cua-native-helper/further-exploration: en: 265e1927952ce6d7 zh: 7c35d9fd98b6e6c8 diff --git a/packages/experimental/cua-macos/native/README.md b/packages/experimental/cua-macos/native/README.md index b44d6a65f4..7e412743b9 100644 --- a/packages/experimental/cua-macos/native/README.md +++ b/packages/experimental/cua-macos/native/README.md @@ -9,7 +9,7 @@ English | [中文](README.zh.md) ## Summary -This macOS 14+ JSON-lines helper uses Swift 6, AppKit, Accessibility, CoreGraphics and ScreenCaptureKit. Windows support is in development. It adapts selected MIT-licensed Cua Driver behavior without loading an external driver. `upstream.json` records the fixed upstream version, adapted Swift files and local modules; `LICENSE.cua-driver` preserves the MIT notice. +This macOS 14+ JSON-lines helper uses Swift 6, AppKit, Accessibility, CoreGraphics and ScreenCaptureKit. It adapts selected MIT-licensed Cua Driver behavior without loading an external driver. `upstream.json` records the fixed upstream version, adapted Swift files and local modules; `LICENSE.cua-driver` preserves the MIT notice. ## Table of Contents @@ -39,18 +39,20 @@ Operation frames remain `{ "id": "opaque request id", "method": "method name", " Screenshot diagnostics use `type: "diagnostic"` frames on the originating connection. Records contain requestId, stage, elapsedMs since receipt and optional errorCode, without window titles, AX text or image bytes. The stdin/stdout proxy forwards them to stderr with `[cua-screenshot]`; operation replies remain on stdout. The Host retains a bounded diagnostic buffer and includes it in screenshot failures. -Successful `activate` and `performSecondaryAction` AXRaise results include `foreground` alongside `{dispatched: true, verified: false}`. It records `requestId`, `operation`, `targetPid`, nullable `targetWindowId`, `activationRequested`, `raiseRequested`, and immediate `before`/`after` observations. `frontPid` comes from WindowServer; `focusedWindowId` is the target app's AX-focused window; `frontWindowId` and `frontWindowPid` identify the first visible normal window. Unknown values are null. Observations are sequential, not atomic or proof of causality. Tool-owned requests use the logged tool call ID. Failed operations retain the existing error response and may have partial effects. +Successful `activate` results include `foreground` alongside `{dispatched: true}`. It records `requestId`, `operation`, `targetPid`, nullable `targetWindowId`, `activationRequested`, `raiseRequested`, and immediate `before`/`after` observations. `frontPid` comes from WindowServer; `focusedWindowId` is the target app's AX-focused window; `frontWindowId` and `frontWindowPid` identify the first visible normal window. Unknown values are null. Observations are sequential, not atomic or proof of causality. Tool-owned requests use the logged tool call ID. Failed operations retain the existing error response and may have partial effects. | Method | Result | | --- | --- | -| `getCapabilities` | `{platform: "macos", permissions: {accessibility, screenRecording}, sessionLocked, methods, coordinateSpace: "window-points", browser: false}`. Permission values are boolean preflight observations; no system prompt opens. | +| `getCapabilities` | `{permissions: {accessibility, screenRecording}, sessionLocked}`. Permission values are boolean preflight observations; no system prompt opens. The TypeScript provider merges its static startup fields (`platform`, `methods`, `appLevelAccessibility`, `keyboard`, `browser`, `coordinateSpace`) before exposing the result. | | `listApps` | Array of `{pid, name, bundleId}` for running regular applications. | | `findApps` | Installed matches `{id, displayName, path, isRunning, pid?}` from standard application directories or an absolute application path; discovery never launches them. | -| `getApp` | `{appHandle, pid, name, bundleId, authorization}` selected by exact name, bundle ID, decimal PID or application path. A stopped selection has `pid: null` and waits for Host consent. Ambiguous names fail. | +| `getApp` | Running selection returns `{appHandle, pid, name, bundleId?, running: true, authorization}`. A stopped selection returns `{appHandle, name, bundleId?, running: false, authorization}` with no `pid`, and waits for Host consent. Ambiguous names fail. | | `launchApp` | Host-only continuation after consent; starts the selected application without requesting activation, waits for launch completion and binds the handle to its verified process identity. | -| `listWindows` | Owned normal windows with `{windowId, pid, appName, title, bounds, isOnScreen, onCurrentSpace}`. Space membership can be null. | -| `getState` | `{appHandle, pid, windowId, focusedWindowId, snapshotId, tree, elements, windows, truncated}`. `windowId` is null for an app-wide observation. Elements include index, role, title, value, description, identifier, bounds, actions, and enabled state. Element bounds are null or [x, y, width, height] in screen points; window input uses local points. These structured element diagnostics are retained by native checks and omitted by the model tool projection. Unavailable optional descriptive properties are null, and an unavailable action list is empty; permission, communication and window-discovery failures still reject the observation. | -| `hover`, `click`, `setValue`, `selectText`, `typeText`, `paste`, `pressKey`, `scroll`, `drag` | `{dispatched: true, verified: false}` records native dispatch. Read fresh state to verify the intended application change. | +| `listWindows` | Owned normal windows with `{windowId, appName, title, bounds, isOnScreen, onCurrentSpace}`. Space membership can be null. | +| `getState` | `{appHandle, windowId, focusedWindowId, snapshotId, tree, elements, windows, truncated}`. `windowId` is null for an app-wide observation. Elements include the opaque string `elementId`, role, title, value, description, identifier, bounds, actions, and enabled state. Element bounds are null or [x, y, width, height] in screen points; window input uses local points. These structured element diagnostics are retained by native checks and omitted by the model tool projection. Unavailable optional descriptive properties are null, and an unavailable action list is empty; permission, communication and window-discovery failures still reject the observation. | +| `listActions` | Provider-defined action names for one element as a string array; an element may advertise none. | +| `show` | `{dispatched: boolean, windowId, foregroundChanged}` records restoration dispatch. `windowId` is null when no window was selected; `foregroundChanged` is null when the sampled observation was unavailable. | +| `invoke`, `performAction`, `mouseMove`, `click`, `setValue`, `selectText`, `typeText`, `paste`, `pressKey`, `scroll`, `drag` | `{dispatched: boolean}` records native dispatch; `invoke` reports false when no applicable default action exists. `mouseMove` also reports `hoverRoute` and `systemPointerMoved`. Read fresh state to verify the intended application change. | | `screenshot` | `{mimeType: "image/png", data, pixelWidth, pixelHeight, bounds, coordinateSpace: "window-points", windowId}`. PNG pixel dimensions can differ from window point dimensions on Retina displays. | Every app-targeted operation requires `appHandle` from `getApp` in the same helper. The helper pins the PID and kernel process start time, and invalidates the handle and all of its snapshots after process exit or PID reuse. Calling `getApp` can acquire the replacement process without reactivating old handles. A random per-helper namespace prevents handles from a terminated helper matching those of its replacement. Repeated acquisition of the same live process shares its handle. @@ -67,7 +69,7 @@ Protocol declarations are generated from [the shared protocol](../../cua/src/pro ## Observation and input -`getState` optionally scopes AX traversal to an owned window or nested sheet `windowId`. A new or failed refresh invalidates the previous snapshot for that app/window scope, while other window scopes remain usable. When an owned CG window has no matching AX surface, getState returns a new snapshot with empty tree/elements and no truncation; its coordinates and screenshots remain available. It rechecks process lifetime, window ownership, the unlocked session and Accessibility permission after traversal. Window-discovery APIDisabled and communication errors remain failures; unsupported or absent optional AX attributes can produce an empty observation. Missing or foreign-owned windows never produce an empty success. An AX element invalidated during traversal rejects the whole read with `STALE_SNAPSHOT`; no partial snapshot is published. Callers may read again after the application changes, without repeating input. Element actions require the exact snapshot ID. Native references never cross JSON. An optional snapshot ID on coordinate actions must belong to that window or an app-wide observation. Window-list refresh releases snapshots for closed windows. Native process identity, snapshot generation, and window ownership checks do not lock the desktop against simultaneous user or application changes. +`getState` optionally scopes AX traversal to an owned window or nested sheet `windowId`. A new or failed refresh invalidates the previous snapshot for that app/window scope, while other window scopes remain usable. When an owned CG window has no matching AX surface, getState returns a new snapshot with empty tree/elements and no truncation; its coordinates and screenshots remain available. It rechecks process lifetime, window ownership, the unlocked session and Accessibility permission after traversal. Window-discovery APIDisabled and communication errors remain failures; unsupported or absent optional AX attributes can produce an empty observation. Missing or foreign-owned windows never produce an empty success. An AX element invalidated during traversal rejects the whole read with `STALE_SNAPSHOT`; no partial snapshot is published. Callers may read again after the application changes, without repeating input. Raw element targets require `appHandle`, `snapshotId`, and an opaque string `elementId`; coordinate actions require `windowId` and may include a snapshot ID from that window or an app-wide observation. Native references never cross JSON. Window-list refresh releases snapshots for closed windows. Native process identity, snapshot generation, and window ownership checks do not lock the desktop against simultaneous user or application changes. Element clicks without holdMs prefer advertised AX actions and otherwise use pointer delivery. Coordinate click, scroll and drag validate window ownership and bounds, then use background PID/window-directed primitives. Each event uses SkyLight when available, otherwise the public PID-targeted API. A posted event is never repeated through the other API. Coordinates are macOS points from the top-left of the entire window, including its title bar. Positive `deltaLinesY` reveals content above; negative reveals below. Positive `deltaLinesX` reveals content left; negative reveals right. Each axis accepts an integer from -10 to 10, and at least one must be nonzero. The helper sends line-unit scroll events directly. Click and drag accept left/right/middle buttons and command/control/option/shift/fn modifiers. Only left clicks support double-click. Modified element clicks use pointer delivery. Drag uses one button press/move/release in one window; callers explicitly supply durationMs (1..5000) and steps (1..240). The movement delay budget is divided with fractional precision across the segments; fixed press/release settling and scheduler latency are additional. No implicit fallback sends global desktop input. @@ -75,25 +77,25 @@ Element clicks without holdMs prefer advertised AX actions and otherwise use poi Capture and pointer delivery read CG bounds before and after an exact-window AX frame query. Movement during the query returns WINDOW_CHANGED. Valid AX/CG frames must have equal outward-rounded integral point rectangles; a known mismatch returns WINDOW_CHANGED before mouse movement, priming or button delivery. The helper preserves both coordinate sources rather than substituting AX geometry for CG geometry. Missing or unusable AX geometry remains unknown, while AX communication, permission and invalid-element errors propagate. Capture without Accessibility permission retains its CG/SCK checks. Advertised AX actions bypass this pointer preflight; an AX action error does not trigger pointer input. These reads do not lock the window against later movement, and no geometry check activates or raises it. -`typeText` and `pressKey` target the selected process's current focused control, not an exact window. Key chords send PID-targeted modifier transitions before the base key and release modifiers in reverse order; these events do not use the global HID queue. Background pointer actions may change that keyboard focus. Keypad names such as KP_0 and KP_Enter preserve their physical key codes. Text injection sends Unicode characters individually and does not use the clipboard. LF, CR and CRLF send one Return; tabs send Tab. Applications apply their normal editing behavior, including indentation and focus navigation. Each down/up event is followed by the configured text interval; dispatch completion does not confirm that the receiving application consumed every event. Cancellation can interrupt text or a gesture after partial input; it cannot undo received events. Very long text can exceed the host's operation deadline. Validate observed application state before deciding how to continue. +`typeText` and `pressKey` target the selected process's current focused control, not an exact window. `pressKey` presses and releases one key while holding its `modifiers` array, sends PID-targeted modifier transitions, and releases those modifiers in reverse order; these events do not use the global HID queue. Key names are platform-defined; keypad names such as `KP_0` and `KP_Enter` preserve their physical key codes. Background pointer actions may change that keyboard focus. Text injection sends Unicode characters individually and does not use the clipboard. LF, CR and CRLF send one Return; tabs send Tab. Applications apply their normal editing behavior, including indentation and focus navigation. Each `typeText` down/up event is followed by the configured text interval; `pressKey` keeps its own press and release timing, and dispatch completion does not confirm that the receiving application consumed every event. Cancellation can interrupt text or a gesture after partial input; it cannot undo received events. Very long text can exceed the host's operation deadline. Validate observed application state before deciding how to continue. The responsible host/helper needs macOS Accessibility permission for AX state and input, and Screen Recording permission for screenshots. Capability preflight and permission errors do not grant permissions. Capture refuses a window that moves or resizes while the image is being read. Unassociated system panels and accessory-only applications are not selectable. -Host-only permission controls are `permissionStatus {}`, `requestPermission {permission}`, and `openPermissionSettings {permission}`, where permission is `accessibility` or `screenRecording`. They are excluded from model tools and from `getCapabilities.methods`. Permission status includes observed helper/parent process paths; these paths do not identify the TCC responsible application. The operating-system prompt names the application and asks for the user’s decision. The helper identifies the responsible process with the optional libSystem SPI `responsibility_get_pid_responsible_for_pid`, then captures its application name and icon before publishing readiness. The function is resolved dynamically, following the same signature used by [Chromium](https://chromium.googlesource.com/chromium/src/+/refs/tags/134.0.6998.28/base/process/process_info_mac.mm). If the symbol, process, or application metadata is unavailable, attribution stays unknown; it is not inferred from the nearest GUI ancestor. Permission checks remain independent of this metadata. +Host-only permission controls are `permissionStatus {}`, `requestPermission {permission}`, and `openPermissionSettings {permission}`, where permission is `accessibility` or `screenRecording`. They are excluded from model tools and from the provider's advertised methods. Permission status includes observed helper/parent process paths; these paths do not identify the TCC responsible application. The operating-system prompt names the application and asks for the user’s decision. The helper identifies the responsible process with the optional libSystem SPI `responsibility_get_pid_responsible_for_pid`, then captures its application name and icon before publishing readiness. The function is resolved dynamically, following the same signature used by [Chromium](https://chromium.googlesource.com/chromium/src/+/refs/tags/134.0.6998.28/base/process/process_info_mac.mm). If the symbol, process, or application metadata is unavailable, attribution stays unknown; it is not inferred from the nearest GUI ancestor. Permission checks remain independent of this metadata. Observation reads each non-layout node’s descriptive properties and children through `AXUIElementCopyMultipleAttributeValues`. Per-attribute errors retain the individual-read rules; unsupported batch APIs use individual reads. Values are retained only during that observation, and input reads live attributes. Application state can change between nodes; a batch does not make the whole tree atomic. System file-panel keyboard routing resolves the remote recipient through the selected app’s focused AX sheet. Only Apple’s Open and Save Panel Service is accepted, and its focused ancestry must still contain the identified remote window. Element pointer fallbacks resolve an app-owned window or sheet through AX parents when AXWindow is unavailable. Ordinary clicks retain AX action priority over pointer input; visual click markers need no system-cursor movement. -Request modifier arrays accept command/control/option/shift/fn. The object API normalizes key-chord aliases before dispatch. +Keyboard modifier names are plain strings. The shared object API passes the names through unchanged; the macOS helper accepts `command`/`cmd`, `shift`, `option`/`alt`, `control`/`ctrl`, and `fn`, and rejects an unknown name with `INVALID_ARGUMENT`. It does not parse chord strings. -`selectText` requires a fresh element snapshot and writable AXSelectedTextRange. It matches one literal occurrence, narrowed by immediately adjacent prefix/suffix, and selects text or places the cursor before/after it. Matching and reported ranges use UTF-16 offsets. Ambiguous or missing text fails; the helper rechecks the value and selected range without rewriting content. AX text includes available writable, disabled, selected and selection-range information; AXAccess owns indices and native references while AXTextFormatter renders the observed values. +`selectText` requires a fresh element snapshot and writable AXSelectedTextRange. It matches one literal occurrence, narrowed by immediately adjacent prefix/suffix, and selects text or places the cursor before/after it. Matching and reported ranges use UTF-16 offsets. Ambiguous or missing text fails; the helper rechecks the value and selected range without rewriting content. AX text includes available writable, disabled, selected and selection-range information; AXAccess owns element IDs and native references while AXTextFormatter renders the observed values. `paste` publishes one plain-text or HTML clipboard format, dispatches the application's enabled standard Paste menu command, and waits for a clipboard data request. It then restores the preserved formats only while its ownership marker and change count still match. The Host serializes its pastes across helpers with a file lock. maxClipboardBytes bounds both input and preserved contents; unsupported menus and oversized data fail before dispatch. A later copy is preserved. Cancellation restores owned clipboard data when possible; forced termination cannot guarantee restoration, and a data request does not prove the target completed editing. After dispatch, `pasteReadTimeoutMs` bounds waiting for clipboard consumption. Expiry returns `PASTE_NOT_CONSUMED`, closes the promised data provider, and restores the original clipboard only while still owned. The failure does not prove the app will never process its queued Paste command; inspect the target before deciding whether to retry. -`hover` accepts an observed element index or a window-local point and never presses a mouse button. Disabled controls may be hovered. No request completion, AX read or screenshot restores the previous point; subsequent hover calls can enter revealed content. Click sends its button events at the target without an off-window priming click. Individual requests are serialized, but no application is reserved between calls. Other input or application changes can interrupt the interaction. +`mouseMove` accepts an observed element ID or a window-local point and never presses a mouse button. Disabled controls may be hovered. No request completion, AX read or screenshot restores the previous point; subsequent mouseMove calls can enter revealed content. Click sends its button events at the target without an off-window priming click. Individual requests are serialized, but no application is reserved between calls. Other input or application changes can interrupt the interaction. -`hover` first uses a same-window element or ancestor advertising both `AXShowAlternateUI` and `AXShowDefaultUI`. Revealed descendants retain the parent UI; leaving restores it once. An AX action failure propagates without trying another input route. Without an applicable AX route, hover moves the visible system cursor through the system input queue after checking the foreground PID and AppKit mouse hit testing at the point. Input-transparent windows and transparent regions do not block the target. A failed check returns `FOREGROUND_REQUIRED` without moving the cursor. The result identifies `hoverRoute` as `accessibility` or `system-pointer` and reports `systemPointerMoved`. Hover does not activate, raise or restore focus. Other input or window changes can race the check and dispatch. +`mouseMove` first uses a same-window element or ancestor advertising both `AXShowAlternateUI` and `AXShowDefaultUI`. Revealed descendants retain the parent UI; leaving restores it once. An AX action failure propagates without trying another input route. Without an applicable AX route, the method moves the visible system cursor through the system input queue after checking the foreground PID and AppKit mouse hit testing at the point. Input-transparent windows and transparent regions do not block the target. A failed check returns `FOREGROUND_REQUIRED` without moving the cursor. The result identifies `hoverRoute` as `accessibility` or `system-pointer` and reports `systemPointerMoved`. The method does not activate, raise or restore focus. Other input or window changes can race the check and dispatch. ----- @@ -107,7 +109,7 @@ Run `python3 packages/experimental/cua-macos/native/tests/shared_helper_e2e.py - Run `python3 packages/experimental/cua-macos/native/tests/launcher_identity_e2e.py --helper /absolute/helper` in a GUI login session to verify a Launch Services application that starts a nested GUI launcher and then the helper. The helper identifies the outer responsible application and retains its name and icon after the launchers exit. This check owns both applications and the helper, cleans up its Launch Services registrations, and does not request Accessibility or Screen Recording access. -Run `python3 packages/experimental/cua-macos/native/tests/axless_e2e.py` after building and unlocking the Mac to verify an owned window whose application removes and later restores its AX roots. The check requires existing Accessibility/Screen Recording grants, rejects stale element indices, captures the AXless window, verifies a coordinate click in the fixture state file, and checks restoration. It never changes system permission settings. +Run `python3 packages/experimental/cua-macos/native/tests/axless_e2e.py` after building and unlocking the Mac to verify an owned window whose application removes and later restores its AX roots. The check requires existing Accessibility/Screen Recording grants, rejects stale element IDs, captures the AXless window, verifies a coordinate click in the fixture state file, and checks restoration. It never changes system permission settings. Run `python3 packages/experimental/cua-macos/native/tests/observation_benchmark.py --reference-helper /absolute/reference --candidate-helper /absolute/candidate --artifacts /private/evidence` to compare complete observations of the same owned AppKit window with 35 and 400 synthetic rows. Each helper receives one warmup and three alternating measured requests. All result fields must match except helper-generated app and snapshot IDs. The report keeps raw timings, byte counts, hashes and replies; it sets no CI speed threshold and makes no memory claim. Fixture startup can activate the application. Run without other desktop automation or compilation jobs. diff --git a/packages/experimental/cua-macos/native/README.zh.md b/packages/experimental/cua-macos/native/README.zh.md index ecefb9c879..285266f9e5 100644 --- a/packages/experimental/cua-macos/native/README.zh.md +++ b/packages/experimental/cua-macos/native/README.zh.md @@ -9,7 +9,7 @@ kind: "package-reference" ## 摘要 -该 JSON-lines 辅助程序支持 macOS 14 及以上,使用 Swift 6、AppKit、辅助功能、CoreGraphics 和 ScreenCaptureKit。Windows 支持正在开发中。程序改写了 MIT 许可的 Cua Driver 部分行为,不加载外部驱动。`upstream.json` 记录固定的上游版本、改写的 Swift 文件和本地模块;`LICENSE.cua-driver` 保留 MIT 声明。 +该 JSON-lines 辅助程序支持 macOS 14 及以上,使用 Swift 6、AppKit、辅助功能、CoreGraphics 和 ScreenCaptureKit。程序改写了 MIT 许可的 Cua Driver 部分行为,不加载外部驱动。`upstream.json` 记录固定的上游版本、改写的 Swift 文件和本地模块;`LICENSE.cua-driver` 保留 MIT 声明。 ## 目录 @@ -39,18 +39,20 @@ AppKit 在主事件循环上运行。阻塞式 socket 接收与握手使用后 截图诊断通过原始连接发送 `type: "diagnostic"` 帧。记录包含 requestId、stage、从接收开始计算的 elapsedMs 和可选的 errorCode,不含窗口标题、AX 文本或图片字节。stdin/stdout 代理在 stderr 上以 `[cua-screenshot]` 前缀转发诊断,操作回复仍写入 stdout。Host 保留有上限的诊断缓冲区,并将其附在截图失败中。 -成功的 `activate` 和 `performSecondaryAction` AXRaise 结果在 `{dispatched: true, verified: false}` 之外包含 `foreground`,记录 `requestId`、`operation`、`targetPid`、可空的 `targetWindowId`、`activationRequested`、`raiseRequested` 和即时的 `before`/`after` 观察。`frontPid` 来自 WindowServer,`focusedWindowId` 为目标应用的 AX 焦点窗口,`frontWindowId` 和 `frontWindowPid` 标识最前面的可见普通窗口。未知值为 null。观察依次取得,不具备原子性,也不证明因果关系。工具发起的请求使用日志中的工具调用 ID。失败操作保留原有错误响应,可能已产生部分效果。 +成功的 `activate` 结果在 `{dispatched: true}` 之外包含 `foreground`,记录 `requestId`、`operation`、`targetPid`、可空的 `targetWindowId`、`activationRequested`、`raiseRequested` 和即时的 `before`/`after` 观察。`frontPid` 来自 WindowServer,`focusedWindowId` 为目标应用的 AX 焦点窗口,`frontWindowId` 和 `frontWindowPid` 标识最前面的可见普通窗口。未知值为 null。观察依次取得,不具备原子性,也不证明因果关系。工具发起的请求使用日志中的工具调用 ID。失败操作保留原有错误响应,可能已产生部分效果。 | 方法 | 结果 | | --- | --- | -| `getCapabilities` | `{platform: "macos", permissions: {accessibility, screenRecording}, sessionLocked, methods, coordinateSpace: "window-points", browser: false}`。权限值是布尔型预检结果,不打开系统提示。 | +| `getCapabilities` | `{permissions: {accessibility, screenRecording}, sessionLocked}`。权限值是布尔型预检结果,不打开系统提示。TypeScript provider 在暴露结果前合并其静态启动字段(`platform`、`methods`、`appLevelAccessibility`、`keyboard`、`browser`、`coordinateSpace`)。 | | `listApps` | 运行中的普通应用数组,元素为 `{pid, name, bundleId}`。 | | `findApps` | 从标准应用目录或绝对应用路径返回已安装匹配项 `{id, displayName, path, isRunning, pid?}`;发现过程不启动应用。 | -| `getApp` | 按精确名称、bundle ID、十进制 PID 或应用路径选择,返回 `{appHandle, pid, name, bundleId, authorization}`。未运行的选择具有 `pid: null`,等待 Host 授权。名称歧义会失败。 | +| `getApp` | 运行中的选择返回 `{appHandle, pid, name, bundleId?, running: true, authorization}`。未运行的选择返回 `{appHandle, name, bundleId?, running: false, authorization}`,其中没有 `pid`,并等待 Host 授权。名称歧义会失败。 | | `launchApp` | 授权后的 Host 专用续接操作;不请求激活,等待应用启动完成后将句柄绑定到已核实的进程身份。 | -| `listWindows` | 应用所属普通窗口,包含 `{windowId, pid, appName, title, bounds, isOnScreen, onCurrentSpace}`。Space 归属可为 null。 | -| `getState` | `{appHandle, pid, windowId, focusedWindowId, snapshotId, tree, elements, windows, truncated}`。应用级观察的 `windowId` 为 null。元素包含 index、role、title、value、description、identifier、bounds、actions 和 enabled 状态。元素边界为 null 或屏幕 point 单位的 [x, y, width, height],窗口输入使用局部 point。这些结构化元素诊断供原生检查保留,模型工具投影会移除它们。不可用的可选描述属性为 null,无法取得的动作列表为空;权限、通信和窗口发现失败仍会拒绝观察。 | -| `hover`, `click`, `setValue`, `selectText`, `typeText`, `paste`, `pressKey`, `scroll`, `drag` | `{dispatched: true, verified: false}` 记录原生分派。需要读取新状态以核实预期的应用变化。 | +| `listWindows` | 应用所属普通窗口,包含 `{windowId, appName, title, bounds, isOnScreen, onCurrentSpace}`。Space 归属可为 null。 | +| `getState` | `{appHandle, windowId, focusedWindowId, snapshotId, tree, elements, windows, truncated}`。应用级观察的 `windowId` 为 null。元素包含不透明字符串 `elementId`、role、title、value、description、identifier、bounds、actions 和 enabled 状态。元素边界为 null 或屏幕 point 单位的 [x, y, width, height],窗口输入使用局部 point。这些结构化元素诊断供原生检查保留,模型工具投影会移除它们。不可用的可选描述属性为 null,无法取得的动作列表为空;权限、通信和窗口发现失败仍会拒绝观察。 | +| `listActions` | 一个元素由 provider 定义的动作名数组;元素可以不声明任何动作。 | +| `show` | `{dispatched: boolean, windowId, foregroundChanged}` 记录恢复分派。未选中窗口时 `windowId` 为 null;无法取得采样观察时 `foregroundChanged` 为 null。 | +| `invoke`, `performAction`, `mouseMove`, `click`, `setValue`, `selectText`, `typeText`, `paste`, `pressKey`, `scroll`, `drag` | `{dispatched: boolean}` 记录原生分派;`invoke` 在没有可用的默认动作时返回 false。`mouseMove` 还报告 `hoverRoute` 和 `systemPointerMoved`。需要读取新状态以核实预期的应用变化。 | | `screenshot` | `{mimeType: "image/png", data, pixelWidth, pixelHeight, bounds, coordinateSpace: "window-points", windowId}`。Retina 显示器上 PNG 像素尺寸可能不同于窗口 point 尺寸。 | 每个面向应用的操作都要求使用同一 helper 的 `getApp` 返回的 `appHandle`。helper 固定 PID 和内核进程启动时间,进程退出或 PID 被复用后使句柄及其全部快照失效。再次调用 `getApp` 可取得替代进程,不会重新激活旧句柄。随机的 helper 命名空间防止已终止 helper 的句柄与替代实例重合。重复获取同一存活进程会共享句柄。 @@ -67,7 +69,7 @@ AppKit 在主事件循环上运行。阻塞式 socket 接收与握手使用后 ## 观察与输入 -`getState` 可将 AX 遍历限定到应用所属窗口或嵌套 sheet 的 `windowId`。新的刷新或失败的刷新使同一应用/窗口范围的旧快照失效,其他窗口范围仍可使用。应用所属 CG 窗口没有匹配 AX 界面时,getState 返回空 tree/elements、truncated 为 false 的新快照,仍可截图和坐标输入。遍历后重新检查进程生命期、窗口归属、会话未锁定及辅助功能权限。窗口发现中的 APIDisabled 和通信错误仍会失败;不支持或缺失的可选 AX 属性可以产生空观察。不存在或属于其他应用的窗口不会返回空成功结果。遍历中 AX 元素失效会以 `STALE_SNAPSHOT` 拒绝整次读取,不发布部分树。应用变化后可以重新观察,但不重复输入。元素动作要求精确的快照 ID,原生引用不跨 JSON 传递。坐标动作的可选快照 ID 必须属于该窗口或应用级观察。刷新窗口列表会释放已关闭窗口的快照。进程身份、快照代次和窗口归属检查不会锁住桌面,用户或应用仍可同时改变状态。 +`getState` 可将 AX 遍历限定到应用所属窗口或嵌套 sheet 的 `windowId`。新的刷新或失败的刷新使同一应用/窗口范围的旧快照失效,其他窗口范围仍可使用。应用所属 CG 窗口没有匹配 AX 界面时,getState 返回空 tree/elements、truncated 为 false 的新快照,仍可截图和坐标输入。遍历后重新检查进程生命期、窗口归属、会话未锁定及辅助功能权限。窗口发现中的 APIDisabled 和通信错误仍会失败;不支持或缺失的可选 AX 属性可以产生空观察。不存在或属于其他应用的窗口不会返回空成功结果。遍历中 AX 元素失效会以 `STALE_SNAPSHOT` 拒绝整次读取,不发布部分树。应用变化后可以重新观察,但不重复输入。原始元素目标要求 `appHandle`、`snapshotId` 和不透明字符串 `elementId`;坐标动作要求 `windowId`,并可携带属于该窗口或应用级观察的快照 ID。原生引用不跨 JSON 传递。刷新窗口列表会释放已关闭窗口的快照。进程身份、快照代次和窗口归属检查不会锁住桌面,用户或应用仍可同时改变状态。 未指定 holdMs 的元素点击优先使用声明的 AX 动作,否则通过鼠标事件发送。坐标点击、滚动和拖动核实窗口归属和边界后,使用后台 PID/窗口定向输入。事件优先使用 SkyLight,不可用时使用公开的 PID 定向 API;已发送的事件不通过另一 API 重发。坐标是整个窗口左上角起算的 macOS point,包含标题栏。`deltaLinesY` 为正时显示上方内容,为负时显示下方内容;`deltaLinesX` 为正时显示左侧内容,为负时显示右侧内容。每个轴接受 -10 到 10 的整数,至少一个轴非零。helper 直接发送按行计量的滚轮事件。点击和拖动支持左、右、中键及 command/control/option/shift/fn 修饰键,只有左键支持双击。带修饰键的元素点击使用鼠标输入。拖动在一个窗口中完成一次按下、移动、抬起,调用方显式提供 durationMs(1..5000)和 steps(1..240)。移动延迟按小数精度分配到各段,按下和抬起的固定等待及调度延迟另计。不存在隐式改用全局桌面输入的后备路径。 @@ -75,25 +77,25 @@ AppKit 在主事件循环上运行。阻塞式 socket 接收与握手使用后 截图和鼠标输入在精确窗口的 AX 边界查询前后读取 CG 边界,查询期间移动会返回 WINDOW_CHANGED。有效的 AX/CG 边界向外取整后必须一致;已知不一致会在移动、预备事件或按键发送前返回 WINDOW_CHANGED。helper 保留两个坐标来源,不用 AX 几何替换 CG 几何。缺失或无效的 AX 几何仍表示未知,AX 通信、权限和无效元素错误继续传递。无辅助功能权限的截图保留 CG/SCK 检查。声明的 AX 动作不经过鼠标预检,AX 动作失败也不改用鼠标输入。这些读取不会锁住窗口以阻止后续移动,几何检查不激活或抬起窗口。 -`typeText` 和 `pressKey` 面向所选进程当前获得焦点的控件,不指定窗口。组合键先向 PID 发送修饰键变化,再发送主键,并逆序释放修饰键,不使用全局 HID 队列。后台鼠标操作可能改变键盘焦点。KP_0 和 KP_Enter 等数字键盘名称保留物理键码。文本逐个 Unicode 字符输入,不使用剪贴板。LF、CR 和 CRLF 发送一次 Return,制表符发送 Tab。应用保留缩进和焦点导航等正常编辑行为。每次按下和抬起后等待配置的文本事件间隔,分派完成不证明应用已消费全部事件。取消可能中断部分文本或手势,无法撤销已接收事件。很长的文本可能超过 Host 操作期限。继续输入前应核实应用状态。 +`typeText` 和 `pressKey` 面向所选进程当前获得焦点的控件,不指定窗口。`pressKey` 在按住所列 `modifiers` 时按下并释放一个键,先向 PID 发送修饰键变化,再发送主键,并逆序释放修饰键,不使用全局 HID 队列。按键名由平台定义;KP_0 和 KP_Enter 等数字键盘名称保留物理键码。后台鼠标操作可能改变键盘焦点。文本逐个 Unicode 字符输入,不使用剪贴板。LF、CR 和 CRLF 发送一次 Return,制表符发送 Tab。应用保留缩进和焦点导航等正常编辑行为。`typeText` 的每次按下和抬起后等待配置的文本事件间隔;`pressKey` 使用自己的按下与释放节奏,分派完成不证明应用已消费全部事件。取消可能中断部分文本或手势,无法撤销已接收事件。很长的文本可能超过 Host 操作期限。继续输入前应核实应用状态。 负责执行的 host/helper 需要 macOS 辅助功能权限以读取 AX 和输入,需要屏幕录制权限以截图。能力预检和权限错误不授予权限。截图会拒绝在读取图片期间移动或缩放的窗口。无法确认归属的系统面板及仅后台辅助类型的应用不可选择。 -仅供 Host 使用的权限操作为 `permissionStatus {}`、`requestPermission {permission}` 和 `openPermissionSettings {permission}`,其中 permission 为 `accessibility` 或 `screenRecording`。这些操作不出现在模型工具及 `getCapabilities.methods` 中。权限状态包含观察到的 helper 和父进程路径,这些路径不能确定 TCC 归属的应用。系统授权提示负责指出应用并询问用户决定。helper 使用可选的 libSystem 内部接口 `responsibility_get_pid_responsible_for_pid` 查询责任进程,在报告就绪前记录对应应用的名称和图标。接口通过动态加载解析,函数签名与 [Chromium](https://chromium.googlesource.com/chromium/src/+/refs/tags/134.0.6998.28/base/process/process_info_mac.mm) 使用的一致。符号、进程或应用信息不可用时,归属保持未知,不根据最近的 GUI 祖先推断。权限检查独立于这些信息。 +仅供 Host 使用的权限操作为 `permissionStatus {}`、`requestPermission {permission}` 和 `openPermissionSettings {permission}`,其中 permission 为 `accessibility` 或 `screenRecording`。这些操作不出现在模型工具及 provider 公布的方法中。权限状态包含观察到的 helper 和父进程路径,这些路径不能确定 TCC 归属的应用。系统授权提示负责指出应用并询问用户决定。helper 使用可选的 libSystem 内部接口 `responsibility_get_pid_responsible_for_pid` 查询责任进程,在报告就绪前记录对应应用的名称和图标。接口通过动态加载解析,函数签名与 [Chromium](https://chromium.googlesource.com/chromium/src/+/refs/tags/134.0.6998.28/base/process/process_info_mac.mm) 使用的一致。符号、进程或应用信息不可用时,归属保持未知,不根据最近的 GUI 祖先推断。权限检查独立于这些信息。 观察通过 `AXUIElementCopyMultipleAttributeValues` 读取每个非布局节点的描述属性和子节点。逐属性错误保留单独读取的规则;不支持批量 API 时使用单独读取。值只在本次观察期间保留,输入读取即时属性。应用状态可能在节点之间变化,批量读取不使整棵树具备原子性。 系统文件面板的键盘路由通过所选应用的 AX 焦点 sheet 解析远端接收方。只接受 Apple 的 Open and Save Panel Service,且其焦点祖先链仍须包含已识别的远端窗口。AXWindow 不可用时,元素鼠标后备路径沿 AX 父节点解析应用所属窗口或 sheet。普通点击保持 AX 动作优先,可视点击标记不需要系统鼠标移动。 -请求中的修饰键数组接受 command/control/option/shift/fn。对象 API 在分派前统一组合键别名。 +键盘修饰键名称是普通字符串。共享对象 API 原样传递名称;macOS helper 接受 `command`/`cmd`、`shift`、`option`/`alt`、`control`/`ctrl` 和 `fn`,未知名称返回 `INVALID_ARGUMENT`。它不解析组合键字符串。 -`selectText` 要求新近元素快照和可写 AXSelectedTextRange。它匹配唯一的字面文本,可用紧邻的 prefix/suffix 缩小范围,然后选中文本或将光标放在前后。匹配和返回范围采用 UTF-16 偏移。歧义或缺失文本会失败,helper 不改写内容,并重新核实值和选区。AX 文本包含可用的可写性、禁用状态、选中状态和选区信息;AXAccess 持有索引和原生引用,AXTextFormatter 渲染已观察的值。 +`selectText` 要求新近元素快照和可写 AXSelectedTextRange。它匹配唯一的字面文本,可用紧邻的 prefix/suffix 缩小范围,然后选中文本或将光标放在前后。匹配和返回范围采用 UTF-16 偏移。歧义或缺失文本会失败,helper 不改写内容,并重新核实值和选区。AX 文本包含可用的可写性、禁用状态、选中状态和选区信息;AXAccess 持有元素 ID 和原生引用,AXTextFormatter 渲染已观察的值。 `paste` 提供一种纯文本或 HTML 剪贴板格式,调用应用已启用的标准 Paste 菜单命令,并等待剪贴板数据请求。随后仅在所有权标记和修改计数仍匹配时恢复原有格式。Host 通过文件锁串行化不同 helper 的粘贴。maxClipboardBytes 同时限制输入和保留内容,不支持的菜单和过大的数据在分派前失败。后续复制会被保留。取消会尽可能恢复仍持有的剪贴板数据,强制结束不保证恢复,数据请求也不证明目标已完成编辑。 分派完成后,`pasteReadTimeoutMs` 限制等待剪贴板读取的时间。到期返回 `PASTE_NOT_CONSUMED`,关闭延迟数据提供方,并仅在仍持有剪贴板时恢复原内容。该失败不能证明应用以后不会处理已排队的 Paste 命令;决定是否重试前先检查目标内容。 -`hover` 接受已观察的元素索引或窗口内坐标,不按下鼠标按钮,也可用于禁用控件。调用结束、AX 读取和截图都不恢复原位置,后续 hover 调用可进入新出现的内容。点击只在目标位置发送按键事件,不先在窗口外点击。单次请求串行执行,不在调用之间保留应用。其他输入或应用变化可能中断交互。 +`mouseMove` 接受已观察的元素 ID 或窗口内坐标,不按下鼠标按钮,也可用于禁用控件。调用结束、AX 读取和截图都不恢复原位置,后续 mouseMove 调用可进入新出现的内容。点击只在目标位置发送按键事件,不先在窗口外点击。单次请求串行执行,不在调用之间保留应用。其他输入或应用变化可能中断交互。 -`hover` 优先查找同一窗口内声明了 `AXShowAlternateUI` 和 `AXShowDefaultUI` 的元素或祖先。进入展开区域的子控件时保留父控件界面,离开时恢复一次。AX 动作失败直接返回错误,不尝试其他输入路径。没有可用 AX 路径时,`hover` 核实前台 PID,并通过 AppKit 查询目标点实际接收鼠标输入的窗口后,使用系统输入队列移动可见鼠标。不接收鼠标输入的窗口和透明区域不会阻挡目标。检查失败返回 `FOREGROUND_REQUIRED`,不移动鼠标。结果中的 `hoverRoute` 标明 `accessibility` 或 `system-pointer`,`systemPointerMoved` 标明是否移动系统鼠标。悬停不激活、不抬起窗口,也不恢复焦点。其他输入或窗口变化可能与检查和分派交错。 +`mouseMove` 优先查找同一窗口内声明了 `AXShowAlternateUI` 和 `AXShowDefaultUI` 的元素或祖先。进入展开区域的子控件时保留父控件界面,离开时恢复一次。AX 动作失败直接返回错误,不尝试其他输入路径。没有可用 AX 路径时,该方法核实前台 PID,并通过 AppKit 查询目标点实际接收鼠标输入的窗口后,使用系统输入队列移动可见鼠标。不接收鼠标输入的窗口和透明区域不会阻挡目标。检查失败返回 `FOREGROUND_REQUIRED`,不移动鼠标。结果中的 `hoverRoute` 标明 `accessibility` 或 `system-pointer`,`systemPointerMoved` 标明是否移动系统鼠标。该方法不激活、不抬起窗口,也不恢复焦点。其他输入或窗口变化可能与检查和分派交错。 ----- @@ -107,7 +109,7 @@ AppKit 在主事件循环上运行。阻塞式 socket 接收与握手使用后 在 GUI 登录会话中运行 `python3 packages/experimental/cua-macos/native/tests/launcher_identity_e2e.py --helper /absolute/helper`,验证由 Launch Services 启动的应用先启动另一个 GUI 启动器,再启动 helper。helper 识别外层责任应用,并在启动器退出后保留其名称和图标。检查只使用测试自建的两个应用和 helper,结束后清理对应的 Launch Services 注册,不申请辅助功能或屏幕录制权限。 -构建并解锁 Mac 后运行 `python3 packages/experimental/cua-macos/native/tests/axless_e2e.py`,验证应用移除并恢复 AX 根节点的窗口。检查需要已有辅助功能/屏幕录制权限,会拒绝过期元素索引,捕获无 AX 窗口,通过 fixture 状态文件核实坐标点击,并检查恢复。不会修改系统权限设置。 +构建并解锁 Mac 后运行 `python3 packages/experimental/cua-macos/native/tests/axless_e2e.py`,验证应用移除并恢复 AX 根节点的窗口。检查需要已有辅助功能/屏幕录制权限,会拒绝过期元素 ID,捕获无 AX 窗口,通过 fixture 状态文件核实坐标点击,并检查恢复。不会修改系统权限设置。 运行 `python3 packages/experimental/cua-macos/native/tests/observation_benchmark.py --reference-helper /absolute/reference --candidate-helper /absolute/candidate --artifacts /private/evidence`,对比同一自建 AppKit 窗口中 35 行和 400 行合成内容的完整观察。每个 helper 先预热一次,再交替测量三次。除 helper 生成的应用和快照 ID 外,结果字段必须一致。报告保留原始耗时、字节数、哈希和回复,不设置 CI 性能阈值,也不声称内存表现。fixture 启动可能激活应用。运行时避免其他桌面自动化或编译任务。 diff --git a/packages/experimental/cua-macos/src/guidance.ts b/packages/experimental/cua-macos/src/guidance.ts index 7e1d35d715..64411f4a81 100644 --- a/packages/experimental/cua-macos/src/guidance.ts +++ b/packages/experimental/cua-macos/src/guidance.ts @@ -1,14 +1,10 @@ -/** Platform guidance appended to the shared application/window instructions. */ +/** Platform setup guidance prefixed to the shared application and window instructions. */ import { COMMON_GUIDANCE } from '@deepseek-ai/dsh-cua/guidance' -/** Platform-specific access and input behavior. */ -export const PLATFORM_GUIDANCE = `macOS: getApp also accepts bundle IDs and .app paths. findApps searches /Applications, /System/Applications and ~/Applications. Accessibility and Screen Recording permissions belong to the responsible launching application. Use the Computer Use permission page to request access, open System Settings, and check again. Native window and AX bounds use macOS points. show does not switch Spaces. Stage Manager can present reduced window geometry; explain any required foreground step before activate or raise. - -Hover first uses advertised AX alternate UI without moving the system cursor, preserving revealed descendants until the pointer target leaves their region. The system-pointer fallback requires the target point to be unobscured in the foreground app. FOREGROUND_REQUIRED requires explicit activation or raising and a fresh observation before retrying. - -Paste delivers plain text or HTML through the application's enabled standard Paste menu command. Paste follows the target app's focused text input. Foreground requirements vary by application; for example, ChatGPT/Codex was observed to accept background Paste without reading clipboard data. PASTE_NOT_CONSUMED means the command was dispatched but no clipboard read was observed before the configured deadline. Inspect the target contents, explicitly activate the app and focus the intended input, then observe again before deciding whether to retry; a delayed paste may still run.` +/** macOS operation levels, permissions, selectors, and native measurement units. */ +export const PLATFORM_GUIDANCE = 'macOS: accessibility tree operations are available at app or window level. Simulated keyboard input is available at app level. Simulated mouse input is available at window level. getApp also accepts bundle IDs and .app paths, and findApps searches /Applications, /System/Applications, and ~/Applications. Accessibility and Screen Recording permissions belong to the responsible launching application; use the Computer Use permission page to request access, open System Settings, and check again. Native window and AX bounds use macOS points, while delivered screenshots carry their own pixel dimensions. show does not switch Spaces, and Stage Manager can present reduced window geometry; explain any required foreground step before activate or raise.' /** Complete model instructions for this provider. */ -export const GUIDANCE = `${COMMON_GUIDANCE} +export const GUIDANCE = `${PLATFORM_GUIDANCE} -${PLATFORM_GUIDANCE}` +${COMMON_GUIDANCE}` diff --git a/packages/experimental/cua-macos/tests/guidance.spec.ts b/packages/experimental/cua-macos/tests/guidance.spec.ts new file mode 100644 index 0000000000..751b5db8b7 --- /dev/null +++ b/packages/experimental/cua-macos/tests/guidance.spec.ts @@ -0,0 +1,127 @@ +/** Model-facing guidance enumerates the full available object API without unavailable operations. */ +import { expect, it } from 'vitest' +import type { CuaApi, CuaApp, CuaSurface, CuaWindow } from '@deepseek-ai/dsh-cua/api' +import { COMMON_GUIDANCE } from '@deepseek-ai/dsh-cua/guidance' +import { GUIDANCE, PLATFORM_GUIDANCE } from '../src/guidance.ts' + +const apiNames: Array = ['getCapabilities', 'listApps', 'findApps', 'getState', 'getApp'] +const accessibilityNames: Array> = [ + 'getAccessibilityTree', 'listActions', 'invoke', 'performAction', 'setValue', 'selectText', +] +const appNames: Array = ['appHandle', 'activate', 'getWindows', 'getWindow'] +const windowNames: Array = ['windowId', 'getScreenshot', 'mouseMove', 'click', 'scroll', 'drag'] + +it('keeps exactly three ordered operation headings', () => { + const heads = COMMON_GUIDANCE.match(/^## .+$/gm) + expect(heads).toEqual(['## Accessibility tree', '## Simulated mouse', '## Simulated keyboard']) + expect(COMMON_GUIDANCE.indexOf('## Accessibility tree')).toBeLessThan(COMMON_GUIDANCE.indexOf('## Simulated mouse')) + expect(COMMON_GUIDANCE.indexOf('## Simulated mouse')).toBeLessThan(COMMON_GUIDANCE.indexOf('## Simulated keyboard')) +}) + +it('prefixes concise platform guidance before the shared catalog', () => { + expect(GUIDANCE).toBe(`${PLATFORM_GUIDANCE}\n\n${COMMON_GUIDANCE}`) + expect(PLATFORM_GUIDANCE).not.toContain('##') +}) + +it('states the macOS accessibility, keyboard, and mouse levels', () => { + expect(PLATFORM_GUIDANCE).toContain('accessibility tree operations are available at app or window level') + expect(PLATFORM_GUIDANCE).toContain('Simulated keyboard input is available at app level') + expect(PLATFORM_GUIDANCE).toContain('Simulated mouse input is available at window level') +}) + +it('enumerates every available method once in its catalog entry', () => { + const signatures = [ + ...apiNames.map(name => `cua.${name}(`), + ...appNames.filter(name => name !== 'appHandle').map(name => `app.${name}(`), + 'app.show(', 'window.show(', + ...accessibilityNames.map(name => `${name}(`), + ...windowNames.filter(name => name !== 'windowId').map(name => `${name}(`), + ...['typeText', 'paste', 'pressKey'].map(name => `${name}(`), + ] + for (const signature of signatures) expect(COMMON_GUIDANCE.split('\n').filter(line => line.startsWith(`- ${signature}`))).toHaveLength(1) + expect(signatures).toHaveLength(24) + expect(new Set(signatures.map(signature => signature.slice(signature.indexOf('.') + 1, -1))).size).toBe(23) + expect(COMMON_GUIDANCE).toContain('app.appHandle') + expect(COMMON_GUIDANCE).toContain('window.windowId') +}) + +it('documents option fields and return fields', () => { + for (const token of ['emit', 'includeMenus', 'details', 'disableDiffing', 'relative', 'mouseButton', 'clickCount', 'holdMs', 'modifiers', 'format', 'prefix', 'suffix', 'selectionType']) expect(COMMON_GUIDANCE).toContain(token) + for (const token of ['dispatched', 'foregroundChanged', 'hoverRoute', 'systemPointerMoved', 'bytes', 'mimeType', 'pixelWidth', 'pixelHeight', 'windowId']) expect(COMMON_GUIDANCE).toContain(token) +}) + +it('inlines discovery, restoration, screenshot, and mouse-move return records', () => { + const lines = COMMON_GUIDANCE.split('\n') + for (const name of ['cua.getCapabilities', 'cua.listApps', 'cua.findApps', 'cua.getState', 'app.getWindows', 'app.show', 'window.show', 'getScreenshot', 'mouseMove']) { + expect(lines.find(line => line.startsWith(`- ${name}(`))).toMatch(/ -> \(?\{ /) + } + expect(COMMON_GUIDANCE).toContain("{ platform: string, permissions: { accessibility: boolean, screenRecording: boolean }, appLevelAccessibility: boolean, keyboard: ('app' | 'window')[], sessionLocked: boolean | null, methods: string[], coordinateSpace: 'screenshot-pixels', browser: false }") + expect(COMMON_GUIDANCE).toContain('{ id: string, displayName: string, isRunning: true, pid: number }[]') + expect(COMMON_GUIDANCE).toContain('({ id: string, displayName: string, path: string } & ({ isRunning: true, pid: number } | { isRunning: false }))[]') + expect(COMMON_GUIDANCE).toContain('bounds: { x: number, y: number, width: number, height: number }, isOnScreen: boolean, onCurrentSpace: boolean | null') +}) + +it('defines every non-builtin type name used in method signatures', () => { + const signatures = COMMON_GUIDANCE.split('\n').filter(line => line.startsWith('- ')).map(line => line.split(' — ')[0]).join('\n') + const names = signatures.replace(/'[^']*'/g, '').match(/\b[A-Z][A-Za-z0-9_]*\b/g) ?? [] + expect([...new Set(names)].sort()).toEqual(['ActionResult', 'App', 'JsonValue', 'Uint8Array', 'Window']) + expect(COMMON_GUIDANCE).toContain('ActionResult = { dispatched: boolean, foregroundChanged?: boolean | null }') + expect(COMMON_GUIDANCE).toContain('JsonValue = string | number | boolean | null | JsonValue[] | { [key: string]: JsonValue }') + expect(COMMON_GUIDANCE).toContain('App is the application object with readonly app.appHandle: string (opaque) and the methods listed below for app level') + expect(COMMON_GUIDANCE).toContain('Window is the window object with readonly window.windowId: number and the methods listed below for window level') + expect(COMMON_GUIDANCE).toContain('Signatures show resolved return values after await') +}) + +it('preserves image formats and pointer modifier enums without restricting keyboard names', () => { + expect(COMMON_GUIDANCE).toContain("mimeType: 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif'") + const lines = COMMON_GUIDANCE.split('\n') + for (const name of ['click', 'drag']) { + expect(lines.find(line => line.startsWith(`- ${name}(`))).toContain("modifiers?: ('command' | 'control' | 'option' | 'shift' | 'fn')[]") + } + expect(COMMON_GUIDANCE).toContain('pressKey(key: string, modifiers?: string[])') + expect(COMMON_GUIDANCE).toContain('Key and modifier names are platform-defined strings') +}) + +it('states platform-dependent levels without qualifying grouped method names', () => { + for (const heading of ['Accessibility tree', 'Simulated mouse', 'Simulated keyboard']) { + expect(COMMON_GUIDANCE).toContain(`## ${heading}\nAvailable at app or window level depending on the platform.`) + } + expect(GUIDANCE).not.toMatch(/\bsurface\b/) + const groups = COMMON_GUIDANCE.slice(COMMON_GUIDANCE.indexOf('## Accessibility tree')) + expect(groups).not.toMatch(/^- (?:surface|window|app)\./m) + expect(COMMON_GUIDANCE).toContain('target: string | [number, number]') + expect(COMMON_GUIDANCE).toContain('from: [number, number]') +}) + +it('keeps consent, lock, emission, observation, and no-replay rules', () => { + expect(COMMON_GUIDANCE).toContain('consent') + expect(COMMON_GUIDANCE).toContain('SESSION_LOCKED') + expect(COMMON_GUIDANCE).toContain('Never replay uncertain input') + expect(COMMON_GUIDANCE).toContain('emit: false suppresses sink output only') + expect(COMMON_GUIDANCE).toContain('Read fresh state after actions') + expect(COMMON_GUIDANCE).toMatch(/element ids are opaque strings/i) + expect(COMMON_GUIDANCE).toContain('snapshotId') +}) + +it('prioritizes reported API availability over instruction text in the prologue', () => { + const prologue = COMMON_GUIDANCE.split('\n\n')[0] + expect(prologue).toContain('Always use cua.getCapabilities() to confirm whether a specific API is available on the current platform; its reported capabilities take precedence over availability statements in these instructions.') +}) + +it('separates facade options from raw RPC parameters', () => { + expect(COMMON_GUIDANCE).toContain('facade-only') + expect(COMMON_GUIDANCE).toContain('emit is local output control') + expect(COMMON_GUIDANCE).toContain('raw operation schema') +}) + +it('documents facade initialization, emitted observations, and separate key arguments', () => { + expect(COMMON_GUIDANCE).toContain('host-provided bridge initialization once') + expect(COMMON_GUIDANCE).toContain('not a preinstalled global') + expect(COMMON_GUIDANCE).toContain('void await') + expect(COMMON_GUIDANCE).toContain('do not pack them into a chord string') + expect(COMMON_GUIDANCE).toContain('perform a left-button double-click') +}) + +it('omits stale names and unavailable platform operations', () => { + for (const stale of ['getAXState', 'performSecondaryAction', 'hover(', 'keyChord', 'sendKeyEvent', 'window.typeText', 'window.pressKey', 'elementIndex', 'verified: false', 'browser tabs', 'not implemented']) expect(GUIDANCE).not.toContain(stale) +}) diff --git a/packages/experimental/cua/README.i18n.yaml b/packages/experimental/cua/README.i18n.yaml index 81b4782f80..8900fd903a 100644 --- a/packages/experimental/cua/README.i18n.yaml +++ b/packages/experimental/cua/README.i18n.yaml @@ -6,26 +6,26 @@ en: ed2539c6d12f814a zh: 55a6c9d7f0d21fb7 /deepseek-ai-dsh-cua: - en: 769f9fb05b127f3d - zh: 0d9c026ec49bf403 + en: 00f8b591b74dfba6 + zh: e928ab13be2eebfa /deepseek-ai-dsh-cua/summary: - en: f4d9cc48587d62a2 - zh: d1bac6c1fe7eb29e + en: 2ee2024dfc558d86 + zh: c3b5661be12923c4 /deepseek-ai-dsh-cua/table-of-contents: en: 5db4d4fea25493b9 zh: 65ab64fc24eb0d09 /deepseek-ai-dsh-cua/use-this-package: - en: e46c5ce22b3b37c9 - zh: eece98ca4a4a3c48 + en: b0ce7af9d135c4ee + zh: d53881aa85f49820 /deepseek-ai-dsh-cua/use-this-package/permission-controls: en: 6706beb084a70fe4 zh: b188bf09b115ce84 /deepseek-ai-dsh-cua/understand-the-implementation: - en: 0b34b0f01f0ca746 - zh: aa6f41a26f437aa5 + en: 0ddac737c0423ca6 + zh: cbbdc012b5b6ca5f /deepseek-ai-dsh-cua/further-exploration: - en: 166e3c1f9a67f753 - zh: 698c5136c5350052 + en: c174fb5a00ea3681 + zh: 039340042676881d /deepseek-ai-dsh-cua/model-experience: en: 215e7ba838619b7b zh: a311da3843709f90 @@ -42,8 +42,8 @@ en: 2d5df52dafa1d940 zh: 06e815759b9150c3 /deepseek-ai-dsh-cua/known-limitations-and-deferred-work: - en: d9232fe6e01142fc - zh: e8e0b193dd639e88 + en: c2006a1c7bda783e + zh: d018cd66d0ecbf7c /deepseek-ai-dsh-cua/known-limitations-and-deferred-work/dev-note: en: 0a1253c6f7b5e8b9 zh: 9f56528562c7c914 diff --git a/packages/experimental/cua/README.md b/packages/experimental/cua/README.md index 0ffb8d6bcf..9d6333048d 100644 --- a/packages/experimental/cua/README.md +++ b/packages/experimental/cua/README.md @@ -7,11 +7,11 @@ kind: "package-reference" English | [中文](README.zh.md) -Providers opting into window-directed execution expose `connectCuaWindows`: `listWindows()` discovers metadata, `getWindows(ids)` obtains consent and creates window objects, and `findApps(query)` / `launch(target)` discover and dispatch launch entries independently. Launch acknowledgement does not imply a process or window is ready. Window input uses the selected window handle; app-wide operations are rejected by the tool schema and executor. macOS retains `connectCua` and its app/window methods. +Providers install the app/window object API with `installCua`; callers connect through `connectCua`. The `cua` API discovers applications, and `CuaApp` objects activate the selected application and enumerate its windows. `CuaApp` and `CuaWindow` both extend `CuaSurface`; explicit window objects own screenshots and pointer input. The macOS provider supplies native execution for this interface. ## Summary -Inspect applications, retain window objects across PTC calls, and send actions through the normal tool pipeline. Platform providers supply native execution; this library owns the object API, request validation, application consent, and image admission. The external PTC runtime owns variable persistence. +Inspect and operate applications through retained objects: select an application, read its accessibility tree, capture explicit windows, and dispatch authorized input. Platform providers supply native execution; this library owns the object API, request validation, application consent, and image admission. The external PTC runtime owns variable persistence. ## Table of Contents @@ -31,17 +31,19 @@ Application consent supplies English, Chinese, and Japanese display text from `s Mount the [macOS provider](../cua-macos/README.md) to enable native operations on macOS. External PTC hosts import `connectCua` from `@deepseek-ai/dsh-cua/bridge` and supply the current `tools.cua` binding. Source compositions and native preparation belong to the provider. -Use App methods for a single-window task. `getApp` and `getWindow` read initial accessibility state silently; call `getAXState()` to emit the tree. Use `getWindows` and `getWindow` to select an explicit window when needed. Re-reading one app/window scope replaces its element indices without invalidating another window's snapshot. Keyboard input follows the application's focus. A lost connection invalidates its handles and coordinates. Failed cleanup is reported before that connection is retired; select the application again and inspect fresh state, because earlier input may have partially executed. Screenshot image errors retain the failing stage and attachment error code. Invalid request arguments reject before dispatch with a readable method, parameter and requirement. +Use `cua.getApp(selector)` to select an application; it obtains consent, optionally launches a stopped application in the background, and reads its initial accessibility tree silently when the provider supports application-level accessibility. `cua.listApps` and `cua.getState` list running applications; `cua.findApps(query)` searches installed applications, including stopped ones. `app.activate()`, `app.getWindows()`, and `app.getWindow(windowId)` operate on the selected application; `getWindow` returns the object for screenshots and pointer input. Select an application and one of its windows before any capture or pointer input. Call `app.getAccessibilityTree()` to emit the tree. Within one API instance, the facade keeps one current accessibility snapshot per application handle across app and window objects, including repeated selections; each new read invalidates the previous snapshot. Element operations use the latest snapshot ID, so callers use IDs from the latest tree and do not assume an older ID still identifies the same control. Element IDs are opaque strings. -Observation methods emit and return their result. Use `void await app.getAXState()` for one visible copy, or use `emit:false` and print the returned text once. Screenshots return `CuaScreenshot` with `bytes`, `mimeType`, `pixelWidth`, `pixelHeight`, and `windowId`. The image sink receives the same object. Use its MIME type when selecting a file extension or declaring an image; the format can be PNG, JPEG, WebP, or GIF. Each screenshot enters the attachment pipeline once; `emit:false` only suppresses the object sink. +Keyboard methods are available in the scopes a provider declares; the provider owns how input is delivered within each scope. A lost connection invalidates its handles and coordinates. Failed cleanup is reported before that connection is retired; select the application again and inspect fresh state, because earlier input may have partially executed. Screenshot image errors retain the failing stage and attachment error code. Invalid request arguments reject before dispatch with a readable method, parameter and requirement. + +Observation methods emit and return their result. Use `void await app.getAccessibilityTree()` for one visible copy, or use `emit:false` and print the returned text once. `window.getScreenshot()` returns `CuaScreenshot` with `bytes`, `mimeType`, `pixelWidth`, `pixelHeight`, and `windowId`. The image sink receives the same object. Use its MIME type when selecting a file extension or declaring an image; the format can be PNG, JPEG, WebP, or GIF. Each screenshot enters the attachment pipeline once; `emit:false` only suppresses the object sink. `tools.cua` returns operation values directly. Screenshot values retain the encoded image Base64 and add a durable `attachment` reference for the tool renderer; model content contains coordinate metadata and one image, without the encoded bytes. Before capture, the tool requires an attachment store and a resolved model route declaring image input. Admission and storage failures reject the call. The object bridge preserves the screenshot bytes and validated metadata without uploading or emitting the same image again. Application consent precedes launch, observation, capture, and input. Session access is stored by conversation and application identity and survives DSH restart and Computer Use disablement. Other conversations require their own consent. Saved grants require platform-verified executable identity. Refusal and revocation close affected Agent connections, so their old objects require fresh selection. No input is replayed after cancellation, timeout, or reconnect. -Actions return `dispatched:true, verified:false`; read fresh state to verify the result. Coordinate actions default to pixels in the latest returned screenshot; `relative: true` accepts integers from 0 to 999 after a successful window observation. Values are divided by 1000 and scaled to the window dimensions, then clamped inside the window. The Host resolves attachment normalization and the selected model route’s image projection before returning the screenshot, then converts input to native window coordinates: macOS points or Windows physical pixels. Resizing invalidates the screenshot mapping; `SCREENSHOT_REQUIRED` requires a new screenshot for absolute coordinates. Resizing rejects old coordinates with `WINDOW_CHANGED`; movement alone preserves window-local coordinates. +Actions return a `dispatched` boolean; `mouseMove` also reports `hoverRoute` and `systemPointerMoved`, and `show()` adds `windowId` and `foregroundChanged`. Read fresh state to verify the result. Screenshots and pointer actions are available only on explicit window objects. Coordinate actions default to pixels in the latest returned screenshot; `relative: true` accepts integers from 0 to 999 after a successful window observation. Values are divided by 1000 and scaled to the window dimensions, then clamped inside the window. The Host resolves attachment normalization and the selected model route’s image projection before returning the screenshot, then converts input to the provider’s native window coordinates. Resizing invalidates the screenshot mapping; `SCREENSHOT_REQUIRED` requires a new screenshot for absolute coordinates. Resizing rejects old coordinates with `WINDOW_CHANGED`; movement alone preserves window-local coordinates. -`click(target, { holdMs: 800 })` holds the mouse button for 800 milliseconds before release. `holdMs` accepts nonnegative integers and applies to each press of a double-click; zero releases without an additional hold. The provider config `maxClickHoldMs` limits explicit holds and defaults to 5000 ms. Explicit holds use pointer input for both AX indices and coordinates; omission preserves ordinary click behavior. The operation deadline includes the hold, and cancellation or timeout releases the button. Received input cannot be undone; forced helper termination cannot guarantee release. +`click(target, { holdMs: 800 })` holds the mouse button for 800 milliseconds before release. `holdMs` applies only to `click`; it accepts nonnegative integers and applies to each press of a double-click; zero releases without an additional hold. The provider config `maxClickHoldMs` limits explicit holds and defaults to 5000 ms. Explicit holds use pointer input; omission preserves ordinary click behavior. The operation deadline includes the hold, and cancellation or timeout releases the button. Received input cannot be undone; forced helper termination cannot guarantee release. ### Permission controls @@ -62,7 +64,7 @@ The Host marker has no configurable fields; platform providers own native config ## Understand the implementation -Permission responses identify their platform: macOS supplies system permission observations, while Windows supplies desktop lock, capture availability and elevation status. The shared page renders the corresponding controls. Before platform identification, it shows neutral observation and input rows without system actions. Unknown Windows session state keeps capture status unknown; setup distinguishes locked desktops, unverified sessions and unavailable capture. Native providers reuse compilation coordination and request-schema generation through explicit exports. +Permission responses identify their platform and report only the state that platform can observe. The shared page renders the controls those observations support. Before platform identification, it shows neutral observation and input rows without system actions. Native providers reuse compilation coordination and request-schema generation through explicit exports.
Shared execution and platform ownership @@ -73,12 +75,18 @@ Legacy `allowedApps` are imported on first store access and never reapplied afte The permission Remote also exposes `ptcConfiguration()` and `enablePersistentPtc()` for the detail-page runtime setting. Reads inspect the existing runtime and editable profile entry. Explicit writes use `configEditor.edit()` to preserve other fields and apply normal Loader reload; an already-persistent runtime is left intact. This setting is separate from system and application authorization. -The provider calls [installCua](src/index.ts) with its prepared helper, connection factory, and guidance. [NativeClient](src/native-client.ts) owns request correlation, byte limits, cancellation acknowledgement, and failure settlement. The platform connector owns startup and connection cleanup. Its typed startup failures preserve their code and diagnostic through request writes and connection shutdown. The shared executor retains one connection per Agent and joins in-flight image writes during disposal. +The provider calls [installCua](src/index.ts) with its prepared helper, connection factory, guidance, and startup capabilities. [NativeClient](src/native-client.ts) owns request correlation, byte limits, cancellation acknowledgement, and failure settlement. The platform connector owns startup and connection cleanup. Its typed startup failures preserve their code and diagnostic through request writes and connection shutdown. The shared executor retains one connection per Agent and joins in-flight image writes during disposal. `agentPreset` defaults to `ptc`, restricting tools and guidance to Agents bound to that preset. The provider uses the existing `agent/created` and `agent-preset/selected` events and Agent-owned scopes, including Agents already present when it loads. Provider unload and Agent disposal release those registrations. Preset definitions may register after the provider; a preset name filters bound Agents and supplies no tools until a matching Agent exists. Set `agentPreset: false` for global registration in standalone compositions without presets. The Host continues to own permissions, native connections and cancellation; preset definitions remain unchanged. [The operation schema](src/protocol.ts) is the authority for model parameters and separately declared Host-only fields. Native implementations enforce target identity, window geometry, resource limits, and operating-system access at execution. The permission store owns durable consent separately from the native protocol. +One object facade ([src/api.ts](src/api.ts)) builds a shared `CuaSurface` and derives `CuaApp` and `CuaWindow` from it. The derived factories inject scope parameters and the accessibility and keyboard checks for their scope; the shared base does not branch on application-only capabilities. Within one API instance, the facade keeps one current accessibility snapshot per `appHandle` across every app and window object for that handle. `getWindow` reads its initial tree silently; `getApp` does the same when the provider reports application-level accessibility. Each later `getAccessibilityTree()` invalidates the previous snapshot before dispatch, and element operations use the latest snapshot ID. Only a `CuaWindow` captures screenshots or sends pointer input. + +Provider startup capabilities are fixed at installation: platform, methods, app-level accessibility, keyboard scopes, browser support, and coordinate space. The native `getCapabilities` RPC reports runtime permissions and session lock only; `installCua` merges both layers for the model-visible result. The raw RPC remains a common operation representation rather than a capability inventory, so provider guidance states the actions its platform supports. + +Keyboard methods keep keys and modifiers separate. `pressKey(key, modifiers?)` presses and releases one key while holding the listed modifiers; `sendKeyEvent(key, direction)` sends exactly one key-down or key-up. `typeText` and `paste` deliver literal text at the provider's declared keyboard scope. Keyboard modifier names are plain strings that the provider interprets. + The root Host entry exports `installCua`, `CuaConfig`, and the Typert-discovered `CuaAccess` service; its `apply()` only marks the optional Client contribution. `/client` loads the permission UI through the existing module loader. Separate Host and Client compiler projects keep React, CSS, and browser registrations out of headless imports. `/api` owns the app/window API and its types; `/bridge`, `/native-client`, and `/protocol` retain runtime and platform consumers. `/types` exports only the four named boundary types required by generated Remote declarations. The Client uses package-local types. `/typert` supplies Host reflection and `/remote` supplies generated browser descriptors and codecs; permission authority remains on the Host. @@ -94,6 +102,7 @@ The detail page reads the effective default (`selectedDefault ?? default`) from - [macOS provider](../cua-macos/README.md) - [Object interfaces](src/types.ts) +- [Scoped surfaces and keyboard input](../../../.agents/notes/implemented/architecture/2026-11-05-cua-scoped-surfaces-and-input.md) - [Consent storage migration](../../../docs/upgrade-guide/v0.2.1-rc.2/cua-consent-storage/guide.md) ----- @@ -121,8 +130,8 @@ Results append to history. Retaining objects does not rewrite previous messages; - Conversation decisions have no automatic retention limit or deletion when a conversation is removed. Revocation removes permission, while its generation remains to reject older handles and pending approvals. - Native behavior and desktop validation are platform-owned; consult each provider for supported applications, input restrictions and measured coverage. -- Persistent variables do not reserve an application across a sequence of operations. Other Agents and the user can change its state. Hover and observations do not restore the previous pointer position; [continuous interaction](../../../.agents/notes/implemented/architecture/2026-10-13-cua-continuous-hover.md) uses no cross-call ownership. -- The package stays in `experimental` until Windows support and platform validation permit promotion to the `computer-use` group. +- Persistent variables do not reserve an application across a sequence of operations. Other Agents and the user can change its state. Pointer movement and observations do not restore the previous pointer position; [continuous interaction](../../../.agents/notes/implemented/architecture/2026-10-13-cua-continuous-hover.md) uses no cross-call ownership. +- Element IDs are opaque strings from the application's current accessibility snapshot. A later read on any window of the same application replaces the current snapshot, so callers must use IDs from the latest tree; an old string may be reused for a different control. Screenshots or pointer input require an explicitly selected window. ----- diff --git a/packages/experimental/cua/README.zh.md b/packages/experimental/cua/README.zh.md index 5fdff3de37..42ae1ee88e 100644 --- a/packages/experimental/cua/README.zh.md +++ b/packages/experimental/cua/README.zh.md @@ -7,11 +7,11 @@ kind: "package-reference" [English](README.md) | 中文 -选择窗口级执行的提供方暴露 `connectCuaWindows`:`listWindows()` 发现元数据,`getWindows(ids)` 获取授权并创建窗口对象,`findApps(query)` / `launch(target)` 独立发现和启动入口。启动回执不表示进程或窗口已经就绪。窗口输入使用选定的窗口句柄;工具 schema 与执行器拒绝应用级操作。macOS 保留 `connectCua` 及其应用和窗口方法。 +各提供方通过 `installCua` 安装应用/窗口对象 API;调用方通过 `connectCua` 连接。`cua` API 负责发现应用,`CuaApp` 对象负责激活选定的应用并枚举其窗口。`CuaApp` 与 `CuaWindow` 都扩展 `CuaSurface`;显式窗口对象负责截图和指针输入。macOS 提供方为此接口提供原生执行。 ## 概述 -检查应用、跨 PTC 调用保留窗口对象,并通过正常工具执行链发送动作。平台提供方负责原生执行;本库负责对象 API、请求校验、应用授权和图像接纳。变量持久性由外部 PTC 运行时负责。 +通过保留对象检查并操作应用:选择应用、读取辅助功能树、截取显式窗口并派发已授权输入。平台提供方负责原生执行;本库负责对象 API、请求校验、应用授权和图像接纳。变量持久性由外部 PTC 运行时负责。 ## 目录 @@ -31,17 +31,19 @@ kind: "package-reference" 挂载 [macOS 提供方](../cua-macos/README.zh.md)以在 macOS 上启用原生操作。外部 PTC 宿主从 `@deepseek-ai/dsh-cua/bridge` 导入 `connectCua`,并提供当前 `tools.cua` 绑定。源码组合与原生组件准备由提供方负责。 -单窗口任务直接使用 App 方法。`getApp` 和 `getWindow` 静默读取初始辅助功能状态;显式调用 `getAXState()` 才会输出树。需要指定窗口时使用 `getWindows` 和 `getWindow`。重新读取一个应用或窗口范围会替换其中的元素编号,不使其他窗口的快照失效。键盘输入跟随应用焦点。连接丢失会使其句柄和坐标失效。清理失败会先报告,再释放该连接;应重新选择应用并读取新状态,因为先前的输入可能已部分执行。截图图像错误会保留失败阶段和附件错误码。请求参数校验失败时,在分派前返回包含方法、参数和要求的可读消息。 +使用 `cua.getApp(selector)` 选择应用;它会获取授权、按需在后台启动已停止的应用,并在 provider 支持应用级辅助功能时静默读取初始辅助功能树。`cua.listApps` 和 `cua.getState` 列出运行中的应用;`cua.findApps(query)` 搜索已安装应用,包括未运行的应用。`app.activate()`、`app.getWindows()` 和 `app.getWindow(windowId)` 操作选定的应用;`getWindow` 返回用于截图和指针输入的对象。进行任何截图或指针输入前,必须选择应用及其一个窗口。调用 `app.getAccessibilityTree()` 输出树。在单个 API 实例内,门面按应用句柄保存一份当前辅助功能快照,该句柄的所有应用对象和窗口对象共享它,包括重复选择;每次新读取都会使上一份快照失效。元素操作使用最新快照 ID,因此调用方应使用最新树中的元素 ID,不应假定旧 ID 仍指向同一控件。元素 ID 是不透明字符串。 -观察方法会输出并返回结果。使用 `void await app.getAXState()` 只展示一份内容,或使用 `emit:false` 后打印一次返回文本。截图返回包含 `bytes`、`mimeType`、`pixelWidth`、`pixelHeight` 和 `windowId` 的 `CuaScreenshot`,图片输出回调接收同一个对象。选择文件后缀或声明图片时使用其中的 MIME 类型;格式可能是 PNG、JPEG、WebP 或 GIF。每张截图只进入一次附件处理链;`emit:false` 只抑制对象层的输出。 +键盘方法可在 provider 声明的作用域中使用;每个作用域内的输入投递由 provider 负责。连接丢失会使其句柄和坐标失效。清理失败会先报告,再释放该连接;应重新选择应用并读取新状态,因为先前的输入可能已部分执行。截图图像错误会保留失败阶段和附件错误码。请求参数校验失败时,在分派前返回包含方法、参数和要求的可读消息。 + +观察方法会输出并返回结果。使用 `void await app.getAccessibilityTree()` 只展示一份内容,或使用 `emit:false` 后打印一次返回文本。`window.getScreenshot()` 返回包含 `bytes`、`mimeType`、`pixelWidth`、`pixelHeight` 和 `windowId` 的 `CuaScreenshot`,图片输出回调接收同一个对象。选择文件后缀或声明图片时使用其中的 MIME 类型;格式可能是 PNG、JPEG、WebP 或 GIF。每张截图只进入一次附件处理链;`emit:false` 只抑制对象层的输出。 `tools.cua` 直接返回操作结果。截图结果保留图片 Base64,并增加供工具渲染使用的持久 `attachment` 引用;模型内容只包含坐标元数据和一张图片,不包含编码字节。截图前要求附件服务可用,并确认当前模型支持图片输入。图片接入或保存失败会拒绝调用。对象桥接保留截图字节和已校验的元数据,不重复上传或输出同一张图片。 应用授权发生在启动、观察、截图和输入之前。会话许可按对话和应用身份持久化,重启 DSH 或关闭 Computer Use 后仍可复用,其他对话需要单独授权。长期许可要求平台验证可执行文件身份。拒绝或撤销会关闭受影响的 Agent 连接,因此旧对象必须重新选择目标。取消、超时或重新连接后均不重放输入。 -动作返回 `dispatched:true, verified:false`;请读取新状态以验证结果。坐标操作默认使用最近返回截图中的像素;成功观察窗口后,传入 `relative: true` 可使用 0~999 的整数坐标。数值除以 1000 后按窗口尺寸缩放,并限制在窗口内。Host 在返回截图前解析附件归一化和当前模型的图片缩放规则,再将输入换算为原生窗口坐标:macOS point 或 Windows 物理像素。窗口尺寸变化会使截图映射失效,绝对坐标遇到 `SCREENSHOT_REQUIRED` 时需要重新截图。窗口缩放后以 `WINDOW_CHANGED` 拒绝旧坐标;单纯移动窗口不改变窗口内坐标。 +动作返回 `dispatched` 布尔值;`mouseMove` 还会返回 `hoverRoute` 和 `systemPointerMoved`,`show()` 还会返回 `windowId` 和 `foregroundChanged`。请读取新状态以验证结果。截图和指针操作只能通过显式窗口对象使用。坐标操作默认使用最近返回截图中的像素;成功观察窗口后,传入 `relative: true` 可使用 0~999 的整数坐标。数值除以 1000 后按窗口尺寸缩放,并限制在窗口内。Host 在返回截图前解析附件归一化和当前模型的图片缩放规则,再将输入换算为提供方的原生窗口坐标。窗口尺寸变化会使截图映射失效,绝对坐标遇到 `SCREENSHOT_REQUIRED` 时需要重新截图。窗口缩放后以 `WINDOW_CHANGED` 拒绝旧坐标;单纯移动窗口不改变窗口内坐标。 -`click(target, { holdMs: 800 })` 按住鼠标按钮 800 毫秒后松开。`holdMs` 接受非负整数,双击时应用于每次按下;0 表示按下后立即松开,不额外等待。提供方配置 `maxClickHoldMs` 限制显式按住时长,默认 5000 毫秒。指定时长后,AX 索引和坐标目标都使用鼠标事件;省略时保留普通点击行为。按住时间计入操作超时,取消或超时会松开按钮。已接收的输入无法撤销;辅助进程被强制终止时无法保证松开。 +`click(target, { holdMs: 800 })` 按住鼠标按钮 800 毫秒后松开。`holdMs` 仅适用于 `click`;它接受非负整数,双击时应用于每次按下;0 表示按下后立即松开,不额外等待。提供方配置 `maxClickHoldMs` 限制显式按住时长,默认 5000 毫秒。指定时长后使用鼠标事件;省略时保留普通点击行为。按住时间计入操作超时,取消或超时会松开按钮。已接收的输入无法撤销;辅助进程被强制终止时无法保证松开。 ### 权限控件 @@ -62,7 +64,7 @@ Computer Use 详情页的权限卡片、组件列表和来源信息使用 l3 边 ## 理解实现 -权限响应标识所属平台:macOS 提供系统权限观察,Windows 提供桌面锁定、截图可用性和运行权限级别。共享页面显示相应控件。平台尚未确认时显示通用观察和输入项,不提供系统操作。Windows 会话状态未知时,截图状态也保持未确认;设置提示区分桌面锁定、会话未确认和截图不可用。原生提供方通过显式导出复用编译协调和请求 schema 生成能力。 +权限响应标识所属平台,并且只报告该平台能够观察到的状态。共享页面显示这些观察结果支持的控件。平台尚未确认时显示通用观察和输入项,不提供系统操作。原生提供方通过显式导出复用编译协调和请求 schema 生成能力。
共享执行与平台职责 @@ -73,12 +75,18 @@ Computer Use 详情页的权限卡片、组件列表和来源信息使用 l3 边 权限 Remote 还通过 `ptcConfiguration()` 和 `enablePersistentPtc()` 支持详情页的执行方式设置。查询读取现有执行器和可编辑的 profile 条目。显式写入使用 `configEditor.edit()` 保留其他字段并按正常 Loader 规则重载;已是持久化模式的执行器保持不变。此设置独立于系统权限和应用授权。 -提供方将准备好的 helper、连接工厂和指引传给 [installCua](src/index.ts)。[NativeClient](src/native-client.ts) 负责请求关联、字节上限、取消确认和失败处理。平台连接器负责启动和连接清理。其带类型的启动失败在请求写入和连接关闭时保留错误码及诊断。共享执行器为每个 Agent 保留一个连接,并在销毁时等待进行中的图像写入。 +提供方将准备好的 helper、连接工厂、指引和启动能力传给 [installCua](src/index.ts)。[NativeClient](src/native-client.ts) 负责请求关联、字节上限、取消确认和失败处理。平台连接器负责启动和连接清理。其带类型的启动失败在请求写入和连接关闭时保留错误码及诊断。共享执行器为每个 Agent 保留一个连接,并在销毁时等待进行中的图像写入。 `agentPreset` 默认为 `ptc`,将工具和指引限制到绑定该 preset 的 Agent。提供方使用现有 `agent/created`、`agent-preset/selected` 事件及 Agent 拥有的作用域,也处理启用前已存在的 Agent。提供方卸载和 Agent 销毁都会释放这些注册。preset 定义可以晚于提供方注册;名称用于筛选已绑定的 Agent,在匹配的 Agent 出现前不提供工具。不使用 preset 的独立组合可设置 `agentPreset: false` 来全局注册。Host 仍拥有权限、本机连接和取消操作,preset 定义保持不变。 [操作 schema](src/protocol.ts) 定义模型参数,并单独声明 Host 专用字段。原生实现在执行时检查目标身份、窗口几何、资源上限和操作系统访问条件。授权存储独立于原生协议保存持久许可。 +对象门面([src/api.ts](src/api.ts))构建共享的 `CuaSurface`,并从它派生 `CuaApp` 和 `CuaWindow`。派生工厂注入作用域参数以及该作用域的辅助功能和键盘检查;共享基类不为仅属于应用的能力分支。在单个 API 实例内,门面按 `appHandle` 保存一份当前辅助功能快照,该句柄的所有应用对象和窗口对象共享它。`getWindow` 静默读取初始树;当 provider 报告应用级辅助功能时,`getApp` 也静默读取。之后每次 `getAccessibilityTree()` 在分派前使上一份快照失效,元素操作使用最新快照 ID。只有 `CuaWindow` 可以截图或发送指针输入。 + +提供方启动能力在安装时固定:平台、方法、应用级辅助功能、键盘作用域、浏览器支持和坐标空间。原生 `getCapabilities` RPC 只报告运行时权限和会话锁定状态;`installCua` 为模型可见结果合并两层。原生 RPC 仍是通用操作表示,而不是能力清单,因此 provider 指引说明其平台支持的动作。 + +键盘方法把按键与修饰键分开。`pressKey(key, modifiers?)` 在按住所列修饰键时按下并释放一个键;`sendKeyEvent(key, direction)` 只发送一次按下或抬起。`typeText` 和 `paste` 在 provider 声明的键盘作用域内传送字面文本。键盘修饰键名称是 provider 解释的普通字符串。 + 根 Host 入口导出 `installCua`、`CuaConfig` 和供 Typert 发现的 `CuaAccess` 服务,`apply()` 只标记可选 Client 贡献。`/client` 通过现有模块加载器加载权限界面。Host 和 Client 使用独立编译项目,headless 导入不会加载 React、CSS 或浏览器注册。`/api` 提供应用、窗口 API 及其类型;`/bridge`、`/native-client` 和 `/protocol` 保留运行时和平台消费者。`/types` 仅导出生成 Remote 声明所需的四个命名类型,Client 使用包内类型。`/typert` 提供 Host 反射,`/remote` 提供浏览器描述和编解码,权限判断仍由 Host 执行。 @@ -94,6 +102,7 @@ Computer Use 详情页的权限卡片、组件列表和来源信息使用 l3 边 - [macOS 提供方](../cua-macos/README.zh.md) - [对象接口](src/types.ts) +- [作用域表面与键盘输入](../../../.agents/notes/implemented/architecture/2026-11-05-cua-scoped-surfaces-and-input.zh.md) - [授权存储迁移](../../../docs/upgrade-guide/v0.2.1-rc.2/cua-consent-storage/guide.zh.md) ----- @@ -121,8 +130,8 @@ Computer Use 详情页的权限卡片、组件列表和来源信息使用 l3 边 - 会话决定没有自动保留期限,也不会随对话删除而自动清理。撤销会移除许可,但保留撤销代次,用于拒绝旧句柄和先前尚未完成的审批。 - 原生行为和桌面验证由各平台负责;支持的应用、输入限制和实测覆盖范围见对应提供方文档。 -- 持久变量不会在一组连续操作期间独占应用。其他 Agent 和用户可能改变其状态。 悬停和观察不恢复先前的鼠标位置;[连续交互](../../../.agents/notes/implemented/architecture/2026-10-13-cua-continuous-hover.zh.md)不分配跨调用所有权。 -- 本包保留在 `experimental`,Windows 支持和平台验证完成后可迁至 `computer-use` 组。 +- 持久变量不会在一组连续操作期间独占应用。其他 Agent 和用户可能改变其状态。指针移动和观察不恢复先前的鼠标位置;[连续交互](../../../.agents/notes/implemented/architecture/2026-10-13-cua-continuous-hover.zh.md)不分配跨调用所有权。 +- 元素 ID 是应用当前辅助功能快照中的不透明字符串。之后读取同一应用的任一窗口会替换当前快照,因此调用方必须使用最新树中的 ID;旧字符串可能被复用于另一个控件。截图或指针输入要求显式选择窗口。 ----- diff --git a/packages/experimental/cua/src/guidance.ts b/packages/experimental/cua/src/guidance.ts index 324dac5e99..52e814ba30 100644 --- a/packages/experimental/cua/src/guidance.ts +++ b/packages/experimental/cua/src/guidance.ts @@ -1,44 +1,48 @@ /** Shared model instructions for native application and window operations. */ -/** Instructions for raw operation calls and optional object-API bindings. */ -export const COMMON_GUIDANCE = `Use cua with method getCapabilities and params {} to inspect permissions and sessionLocked. If sessionLocked is true or an operation reports SESSION_LOCKED, stop UI attempts and ask the user to unlock the desktop session. A null sessionLocked means no usable console session was verified. After unlocking, read fresh state; screenshots from a locked desktop are not current observations. Use listApps or cua.getState to discover running applications, and findApps(query) to search installed applications by name or application path. getApp requests user consent before launching a stopped application in the background, or before observations and input on a running one. If access is denied or revoked, stop using that application until the user explicitly permits another authorization request. Never switch tools to bypass a refusal. Keep the returned appHandle; every app operation requires it. listWindows returns window IDs and bounds in the provider’s native units. Raw getState returns AX text and snapshotId. Menu-bar entries are shown by default; includeMenus=true expands their contents. details=true adds identifiers, global native bounds and complete action names. Both options also apply to getAXState. Each read replaces the indices for that app/window scope. Use its element indices only with that snapshotId. Raw screenshot and coordinate operations require a windowId. Coordinates are pixels in the latest returned screenshot, measured from its top-left. Set relative:true for integer thousandths from 0 to 999 instead. The Host converts both modes to native window coordinates; AX detail bounds remain global native coordinates. A verified window can expose no AX elements. Its empty snapshot permits screenshots and coordinate input; element-index actions require an element from a fresh AX observation. +/** Async method catalog with consent and observation rules, grouped by observation, mouse, and keyboard. */ +export const COMMON_GUIDANCE = `Use cua to observe and operate native applications. Always use cua.getCapabilities() to confirm whether a specific API is available on the current platform; its reported capabilities take precedence over availability statements in these instructions. All methods are async; observation options default to { emit: true }, and emit: false suppresses sink output only, leaving returned values unchanged. Actions report dispatch evidence, not verified completion. If sessionLocked is true or an operation reports SESSION_LOCKED, stop UI actions and ask the user to unlock the desktop session; null or unknown means verify a usable unlocked desktop session first. cua.getApp requests user consent; if access is denied or revoked, stop using that application until the user explicitly permits another request, and never bypass a refusal or switch tools to avoid it. Never replay uncertain input without a fresh observation. -Initialize the object API once in persistent PTC. Reuse its variables in later calls; put temporary declarations inside { ... } blocks to avoid redeclaration errors. All object methods are async. getAXState returns text, not a structured state object. Its text separates values and placeholders, and reports subroles, help, URLs, disabled/focused/selected/expanded state and UTF-16 selection ranges when available. Writability is true, false or unknown on relevant controls; omitted state fields do not assert false. selection=unavailable means the reported range exceeds the observed text. Compact output omits ordinary Press/Pick (click), ShowMenu (right click) and ScrollToVisible actions; details=true lists every available action. Use the displayed action name with performSecondaryAction; ambiguous aliases require the complete name from details=true. Truncation reports the reached provider limit. Narrow the window or increase that provider limit before reading again. +In persistent PTC, use the host-provided bridge initialization once and retain the returned objects; cua comes from that bridge and is not a preinstalled global. Use void await for observations that emit, and never stringify screenshot image bytes. -Use app methods directly for single-window tasks; getApp already reads initial AX state. Call app.getWindows() and await app.getWindow(windowId) only to target a particular window or resolve ambiguous window selection. App screenshots and coordinate actions use the latest AX observation: its focused on-screen, nonzero-size window, otherwise the sole such window. They do not refresh focus automatically. Read app.getAXState() to follow changed focus. +Signatures show resolved return values after await. ActionResult = { dispatched: boolean, foregroundChanged?: boolean | null }; foregroundChanged is omitted when not sampled and null when the sample is unavailable. JsonValue = string | number | boolean | null | JsonValue[] | { [key: string]: JsonValue }; numbers must be finite. App is the application object with readonly app.appHandle: string (opaque) and the methods listed below for app level. Window is the window object with readonly window.windowId: number and the methods listed below for window level. Neither object carries pid. -CuaScreenshot contains { bytes: Uint8Array, mimeType: "image/png" | "image/jpeg" | "image/webp" | "image/gif", pixelWidth: number, pixelHeight: number, windowId: number }. Use mimeType to choose a file extension or declare an image; do not assume PNG. +Setup and discovery: +- cua.getCapabilities(options?: { emit?: boolean }) -> { platform: string, permissions: { accessibility: boolean, screenRecording: boolean }, appLevelAccessibility: boolean, keyboard: ('app' | 'window')[], sessionLocked: boolean | null, methods: string[], coordinateSpace: 'screenshot-pixels', browser: false } — inspect reported permissions, sessionLocked, methods, and keyboard scopes without requesting permissions. +- cua.listApps(options?: { emit?: boolean }) -> { id: string, displayName: string, isRunning: true, pid: number }[] — enumerate running applications. +- cua.findApps(query: string, options?: { emit?: boolean }) -> ({ id: string, displayName: string, path: string } & ({ isRunning: true, pid: number } | { isRunning: false }))[] — search installed applications, including stopped matches; only running matches carry pid. +- cua.getState(options?: { emit?: boolean }) -> { apps: { id: string, displayName: string, isRunning: true, pid: number }[], browsers: [] } — summarize running applications; this is not an accessibility observation. +- cua.getApp(selector: string) -> App — select an application by name, bundle ID, absolute path, or running PID string, obtain consent, launch in the background if needed, and read initial AX state silently; it does not activate the app. +- app.getWindows(options?: { emit?: boolean }) -> { windowId: number, appName: string, title: string, bounds: { x: number, y: number, width: number, height: number }, isOnScreen: boolean, onCurrentSpace: boolean | null }[] — enumerate windows with global native bounds; null onCurrentSpace means unknown Space membership. +- app.getWindow(windowId: number) -> Window — select one window and read its initial AX state silently; do this before any window screenshot or coordinate input. +- app.activate() -> ActionResult — request explicit foreground activation; use only when foreground access is required. +- app.show() -> { dispatched: boolean, windowId: number | null, foregroundChanged: boolean | null } — unhide the app and restore its selected, focused, main, or sole window without activation. +- window.show() -> { dispatched: boolean, windowId: number | null, foregroundChanged: boolean | null } — unhide and restore that explicit window without activation. -Object API signatures (options default to { emit: true }): +## Accessibility tree +Available at app or window level depending on the platform. -- cua.getCapabilities(options?) -> { platform, permissions, sessionLocked, methods, coordinateSpace, browser } -- cua.listApps(options?) -> Array<{ id, displayName, isRunning: true, pid }> -- cua.findApps(query: string, options?) -> Array<{ id, displayName, path, isRunning, pid? }> -- cua.getState(options?) -> { apps, browsers: [] } -- cua.getApp(selector: string) -> App -- app.activate() -> { dispatched: true, verified: false } -- app.getWindows(options?) -> Array<{ windowId, pid, appName, title, bounds, isOnScreen, onCurrentSpace }> -- app.getWindow(windowId: number) -> Window -- app.typeText(text: string), app.pressKey(chord: string) -> action result -- app.paste(text: string, options?: { format?: "text" | "html" }) -> action result +Element ids are opaque strings from the latest successful tree; the object facade keeps one current snapshot per app across its repeated app and window objects, a new read replaces it, and a failed read invalidates the previous one. Repeated strings can appear for different elements, so do not reuse an old id blindly, and element operations do not fall back to pointer input or typing. +- getAccessibilityTree(options?: { emit?: boolean, includeMenus?: boolean, details?: boolean, disableDiffing?: boolean }) -> string — read the full tree text; includeMenus expands menu contents and details adds identifiers, native bounds, and complete action names. +- listActions(elementId: string) -> string[] — list the actions an element advertises. +- invoke(elementId: string) -> ActionResult — invoke the element's default action; dispatched is false when it has none. +- performAction(elementId: string, action: string, argument?: JsonValue) -> ActionResult — perform an observed action with an optional direct JSON argument. +- setValue(elementId: string, value: JsonValue) -> ActionResult — write a control value. +- selectText(elementId: string, text: string, options?: { prefix?: string, suffix?: string, selectionType?: 'text' | 'cursor_before' | 'cursor_after' }) -> ActionResult — select one literal occurrence or place the cursor beside it, using adjacent context to disambiguate. -App and Window methods: +## Simulated mouse +Available at app or window level depending on the platform. +- getScreenshot(options?: { emit?: boolean }) -> { bytes: Uint8Array, mimeType: 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif', pixelWidth: number, pixelHeight: number, windowId: number } — capture the selected window as one encoded image; bytes is a JavaScript byte array, and mimeType identifies its encoding, so do not assume PNG. +- mouseMove(target: string | [number, number], options?: { relative?: boolean }) -> { dispatched: boolean, foregroundChanged?: boolean | null, hoverRoute: 'accessibility' | 'system-pointer', systemPointerMoved: boolean } — reveal AX alternate UI or move the system pointer without pressing; inspect hoverRoute and systemPointerMoved, and expect no automatic pointer restoration. +- click(target: string | [number, number], options?: { mouseButton?: 'left' | 'right' | 'middle', clickCount?: 1 | 2, modifiers?: ('command' | 'control' | 'option' | 'shift' | 'fn')[], holdMs?: number, relative?: boolean }) -> ActionResult — click an element id or point, or perform a left-button double-click; holdMs controls the press duration of each press. +- scroll(options: { x: number, y: number, deltaLinesX: number, deltaLinesY: number, relative?: boolean }) -> ActionResult — scroll at a point; deltas are integers from -10 to 10 with at least one nonzero, and positive values reveal content above or left. +- drag(from: [number, number], to: [number, number], options?: { mouseButton?: 'left' | 'right' | 'middle', modifiers?: ('command' | 'control' | 'option' | 'shift' | 'fn')[], relative?: boolean }) -> ActionResult — drag between two points of one window. -- show() -> { dispatched: true, verified: false, windowId: number | null, foregroundChanged: boolean | null } -- getAXState(options?: { emit?: boolean, disableDiffing?: boolean, includeMenus?: boolean, details?: boolean }) -> string -- getScreenshot(options?: { emit?: boolean }) -> CuaScreenshot -- getAXStateAndScreenshot(options?) -> { state: string, screenshot: CuaScreenshot } -- click(target: number | [x, y], options?: { mouseButton?: "left" | "right" | "middle", clickCount?: 1 | 2, holdMs?: number, modifiers?: Array<"command" | "control" | "option" | "shift" | "fn">, relative?: boolean }) -> action result -- hover(target: number | [x, y], options?: { relative?: boolean }) -> { dispatched, verified, hoverRoute, systemPointerMoved } -- setValue(elementIndex: number, value: string) -> action result -- selectText(elementIndex: number, text: string, options?: { prefix?: string, suffix?: string, selectionType?: "text" | "cursor_before" | "cursor_after" }) -> action result -- performSecondaryAction(elementIndex: number, action: string) -> action result -- scroll({ x, y, deltaLinesX, deltaLinesY, relative? }) -> action result -- drag(from: [x, y], to: [x, y], options?: { mouseButton?: "left" | "right" | "middle", modifiers?: Array<"command" | "control" | "option" | "shift" | "fn">, relative?: boolean }) -> action result +A string target is an element id; coordinate targets are [x, y] and are pixels in the latest returned screenshot by default. With relative: true they are integer thousandths of the window width and height from 0 to 999, based on the current AX observation or screenshot. Left clicks support one or two presses; right and middle clicks support one. FOREGROUND_REQUIRED means explain the need, then explicitly activate or raise and observe again; activation is never automatic. Read fresh state after actions, and treat WINDOW_CHANGED, STALE_SNAPSHOT, and SCREENSHOT_REQUIRED as requiring the stated fresh observation or capture before any retry. -Raw operation tools use { method, params }, including params: {} for parameterless methods. getApp selects without activating the app. Keep applications in the background for observation and actions that the provider supports without foreground access. Do not activate or raise an app during initialization, before each action, or merely because another app is foreground. Prefer advertised AX actions. If a window is hidden or minimized, try app.show() or window.show() and read fresh state. show requests unhide and unminimize without activation or raising; it chooses the explicit, focused, main or sole AX window. A null windowId means no window was selected for restoration. foregroundChanged compares the front app and top window before and after the request; null means unavailable, and delayed focus changes remain possible. If restoration is unsupported or the window remains unusable, explain the needed foreground step, use app.activate() or an advertised raise action, and read fresh state. Completing the task takes priority when foreground access is necessary. Avoid repeated activation when the user switches away; continue background-capable steps and report what requires foreground access. Applications may still change focus in response to input. +## Simulated keyboard +Available at app or window level depending on the platform. +- typeText(text: string) -> ActionResult — type literal text at the app's current focus; line endings send Return and tabs send Tab. +- paste(text: string, options?: { format?: 'text' | 'html' }) -> ActionResult — deliver text or HTML through the app's Paste command, restoring prior clipboard contents unless another writer changes them; a Paste failure is surfaced without substituting typeText, and PASTE_NOT_CONSUMED means inspect before any retry. +- pressKey(key: string, modifiers?: string[]) -> ActionResult — press and release one complete keystroke. For example pressKey('Tab', ['shift']) or pressKey('+'). Key and modifier names are platform-defined strings. Pass key and modifiers separately; do not pack them into a chord string. -Await operations sequentially. After input, read fresh state to verify the effect. A successful action means dispatched, not verified completion. Cancellation may leave partial effects; never retry uncertain input without observing. STALE_APP requires getApp again; STALE_SNAPSHOT requires getState again. Absolute coordinate input requires a fresh screenshot of that window. Relative input can use a successful AX observation or screenshot. SCREENSHOT_REQUIRED means capture a fresh screenshot before using pixel coordinates. For coordinate input, targets must be [x, y], for example click([650, 400], {relative:true}). A bare number such as click(650) is always an AX element index. The relative option applies only to coordinate targets, not AX indices. Window resizing since the latest observation rejects coordinate input; movement alone preserves window-local coordinates. WINDOW_CHANGED requires fresh state before any retry; use an advertised AX action or explicitly restore the window before screenshot or coordinate input, then observe again. PERMISSION_DENIED requires the user to address the reported system access restriction. After granting access, observe fresh state before continuing; do not automatically replay prior input. - -Hover reveals alternate UI through a provider-supported accessibility action or moves the system pointer without pressing a button. Wait for the application's hover delay and observe before clicking; subsequent observations do not restore the pointer. Use successive hover calls for intermediate points. Other input and application changes can interrupt the interaction. click accepts optional holdMs, a nonnegative integer in milliseconds for each press, including double-click presses. Zero releases without an additional hold. The configured maximum is stated below. Explicit holdMs uses pointer input even for AX targets; omission preserves ordinary clicks. The operation deadline applies, and cancellation or timeout releases the button. - -Use selectText only on controls advertising selectionWritable. It selects a unique literal occurrence, or places the cursor before/after it; prefix and suffix must be immediately adjacent. AMBIGUOUS_TEXT requires more context; TEXT_NOT_FOUND or SELECTION_CHANGED requires a fresh observation before deciding on input. Left clicks support single/double clicks; right and middle clicks support single clicks. Modified clicks use pointer input. Keypad names such as KP_0 and KP_Enter retain their physical key identity. Window objects expose observation and pointer/AX actions; keyboard input remains app-scoped and follows current focus. Scroll deltas are integer lines from -10 to 10; positive values reveal content above or left. Paste delivers plain text or HTML through the system clipboard and the application's paste action. Original clipboard formats are restored if the clipboard still belongs to this paste; a later copy is preserved. Unsupported Paste commands fail without typing fallback. CLIPBOARD_CHANGED means another writer intervened; observe before deciding on further input. Browser applications can be controlled with getApp like other native apps; browser tabs are unavailable. Installed-app search covers the locations documented by the platform provider; use an absolute application path for another location. Launch does not restore a window or document, and cancellation may leave an application already started. The execution host must install the object API and own variable persistence; this plugin does not preload a cua global. In persistent PTC, use the host-provided initialization snippet below once. Its installation-owned file URL works independently of the project directory. Retain app objects between calls. Observation methods emit by default and also return their value. Use void await app.getAXState() to avoid a duplicate REPL completion, or pass emit:false and print the returned text once. End screenshot calls with void await app.getScreenshot() or void await app.getAXStateAndScreenshot() so image bytes are not serialized as the program completion value.` +Raw tools use { method, params }: include appHandle for app calls and windowId for window calls, and use snapshotId with elementId for element routes. Object options such as emit and disableDiffing are facade-only: emit is local output control and neither is a raw RPC parameter, so raw callers must follow the raw operation schema for admitted params. getAccessibilityTree and getWindow read through raw getState; getWindows maps to listWindows; getScreenshot maps to screenshot; cua.getState maps to listApps; every other named operation uses the same method name.` From c174e33a1ba89feb7c6685dbe53f6afd7ef2ba7b Mon Sep 17 00:00:00 2001 From: winewill Date: Wed, 4 Nov 2026 17:43:01 +0800 Subject: [PATCH 251/322] Paint the Windows workspace with its startup theme before the first frame --- apps/desktop/src/main.ts | 1 + apps/desktop/tests/main-startup.spec.ts | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/apps/desktop/src/main.ts b/apps/desktop/src/main.ts index dd3141228b..73e321a329 100644 --- a/apps/desktop/src/main.ts +++ b/apps/desktop/src/main.ts @@ -268,6 +268,7 @@ function createWindow(preload: string, show = false, primary = false): BrowserWi minHeight: 600, show, ...(process.platform === 'win32' && primary ? { + backgroundColor: chromeFallbackFill(), titleBarStyle: 'hidden' as const, titleBarOverlay: { height: WINDOWS_TITLEBAR_HEIGHT, color: chromeFallbackFill(), symbolColor: nativeTheme.shouldUseDarkColors ? '#f9fafb' : '#0f1115' }, diff --git a/apps/desktop/tests/main-startup.spec.ts b/apps/desktop/tests/main-startup.spec.ts index 69ec6c9af9..a5ffc8b9ba 100644 --- a/apps/desktop/tests/main-startup.spec.ts +++ b/apps/desktop/tests/main-startup.spec.ts @@ -1164,6 +1164,14 @@ describe('desktop main startup', () => { expect(harness.hosts).toHaveLength(0) }) + it.each([[false, '#f9fafb'], [true, '#1b1b1c']] as const)('paints the Windows workspace in its startup palette (dark=%s)', async (dark, color) => { + vi.spyOn(process, 'platform', 'get').mockReturnValue('win32') + harness.nativeTheme.shouldUseDarkColors = dark + await import('../src/main.ts') + await harness.preparing.promise + expect(harness.windows[0]!.options).toMatchObject({ backgroundColor: color }) + }) + it('serves packaged shell documents instead of rejecting the shell origin', async () => { const { serveWebDocument } = await import('../src/web-document.ts') vi.mocked(serveWebDocument).mockResolvedValue(new Response('shell document')) From 21ebc610743dc8fa89a3fcfbe9b5ba267a361be4 Mon Sep 17 00:00:00 2001 From: winewill Date: Thu, 5 Nov 2026 11:20:26 +0800 Subject: [PATCH 252/322] Restore desktop theme before startup and track Windows background changes --- apps/desktop/README.i18n.yaml | 4 +- apps/desktop/README.md | 2 + apps/desktop/README.zh.md | 2 + apps/desktop/src/main.ts | 24 ++++++++--- apps/desktop/src/theme-cache.ts | 39 +++++++++++++++++ apps/desktop/tests/main-startup.spec.ts | 56 ++++++++++++++++++++++++- apps/desktop/tests/theme-cache.spec.ts | 40 ++++++++++++++++++ 7 files changed, 159 insertions(+), 8 deletions(-) create mode 100644 apps/desktop/src/theme-cache.ts create mode 100644 apps/desktop/tests/theme-cache.spec.ts diff --git a/apps/desktop/README.i18n.yaml b/apps/desktop/README.i18n.yaml index dc6cb5f9e0..8b91815c2d 100644 --- a/apps/desktop/README.i18n.yaml +++ b/apps/desktop/README.i18n.yaml @@ -15,8 +15,8 @@ en: 127ea90553cb6af7 zh: 7b1c5aec8558c684 /deepseek-harness-desktop/application-overview: - en: d4afa46403997884 - zh: 9b9fe126afda70f0 + en: 0896633a2d561d41 + zh: 5c143fad65016b8f /deepseek-harness-desktop/terminal-command: en: 5f2d25a1d8472647 zh: 2acb5c5d7d1917e2 diff --git a/apps/desktop/README.md b/apps/desktop/README.md index 68596d719f..8883f43b83 100644 --- a/apps/desktop/README.md +++ b/apps/desktop/README.md @@ -31,6 +31,8 @@ Desktop runs the Harness workspace in a native application. This reference cover ## Application overview +Desktop restores the last confirmed application theme source before creating native windows. The cache is local to Electron userData; a missing, invalid or unreadable cache uses system appearance, and a write failure is logged without blocking theme changes. Windows workspace backgrounds remain opaque and follow the effective light/dark theme, including runtime changes; custom palettes use the built-in light/dark background approximation. macOS keeps its transparent sidebar vibrancy. On the first launch after upgrading from a version without this cache, the initial native palette follows the system until the application publishes its preference. + Electron caches the last confirmed UI language in `userData/desktop/locale-cache` so startup recovery dialogs can use it before Host settings are available. Missing, invalid, or unreadable caches fall back to the system language; cache write failures do not block startup. A successful Host startup or a UI language change refreshes the cache. Until then, a changed system language may differ from the cached language. Desktop analytics follows the [product collection policy](../../packages/client/product-analytics/README.md), including its live application setting. Web usage is excluded. Update installation waits for its local analytics intake before locking API admission and stopping the Host. Intake has a one-second deadline; failure does not prevent installation, and collector delivery is not awaited. diff --git a/apps/desktop/README.zh.md b/apps/desktop/README.zh.md index 13661f0590..6762d63930 100644 --- a/apps/desktop/README.zh.md +++ b/apps/desktop/README.zh.md @@ -31,6 +31,8 @@ Desktop 在原生应用中运行 Harness 工作区。本参考文档说明应用 ## 应用概览 +Desktop 在创建原生窗口前恢复上次确认的应用主题来源。缓存保存在 Electron userData 中;缓存缺失、无效或不可读时使用系统外观,写入失败会记录日志但不阻止主题切换。Windows 工作区底色保持不透明,并跟随有效的浅色/深色主题及运行中的变化;自定义配色使用内置浅色/深色底色近似。macOS 保留透明侧边栏毛玻璃效果。从没有此缓存的版本升级后,首次启动的原生初始配色跟随系统,直到应用发布其主题偏好。 + Electron 在 `userData/desktop/locale-cache` 缓存最近确认的界面语言,使启动恢复弹窗在 Host 设置尚不可用时也能使用该语言。缓存缺失、无效或不可读时回退到系统语言;缓存写入失败不阻断启动。Host 成功启动或界面语言变更时会刷新缓存;在此之前,变更后的系统语言可能与缓存语言不同。 桌面埋点遵循[产品采集策略](../../packages/client/product-analytics/README.zh.md)及其动态应用配置,不包含 Web 使用情况。安装更新会等待该操作的本地埋点接收请求结束,再锁定 API 准入并停止 Host。接收请求的时限为一秒,失败不会阻止安装,也不等待收集端完成发送。 diff --git a/apps/desktop/src/main.ts b/apps/desktop/src/main.ts index 73e321a329..a621847e72 100644 --- a/apps/desktop/src/main.ts +++ b/apps/desktop/src/main.ts @@ -63,6 +63,7 @@ import { DesktopMandatoryUpdateWindow } from './mandatory-update-window.ts' import { DesktopPolicyTestAuth } from './policy-test-auth.ts' import { readDesktopSettings } from './settings.ts' import { readDesktopLocaleCache, writeDesktopLocaleCache } from './locale-cache.ts' +import { readDesktopThemeCache, writeDesktopThemeCache } from './theme-cache.ts' import { DesktopUpdateDialog, type UpdateDialogOptions } from './update-dialog.ts' import { readDesktopRuntime } from './runtime-tree.ts' import { DesktopBrowserGuests } from './browser-guests.ts' @@ -81,6 +82,7 @@ let shuttingDown = false */ let skipQuitConfirmation = false let windowsLanguage: string | undefined = readDesktopLocaleCache(app.getPath('userData')) +nativeTheme.themeSource = readDesktopThemeCache(app.getPath('userData')) /** * Whether the backend has reached ready: false until the first ready, back to * false when a restart returns it to starting, frozen during shutdown so a @@ -238,9 +240,10 @@ function developmentHostInspectPort(enabled: boolean): number | undefined { /** * Opaque chrome fallback matching the built-in sidebar palette (the resolved * `--dsw-static-neutral-bluish-900` / `-50` tokens). An approximation for - * custom themes: Windows swaps in the renderer's measured palette over the - * windowsAppearance IPC, and macOS shows it only while minimized or hidden. - * @returns the sidebar fill hex for the active system color scheme. + * custom themes: Windows captions use the renderer's measured palette over + * windowsAppearance IPC. The Windows workspace base stays opaque and follows + * the effective light/dark theme; macOS uses it only while minimized or hidden. + * @returns the sidebar fill hex for the effective application color scheme. */ function chromeFallbackFill(): string { return nativeTheme.shouldUseDarkColors ? '#1b1b1c' : '#f9fafb' @@ -309,6 +312,13 @@ function createWindow(preload: string, show = false, primary = false): BrowserWi // current state so a fullscreen reload does not fall back to windowed CSS. window.webContents.on('did-finish-load', sendFullscreen) } + if (process.platform === 'win32' && primary) { + const updateBackground = (): void => { + if (!window.isDestroyed()) window.setBackgroundColor(chromeFallbackFill()) + } + nativeTheme.on('updated', updateBackground) + window.once('closed', () => { nativeTheme.removeListener('updated', updateBackground) }) + } if (process.platform === 'darwin') { // Deminiaturize reattaches the NSVisualEffectView material late // (electron/electron#25368), so a transparent window shows the desktop @@ -871,8 +881,12 @@ async function main(): Promise { ipcMain.handle(PLATFORM_IPC.close, (event) => { assertMainApplication(event); platformView.close() }) // Only the main window may synchronize its palette with the native material. ipcMain.on(DESKTOP_IPC.nativeThemeSet, (event, source: unknown) => { - if (mainWindow === undefined || event.sender !== mainWindow.webContents) return - if (source === 'light' || source === 'dark' || source === 'system') nativeTheme.themeSource = source + if (mainWindow === undefined || event.sender !== mainWindow.webContents + || event.senderFrame !== mainWindow.webContents.mainFrame + || !event.senderFrame.url.startsWith(`${SCHEME}://app/`)) return + if (source !== 'light' && source !== 'dark' && source !== 'system') return + nativeTheme.themeSource = source + writeDesktopThemeCache(app.getPath('userData'), source) }) ipcMain.handle(DESKTOP_IPC.localeBootstrap, async (event) => { if (event.sender !== mainWindow?.webContents || event.senderFrame !== mainWindow.webContents.mainFrame diff --git a/apps/desktop/src/theme-cache.ts b/apps/desktop/src/theme-cache.ts new file mode 100644 index 0000000000..833d5ebd07 --- /dev/null +++ b/apps/desktop/src/theme-cache.ts @@ -0,0 +1,39 @@ +/** Last confirmed application theme source for native windows before renderer startup. */ +import { mkdirSync, readFileSync, writeFileSync } from 'node:fs' +import { join } from 'node:path' + +/** Theme sources supported by Electron and the application theme selector. */ +export type DesktopThemeSource = 'system' | 'light' | 'dark' + +/** + * Read the last confirmed source; missing or unusable cache falls back to the system. + * @param userData - Electron userData directory. + * @returns Cached theme source or system fallback. + */ +export function readDesktopThemeCache(userData: string): DesktopThemeSource { + try { + const value = readFileSync(join(userData, 'desktop', 'theme-cache'), 'utf8').trim() + if (value === 'system' || value === 'light' || value === 'dark') return value + throw new Error('expected system, light or dark') + } catch (error) { + if ((error as NodeJS.ErrnoException).code !== 'ENOENT') { + console.warn('desktop theme cache: using system appearance because the cache could not be read', error) + } + return 'system' + } +} + +/** + * Remember a confirmed source; failure leaves the active theme usable and logs lost persistence. + * @param userData - Electron userData directory. + * @param source - Theme source confirmed by the owned application main frame. + */ +export function writeDesktopThemeCache(userData: string, source: DesktopThemeSource): void { + try { + const directory = join(userData, 'desktop') + mkdirSync(directory, { recursive: true, mode: 0o700 }) + writeFileSync(join(directory, 'theme-cache'), `${source}\n`, { mode: 0o600 }) + } catch (error) { + console.warn('desktop theme cache: appearance could not be saved for the next startup', error) + } +} diff --git a/apps/desktop/tests/main-startup.spec.ts b/apps/desktop/tests/main-startup.spec.ts index a5ffc8b9ba..cf9109aaf4 100644 --- a/apps/desktop/tests/main-startup.spec.ts +++ b/apps/desktop/tests/main-startup.spec.ts @@ -204,7 +204,12 @@ const harness = await vi.hoisted(async () => { let analyticsEnabled = true let analyticsEnabledListener: ((enabled: boolean) => void) | undefined const analytics = vi.fn(async (_event: unknown) => {}) - const nativeTheme = { themeSource: 'system', shouldUseDarkColors: false } + const nativeTheme = new class extends EventEmitter { + themeSource = 'system' + systemDark = false + get shouldUseDarkColors() { return this.themeSource === 'system' ? this.systemDark : this.themeSource === 'dark' } + set shouldUseDarkColors(value: boolean) { this.systemDark = value } + }() const trays: FakeTray[] = [] class FakeTray extends EventEmitter { readonly setToolTip = vi.fn() @@ -282,6 +287,7 @@ const harness = await vi.hoisted(async () => { loginShell.mockReset().mockImplementation(base => readLoginShell(base)) updateDownload.mockReset().mockImplementation(async () => updateState) updateInstall.mockReset().mockImplementation(async () => updateState) + nativeTheme.removeAllListeners() nativeTheme.themeSource = 'system'; nativeTheme.shouldUseDarkColors = false preparing = deferred(); prepared = deferred(); hostStarted = deferred() navigated = deferred(); dialogShown = deferred(); quitCompleted = deferred() @@ -1158,6 +1164,7 @@ describe('desktop main startup', () => { { role: 'toggleDevTools', visible: false, accelerator: 'F12' }, ]) } else { + expect(window.options).not.toHaveProperty('backgroundColor') expect(window.options).not.toHaveProperty('titleBarStyle') expect(window.options).not.toHaveProperty('vibrancy') } @@ -1172,6 +1179,53 @@ describe('desktop main startup', () => { expect(harness.windows[0]!.options).toMatchObject({ backgroundColor: color }) }) + describe.each(['win32', 'darwin'] as const)('cached theme on %s', (platform) => { + it.each([ + ['light', true, '#f9fafb'], ['dark', false, '#1b1b1c'], + ['system', true, '#1b1b1c'], ['system', false, '#f9fafb'], + ] as const)('restores %s with system dark=%s before creating the workspace', async (source, systemDark, color) => { + vi.spyOn(process, 'platform', 'get').mockReturnValue(platform) + const directory = join(harness.app.getPath('userData'), 'desktop') + mkdirSync(directory, { recursive: true }) + writeFileSync(join(directory, 'theme-cache'), `${source}\n`) + harness.nativeTheme.systemDark = systemDark + await import('../src/main.ts') + await harness.preparing.promise + expect(harness.nativeTheme.themeSource).toBe(source) + expect(harness.windows[0]!.options).toMatchObject({ backgroundColor: platform === 'darwin' ? '#00000000' : color }) + }) + }) + + it('tracks effective appearance changes and removes the listener when closed', async () => { + await import('../src/main.ts') + await harness.preparing.promise + const window = harness.windows[0]! + for (const dark of [true, false]) { + harness.nativeTheme.systemDark = dark + harness.nativeTheme.emit('updated') + expect(window.setBackgroundColor).toHaveBeenLastCalledWith(dark ? '#1b1b1c' : '#f9fafb') + } + window.emit('closed') + expect(harness.nativeTheme.listenerCount('updated')).toBe(0) + }) + + it('persists only theme sources from the owned application main frame', async () => { + await import('../src/main.ts') + await harness.preparing.promise + const window = harness.windows[0]! + const listener = harness.ipcOn.mock.calls.find(([channel]) => channel === DESKTOP_IPC.nativeThemeSet)![1] + const event = { sender: window.webContents, senderFrame: window.webContents.mainFrame } + listener({ ...event, senderFrame: { url: 'dsh-app://app/' } }, 'dark') + listener(event, 'invalid') + expect(harness.nativeTheme.themeSource).toBe('system') + listener(event, 'dark') + const { readDesktopThemeCache } = await import('../src/theme-cache.ts') + expect(readDesktopThemeCache(harness.app.getPath('userData'))).toBe('dark') + window.webContents.mainFrame.url = 'dsh-app://unowned/' + listener(event, 'light') + expect(readDesktopThemeCache(harness.app.getPath('userData'))).toBe('dark') + }) + it('serves packaged shell documents instead of rejecting the shell origin', async () => { const { serveWebDocument } = await import('../src/web-document.ts') vi.mocked(serveWebDocument).mockResolvedValue(new Response('shell document')) diff --git a/apps/desktop/tests/theme-cache.spec.ts b/apps/desktop/tests/theme-cache.spec.ts new file mode 100644 index 0000000000..4e199274aa --- /dev/null +++ b/apps/desktop/tests/theme-cache.spec.ts @@ -0,0 +1,40 @@ +import { mkdtempSync, rmSync, writeFileSync } from 'node:fs' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import { expect, it, onTestFinished, vi } from 'vitest' +import { readDesktopThemeCache, writeDesktopThemeCache } from '../src/theme-cache.ts' + +function fixture() { + const directory = mkdtempSync(join(tmpdir(), 'desktop-theme-')) + onTestFinished(() => { rmSync(directory, { recursive: true, force: true }) }) + return directory +} + +it('uses system appearance until a confirmed source is available', () => { + const directory = fixture() + expect(readDesktopThemeCache(directory)).toBe('system') + for (const source of ['dark', 'light', 'system'] as const) { + writeDesktopThemeCache(directory, source) + expect(readDesktopThemeCache(directory)).toBe(source) + } +}) + +it.each(['', '{invalid', 'DARK'])('uses system appearance for invalid cached source %j', (source) => { + const directory = fixture() + writeDesktopThemeCache(directory, 'dark') + writeFileSync(join(directory, 'desktop', 'theme-cache'), source) + const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) + onTestFinished(() => { warn.mockRestore() }) + expect(readDesktopThemeCache(directory)).toBe('system') + expect(warn).toHaveBeenCalledOnce() +}) + +it('keeps an unusable cache from blocking startup or theme changes', () => { + const directory = fixture() + writeFileSync(join(directory, 'desktop'), 'not a directory') + const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) + onTestFinished(() => { warn.mockRestore() }) + expect(() => { writeDesktopThemeCache(directory, 'dark') }).not.toThrow() + expect(warn).toHaveBeenCalledWith(expect.stringContaining('could not be saved'), expect.any(Error)) + expect(readDesktopThemeCache(directory)).toBe('system') +}) From 327aeefca1b4adde821ea1da912c360842a1bd14 Mon Sep 17 00:00:00 2001 From: winewill Date: Thu, 5 Nov 2026 14:02:47 +0800 Subject: [PATCH 253/322] Update welcome startup theme mock for native appearance events --- apps/desktop/tests/welcome-startup.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/desktop/tests/welcome-startup.spec.ts b/apps/desktop/tests/welcome-startup.spec.ts index e578c8a655..72b58551fb 100644 --- a/apps/desktop/tests/welcome-startup.spec.ts +++ b/apps/desktop/tests/welcome-startup.spec.ts @@ -40,7 +40,7 @@ const state = vi.hoisted(() => ({ windowOptions: undefined as BrowserWindowConstructorOptions | undefined, menu: vi.fn(), operations: undefined as WelcomeOperations | undefined, - nativeTheme: { themeSource: 'system', shouldUseDarkColors: false }, + nativeTheme: { themeSource: 'system', shouldUseDarkColors: false, on: vi.fn(), removeListener: vi.fn() }, })) vi.mock('../src/crash-report.ts', async importOriginal => ({ From ac60dc5188c465ff035d1c13d5ed734550e47cdd Mon Sep 17 00:00:00 2001 From: winewill Date: Thu, 5 Nov 2026 14:42:35 +0800 Subject: [PATCH 254/322] Read startup appearance from Host settings instead of a theme cache --- apps/desktop/README.i18n.yaml | 4 +-- apps/desktop/README.md | 2 +- apps/desktop/README.zh.md | 2 +- apps/desktop/src/main.ts | 5 ++- apps/desktop/src/theme-cache.ts | 39 --------------------- apps/desktop/src/welcome-backend.ts | 13 ++++++- apps/desktop/tests/main-startup.spec.ts | 33 +++++++++++------- apps/desktop/tests/theme-cache.spec.ts | 40 ---------------------- apps/desktop/tests/welcome-host.spec.ts | 22 +++++++++++- apps/desktop/tests/welcome-startup.spec.ts | 12 +++++-- 10 files changed, 70 insertions(+), 102 deletions(-) delete mode 100644 apps/desktop/src/theme-cache.ts delete mode 100644 apps/desktop/tests/theme-cache.spec.ts diff --git a/apps/desktop/README.i18n.yaml b/apps/desktop/README.i18n.yaml index 8b91815c2d..c32224ea8e 100644 --- a/apps/desktop/README.i18n.yaml +++ b/apps/desktop/README.i18n.yaml @@ -15,8 +15,8 @@ en: 127ea90553cb6af7 zh: 7b1c5aec8558c684 /deepseek-harness-desktop/application-overview: - en: 0896633a2d561d41 - zh: 5c143fad65016b8f + en: 2f28b37cee1e7869 + zh: 5755a5e97af90f12 /deepseek-harness-desktop/terminal-command: en: 5f2d25a1d8472647 zh: 2acb5c5d7d1917e2 diff --git a/apps/desktop/README.md b/apps/desktop/README.md index 8883f43b83..451aec6a95 100644 --- a/apps/desktop/README.md +++ b/apps/desktop/README.md @@ -31,7 +31,7 @@ Desktop runs the Harness workspace in a native application. This reference cover ## Application overview -Desktop restores the last confirmed application theme source before creating native windows. The cache is local to Electron userData; a missing, invalid or unreadable cache uses system appearance, and a write failure is logged without blocking theme changes. Windows workspace backgrounds remain opaque and follow the effective light/dark theme, including runtime changes; custom palettes use the built-in light/dark background approximation. macOS keeps its transparent sidebar vibrancy. On the first launch after upgrading from a version without this cache, the initial native palette follows the system until the application publishes its preference. +Desktop reads the effective application theme from the existing Host startup settings response before showing the welcome or workspace window. Missing or invalid optional theme settings use system appearance; invalid values are logged. Windows workspace backgrounds remain opaque and follow the effective light/dark theme, including runtime changes; custom palettes use the built-in light/dark background approximation. macOS keeps its transparent sidebar vibrancy. No separate theme cache is maintained. Electron caches the last confirmed UI language in `userData/desktop/locale-cache` so startup recovery dialogs can use it before Host settings are available. Missing, invalid, or unreadable caches fall back to the system language; cache write failures do not block startup. A successful Host startup or a UI language change refreshes the cache. Until then, a changed system language may differ from the cached language. diff --git a/apps/desktop/README.zh.md b/apps/desktop/README.zh.md index 6762d63930..54486bc53f 100644 --- a/apps/desktop/README.zh.md +++ b/apps/desktop/README.zh.md @@ -31,7 +31,7 @@ Desktop 在原生应用中运行 Harness 工作区。本参考文档说明应用 ## 应用概览 -Desktop 在创建原生窗口前恢复上次确认的应用主题来源。缓存保存在 Electron userData 中;缓存缺失、无效或不可读时使用系统外观,写入失败会记录日志但不阻止主题切换。Windows 工作区底色保持不透明,并跟随有效的浅色/深色主题及运行中的变化;自定义配色使用内置浅色/深色底色近似。macOS 保留透明侧边栏毛玻璃效果。从没有此缓存的版本升级后,首次启动的原生初始配色跟随系统,直到应用发布其主题偏好。 +Desktop 在显示欢迎页或工作区窗口前,从现有 Host 启动设置响应读取有效的应用主题。可选主题设置缺失或无效时使用系统外观;无效值会记录日志。Windows 工作区底色保持不透明,并跟随有效的浅色/深色主题及运行中的变化;自定义配色使用内置浅色/深色底色近似。macOS 保留透明侧边栏毛玻璃效果。不维护独立的主题缓存。 Electron 在 `userData/desktop/locale-cache` 缓存最近确认的界面语言,使启动恢复弹窗在 Host 设置尚不可用时也能使用该语言。缓存缺失、无效或不可读时回退到系统语言;缓存写入失败不阻断启动。Host 成功启动或界面语言变更时会刷新缓存;在此之前,变更后的系统语言可能与缓存语言不同。 diff --git a/apps/desktop/src/main.ts b/apps/desktop/src/main.ts index a621847e72..9a08349620 100644 --- a/apps/desktop/src/main.ts +++ b/apps/desktop/src/main.ts @@ -63,7 +63,6 @@ import { DesktopMandatoryUpdateWindow } from './mandatory-update-window.ts' import { DesktopPolicyTestAuth } from './policy-test-auth.ts' import { readDesktopSettings } from './settings.ts' import { readDesktopLocaleCache, writeDesktopLocaleCache } from './locale-cache.ts' -import { readDesktopThemeCache, writeDesktopThemeCache } from './theme-cache.ts' import { DesktopUpdateDialog, type UpdateDialogOptions } from './update-dialog.ts' import { readDesktopRuntime } from './runtime-tree.ts' import { DesktopBrowserGuests } from './browser-guests.ts' @@ -82,7 +81,6 @@ let shuttingDown = false */ let skipQuitConfirmation = false let windowsLanguage: string | undefined = readDesktopLocaleCache(app.getPath('userData')) -nativeTheme.themeSource = readDesktopThemeCache(app.getPath('userData')) /** * Whether the backend has reached ready: false until the first ready, back to * false when a restart returns it to starting, frozen during shutdown so a @@ -886,7 +884,6 @@ async function main(): Promise { || !event.senderFrame.url.startsWith(`${SCHEME}://app/`)) return if (source !== 'light' && source !== 'dark' && source !== 'system') return nativeTheme.themeSource = source - writeDesktopThemeCache(app.getPath('userData'), source) }) ipcMain.handle(DESKTOP_IPC.localeBootstrap, async (event) => { if (event.sender !== mainWindow?.webContents || event.senderFrame !== mainWindow.webContents.mainFrame @@ -1360,6 +1357,7 @@ async function main(): Promise { const window = mainWindow ?? createMainWindow() await navigateMain(applicationUrl) if (isQuitting() || recovery.active || window.isDestroyed()) return + if (process.platform === 'win32') window.setBackgroundColor(chromeFallbackFill()) if (activate) window.show() else window.showInactive() enteredWorkspace = true @@ -1443,6 +1441,7 @@ async function main(): Promise { if (quitting || recovery.active) return const state = await readWelcomeState() if (isQuitting() || backend.state.phase !== 'ready') return + nativeTheme.themeSource = state.themePreference locale = resolveDesktopStartupLocale(state.localePreference, systemLanguages) writeDesktopLocaleCache(app.getPath('userData'), locale.id) windowsLanguage = locale.id diff --git a/apps/desktop/src/theme-cache.ts b/apps/desktop/src/theme-cache.ts deleted file mode 100644 index 833d5ebd07..0000000000 --- a/apps/desktop/src/theme-cache.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** Last confirmed application theme source for native windows before renderer startup. */ -import { mkdirSync, readFileSync, writeFileSync } from 'node:fs' -import { join } from 'node:path' - -/** Theme sources supported by Electron and the application theme selector. */ -export type DesktopThemeSource = 'system' | 'light' | 'dark' - -/** - * Read the last confirmed source; missing or unusable cache falls back to the system. - * @param userData - Electron userData directory. - * @returns Cached theme source or system fallback. - */ -export function readDesktopThemeCache(userData: string): DesktopThemeSource { - try { - const value = readFileSync(join(userData, 'desktop', 'theme-cache'), 'utf8').trim() - if (value === 'system' || value === 'light' || value === 'dark') return value - throw new Error('expected system, light or dark') - } catch (error) { - if ((error as NodeJS.ErrnoException).code !== 'ENOENT') { - console.warn('desktop theme cache: using system appearance because the cache could not be read', error) - } - return 'system' - } -} - -/** - * Remember a confirmed source; failure leaves the active theme usable and logs lost persistence. - * @param userData - Electron userData directory. - * @param source - Theme source confirmed by the owned application main frame. - */ -export function writeDesktopThemeCache(userData: string, source: DesktopThemeSource): void { - try { - const directory = join(userData, 'desktop') - mkdirSync(directory, { recursive: true, mode: 0o700 }) - writeFileSync(join(directory, 'theme-cache'), `${source}\n`, { mode: 0o600 }) - } catch (error) { - console.warn('desktop theme cache: appearance could not be saved for the next startup', error) - } -} diff --git a/apps/desktop/src/welcome-backend.ts b/apps/desktop/src/welcome-backend.ts index 15b0932cb2..93648f7101 100644 --- a/apps/desktop/src/welcome-backend.ts +++ b/apps/desktop/src/welcome-backend.ts @@ -10,6 +10,8 @@ export interface WelcomeState { readonly hasApiKey: boolean readonly writable: boolean readonly localePreference: string | null + /** Effective Host theme preference; absent or invalid optional theme settings use system appearance. */ + readonly themePreference: 'light' | 'dark' | 'system' } /** Narrow operations available to the native welcome flow. */ @@ -19,7 +21,7 @@ export interface DesktopWelcomeBackend { readonly account: DesktopAccountBackend /** @param event - desktop-owned fields. @returns after local Host intake. */ report(event: ProductEvent): Promise - /** @returns Configured-key presence and the shared language preference, without credential values. */ + /** @returns Configured-key presence and the shared language and theme preferences, without credential values. */ read(): Promise /** @returns The saved UI language without account or provider requests. */ readLocalePreference(): Promise @@ -85,6 +87,14 @@ export function connectDesktopWelcome( } return locale.value.preference ?? null } + const themePreference = (namespaces: unknown[]): WelcomeState['themePreference'] => { + const theme = namespaces.find(item => record(item) && item.ns === 'ui-theme') + if (theme === undefined) return 'system' + const preference = record(theme) && record(theme.value) ? theme.value.preference : undefined + if (preference === 'light' || preference === 'dark' || preference === 'system') return preference + console.warn('desktop appearance: invalid Host theme preference; using system appearance') + return 'system' + } const read = async (): Promise => { const { settings, ref } = await settingsAndReference() const providers = await invoke({ namespace: 'llm', method: 'listConfigurableProviders', args: {} }) @@ -116,6 +126,7 @@ export function connectDesktopWelcome( hasApiKey: Object.values(states).some(value => record(value) && value.configured === true), writable: ref !== undefined && record(states[ref]) && states[ref].writable === true, localePreference: localePreference(namespaces), + themePreference: themePreference(namespaces), } } return { diff --git a/apps/desktop/tests/main-startup.spec.ts b/apps/desktop/tests/main-startup.spec.ts index cf9109aaf4..8c58dec463 100644 --- a/apps/desktop/tests/main-startup.spec.ts +++ b/apps/desktop/tests/main-startup.spec.ts @@ -156,7 +156,7 @@ const harness = await vi.hoisted(async () => { readonly updateTasks = vi.fn(async (_action: 'inspect' | 'lock' | 'unlock') => false) readonly inspectQuit = vi.fn(async () => ({ activeTasks: false, scheduledTasks: false })) url = 'http://127.0.0.1:3080/?token=test' - fetch = vi.fn(async () => Response.json({ hasApiKey: true, writable: true, localePreference: null })) + fetch = vi.fn(async () => Response.json({ hasApiKey: true, writable: true, localePreference: null, themePreference: 'system' })) readonly ready = deferred() readonly exited = deferred() readonly stopping = deferred() @@ -1179,20 +1179,30 @@ describe('desktop main startup', () => { expect(harness.windows[0]!.options).toMatchObject({ backgroundColor: color }) }) - describe.each(['win32', 'darwin'] as const)('cached theme on %s', (platform) => { + describe.each(['win32', 'darwin'] as const)('Host theme on %s', (platform) => { it.each([ ['light', true, '#f9fafb'], ['dark', false, '#1b1b1c'], ['system', true, '#1b1b1c'], ['system', false, '#f9fafb'], - ] as const)('restores %s with system dark=%s before creating the workspace', async (source, systemDark, color) => { + ] as const)('applies %s with system dark=%s before revealing the workspace', async (source, systemDark, color) => { vi.spyOn(process, 'platform', 'get').mockReturnValue(platform) - const directory = join(harness.app.getPath('userData'), 'desktop') - mkdirSync(directory, { recursive: true }) - writeFileSync(join(directory, 'theme-cache'), `${source}\n`) harness.nativeTheme.systemDark = systemDark await import('../src/main.ts') await harness.preparing.promise - expect(harness.nativeTheme.themeSource).toBe(source) - expect(harness.windows[0]!.options).toMatchObject({ backgroundColor: platform === 'darwin' ? '#00000000' : color }) + const window = harness.windows[0]! + expect(window.show).not.toHaveBeenCalled() + harness.prepared.resolve() + await harness.hostStarted.promise + const host = harness.hosts[0]! + host.fetch.mockResolvedValue(Response.json({ hasApiKey: true, localePreference: null, themePreference: source })) + window.show.mockImplementation(() => { + expect(harness.nativeTheme.themeSource).toBe(source) + if (platform === 'win32') expect(window.setBackgroundColor).toHaveBeenLastCalledWith(color) + else expect(window.options).toMatchObject({ backgroundColor: '#00000000', vibrancy: 'sidebar' }) + }) + host.ready.resolve() + await Promise.resolve(invoke(DESKTOP_IPC.boot)) + await vi.waitFor(() => { expect(window.show).toHaveBeenCalledOnce() }) + expect(host.fetch).toHaveBeenCalledOnce() }) }) @@ -1209,7 +1219,7 @@ describe('desktop main startup', () => { expect(harness.nativeTheme.listenerCount('updated')).toBe(0) }) - it('persists only theme sources from the owned application main frame', async () => { + it('accepts only theme sources from the owned application main frame', async () => { await import('../src/main.ts') await harness.preparing.promise const window = harness.windows[0]! @@ -1219,11 +1229,10 @@ describe('desktop main startup', () => { listener(event, 'invalid') expect(harness.nativeTheme.themeSource).toBe('system') listener(event, 'dark') - const { readDesktopThemeCache } = await import('../src/theme-cache.ts') - expect(readDesktopThemeCache(harness.app.getPath('userData'))).toBe('dark') + expect(harness.nativeTheme.themeSource).toBe('dark') window.webContents.mainFrame.url = 'dsh-app://unowned/' listener(event, 'light') - expect(readDesktopThemeCache(harness.app.getPath('userData'))).toBe('dark') + expect(harness.nativeTheme.themeSource).toBe('dark') }) it('serves packaged shell documents instead of rejecting the shell origin', async () => { diff --git a/apps/desktop/tests/theme-cache.spec.ts b/apps/desktop/tests/theme-cache.spec.ts deleted file mode 100644 index 4e199274aa..0000000000 --- a/apps/desktop/tests/theme-cache.spec.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { mkdtempSync, rmSync, writeFileSync } from 'node:fs' -import { tmpdir } from 'node:os' -import { join } from 'node:path' -import { expect, it, onTestFinished, vi } from 'vitest' -import { readDesktopThemeCache, writeDesktopThemeCache } from '../src/theme-cache.ts' - -function fixture() { - const directory = mkdtempSync(join(tmpdir(), 'desktop-theme-')) - onTestFinished(() => { rmSync(directory, { recursive: true, force: true }) }) - return directory -} - -it('uses system appearance until a confirmed source is available', () => { - const directory = fixture() - expect(readDesktopThemeCache(directory)).toBe('system') - for (const source of ['dark', 'light', 'system'] as const) { - writeDesktopThemeCache(directory, source) - expect(readDesktopThemeCache(directory)).toBe(source) - } -}) - -it.each(['', '{invalid', 'DARK'])('uses system appearance for invalid cached source %j', (source) => { - const directory = fixture() - writeDesktopThemeCache(directory, 'dark') - writeFileSync(join(directory, 'desktop', 'theme-cache'), source) - const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) - onTestFinished(() => { warn.mockRestore() }) - expect(readDesktopThemeCache(directory)).toBe('system') - expect(warn).toHaveBeenCalledOnce() -}) - -it('keeps an unusable cache from blocking startup or theme changes', () => { - const directory = fixture() - writeFileSync(join(directory, 'desktop'), 'not a directory') - const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) - onTestFinished(() => { warn.mockRestore() }) - expect(() => { writeDesktopThemeCache(directory, 'dark') }).not.toThrow() - expect(warn).toHaveBeenCalledWith(expect.stringContaining('could not be saved'), expect.any(Error)) - expect(readDesktopThemeCache(directory)).toBe('system') -}) diff --git a/apps/desktop/tests/welcome-host.spec.ts b/apps/desktop/tests/welcome-host.spec.ts index d5dfb480a2..5f96a75bd8 100644 --- a/apps/desktop/tests/welcome-host.spec.ts +++ b/apps/desktop/tests/welcome-host.spec.ts @@ -32,13 +32,33 @@ const url = 'http://127.0.0.1:19387/' const cookie = 'dsh-auth-fixture=signed' describe('desktop welcome Web operations', () => { + it.each(['light', 'dark', 'system'] as const)('reads the live %s theme in the existing settings request', async (preference) => { + const host = transport() + host.namespaces.push({ ns: 'ui-theme', value: { preference } }) + const backend = connectDesktopWelcome(url, cookie, host.send) + expect(await backend.read()).toMatchObject({ themePreference: preference }) + expect(host.send.mock.calls.filter(([input]) => input.endsWith('/api/settings/describe'))).toHaveLength(1) + host.namespaces.find(item => item.ns === 'ui-theme')!.value.preference = 'system' + expect(await backend.read()).toMatchObject({ themePreference: 'system' }) + }) + + it('falls back for an invalid optional theme without blocking startup metadata', async () => { + const host = transport() + host.namespaces.push({ ns: 'ui-theme', value: { preference: 'invalid' } }) + const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) + try { + expect(await connectDesktopWelcome(url, cookie, host.send).read()).toMatchObject({ themePreference: 'system' }) + expect(warn).toHaveBeenCalledOnce() + } finally { warn.mockRestore() } + }) + it('authenticates with the explicit Host cookie and stores only through the configured credential reference', async () => { const host = transport() const backend = connectDesktopWelcome(url, cookie, host.send) expect(await backend.analyticsEnabled()).toBe(true) expect(await backend.save('sk-example')).toEqual({ ok: true }) expect(host.keys.get('CUSTOM_DEEPSEEK_KEY')).toBe('sk-example') - expect(await backend.read()).toEqual({ loggedIn: false, hasApiKey: true, writable: true, localePreference: null }) + expect(await backend.read()).toEqual({ loggedIn: false, hasApiKey: true, writable: true, localePreference: null, themePreference: 'system' }) for (const [input, init] of host.send.mock.calls) { expect(input).toMatch(/^http:\/\/127\.0\.0\.1:19387\/api\//u) expect(init).toMatchObject({ redirect: 'error', headers: { cookie } }) diff --git a/apps/desktop/tests/welcome-startup.spec.ts b/apps/desktop/tests/welcome-startup.spec.ts index 72b58551fb..1f9bc8a5cf 100644 --- a/apps/desktop/tests/welcome-startup.spec.ts +++ b/apps/desktop/tests/welcome-startup.spec.ts @@ -33,6 +33,7 @@ const state = vi.hoisted(() => ({ closeWelcome: vi.fn(), welcomeLocale: undefined as DesktopLocale | undefined, preference: 'zh', + themePreference: 'system', hasApiKey: false, handlers: new Map unknown>(), listeners: new Map void>(), @@ -82,6 +83,7 @@ vi.mock('electron', () => ({ focus = state.focusWorkspace moveTop = state.moveTopWorkspace hide = vi.fn() + setBackgroundColor = vi.fn() show = state.showWorkspace showInactive = state.showInactiveWorkspace async loadURL(url: string) { state.contents = this.webContents; await state.loadWorkspace(url); this.ready?.() } @@ -120,6 +122,7 @@ vi.mock('../src/host-process.ts', () => ({ fetch() { return Promise.resolve(Response.json({ loggedIn: false, hasApiKey: state.hasApiKey, writable: true, localePreference: state.preference, + themePreference: state.themePreference, })) } }, @@ -130,7 +133,8 @@ vi.mock('../src/welcome-backend.ts', () => ({ readLocalePreference: async () => state.preference, read: async () => { await state.beforeRead() - return { loggedIn: false, hasApiKey: state.hasApiKey, writable: true, localePreference: state.preference } + return { loggedIn: false, hasApiKey: state.hasApiKey, writable: true, + localePreference: state.preference, themePreference: state.themePreference } }, save: async () => ({ ok: true }), account: { @@ -178,6 +182,7 @@ it.each([false, true])('starts welcome onboarding without carrying update focus vi.resetModules() vi.clearAllMocks() state.preference = 'zh' + state.themePreference = updated ? 'dark' : 'light' state.hasApiKey = false state.operations = undefined state.accountState.mockResolvedValue({ status: 'signed-out', attempt: null, links: { usageUrl: '', topUpUrl: '' } }) @@ -196,7 +201,10 @@ it.each([false, true])('starts welcome onboarding without carrying update focus const reading = Promise.withResolvers() const loading = Promise.withResolvers() state.beforeRead.mockReturnValueOnce(reading.promise) - state.beforeWelcome.mockReturnValueOnce(loading.promise) + state.beforeWelcome.mockImplementationOnce(async () => { + expect(state.nativeTheme.themeSource).toBe(state.themePreference) + await loading.promise + }) const activate = () => { state.appListeners.get('second-instance')!() state.appListeners.get('open-url')!({ preventDefault: vi.fn() }, 'dsh://open') From d456f6c58b5e4a47e6375332fe237dcc7f1f7829 Mon Sep 17 00:00:00 2001 From: winewill Date: Thu, 5 Nov 2026 15:04:23 +0800 Subject: [PATCH 255/322] fix(theme): preserve boot preference during client initialization --- packages/client/ui-theme/README.i18n.yaml | 4 +-- packages/client/ui-theme/README.md | 2 +- packages/client/ui-theme/README.zh.md | 2 +- packages/client/ui-theme/src/client/index.ts | 10 +++++- .../__snapshots__/theme.client.spec.ts.snap | 22 +++++++++++++ .../ui-theme/tests/theme.client.spec.ts | 33 +++++++++++++++++++ 6 files changed, 68 insertions(+), 5 deletions(-) create mode 100644 packages/client/ui-theme/tests/__snapshots__/theme.client.spec.ts.snap diff --git a/packages/client/ui-theme/README.i18n.yaml b/packages/client/ui-theme/README.i18n.yaml index 41a3730f86..d5fb6b6388 100644 --- a/packages/client/ui-theme/README.i18n.yaml +++ b/packages/client/ui-theme/README.i18n.yaml @@ -27,8 +27,8 @@ en: 5244fc168d0a03f8 zh: c7ab12fdf8c6c55b /deepseek-ai-dsh-client-ui-theme/use-this-package/pre-plugin-palette: - en: 203523ddd7927c34 - zh: 31dd89da78f9ab4f + en: 18f62cd5e6d32570 + zh: 728ddd17d7610470 /deepseek-ai-dsh-client-ui-theme/understand-the-implementation: en: 3eb9b0e3365b2db3 zh: c73acc55dd897266 diff --git a/packages/client/ui-theme/README.md b/packages/client/ui-theme/README.md index 197b3031a4..63fb6060d4 100644 --- a/packages/client/ui-theme/README.md +++ b/packages/client/ui-theme/README.md @@ -45,7 +45,7 @@ A composition can register a third-party theme id with alias-token overrides thr ### Pre-plugin palette -When the host composition includes an HTTP server, the host half embeds the registered `ui-theme` settings, or schema defaults, into each index response. Head CSS selects the document canvas color scheme before any script runs, including a `prefers-color-scheme` query for the `system` preference. A body script then sets `body[data-ds-dark-theme]`, `--dsh-content-font-size`, `--dsh-code-font-size`, `--dsh-terminal-font-size`, and each non-empty `--dsh-font-family-` list before the loading page and application scripts, so the first paint uses the selected palette and text and code sizes, and `ThemeRuntime` starts from the saved sizes and fonts instead of rendering the defaults first. +When the host composition includes an HTTP server, the host half embeds the registered `ui-theme` settings, or schema defaults, into each index response. Head CSS selects the document canvas color scheme before any script runs, including a `prefers-color-scheme` query for the `system` preference. A body script then sets `body[data-ds-dark-theme]`, `--dsh-content-font-size`, `--dsh-code-font-size`, `--dsh-terminal-font-size`, and each non-empty `--dsh-font-family-` list before the loading page and application scripts, so the first paint uses the selected palette and text and code sizes, and `ThemeRuntime` starts from the saved preference, sizes, and fonts instead of rendering the defaults first. ----- diff --git a/packages/client/ui-theme/README.zh.md b/packages/client/ui-theme/README.zh.md index c83bea91bc..8a61ad71f3 100644 --- a/packages/client/ui-theme/README.zh.md +++ b/packages/client/ui-theme/README.zh.md @@ -45,7 +45,7 @@ Desktop 的固定快捷键 `Cmd`/`Ctrl` + `+`(或 `=`)和 `Cmd`/`Ctrl` + `-` ### 插件前调色板 -当主机组合包含 HTTP 服务器时,宿主侧会把已注册的 `ui-theme` 设置或 schema 默认值嵌入每份 index 响应。head CSS 会在任何脚本运行前选择文档画布的配色方案,其中 `system` 偏好使用 `prefers-color-scheme` 查询;随后,body 脚本会在加载页面和应用脚本之前设置 `body[data-ds-dark-theme]`、`--dsh-content-font-size`、`--dsh-code-font-size`、`--dsh-terminal-font-size` 以及每个非空的 `--dsh-font-family-` 列表,因此首帧绘制就采用所选调色板与正文、代码字号,`ThemeRuntime` 也从已保存的字号与字体开始,不会先渲染默认值。 +当主机组合包含 HTTP 服务器时,宿主侧会把已注册的 `ui-theme` 设置或 schema 默认值嵌入每份 index 响应。head CSS 会在任何脚本运行前选择文档画布的配色方案,其中 `system` 偏好使用 `prefers-color-scheme` 查询;随后,body 脚本会在加载页面和应用脚本之前设置 `body[data-ds-dark-theme]`、`--dsh-content-font-size`、`--dsh-code-font-size`、`--dsh-terminal-font-size` 以及每个非空的 `--dsh-font-family-` 列表,因此首帧绘制就采用所选调色板与正文、代码字号,`ThemeRuntime` 也从已保存的主题偏好、字号与字体开始,不会先渲染默认值。 ----- diff --git a/packages/client/ui-theme/src/client/index.ts b/packages/client/ui-theme/src/client/index.ts index a020fc35ae..8d58904a9e 100644 --- a/packages/client/ui-theme/src/client/index.ts +++ b/packages/client/ui-theme/src/client/index.ts @@ -202,7 +202,7 @@ export class ThemeRuntime { constructor(ctx: ClientContext, host: ConfigForm) { this.ctx = ctx this.host = host - this.preference = DEFAULT_PREFERENCE + this.preference = bootstrapPreference() // Non-browser runs (node e2e booting the client tree) have no matchMedia. this.media = typeof matchMedia === 'undefined' ? undefined : matchMedia('(prefers-color-scheme: dark)') this.snapshot = this.buildSnapshot() @@ -439,6 +439,14 @@ export class ThemeRuntime { } } +/** Preserve the Host boot palette while the settings scope is loading. */ +function bootstrapPreference(): ThemePreference { + /* v8 ignore next -- documentless client compositions have no boot injection */ + if (typeof document === 'undefined') return DEFAULT_PREFERENCE + const preference = document.documentElement.dataset.dsThemeSource + return isThemePreference(preference) ? preference : DEFAULT_PREFERENCE +} + /** * Read the font sizes the Host boot script wrote on `body` before any plugin * ran, so the initial snapshot matches first paint and ui-layout's presenter diff --git a/packages/client/ui-theme/tests/__snapshots__/theme.client.spec.ts.snap b/packages/client/ui-theme/tests/__snapshots__/theme.client.spec.ts.snap new file mode 100644 index 0000000000..70e9e9663e --- /dev/null +++ b/packages/client/ui-theme/tests/__snapshots__/theme.client.spec.ts.snap @@ -0,0 +1,22 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`ThemeRuntime > preserves boot preference dark until Host settings arrive 1`] = ` +{ + "palette": "dark", + "preference": "dark", +} +`; + +exports[`ThemeRuntime > preserves boot preference light until Host settings arrive 1`] = ` +{ + "palette": "light", + "preference": "light", +} +`; + +exports[`ThemeRuntime > preserves boot preference system until Host settings arrive 1`] = ` +{ + "palette": "light", + "preference": "system", +} +`; diff --git a/packages/client/ui-theme/tests/theme.client.spec.ts b/packages/client/ui-theme/tests/theme.client.spec.ts index 552ed34d04..c32b128faa 100644 --- a/packages/client/ui-theme/tests/theme.client.spec.ts +++ b/packages/client/ui-theme/tests/theme.client.spec.ts @@ -1,4 +1,6 @@ // @vitest-environment jsdom +import { runInNewContext } from 'node:vm' +import { bootThemeInjections } from '../src/boot-theme.ts' import { afterEach, describe, expect, it, vi } from 'vitest' import { Context } from '@deepseek-ai/cordis' import { stubConfigForm, type StubConfigForm } from '@deepseek-ai/dsh-client-test-runtime' @@ -33,6 +35,37 @@ describe('ThemeRuntime', () => { expect(snapshot.themes.map(t => t.id)).toEqual(['light', 'dark']) }) + it.each(['light', 'dark', 'system'] as const)('preserves boot preference %s until Host settings arrive', (preference) => { + for (const row of bootThemeInjections(preference)) { + if (row.kind === 'script') runInNewContext(row.text, { document }) + } + try { + const { theme, host, events } = make() + expect(theme.getTheme().preference).toBe(preference) + expect({ preference: theme.getTheme().preference, palette: theme.getTheme().active.colorScheme }).toMatchSnapshot() + expect(events).toEqual([]) + host.publish({ status: 'ready', value: { + preference: 'light', fontSize: 14, codeFontSize: 13, terminalFontSize: 13, + textFontFamily: '', codeFontFamily: '', terminalFontFamily: '', + }, revision: 1, writable: true }) + expect(theme.getTheme().preference).toBe('light') + expect(host.set).not.toHaveBeenCalled() + } finally { + delete document.documentElement.dataset.dsThemeSource + document.body.removeAttribute('data-ds-dark-theme') + document.body.removeAttribute('style') + } + }) + + it('uses the default when the boot preference is invalid', () => { + document.documentElement.dataset.dsThemeSource = 'invalid' + try { + expect(make().theme.getTheme().preference).toBe('system') + } finally { + delete document.documentElement.dataset.dsThemeSource + } + }) + it('seeds the initial font size from the boot-script body variable, ignoring junk', () => { // The Host boot script writes the durable size on body before any plugin // runs; the first snapshot must match it so activation never flashes 14. From 5e17999f7821b9557e28943c03db9d864aa00b50 Mon Sep 17 00:00:00 2001 From: winewill Date: Thu, 5 Nov 2026 15:12:19 +0800 Subject: [PATCH 256/322] docs(desktop): describe current startup theme behavior --- apps/desktop/README.i18n.yaml | 4 ++-- apps/desktop/README.md | 2 +- apps/desktop/README.zh.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/desktop/README.i18n.yaml b/apps/desktop/README.i18n.yaml index c32224ea8e..d36cd62277 100644 --- a/apps/desktop/README.i18n.yaml +++ b/apps/desktop/README.i18n.yaml @@ -15,8 +15,8 @@ en: 127ea90553cb6af7 zh: 7b1c5aec8558c684 /deepseek-harness-desktop/application-overview: - en: 2f28b37cee1e7869 - zh: 5755a5e97af90f12 + en: 1f59637852e162b4 + zh: b1530a1af195cb92 /deepseek-harness-desktop/terminal-command: en: 5f2d25a1d8472647 zh: 2acb5c5d7d1917e2 diff --git a/apps/desktop/README.md b/apps/desktop/README.md index 451aec6a95..1e9c3a595d 100644 --- a/apps/desktop/README.md +++ b/apps/desktop/README.md @@ -31,7 +31,7 @@ Desktop runs the Harness workspace in a native application. This reference cover ## Application overview -Desktop reads the effective application theme from the existing Host startup settings response before showing the welcome or workspace window. Missing or invalid optional theme settings use system appearance; invalid values are logged. Windows workspace backgrounds remain opaque and follow the effective light/dark theme, including runtime changes; custom palettes use the built-in light/dark background approximation. macOS keeps its transparent sidebar vibrancy. No separate theme cache is maintained. +Desktop reads the effective application theme from the Host startup settings response before showing the welcome or workspace window. Missing or invalid optional theme settings use system appearance; invalid values are logged. Windows workspace backgrounds remain opaque and follow the effective light/dark theme, including runtime changes; custom palettes use the built-in light/dark background approximation. macOS windows use a transparent background with sidebar vibrancy. Electron caches the last confirmed UI language in `userData/desktop/locale-cache` so startup recovery dialogs can use it before Host settings are available. Missing, invalid, or unreadable caches fall back to the system language; cache write failures do not block startup. A successful Host startup or a UI language change refreshes the cache. Until then, a changed system language may differ from the cached language. diff --git a/apps/desktop/README.zh.md b/apps/desktop/README.zh.md index 54486bc53f..96c44ba1e2 100644 --- a/apps/desktop/README.zh.md +++ b/apps/desktop/README.zh.md @@ -31,7 +31,7 @@ Desktop 在原生应用中运行 Harness 工作区。本参考文档说明应用 ## 应用概览 -Desktop 在显示欢迎页或工作区窗口前,从现有 Host 启动设置响应读取有效的应用主题。可选主题设置缺失或无效时使用系统外观;无效值会记录日志。Windows 工作区底色保持不透明,并跟随有效的浅色/深色主题及运行中的变化;自定义配色使用内置浅色/深色底色近似。macOS 保留透明侧边栏毛玻璃效果。不维护独立的主题缓存。 +Desktop 在显示欢迎页或工作区窗口前,从 Host 启动设置响应读取有效的应用主题。可选主题设置缺失或无效时使用系统外观;无效值会记录日志。Windows 工作区底色保持不透明,并跟随有效的浅色/深色主题及运行中的变化;自定义配色使用内置浅色/深色底色近似。macOS 窗口使用透明背景和侧边栏毛玻璃效果。 Electron 在 `userData/desktop/locale-cache` 缓存最近确认的界面语言,使启动恢复弹窗在 Host 设置尚不可用时也能使用该语言。缓存缺失、无效或不可读时回退到系统语言;缓存写入失败不阻断启动。Host 成功启动或界面语言变更时会刷新缓存;在此之前,变更后的系统语言可能与缓存语言不同。 From 481641b1b96300b84ecb97540f37f5d30d8a3b20 Mon Sep 17 00:00:00 2001 From: Yichen Jiang Date: Thu, 5 Nov 2026 16:51:29 +0800 Subject: [PATCH 257/322] feat(worktrees): add the retain-on-archive switch `retainOnArchive`, a volatile field of the worktree service's Config, skips cleanup admission while it is on; it is read at each archive, so a change applies to later archives only. The service keeps its instance off the generated Settings pages, and the Forge client draws the switch as the `plugins.row.config` page of the bundle's `worktree` row, staged through the shared Plugins form until one explicit save. Docs: the worktree, Forge, and bundle READMEs, the archive-worktrees upgrade guide, the config and client catalogs, and the explicit-worktree-creation note. --- ...09-13-explicit-worktree-creation.i18n.yaml | 4 +- .../2026-09-13-explicit-worktree-creation.md | 2 +- ...026-09-13-explicit-worktree-creation.zh.md | 2 +- docs/config-catalog.md | 7 +- docs/config-catalog.zh.md | 7 +- .../archive-worktrees/guide.i18n.yaml | 8 +-- .../v0.2.2-rc.1/archive-worktrees/guide.md | 4 +- .../v0.2.2-rc.1/archive-worktrees/guide.zh.md | 4 +- .../client-ui-forge/README.i18n.yaml | 4 +- .../experimental/client-ui-forge/README.md | 2 +- .../experimental/client-ui-forge/README.zh.md | 2 +- .../experimental/client-ui-forge/package.json | 4 ++ .../src/client/WorktreeSettings.module.css | 29 ++++++++ .../src/client/WorktreeSettings.tsx | 42 ++++++++++++ .../client-ui-forge/src/client/locales.ts | 56 ++++++++++++++++ .../client-ui-forge/src/client/mount.ts | 17 ++++- .../src/client/worktree-settings-form.ts | 43 ++++++++++++ .../tests/mount.client.spec.ts | 34 +++++++++- .../tests/worktree-settings.client.spec.tsx | 66 +++++++++++++++++++ .../client-ui-forge/tsconfig.client.json | 6 ++ .../forge-bundle/README.i18n.yaml | 4 +- packages/experimental/forge-bundle/README.md | 2 +- .../experimental/forge-bundle/README.zh.md | 2 +- .../experimental/worktree/README.i18n.yaml | 4 +- packages/experimental/worktree/README.md | 4 +- packages/experimental/worktree/README.zh.md | 4 +- packages/experimental/worktree/package.json | 2 + packages/experimental/worktree/src/archive.ts | 3 + packages/experimental/worktree/src/index.ts | 13 +++- .../worktree/tests/archive.spec.ts | 18 ++++- .../experimental/worktree/tests/harness.ts | 5 +- .../worktree/tests/settings.spec.ts | 36 ++++++++++ packages/experimental/worktree/tsconfig.json | 3 + .../src/client/slot-catalog.ts | 4 +- pnpm-lock.yaml | 9 +++ 35 files changed, 414 insertions(+), 42 deletions(-) create mode 100644 packages/experimental/client-ui-forge/src/client/WorktreeSettings.module.css create mode 100644 packages/experimental/client-ui-forge/src/client/WorktreeSettings.tsx create mode 100644 packages/experimental/client-ui-forge/src/client/worktree-settings-form.ts create mode 100644 packages/experimental/client-ui-forge/tests/worktree-settings.client.spec.tsx create mode 100644 packages/experimental/worktree/tests/settings.spec.ts diff --git a/.agents/notes/implemented/feature/2026-09-13-explicit-worktree-creation.i18n.yaml b/.agents/notes/implemented/feature/2026-09-13-explicit-worktree-creation.i18n.yaml index e1ed63684a..b5373db47c 100644 --- a/.agents/notes/implemented/feature/2026-09-13-explicit-worktree-creation.i18n.yaml +++ b/.agents/notes/implemented/feature/2026-09-13-explicit-worktree-creation.i18n.yaml @@ -9,8 +9,8 @@ en: 12ab239ab0c58e31 zh: c32874442ce66041 /agent-note-explicit-worktree-creation/decision: - en: 77fd7d1b0f2b4840 - zh: 0d3b1d86a75c442a + en: 92782d5964d1a021 + zh: 37b385836e9ae2b9 /agent-note-explicit-worktree-creation/alternatives-considered: en: 72d42e892a37b94c zh: 92a14a51c6a89c53 diff --git a/.agents/notes/implemented/feature/2026-09-13-explicit-worktree-creation.md b/.agents/notes/implemented/feature/2026-09-13-explicit-worktree-creation.md index 06cf905f45..33cabb9b8e 100644 --- a/.agents/notes/implemented/feature/2026-09-13-explicit-worktree-creation.md +++ b/.agents/notes/implemented/feature/2026-09-13-explicit-worktree-creation.md @@ -18,7 +18,7 @@ Git and directory creation use the mounted subprocess and sandbox providers with Leaving uses the shared working-directory operation and retains the checkout and branch. Failed setup can retain partial artifacts and reports their location. The service does not own a branch merge policy or a task association database. -The service records each creation as a `plugin:worktree/created` record and owns archive-triggered cleanup of those checkouts, as the job and Agent registries own their archive-admission families. A Session's inherited prefix decides whether it created a checkout or merely refers to one; cwd alone never grants cleanup ownership. Admission registers the attempt inside the Workspace write queue and returns; inspection reads cold Sessions through the projection cache or their log, without starting an Agent, and runs afterwards. Only a clean, unreferenced checkout is removed, without force and without deleting its branch; tracked changes and untracked files retain it, ignored files do not, matching Git's own non-force refusal. Processes and terminals are not consulted. Unarchiving cancels an unadmitted removal and waits for an admitted one, and directory entry into a checkout being removed waits for that removal. No startup sweep deletes previously archived worktrees. +The service records each creation as a `plugin:worktree/created` record and owns archive-triggered cleanup of those checkouts, as the job and Agent registries own their archive-admission families. A Session's inherited prefix decides whether it created a checkout or merely refers to one; cwd alone never grants cleanup ownership. Admission registers the attempt inside the Workspace write queue and returns; inspection reads cold Sessions through the projection cache or their log, without starting an Agent, and runs afterwards. Only a clean, unreferenced checkout is removed, without force and without deleting its branch; tracked changes and untracked files retain it, ignored files do not, matching Git's own non-force refusal. Processes and terminals are not consulted. A volatile `retainOnArchive` setting, read at admission, turns the cleanup off without unmounting the service; the Forge client edits it on the bundle's worktree row of the Plugins page because the service package has no Client half. Unarchiving cancels an unadmitted removal and waits for an admitted one, and directory entry into a checkout being removed waits for that removal. No startup sweep deletes previously archived worktrees. ## Alternatives considered diff --git a/.agents/notes/implemented/feature/2026-09-13-explicit-worktree-creation.zh.md b/.agents/notes/implemented/feature/2026-09-13-explicit-worktree-creation.zh.md index ee8ff78faf..a3c7313ddd 100644 --- a/.agents/notes/implemented/feature/2026-09-13-explicit-worktree-creation.zh.md +++ b/.agents/notes/implemented/feature/2026-09-13-explicit-worktree-creation.zh.md @@ -18,7 +18,7 @@ Git 与目录创建使用挂载的子进程及沙箱提供方,不扩大调用 离开使用共享工作目录操作,保留检出目录与分支。初始化失败可能留下部分产物,并报告其位置。该服务不拥有分支合并策略或任务关联数据库。 -服务把每次创建记录为 `plugin:worktree/created` Session 事件,并像 job 与 Agent 注册表各自拥有归档准入家族那样,拥有这些检出目录的归档触发清理。Session 的继承前缀决定它创建了某个检出目录还是仅引用它;当前工作目录本身不授予清理所有权。准入在 Workspace 写队列内登记尝试并返回;检查通过投影缓存或日志读取冷 Session,不启动 Agent,并在之后执行。只删除干净且无人引用的检出目录,不带 force 也不删除分支;跟踪文件改动与未跟踪文件保留目录,被忽略的文件不保留,与 Git 自身不带 force 时的拒绝条件一致。不咨询进程与终端。取消归档会取消尚未获准的删除并等待已获准的删除,进入正在删除的检出目录会等待该删除结束。不在启动时扫描删除此前已归档的工作树。 +服务把每次创建记录为 `plugin:worktree/created` Session 事件,并像 job 与 Agent 注册表各自拥有归档准入家族那样,拥有这些检出目录的归档触发清理。Session 的继承前缀决定它创建了某个检出目录还是仅引用它;当前工作目录本身不授予清理所有权。准入在 Workspace 写队列内登记尝试并返回;检查通过投影缓存或日志读取冷 Session,不启动 Agent,并在之后执行。只删除干净且无人引用的检出目录,不带 force 也不删除分支;跟踪文件改动与未跟踪文件保留目录,被忽略的文件不保留,与 Git 自身不带 force 时的拒绝条件一致。不咨询进程与终端。volatile 的 `retainOnArchive` 设置在准入时读取,无需卸载服务即可关闭清理;由于服务包没有 Client 半部,Forge 客户端在插件页该套件的 worktree 行上编辑它。取消归档会取消尚未获准的删除并等待已获准的删除,进入正在删除的检出目录会等待该删除结束。不在启动时扫描删除此前已归档的工作树。 ## Alternatives considered diff --git a/docs/config-catalog.md b/docs/config-catalog.md index f7c40cac2f..3c07fa2cb3 100644 --- a/docs/config-catalog.md +++ b/docs/config-catalog.md @@ -1505,11 +1505,14 @@ export type PaidTranslationProvider = 'deepseek-account' | 'deepseek-official' ## `@deepseek-ai/dsh-experimental-worktree` - `inject`: `workingDirectory` · `fs` · `subprocess` · `sandbox` · `sandboxPolicy` · `sessionProjections` -- `source`: [`packages/experimental/worktree/src/index.ts:34`](../packages/experimental/worktree/src/index.ts) +- `refs`: `Volatile` (`@deepseek-ai/cordis`) +- `source`: [`packages/experimental/worktree/src/index.ts:35`](../packages/experimental/worktree/src/index.ts) ```ts config-catalog -/** Worktree location, generated names, executables, and subprocess resource limits. */ +/** Worktree location, generated names, executables, subprocess resource limits, and the archive cleanup switch. */ export interface Config { + /** Keep every checkout when its Session is archived; editable live from the Plugins page. */ + retainOnArchive: Volatile /** Relative checkout pool inside the source repository. */ directory?: string /** Prefix for automatically generated branch and checkout names. */ diff --git a/docs/config-catalog.zh.md b/docs/config-catalog.zh.md index 38598de93b..e0c67d1c7c 100644 --- a/docs/config-catalog.zh.md +++ b/docs/config-catalog.zh.md @@ -1507,11 +1507,14 @@ export type PaidTranslationProvider = 'deepseek-account' | 'deepseek-official' ## `@deepseek-ai/dsh-experimental-worktree` - `inject`: `workingDirectory` · `fs` · `subprocess` · `sandbox` · `sandboxPolicy` · `sessionProjections` -- `source`: [`packages/experimental/worktree/src/index.ts:34`](../packages/experimental/worktree/src/index.ts) +- `refs`: `Volatile` (`@deepseek-ai/cordis`) +- `source`: [`packages/experimental/worktree/src/index.ts:35`](../packages/experimental/worktree/src/index.ts) ```ts config-catalog -/** Worktree location, generated names, executables, and subprocess resource limits. */ +/** Worktree location, generated names, executables, subprocess resource limits, and the archive cleanup switch. */ export interface Config { + /** Keep every checkout when its Session is archived; editable live from the Plugins page. */ + retainOnArchive: Volatile /** Relative checkout pool inside the source repository. */ directory?: string /** Prefix for automatically generated branch and checkout names. */ diff --git a/docs/upgrade-guide/v0.2.2-rc.1/archive-worktrees/guide.i18n.yaml b/docs/upgrade-guide/v0.2.2-rc.1/archive-worktrees/guide.i18n.yaml index e060db6784..b563eb7323 100644 --- a/docs/upgrade-guide/v0.2.2-rc.1/archive-worktrees/guide.i18n.yaml +++ b/docs/upgrade-guide/v0.2.2-rc.1/archive-worktrees/guide.i18n.yaml @@ -9,8 +9,8 @@ en: bc309764ab7b8b98 zh: 20fdfbce76706025 /worktree-cleanup-on-archive/change: - en: 587c3f8c7ef85a04 - zh: 970d67cfaf4c6afe + en: 05f27e166f2dbb40 + zh: a320ac6252fd2e38 /worktree-cleanup-on-archive/migration: - en: 2bd42635cf35d5c4 - zh: 4d9048402216767d + en: c9b2fca77d02e07f + zh: a4228d7f22fb7e35 diff --git a/docs/upgrade-guide/v0.2.2-rc.1/archive-worktrees/guide.md b/docs/upgrade-guide/v0.2.2-rc.1/archive-worktrees/guide.md index fe80784662..77912a2e71 100644 --- a/docs/upgrade-guide/v0.2.2-rc.1/archive-worktrees/guide.md +++ b/docs/upgrade-guide/v0.2.2-rc.1/archive-worktrees/guide.md @@ -9,13 +9,13 @@ English | [中文](guide.zh.md) ## Change -Archiving a Session previously retained its checkout. The worktree service now records each checkout it creates as a `plugin:worktree/created` record and, when the Session that created one is archived, removes it with a non-force `git worktree remove` when no unarchived Session refers to it, its creator's policy is not read-only, and Git finds no tracked changes, untracked files, hidden index flags, submodules, locks, or detached HEAD. Ignored files such as `node_modules` do not retain it. Branches and commits remain. Checkouts created before this release have no such event and are never swept, nor are Sessions archived earlier. See the [worktree service](../../../../packages/experimental/worktree/README.md). +Archiving a Session previously retained its checkout. The worktree service now records each checkout it creates as a `plugin:worktree/created` record and, when the Session that created one is archived, removes it with a non-force `git worktree remove` when no unarchived Session refers to it, its creator's policy is not read-only, and Git finds no tracked changes, untracked files, hidden index flags, submodules, locks, or detached HEAD. Ignored files such as `node_modules` do not retain it. Branches and commits remain. The service's `retainOnArchive` setting, off by default, keeps every checkout instead. Checkouts created before this release have no such event and are never swept, nor are Sessions archived earlier. See the [worktree service](../../../../packages/experimental/worktree/README.md). The Forge bundle mounts one `worktree` service for both the panel and the `create_worktree` tool. The `forge-worktree` row and the `optional-forge-panel` group that isolated a second service are gone; the panel is the top-level `forge-panel` row. ## Migration -1. If a checkout must remain available outside DSH, keep its Session unarchived or lock it with `git worktree lock ` before archiving. Ignored files are not kept. +1. If a checkout must remain available outside DSH, keep its Session unarchived, lock it with `git worktree lock ` before archiving, or turn on **Keep worktrees when archiving** on the Forge bundle's worktree row of the Plugins page (`retainOnArchive`), which keeps every checkout. Ignored files are not kept. 2. To resume an archived Session whose checkout was removed, unarchive it and use **Restore worktree**. The retained branch is checked out at the recorded path. 3. In a profile's `cordis.patch.yml`, move any `forge-worktree` override to the `worktree` row and any `optional-forge-panel` override to the `forge-panel` row; a `disabled: true` on `forge-panel` turns off the panel alone. 4. Confirm the branch and commits are present with `git branch --list` and that **Restore worktree** makes the recorded checkout available. Session logs require no migration. diff --git a/docs/upgrade-guide/v0.2.2-rc.1/archive-worktrees/guide.zh.md b/docs/upgrade-guide/v0.2.2-rc.1/archive-worktrees/guide.zh.md index 8fae0b84fb..5edf966298 100644 --- a/docs/upgrade-guide/v0.2.2-rc.1/archive-worktrees/guide.zh.md +++ b/docs/upgrade-guide/v0.2.2-rc.1/archive-worktrees/guide.zh.md @@ -9,13 +9,13 @@ description: "归档 Session 可以删除其干净的工作树并保留分支, ## 变更 -归档 Session 以前会保留检出目录。工作树服务现在把它创建的每个检出目录记录为 `plugin:worktree/created` Session 事件;当创建它的 Session 被归档时,若没有未归档的 Session 引用该目录、创建者的策略不是只读,且 Git 未发现跟踪文件改动、未跟踪文件、隐藏的索引标记、子模块、锁或分离 HEAD,就用不带 force 的 `git worktree remove` 删除它。`node_modules` 之类被忽略的文件不会保留目录。分支和提交仍会保留。本版本之前创建的检出目录没有该事件,不会被扫描;更早归档的 Session 也不会。参见[工作树服务](../../../../packages/experimental/worktree/README.zh.md)。 +归档 Session 以前会保留检出目录。工作树服务现在把它创建的每个检出目录记录为 `plugin:worktree/created` Session 事件;当创建它的 Session 被归档时,若没有未归档的 Session 引用该目录、创建者的策略不是只读,且 Git 未发现跟踪文件改动、未跟踪文件、隐藏的索引标记、子模块、锁或分离 HEAD,就用不带 force 的 `git worktree remove` 删除它。`node_modules` 之类被忽略的文件不会保留目录。分支和提交仍会保留。服务的 `retainOnArchive` 设置默认关闭,开启后改为保留所有检出目录。本版本之前创建的检出目录没有该事件,不会被扫描;更早归档的 Session 也不会。参见[工作树服务](../../../../packages/experimental/worktree/README.zh.md)。 Forge bundle 为面板和 `create_worktree` 工具挂载同一个 `worktree` 服务。隔离第二个服务的 `forge-worktree` 行与 `optional-forge-panel` 组已移除;面板是顶层的 `forge-panel` 行。 ## 迁移 -1. 如果检出目录必须供 DSH 之外继续使用,请保持其 Session 未归档,或在归档前用 `git worktree lock ` 锁定它。被忽略的文件不会保留。 +1. 如果检出目录必须供 DSH 之外继续使用,请保持其 Session 未归档,在归档前用 `git worktree lock ` 锁定它,或在插件页 Forge 套件的 worktree 行上开启**归档时不删除工作树**(`retainOnArchive`),它会保留所有检出目录。被忽略的文件不会保留。 2. 要继续使用已归档且检出目录已删除的 Session,请取消归档并使用**恢复工作树**。保留的分支会在记录的路径重新检出。 3. 在 profile 的 `cordis.patch.yml` 中,把针对 `forge-worktree` 的覆盖迁到 `worktree` 行,把针对 `optional-forge-panel` 的覆盖迁到 `forge-panel` 行;对 `forge-panel` 设置 `disabled: true` 可以只关闭面板。 4. 用 `git branch --list` 确认分支与提交仍然存在,并确认**恢复工作树**使记录的检出目录重新可用。Session 日志无需迁移。 diff --git a/packages/experimental/client-ui-forge/README.i18n.yaml b/packages/experimental/client-ui-forge/README.i18n.yaml index e6198c7bfd..c26fe9644d 100644 --- a/packages/experimental/client-ui-forge/README.i18n.yaml +++ b/packages/experimental/client-ui-forge/README.i18n.yaml @@ -15,8 +15,8 @@ en: d152484eb41ac6b4 zh: 2f8a621b991260a1 /deepseek-ai-dsh-experimental-client-ui-forge/use-this-package: - en: 87757c920ff2cef4 - zh: 4bf1925d5d77bfd9 + en: 254fbb55abefed09 + zh: f8c5bccf35434ae5 /deepseek-ai-dsh-experimental-client-ui-forge/understand-the-implementation: en: 0c2dd86b5f6b489d zh: 2f0fce0affa48f59 diff --git a/packages/experimental/client-ui-forge/README.md b/packages/experimental/client-ui-forge/README.md index a2d3d609b9..ce90c87ee1 100644 --- a/packages/experimental/client-ui-forge/README.md +++ b/packages/experimental/client-ui-forge/README.md @@ -30,7 +30,7 @@ Enable the [forge bundle](../forge-bundle/README.md) on the Plugins page; it com Panel text follows the application language: Chinese, English, Japanese, Spanish, French, German, Russian, or Portuguese. - **Worktree option** — on the New Session screen, New worktree sits beside the current branch at the right end of the row with the workspace and mode pickers. Both stay hidden outside a Git checkout. The branch is read-only until New worktree is checked, when it becomes the base branch selector; the menu lists recent local branches. If permissions block an existing request, its selected base stays visible without a selector and the request can still be withdrawn. Hovering, focusing, or tapping the read-only branch or base shows its full description. The option is disabled, with the reason in its tooltip, in a read-only Session and when the checkout or its Git directory lies outside the Session's writable root, as for a project that is itself a linked worktree. Sending the first message hands it to the Session at once, and it waits there while the branch `dsh--<4 random hexadecimal digits>` is created from the base under the repository's `.agents/worktrees/` and its checkout becomes the Session's working directory; the message's turn starts once the worktree exists. -- **Archive cleanup** — archiving a Session lets the [worktree service](../worktree/README.md) reclaim the clean, unreferenced worktree it created, whether through the New Session option or the model's `create_worktree` tool, while retaining the branch and its commits. A scheduled cleanup uses the archive notice “Archived; the worktree will be cleaned up”; one that ends retained returns to the ordinary notice, and one that fails replaces it with a warning while the Session stays archived. Undo cancels deletion before admission or waits for an admitted deletion; a removed checkout uses the existing Restore worktree flow. +- **Archive cleanup** — archiving a Session lets the [worktree service](../worktree/README.md) reclaim the clean, unreferenced worktree it created, whether through the New Session option or the model's `create_worktree` tool, while retaining the branch and its commits. A scheduled cleanup uses the archive notice “Archived; the worktree will be cleaned up”; one that ends retained returns to the ordinary notice, and one that fails replaces it with a warning while the Session stays archived. Undo cancels deletion before admission or waits for an admitted deletion; a removed checkout uses the existing Restore worktree flow. The bundle's worktree row on the Plugins page offers Keep worktrees when archiving: once saved, archiving keeps every worktree and shows the ordinary archive notice; the switch is read at each archive, so it does not affect a cleanup already scheduled. - **Creation card** — while the worktree is created, a card above the composer shows the new branch and its two steps, creating the branch and checking out files; More details adds the branch and base. Cancel stops the attempt. After a stopped or failed attempt the message keeps waiting, and the card shows the reason of a failure: Retry tries again with a new branch name, and Continue without a worktree withdraws the request so the message goes on in the current checkout. - **Removed worktree** — when the worktree the Session works in has been removed outside the Session, a card above the composer says so, and a message sent meanwhile waits without starting its turn until the worktree is restored or left; the card then says that the message goes on afterwards. Restore worktree, also offered as Restore in the tab, checks the branch out again at the same directory, or creates the branch again at the commit it started from when the branch is gone too; while it runs, the card follows its two steps, preparing the worktree and checking out files, and the tab's Restore turns into a spinner. Continue in the project moves the Session to the source checkout. Meanwhile the tab's first row shows a warning glyph. - **Code review and changes** — on the right-sidebar start page, opens the same change request tab as the Session header button. diff --git a/packages/experimental/client-ui-forge/README.zh.md b/packages/experimental/client-ui-forge/README.zh.md index a4e46e0927..6df023d0f8 100644 --- a/packages/experimental/client-ui-forge/README.zh.md +++ b/packages/experimental/client-ui-forge/README.zh.md @@ -30,7 +30,7 @@ kind: "package-reference" 面板文案跟随应用语言,支持中文、英文、日语、西班牙语、法语、德语、俄语和葡萄牙语。 - **工作树选项**——在新会话页面上,“新建工作树”与当前分支一起位于工作区与模式选择器那一行的右端。不在 Git 检出中时,两者均隐藏。分支默认为只读展示;勾选“新建工作树”后,它变为基准分支选择器,菜单列出最近的本地分支。权限阻止已有请求时,仍只读显示已选基准,并允许取消请求。悬停、聚焦或轻点只读分支或基准会显示完整说明。Session 为只读,或检出及其 Git 目录不在 Session 的可写根内(例如项目本身就是链接 worktree)时,该选项不可用,提示中说明原因。发送第一条消息后,消息立即交给 Session 并在那里等待,同时从基准分支在仓库的 `.agents/worktrees/` 下创建分支 `dsh--<4 位随机十六进制数>`,并把它的检出设为 Session 的工作目录;worktree 建好后这条消息的这一轮才开始。 -- **归档清理**——归档一个会话后,由[工作树服务](../worktree/README.zh.md)回收它创建的干净且无人引用的工作树,无论来自新会话选项还是模型的 `create_worktree` 工具,分支及其提交保留。清理排队后,归档提示为“已归档,工作树将被清理”;最终保留时恢复为普通归档提示,失败时替换为警告而会话仍保持归档。撤销归档会取消尚未获准的删除,或等待已获准的删除结束;已移除的工作树使用现有的“恢复工作树”流程。 +- **归档清理**——归档一个会话后,由[工作树服务](../worktree/README.zh.md)回收它创建的干净且无人引用的工作树,无论来自新会话选项还是模型的 `create_worktree` 工具,分支及其提交保留。清理排队后,归档提示为“已归档,工作树将被清理”;最终保留时恢复为普通归档提示,失败时替换为警告而会话仍保持归档。撤销归档会取消尚未获准的删除,或等待已获准的删除结束;已移除的工作树使用现有的“恢复工作树”流程。插件页上该套件的 worktree 行提供“归档时不删除工作树”开关:保存后,归档会保留所有工作树并显示普通归档提示;开关在每次归档时读取,不影响已排队的清理。 - **创建卡片**——创建 worktree 期间,输入框上方的卡片显示新分支以及“创建分支”“检出文件”两个步骤;“更多详情”会列出分支与基准。“取消”停止这次尝试。尝试被停止或失败后,消息继续等待,失败时卡片显示原因:“重试”换一个新分支名再试;“不使用工作树”撤回请求,消息在当前检出中继续发送。 - **工作树已被删除**——Session 所在的 worktree 在 Session 之外被删除后,输入框上方的卡片会说明这一点;此期间发送的消息会等待、不开始这一轮,直到该 worktree 被恢复或离开,卡片也会说明消息之后会接着发送。“恢复工作树”(标签页中的“恢复”与之相同)在原目录重新检出该分支;分支也已删除时,从它开始时的提交重新创建分支;恢复期间卡片显示“准备工作树”“检出文件”两个步骤,标签页中的“恢复”变为加载状态。“在项目目录继续”把 Session 移回源检出。此期间标签页顶部一行显示警示图标。 - **代码审查和变更**——右侧栏起始页中的入口,与会话标题栏按钮打开同一个变更请求标签页。 diff --git a/packages/experimental/client-ui-forge/package.json b/packages/experimental/client-ui-forge/package.json index 76ad557823..7ab090b292 100644 --- a/packages/experimental/client-ui-forge/package.json +++ b/packages/experimental/client-ui-forge/package.json @@ -44,6 +44,8 @@ "@deepseek-ai/dsh-client-locale", "@deepseek-ai/dsh-client-ui-conversation", "@deepseek-ai/dsh-client-ui-layout", + "@deepseek-ai/dsh-client-ui-plugin-manager", + "@deepseek-ai/dsh-client-ui-settings", "@deepseek-ai/dsh-client-ui-sidebar-right", "@deepseek-ai/dsh-client-ui-workspace" ], @@ -82,9 +84,11 @@ "@deepseek-ai/dsh-client-test-runtime": "workspace:*", "@deepseek-ai/dsh-client-ui-conversation": "workspace:*", "@deepseek-ai/dsh-client-ui-layout": "workspace:*", + "@deepseek-ai/dsh-client-ui-plugin-manager": "workspace:*", "@deepseek-ai/dsh-client-ui-primitives": "workspace:*", "@deepseek-ai/dsh-client-ui-renderer": "workspace:*", "@deepseek-ai/dsh-client-ui-session": "workspace:*", + "@deepseek-ai/dsh-client-ui-settings": "workspace:*", "@deepseek-ai/dsh-client-ui-sidebar-right": "workspace:*", "@deepseek-ai/dsh-client-ui-slots": "workspace:*", "@deepseek-ai/dsh-client-ui-workspace": "workspace:*", diff --git a/packages/experimental/client-ui-forge/src/client/WorktreeSettings.module.css b/packages/experimental/client-ui-forge/src/client/WorktreeSettings.module.css new file mode 100644 index 0000000000..40cd140139 --- /dev/null +++ b/packages/experimental/client-ui-forge/src/client/WorktreeSettings.module.css @@ -0,0 +1,29 @@ +/* The worktree row page: one switch row under the Plugins form's tokens. */ +.row { + display: flex; + align-items: center; + justify-content: space-between; + gap: 24px; + padding: 12px 0; +} + +.text { + display: flex; + flex-direction: column; + gap: 4px; + min-width: 0; +} + +.title { + font-size: 13px; + font-weight: 500; + line-height: 1.5; + color: var(--dsw-alias-label-primary); +} + +.description { + margin: 0; + font-size: 12px; + line-height: 18px; + color: var(--dsw-alias-label-secondary); +} diff --git a/packages/experimental/client-ui-forge/src/client/WorktreeSettings.tsx b/packages/experimental/client-ui-forge/src/client/WorktreeSettings.tsx new file mode 100644 index 0000000000..2fbc6f97b2 --- /dev/null +++ b/packages/experimental/client-ui-forge/src/client/WorktreeSettings.tsx @@ -0,0 +1,42 @@ +/** The worktree service's row page on the Plugins page: the archive cleanup switch. */ +import { useId } from 'react' +import { SettingsForm, Switch } from '@deepseek-ai/dsh-client-ui-primitives' +import type { SettingsFormLabels } from '@deepseek-ai/dsh-client-ui-primitives' +import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots' +import type {} from '@deepseek-ai/dsh-client-ui-plugin-manager/client' +import type { NS } from './locales.ts' +import type { WorktreeSettingsInjected } from './worktree-settings-form.ts' +import css from './WorktreeSettings.module.css' + +export type WorktreeSettingsProps = PropsRuntime<'plugins.row.config'> & PropsLocale & InjectFace + +function formLabels(t: WorktreeSettingsProps['t']): SettingsFormLabels { + return { + unavailable: t('settings.unavailable'), readOnly: t('settings.readOnly'), saveFailed: t('settings.saveFailed'), + save: t('settings.save'), saving: t('settings.saving'), + } +} + +/** + * Render the worktree row's configuration: one switch that keeps every + * checkout when its Session is archived. The summary view names the switch. + * @param props - the Plugins page view, the staged form, and its actions. + * @returns the row page's form, or the summary line. + */ +export function WorktreeSettings(props: WorktreeSettingsProps) { + const { t } = props + const id = useId() + const state = props.useWorktreeForm(value => value) + if (props.view === 'summary') return t('settings.retainOnArchive.title') + const disabled = !state.writable || state.saving + return +
+
+ +

{t('settings.retainOnArchive.description')}

+
+ { props.edit('retainOnArchive', next ? 'true' : 'false') }} /> +
+
+} diff --git a/packages/experimental/client-ui-forge/src/client/locales.ts b/packages/experimental/client-ui-forge/src/client/locales.ts index f0c041d34d..791afed30d 100644 --- a/packages/experimental/client-ui-forge/src/client/locales.ts +++ b/packages/experimental/client-ui-forge/src/client/locales.ts @@ -5,6 +5,13 @@ export const NS = 'forgePanel' /** Chinese copy; its keys define {@link ForgePanelKey}. */ export const zh = { + 'settings.retainOnArchive.title': '归档时不删除工作树', + 'settings.retainOnArchive.description': '开启后,归档会话时保留它创建的工作树;关闭时,干净且无人引用的工作树会被删除,分支和提交仍然保留。', + 'settings.unavailable': '工作树设置不可用。', + 'settings.readOnly': '此部署以只读方式保存设置。', + 'settings.saveFailed': '此部署未接受这些值,已保留以便修改。', + 'settings.save': '保存', + 'settings.saving': '保存中…', 'toast.archiveCleanupScheduled': '已归档,工作树将被清理', 'toast.archiveCleanupFailed': '已归档,工作树清理失败。分支已保留,请检查工作树。', 'review.startReview': '开始评审', @@ -279,6 +286,13 @@ export type ForgePanelKey = keyof typeof zh /** English copy with the same keys. */ export const en: Record = { + 'settings.retainOnArchive.title': 'Keep worktrees when archiving', + 'settings.retainOnArchive.description': 'When on, archiving a Session keeps the worktree it created; when off, a clean, unreferenced worktree is removed while its branch and commits remain.', + 'settings.unavailable': 'Worktree settings are unavailable.', + 'settings.readOnly': 'This deployment stores settings read-only.', + 'settings.saveFailed': 'The deployment did not accept these values; they were left for you to correct.', + 'settings.save': 'Save', + 'settings.saving': 'Saving…', 'toast.archiveCleanupScheduled': 'Archived; the worktree will be cleaned up', 'toast.archiveCleanupFailed': 'Archived; worktree cleanup failed. The branch is retained. Check the worktree.', 'review.startReview': 'Start review', @@ -557,6 +571,13 @@ declare module '@deepseek-ai/dsh-client-ui-slots' { /** Japanese copy with the same keys. */ export const ja: Record = { + 'settings.retainOnArchive.title': 'アーカイブ時にワークツリーを残す', + 'settings.retainOnArchive.description': 'オンにすると、セッションをアーカイブしてもそのセッションが作成したワークツリーを残します。オフにすると、クリーンで参照されていないワークツリーは削除され、ブランチとコミットは残ります。', + 'settings.unavailable': 'ワークツリー設定を利用できません。', + 'settings.readOnly': 'このデプロイでは設定は読み取り専用で保存されます。', + 'settings.saveFailed': 'このデプロイでは値が受け入れられませんでした。修正のために値はそのまま残されています。', + 'settings.save': '保存', + 'settings.saving': '保存中…', 'toast.archiveCleanupScheduled': 'アーカイブしました。ワークツリーを削除します', 'toast.archiveCleanupFailed': 'アーカイブしましたが、ワークツリーの削除に失敗しました。ブランチは保持されています。ワークツリーを確認してください。', 'review.startReview': 'レビューを開始', @@ -828,6 +849,13 @@ export const ja: Record = { /** Spanish copy with the same keys. */ export const es: Record = { + 'settings.retainOnArchive.title': 'Conservar los árboles de trabajo al archivar', + 'settings.retainOnArchive.description': 'Si está activado, archivar una sesión conserva el árbol de trabajo que creó; si está desactivado, un árbol de trabajo limpio y sin referencias se elimina, y la rama y sus commits se conservan.', + 'settings.unavailable': 'La configuración del árbol de trabajo no está disponible.', + 'settings.readOnly': 'Esta implementación guarda la configuración en modo de solo lectura.', + 'settings.saveFailed': 'La implementación no aceptó estos valores; se dejaron para que los corrijas.', + 'settings.save': 'Guardar', + 'settings.saving': 'Guardando…', 'toast.archiveCleanupScheduled': 'Archivado; se eliminará el árbol de trabajo', 'toast.archiveCleanupFailed': 'Archivado; no se pudo eliminar el árbol de trabajo. La rama se conserva. Revisa el árbol de trabajo.', 'review.startReview': 'Iniciar revisión', @@ -1099,6 +1127,13 @@ export const es: Record = { /** French copy with the same keys. */ export const fr: Record = { + 'settings.retainOnArchive.title': 'Conserver les arbres de travail à l’archivage', + 'settings.retainOnArchive.description': 'Activé, l’archivage d’une session conserve l’arbre de travail qu’elle a créé ; désactivé, un arbre de travail propre et non référencé est supprimé, la branche et ses commits restant conservés.', + 'settings.unavailable': 'Les paramètres de l’arbre de travail sont indisponibles.', + 'settings.readOnly': 'Ce déploiement enregistre les paramètres en lecture seule.', + 'settings.saveFailed': 'Le déploiement n’a pas accepté ces valeurs ; elles ont été laissées pour correction.', + 'settings.save': 'Enregistrer', + 'settings.saving': 'Enregistrement…', 'toast.archiveCleanupScheduled': 'Archivé ; l’arbre de travail sera supprimé', 'toast.archiveCleanupFailed': 'Archivé ; échec de la suppression de l’arbre de travail. La branche est conservée. Vérifiez l’arbre de travail.', 'review.startReview': 'Commencer la revue', @@ -1370,6 +1405,13 @@ export const fr: Record = { /** German copy with the same keys. */ export const de: Record = { + 'settings.retainOnArchive.title': 'Arbeitsbäume beim Archivieren behalten', + 'settings.retainOnArchive.description': 'Eingeschaltet behält das Archivieren einer Sitzung den von ihr erstellten Arbeitsbaum; ausgeschaltet wird ein sauberer, nicht referenzierter Arbeitsbaum entfernt, während Branch und Commits erhalten bleiben.', + 'settings.unavailable': 'Die Arbeitsbaum-Einstellungen sind nicht verfügbar.', + 'settings.readOnly': 'Diese Bereitstellung speichert Einstellungen schreibgeschützt.', + 'settings.saveFailed': 'Die Bereitstellung hat diese Werte nicht übernommen; sie wurden zur Korrektur belassen.', + 'settings.save': 'Speichern', + 'settings.saving': 'Wird gespeichert…', 'toast.archiveCleanupScheduled': 'Archiviert; der Arbeitsbaum wird entfernt', 'toast.archiveCleanupFailed': 'Archiviert; der Arbeitsbaum konnte nicht entfernt werden. Der Branch bleibt erhalten. Prüfe den Arbeitsbaum.', 'review.startReview': 'Review starten', @@ -1641,6 +1683,13 @@ export const de: Record = { /** Russian copy with the same keys. */ export const ru: Record = { + 'settings.retainOnArchive.title': 'Сохранять рабочие деревья при архивации', + 'settings.retainOnArchive.description': 'Если включено, при архивации сессии созданное ею рабочее дерево сохраняется; если выключено, чистое рабочее дерево без ссылок удаляется, а ветка и коммиты остаются.', + 'settings.unavailable': 'Настройки рабочего дерева недоступны.', + 'settings.readOnly': 'В этом развёртывании настройки сохраняются только для чтения.', + 'settings.saveFailed': 'Развёртывание не приняло эти значения; они оставлены для исправления.', + 'settings.save': 'Сохранить', + 'settings.saving': 'Сохранение…', 'toast.archiveCleanupScheduled': 'Архивировано; рабочее дерево будет удалено', 'toast.archiveCleanupFailed': 'Архивировано; не удалось удалить рабочее дерево. Ветка сохранена. Проверьте рабочее дерево.', 'review.startReview': 'Начать проверку', @@ -1912,6 +1961,13 @@ export const ru: Record = { /** Portuguese copy with the same keys. */ export const pt: Record = { + 'settings.retainOnArchive.title': 'Manter árvores de trabalho ao arquivar', + 'settings.retainOnArchive.description': 'Quando ativado, arquivar uma sessão mantém a árvore de trabalho que ela criou; quando desativado, uma árvore de trabalho limpa e sem referências é removida, e o ramo e os commits permanecem.', + 'settings.unavailable': 'As configurações da árvore de trabalho não estão disponíveis.', + 'settings.readOnly': 'Esta implantação guarda as configurações apenas para leitura.', + 'settings.saveFailed': 'A implantação não aceitou estes valores; eles foram mantidos para correção.', + 'settings.save': 'Salvar', + 'settings.saving': 'Salvando…', 'toast.archiveCleanupScheduled': 'Arquivado; a árvore de trabalho será removida', 'toast.archiveCleanupFailed': 'Arquivado; a remoção da árvore de trabalho falhou. O ramo foi mantido. Verifique a árvore de trabalho.', 'review.startReview': 'Iniciar revisão', diff --git a/packages/experimental/client-ui-forge/src/client/mount.ts b/packages/experimental/client-ui-forge/src/client/mount.ts index 166b1dd6ae..c0608a3678 100644 --- a/packages/experimental/client-ui-forge/src/client/mount.ts +++ b/packages/experimental/client-ui-forge/src/client/mount.ts @@ -6,8 +6,10 @@ import type {} from '@deepseek-ai/dsh-api-session-controller/client' import type {} from '@deepseek-ai/dsh-client-locale/client' import type {} from '@deepseek-ai/dsh-client-ui-conversation/client' import type {} from '@deepseek-ai/dsh-client-ui-layout/client' +import type {} from '@deepseek-ai/dsh-client-ui-plugin-manager/client' import { IconBranchOutlineRegular } from '@deepseek-ai/dsh-client-ui-primitives' import type {} from '@deepseek-ai/dsh-client-ui-renderer/client' +import type {} from '@deepseek-ai/dsh-client-ui-settings/client' import type {} from '@deepseek-ai/dsh-client-ui-sidebar-right/client' import type { HostObservable } from '@deepseek-ai/dsh-client-ui-slots' import type {} from '@deepseek-ai/dsh-client-ui-workspace/client' @@ -34,10 +36,18 @@ import { } from './source.ts' import { numberOf } from './status.ts' import { WorktreeProgress, type WorktreeProgressInjected } from './WorktreeProgress.tsx' +import { WorktreeSettings } from './WorktreeSettings.tsx' +import { WorktreeSettingsForm, type WorktreeSettings as WorktreeSettingsFields } from './worktree-settings-form.ts' import { WorktreeToggle, type WorktreeToggleInjected } from './WorktreeToggle.tsx' /** Services required before the Remote contribution mounts. */ -export const inject = ['remote', 'slots', 'locale', 'sidebarRightTabs', 'sidebarRight', 'sessions'] +export const inject = ['remote', 'slots', 'locale', 'sidebarRightTabs', 'sidebarRight', 'sessions', 'configForms'] + +/** The worktree row of the Forge bundle, whose Plugins page carries the archive cleanup switch. */ +export const WORKTREE_ROW_KEY = '@deepseek-ai/dsh-experimental-forge-bundle#worktree' + +/** The Loader entry id the worktree service's settings namespace follows. */ +export const WORKTREE_NS = 'worktree' /** Registry id of the forge tab type, also its slot key. */ export const TAB_ID = '@deepseek-ai/dsh-experimental-client-ui-forge' @@ -345,6 +355,11 @@ function registerUi(ctx: Context): void { ctx.slots.inject('sidebar.session.row.hover', () => ctx.slots.register({ name: 'sidebar.session.row.hover', id: 'forge-panel.row', order: 20, locale: NS, inject: listFace, }, SessionHoverForge)) + const worktreeSettings = new WorktreeSettingsForm(ctx.configForms.get(WORKTREE_NS)) + ctx.effect(() => () => { worktreeSettings.dispose() }, 'forge-panel: worktree settings form') + ctx.slots.inject('plugins.row.config', () => ctx.slots.register({ + name: 'plugins.row.config', key: WORKTREE_ROW_KEY, locale: NS, inject: () => worktreeSettings.inject(), + }, WorktreeSettings)) } /** diff --git a/packages/experimental/client-ui-forge/src/client/worktree-settings-form.ts b/packages/experimental/client-ui-forge/src/client/worktree-settings-form.ts new file mode 100644 index 0000000000..1aed3ccbfb --- /dev/null +++ b/packages/experimental/client-ui-forge/src/client/worktree-settings-form.ts @@ -0,0 +1,43 @@ +/** Staged worktree row settings using the shared Plugins form model. */ +import { SettingsFormModel, type SettingsFieldState, type SettingsFormActions, type SettingsFormScope, + type SettingsFormShell } from '@deepseek-ai/dsh-client-ui-primitives' +import type { SnapshotStore } from '@deepseek-ai/dsh-client-store' + +/** The volatile fields of the worktree service's Config. */ +export interface WorktreeSettings { + retainOnArchive: boolean +} + +/** Current drafts and the shared form status. */ +export interface WorktreeFormState extends SettingsFormShell { + retainOnArchive: SettingsFieldState +} + +/** Registration-side form observable and edit callbacks. */ +export interface WorktreeSettingsInjected extends SettingsFormActions { + hooks: { worktreeForm: SnapshotStore } +} + +/** Stages the retain switch until the reader saves it; the draft text is `true` or `false`. */ +export class WorktreeSettingsForm { + private readonly form: SettingsFormModel + private readonly state: SnapshotStore + + /** @param scope - Host-backed configuration form of the worktree row. */ + constructor(scope: SettingsFormScope) { + this.form = new SettingsFormModel(scope, [{ + field: 'retainOnArchive', + format: value => value === true ? 'true' : 'false', + parse: text => text === 'true' ? { kind: 'set', value: true } : text === 'false' ? { kind: 'set', value: false } : undefined, + }]) + this.state = this.form.bind(() => ({ ...this.form.shell(), retainOnArchive: this.form.field('retainOnArchive') })) + } + + /** + * Build the registration face for the row page. + * @returns draft observable and shared edit/save actions. + */ + inject(): WorktreeSettingsInjected { return { hooks: { worktreeForm: this.state }, ...this.form.actions() } } + /** Release the accepted-value subscription. */ + dispose(): void { this.form.dispose() } +} diff --git a/packages/experimental/client-ui-forge/tests/mount.client.spec.ts b/packages/experimental/client-ui-forge/tests/mount.client.spec.ts index 892c48284c..a87fc349fb 100644 --- a/packages/experimental/client-ui-forge/tests/mount.client.spec.ts +++ b/packages/experimental/client-ui-forge/tests/mount.client.spec.ts @@ -7,6 +7,7 @@ import assert from 'node:assert/strict' import { Context, Service } from '@deepseek-ai/cordis' import type { RemoteHostFacts } from '@deepseek-ai/dsh-api-remotes/client' import { LocaleRuntime } from '@deepseek-ai/dsh-client-locale/client' +import { stubConfigForm } from '@deepseek-ai/dsh-client-test-runtime' import { SlotRegistry } from '@deepseek-ai/dsh-client-ui-renderer/client' import type { SidebarRightTabDefinition, TabId } from '@deepseek-ai/dsh-client-ui-sidebar-right/client' import type { ChangeRequestSnapshot, ForgeReviewRequest, ForgeReviewResult } from '@deepseek-ai/dsh-experimental-forge/types' @@ -21,13 +22,15 @@ import { ForgeTab, type ForgeTabInjected } from '../src/client/ForgeTab.tsx' import { ForgeTabTitle } from '../src/client/ForgeTabTitle.tsx' import { HeaderButton, type HeaderButtonInjected } from '../src/client/HeaderButton.tsx' import { en, NS, zh } from '../src/client/locales.ts' -import { inject, mountForgePanel, TAB_ID, TAB_KIND } from '../src/client/mount.ts' +import { inject, mountForgePanel, TAB_ID, TAB_KIND, WORKTREE_NS, WORKTREE_ROW_KEY } from '../src/client/mount.ts' import type { SessionListInjected } from '../src/client/session-list.ts' import { SessionHoverForge } from '../src/client/SessionHoverForge.tsx' import { SessionRowForge } from '../src/client/SessionRowForge.tsx' import type { NoticeSource } from '../src/client/source.ts' import type { ReviewSelection } from '../src/client/review.ts' import { WorktreeProgress, type WorktreeProgressInjected } from '../src/client/WorktreeProgress.tsx' +import { WorktreeSettings } from '../src/client/WorktreeSettings.tsx' +import type { WorktreeSettingsInjected, WorktreeSettings as WorktreeSettingsFields } from '../src/client/worktree-settings-form.ts' import { WorktreeToggle, type WorktreeToggleInjected } from '../src/client/WorktreeToggle.tsx' import type { WorktreeCleanup } from '@deepseek-ai/dsh-experimental-worktree/types' import type { @@ -187,6 +190,8 @@ async function base() { return fiber.ctx }) } ctx.provide('sessions', sessions) + const worktreeForm = stubConfigForm() + ctx.provide('configForms', { get: (name: string) => { expect(name).toBe(WORKTREE_NS); return worktreeForm.scope } } as never) ctx.provide('sidebarRight', sidebarRight) await ctx.plugin(SlotRegistry) ctx.slots.register({ @@ -202,9 +207,12 @@ async function base() { 'shell.overlay': { kind: 'list', scope: 'root' }, 'sidebar.session.row.trailing': { kind: 'list', scope: 'root', inline: true }, 'sidebar.session.row.hover': { kind: 'list', scope: 'root' }, + 'plugins.row.config': { kind: 'keyed', scope: 'root' }, }, } as never, () => null) - return { ctx, remote, unmount, streams, stateStreams, forgePanel, sidebarRightTabs, unregisterTab, sidebarRight, sessions, scopes } + return { + ctx, remote, unmount, streams, stateStreams, forgePanel, sidebarRightTabs, unregisterTab, sidebarRight, sessions, scopes, worktreeForm, + } } async function fixture() { @@ -275,7 +283,7 @@ describe('mountForgePanel registration', () => { }) it('declares the browser services it needs', () => { - expect(inject).toEqual(['remote', 'slots', 'locale', 'sidebarRightTabs', 'sidebarRight', 'sessions']) + expect(inject).toEqual(['remote', 'slots', 'locale', 'sidebarRightTabs', 'sidebarRight', 'sessions', 'configForms']) }) it('registers the tab types, their bodies and titles, the header button, the worktree option and card, and the toast', async () => { @@ -861,6 +869,26 @@ describe('mountForgePanel changes view', () => { }) +describe('worktree row settings', () => { + it('registers the row page over the worktree namespace and stages the retain switch as a boolean write', async () => { + const f = await fixture() + try { + const registration = f.ctx.slots.entries('plugins.row.config').find(candidate => candidate.component === WorktreeSettings) + expect(registration?.options).toMatchObject({ key: WORKTREE_ROW_KEY }) + const face = registration!.inject!() as Partial + if (face.hooks === undefined || face.edit === undefined || face.save === undefined) throw new Error('expected the worktree settings face') + f.worktreeForm.publish({ status: 'ready', value: { retainOnArchive: false }, base: { retainOnArchive: false }, user: {}, writable: true }) + expect(face.hooks.worktreeForm.getSnapshot()).toMatchObject({ available: true, dirty: false, retainOnArchive: { text: 'false' } }) + face.edit('retainOnArchive', 'true') + expect(face.hooks.worktreeForm.getSnapshot()).toMatchObject({ dirty: true, retainOnArchive: { text: 'true', overridden: true } }) + face.save() + await vi.waitFor(() => { expect(f.worktreeForm.mutate).toHaveBeenCalledOnce() }) + expect(f.worktreeForm.mutate.mock.calls[0]?.[0]).toEqual([{ op: 'set', path: ['retainOnArchive'], value: true }]) + } finally { await f.ctx.fiber.dispose() } + expect(f.worktreeForm.listenerCount()).toBe(0) + }) +}) + describe('archive notices', () => { it('uses the scheduled cleanup notice and reports a later failure', async () => { const f = await fixture() diff --git a/packages/experimental/client-ui-forge/tests/worktree-settings.client.spec.tsx b/packages/experimental/client-ui-forge/tests/worktree-settings.client.spec.tsx new file mode 100644 index 0000000000..b2699357b2 --- /dev/null +++ b/packages/experimental/client-ui-forge/tests/worktree-settings.client.spec.tsx @@ -0,0 +1,66 @@ +// @vitest-environment jsdom +/** The worktree row page: the summary names the switch, and the page stages it until one explicit save. */ +import { afterEach, expect, it, vi } from 'vitest' +import { cleanup, fireEvent, render } from '@testing-library/react' +import { bindSnapshotSelector, stubConfigForm } from '@deepseek-ai/dsh-client-test-runtime' +import { en } from '../src/client/locales.ts' +import { WorktreeSettingsForm, type WorktreeSettings as WorktreeSettingsFields } from '../src/client/worktree-settings-form.ts' +import { WorktreeSettings, type WorktreeSettingsProps } from '../src/client/WorktreeSettings.tsx' + +afterEach(cleanup) + +const TITLE = en['settings.retainOnArchive.title'] + +function mount(scope: ReturnType>, view: 'page' | 'summary' = 'page') { + const form = new WorktreeSettingsForm(scope.scope), { hooks, ...actions } = form.inject() + const props = { + view, ...actions, useWorktreeForm: bindSnapshotSelector(hooks.worktreeForm), t: (key: keyof typeof en) => en[key], + } as WorktreeSettingsProps + return { form, actions, hooks, rendered: render() } +} + +it('names the switch in the summary view', () => { + const scope = stubConfigForm() + const m = mount(scope, 'summary') + try { + expect(m.rendered.container.textContent).toBe(TITLE) + } finally { m.form.dispose() } +}) + +it('stages each toggle as a boolean write until save, and rejects a draft that is neither value', async () => { + const scope = stubConfigForm() + scope.publish({ + status: 'ready', value: { retainOnArchive: true }, base: { retainOnArchive: false }, user: { retainOnArchive: true }, writable: true, revision: 2, + }) + const m = mount(scope) + try { + const toggle = m.rendered.getByRole('switch', { name: TITLE }) + expect(toggle.getAttribute('aria-checked')).toBe('true') + expect(m.rendered.getByText(en['settings.retainOnArchive.description'])).toBeTruthy() + fireEvent.click(toggle) + expect(toggle.getAttribute('aria-checked')).toBe('false') + fireEvent.click(toggle) + expect(toggle.getAttribute('aria-checked')).toBe('true') + fireEvent.click(toggle) + expect(scope.mutate).not.toHaveBeenCalled() + fireEvent.click(m.rendered.getByRole('button', { name: en['settings.save'] })) + await vi.waitFor(() => { expect(scope.mutate).toHaveBeenCalledWith([{ op: 'set', path: ['retainOnArchive'], value: false }], 2) }) + m.actions.edit('retainOnArchive', 'bogus') + expect(m.hooks.worktreeForm.getSnapshot()).toMatchObject({ invalid: true, retainOnArchive: { text: 'bogus', invalid: true } }) + expect(m.rendered.getByRole('switch', { name: TITLE }).getAttribute('aria-checked')).toBe('false') + } finally { + m.rendered.unmount() + m.form.dispose() + } + expect(scope.listenerCount()).toBe(0) +}) + +it('disables the switch while the document is read-only', () => { + const scope = stubConfigForm() + scope.publish({ status: 'ready', value: { retainOnArchive: false } }) + const m = mount(scope) + try { + expect(m.rendered.getByText(en['settings.readOnly'])).toBeTruthy() + expect(m.rendered.getByRole('switch', { name: TITLE })).toHaveProperty('disabled', true) + } finally { m.form.dispose() } +}) diff --git a/packages/experimental/client-ui-forge/tsconfig.client.json b/packages/experimental/client-ui-forge/tsconfig.client.json index 2e585c79d9..6b1f10f81f 100644 --- a/packages/experimental/client-ui-forge/tsconfig.client.json +++ b/packages/experimental/client-ui-forge/tsconfig.client.json @@ -32,6 +32,9 @@ { "path": "../../client/ui-layout" }, + { + "path": "../../client/ui-plugin-manager/tsconfig.client.json" + }, { "path": "../../client/ui-primitives" }, @@ -41,6 +44,9 @@ { "path": "../../client/ui-session" }, + { + "path": "../../client/ui-settings/tsconfig.client.json" + }, { "path": "../../client/ui-sidebar-right" }, diff --git a/packages/experimental/forge-bundle/README.i18n.yaml b/packages/experimental/forge-bundle/README.i18n.yaml index 9debfff423..a62ad422d4 100644 --- a/packages/experimental/forge-bundle/README.i18n.yaml +++ b/packages/experimental/forge-bundle/README.i18n.yaml @@ -18,8 +18,8 @@ en: 33679bed06be4e74 zh: 77dcfac9570d1fbc /deepseek-ai-dsh-experimental-forge-bundle/understand-the-implementation: - en: 88b97653b7e8cf42 - zh: f2deac3b624506b9 + en: b25e0de13e5e1ed0 + zh: 5b0eff3cf148dfee /deepseek-ai-dsh-experimental-forge-bundle/further-exploration: en: ab1f524b8ad79c55 zh: 137cfcb6d192c269 diff --git a/packages/experimental/forge-bundle/README.md b/packages/experimental/forge-bundle/README.md index 4856883104..5f84d8b749 100644 --- a/packages/experimental/forge-bundle/README.md +++ b/packages/experimental/forge-bundle/README.md @@ -37,7 +37,7 @@ The same switch enables the model's [`create_worktree`](../tool-worktree/README.
Maintainer details — click to expand -The bundle mounts the forge registry, GitHub provider, Session bindings, the worktree model tool, and the panel as six top-level rows. The tool and the panel share the one `worktree` service, so one `worktree` row override configures both, and one archive of a Session reclaims its checkout once. The panel records worktrees requested before a Session starts; model-created worktrees do not acquire the panel's recovery records, but both kinds take part in archive cleanup. The rows use the Session projection, working-directory, filesystem, subprocess, and sandbox services from base-backed profiles; archive cleanup also needs the Workspace registry and Session query of those profiles. +The bundle mounts the forge registry, GitHub provider, Session bindings, the worktree model tool, and the panel as six top-level rows. The tool and the panel share the one `worktree` service, so one `worktree` row override configures both, and one archive of a Session reclaims its checkout once; the row's Keep worktrees when archiving switch on the Plugins page turns the cleanup off for both. The panel records worktrees requested before a Session starts; model-created worktrees do not acquire the panel's recovery records, but both kinds take part in archive cleanup. The rows use the Session projection, working-directory, filesystem, subprocess, and sandbox services from base-backed profiles; archive cleanup also needs the Workspace registry and Session query of those profiles.
diff --git a/packages/experimental/forge-bundle/README.zh.md b/packages/experimental/forge-bundle/README.zh.md index b1e437bc25..998ad63f49 100644 --- a/packages/experimental/forge-bundle/README.zh.md +++ b/packages/experimental/forge-bundle/README.zh.md @@ -37,7 +37,7 @@ kind: "package-bundle"
维护者细节——点击展开 -组合包以六个顶层行挂载 Forge 注册表、GitHub 提供方、Session 绑定、工作树模型工具和面板。工具与面板共用同一个 `worktree` 服务,因此一条 `worktree` 行覆盖同时配置两者,归档一个 Session 只回收一次其检出目录。面板记录 Session 开始前请求的工作树;模型创建的工作树不会获得面板的恢复记录,但两种工作树都参与归档清理。这些行使用基于 base 的 profile 提供的 Session 投影、工作目录、文件系统、子进程和沙箱服务;归档清理还需要这些 profile 的 Workspace 注册表与 Session 查询。 +组合包以六个顶层行挂载 Forge 注册表、GitHub 提供方、Session 绑定、工作树模型工具和面板。工具与面板共用同一个 `worktree` 服务,因此一条 `worktree` 行覆盖同时配置两者,归档一个 Session 只回收一次其检出目录;该行在插件页上的“归档时不删除工作树”开关同时为两者关闭清理。面板记录 Session 开始前请求的工作树;模型创建的工作树不会获得面板的恢复记录,但两种工作树都参与归档清理。这些行使用基于 base 的 profile 提供的 Session 投影、工作目录、文件系统、子进程和沙箱服务;归档清理还需要这些 profile 的 Workspace 注册表与 Session 查询。
diff --git a/packages/experimental/worktree/README.i18n.yaml b/packages/experimental/worktree/README.i18n.yaml index a7b24da9f0..52775cdaa9 100644 --- a/packages/experimental/worktree/README.i18n.yaml +++ b/packages/experimental/worktree/README.i18n.yaml @@ -15,8 +15,8 @@ en: d152484eb41ac6b4 zh: 2f8a621b991260a1 /deepseek-ai-dsh-experimental-worktree/use-this-package: - en: ab16360228013067 - zh: 48047eb61715aaaa + en: bddc0a7dd4dc21f6 + zh: 57005ed1aaf034aa /deepseek-ai-dsh-experimental-worktree/understand-the-implementation: en: 6971a7ca9073bef1 zh: b977c28a75c7f963 diff --git a/packages/experimental/worktree/README.md b/packages/experimental/worktree/README.md index d285818e63..5725f48843 100644 --- a/packages/experimental/worktree/README.md +++ b/packages/experimental/worktree/README.md @@ -36,9 +36,9 @@ Mount the service alongside `workingDirectory`, `fs`, `subprocess`, `sandbox`, ` `ctx.worktrees.restore(agent, { path, branch, baseCommit, repositoryRoot }, signal?, onPhase?)` checks a removed worktree out again at its recorded directory. It validates the recorded repository root, full commit object name, branch, and canonical target inside the configured pool before mutation. It removes only the missing target's unlocked registration with `git worktree remove`; other worktrees and locked registrations remain unchanged. It then checks out the branch when it still exists, or creates the branch again at `baseCommit` when it does not, and reports which happened as `branchRecreated`. An existing directory is an error. The calling Session's working directory does not change, and changes that were never committed are not recovered. Checkout disables filters as creation does. `onPhase` receives `prepare` before validation, target-registration cleanup, and branch creation, and `checkout` before the files are written; it must not throw. -Every creation appends a `plugin:worktree/created` record to the Session log after the directory change, so the `worktree` projection lists the Session's checkouts with `owned` false for one inside a fork-inherited prefix. When the Workspace archives a Session, the service registers one `scheduled` cleanup for the first checkout that Session created itself and returns; the inspection runs in the background. The checkout is retained while any unarchived Session refers to it, by a recorded creation or by a working directory inside it (a Session beneath an archived subagent ancestor counts as archived; cold Sessions are read from the projection cache or their log), and while the creator's sandbox policy is read-only. An eligible checkout is removed with a non-force `git worktree remove` under the creator's policy after a second use check inside the path lock, which also holds `ensure` and `set` into that path through `working-directory/access`; the branch and its commits remain. Tracked changes, untracked files, hidden index flags, submodules, locks, detached HEAD, a mismatched branch, and targets outside the configured pool retain the checkout; ignored files do not, as Git itself discards them. Processes are not consulted: a process still writing there makes Git refuse, and an idle one fails its next command. Unarchiving cancels an unadmitted removal and waits for an admitted one. `cleanupOf(session, revision)` reads the attempt, or waits for a named revision to settle, as `scheduled`, `retained`, `removed`, or `failed`; a failure leaves the Session archived and logs a warning. Checkouts created before this event existed, and Sessions archived earlier, are not swept. +Every creation appends a `plugin:worktree/created` record to the Session log after the directory change, so the `worktree` projection lists the Session's checkouts with `owned` false for one inside a fork-inherited prefix. When the Workspace archives a Session, the service registers one `scheduled` cleanup for the first checkout that Session created itself and returns; the inspection runs in the background. While `retainOnArchive` is on, archiving registers nothing and every checkout stays; the field is volatile and read at each archive, and the [Forge panel](../client-ui-forge/README.md) edits it as a switch on the bundle's worktree row of the Plugins page. The checkout is retained while any unarchived Session refers to it, by a recorded creation or by a working directory inside it (a Session beneath an archived subagent ancestor counts as archived; cold Sessions are read from the projection cache or their log), and while the creator's sandbox policy is read-only. An eligible checkout is removed with a non-force `git worktree remove` under the creator's policy after a second use check inside the path lock, which also holds `ensure` and `set` into that path through `working-directory/access`; the branch and its commits remain. Tracked changes, untracked files, hidden index flags, submodules, locks, detached HEAD, a mismatched branch, and targets outside the configured pool retain the checkout; ignored files do not, as Git itself discards them. Processes are not consulted: a process still writing there makes Git refuse, and an idle one fails its next command. Unarchiving cancels an unadmitted removal and waits for an admitted one. `cleanupOf(session, revision)` reads the attempt, or waits for a named revision to settle, as `scheduled`, `retained`, `removed`, or `failed`; a failure leaves the Session archived and logs a warning. Checkouts created before this event existed, and Sessions archived earlier, are not swept. -The default checkout directory is `/.agents/worktrees/`. The returned `repositoryRoot` is the top-level directory of the caller’s current checkout; when it is a linked checkout, the pool is nested inside it. Omitted names join the `dsh-` prefix, the first eight hexadecimal digits of the UUID in the Session id, a hyphen, and four random hexadecimal digits, such as `dsh-6b1f02c4-9a3e`; a Session id without a UUID gets eight random hexadecimal digits after the prefix. `generatedWorktreeName` exports the same rule for callers that name a worktree before creating it. The service writes a `.gitignore` containing `*` and a trailing newline only when its allocation creates the pool; existing files and ignore rules are preserved. Relative `directory`, generated `namePrefix`, executable choices, and process limits are configurable in the [configuration catalog](../../../docs/config-catalog.md#deepseek-aidsh-experimental-worktree). +The default checkout directory is `/.agents/worktrees/`. The returned `repositoryRoot` is the top-level directory of the caller’s current checkout; when it is a linked checkout, the pool is nested inside it. Omitted names join the `dsh-` prefix, the first eight hexadecimal digits of the UUID in the Session id, a hyphen, and four random hexadecimal digits, such as `dsh-6b1f02c4-9a3e`; a Session id without a UUID gets eight random hexadecimal digits after the prefix. `generatedWorktreeName` exports the same rule for callers that name a worktree before creating it. The service writes a `.gitignore` containing `*` and a trailing newline only when its allocation creates the pool; existing files and ignore rules are preserved. Relative `directory`, generated `namePrefix`, executable choices, process limits, and `retainOnArchive` are configurable in the [configuration catalog](../../../docs/config-catalog.md#deepseek-aidsh-experimental-worktree). ----- diff --git a/packages/experimental/worktree/README.zh.md b/packages/experimental/worktree/README.zh.md index 61395089ca..61b0e8cbdb 100644 --- a/packages/experimental/worktree/README.zh.md +++ b/packages/experimental/worktree/README.zh.md @@ -36,9 +36,9 @@ kind: "package-reference" `ctx.worktrees.restore(agent, { path, branch, baseCommit, repositoryRoot }, signal?, onPhase?)` 在记录的目录重新检出被删除的 worktree。它在修改前校验记录中的仓库根目录、完整提交对象名、分支和配置池内的规范目标路径。它只通过 `git worktree remove` 移除缺失目标的未锁定登记;其他 worktree 与锁定登记保持不变。随后在分支仍存在时检出该分支,否则在 `baseCommit` 重新创建同名分支,并通过 `branchRecreated` 报告是哪种情况。目录已存在时会报错。调用方 Session 的工作目录不变,从未提交的修改无法恢复。检出与创建时一样禁用过滤器。`onPhase` 在检查目录、清理登记与创建分支之前收到 `prepare`,在写入文件之前收到 `checkout`;它不能抛出异常。 -每次创建都会在目录切换之后向 Session 日志追加一条 `plugin:worktree/created` 事件,因此 `worktree` 投影列出该 Session 的检出目录,位于 fork 继承前缀内的条目 `owned` 为 false。Workspace 归档某个 Session 时,服务为该 Session 自己创建的第一个检出目录登记一条 `scheduled` 清理并立即返回;检查在后台进行。只要任一未归档 Session 仍引用该目录——通过记录的创建,或通过位于其中的工作目录(祖先子代理已归档的 Session 视为已归档;冷 Session 从投影缓存或其日志读取)——或创建者的沙箱策略为只读,目录就保留。符合条件的目录在路径锁内再做一次使用检查后,用创建者的策略执行不带 force 的 `git worktree remove`;路径锁同时通过 `working-directory/access` 阻塞进入该路径的 `ensure` 与 `set`;分支及其提交保留。跟踪文件改动、未跟踪文件、隐藏的索引标记、子模块、锁、分离 HEAD、分支不匹配以及位于配置池之外的目标都会保留目录;被忽略的文件不会,因为 Git 自身会丢弃它们。不检查进程:仍在写入的进程会让 Git 拒绝删除,空闲进程的下一条命令会失败。取消归档会取消尚未获准的删除,并等待已获准的删除结束。`cleanupOf(session, revision)` 读取本次尝试,或等待指定修订号结束,状态为 `scheduled`、`retained`、`removed` 或 `failed`;失败时 Session 仍保持归档并记录警告。此事件存在之前创建的检出目录,以及更早归档的 Session,不会被扫描。 +每次创建都会在目录切换之后向 Session 日志追加一条 `plugin:worktree/created` 事件,因此 `worktree` 投影列出该 Session 的检出目录,位于 fork 继承前缀内的条目 `owned` 为 false。Workspace 归档某个 Session 时,服务为该 Session 自己创建的第一个检出目录登记一条 `scheduled` 清理并立即返回;检查在后台进行。`retainOnArchive` 开启时,归档不登记任何清理,所有检出目录都保留;该字段是 volatile 字段,每次归档时读取,[Forge 面板](../client-ui-forge/README.zh.md)在插件页该套件的 worktree 行上以开关编辑它。只要任一未归档 Session 仍引用该目录——通过记录的创建,或通过位于其中的工作目录(祖先子代理已归档的 Session 视为已归档;冷 Session 从投影缓存或其日志读取)——或创建者的沙箱策略为只读,目录就保留。符合条件的目录在路径锁内再做一次使用检查后,用创建者的策略执行不带 force 的 `git worktree remove`;路径锁同时通过 `working-directory/access` 阻塞进入该路径的 `ensure` 与 `set`;分支及其提交保留。跟踪文件改动、未跟踪文件、隐藏的索引标记、子模块、锁、分离 HEAD、分支不匹配以及位于配置池之外的目标都会保留目录;被忽略的文件不会,因为 Git 自身会丢弃它们。不检查进程:仍在写入的进程会让 Git 拒绝删除,空闲进程的下一条命令会失败。取消归档会取消尚未获准的删除,并等待已获准的删除结束。`cleanupOf(session, revision)` 读取本次尝试,或等待指定修订号结束,状态为 `scheduled`、`retained`、`removed` 或 `failed`;失败时 Session 仍保持归档并记录警告。此事件存在之前创建的检出目录,以及更早归档的 Session,不会被扫描。 -默认检出目录是 `/.agents/worktrees/`。返回的 `repositoryRoot` 是调用方当前检出目录的顶层目录;如果它是链接检出目录,工作树父目录就嵌套在其中。省略名称时,名称由前缀 `dsh-`、Session id 中 UUID 的前 8 位十六进制数、一个连字符和 4 位随机十六进制数组成,例如 `dsh-6b1f02c4-9a3e`;Session id 不含 UUID 时,前缀后接 8 位随机十六进制数。`generatedWorktreeName` 导出同一规则,供在创建前确定名称的调用方使用。仅当服务的分配操作创建了父目录时,服务才会写入内容为 `*` 加换行符的 `.gitignore`;已有文件与忽略规则保持不变。相对路径 `directory`、生成名称使用的 `namePrefix`、可执行程序与进程限制可在[配置目录](../../../docs/config-catalog.zh.md#deepseek-aidsh-experimental-worktree)中查阅。 +默认检出目录是 `/.agents/worktrees/`。返回的 `repositoryRoot` 是调用方当前检出目录的顶层目录;如果它是链接检出目录,工作树父目录就嵌套在其中。省略名称时,名称由前缀 `dsh-`、Session id 中 UUID 的前 8 位十六进制数、一个连字符和 4 位随机十六进制数组成,例如 `dsh-6b1f02c4-9a3e`;Session id 不含 UUID 时,前缀后接 8 位随机十六进制数。`generatedWorktreeName` 导出同一规则,供在创建前确定名称的调用方使用。仅当服务的分配操作创建了父目录时,服务才会写入内容为 `*` 加换行符的 `.gitignore`;已有文件与忽略规则保持不变。相对路径 `directory`、生成名称使用的 `namePrefix`、可执行程序、进程限制与 `retainOnArchive` 可在[配置目录](../../../docs/config-catalog.zh.md#deepseek-aidsh-experimental-worktree)中查阅。 ----- diff --git a/packages/experimental/worktree/package.json b/packages/experimental/worktree/package.json index 97ad9bfb91..6f0a109d84 100644 --- a/packages/experimental/worktree/package.json +++ b/packages/experimental/worktree/package.json @@ -51,6 +51,7 @@ "@deepseek-ai/dsh-session-projection": "workspace:*", "@deepseek-ai/dsh-session-projection-cache": "workspace:*", "@deepseek-ai/dsh-session-query": "workspace:*", + "@deepseek-ai/dsh-settings": "workspace:*", "@deepseek-ai/dsh-subprocess": "workspace:*", "@deepseek-ai/dsh-working-directory": "workspace:*", "@deepseek-ai/dsh-workspace": "workspace:*" @@ -69,6 +70,7 @@ "@deepseek-ai/dsh-session-projection": "workspace:*", "@deepseek-ai/dsh-session-projection-cache": "workspace:*", "@deepseek-ai/dsh-session-query": "workspace:*", + "@deepseek-ai/dsh-settings": "workspace:*", "@deepseek-ai/dsh-storage": "workspace:*", "@deepseek-ai/dsh-storage-domain": "workspace:*", "@deepseek-ai/dsh-subprocess": "workspace:*", diff --git a/packages/experimental/worktree/src/archive.ts b/packages/experimental/worktree/src/archive.ts index d5d3dfde06..adb0101f08 100644 --- a/packages/experimental/worktree/src/archive.ts +++ b/packages/experimental/worktree/src/archive.ts @@ -28,6 +28,8 @@ declare module '@deepseek-ai/cordis' { /** The service operations reclamation needs; kept narrow so the archive module never reaches Git directly. */ export interface ReclamationHost { + /** Whether the deployment keeps every checkout on archive; read at each admission. */ + retainOnArchive(): boolean /** Run `body` after every operation on `path` that was requested earlier, and before any requested later. */ exclusiveCheckout(path: string, body: () => Promise): Promise /** Inspect and, when eligible and admitted, remove the checkout without force. Rejects on Git failure. */ @@ -114,6 +116,7 @@ export class WorktreeReclamation { /** Register attempts for the Session's own creations and return; every inspection runs in the background. */ private schedule(sessionId: SessionId): void { + if (this.host.retainOnArchive()) return const live = this.ctx.sessions.get(sessionId) // A cold Session's creations come from the persisted cache or its log, below. const owned = live === undefined ? undefined : this.projection.stateOf(live).created.filter(creation => creation.owned) diff --git a/packages/experimental/worktree/src/index.ts b/packages/experimental/worktree/src/index.ts index c168ba7bd9..9006fb3f23 100644 --- a/packages/experimental/worktree/src/index.ts +++ b/packages/experimental/worktree/src/index.ts @@ -1,11 +1,12 @@ /** Creates a new Git branch and checkout, then changes the calling Session's working directory; restores a removed checkout. */ -import { Context, Service } from '@deepseek-ai/cordis' +import { Context, Service, type Volatile } from '@deepseek-ai/cordis' import z from '@deepseek-ai/schemastery' import type { Agent } from '@deepseek-ai/dsh-agent' import type {} from '@deepseek-ai/dsh-fs' import type { SandboxExecutionPolicy } from '@deepseek-ai/dsh-sandbox' import type {} from '@deepseek-ai/dsh-sandbox-policy' +import type {} from '@deepseek-ai/dsh-settings' import { appendPluginRecord } from '@deepseek-ai/dsh-session' import type { Session } from '@deepseek-ai/dsh-session' import type { ProjectionHandle } from '@deepseek-ai/dsh-session-projection' @@ -30,8 +31,10 @@ export { generatedWorktreeName } from './name.ts' export { CREATED_RECORD, createdWorktreeSchema, worktreeProjection } from './projection.ts' export type { WorktreeProjectionState } from './projection.ts' -/** Worktree location, generated names, executables, and subprocess resource limits. */ +/** Worktree location, generated names, executables, subprocess resource limits, and the archive cleanup switch. */ export interface Config { + /** Keep every checkout when its Session is archived; editable live from the Plugins page. */ + retainOnArchive: Volatile /** Relative checkout pool inside the source repository. */ directory?: string /** Prefix for automatically generated branch and checkout names. */ @@ -78,7 +81,8 @@ function relativePath(value: string): boolean { export class WorktreeService extends Service { static inject = ['workingDirectory', 'fs', 'subprocess', 'sandbox', 'sandboxPolicy', 'sessionProjections'] - static Config: z = z.object({ + static Config = z.object({ + retainOnArchive: z.boolean().default(false).volatile(), directory: z.string().default('.agents/worktrees'), namePrefix: z.string().default('dsh-'), gitCommand: z.string().default('git'), @@ -115,6 +119,8 @@ export class WorktreeService extends Service { this.lifetime.abort(new Error('worktree service disposed')) await Promise.allSettled(this.pending) }) + // The Forge panel draws the retain switch on this row's Plugins page. + ctx.inject(['settings'], (child) => { child.effect(() => child.settings.configure({ auto: false }, ctx.fiber)) }) } protected async [Service.init](): Promise { @@ -123,6 +129,7 @@ export class WorktreeService extends Service { // them the service only creates and restores, as a headless profile composes it. this.ctx.inject(['workspaceRegistry', 'sessionQuery', 'sessions', 'workingDirectory', 'sandboxPolicy'], (scope) => { const reclamation = new WorktreeReclamation(scope, { + retainOnArchive: () => this.config.retainOnArchive.get(), exclusiveCheckout: (path, body) => this.exclusiveCheckout(path, body), removeCheckout: (session, request, signal, admit) => this.removeCheckout(session, request, signal, admit), }, this.projection) diff --git a/packages/experimental/worktree/tests/archive.spec.ts b/packages/experimental/worktree/tests/archive.spec.ts index 812e051d05..e2b5c8d47a 100644 --- a/packages/experimental/worktree/tests/archive.spec.ts +++ b/packages/experimental/worktree/tests/archive.spec.ts @@ -63,7 +63,7 @@ function agentFor(ctx: Context, session: Session): Agent { return agent } -async function fixture(options: { cache?: boolean } = {}) { +async function fixture(options: { cache?: boolean; retainOnArchive?: boolean } = {}) { const temporary = await realpath(await mkdtemp(join(tmpdir(), 'dsh-worktree-archive-'))) cleanups.push(() => rm(temporary, { recursive: true, force: true })) const root = await repository(temporary) @@ -87,12 +87,13 @@ async function fixture(options: { cache?: boolean } = {}) { ctx.provide('storageDomain', domain) if (options.cache === true) await ctx.plugin(SessionProjectionCache, { writeEveryEvents: 1_000, writeIntervalMs: 60_000 }) await ctx.plugin(WorkspaceRegistry) - await ctx.plugin(WorktreeService, {}) + const worktrees = ctx.plugin(WorktreeService, options.retainOnArchive === undefined ? {} : { retainOnArchive: options.retainOnArchive }) + await worktrees const session = ctx.sessions.create(SessionId('archive-owner'), { meta: { cwd: root } }) const agent = agentFor(ctx, session) await ctx.agents.register(agent) const worktree = await ctx.worktrees.create(agent, { name: 'archive-me' }) - return { ctx, root, session, agent, worktree, temporary } + return { ctx, root, session, agent, worktree, temporary, worktrees } } type Fixture = Awaited> @@ -420,6 +421,17 @@ describe('archive-triggered worktree cleanup', () => { expect(handle.stateOf(f.session).created).toEqual(before) }) + it('registers no attempt while retainOnArchive is set, and resumes once it is cleared', async () => { + const f = await fixture({ retainOnArchive: true }) + await f.ctx.workspaceRegistry.archiveSession(f.session.id) + expect(await f.ctx.worktrees.cleanupOf(f.session, null)).toBeNull() + await access(f.worktree.path) + await f.ctx.workspaceRegistry.unarchiveSession(f.session.id) + await f.worktrees.update({ retainOnArchive: false }) + await f.ctx.workspaceRegistry.archiveSession(f.session.id) + expect(await settled(f)).toMatchObject({ status: 'removed' }) + }) + it('withdraws listeners before draining, so disposal neither fails unrelated access nor serves a stale result', async () => { const f = await fixture() const entered = Promise.withResolvers() diff --git a/packages/experimental/worktree/tests/harness.ts b/packages/experimental/worktree/tests/harness.ts index e1cb3ee446..0da9cb0432 100644 --- a/packages/experimental/worktree/tests/harness.ts +++ b/packages/experimental/worktree/tests/harness.ts @@ -69,7 +69,10 @@ export async function repository(parent = tmpdir()): Promise { } } -export async function harness(root: string, config: Config = {}, mode: SandboxMode = 'danger-full-access'): Promise { +/** Plugin config as the schema accepts it: the volatile `retainOnArchive` is given as its plain value. */ +export type HarnessConfig = Omit & { retainOnArchive?: boolean } + +export async function harness(root: string, config: HarnessConfig = {}, mode: SandboxMode = 'danger-full-access'): Promise { const ctx = new Context() try { await ctx.plugin(SessionProjectionRegistry) diff --git a/packages/experimental/worktree/tests/settings.spec.ts b/packages/experimental/worktree/tests/settings.spec.ts new file mode 100644 index 0000000000..1b6e6c145c --- /dev/null +++ b/packages/experimental/worktree/tests/settings.spec.ts @@ -0,0 +1,36 @@ +/** The service's Plugins page is the Forge panel's row page, not a generated Settings page. */ +import { mkdtemp, rm } from 'node:fs/promises' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import { afterEach, it } from 'vitest' +import AgentRegistry from '@deepseek-ai/dsh-agent' +import LocalFileSystem from '@deepseek-ai/dsh-fs-local' +import SandboxPolicyService from '@deepseek-ai/dsh-sandbox-policy' +import SessionProjectionRegistry from '@deepseek-ai/dsh-session-projection' +import LocalSubprocessRuntime from '@deepseek-ai/dsh-subprocess-local' +import SystemPrompt from '@deepseek-ai/dsh-system-prompt' +import WorkingDirectoryService from '@deepseek-ai/dsh-working-directory' +import { omitsGeneratedPage } from '../../../settings/settings/tests/live-config.ts' +import WorktreeService from '../src/index.ts' +import { UnusedSandbox } from './harness.ts' + +const cleanups: Array<() => Promise> = [] +afterEach(async () => { + for (const cleanup of cleanups.splice(0).reverse()) await cleanup() +}) + +it('keeps its own instance off the generated Settings pages', async () => { + const root = await mkdtemp(join(tmpdir(), 'dsh-worktree-settings-')) + cleanups.push(() => rm(root, { recursive: true, force: true })) + await omitsGeneratedPage(async (ctx) => { + await ctx.plugin(SessionProjectionRegistry) + await ctx.plugin(AgentRegistry) + await ctx.plugin(SystemPrompt) + await ctx.plugin(LocalFileSystem, { cwd: root }) + await ctx.plugin(LocalSubprocessRuntime) + await ctx.plugin(UnusedSandbox) + await ctx.plugin(SandboxPolicyService, { mode: 'danger-full-access', workspaceRoot: root }) + await ctx.plugin(WorkingDirectoryService) + return ctx.plugin(WorktreeService) + }) +}) diff --git a/packages/experimental/worktree/tsconfig.json b/packages/experimental/worktree/tsconfig.json index 1665709063..82f74490dd 100644 --- a/packages/experimental/worktree/tsconfig.json +++ b/packages/experimental/worktree/tsconfig.json @@ -52,6 +52,9 @@ }, { "path": "../../workspace/workspace" + }, + { + "path": "../../settings/settings" } ] } diff --git a/packages/extensions/cordis-client-runner/src/client/slot-catalog.ts b/packages/extensions/cordis-client-runner/src/client/slot-catalog.ts index 9c23bd0ddc..73731e5732 100644 --- a/packages/extensions/cordis-client-runner/src/client/slot-catalog.ts +++ b/packages/extensions/cordis-client-runner/src/client/slot-catalog.ts @@ -3061,7 +3061,9 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [ hookContext: '', slotInject: '', declaredBy: 'an entry in \'main\' (client-ui-plugin-manager), so it exists while that entry is mounted', - occupants: [], + occupants: [ + 'experimental-client-ui-forge WorktreeSettings', + ], replaceRisk: 'none', example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'plugins.row.config\', () => ctx.slots.register(\n { name: \'plugins.row.config\', key: \'\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}', source: 'packages/client/ui-plugin-manager/src/client/slot-contract.ts:167', diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ad90edd159..b74516dfc7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9277,6 +9277,9 @@ importers: '@deepseek-ai/dsh-client-ui-layout': specifier: workspace:* version: link:../../client/ui-layout + '@deepseek-ai/dsh-client-ui-plugin-manager': + specifier: workspace:* + version: link:../../client/ui-plugin-manager '@deepseek-ai/dsh-client-ui-primitives': specifier: workspace:* version: link:../../client/ui-primitives @@ -9286,6 +9289,9 @@ importers: '@deepseek-ai/dsh-client-ui-session': specifier: workspace:* version: link:../../client/ui-session + '@deepseek-ai/dsh-client-ui-settings': + specifier: workspace:* + version: link:../../client/ui-settings '@deepseek-ai/dsh-client-ui-sidebar-right': specifier: workspace:* version: link:../../client/ui-sidebar-right @@ -11821,6 +11827,9 @@ importers: '@deepseek-ai/dsh-session-query': specifier: workspace:* version: link:../../session-query/session-query + '@deepseek-ai/dsh-settings': + specifier: workspace:* + version: link:../../settings/settings '@deepseek-ai/dsh-storage': specifier: workspace:* version: link:../../storage/storage From fc6afa97fe7e7166efbe990d407e3a21d4efdbbc Mon Sep 17 00:00:00 2001 From: sjw1231 Date: Thu, 5 Nov 2026 16:09:05 +0800 Subject: [PATCH 258/322] fix(tools): classify cancellation thrown by a started tool body A started tool body that throws the signal's reason or an AbortError without HarnessError identity now keeps its message and carries AbortError / ABORTED, so the cancellation is routable like the registry's own cancellation results. HarnessErrors and distinct failures that settle during cancellation stay unchanged. Refs #7869 --- ...19-cooperative-tool-cancellation.i18n.yaml | 4 +- ...026-07-19-cooperative-tool-cancellation.md | 2 +- ...-07-19-cooperative-tool-cancellation.zh.md | 2 +- .agents/skills/dsh-error-handling/SKILL.md | 4 +- .../references/error-codes.md | 2 +- docs/cookbook/adding-a-tool.i18n.yaml | 4 +- docs/cookbook/adding-a-tool.md | 2 +- docs/cookbook/adding-a-tool.zh.md | 2 +- docs/subsystems/tools.i18n.yaml | 4 +- docs/subsystems/tools.md | 2 +- docs/subsystems/tools.zh.md | 2 +- packages/core/tools/README.i18n.yaml | 4 +- packages/core/tools/README.md | 2 +- packages/core/tools/README.zh.md | 2 +- packages/core/tools/src/pipeline.ts | 21 +++- packages/core/tools/tests/tools.spec.ts | 113 ++++++++++++++++++ 16 files changed, 150 insertions(+), 22 deletions(-) diff --git a/.agents/notes/implemented/architecture/2026-07-19-cooperative-tool-cancellation.i18n.yaml b/.agents/notes/implemented/architecture/2026-07-19-cooperative-tool-cancellation.i18n.yaml index e4b4714af1..1cb3a2ce6c 100644 --- a/.agents/notes/implemented/architecture/2026-07-19-cooperative-tool-cancellation.i18n.yaml +++ b/.agents/notes/implemented/architecture/2026-07-19-cooperative-tool-cancellation.i18n.yaml @@ -15,8 +15,8 @@ en: 0e1399cad4151f87 zh: 960fa0ccbe0f8fea /agent-note-cooperative-tool-cancellation-at-the-registry-boundary/decision/cancellation-codes-record-whether-dispatch-occurred: - en: c787fba8731ac147 - zh: 21b5968ae6f8cd59 + en: 8dd2ee8bcc3bbadd + zh: 0792ddab00d72512 /agent-note-cooperative-tool-cancellation-at-the-registry-boundary/decision/pre-aborted-entry-short-circuits-after-materialization: en: 53362db6a0c71698 zh: 311de45ca26d3fdc diff --git a/.agents/notes/implemented/architecture/2026-07-19-cooperative-tool-cancellation.md b/.agents/notes/implemented/architecture/2026-07-19-cooperative-tool-cancellation.md index 8ad0af1d21..9369c18c6b 100644 --- a/.agents/notes/implemented/architecture/2026-07-19-cooperative-tool-cancellation.md +++ b/.agents/notes/implemented/architecture/2026-07-19-cooperative-tool-cancellation.md @@ -32,7 +32,7 @@ An around-dispatch wrapper may replace `exec.signal` for its delegated lifetime `ABORTED_BEFORE_DISPATCH` carries `{ name: 'AbortError' }` and model text `Error: tool call aborted before dispatch`. It applies whenever cancellation prevents body invocation, including pre-aborted entry, cancellation during pre-policy or approval, an aborted wrapper signal, a wrapper success overtaken by caller cancellation before delegation, and agent-loop siblings skipped after turn cancellation. -`ABORTED` carries model text `Error: tool call aborted` and applies only after the body was invoked, including cancellation while an around wrapper or post-policy listener waits after body completion. A denial, wrapper failure, tool failure, or post-policy failure remains more specific than generic cancellation. A timeout owned by timeout-policy remains `TOOL_TIMEOUT`, and contexts deferred before a successful outcome is replaced remain attached. +`ABORTED` carries model text `Error: tool call aborted` and applies only after the body was invoked, including cancellation while an around wrapper or post-policy listener waits after body completion. A started body that throws the signal's reason or an `AbortError` without `HarnessError` identity keeps that message and carries `{ name: 'AbortError', code: 'ABORTED' }`. A denial, wrapper failure, other tool failure, or post-policy failure remains more specific than generic cancellation. A timeout owned by timeout-policy remains `TOOL_TIMEOUT`, and contexts deferred before a successful outcome is replaced remain attached. ### Pre-aborted entry short-circuits after materialization diff --git a/.agents/notes/implemented/architecture/2026-07-19-cooperative-tool-cancellation.zh.md b/.agents/notes/implemented/architecture/2026-07-19-cooperative-tool-cancellation.zh.md index 613db6dacd..99cf662d77 100644 --- a/.agents/notes/implemented/architecture/2026-07-19-cooperative-tool-cancellation.zh.md +++ b/.agents/notes/implemented/architecture/2026-07-19-cooperative-tool-cancellation.zh.md @@ -32,7 +32,7 @@ Status: implemented `ABORTED_BEFORE_DISPATCH` 携带 `{ name: 'AbortError' }` 和模型可见文本 `Error: tool call aborted before dispatch`。凡取消阻止工具主体调用时都使用该结果,包括进入时已中止、前置策略或审批期间取消、包装层信号已中止、包装层在委托前返回的成功结果被调用方取消抢先,以及轮次取消后 agent loop(智能体循环)跳过的同批调用。 -`ABORTED` 携带模型可见文本 `Error: tool call aborted`,并且只在工具主体已经调用后使用,包括工具主体完成后环绕包装层或后置策略监听器等待期间发生的取消。拒绝、包装层失败、工具失败或后置策略失败比通用取消更具体。timeout-policy 自身拥有的超时仍为 `TOOL_TIMEOUT`,成功结果被取消替换前延后附加的上下文仍会保留。 +`ABORTED` 携带模型可见文本 `Error: tool call aborted`,并且只在工具主体已经调用后使用,包括工具主体完成后环绕包装层或后置策略监听器等待期间发生的取消。已开始的工具主体抛出 signal 的 reason 或不具备 `HarnessError` 身份的 `AbortError` 时,结果保留该 message,并携带 `{ name: 'AbortError', code: 'ABORTED' }`。拒绝、包装层失败、其他工具失败或后置策略失败比通用取消更具体。timeout-policy 自身拥有的超时仍为 `TOOL_TIMEOUT`,成功结果被取消替换前延后附加的上下文仍会保留。 ### 进入时已中止会在物化后短路 diff --git a/.agents/skills/dsh-error-handling/SKILL.md b/.agents/skills/dsh-error-handling/SKILL.md index 126c9d0ecc..35f51cb935 100644 --- a/.agents/skills/dsh-error-handling/SKILL.md +++ b/.agents/skills/dsh-error-handling/SKILL.md @@ -17,11 +17,11 @@ Convert foreign failures where the dependency is owned. Node errno, SDK, protoco ## Tool failures -The tool registry keeps `error.name` and `error.code` on `tool/result` when the producer supplies them: a `HarnessError` thrown by the tool body, a pre-execute `deny` with `info`, the registry's own cancellation result (`AbortError` with `ABORTED` or `ABORTED_BEFORE_DISPATCH`), or a `tools/execute` wrapper result such as the timeout policy's `TOOL_TIMEOUT`. Any other thrown value, a guard denial, an approval rejection, and a post-execute block persist only text that retry policy, UI, and analytics cannot route on. Every expected failure reachable from a tool body therefore throws a `HarnessError`, normally the owning domain's subclass: +The tool registry keeps `error.name` and `error.code` on `tool/result` when the producer supplies them: a `HarnessError` thrown by the tool body, a pre-execute `deny` with `info`, the registry's own cancellation result (`AbortError` with `ABORTED` or `ABORTED_BEFORE_DISPATCH`, also applied to a signal reason or `AbortError` the body throws after cancellation), or a `tools/execute` wrapper result such as the timeout policy's `TOOL_TIMEOUT`. Any other thrown value, a guard denial, an approval rejection, and a post-execute block persist only text that retry policy, UI, and analytics cannot route on. Every expected failure reachable from a tool body therefore throws a `HarnessError`, normally the owning domain's subclass: - Hand-checked argument constraints throw `ToolArgsError` (`INVALID_ARGS`) from `dsh-tools`. - Missing composition or caller context, such as an absent Agent, service, or open turn, throws the owning package's error with its own code. -- Caller cancellation throws a `HarnessError` whose `name` is `AbortError` and whose code is the `dsh-tools` `TOOL_ABORTED` constant (`ABORTED`), matching the registry's cancellation result; never a bare `AbortError` or `signal.reason`. +- Caller cancellation either propagates the signal's reason or an `AbortError`, which the registry classifies as `AbortError` with the `dsh-tools` `TOOL_ABORTED` constant (`ABORTED`), or throws a `HarnessError` with that `name` and code. Never replace it with a different plain `Error`; a failure distinct from the cancellation, such as a cleanup failure, keeps its own class and code. - Dependency failures follow the conversion rule above; filesystem errno maps to `FsError` codes such as `FS_NOT_FOUND`, `FS_PERMISSION_DENIED`, and `FS_IO_ERROR`. A policy that denies a call in `tools/pre-execute` supplies `info` with its own `name` and `code`. The registry's built-in approval rejections and guard denials currently carry only a reason, so they remain unroutable until the registry gives them codes. A failure the model must not treat as success is an `isError` result; a successful domain outcome in a non-ideal state, such as a non-zero exit or no matches, stays a success value, and a success-shaped failure value is allowed only when the output schema documents it. Tests assert `error.info.name` and `error.info.code` for each expected failure path, not only the message. diff --git a/.agents/skills/dsh-error-handling/references/error-codes.md b/.agents/skills/dsh-error-handling/references/error-codes.md index 26b2cada50..8398513965 100644 --- a/.agents/skills/dsh-error-handling/references/error-codes.md +++ b/.agents/skills/dsh-error-handling/references/error-codes.md @@ -26,7 +26,7 @@ Use this guide when adding or reviewing an error class, an error code, or a fail - `name` is the PascalCase class name ending in `Error`, such as `JobError` or `SandboxEscalationError`. - Assign `this.name` a string literal in the constructor. `HarnessError` defaults `name` to `new.target.name`, but a bundler may rename a colliding class binding, and a renamed class would change persisted data. - Do not reuse another domain's class name, and do not encode a code in the name. -- Cancellation is the one exception: a tool throws a `HarnessError` whose `name` is `AbortError` and whose code is the `dsh-tools` `TOOL_ABORTED` constant (`ABORTED`), so tool-thrown and registry-generated cancellations share one `name` and `code`. +- Cancellation is the one exception: its `name` is `AbortError` and its code is the `dsh-tools` `TOOL_ABORTED` constant (`ABORTED`). The registry applies both to a signal reason or `AbortError` a tool throws after cancellation; a tool that throws its own cancellation error uses a `HarnessError` with the same `name` and code. ## Format the code diff --git a/docs/cookbook/adding-a-tool.i18n.yaml b/docs/cookbook/adding-a-tool.i18n.yaml index 5f78bb6983..69e442121d 100644 --- a/docs/cookbook/adding-a-tool.i18n.yaml +++ b/docs/cookbook/adding-a-tool.i18n.yaml @@ -9,8 +9,8 @@ en: 2cc80a2a79e23005 zh: 87e43383055890ce /tool-authoring-reference/rules-of-the-execute-contract: - en: f12260d67c4c4d4d - zh: 3955d44622432fd9 + en: 291be8e1926ba5f2 + zh: f5ff9c6648452161 /tool-authoring-reference/long-running-work: en: 5f6b0c15cb91e21b zh: 633a2192df186ac3 diff --git a/docs/cookbook/adding-a-tool.md b/docs/cookbook/adding-a-tool.md index b1eaed1098..6917b1e612 100644 --- a/docs/cookbook/adding-a-tool.md +++ b/docs/cookbook/adding-a-tool.md @@ -45,7 +45,7 @@ Registration is effect-based: disposing the plugin fiber unregisters the tool. S - **Execution identity is protected.** The registry materializes `arguments` as detached lossless JSON in one recursive pass, freezes that value before policy starts, and assigns an opaque `exec.token`; `callId`, `name`, `arguments`, `agent`, `token`, the required caller-owned `signal`, and an optional enclosing-transport `parent` token stay immutable through dispatch. `parent` is identity-only and exposes no live outer execution. Treat `args` as readonly input. Only an around-dispatch wrapper receives a mutable view, and it may replace and restore the required `exec.signal` to impose a deadline but cannot remove it. - **Declare and return one canonical JSON value.** `output.schema` uses `ValueSchemaSpec` and may have an object, array, scalar, or null root. `execute` returns only the inferred value; the registry snapshots it as lossless JSON, validates it, freezes it, and passes it to `output.render(args, value)`. Do not return content blocks from the body or make callers parse prose for ids and fields. - **Throwing or returning an invalid value means `isError`.** The registry catches throws and contains schema, renderer, metadata-projector, and lossless-JSON failures before observers run. Throw a `HarnessError` subclass with a stable `code` for every expected failure; a thrown `HarnessError` is the only tool-body outcome that keeps `error.name` and `error.code` on the result, and the [error-handling rules](../../.agents/skills/dsh-error-handling/SKILL.md#tool-failures) define the classes and codes. Represent a successful domain outcome in the canonical value even when its Native renderer explains a non-ideal state, such as a non-zero process exit. -- **Honor `exec.signal`.** Cancel in-flight work when it fires and throw a `HarnessError` named `AbortError` whose code is the `TOOL_ABORTED` constant (`ABORTED`), matching the registry's own cancellation result. +- **Honor `exec.signal`.** Cancel in-flight work when it fires and let the signal's reason or a dependency's `AbortError` propagate; the registry records it as `AbortError` with the `TOOL_ABORTED` constant (`ABORTED`). Do not replace it with a different plain `Error`. - **Project durable card data with `presentationMeta` (optional).** `output.presentationMeta(args, value)` derives replayable JSON from the same canonical value. The core persists it on `tool/result` and hands it to `presentResult`, so a card that needs result-time facts—such as `write`/`edit` applied hunks—survives replay without persisting the canonical value. The projector is skipped for nested Code dispatches because they have no cards. - **Use `exec.agent` for async notifications.** `agent.inject({ content, source: { kind: 'my-plugin' } })` appends durable context the NEXT model request sees — it is not a wake-up (an idle agent stays idle). Declare that `kind` through [`MessageSourceMap`](../subsystems/llm-streaming.md#content-blocks-and-messages) in your plugin: session format V4 rejects the retired `{ kind: 'plugin', plugin: '' }` wrapper at message admission. Guard against disposed agents (try/catch). diff --git a/docs/cookbook/adding-a-tool.zh.md b/docs/cookbook/adding-a-tool.zh.md index 0149575daf..9cdf5541dd 100644 --- a/docs/cookbook/adding-a-tool.zh.md +++ b/docs/cookbook/adding-a-tool.zh.md @@ -45,7 +45,7 @@ export function apply(ctx: Context) { - **执行身份受保护。** 注册表在一次递归遍历中将 `arguments` 物化为分离的无损 JSON,在策略开始前冻结该值,并分配一个不透明的 `exec.token`;`callId`、`name`、`arguments`、`agent`、`token`、必填且由调用方持有的 `signal`,以及可选的外层传输 `parent` token 在整个分发过程中保持不可变。`parent` 仅用于身份标识,不暴露活跃的外层执行。请将 `args` 视为只读输入。只有 around-dispatch 包装器会收到可变视图;它可以替换并恢复必填的 `exec.signal` 以施加截止时间,但不能移除该信号。 - **声明并返回一个规范 JSON 值。** `output.schema` 使用 `ValueSchemaSpec`,根可以是对象、数组、标量或 null。`execute` 只返回推导出的值;注册表将其快照为无损 JSON,完成校验和冻结后,再传给 `output.render(args, value)`。工具主体不要返回内容块,也不要迫使调用方从自然语言中解析 id 和字段。 - **抛出异常或返回无效值意味着 `isError`。** 注册表会捕获异常,并在观察者运行前收敛 schema、渲染器、元数据投影器和无损 JSON 失败。每种预期失败都应抛出带稳定 `code` 的 `HarnessError` 子类;在工具主体的各种产出中,只有抛出的 `HarnessError` 会让结果保留 `error.name` 和 `error.code`,具体的错误类和 code 由[错误处理规则](../../.agents/skills/dsh-error-handling/SKILL.md#tool-failures)规定。成功的领域结果即使表示不理想的状态,也应写入规范值;其 Native 渲染器可以解释该状态,例如进程以非零状态退出。 -- **遵守 `exec.signal`。** 信号触发时取消进行中的工作,并抛出 `name` 为 `AbortError`、code 为 `TOOL_ABORTED` 常量(值为 `ABORTED`)的 `HarnessError`,与注册表自己生成的取消结果一致。 +- **遵守 `exec.signal`。** 信号触发时取消进行中的工作,让 signal 的 reason 或依赖抛出的 `AbortError` 直接传播;注册表会把它记录为 `AbortError` 与 `TOOL_ABORTED` 常量(值为 `ABORTED`)。不要把它替换成另一个普通 `Error`。 - **使用 `presentationMeta` 投影持久化的卡片数据(可选)。** `output.presentationMeta(args, value)` 从同一个规范值派生可回放的 JSON。核心将其持久化在 `tool/result` 上并传给 `presentResult`,因此需要结果期事实的卡片——例如 `write`/`edit` 的已应用 hunk——无需持久化规范值也能在回放中重现。嵌套 Code 分发没有卡片,因此会跳过该投影器。 - **使用 `exec.agent` 发送异步通知。** `agent.inject({ content, source: { kind: 'my-plugin' } })` 追加持久化上下文,下一次模型请求会看到它——这不是唤醒(空闲的 agent(智能体)保持空闲)。在插件里通过 [`MessageSourceMap`](../subsystems/llm-streaming.zh.md#content-blocks-and-messages) 声明该 `kind`:session format V4 在消息准入处拒绝退役的 `{ kind: 'plugin', plugin: '' }` 包装。请防范已 dispose 的 agent(try/catch)。 diff --git a/docs/subsystems/tools.i18n.yaml b/docs/subsystems/tools.i18n.yaml index c155ec4cb6..6aecc60c2c 100644 --- a/docs/subsystems/tools.i18n.yaml +++ b/docs/subsystems/tools.i18n.yaml @@ -21,8 +21,8 @@ en: 14522295539ea2fb zh: 572c462f2c6b70ad /tools/execution-extensible-waterfalls-plus-monotonic-policy: - en: 0baa3a0d6fb8d3be - zh: 3583d70d2507cac8 + en: fe34c933c35399e9 + zh: 58142bf2f0d5877b /tools/the-enforced-raw-json-schema-subset: en: 28e354bfa2f9cebb zh: be1f75abccf8afdf diff --git a/docs/subsystems/tools.md b/docs/subsystems/tools.md index 02b213abdb..47c333df63 100644 --- a/docs/subsystems/tools.md +++ b/docs/subsystems/tools.md @@ -522,7 +522,7 @@ interface ToolErrorInfo { } ``` -The result carries only the outcome. Call identity remains on the immutable `ToolExecution` that accompanies it through every hook and on the durable `tool/call` / `tool/result` session events, so wrappers cannot create a second, disagreeing identity. The canonical `value` is execution-local: the loop persists only `content`, `error`, and `meta`, while `tool/ptc-dispatch` stores the sub-call's rendered `content`, `isError`, optional structured `error`, and presentation `meta`. Replay reproduces presentation but cannot reconstruct canonical intermediate values. Optional `ToolErrorInfo.reason` retains raw user-facing detail without adding it to model-facing content. The registry sets `info` from a thrown `HarnessError` (its `name` and `code`), from a pre-execute `deny` that supplies it, and on its own cancellation results (`AbortError` with `ABORTED` or `ABORTED_BEFORE_DISPATCH`); a `tools/execute` wrapper may also return a result with `info`, such as the timeout policy's `TOOL_TIMEOUT`. Any other thrown value, guard denial, approval rejection, or post-execute block produces an `error` without `info`. +The result carries only the outcome. Call identity remains on the immutable `ToolExecution` that accompanies it through every hook and on the durable `tool/call` / `tool/result` session events, so wrappers cannot create a second, disagreeing identity. The canonical `value` is execution-local: the loop persists only `content`, `error`, and `meta`, while `tool/ptc-dispatch` stores the sub-call's rendered `content`, `isError`, optional structured `error`, and presentation `meta`. Replay reproduces presentation but cannot reconstruct canonical intermediate values. Optional `ToolErrorInfo.reason` retains raw user-facing detail without adding it to model-facing content. The registry sets `info` from a thrown `HarnessError` (its `name` and `code`), from a pre-execute `deny` that supplies it, and on its own cancellation results (`AbortError` with `ABORTED` or `ABORTED_BEFORE_DISPATCH`); when a started body throws the signal's reason or an `AbortError` after cancellation, the result keeps that message and carries `AbortError` with `ABORTED`; a `tools/execute` wrapper may also return a result with `info`, such as the timeout policy's `TOOL_TIMEOUT`. Any other thrown value, guard denial, approval rejection, or post-execute block produces an `error` without `info`. On success the registry snapshots and validates the body value, freezes it, and invokes the pure renderer plus the optional presentation metadata projector for native and nested calls. It separately materializes the durable presentation fields immediately before `tools/result`; an invalid value, renderer/projector failure, or non-JSON presentation becomes a JSON-safe `isError`. The final live observer therefore sees the exact execution-local value beside fields safe for the later durable append. diff --git a/docs/subsystems/tools.zh.md b/docs/subsystems/tools.zh.md index 32e333c298..0a643f25bd 100644 --- a/docs/subsystems/tools.zh.md +++ b/docs/subsystems/tools.zh.md @@ -522,7 +522,7 @@ interface ToolErrorInfo { } ``` -结果仅承载产出。调用身份保留在不可变的 `ToolExecution` 上,后者伴随结果经过每个钩子,并出现在持久化的 `tool/call` / `tool/result` 会话事件上,因此包装层无法创建第二个相互矛盾的身份。规范的 `value` 仅存在于执行期间:循环只持久化 `content`、`error` 和 `meta`,`tool/ptc-dispatch` 则存储子调用渲染后的 `content`、`isError`、可选结构化 `error` 和展示 `meta`。回放可以重现展示,却无法重建规范的中间值。可选的 `ToolErrorInfo.reason` 保留面向用户的原始详情,不将其加入模型可见内容。注册表会在以下情况设置 `info`:抛出的是 `HarnessError`(取其 `name` 和 `code`)、pre-execute 的 `deny` 自带 `info`,以及注册表自己生成的取消结果(`AbortError`,code 为 `ABORTED` 或 `ABORTED_BEFORE_DISPATCH`);`tools/execute` 包装器也可能返回带 `info` 的结果,例如超时策略的 `TOOL_TIMEOUT`。其他抛出值、guard 拒绝、审批拒绝和 post-execute block 产生的 `error` 都不含 `info`。 +结果仅承载产出。调用身份保留在不可变的 `ToolExecution` 上,后者伴随结果经过每个钩子,并出现在持久化的 `tool/call` / `tool/result` 会话事件上,因此包装层无法创建第二个相互矛盾的身份。规范的 `value` 仅存在于执行期间:循环只持久化 `content`、`error` 和 `meta`,`tool/ptc-dispatch` 则存储子调用渲染后的 `content`、`isError`、可选结构化 `error` 和展示 `meta`。回放可以重现展示,却无法重建规范的中间值。可选的 `ToolErrorInfo.reason` 保留面向用户的原始详情,不将其加入模型可见内容。注册表会在以下情况设置 `info`:抛出的是 `HarnessError`(取其 `name` 和 `code`)、pre-execute 的 `deny` 自带 `info`,以及注册表自己生成的取消结果(`AbortError`,code 为 `ABORTED` 或 `ABORTED_BEFORE_DISPATCH`);已开始的工具主体在取消后抛出 signal 的 reason 或 `AbortError` 时,结果保留其 message,并带上 `AbortError` 与 `ABORTED`;`tools/execute` 包装器也可能返回带 `info` 的结果,例如超时策略的 `TOOL_TIMEOUT`。其他抛出值、guard 拒绝、审批拒绝和 post-execute block 产生的 `error` 都不含 `info`。 成功时,注册表会快照并校验函数体返回值,将其冻结,然后调用纯渲染器,并为原生与嵌套调用执行可选的展示元数据投影器。注册表会在 `tools/result` 之前另行物化持久展示字段;无效值、渲染器/投影器失败或非 JSON 展示都会转为 JSON 安全的 `isError`。因此,最终实时观察者能看到精确的执行期值,以及可安全用于后续持久追加的字段。 diff --git a/packages/core/tools/README.i18n.yaml b/packages/core/tools/README.i18n.yaml index 68b03222e1..996df18d4f 100644 --- a/packages/core/tools/README.i18n.yaml +++ b/packages/core/tools/README.i18n.yaml @@ -45,8 +45,8 @@ en: 2dee0a37e0c1fa38 zh: 0963cba32685612e /deepseek-ai-dsh-tools/understand-the-implementation/execution-and-cancellation: - en: dc44a88997777988 - zh: 56454aeace1c8b77 + en: 41f1c678aba0056e + zh: 7976fdd8aced1cc5 /deepseek-ai-dsh-tools/understand-the-implementation/ptc-mode: en: 83cf9a5077158879 zh: 80508a70a3674226 diff --git a/packages/core/tools/README.md b/packages/core/tools/README.md index a0ce675371..178cd0e402 100644 --- a/packages/core/tools/README.md +++ b/packages/core/tools/README.md @@ -125,7 +125,7 @@ The registry holds typed `ToolDefinition`s in scoped layers and projects them on ### Execution and cancellation -Each typed invocation materializes and freezes parsed arguments, assigns an opaque correlation token, and runs policy and dispatch. A pre-execute denial may attach `ToolErrorInfo` beside its model-facing reason; the native and PTC durable projections preserve the structured name, code, and optional user-facing reason without adding that detail to model content. Cancellation is cooperative and quiescent: every tool body receives the caller-owned `exec.signal` and must observe it; cancellation before body invocation is `ABORTED_BEFORE_DISPATCH`, after invocation it replaces only a successful outcome with `ABORTED`. Denials, wrapper failures, tool failures, post-policy failures, and timeout-owned `TOOL_TIMEOUT` remain more specific. Unknown and throwing tools become structured errors (`UNKNOWN_TOOL`), so a call fails without ending the turn. +Each typed invocation materializes and freezes parsed arguments, assigns an opaque correlation token, and runs policy and dispatch. A pre-execute denial may attach `ToolErrorInfo` beside its model-facing reason; the native and PTC durable projections preserve the structured name, code, and optional user-facing reason without adding that detail to model content. Cancellation is cooperative and quiescent: every tool body receives the caller-owned `exec.signal` and must observe it; cancellation before body invocation is `ABORTED_BEFORE_DISPATCH`, after invocation it replaces only a successful outcome with `ABORTED`, and a thrown signal reason or `AbortError` without `HarnessError` identity keeps its message but carries `ABORTED`. Denials, wrapper failures, tool failures, post-policy failures, and timeout-owned `TOOL_TIMEOUT` remain more specific. Unknown and throwing tools become structured errors (`UNKNOWN_TOOL`), so a call fails without ending the turn. ### PTC mode diff --git a/packages/core/tools/README.zh.md b/packages/core/tools/README.zh.md index 55e9c50020..a1c351b7c8 100644 --- a/packages/core/tools/README.zh.md +++ b/packages/core/tools/README.zh.md @@ -125,7 +125,7 @@ Agent 步骤的并发上限使用 [agent-loop 配置](../agent-loop/README.zh.md ### 执行与取消 -每次类型化调用都会实体化并冻结解析后的参数、分配不透明关联 token,再运行策略与分发。pre-execute 拒绝可以在模型可见原因旁附带 `ToolErrorInfo`;原生与 PTC 持久投影会保留结构化名称、代码与可选用户可见原因,但不会把该详情加入模型内容。取消采用协作式并等待完全停稳:每个工具主体都收到调用方拥有的 `exec.signal` 且必须观测它;调用主体前的取消为 `ABORTED_BEFORE_DISPATCH`,调用主体后的取消只能把成功结果替换为 `ABORTED`。拒绝、包装层失败、工具失败、后置策略失败与超时产生的 `TOOL_TIMEOUT` 仍保留更具体的结果。未知工具与抛出异常的工具都会变成结构化错误(`UNKNOWN_TOOL`),因此调用会失败而不会结束轮次。 +每次类型化调用都会实体化并冻结解析后的参数、分配不透明关联 token,再运行策略与分发。pre-execute 拒绝可以在模型可见原因旁附带 `ToolErrorInfo`;原生与 PTC 持久投影会保留结构化名称、代码与可选用户可见原因,但不会把该详情加入模型内容。取消采用协作式并等待完全停稳:每个工具主体都收到调用方拥有的 `exec.signal` 且必须观测它;调用主体前的取消为 `ABORTED_BEFORE_DISPATCH`,调用主体后的取消只能把成功结果替换为 `ABORTED`,抛出的 signal reason 或不具备 `HarnessError` 身份的 `AbortError` 保留其 message 并携带 `ABORTED`。拒绝、包装层失败、工具失败、后置策略失败与超时产生的 `TOOL_TIMEOUT` 仍保留更具体的结果。未知工具与抛出异常的工具都会变成结构化错误(`UNKNOWN_TOOL`),因此调用会失败而不会结束轮次。 ### PTC mode diff --git a/packages/core/tools/src/pipeline.ts b/packages/core/tools/src/pipeline.ts index 56c68c6c59..b4128ba29e 100644 --- a/packages/core/tools/src/pipeline.ts +++ b/packages/core/tools/src/pipeline.ts @@ -254,6 +254,9 @@ export class ToolExecutionPipeline { * Dispatch the registered body with the original caller signal fused back * into any around-wrapper replacement. Cancellation never abandons the body: * a started promise reaches quiescence before its outcome becomes `ABORTED`. + * After cancellation, a thrown signal reason or `AbortError` without + * `HarnessError` identity keeps its message and gains the `ABORTED` + * identity; a thrown `HarnessError` and any other failure stay unchanged. */ private async dispatchToolBody(exec: MutableToolRunContext): Promise { const state = this.cancellationStates.get(exec) @@ -278,7 +281,9 @@ export class ToolExecutionPipeline { ? toolAbortedResult(result) : result } catch (error: unknown) { - return toolErrorResult(error) + return isAborted(signal) && isUnclassifiedCancellation(error, signal) + ? toolErrorResult(error, { name: 'AbortError', code: TOOL_ABORTED }) + : toolErrorResult(error) } finally { fused.dispose() exec.signal = wrapperSignal @@ -687,13 +692,23 @@ function errorInfo(error: unknown): ToolErrorInfo | undefined { } } +/** Whether a value thrown after cancellation is that cancellation and carries no identity of its own. */ +function isUnclassifiedCancellation(error: unknown, signal: AbortSignal): boolean { + if (errorInfo(error) !== undefined) return false + try { + return error === signal.reason || (error instanceof Error && error.name === 'AbortError') + } catch { + // A value whose prototype or `name` cannot be read is not a recognizable cancellation. + return false + } +} + /** Mint a same-process correlation token whose identity is its value. */ function createExecutionToken(): ToolExecutionToken { return Symbol('dsh.tool.execution') as ToolExecutionToken } -function toolErrorResult(error: unknown): ToolExecutionResult { - const info = errorInfo(error) +function toolErrorResult(error: unknown, info = errorInfo(error)): ToolExecutionResult { const message = toolErrorMessage(error) return { content: [{ type: 'text', text: `Error: ${message}` }], diff --git a/packages/core/tools/tests/tools.spec.ts b/packages/core/tools/tests/tools.spec.ts index 785927d780..fd3ca61a39 100644 --- a/packages/core/tools/tests/tools.spec.ts +++ b/packages/core/tools/tests/tools.spec.ts @@ -1729,6 +1729,119 @@ describe('ToolRuntime', () => { }) }) + it.each([ + ['the signal reason', (signal: AbortSignal): void => { signal.throwIfAborted() }, 'caller stopped'], + ['a dependency AbortError', (): void => { throw new DOMException('This operation was aborted', 'AbortError') }, 'This operation was aborted'], + ])('classifies %s thrown after cancellation as ABORTED', async (_label, fail, message) => { + const ctx = await setup() + const entered = Promise.withResolvers() + ctx.tools.register({ + ...echoTool, + name: 'throws-on-abort', + async execute(_args, exec) { + entered.resolve(undefined) + await new Promise((resolve) => { + exec.signal.addEventListener('abort', () => { resolve() }, { once: true }) + }) + fail(exec.signal) + return 'not reached' + }, + }) + const controller = new AbortController() + const pending = executeToolFixture(ctx, { + callId: ToolCallId('throws-on-abort'), name: 'throws-on-abort', arguments: {}, signal: controller.signal, + }) + await entered.promise + controller.abort('caller stopped') + + await expect(pending).resolves.toMatchObject({ + content: [{ type: 'text', text: `Error: ${message}` }], + isError: true, + error: { message, info: { name: 'AbortError', code: TOOL_ABORTED } }, + }) + }) + + it('keeps a HarnessError thrown after cancellation', async () => { + const ctx = await setup() + const entered = Promise.withResolvers() + ctx.tools.register({ + ...echoTool, + name: 'domain-abort', + execute(_args, exec) { + entered.resolve(undefined) + return new Promise((_resolve, reject) => { + exec.signal.addEventListener('abort', () => { + reject(new HarnessError('search cancelled', 'SEARCH_ABORTED')) + }, { once: true }) + }) + }, + }) + const controller = new AbortController() + const pending = executeToolFixture(ctx, { + callId: ToolCallId('domain-abort'), name: 'domain-abort', arguments: {}, signal: controller.signal, + }) + await entered.promise + controller.abort('caller stopped') + + await expect(pending).resolves.toMatchObject({ + content: [{ type: 'text', text: 'Error: search cancelled' }], + isError: true, + error: { info: { name: 'HarnessError', code: 'SEARCH_ABORTED' } }, + }) + }) + + it.each([ + ['a distinct failure', (): void => { throw new Error('cleanup failed') }, 'Error: cleanup failed'], + ['an uninspectable value', (): void => { + throw new Proxy({}, { + getPrototypeOf: () => { throw new Error('prototype trap') }, + has: () => { throw new Error('has trap') }, + get: () => { throw new Error('get trap') }, + }) + }, 'Error: '], + ])('keeps %s thrown during cancellation without info', async (_label, fail, text) => { + const ctx = await setup() + const entered = Promise.withResolvers() + ctx.tools.register({ + ...echoTool, + name: 'fails-during-abort', + async execute(_args, exec) { + entered.resolve(undefined) + await new Promise((resolve) => { + exec.signal.addEventListener('abort', () => { resolve() }, { once: true }) + }) + fail() + return 'not reached' + }, + }) + const controller = new AbortController() + const pending = executeToolFixture(ctx, { + callId: ToolCallId('fails-during-abort'), name: 'fails-during-abort', arguments: {}, signal: controller.signal, + }) + await entered.promise + controller.abort('caller stopped') + + const result = await pending + expect(result).toMatchObject({ content: [{ type: 'text', text }], isError: true }) + expect(result.error?.info).toBeUndefined() + }) + + it('keeps a plain failure without info when the call was not cancelled', async () => { + const ctx = await setup() + ctx.tools.register({ + ...echoTool, + name: 'plain-failure', + execute() { return Promise.reject(new Error('disk full')) }, + }) + + const result = await executeToolFixture(ctx, { + callId: ToolCallId('plain-failure'), name: 'plain-failure', arguments: {}, signal: new AbortController().signal, + }) + + expect(result).toMatchObject({ isError: true, error: { message: 'disk full' } }) + expect(result.error?.info).toBeUndefined() + }) + it('materializes a pre-aborted call and publishes one result without entering pipeline phases', async () => { const ctx = await setup() const phases = { pre: 0, around: 0, body: 0, post: 0, result: 0 } From 7e180cfd7074bb83cbe9c2c383a7f8d048595016 Mon Sep 17 00:00:00 2001 From: sjw1231 Date: Thu, 5 Nov 2026 16:22:15 +0800 Subject: [PATCH 259/322] feat(tools): attach ApprovalError codes to approval denials An ask that approval does not grant now denies with ApprovalError and APPROVAL_REJECTED, APPROVAL_CANCELLED, or APPROVAL_UNAVAILABLE, so a user rejection is routable on tool/result like other structured failures. Model-facing reasons are unchanged. Refs #7869 --- .agents/skills/dsh-error-handling/SKILL.md | 4 ++-- docs/persistence-catalog.i18n.yaml | 4 ++-- docs/persistence-catalog.md | 2 +- docs/persistence-catalog.zh.md | 2 +- docs/persistence-schema.json | 2 +- docs/subsystems/tools.i18n.yaml | 4 ++-- docs/subsystems/tools.md | 2 +- docs/subsystems/tools.zh.md | 2 +- packages/core/tools/src/contracts.ts | 12 +++++++++++ packages/core/tools/src/pipeline.ts | 20 ++++++++++++------- packages/core/tools/tests/tools.spec.ts | 7 ++++++- .../hook-cc-pretool-ask/session.v4.jsonl | 2 +- 12 files changed, 43 insertions(+), 20 deletions(-) diff --git a/.agents/skills/dsh-error-handling/SKILL.md b/.agents/skills/dsh-error-handling/SKILL.md index 35f51cb935..410f830dab 100644 --- a/.agents/skills/dsh-error-handling/SKILL.md +++ b/.agents/skills/dsh-error-handling/SKILL.md @@ -17,14 +17,14 @@ Convert foreign failures where the dependency is owned. Node errno, SDK, protoco ## Tool failures -The tool registry keeps `error.name` and `error.code` on `tool/result` when the producer supplies them: a `HarnessError` thrown by the tool body, a pre-execute `deny` with `info`, the registry's own cancellation result (`AbortError` with `ABORTED` or `ABORTED_BEFORE_DISPATCH`, also applied to a signal reason or `AbortError` the body throws after cancellation), or a `tools/execute` wrapper result such as the timeout policy's `TOOL_TIMEOUT`. Any other thrown value, a guard denial, an approval rejection, and a post-execute block persist only text that retry policy, UI, and analytics cannot route on. Every expected failure reachable from a tool body therefore throws a `HarnessError`, normally the owning domain's subclass: +The tool registry keeps `error.name` and `error.code` on `tool/result` when the producer supplies them: a `HarnessError` thrown by the tool body, a pre-execute `deny` with `info` (including the registry's approval denials, `ApprovalError` with `APPROVAL_REJECTED`, `APPROVAL_CANCELLED`, or `APPROVAL_UNAVAILABLE`), the registry's own cancellation result (`AbortError` with `ABORTED` or `ABORTED_BEFORE_DISPATCH`, also applied to a signal reason or `AbortError` the body throws after cancellation), or a `tools/execute` wrapper result such as the timeout policy's `TOOL_TIMEOUT`. Any other thrown value, a guard denial, and a post-execute block persist only text that retry policy, UI, and analytics cannot route on. Every expected failure reachable from a tool body therefore throws a `HarnessError`, normally the owning domain's subclass: - Hand-checked argument constraints throw `ToolArgsError` (`INVALID_ARGS`) from `dsh-tools`. - Missing composition or caller context, such as an absent Agent, service, or open turn, throws the owning package's error with its own code. - Caller cancellation either propagates the signal's reason or an `AbortError`, which the registry classifies as `AbortError` with the `dsh-tools` `TOOL_ABORTED` constant (`ABORTED`), or throws a `HarnessError` with that `name` and code. Never replace it with a different plain `Error`; a failure distinct from the cancellation, such as a cleanup failure, keeps its own class and code. - Dependency failures follow the conversion rule above; filesystem errno maps to `FsError` codes such as `FS_NOT_FOUND`, `FS_PERMISSION_DENIED`, and `FS_IO_ERROR`. -A policy that denies a call in `tools/pre-execute` supplies `info` with its own `name` and `code`. The registry's built-in approval rejections and guard denials currently carry only a reason, so they remain unroutable until the registry gives them codes. A failure the model must not treat as success is an `isError` result; a successful domain outcome in a non-ideal state, such as a non-zero exit or no matches, stays a success value, and a success-shaped failure value is allowed only when the output schema documents it. Tests assert `error.info.name` and `error.info.code` for each expected failure path, not only the message. +A policy that denies a call in `tools/pre-execute` supplies `info` with its own `name` and `code`. Guard denials currently carry only a reason, so they remain unroutable until the registry gives them codes. A failure the model must not treat as success is an `isError` result; a successful domain outcome in a non-ideal state, such as a non-zero exit or no matches, stays a success value, and a success-shaped failure value is allowed only when the output schema documents it. Tests assert `error.info.name` and `error.info.code` for each expected failure path, not only the message. Existing `name` and `code` values persist in Session logs and feed analytics. Renaming or reclassifying one is an externally perceptible change that needs an [upgrade guide](../dsh-create-upgrade-guide/SKILL.md). diff --git a/docs/persistence-catalog.i18n.yaml b/docs/persistence-catalog.i18n.yaml index 310e193d05..d06e221f7e 100644 --- a/docs/persistence-catalog.i18n.yaml +++ b/docs/persistence-catalog.i18n.yaml @@ -1308,8 +1308,8 @@ en: 0080c345c319a4b5 zh: de1a8b3ed621ce21 /session-persistence-event-catalog/resolved-persistence-types/toolrestriction: - en: d70be5d46cb1ef7d - zh: d3d5a05d62e443fe + en: 201964862981c234 + zh: 57dd19efdbf93594 /session-persistence-event-catalog/resolved-persistence-types/toolresultmessage: en: 2258683c3cfa4ce3 zh: 5663aa76c911761b diff --git a/docs/persistence-catalog.md b/docs/persistence-catalog.md index d3a8d5bb2e..bb400b173a 100644 --- a/docs/persistence-catalog.md +++ b/docs/persistence-catalog.md @@ -5269,7 +5269,7 @@ Sources: [`packages/llm/llm/src/types.ts:134`](../packages/llm/llm/src/types.ts) SHA-256: `3cfc3a56502da1f8c6153c2c56657bab4b749056968634dd0991d325ec1c919f` -Sources: [`packages/core/tools/src/contracts.ts:376`](../packages/core/tools/src/contracts.ts) +Sources: [`packages/core/tools/src/contracts.ts:388`](../packages/core/tools/src/contracts.ts) | Property | Presence | Type | |---|---|---| diff --git a/docs/persistence-catalog.zh.md b/docs/persistence-catalog.zh.md index 73ebef9642..c6c7d0f7d2 100644 --- a/docs/persistence-catalog.zh.md +++ b/docs/persistence-catalog.zh.md @@ -5271,7 +5271,7 @@ SHA-256: `43e311235aa537df1bacdd92d144df8a952337a76e9ac892cdf670f1a797bad8` SHA-256: `3cfc3a56502da1f8c6153c2c56657bab4b749056968634dd0991d325ec1c919f` -来源:[`packages/core/tools/src/contracts.ts:376`](../packages/core/tools/src/contracts.ts) +来源:[`packages/core/tools/src/contracts.ts:388`](../packages/core/tools/src/contracts.ts) | 属性 | 存在性 | 类型 | |---|---|---| diff --git a/docs/persistence-schema.json b/docs/persistence-schema.json index 57c674e416..a51c94d7fe 100644 --- a/docs/persistence-schema.json +++ b/docs/persistence-schema.json @@ -223,7 +223,7 @@ {"digest":"3bec87f9e6ab3da03346f49923d3c51621debc0159df68605e543c3b2a026f90","names":[],"sources":["packages/llm/llm/src/types.ts:497"]}, {"digest":"3bfeb47b58606f4661904bc723da612782214c463d01e6d61cd6d6193d7374e1","names":[],"sources":[]}, {"digest":"3c2535ca0a2062f172f15344f8040755002b5ac506cf94fc4ebaa822b15feb8c","names":[],"sources":[]}, - {"digest":"3cfc3a56502da1f8c6153c2c56657bab4b749056968634dd0991d325ec1c919f","names":["packages/core/tools/src/contracts.ts#ToolRestriction"],"sources":["packages/core/tools/src/contracts.ts:376"]}, + {"digest":"3cfc3a56502da1f8c6153c2c56657bab4b749056968634dd0991d325ec1c919f","names":["packages/core/tools/src/contracts.ts#ToolRestriction"],"sources":["packages/core/tools/src/contracts.ts:388"]}, {"digest":"3d7d07060a7be77984feb651ea2bf1925d3e0477911d9d3ed86330d1e8ca6182","names":["packages/feedback/message-feedback/src/types.ts#MessageFeedbackItem"],"sources":["packages/feedback/message-feedback/src/types.ts:20"]}, {"digest":"3e0eff5946255ff05d88a10839c60305135801f97794ea48d409f8503303317e","names":[],"sources":[]}, {"digest":"3e2ece4967cfebe95f450a93f45523dff99d6749f6269f2f60f84dfecfcf3693","names":[],"sources":[]}, diff --git a/docs/subsystems/tools.i18n.yaml b/docs/subsystems/tools.i18n.yaml index 6aecc60c2c..48c99ccfa0 100644 --- a/docs/subsystems/tools.i18n.yaml +++ b/docs/subsystems/tools.i18n.yaml @@ -21,8 +21,8 @@ en: 14522295539ea2fb zh: 572c462f2c6b70ad /tools/execution-extensible-waterfalls-plus-monotonic-policy: - en: fe34c933c35399e9 - zh: 58142bf2f0d5877b + en: fa1bbf79ee7026d6 + zh: cf37174936293852 /tools/the-enforced-raw-json-schema-subset: en: 28e354bfa2f9cebb zh: be1f75abccf8afdf diff --git a/docs/subsystems/tools.md b/docs/subsystems/tools.md index 47c333df63..c61435cf51 100644 --- a/docs/subsystems/tools.md +++ b/docs/subsystems/tools.md @@ -522,7 +522,7 @@ interface ToolErrorInfo { } ``` -The result carries only the outcome. Call identity remains on the immutable `ToolExecution` that accompanies it through every hook and on the durable `tool/call` / `tool/result` session events, so wrappers cannot create a second, disagreeing identity. The canonical `value` is execution-local: the loop persists only `content`, `error`, and `meta`, while `tool/ptc-dispatch` stores the sub-call's rendered `content`, `isError`, optional structured `error`, and presentation `meta`. Replay reproduces presentation but cannot reconstruct canonical intermediate values. Optional `ToolErrorInfo.reason` retains raw user-facing detail without adding it to model-facing content. The registry sets `info` from a thrown `HarnessError` (its `name` and `code`), from a pre-execute `deny` that supplies it, and on its own cancellation results (`AbortError` with `ABORTED` or `ABORTED_BEFORE_DISPATCH`); when a started body throws the signal's reason or an `AbortError` after cancellation, the result keeps that message and carries `AbortError` with `ABORTED`; a `tools/execute` wrapper may also return a result with `info`, such as the timeout policy's `TOOL_TIMEOUT`. Any other thrown value, guard denial, approval rejection, or post-execute block produces an `error` without `info`. +The result carries only the outcome. Call identity remains on the immutable `ToolExecution` that accompanies it through every hook and on the durable `tool/call` / `tool/result` session events, so wrappers cannot create a second, disagreeing identity. The canonical `value` is execution-local: the loop persists only `content`, `error`, and `meta`, while `tool/ptc-dispatch` stores the sub-call's rendered `content`, `isError`, optional structured `error`, and presentation `meta`. Replay reproduces presentation but cannot reconstruct canonical intermediate values. Optional `ToolErrorInfo.reason` retains raw user-facing detail without adding it to model-facing content. The registry sets `info` from a thrown `HarnessError` (its `name` and `code`), from a pre-execute `deny` that supplies it, and on its own cancellation results (`AbortError` with `ABORTED` or `ABORTED_BEFORE_DISPATCH`); when a started body throws the signal's reason or an `AbortError` after cancellation, the result keeps that message and carries `AbortError` with `ABORTED`; a `tools/execute` wrapper may also return a result with `info`, such as the timeout policy's `TOOL_TIMEOUT`. An `ask` that approval does not grant becomes a denial with `ApprovalError` and `APPROVAL_REJECTED`, `APPROVAL_CANCELLED`, or `APPROVAL_UNAVAILABLE`. Any other thrown value, guard denial, or post-execute block produces an `error` without `info`. On success the registry snapshots and validates the body value, freezes it, and invokes the pure renderer plus the optional presentation metadata projector for native and nested calls. It separately materializes the durable presentation fields immediately before `tools/result`; an invalid value, renderer/projector failure, or non-JSON presentation becomes a JSON-safe `isError`. The final live observer therefore sees the exact execution-local value beside fields safe for the later durable append. diff --git a/docs/subsystems/tools.zh.md b/docs/subsystems/tools.zh.md index 0a643f25bd..808d7907d7 100644 --- a/docs/subsystems/tools.zh.md +++ b/docs/subsystems/tools.zh.md @@ -522,7 +522,7 @@ interface ToolErrorInfo { } ``` -结果仅承载产出。调用身份保留在不可变的 `ToolExecution` 上,后者伴随结果经过每个钩子,并出现在持久化的 `tool/call` / `tool/result` 会话事件上,因此包装层无法创建第二个相互矛盾的身份。规范的 `value` 仅存在于执行期间:循环只持久化 `content`、`error` 和 `meta`,`tool/ptc-dispatch` 则存储子调用渲染后的 `content`、`isError`、可选结构化 `error` 和展示 `meta`。回放可以重现展示,却无法重建规范的中间值。可选的 `ToolErrorInfo.reason` 保留面向用户的原始详情,不将其加入模型可见内容。注册表会在以下情况设置 `info`:抛出的是 `HarnessError`(取其 `name` 和 `code`)、pre-execute 的 `deny` 自带 `info`,以及注册表自己生成的取消结果(`AbortError`,code 为 `ABORTED` 或 `ABORTED_BEFORE_DISPATCH`);已开始的工具主体在取消后抛出 signal 的 reason 或 `AbortError` 时,结果保留其 message,并带上 `AbortError` 与 `ABORTED`;`tools/execute` 包装器也可能返回带 `info` 的结果,例如超时策略的 `TOOL_TIMEOUT`。其他抛出值、guard 拒绝、审批拒绝和 post-execute block 产生的 `error` 都不含 `info`。 +结果仅承载产出。调用身份保留在不可变的 `ToolExecution` 上,后者伴随结果经过每个钩子,并出现在持久化的 `tool/call` / `tool/result` 会话事件上,因此包装层无法创建第二个相互矛盾的身份。规范的 `value` 仅存在于执行期间:循环只持久化 `content`、`error` 和 `meta`,`tool/ptc-dispatch` 则存储子调用渲染后的 `content`、`isError`、可选结构化 `error` 和展示 `meta`。回放可以重现展示,却无法重建规范的中间值。可选的 `ToolErrorInfo.reason` 保留面向用户的原始详情,不将其加入模型可见内容。注册表会在以下情况设置 `info`:抛出的是 `HarnessError`(取其 `name` 和 `code`)、pre-execute 的 `deny` 自带 `info`,以及注册表自己生成的取消结果(`AbortError`,code 为 `ABORTED` 或 `ABORTED_BEFORE_DISPATCH`);已开始的工具主体在取消后抛出 signal 的 reason 或 `AbortError` 时,结果保留其 message,并带上 `AbortError` 与 `ABORTED`;`tools/execute` 包装器也可能返回带 `info` 的结果,例如超时策略的 `TOOL_TIMEOUT`。审批未授予的 `ask` 会变成带 `ApprovalError` 的拒绝,code 为 `APPROVAL_REJECTED`、`APPROVAL_CANCELLED` 或 `APPROVAL_UNAVAILABLE`。其他抛出值、guard 拒绝和 post-execute block 产生的 `error` 都不含 `info`。 成功时,注册表会快照并校验函数体返回值,将其冻结,然后调用纯渲染器,并为原生与嵌套调用执行可选的展示元数据投影器。注册表会在 `tools/result` 之前另行物化持久展示字段;无效值、渲染器/投影器失败或非 JSON 展示都会转为 JSON 安全的 `isError`。因此,最终实时观察者能看到精确的执行期值,以及可安全用于后续持久追加的字段。 diff --git a/packages/core/tools/src/contracts.ts b/packages/core/tools/src/contracts.ts index 089dc09417..52d06c96eb 100644 --- a/packages/core/tools/src/contracts.ts +++ b/packages/core/tools/src/contracts.ts @@ -266,6 +266,18 @@ export const TOOL_ABORTED = 'ABORTED' /** Canonical error code for cancellation before a tool body was invoked. */ export const TOOL_ABORTED_BEFORE_DISPATCH = 'ABORTED_BEFORE_DISPATCH' +/** Error name the registry records when approval does not grant a call. */ +export const APPROVAL_ERROR_NAME = 'ApprovalError' + +/** Approval code for a call the user rejected. */ +export const APPROVAL_REJECTED = 'APPROVAL_REJECTED' + +/** Approval code for an approval request cancelled without a caller cancellation. */ +export const APPROVAL_CANCELLED = 'APPROVAL_CANCELLED' + +/** Approval code for a call that needs approval when no approval service, Agent, or channel can answer it. */ +export const APPROVAL_UNAVAILABLE = 'APPROVAL_UNAVAILABLE' + /** Structured error metadata for a failed tool call (alongside the model-facing text). */ export interface ToolErrorInfo { name: string diff --git a/packages/core/tools/src/pipeline.ts b/packages/core/tools/src/pipeline.ts index b4128ba29e..db9a82eba7 100644 --- a/packages/core/tools/src/pipeline.ts +++ b/packages/core/tools/src/pipeline.ts @@ -7,7 +7,7 @@ import { HarnessError } from '@deepseek-ai/dsh-llm' import type { UserMessage } from '@deepseek-ai/dsh-session' import type {} from '@deepseek-ai/dsh-user-approval' import { assertNever, deepFreeze, snapshotJsonValue, type JsonValue } from '@deepseek-ai/dsh-util-values' -import { TOOL_ABORTED, TOOL_ABORTED_BEFORE_DISPATCH, ToolNotFoundError, ToolOutputError } from './contracts.ts' +import { APPROVAL_CANCELLED, APPROVAL_ERROR_NAME, APPROVAL_REJECTED, APPROVAL_UNAVAILABLE, TOOL_ABORTED, TOOL_ABORTED_BEFORE_DISPATCH, ToolNotFoundError, ToolOutputError } from './contracts.ts' import { validateJsonSchemaValue } from './json-schema.ts' import type { ToolsService } from './index.ts' import type { ResolvedToolSet, ToolDefinition, ToolExecutionInput, ToolExecutionMode, ToolExecution, ToolRunContext, ToolExecutionResult, ToolExecutionSuccess, ToolErrorInfo, ToolExecutionToken, PreToolDecision, PostToolDecision } from './contracts.ts' @@ -432,7 +432,8 @@ export class ToolExecutionPipeline { * session to audit to and no UI to route to. Otherwise the outcome maps * one-to-one — `allowed-once` proceeds; the three non-grants deny with * distinct reasons so the model can tell a human "no" from an absent - * approval channel. + * approval channel. Every denial carries `ApprovalError` with + * `APPROVAL_REJECTED`, `APPROVAL_CANCELLED`, or `APPROVAL_UNAVAILABLE`. */ private async serviceAsk( exec: ToolExecution, @@ -441,13 +442,13 @@ export class ToolExecutionPipeline { const approval = this.ctx.get('approval') if (approval === undefined) { return { - decision: { kind: 'deny', reason: ask.reason ?? `tool "${exec.name}" requires approval (not yet supported)` }, + decision: approvalDenial(ask.reason ?? `tool "${exec.name}" requires approval (not yet supported)`, APPROVAL_UNAVAILABLE), approvalCancelled: false, } } if (exec.agent === undefined) { return { - decision: { kind: 'deny', reason: `tool "${exec.name}" requires approval, but the call has no agent to route it through` }, + decision: approvalDenial(`tool "${exec.name}" requires approval, but the call has no agent to route it through`, APPROVAL_UNAVAILABLE), approvalCancelled: false, } } @@ -462,15 +463,15 @@ export class ToolExecutionPipeline { switch (outcome) { case 'allowed-once': return { decision: { kind: 'allow' }, approvalCancelled: false } case 'rejected': return { - decision: { kind: 'deny', reason: `the user rejected tool "${exec.name}"` }, + decision: approvalDenial(`the user rejected tool "${exec.name}"`, APPROVAL_REJECTED), approvalCancelled: false, } case 'cancelled': return { - decision: { kind: 'deny', reason: `approval for tool "${exec.name}" was cancelled` }, + decision: approvalDenial(`approval for tool "${exec.name}" was cancelled`, APPROVAL_CANCELLED), approvalCancelled: true, } case 'unavailable': return { - decision: { kind: 'deny', reason: `tool "${exec.name}" requires approval, but no approval channel is available` }, + decision: approvalDenial(`tool "${exec.name}" requires approval, but no approval channel is available`, APPROVAL_UNAVAILABLE), approvalCancelled: false, } default: return assertNever(outcome, 'ApprovalOutcome') @@ -692,6 +693,11 @@ function errorInfo(error: unknown): ToolErrorInfo | undefined { } } +/** Materialize a non-granting approval outcome as a denial with routable `ApprovalError` identity. */ +function approvalDenial(reason: string, code: string): Extract { + return { kind: 'deny', reason, info: { name: APPROVAL_ERROR_NAME, code } } +} + /** Whether a value thrown after cancellation is that cancellation and carries no identity of its own. */ function isUnclassifiedCancellation(error: unknown, signal: AbortSignal): boolean { if (errorInfo(error) !== undefined) return false diff --git a/packages/core/tools/tests/tools.spec.ts b/packages/core/tools/tests/tools.spec.ts index fd3ca61a39..2210774820 100644 --- a/packages/core/tools/tests/tools.spec.ts +++ b/packages/core/tools/tests/tools.spec.ts @@ -11,7 +11,7 @@ import SystemPrompt from '@deepseek-ai/dsh-system-prompt' import AgentRegistry, { type Agent } from '@deepseek-ai/dsh-agent' import AgentLoop from '@deepseek-ai/dsh-agent-loop' import ApprovalService, { type ApprovalOutcome, type ApprovalRequest } from '@deepseek-ai/dsh-user-approval' -import ToolRuntime, { defineTool, JsonSchemaError, parameterSchemaSpecToJsonSchema, validateArgs, ToolArgsError, ToolNotFoundError, TOOL_ABORTED, TOOL_ABORTED_BEFORE_DISPATCH, type InferArgs, type ParameterSchemaSpec, type PreToolDecision, type PostToolDecision, type JsonSchemaNode, type ToolDefinition, type ToolDispatchExecution, type ToolExecutionResult, type ToolExecutionToken } from '@deepseek-ai/dsh-tools' +import ToolRuntime, { APPROVAL_CANCELLED, APPROVAL_ERROR_NAME, APPROVAL_REJECTED, APPROVAL_UNAVAILABLE, defineTool, JsonSchemaError, parameterSchemaSpecToJsonSchema, validateArgs, ToolArgsError, ToolNotFoundError, TOOL_ABORTED, TOOL_ABORTED_BEFORE_DISPATCH, type InferArgs, type ParameterSchemaSpec, type PreToolDecision, type PostToolDecision, type JsonSchemaNode, type ToolDefinition, type ToolDispatchExecution, type ToolExecutionResult, type ToolExecutionToken } from '@deepseek-ai/dsh-tools' import { defineContentToolFixture } from '@deepseek-ai/dsh-tool-testkit' import type { JsonValue } from '@deepseek-ai/dsh-util-values' @@ -837,6 +837,7 @@ describe('ToolRuntime', () => { const result = await executeToolFixture(ctx, { signal: testToolSignal, callId: ToolCallId('c1'), name: 'echo', arguments: { text: 'hi' } }) expect(result.isError).toBe(true) expect(result.content[0]).toMatchObject({ text: 'Error: tool "echo" requires approval (not yet supported)' }) + expect(result.error?.info).toEqual({ name: APPROVAL_ERROR_NAME, code: APPROVAL_UNAVAILABLE }) }) describe('ask routing through ctx.approval', () => { @@ -893,6 +894,7 @@ describe('ToolRuntime', () => { const result = await executeToolFixture(ctx, { signal: testToolSignal, callId: ToolCallId('c1'), name: 'echo', arguments: {}, agent: fakeAgent() }) expect(result.isError).toBe(true) expect(result.content[0]).toMatchObject({ text: 'Error: the user rejected tool "echo"' }) + expect(result.error?.info).toEqual({ name: APPROVAL_ERROR_NAME, code: APPROVAL_REJECTED }) }) it('denies with the cancellation reason on cancelled', async () => { @@ -903,6 +905,7 @@ describe('ToolRuntime', () => { const result = await executeToolFixture(ctx, { signal: testToolSignal, callId: ToolCallId('c1'), name: 'echo', arguments: {}, agent: fakeAgent() }) expect(result.isError).toBe(true) expect(result.content[0]).toMatchObject({ text: 'Error: approval for tool "echo" was cancelled' }) + expect(result.error?.info).toEqual({ name: APPROVAL_ERROR_NAME, code: APPROVAL_CANCELLED }) }) it('returns ABORTED_BEFORE_DISPATCH when caller cancellation overtakes approval', async () => { @@ -947,6 +950,7 @@ describe('ToolRuntime', () => { const result = await executeToolFixture(ctx, { signal: testToolSignal, callId: ToolCallId('c1'), name: 'echo', arguments: {}, agent: fakeAgent() }) expect(result.isError).toBe(true) expect(result.content[0]).toMatchObject({ text: 'Error: tool "echo" requires approval, but no approval channel is available' }) + expect(result.error?.info).toEqual({ name: APPROVAL_ERROR_NAME, code: APPROVAL_UNAVAILABLE }) }) it('denies an agent-less execution without asking — nothing to route or audit through', async () => { @@ -962,6 +966,7 @@ describe('ToolRuntime', () => { expect(asked).toBe(false) expect(result.isError).toBe(true) expect(result.content[0]).toMatchObject({ text: 'Error: tool "echo" requires approval, but the call has no agent to route it through' }) + expect(result.error?.info).toEqual({ name: APPROVAL_ERROR_NAME, code: APPROVAL_UNAVAILABLE }) }) it('turns a rogue outcome from a NON-conforming approval stand-in into an isError result', async () => { diff --git a/snapshots/session/hook-cc-pretool-ask/session.v4.jsonl b/snapshots/session/hook-cc-pretool-ask/session.v4.jsonl index a7e9e8d802..b6442d4b68 100644 --- a/snapshots/session/hook-cc-pretool-ask/session.v4.jsonl +++ b/snapshots/session/hook-cc-pretool-ask/session.v4.jsonl @@ -18,7 +18,7 @@ {"type":"hook/result","data":{"turn":1,"point":"PreToolUse","handlerId":"claude-code:PreToolUse:1","decision":"ask","exitCode":0,"durationMs":4.532041999999819}} {"type":"approval/asked","data":{"id":"{{approval:1}}","toolName":"bash","callId":"call_00_6k0oGSliVHxGSgqBmMEO4311","reason":"bash requires manual approval in this session"}} {"type":"approval/decided","data":{"id":"{{approval:1}}","outcome":"rejected"}} -{"type":"tool/result","data":{"turn":1,"step":1,"message":{"role":"tool","source":{"kind":"tool","callId":"call_00_6k0oGSliVHxGSgqBmMEO4311"},"toolCallId":"call_00_6k0oGSliVHxGSgqBmMEO4311","content":[{"type":"text","text":"Error: the user rejected tool \"bash\""}],"isError":true,"id":"{{message:5}}"}},"sourceEventSeqs":[14],"surfaceOp":"append"} +{"type":"tool/result","data":{"turn":1,"step":1,"message":{"role":"tool","source":{"kind":"tool","callId":"call_00_6k0oGSliVHxGSgqBmMEO4311"},"toolCallId":"call_00_6k0oGSliVHxGSgqBmMEO4311","content":[{"type":"text","text":"Error: the user rejected tool \"bash\""}],"isError":true,"id":"{{message:5}}"},"error":{"name":"ApprovalError","code":"APPROVAL_REJECTED"}},"sourceEventSeqs":[14],"surfaceOp":"append"} {"type":"step/end","data":{"turn":1,"step":1}} {"type":"step/start","data":{"turn":1,"step":2}} {"type":"assistant/message","data":{"turn":1,"step":2,"message":{"role":"assistant","content":[{"type":"reasoning","text":"The bash tool returned an error saying it requires manual approval in this session. I'll report this verbatim."},{"type":"text","text":"The tool result I got back verbatim is:\n\n```\nError: bash requires manual approval in this session\n```"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:6}}"},"usage":{"inputTokens":166,"outputTokens":45,"cacheReadTokens":2816,"reasoningTokens":22},"stream":[{"type":"chunk","time":1788699375166,"chunk":{"type":"block-start","index":0,"blockType":"reasoning"}},{"type":"reasoning-chunks","time0":1788699375166,"index":0,"dt":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"texts":["The"," bash"," tool"," returned"," an"," error"," saying"," it"," requires"," manual"," approval"," in"," this"," session","."," I","'ll"," report"," this"," verb","atim","."]},{"type":"chunk","time":1788699375166,"chunk":{"type":"block-start","index":1,"blockType":"text"}},{"type":"text-chunks","time0":1788699375166,"index":1,"dt":[0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"texts":["The"," tool"," result"," I"," got"," back"," verb","atim"," is",":\n\n","```\n","Error",":"," bash"," requires"," manual"," approval"," in"," this"," session","\n","```"]},{"type":"chunk","time":1788699375167,"chunk":{"type":"block-end","index":0,"block":{"type":"reasoning","text":"The bash tool returned an error saying it requires manual approval in this session. I'll report this verbatim."}}},{"type":"chunk","time":1788699375167,"chunk":{"type":"block-end","index":1,"block":{"type":"text","text":"The tool result I got back verbatim is:\n\n```\nError: bash requires manual approval in this session\n```"}}},{"type":"chunk","time":1788699375167,"chunk":{"type":"usage","usage":{"inputTokens":166,"outputTokens":45,"cacheReadTokens":2816,"reasoningTokens":22}}},{"type":"chunk","time":1788699375167,"chunk":{"type":"finish","reason":{"kind":"stop"}}}]},"surfaceOp":"append"} From b7abd58b4a1420269b742696c5db76b2b05433c2 Mon Sep 17 00:00:00 2001 From: Turtle Date: Thu, 5 Nov 2026 17:04:54 +0800 Subject: [PATCH 260/322] fix(ui-schedule): keep task detail controls steady during pause, resume, and run Co-authored-by: winewill <324803222+winewill@users.noreply.github.com> --- packages/client/ui-schedule/README.i18n.yaml | 4 +- packages/client/ui-schedule/README.md | 2 +- packages/client/ui-schedule/README.zh.md | 2 +- .../ui-schedule/src/client/TaskDetail.tsx | 28 +++++++------ .../src/client/TaskEditorFields.tsx | 11 +++-- .../src/client/TaskManagerPage.module.css | 10 ++--- .../tests/host-task-editor.client.spec.tsx | 40 +++++++++++++++++++ 7 files changed, 73 insertions(+), 24 deletions(-) diff --git a/packages/client/ui-schedule/README.i18n.yaml b/packages/client/ui-schedule/README.i18n.yaml index f27cfcc871..1371e74c19 100644 --- a/packages/client/ui-schedule/README.i18n.yaml +++ b/packages/client/ui-schedule/README.i18n.yaml @@ -15,8 +15,8 @@ en: d152484eb41ac6b4 zh: 405b30feaf48c087 /deepseek-ai-dsh-client-ui-schedule/use-this-package: - en: 595c27f4369cf399 - zh: 40ccf96444e85ad7 + en: 68526e7df25338d4 + zh: 3bfdfa01dc9afaec /deepseek-ai-dsh-client-ui-schedule/use-this-package/time-zone-data-source: en: 4005b800e930f581 zh: ccb9318dad7f7e8f diff --git a/packages/client/ui-schedule/README.md b/packages/client/ui-schedule/README.md index 8710f34800..fbd7582bd2 100644 --- a/packages/client/ui-schedule/README.md +++ b/packages/client/ui-schedule/README.md @@ -35,7 +35,7 @@ The destination menu offers a new conversation that the first delivery creates a The repeat editor offers once, minute, hour, day, week, month, and custom rules. Date and clock controls reuse existing pickers. Guided presets produce RRULE; minute and hour intervals start from the current minute in the selected zone. The Custom choice and Customize input do not name either syntax; the input accepts a two-line RRULE or a five-field Cron expression with an explicit zone. RRULE retains the zone in `DTSTART`; Cron retains its expression and selected zone as Cron timing. Complex RRULE values remain verbatim. The shared time parser checks new or changed Custom text before enabling Save; invalid or empty input keeps the draft and explains which field to change. Invalid Custom text offers manual correction, another repeat option, or correction by the Agent. The Host performs the final validation on save. Stored After and At tasks show date and clock fields immediately; a repeated local time uses UTC when needed to retain the exact instant. Every, Daily, and Weekly tasks show the matching controls when their interval or wall-clock precision is representable. Other stored timings remain in Custom and keep their typed timing until replaced. Viewing a task or editing other fields preserves its timing and committed occurrence. -Pause and resume update lifecycle state. While a pause or resume, a catalog reload, or a deletion is in progress, the toggle keeps its look and focus and ignores activation. Unsaved changes hold pause, resume, Run now, and Delete until you save or discard them. The detail menu offers Run now and Delete. It offers no queued-message cancellation: one inbox message may contain deliveries from several tasks. While a delivery to a reused conversation is queued or running, the detail disables its fields, Save, pause and resume, Run now, and Delete, and states that the task is queued or running and is managed in its conversation, which the bottom conversation entry opens. The minimum delivery interval disables another immediate run until the interval ends, while pause and deletion remain available once execution is idle. When the interval is the only cause, the Run now row stays focusable, and its tooltip states that the minimum run interval has not passed and when Run now becomes available. An archived linked conversation of a task already bound to a Session also disables Run now, because the Host refuses that delivery. A run that the Host refuses with `schedule_execution_pending` shows a status notice instead of an error. Deletion requires confirmation, removes the task and its saved records, retains Sessions and already-delivered messages, and reports the result through the existing app-wide toast. The confirmation focuses Cancel first; when it closes, focus returns to the detail menu button. The detail keeps the task until the Host answers. An applied deletion closes the detail or its task tab; a failed deletion keeps the task open for another attempt. +Pause and resume update lifecycle state. While a pause or resume, a catalog reload, or a deletion is in progress, the toggle keeps its look and focus and ignores activation. During a pause, resume, or Run now request, the rule fields reject input without turning grey, and Close and Discard keep their look and ignore activation. Unsaved changes hold pause, resume, Run now, and Delete until you save or discard them. The detail menu offers Run now and Delete. It offers no queued-message cancellation: one inbox message may contain deliveries from several tasks. While a delivery to a reused conversation is queued or running, the detail disables its fields, Save, pause and resume, Run now, and Delete, and states that the task is queued or running and is managed in its conversation, which the bottom conversation entry opens. The minimum delivery interval disables another immediate run until the interval ends, while pause and deletion remain available once execution is idle. When the interval is the only cause, the Run now row stays focusable, and its tooltip states that the minimum run interval has not passed and when Run now becomes available. An archived linked conversation of a task already bound to a Session also disables Run now, because the Host refuses that delivery. A run that the Host refuses with `schedule_execution_pending` shows a status notice instead of an error. Deletion requires confirmation, removes the task and its saved records, retains Sessions and already-delivered messages, and reports the result through the existing app-wide toast. The confirmation focuses Cancel first; when it closes, focus returns to the detail menu button. The detail keeps the task until the Host answers. An applied deletion closes the detail or its task tab; a failed deletion keeps the task open for another attempt. The list, detail, header, and Session hover show the later of the scheduled occurrence and the Host delivery floor as the next run. Creation and editing show one short minimum-interval hint for per-run conversation targets, read from `schedule.deliveryLimits`; a failed read offers Retry. Scheduled and immediate runs share this limit. diff --git a/packages/client/ui-schedule/README.zh.md b/packages/client/ui-schedule/README.zh.md index 599b4c9d1a..51b523d0b9 100644 --- a/packages/client/ui-schedule/README.zh.md +++ b/packages/client/ui-schedule/README.zh.md @@ -35,7 +35,7 @@ kind: "package-reference" 重复编辑提供仅一次、每分钟、每小时、每天、每周、每月和自定义规则。日期和时间控件复用已有选择器。引导选项生成 RRULE;分钟和小时间隔从所选时区的当前分钟开始。自定义选项和自定义输入框不提示任何语法名称;输入框接受两行 RRULE 或带显式时区的五字段 Cron。RRULE 在 `DTSTART` 中保留时区;Cron 将表达式和所选时区保留为 Cron 时间类型。复杂 RRULE 保持原文。新的或已修改的自定义文本由共享时间解析器校验,校验通过后才能保存;无效或空输入保留草稿,并说明需要修改的字段。自定义文本无效时,提示手动修改规则、选择其他重复方式,或让智能体修改规则。宿主在保存时执行最终校验。已有 After、At 任务直接显示日期和时间控件;本地时间重复时,必要时使用 UTC 保留准确时点。Every、Daily、Weekly 任务在控件可表示其间隔或钟表时间精度时直接显示对应控件;其他时间规则仍在自定义中显示描述,并在替换前保留原类型。查看任务或编辑其他字段保留其时间规则及已提交发生时点。 -暂停和恢复修改生命周期状态。暂停或恢复请求、目录重读或删除进行期间,切换按钮保持原有外观和焦点,并忽略点击。有未保存修改时,先保存或放弃更改,才能暂停、恢复、立即执行或删除。详情菜单提供立即执行和删除,不提供取消排队消息:同一条收件箱消息可能包含多个任务的投递。投递到复用对话的投递排队或执行期间,详情禁用字段、保存、暂停与恢复、立即执行和删除,并说明此任务已排队或执行中,请在会话中管理任务;详情底部的会话入口打开该会话。最小投递间隔结束前禁用再次立即执行,执行空闲后仍可暂停或删除。仅因间隔禁用时,立即执行项仍可聚焦,其提示说明未满最小运行间隔,并给出可以立即执行的时间。已经关联会话的任务,其关联对话已归档时,同样禁用立即执行,因为宿主拒绝这次投递。宿主以 `schedule_execution_pending` 拒绝的立即执行显示为状态提示,而非错误。删除需要确认,移除任务及其已保存记录,保留会话和已经投递的消息,并通过现有应用级提示报告结果。确认对话框首先聚焦“取消”;对话框关闭后,焦点回到详情菜单按钮。宿主答复之前,详情保持显示该任务。删除生效后关闭详情或其任务页签;删除失败时保留任务,以便再次尝试。 +暂停和恢复修改生命周期状态。暂停或恢复请求、目录重读或删除进行期间,切换按钮保持原有外观和焦点,并忽略点击。暂停、恢复或立即执行请求期间,规则字段拒绝输入但不变灰,关闭和“放弃”保持原有外观并忽略点击。有未保存修改时,先保存或放弃更改,才能暂停、恢复、立即执行或删除。详情菜单提供立即执行和删除,不提供取消排队消息:同一条收件箱消息可能包含多个任务的投递。投递到复用对话的投递排队或执行期间,详情禁用字段、保存、暂停与恢复、立即执行和删除,并说明此任务已排队或执行中,请在会话中管理任务;详情底部的会话入口打开该会话。最小投递间隔结束前禁用再次立即执行,执行空闲后仍可暂停或删除。仅因间隔禁用时,立即执行项仍可聚焦,其提示说明未满最小运行间隔,并给出可以立即执行的时间。已经关联会话的任务,其关联对话已归档时,同样禁用立即执行,因为宿主拒绝这次投递。宿主以 `schedule_execution_pending` 拒绝的立即执行显示为状态提示,而非错误。删除需要确认,移除任务及其已保存记录,保留会话和已经投递的消息,并通过现有应用级提示报告结果。确认对话框首先聚焦“取消”;对话框关闭后,焦点回到详情菜单按钮。宿主答复之前,详情保持显示该任务。删除生效后关闭详情或其任务页签;删除失败时保留任务,以便再次尝试。 列表、详情、页头和会话悬浮内容的下次运行时间,取计划发生时间和宿主最早允许投递时间中较晚的一项。创建和编辑“每次新建对话”时,通过 `schedule.deliveryLimits` 读取宿主配置,以一句短提示显示最小间隔;读取失败可重试。定时与立即执行共用此限制。 diff --git a/packages/client/ui-schedule/src/client/TaskDetail.tsx b/packages/client/ui-schedule/src/client/TaskDetail.tsx index 38cb539495..8c1f612643 100644 --- a/packages/client/ui-schedule/src/client/TaskDetail.tsx +++ b/packages/client/ui-schedule/src/client/TaskDetail.tsx @@ -215,10 +215,13 @@ function TaskDetailView(props: TaskDetailProps): ReactNode { ? JSON.stringify(draft) !== JSON.stringify({ ...initial, cwd: initial.cwd || projects.defaultCwd }) : storedDirty const issue = dirty ? taskDraftIssue(draft, changes) : undefined const valid = issue === undefined - const [actionPending, setPending] = useState(false) + const [actionPending, setPending] = useState<'toggle' | 'run' | 'delete' | null>(null) const [actionFailure, setFailure] = useState(null) const saving = cached?.pending === true - const pending = actionPending || saving + const pending = actionPending !== null || saving + // A pause, resume, or run would otherwise flash its controls grey between two enabled states. + const actionHold = actionPending === 'toggle' || actionPending === 'run' + const nativeHold = pending && !actionHold const failure = !pending && dirty && base !== undefined && task !== undefined && base.updatedAt !== task.updatedAt ? 'host.conflict' : actionFailure ?? cached?.failure ?? null const [menuOpen, setMenuOpen] = useState(false) @@ -283,18 +286,18 @@ function TaskDetailView(props: TaskDetailProps): ReactNode { const setActive = async (task: ScheduleCatalogEntry): Promise => { // The toggle stays focusable while busy, so a second press is ignored here instead of by `disabled`. if (busy) return - setPending(true) + setPending('toggle') const outcome = await hostActions.edit({ id: task.id, action: 'update', patch: { active: task.status !== 'active' }, expectedUpdatedAt: task.updatedAt ?? null }) if (!mounted.current) return - setPending(false) + setPending(null) setFailure(outcome === 'saved' ? null : outcome.failed) } const run = async (id: ScheduleId): Promise => { setMenuOpen(false) - setPending(true) + setPending('run') const outcome = await hostActions.run(id) if (!mounted.current) return - setPending(false) + setPending(null) setFailure(outcome === 'queued' ? null : outcome.failed) } @@ -350,7 +353,8 @@ function TaskDetailView(props: TaskDetailProps): ReactNode { } {onClose !== undefined && } + disabled={nativeHold} aria-disabled={actionHold || undefined} + onClick={() => { if (!actionHold) onClose() }}>}
: failure === 'host.executionPending' ?

{t(failure)}

: failure !== null &&

{t(failure)}

} {draft.target === 'new' && } @@ -408,8 +412,8 @@ function TaskDetailView(props: TaskDetailProps): ReactNode { } {(tab === 'rule' || dirty) &&