@songtonyli/dsh-cli 0.1.90 → 0.1.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bin/dsh.mjs +1 -1
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js +26 -13
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +6 -3
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +51 -1
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/util/index.js +2 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-host-header/hostHeaderMiddleware.js +4 -2
- package/node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/parseArn.js +4 -2
- package/node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-browser/defaultUserAgent.js +18 -9
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/NODE_AUTH_SCHEME_PREFERENCE_OPTIONS.js +6 -3
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js +1 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsSmithyRpcV2JsonProtocol.js +51 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/util/util-arn-parser/arn.js +2 -1
- package/node_modules/@aws-sdk/core/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
- package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
- package/node_modules/@aws-sdk/middleware-eventstream/dist-cjs/index.js +4 -2
- package/node_modules/@aws-sdk/middleware-eventstream/dist-es/eventStreamHandlingMiddleware.js +2 -1
- package/node_modules/@aws-sdk/middleware-eventstream/dist-es/eventStreamHeaderMiddleware.js +2 -1
- package/node_modules/@aws-sdk/middleware-eventstream/package.json +1 -1
- package/node_modules/@aws-sdk/middleware-websocket/package.json +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/package.json +3 -3
- package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +1 -1
- package/node_modules/@aws-sdk/token-providers/package.json +3 -3
- package/node_modules/@aws-sdk/xml-builder/package.json +1 -1
- package/node_modules/@deepseek-ai/cordis/README.md +6 -2
- package/node_modules/@deepseek-ai/cordis/lib/index.js +955 -909
- package/node_modules/@deepseek-ai/cordis/src/context.ts +1 -1
- package/node_modules/@deepseek-ai/cordis/src/events.ts +81 -62
- package/node_modules/@deepseek-ai/cordis/src/fiber.ts +95 -58
- package/node_modules/@deepseek-ai/cordis/src/logger.ts +10 -5
- package/node_modules/@deepseek-ai/cordis/src/reflect.ts +37 -19
- package/node_modules/@deepseek-ai/cordis/src/utils.ts +28 -21
- package/node_modules/@deepseek-ai/cordis-plugin-include/lib/index.js +2 -2
- package/node_modules/@deepseek-ai/cordis-plugin-include/src/index.ts +2 -6
- package/node_modules/@deepseek-ai/cordis-plugin-loader/README.md +4 -0
- package/node_modules/@deepseek-ai/cordis-plugin-loader/lib/index.js +40 -39
- package/node_modules/@deepseek-ai/cordis-plugin-loader/src/config/entry.ts +13 -13
- package/node_modules/@deepseek-ai/cordis-plugin-loader/src/config/group.ts +1 -3
- package/node_modules/@deepseek-ai/cordis-plugin-loader/src/config/isolate.ts +10 -7
- package/node_modules/@deepseek-ai/cordis-plugin-loader/src/index.ts +17 -20
- package/node_modules/@deepseek-ai/dsh/package.json +0 -1
- package/node_modules/@deepseek-ai/dsh-action-cards/lib/typert.host.js +1 -1
- package/node_modules/@deepseek-ai/dsh-agent-preset/skills/cordis-composition-reference/references/packages.md +5 -3
- package/node_modules/@deepseek-ai/dsh-agent-preset/skills/cordis-plugin-development/references/host-plugin.md +13 -0
- package/node_modules/@deepseek-ai/dsh-agent-preset-registry/lib/index.js +2 -2
- package/node_modules/@deepseek-ai/dsh-agent-preset-registry/lib/typert.host.js +1 -1
- package/node_modules/@deepseek-ai/dsh-agent-preset-registry/lib/types/mount.js +2 -2
- package/node_modules/@deepseek-ai/dsh-api-gateway/lib/client.browser.js +1 -1
- package/node_modules/@deepseek-ai/dsh-api-gateway/lib/client.node.js +1 -1
- package/node_modules/@deepseek-ai/dsh-api-gateway/lib/types/client/remote-events.js +1 -1
- package/node_modules/@deepseek-ai/dsh-api-remotes/lib/client.js +7464 -2004
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/client.js +77 -92
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.host.js +47 -3
- package/node_modules/@deepseek-ai/dsh-api-terminal-controller/lib/typert.host.js +1 -1
- package/node_modules/@deepseek-ai/dsh-app-boot/lib/index.js +8 -19
- package/node_modules/@deepseek-ai/dsh-base/cordis.patch.yml +3 -0
- package/node_modules/@deepseek-ai/dsh-client-file-upload/lib/typert.host.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-modules/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-client-modules/README.md +3 -1
- package/node_modules/@deepseek-ai/dsh-client-modules/README.zh.md +3 -1
- package/node_modules/@deepseek-ai/dsh-client-modules/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-modules/lib/index.js +37 -15
- package/node_modules/@deepseek-ai/dsh-client-ui-attachment/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-attachment/README.md +3 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-attachment/README.zh.md +3 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-attachment/lib/client.js +19 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-attachment/package.json +4 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-chat/README.i18n.yaml +10 -10
- package/node_modules/@deepseek-ai/dsh-client-ui-chat/README.md +8 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-chat/README.zh.md +8 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/client.js +146 -30
- package/node_modules/@deepseek-ai/dsh-client-ui-chat/package.json +4 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-commands/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-commands/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-commands/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-commands/lib/client.js +295 -274
- package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/README.i18n.yaml +40 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/README.md +100 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/README.zh.md +100 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/lib/client.js +1445 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/lib/index.js +6 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/locale/de.json +5 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/locale/en.json +5 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/locale/es.json +5 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/locale/fr.json +5 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/locale/ja.json +5 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/locale/pt.json +5 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/locale/ru.json +5 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/locale/zh.json +5 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/package.json +61 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/README.md +4 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/README.zh.md +4 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/client.js +119 -55
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/package.json +4 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/README.md +2 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/README.zh.md +2 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/lib/client.js +19 -7
- package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/package.json +4 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/README.i18n.yaml +40 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/README.md +92 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/README.zh.md +92 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/lib/client.js +1875 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/lib/index.js +6 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/locale/de.json +5 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/locale/en.json +5 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/locale/es.json +5 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/locale/fr.json +5 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/locale/ja.json +5 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/locale/pt.json +5 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/locale/ru.json +5 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/locale/zh.json +5 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/package.json +65 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-layout/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-layout/README.md +9 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-layout/README.zh.md +9 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-layout/lib/client.js +91 -26
- package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/README.md +8 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/README.zh.md +8 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/lib/client.js +431 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/package.json +13 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/README.i18n.yaml +8 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/README.md +6 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/README.zh.md +6 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/lib/client.js +111 -48
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-market/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-market/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-market/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-market/lib/client.js +2 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-reference/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-reference/README.md +2 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-reference/README.zh.md +2 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-reference/lib/client.js +28 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-reference/package.json +4 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-schedule/README.i18n.yaml +19 -19
- package/node_modules/@deepseek-ai/dsh-client-ui-schedule/README.md +25 -39
- package/node_modules/@deepseek-ai/dsh-client-ui-schedule/README.zh.md +23 -37
- package/node_modules/@deepseek-ai/dsh-client-ui-schedule/lib/client.js +10359 -3743
- package/node_modules/@deepseek-ai/dsh-client-ui-schedule/package.json +1 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/lib/client.js +76 -58
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/README.md +5 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/README.zh.md +5 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/client.js +46 -18
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/README.i18n.yaml +8 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/README.md +7 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/README.zh.md +7 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/client.js +349 -251
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/package.json +5 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/README.i18n.yaml +20 -14
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/README.md +44 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/README.zh.md +44 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/lib/client.js +1571 -472
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/package.json +5 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/README.i18n.yaml +12 -12
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/README.md +15 -7
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/README.zh.md +15 -7
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/lib/client.js +435 -52
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/package.json +4 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-subagent/lib/client.js +8 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-theme/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-theme/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-theme/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-theme/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/README.md +5 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/README.zh.md +5 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/lib/client.js +195 -59
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/package.json +5 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/README.md +6 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/README.zh.md +6 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/lib/client.js +127 -27
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/README.i18n.yaml +15 -15
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/README.md +16 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/README.zh.md +17 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/client.js +523 -480
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/package.json +4 -2
- package/node_modules/@deepseek-ai/dsh-commands/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-commands/README.md +3 -0
- package/node_modules/@deepseek-ai/dsh-commands/README.zh.md +3 -0
- package/node_modules/@deepseek-ai/dsh-commands/lib/typert.host.js +1 -1
- package/node_modules/@deepseek-ai/dsh-commands/lib/types/builtin.js +39 -0
- package/node_modules/@deepseek-ai/dsh-commands/package.json +5 -1
- package/node_modules/@deepseek-ai/dsh-compaction-basic/README.i18n.yaml +4 -10
- package/node_modules/@deepseek-ai/dsh-compaction-basic/README.md +2 -0
- package/node_modules/@deepseek-ai/dsh-compaction-basic/README.zh.md +2 -0
- package/node_modules/@deepseek-ai/dsh-cordis-client-runner/lib/client.js +233 -56
- package/node_modules/@deepseek-ai/dsh-cordis-host-runner/lib/typert.host.js +2 -2
- package/node_modules/@deepseek-ai/dsh-deepseek-llm-api-extensions/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-deepseek-llm-api-extensions/README.md +2 -0
- package/node_modules/@deepseek-ai/dsh-deepseek-llm-api-extensions/README.zh.md +2 -0
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/README.i18n.yaml +16 -19
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/README.md +11 -22
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/README.zh.md +11 -22
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/lib/index.js +2 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-cot-translation/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/README.i18n.yaml +12 -12
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/README.md +18 -10
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/README.zh.md +20 -12
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/lib/client.js +3338 -297
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/lib/index.js +159 -52
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/lib/typert.host.js +298 -18
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/lib/typert.remote-client.js +267 -13
- package/node_modules/@deepseek-ai/dsh-experimental-forge/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-experimental-forge/README.md +5 -1
- package/node_modules/@deepseek-ai/dsh-experimental-forge/README.zh.md +5 -1
- package/node_modules/@deepseek-ai/dsh-experimental-forge/lib/index.js +48 -6
- package/node_modules/@deepseek-ai/dsh-experimental-forge-github/README.i18n.yaml +8 -8
- package/node_modules/@deepseek-ai/dsh-experimental-forge-github/README.md +9 -5
- package/node_modules/@deepseek-ai/dsh-experimental-forge-github/README.zh.md +9 -5
- package/node_modules/@deepseek-ai/dsh-experimental-forge-github/lib/index.js +301 -31
- package/node_modules/@deepseek-ai/dsh-experimental-forge-github/package.json +1 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/lib/client.js +5 -58
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/lib/index.js +5 -2
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-session-inspector/lib/client.js +77 -92
- package/node_modules/@deepseek-ai/dsh-experimental-translator/lib/index.js +2 -2
- package/node_modules/@deepseek-ai/dsh-experimental-translator/lib/types/deepseek.js +2 -2
- package/node_modules/@deepseek-ai/dsh-fs/README.i18n.yaml +12 -12
- package/node_modules/@deepseek-ai/dsh-fs/README.md +15 -7
- package/node_modules/@deepseek-ai/dsh-fs/README.zh.md +15 -7
- package/node_modules/@deepseek-ai/dsh-fs/lib/index.js +21 -2
- package/node_modules/@deepseek-ai/dsh-fs/package.json +3 -0
- package/node_modules/@deepseek-ai/dsh-fs-local/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-fs-local/README.md +4 -2
- package/node_modules/@deepseek-ai/dsh-fs-local/README.zh.md +4 -2
- package/node_modules/@deepseek-ai/dsh-fs-local/lib/index.js +156 -30
- package/node_modules/@deepseek-ai/dsh-fs-local/package.json +2 -1
- package/node_modules/@deepseek-ai/dsh-fs-observation-policy/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-fs-observation-policy/README.md +4 -2
- package/node_modules/@deepseek-ai/dsh-fs-observation-policy/README.zh.md +4 -2
- package/node_modules/@deepseek-ai/dsh-fs-observation-policy/lib/index.js +12 -4
- package/node_modules/@deepseek-ai/dsh-fs-patch/LICENSE +235 -0
- package/node_modules/@deepseek-ai/dsh-fs-patch/README.i18n.yaml +40 -0
- package/node_modules/@deepseek-ai/dsh-fs-patch/README.md +112 -0
- package/node_modules/@deepseek-ai/dsh-fs-patch/README.zh.md +112 -0
- package/node_modules/@deepseek-ai/dsh-fs-patch/lib/index.js +275 -0
- package/node_modules/@deepseek-ai/dsh-fs-patch/package.json +35 -0
- package/node_modules/@deepseek-ai/dsh-fs-sandbox/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-fs-sandbox/README.md +4 -2
- package/node_modules/@deepseek-ai/dsh-fs-sandbox/README.zh.md +4 -2
- package/node_modules/@deepseek-ai/dsh-fs-sandbox/lib/index.js +24 -1
- package/node_modules/@deepseek-ai/dsh-goal/lib/typert.host.js +1 -1
- package/node_modules/@deepseek-ai/dsh-hmr/lib/index.js +4 -3
- package/node_modules/@deepseek-ai/dsh-llm/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-llm/README.md +2 -0
- package/node_modules/@deepseek-ai/dsh-llm/README.zh.md +2 -0
- package/node_modules/@deepseek-ai/dsh-llm/lib/typert.host.js +9 -1
- package/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/index.js +4 -3
- package/node_modules/@deepseek-ai/dsh-llm-pi-ai/README.i18n.yaml +5 -2
- package/node_modules/@deepseek-ai/dsh-llm-pi-ai/README.md +7 -0
- package/node_modules/@deepseek-ai/dsh-llm-pi-ai/README.zh.md +7 -0
- package/node_modules/@deepseek-ai/dsh-llm-pi-ai/lib/index.js +27 -11
- package/node_modules/@deepseek-ai/dsh-official-bundles/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-official-bundles/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-official-bundles/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-official-bundles/lib/index.js +86 -52
- package/node_modules/@deepseek-ai/dsh-permission-presets/lib/typert.host.js +1 -1
- package/node_modules/@deepseek-ai/dsh-plugin-manager/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-plugin-manager/README.md +4 -4
- package/node_modules/@deepseek-ai/dsh-plugin-manager/README.zh.md +4 -4
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/index.js +32 -12
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/typert.host.js +31 -31
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/typert.remote-client.js +27 -27
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/github-connection.js +13 -3
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/index.js +14 -2
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/install-spec.js +1 -1
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/operations.js +2 -0
- package/node_modules/@deepseek-ai/dsh-plugin-recommendations/lib/typert.host.js +1 -1
- package/node_modules/@deepseek-ai/dsh-schedule/README.i18n.yaml +72 -39
- package/node_modules/@deepseek-ai/dsh-schedule/README.md +180 -56
- package/node_modules/@deepseek-ai/dsh-schedule/README.zh.md +185 -61
- package/node_modules/@deepseek-ai/dsh-schedule/lib/index.js +1270 -992
- package/node_modules/@deepseek-ai/dsh-schedule/lib/typert.host.js +1842 -274
- package/node_modules/@deepseek-ai/dsh-schedule/lib/typert.remote-client.js +1712 -194
- package/node_modules/@deepseek-ai/dsh-schedule/lib/types/delivery-history.js +7 -20
- package/node_modules/@deepseek-ai/dsh-schedule/lib/types/domain.js +199 -655
- package/node_modules/@deepseek-ai/dsh-schedule/lib/types/index.js +452 -204
- package/node_modules/@deepseek-ai/dsh-schedule/lib/types/runtime.js +389 -70
- package/node_modules/@deepseek-ai/dsh-schedule/lib/types/storage.js +85 -16
- package/node_modules/@deepseek-ai/dsh-schedule/lib/types/types.js +1 -1
- package/node_modules/@deepseek-ai/dsh-schedule/lib/types/update.js +72 -144
- package/node_modules/@deepseek-ai/dsh-schedule/package.json +5 -2
- package/node_modules/@deepseek-ai/dsh-sdk-app/README.i18n.yaml +12 -12
- package/node_modules/@deepseek-ai/dsh-sdk-app/README.md +7 -4
- package/node_modules/@deepseek-ai/dsh-sdk-app/README.zh.md +7 -4
- package/node_modules/@deepseek-ai/dsh-sdk-app/cordis.patch.yml +3 -0
- package/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/README.i18n.yaml +52 -4
- package/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/README.md +77 -1
- package/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/README.zh.md +77 -1
- package/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/lib/index.js +306 -2
- package/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/package.json +15 -0
- package/node_modules/@deepseek-ai/dsh-sdk-protocol/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-sdk-protocol/README.md +10 -2
- package/node_modules/@deepseek-ai/dsh-sdk-protocol/README.zh.md +10 -2
- package/node_modules/@deepseek-ai/dsh-sdk-protocol/package.json +2 -0
- package/node_modules/@deepseek-ai/dsh-session-log-deepseek/README.i18n.yaml +9 -6
- package/node_modules/@deepseek-ai/dsh-session-log-deepseek/README.md +20 -1
- package/node_modules/@deepseek-ai/dsh-session-log-deepseek/README.zh.md +20 -1
- package/node_modules/@deepseek-ai/dsh-session-log-deepseek/lib/index.js +91 -57
- package/node_modules/@deepseek-ai/dsh-session-log-deepseek/lib/types/index.js +100 -66
- package/node_modules/@deepseek-ai/dsh-session-persistence-jsonl/lib/worker.cjs +947 -917
- package/node_modules/@deepseek-ai/dsh-session-reference/lib/typert.host.js +1 -1
- package/node_modules/@deepseek-ai/dsh-session-title-llm/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-session-title-llm/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-session-title-llm/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-settings/lib/index.js +2 -2
- package/node_modules/@deepseek-ai/dsh-settings/lib/types/index.js +2 -2
- package/node_modules/@deepseek-ai/dsh-subagent/lib/typert.host.js +1 -1
- package/node_modules/@deepseek-ai/dsh-system-prompt/lib/index.js +2 -0
- package/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/api-catalog.js +260 -92
- package/node_modules/@deepseek-ai/dsh-tool-fs/README.i18n.yaml +38 -20
- package/node_modules/@deepseek-ai/dsh-tool-fs/README.md +63 -5
- package/node_modules/@deepseek-ai/dsh-tool-fs/README.zh.md +63 -5
- package/node_modules/@deepseek-ai/dsh-tool-fs/lib/index.js +784 -27
- package/node_modules/@deepseek-ai/dsh-tool-fs/package.json +4 -1
- package/node_modules/@deepseek-ai/dsh-tool-schedule/README.i18n.yaml +50 -32
- package/node_modules/@deepseek-ai/dsh-tool-schedule/README.md +47 -20
- package/node_modules/@deepseek-ai/dsh-tool-schedule/README.zh.md +47 -20
- package/node_modules/@deepseek-ai/dsh-tool-schedule/lib/index.js +477 -445
- package/node_modules/@deepseek-ai/dsh-tool-schedule/package.json +7 -2
- package/node_modules/@deepseek-ai/dsh-user-questions/lib/typert.host.js +1 -1
- package/node_modules/@deepseek-ai/dsh-util-time/README.i18n.yaml +10 -10
- package/node_modules/@deepseek-ai/dsh-util-time/README.md +11 -7
- package/node_modules/@deepseek-ai/dsh-util-time/README.zh.md +11 -7
- package/node_modules/@deepseek-ai/dsh-util-time/lib/index.js +1020 -3
- package/node_modules/@deepseek-ai/dsh-util-time/package.json +4 -2
- package/node_modules/@deepseek-ai/dsh-util-values/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-util-values/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-util-values/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-util-values/lib/index.js +77 -92
- package/node_modules/@deepseek-ai/dsh-web-app/cordis.patch.yml +5 -1
- package/node_modules/@deepseek-ai/dsh-web-app/package.json +3 -1
- package/node_modules/@deepseek-ai/dsh-web-app/presets/cordis.patch.yml +3 -0
- package/node_modules/@deepseek-ai/dsh-web-app/presets/ptc.patch.yml +3 -0
- package/node_modules/@deepseek-ai/dsh-web-app/presets/standard.patch.yml +3 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-BCbHmUSs.js +197 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-BUDGJY4R.css +1 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/index.html +2 -2
- package/node_modules/@deepseek-ai/dsh-workflow-ptc/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-workspace-changes/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-workspace-changes/README.md +3 -1
- package/node_modules/@deepseek-ai/dsh-workspace-changes/README.zh.md +4 -2
- package/node_modules/@deepseek-ai/dsh-workspace-changes/lib/index.js +5 -0
- package/node_modules/@deepseek-ai/dsh-workspace-changes/lib/types/index.js +5 -0
- package/node_modules/@deepseek-ai/dsh-workspace-changes/package.json +4 -1
- package/node_modules/@opentelemetry/semantic-conventions/dist/experimental_attributes.cjs +16917 -0
- package/node_modules/@opentelemetry/semantic-conventions/dist/experimental_attributes.mjs +15193 -0
- package/node_modules/@opentelemetry/semantic-conventions/dist/experimental_events.cjs +325 -0
- package/node_modules/@opentelemetry/semantic-conventions/dist/experimental_events.mjs +295 -0
- package/node_modules/@opentelemetry/semantic-conventions/dist/experimental_metrics.cjs +4642 -0
- package/node_modules/@opentelemetry/semantic-conventions/dist/experimental_metrics.mjs +4155 -0
- package/node_modules/@opentelemetry/semantic-conventions/dist/index-incubating.cjs +2495 -0
- package/node_modules/@opentelemetry/semantic-conventions/dist/index-incubating.mjs +7 -0
- package/node_modules/@opentelemetry/semantic-conventions/dist/index.cjs +662 -0
- package/node_modules/@opentelemetry/semantic-conventions/dist/index.mjs +6 -0
- package/node_modules/@opentelemetry/semantic-conventions/dist/internal/utils.cjs +20 -0
- package/node_modules/@opentelemetry/semantic-conventions/dist/internal/utils.mjs +20 -0
- package/node_modules/@opentelemetry/semantic-conventions/dist/resource/SemanticResourceAttributes.cjs +1326 -0
- package/node_modules/@opentelemetry/semantic-conventions/dist/resource/SemanticResourceAttributes.mjs +1188 -0
- package/node_modules/@opentelemetry/semantic-conventions/dist/stable_attributes.cjs +1947 -0
- package/node_modules/@opentelemetry/semantic-conventions/dist/stable_attributes.mjs +1756 -0
- package/node_modules/@opentelemetry/semantic-conventions/dist/stable_events.cjs +9 -0
- package/node_modules/@opentelemetry/semantic-conventions/dist/stable_events.mjs +9 -0
- package/node_modules/@opentelemetry/semantic-conventions/dist/stable_metrics.cjs +362 -0
- package/node_modules/@opentelemetry/semantic-conventions/dist/stable_metrics.mjs +312 -0
- package/node_modules/@opentelemetry/semantic-conventions/dist/trace/SemanticAttributes.cjs +2508 -0
- package/node_modules/@opentelemetry/semantic-conventions/dist/trace/SemanticAttributes.mjs +2236 -0
- package/node_modules/@opentelemetry/semantic-conventions/package.json +22 -35
- package/node_modules/@smithy/core/dist-cjs/index.js +4 -2
- package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +32 -16
- package/node_modules/@smithy/core/dist-cjs/submodules/client/index.js +26 -13
- package/node_modules/@smithy/core/dist-cjs/submodules/config/index.browser.js +8 -4
- package/node_modules/@smithy/core/dist-cjs/submodules/config/index.js +16 -8
- package/node_modules/@smithy/core/dist-cjs/submodules/config/index.native.js +8 -4
- package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.browser.js +2 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js +10 -5
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.browser.js +18 -9
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +18 -9
- package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +42 -24
- package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.browser.js +20 -10
- package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.js +24 -12
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.browser.js +13 -4
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +7 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.native.js +13 -4
- package/node_modules/@smithy/core/dist-cjs/submodules/transport/index.js +6 -3
- package/node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/DefaultIdentityProviderConfig.js +2 -1
- package/node_modules/@smithy/core/dist-es/normalizeProvider.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v1/CborShapeDeserializer.js +8 -4
- package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v1/CborShapeSerializer.js +6 -3
- package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v2/CborShapeDeserializer2.js +12 -6
- package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v2/CborShapeSerializer2.js +4 -2
- package/node_modules/@smithy/core/dist-es/submodules/cbor/parseCborBody.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/client/middleware-stack/MiddlewareStack.js +10 -5
- package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/create-aggregated-client.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/exceptions.js +4 -2
- package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/extensions/checksum.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/get-value-from-text-node.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/object-mapping.js +4 -2
- package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/serde-json.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getHomeDir.js +8 -4
- package/node_modules/@smithy/core/dist-es/submodules/config/util-config-provider/booleanSelector.js +6 -3
- package/node_modules/@smithy/core/dist-es/submodules/config/util-config-provider/numberSelector.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/getEndpointUrlConfig.js +8 -4
- package/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/resolveEndpoint.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js +6 -3
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/HeaderMarshaller.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/Int64.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/SmithyMessageDecoderStream.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde/utils.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde-universal/getUnmarshalledStream.js +4 -2
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js +8 -4
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +4 -2
- package/node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeDeserializer.js +7 -5
- package/node_modules/@smithy/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeSerializer.js +7 -5
- package/node_modules/@smithy/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.js +7 -5
- package/node_modules/@smithy/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeSerializer2.js +6 -3
- package/node_modules/@smithy/core/dist-es/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.js +3 -0
- package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/configurations.js +4 -2
- package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/parseRetryAfterHeader.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/retry-pre-sra-deprecated/StandardRetryStrategy.js +6 -3
- package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/retryMiddleware.js +6 -3
- package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/util.js +6 -3
- package/node_modules/@smithy/core/dist-es/submodules/serde/index.browser.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/index.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/index.native.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/parse-utils.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/serde/util-body-length/calculateBodyLength.browser.js +6 -3
- package/node_modules/@smithy/core/dist-es/submodules/transport/httpResponse.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/transport/normalizeProvider.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/transport/toEndpointV1.js +2 -1
- package/node_modules/@smithy/core/package.json +1 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +19 -7
- package/node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js +2 -1
- package/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +11 -6
- package/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +6 -0
- package/node_modules/@smithy/node-http-handler/package.json +2 -2
- package/node_modules/@smithy/signature-v4/dist-cjs/index.js +23 -11
- package/node_modules/@smithy/signature-v4/dist-es/HeaderFormatter.js +4 -2
- package/node_modules/@smithy/signature-v4/dist-es/SignatureV4Base.js +4 -2
- package/node_modules/@smithy/signature-v4/dist-es/getCanonicalHeaders.js +5 -1
- package/node_modules/@smithy/signature-v4/dist-es/getCanonicalQuery.js +2 -1
- package/node_modules/@smithy/signature-v4/dist-es/getPayloadHash.js +2 -1
- package/node_modules/@smithy/signature-v4/dist-es/headerUtil.js +6 -3
- package/node_modules/@smithy/signature-v4/dist-es/moveHeadersToQuery.js +2 -1
- package/node_modules/@smithy/signature-v4/dist-es/prepareRequest.js +2 -1
- package/node_modules/@smithy/signature-v4/package.json +2 -2
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/package.json +2 -2
- package/node_modules/encodeurl/README.md +14 -0
- package/node_modules/encodeurl/index.js +5 -10
- package/node_modules/encodeurl/package.json +7 -3
- package/node_modules/hast-util-to-html/lib/handle/comment.js +6 -1
- package/node_modules/hast-util-to-html/lib/handle/doctype.js +1 -1
- package/node_modules/hast-util-to-html/lib/handle/element.js +33 -9
- package/node_modules/hast-util-to-html/lib/handle/index.js +1 -1
- package/node_modules/hast-util-to-html/lib/handle/raw.js +1 -1
- package/node_modules/hast-util-to-html/lib/handle/root.js +1 -1
- package/node_modules/hast-util-to-html/lib/handle/text.js +1 -1
- package/node_modules/hast-util-to-html/lib/index.js +9 -4
- package/node_modules/hast-util-to-html/lib/omission/closing.js +7 -5
- package/node_modules/hast-util-to-html/lib/omission/omission.js +0 -1
- package/node_modules/hast-util-to-html/lib/omission/opening.js +4 -2
- package/node_modules/hast-util-to-html/lib/omission/util/siblings.js +3 -0
- package/node_modules/hast-util-to-html/package.json +5 -23
- package/node_modules/hast-util-to-html/readme.md +3 -2
- package/node_modules/jose/dist/webapi/jwks/remote.js +1 -1
- package/node_modules/jose/package.json +1 -1
- package/node_modules/rrule/LICENCE +65 -0
- package/node_modules/rrule/README.md +837 -0
- package/node_modules/rrule/dist/es5/rrule.js +3803 -0
- package/node_modules/rrule/dist/es5/rrule.min.js +2 -0
- package/node_modules/rrule/dist/esm/cache.js +95 -0
- package/node_modules/rrule/dist/esm/callbackiterresult.js +24 -0
- package/node_modules/rrule/dist/esm/datetime.js +186 -0
- package/node_modules/rrule/dist/esm/dateutil.js +161 -0
- package/node_modules/rrule/dist/esm/datewithzone.js +36 -0
- package/node_modules/rrule/dist/esm/helpers.js +118 -0
- package/node_modules/rrule/dist/esm/index.js +22 -0
- package/node_modules/rrule/dist/esm/iter/index.js +138 -0
- package/node_modules/rrule/dist/esm/iter/poslist.js +42 -0
- package/node_modules/rrule/dist/esm/iterinfo/easter.js +21 -0
- package/node_modules/rrule/dist/esm/iterinfo/index.js +188 -0
- package/node_modules/rrule/dist/esm/iterinfo/monthinfo.js +51 -0
- package/node_modules/rrule/dist/esm/iterinfo/yearinfo.js +128 -0
- package/node_modules/rrule/dist/esm/iterresult.js +88 -0
- package/node_modules/rrule/dist/esm/iterset.js +63 -0
- package/node_modules/rrule/dist/esm/masks.js +30 -0
- package/node_modules/rrule/dist/esm/nlp/i18n.js +74 -0
- package/node_modules/rrule/dist/esm/nlp/index.js +122 -0
- package/node_modules/rrule/dist/esm/nlp/parsetext.js +391 -0
- package/node_modules/rrule/dist/esm/nlp/totext.js +395 -0
- package/node_modules/rrule/dist/esm/optionstostring.js +98 -0
- package/node_modules/rrule/dist/esm/parseoptions.js +201 -0
- package/node_modules/rrule/dist/esm/parsestring.js +128 -0
- package/node_modules/rrule/dist/esm/rrule.js +232 -0
- package/node_modules/rrule/dist/esm/rruleset.js +182 -0
- package/node_modules/rrule/dist/esm/rrulestr.js +188 -0
- package/node_modules/rrule/dist/esm/types.js +14 -0
- package/node_modules/rrule/dist/esm/weekday.js +45 -0
- package/node_modules/rrule/package.json +79 -0
- package/package.json +32 -31
- package/node_modules/@deepseek-ai/dsh-computer-use/README.i18n.yaml +0 -37
- package/node_modules/@deepseek-ai/dsh-computer-use/README.md +0 -90
- package/node_modules/@deepseek-ai/dsh-computer-use/README.zh.md +0 -90
- package/node_modules/@deepseek-ai/dsh-computer-use/lib/index.js +0 -35
- package/node_modules/@deepseek-ai/dsh-computer-use/lib/types/brand.js +0 -10
- package/node_modules/@deepseek-ai/dsh-computer-use/lib/types/index.js +0 -36
- package/node_modules/@deepseek-ai/dsh-computer-use/locale/de.json +0 -6
- package/node_modules/@deepseek-ai/dsh-computer-use/locale/en.json +0 -6
- package/node_modules/@deepseek-ai/dsh-computer-use/locale/es.json +0 -6
- package/node_modules/@deepseek-ai/dsh-computer-use/locale/fr.json +0 -6
- package/node_modules/@deepseek-ai/dsh-computer-use/locale/ja.json +0 -6
- package/node_modules/@deepseek-ai/dsh-computer-use/locale/pt.json +0 -6
- package/node_modules/@deepseek-ai/dsh-computer-use/locale/ru.json +0 -6
- package/node_modules/@deepseek-ai/dsh-computer-use/locale/zh.json +0 -6
- package/node_modules/@deepseek-ai/dsh-computer-use/package.json +0 -44
- package/node_modules/@deepseek-ai/dsh-cua/README.i18n.yaml +0 -49
- package/node_modules/@deepseek-ai/dsh-cua/README.md +0 -130
- package/node_modules/@deepseek-ai/dsh-cua/README.zh.md +0 -130
- package/node_modules/@deepseek-ai/dsh-cua/lib/api.js +0 -597
- package/node_modules/@deepseek-ai/dsh-cua/lib/bridge.js +0 -611
- package/node_modules/@deepseek-ai/dsh-cua/lib/client.js +0 -1758
- package/node_modules/@deepseek-ai/dsh-cua/lib/index.js +0 -1916
- package/node_modules/@deepseek-ai/dsh-cua/lib/native-client.js +0 -285
- package/node_modules/@deepseek-ai/dsh-cua/lib/protocol.js +0 -305
- package/node_modules/@deepseek-ai/dsh-cua/lib/remote-types.js +0 -1
- package/node_modules/@deepseek-ai/dsh-cua/lib/typert.host.js +0 -416
- package/node_modules/@deepseek-ai/dsh-cua/lib/typert.remote-client.js +0 -301
- package/node_modules/@deepseek-ai/dsh-cua/locale/de.json +0 -6
- package/node_modules/@deepseek-ai/dsh-cua/locale/en.json +0 -6
- package/node_modules/@deepseek-ai/dsh-cua/locale/es.json +0 -6
- package/node_modules/@deepseek-ai/dsh-cua/locale/fr.json +0 -6
- package/node_modules/@deepseek-ai/dsh-cua/locale/ja.json +0 -6
- package/node_modules/@deepseek-ai/dsh-cua/locale/pt.json +0 -6
- package/node_modules/@deepseek-ai/dsh-cua/locale/ru.json +0 -6
- package/node_modules/@deepseek-ai/dsh-cua/locale/zh.json +0 -6
- package/node_modules/@deepseek-ai/dsh-cua/package.json +0 -151
- package/node_modules/@deepseek-ai/dsh-cua-bundle/README.i18n.yaml +0 -46
- package/node_modules/@deepseek-ai/dsh-cua-bundle/README.md +0 -94
- package/node_modules/@deepseek-ai/dsh-cua-bundle/README.zh.md +0 -94
- package/node_modules/@deepseek-ai/dsh-cua-bundle/cordis.patch.yml +0 -10
- package/node_modules/@deepseek-ai/dsh-cua-bundle/docs/DETAIL.md +0 -1
- package/node_modules/@deepseek-ai/dsh-cua-bundle/docs/DETAIL.zh.md +0 -1
- package/node_modules/@deepseek-ai/dsh-cua-bundle/docs/preview.svg +0 -33
- package/node_modules/@deepseek-ai/dsh-cua-bundle/docs/preview.zh.svg +0 -33
- package/node_modules/@deepseek-ai/dsh-cua-bundle/icon.svg +0 -35
- package/node_modules/@deepseek-ai/dsh-cua-bundle/lib/index.js +0 -1
- package/node_modules/@deepseek-ai/dsh-cua-bundle/locale/de.json +0 -7
- package/node_modules/@deepseek-ai/dsh-cua-bundle/locale/en.json +0 -7
- package/node_modules/@deepseek-ai/dsh-cua-bundle/locale/es.json +0 -7
- package/node_modules/@deepseek-ai/dsh-cua-bundle/locale/fr.json +0 -7
- package/node_modules/@deepseek-ai/dsh-cua-bundle/locale/ja.json +0 -7
- package/node_modules/@deepseek-ai/dsh-cua-bundle/locale/pt.json +0 -7
- package/node_modules/@deepseek-ai/dsh-cua-bundle/locale/ru.json +0 -7
- package/node_modules/@deepseek-ai/dsh-cua-bundle/locale/zh.json +0 -7
- package/node_modules/@deepseek-ai/dsh-cua-bundle/package.json +0 -58
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index--TtJvO-i.js +0 -197
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-Jtzf36XE.css +0 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_attributes.js +0 -14991
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_events.js +0 -298
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_metrics.js +0 -4060
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/index-incubating.js +0 -13
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/index.js +0 -16
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/internal/utils.js +0 -23
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/resource/SemanticResourceAttributes.js +0 -1250
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/resource/index.js +0 -10
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js +0 -1733
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_events.js +0 -12
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_metrics.js +0 -315
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/trace/SemanticAttributes.js +0 -2360
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/trace/index.js +0 -10
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/version.js +0 -7
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_attributes.js +0 -14991
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_events.js +0 -298
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_metrics.js +0 -4060
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/index-incubating.js +0 -13
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/index.js +0 -16
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/internal/utils.js +0 -23
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/resource/SemanticResourceAttributes.js +0 -1250
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/resource/index.js +0 -10
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.js +0 -1733
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_events.js +0 -12
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_metrics.js +0 -315
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/trace/SemanticAttributes.js +0 -2360
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/trace/index.js +0 -10
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/version.js +0 -7
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_attributes.js +0 -15049
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_events.js +0 -301
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_metrics.js +0 -4072
- package/node_modules/@opentelemetry/semantic-conventions/build/src/index-incubating.js +0 -29
- package/node_modules/@opentelemetry/semantic-conventions/build/src/index.js +0 -32
- package/node_modules/@opentelemetry/semantic-conventions/build/src/internal/utils.js +0 -27
- package/node_modules/@opentelemetry/semantic-conventions/build/src/resource/SemanticResourceAttributes.js +0 -1255
- package/node_modules/@opentelemetry/semantic-conventions/build/src/resource/index.js +0 -26
- package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.js +0 -1759
- package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_events.js +0 -15
- package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_metrics.js +0 -319
- package/node_modules/@opentelemetry/semantic-conventions/build/src/trace/SemanticAttributes.js +0 -2368
- package/node_modules/@opentelemetry/semantic-conventions/build/src/trace/index.js +0 -26
- package/node_modules/@opentelemetry/semantic-conventions/build/src/version.js +0 -10
- /package/node_modules/@smithy/core/dist-es/submodules/{protocols → serde}/writeKey.js +0 -0
|
@@ -5,6 +5,9 @@ import { readLangHintForPath as langFromPath } from "@deepseek-ai/dsh-util-code-
|
|
|
5
5
|
import { basename, extname, isAbsolute, relative, resolve } from "node:path";
|
|
6
6
|
import { ESCALATION_TARGETS, approveEscalation, escalationHintMarker, isHiddenIn, isReadableIn, nameGlobMatcher, sandboxDenialMarker, sandboxPermissionsDescription, validateEscalationArgs } from "@deepseek-ai/dsh-sandbox";
|
|
7
7
|
import { structuredPatch } from "diff";
|
|
8
|
+
import { PatchParseError, applyHunks, parsePatch } from "@deepseek-ai/dsh-fs-patch";
|
|
9
|
+
import { assertNever } from "@deepseek-ai/dsh-util-values";
|
|
10
|
+
import { HarnessError } from "@deepseek-ai/dsh-llm";
|
|
8
11
|
import { AttachmentError, AttachmentId } from "@deepseek-ai/dsh-attachment";
|
|
9
12
|
//#region lib/types/read-render.js
|
|
10
13
|
/**
|
|
@@ -584,6 +587,14 @@ function diffsFromMeta(meta) {
|
|
|
584
587
|
return diffs;
|
|
585
588
|
}
|
|
586
589
|
/**
|
|
590
|
+
* Narrow the patch tool's optional stopped flag from persisted metadata.
|
|
591
|
+
* @param meta - opaque live or replayed result metadata.
|
|
592
|
+
* @returns true only for an explicit stopped flag.
|
|
593
|
+
*/
|
|
594
|
+
function stoppedFromMeta(meta) {
|
|
595
|
+
return typeof meta === "object" && meta !== null && !Array.isArray(meta) && meta.stopped === true;
|
|
596
|
+
}
|
|
597
|
+
/**
|
|
587
598
|
* Read the operation's file path even when the applied diff is empty.
|
|
588
599
|
* @param meta - opaque persisted result metadata.
|
|
589
600
|
* @returns the recorded path, or undefined for old or malformed metadata.
|
|
@@ -601,17 +612,6 @@ function pathFromMeta(meta) {
|
|
|
601
612
|
* stable message shown to the model.
|
|
602
613
|
* @module @deepseek-ai/dsh-tool-fs/src/error
|
|
603
614
|
*/
|
|
604
|
-
/**
|
|
605
|
-
* Render the stable model-facing diagnostic for a guarded-mutation failure.
|
|
606
|
-
* `FS_STALE_VERSION` keeps the provider's reason and appends its re-read
|
|
607
|
-
* remedy. `FS_NOT_OBSERVED` replaces operation-specific policy/provider text
|
|
608
|
-
* with one path-aware reason and read remedy. The original error remains the
|
|
609
|
-
* cause, and both diagnostics preserve its code for machine routing. Anything
|
|
610
|
-
* else passes through untouched.
|
|
611
|
-
* @param error - the caught value from a write/edit execution.
|
|
612
|
-
* @param displayPath - the resolved target path shown to the model.
|
|
613
|
-
* @returns a remediated `FsError` for the two guarded-mutation codes, else the original value.
|
|
614
|
-
*/
|
|
615
615
|
function remediateFsError(error, displayPath) {
|
|
616
616
|
if (!(error instanceof FsError)) return error;
|
|
617
617
|
if (error.code === "FS_NOT_OBSERVED") return new FsError(`cannot modify "${displayPath}": file has not been read — read the file, then retry`, error.code, { cause: error });
|
|
@@ -778,6 +778,775 @@ function applyWriteTool(ctx, sandbox) {
|
|
|
778
778
|
}));
|
|
779
779
|
}
|
|
780
780
|
//#endregion
|
|
781
|
+
//#region lib/types/patch/plan.js
|
|
782
|
+
/**
|
|
783
|
+
* Resolve every operation without dropping repeated aliases or splitting moves.
|
|
784
|
+
* @param ctx - filesystem service owner.
|
|
785
|
+
* @param sandbox - filesystem diagnostic mapper.
|
|
786
|
+
* @param exec - session cwd and execution signal.
|
|
787
|
+
* @param request - raw patch and resolved per-call policy.
|
|
788
|
+
* @returns resolved operations sharing one target per canonical key, plus resolution refusals.
|
|
789
|
+
*/
|
|
790
|
+
async function planPatch(ctx, sandbox, exec, request) {
|
|
791
|
+
const parsed = parsePatch(request.patch);
|
|
792
|
+
const targets = /* @__PURE__ */ new Map();
|
|
793
|
+
const resolve = async (path) => {
|
|
794
|
+
const target = await ctx.fs.resolve(path, await sessionResolveOptions(ctx, exec));
|
|
795
|
+
const prior = targets.get(target.targetKey);
|
|
796
|
+
if (prior) return prior;
|
|
797
|
+
targets.set(target.targetKey, target);
|
|
798
|
+
return target;
|
|
799
|
+
};
|
|
800
|
+
const result = {
|
|
801
|
+
operations: [],
|
|
802
|
+
refusals: []
|
|
803
|
+
};
|
|
804
|
+
for (const [index, operation] of parsed.entries()) {
|
|
805
|
+
const moveTo = operation.kind === "update" ? operation.moveTo : void 0;
|
|
806
|
+
const record = {
|
|
807
|
+
index,
|
|
808
|
+
kind: moveTo === void 0 ? operation.kind : "move",
|
|
809
|
+
path: operation.path,
|
|
810
|
+
patchLine: operation.lineNumber,
|
|
811
|
+
...moveTo === void 0 ? {} : { destination: moveTo }
|
|
812
|
+
};
|
|
813
|
+
let failurePath = operation.path;
|
|
814
|
+
try {
|
|
815
|
+
const target = await resolve(operation.path);
|
|
816
|
+
record.path = target.displayPath;
|
|
817
|
+
const base = {
|
|
818
|
+
target,
|
|
819
|
+
rawPath: operation.path,
|
|
820
|
+
record
|
|
821
|
+
};
|
|
822
|
+
switch (operation.kind) {
|
|
823
|
+
case "add":
|
|
824
|
+
result.operations.push({
|
|
825
|
+
...base,
|
|
826
|
+
kind: "add",
|
|
827
|
+
content: operation.content
|
|
828
|
+
});
|
|
829
|
+
break;
|
|
830
|
+
case "delete":
|
|
831
|
+
result.operations.push({
|
|
832
|
+
...base,
|
|
833
|
+
kind: "delete"
|
|
834
|
+
});
|
|
835
|
+
break;
|
|
836
|
+
case "update":
|
|
837
|
+
if (operation.moveTo === void 0) result.operations.push({
|
|
838
|
+
...base,
|
|
839
|
+
kind: "update",
|
|
840
|
+
hunks: operation.hunks
|
|
841
|
+
});
|
|
842
|
+
else {
|
|
843
|
+
failurePath = operation.moveTo;
|
|
844
|
+
const destination = await resolve(operation.moveTo);
|
|
845
|
+
record.destination = destination.displayPath;
|
|
846
|
+
result.operations.push({
|
|
847
|
+
...base,
|
|
848
|
+
kind: "move",
|
|
849
|
+
destination,
|
|
850
|
+
hunks: operation.hunks
|
|
851
|
+
});
|
|
852
|
+
}
|
|
853
|
+
break;
|
|
854
|
+
/* v8 ignore next -- Closed parsed-operation union; assertNever checks exhaustiveness at compile time. */
|
|
855
|
+
default: assertNever(operation);
|
|
856
|
+
}
|
|
857
|
+
} catch (error) {
|
|
858
|
+
if (!(error instanceof FsError)) throw error;
|
|
859
|
+
result.refusals.push({
|
|
860
|
+
operation: record,
|
|
861
|
+
failure: patchFailure(sandbox, request.sandboxPolicy, error, failurePath)
|
|
862
|
+
});
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
return result;
|
|
866
|
+
}
|
|
867
|
+
/**
|
|
868
|
+
* Obtain a source guard without recording an observation.
|
|
869
|
+
* @param ctx - intent dispatcher.
|
|
870
|
+
* @param exec - opaque observation actor.
|
|
871
|
+
* @param target - resolved source.
|
|
872
|
+
* @param kind - deletion or edit-family source policy.
|
|
873
|
+
* @returns the observed version, or undefined for a bare provider.
|
|
874
|
+
*/
|
|
875
|
+
function sourceIntent(ctx, exec, target, kind) {
|
|
876
|
+
return kind === "delete" ? ctx.waterfall("fs/delete-intent", target, exec, () => void 0) : ctx.waterfall("fs/edit-intent", target, exec, () => void 0);
|
|
877
|
+
}
|
|
878
|
+
/**
|
|
879
|
+
* Obtain a write guard without recording an observation.
|
|
880
|
+
* @param ctx - intent dispatcher.
|
|
881
|
+
* @param exec - opaque observation actor.
|
|
882
|
+
* @param target - resolved write destination.
|
|
883
|
+
* @returns the observed write intent, or undefined for a bare provider.
|
|
884
|
+
*/
|
|
885
|
+
function destinationIntent(ctx, exec, target) {
|
|
886
|
+
return ctx.waterfall("fs/write-intent", target, exec, () => void 0);
|
|
887
|
+
}
|
|
888
|
+
/**
|
|
889
|
+
* Preserve filesystem codes while applying the existing model-facing error policy.
|
|
890
|
+
* @param sandbox - shared denial mapper.
|
|
891
|
+
* @param policy - policy supplied by the request.
|
|
892
|
+
* @param error - expected filesystem failure.
|
|
893
|
+
* @param path - display path whose operation failed.
|
|
894
|
+
* @returns the remediated code and message; unexpected mapper defects reject.
|
|
895
|
+
*/
|
|
896
|
+
function patchFailure(sandbox, policy, error, path) {
|
|
897
|
+
const mapped = remediateFsError(sandbox.mapError(error, policy), path);
|
|
898
|
+
return {
|
|
899
|
+
code: mapped.code,
|
|
900
|
+
message: mapped.message
|
|
901
|
+
};
|
|
902
|
+
}
|
|
903
|
+
/**
|
|
904
|
+
* List all targets the operation can mutate, with destination first for a move.
|
|
905
|
+
* @param operation - resolved operation.
|
|
906
|
+
* @returns targets whose versions the uncertainty comparison records.
|
|
907
|
+
*/
|
|
908
|
+
function mutationTargets(operation) {
|
|
909
|
+
return operation.kind === "move" ? [operation.destination, operation.target] : [operation.target];
|
|
910
|
+
}
|
|
911
|
+
//#endregion
|
|
912
|
+
//#region lib/types/patch/execute.js
|
|
913
|
+
async function unchanged(ctx, before) {
|
|
914
|
+
try {
|
|
915
|
+
for (const entry of before) if ((await ctx.fs.stat(entry.target))?.version !== entry.info?.version) return false;
|
|
916
|
+
return true;
|
|
917
|
+
} catch (error) {
|
|
918
|
+
if (!(error instanceof FsError)) throw error;
|
|
919
|
+
return false;
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
/**
|
|
923
|
+
* Commit a fully admitted plan; the first failure stops later operations without rollback.
|
|
924
|
+
* @param ctx - provider and observation dispatcher.
|
|
925
|
+
* @param sandbox - existing model-facing denial mapper.
|
|
926
|
+
* @param exec - session actor and cancellation signal.
|
|
927
|
+
* @param policy - request's resolved confinement policy.
|
|
928
|
+
* @param operations - operations that all passed preflight.
|
|
929
|
+
* @returns known changes, failed or unknown effects, and skipped successors in patch order.
|
|
930
|
+
*/
|
|
931
|
+
async function commitPatch(ctx, sandbox, exec, policy, operations) {
|
|
932
|
+
const outcomes = operations.map((operation) => ({
|
|
933
|
+
status: "skipped",
|
|
934
|
+
operation: operation.record
|
|
935
|
+
}));
|
|
936
|
+
let cancelled = false;
|
|
937
|
+
for (const [index, operation] of operations.entries()) {
|
|
938
|
+
if (exec.signal.aborted) {
|
|
939
|
+
cancelled = true;
|
|
940
|
+
break;
|
|
941
|
+
}
|
|
942
|
+
let started = false;
|
|
943
|
+
let before = [];
|
|
944
|
+
let failurePath = operation.target.displayPath;
|
|
945
|
+
const target = operation.target;
|
|
946
|
+
const record = operation.record;
|
|
947
|
+
let outcome;
|
|
948
|
+
try {
|
|
949
|
+
before = await Promise.all(mutationTargets(operation).map(async (target) => ({
|
|
950
|
+
target,
|
|
951
|
+
info: await ctx.fs.stat(target, exec.signal)
|
|
952
|
+
})));
|
|
953
|
+
switch (operation.kind) {
|
|
954
|
+
case "add": {
|
|
955
|
+
const intent = await destinationIntent(ctx, exec, target);
|
|
956
|
+
started = true;
|
|
957
|
+
const result = await ctx.fs.writeText(target, operation.content, intent, exec.signal, policy);
|
|
958
|
+
ctx.emit("fs/observed", target, {
|
|
959
|
+
kind: "present",
|
|
960
|
+
version: result.version
|
|
961
|
+
}, exec);
|
|
962
|
+
outcome = {
|
|
963
|
+
status: "completed",
|
|
964
|
+
operation: record,
|
|
965
|
+
changes: [{
|
|
966
|
+
path: ctx.fs.processPath(target),
|
|
967
|
+
before: result.before,
|
|
968
|
+
after: result.after
|
|
969
|
+
}]
|
|
970
|
+
};
|
|
971
|
+
break;
|
|
972
|
+
}
|
|
973
|
+
case "update": {
|
|
974
|
+
const intent = await sourceIntent(ctx, exec, target, "edit");
|
|
975
|
+
started = true;
|
|
976
|
+
const result = await ctx.fs.patchText(target, operation.hunks, intent, exec.signal, policy);
|
|
977
|
+
ctx.emit("fs/observed", target, {
|
|
978
|
+
kind: "present",
|
|
979
|
+
version: result.version
|
|
980
|
+
}, exec);
|
|
981
|
+
outcome = {
|
|
982
|
+
status: "completed",
|
|
983
|
+
operation: record,
|
|
984
|
+
changes: [{
|
|
985
|
+
path: ctx.fs.processPath(target),
|
|
986
|
+
before: result.before,
|
|
987
|
+
after: result.after
|
|
988
|
+
}]
|
|
989
|
+
};
|
|
990
|
+
break;
|
|
991
|
+
}
|
|
992
|
+
case "delete": {
|
|
993
|
+
const intent = await sourceIntent(ctx, exec, target, "delete");
|
|
994
|
+
started = true;
|
|
995
|
+
const result = await ctx.fs.deleteFile(target, intent, exec.signal, policy);
|
|
996
|
+
ctx.emit("fs/observed", target, { kind: "absent" }, exec);
|
|
997
|
+
outcome = {
|
|
998
|
+
status: "completed",
|
|
999
|
+
operation: record,
|
|
1000
|
+
changes: [{
|
|
1001
|
+
path: ctx.fs.processPath(target),
|
|
1002
|
+
before: result.before,
|
|
1003
|
+
after: null
|
|
1004
|
+
}]
|
|
1005
|
+
};
|
|
1006
|
+
break;
|
|
1007
|
+
}
|
|
1008
|
+
case "move": {
|
|
1009
|
+
const expectedSource = await sourceIntent(ctx, exec, target, "edit");
|
|
1010
|
+
failurePath = operation.destination.displayPath;
|
|
1011
|
+
const expectedDestination = await destinationIntent(ctx, exec, operation.destination);
|
|
1012
|
+
started = true;
|
|
1013
|
+
const result = await ctx.fs.moveFile(target, operation.destination, {
|
|
1014
|
+
hunks: operation.hunks,
|
|
1015
|
+
...expectedSource === void 0 ? {} : { expectedSource },
|
|
1016
|
+
...expectedDestination === void 0 ? {} : { expectedDestination }
|
|
1017
|
+
}, exec.signal, policy);
|
|
1018
|
+
const changes = [{
|
|
1019
|
+
path: ctx.fs.processPath(operation.destination),
|
|
1020
|
+
before: result.destination.before,
|
|
1021
|
+
after: result.destination.after
|
|
1022
|
+
}];
|
|
1023
|
+
ctx.emit("fs/observed", operation.destination, {
|
|
1024
|
+
kind: "present",
|
|
1025
|
+
version: result.destination.version
|
|
1026
|
+
}, exec);
|
|
1027
|
+
if (result.sourceDeleted) {
|
|
1028
|
+
ctx.emit("fs/observed", target, { kind: "absent" }, exec);
|
|
1029
|
+
outcome = {
|
|
1030
|
+
status: "completed",
|
|
1031
|
+
operation: record,
|
|
1032
|
+
changes: [...changes, {
|
|
1033
|
+
path: ctx.fs.processPath(target),
|
|
1034
|
+
before: result.sourceBefore,
|
|
1035
|
+
after: null
|
|
1036
|
+
}]
|
|
1037
|
+
};
|
|
1038
|
+
} else outcome = {
|
|
1039
|
+
status: "failed",
|
|
1040
|
+
operation: record,
|
|
1041
|
+
failure: patchFailure(sandbox, policy, new FsError(result.sourceFailure.message, result.sourceFailure.code), target.displayPath),
|
|
1042
|
+
changes
|
|
1043
|
+
};
|
|
1044
|
+
break;
|
|
1045
|
+
}
|
|
1046
|
+
/* v8 ignore next -- Closed parsed-operation union; assertNever checks exhaustiveness at compile time. */
|
|
1047
|
+
default: assertNever(operation);
|
|
1048
|
+
}
|
|
1049
|
+
} catch (error) {
|
|
1050
|
+
if (!(error instanceof FsError)) throw error;
|
|
1051
|
+
const failure = patchFailure(sandbox, policy, error, failurePath);
|
|
1052
|
+
outcome = started && (error.code === "FS_ABORTED" || error.code === "FS_IO_ERROR" && !await unchanged(ctx, before)) ? {
|
|
1053
|
+
status: "unknown",
|
|
1054
|
+
operation: record,
|
|
1055
|
+
failure: {
|
|
1056
|
+
...failure,
|
|
1057
|
+
message: `${failure.message} — re-read the affected files before retrying`
|
|
1058
|
+
}
|
|
1059
|
+
} : {
|
|
1060
|
+
status: "failed",
|
|
1061
|
+
operation: record,
|
|
1062
|
+
failure,
|
|
1063
|
+
changes: []
|
|
1064
|
+
};
|
|
1065
|
+
}
|
|
1066
|
+
outcomes[index] = outcome;
|
|
1067
|
+
if (outcome.status !== "completed") {
|
|
1068
|
+
cancelled = exec.signal.aborted;
|
|
1069
|
+
break;
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
return {
|
|
1073
|
+
phase: "commit",
|
|
1074
|
+
outcomes,
|
|
1075
|
+
affectedPaths: [...new Set(outcomes.flatMap((outcome) => "changes" in outcome ? outcome.changes.map((change) => change.path) : []))],
|
|
1076
|
+
cancelled
|
|
1077
|
+
};
|
|
1078
|
+
}
|
|
1079
|
+
//#endregion
|
|
1080
|
+
//#region lib/types/patch/preflight.js
|
|
1081
|
+
var Preflight = class {
|
|
1082
|
+
ctx;
|
|
1083
|
+
sandbox;
|
|
1084
|
+
exec;
|
|
1085
|
+
policy;
|
|
1086
|
+
failurePath = "";
|
|
1087
|
+
states = /* @__PURE__ */ new Map();
|
|
1088
|
+
constructor(ctx, sandbox, exec, policy) {
|
|
1089
|
+
this.ctx = ctx;
|
|
1090
|
+
this.sandbox = sandbox;
|
|
1091
|
+
this.exec = exec;
|
|
1092
|
+
this.policy = policy;
|
|
1093
|
+
}
|
|
1094
|
+
async state(target) {
|
|
1095
|
+
const known = this.states.get(target.targetKey);
|
|
1096
|
+
if (known) return known;
|
|
1097
|
+
const info = await this.ctx.fs.stat(target, this.exec.signal);
|
|
1098
|
+
const state = {
|
|
1099
|
+
exists: info !== void 0,
|
|
1100
|
+
info,
|
|
1101
|
+
touched: false
|
|
1102
|
+
};
|
|
1103
|
+
this.states.set(target.targetKey, state);
|
|
1104
|
+
return state;
|
|
1105
|
+
}
|
|
1106
|
+
regular(state, target) {
|
|
1107
|
+
if (state.info !== void 0 && state.info.type !== "file") throw new FsError(`cannot modify "${target.displayPath}": not a regular file`, "FS_NOT_REGULAR_FILE");
|
|
1108
|
+
}
|
|
1109
|
+
async source(state, target, kind) {
|
|
1110
|
+
const intent = state.touched ? void 0 : await sourceIntent(this.ctx, this.exec, target, kind === "delete" ? "delete" : "edit");
|
|
1111
|
+
if (!state.exists) throw new FsError(`cannot ${kind} "${target.displayPath}": not found`, "FS_NOT_FOUND");
|
|
1112
|
+
this.regular(state, target);
|
|
1113
|
+
if (intent !== void 0 && intent.version !== state.info?.version) throw new FsError(`cannot ${kind} "${target.displayPath}": file changed since it was read`, "FS_STALE_VERSION");
|
|
1114
|
+
}
|
|
1115
|
+
async destination(state, target) {
|
|
1116
|
+
const intent = state.touched ? void 0 : await destinationIntent(this.ctx, this.exec, target);
|
|
1117
|
+
this.regular(state, target);
|
|
1118
|
+
if (intent?.kind === "createIfAbsent" && state.exists) throw new FsError(`cannot overwrite existing "${target.displayPath}" without reading it first`, "FS_NOT_OBSERVED");
|
|
1119
|
+
if (intent?.kind === "replaceIfVersion" && (!state.exists || state.info?.version !== intent.version)) throw new FsError(`cannot write "${target.displayPath}": file changed since it was read`, "FS_STALE_VERSION");
|
|
1120
|
+
}
|
|
1121
|
+
async content(state, target) {
|
|
1122
|
+
if (state.content === void 0) {
|
|
1123
|
+
const text = await this.ctx.fs.readText(target, this.exec.signal);
|
|
1124
|
+
if (text.includes("\0")) throw new FsError(`cannot patch "${target.displayPath}": binary file`, "FS_NOT_TEXT");
|
|
1125
|
+
state.content = text.replace(/\r\n/g, "\n");
|
|
1126
|
+
}
|
|
1127
|
+
return state.content;
|
|
1128
|
+
}
|
|
1129
|
+
publish(target, content) {
|
|
1130
|
+
this.states.set(target.targetKey, {
|
|
1131
|
+
exists: content !== void 0,
|
|
1132
|
+
info: void 0,
|
|
1133
|
+
touched: true,
|
|
1134
|
+
...content === void 0 ? {} : { content }
|
|
1135
|
+
});
|
|
1136
|
+
}
|
|
1137
|
+
/** Simulate one operation; a filesystem refusal becomes the operation's failure. */
|
|
1138
|
+
async check(operation) {
|
|
1139
|
+
this.failurePath = operation.target.displayPath;
|
|
1140
|
+
try {
|
|
1141
|
+
return await this.simulate(operation);
|
|
1142
|
+
} catch (error) {
|
|
1143
|
+
if (!(error instanceof FsError)) throw error;
|
|
1144
|
+
return patchFailure(this.sandbox, this.policy, error, this.failurePath);
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
async simulate(operation) {
|
|
1148
|
+
if (operation.kind === "move" && operation.target.targetKey === operation.destination.targetKey) throw new FsError(`cannot move "${operation.target.displayPath}" to itself`, "FS_SAME_TARGET");
|
|
1149
|
+
if (operation.kind === "delete" || operation.kind === "move") {
|
|
1150
|
+
if ((await this.ctx.fs.lstat(operation.rawPath, await sessionResolveOptions(this.ctx, this.exec)))?.type === "symlink") return {
|
|
1151
|
+
code: "PATCH_SYMLINK_SOURCE",
|
|
1152
|
+
message: `cannot ${operation.kind} "${operation.target.displayPath}": path is a symbolic link — operate on its target path instead`
|
|
1153
|
+
};
|
|
1154
|
+
}
|
|
1155
|
+
const state = await this.state(operation.target);
|
|
1156
|
+
switch (operation.kind) {
|
|
1157
|
+
case "add":
|
|
1158
|
+
await this.destination(state, operation.target);
|
|
1159
|
+
this.publish(operation.target, operation.content);
|
|
1160
|
+
return;
|
|
1161
|
+
case "delete":
|
|
1162
|
+
await this.source(state, operation.target, "delete");
|
|
1163
|
+
this.publish(operation.target);
|
|
1164
|
+
return;
|
|
1165
|
+
case "update":
|
|
1166
|
+
case "move": {
|
|
1167
|
+
await this.source(state, operation.target, operation.kind === "move" ? "move" : "edit");
|
|
1168
|
+
if (operation.kind === "move") {
|
|
1169
|
+
this.failurePath = operation.destination.displayPath;
|
|
1170
|
+
await this.destination(await this.state(operation.destination), operation.destination);
|
|
1171
|
+
this.failurePath = operation.target.displayPath;
|
|
1172
|
+
}
|
|
1173
|
+
const result = applyHunks(await this.content(state, operation.target), operation.hunks);
|
|
1174
|
+
if (!result.ok) {
|
|
1175
|
+
const first = result.failure.pattern.slice(0, 1).join("");
|
|
1176
|
+
const characters = Array.from(first);
|
|
1177
|
+
const preview = characters.length > 80 ? `${characters.slice(0, 80).join("")}…` : first;
|
|
1178
|
+
return {
|
|
1179
|
+
code: "FS_PATCH_MISMATCH",
|
|
1180
|
+
hunkLine: result.failure.hunkLineNumber,
|
|
1181
|
+
message: `cannot patch "${operation.target.displayPath}": hunk at patch line ${result.failure.hunkLineNumber} (${result.failure.stage}) does not match — ${preview}`
|
|
1182
|
+
};
|
|
1183
|
+
}
|
|
1184
|
+
if (operation.kind === "move") {
|
|
1185
|
+
this.publish(operation.destination, result.after);
|
|
1186
|
+
this.publish(operation.target);
|
|
1187
|
+
} else this.publish(operation.target, result.after);
|
|
1188
|
+
return;
|
|
1189
|
+
}
|
|
1190
|
+
/* v8 ignore next -- Closed parsed-operation union; assertNever checks exhaustiveness at compile time. */
|
|
1191
|
+
default: return assertNever(operation);
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
};
|
|
1195
|
+
/**
|
|
1196
|
+
* Collect every independent preflight refusal while simulating only admitted operations.
|
|
1197
|
+
* Sandbox containment is the provider's decision at commit, as for write and edit.
|
|
1198
|
+
* @param ctx - filesystem service owner; reads never emit observations.
|
|
1199
|
+
* @param sandbox - model-facing denial mapper.
|
|
1200
|
+
* @param exec - observation actor and cancellation signal.
|
|
1201
|
+
* @param policy - resolved confinement policy used to label refusals.
|
|
1202
|
+
* @param operations - complete resolved operation plan.
|
|
1203
|
+
* @returns refused operations in patch order; any refusal forbids the commit phase.
|
|
1204
|
+
*/
|
|
1205
|
+
async function preflightPatch(ctx, sandbox, exec, policy, operations) {
|
|
1206
|
+
const preflight = new Preflight(ctx, sandbox, exec, policy);
|
|
1207
|
+
const refusals = [];
|
|
1208
|
+
for (const operation of operations) {
|
|
1209
|
+
const failure = await preflight.check(operation);
|
|
1210
|
+
if (failure !== void 0) refusals.push({
|
|
1211
|
+
operation: operation.record,
|
|
1212
|
+
failure
|
|
1213
|
+
});
|
|
1214
|
+
}
|
|
1215
|
+
return refusals;
|
|
1216
|
+
}
|
|
1217
|
+
//#endregion
|
|
1218
|
+
//#region lib/types/patch/index.js
|
|
1219
|
+
/**
|
|
1220
|
+
* Preflight a whole patch before sequential guarded mutations; business failures become records.
|
|
1221
|
+
* @param ctx - mounted filesystem and observation-policy events.
|
|
1222
|
+
* @param sandbox - denial mapper shared with existing filesystem tools.
|
|
1223
|
+
* @param exec - session cwd, observation actor, and cancellation signal.
|
|
1224
|
+
* @param request - raw patch and policy already resolved by the caller.
|
|
1225
|
+
* @returns the syntax failure, the preflight refusals, or ordered commit outcomes.
|
|
1226
|
+
* @throws unexpected programming defects without starting further operations.
|
|
1227
|
+
*/
|
|
1228
|
+
async function executePatch(ctx, sandbox, exec, request) {
|
|
1229
|
+
let plan;
|
|
1230
|
+
try {
|
|
1231
|
+
plan = await planPatch(ctx, sandbox, exec, request);
|
|
1232
|
+
} catch (error) {
|
|
1233
|
+
if (!(error instanceof PatchParseError)) throw error;
|
|
1234
|
+
return {
|
|
1235
|
+
phase: "syntax",
|
|
1236
|
+
failure: {
|
|
1237
|
+
code: "PATCH_SYNTAX",
|
|
1238
|
+
message: error.message
|
|
1239
|
+
}
|
|
1240
|
+
};
|
|
1241
|
+
}
|
|
1242
|
+
const [first, ...rest] = [...plan.refusals, ...await preflightPatch(ctx, sandbox, exec, request.sandboxPolicy, plan.operations)].sort((left, right) => left.operation.index - right.operation.index);
|
|
1243
|
+
if (first !== void 0) return {
|
|
1244
|
+
phase: "preflight",
|
|
1245
|
+
refusals: [first, ...rest]
|
|
1246
|
+
};
|
|
1247
|
+
return commitPatch(ctx, sandbox, exec, request.sandboxPolicy, plan.operations);
|
|
1248
|
+
}
|
|
1249
|
+
//#endregion
|
|
1250
|
+
//#region lib/types/apply-patch-output.js
|
|
1251
|
+
/** Canonical patch results, typed refusals, and compact model output. */
|
|
1252
|
+
/** Strict canonical output; full file texts feed rendering and are excluded from presentation metadata. */
|
|
1253
|
+
const patchOutputSchema = {
|
|
1254
|
+
type: "object",
|
|
1255
|
+
additionalProperties: false,
|
|
1256
|
+
properties: {
|
|
1257
|
+
phase: {
|
|
1258
|
+
type: "string",
|
|
1259
|
+
const: "commit",
|
|
1260
|
+
required: true
|
|
1261
|
+
},
|
|
1262
|
+
cancelled: {
|
|
1263
|
+
type: "boolean",
|
|
1264
|
+
required: true
|
|
1265
|
+
},
|
|
1266
|
+
operations: {
|
|
1267
|
+
type: "array",
|
|
1268
|
+
required: true,
|
|
1269
|
+
items: {
|
|
1270
|
+
type: "object",
|
|
1271
|
+
additionalProperties: false,
|
|
1272
|
+
properties: {
|
|
1273
|
+
index: {
|
|
1274
|
+
type: "integer",
|
|
1275
|
+
required: true
|
|
1276
|
+
},
|
|
1277
|
+
kind: {
|
|
1278
|
+
type: "string",
|
|
1279
|
+
enum: [
|
|
1280
|
+
"add",
|
|
1281
|
+
"update",
|
|
1282
|
+
"delete",
|
|
1283
|
+
"move"
|
|
1284
|
+
],
|
|
1285
|
+
required: true
|
|
1286
|
+
},
|
|
1287
|
+
path: {
|
|
1288
|
+
type: "string",
|
|
1289
|
+
required: true
|
|
1290
|
+
},
|
|
1291
|
+
destination: { type: "string" },
|
|
1292
|
+
patchLine: {
|
|
1293
|
+
type: "integer",
|
|
1294
|
+
required: true
|
|
1295
|
+
},
|
|
1296
|
+
status: {
|
|
1297
|
+
type: "string",
|
|
1298
|
+
enum: [
|
|
1299
|
+
"completed",
|
|
1300
|
+
"failed",
|
|
1301
|
+
"unknown",
|
|
1302
|
+
"skipped"
|
|
1303
|
+
],
|
|
1304
|
+
required: true
|
|
1305
|
+
},
|
|
1306
|
+
code: { type: "string" },
|
|
1307
|
+
message: { type: "string" },
|
|
1308
|
+
hunkLine: { type: "integer" },
|
|
1309
|
+
changes: {
|
|
1310
|
+
type: "array",
|
|
1311
|
+
items: {
|
|
1312
|
+
type: "object",
|
|
1313
|
+
additionalProperties: false,
|
|
1314
|
+
properties: {
|
|
1315
|
+
path: {
|
|
1316
|
+
type: "string",
|
|
1317
|
+
required: true
|
|
1318
|
+
},
|
|
1319
|
+
before: {
|
|
1320
|
+
required: true,
|
|
1321
|
+
oneOf: [{ type: "string" }, { type: "null" }]
|
|
1322
|
+
},
|
|
1323
|
+
after: {
|
|
1324
|
+
required: true,
|
|
1325
|
+
oneOf: [{ type: "string" }, { type: "null" }]
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1329
|
+
}
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
},
|
|
1333
|
+
affectedPaths: {
|
|
1334
|
+
type: "array",
|
|
1335
|
+
items: { type: "string" },
|
|
1336
|
+
required: true
|
|
1337
|
+
}
|
|
1338
|
+
}
|
|
1339
|
+
};
|
|
1340
|
+
/** Patch syntax and symbolic-link refusals retain their own stable codes. */
|
|
1341
|
+
var PatchToolError = class extends HarnessError {};
|
|
1342
|
+
function rejection(code, message) {
|
|
1343
|
+
return code === "PATCH_SYNTAX" || code === "PATCH_SYMLINK_SOURCE" ? new PatchToolError(message, code) : new FsError(message, code);
|
|
1344
|
+
}
|
|
1345
|
+
function refusalError(first, ...rest) {
|
|
1346
|
+
const refusals = [first, ...rest];
|
|
1347
|
+
const lines = refusals.map(({ operation, failure }) => `- operation ${operation.index + 1} (${operation.kind} ${operation.path}, patch line ${operation.patchLine}): ${failure.message}`);
|
|
1348
|
+
return rejection(first.failure.code, `Patch rejected before any change (${refusals.length} problems):\n${lines.join("\n")}`);
|
|
1349
|
+
}
|
|
1350
|
+
/**
|
|
1351
|
+
* Convert a report into a commit value, or reject while no disk change exists.
|
|
1352
|
+
* A commit whose first operation failed without any change, such as a provider sandbox
|
|
1353
|
+
* denial, rejects like a preflight refusal so the error code reaches the same retry paths.
|
|
1354
|
+
* @param report - executor report.
|
|
1355
|
+
* @returns a flat, lossless JSON commit value, including partial failures.
|
|
1356
|
+
* @throws FsError or PatchToolError for syntax, preflight, or first-operation refusals.
|
|
1357
|
+
*/
|
|
1358
|
+
function patchToolValue(report) {
|
|
1359
|
+
if (report.phase === "syntax") throw rejection(report.failure.code, report.failure.message);
|
|
1360
|
+
if (report.phase === "preflight") throw refusalError(...report.refusals);
|
|
1361
|
+
const [first, ...rest] = report.outcomes;
|
|
1362
|
+
if (first?.status === "failed" && first.changes.length === 0 && rest.every((outcome) => outcome.status === "skipped")) throw refusalError(first);
|
|
1363
|
+
return {
|
|
1364
|
+
phase: "commit",
|
|
1365
|
+
cancelled: report.cancelled,
|
|
1366
|
+
affectedPaths: report.affectedPaths,
|
|
1367
|
+
operations: report.outcomes.map((outcome) => ({
|
|
1368
|
+
...outcome.operation,
|
|
1369
|
+
status: outcome.status,
|
|
1370
|
+
..."failure" in outcome ? outcome.failure : {},
|
|
1371
|
+
..."changes" in outcome ? { changes: outcome.changes } : {}
|
|
1372
|
+
}))
|
|
1373
|
+
};
|
|
1374
|
+
}
|
|
1375
|
+
/**
|
|
1376
|
+
* Identify a stopped commit, including cancellation before the next operation.
|
|
1377
|
+
* @param value - canonical patch result.
|
|
1378
|
+
* @returns whether the patch did not finish every operation.
|
|
1379
|
+
*/
|
|
1380
|
+
function patchStopped(value) {
|
|
1381
|
+
return value.cancelled || value.operations.some((operation) => operation.status !== "completed");
|
|
1382
|
+
}
|
|
1383
|
+
function completedLines(operations) {
|
|
1384
|
+
return [
|
|
1385
|
+
"add",
|
|
1386
|
+
"update",
|
|
1387
|
+
"delete"
|
|
1388
|
+
].flatMap((kind) => operations.filter((operation) => operation.status === "completed" && (operation.kind === "move" ? "update" : operation.kind) === kind).map((operation) => `${kind === "add" ? "A" : kind === "delete" ? "D" : "M"} ${operation.destination ?? operation.path}`));
|
|
1389
|
+
}
|
|
1390
|
+
/**
|
|
1391
|
+
* Render completed paths and actionable stopped-operation diagnostics.
|
|
1392
|
+
* @param value - canonical patch result; paths already use the executor's display spelling.
|
|
1393
|
+
* @returns concise model-visible text without whole-file contents.
|
|
1394
|
+
*/
|
|
1395
|
+
function renderPatch(value) {
|
|
1396
|
+
if (!patchStopped(value)) return value.operations.length === 0 ? "Success. No operations in patch." : ["Success. Updated the following files:", ...completedLines(value.operations)].join("\n");
|
|
1397
|
+
const completed = value.operations.filter((operation) => operation.status === "completed").length;
|
|
1398
|
+
const lines = [`Patch stopped after ${completed} of ${value.operations.length} operations.`];
|
|
1399
|
+
if (completed > 0) lines.push("Completed:", ...completedLines(value.operations));
|
|
1400
|
+
for (const [status, title] of [
|
|
1401
|
+
["failed", "Failed:"],
|
|
1402
|
+
["unknown", "Outcome unknown:"],
|
|
1403
|
+
["skipped", "Not executed:"]
|
|
1404
|
+
]) {
|
|
1405
|
+
const operations = value.operations.filter((operation) => operation.status === status);
|
|
1406
|
+
if (operations.length === 0) continue;
|
|
1407
|
+
lines.push(title);
|
|
1408
|
+
for (const operation of operations) {
|
|
1409
|
+
const label = `- operation ${operation.index + 1} (${operation.kind} ${operation.path}`;
|
|
1410
|
+
if (status === "skipped") {
|
|
1411
|
+
lines.push(`${label})`);
|
|
1412
|
+
continue;
|
|
1413
|
+
}
|
|
1414
|
+
const destination = operation.destination === void 0 ? "" : ` -> ${operation.destination}`;
|
|
1415
|
+
lines.push(`${label}${destination}, patch line ${operation.patchLine}): ${operation.message}`);
|
|
1416
|
+
if (status === "failed" && operation.kind === "move" && operation.changes?.length) lines.push(` destination ${operation.destination} was written; source ${operation.path} remains`);
|
|
1417
|
+
}
|
|
1418
|
+
}
|
|
1419
|
+
return lines.join("\n");
|
|
1420
|
+
}
|
|
1421
|
+
/**
|
|
1422
|
+
* Derive hunks only from known completed effects, including a partial move destination.
|
|
1423
|
+
* Creations store no diff, as for `write`; a removal without a bounded basis stores none either.
|
|
1424
|
+
* @param value - canonical commit value containing the provider's bounded baselines.
|
|
1425
|
+
* @returns serializable diff hunks and an explicit stopped flag; no whole-file change records.
|
|
1426
|
+
*/
|
|
1427
|
+
function patchPresentationMeta(value) {
|
|
1428
|
+
return {
|
|
1429
|
+
diffs: value.operations.flatMap((operation) => {
|
|
1430
|
+
if (operation.status !== "completed" && operation.status !== "failed") return [];
|
|
1431
|
+
return (operation.changes ?? []).flatMap(({ path, before, after }) => {
|
|
1432
|
+
if (before === null) return [];
|
|
1433
|
+
if (after === null) return [{
|
|
1434
|
+
path,
|
|
1435
|
+
oldText: before,
|
|
1436
|
+
newText: ""
|
|
1437
|
+
}];
|
|
1438
|
+
return computeHunkDiffs(path, before, after);
|
|
1439
|
+
});
|
|
1440
|
+
}).map(({ path, oldText, newText }) => ({
|
|
1441
|
+
path,
|
|
1442
|
+
oldText,
|
|
1443
|
+
newText
|
|
1444
|
+
})),
|
|
1445
|
+
stopped: patchStopped(value)
|
|
1446
|
+
};
|
|
1447
|
+
}
|
|
1448
|
+
//#endregion
|
|
1449
|
+
//#region lib/types/apply-patch-presentation.js
|
|
1450
|
+
/** Pure patch call previews and known applied diff metadata for Host and Web replay. */
|
|
1451
|
+
/**
|
|
1452
|
+
* Preview the requested operations without resolving paths or reading the filesystem.
|
|
1453
|
+
* A deletion has no diff text to preview and appears only among the locations.
|
|
1454
|
+
* @param patch - raw patch argument.
|
|
1455
|
+
* @returns a diff call view, or undefined when syntax is invalid.
|
|
1456
|
+
*/
|
|
1457
|
+
function presentPatchCall(patch) {
|
|
1458
|
+
let operations;
|
|
1459
|
+
try {
|
|
1460
|
+
operations = parsePatch(patch);
|
|
1461
|
+
} catch (error) {
|
|
1462
|
+
if (!(error instanceof PatchParseError)) throw error;
|
|
1463
|
+
return;
|
|
1464
|
+
}
|
|
1465
|
+
const diffs = operations.flatMap((operation) => {
|
|
1466
|
+
const path = operation.path;
|
|
1467
|
+
switch (operation.kind) {
|
|
1468
|
+
case "add": return [{
|
|
1469
|
+
path,
|
|
1470
|
+
oldText: null,
|
|
1471
|
+
newText: operation.content
|
|
1472
|
+
}];
|
|
1473
|
+
case "delete": return [];
|
|
1474
|
+
case "update": return [{
|
|
1475
|
+
path,
|
|
1476
|
+
oldText: operation.hunks.flatMap((hunk) => hunk.oldLines).join("\n") || null,
|
|
1477
|
+
newText: operation.hunks.flatMap((hunk) => hunk.newLines).join("\n")
|
|
1478
|
+
}];
|
|
1479
|
+
/* v8 ignore next -- Exhaustive closed parser union. */
|
|
1480
|
+
default: return assertNever(operation);
|
|
1481
|
+
}
|
|
1482
|
+
});
|
|
1483
|
+
const paths = new Set(operations.flatMap((operation) => operation.kind === "update" && operation.moveTo !== void 0 ? [operation.path, operation.moveTo] : [operation.path]));
|
|
1484
|
+
return {
|
|
1485
|
+
card: "diff",
|
|
1486
|
+
title: `Apply patch (${paths.size} ${paths.size === 1 ? "file" : "files"})`,
|
|
1487
|
+
diffs,
|
|
1488
|
+
locations: [...paths].map((path) => ({ path }))
|
|
1489
|
+
};
|
|
1490
|
+
}
|
|
1491
|
+
/**
|
|
1492
|
+
* Present applied metadata; failed or missing metadata uses generic result rendering.
|
|
1493
|
+
* @param result - live or replayed tool result.
|
|
1494
|
+
* @returns known applied hunks with a stopped title where appropriate.
|
|
1495
|
+
*/
|
|
1496
|
+
function presentPatchResult(result) {
|
|
1497
|
+
if (result.isError) return void 0;
|
|
1498
|
+
const diffs = diffsFromMeta(result.meta);
|
|
1499
|
+
if (diffs === void 0) return void 0;
|
|
1500
|
+
return {
|
|
1501
|
+
card: "diff",
|
|
1502
|
+
title: stoppedFromMeta(result.meta) ? "Apply patch (stopped)" : "Apply patch",
|
|
1503
|
+
diffs
|
|
1504
|
+
};
|
|
1505
|
+
}
|
|
1506
|
+
//#endregion
|
|
1507
|
+
//#region lib/types/apply-patch.js
|
|
1508
|
+
/**
|
|
1509
|
+
* Register the patch tool and scope-aware guidance using the shared mutation controller.
|
|
1510
|
+
* @param ctx - plugin effect scope and filesystem services.
|
|
1511
|
+
* @param sandbox - per-call policy resolver and denial mapper.
|
|
1512
|
+
*/
|
|
1513
|
+
function applyApplyPatchTool(ctx, sandbox) {
|
|
1514
|
+
ctx.systemPrompt.section({
|
|
1515
|
+
name: "tool:apply_patch",
|
|
1516
|
+
order: ctx.systemPrompt.getSectionOrder("TOOL_APPLY_PATCH"),
|
|
1517
|
+
text: ({ scope }) => ctx.tools.get("apply_patch", scope) === void 0 ? "" : "Prefer apply_patch over separate edit calls for changes across files or separated regions. Read a file before updating, deleting, or moving it (the default fs-observation-policy requires it), unless you just created or edited it in this session. The whole patch is checked first (syntax, hunk matching, missing files) and a rejected patch changes nothing; once applying starts, operations run in order, stop at the first failure, and are not rolled back, so re-read affected files before retrying when needed."
|
|
1518
|
+
});
|
|
1519
|
+
ctx.tools.register(defineTool({
|
|
1520
|
+
name: "apply_patch",
|
|
1521
|
+
description: "Create, update, delete, or move UTF-8 text files with one Codex-style patch; prefer it over multiple edit calls when a change spans several files or separated regions.",
|
|
1522
|
+
parameters: {
|
|
1523
|
+
input: {
|
|
1524
|
+
type: "string",
|
|
1525
|
+
required: true,
|
|
1526
|
+
description: "Codex patch text: start with *** Begin Patch and end with *** End Patch. Use *** Add File: path with + lines; *** Update File: path, optionally followed by *** Move to: path, with @@ or @@ context and space-prefixed context, + added, or - removed lines; *** End of File anchors the last hunk to the file end. Use *** Delete File: path to delete. Paths are relative to the Session working directory. Read existing files before updating, deleting, or moving them."
|
|
1527
|
+
},
|
|
1528
|
+
...sandbox.escalationModes.length > 0 ? sandbox.schemaFields() : {}
|
|
1529
|
+
},
|
|
1530
|
+
output: {
|
|
1531
|
+
schema: patchOutputSchema,
|
|
1532
|
+
render: (_args, value) => [{
|
|
1533
|
+
type: "text",
|
|
1534
|
+
text: renderPatch(value)
|
|
1535
|
+
}],
|
|
1536
|
+
presentationMeta: (_args, value) => patchPresentationMeta(value)
|
|
1537
|
+
},
|
|
1538
|
+
async execute(args, exec) {
|
|
1539
|
+
const sandboxPolicy = await sandbox.resolvePolicy("apply_patch", args, exec);
|
|
1540
|
+
return patchToolValue(await executePatch(ctx, sandbox, exec, {
|
|
1541
|
+
patch: args.input,
|
|
1542
|
+
sandboxPolicy
|
|
1543
|
+
}));
|
|
1544
|
+
},
|
|
1545
|
+
presentCall: (args) => presentPatchCall(args.input),
|
|
1546
|
+
presentResult: (_args, result) => presentPatchResult(result)
|
|
1547
|
+
}));
|
|
1548
|
+
}
|
|
1549
|
+
//#endregion
|
|
781
1550
|
//#region lib/types/edit.js
|
|
782
1551
|
/**
|
|
783
1552
|
* Model-facing literal edit, unique-match by default. It obtains an optional guard from the
|
|
@@ -1291,20 +2060,6 @@ var FsSandboxController = class {
|
|
|
1291
2060
|
mode: approvedMode
|
|
1292
2061
|
};
|
|
1293
2062
|
}
|
|
1294
|
-
/**
|
|
1295
|
-
* Map a thrown provider error for the model: a `FS_SANDBOX_DENIED` becomes a
|
|
1296
|
-
* `FsError` whose text is the shared `[sandbox: …]` denial marker plus the
|
|
1297
|
-
* same-turn escalation hint, so a policy denial reads identically to bash's
|
|
1298
|
-
* WHILE keeping the structured `FS_SANDBOX_DENIED` code — `ToolRuntime`
|
|
1299
|
-
* populates `result.error` only for `HarnessError` instances, so a plain
|
|
1300
|
-
* `Error` would strip the code retry/observers key off. Any other error
|
|
1301
|
-
* passes through unchanged. A `FS_SANDBOX_DENIED` only arises under a
|
|
1302
|
-
* confining backend, which always advertises the escalation fields, so the
|
|
1303
|
-
* hint always applies here.
|
|
1304
|
-
* @param error - the error thrown by the mutation.
|
|
1305
|
-
* @param policy - the policy stamped onto the call (names the mode in the marker).
|
|
1306
|
-
* @returns the error to throw — the marker `FsError` for a sandbox denial, else the original.
|
|
1307
|
-
*/
|
|
1308
2063
|
mapError(error, policy) {
|
|
1309
2064
|
if (!(error instanceof FsError) || error.code !== "FS_SANDBOX_DENIED") return error;
|
|
1310
2065
|
const mode = policy.mode;
|
|
@@ -1314,7 +2069,7 @@ var FsSandboxController = class {
|
|
|
1314
2069
|
//#endregion
|
|
1315
2070
|
//#region lib/types/index.js
|
|
1316
2071
|
/**
|
|
1317
|
-
* Model-facing read, read_image, write, and
|
|
2072
|
+
* Model-facing read, read_image, write, edit, and apply_patch tools over `ctx.fs`. This package owns schemas, validation,
|
|
1318
2073
|
* read windows, formatting, and observation events, never a concrete provider. An optional
|
|
1319
2074
|
* event policy supplies mutation guards; without one the tools use unconditional provider calls.
|
|
1320
2075
|
* @module @deepseek-ai/dsh-tool-fs
|
|
@@ -1333,6 +2088,7 @@ const Config = z.object({
|
|
|
1333
2088
|
readImage: z.boolean().default(true),
|
|
1334
2089
|
write: z.boolean().default(true),
|
|
1335
2090
|
edit: z.boolean().default(true),
|
|
2091
|
+
applyPatch: z.boolean().default(false),
|
|
1336
2092
|
readLimit: z.number().default(READ_LIMIT),
|
|
1337
2093
|
readMaxLineLength: z.number().default(READ_MAX_LINE_LENGTH),
|
|
1338
2094
|
readMaxBytes: z.number().default(READ_MAX_BYTES),
|
|
@@ -1358,10 +2114,11 @@ function apply(ctx, config) {
|
|
|
1358
2114
|
if (resolved.readImage) ctx.inject(["attachments"], (imageCtx) => {
|
|
1359
2115
|
applyReadImageTool(imageCtx);
|
|
1360
2116
|
});
|
|
1361
|
-
if (resolved.write || resolved.edit) {
|
|
2117
|
+
if (resolved.write || resolved.edit || resolved.applyPatch) {
|
|
1362
2118
|
const sandbox = new FsSandboxController(ctx);
|
|
1363
2119
|
if (resolved.write) applyWriteTool(ctx, sandbox);
|
|
1364
2120
|
if (resolved.edit) applyEditTool(ctx, sandbox);
|
|
2121
|
+
if (resolved.applyPatch) applyApplyPatchTool(ctx, sandbox);
|
|
1365
2122
|
}
|
|
1366
2123
|
}
|
|
1367
2124
|
//#endregion
|