@dsh-cove/dsh-web-all 0.0.0-stage → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.i18n.yaml +6 -0
- package/README.md +201 -2
- package/README.zh.md +202 -0
- package/cordis.patch.yml +59 -0
- package/lib/client.js +25413 -0
- package/lib/client.js.map +1 -0
- package/lib/index.js +20024 -0
- package/lib/invariant.js +6 -0
- package/lib/types/client/compat.d.ts +29 -0
- package/lib/types/client/compat.d.ts.map +1 -0
- package/lib/types/client/compat.js +69 -0
- package/lib/types/client/conversation/git-branch.d.ts +13 -0
- package/lib/types/client/conversation/git-branch.d.ts.map +1 -0
- package/lib/types/client/conversation/git-branch.js +121 -0
- package/lib/types/client/conversation/git-graph/api.d.ts +42 -0
- package/lib/types/client/conversation/git-graph/api.d.ts.map +1 -0
- package/lib/types/client/conversation/git-graph/api.js +72 -0
- package/lib/types/client/conversation/git-graph/branch-chip.d.ts +47 -0
- package/lib/types/client/conversation/git-graph/branch-chip.d.ts.map +1 -0
- package/lib/types/client/conversation/git-graph/branch-chip.js +268 -0
- package/lib/types/client/conversation/git-graph/branch-popover.d.ts +32 -0
- package/lib/types/client/conversation/git-graph/branch-popover.d.ts.map +1 -0
- package/lib/types/client/conversation/git-graph/branch-popover.js +108 -0
- package/lib/types/client/conversation/git-graph/chip.d.ts +24 -0
- package/lib/types/client/conversation/git-graph/chip.d.ts.map +1 -0
- package/lib/types/client/conversation/git-graph/chip.js +15 -0
- package/lib/types/client/conversation/git-graph/create-branch-dialog.d.ts +30 -0
- package/lib/types/client/conversation/git-graph/create-branch-dialog.d.ts.map +1 -0
- package/lib/types/client/conversation/git-graph/create-branch-dialog.js +52 -0
- package/lib/types/client/conversation/git-graph/error-copy.d.ts +17 -0
- package/lib/types/client/conversation/git-graph/error-copy.d.ts.map +1 -0
- package/lib/types/client/conversation/git-graph/error-copy.js +44 -0
- package/lib/types/client/conversation/git-graph/graph-dialog.d.ts +21 -0
- package/lib/types/client/conversation/git-graph/graph-dialog.d.ts.map +1 -0
- package/lib/types/client/conversation/git-graph/graph-dialog.js +112 -0
- package/lib/types/client/conversation/git-graph/hero-seat.d.ts +53 -0
- package/lib/types/client/conversation/git-graph/hero-seat.d.ts.map +1 -0
- package/lib/types/client/conversation/git-graph/hero-seat.js +54 -0
- package/lib/types/client/conversation/git-graph/locales.d.ts +88 -0
- package/lib/types/client/conversation/git-graph/locales.d.ts.map +1 -0
- package/lib/types/client/conversation/git-graph/locales.js +85 -0
- package/lib/types/client/conversation/git-graph/sse-leader.d.ts +37 -0
- package/lib/types/client/conversation/git-graph/sse-leader.d.ts.map +1 -0
- package/lib/types/client/conversation/git-graph/sse-leader.js +101 -0
- package/lib/types/client/conversation/index.d.ts +43 -0
- package/lib/types/client/conversation/index.d.ts.map +1 -0
- package/lib/types/client/conversation/index.js +39 -0
- package/lib/types/client/conversation/selector-context.d.ts +12 -0
- package/lib/types/client/conversation/selector-context.d.ts.map +1 -0
- package/lib/types/client/conversation/selector-context.js +11 -0
- package/lib/types/client/conversation/session-lane-chip.d.ts +72 -0
- package/lib/types/client/conversation/session-lane-chip.d.ts.map +1 -0
- package/lib/types/client/conversation/session-lane-chip.js +163 -0
- package/lib/types/client/conversation/session-lane-locales.d.ts +22 -0
- package/lib/types/client/conversation/session-lane-locales.d.ts.map +1 -0
- package/lib/types/client/conversation/session-lane-locales.js +29 -0
- package/lib/types/client/conversation/subagent-model-dom.d.ts +16 -0
- package/lib/types/client/conversation/subagent-model-dom.d.ts.map +1 -0
- package/lib/types/client/conversation/subagent-model-dom.js +138 -0
- package/lib/types/client/conversation/subagent-model.d.ts +17 -0
- package/lib/types/client/conversation/subagent-model.d.ts.map +1 -0
- package/lib/types/client/conversation/subagent-model.js +156 -0
- package/lib/types/client/conversation/worktree/api.d.ts +97 -0
- package/lib/types/client/conversation/worktree/api.d.ts.map +1 -0
- package/lib/types/client/conversation/worktree/api.js +239 -0
- package/lib/types/client/conversation/worktree/dialogs/DeleteWorktreeDialog.d.ts +35 -0
- package/lib/types/client/conversation/worktree/dialogs/DeleteWorktreeDialog.d.ts.map +1 -0
- package/lib/types/client/conversation/worktree/dialogs/DeleteWorktreeDialog.js +55 -0
- package/lib/types/client/conversation/worktree/dialogs/PrCreateDialog.d.ts +27 -0
- package/lib/types/client/conversation/worktree/dialogs/PrCreateDialog.d.ts.map +1 -0
- package/lib/types/client/conversation/worktree/dialogs/PrCreateDialog.js +49 -0
- package/lib/types/client/conversation/worktree/lane-binding.d.ts +46 -0
- package/lib/types/client/conversation/worktree/lane-binding.d.ts.map +1 -0
- package/lib/types/client/conversation/worktree/lane-binding.js +60 -0
- package/lib/types/client/conversation/worktree/lane-menu.d.ts +51 -0
- package/lib/types/client/conversation/worktree/lane-menu.d.ts.map +1 -0
- package/lib/types/client/conversation/worktree/lane-menu.js +140 -0
- package/lib/types/client/conversation/worktree/lane-open.d.ts +126 -0
- package/lib/types/client/conversation/worktree/lane-open.d.ts.map +1 -0
- package/lib/types/client/conversation/worktree/lane-open.js +140 -0
- package/lib/types/client/conversation/worktree/lane-workspace-sweeper.d.ts +79 -0
- package/lib/types/client/conversation/worktree/lane-workspace-sweeper.d.ts.map +1 -0
- package/lib/types/client/conversation/worktree/lane-workspace-sweeper.js +116 -0
- package/lib/types/client/conversation/worktree/lifecycle.d.ts +29 -0
- package/lib/types/client/conversation/worktree/lifecycle.d.ts.map +1 -0
- package/lib/types/client/conversation/worktree/lifecycle.js +67 -0
- package/lib/types/client/conversation/worktree/locales.d.ts +58 -0
- package/lib/types/client/conversation/worktree/locales.d.ts.map +1 -0
- package/lib/types/client/conversation/worktree/locales.js +86 -0
- package/lib/types/client/conversation/worktree/semantic.d.ts +11 -0
- package/lib/types/client/conversation/worktree/semantic.d.ts.map +1 -0
- package/lib/types/client/conversation/worktree/semantic.js +10 -0
- package/lib/types/client/index.d.ts +14 -0
- package/lib/types/client/index.d.ts.map +1 -0
- package/lib/types/client/index.js +45 -0
- package/lib/types/client/lark-inbox/i18n.d.ts +63 -0
- package/lib/types/client/lark-inbox/i18n.d.ts.map +1 -0
- package/lib/types/client/lark-inbox/i18n.js +119 -0
- package/lib/types/client/lark-inbox/wizard.d.ts +19 -0
- package/lib/types/client/lark-inbox/wizard.d.ts.map +1 -0
- package/lib/types/client/lark-inbox/wizard.js +158 -0
- package/lib/types/client/notify/i18n.d.ts +47 -0
- package/lib/types/client/notify/i18n.d.ts.map +1 -0
- package/lib/types/client/notify/i18n.js +87 -0
- package/lib/types/client/settings/family-scope.d.ts +23 -0
- package/lib/types/client/settings/family-scope.d.ts.map +1 -0
- package/lib/types/client/settings/family-scope.js +30 -0
- package/lib/types/client/settings/lark-inbox.d.ts +73 -0
- package/lib/types/client/settings/lark-inbox.d.ts.map +1 -0
- package/lib/types/client/settings/lark-inbox.js +144 -0
- package/lib/types/client/settings/notify.d.ts +66 -0
- package/lib/types/client/settings/notify.d.ts.map +1 -0
- package/lib/types/client/settings/notify.js +139 -0
- package/lib/types/client/settings/primitives-0.2.d.ts +137 -0
- package/lib/types/client/settings/primitives-0.2.d.ts.map +1 -0
- package/lib/types/client/settings/primitives-0.2.js +8 -0
- package/lib/types/client/sidebar/RenderBoundary.d.ts +17 -0
- package/lib/types/client/sidebar/RenderBoundary.d.ts.map +1 -0
- package/lib/types/client/sidebar/RenderBoundary.js +18 -0
- package/lib/types/client/sidebar/agent-browser.d.ts +9 -0
- package/lib/types/client/sidebar/agent-browser.d.ts.map +1 -0
- package/lib/types/client/sidebar/agent-browser.js +102 -0
- package/lib/types/client/sidebar/diff-view.d.ts +58 -0
- package/lib/types/client/sidebar/diff-view.d.ts.map +1 -0
- package/lib/types/client/sidebar/diff-view.js +223 -0
- package/lib/types/client/sidebar/git-workbench.d.ts +41 -0
- package/lib/types/client/sidebar/git-workbench.d.ts.map +1 -0
- package/lib/types/client/sidebar/git-workbench.js +480 -0
- package/lib/types/client/sidebar/icons.d.ts +9 -0
- package/lib/types/client/sidebar/icons.d.ts.map +1 -0
- package/lib/types/client/sidebar/icons.js +6 -0
- package/lib/types/client/sidebar/index.d.ts +19 -0
- package/lib/types/client/sidebar/index.d.ts.map +1 -0
- package/lib/types/client/sidebar/index.js +12 -0
- package/lib/types/client/sidebar/native-panels.d.ts +19 -0
- package/lib/types/client/sidebar/native-panels.d.ts.map +1 -0
- package/lib/types/client/sidebar/native-panels.js +103 -0
- package/lib/types/client/sidebar/page-shell.d.ts +52 -0
- package/lib/types/client/sidebar/page-shell.d.ts.map +1 -0
- package/lib/types/client/sidebar/page-shell.js +18 -0
- package/lib/types/client/sidebar/panels/memoir/api.d.ts +258 -0
- package/lib/types/client/sidebar/panels/memoir/api.d.ts.map +1 -0
- package/lib/types/client/sidebar/panels/memoir/api.js +135 -0
- package/lib/types/client/sidebar/panels/memoir/controller.d.ts +22 -0
- package/lib/types/client/sidebar/panels/memoir/controller.d.ts.map +1 -0
- package/lib/types/client/sidebar/panels/memoir/controller.js +38 -0
- package/lib/types/client/sidebar/panels/memoir/cwd.d.ts +80 -0
- package/lib/types/client/sidebar/panels/memoir/cwd.d.ts.map +1 -0
- package/lib/types/client/sidebar/panels/memoir/cwd.js +96 -0
- package/lib/types/client/sidebar/panels/memoir/i18n.d.ts +21 -0
- package/lib/types/client/sidebar/panels/memoir/i18n.d.ts.map +1 -0
- package/lib/types/client/sidebar/panels/memoir/i18n.js +288 -0
- package/lib/types/client/sidebar/panels/memoir/panel-activation.d.ts +11 -0
- package/lib/types/client/sidebar/panels/memoir/panel-activation.d.ts.map +1 -0
- package/lib/types/client/sidebar/panels/memoir/panel-activation.js +37 -0
- package/lib/types/client/sidebar/panels/memoir/panel.d.ts +26 -0
- package/lib/types/client/sidebar/panels/memoir/panel.d.ts.map +1 -0
- package/lib/types/client/sidebar/panels/memoir/panel.js +423 -0
- package/lib/types/client/sidebar/panels/memoir/styles.d.ts +22 -0
- package/lib/types/client/sidebar/panels/memoir/styles.d.ts.map +1 -0
- package/lib/types/client/sidebar/panels/memoir/styles.js +774 -0
- package/lib/types/client/sidebar/panels/memoir/types.d.ts +7 -0
- package/lib/types/client/sidebar/panels/memoir/types.d.ts.map +1 -0
- package/lib/types/client/sidebar/panels/memoir/types.js +5 -0
- package/lib/types/client/sidebar/panels/ssh/ClusterTab.d.ts +8 -0
- package/lib/types/client/sidebar/panels/ssh/ClusterTab.d.ts.map +1 -0
- package/lib/types/client/sidebar/panels/ssh/ClusterTab.js +53 -0
- package/lib/types/client/sidebar/panels/ssh/HostFormDialog.d.ts +13 -0
- package/lib/types/client/sidebar/panels/ssh/HostFormDialog.d.ts.map +1 -0
- package/lib/types/client/sidebar/panels/ssh/HostFormDialog.js +110 -0
- package/lib/types/client/sidebar/panels/ssh/HostsTab.d.ts +26 -0
- package/lib/types/client/sidebar/panels/ssh/HostsTab.d.ts.map +1 -0
- package/lib/types/client/sidebar/panels/ssh/HostsTab.js +175 -0
- package/lib/types/client/sidebar/panels/ssh/SshPanel.d.ts +14 -0
- package/lib/types/client/sidebar/panels/ssh/SshPanel.d.ts.map +1 -0
- package/lib/types/client/sidebar/panels/ssh/SshPanel.js +34 -0
- package/lib/types/client/sidebar/panels/ssh/TerminalTab.d.ts +18 -0
- package/lib/types/client/sidebar/panels/ssh/TerminalTab.d.ts.map +1 -0
- package/lib/types/client/sidebar/panels/ssh/TerminalTab.js +207 -0
- package/lib/types/client/sidebar/panels/ssh/TransferTab.d.ts +8 -0
- package/lib/types/client/sidebar/panels/ssh/TransferTab.d.ts.map +1 -0
- package/lib/types/client/sidebar/panels/ssh/TransferTab.js +168 -0
- package/lib/types/client/sidebar/panels/ssh/TunnelsTab.d.ts +18 -0
- package/lib/types/client/sidebar/panels/ssh/TunnelsTab.d.ts.map +1 -0
- package/lib/types/client/sidebar/panels/ssh/TunnelsTab.js +161 -0
- package/lib/types/client/sidebar/panels/ssh/api.d.ts +80 -0
- package/lib/types/client/sidebar/panels/ssh/api.d.ts.map +1 -0
- package/lib/types/client/sidebar/panels/ssh/api.js +333 -0
- package/lib/types/client/sidebar/panels/ssh/controller.d.ts +23 -0
- package/lib/types/client/sidebar/panels/ssh/controller.d.ts.map +1 -0
- package/lib/types/client/sidebar/panels/ssh/controller.js +41 -0
- package/lib/types/client/sidebar/panels/ssh/helpers.d.ts +44 -0
- package/lib/types/client/sidebar/panels/ssh/helpers.d.ts.map +1 -0
- package/lib/types/client/sidebar/panels/ssh/helpers.js +53 -0
- package/lib/types/client/sidebar/panels/ssh/locales.d.ts +155 -0
- package/lib/types/client/sidebar/panels/ssh/locales.d.ts.map +1 -0
- package/lib/types/client/sidebar/panels/ssh/locales.js +312 -0
- package/lib/types/client/sidebar/panels/ssh/xterm.css.d.ts +3 -0
- package/lib/types/client/sidebar/panels/ssh/xterm.css.d.ts.map +1 -0
- package/lib/types/client/sidebar/panels/ssh/xterm.css.js +2 -0
- package/lib/types/client/sidebar/right-pane-i18n.d.ts +121 -0
- package/lib/types/client/sidebar/right-pane-i18n.d.ts.map +1 -0
- package/lib/types/client/sidebar/right-pane-i18n.js +239 -0
- package/lib/types/client/sidebar/right-pane.d.ts +27 -0
- package/lib/types/client/sidebar/right-pane.d.ts.map +1 -0
- package/lib/types/client/sidebar/right-pane.js +112 -0
- package/lib/types/client/sidebar/scope.d.ts +17 -0
- package/lib/types/client/sidebar/scope.d.ts.map +1 -0
- package/lib/types/client/sidebar/scope.js +41 -0
- package/lib/types/client/trust.d.ts +78 -0
- package/lib/types/client/trust.d.ts.map +1 -0
- package/lib/types/client/trust.js +130 -0
- package/lib/types/client/ui-icons.d.ts +19 -0
- package/lib/types/client/ui-icons.d.ts.map +1 -0
- package/lib/types/client/ui-icons.js +33 -0
- package/lib/types/core/git-graph/commands.d.ts +36 -0
- package/lib/types/core/git-graph/commands.d.ts.map +1 -0
- package/lib/types/core/git-graph/commands.js +122 -0
- package/lib/types/core/git-graph/protocol.d.ts +104 -0
- package/lib/types/core/git-graph/protocol.d.ts.map +1 -0
- package/lib/types/core/git-graph/protocol.js +142 -0
- package/lib/types/core/index.d.ts +3 -0
- package/lib/types/core/index.d.ts.map +1 -0
- package/lib/types/core/index.js +2 -0
- package/lib/types/core/lark-inbox/gating.d.ts +21 -0
- package/lib/types/core/lark-inbox/gating.d.ts.map +1 -0
- package/lib/types/core/lark-inbox/gating.js +17 -0
- package/lib/types/core/lark-inbox/queue.d.ts +27 -0
- package/lib/types/core/lark-inbox/queue.d.ts.map +1 -0
- package/lib/types/core/lark-inbox/queue.js +78 -0
- package/lib/types/core/memoir/protocol.d.ts +42 -0
- package/lib/types/core/memoir/protocol.d.ts.map +1 -0
- package/lib/types/core/memoir/protocol.js +8 -0
- package/lib/types/core/no-browser-auth/contract.d.ts +22 -0
- package/lib/types/core/no-browser-auth/contract.d.ts.map +1 -0
- package/lib/types/core/no-browser-auth/contract.js +9 -0
- package/lib/types/core/notify/contract.d.ts +133 -0
- package/lib/types/core/notify/contract.d.ts.map +1 -0
- package/lib/types/core/notify/contract.js +186 -0
- package/lib/types/core/notify/feed.d.ts +116 -0
- package/lib/types/core/notify/feed.d.ts.map +1 -0
- package/lib/types/core/notify/feed.js +214 -0
- package/lib/types/core/playwright-sessions/contracts.d.ts +98 -0
- package/lib/types/core/playwright-sessions/contracts.d.ts.map +1 -0
- package/lib/types/core/playwright-sessions/contracts.js +68 -0
- package/lib/types/core/playwright-sessions/control.d.ts +19 -0
- package/lib/types/core/playwright-sessions/control.d.ts.map +1 -0
- package/lib/types/core/playwright-sessions/control.js +9 -0
- package/lib/types/core/playwright-sessions/index.d.ts +4 -0
- package/lib/types/core/playwright-sessions/index.d.ts.map +1 -0
- package/lib/types/core/playwright-sessions/index.js +3 -0
- package/lib/types/core/playwright-sessions/names.d.ts +4 -0
- package/lib/types/core/playwright-sessions/names.d.ts.map +1 -0
- package/lib/types/core/playwright-sessions/names.js +84 -0
- package/lib/types/core/playwright-sessions/schema.d.ts +4 -0
- package/lib/types/core/playwright-sessions/schema.d.ts.map +1 -0
- package/lib/types/core/playwright-sessions/schema.js +90 -0
- package/lib/types/core/playwright-sessions/wire.d.ts +78 -0
- package/lib/types/core/playwright-sessions/wire.d.ts.map +1 -0
- package/lib/types/core/playwright-sessions/wire.js +103 -0
- package/lib/types/core/remote-access/paths.d.ts +19 -0
- package/lib/types/core/remote-access/paths.d.ts.map +1 -0
- package/lib/types/core/remote-access/paths.js +18 -0
- package/lib/types/core/remote-web-ui/security.d.ts +35 -0
- package/lib/types/core/remote-web-ui/security.d.ts.map +1 -0
- package/lib/types/core/remote-web-ui/security.js +146 -0
- package/lib/types/core/right-pane/protocol.d.ts +25 -0
- package/lib/types/core/right-pane/protocol.d.ts.map +1 -0
- package/lib/types/core/right-pane/protocol.js +91 -0
- package/lib/types/core/schedule-mode/index.d.ts +7 -0
- package/lib/types/core/schedule-mode/index.d.ts.map +1 -0
- package/lib/types/core/schedule-mode/index.js +6 -0
- package/lib/types/core/schedule-mode/native.d.ts +35 -0
- package/lib/types/core/schedule-mode/native.d.ts.map +1 -0
- package/lib/types/core/schedule-mode/native.js +82 -0
- package/lib/types/core/schedule-mode/types.d.ts +177 -0
- package/lib/types/core/schedule-mode/types.d.ts.map +1 -0
- package/lib/types/core/schedule-mode/types.js +65 -0
- package/lib/types/core/schedule-mode/view.d.ts +62 -0
- package/lib/types/core/schedule-mode/view.d.ts.map +1 -0
- package/lib/types/core/schedule-mode/view.js +4 -0
- package/lib/types/core/ssh/protocol.d.ts +215 -0
- package/lib/types/core/ssh/protocol.d.ts.map +1 -0
- package/lib/types/core/ssh/protocol.js +23 -0
- package/lib/types/core/subagent-model/badges.d.ts +73 -0
- package/lib/types/core/subagent-model/badges.d.ts.map +1 -0
- package/lib/types/core/subagent-model/badges.js +105 -0
- package/lib/types/core/subagent-model/model-resolver.d.ts +25 -0
- package/lib/types/core/subagent-model/model-resolver.d.ts.map +1 -0
- package/lib/types/core/subagent-model/model-resolver.js +60 -0
- package/lib/types/core/worktree/invariant.d.ts +62 -0
- package/lib/types/core/worktree/invariant.d.ts.map +1 -0
- package/lib/types/core/worktree/invariant.js +72 -0
- package/lib/types/core/worktree/manifest.d.ts +71 -0
- package/lib/types/core/worktree/manifest.d.ts.map +1 -0
- package/lib/types/core/worktree/manifest.js +98 -0
- package/lib/types/core/worktree/paths.d.ts +60 -0
- package/lib/types/core/worktree/paths.d.ts.map +1 -0
- package/lib/types/core/worktree/paths.js +118 -0
- package/lib/types/core/worktree/pr-create.d.ts +67 -0
- package/lib/types/core/worktree/pr-create.d.ts.map +1 -0
- package/lib/types/core/worktree/pr-create.js +118 -0
- package/lib/types/core/worktree/protocol.d.ts +7 -0
- package/lib/types/core/worktree/protocol.d.ts.map +1 -0
- package/lib/types/core/worktree/protocol.js +6 -0
- package/lib/types/core/worktree/types.d.ts +292 -0
- package/lib/types/core/worktree/types.d.ts.map +1 -0
- package/lib/types/core/worktree/types.js +14 -0
- package/lib/types/core/worktree/workspace-model.d.ts +56 -0
- package/lib/types/core/worktree/workspace-model.d.ts.map +1 -0
- package/lib/types/core/worktree/workspace-model.js +14 -0
- package/lib/types/host/services/access-trust/index.d.ts +54 -0
- package/lib/types/host/services/access-trust/index.d.ts.map +1 -0
- package/lib/types/host/services/access-trust/index.js +82 -0
- package/lib/types/host/services/access-trust/trust.d.ts +70 -0
- package/lib/types/host/services/access-trust/trust.d.ts.map +1 -0
- package/lib/types/host/services/access-trust/trust.js +187 -0
- package/lib/types/host/services/codex-bridge/bridge.d.ts +106 -0
- package/lib/types/host/services/codex-bridge/bridge.d.ts.map +1 -0
- package/lib/types/host/services/codex-bridge/bridge.js +321 -0
- package/lib/types/host/services/codex-bridge/codex-auth.d.ts +108 -0
- package/lib/types/host/services/codex-bridge/codex-auth.d.ts.map +1 -0
- package/lib/types/host/services/codex-bridge/codex-auth.js +241 -0
- package/lib/types/host/services/codex-bridge/dsh-integration.d.ts +58 -0
- package/lib/types/host/services/codex-bridge/dsh-integration.d.ts.map +1 -0
- package/lib/types/host/services/codex-bridge/dsh-integration.js +120 -0
- package/lib/types/host/services/codex-bridge/http.d.ts +43 -0
- package/lib/types/host/services/codex-bridge/http.d.ts.map +1 -0
- package/lib/types/host/services/codex-bridge/http.js +92 -0
- package/lib/types/host/services/codex-bridge/index.d.ts +63 -0
- package/lib/types/host/services/codex-bridge/index.d.ts.map +1 -0
- package/lib/types/host/services/codex-bridge/index.js +111 -0
- package/lib/types/host/services/codex-bridge/loopback.d.ts +25 -0
- package/lib/types/host/services/codex-bridge/loopback.d.ts.map +1 -0
- package/lib/types/host/services/codex-bridge/loopback.js +68 -0
- package/lib/types/host/services/codex-bridge/routes.d.ts +31 -0
- package/lib/types/host/services/codex-bridge/routes.d.ts.map +1 -0
- package/lib/types/host/services/codex-bridge/routes.js +126 -0
- package/lib/types/host/services/family-config.d.ts +71 -0
- package/lib/types/host/services/family-config.d.ts.map +1 -0
- package/lib/types/host/services/family-config.js +166 -0
- package/lib/types/host/services/family-namespaces.d.ts +24 -0
- package/lib/types/host/services/family-namespaces.d.ts.map +1 -0
- package/lib/types/host/services/family-namespaces.js +30 -0
- package/lib/types/host/services/git-graph/index.d.ts +6 -0
- package/lib/types/host/services/git-graph/index.d.ts.map +1 -0
- package/lib/types/host/services/git-graph/index.js +7 -0
- package/lib/types/host/services/git-graph/routes.d.ts +4 -0
- package/lib/types/host/services/git-graph/routes.d.ts.map +1 -0
- package/lib/types/host/services/git-graph/routes.js +241 -0
- package/lib/types/host/services/git-graph/service.d.ts +52 -0
- package/lib/types/host/services/git-graph/service.d.ts.map +1 -0
- package/lib/types/host/services/git-graph/service.js +301 -0
- package/lib/types/host/services/index.d.ts +23 -0
- package/lib/types/host/services/index.d.ts.map +1 -0
- package/lib/types/host/services/index.js +80 -0
- package/lib/types/host/services/lark-inbox/config.d.ts +24 -0
- package/lib/types/host/services/lark-inbox/config.d.ts.map +1 -0
- package/lib/types/host/services/lark-inbox/config.js +48 -0
- package/lib/types/host/services/lark-inbox/gateway.d.ts +53 -0
- package/lib/types/host/services/lark-inbox/gateway.d.ts.map +1 -0
- package/lib/types/host/services/lark-inbox/gateway.js +171 -0
- package/lib/types/host/services/lark-inbox/host-routes.d.ts +22 -0
- package/lib/types/host/services/lark-inbox/host-routes.d.ts.map +1 -0
- package/lib/types/host/services/lark-inbox/host-routes.js +146 -0
- package/lib/types/host/services/lark-inbox/inbox-store.d.ts +39 -0
- package/lib/types/host/services/lark-inbox/inbox-store.d.ts.map +1 -0
- package/lib/types/host/services/lark-inbox/inbox-store.js +124 -0
- package/lib/types/host/services/lark-inbox/index.d.ts +26 -0
- package/lib/types/host/services/lark-inbox/index.d.ts.map +1 -0
- package/lib/types/host/services/lark-inbox/index.js +135 -0
- package/lib/types/host/services/lark-inbox/tools.d.ts +7 -0
- package/lib/types/host/services/lark-inbox/tools.d.ts.map +1 -0
- package/lib/types/host/services/lark-inbox/tools.js +119 -0
- package/lib/types/host/services/lark-inbox/wizard.d.ts +62 -0
- package/lib/types/host/services/lark-inbox/wizard.d.ts.map +1 -0
- package/lib/types/host/services/lark-inbox/wizard.js +211 -0
- package/lib/types/host/services/lifecycle.d.ts +29 -0
- package/lib/types/host/services/lifecycle.d.ts.map +1 -0
- package/lib/types/host/services/lifecycle.js +93 -0
- package/lib/types/host/services/memoir/index.d.ts +40 -0
- package/lib/types/host/services/memoir/index.d.ts.map +1 -0
- package/lib/types/host/services/memoir/index.js +52 -0
- package/lib/types/host/services/memoir/routes.d.ts +30 -0
- package/lib/types/host/services/memoir/routes.d.ts.map +1 -0
- package/lib/types/host/services/memoir/routes.js +364 -0
- package/lib/types/host/services/memoir/settings.d.ts +27 -0
- package/lib/types/host/services/memoir/settings.d.ts.map +1 -0
- package/lib/types/host/services/memoir/settings.js +120 -0
- package/lib/types/host/services/memoir/store.d.ts +35 -0
- package/lib/types/host/services/memoir/store.d.ts.map +1 -0
- package/lib/types/host/services/memoir/store.js +124 -0
- package/lib/types/host/services/memoir/tools.d.ts +8 -0
- package/lib/types/host/services/memoir/tools.d.ts.map +1 -0
- package/lib/types/host/services/memoir/tools.js +154 -0
- package/lib/types/host/services/no-browser-auth/index.d.ts +25 -0
- package/lib/types/host/services/no-browser-auth/index.d.ts.map +1 -0
- package/lib/types/host/services/no-browser-auth/index.js +42 -0
- package/lib/types/host/services/notify/config.d.ts +105 -0
- package/lib/types/host/services/notify/config.d.ts.map +1 -0
- package/lib/types/host/services/notify/config.js +123 -0
- package/lib/types/host/services/notify/feishu-sender.d.ts +120 -0
- package/lib/types/host/services/notify/feishu-sender.d.ts.map +1 -0
- package/lib/types/host/services/notify/feishu-sender.js +186 -0
- package/lib/types/host/services/notify/host-routes.d.ts +69 -0
- package/lib/types/host/services/notify/host-routes.d.ts.map +1 -0
- package/lib/types/host/services/notify/host-routes.js +112 -0
- package/lib/types/host/services/notify/index.d.ts +80 -0
- package/lib/types/host/services/notify/index.d.ts.map +1 -0
- package/lib/types/host/services/notify/index.js +263 -0
- package/lib/types/host/services/playwright-sessions/child.d.ts +76 -0
- package/lib/types/host/services/playwright-sessions/child.d.ts.map +1 -0
- package/lib/types/host/services/playwright-sessions/child.js +197 -0
- package/lib/types/host/services/playwright-sessions/controller.d.ts +25 -0
- package/lib/types/host/services/playwright-sessions/controller.d.ts.map +1 -0
- package/lib/types/host/services/playwright-sessions/controller.js +104 -0
- package/lib/types/host/services/playwright-sessions/index.d.ts +6 -0
- package/lib/types/host/services/playwright-sessions/index.d.ts.map +1 -0
- package/lib/types/host/services/playwright-sessions/index.js +161 -0
- package/lib/types/host/services/playwright-sessions/live-view.d.ts +32 -0
- package/lib/types/host/services/playwright-sessions/live-view.d.ts.map +1 -0
- package/lib/types/host/services/playwright-sessions/live-view.js +188 -0
- package/lib/types/host/services/playwright-sessions/manager.d.ts +87 -0
- package/lib/types/host/services/playwright-sessions/manager.d.ts.map +1 -0
- package/lib/types/host/services/playwright-sessions/manager.js +203 -0
- package/lib/types/host/services/playwright-sessions/profile-gc.d.ts +39 -0
- package/lib/types/host/services/playwright-sessions/profile-gc.d.ts.map +1 -0
- package/lib/types/host/services/playwright-sessions/profile-gc.js +72 -0
- package/lib/types/host/services/playwright-sessions/routes.d.ts +18 -0
- package/lib/types/host/services/playwright-sessions/routes.d.ts.map +1 -0
- package/lib/types/host/services/playwright-sessions/routes.js +87 -0
- package/lib/types/host/services/remote-access/boot-scripts.d.ts +55 -0
- package/lib/types/host/services/remote-access/boot-scripts.d.ts.map +1 -0
- package/lib/types/host/services/remote-access/boot-scripts.js +109 -0
- package/lib/types/host/services/remote-access/index.d.ts +28 -0
- package/lib/types/host/services/remote-access/index.d.ts.map +1 -0
- package/lib/types/host/services/remote-access/index.js +47 -0
- package/lib/types/host/services/remote-access/routes.d.ts +42 -0
- package/lib/types/host/services/remote-access/routes.d.ts.map +1 -0
- package/lib/types/host/services/remote-access/routes.js +119 -0
- package/lib/types/host/services/remote-web-ui/index.d.ts +21 -0
- package/lib/types/host/services/remote-web-ui/index.d.ts.map +1 -0
- package/lib/types/host/services/remote-web-ui/index.js +325 -0
- package/lib/types/host/services/remote-web-ui/server-mode/accounts.d.ts +115 -0
- package/lib/types/host/services/remote-web-ui/server-mode/accounts.d.ts.map +1 -0
- package/lib/types/host/services/remote-web-ui/server-mode/accounts.js +396 -0
- package/lib/types/host/services/remote-web-ui/server-mode/cookie.d.ts +28 -0
- package/lib/types/host/services/remote-web-ui/server-mode/cookie.d.ts.map +1 -0
- package/lib/types/host/services/remote-web-ui/server-mode/cookie.js +48 -0
- package/lib/types/host/services/remote-web-ui/server-mode/dsh-home.d.ts +17 -0
- package/lib/types/host/services/remote-web-ui/server-mode/dsh-home.d.ts.map +1 -0
- package/lib/types/host/services/remote-web-ui/server-mode/dsh-home.js +40 -0
- package/lib/types/host/services/remote-web-ui/server-mode/external-auth.d.ts +73 -0
- package/lib/types/host/services/remote-web-ui/server-mode/external-auth.d.ts.map +1 -0
- package/lib/types/host/services/remote-web-ui/server-mode/external-auth.js +242 -0
- package/lib/types/host/services/remote-web-ui/server-mode/fence.d.ts +23 -0
- package/lib/types/host/services/remote-web-ui/server-mode/fence.d.ts.map +1 -0
- package/lib/types/host/services/remote-web-ui/server-mode/fence.js +24 -0
- package/lib/types/host/services/remote-web-ui/server-mode/gateway-routes.d.ts +89 -0
- package/lib/types/host/services/remote-web-ui/server-mode/gateway-routes.d.ts.map +1 -0
- package/lib/types/host/services/remote-web-ui/server-mode/gateway-routes.js +768 -0
- package/lib/types/host/services/remote-web-ui/server-mode/gateway.d.ts +99 -0
- package/lib/types/host/services/remote-web-ui/server-mode/gateway.d.ts.map +1 -0
- package/lib/types/host/services/remote-web-ui/server-mode/gateway.js +679 -0
- package/lib/types/host/services/remote-web-ui/server-mode/http.d.ts +43 -0
- package/lib/types/host/services/remote-web-ui/server-mode/http.d.ts.map +1 -0
- package/lib/types/host/services/remote-web-ui/server-mode/http.js +92 -0
- package/lib/types/host/services/remote-web-ui/server-mode/integrated-auth.d.ts +42 -0
- package/lib/types/host/services/remote-web-ui/server-mode/integrated-auth.d.ts.map +1 -0
- package/lib/types/host/services/remote-web-ui/server-mode/integrated-auth.js +73 -0
- package/lib/types/host/services/remote-web-ui/server-mode/lan.d.ts +13 -0
- package/lib/types/host/services/remote-web-ui/server-mode/lan.d.ts.map +1 -0
- package/lib/types/host/services/remote-web-ui/server-mode/lan.js +17 -0
- package/lib/types/host/services/remote-web-ui/server-mode/loopback.d.ts +25 -0
- package/lib/types/host/services/remote-web-ui/server-mode/loopback.d.ts.map +1 -0
- package/lib/types/host/services/remote-web-ui/server-mode/loopback.js +68 -0
- package/lib/types/host/services/remote-web-ui/server-mode/posture.d.ts +75 -0
- package/lib/types/host/services/remote-web-ui/server-mode/posture.d.ts.map +1 -0
- package/lib/types/host/services/remote-web-ui/server-mode/posture.js +116 -0
- package/lib/types/host/services/remote-web-ui/server-mode/roles.d.ts +44 -0
- package/lib/types/host/services/remote-web-ui/server-mode/roles.d.ts.map +1 -0
- package/lib/types/host/services/remote-web-ui/server-mode/roles.js +47 -0
- package/lib/types/host/services/remote-web-ui/server-mode/server-boot.d.ts +21 -0
- package/lib/types/host/services/remote-web-ui/server-mode/server-boot.d.ts.map +1 -0
- package/lib/types/host/services/remote-web-ui/server-mode/server-boot.js +37 -0
- package/lib/types/host/services/remote-web-ui/server-mode/sessions.d.ts +111 -0
- package/lib/types/host/services/remote-web-ui/server-mode/sessions.d.ts.map +1 -0
- package/lib/types/host/services/remote-web-ui/server-mode/sessions.js +298 -0
- package/lib/types/host/services/remote-web-ui/server.d.ts +82 -0
- package/lib/types/host/services/remote-web-ui/server.d.ts.map +1 -0
- package/lib/types/host/services/remote-web-ui/server.js +492 -0
- package/lib/types/host/services/resources.d.ts +9 -0
- package/lib/types/host/services/resources.d.ts.map +1 -0
- package/lib/types/host/services/resources.js +98 -0
- package/lib/types/host/services/right-pane/browser.d.ts +42 -0
- package/lib/types/host/services/right-pane/browser.d.ts.map +1 -0
- package/lib/types/host/services/right-pane/browser.js +106 -0
- package/lib/types/host/services/right-pane/index.d.ts +22 -0
- package/lib/types/host/services/right-pane/index.d.ts.map +1 -0
- package/lib/types/host/services/right-pane/index.js +114 -0
- package/lib/types/host/services/right-pane/wire.d.ts +6 -0
- package/lib/types/host/services/right-pane/wire.d.ts.map +1 -0
- package/lib/types/host/services/right-pane/wire.js +9 -0
- package/lib/types/host/services/schedule-mode/config.d.ts +11 -0
- package/lib/types/host/services/schedule-mode/config.d.ts.map +1 -0
- package/lib/types/host/services/schedule-mode/config.js +15 -0
- package/lib/types/host/services/schedule-mode/engine.d.ts +150 -0
- package/lib/types/host/services/schedule-mode/engine.d.ts.map +1 -0
- package/lib/types/host/services/schedule-mode/engine.js +672 -0
- package/lib/types/host/services/schedule-mode/index.d.ts +33 -0
- package/lib/types/host/services/schedule-mode/index.d.ts.map +1 -0
- package/lib/types/host/services/schedule-mode/index.js +175 -0
- package/lib/types/host/services/schedule-mode/routes.d.ts +31 -0
- package/lib/types/host/services/schedule-mode/routes.d.ts.map +1 -0
- package/lib/types/host/services/schedule-mode/routes.js +109 -0
- package/lib/types/host/services/schedule-mode/session-create.d.ts +27 -0
- package/lib/types/host/services/schedule-mode/session-create.d.ts.map +1 -0
- package/lib/types/host/services/schedule-mode/session-create.js +21 -0
- package/lib/types/host/services/schedule-mode/store.d.ts +36 -0
- package/lib/types/host/services/schedule-mode/store.d.ts.map +1 -0
- package/lib/types/host/services/schedule-mode/store.js +309 -0
- package/lib/types/host/services/schedule-mode/tools.d.ts +13 -0
- package/lib/types/host/services/schedule-mode/tools.d.ts.map +1 -0
- package/lib/types/host/services/schedule-mode/tools.js +132 -0
- package/lib/types/host/services/ssh/engine.d.ts +162 -0
- package/lib/types/host/services/ssh/engine.d.ts.map +1 -0
- package/lib/types/host/services/ssh/engine.js +699 -0
- package/lib/types/host/services/ssh/host-keys.d.ts +10 -0
- package/lib/types/host/services/ssh/host-keys.d.ts.map +1 -0
- package/lib/types/host/services/ssh/host-keys.js +108 -0
- package/lib/types/host/services/ssh/index.d.ts +38 -0
- package/lib/types/host/services/ssh/index.d.ts.map +1 -0
- package/lib/types/host/services/ssh/index.js +47 -0
- package/lib/types/host/services/ssh/routes.d.ts +29 -0
- package/lib/types/host/services/ssh/routes.d.ts.map +1 -0
- package/lib/types/host/services/ssh/routes.js +465 -0
- package/lib/types/host/services/ssh/store.d.ts +40 -0
- package/lib/types/host/services/ssh/store.d.ts.map +1 -0
- package/lib/types/host/services/ssh/store.js +330 -0
- package/lib/types/host/services/ssh/terminal-ws.d.ts +9 -0
- package/lib/types/host/services/ssh/terminal-ws.d.ts.map +1 -0
- package/lib/types/host/services/ssh/terminal-ws.js +142 -0
- package/lib/types/host/services/ssh/tools.d.ts +11 -0
- package/lib/types/host/services/ssh/tools.d.ts.map +1 -0
- package/lib/types/host/services/ssh/tools.js +270 -0
- package/lib/types/host/services/web-render/contracts.d.ts +93 -0
- package/lib/types/host/services/web-render/contracts.d.ts.map +1 -0
- package/lib/types/host/services/web-render/contracts.js +60 -0
- package/lib/types/host/services/web-render/index.d.ts +58 -0
- package/lib/types/host/services/web-render/index.d.ts.map +1 -0
- package/lib/types/host/services/web-render/index.js +90 -0
- package/lib/types/host/services/web-render/provider.d.ts +37 -0
- package/lib/types/host/services/web-render/provider.d.ts.map +1 -0
- package/lib/types/host/services/web-render/provider.js +274 -0
- package/lib/types/host/services/web-search-anthropic/contracts.d.ts +117 -0
- package/lib/types/host/services/web-search-anthropic/contracts.d.ts.map +1 -0
- package/lib/types/host/services/web-search-anthropic/contracts.js +90 -0
- package/lib/types/host/services/web-search-anthropic/index.d.ts +53 -0
- package/lib/types/host/services/web-search-anthropic/index.d.ts.map +1 -0
- package/lib/types/host/services/web-search-anthropic/index.js +123 -0
- package/lib/types/host/services/web-search-anthropic/provider.d.ts +101 -0
- package/lib/types/host/services/web-search-anthropic/provider.d.ts.map +1 -0
- package/lib/types/host/services/web-search-anthropic/provider.js +237 -0
- package/lib/types/host/services/web-search-kaon/contracts.d.ts +114 -0
- package/lib/types/host/services/web-search-kaon/contracts.d.ts.map +1 -0
- package/lib/types/host/services/web-search-kaon/contracts.js +73 -0
- package/lib/types/host/services/web-search-kaon/index.d.ts +50 -0
- package/lib/types/host/services/web-search-kaon/index.d.ts.map +1 -0
- package/lib/types/host/services/web-search-kaon/index.js +114 -0
- package/lib/types/host/services/web-search-kaon/provider.d.ts +111 -0
- package/lib/types/host/services/web-search-kaon/provider.d.ts.map +1 -0
- package/lib/types/host/services/web-search-kaon/provider.js +244 -0
- package/lib/types/host/services/worktree/git-runner.d.ts +82 -0
- package/lib/types/host/services/worktree/git-runner.d.ts.map +1 -0
- package/lib/types/host/services/worktree/git-runner.js +81 -0
- package/lib/types/host/services/worktree/git.d.ts +94 -0
- package/lib/types/host/services/worktree/git.d.ts.map +1 -0
- package/lib/types/host/services/worktree/git.js +153 -0
- package/lib/types/host/services/worktree/http.d.ts +12 -0
- package/lib/types/host/services/worktree/http.d.ts.map +1 -0
- package/lib/types/host/services/worktree/http.js +34 -0
- package/lib/types/host/services/worktree/index.d.ts +38 -0
- package/lib/types/host/services/worktree/index.d.ts.map +1 -0
- package/lib/types/host/services/worktree/index.js +78 -0
- package/lib/types/host/services/worktree/lane-tool.d.ts +22 -0
- package/lib/types/host/services/worktree/lane-tool.d.ts.map +1 -0
- package/lib/types/host/services/worktree/lane-tool.js +92 -0
- package/lib/types/host/services/worktree/manager.d.ts +410 -0
- package/lib/types/host/services/worktree/manager.d.ts.map +1 -0
- package/lib/types/host/services/worktree/manager.js +1485 -0
- package/lib/types/host/services/worktree/model-override.d.ts +20 -0
- package/lib/types/host/services/worktree/model-override.d.ts.map +1 -0
- package/lib/types/host/services/worktree/model-override.js +35 -0
- package/lib/types/host/services/worktree/routes.d.ts +50 -0
- package/lib/types/host/services/worktree/routes.d.ts.map +1 -0
- package/lib/types/host/services/worktree/routes.js +695 -0
- package/lib/types/host/services/worktree/run-command.d.ts +26 -0
- package/lib/types/host/services/worktree/run-command.d.ts.map +1 -0
- package/lib/types/host/services/worktree/run-command.js +36 -0
- package/lib/types/host/services/worktree/session-lane/manager.d.ts +109 -0
- package/lib/types/host/services/worktree/session-lane/manager.d.ts.map +1 -0
- package/lib/types/host/services/worktree/session-lane/manager.js +172 -0
- package/lib/types/host/services/worktree/workspace-model-routes.d.ts +21 -0
- package/lib/types/host/services/worktree/workspace-model-routes.d.ts.map +1 -0
- package/lib/types/host/services/worktree/workspace-model-routes.js +198 -0
- package/lib/types/host/services/worktree/workspace-model.d.ts +48 -0
- package/lib/types/host/services/worktree/workspace-model.d.ts.map +1 -0
- package/lib/types/host/services/worktree/workspace-model.js +113 -0
- package/lib/types/index.d.ts +47 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +52 -0
- package/lib/types/invariant.d.ts +4 -0
- package/lib/types/invariant.d.ts.map +1 -0
- package/lib/types/invariant.js +3 -0
- package/package.json +153 -3
- package/presets/code-vibe/THIRD_PARTY_NOTICES.md +55 -0
- package/presets/code-vibe/skills/UPSTREAM.md +104 -0
- package/presets/code-vibe/skills/agent-experience/SKILL.md +15 -0
- package/presets/code-vibe/skills/agent-operation/SKILL.md +43 -0
- package/presets/code-vibe/skills/code-review/SKILL.md +45 -0
- package/presets/code-vibe/skills/dsh-ci-test-reliability/SKILL.md +133 -0
- package/presets/code-vibe/skills/dsh-ci-test-reliability/references/ci-flake-diagnosis.md +60 -0
- package/presets/code-vibe/skills/dsh-find-simplifications/SKILL.md +69 -0
- package/presets/code-vibe/skills/dsh-find-simplifications/references/historical-patterns.md +45 -0
- package/presets/code-vibe/skills/dsh-merging-stacked-prs/SKILL.md +129 -0
- package/presets/code-vibe/skills/dsh-prose-standard/SKILL.md +83 -0
- package/presets/code-vibe/skills/dsh-prose-standard/references/examples.md +169 -0
- package/presets/code-vibe/skills/dsh-speed-up-perf/SKILL.md +94 -0
- package/presets/code-vibe/skills/dsh-trim-cot-leakage/SKILL.md +47 -0
- package/presets/code-vibe/skills/dsh-trim-cot-leakage/references/examples.md +275 -0
- package/presets/code-vibe/skills/dsh-trim-cot-leakage/references/recall-batteries.md +52 -0
- package/presets/code-vibe/skills/frontend-design/SKILL.md +60 -0
- package/presets/code-vibe/skills/frontend-design/references/critique-format.md +35 -0
- package/presets/code-vibe/skills/frontend-design/references/design-standards/LOAD-MAP.md +81 -0
- package/presets/code-vibe/skills/frontend-design/references/design-standards/README.md +53 -0
- package/presets/code-vibe/skills/frontend-design/references/design-standards/anchor.md +51 -0
- package/presets/code-vibe/skills/frontend-design/references/design-standards/audit/ai-tells.md +59 -0
- package/presets/code-vibe/skills/frontend-design/references/design-standards/audit/web-interface.md +14 -0
- package/presets/code-vibe/skills/frontend-design/references/design-standards/change-control.md +62 -0
- package/presets/code-vibe/skills/frontend-design/references/design-standards/copy.md +65 -0
- package/presets/code-vibe/skills/frontend-design/references/design-standards/craft-knobs.md +61 -0
- package/presets/code-vibe/skills/frontend-design/references/design-standards/debug-playbook.md +37 -0
- package/presets/code-vibe/skills/frontend-design/references/design-standards/exemplars/README.md +64 -0
- package/presets/code-vibe/skills/frontend-design/references/design-standards/plan-architecture.checklist.json +13 -0
- package/presets/code-vibe/skills/frontend-design/references/design-standards/product-judgment.md +113 -0
- package/presets/code-vibe/skills/frontend-design/references/design-standards/system-architecture.md +108 -0
- package/presets/code-vibe/skills/frontend-design/references/design-standards/tokens/README.md +26 -0
- package/presets/code-vibe/skills/frontend-design/references/design-standards/tokens/color-roles.md +49 -0
- package/presets/code-vibe/skills/frontend-design/references/design-standards/tokens/motion.md +51 -0
- package/presets/code-vibe/skills/frontend-design/references/design-standards/tokens/scale.md +89 -0
- package/presets/code-vibe/skills/frontend-design/references/design-standards/ui-page-gate.md +61 -0
- package/presets/code-vibe/skills/frontend-design/references/design-standards/ui-surface.checklist.json +49 -0
- package/presets/code-vibe/skills/frontend-design/references/design-standards/ux.md +76 -0
- package/presets/code-vibe/skills/frontend-design/references/design-standards/visual.md +52 -0
- package/presets/code-vibe/skills/frontend-design/references/perceptible-path.md +27 -0
- package/presets/code-vibe/skills/frontend-design/references/product-package.md +80 -0
- package/presets/code-vibe/skills/frontend-design/references/scheme-antipatterns.md +21 -0
- package/presets/code-vibe/skills/quality-review/SKILL.md +57 -0
- package/presets/code-vibe/skills/quality-review/references/bounded-verify.md +37 -0
- package/presets/code-vibe/skills/quality-review/references/browser-verify.md +81 -0
- package/presets/code-vibe/skills/quality-review/references/evidence-contract.md +194 -0
- package/presets/code-vibe/skills/quality-review/references/falsify-checklist.md +44 -0
- package/presets/code-vibe/skills/quality-review/references/human-acceptance-pack.md +68 -0
- package/presets/code-vibe/skills/quality-review/references/product-regression.md +51 -0
- package/presets/code-vibe/skills/quality-review/references/ux-standards.md +37 -0
- package/presets/code-vibe/skills/quality-review/references/ux-walkthrough.md +49 -0
- package/presets/code-vibe/skills/quality-review/references/validation-report.md +22 -0
- package/presets/code-vibe/skills/quality-review/references/verification-loop.md +95 -0
- package/presets/code-vibe/skills/quality-review/references/version-acceptance-matrix.md +131 -0
- package/presets/code-vibe/skills/record-browser-gif/SKILL.md +174 -0
- package/presets/code-vibe/skills/record-browser-gif/scripts/encode_gif.py +337 -0
- package/presets/code-vibe/skills/record-browser-gif/scripts/test_encode_gif.py +103 -0
- package/presets/code-vibe/skills/wish-programming/SKILL.md +150 -0
- package/presets/code-vibe/skills/wish-programming/references/roles/arch-reviewer.md +26 -0
- package/presets/code-vibe/skills/wish-programming/references/roles/design-reviewer.md +32 -0
- package/presets/code-vibe/skills/wish-programming/references/roles/pm-reviewer.md +26 -0
- package/presets/code-vibe/skills/wish-programming/references/roles/qa-reviewer.md +16 -0
- package/presets/code-vibe/skills/wish-programming/references/roles/security-reviewer.md +16 -0
- package/presets/code-vibe/skills/wish-programming/references/roles/sre-reviewer.md +16 -0
- package/presets/code-vibe/skills/wish-programming/references/roles/ux-adversary.md +16 -0
- package/presets/code-vibe/skills/wish-programming/references/templates/arch.md.tpl +51 -0
- package/presets/code-vibe/skills/wish-programming/references/templates/brief.md.tpl +36 -0
- package/presets/code-vibe/skills/wish-programming/references/templates/confirmation-pack.md +54 -0
- package/presets/code-vibe/skills/wish-programming/references/templates/design-spec.md.tpl +49 -0
- package/presets/code-vibe/skills/wish-programming/references/templates/module-readme.md +37 -0
- package/presets/code-vibe/skills/wish-programming/references/templates/product.md.tpl +74 -0
- package/presets/code-vibe/skills/wish-programming/references/templates/requirements.md.tpl +31 -0
- package/presets/code-vibe/skills/wish-programming/references/workflow-template.md +122 -0
- package/presets/code-vibe/skills/wish-programming/scripts/MANIFEST.sha256 +11 -0
- package/presets/code-vibe/skills/wish-programming/scripts/check_spec.py +416 -0
- package/presets/code-vibe/skills/wish-programming/scripts/check_whitelist.py +193 -0
- package/presets/code-vibe/skills/wish-programming/scripts/coverage_check.py +199 -0
- package/presets/code-vibe/skills/wish-programming/scripts/gate-lock.sh +46 -0
- package/presets/code-vibe/skills/wish-programming/scripts/journey.sh +281 -0
- package/presets/code-vibe/skills/wish-programming/scripts/project.sh +152 -0
- package/presets/code-vibe/skills/wish-programming/scripts/replay.sh +65 -0
- package/presets/code-vibe/skills/wish-programming/scripts/scan_drift.py +79 -0
- package/presets/code-vibe/skills/wish-programming/scripts/verify.sh +169 -0
- package/presets/code-vibe/skills/wish-programming/scripts/verify_preset_budgets.py +218 -0
- package/presets/code-vibe/skills/wish-programming/scripts/wish.sh +150 -0
- package/presets/code-vibe.patch.yml +325 -0
- package/presets/hiopen.patch.yml +109 -0
- package/src/client/compat.ts +86 -0
- package/src/client/conversation/conversation.module.css +264 -0
- package/src/client/conversation/git-branch.tsx +152 -0
- package/src/client/conversation/git-graph/LICENSE.git-graph +202 -0
- package/src/client/conversation/git-graph/api.ts +85 -0
- package/src/client/conversation/git-graph/branch-chip.tsx +354 -0
- package/src/client/conversation/git-graph/branch-popover.tsx +185 -0
- package/src/client/conversation/git-graph/chip.tsx +47 -0
- package/src/client/conversation/git-graph/create-branch-dialog.tsx +108 -0
- package/src/client/conversation/git-graph/error-copy.ts +50 -0
- package/src/client/conversation/git-graph/git-graph.module.css +792 -0
- package/src/client/conversation/git-graph/graph-dialog.tsx +196 -0
- package/src/client/conversation/git-graph/hero-seat.ts +76 -0
- package/src/client/conversation/git-graph/locales.ts +90 -0
- package/src/client/conversation/git-graph/sse-leader.ts +124 -0
- package/src/client/conversation/index.ts +82 -0
- package/src/client/conversation/selector-context.tsx +24 -0
- package/src/client/conversation/session-lane-chip.tsx +262 -0
- package/src/client/conversation/session-lane-locales.ts +34 -0
- package/src/client/conversation/subagent-model-dom.ts +157 -0
- package/src/client/conversation/subagent-model.ts +198 -0
- package/src/client/conversation/worktree/api.ts +283 -0
- package/src/client/conversation/worktree/dialogs/DeleteWorktreeDialog.tsx +111 -0
- package/src/client/conversation/worktree/dialogs/PrCreateDialog.tsx +114 -0
- package/src/client/conversation/worktree/lane-binding.ts +77 -0
- package/src/client/conversation/worktree/lane-menu.tsx +247 -0
- package/src/client/conversation/worktree/lane-open.ts +204 -0
- package/src/client/conversation/worktree/lane-workspace-sweeper.ts +136 -0
- package/src/client/conversation/worktree/lifecycle.ts +75 -0
- package/src/client/conversation/worktree/locales.ts +97 -0
- package/src/client/conversation/worktree/semantic.ts +10 -0
- package/src/client/conversation/worktree/worktree.module.css +70 -0
- package/src/client/css-modules.d.ts +8 -0
- package/src/client/index.ts +58 -0
- package/src/client/lark-inbox/i18n.ts +125 -0
- package/src/client/lark-inbox/lark-wizard.module.css +88 -0
- package/src/client/lark-inbox/wizard.tsx +211 -0
- package/src/client/notify/i18n.ts +93 -0
- package/src/client/settings/family-scope.ts +45 -0
- package/src/client/settings/lark-inbox.tsx +319 -0
- package/src/client/settings/notify.tsx +288 -0
- package/src/client/settings/primitives-0.2.ts +148 -0
- package/src/client/settings/settings-shell.module.css +56 -0
- package/src/client/sidebar/RenderBoundary.tsx +17 -0
- package/src/client/sidebar/agent-browser.tsx +114 -0
- package/src/client/sidebar/diff-view.tsx +314 -0
- package/src/client/sidebar/git-workbench.tsx +700 -0
- package/src/client/sidebar/icons.tsx +23 -0
- package/src/client/sidebar/index.ts +28 -0
- package/src/client/sidebar/native-panels.tsx +149 -0
- package/src/client/sidebar/page-shell.module.css +96 -0
- package/src/client/sidebar/page-shell.tsx +86 -0
- package/src/client/sidebar/panels/memoir/api.ts +300 -0
- package/src/client/sidebar/panels/memoir/controller.ts +47 -0
- package/src/client/sidebar/panels/memoir/cwd.ts +140 -0
- package/src/client/sidebar/panels/memoir/i18n.ts +300 -0
- package/src/client/sidebar/panels/memoir/panel-activation.ts +42 -0
- package/src/client/sidebar/panels/memoir/panel.tsx +869 -0
- package/src/client/sidebar/panels/memoir/styles.ts +776 -0
- package/src/client/sidebar/panels/memoir/types.ts +7 -0
- package/src/client/sidebar/panels/ssh/ClusterTab.tsx +123 -0
- package/src/client/sidebar/panels/ssh/HostFormDialog.tsx +243 -0
- package/src/client/sidebar/panels/ssh/HostsTab.tsx +290 -0
- package/src/client/sidebar/panels/ssh/SshPanel.tsx +76 -0
- package/src/client/sidebar/panels/ssh/TerminalTab.tsx +290 -0
- package/src/client/sidebar/panels/ssh/TransferTab.tsx +232 -0
- package/src/client/sidebar/panels/ssh/TunnelsTab.tsx +204 -0
- package/src/client/sidebar/panels/ssh/api.ts +388 -0
- package/src/client/sidebar/panels/ssh/controller.ts +48 -0
- package/src/client/sidebar/panels/ssh/helpers.ts +70 -0
- package/src/client/sidebar/panels/ssh/locales.ts +318 -0
- package/src/client/sidebar/panels/ssh/panel.module.css +801 -0
- package/src/client/sidebar/panels/ssh/xterm.css.ts +2 -0
- package/src/client/sidebar/right-pane-i18n.ts +243 -0
- package/src/client/sidebar/right-pane.tsx +156 -0
- package/src/client/sidebar/scope.ts +54 -0
- package/src/client/sidebar/sidebar-header.module.css +72 -0
- package/src/client/sidebar/sidebar.module.css +619 -0
- package/src/client/trust.ts +187 -0
- package/src/client/ui-icons.ts +35 -0
- package/src/core/git-graph/commands.ts +107 -0
- package/src/core/git-graph/protocol.ts +238 -0
- package/src/core/index.ts +2 -0
- package/src/core/lark-inbox/gating.ts +35 -0
- package/src/core/lark-inbox/queue.ts +100 -0
- package/src/core/memoir/protocol.ts +46 -0
- package/src/core/no-browser-auth/contract.ts +25 -0
- package/src/core/notify/contract.ts +236 -0
- package/src/core/notify/feed.ts +235 -0
- package/src/core/playwright-sessions/contracts.ts +143 -0
- package/src/core/playwright-sessions/control.ts +33 -0
- package/src/core/playwright-sessions/index.ts +3 -0
- package/src/core/playwright-sessions/names.ts +83 -0
- package/src/core/playwright-sessions/schema.ts +102 -0
- package/src/core/playwright-sessions/wire.ts +142 -0
- package/src/core/remote-access/paths.ts +23 -0
- package/src/core/remote-web-ui/security.ts +171 -0
- package/src/core/right-pane/protocol.ts +94 -0
- package/src/core/schedule-mode/index.ts +6 -0
- package/src/core/schedule-mode/native.ts +105 -0
- package/src/core/schedule-mode/types.ts +182 -0
- package/src/core/schedule-mode/view.ts +66 -0
- package/src/core/ssh/protocol.ts +212 -0
- package/src/core/subagent-model/badges.ts +161 -0
- package/src/core/worktree/invariant.ts +101 -0
- package/src/core/worktree/manifest.ts +135 -0
- package/src/core/worktree/paths.ts +123 -0
- package/src/core/worktree/pr-create.ts +157 -0
- package/src/core/worktree/protocol.ts +7 -0
- package/src/core/worktree/types.ts +317 -0
- package/src/core/worktree/workspace-model.ts +61 -0
- package/src/host/services/access-trust/index.ts +127 -0
- package/src/host/services/access-trust/trust.ts +189 -0
- package/src/host/services/codex-bridge/bridge.ts +392 -0
- package/src/host/services/codex-bridge/codex-auth.ts +352 -0
- package/src/host/services/codex-bridge/dsh-integration.ts +169 -0
- package/src/host/services/codex-bridge/http.ts +105 -0
- package/src/host/services/codex-bridge/index.ts +154 -0
- package/src/host/services/codex-bridge/loopback.ts +63 -0
- package/src/host/services/codex-bridge/routes.ts +143 -0
- package/src/host/services/family-config.ts +224 -0
- package/src/host/services/family-namespaces.ts +39 -0
- package/src/host/services/git-graph/index.ts +11 -0
- package/src/host/services/git-graph/routes.ts +212 -0
- package/src/host/services/git-graph/service.ts +305 -0
- package/src/host/services/index.ts +94 -0
- package/src/host/services/lark-inbox/config.ts +66 -0
- package/src/host/services/lark-inbox/gateway.ts +184 -0
- package/src/host/services/lark-inbox/host-routes.ts +113 -0
- package/src/host/services/lark-inbox/inbox-store.ts +160 -0
- package/src/host/services/lark-inbox/index.ts +141 -0
- package/src/host/services/lark-inbox/tools.ts +124 -0
- package/src/host/services/lark-inbox/wizard.ts +206 -0
- package/src/host/services/lifecycle.ts +107 -0
- package/src/host/services/memoir/index.ts +80 -0
- package/src/host/services/memoir/routes.ts +346 -0
- package/src/host/services/memoir/settings.ts +122 -0
- package/src/host/services/memoir/store.ts +132 -0
- package/src/host/services/memoir/tools.ts +158 -0
- package/src/host/services/no-browser-auth/index.ts +70 -0
- package/src/host/services/notify/config.ts +178 -0
- package/src/host/services/notify/feishu-sender.ts +220 -0
- package/src/host/services/notify/host-routes.ts +133 -0
- package/src/host/services/notify/index.ts +305 -0
- package/src/host/services/playwright-sessions/child.ts +251 -0
- package/src/host/services/playwright-sessions/controller.ts +102 -0
- package/src/host/services/playwright-sessions/index.ts +146 -0
- package/src/host/services/playwright-sessions/live-view.ts +225 -0
- package/src/host/services/playwright-sessions/manager.ts +239 -0
- package/src/host/services/playwright-sessions/profile-gc.ts +97 -0
- package/src/host/services/playwright-sessions/routes.ts +90 -0
- package/src/host/services/remote-access/boot-scripts.ts +118 -0
- package/src/host/services/remote-access/index.ts +62 -0
- package/src/host/services/remote-access/routes.ts +137 -0
- package/src/host/services/remote-web-ui/index.ts +344 -0
- package/src/host/services/remote-web-ui/server-mode/accounts.ts +423 -0
- package/src/host/services/remote-web-ui/server-mode/cookie.ts +57 -0
- package/src/host/services/remote-web-ui/server-mode/dsh-home.ts +42 -0
- package/src/host/services/remote-web-ui/server-mode/external-auth.ts +296 -0
- package/src/host/services/remote-web-ui/server-mode/fence.ts +27 -0
- package/src/host/services/remote-web-ui/server-mode/gateway-routes.ts +797 -0
- package/src/host/services/remote-web-ui/server-mode/gateway.ts +684 -0
- package/src/host/services/remote-web-ui/server-mode/http.ts +105 -0
- package/src/host/services/remote-web-ui/server-mode/integrated-auth.ts +118 -0
- package/src/host/services/remote-web-ui/server-mode/lan.ts +19 -0
- package/src/host/services/remote-web-ui/server-mode/loopback.ts +63 -0
- package/src/host/services/remote-web-ui/server-mode/posture.ts +154 -0
- package/src/host/services/remote-web-ui/server-mode/roles.ts +51 -0
- package/src/host/services/remote-web-ui/server-mode/server-boot.ts +38 -0
- package/src/host/services/remote-web-ui/server-mode/sessions.ts +347 -0
- package/src/host/services/remote-web-ui/server.ts +591 -0
- package/src/host/services/resources.ts +78 -0
- package/src/host/services/right-pane/browser.ts +106 -0
- package/src/host/services/right-pane/index.ts +117 -0
- package/src/host/services/right-pane/wire.ts +10 -0
- package/src/host/services/schedule-mode/config.ts +26 -0
- package/src/host/services/schedule-mode/engine.ts +689 -0
- package/src/host/services/schedule-mode/index.ts +214 -0
- package/src/host/services/schedule-mode/routes.ts +130 -0
- package/src/host/services/schedule-mode/session-create.ts +36 -0
- package/src/host/services/schedule-mode/store.ts +304 -0
- package/src/host/services/schedule-mode/tools.ts +154 -0
- package/src/host/services/ssh/engine.ts +675 -0
- package/src/host/services/ssh/host-keys.ts +99 -0
- package/src/host/services/ssh/index.ts +84 -0
- package/src/host/services/ssh/routes.ts +442 -0
- package/src/host/services/ssh/store.ts +310 -0
- package/src/host/services/ssh/terminal-ws.ts +157 -0
- package/src/host/services/ssh/tools.ts +279 -0
- package/src/host/services/web-render/contracts.ts +138 -0
- package/src/host/services/web-render/index.ts +112 -0
- package/src/host/services/web-render/provider.ts +282 -0
- package/src/host/services/web-search-anthropic/contracts.ts +163 -0
- package/src/host/services/web-search-anthropic/index.ts +152 -0
- package/src/host/services/web-search-anthropic/provider.ts +325 -0
- package/src/host/services/worktree/git-runner.ts +124 -0
- package/src/host/services/worktree/git.ts +183 -0
- package/src/host/services/worktree/http.ts +36 -0
- package/src/host/services/worktree/index.ts +92 -0
- package/src/host/services/worktree/lane-tool.ts +100 -0
- package/src/host/services/worktree/manager.ts +1553 -0
- package/src/host/services/worktree/model-override.ts +43 -0
- package/src/host/services/worktree/routes.ts +570 -0
- package/src/host/services/worktree/run-command.ts +66 -0
- package/src/host/services/worktree/session-lane/manager.ts +228 -0
- package/src/host/services/worktree/workspace-model-routes.ts +156 -0
- package/src/host/services/worktree/workspace-model.ts +132 -0
- package/src/index.ts +84 -0
- package/src/invariant.ts +4 -0
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Anthropic 兼容 Messages 搜索 provider(只补响应解析)。
|
|
3
|
+
*
|
|
4
|
+
* 一次搜索 = 一次 Messages 请求 + 原生 `web_search_20250305` 服务端工具:代价是
|
|
5
|
+
* 一个模型回合,回报是结构化结果。相对官方 provider 的唯一差别是**响应归一化**:
|
|
6
|
+
* 本 provider 同时接受标准 Anthropic 形状(`web_search_tool_result` 条目 + citation
|
|
7
|
+
* 摘录)与只有 citation 的形状(`server_tool_use` + `text.citations[]`,Bedrock 系
|
|
8
|
+
* 上游的表现),并在「模型只是申请调用客户端工具」时给出可操作的报错,而不是假装
|
|
9
|
+
* 搜到了东西。
|
|
10
|
+
*
|
|
11
|
+
* 配置不在本域:每次搜索都从官方设置条目现读(见 contracts 的
|
|
12
|
+
* `searchConfigFrom`),所以用户改的还是原来那个 Web search 配置面,
|
|
13
|
+
* 热更新立即生效,无需重挂插件。
|
|
14
|
+
*
|
|
15
|
+
* @module web-all/host/services/web-search-anthropic
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import {
|
|
19
|
+
WebSearchError,
|
|
20
|
+
WEB_SEARCH_ANTHROPIC_PROVIDER_ID,
|
|
21
|
+
type SearchConfig,
|
|
22
|
+
type WebSearchProvider,
|
|
23
|
+
type WebSearchRequest,
|
|
24
|
+
type WebSearchResult,
|
|
25
|
+
type WebSearchSource,
|
|
26
|
+
} from './contracts.ts'
|
|
27
|
+
|
|
28
|
+
/** 归因头;与 provider 行为一起演进。 */
|
|
29
|
+
const USER_AGENT = 'dsh-web-all/web-search-anthropic'
|
|
30
|
+
|
|
31
|
+
/** 一次引用位置;只有 citation 的形状把命中信息全放在这里。 */
|
|
32
|
+
export interface CitationLocation {
|
|
33
|
+
type?: string
|
|
34
|
+
url?: string | null
|
|
35
|
+
title?: string | null
|
|
36
|
+
cited_text?: string | null
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** 一个内容块;只消费下方注释里列出的几种。 */
|
|
40
|
+
export interface ContentBlock {
|
|
41
|
+
type?: string
|
|
42
|
+
text?: string | null
|
|
43
|
+
name?: string | null
|
|
44
|
+
citations?: readonly CitationLocation[] | null
|
|
45
|
+
/** `web_search_tool_result` 的载荷:条目数组,或一个错误对象。 */
|
|
46
|
+
content?: unknown
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** `web_search_tool_result` 里的一个可引用条目。 */
|
|
50
|
+
export interface SearchResultItem {
|
|
51
|
+
type?: string
|
|
52
|
+
url?: string | null
|
|
53
|
+
title?: string | null
|
|
54
|
+
page_age?: string | null
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** Anthropic Messages 响应信封(best-effort;字段随上游而变)。 */
|
|
58
|
+
export interface AnthropicResponse {
|
|
59
|
+
content?: readonly ContentBlock[] | null
|
|
60
|
+
stop_reason?: string | null
|
|
61
|
+
usage?: { server_tool_use?: { web_search_requests?: number | null } | null } | null
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** 归一化结果:来源 + 用于诊断的检索事实。 */
|
|
65
|
+
export interface MappedSearchResponse {
|
|
66
|
+
sources: readonly WebSearchSource[]
|
|
67
|
+
/** 端点侧实际执行的服务端搜索次数(0 表示没搜)。 */
|
|
68
|
+
searches: number
|
|
69
|
+
/** 响应里有 `tool_use(web_search)`:模型申请调用客户端工具,端点没执行搜索。 */
|
|
70
|
+
clientToolUse: boolean
|
|
71
|
+
/** `web_search_tool_result` 自带的错误码(有则整体失败)。 */
|
|
72
|
+
resultError?: string
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** 一次搜索的运行期选项快照:配置 + 凭据解析面(测试可注入 fetch)。 */
|
|
76
|
+
export interface AnthropicMessagesSearchProviderOptions extends SearchConfig {
|
|
77
|
+
/** 字面 key;存在时优先于 {@link resolveApiKey}。 */
|
|
78
|
+
apiKey?: string
|
|
79
|
+
/** 每次搜索解析一次当前 key(凭据服务 / 启动环境)。 */
|
|
80
|
+
resolveApiKey?: () => Promise<string | undefined>
|
|
81
|
+
/** 注入的 fetch,测试用。 */
|
|
82
|
+
fetchImpl?: typeof fetch
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** 收集每个 URL 的 citation 摘录(首次出现优先);标准形状下它才是 snippet 来源。 */
|
|
86
|
+
export function citationSnippets(blocks: readonly ContentBlock[]): Map<string, string> {
|
|
87
|
+
const map = new Map<string, string>()
|
|
88
|
+
for (const block of blocks) {
|
|
89
|
+
if (block.type !== 'text') continue
|
|
90
|
+
for (const cite of block.citations ?? []) {
|
|
91
|
+
const url = cite.url ?? ''
|
|
92
|
+
const text = cite.cited_text ?? ''
|
|
93
|
+
if (url !== '' && text !== '' && !map.has(url)) map.set(url, text)
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return map
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** 读出 `web_search_tool_result` 自带的错误(载荷是对象而非数组时)。 */
|
|
100
|
+
function resultErrorOf(block: ContentBlock): string | undefined {
|
|
101
|
+
const payload = block.content
|
|
102
|
+
if (payload === null || typeof payload !== 'object' || Array.isArray(payload)) return undefined
|
|
103
|
+
const record = payload as { type?: unknown; error_code?: unknown }
|
|
104
|
+
if (record.error_code === undefined || record.error_code === null) return undefined
|
|
105
|
+
return `${String(record.type ?? 'web_search_tool_result_error')}: ${String(record.error_code)}`
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* 把两种 Anthropic 兼容响应形状统一成 seam 的 `sources[]`。
|
|
110
|
+
*
|
|
111
|
+
* 顺序:先走标准结果块(带 `page_age` 与条目级字段),拿不到任何条目时再回落到
|
|
112
|
+
* citation —— 只有 citation 的上游永远走第二条分支;两条分支都用同一张 citation
|
|
113
|
+
* 摘录表补 `snippet`,按 URL 去重(`max_uses > 1` 时同一 URL 可能多次出现)。
|
|
114
|
+
*
|
|
115
|
+
* @param response - 解析后的 Messages 响应体。
|
|
116
|
+
* @returns 归一化结果;`searches`/`clientToolUse`/`resultError` 供诊断使用。
|
|
117
|
+
*/
|
|
118
|
+
export function mapSearchResponse(response: AnthropicResponse): MappedSearchResponse {
|
|
119
|
+
const blocks = response.content ?? []
|
|
120
|
+
const searches = response.usage?.server_tool_use?.web_search_requests
|
|
121
|
+
?? blocks.filter(block => block.type === 'server_tool_use' && block.name === 'web_search').length
|
|
122
|
+
const clientToolUse = blocks.some(block => block.type === 'tool_use' && block.name === 'web_search')
|
|
123
|
+
const resultError = blocks.filter(block => block.type === 'web_search_tool_result')
|
|
124
|
+
.map(resultErrorOf)
|
|
125
|
+
.find(error => error !== undefined)
|
|
126
|
+
|
|
127
|
+
const snippets = citationSnippets(blocks)
|
|
128
|
+
const sources: WebSearchSource[] = []
|
|
129
|
+
const seen = new Set<string>()
|
|
130
|
+
const add = (url: string | null | undefined, title: string | null | undefined, snippet: string | null | undefined, publishedAt?: string | null): void => {
|
|
131
|
+
const value = url ?? ''
|
|
132
|
+
if (value === '' || seen.has(value)) return
|
|
133
|
+
seen.add(value)
|
|
134
|
+
sources.push({
|
|
135
|
+
url: value,
|
|
136
|
+
...title !== null && title !== undefined && title !== '' ? { title } : {},
|
|
137
|
+
...snippet !== null && snippet !== undefined && snippet !== '' ? { snippet } : {},
|
|
138
|
+
...publishedAt !== null && publishedAt !== undefined && publishedAt !== '' ? { publishedAt } : {},
|
|
139
|
+
})
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
for (const block of blocks) {
|
|
143
|
+
if (block.type !== 'web_search_tool_result' || !Array.isArray(block.content)) continue
|
|
144
|
+
for (const item of block.content as SearchResultItem[]) {
|
|
145
|
+
if (item?.type !== 'web_search_result') continue
|
|
146
|
+
const url = item.url ?? ''
|
|
147
|
+
add(url, item.title, snippets.get(url), item.page_age)
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if (sources.length === 0) {
|
|
152
|
+
for (const block of blocks) {
|
|
153
|
+
if (block.type !== 'text') continue
|
|
154
|
+
for (const cite of block.citations ?? []) add(cite.url, cite.title, cite.cited_text)
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return {
|
|
159
|
+
sources,
|
|
160
|
+
searches,
|
|
161
|
+
clientToolUse,
|
|
162
|
+
...resultError !== undefined ? { resultError } : {},
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/** 去掉尾斜杠,避免 `baseURL` 以 `/` 结尾时拼出 `//messages`。 */
|
|
167
|
+
function trimTrailingSlash(value: string): string {
|
|
168
|
+
return value.endsWith('/') ? value.replace(/\/+$/u, '') : value
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/** 端点与配置引导:把「这是配置问题、改哪里」写进错误里(指向官方那套配置面)。 */
|
|
172
|
+
function endpointHint(endpoint: string): string {
|
|
173
|
+
return `\n\nThe web search request used endpoint ${JSON.stringify(endpoint)}. Search endpoint configuration is separate from chat: guide the user to Plugins > Built-in plugin settings > Web search, where they can change and save the Messages API base URL, the model, and the credential reference. Only the user should choose or change the endpoint.`
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/** 端点没执行搜索时的可操作报错:区分「模型申请客户端工具」与「搜了但没结果」。 */
|
|
177
|
+
function noResultError(mapped: MappedSearchResponse, config: SearchConfig): WebSearchError {
|
|
178
|
+
if (mapped.clientToolUse) {
|
|
179
|
+
return new WebSearchError(
|
|
180
|
+
`The endpoint returned a client-side tool_use(web_search) instead of executing the search itself, so model ${JSON.stringify(config.model)} has no web search results. `
|
|
181
|
+
+ 'Native server-side web_search_20250305 is an Anthropic-model feature: on a multi-vendor gateway pick a Claude model, because DeepSeek/Gemini routes reply with a client tool call. '
|
|
182
|
+
+ 'The model comes from the Web search settings, not from this plugin.',
|
|
183
|
+
'WEB_PROVIDER_ERROR',
|
|
184
|
+
)
|
|
185
|
+
}
|
|
186
|
+
if (mapped.searches === 0) {
|
|
187
|
+
return new WebSearchError(
|
|
188
|
+
`The endpoint executed no server-side web search for model ${JSON.stringify(config.model)} and returned no citeable sources; the request may not have triggered native web search.`,
|
|
189
|
+
'WEB_PROVIDER_ERROR',
|
|
190
|
+
)
|
|
191
|
+
}
|
|
192
|
+
return new WebSearchError(
|
|
193
|
+
`The endpoint executed ${mapped.searches} server-side web search(es) but returned no citeable sources.`,
|
|
194
|
+
'WEB_PROVIDER_ERROR',
|
|
195
|
+
)
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/** 用 Anthropic 兼容 Messages 端点做检索的 provider。 */
|
|
199
|
+
export class AnthropicMessagesSearchProvider implements WebSearchProvider {
|
|
200
|
+
readonly id = WEB_SEARCH_ANTHROPIC_PROVIDER_ID
|
|
201
|
+
private readonly resolveConfig: () => SearchConfig | undefined
|
|
202
|
+
private readonly resolveKey: () => Promise<string | undefined>
|
|
203
|
+
private readonly fetchImpl: typeof fetch | undefined
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* @param resolveConfig - 下一次操作的配置;thunk 而非快照,官方设置条目的热更新
|
|
207
|
+
* 因此每次搜索都生效,而不必重注册 provider(重注册会让 seam 的选择对用户可见地抖动)。
|
|
208
|
+
* @param resolveKey - 解析字面 key / 凭据服务 / 启动环境,每次搜索调用一次。
|
|
209
|
+
* @param fetchImpl - 注入的 fetch,测试用。
|
|
210
|
+
*/
|
|
211
|
+
constructor(
|
|
212
|
+
resolveConfig: () => SearchConfig | undefined,
|
|
213
|
+
resolveKey: () => Promise<string | undefined>,
|
|
214
|
+
fetchImpl?: typeof fetch,
|
|
215
|
+
) {
|
|
216
|
+
this.resolveConfig = resolveConfig
|
|
217
|
+
this.resolveKey = resolveKey
|
|
218
|
+
this.fetchImpl = fetchImpl
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
available(): boolean {
|
|
222
|
+
const config = this.resolveConfig()
|
|
223
|
+
return config !== undefined
|
|
224
|
+
&& URL.canParse(config.baseURL)
|
|
225
|
+
&& config.model !== ''
|
|
226
|
+
&& Number.isInteger(config.maxTokens) && config.maxTokens > 0
|
|
227
|
+
&& Number.isInteger(config.maxUses) && config.maxUses > 0
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
async search(request: WebSearchRequest, signal?: AbortSignal): Promise<WebSearchResult> {
|
|
231
|
+
const config = this.resolveConfig()
|
|
232
|
+
if (config === undefined) throw missingConfigError()
|
|
233
|
+
// 读经函数而非直接比属性:TS 会把 `signal?.aborted === true` 早退后的属性
|
|
234
|
+
// 窄化成 false,后续再判同一属性就成了「无重叠比较」。
|
|
235
|
+
const isAborted = (): boolean => signal?.aborted === true
|
|
236
|
+
const endpoint = `${trimTrailingSlash(config.baseURL)}/messages`
|
|
237
|
+
const apiKey = await this.apiKey(config, signal)
|
|
238
|
+
if (isAborted()) throw abortedError()
|
|
239
|
+
|
|
240
|
+
const body = {
|
|
241
|
+
model: config.model,
|
|
242
|
+
max_tokens: config.maxTokens,
|
|
243
|
+
messages: [{
|
|
244
|
+
role: 'user',
|
|
245
|
+
content: [{ type: 'text', text: `Perform a web search for the query: ${request.query}` }],
|
|
246
|
+
}],
|
|
247
|
+
tools: [{ type: 'web_search_20250305', name: 'web_search', max_uses: config.maxUses }],
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
const doFetch = this.fetchImpl ?? fetch
|
|
251
|
+
let response: Response
|
|
252
|
+
try {
|
|
253
|
+
response = await doFetch(endpoint, {
|
|
254
|
+
method: 'POST',
|
|
255
|
+
redirect: 'error',
|
|
256
|
+
headers: {
|
|
257
|
+
'x-api-key': apiKey,
|
|
258
|
+
'authorization': `Bearer ${apiKey}`,
|
|
259
|
+
'anthropic-version': config.apiVersion,
|
|
260
|
+
'content-type': 'application/json',
|
|
261
|
+
'accept': 'application/json',
|
|
262
|
+
'user-agent': USER_AGENT,
|
|
263
|
+
},
|
|
264
|
+
body: JSON.stringify(body),
|
|
265
|
+
...signal === undefined ? {} : { signal },
|
|
266
|
+
})
|
|
267
|
+
} catch (error) {
|
|
268
|
+
if (isAborted()) throw abortedError()
|
|
269
|
+
throw new WebSearchError(`Web search request failed: ${String(error)}.${endpointHint(endpoint)}`, 'WEB_PROVIDER_ERROR')
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
if (!response.ok) {
|
|
273
|
+
let detail = ''
|
|
274
|
+
try {
|
|
275
|
+
const parsed = await response.json() as { error?: { message?: string } | string; message?: string }
|
|
276
|
+
detail = typeof parsed.error === 'string' ? parsed.error : parsed.error?.message ?? parsed.message ?? ''
|
|
277
|
+
} catch {
|
|
278
|
+
// 非 JSON 错误体:状态码已经足够定位。
|
|
279
|
+
}
|
|
280
|
+
const message = `Web search endpoint error (HTTP ${response.status})${detail === '' ? '' : `: ${detail}`}`
|
|
281
|
+
throw new WebSearchError(`${message}${endpointHint(endpoint)}`, 'WEB_PROVIDER_ERROR')
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
let mapped: MappedSearchResponse
|
|
285
|
+
try {
|
|
286
|
+
mapped = mapSearchResponse(await response.json() as AnthropicResponse)
|
|
287
|
+
} catch (error) {
|
|
288
|
+
throw new WebSearchError(`Web search returned an unprocessable response body: ${String(error)}`, 'WEB_PROVIDER_ERROR')
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
if (mapped.resultError !== undefined) {
|
|
292
|
+
throw new WebSearchError(`The endpoint's web search failed: ${mapped.resultError}.`, 'WEB_PROVIDER_ERROR')
|
|
293
|
+
}
|
|
294
|
+
if (mapped.sources.length === 0) throw noResultError(mapped, config)
|
|
295
|
+
|
|
296
|
+
return { sources: mapped.sources, truncated: false }
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/** 解析一次操作的 key:调用方给的解析器(字面 key → 凭据服务 → 环境变量)。 */
|
|
300
|
+
private async apiKey(config: SearchConfig, signal?: AbortSignal): Promise<string> {
|
|
301
|
+
if (signal?.aborted === true) throw abortedError()
|
|
302
|
+
const resolved = await this.resolveKey()
|
|
303
|
+
if (resolved !== undefined && resolved.length > 0) return resolved
|
|
304
|
+
const ref = config.apiKeyEnv === '' ? 'the configured credential reference' : config.apiKeyEnv
|
|
305
|
+
throw new WebSearchError(
|
|
306
|
+
`Web search has no API key for "${ref}"; store it through the credentials service, export it in the launching environment, `
|
|
307
|
+
+ 'or set the credential reference in the Web search settings.',
|
|
308
|
+
'WEB_PROVIDER_CREDENTIAL_MISSING',
|
|
309
|
+
)
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/** 配置缺失:设置条目读不到、或基址/模型为空。 */
|
|
314
|
+
function missingConfigError(): WebSearchError {
|
|
315
|
+
return new WebSearchError(
|
|
316
|
+
'Web search is pinned to the anthropic-messages provider, but no Messages API base URL and model are configured. '
|
|
317
|
+
+ 'Guide the user to Plugins > Built-in plugin settings > Web search and set the Messages API base URL, the model, and the credential reference.',
|
|
318
|
+
'WEB_PROVIDER_CREDENTIAL_MISSING',
|
|
319
|
+
)
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/** 调用方取消:与原生 provider 的 `WEB_ABORTED` 对齐。 */
|
|
323
|
+
function abortedError(): WebSearchError {
|
|
324
|
+
return new WebSearchError('Web search aborted', 'WEB_ABORTED')
|
|
325
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
// Generated by scripts/sync-shared.mjs from shared/host/git-runner.ts. Do not edit this copy; edit the shared source and run "node scripts/sync-shared.mjs".
|
|
2
|
+
/**
|
|
3
|
+
* Shared host git subprocess plumbing: the run result shape, the runner seam,
|
|
4
|
+
* the collected-output cap, and the production runner over the subprocess
|
|
5
|
+
* service. Packages receive this file as a generated copy via
|
|
6
|
+
* scripts/sync-shared.mjs; edit the shared source and re-run the sync instead
|
|
7
|
+
* of editing a copy.
|
|
8
|
+
*
|
|
9
|
+
* The context shape is declared structurally so this module stays
|
|
10
|
+
* self-contained (shared/ has no cordis dependency): any context whose
|
|
11
|
+
* `subprocess` satisfies SubprocessServiceLike works, which the plugin
|
|
12
|
+
* contexts do.
|
|
13
|
+
* @module dsh-web-shared/host/git-runner
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/** One finished git invocation. */
|
|
17
|
+
export interface GitRunResult {
|
|
18
|
+
exitCode: number | null
|
|
19
|
+
stdout: string
|
|
20
|
+
stderr: string
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** The spawn seam the service runs git through (subprocess service in production). */
|
|
24
|
+
export interface GitRunner {
|
|
25
|
+
run(argv: readonly string[], cwd: string, signal?: AbortSignal): Promise<GitRunResult>
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Collected-output cap for one git command. */
|
|
29
|
+
export const OUTPUT_CAP_BYTES = 1 << 20
|
|
30
|
+
|
|
31
|
+
/** The subprocess service surface this runner consumes (structural). */
|
|
32
|
+
export interface SubprocessServiceLike {
|
|
33
|
+
spawn(spec: {
|
|
34
|
+
argv: readonly string[]
|
|
35
|
+
cwd: string
|
|
36
|
+
stdio: {
|
|
37
|
+
stdin: 'ignore'
|
|
38
|
+
stdout: { maxBytes: number }
|
|
39
|
+
stderr: { maxBytes: number }
|
|
40
|
+
}
|
|
41
|
+
graceMs: number
|
|
42
|
+
signal?: AbortSignal
|
|
43
|
+
}): {
|
|
44
|
+
done: Promise<{ exitCode: number | null }>
|
|
45
|
+
collected: {
|
|
46
|
+
stdout?: { readFrom(offset: number): { text: string } }
|
|
47
|
+
stderr?: { readFrom(offset: number): { text: string } }
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Per-package knobs for the shared production runner. */
|
|
53
|
+
export interface GitRunnerOptions {
|
|
54
|
+
/** Build the full spawn argv from the git args (default ['git', ...argv]). */
|
|
55
|
+
spawnArgv?: (argv: readonly string[]) => readonly string[]
|
|
56
|
+
/** degrade turns spawn/run failures into exitCode 127 results instead of throwing. */
|
|
57
|
+
failureMode?: 'throw' | 'degrade'
|
|
58
|
+
/** console.error tag for degrade mode. */
|
|
59
|
+
errorTag?: string
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Production runner over the subprocess service: one managed child per
|
|
64
|
+
* command, bounded collect on both streams. A caller-owned AbortSignal reaches
|
|
65
|
+
* the subprocess tree and remains authoritative even in degrade mode. Degrade
|
|
66
|
+
* mode keeps the SCM tab showing the friendly "not a git repository" state
|
|
67
|
+
* instead of a bare 400 when git is missing or the subprocess service fails.
|
|
68
|
+
* @param ctx - context carrying the subprocess service.
|
|
69
|
+
* @param options - per-package behavior knobs.
|
|
70
|
+
* @returns the runner.
|
|
71
|
+
*/
|
|
72
|
+
export function subprocessRunner(ctx: { subprocess: SubprocessServiceLike }, options: GitRunnerOptions = {}): GitRunner {
|
|
73
|
+
const spawnArgv = options.spawnArgv ?? ((argv) => ['git', ...argv])
|
|
74
|
+
const degrade = options.failureMode === 'degrade'
|
|
75
|
+
const errorTag = options.errorTag ?? 'git'
|
|
76
|
+
const failure = (prefix: string, error: unknown): GitRunResult => ({
|
|
77
|
+
exitCode: 127,
|
|
78
|
+
stdout: '',
|
|
79
|
+
stderr: prefix + (error instanceof Error ? error.message : String(error)),
|
|
80
|
+
})
|
|
81
|
+
return {
|
|
82
|
+
async run(argv, cwd, signal) {
|
|
83
|
+
signal?.throwIfAborted()
|
|
84
|
+
const spec = {
|
|
85
|
+
argv: spawnArgv(argv),
|
|
86
|
+
cwd,
|
|
87
|
+
stdio: {
|
|
88
|
+
stdin: 'ignore' as const,
|
|
89
|
+
stdout: { maxBytes: OUTPUT_CAP_BYTES },
|
|
90
|
+
stderr: { maxBytes: OUTPUT_CAP_BYTES },
|
|
91
|
+
},
|
|
92
|
+
graceMs: 10_000,
|
|
93
|
+
signal,
|
|
94
|
+
}
|
|
95
|
+
if (degrade) {
|
|
96
|
+
let handle
|
|
97
|
+
try {
|
|
98
|
+
handle = ctx.subprocess.spawn(spec)
|
|
99
|
+
} catch (error) {
|
|
100
|
+
signal?.throwIfAborted()
|
|
101
|
+
console.error('[' + errorTag + '] git spawn failed:', error)
|
|
102
|
+
return failure('git: spawn failed: ', error)
|
|
103
|
+
}
|
|
104
|
+
try {
|
|
105
|
+
const outcome = await handle.done
|
|
106
|
+
signal?.throwIfAborted()
|
|
107
|
+
const stdout = handle.collected.stdout?.readFrom(0).text ?? ''
|
|
108
|
+
const stderr = handle.collected.stderr?.readFrom(0).text ?? ''
|
|
109
|
+
return { exitCode: outcome.exitCode, stdout, stderr }
|
|
110
|
+
} catch (error) {
|
|
111
|
+
signal?.throwIfAborted()
|
|
112
|
+
console.error('[' + errorTag + '] git run failed:', error)
|
|
113
|
+
return failure('git: run failed: ', error)
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
const handle = ctx.subprocess.spawn(spec)
|
|
117
|
+
const outcome = await handle.done
|
|
118
|
+
signal?.throwIfAborted()
|
|
119
|
+
const stdout = handle.collected.stdout?.readFrom(0).text ?? ''
|
|
120
|
+
const stderr = handle.collected.stderr?.readFrom(0).text ?? ''
|
|
121
|
+
return { exitCode: outcome.exitCode, stdout, stderr }
|
|
122
|
+
},
|
|
123
|
+
}
|
|
124
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host git subprocess plumbing for the worktree manager. We reuse the
|
|
3
|
+
* shared runner seam (`@deepseek-ai/dsh-subprocess`) the family already
|
|
4
|
+
* uses for git operations; this file only owns the worktree-specific git
|
|
5
|
+
* argv builders so the service layer stays declarative.
|
|
6
|
+
* @module dsh-client-ui-worktree/host/git
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type { GitRunner } from './git-runner.ts'
|
|
10
|
+
|
|
11
|
+
/** win32 ships git as git.exe (git for Windows); the .cmd/.bat shim in
|
|
12
|
+
* PATH would otherwise be the resolution target and Node's spawn cannot
|
|
13
|
+
* launch a .cmd file directly. Naming git.exe bypasses any shim and
|
|
14
|
+
* always hits the native executable. cmd.exe routing is deliberately
|
|
15
|
+
* NOT used: several git args carry %-format specs (--format on
|
|
16
|
+
* for-each-ref / log) that cmd would expand and corrupt. */
|
|
17
|
+
export function gitSpawnArgv(platform: NodeJS.Platform, argv: readonly string[]): readonly string[] {
|
|
18
|
+
return platform === 'win32' ? ['git.exe', ...argv] : ['git', ...argv]
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** `git rev-parse --path-format=absolute --git-common-dir` — used to map any
|
|
22
|
+
* worktree back to its main repo. */
|
|
23
|
+
export const GIT_COMMON_DIR_ARGV = ['rev-parse', '--path-format=absolute', '--git-common-dir'] as const
|
|
24
|
+
|
|
25
|
+
/** `git worktree list --porcelain` — the canonical list of linked worktrees
|
|
26
|
+
* with their branch, HEAD, and on-disk path. */
|
|
27
|
+
export const WORKTREE_LIST_ARGV = ['worktree', 'list', '--porcelain'] as const
|
|
28
|
+
|
|
29
|
+
/** `git symbolic-ref -q --short HEAD` — current branch, empty when detached. */
|
|
30
|
+
export const HEAD_BRANCH_ARGV = ['symbolic-ref', '-q', '--short', 'HEAD'] as const
|
|
31
|
+
|
|
32
|
+
/** `git rev-parse --short HEAD` — used when detached. */
|
|
33
|
+
export const HEAD_SHORT_ARGV = ['rev-parse', '--short', 'HEAD'] as const
|
|
34
|
+
|
|
35
|
+
/** `git status --porcelain` — used for the dirty count. */
|
|
36
|
+
export const STATUS_PORCELAIN_ARGV = ['status', '--porcelain'] as const
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* `git worktree add [-b <branch>] [--detach] <path> [<commit-ish>]` — the
|
|
40
|
+
* create argv. `branch` cuts a new branch at `commitIsh` and checks it out
|
|
41
|
+
* in the linked worktree; without it git checks out `commitIsh` itself, and
|
|
42
|
+
* a commit-ish that is not a branch name leaves a DETACHED HEAD. A detached
|
|
43
|
+
* worktree cannot be pushed (`git push -u origin <branch>` needs a local
|
|
44
|
+
* branch) or matched by `git worktree list --porcelain`, so every
|
|
45
|
+
* session-bound lane must pass `branch`.
|
|
46
|
+
*
|
|
47
|
+
* `-b` and `--detach` are mutually exclusive in git; passing both is a
|
|
48
|
+
* programmer error and throws rather than silently dropping one.
|
|
49
|
+
*/
|
|
50
|
+
export function worktreeAddArgv(
|
|
51
|
+
path: string,
|
|
52
|
+
commitIsh: string,
|
|
53
|
+
detach: boolean,
|
|
54
|
+
branch?: string,
|
|
55
|
+
): readonly string[] {
|
|
56
|
+
if (detach && branch !== undefined) {
|
|
57
|
+
throw new Error('worktreeAddArgv: --detach and -b are mutually exclusive')
|
|
58
|
+
}
|
|
59
|
+
const argv = ['worktree', 'add']
|
|
60
|
+
if (detach) argv.push('--detach')
|
|
61
|
+
if (branch !== undefined) argv.push('-b', branch)
|
|
62
|
+
argv.push(path, commitIsh)
|
|
63
|
+
return argv
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* `git check-ignore -q <path>` — exit 0 when the path is ignored by the
|
|
68
|
+
* repository's ignore rules. Used to refuse creating a lane before the
|
|
69
|
+
* lane root is ignored, so an unignored `<repo>/.dsh/workspaces/` can never
|
|
70
|
+
* be swept into the main checkout by a `git add -A`.
|
|
71
|
+
*/
|
|
72
|
+
export function checkIgnoreArgv(path: string): readonly string[] {
|
|
73
|
+
return ['check-ignore', '-q', path]
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** `git worktree remove [--force] <path>` — the remove argv. */
|
|
77
|
+
export function worktreeRemoveArgv(path: string, force: boolean): readonly string[] {
|
|
78
|
+
const argv = ['worktree', 'remove']
|
|
79
|
+
if (force) argv.push('--force')
|
|
80
|
+
argv.push(path)
|
|
81
|
+
return argv
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** `git worktree prune` — drop stale administrative records. */
|
|
85
|
+
export const WORKTREE_PRUNE_ARGV = ['worktree', 'prune'] as const
|
|
86
|
+
|
|
87
|
+
/** `git worktree list --porcelain` invocation helper. */
|
|
88
|
+
export function worktreeListPorcelain(): readonly string[] {
|
|
89
|
+
return WORKTREE_LIST_ARGV
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** `git init -b <initialBranch>` — used for `POST /worktree/init`. */
|
|
93
|
+
export function gitInitArgv(initialBranch: string): readonly string[] {
|
|
94
|
+
return ['init', '-b', initialBranch]
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** `git rev-parse --verify --quiet refs/heads/<branch>` — branch exists check. */
|
|
98
|
+
export function verifyRefArgv(branch: string): readonly string[] {
|
|
99
|
+
return ['rev-parse', '--verify', '--quiet', `refs/heads/${branch}`]
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** `git branch <name> [<start>]` — create branch from start point. */
|
|
103
|
+
export function createBranchArgv(name: string, start?: string): readonly string[] {
|
|
104
|
+
const argv = ['branch', name]
|
|
105
|
+
if (start !== undefined) argv.push(start)
|
|
106
|
+
return argv
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** `git remote` — list configured remotes (we look for `origin`). */
|
|
110
|
+
export const REMOTE_LIST_ARGV = ['remote'] as const
|
|
111
|
+
|
|
112
|
+
/** `git remote get-url <name>` — the remote URL for compare-URL / API derivation. */
|
|
113
|
+
export function remoteGetUrlArgv(name: string): readonly string[] {
|
|
114
|
+
return ['remote', 'get-url', name]
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/** `git push -u origin <branch>` — push and set upstream. */
|
|
118
|
+
export function pushUpstreamArgv(branch: string): readonly string[] {
|
|
119
|
+
return ['push', '-u', 'origin', branch]
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/** `git ls-remote --exit-code origin refs/heads/<branch>` — remote branch existence probe. */
|
|
123
|
+
export function lsRemoteBranchArgv(branch: string): readonly string[] {
|
|
124
|
+
return ['ls-remote', '--exit-code', 'origin', `refs/heads/${branch}`]
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/** `git fetch origin --prune` — sync remote-tracking refs and drop deleted ones. */
|
|
128
|
+
export const FETCH_PRUNE_ARGV = ['fetch', 'origin', '--prune'] as const
|
|
129
|
+
|
|
130
|
+
/** `git merge-base --is-ancestor <candidate> <base>` — merge detection (exit 0 = ancestor). */
|
|
131
|
+
export function mergeBaseIsAncestorArgv(candidate: string, base: string): readonly string[] {
|
|
132
|
+
return ['merge-base', '--is-ancestor', candidate, base]
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/** `git rev-parse --verify --quiet refs/remotes/origin/<branch>` — pushed probe. */
|
|
136
|
+
export function verifyRemoteRefArgv(branch: string): readonly string[] {
|
|
137
|
+
return ['rev-parse', '--verify', '--quiet', `refs/remotes/origin/${branch}`]
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/** `git symbolic-ref refs/remotes/origin/HEAD` — remote default branch probe (fails when unset). */
|
|
141
|
+
export const REMOTE_HEAD_REF = 'refs/remotes/origin/HEAD' as const
|
|
142
|
+
export const REMOTE_HEAD_ARGV = ['symbolic-ref', REMOTE_HEAD_REF] as const
|
|
143
|
+
|
|
144
|
+
/** `git branch -d|-D <branch>` — delete the local branch (refuses unmerged without -D). */
|
|
145
|
+
export function branchDeleteArgv(branch: string, force: boolean): readonly string[] {
|
|
146
|
+
return ['branch', force ? '-D' : '-d', branch]
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/** `git for-each-ref refs/heads refs/remotes/origin --format=%(refname:short)` —
|
|
150
|
+
* candidate branches for the create/PR dialog dropdowns. Local branches
|
|
151
|
+
* come first, then remote-tracking `origin/*` names (prefix stripped). */
|
|
152
|
+
export const BRANCH_LIST_ARGV = [
|
|
153
|
+
'for-each-ref', 'refs/heads', 'refs/remotes/origin',
|
|
154
|
+
'--format=%(refname:short)',
|
|
155
|
+
] as const
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Parse `git for-each-ref` output into a deduplicated short-name list:
|
|
159
|
+
* local branches in listing order first, then `origin/*` remote-tracking
|
|
160
|
+
* names with the `origin/` prefix stripped (skipping duplicates already
|
|
161
|
+
* seen locally, so `dev` + `origin/dev` collapse to one entry).
|
|
162
|
+
*/
|
|
163
|
+
export function parseBranchList(stdout: string): string[] {
|
|
164
|
+
const seen = new Set<string>()
|
|
165
|
+
const out: string[] = []
|
|
166
|
+
for (const raw of stdout.split('\n')) {
|
|
167
|
+
const line = raw.replace(/\r$/, '').trim()
|
|
168
|
+
if (line === '' || line === 'origin/HEAD') continue
|
|
169
|
+
const name = stripOriginPrefix(line)
|
|
170
|
+
if (name === '' || seen.has(name)) continue
|
|
171
|
+
seen.add(name)
|
|
172
|
+
out.push(name)
|
|
173
|
+
}
|
|
174
|
+
return out
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/** Strip a leading `origin/` from a remote-tracking short ref. */
|
|
178
|
+
export function stripOriginPrefix(ref: string): string {
|
|
179
|
+
return ref.startsWith('origin/') ? ref.slice('origin/'.length) : ref
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/** Re-export the shared runner type for callers. */
|
|
183
|
+
export type { GitRunner }
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSON request/response helpers. Kept tiny on purpose; the manager layer
|
|
3
|
+
* owns the response shape (`MutationResult` / `WorktreeErrorView`) and the
|
|
4
|
+
* route layer only does envelope + status code translation.
|
|
5
|
+
* @module dsh-client-ui-worktree/host/http
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import type { IncomingMessage, ServerResponse } from 'node:http'
|
|
9
|
+
|
|
10
|
+
/** Read a JSON object body. Returns `null` for empty bodies, throws otherwise. */
|
|
11
|
+
export async function readJsonObject(req: IncomingMessage, limit = 1024 * 1024): Promise<Record<string, unknown> | null> {
|
|
12
|
+
const chunks: Buffer[] = []
|
|
13
|
+
let received = 0
|
|
14
|
+
for await (const chunk of req) {
|
|
15
|
+
received += chunk.length
|
|
16
|
+
if (received > limit) {
|
|
17
|
+
req.destroy()
|
|
18
|
+
throw new Error('request body too large')
|
|
19
|
+
}
|
|
20
|
+
chunks.push(chunk as Buffer)
|
|
21
|
+
}
|
|
22
|
+
if (received === 0) return null
|
|
23
|
+
const text = Buffer.concat(chunks).toString('utf8')
|
|
24
|
+
if (text.trim() === '') return null
|
|
25
|
+
const parsed = JSON.parse(text)
|
|
26
|
+
if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
27
|
+
throw new Error('expected JSON object body')
|
|
28
|
+
}
|
|
29
|
+
return parsed as Record<string, unknown>
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Write a JSON response with the given status. */
|
|
33
|
+
export function writeJson(res: ServerResponse, status: number, payload: unknown): void {
|
|
34
|
+
res.writeHead(status, { 'content-type': 'application/json; charset=utf-8' })
|
|
35
|
+
res.end(JSON.stringify(payload))
|
|
36
|
+
}
|