@waq666/pneuma 0.0.0-stage → 0.7.0
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 +21 -0
- package/README.md +144 -2
- package/bin/dsc.js +91 -0
- package/bin/headless.cjs +40 -0
- package/lib/adapter/core-runtime.d.ts +11 -0
- package/lib/adapter/core-runtime.js +259 -0
- package/lib/adapter/host.d.ts +18 -0
- package/lib/adapter/host.js +14 -0
- package/lib/adapter/runtime.d.ts +15 -0
- package/lib/adapter/runtime.js +290 -0
- package/lib/adapter/transcript.d.ts +184 -0
- package/lib/adapter/transcript.js +605 -0
- package/lib/app/AgentsOverlay.d.ts +18 -0
- package/lib/app/AgentsOverlay.js +63 -0
- package/lib/app/App.d.ts +13 -0
- package/lib/app/App.js +1498 -0
- package/lib/app/ApprovalCard.d.ts +12 -0
- package/lib/app/ApprovalCard.js +76 -0
- package/lib/app/AskCard.d.ts +20 -0
- package/lib/app/AskCard.js +45 -0
- package/lib/app/ChatView.d.ts +32 -0
- package/lib/app/ChatView.js +198 -0
- package/lib/app/Composer.d.ts +50 -0
- package/lib/app/Composer.js +282 -0
- package/lib/app/DiffBlock.d.ts +6 -0
- package/lib/app/DiffBlock.js +37 -0
- package/lib/app/MarkdownView.d.ts +6 -0
- package/lib/app/MarkdownView.js +99 -0
- package/lib/app/ModelPicker.d.ts +7 -0
- package/lib/app/ModelPicker.js +18 -0
- package/lib/app/PlanReviewCard.d.ts +13 -0
- package/lib/app/PlanReviewCard.js +54 -0
- package/lib/app/PresetPicker.d.ts +11 -0
- package/lib/app/PresetPicker.js +19 -0
- package/lib/app/PreviewOverlay.d.ts +14 -0
- package/lib/app/PreviewOverlay.js +22 -0
- package/lib/app/SessionPicker.d.ts +43 -0
- package/lib/app/SessionPicker.js +56 -0
- package/lib/app/SettingsOverlay.d.ts +32 -0
- package/lib/app/SettingsOverlay.js +157 -0
- package/lib/app/SkillsPicker.d.ts +7 -0
- package/lib/app/SkillsPicker.js +19 -0
- package/lib/app/StatusBar.d.ts +22 -0
- package/lib/app/StatusBar.js +272 -0
- package/lib/app/TaskStrips.d.ts +13 -0
- package/lib/app/TaskStrips.js +40 -0
- package/lib/app/ToolCard.d.ts +5 -0
- package/lib/app/ToolCard.js +40 -0
- package/lib/app/TranscriptOverlay.d.ts +12 -0
- package/lib/app/TranscriptOverlay.js +17 -0
- package/lib/app/Welcome.d.ts +6 -0
- package/lib/app/Welcome.js +66 -0
- package/lib/app/attach.d.ts +16 -0
- package/lib/app/attach.js +58 -0
- package/lib/app/click.d.ts +27 -0
- package/lib/app/click.js +89 -0
- package/lib/app/clipboard-image.d.ts +11 -0
- package/lib/app/clipboard-image.js +66 -0
- package/lib/app/cursor.d.ts +4 -0
- package/lib/app/cursor.js +24 -0
- package/lib/app/hello.d.ts +11 -0
- package/lib/app/hello.js +8 -0
- package/lib/app/history-store.d.ts +4 -0
- package/lib/app/history-store.js +41 -0
- package/lib/app/image-blocks.d.ts +12 -0
- package/lib/app/image-blocks.js +125 -0
- package/lib/app/markdown.d.ts +54 -0
- package/lib/app/markdown.js +189 -0
- package/lib/app/settings-model.d.ts +69 -0
- package/lib/app/settings-model.js +114 -0
- package/lib/app/theme.d.ts +166 -0
- package/lib/app/theme.js +141 -0
- package/lib/boot.d.ts +1 -0
- package/lib/boot.js +34 -0
- package/lib/commands.d.ts +49 -0
- package/lib/commands.js +115 -0
- package/lib/contract.d.ts +1973 -0
- package/lib/contract.js +36 -0
- package/lib/core/agent-roles.d.ts +52 -0
- package/lib/core/agent-roles.js +274 -0
- package/lib/core/approval-floor.d.ts +183 -0
- package/lib/core/approval-floor.js +679 -0
- package/lib/core/approval.d.ts +42 -0
- package/lib/core/approval.js +8 -0
- package/lib/core/audit.d.ts +61 -0
- package/lib/core/audit.js +59 -0
- package/lib/core/boot-notices.d.ts +6 -0
- package/lib/core/boot-notices.js +61 -0
- package/lib/core/cdp/actions.d.ts +182 -0
- package/lib/core/cdp/actions.js +649 -0
- package/lib/core/cdp/launch.d.ts +192 -0
- package/lib/core/cdp/launch.js +491 -0
- package/lib/core/cdp/snapshot.d.ts +139 -0
- package/lib/core/cdp/snapshot.js +316 -0
- package/lib/core/cdp/transport.d.ts +160 -0
- package/lib/core/cdp/transport.js +359 -0
- package/lib/core/command-policy.d.ts +108 -0
- package/lib/core/command-policy.js +580 -0
- package/lib/core/commands-completion.d.ts +78 -0
- package/lib/core/commands-completion.js +167 -0
- package/lib/core/compact-anchors.d.ts +76 -0
- package/lib/core/compact-anchors.js +284 -0
- package/lib/core/compact.d.ts +110 -0
- package/lib/core/compact.js +210 -0
- package/lib/core/config-store.d.ts +38 -0
- package/lib/core/config-store.js +307 -0
- package/lib/core/config.d.ts +36 -0
- package/lib/core/config.js +124 -0
- package/lib/core/connection-test.d.ts +60 -0
- package/lib/core/connection-test.js +84 -0
- package/lib/core/desktop-control.d.ts +298 -0
- package/lib/core/desktop-control.js +1311 -0
- package/lib/core/diff-text.d.ts +74 -0
- package/lib/core/diff-text.js +257 -0
- package/lib/core/dock-browser.d.ts +137 -0
- package/lib/core/dock-browser.js +146 -0
- package/lib/core/dock-ops.d.ts +59 -0
- package/lib/core/dock-ops.js +104 -0
- package/lib/core/dock-session.d.ts +39 -0
- package/lib/core/dock-session.js +28 -0
- package/lib/core/dsh-compat/hook.d.ts +18 -0
- package/lib/core/dsh-compat/hook.js +52 -0
- package/lib/core/dsh-compat/resolve-hook.d.ts +5 -0
- package/lib/core/dsh-compat/resolve-hook.js +59 -0
- package/lib/core/dsh-compat/tools-facade.d.ts +47 -0
- package/lib/core/dsh-compat/tools-facade.js +108 -0
- package/lib/core/err-text.d.ts +13 -0
- package/lib/core/err-text.js +15 -0
- package/lib/core/events.d.ts +149 -0
- package/lib/core/events.js +1 -0
- package/lib/core/git-exec.d.ts +23 -0
- package/lib/core/git-exec.js +72 -0
- package/lib/core/git-info.d.ts +47 -0
- package/lib/core/git-info.js +157 -0
- package/lib/core/goal.d.ts +89 -0
- package/lib/core/goal.js +189 -0
- package/lib/core/hooks.d.ts +272 -0
- package/lib/core/hooks.js +818 -0
- package/lib/core/host-browser-link.d.ts +59 -0
- package/lib/core/host-browser-link.js +9 -0
- package/lib/core/host-methods.d.ts +25 -0
- package/lib/core/host-methods.js +103 -0
- package/lib/core/image-diet.d.ts +77 -0
- package/lib/core/image-diet.js +127 -0
- package/lib/core/learnings/ledger.d.ts +73 -0
- package/lib/core/learnings/ledger.js +273 -0
- package/lib/core/learnings/skill-write.d.ts +250 -0
- package/lib/core/learnings/skill-write.js +854 -0
- package/lib/core/learnings/store.d.ts +102 -0
- package/lib/core/learnings/store.js +266 -0
- package/lib/core/lifecycle-hooks.d.ts +189 -0
- package/lib/core/lifecycle-hooks.js +576 -0
- package/lib/core/llm.d.ts +272 -0
- package/lib/core/llm.js +548 -0
- package/lib/core/lockfile.d.ts +17 -0
- package/lib/core/lockfile.js +110 -0
- package/lib/core/loop.d.ts +185 -0
- package/lib/core/loop.js +587 -0
- package/lib/core/lsp/client.d.ts +189 -0
- package/lib/core/lsp/client.js +690 -0
- package/lib/core/lsp/framing.d.ts +84 -0
- package/lib/core/lsp/framing.js +181 -0
- package/lib/core/lsp/line-shift.d.ts +28 -0
- package/lib/core/lsp/line-shift.js +127 -0
- package/lib/core/lsp/manager.d.ts +93 -0
- package/lib/core/lsp/manager.js +418 -0
- package/lib/core/lsp/normalize.d.ts +32 -0
- package/lib/core/lsp/normalize.js +139 -0
- package/lib/core/lsp/servers.d.ts +106 -0
- package/lib/core/lsp/servers.js +352 -0
- package/lib/core/lsp/uri.d.ts +76 -0
- package/lib/core/lsp/uri.js +179 -0
- package/lib/core/market.d.ts +51 -0
- package/lib/core/market.js +358 -0
- package/lib/core/mcp.d.ts +201 -0
- package/lib/core/mcp.js +836 -0
- package/lib/core/memory-eval.d.ts +158 -0
- package/lib/core/memory-eval.js +215 -0
- package/lib/core/memory.d.ts +266 -0
- package/lib/core/memory.js +703 -0
- package/lib/core/mention.d.ts +57 -0
- package/lib/core/mention.js +129 -0
- package/lib/core/microcompact.d.ts +48 -0
- package/lib/core/microcompact.js +79 -0
- package/lib/core/migrate.d.ts +56 -0
- package/lib/core/migrate.js +134 -0
- package/lib/core/model-caps.d.ts +83 -0
- package/lib/core/model-caps.js +150 -0
- package/lib/core/model-discovery.d.ts +19 -0
- package/lib/core/model-discovery.js +69 -0
- package/lib/core/modes.d.ts +72 -0
- package/lib/core/modes.js +152 -0
- package/lib/core/native-bridge.d.ts +135 -0
- package/lib/core/native-bridge.js +563 -0
- package/lib/core/path-policy.d.ts +32 -0
- package/lib/core/path-policy.js +248 -0
- package/lib/core/permission-presets.d.ts +67 -0
- package/lib/core/permission-presets.js +75 -0
- package/lib/core/plugin-loader.d.ts +36 -0
- package/lib/core/plugin-loader.js +294 -0
- package/lib/core/plugin-registry.d.ts +113 -0
- package/lib/core/plugin-registry.js +256 -0
- package/lib/core/prefs.d.ts +82 -0
- package/lib/core/prefs.js +372 -0
- package/lib/core/presets.d.ts +80 -0
- package/lib/core/presets.js +373 -0
- package/lib/core/pricing.d.ts +90 -0
- package/lib/core/pricing.js +126 -0
- package/lib/core/prompt.d.ts +92 -0
- package/lib/core/prompt.js +339 -0
- package/lib/core/ptc.d.ts +66 -0
- package/lib/core/ptc.js +70 -0
- package/lib/core/remote/frames.d.ts +91 -0
- package/lib/core/remote/frames.js +174 -0
- package/lib/core/remote/notify.d.ts +54 -0
- package/lib/core/remote/notify.js +77 -0
- package/lib/core/remote/owner.d.ts +32 -0
- package/lib/core/remote/owner.js +75 -0
- package/lib/core/remote/pairing.d.ts +104 -0
- package/lib/core/remote/pairing.js +261 -0
- package/lib/core/remote/push.d.ts +80 -0
- package/lib/core/remote/push.js +222 -0
- package/lib/core/remote/store.d.ts +18 -0
- package/lib/core/remote/store.js +59 -0
- package/lib/core/remote/tickets.d.ts +20 -0
- package/lib/core/remote/tickets.js +49 -0
- package/lib/core/remote/uploads.d.ts +63 -0
- package/lib/core/remote/uploads.js +161 -0
- package/lib/core/request-attribution.d.ts +26 -0
- package/lib/core/request-attribution.js +86 -0
- package/lib/core/request-invariant.d.ts +61 -0
- package/lib/core/request-invariant.js +199 -0
- package/lib/core/sandbox/backends.d.ts +64 -0
- package/lib/core/sandbox/backends.js +194 -0
- package/lib/core/sandbox/execpolicy.d.ts +93 -0
- package/lib/core/sandbox/execpolicy.js +452 -0
- package/lib/core/sandbox/net-proxy.d.ts +31 -0
- package/lib/core/sandbox/net-proxy.js +162 -0
- package/lib/core/sandbox/policy.d.ts +211 -0
- package/lib/core/sandbox/policy.js +559 -0
- package/lib/core/sandbox/win/abi.d.ts +161 -0
- package/lib/core/sandbox/win/abi.js +169 -0
- package/lib/core/sandbox/win/account.d.ts +71 -0
- package/lib/core/sandbox/win/account.js +206 -0
- package/lib/core/sandbox/win/acl.d.ts +54 -0
- package/lib/core/sandbox/win/acl.js +339 -0
- package/lib/core/sandbox/win/backend.d.ts +61 -0
- package/lib/core/sandbox/win/backend.js +249 -0
- package/lib/core/sandbox/win/doctor.d.ts +24 -0
- package/lib/core/sandbox/win/doctor.js +272 -0
- package/lib/core/sandbox/win/ffi.d.ts +107 -0
- package/lib/core/sandbox/win/ffi.js +166 -0
- package/lib/core/sandbox/win/net-abi.d.ts +154 -0
- package/lib/core/sandbox/win/net-abi.js +316 -0
- package/lib/core/sandbox/win/runner-entry.d.ts +35 -0
- package/lib/core/sandbox/win/runner-entry.js +391 -0
- package/lib/core/sandbox/win/setup.d.ts +60 -0
- package/lib/core/sandbox/win/setup.js +986 -0
- package/lib/core/sandbox/win/token.d.ts +35 -0
- package/lib/core/sandbox/win/token.js +238 -0
- package/lib/core/sandbox/win/wfp.d.ts +41 -0
- package/lib/core/sandbox/win/wfp.js +200 -0
- package/lib/core/sandbox/win/workspace-sid.d.ts +9 -0
- package/lib/core/sandbox/win/workspace-sid.js +45 -0
- package/lib/core/schedule/rule.d.ts +184 -0
- package/lib/core/schedule/rule.js +745 -0
- package/lib/core/schedule/runner.d.ts +185 -0
- package/lib/core/schedule/runner.js +678 -0
- package/lib/core/schedule/store.d.ts +182 -0
- package/lib/core/schedule/store.js +455 -0
- package/lib/core/secrets.d.ts +41 -0
- package/lib/core/secrets.js +150 -0
- package/lib/core/session-export.d.ts +18 -0
- package/lib/core/session-export.js +73 -0
- package/lib/core/session-index.d.ts +159 -0
- package/lib/core/session-index.js +683 -0
- package/lib/core/session-meta.d.ts +41 -0
- package/lib/core/session-meta.js +97 -0
- package/lib/core/session.d.ts +356 -0
- package/lib/core/session.js +998 -0
- package/lib/core/skills.d.ts +60 -0
- package/lib/core/skills.js +171 -0
- package/lib/core/spill.d.ts +159 -0
- package/lib/core/spill.js +329 -0
- package/lib/core/surface-registry.d.ts +45 -0
- package/lib/core/surface-registry.js +67 -0
- package/lib/core/team-board.d.ts +95 -0
- package/lib/core/team-board.js +316 -0
- package/lib/core/throughput.d.ts +46 -0
- package/lib/core/throughput.js +40 -0
- package/lib/core/todo-reminder.d.ts +44 -0
- package/lib/core/todo-reminder.js +55 -0
- package/lib/core/todo.d.ts +81 -0
- package/lib/core/todo.js +222 -0
- package/lib/core/token-estimate.d.ts +55 -0
- package/lib/core/token-estimate.js +82 -0
- package/lib/core/tool-guards.d.ts +103 -0
- package/lib/core/tool-guards.js +77 -0
- package/lib/core/tool-search.d.ts +152 -0
- package/lib/core/tool-search.js +311 -0
- package/lib/core/tools/bash.d.ts +281 -0
- package/lib/core/tools/bash.js +871 -0
- package/lib/core/tools/command-runner.d.ts +84 -0
- package/lib/core/tools/command-runner.js +68 -0
- package/lib/core/tools/fs-tools.d.ts +23 -0
- package/lib/core/tools/fs-tools.js +247 -0
- package/lib/core/tools/index.d.ts +8 -0
- package/lib/core/tools/index.js +4 -0
- package/lib/core/tools/sandbox-args.d.ts +51 -0
- package/lib/core/tools/sandbox-args.js +90 -0
- package/lib/core/tools/search-tools.d.ts +3 -0
- package/lib/core/tools/search-tools.js +153 -0
- package/lib/core/tools.d.ts +96 -0
- package/lib/core/tools.js +53 -0
- package/lib/core/ui-boot-source.d.ts +71 -0
- package/lib/core/ui-boot-source.js +121 -0
- package/lib/core/ui-bundles.d.ts +249 -0
- package/lib/core/ui-bundles.js +830 -0
- package/lib/core/ui-combo.d.ts +49 -0
- package/lib/core/ui-combo.js +55 -0
- package/lib/core/ui-events.d.ts +81 -0
- package/lib/core/ui-events.js +364 -0
- package/lib/core/ui-hmr.d.ts +36 -0
- package/lib/core/ui-hmr.js +128 -0
- package/lib/core/ui-methods.d.ts +69 -0
- package/lib/core/ui-methods.js +341 -0
- package/lib/core/ui-route.d.ts +69 -0
- package/lib/core/ui-route.js +122 -0
- package/lib/core/ui-server.d.ts +75 -0
- package/lib/core/ui-server.js +369 -0
- package/lib/core/ui-trust.d.ts +47 -0
- package/lib/core/ui-trust.js +164 -0
- package/lib/core/untrusted.d.ts +30 -0
- package/lib/core/untrusted.js +48 -0
- package/lib/core/update-check.d.ts +81 -0
- package/lib/core/update-check.js +177 -0
- package/lib/core/usage-log.d.ts +82 -0
- package/lib/core/usage-log.js +306 -0
- package/lib/core/version.d.ts +1 -0
- package/lib/core/version.js +37 -0
- package/lib/core/web-http.d.ts +57 -0
- package/lib/core/web-http.js +137 -0
- package/lib/core/web-static.d.ts +31 -0
- package/lib/core/web-static.js +75 -0
- package/lib/headless.d.ts +1 -0
- package/lib/headless.js +31 -0
- package/lib/host/kernel.d.ts +33 -0
- package/lib/host/kernel.js +451 -0
- package/lib/index.d.ts +41 -0
- package/lib/index.js +35 -0
- package/lib/plugins/agent.d.ts +2 -0
- package/lib/plugins/agent.js +274 -0
- package/lib/plugins/approval-floor.d.ts +2 -0
- package/lib/plugins/approval-floor.js +223 -0
- package/lib/plugins/approval.d.ts +16 -0
- package/lib/plugins/approval.js +674 -0
- package/lib/plugins/ask.d.ts +2 -0
- package/lib/plugins/ask.js +245 -0
- package/lib/plugins/browser.d.ts +68 -0
- package/lib/plugins/browser.js +1341 -0
- package/lib/plugins/commands.d.ts +23 -0
- package/lib/plugins/commands.js +498 -0
- package/lib/plugins/compact.d.ts +21 -0
- package/lib/plugins/compact.js +274 -0
- package/lib/plugins/computer-use.d.ts +47 -0
- package/lib/plugins/computer-use.js +539 -0
- package/lib/plugins/desktop-dock.d.ts +2 -0
- package/lib/plugins/desktop-dock.js +626 -0
- package/lib/plugins/dock-browser.d.ts +34 -0
- package/lib/plugins/dock-browser.js +765 -0
- package/lib/plugins/dsh-compat.d.ts +25 -0
- package/lib/plugins/dsh-compat.js +37 -0
- package/lib/plugins/file-review.d.ts +108 -0
- package/lib/plugins/file-review.js +393 -0
- package/lib/plugins/git.d.ts +26 -0
- package/lib/plugins/git.js +132 -0
- package/lib/plugins/goal.d.ts +20 -0
- package/lib/plugins/goal.js +245 -0
- package/lib/plugins/guards.d.ts +14 -0
- package/lib/plugins/guards.js +18 -0
- package/lib/plugins/hooks.d.ts +19 -0
- package/lib/plugins/hooks.js +583 -0
- package/lib/plugins/host-stdio.d.ts +88 -0
- package/lib/plugins/host-stdio.js +317 -0
- package/lib/plugins/image-diet.d.ts +17 -0
- package/lib/plugins/image-diet.js +85 -0
- package/lib/plugins/lifecycle-hooks.d.ts +26 -0
- package/lib/plugins/lifecycle-hooks.js +338 -0
- package/lib/plugins/llm.d.ts +13 -0
- package/lib/plugins/llm.js +215 -0
- package/lib/plugins/lsp.d.ts +54 -0
- package/lib/plugins/lsp.js +608 -0
- package/lib/plugins/mcp.d.ts +16 -0
- package/lib/plugins/mcp.js +673 -0
- package/lib/plugins/memory.d.ts +17 -0
- package/lib/plugins/memory.js +858 -0
- package/lib/plugins/microcompact.d.ts +18 -0
- package/lib/plugins/microcompact.js +119 -0
- package/lib/plugins/mode.d.ts +18 -0
- package/lib/plugins/mode.js +115 -0
- package/lib/plugins/permission-presets.d.ts +18 -0
- package/lib/plugins/permission-presets.js +135 -0
- package/lib/plugins/plan.d.ts +2 -0
- package/lib/plugins/plan.js +192 -0
- package/lib/plugins/plugin-manager.d.ts +2 -0
- package/lib/plugins/plugin-manager.js +165 -0
- package/lib/plugins/presets.d.ts +2 -0
- package/lib/plugins/presets.js +182 -0
- package/lib/plugins/prompt.d.ts +2 -0
- package/lib/plugins/prompt.js +264 -0
- package/lib/plugins/ptc.d.ts +2 -0
- package/lib/plugins/ptc.js +272 -0
- package/lib/plugins/remote/http.d.ts +11 -0
- package/lib/plugins/remote/http.js +11 -0
- package/lib/plugins/remote/routes.d.ts +24 -0
- package/lib/plugins/remote/routes.js +384 -0
- package/lib/plugins/remote/types.d.ts +135 -0
- package/lib/plugins/remote/types.js +87 -0
- package/lib/plugins/remote.d.ts +17 -0
- package/lib/plugins/remote.js +1028 -0
- package/lib/plugins/runtime-api.d.ts +16 -0
- package/lib/plugins/runtime-api.js +99 -0
- package/lib/plugins/runtime.d.ts +10 -0
- package/lib/plugins/runtime.js +451 -0
- package/lib/plugins/sandbox.d.ts +2 -0
- package/lib/plugins/sandbox.js +761 -0
- package/lib/plugins/schedule.d.ts +26 -0
- package/lib/plugins/schedule.js +538 -0
- package/lib/plugins/self-improve.d.ts +61 -0
- package/lib/plugins/self-improve.js +953 -0
- package/lib/plugins/session-search.d.ts +16 -0
- package/lib/plugins/session-search.js +308 -0
- package/lib/plugins/session-title.d.ts +19 -0
- package/lib/plugins/session-title.js +109 -0
- package/lib/plugins/session.d.ts +7 -0
- package/lib/plugins/session.js +296 -0
- package/lib/plugins/settings.d.ts +3 -0
- package/lib/plugins/settings.js +705 -0
- package/lib/plugins/skills.d.ts +2 -0
- package/lib/plugins/skills.js +360 -0
- package/lib/plugins/spill.d.ts +16 -0
- package/lib/plugins/spill.js +200 -0
- package/lib/plugins/subagent.d.ts +2 -0
- package/lib/plugins/subagent.js +862 -0
- package/lib/plugins/surfaces.d.ts +11 -0
- package/lib/plugins/surfaces.js +20 -0
- package/lib/plugins/team.d.ts +16 -0
- package/lib/plugins/team.js +149 -0
- package/lib/plugins/todo.d.ts +19 -0
- package/lib/plugins/todo.js +188 -0
- package/lib/plugins/tool-search.d.ts +2 -0
- package/lib/plugins/tool-search.js +425 -0
- package/lib/plugins/tools-default.d.ts +12 -0
- package/lib/plugins/tools-default.js +275 -0
- package/lib/plugins/tools.d.ts +16 -0
- package/lib/plugins/tools.js +62 -0
- package/lib/plugins/transcript.d.ts +15 -0
- package/lib/plugins/transcript.js +311 -0
- package/lib/plugins/tui.d.ts +2 -0
- package/lib/plugins/tui.js +98 -0
- package/lib/plugins/waiting.d.ts +12 -0
- package/lib/plugins/waiting.js +34 -0
- package/lib/plugins/web-search.d.ts +14 -0
- package/lib/plugins/web-search.js +263 -0
- package/lib/plugins/webserver.d.ts +48 -0
- package/lib/plugins/webserver.js +228 -0
- package/lib/remote/assets/app-DAcUCOEn.js +14 -0
- package/lib/remote/assets/icon-192.png +0 -0
- package/lib/remote/assets/icon-512.png +0 -0
- package/lib/remote/assets/index.html +34 -0
- package/lib/remote/assets/manifest.json +27 -0
- package/lib/remote/assets/style-DIB6729x.css +1 -0
- package/lib/remote/assets/sw.js +66 -0
- package/lib/services/types.d.ts +1228 -0
- package/lib/services/types.js +1 -0
- package/lib/tools/config-cli.d.ts +1 -0
- package/lib/tools/config-cli.js +89 -0
- package/lib/ui/arrival.d.ts +72 -0
- package/lib/ui/arrival.js +105 -0
- package/lib/ui/assets/app-B70nVIKd.js +69 -0
- package/lib/ui/assets/chunk-2UxHyX5q.js +1 -0
- package/lib/ui/assets/chunk-B1dDrJ26.js +1 -0
- package/lib/ui/assets/chunk-B6aJPvgy.js +1 -0
- package/lib/ui/assets/chunk-BEwlwnbL.js +1 -0
- package/lib/ui/assets/chunk-BGcgwlCI.js +12 -0
- package/lib/ui/assets/chunk-BIGW1oBm.js +1 -0
- package/lib/ui/assets/chunk-BPQ3VLAy.js +1 -0
- package/lib/ui/assets/chunk-BRH0KZbk.js +141 -0
- package/lib/ui/assets/chunk-BX6H_ySx.js +1 -0
- package/lib/ui/assets/chunk-B_P3UbPa.js +1 -0
- package/lib/ui/assets/chunk-B_TYUkTI.js +1 -0
- package/lib/ui/assets/chunk-B_vNuMnf.js +1 -0
- package/lib/ui/assets/chunk-BajyYBss.js +10 -0
- package/lib/ui/assets/chunk-BdnUsdx6.js +1 -0
- package/lib/ui/assets/chunk-Buea-lGh.js +1 -0
- package/lib/ui/assets/chunk-C0PvZCCE.js +1 -0
- package/lib/ui/assets/chunk-C0m74zRD.js +1 -0
- package/lib/ui/assets/chunk-C27-OAKa.js +1 -0
- package/lib/ui/assets/chunk-C2oV4EkX.js +1 -0
- package/lib/ui/assets/chunk-C7zT0LnQ.js +1 -0
- package/lib/ui/assets/chunk-C9GSunVT.js +1 -0
- package/lib/ui/assets/chunk-C9tS-k6U.js +1 -0
- package/lib/ui/assets/chunk-CHLpvVh8.js +1 -0
- package/lib/ui/assets/chunk-CLxacb5B.js +1 -0
- package/lib/ui/assets/chunk-COt5Ahok.js +1 -0
- package/lib/ui/assets/chunk-CPTIWCL2.js +1 -0
- package/lib/ui/assets/chunk-CQLl-L-p.js +1 -0
- package/lib/ui/assets/chunk-CUWRgxuq.js +55 -0
- package/lib/ui/assets/chunk-CWanVSXC.js +1 -0
- package/lib/ui/assets/chunk-Cf5RLm7j.js +1 -0
- package/lib/ui/assets/chunk-CickPsom.js +1 -0
- package/lib/ui/assets/chunk-Cj5Yp3dK.js +1 -0
- package/lib/ui/assets/chunk-Cmh6b_Ma.js +1 -0
- package/lib/ui/assets/chunk-Cp-IABpG.js +1 -0
- package/lib/ui/assets/chunk-CqE71os6.js +1 -0
- package/lib/ui/assets/chunk-CtKP3W-j.js +1 -0
- package/lib/ui/assets/chunk-Cvjx9yec.js +1 -0
- package/lib/ui/assets/chunk-CxGP3dtY.js +1 -0
- package/lib/ui/assets/chunk-CylS5w8V.js +1 -0
- package/lib/ui/assets/chunk-D38fbIBN.js +1 -0
- package/lib/ui/assets/chunk-D97Zzqfu.js +1 -0
- package/lib/ui/assets/chunk-DAi9KRSo.js +1 -0
- package/lib/ui/assets/chunk-DHK4yRfg.js +1 -0
- package/lib/ui/assets/chunk-DJeabLx-.js +1 -0
- package/lib/ui/assets/chunk-DNRxmY5a.js +1 -0
- package/lib/ui/assets/chunk-DNSN1z5r.js +1 -0
- package/lib/ui/assets/chunk-DNasK_ZG.js +1 -0
- package/lib/ui/assets/chunk-DPvrY3IQ.js +1 -0
- package/lib/ui/assets/chunk-DXmwc3jG.js +1 -0
- package/lib/ui/assets/chunk-Dd0kTxKP.js +1 -0
- package/lib/ui/assets/chunk-De0Btta0.js +1 -0
- package/lib/ui/assets/chunk-Des-eS-w.js +1 -0
- package/lib/ui/assets/chunk-Df6bDoY_.js +1 -0
- package/lib/ui/assets/chunk-DijEV5ha.js +1 -0
- package/lib/ui/assets/chunk-DkvoVjww.js +1 -0
- package/lib/ui/assets/chunk-DlC-OlHO.js +1 -0
- package/lib/ui/assets/chunk-DnzrXTVv.js +1 -0
- package/lib/ui/assets/chunk-Dualf0xi.js +1 -0
- package/lib/ui/assets/chunk-EXT84bkm.js +1 -0
- package/lib/ui/assets/chunk-GwR3hkPK.js +1 -0
- package/lib/ui/assets/chunk-P80f7IUj.js +1 -0
- package/lib/ui/assets/chunk-VOosw3JB.js +1 -0
- package/lib/ui/assets/chunk-YQ4lDkt_.js +140 -0
- package/lib/ui/assets/chunk-Yzrsuije.js +1 -0
- package/lib/ui/assets/chunk-Z72CF80r.js +1 -0
- package/lib/ui/assets/chunk-g9-lgVsj.js +1 -0
- package/lib/ui/assets/chunk-vGWfd6FD.js +1 -0
- package/lib/ui/assets/chunk-wDzz0qaB.js +1 -0
- package/lib/ui/assets/chunk-ySF7HWmS.js +1 -0
- package/lib/ui/assets/icon.png +0 -0
- package/lib/ui/assets/index.html +14 -0
- package/lib/ui/assets/pdf.worker.min-CjEcRF4W.mjs +28 -0
- package/lib/ui/assets/style-Bq01xH_b.css +1 -0
- package/lib/ui/frames.d.ts +67 -0
- package/lib/ui/frames.js +146 -0
- package/lib/ui/index.d.ts +59 -0
- package/lib/ui/index.js +50 -0
- package/lib/ui/manifest.d.ts +172 -0
- package/lib/ui/manifest.js +158 -0
- package/lib/ui/plugin.d.ts +161 -0
- package/lib/ui/plugin.js +7 -0
- package/lib/ui/plugins/browser/client.js +290 -0
- package/lib/ui/plugins/browser/icon.png +0 -0
- package/lib/ui/plugins/composer/client.js +1843 -0
- package/lib/ui/plugins/composer/icon.png +0 -0
- package/lib/ui/plugins/files/client.js +646 -0
- package/lib/ui/plugins/files/icon.png +0 -0
- package/lib/ui/plugins/manifest.json +107 -0
- package/lib/ui/plugins/plugins/client.js +682 -0
- package/lib/ui/plugins/plugins/icon.png +0 -0
- package/lib/ui/plugins/preview/client.js +197 -0
- package/lib/ui/plugins/preview/icon.png +0 -0
- package/lib/ui/plugins/prompt/client.js +653 -0
- package/lib/ui/plugins/prompt/icon.png +0 -0
- package/lib/ui/plugins/sessions/client.js +1577 -0
- package/lib/ui/plugins/sessions/icon.png +0 -0
- package/lib/ui/plugins/settings/client.js +5470 -0
- package/lib/ui/plugins/settings/icon.png +0 -0
- package/lib/ui/plugins/skills/client.js +485 -0
- package/lib/ui/plugins/skills/icon.png +0 -0
- package/lib/ui/plugins/status/client.js +1420 -0
- package/lib/ui/plugins/status/icon.png +0 -0
- package/lib/ui/plugins/statusbar/client.js +504 -0
- package/lib/ui/plugins/statusbar/icon.png +0 -0
- package/lib/ui/plugins/tasks/client.js +52 -0
- package/lib/ui/plugins/tasks/icon.png +0 -0
- package/lib/ui/plugins/team/client.js +527 -0
- package/lib/ui/plugins/team/icon.png +0 -0
- package/lib/ui/plugins/terminal/client.js +232 -0
- package/lib/ui/plugins/terminal/icon.png +0 -0
- package/lib/ui/plugins/trace/client.js +1376 -0
- package/lib/ui/plugins/trace/icon.png +0 -0
- package/lib/ui/plugins/transcript/client.js +2661 -0
- package/lib/ui/plugins/transcript/icon.png +0 -0
- package/lib/ui/scoped-slots.d.ts +20 -0
- package/lib/ui/scoped-slots.js +21 -0
- package/lib/ui/sdk/@dsc/ui/index.d.ts +242 -0
- package/lib/ui/sdk/@dsc/ui/package.json +16 -0
- package/lib/ui/sdk/@dsc/ui-core/contract.d.ts +1973 -0
- package/lib/ui/sdk/@dsc/ui-core/core/diff-text.d.ts +74 -0
- package/lib/ui/sdk/@dsc/ui-core/core/dock-browser.d.ts +137 -0
- package/lib/ui/sdk/@dsc/ui-core/core/dock-ops.d.ts +59 -0
- package/lib/ui/sdk/@dsc/ui-core/core/model-caps.d.ts +83 -0
- package/lib/ui/sdk/@dsc/ui-core/core/native-bridge.d.ts +135 -0
- package/lib/ui/sdk/@dsc/ui-core/core/token-estimate.d.ts +55 -0
- package/lib/ui/sdk/@dsc/ui-core/package.json +16 -0
- package/lib/ui/sdk/@dsc/ui-core/ui/arrival.d.ts +72 -0
- package/lib/ui/sdk/@dsc/ui-core/ui/frames.d.ts +67 -0
- package/lib/ui/sdk/@dsc/ui-core/ui/index.d.ts +59 -0
- package/lib/ui/sdk/@dsc/ui-core/ui/manifest.d.ts +172 -0
- package/lib/ui/sdk/@dsc/ui-core/ui/plugin.d.ts +161 -0
- package/lib/ui/sdk/@dsc/ui-core/ui/scoped-slots.d.ts +20 -0
- package/lib/ui/sdk/@dsc/ui-core/ui/services-react.d.ts +27 -0
- package/lib/ui/sdk/@dsc/ui-core/ui/services.d.ts +63 -0
- package/lib/ui/sdk/@dsc/ui-core/ui/slots-react.d.ts +28 -0
- package/lib/ui/sdk/@dsc/ui-core/ui/slots.d.ts +481 -0
- package/lib/ui/sdk/@dsc/ui-core/ui/store.d.ts +89 -0
- package/lib/ui/sdk/@dsc/ui-dockkit/dock-model.d.ts +238 -0
- package/lib/ui/sdk/@dsc/ui-dockkit/dock-state.d.ts +163 -0
- package/lib/ui/sdk/@dsc/ui-dockkit/dock.d.ts +24 -0
- package/lib/ui/sdk/@dsc/ui-dockkit/index.d.ts +15 -0
- package/lib/ui/sdk/@dsc/ui-dockkit/package.json +16 -0
- package/lib/ui/sdk/@dsc/ui-layout/app.d.ts +74 -0
- package/lib/ui/sdk/@dsc/ui-layout/appearance.d.ts +70 -0
- package/lib/ui/sdk/@dsc/ui-layout/host-channel.d.ts +112 -0
- package/lib/ui/sdk/@dsc/ui-layout/index.d.ts +34 -0
- package/lib/ui/sdk/@dsc/ui-layout/package.json +16 -0
- package/lib/ui/sdk/@dsc/ui-layout/page-state.d.ts +14 -0
- package/lib/ui/sdk/@dsc/ui-layout/review-pane.d.ts +21 -0
- package/lib/ui/sdk/@dsc/ui-layout/runtime-context.d.ts +44 -0
- package/lib/ui/sdk/@dsc/ui-layout/thread-view.d.ts +28 -0
- package/lib/ui/sdk/@dsc/ui-layout/update-button.d.ts +21 -0
- package/lib/ui/sdk/@dsc/ui-primitives/code-file-icon-artwork.d.ts +53 -0
- package/lib/ui/sdk/@dsc/ui-primitives/code-view.d.ts +15 -0
- package/lib/ui/sdk/@dsc/ui-primitives/compat.d.ts +27 -0
- package/lib/ui/sdk/@dsc/ui-primitives/completion-sound.d.ts +24 -0
- package/lib/ui/sdk/@dsc/ui-primitives/confirm.d.ts +33 -0
- package/lib/ui/sdk/@dsc/ui-primitives/css.d.ts +47 -0
- package/lib/ui/sdk/@dsc/ui-primitives/diff-rows.d.ts +20 -0
- package/lib/ui/sdk/@dsc/ui-primitives/file-icons.d.ts +38 -0
- package/lib/ui/sdk/@dsc/ui-primitives/file-type-classify.d.ts +66 -0
- package/lib/ui/sdk/@dsc/ui-primitives/file-type-icon.d.ts +57 -0
- package/lib/ui/sdk/@dsc/ui-primitives/highlight.d.ts +24 -0
- package/lib/ui/sdk/@dsc/ui-primitives/hover-delay.d.ts +17 -0
- package/lib/ui/sdk/@dsc/ui-primitives/icons.d.ts +109 -0
- package/lib/ui/sdk/@dsc/ui-primitives/index.d.ts +55 -0
- package/lib/ui/sdk/@dsc/ui-primitives/lang-table.d.ts +10 -0
- package/lib/ui/sdk/@dsc/ui-primitives/markdown.d.ts +20 -0
- package/lib/ui/sdk/@dsc/ui-primitives/native.d.ts +41 -0
- package/lib/ui/sdk/@dsc/ui-primitives/package.json +16 -0
- package/lib/ui/sdk/@dsc/ui-primitives/panels.d.ts +86 -0
- package/lib/ui/sdk/@dsc/ui-primitives/paths.d.ts +11 -0
- package/lib/ui/sdk/@dsc/ui-primitives/pdf-view.d.ts +13 -0
- package/lib/ui/sdk/@dsc/ui-primitives/plugin-text.d.ts +15 -0
- package/lib/ui/sdk/@dsc/ui-primitives/select.d.ts +35 -0
- package/lib/ui/sdk/@dsc/ui-primitives/table-view.d.ts +23 -0
- package/lib/ui/sdk/@dsc/ui-primitives/thread-resizer.d.ts +22 -0
- package/lib/ui/sdk/@dsc/ui-primitives/time.d.ts +33 -0
- package/lib/ui/sdk/@dsc/ui-primitives/toast.d.ts +16 -0
- package/lib/ui/sdk/@dsc/ui-primitives/tokens.d.ts +14 -0
- package/lib/ui/sdk/@dsc/ui-primitives/tool-args.d.ts +49 -0
- package/lib/ui/sdk/@dsc/ui-primitives/tool-summary.d.ts +64 -0
- package/lib/ui/sdk/@dsc/ui-renderer/boot.d.ts +121 -0
- package/lib/ui/sdk/@dsc/ui-renderer/hmr.d.ts +43 -0
- package/lib/ui/sdk/@dsc/ui-renderer/index.d.ts +20 -0
- package/lib/ui/sdk/@dsc/ui-renderer/package.json +16 -0
- package/lib/ui/sdk/@dsc/ui-slots/index.d.ts +19 -0
- package/lib/ui/sdk/@dsc/ui-slots/package.json +16 -0
- package/lib/ui/sdk/@dsc/ui-slots/slots-react.d.ts +48 -0
- package/lib/ui/sdk/@dsc/ui-slots/slots.d.ts +102 -0
- package/lib/ui/services-react.d.ts +27 -0
- package/lib/ui/services-react.js +32 -0
- package/lib/ui/services.d.ts +63 -0
- package/lib/ui/services.js +121 -0
- package/lib/ui/slots-ink.d.ts +26 -0
- package/lib/ui/slots-ink.js +78 -0
- package/lib/ui/slots-react.d.ts +28 -0
- package/lib/ui/slots-react.js +88 -0
- package/lib/ui/slots.d.ts +481 -0
- package/lib/ui/slots.js +550 -0
- package/lib/ui/store.d.ts +89 -0
- package/lib/ui/store.js +62 -0
- package/lib/ui/tui-plugin-api.d.ts +23 -0
- package/lib/ui/tui-plugin-api.js +23 -0
- package/lib/ui/tui-plugins.d.ts +47 -0
- package/lib/ui/tui-plugins.js +220 -0
- package/package.json +58 -6
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 右侧栏(dock)布局的纯模型:页签 / 窗格 / 会话各一份布局,零 React、零 DOM,
|
|
3
|
+
* 行为单测直接跑这份源码(shots/dock-model-check.mjs)。
|
|
4
|
+
*
|
|
5
|
+
* 这一份**从旧渲染层原样搬来**(`desktop/src/renderer/dock-model.ts`)——旧桌面版的
|
|
6
|
+
* 右侧栏就是按下面这套能力面做的,壳里不再发明第二份。持久化键(`dsc.dock.surfaces`)
|
|
7
|
+
* 也是同一个:两个界面共享用户摆好的页签组(与文件预览的 `dsc.diffView` 同款思路)。
|
|
8
|
+
*
|
|
9
|
+
* 能力面(收窄自 dsh 的 ui-sidebar-right + ui-dockkit):
|
|
10
|
+
* - 页签多开:终端与浏览器可无限多开(浏览器一张页签一台原生视图,一台视图一个 id);
|
|
11
|
+
* 文件 / Git 每个布局单例(已开则聚焦);
|
|
12
|
+
* 文件预览页签(preview)按路径去重、每窗格至多 10 张(文件树单击文件的路径);
|
|
13
|
+
* - 「开始」引导页(guide):每个窗格至多一张,是「新标签页」的门面——
|
|
14
|
+
* 入口卡选中后就地替换成那个页面(dsh 的 replaceTab: true);
|
|
15
|
+
* - 分栏:上限两格(dsh 同款),格宽比 fraction 记在布局上;
|
|
16
|
+
* - 每个会话各一份布局(expanded / mode / 页签组),切会话各回各的面板组;
|
|
17
|
+
* - 全屏(盖住顶栏以下)与贴边(推挤正文轨道)两种展示。
|
|
18
|
+
*
|
|
19
|
+
* 不变量(reducer 们共同维护,测试逐条压):
|
|
20
|
+
* - panes 至少一格、至多两格;每格至少一个页签;
|
|
21
|
+
* - 一格至多一张 guide;格内没有 guide 时才画「新标签页」钮;
|
|
22
|
+
* - 关掉激活页签自动聚焦邻位;格被清空自动补一张 guide;
|
|
23
|
+
* - activePaneId / activeTabId 永远指向存在的对象。
|
|
24
|
+
*
|
|
25
|
+
* @module dsc-ui-shell/dock-model
|
|
26
|
+
*/
|
|
27
|
+
export type DockTabKind = 'guide' | 'terminal' | 'browser' | 'files' | 'git' | 'preview'
|
|
28
|
+
/**
|
|
29
|
+
* 补丁页签(一个文件一张,`path` 是它的绝对路径):看某次 write / edit **改了什么**
|
|
30
|
+
* 的 unified diff,与「文件当前内容」(preview)是**两个不同视图**。
|
|
31
|
+
*
|
|
32
|
+
* 为什么单开一种 kind 而不是复用 preview:两者读的是两份数据——preview 读盘上现值
|
|
33
|
+
* (`fs-read`),patch 读那份已经算好的差异快照(hunks,随工具结果来)。同一份文件
|
|
34
|
+
* 可以同时开着「补丁」和「当前内容」两张页签,页签条上分得清。
|
|
35
|
+
*/
|
|
36
|
+
| 'patch'
|
|
37
|
+
/**
|
|
38
|
+
* 子智能体(一个子智能体一张,`path` 是它的会话文件路径)。
|
|
39
|
+
*
|
|
40
|
+
* 为什么单开一种 kind 而不是复用 preview:它渲染的不是文件内容,而是那个子智能体的
|
|
41
|
+
* 运行记录(`peekTranscript` 回的只读条目流),而且点一行子智能体就该把它落到右侧栏
|
|
42
|
+
* ——与 dsh 的 `sidebarRight.openResource(subagentChatAddress(...), {kind:'subagentchat'})`
|
|
43
|
+
* 同一条路(右侧栏是只读的伴读面,不是模态框)。
|
|
44
|
+
*/
|
|
45
|
+
| 'subagent'
|
|
46
|
+
/**
|
|
47
|
+
* 后台活(作业 / 持久终端会话)的**只读输出面**(一个后台活一张,`path` 是 work id)。
|
|
48
|
+
*
|
|
49
|
+
* 与 `subagent` 同一条理由单开一种 kind:状态面板「终端」区点一行要看的是那个后台活
|
|
50
|
+
* 的输出(走 `readBackground` 的只读快照,**不是**交互式终端 `terminal` 那条可写通道),
|
|
51
|
+
* 与「用户自己开的 shell」是两套东西。渲染成等宽 `<pre>`(不引 xterm),按秒轮询快照。
|
|
52
|
+
*
|
|
53
|
+
* 对照参考实现:后台活详情是一块独立的只读文本侧栏(`BackgroundBashOutputSidePane`),
|
|
54
|
+
* 不走交互终端的可写通道——右侧栏是只读的伴读面,与 `subagent` 同一落点。
|
|
55
|
+
*/
|
|
56
|
+
| 'work-output';
|
|
57
|
+
/** 一张页签:id 是毫秒 + 随机尾巴,进程内唯一即可(持久化恢复后也不与现存冲突)。 */
|
|
58
|
+
export interface DockTab {
|
|
59
|
+
id: string;
|
|
60
|
+
kind: DockTabKind;
|
|
61
|
+
/** preview / patch = 那个文件的绝对路径;subagent = 那个子智能体的会话文件路径;work-output = 后台活 id(job-N / term-N);browser = 这一页正在看的地址(重开这张页签回到它)。 */
|
|
62
|
+
path?: string;
|
|
63
|
+
/**
|
|
64
|
+
* chip 上显示的标题(可缺)。
|
|
65
|
+
*
|
|
66
|
+
* 为什么要有它:子智能体的会话文件名是 uuid(`e8888…-….jsonl`),拿文件名当页签标题
|
|
67
|
+
* 等于给用户一列看不懂的哈希;而它的**名字**(`reader-1`)只有开页签的那一方知道
|
|
68
|
+
* (名册在 subagent 插件里)。所以标题由调用方一并交过来,壳只负责显示。
|
|
69
|
+
* work-output 同样用它显示后台活的标题(作业首行 / 终端最近一条命令)。
|
|
70
|
+
*/
|
|
71
|
+
label?: string;
|
|
72
|
+
/** 仅 preview 页签:打开时定位到的 1-based 行号(/review findings 的行号跳转用)。 */
|
|
73
|
+
line?: number;
|
|
74
|
+
}
|
|
75
|
+
/** 一个窗格:一排页签 + 当前激活的那张。 */
|
|
76
|
+
export interface DockPane {
|
|
77
|
+
id: string;
|
|
78
|
+
tabs: DockTab[];
|
|
79
|
+
activeTabId: string;
|
|
80
|
+
}
|
|
81
|
+
/** 一个会话的右侧栏布局。 */
|
|
82
|
+
export interface DockSurface {
|
|
83
|
+
panes: DockPane[];
|
|
84
|
+
activePaneId: string;
|
|
85
|
+
/** 分栏时左格占的宽度比(0.2–0.8);单格时无意义。 */
|
|
86
|
+
fraction: number;
|
|
87
|
+
expanded: boolean;
|
|
88
|
+
mode: 'push' | 'fullscreen';
|
|
89
|
+
}
|
|
90
|
+
/** 每个会话一份布局(持久化的键就是会话 id)。 */
|
|
91
|
+
export type DockSurfaces = Record<string, DockSurface>;
|
|
92
|
+
/**
|
|
93
|
+
* Dock 组件的动作面:App 用 dock-model 的 reducer 实现,Dock 只管调。
|
|
94
|
+
* 全部收口成回调,dock-model 本身不碰 React。
|
|
95
|
+
*/
|
|
96
|
+
export interface DockActions {
|
|
97
|
+
/** 开一张页签(`replaceGuide` = 开始页入口卡的就地替换路径)。 */
|
|
98
|
+
openTab(kind: DockTabKind, options?: {
|
|
99
|
+
replaceGuide?: boolean;
|
|
100
|
+
}): void;
|
|
101
|
+
/** 开一张文件预览页签(同路径去重 = 聚焦;对齐 dsh 的 openResource);line = 定位行号。 */
|
|
102
|
+
openPreview(path: string, line?: number): void;
|
|
103
|
+
/**
|
|
104
|
+
* 开一张浏览器页签(**可多开**:2026-10 起浏览器不再是单例)。
|
|
105
|
+
* `url` = 开的时候直接进的地址,不给就是空态;`label` = chip 上的标题。
|
|
106
|
+
* `id` = 指定页签 id(= 原生视图 id);给了就用它,同 id 已存在只聚焦不新建。
|
|
107
|
+
* 只有「桌面侧指名一台视图」那条路会传(agent 开页签),用户自己点开的一律不给。
|
|
108
|
+
*/
|
|
109
|
+
openBrowserTab(url?: string, label?: string, id?: string): void;
|
|
110
|
+
/** 回填一张页签的标题 / 地址(浏览器页签用:网页标题进 chip、当前地址存回页签)。 */
|
|
111
|
+
setTabInfo(tabId: string, patch: {
|
|
112
|
+
label?: string;
|
|
113
|
+
path?: string;
|
|
114
|
+
}): void;
|
|
115
|
+
/** 开一张补丁页签(同路径去重 = 聚焦):看那个文件某次 write / edit 改了什么。 */
|
|
116
|
+
openPatch(path: string): void;
|
|
117
|
+
/** 开一张子智能体页签(同会话文件去重 = 聚焦);label = chip 上显示的队友名。 */
|
|
118
|
+
openSubagent(path: string, label?: string): void;
|
|
119
|
+
/** 开一张后台活输出页签(同 work id 去重 = 聚焦);label = chip 上显示的后台活标题。 */
|
|
120
|
+
openWorkOutput(id: string, label?: string): void;
|
|
121
|
+
closeTab(tabId: string): void;
|
|
122
|
+
focusTab(tabId: string): void;
|
|
123
|
+
focusPane(paneId: string): void;
|
|
124
|
+
splitPane(paneId: string): void;
|
|
125
|
+
/** 收回分栏(右格并回左格)。 */
|
|
126
|
+
unsplit(): void;
|
|
127
|
+
/** 拖拽搬页签:落到目标窗格的末尾。 */
|
|
128
|
+
placeTab(tabId: string, paneId: string): void;
|
|
129
|
+
setExpanded(expanded: boolean): void;
|
|
130
|
+
toggleMode(): void;
|
|
131
|
+
setFraction(fraction: number): void;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* 造一张指定种类的页签(preview 页签带文件路径)。
|
|
135
|
+
*
|
|
136
|
+
* `id` 只在**调用方要指名这张页签**时给——现在只有浏览器页签走这条路(见
|
|
137
|
+
* {@link openBrowserTab}):桌面主进程按 id 指认它要驱动的那台原生视图。
|
|
138
|
+
* 不给就自己发号(绝大多数调用点都是这样)。
|
|
139
|
+
*/
|
|
140
|
+
export declare function makeTab(kind: DockTabKind, path?: string, id?: string): DockTab;
|
|
141
|
+
/** 默认布局:一格、只有一张「开始」。新会话第一次打开右侧栏就是它。 */
|
|
142
|
+
export declare function defaultSurface(): DockSurface;
|
|
143
|
+
/** 布局里的一个窗格(找不到返回 undefined:调用方按不变量处理,这里不抛)。 */
|
|
144
|
+
export declare function paneOf(surface: DockSurface, paneId: string): DockPane | undefined;
|
|
145
|
+
/** 当前激活窗格。 */
|
|
146
|
+
export declare function activePane(surface: DockSurface): DockPane;
|
|
147
|
+
/** 某窗格现在能不能加「新标签页」(对齐 dsh:格内已有 guide 就不画加号)。 */
|
|
148
|
+
export declare function canAddTab(pane: DockPane): boolean;
|
|
149
|
+
/**
|
|
150
|
+
* 开一张页签。`paneId` 缺省 = 激活窗格;`replaceGuide` = 就地替换该窗格里的
|
|
151
|
+
* guide(开始页入口卡的路径)。返回新 surface;无可替换的 guide 时原样返回。
|
|
152
|
+
*/
|
|
153
|
+
export declare function openTab(surface: DockSurface, kind: DockTabKind, options?: {
|
|
154
|
+
paneId?: string;
|
|
155
|
+
replaceGuide?: boolean;
|
|
156
|
+
}): DockSurface;
|
|
157
|
+
/**
|
|
158
|
+
* 开一张文件预览页签(对齐 dsh 的 openResource → file: 页签):同一份文件
|
|
159
|
+
* (按绝对路径认)在哪个窗格都只有一张,已开即聚焦(带上新的定位行号);
|
|
160
|
+
* 新开的追加到激活窗格末尾;该窗格预览页签到上限时关掉最旧的一张,给新的让位。
|
|
161
|
+
*/
|
|
162
|
+
export declare function openPreview(surface: DockSurface, path: string, line?: number): DockSurface;
|
|
163
|
+
/**
|
|
164
|
+
* 开一张补丁页签(照 {@link openPreview} 的形状):同一个文件(按绝对路径认)只有一张,
|
|
165
|
+
* 已开即聚焦;新开的追加到激活窗格末尾,不设上限。页签不认识补丁内容——那份差异快照
|
|
166
|
+
* 存在壳的补丁源表里(见 dock-state 的 setDockPreview),这里只登记「哪个文件」。
|
|
167
|
+
*/
|
|
168
|
+
export declare function openPatch(surface: DockSurface, path: string): DockSurface;
|
|
169
|
+
/**
|
|
170
|
+
* 开一张子智能体页签(照 {@link openPreview} 的形状):同一个子智能体(按会话文件认)
|
|
171
|
+
* 只有一张,已开即聚焦;新开的追加到激活窗格末尾,不设上限——右侧栏同时盯着几个队友
|
|
172
|
+
* 是正常用法,而且它们各自只读、不吃内存里的大对象。
|
|
173
|
+
*/
|
|
174
|
+
export declare function openSubagent(surface: DockSurface, path: string, label?: string): DockSurface;
|
|
175
|
+
/**
|
|
176
|
+
* 开一张后台活输出页签(照 {@link openSubagent} 的形状):同一个后台活(按 work id 认)
|
|
177
|
+
* 只有一张,已开即聚焦;新开的追加到激活窗格末尾,不设上限(同时盯几个后台活是正常用法,
|
|
178
|
+
* 每个只读、按秒轮询,不吃内存里的大对象)。
|
|
179
|
+
*/
|
|
180
|
+
export declare function openWorkOutput(surface: DockSurface, id: string, label?: string): DockSurface;
|
|
181
|
+
/**
|
|
182
|
+
* 开一张浏览器页签(**可多开**,对齐 dsh:浏览器的页签条就是右侧栏的页签条)。
|
|
183
|
+
*
|
|
184
|
+
* 为什么解除单例:dsh 那张截图里的「浏览器 × / +」就是右侧栏的页签条本身,一张页签
|
|
185
|
+
* 一台原生视图;dsc 的页签条 / 分栏 / 拖拽 / 右键菜单已经现成,跟着解除单例即可,
|
|
186
|
+
* 不必在面板内部再造一条 Chrome 式页签条。同一个地址开两张**不去重**——对照两个版本的
|
|
187
|
+
* 同一份文档是正常用法。
|
|
188
|
+
*
|
|
189
|
+
* @param url 开的时候直接进的地址;不给就是空态(新页签不自动加载任何页面)
|
|
190
|
+
* @param label chip 上的标题;通常留空,由页面标题回填(见 {@link setTabInfo})
|
|
191
|
+
* @param id 指定页签 id;不给就自己发号。见下面「为什么 id 要能由调用方指定」
|
|
192
|
+
*/
|
|
193
|
+
export declare function openBrowserTab(surface: DockSurface, url?: string, label?: string, id?: string): DockSurface;
|
|
194
|
+
/**
|
|
195
|
+
* 回填一张页签的标题与地址(浏览器页签用)。
|
|
196
|
+
*
|
|
197
|
+
* 为什么要有它:多开之后 chip 上全写「浏览器」就分不清谁是谁;「重开那张页签回到那个
|
|
198
|
+
* 页面」也只能靠把地址存回页签(布局是每会话落盘的)。同值不产生新对象——否则网页
|
|
199
|
+
* 每报一次标题 / 地址就会写一遍 localStorage。
|
|
200
|
+
*/
|
|
201
|
+
export declare function setTabInfo(surface: DockSurface, tabId: string, patch: {
|
|
202
|
+
label?: string;
|
|
203
|
+
path?: string;
|
|
204
|
+
}): DockSurface;
|
|
205
|
+
/**
|
|
206
|
+
* 关一张页签。格被清空自动补一张 guide;只剩一格时格不会消失(对齐 dsh:
|
|
207
|
+
* 关的是内容,栏架子和「开始」门面永远在)。
|
|
208
|
+
*/
|
|
209
|
+
export declare function closeTab(surface: DockSurface, tabId: string): DockSurface;
|
|
210
|
+
/** 聚焦一张页签(顺带把它所在的窗格设为激活)。 */
|
|
211
|
+
export declare function focusTab(surface: DockSurface, tabId: string): DockSurface;
|
|
212
|
+
/** 聚焦一个窗格。 */
|
|
213
|
+
export declare function focusPane(surface: DockSurface, paneId: string): DockSurface;
|
|
214
|
+
/**
|
|
215
|
+
* 把激活窗格一分为二(右侧新格),激活页签跟着过去。上限两格(dsh 同款);
|
|
216
|
+
* 已经两格或激活页签是格内唯一内容且是 guide 时不动(空门面不值得分)。
|
|
217
|
+
*/
|
|
218
|
+
export declare function splitPane(surface: DockSurface, paneId?: string): DockSurface;
|
|
219
|
+
/** 收回分栏:右格的页签全部并回左格,回到单格;左格已有 guide 时右格的 guide 让路(格内至多一张)。 */
|
|
220
|
+
export declare function unsplitPane(surface: DockSurface): DockSurface;
|
|
221
|
+
/**
|
|
222
|
+
* 拖拽搬页签:把一张页签挪到目标窗格的 `index` 位置(缺省 = 末尾)。
|
|
223
|
+
* 源格因此清空时自动补 guide;跨格搬单例页签永远允许(格内单例由 openTab 保证,
|
|
224
|
+
* 这里搬的是已存在的张)。
|
|
225
|
+
*/
|
|
226
|
+
export declare function placeTab(surface: DockSurface, tabId: string, toPaneId: string, index?: number): DockSurface;
|
|
227
|
+
/** 开合右侧栏(每会话各自记忆,对齐 dsh 的 expanded 在 surface 上)。 */
|
|
228
|
+
export declare function setExpanded(surface: DockSurface, expanded: boolean): DockSurface;
|
|
229
|
+
/** 贴边 ⇄ 全屏。 */
|
|
230
|
+
export declare function toggleMode(surface: DockSurface): DockSurface;
|
|
231
|
+
/** 调分栏宽比(拖拽条),夹到 0.2–0.8。 */
|
|
232
|
+
export declare function setFraction(surface: DockSurface, fraction: number): DockSurface;
|
|
233
|
+
/**
|
|
234
|
+
* 读存档。存坏了 / 认不出的会话直接丢(该会话回默认布局),绝不因存档把启动带崩。
|
|
235
|
+
*/
|
|
236
|
+
export declare function loadSurfaces(): DockSurfaces;
|
|
237
|
+
/** 落盘;超出上限的旧会话布局按「键序先后」丢最前的(插入序即使用序的老新)。 */
|
|
238
|
+
export declare function saveSurfaces(surfaces: DockSurfaces): void;
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 右侧栏(dock)的布局真源:**每个会话一份页签布局**,剪贴在这份模块状态里。
|
|
3
|
+
*
|
|
4
|
+
* 与旧桌面版同构(布局算法在 `./dock-model`,这一份是它的 React 接线):
|
|
5
|
+
* - 会话切换时整份布局跟着换(`setDockSession`,壳从宿主快照的 sessionId 调);
|
|
6
|
+
* - 任何变更**顺手落盘**(localStorage `dsc.dock.surfaces`,键与旧界面共用——
|
|
7
|
+
* 两个界面切来切去时页签组不会各摆各的);
|
|
8
|
+
* - 展示态(展开 / 全屏 / 分栏比)也在布局里,所以「切回会话,面板组还是那一套」。
|
|
9
|
+
*
|
|
10
|
+
* ## 页签内容从哪来
|
|
11
|
+
*
|
|
12
|
+
* 布局只管「有哪些页签」(kind + 可选 path),**每种 kind 长什么样**由插件经
|
|
13
|
+
* {@link registerDockTab} 报名:图标 / 标题 / 渲染组件 / 是否 keepMounted。
|
|
14
|
+
* 这与旧桌面版的内置页面表同构,但壳里内容归插件(终端、文件、预览各是各的),
|
|
15
|
+
* 「开始」页与浏览器是壳自己的两个内置 kind。
|
|
16
|
+
*
|
|
17
|
+
* ## 为什么不用 React context
|
|
18
|
+
*
|
|
19
|
+
* 槽条目的渲染树与壳的 App 不在同一条 props 链上(插件是壳按启动图动态装上去的),
|
|
20
|
+
* 而这一份状态本来就与渲染树无关——订阅式单例最贴合。
|
|
21
|
+
*
|
|
22
|
+
* @module dsc-ui-shell/dock-state
|
|
23
|
+
*/
|
|
24
|
+
import { type ComponentType, type ReactNode } from 'react';
|
|
25
|
+
import type { ChangedFileView } from '@dsc/ui-core';
|
|
26
|
+
import { type DockActions, type DockSurface, type DockTab, type DockTabKind } from './dock-model';
|
|
27
|
+
export type { DockActions, DockPane, DockSurface, DockTab, DockTabKind } from './dock-model';
|
|
28
|
+
/**
|
|
29
|
+
* 切到某个会话的布局(壳从宿主快照的 sessionId 调;没会话时传空串)。
|
|
30
|
+
*
|
|
31
|
+
* 切走的会话布局留在 {@link surfaces} 与 localStorage 里——切回来还是那一套页签。
|
|
32
|
+
*/
|
|
33
|
+
export declare function setDockSession(id: string): void;
|
|
34
|
+
/** 订阅布局变化(`useSyncExternalStore` 的订阅函数)。 */
|
|
35
|
+
export declare function subscribeDock(listener: () => void): () => void;
|
|
36
|
+
/** 当前会话的布局(`useSyncExternalStore` 的取数函数;引用稳定,变更才换)。 */
|
|
37
|
+
export declare function dockSurface(): DockSurface;
|
|
38
|
+
/**
|
|
39
|
+
* 布局动作表(旧桌面版 App 里的同一套接线:开预览顺手展开侧栏)。
|
|
40
|
+
*
|
|
41
|
+
* 做常量而不是工厂:动作全是 `mutate` 的薄包装,没有闭包状态,引用天然稳定。
|
|
42
|
+
*/
|
|
43
|
+
export declare const dockActions: DockActions;
|
|
44
|
+
/** 展开右侧栏并就地替换「开始」页(开始页入口卡与快捷键的路径,旧界面同款)。 */
|
|
45
|
+
export declare function openDockTab(kind: DockTabKind): void;
|
|
46
|
+
/**
|
|
47
|
+
* 展开右侧栏并**开一张新的浏览器页签**(Ctrl+T、页面自己 `window.open` 都走它)。
|
|
48
|
+
*
|
|
49
|
+
* 为什么要单独一个入口而不是让调用方拼 `openTab('browser')`:浏览器可多开之后,
|
|
50
|
+
* 「新开一张」与「就地替换开始页」是两种语义(后者是门面入口卡的路径)。插件只说
|
|
51
|
+
* 「开一张浏览器页签」,页签类型与「顺手展开」这两条策略归布局这一层——
|
|
52
|
+
* 与 {@link setDockPreview} 同一性质。
|
|
53
|
+
*
|
|
54
|
+
* @param url 直接进的地址;不给就是空态页签
|
|
55
|
+
* @param viewId 指定页签 id(= 原生视图 id);只有「桌面侧指名一台视图」那条路会传。
|
|
56
|
+
* 为什么要能指定:浏览器页签的原生视图 id 就是 `tab.id`,而 agent 那条链路上,
|
|
57
|
+
* 桌面主进程是按宿主台账里的 viewId 指认它要开/要驱动的那台视图的——这个 id 得由
|
|
58
|
+
* **桌面侧发号、壳照用**,不能由壳自己发号(那样两边对不上号)。不给就照旧自己发。
|
|
59
|
+
*/
|
|
60
|
+
export declare function openDockBrowserTab(url?: string, viewId?: string): void;
|
|
61
|
+
/** 页签体的 props:布局对象 + 这一张现在的可见性。 */
|
|
62
|
+
export interface DockTabBodyProps {
|
|
63
|
+
/** 这张页签(preview 用 tab.path / tab.line)。 */
|
|
64
|
+
tab: DockTab;
|
|
65
|
+
/** 这一张是不是它窗格的激活页签。 */
|
|
66
|
+
active: boolean;
|
|
67
|
+
/** dock 整块展开着没有(收起 = 滑出右缘;keepMounted 的终端这时仍活着)。 */
|
|
68
|
+
expanded: boolean;
|
|
69
|
+
}
|
|
70
|
+
/** 一种页签的界面(插件经 {@link registerDockTab} 报名)。 */
|
|
71
|
+
export interface DockTabKindMeta {
|
|
72
|
+
kind: DockTabKind;
|
|
73
|
+
/** chip 上的短标题(preview 不用——标题取文件名)。 */
|
|
74
|
+
label: string;
|
|
75
|
+
/** chip 上的小图标。 */
|
|
76
|
+
icon?: ReactNode;
|
|
77
|
+
/** 内容组件。 */
|
|
78
|
+
component: ComponentType<DockTabBodyProps>;
|
|
79
|
+
/**
|
|
80
|
+
* 切走只藏不卸(终端的进程与输出活着)。
|
|
81
|
+
* 为假时只在「激活且展开」挂载——重挂无副作用的页面(文件 / Git / 预览)省一份常驻监听。
|
|
82
|
+
*/
|
|
83
|
+
keepMounted?: boolean;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* 报名一种页签的界面(插件 `apply` 里调一次)。
|
|
87
|
+
*
|
|
88
|
+
* 返回撤销函数;重复 kind 覆盖——同一个插件重装时不该在注册表里留下两份。
|
|
89
|
+
*/
|
|
90
|
+
export declare function registerDockTab(meta: DockTabKindMeta): () => void;
|
|
91
|
+
/** 已报名的页签界面(壳的页签条与页签体都按它画)。 */
|
|
92
|
+
export declare function dockTabKinds(): readonly DockTabKindMeta[];
|
|
93
|
+
/** 某种 kind 的界面(没报名给 undefined——页签体画占位)。 */
|
|
94
|
+
export declare function dockTabMeta(kind: DockTabKind): DockTabKindMeta | undefined;
|
|
95
|
+
/**
|
|
96
|
+
* 打开一张文件预览页签(文件树点一个文件、改动卡点「打开」都走它)。
|
|
97
|
+
*
|
|
98
|
+
* `cwd` 保留在签名里只是为了调用方少改(旧面板时代的交接结构),打开页签只需要路径——
|
|
99
|
+
* 页面显示用的相对路径由预览组件自己按当前会话 cwd 裁。
|
|
100
|
+
*
|
|
101
|
+
* 带上 `patch`(write / edit 工具卡点文件名那条路)就开**补丁页签**、并把这份「改了什么」
|
|
102
|
+
* 的差异快照存进 {@link patchSources},与「文件当前内容」(preview)分开成两个视图。
|
|
103
|
+
* 单一入口(对齐参考实现的 onOpenCodeViewer(source)):调用方只说「开这个文件的这种源」,
|
|
104
|
+
* 是内容还是补丁由带没带 patch 决定,页签 kind 由壳挑。
|
|
105
|
+
*/
|
|
106
|
+
export declare function setDockPreview(target: {
|
|
107
|
+
path: string;
|
|
108
|
+
cwd?: string;
|
|
109
|
+
patch?: ChangedFileView;
|
|
110
|
+
}): void;
|
|
111
|
+
/**
|
|
112
|
+
* 读某个文件的补丁源(补丁页签体用);没开过补丁、或重启后失效就是 null。
|
|
113
|
+
*
|
|
114
|
+
* 与布局订阅同一条通道:setDockPreview 存进来源表后 notify,页签体据此重渲染。
|
|
115
|
+
*/
|
|
116
|
+
export declare function useDockPatchSource(path: string): ChangedFileView | null;
|
|
117
|
+
/**
|
|
118
|
+
* 打开一张子智能体页签(那一条队友消息里的「在右侧栏看运行记录」、状态面板点一行都走它)。
|
|
119
|
+
*
|
|
120
|
+
* 为什么与 {@link setDockPreview} 并排放在这里而不是塞进 `dockActions`:动作面
|
|
121
|
+
* (`DockActions`)是「Dock 组件自己会调的那些」,而这是一个**插件发起的目标式请求**
|
|
122
|
+
* (给一个子智能体、把右侧栏开到它上面),与预览同一性质——壳是布局真源,插件只说意图。
|
|
123
|
+
*/
|
|
124
|
+
export declare function setDockSubagent(target: {
|
|
125
|
+
path: string;
|
|
126
|
+
label?: string;
|
|
127
|
+
}): void;
|
|
128
|
+
/**
|
|
129
|
+
* 打开一张后台活输出页签(状态面板「终端」区点一行走它)。
|
|
130
|
+
*
|
|
131
|
+
* 与 {@link setDockSubagent} 同一性质:插件发起的目标式请求(给一个后台活 id、把右侧栏
|
|
132
|
+
* 开到它的只读输出面上),壳是布局真源,插件只说意图。`id` 是 job-N / term-N。
|
|
133
|
+
*/
|
|
134
|
+
export declare function setDockWorkOutput(target: {
|
|
135
|
+
id: string;
|
|
136
|
+
label?: string;
|
|
137
|
+
}): void;
|
|
138
|
+
/**
|
|
139
|
+
* 审查目标:轮尾「文件已更改」卡的「审查」把**那一轮的文件清单**交给并排审查面板。
|
|
140
|
+
*
|
|
141
|
+
* 为什么带 index:卡上点的是第几个文件,面板打开就该定位到第几个——
|
|
142
|
+
* 旧界面的并排审查栏是同一个语义(onReview(files, index))。
|
|
143
|
+
*/
|
|
144
|
+
export interface DockReview {
|
|
145
|
+
files: ChangedFileView[];
|
|
146
|
+
index: number;
|
|
147
|
+
cwd: string;
|
|
148
|
+
}
|
|
149
|
+
/** 现在要审查哪一轮的哪些文件;没点过是 null。 */
|
|
150
|
+
export declare function dockReview(): DockReview | null;
|
|
151
|
+
/** 交接审查目标(卡上点「审查」时调;并排面板读它画)。 */
|
|
152
|
+
export declare function setDockReview(next: DockReview | null): void;
|
|
153
|
+
/** 当前会话的布局(组件里读它画页签条与页签体)。 */
|
|
154
|
+
export declare function useDockSurface(): DockSurface;
|
|
155
|
+
/** 现在要审查哪一轮的哪些文件(并排面板读它;没点过是 null)。 */
|
|
156
|
+
export declare function useDockReview(): DockReview | null;
|
|
157
|
+
/**
|
|
158
|
+
* 当前激活的预览页签路径(文件树拿它给正在预览的那一行点亮)。
|
|
159
|
+
*
|
|
160
|
+
* 从布局里推,而不是另存一份「预览目标」——目标就是那张活着的页签,
|
|
161
|
+
* 关掉页签、切走激活页签,高亮跟着消失,不会留下幽灵状态。
|
|
162
|
+
*/
|
|
163
|
+
export declare function useActivePreviewPath(): string | null;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 右侧栏(dock):多页签面板的渲染层——**从旧桌面版 `Dock.tsx` 搬来**,
|
|
3
|
+
* 布局算法在 `./dock-model`,状态在 `./dock-state`,这一份只管画。
|
|
4
|
+
*
|
|
5
|
+
* 结构(与旧桌面版逐块同构):
|
|
6
|
+
* - 页签条:chip(图标 + 标题)可点击聚焦、中键关闭、右键菜单(关闭 / 向右分栏 /
|
|
7
|
+
* 收回分栏)、可拖拽跨窗格;条尾是 chrome 两钮——全屏切换与收起;
|
|
8
|
+
* 格内没有「开始」页时画 `+` 钮(就地开/聚焦一张 guide)。
|
|
9
|
+
* - 「开始」页(guide):罗盘 + 入口卡,选中一项就地替换成那个页面——它是门面,
|
|
10
|
+
* 不是常驻内容。
|
|
11
|
+
* - 页面体挂载规则:报名了 `keepMounted` 的 kind(终端)切页签/窗格只藏不卸,
|
|
12
|
+
* 进程与输出存活;其余 kind 只在激活且展开时挂载。
|
|
13
|
+
* - 展示:贴边(占正文轨道)与全屏(盖住顶栏以下、保留轨道宽度)两种,窄视口
|
|
14
|
+
* (<768px,对齐旧桌面版)自动全屏;收起是整块滑出右缘,不卸载内容。
|
|
15
|
+
*
|
|
16
|
+
* @module dsc-ui-shell/dock
|
|
17
|
+
*/
|
|
18
|
+
import { type JSX } from 'react';
|
|
19
|
+
/** 右侧栏组件:贴边/全屏两种展示,收起时整块滑出右缘(内容不卸载)。 */
|
|
20
|
+
export declare function Dock(props: {
|
|
21
|
+
/** 贴边模式的宽度(px);拖拽调宽、双击复位由壳负责存档。 */
|
|
22
|
+
width: number;
|
|
23
|
+
onResize(width: number): void;
|
|
24
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@dsc/ui-dockkit`:右侧栏(dock)那一套——分栏模型、会话级状态与画法。
|
|
3
|
+
*
|
|
4
|
+
* 与 dsh 的 `ui-dockkit` 同位,包内也照它的两层切:`dock-model`(纯数据 + 纯函数,
|
|
5
|
+
* 无 React)在底,`dock-state`(模块级订阅状态 + 插件登记面)在中,`dock`(React 画法)在上。
|
|
6
|
+
*
|
|
7
|
+
* 分层纪律(由 `scripts/ui-plugin-test.mjs` 的 [5b] 钉住):本包只许往下——
|
|
8
|
+
* 依赖 `@dsc/ui-primitives`(图标 / 文件图标)与 `@dsc/ui-core`;不许 import
|
|
9
|
+
* `@dsc/ui-layout`(布局在其上),也不许 import `@dsc/ui`(聚合面,反向会成环)。
|
|
10
|
+
*
|
|
11
|
+
* @module dsc-ui-shell/ui-dockkit
|
|
12
|
+
*/
|
|
13
|
+
export * from './dock-model';
|
|
14
|
+
export * from './dock-state';
|
|
15
|
+
export * from './dock';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dsc/ui-dockkit",
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"description": "界面壳右侧栏的工具包(分栏模型 + 会话级状态 + React 画法):只依赖基元库,不许反向。",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"types": "./index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./index.d.ts"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"**/*.d.ts"
|
|
15
|
+
]
|
|
16
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 界面壳的应用骨架:侧栏 + 主区(顶栏 / 消息流 / 输入区 / 状态栏)+ 诊断区。
|
|
3
|
+
*
|
|
4
|
+
* **这一层的 class 名与嵌套是照旧桌面界面 `App.tsx` 写的**,所以壳自己一行样式都不用写:
|
|
5
|
+
* `.app`(flex 行)→ `.sidebar` + `.main`(flex 列)→ `.topbar` / `.thread-zone` /
|
|
6
|
+
* `.statusbar` 全部吃 `legacy/views.css` 里现成的规则。壳新增的东西(诊断面板、宿主
|
|
7
|
+
* 异常条、数据通道状态)写在 `styles.css` 里,与旧界面那套一眼能分开。
|
|
8
|
+
*
|
|
9
|
+
* 为什么槽条目要做成 `display:contents`(见 `styles.css`):旧界面的布局规则全是按
|
|
10
|
+
* **直接子节点**写的——侧栏是 flex 列、聊天区是 flex 列、输入区靠 `.composer-zone > *`
|
|
11
|
+
* 定宽。壳为了给每个条目套错误边界必须多包一层 div,那一层会把上面这些规则全部挡掉。
|
|
12
|
+
* `display:contents` 让这一层不生成盒子,插件放进去的东西就等于直接挂在外壳里。
|
|
13
|
+
*
|
|
14
|
+
* @module dsc-ui-shell/app
|
|
15
|
+
*/
|
|
16
|
+
import { type ReactNode } from 'react';
|
|
17
|
+
import type { ServiceRegistry, UiBootGraph, UiPluginLoadReport } from '@dsc/ui-core';
|
|
18
|
+
import type { UiSlots } from '@dsc/ui';
|
|
19
|
+
/**
|
|
20
|
+
* 骨架消费的装载会话份额(E4 起按结构定义在这里,不再反向 import 渲染器包)。
|
|
21
|
+
*
|
|
22
|
+
* 渲染器包的 `UiBootSession` 结构上满足它,装配点(入口的 `<App/>`)做检查;诊断区要的
|
|
23
|
+
* 数据——装载报告、批状态、每插件 phase——都在这个份额里,语义与之前的
|
|
24
|
+
* `getReports()` / `subscribe()` / 全局账本同一份(`getState()` 返回的就是那个账本对象)。
|
|
25
|
+
*/
|
|
26
|
+
export interface AppBootSession {
|
|
27
|
+
getReports(): readonly UiPluginLoadReport[];
|
|
28
|
+
getState(): AppBootLedger;
|
|
29
|
+
subscribe(listener: () => void): () => void;
|
|
30
|
+
}
|
|
31
|
+
/** 启动账本里诊断区画的那几项(渲染器包 `UiBootState` 的结构子集)。 */
|
|
32
|
+
export interface AppBootLedger {
|
|
33
|
+
startedAt: number;
|
|
34
|
+
batches: readonly {
|
|
35
|
+
phase: string;
|
|
36
|
+
entries: readonly string[];
|
|
37
|
+
state: string;
|
|
38
|
+
scheduledAt?: number;
|
|
39
|
+
startedAt?: number;
|
|
40
|
+
doneAt?: number;
|
|
41
|
+
}[];
|
|
42
|
+
plugins: Record<string, {
|
|
43
|
+
phase: string;
|
|
44
|
+
state: string;
|
|
45
|
+
}>;
|
|
46
|
+
}
|
|
47
|
+
/** 一条页内同步失败(热更句柄的读数;与渲染器包的 `PluginSyncFailure` 同形)。 */
|
|
48
|
+
export interface AppSyncFailure {
|
|
49
|
+
id: string;
|
|
50
|
+
message: string;
|
|
51
|
+
at: number;
|
|
52
|
+
}
|
|
53
|
+
/** 骨架消费的热更句柄份额(渲染器包 `UiPluginHmr` 的结构子集)。 */
|
|
54
|
+
export interface AppSyncHandle {
|
|
55
|
+
getFailures(): AppSyncFailure[];
|
|
56
|
+
retry(): void;
|
|
57
|
+
subscribe(listener: () => void): () => void;
|
|
58
|
+
}
|
|
59
|
+
/** 应用参数。 */
|
|
60
|
+
export interface AppProps {
|
|
61
|
+
slots: UiSlots;
|
|
62
|
+
boot: UiBootGraph;
|
|
63
|
+
/** 服务表(A1):诊断区那行的读数源;本体经 ServicesProvider 交给条目组件。 */
|
|
64
|
+
serviceRegistry: ServiceRegistry;
|
|
65
|
+
/** 装载会话:报告、批状态、换装都从它读;清单取不到时 null(空壳 + 诊断)。 */
|
|
66
|
+
session: AppBootSession | null;
|
|
67
|
+
/** 壳侧热更句柄(页内同步失败与重试按钮的读数面)。 */
|
|
68
|
+
hmr: AppSyncHandle | null;
|
|
69
|
+
/** 清单/装载会话起不来时的原因(诊断区画它)。 */
|
|
70
|
+
bootError: string | null;
|
|
71
|
+
/** 壳当前放行的平台模块(诊断区那一行的读数;本体住装载器,从入口传进来)。 */
|
|
72
|
+
allowedModules: readonly string[];
|
|
73
|
+
}
|
|
74
|
+
export declare function App({ slots, boot, serviceRegistry, session, hmr, bootError, allowedModules }: AppProps): ReactNode;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 外观偏好:主题模式、字号、密度三项怎么落到 DOM 上(浏览器侧)。
|
|
3
|
+
*
|
|
4
|
+
* 与桌面渲染层 `desktop/src/renderer/appearance.ts` 同一套语义:真源在宿主的
|
|
5
|
+
* `~/.dsc/settings.json`(走 `getUiPrefs`),这里另存一份 localStorage 镜像,
|
|
6
|
+
* 只为首帧不闪——宿主回读还没到,就能按上次的设置上色。
|
|
7
|
+
*
|
|
8
|
+
* 从旧版搬过来时**故意删掉**三件事(不是漏了):
|
|
9
|
+
* 1. `pushWindowChrome`:那是在跟 Electron 主进程报原生窗口控件区的颜色——浏览器里
|
|
10
|
+
* 没有这个口子。**现在回来了**:走原生桥(`pushNativeChrome` → `getHostNative()`),
|
|
11
|
+
* 桥缺席时整段是空操作。桌面窗口切到本壳时,这一条才是有用的那一条。
|
|
12
|
+
* 2. `dsc.setThemeSource`:原生弹出层(select 下拉、右键菜单)的深浅同理——同样经
|
|
13
|
+
* 原生桥回来了(`pushNativeChrome` 里那一次 `setThemeSource`)。
|
|
14
|
+
* 3. **按钮大小这条轴**:dsh 没有按钮缩放变量(它的全局轴是字号),按「按钮尺寸对齐
|
|
15
|
+
* dsh」的口径,本壳不再往 `--dsc-btn-scale` 写值——那批 `calc(Npx * var(--dsc-btn-scale))`
|
|
16
|
+
* 在 `styles.css` 里被固定尺寸覆盖掉了。旧存档里的 `buttonScale` 读得到就忽略,
|
|
17
|
+
* 不做迁移提示(它只影响观感,不影响功能)。
|
|
18
|
+
*
|
|
19
|
+
* @module dsc-ui-shell/appearance
|
|
20
|
+
*/
|
|
21
|
+
import type { ThemeMode, UiDensity, UiFontSize, UiPrefsView } from '@dsc/ui-core';
|
|
22
|
+
export type { ThemeMode, UiDensity, UiFontSize };
|
|
23
|
+
/** 字号倍率的可调范围;与 `src/core/prefs.ts` 读档时的夹取范围一致,改这里要两边一起改。 */
|
|
24
|
+
export declare const FONT_SCALE_MIN = 0.85;
|
|
25
|
+
export declare const FONT_SCALE_MAX = 1.35;
|
|
26
|
+
/** 基准倍率:正文 13px 原样。 */
|
|
27
|
+
export declare const FONT_SCALE_DEFAULT = 1;
|
|
28
|
+
/** 一项外观设置。按钮大小不在这里——那条轴已经退场(见文件头第 3 条)。 */
|
|
29
|
+
export interface Appearance {
|
|
30
|
+
themeMode: ThemeMode;
|
|
31
|
+
fontSize: UiFontSize;
|
|
32
|
+
density: UiDensity;
|
|
33
|
+
}
|
|
34
|
+
/** 出厂默认:深色、标准字号、标准密度。真源是 `core/prefs.ts` 的 readPrefs 默认值。 */
|
|
35
|
+
export declare const DEFAULT_APPEARANCE: Appearance;
|
|
36
|
+
/**
|
|
37
|
+
* 把外部来的字号值归一成能用的倍率。
|
|
38
|
+
*
|
|
39
|
+
* 数字夹到 0.85–1.35 并保留两位小数;旧的 'sm'/'md'/'lg' 按 0.92/1/1.12 迁移;
|
|
40
|
+
* 其余(认不出的字符串、NaN、null)回落 1。宿主回读、localStorage 镜像都先过这里,
|
|
41
|
+
* 所以旧存档最多是字号不对,不会把界面带崩。
|
|
42
|
+
*
|
|
43
|
+
* @param value 任意来源的字号值(数字或旧版三档字符串)
|
|
44
|
+
* @returns 可以直接写进 `--dsc-font-scale` 的倍率
|
|
45
|
+
*/
|
|
46
|
+
export declare function normalizeFontScale(value: unknown): number;
|
|
47
|
+
/**
|
|
48
|
+
* 把宿主 `getUiPrefs` 的返回值(或 localStorage 镜像)归一成渲染层能直接用的外观。
|
|
49
|
+
*
|
|
50
|
+
* @param prefs 宿主原样返回的界面偏好,或解析出来的镜像
|
|
51
|
+
*/
|
|
52
|
+
export declare function appearanceFromPrefs(prefs: Partial<UiPrefsView> | null | undefined): Appearance;
|
|
53
|
+
/**
|
|
54
|
+
* 把一份外观设置写到 document 根元素上。
|
|
55
|
+
*
|
|
56
|
+
* @param appearance 要生效的外观
|
|
57
|
+
*/
|
|
58
|
+
export declare function applyAppearance(appearance: Appearance): void;
|
|
59
|
+
/**
|
|
60
|
+
* 读取上次落盘的外观镜像。第一次运行或存坏了就返回默认值。
|
|
61
|
+
*
|
|
62
|
+
* @returns 缓存的外观,或默认值
|
|
63
|
+
*/
|
|
64
|
+
export declare function loadCachedAppearance(): Appearance;
|
|
65
|
+
/**
|
|
66
|
+
* 把外观写进 localStorage 镜像,供下次启动的首帧使用。
|
|
67
|
+
*
|
|
68
|
+
* @param appearance 刚从宿主读回来的外观
|
|
69
|
+
*/
|
|
70
|
+
export declare function saveCachedAppearance(appearance: Appearance): void;
|