@waq666/pneuma 0.7.1 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +242 -206
- package/bin/dsc.js +9 -3
- package/bin/headless.cjs +1 -1
- package/lib/adapter/transcript.d.ts +19 -2
- package/lib/adapter/transcript.js +71 -14
- package/lib/app/AgentsOverlay.js +7 -6
- package/lib/app/App.js +1 -1
- package/lib/app/ApprovalCard.js +15 -9
- package/lib/app/ChatView.d.ts +3 -1
- package/lib/app/ChatView.js +21 -17
- package/lib/app/Composer.js +22 -4
- package/lib/app/MarkdownView.js +2 -1
- package/lib/app/ModelPicker.js +7 -6
- package/lib/app/PickerFrame.d.ts +4 -0
- package/lib/app/PickerFrame.js +18 -0
- package/lib/app/PlanReviewCard.js +2 -1
- package/lib/app/PresetPicker.js +8 -7
- package/lib/app/SessionPicker.js +21 -20
- package/lib/app/SettingsOverlay.js +1 -1
- package/lib/app/SkillsPicker.js +7 -6
- package/lib/app/StatusBar.js +3 -15
- package/lib/app/TaskStrips.js +1 -4
- package/lib/app/TimelineRail.js +2 -1
- package/lib/app/ToolCard.js +2 -6
- package/lib/app/Welcome.d.ts +1 -0
- package/lib/app/Welcome.js +1 -4
- package/lib/app/click.d.ts +0 -2
- package/lib/app/click.js +2 -21
- package/lib/app/display-width.d.ts +16 -0
- package/lib/app/display-width.js +33 -0
- package/lib/app/markdown.d.ts +1 -3
- package/lib/app/markdown.js +2 -19
- package/lib/app/scroll-model.js +1 -1
- package/lib/contract/approval.d.ts +91 -0
- package/lib/contract/approval.js +1 -0
- package/lib/contract/mode.d.ts +69 -0
- package/lib/contract/mode.js +1 -0
- package/lib/contract/plugin.d.ts +240 -0
- package/lib/contract/plugin.js +1 -0
- package/lib/contract/runtime.d.ts +282 -0
- package/lib/contract/runtime.js +1 -0
- package/lib/contract/session.d.ts +208 -0
- package/lib/contract/session.js +36 -0
- package/lib/contract/settings.d.ts +242 -0
- package/lib/contract/settings.js +1 -0
- package/lib/contract/snapshot.d.ts +453 -0
- package/lib/contract/snapshot.js +1 -0
- package/lib/contract/task.d.ts +189 -0
- package/lib/contract/task.js +10 -0
- package/lib/contract/transcript.d.ts +358 -0
- package/lib/contract/transcript.js +1 -0
- package/lib/contract/usage.d.ts +132 -0
- package/lib/contract/usage.js +10 -0
- package/lib/contract.d.ts +20 -1968
- package/lib/contract.js +19 -30
- package/lib/core/agent-roles.d.ts +1 -1
- package/lib/core/agent-roles.js +6 -5
- package/lib/core/approval-floor.d.ts +9 -0
- package/lib/core/approval-floor.js +152 -25
- package/lib/core/attachments.d.ts +185 -0
- package/lib/core/attachments.js +425 -0
- package/lib/core/bytes.d.ts +14 -0
- package/lib/core/bytes.js +28 -0
- package/lib/core/call-meaning.d.ts +20 -0
- package/lib/core/call-meaning.js +347 -0
- package/lib/core/cdp/actions.js +6 -0
- package/lib/core/cdp/launch.js +2 -2
- package/lib/core/cdp/report.d.ts +27 -0
- package/lib/core/cdp/report.js +50 -0
- package/lib/core/cdp/ring-buffer.d.ts +25 -0
- package/lib/core/cdp/ring-buffer.js +44 -0
- package/lib/core/cdp/snapshot.js +5 -9
- package/lib/core/cdp/transport.js +1 -1
- package/lib/core/clamp.d.ts +20 -0
- package/lib/core/clamp.js +24 -0
- package/lib/core/clock.d.ts +16 -0
- package/lib/core/clock.js +20 -0
- package/lib/core/command-policy.js +33 -1
- package/lib/core/commands-completion.d.ts +28 -0
- package/lib/core/commands-completion.js +108 -30
- package/lib/core/compact.d.ts +36 -6
- package/lib/core/compact.js +89 -17
- package/lib/core/desktop-control.js +1 -3
- package/lib/core/dsh-compat/llm-usage-event.d.ts +78 -0
- package/lib/core/dsh-compat/llm-usage-event.js +91 -0
- package/lib/core/dsh-compat/presentation.d.ts +84 -0
- package/lib/core/dsh-compat/presentation.js +105 -0
- package/lib/core/dsh-compat/resolve-hook.d.ts +3 -3
- package/lib/core/dsh-compat/resolve-hook.js +41 -13
- package/lib/core/dsh-compat/service-map.d.ts +52 -0
- package/lib/core/dsh-compat/service-map.js +87 -0
- package/lib/core/dsh-compat/session-bridge.d.ts +107 -0
- package/lib/core/dsh-compat/session-bridge.js +376 -0
- package/lib/core/dsh-compat/session-events.d.ts +54 -0
- package/lib/core/dsh-compat/session-events.js +297 -0
- package/lib/core/dsh-compat/shims/credentials.d.ts +62 -0
- package/lib/core/dsh-compat/shims/credentials.js +86 -0
- package/lib/core/dsh-compat/shims/home-paths.d.ts +77 -0
- package/lib/core/dsh-compat/shims/home-paths.js +143 -0
- package/lib/core/dsh-compat/tools-facade.d.ts +31 -1
- package/lib/core/dsh-compat/tools-facade.js +207 -3
- package/lib/core/err-text.d.ts +5 -0
- package/lib/core/err-text.js +5 -0
- package/lib/core/events.d.ts +31 -2
- package/lib/core/git-info.d.ts +127 -15
- package/lib/core/git-info.js +315 -34
- package/lib/core/git-surface.d.ts +17 -0
- package/lib/core/git-surface.js +7 -0
- package/lib/core/hooks.d.ts +19 -2
- package/lib/core/hooks.js +57 -13
- package/lib/core/host-methods.d.ts +1 -1
- package/lib/core/host-methods.js +4 -0
- package/lib/core/image-diet.js +1 -4
- package/lib/core/json-text.d.ts +11 -0
- package/lib/core/json-text.js +18 -0
- package/lib/core/learnings/skill-write.d.ts +1 -7
- package/lib/core/learnings/skill-write.js +3 -37
- package/lib/core/lifecycle-hooks.d.ts +11 -3
- package/lib/core/lifecycle-hooks.js +33 -42
- package/lib/core/llm.d.ts +42 -0
- package/lib/core/llm.js +40 -25
- package/lib/core/loop.d.ts +11 -1
- package/lib/core/loop.js +95 -28
- package/lib/core/lsp/client.js +30 -17
- package/lib/core/lsp/normalize.d.ts +0 -2
- package/lib/core/lsp/normalize.js +1 -6
- package/lib/core/lsp/servers.js +1 -4
- package/lib/core/mcp.d.ts +18 -0
- package/lib/core/mcp.js +60 -16
- package/lib/core/microcompact.d.ts +45 -0
- package/lib/core/microcompact.js +128 -0
- package/lib/core/native-bridge.js +2 -10
- package/lib/core/path-policy.d.ts +13 -1
- package/lib/core/path-policy.js +87 -18
- package/lib/core/permission-presets.d.ts +9 -5
- package/lib/core/permission-presets.js +14 -7
- package/lib/core/permission-scope.d.ts +65 -0
- package/lib/core/permission-scope.js +109 -0
- package/lib/core/plugin-bundle.d.ts +95 -0
- package/lib/core/plugin-bundle.js +137 -0
- package/lib/core/plugin-loader.d.ts +36 -1
- package/lib/core/plugin-loader.js +336 -12
- package/lib/core/plugin-patch.d.ts +64 -0
- package/lib/core/plugin-patch.js +146 -0
- package/lib/core/plugin-registry.d.ts +14 -0
- package/lib/core/plugin-registry.js +2 -0
- package/lib/core/prefs.js +40 -2
- package/lib/core/presets.d.ts +11 -0
- package/lib/core/presets.js +61 -22
- package/lib/core/profile-dir.d.ts +5 -0
- package/lib/core/profile-dir.js +40 -0
- package/lib/core/prompt.js +55 -19
- package/lib/core/ptc.d.ts +8 -2
- package/lib/core/ptc.js +18 -4
- package/lib/core/records.d.ts +16 -0
- package/lib/core/records.js +22 -0
- package/lib/core/remote/notify.js +1 -3
- package/lib/core/remote/push.js +2 -6
- package/lib/core/sandbox/execpolicy.js +27 -3
- package/lib/core/sandbox/net-proxy.js +2 -2
- package/lib/core/sandbox/policy.d.ts +1 -1
- package/lib/core/sandbox/policy.js +21 -15
- package/lib/core/sandbox/win/account.js +1 -4
- package/lib/core/sandbox/win/acl.js +1 -6
- package/lib/core/sandbox/win/backend.d.ts +24 -3
- package/lib/core/sandbox/win/backend.js +73 -23
- package/lib/core/sandbox/win/doctor.js +1 -4
- package/lib/core/sandbox/win/runner-entry.js +1 -6
- package/lib/core/sandbox/win/setup.js +1 -4
- package/lib/core/sandbox/win/utf16.d.ts +11 -0
- package/lib/core/sandbox/win/utf16.js +15 -0
- package/lib/core/sandbox/win/wfp.js +1 -4
- package/lib/core/schedule/rule.d.ts +0 -17
- package/lib/core/schedule/rule.js +1 -3
- package/lib/core/schedule/runner.d.ts +5 -2
- package/lib/core/schedule/runner.js +32 -9
- package/lib/core/schedule/store.d.ts +0 -2
- package/lib/core/schedule/store.js +2 -9
- package/lib/core/session-index.d.ts +50 -0
- package/lib/core/session-index.js +169 -3
- package/lib/core/session.d.ts +89 -13
- package/lib/core/session.js +385 -32
- package/lib/core/shell-quote.d.ts +21 -0
- package/lib/core/shell-quote.js +24 -0
- package/lib/core/side-ask.d.ts +52 -0
- package/lib/core/side-ask.js +89 -0
- package/lib/core/skills.d.ts +16 -0
- package/lib/core/skills.js +45 -8
- package/lib/core/snapshot-throttle.d.ts +8 -0
- package/lib/core/snapshot-throttle.js +24 -0
- package/lib/core/spill.d.ts +11 -5
- package/lib/core/spill.js +35 -36
- package/lib/core/strings.d.ts +21 -0
- package/lib/core/strings.js +33 -0
- package/lib/core/terminal-env.d.ts +61 -0
- package/lib/core/terminal-env.js +327 -0
- package/lib/core/text-format.d.ts +17 -0
- package/lib/core/text-format.js +26 -0
- package/lib/core/todo-reminder.d.ts +19 -14
- package/lib/core/todo-reminder.js +14 -23
- package/lib/core/token-estimate.d.ts +18 -2
- package/lib/core/token-estimate.js +10 -2
- package/lib/core/tool-result-prune.d.ts +42 -0
- package/lib/core/tool-result-prune.js +47 -0
- package/lib/core/tool-search.d.ts +3 -2
- package/lib/core/tool-search.js +3 -2
- package/lib/core/tools/bash.d.ts +35 -3
- package/lib/core/tools/bash.js +168 -41
- package/lib/core/tools/fs-tools.js +18 -17
- package/lib/core/tools/image-tool.d.ts +2 -0
- package/lib/core/tools/image-tool.js +59 -0
- package/lib/core/tools/path-args.d.ts +4 -0
- package/lib/core/tools/path-args.js +22 -0
- package/lib/core/tools/search-tools.d.ts +30 -0
- package/lib/core/tools/search-tools.js +321 -34
- package/lib/core/tools.d.ts +82 -0
- package/lib/core/tools.js +21 -0
- package/lib/core/transcript-text.d.ts +19 -0
- package/lib/core/transcript-text.js +44 -0
- package/lib/core/ui-boot-source.d.ts +5 -0
- package/lib/core/ui-boot-source.js +10 -3
- package/lib/core/ui-bundles.d.ts +80 -6
- package/lib/core/ui-bundles.js +700 -76
- package/lib/core/ui-events.d.ts +10 -0
- package/lib/core/ui-events.js +25 -0
- package/lib/core/ui-methods.d.ts +1 -1
- package/lib/core/ui-methods.js +42 -13
- package/lib/core/ui-route.js +11 -7
- package/lib/core/ui-server.d.ts +6 -0
- package/lib/core/ui-server.js +106 -1
- package/lib/core/unified-diff.d.ts +35 -0
- package/lib/core/unified-diff.js +86 -0
- package/lib/core/usage-log.js +39 -0
- package/lib/core/web-http.d.ts +1 -1
- package/lib/core/web-http.js +1 -3
- package/lib/host/kernel.js +57 -41
- package/lib/plugins/agent.js +101 -20
- package/lib/plugins/approval-floor.js +12 -8
- package/lib/plugins/approval.js +252 -80
- package/lib/plugins/ask.js +60 -8
- package/lib/plugins/browser.js +32 -84
- package/lib/plugins/commands.js +167 -57
- package/lib/plugins/compact.d.ts +2 -2
- package/lib/plugins/compact.js +200 -30
- package/lib/plugins/computer-use.js +34 -18
- package/lib/plugins/dock-browser.js +24 -65
- package/lib/plugins/dsh-compat.js +7 -0
- package/lib/plugins/file-review.js +59 -15
- package/lib/plugins/git.js +16 -8
- package/lib/plugins/goal.js +9 -8
- package/lib/plugins/hooks.js +4 -2
- package/lib/plugins/host-stdio.js +14 -16
- package/lib/plugins/lifecycle-hooks.d.ts +5 -4
- package/lib/plugins/lifecycle-hooks.js +12 -10
- package/lib/plugins/llm.js +74 -33
- package/lib/plugins/lsp.js +22 -27
- package/lib/plugins/mcp.js +16 -17
- package/lib/plugins/memory.js +3 -24
- package/lib/plugins/microcompact.d.ts +4 -1
- package/lib/plugins/microcompact.js +117 -19
- package/lib/plugins/mode.js +30 -11
- package/lib/plugins/permission-presets.d.ts +2 -1
- package/lib/plugins/permission-presets.js +55 -35
- package/lib/plugins/plugin-manager.js +4 -6
- package/lib/plugins/presets.js +56 -27
- package/lib/plugins/prompt.js +54 -11
- package/lib/plugins/ptc.d.ts +13 -0
- package/lib/plugins/ptc.js +121 -24
- package/lib/plugins/remote/types.d.ts +1 -1
- package/lib/plugins/remote/types.js +11 -0
- package/lib/plugins/remote.js +14 -15
- package/lib/plugins/runtime.js +91 -14
- package/lib/plugins/sandbox.js +181 -60
- package/lib/plugins/schedule.js +12 -11
- package/lib/plugins/self-improve.js +28 -18
- package/lib/plugins/session-search.js +18 -13
- package/lib/plugins/session-title.js +1 -1
- package/lib/plugins/session.js +103 -25
- package/lib/plugins/settings.js +16 -40
- package/lib/plugins/skills.js +18 -1
- package/lib/plugins/spill.js +18 -11
- package/lib/plugins/subagent.js +208 -42
- package/lib/plugins/team.js +11 -5
- package/lib/plugins/todo.d.ts +1 -1
- package/lib/plugins/todo.js +25 -19
- package/lib/plugins/tool-search.js +47 -28
- package/lib/plugins/tools-default.js +89 -5
- package/lib/plugins/tools.js +3 -3
- package/lib/plugins/transcript.js +116 -9
- package/lib/plugins/web-search.d.ts +1 -1
- package/lib/plugins/web-search.js +25 -16
- package/lib/plugins/webserver.js +40 -7
- package/lib/remote/assets/app-B3Id1EBq.js +14 -0
- package/lib/remote/assets/index.html +2 -2
- package/lib/remote/assets/{style-DIB6729x.css → style-NtlpbKOI.css} +1 -1
- package/lib/services/types.d.ts +247 -29
- package/lib/tools/plugin-cli.d.ts +1 -0
- package/lib/tools/plugin-cli.js +209 -0
- package/lib/ui/assets/app-B-Jx5dnh.js +90 -0
- package/lib/ui/assets/{chunk-BajyYBss.js → chunk-Bfdlo8Me.js} +1 -1
- package/lib/ui/assets/chunk-DGX-i4eb.js +12 -0
- package/lib/ui/assets/index.html +62 -14
- package/lib/ui/assets/style-WzxwEPaE.css +1 -0
- package/lib/ui/frames.js +1 -3
- package/lib/ui/index.d.ts +30 -1
- package/lib/ui/index.js +29 -0
- package/lib/ui/manifest.d.ts +24 -6
- package/lib/ui/manifest.js +3 -2
- package/lib/ui/plugins/actions/bundle.json +8 -0
- package/lib/ui/plugins/actions/client.js +43 -0
- package/lib/ui/plugins/ask/bundle.json +8 -0
- package/lib/ui/plugins/ask/client.js +415 -0
- package/lib/ui/plugins/browser/bundle.json +8 -0
- package/lib/ui/plugins/composer/bundle.json +9 -0
- package/lib/ui/plugins/composer/client.js +1806 -1087
- package/lib/ui/plugins/files/bundle.json +8 -0
- package/lib/ui/plugins/files/client.js +13 -98
- package/lib/ui/plugins/manifest.json +1 -104
- package/lib/ui/plugins/palette/bundle.json +8 -0
- package/lib/ui/plugins/palette/client.js +360 -0
- package/lib/ui/plugins/plugins/bundle.json +8 -0
- package/lib/ui/plugins/plugins/client.js +116 -38
- package/lib/ui/plugins/preview/bundle.json +8 -0
- package/lib/ui/plugins/preview/client.js +6 -16
- package/lib/ui/plugins/prompt/bundle.json +8 -0
- package/lib/ui/plugins/prompt/client.js +81 -47
- package/lib/ui/plugins/sessions/bundle.json +8 -0
- package/lib/ui/plugins/sessions/client.js +157 -111
- package/lib/ui/plugins/settings/bundle.json +8 -0
- package/lib/ui/plugins/settings/client.js +184 -170
- package/lib/ui/plugins/skills/bundle.json +8 -0
- package/lib/ui/plugins/skills/client.js +161 -79
- package/lib/ui/plugins/status/bundle.json +8 -0
- package/lib/ui/plugins/status/client.js +165 -26
- package/lib/ui/plugins/statusbar/bundle.json +9 -0
- package/lib/ui/plugins/statusbar/client.js +100 -144
- package/lib/ui/plugins/tasks/bundle.json +8 -0
- package/lib/ui/plugins/team/bundle.json +8 -0
- package/lib/ui/plugins/team/client.js +60 -58
- package/lib/ui/plugins/terminal/bundle.json +8 -0
- package/lib/ui/plugins/terminal/client.js +1 -7
- package/lib/ui/plugins/trace/bundle.json +11 -0
- package/lib/ui/plugins/trace/client.js +86 -179
- package/lib/ui/plugins/transcript/bundle.json +8 -0
- package/lib/ui/plugins/transcript/client.js +1608 -1243
- package/lib/ui/sdk/@dsc/ui/index.d.ts +54 -16
- package/lib/ui/sdk/@dsc/ui/package.json +1 -1
- package/lib/ui/sdk/@dsc/ui-core/contract.d.ts +20 -1968
- package/lib/ui/sdk/@dsc/ui-core/core/attachments.d.ts +185 -0
- package/lib/ui/sdk/@dsc/ui-core/core/bytes.d.ts +14 -0
- package/lib/ui/sdk/@dsc/ui-core/core/err-text.d.ts +18 -0
- package/lib/ui/sdk/@dsc/ui-core/core/git-surface.d.ts +17 -0
- package/lib/ui/sdk/@dsc/ui-core/core/json-text.d.ts +11 -0
- package/lib/ui/sdk/@dsc/ui-core/core/path-policy.d.ts +44 -0
- package/lib/ui/sdk/@dsc/ui-core/core/records.d.ts +16 -0
- package/lib/ui/sdk/@dsc/ui-core/core/throughput.d.ts +46 -0
- package/lib/ui/sdk/@dsc/ui-core/core/token-estimate.d.ts +18 -2
- package/lib/ui/sdk/@dsc/ui-core/core/unified-diff.d.ts +35 -0
- package/lib/ui/sdk/@dsc/ui-core/package.json +1 -1
- package/lib/ui/sdk/@dsc/ui-core/ui/index.d.ts +30 -1
- package/lib/ui/sdk/@dsc/ui-core/ui/manifest.d.ts +24 -6
- package/lib/ui/sdk/@dsc/ui-core/ui/services.d.ts +19 -8
- package/lib/ui/sdk/@dsc/ui-core/ui/signal.d.ts +49 -0
- package/lib/ui/sdk/@dsc/ui-dockkit/dock-model.d.ts +17 -3
- package/lib/ui/sdk/@dsc/ui-dockkit/dock-state.d.ts +1 -1
- package/lib/ui/sdk/@dsc/ui-dockkit/package.json +1 -1
- package/lib/ui/sdk/@dsc/ui-layout/app.d.ts +4 -0
- package/lib/ui/sdk/@dsc/ui-layout/appearance.d.ts +6 -1
- package/lib/ui/sdk/@dsc/ui-layout/host-channel.d.ts +21 -0
- package/lib/ui/sdk/@dsc/ui-layout/index.d.ts +1 -0
- package/lib/ui/sdk/@dsc/ui-layout/package.json +1 -1
- package/lib/ui/sdk/@dsc/ui-layout/page-state.d.ts +1 -1
- package/lib/ui/sdk/@dsc/ui-layout/runtime-context.d.ts +10 -1
- package/lib/ui/sdk/@dsc/ui-layout/thread-view.d.ts +1 -1
- package/lib/ui/sdk/@dsc/ui-layout/usage-today.d.ts +11 -0
- package/lib/ui/sdk/@dsc/ui-primitives/dialog-focus.d.ts +30 -0
- package/lib/ui/sdk/@dsc/ui-primitives/error-text.d.ts +12 -0
- package/lib/ui/sdk/@dsc/ui-primitives/git-surface.d.ts +9 -0
- package/lib/ui/sdk/@dsc/ui-primitives/highlight.d.ts +23 -0
- package/lib/ui/sdk/@dsc/ui-primitives/humanize-error.d.ts +35 -0
- package/lib/ui/sdk/@dsc/ui-primitives/icons-workspace.d.ts +33 -0
- package/lib/ui/sdk/@dsc/ui-primitives/icons.d.ts +21 -3
- package/lib/ui/sdk/@dsc/ui-primitives/image-lightbox.d.ts +21 -0
- package/lib/ui/sdk/@dsc/ui-primitives/index.d.ts +16 -0
- package/lib/ui/sdk/@dsc/ui-primitives/markdown.d.ts +10 -14
- package/lib/ui/sdk/@dsc/ui-primitives/package.json +1 -1
- package/lib/ui/sdk/@dsc/ui-primitives/panels.d.ts +31 -8
- package/lib/ui/sdk/@dsc/ui-primitives/paths.d.ts +2 -0
- package/lib/ui/sdk/@dsc/ui-primitives/review-findings-card.d.ts +25 -0
- package/lib/ui/sdk/@dsc/ui-primitives/review-findings.d.ts +64 -0
- package/lib/ui/sdk/@dsc/ui-primitives/review-notice-card.d.ts +27 -0
- package/lib/ui/sdk/@dsc/ui-primitives/review-notice.d.ts +80 -0
- package/lib/ui/sdk/@dsc/ui-primitives/signal.d.ts +9 -0
- package/lib/ui/sdk/@dsc/ui-primitives/sizes.d.ts +15 -0
- package/lib/ui/sdk/@dsc/ui-primitives/skeleton.d.ts +39 -0
- package/lib/ui/sdk/@dsc/ui-primitives/snapshot.d.ts +46 -0
- package/lib/ui/sdk/@dsc/ui-primitives/thread-resizer.d.ts +3 -3
- package/lib/ui/sdk/@dsc/ui-primitives/throughput.d.ts +13 -0
- package/lib/ui/sdk/@dsc/ui-primitives/tokens.d.ts +9 -0
- package/lib/ui/sdk/@dsc/ui-primitives/tool-args.d.ts +1 -1
- package/lib/ui/sdk/@dsc/ui-primitives/tool-summary.d.ts +30 -6
- package/lib/ui/sdk/@dsc/ui-primitives/unified-diff.d.ts +10 -0
- package/lib/ui/sdk/@dsc/ui-renderer/boot.d.ts +10 -1
- package/lib/ui/sdk/@dsc/ui-renderer/cordis-host.d.ts +113 -0
- package/lib/ui/sdk/@dsc/ui-renderer/package.json +1 -1
- package/lib/ui/sdk/@dsc/ui-slots/package.json +1 -1
- package/lib/ui/services.d.ts +19 -8
- package/lib/ui/services.js +20 -12
- package/lib/ui/signal.d.ts +49 -0
- package/lib/ui/signal.js +57 -0
- package/lib/ui/tui-plugins.js +36 -16
- package/package.json +71 -58
- package/lib/remote/assets/app-DAcUCOEn.js +0 -14
- package/lib/ui/assets/app-B70nVIKd.js +0 -69
- package/lib/ui/assets/chunk-BGcgwlCI.js +0 -12
- package/lib/ui/assets/style-Bq01xH_b.css +0 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 模块级信号:一份共享状态 + 订阅 + 通知(全壳唯一一份写法)。
|
|
3
|
+
*
|
|
4
|
+
* 为什么要它:界面里有七处模块级共享状态(正文区那张脸、切页、dock 布局、旁问、文件树、
|
|
5
|
+
* 团队面板、启动账本),每处都手写「`Set<() => void>` + `subscribe` + 一个 for 循环通知」。
|
|
6
|
+
* 抄过去的不是那十行代码,是三条**抄漏了也不报错**的语义:
|
|
7
|
+
*
|
|
8
|
+
* 1. **引用稳定**:没变时 `get()` 必须返回同一个值(对象也一样)。`useSyncExternalStore`
|
|
9
|
+
* 拿它判断要不要重画——克隆一次就是逐帧重画,而且是"看起来卡"而不是"看起来错";
|
|
10
|
+
* 2. **通知前复制订阅者**:回调里退订(组件卸载时就会发生)不能打断这一轮遍历,
|
|
11
|
+
* 否则后面几个订阅者这一轮收不到通知,界面就停在旧值上;
|
|
12
|
+
* 3. **写入判等**:值没变就不通知。几个老实现各自用 `next === value` 判,
|
|
13
|
+
* 这里统一成 `Object.is`(`NaN` 算没变)。
|
|
14
|
+
*
|
|
15
|
+
* 与 `defineStore`(`store.ts`)的分工:
|
|
16
|
+
* - `defineStore` 是**按登记实例化**的席位——必须在 `apply(ui)` 里现建,随登记卸载消失,
|
|
17
|
+
* 带 actions 表与浅拷贝 draft;
|
|
18
|
+
* - 这份是**模块级单例**——没有登记、没有生命周期,谁引都是同一份。
|
|
19
|
+
* 两者要的只有「订阅 + 没变不通知」,所以不合并成一层。
|
|
20
|
+
*
|
|
21
|
+
* 两种用法,按「状态归不归这份信号」选:
|
|
22
|
+
* - **值归信号**(`set`):切页、团队面板开合、dock 布局、正文区那张脸。多字段写成
|
|
23
|
+
* **一个对象**、一次 `set` 发出去;分两次写会让订阅方先渲染半套新值
|
|
24
|
+
* (`thread-view` 的「切到轨迹并聚焦某一步」踩过这个:滚动位置会闪一下)。
|
|
25
|
+
* - **值在别处**(`notify`):状态是一张模块级 Map 或挂在 `globalThis` 上的账本
|
|
26
|
+
* (文件树、旁问、启动账本)。这类只借这份信号当**变更通道**:值怎么存照旧,
|
|
27
|
+
* 写完调 `notify()` 让订阅者重读。硬要把 Map 塞进信号,每次流式增量都得整张复制一遍,
|
|
28
|
+
* 换来的是零语义收益。
|
|
29
|
+
*
|
|
30
|
+
* @module dsc/ui/signal
|
|
31
|
+
*/
|
|
32
|
+
/** 一份模块级信号。 */
|
|
33
|
+
export interface Signal<T> {
|
|
34
|
+
/** 读当前值(没变时返回同一个引用)。 */
|
|
35
|
+
get(): T;
|
|
36
|
+
/** 写新值;与当前值相同(`Object.is`)就不通知。 */
|
|
37
|
+
set(next: T): void;
|
|
38
|
+
/**
|
|
39
|
+
* 通知订阅者「外部数据变了,重读一次」。
|
|
40
|
+
*
|
|
41
|
+
* 只在**值不归这份信号**时用(模块级 Map、`globalThis` 上的账本);值归信号时用 `set`。
|
|
42
|
+
* 它不判等——调用方说变了就是变了。
|
|
43
|
+
*/
|
|
44
|
+
notify(): void;
|
|
45
|
+
/** 订阅变化(`useSyncExternalStore` 的订阅函数形状)。 */
|
|
46
|
+
subscribe(listener: () => void): () => void;
|
|
47
|
+
}
|
|
48
|
+
/** 造一份信号;初值就是第一份状态。 */
|
|
49
|
+
export declare function createSignal<T>(initial: T): Signal<T>;
|
|
@@ -53,7 +53,15 @@ export type DockTabKind = 'guide' | 'terminal' | 'browser' | 'files' | 'git' | '
|
|
|
53
53
|
* 对照参考实现:后台活详情是一块独立的只读文本侧栏(`BackgroundBashOutputSidePane`),
|
|
54
54
|
* 不走交互终端的可写通道——右侧栏是只读的伴读面,与 `subagent` 同一落点。
|
|
55
55
|
*/
|
|
56
|
-
| 'work-output'
|
|
56
|
+
| 'work-output'
|
|
57
|
+
/**
|
|
58
|
+
* 旁问(只读一次性问答,一整个会话一张)。
|
|
59
|
+
*
|
|
60
|
+
* 为什么单开一种 kind:它既不是文件(preview),也不是某个子智能体的记录——
|
|
61
|
+
* 内容是「问题 + 引用 + 答案」的气泡列表,状态按会话记在插件里(不落盘)。
|
|
62
|
+
* 右侧栏本来就是「伴读面」,旁问与它同一条语义。
|
|
63
|
+
*/
|
|
64
|
+
| 'ask';
|
|
57
65
|
/** 一张页签:id 是毫秒 + 随机尾巴,进程内唯一即可(持久化恢复后也不与现存冲突)。 */
|
|
58
66
|
export interface DockTab {
|
|
59
67
|
id: string;
|
|
@@ -203,8 +211,14 @@ export declare function setTabInfo(surface: DockSurface, tabId: string, patch: {
|
|
|
203
211
|
path?: string;
|
|
204
212
|
}): DockSurface;
|
|
205
213
|
/**
|
|
206
|
-
* 关一张页签。格被清空自动补一张 guide
|
|
207
|
-
*
|
|
214
|
+
* 关一张页签。格被清空自动补一张 guide;**关掉整块栏最后一张页签才收起来**。
|
|
215
|
+
*
|
|
216
|
+
* 为什么判「最后一张」而不是「还剩不剩真内容」:后者会把「旁问」旁边那张还开着的
|
|
217
|
+
* 「开始」一起收走(2026-10-28 报障)——用户关的是一张页签,被收起的是整块栏。
|
|
218
|
+
* 而 guide 的 ✕ 若只补一张新 guide(id 变了、画出来一样),又等于「点了没反应」
|
|
219
|
+
* (2026-10-27 报障),所以关掉最后一张时仍然要收起:栏架子和门面留着,下次展开还是它。
|
|
220
|
+
*
|
|
221
|
+
* 分栏同理:只要别的格里还有页签(哪怕只剩门面),就照旧只补门面、不收栏。
|
|
208
222
|
*/
|
|
209
223
|
export declare function closeTab(surface: DockSurface, tabId: string): DockSurface;
|
|
210
224
|
/** 聚焦一张页签(顺带把它所在的窗格设为激活)。 */
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* @module dsc-ui-shell/dock-state
|
|
23
23
|
*/
|
|
24
24
|
import { type ComponentType, type ReactNode } from 'react';
|
|
25
|
-
import type
|
|
25
|
+
import { type ChangedFileView } from '@dsc/ui-core';
|
|
26
26
|
import { type DockActions, type DockSurface, type DockTab, type DockTabKind } from './dock-model';
|
|
27
27
|
export type { DockActions, DockPane, DockSurface, DockTab, DockTabKind } from './dock-model';
|
|
28
28
|
/**
|
|
@@ -42,6 +42,10 @@ export interface AppBootLedger {
|
|
|
42
42
|
plugins: Record<string, {
|
|
43
43
|
phase: string;
|
|
44
44
|
state: string;
|
|
45
|
+
/** 装配路径(2026-10-26 起:cordis 是默认,旧退订账本是回滚面)。 */
|
|
46
|
+
via?: 'cordis' | 'ledger';
|
|
47
|
+
/** 走 cordis 时那条纤维的状态码(0 待装 / 1 装载中 / 2 生效 / 3 失败 / 4 已卸)。 */
|
|
48
|
+
fiber?: number;
|
|
45
49
|
}>;
|
|
46
50
|
}
|
|
47
51
|
/** 一条页内同步失败(热更句柄的读数;与渲染器包的 `PluginSyncFailure` 同形)。 */
|
|
@@ -31,7 +31,12 @@ export interface Appearance {
|
|
|
31
31
|
fontSize: UiFontSize;
|
|
32
32
|
density: UiDensity;
|
|
33
33
|
}
|
|
34
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* 出厂默认:claude(暖米白)、标准字号、标准密度。
|
|
36
|
+
*
|
|
37
|
+
* 真源是 `core/prefs.ts` 的 readPrefs 默认值;这里跟着一起改,是为了宿主还没回读、
|
|
38
|
+
* 或 localStorage 镜像为空的那一帧也落在同一个主题上(0.7.2 起默认由 dark 改成 claude)。
|
|
39
|
+
*/
|
|
35
40
|
export declare const DEFAULT_APPEARANCE: Appearance;
|
|
36
41
|
/**
|
|
37
42
|
* 把外部来的字号值归一成能用的倍率。
|
|
@@ -82,6 +82,15 @@ export declare class HostInvokeAbortedError extends Error {
|
|
|
82
82
|
readonly reason: 'timeout' | 'aborted';
|
|
83
83
|
constructor(reason: 'timeout' | 'aborted', timeoutMs: number);
|
|
84
84
|
}
|
|
85
|
+
/** 旁问的一条增量(与宿主 `dsc/side-ask-chunk` 的形状一致)。 */
|
|
86
|
+
export interface AskChunk {
|
|
87
|
+
/** 这次旁问的票据(= sideAsk 的 requestId)。 */
|
|
88
|
+
id: string;
|
|
89
|
+
/** 本次新增的正文(可能为空,done 时就是空串)。 */
|
|
90
|
+
delta: string;
|
|
91
|
+
/** 收尾标记:为真表示这条流结束,后续只等 invoke 的最终返回值。 */
|
|
92
|
+
done?: boolean;
|
|
93
|
+
}
|
|
85
94
|
/** 壳看到的宿主通道。 */
|
|
86
95
|
export interface HostChannel {
|
|
87
96
|
getSnapshot(): HostSnapshot | null;
|
|
@@ -96,6 +105,11 @@ export interface HostChannel {
|
|
|
96
105
|
* @returns 退订函数
|
|
97
106
|
*/
|
|
98
107
|
onPlugins(listener: (frame: HostPluginsFrame) => void): () => void;
|
|
108
|
+
/**
|
|
109
|
+
* 订阅旁问增量(`event: ask`)。同一条流换事件名,不为它另开 EventSource。
|
|
110
|
+
* @returns 退订函数
|
|
111
|
+
*/
|
|
112
|
+
onAsk(listener: (chunk: AskChunk) => void): () => void;
|
|
99
113
|
/** 订阅(快照或握手或连接状态变化时叫一次)。 */
|
|
100
114
|
subscribe(listener: () => void): () => void;
|
|
101
115
|
/**
|
|
@@ -105,6 +119,13 @@ export interface HostChannel {
|
|
|
105
119
|
* @param options - 可选:取消信号与超时(等人的调用要传更长的超时,见 {@link HUMAN_WAIT_TIMEOUT_MS})
|
|
106
120
|
*/
|
|
107
121
|
invoke<T = unknown>(method: string, args?: unknown[], options?: InvokeOptions): Promise<T>;
|
|
122
|
+
/**
|
|
123
|
+
* 立刻重开一条流(手动重连)。
|
|
124
|
+
*
|
|
125
|
+
* 用在 401 这类「浏览器已经放弃重连」的情形:`close()` 之后不会再自愈,只能换实例。
|
|
126
|
+
* 与帧号跳号那条路径同一套做法(新实例没有 Last-Event-ID,宿主回一帧全量)。
|
|
127
|
+
*/
|
|
128
|
+
reconnect(): void;
|
|
108
129
|
/** 主动断开(页面卸载时;正常不需要——EventSource 会自动重连)。 */
|
|
109
130
|
close(): void;
|
|
110
131
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** 现在顶在主区的是哪一页(`null` = 对话页)。 */
|
|
2
2
|
export declare function shellPage(): string | null;
|
|
3
|
-
/** 切页(`null` =
|
|
3
|
+
/** 切页(`null` = 回对话页)。切到同一页不重复通知(`createSignal` 自己判等)。 */
|
|
4
4
|
export declare function setShellPage(next: string | null): void;
|
|
5
5
|
/** 订阅切页(`useSyncExternalStore` 的订阅函数)。 */
|
|
6
6
|
export declare function subscribePage(listener: () => void): () => void;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { type ReactNode } from 'react';
|
|
12
12
|
import type { HostSnapshot } from '@dsc/ui-core';
|
|
13
|
-
import type { ChannelStatus, HostChannel, HostHello } from './host-channel';
|
|
13
|
+
import type { AskChunk, ChannelStatus, HostChannel, HostHello } from './host-channel';
|
|
14
14
|
/** 把通道挂到 React 树上(壳的根节点用一次)。 */
|
|
15
15
|
export declare function RuntimeProvider({ channel, children }: {
|
|
16
16
|
channel: HostChannel;
|
|
@@ -42,3 +42,12 @@ export declare function useHostHello(): HostHello | null;
|
|
|
42
42
|
* 只有把原因显示出来,用户才知道该刷新还是该重启宿主。正常时是 null。
|
|
43
43
|
*/
|
|
44
44
|
export declare function useHostError(): string | null;
|
|
45
|
+
/**
|
|
46
|
+
* 订阅旁问增量(流式答案)。
|
|
47
|
+
*
|
|
48
|
+
* 为什么给 hook 而不是让插件自己 `addEventListener`:插件拿不到 EventSource 那条流
|
|
49
|
+
* (它在壳里),只拿得到 `@dsc/ui` 的导出面。回调走 ref,内联箭头不会让订阅每次渲染重挂。
|
|
50
|
+
*
|
|
51
|
+
* @param handler 每来一条增量调一次(含 done 标记)
|
|
52
|
+
*/
|
|
53
|
+
export declare function useAskStream(handler: (chunk: AskChunk) => void): void;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export type ThreadView = 'chat' | 'trace';
|
|
3
3
|
/** 现在正文区显示的是哪一张脸。 */
|
|
4
4
|
export declare function shellThreadView(): ThreadView;
|
|
5
|
-
/**
|
|
5
|
+
/** 切正文区的脸(切到同一张不重复通知;聚焦目标保持原样)。 */
|
|
6
6
|
export declare function setThreadView(next: ThreadView): void;
|
|
7
7
|
/**
|
|
8
8
|
* 切到轨迹页,并(可选)把某一条步骤定为聚焦目标。
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** 今日读数:token 合计与估算金额(宿主算不出金额时是 null)。 */
|
|
2
|
+
export interface TodayUsage {
|
|
3
|
+
tokens: number;
|
|
4
|
+
cost: number | null;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* 今日用量。
|
|
8
|
+
*
|
|
9
|
+
* @param refreshKey 变化即重取(一般传本会话累计 token)
|
|
10
|
+
*/
|
|
11
|
+
export declare function useTodayUsage(refreshKey?: unknown): TodayUsage;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 弹层的焦点管理(2026-10-25,P0-1)。
|
|
3
|
+
*
|
|
4
|
+
* 为什么要有它:壳里 9 个 `role="dialog"` 的弹层,只有 `confirm.ts` 会归还焦点。其余弹层
|
|
5
|
+
* 打开时焦点还停在被点的按钮上(Tab 于是从页面顶部往后走,走的是`遮罩底下的内容`),
|
|
6
|
+
* 关掉时焦点掉进 `<body>`——键盘用户下一步按 Tab 是从头开始,读屏也读不到"弹层开了"。
|
|
7
|
+
*
|
|
8
|
+
* 四件事,一件不多:
|
|
9
|
+
* 1. 打开时记下来源焦点,把焦点移进弹层(`[data-autofocus]` → 第一个可聚焦元素 → 弹层本身);
|
|
10
|
+
* 2. Tab / Shift+Tab 在弹层内循环,不跑到遮罩底下;
|
|
11
|
+
* 3. Esc 交给调用方(`onClose`),并 `stopPropagation`——嵌套弹层(设置里开模型详情)
|
|
12
|
+
* 先收到 Esc,外层不会跟着关;
|
|
13
|
+
* 4. 关闭时把焦点还给来源(来源已经不在 DOM 里就不还,别把焦点丢进虚空)。
|
|
14
|
+
*
|
|
15
|
+
* 可聚焦判定用 `offsetParent`:壳里藏元素用 `display: none` / `hidden`(不是 `visibility`),
|
|
16
|
+
* 拿它筛一遍就够;`inert` 容器里的元素浏览器自己不让聚焦,不用再判。
|
|
17
|
+
*
|
|
18
|
+
* @module dsc-ui-shell/ui-primitives/dialog-focus
|
|
19
|
+
*/
|
|
20
|
+
import { type RefObject } from 'react';
|
|
21
|
+
/**
|
|
22
|
+
* 给一个弹层接上焦点管理。
|
|
23
|
+
*
|
|
24
|
+
* @param active 弹层是否开着(false 时什么都不做,也不还原焦点)
|
|
25
|
+
* @param onClose Esc 时调它;不传就只做焦点循环(例如只读浮层)
|
|
26
|
+
* @returns `ref` 挂到弹层根元素上
|
|
27
|
+
*/
|
|
28
|
+
export declare function useDialogFocus(active: boolean, onClose?: () => void): {
|
|
29
|
+
ref: RefObject<HTMLDivElement | null>;
|
|
30
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 错误文案(`errText`)在基元包里的出口。
|
|
3
|
+
*
|
|
4
|
+
* 为什么要有这么一层:壳内七个界面插件此前各自写了一遍
|
|
5
|
+
* `error instanceof Error ? error.message : String(error)`(settings 五处、plugins、skills),
|
|
6
|
+
* 与宿主 `core/err-text.ts` 是同一份实现。界面插件按插件规范只能值引用平台种子
|
|
7
|
+
* (`@dsc/ui` / `@dsc/ui-primitives` / `@dsc/ui-slots` / `@dsc/ui-dockkit`),
|
|
8
|
+
* `@dsc/ui-core` 不在种子里,所以这里做一次转出:实现仍只有 core 那一份。
|
|
9
|
+
*
|
|
10
|
+
* @module dsc-ui-shell/ui-primitives/error-text
|
|
11
|
+
*/
|
|
12
|
+
export { errText } from '@dsc/ui-core';
|
|
@@ -7,6 +7,29 @@ export declare function getHighlighter(): Promise<HighlighterCoreLike>;
|
|
|
7
7
|
export declare function loadLang(id: string): Promise<void>;
|
|
8
8
|
/** 把一段代码高亮成 shiki HTML(无语法 / 装不上 → 纯文本 lang,回落转义输出)。 */
|
|
9
9
|
export declare function highlightToHtml(code: string, lang: string | undefined): Promise<string>;
|
|
10
|
+
/**
|
|
11
|
+
* 把一段代码高亮成**结构化**的行(每行一组「文本 + 双主题 CSS 变量」)。
|
|
12
|
+
*
|
|
13
|
+
* 为什么要有它,而不是继续吐 HTML:会话流里的代码块每来一个流式字就要重画一次,
|
|
14
|
+
* 而 `codeToHtml` 的产物只能靠 dangerouslySetInnerHTML 整块替换——React 每次都把内部
|
|
15
|
+
* DOM 重建一遍,正在增长的那块会闪、滚动位置会丢。换成结构化产物后,调用方渲染成
|
|
16
|
+
* 真正的 React 元素:行与行、段与段都能按位置复用,纯文本态和高亮态还是同一个 DOM
|
|
17
|
+
* 骨架(`pre.shiki > code > span.line`),切换时只换颜色,高度一格都不动。
|
|
18
|
+
*
|
|
19
|
+
* 没有对应语法 / 语法装不上 / shiki 解析失败 → null,调用方回落纯文本。
|
|
20
|
+
*
|
|
21
|
+
* @param code - 代码原文(调用方已去掉末尾那个装饰性换行)。
|
|
22
|
+
* @param lang - 围栏标注(`ts` 这类短名会先归一成 shiki 的语法 id)。
|
|
23
|
+
* @returns 逐行的 token 段,或 null。
|
|
24
|
+
*/
|
|
25
|
+
export declare function highlightToLines(code: string, lang: string | undefined): Promise<HighlightedCodeLine[] | null>;
|
|
26
|
+
/** 高亮后的一行:若干段文本,每段自带 `--shiki-light` / `--shiki-dark` 两个变量。 */
|
|
27
|
+
export type HighlightedCodeLine = readonly HighlightSpan[];
|
|
28
|
+
/** 高亮后的一段文本。`style` 直接喂给 React 的 style 对象(键就是 CSS 变量名)。 */
|
|
29
|
+
export interface HighlightSpan {
|
|
30
|
+
readonly text: string;
|
|
31
|
+
readonly style: Record<string, string>;
|
|
32
|
+
}
|
|
10
33
|
/** 一行的高亮产物:每段 token 一条(html 是已转义并带双主题 CSS 变量的 <span>)。 */
|
|
11
34
|
export interface HighlightedLine {
|
|
12
35
|
segments: string[];
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 错误文案的"人话层"(2026-10-25,P0-3)。
|
|
3
|
+
*
|
|
4
|
+
* 现状:全仓 90 处 `失败:${text(error)}`、74 处 `toastErr(...)`,用户看到的是
|
|
5
|
+
* "读取归档失败:Error: connect ECONNREFUSED 127.0.0.1:17321"——工程语言,没有下一步。
|
|
6
|
+
*
|
|
7
|
+
* 这一层只做三件事,**不改错误的流转**(原文照旧要留):
|
|
8
|
+
* 1. `title`:发生了什么(用户视角,一句话);
|
|
9
|
+
* 2. `hint`:下一步能做什么(一句,命令式);
|
|
10
|
+
* 3. `detail`:原文整串——诊断、复制、报障用它,不塞进界面主文案。
|
|
11
|
+
*
|
|
12
|
+
* 为什么按模式匹配而不是按错误类型:宿主与原生桥返回的常常是 `{ ok:false, error:string }`
|
|
13
|
+
* 或者被 `String()` 过一道的字符串,类型信息早没了;能认的只有字样。规则按"先具体后笼统"排,
|
|
14
|
+
* 每一条都解释了它对应哪种真实故障。
|
|
15
|
+
*
|
|
16
|
+
* @module dsc-ui-shell/ui-primitives/humanize-error
|
|
17
|
+
*/
|
|
18
|
+
/** 一条错误的三个面向。 */
|
|
19
|
+
export interface HumanError {
|
|
20
|
+
/** 发生了什么(用户视角)。 */
|
|
21
|
+
title: string;
|
|
22
|
+
/** 下一步做什么。 */
|
|
23
|
+
hint: string;
|
|
24
|
+
/** 原始文本,给诊断与复制用。 */
|
|
25
|
+
detail: string;
|
|
26
|
+
}
|
|
27
|
+
/** 把一行错误翻成「发生了什么 / 下一步 / 原文」。 */
|
|
28
|
+
export declare function humanizeError(input: unknown, fallback?: string): HumanError;
|
|
29
|
+
/** toast / 单行提示用:标题 + 下一步,一句话说完。 */
|
|
30
|
+
export declare function humanErrorLine(input: unknown, fallback?: string): string;
|
|
31
|
+
/** 内联错误行用:标题 + 下一步,原文另外给 `detail`(调用方塞进 title 属性)。 */
|
|
32
|
+
export declare function humanErrorText(input: unknown, fallback?: string): {
|
|
33
|
+
text: string;
|
|
34
|
+
detail: string;
|
|
35
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 工作区那一组的彩色图标(2026-10-25)。
|
|
3
|
+
*
|
|
4
|
+
* 为什么另立一套而不是改 {@link ./icons} 里的线性版:那一套是**全站通用**的字形(侧栏、
|
|
5
|
+
* 文件树、工具卡的 read、技能菜单都借 `IconFolder`),一旦填上颜色,几十处跟着变色;
|
|
6
|
+
* 这一套只服务「工作区」这一个语义:顶栏打开方式组、侧栏工作区行、菜单里的那四条打开方式。
|
|
7
|
+
*
|
|
8
|
+
* 颜色为什么写死 #RRGGBB 而不是令牌:它们读的是**对象本身**的颜色(文件夹是琥珀色、
|
|
9
|
+
* 终端是绿色、VS Code 是蓝色),跟主题的明暗无关;主题里那套 `--dsc-*` 令牌是界面表面的
|
|
10
|
+
* 颜色,换成它反而会让琥珀文件夹在深浅主题之间跳色。同类先例见
|
|
11
|
+
* `file-type-icon.tsx` 里代码文件片的品牌色。
|
|
12
|
+
*
|
|
13
|
+
* 目录图标是**双色**(暗色背板 + 亮色前片):单色实心块在 15px 上只是一块色斑,
|
|
14
|
+
* 分出前后面才一眼读成「文件夹」。
|
|
15
|
+
*
|
|
16
|
+
* @module dsc-ui-shell/ui-primitives/icons-workspace
|
|
17
|
+
*/
|
|
18
|
+
import type { JSX } from 'react';
|
|
19
|
+
type Props = {
|
|
20
|
+
size?: number;
|
|
21
|
+
className?: string;
|
|
22
|
+
};
|
|
23
|
+
/** 闭合的文件夹(琥珀双色):背板页签 + 前片。 */
|
|
24
|
+
export declare function IconFolderColor({ size, className }: Props): JSX.Element;
|
|
25
|
+
/** 打开的文件夹(琥珀双色):背板 + 向外翻的前片。 */
|
|
26
|
+
export declare function IconFolderOpenColor({ size, className }: Props): JSX.Element;
|
|
27
|
+
/** 终端(绿):框 + 提示符,框内垫一层同色淡底,凑近才看得出是填色。 */
|
|
28
|
+
export declare function IconTerminalColor({ size, className }: Props): JSX.Element;
|
|
29
|
+
/** VS Code 官方 mark(蓝):左侧的缺口用 evenodd 挖空,小尺寸下不至于糊成一块蓝。 */
|
|
30
|
+
export declare function IconVSCodeColor({ size, className }: Props): JSX.Element;
|
|
31
|
+
/** 复制(蓝灰):两张纸,后面那张是淡底。 */
|
|
32
|
+
export declare function IconCopyColor({ size, className }: Props): JSX.Element;
|
|
33
|
+
export {};
|
|
@@ -5,11 +5,18 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @module desktop/renderer/icons
|
|
7
7
|
*/
|
|
8
|
-
import type { JSX } from 'react';
|
|
8
|
+
import type { CSSProperties, JSX } from 'react';
|
|
9
9
|
type IconProps = {
|
|
10
10
|
size?: number;
|
|
11
11
|
className?: string;
|
|
12
12
|
};
|
|
13
|
+
/**
|
|
14
|
+
* {@link sized} 的对外版本:彩色图标那一套(`icons-workspace.tsx`)也要把尺寸挂成
|
|
15
|
+
* 同一个 CSS 变量,按钮尺寸倍率(`.row-menu .menu-item svg` 那条规则)才认得它。
|
|
16
|
+
*
|
|
17
|
+
* @param size 图标边长(px)
|
|
18
|
+
*/
|
|
19
|
+
export declare function iconSizeStyle(size: number): CSSProperties;
|
|
13
20
|
export declare function IconPlus(props: IconProps): JSX.Element;
|
|
14
21
|
export declare function IconFolder(props: IconProps): JSX.Element;
|
|
15
22
|
export declare function IconFolderOpen(props: IconProps): JSX.Element;
|
|
@@ -74,8 +81,19 @@ export declare function IconMore(props: IconProps): JSX.Element;
|
|
|
74
81
|
export declare function IconSort(props: IconProps): JSX.Element;
|
|
75
82
|
/** 归档(箱子)。 */
|
|
76
83
|
export declare function IconArchive(props: IconProps): JSX.Element;
|
|
77
|
-
/**
|
|
78
|
-
|
|
84
|
+
/**
|
|
85
|
+
* 置顶(图钉):竖向推钉——顶帽一横、梯形钉身、一根针。
|
|
86
|
+
*
|
|
87
|
+
* 为什么改成竖的(2026-11-03 用户报障「置顶图标太丑」):原来那版是 45° 斜拼的
|
|
88
|
+
* 三段线,缩到 13px 糊成一个小哑铃,谁看都认不出是图钉。竖向对称的形状在同样
|
|
89
|
+
* 尺寸下轮廓清楚,一眼能认。
|
|
90
|
+
*
|
|
91
|
+
* @param filled - 钉身填实。已置顶的那枚用它:和「悬浮才露出的灰描边」拉开区别,
|
|
92
|
+
* 不用再靠颜色深浅去猜有没有钉住。
|
|
93
|
+
*/
|
|
94
|
+
export declare function IconPin({ filled, ...props }: IconProps & {
|
|
95
|
+
filled?: boolean;
|
|
96
|
+
}): JSX.Element;
|
|
79
97
|
/** 终端(方框 + 提示符)。 */
|
|
80
98
|
export declare function IconTerminal(props: IconProps): JSX.Element;
|
|
81
99
|
/** 代码(尖括号对,VS Code 打开目录菜单用)。 */
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 贴图放大浮层:输入框上方那排待发贴图,点一下开大图,点遮罩或按 Esc 关。
|
|
3
|
+
*
|
|
4
|
+
* 为什么需要自己画这一层:待发贴图是用户当场贴/拖进来的本地文件,界面手上只有
|
|
5
|
+
* dataURL(`data:image/png;base64,…`)。浏览器禁止页面顶层导航到 `data:` 地址,所以
|
|
6
|
+
* 「外面套一个 `<a target="_blank">` 点开」这条路走不通;dataURL 也没有文件路径,
|
|
7
|
+
* 交给系统图片查看器同样没门。旧界面本来就有这个浮层,移植到壳的时候只把样式留下了
|
|
8
|
+
* (`.img-lightbox`,见 `ui-shell/src/legacy/views.css`),组件本身没搬过来——所以缩略图
|
|
9
|
+
* 就只剩缩略图。这里把组件补回来,视觉仍用那一份现成样式,不新造一套。
|
|
10
|
+
*
|
|
11
|
+
* 已发消息里的贴图不走这里:那些是宿主的同源地址(`/api/attachments/<sha>`),
|
|
12
|
+
* 普通链接就能开。
|
|
13
|
+
*
|
|
14
|
+
* @module dsc-ui-shell/ui-primitives/image-lightbox
|
|
15
|
+
*/
|
|
16
|
+
import { type ReactNode } from 'react';
|
|
17
|
+
export declare function ImageLightbox(props: {
|
|
18
|
+
src: string;
|
|
19
|
+
alt: string;
|
|
20
|
+
onClose(): void;
|
|
21
|
+
}): ReactNode;
|
|
@@ -26,6 +26,17 @@
|
|
|
26
26
|
* @module dsc-ui-shell/ui-primitives
|
|
27
27
|
*/
|
|
28
28
|
export * from './icons';
|
|
29
|
+
export * from './icons-workspace';
|
|
30
|
+
export * from './dialog-focus';
|
|
31
|
+
export * from './skeleton';
|
|
32
|
+
export * from './error-text';
|
|
33
|
+
export * from './sizes';
|
|
34
|
+
export * from './throughput';
|
|
35
|
+
export * from './git-surface';
|
|
36
|
+
export * from './unified-diff';
|
|
37
|
+
export * from './snapshot';
|
|
38
|
+
export * from './signal';
|
|
39
|
+
export * from './humanize-error';
|
|
29
40
|
export * from './plugin-text';
|
|
30
41
|
export * from './code-view';
|
|
31
42
|
export * from './compat';
|
|
@@ -39,12 +50,17 @@ export * from './file-type-icon';
|
|
|
39
50
|
export * from './file-icons';
|
|
40
51
|
export * from './highlight';
|
|
41
52
|
export * from './hover-delay';
|
|
53
|
+
export * from './image-lightbox';
|
|
42
54
|
export * from './lang-table';
|
|
43
55
|
export * from './markdown';
|
|
44
56
|
export * from './native';
|
|
45
57
|
export * from './panels';
|
|
46
58
|
export * from './paths';
|
|
47
59
|
export * from './pdf-view';
|
|
60
|
+
export * from './review-notice';
|
|
61
|
+
export * from './review-notice-card';
|
|
62
|
+
export * from './review-findings';
|
|
63
|
+
export * from './review-findings-card';
|
|
48
64
|
export * from './select';
|
|
49
65
|
export * from './table-view';
|
|
50
66
|
export * from './thread-resizer';
|
|
@@ -1,20 +1,16 @@
|
|
|
1
|
+
/** markdown 里相对路径图片的解析口:给一个能调 fs-read 的函数即可。 */
|
|
2
|
+
export type FsRead = (file: string) => Promise<unknown>;
|
|
1
3
|
/**
|
|
2
|
-
* markdown
|
|
3
|
-
* + 相对路径图片经宿主 fs-read 转 base64。
|
|
4
|
-
*
|
|
5
|
-
* 从旧渲染层 `file-preview.tsx` 的 MarkdownView / MdImage / CodeBlock 移植。
|
|
6
|
-
* 与旧版的一点差异:fs-read 的通道不归平台层管——调用方传 `fsRead(file)` 取回包
|
|
7
|
-
* (预览插件传 dock 通道那份),不传时相对路径图片一律显示占位。
|
|
4
|
+
* markdown 视图:会话流同款 ReactMarkdown,代码块交给 shiki。
|
|
8
5
|
*
|
|
9
|
-
*
|
|
6
|
+
* streaming 由调用方给(会话流传这一行是不是直播尾):只在流式中改变代码块上色的
|
|
7
|
+
* 时机,不影响其余渲染。
|
|
10
8
|
*/
|
|
11
|
-
|
|
12
|
-
/** markdown 里相对路径图片的解析口:给一个能调 `fs-read` 的函数即可。 */
|
|
13
|
-
export type FsRead = (file: string) => Promise<unknown>;
|
|
14
|
-
/** markdown 视图:会话流同款 ReactMarkdown,代码块交给 shiki。 */
|
|
15
|
-
export declare function MarkdownView({ text, path, fsRead, }: {
|
|
9
|
+
export declare const MarkdownView: import("react").NamedExoticComponent<{
|
|
16
10
|
text: string;
|
|
17
11
|
path: string;
|
|
18
12
|
/** 相对路径图片的解析口;缺省时相对路径图片显示占位。 */
|
|
19
|
-
fsRead?: FsRead;
|
|
20
|
-
|
|
13
|
+
fsRead?: FsRead | undefined;
|
|
14
|
+
/** 这段正文还在增长:代码块等它停顿一下再上色(见 CodeBlock 的说明)。 */
|
|
15
|
+
streaming?: boolean;
|
|
16
|
+
}>;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 面板尺寸与拖拽(桌面渲染层 `panels.ts` 的同构移植):
|
|
3
|
-
* 侧栏宽度、停靠面板宽度、中间对话列宽——三项都能用鼠标拖,拖完的值存在 localStorage
|
|
3
|
+
* 侧栏宽度、停靠面板宽度、中间对话列宽——三项都能用鼠标拖,拖完的值存在 localStorage,
|
|
4
|
+
* 同时**镜像一份到 `~/.dsc/settings.json`**(`ui.panelWidths`)。
|
|
4
5
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
* 为什么要那份镜像:宿主每次启动、每次切工作目录都会换一个端口(`ui-server` 的
|
|
7
|
+
* `port ?? 0`),而 localStorage 按源隔离——换端口就是一份空存储,光靠它的话用户拖出来的
|
|
8
|
+
* 宽度每次重开都回默认(用户报障 2026-10-29)。外观镜像踩过同一个坑,处理办法一样:
|
|
9
|
+
* 宿主那份当真值,localStorage 只当同一源内的快速读写层。
|
|
10
|
+
*
|
|
11
|
+
* 键名两边一套:localStorage 用 `dsc.sidebarWidth` 这批(与旧桌面渲染层共用,切界面宽度
|
|
12
|
+
* 能延续),settings.json 用短键 `sidebar` / `thread` / `dock` / `diff` / `collapsed`。
|
|
10
13
|
*
|
|
11
14
|
* @module dsc-ui-shell/platform/panels
|
|
12
15
|
*/
|
|
@@ -39,12 +42,32 @@ export declare const PANEL_KEYS: {
|
|
|
39
42
|
readonly diffPaneWidth: "dsc.diffPaneWidth";
|
|
40
43
|
};
|
|
41
44
|
/**
|
|
42
|
-
*
|
|
45
|
+
* 宿主那份几何的形状(`~/.dsc/settings.json` 的 `ui.panelWidths`,与契约
|
|
46
|
+
* `PanelWidthsView` 同形)。只列这五个键:面板以外的东西不归这里管。
|
|
47
|
+
*/
|
|
48
|
+
export type PanelGeometry = Partial<Record<'sidebar' | 'thread' | 'dock' | 'diff', number>> & {
|
|
49
|
+
collapsed?: boolean;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* 灌入宿主那份几何。启动时调一次,之后由写入路径自己维护。
|
|
53
|
+
*
|
|
54
|
+
* @param values 宿主 `getUiPrefs().panelWidths`;空对象 = 没拖过任何一项
|
|
55
|
+
*/
|
|
56
|
+
export declare function primePanelGeometry(values: PanelGeometry): void;
|
|
57
|
+
/**
|
|
58
|
+
* 注册落盘出口。壳入口接到宿主通道后调一次,把整份几何交给 `setUiPrefs`。
|
|
59
|
+
*
|
|
60
|
+
* @param fn 收到的是**整份**几何(不是单个键),因为宿主补丁是整键替换
|
|
61
|
+
*/
|
|
62
|
+
export declare function setPanelGeometrySaver(fn: ((geometry: PanelGeometry) => void) | null): void;
|
|
63
|
+
/**
|
|
64
|
+
* 读一个存过的面板宽度:先问 localStorage(同源内的最新值),没有再问宿主那份
|
|
65
|
+
* (跨宿主重启的那份)。没存过、存坏、或落在区间外都算没有。
|
|
43
66
|
*/
|
|
44
67
|
export declare function readStoredPx(key: string, min: number, max: number): number | null;
|
|
45
68
|
/** 落盘一个面板宽度;传 null 表示复位(删键,回到样式表默认宽)。 */
|
|
46
69
|
export declare function writeStoredPx(key: string, px: number | null): void;
|
|
47
|
-
/**
|
|
70
|
+
/** 读一个开关(侧栏收起状态):localStorage 里有这个键就以它为准,否则看宿主那份。 */
|
|
48
71
|
export declare function readStoredFlag(key: string): boolean;
|
|
49
72
|
/** 落盘一个开关。 */
|
|
50
73
|
export declare function writeStoredFlag(key: string, on: boolean): void;
|
|
@@ -9,3 +9,5 @@
|
|
|
9
9
|
export declare function displayPathOf(path: string, cwd: string, home?: string): string;
|
|
10
10
|
/** 路径里的文件名(两种分隔符都认;`split(/[\\/]/).pop()` 的显式写法)。 */
|
|
11
11
|
export declare function baseNameOf(path: string): string;
|
|
12
|
+
/** 拼子路径:`fs-list` / `fs-read` 吃反斜杠绝对路径,父路径已带分隔符就不再补。 */
|
|
13
|
+
export declare function joinPath(parent: string, name: string): string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `/review` findings 卡(T45):审查队友交回的那段 `<review-findings>` 汇报在对话流里的
|
|
3
|
+
* 展示形态——卡头(队友名 + 收工状态)+ 引言 + 按条渲染(优先级徽标、标题、可点的位置、
|
|
4
|
+
* 说明、建议)。位置点开走右侧预览页签并定位到行。
|
|
5
|
+
*
|
|
6
|
+
* 解析在 `./review-findings`(零依赖纯模块,探针直测);本组件只管画。
|
|
7
|
+
* 样式全用 `ui-shell/src/legacy/views.css` 里已有的 `.review-findings*` / `.review-finding*`
|
|
8
|
+
* 那一套(含 `data-priority='P0'…'P3'` 四档徽标),这里不新造样式。
|
|
9
|
+
*
|
|
10
|
+
* @module dsc-ui-shell/ui-primitives/review-findings-card
|
|
11
|
+
*/
|
|
12
|
+
import type { ReactNode } from 'react';
|
|
13
|
+
import type { ReviewFindingsView } from './review-findings';
|
|
14
|
+
/**
|
|
15
|
+
* 审查结论卡。
|
|
16
|
+
*
|
|
17
|
+
* @param props.doc - `parseReviewFindings` 的解析结果
|
|
18
|
+
* @param props.cwd - 会话工作目录(位置是仓库相对路径,点开预览要拼成绝对路径)
|
|
19
|
+
* @param props.onOpenLocation - 点位置时打开预览;不给就只显示文本(不引入新的打开方式)
|
|
20
|
+
*/
|
|
21
|
+
export declare function ReviewFindingsCard({ doc, cwd, onOpenLocation }: {
|
|
22
|
+
doc: ReviewFindingsView;
|
|
23
|
+
cwd?: string;
|
|
24
|
+
onOpenLocation?: (path: string, line?: number) => void;
|
|
25
|
+
}): ReactNode;
|