@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
|
@@ -4,13 +4,17 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
4
4
|
const jsxRuntime = require("react/jsx-runtime");
|
|
5
5
|
const react = require("react");
|
|
6
6
|
const ui$1 = require("@dsc/ui");
|
|
7
|
+
const uiPrimitives = require("@dsc/ui-primitives");
|
|
7
8
|
const PAGE = "skills";
|
|
8
9
|
const SOURCE_LABELS = {
|
|
9
10
|
"project-dsc": "本项目 .dsc/skills",
|
|
10
11
|
"project-agents": "本项目 .agents/skills",
|
|
11
12
|
custom: "自定义目录",
|
|
12
|
-
"user-
|
|
13
|
+
"user-agents": "公共 Agent",
|
|
14
|
+
"user-dsc": "用户技能 ~/.dsc/skills",
|
|
15
|
+
"user-dsh": "DSH 全局技能"
|
|
13
16
|
};
|
|
17
|
+
const SOURCE_ORDER = ["project-dsc", "project-agents", "custom", "user-agents", "user-dsc", "user-dsh"];
|
|
14
18
|
const ui = ui$1.defineUiPlugin({
|
|
15
19
|
name: "技能中心",
|
|
16
20
|
apply(ui2) {
|
|
@@ -30,6 +34,7 @@ function SkillsView() {
|
|
|
30
34
|
const [skills, setSkills] = react.useState(null);
|
|
31
35
|
const [skillsError, setSkillsError] = react.useState("");
|
|
32
36
|
const [query, setQuery] = react.useState("");
|
|
37
|
+
const [scopeTab, setScopeTab] = react.useState("all");
|
|
33
38
|
const [detail, setDetail] = react.useState(null);
|
|
34
39
|
const [market, setMarket] = react.useState(null);
|
|
35
40
|
const [marketSource, setMarketSource] = react.useState("");
|
|
@@ -43,7 +48,7 @@ function SkillsView() {
|
|
|
43
48
|
setSkills(list);
|
|
44
49
|
setSkillsError("");
|
|
45
50
|
}).catch((error) => {
|
|
46
|
-
setSkillsError(
|
|
51
|
+
setSkillsError(uiPrimitives.errText(error));
|
|
47
52
|
});
|
|
48
53
|
};
|
|
49
54
|
const browse = (source, refresh) => {
|
|
@@ -55,7 +60,7 @@ function SkillsView() {
|
|
|
55
60
|
else if (refresh) ui$1.toastOk(`已从 ${result.source} 获取 ${String(result.items.length)} 个技能`);
|
|
56
61
|
maybeAutoInstall();
|
|
57
62
|
}).catch((error) => {
|
|
58
|
-
ui$1.toastErr(`获取失败:${
|
|
63
|
+
ui$1.toastErr(`获取失败:${uiPrimitives.errText(error)}`);
|
|
59
64
|
}).finally(() => {
|
|
60
65
|
setMarketLoading(false);
|
|
61
66
|
});
|
|
@@ -66,14 +71,40 @@ function SkillsView() {
|
|
|
66
71
|
react.useEffect(() => {
|
|
67
72
|
if (tab === "market" && market === null && !marketLoading) browse("", false);
|
|
68
73
|
}, [tab]);
|
|
74
|
+
const scopeCounts = react.useMemo(() => {
|
|
75
|
+
const list = skills ?? [];
|
|
76
|
+
const global = list.filter((skill) => (skill.scope ?? "global") === "global").length;
|
|
77
|
+
return { all: list.length, global, project: list.length - global };
|
|
78
|
+
}, [skills]);
|
|
69
79
|
const filtered = react.useMemo(() => {
|
|
70
80
|
const needle = query.trim().toLowerCase();
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
81
|
+
const inScope = (skills ?? []).filter(
|
|
82
|
+
(skill) => scopeTab === "all" || (skill.scope ?? "global") === scopeTab
|
|
83
|
+
);
|
|
84
|
+
if (needle === "") return inScope;
|
|
85
|
+
return inScope.filter(
|
|
74
86
|
(skill) => skill.name.toLowerCase().includes(needle) || skill.description.toLowerCase().includes(needle) || (skill.whenToUse ?? "").toLowerCase().includes(needle)
|
|
75
87
|
);
|
|
76
|
-
}, [skills, query]);
|
|
88
|
+
}, [skills, query, scopeTab]);
|
|
89
|
+
const groups = react.useMemo(() => {
|
|
90
|
+
const map = /* @__PURE__ */ new Map();
|
|
91
|
+
for (const skill of filtered) {
|
|
92
|
+
const key = skill.root ?? `provider:${skill.source}`;
|
|
93
|
+
let group = map.get(key);
|
|
94
|
+
if (group === void 0) {
|
|
95
|
+
group = {
|
|
96
|
+
key,
|
|
97
|
+
label: SOURCE_LABELS[skill.source] ?? "插件提供",
|
|
98
|
+
root: skill.root,
|
|
99
|
+
order: SOURCE_ORDER.indexOf(skill.source) === -1 ? SOURCE_ORDER.length : SOURCE_ORDER.indexOf(skill.source),
|
|
100
|
+
items: []
|
|
101
|
+
};
|
|
102
|
+
map.set(key, group);
|
|
103
|
+
}
|
|
104
|
+
group.items.push(skill);
|
|
105
|
+
}
|
|
106
|
+
return [...map.values()].sort((a, b) => a.order - b.order || a.label.localeCompare(b.label));
|
|
107
|
+
}, [filtered]);
|
|
77
108
|
const marketFiltered = react.useMemo(() => {
|
|
78
109
|
const needle = query.trim().toLowerCase();
|
|
79
110
|
const items = market?.items ?? [];
|
|
@@ -90,7 +121,7 @@ function SkillsView() {
|
|
|
90
121
|
else if (result.notice !== void 0) ui$1.toastOk(result.notice);
|
|
91
122
|
reloadSkills();
|
|
92
123
|
}).catch((error) => {
|
|
93
|
-
ui$1.toastErr(`操作失败:${
|
|
124
|
+
ui$1.toastErr(`操作失败:${uiPrimitives.errText(error)}`);
|
|
94
125
|
reloadSkills();
|
|
95
126
|
});
|
|
96
127
|
};
|
|
@@ -103,7 +134,7 @@ function SkillsView() {
|
|
|
103
134
|
if (!result.ok || result.skill === void 0) ui$1.toastErr(`读取正文失败:${result.error ?? "未知原因"}`);
|
|
104
135
|
else setDetail(result.skill);
|
|
105
136
|
}).catch((error) => {
|
|
106
|
-
ui$1.toastErr(`读取正文失败:${
|
|
137
|
+
ui$1.toastErr(`读取正文失败:${uiPrimitives.errText(error)}`);
|
|
107
138
|
});
|
|
108
139
|
};
|
|
109
140
|
const openFolder = (path) => {
|
|
@@ -127,7 +158,7 @@ function SkillsView() {
|
|
|
127
158
|
ui$1.toastOk(`已导入 ${names.join("、")}`);
|
|
128
159
|
reloadSkills();
|
|
129
160
|
}).catch((error) => {
|
|
130
|
-
ui$1.toastErr(`导入失败:${
|
|
161
|
+
ui$1.toastErr(`导入失败:${uiPrimitives.errText(error)}`);
|
|
131
162
|
});
|
|
132
163
|
};
|
|
133
164
|
const install = (item) => {
|
|
@@ -153,7 +184,7 @@ function SkillsView() {
|
|
|
153
184
|
}
|
|
154
185
|
);
|
|
155
186
|
}).catch((error) => {
|
|
156
|
-
ui$1.toastErr(`安装失败:${
|
|
187
|
+
ui$1.toastErr(`安装失败:${uiPrimitives.errText(error)}`);
|
|
157
188
|
}).finally(() => {
|
|
158
189
|
setInstalling("");
|
|
159
190
|
});
|
|
@@ -183,7 +214,7 @@ function SkillsView() {
|
|
|
183
214
|
setMarket(null);
|
|
184
215
|
browse(sources[0]?.name ?? "", false);
|
|
185
216
|
}).catch((error) => {
|
|
186
|
-
ui$1.toastErr(`保存失败:${
|
|
217
|
+
ui$1.toastErr(`保存失败:${uiPrimitives.errText(error)}`);
|
|
187
218
|
}).finally(() => {
|
|
188
219
|
setSavingSources(false);
|
|
189
220
|
});
|
|
@@ -267,86 +298,140 @@ function SkillsView() {
|
|
|
267
298
|
)
|
|
268
299
|
] })
|
|
269
300
|
] }),
|
|
301
|
+
tab === "installed" ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "skills-scope", role: "group", "aria-label": "技能作用域", children: [
|
|
302
|
+
{ value: "all", label: "全部", count: scopeCounts.all },
|
|
303
|
+
{ value: "global", label: "全局", count: scopeCounts.global },
|
|
304
|
+
{ value: "project", label: "项目", count: scopeCounts.project }
|
|
305
|
+
].map((chip) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
306
|
+
"button",
|
|
307
|
+
{
|
|
308
|
+
type: "button",
|
|
309
|
+
className: scopeTab === chip.value ? "on" : "",
|
|
310
|
+
"aria-pressed": scopeTab === chip.value,
|
|
311
|
+
onClick: () => {
|
|
312
|
+
setScopeTab(chip.value);
|
|
313
|
+
},
|
|
314
|
+
children: [
|
|
315
|
+
chip.label,
|
|
316
|
+
" ",
|
|
317
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "count", children: chip.count })
|
|
318
|
+
]
|
|
319
|
+
},
|
|
320
|
+
chip.value
|
|
321
|
+
)) }) : null,
|
|
270
322
|
tab === "installed" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "skills-list", children: [
|
|
271
323
|
skillsError !== "" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "settings-note error", children: [
|
|
272
324
|
"扫描失败:",
|
|
273
|
-
skillsError
|
|
325
|
+
uiPrimitives.humanErrorText(skillsError).text
|
|
274
326
|
] }),
|
|
275
|
-
skills === null && skillsError === "" && /* @__PURE__ */ jsxRuntime.
|
|
276
|
-
|
|
277
|
-
"
|
|
278
|
-
/* @__PURE__ */ jsxRuntime.jsx("code", { children: "<名字>/SKILL.md" }),
|
|
279
|
-
" 放入 ",
|
|
280
|
-
/* @__PURE__ */ jsxRuntime.jsx("code", { children: "~/.dsc/skills/" }),
|
|
281
|
-
" 或项目的",
|
|
282
|
-
" ",
|
|
283
|
-
/* @__PURE__ */ jsxRuntime.jsx("code", { children: ".dsc/skills" }),
|
|
284
|
-
",或点击右上角「导入技能」,也可在「市场」页安装。"
|
|
327
|
+
skills === null && skillsError === "" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "settings-loading", role: "status", "aria-label": "正在扫描技能目录", children: [
|
|
328
|
+
/* @__PURE__ */ jsxRuntime.jsx(uiPrimitives.SkeletonText, { lines: 4 }),
|
|
329
|
+
/* @__PURE__ */ jsxRuntime.jsx(uiPrimitives.SkeletonText, { lines: 3, widths: ["100%", "100%", "54%"] })
|
|
285
330
|
] }),
|
|
286
|
-
|
|
287
|
-
/* @__PURE__ */ jsxRuntime.jsx("
|
|
288
|
-
/* @__PURE__ */ jsxRuntime.
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
/* @__PURE__ */ jsxRuntime.jsx("
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
331
|
+
skills !== null && skills.length === 0 && skillsError === "" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "empty-card", children: [
|
|
332
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "empty-card-icon", children: /* @__PURE__ */ jsxRuntime.jsx(ui$1.IconBolt, { size: 18 }) }),
|
|
333
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "empty-card-title", children: "还没有技能" }),
|
|
334
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "empty-card-desc", children: [
|
|
335
|
+
"把 ",
|
|
336
|
+
/* @__PURE__ */ jsxRuntime.jsx("code", { children: "<名字>/SKILL.md" }),
|
|
337
|
+
" 放进 ",
|
|
338
|
+
/* @__PURE__ */ jsxRuntime.jsx("code", { children: "~/.dsc/skills/" }),
|
|
339
|
+
"、",
|
|
340
|
+
/* @__PURE__ */ jsxRuntime.jsx("code", { children: "~/.agents/skills/" }),
|
|
341
|
+
"(公共 Agent)、",
|
|
342
|
+
/* @__PURE__ */ jsxRuntime.jsx("code", { children: "~/.dsh/skills/" }),
|
|
343
|
+
"(DSH 全局) 或项目的 ",
|
|
344
|
+
/* @__PURE__ */ jsxRuntime.jsx("code", { children: ".dsc/skills" }),
|
|
345
|
+
",也可以直接导入一个目录。"
|
|
346
|
+
] }),
|
|
347
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "empty-card-actions", children: [
|
|
348
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "btn-primary", onClick: importSkill, children: "导入技能" }),
|
|
349
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
350
|
+
"button",
|
|
351
|
+
{
|
|
352
|
+
type: "button",
|
|
353
|
+
className: "btn-ghost",
|
|
354
|
+
onClick: () => {
|
|
355
|
+
setTab("market");
|
|
356
|
+
},
|
|
357
|
+
children: "去市场看看"
|
|
358
|
+
}
|
|
359
|
+
)
|
|
360
|
+
] })
|
|
361
|
+
] }),
|
|
362
|
+
groups.map((group) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "skills-group", children: [
|
|
363
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "skills-group-head", children: [
|
|
364
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "skills-group-title", children: group.label }),
|
|
365
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "skills-group-count", children: [
|
|
366
|
+
group.items.length,
|
|
367
|
+
" 个技能"
|
|
301
368
|
] }),
|
|
302
|
-
/* @__PURE__ */ jsxRuntime.
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
}
|
|
313
|
-
),
|
|
314
|
-
skill.
|
|
315
|
-
|
|
369
|
+
group.root === void 0 ? null : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mono skills-group-path", "data-tip": group.root, children: group.root })
|
|
370
|
+
] }),
|
|
371
|
+
group.items.map((skill) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `skill-row${skill.enabled ? "" : " off"}`, children: [
|
|
372
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "skill-icon", children: /* @__PURE__ */ jsxRuntime.jsx(ui$1.IconBolt, { size: 15 }) }),
|
|
373
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "skill-info", children: [
|
|
374
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "skill-name", children: [
|
|
375
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "skill-title", children: [
|
|
376
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "slash", children: "/" }),
|
|
377
|
+
skill.name
|
|
378
|
+
] }),
|
|
379
|
+
!skill.modelInvocable && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tag", children: "仅手动" })
|
|
380
|
+
] }),
|
|
381
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `skill-desc${skill.problem !== void 0 ? " problem" : ""}`, children: skill.problem !== void 0 ? `⚠ ${skill.problem}` : skill.description }),
|
|
382
|
+
skill.whenToUse !== void 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "skill-when", children: [
|
|
383
|
+
"何时用:",
|
|
384
|
+
skill.whenToUse
|
|
385
|
+
] }),
|
|
386
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "skill-links", children: [
|
|
387
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
316
388
|
"button",
|
|
317
389
|
{
|
|
318
390
|
type: "button",
|
|
319
391
|
className: "text-btn",
|
|
320
|
-
"data-tip": skill.path,
|
|
321
392
|
onClick: () => {
|
|
322
|
-
|
|
393
|
+
openDetail(skill);
|
|
323
394
|
},
|
|
324
|
-
children:
|
|
325
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui$1.IconFolder, { size: 13 }),
|
|
326
|
-
" 打开所在目录"
|
|
327
|
-
]
|
|
395
|
+
children: detail?.name === skill.name ? "收起正文" : "查看正文"
|
|
328
396
|
}
|
|
329
397
|
),
|
|
330
|
-
/* @__PURE__ */ jsxRuntime.
|
|
331
|
-
|
|
398
|
+
skill.path !== void 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
399
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
400
|
+
"button",
|
|
401
|
+
{
|
|
402
|
+
type: "button",
|
|
403
|
+
className: "text-btn",
|
|
404
|
+
"data-tip": skill.path,
|
|
405
|
+
onClick: () => {
|
|
406
|
+
openFolder(skill.path ?? "");
|
|
407
|
+
},
|
|
408
|
+
children: [
|
|
409
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui$1.IconFolder, { size: 13 }),
|
|
410
|
+
" 打开所在目录"
|
|
411
|
+
]
|
|
412
|
+
}
|
|
413
|
+
),
|
|
414
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "mono skill-path", children: skill.path })
|
|
415
|
+
] })
|
|
416
|
+
] }),
|
|
417
|
+
detail !== null && detail.name === skill.name && /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "skill-body", children: detail.content })
|
|
332
418
|
] }),
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
if (skill.toggleable) toggle(skill);
|
|
419
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
420
|
+
"button",
|
|
421
|
+
{
|
|
422
|
+
type: "button",
|
|
423
|
+
className: `switch${skill.enabled ? " on" : ""}${skill.toggleable ? "" : " locked"}`,
|
|
424
|
+
role: "switch",
|
|
425
|
+
"aria-checked": skill.enabled,
|
|
426
|
+
"aria-label": `${skill.name} 开关`,
|
|
427
|
+
"data-tip": skill.toggleable ? skill.enabled ? "停用,不再进入模型目录并移除命令" : "启用" : "由插件提供,不能在技能中心启停",
|
|
428
|
+
onClick: () => {
|
|
429
|
+
if (skill.toggleable) toggle(skill);
|
|
430
|
+
}
|
|
346
431
|
}
|
|
347
|
-
|
|
348
|
-
)
|
|
349
|
-
] },
|
|
432
|
+
)
|
|
433
|
+
] }, `${skill.source}/${skill.name}`))
|
|
434
|
+
] }, group.key)),
|
|
350
435
|
skills !== null && skills.length > 0 && filtered.length === 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "plugins-empty", children: [
|
|
351
436
|
"没有匹配「",
|
|
352
437
|
query,
|
|
@@ -478,8 +563,5 @@ ${source.error ?? ""}`,
|
|
|
478
563
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "skills-foot", children: "模型仅能看到技能名称与一句话说明;正文按需读取,不常驻上下文。" })
|
|
479
564
|
] });
|
|
480
565
|
}
|
|
481
|
-
function text(error) {
|
|
482
|
-
return error instanceof Error ? error.message : String(error);
|
|
483
|
-
}
|
|
484
566
|
exports.default = ui;
|
|
485
567
|
};
|
|
@@ -5,6 +5,7 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
5
5
|
const react = require("react");
|
|
6
6
|
const reactDom = require("react-dom");
|
|
7
7
|
const ui$1 = require("@dsc/ui");
|
|
8
|
+
const uiPrimitives = require("@dsc/ui-primitives");
|
|
8
9
|
const TODO_COMPACT_THRESHOLD = 6;
|
|
9
10
|
const TODO_FOCUS_SIZE = 3;
|
|
10
11
|
function isSettled(status) {
|
|
@@ -107,7 +108,12 @@ const CLOCK_FAST_MS = 1e3;
|
|
|
107
108
|
const CLOCK_SLOW_MS = 1e4;
|
|
108
109
|
const AUTO_PANEL_MIN_WIDTH = 1280;
|
|
109
110
|
const THREAD_AREA_SELECTOR = "[data-thread-area]";
|
|
111
|
+
const TOPBAR_TABS_SELECTOR = ".topbar .tabs";
|
|
110
112
|
const MODE_KEY = "dsc.statusPanel.mode";
|
|
113
|
+
const POS_KEY = "dsc.statusPanel.pos";
|
|
114
|
+
const DRAG_SLOP = 4;
|
|
115
|
+
const SNAP_BACK_PX = 24;
|
|
116
|
+
const DRAG_MARGIN = 8;
|
|
111
117
|
const PREVIEW_OPEN_MS = 120;
|
|
112
118
|
const PREVIEW_CLOSE_MS = 80;
|
|
113
119
|
const MODE_LABEL = {
|
|
@@ -130,6 +136,49 @@ function writeMode(mode) {
|
|
|
130
136
|
} catch {
|
|
131
137
|
}
|
|
132
138
|
}
|
|
139
|
+
function readPos() {
|
|
140
|
+
try {
|
|
141
|
+
const raw = globalThis.localStorage?.getItem(POS_KEY);
|
|
142
|
+
if (raw === null || raw === void 0) return null;
|
|
143
|
+
const parsed = JSON.parse(raw);
|
|
144
|
+
if (typeof parsed !== "object" || parsed === null) return null;
|
|
145
|
+
const x = parsed.x;
|
|
146
|
+
const y = parsed.y;
|
|
147
|
+
if (typeof x !== "number" || typeof y !== "number" || !Number.isFinite(x) || !Number.isFinite(y)) return null;
|
|
148
|
+
return { x, y };
|
|
149
|
+
} catch {
|
|
150
|
+
return null;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
function writePos(pos) {
|
|
154
|
+
try {
|
|
155
|
+
globalThis.localStorage?.setItem(POS_KEY, JSON.stringify(pos));
|
|
156
|
+
} catch {
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
function clearPos() {
|
|
160
|
+
try {
|
|
161
|
+
globalThis.localStorage?.removeItem(POS_KEY);
|
|
162
|
+
} catch {
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
function clampIn(value, min, max) {
|
|
166
|
+
return min > max ? min : Math.min(Math.max(value, min), max);
|
|
167
|
+
}
|
|
168
|
+
function dragBounds(hostEl, applied) {
|
|
169
|
+
const container = hostEl.closest(".main") ?? hostEl.closest(THREAD_AREA_SELECTOR);
|
|
170
|
+
if (container === null) return null;
|
|
171
|
+
const frame = container.getBoundingClientRect();
|
|
172
|
+
const rect = hostEl.getBoundingClientRect();
|
|
173
|
+
const left = rect.left - applied.x;
|
|
174
|
+
const top = rect.top - applied.y;
|
|
175
|
+
return {
|
|
176
|
+
minX: frame.left + DRAG_MARGIN - left,
|
|
177
|
+
maxX: frame.right - DRAG_MARGIN - rect.width - left,
|
|
178
|
+
minY: frame.top + DRAG_MARGIN - top,
|
|
179
|
+
maxY: frame.bottom - DRAG_MARGIN - rect.height - top
|
|
180
|
+
};
|
|
181
|
+
}
|
|
133
182
|
const DEFAULT_SECTION_OPEN = {
|
|
134
183
|
git: true,
|
|
135
184
|
goal: true,
|
|
@@ -195,14 +244,6 @@ function sameGoal(left, right) {
|
|
|
195
244
|
if (left === null || right === null) return false;
|
|
196
245
|
return left.objective === right.objective && left.phase === right.phase && left.rounds === right.rounds && left.maxRounds === right.maxRounds && left.armed === right.armed && left.blockedReason === right.blockedReason;
|
|
197
246
|
}
|
|
198
|
-
function readSessionId(snapshot) {
|
|
199
|
-
const status = snapshot?.["status"];
|
|
200
|
-
if (typeof status !== "object" || status === null) return null;
|
|
201
|
-
const path = status["sessionPath"];
|
|
202
|
-
if (typeof path !== "string" || path === "") return null;
|
|
203
|
-
const base = path.replace(/\\/g, "/").split("/").pop() ?? "";
|
|
204
|
-
return base.endsWith(".jsonl") ? base.slice(0, -6) : base;
|
|
205
|
-
}
|
|
206
247
|
function sameMateList(left, right) {
|
|
207
248
|
if (left === right) return true;
|
|
208
249
|
if (left.length !== right.length) return false;
|
|
@@ -287,7 +328,7 @@ function StatusPanel({ slots }) {
|
|
|
287
328
|
const view = ui$1.useThreadView();
|
|
288
329
|
const todos = ui$1.useHostSelector(readTodos, sameTodos);
|
|
289
330
|
const goal = ui$1.useHostSelector(readGoal, sameGoal);
|
|
290
|
-
const sessionId = ui$1.useHostSelector(readSessionId);
|
|
331
|
+
const sessionId = ui$1.useHostSelector(uiPrimitives.readSessionId);
|
|
291
332
|
const works = ui$1.useHostSelector(readBackgroundWorks, sameWorks);
|
|
292
333
|
const plans = ui$1.useHostSelector(readPlanDirectory, samePlans);
|
|
293
334
|
const scheduled = ui$1.useHostSelector(readScheduled, sameTasks);
|
|
@@ -318,18 +359,26 @@ function StatusPanel({ slots }) {
|
|
|
318
359
|
const sentinel = react.useRef(null);
|
|
319
360
|
const box = react.useRef(null);
|
|
320
361
|
const [host, setHost] = react.useState(null);
|
|
362
|
+
const [area, setArea] = react.useState(null);
|
|
363
|
+
const [pos, setPos] = react.useState(() => readPos() ?? { x: 0, y: 0 });
|
|
364
|
+
const posRef = react.useRef(pos);
|
|
365
|
+
const dragRef = react.useRef(null);
|
|
366
|
+
const suppressClickRef = react.useRef(false);
|
|
321
367
|
const [avail, setAvail] = react.useState(() => {
|
|
322
|
-
const
|
|
323
|
-
return
|
|
368
|
+
const el = typeof document === "undefined" ? null : document.querySelector(THREAD_AREA_SELECTOR);
|
|
369
|
+
return el instanceof HTMLElement && el.clientWidth > 0 ? el.clientWidth : AUTO_PANEL_MIN_WIDTH;
|
|
324
370
|
});
|
|
325
371
|
react.useEffect(() => {
|
|
326
372
|
const node = sentinel.current;
|
|
327
|
-
const
|
|
328
|
-
|
|
373
|
+
const tabs = document.querySelector(TOPBAR_TABS_SELECTOR);
|
|
374
|
+
const nextHost = tabs ?? node?.closest(THREAD_AREA_SELECTOR) ?? null;
|
|
375
|
+
setHost(nextHost instanceof HTMLElement ? nextHost : null);
|
|
376
|
+
const nextArea = node?.closest(THREAD_AREA_SELECTOR) ?? null;
|
|
377
|
+
setArea(nextArea instanceof HTMLElement ? nextArea : null);
|
|
329
378
|
}, [view]);
|
|
330
379
|
react.useEffect(() => {
|
|
331
|
-
if (
|
|
332
|
-
const element =
|
|
380
|
+
if (area === null) return void 0;
|
|
381
|
+
const element = area;
|
|
333
382
|
const measure = () => setAvail(element.clientWidth);
|
|
334
383
|
measure();
|
|
335
384
|
if (typeof ResizeObserver === "undefined") {
|
|
@@ -339,7 +388,93 @@ function StatusPanel({ slots }) {
|
|
|
339
388
|
const observer = new ResizeObserver(measure);
|
|
340
389
|
observer.observe(element);
|
|
341
390
|
return () => observer.disconnect();
|
|
342
|
-
}, [
|
|
391
|
+
}, [area]);
|
|
392
|
+
const commitPos = react.useCallback((next) => {
|
|
393
|
+
posRef.current = next;
|
|
394
|
+
setPos(next);
|
|
395
|
+
if (next.x === 0 && next.y === 0) clearPos();
|
|
396
|
+
else writePos(next);
|
|
397
|
+
}, []);
|
|
398
|
+
const onMiniPointerDown = react.useCallback((event) => {
|
|
399
|
+
if (event.button !== 0) return;
|
|
400
|
+
const hostEl = box.current;
|
|
401
|
+
if (hostEl === null) return;
|
|
402
|
+
const bounds = dragBounds(hostEl, posRef.current);
|
|
403
|
+
if (bounds === null) return;
|
|
404
|
+
try {
|
|
405
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
406
|
+
} catch {
|
|
407
|
+
}
|
|
408
|
+
hostEl.setAttribute("data-dragging", "1");
|
|
409
|
+
dragRef.current = {
|
|
410
|
+
pointerId: event.pointerId,
|
|
411
|
+
startX: event.clientX,
|
|
412
|
+
startY: event.clientY,
|
|
413
|
+
baseX: posRef.current.x,
|
|
414
|
+
baseY: posRef.current.y,
|
|
415
|
+
bounds,
|
|
416
|
+
moved: false,
|
|
417
|
+
frame: null,
|
|
418
|
+
nextX: posRef.current.x,
|
|
419
|
+
nextY: posRef.current.y
|
|
420
|
+
};
|
|
421
|
+
}, []);
|
|
422
|
+
const onMiniPointerMove = react.useCallback((event) => {
|
|
423
|
+
const drag = dragRef.current;
|
|
424
|
+
if (drag === null || event.pointerId !== drag.pointerId) return;
|
|
425
|
+
const dx = event.clientX - drag.startX;
|
|
426
|
+
const dy = event.clientY - drag.startY;
|
|
427
|
+
if (!drag.moved && Math.abs(dx) < DRAG_SLOP && Math.abs(dy) < DRAG_SLOP) return;
|
|
428
|
+
drag.moved = true;
|
|
429
|
+
drag.nextX = clampIn(drag.baseX + dx, drag.bounds.minX, drag.bounds.maxX);
|
|
430
|
+
drag.nextY = clampIn(drag.baseY + dy, drag.bounds.minY, drag.bounds.maxY);
|
|
431
|
+
if (drag.frame !== null) return;
|
|
432
|
+
drag.frame = window.requestAnimationFrame(() => {
|
|
433
|
+
drag.frame = null;
|
|
434
|
+
const hostEl = box.current;
|
|
435
|
+
if (hostEl === null) return;
|
|
436
|
+
hostEl.style.transform = `translate3d(${String(drag.nextX)}px, ${String(drag.nextY)}px, 0)`;
|
|
437
|
+
});
|
|
438
|
+
}, []);
|
|
439
|
+
const onMiniPointerUp = react.useCallback((event) => {
|
|
440
|
+
const drag = dragRef.current;
|
|
441
|
+
if (drag === null || event.pointerId !== drag.pointerId) return;
|
|
442
|
+
dragRef.current = null;
|
|
443
|
+
if (drag.frame !== null) {
|
|
444
|
+
window.cancelAnimationFrame(drag.frame);
|
|
445
|
+
drag.frame = null;
|
|
446
|
+
}
|
|
447
|
+
try {
|
|
448
|
+
event.currentTarget.releasePointerCapture(event.pointerId);
|
|
449
|
+
} catch {
|
|
450
|
+
}
|
|
451
|
+
box.current?.removeAttribute("data-dragging");
|
|
452
|
+
if (!drag.moved) return;
|
|
453
|
+
suppressClickRef.current = true;
|
|
454
|
+
const moved = { x: drag.nextX, y: drag.nextY };
|
|
455
|
+
const final = Math.hypot(moved.x, moved.y) < SNAP_BACK_PX ? { x: 0, y: 0 } : moved;
|
|
456
|
+
const hostEl = box.current;
|
|
457
|
+
if (hostEl !== null) hostEl.style.transform = `translate3d(${String(final.x)}px, ${String(final.y)}px, 0)`;
|
|
458
|
+
commitPos(final);
|
|
459
|
+
}, [commitPos]);
|
|
460
|
+
react.useEffect(() => {
|
|
461
|
+
if (host === null) return void 0;
|
|
462
|
+
const onResize = () => {
|
|
463
|
+
const hostEl = box.current;
|
|
464
|
+
if (hostEl === null) return;
|
|
465
|
+
const bounds = dragBounds(hostEl, posRef.current);
|
|
466
|
+
if (bounds === null) return;
|
|
467
|
+
const current = posRef.current;
|
|
468
|
+
const clamped = {
|
|
469
|
+
x: clampIn(current.x, bounds.minX, bounds.maxX),
|
|
470
|
+
y: clampIn(current.y, bounds.minY, bounds.maxY)
|
|
471
|
+
};
|
|
472
|
+
if (clamped.x === current.x && clamped.y === current.y) return;
|
|
473
|
+
commitPos(clamped);
|
|
474
|
+
};
|
|
475
|
+
window.addEventListener("resize", onResize);
|
|
476
|
+
return () => window.removeEventListener("resize", onResize);
|
|
477
|
+
}, [host, commitPos]);
|
|
343
478
|
react.useEffect(() => {
|
|
344
479
|
if (usingShared) return void 0;
|
|
345
480
|
let alive = true;
|
|
@@ -565,7 +700,10 @@ function StatusPanel({ slots }) {
|
|
|
565
700
|
{
|
|
566
701
|
className: "sp-host",
|
|
567
702
|
ref: box,
|
|
568
|
-
style: {
|
|
703
|
+
style: {
|
|
704
|
+
"--sp-avail": `${String(avail)}px`,
|
|
705
|
+
transform: `translate3d(${String(pos.x)}px, ${String(pos.y)}px, 0)`
|
|
706
|
+
},
|
|
569
707
|
children: [
|
|
570
708
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
571
709
|
"aside",
|
|
@@ -585,8 +723,16 @@ function StatusPanel({ slots }) {
|
|
|
585
723
|
"aria-hidden": expanded,
|
|
586
724
|
tabIndex: expanded ? -1 : 0,
|
|
587
725
|
inert: expanded,
|
|
588
|
-
"data-tip": "
|
|
726
|
+
"data-tip": "展开状态面板(按住可以拖动)",
|
|
727
|
+
onPointerDown: onMiniPointerDown,
|
|
728
|
+
onPointerMove: onMiniPointerMove,
|
|
729
|
+
onPointerUp: onMiniPointerUp,
|
|
730
|
+
onPointerCancel: onMiniPointerUp,
|
|
589
731
|
onClick: () => {
|
|
732
|
+
if (suppressClickRef.current) {
|
|
733
|
+
suppressClickRef.current = false;
|
|
734
|
+
return;
|
|
735
|
+
}
|
|
590
736
|
chooseMode("panel");
|
|
591
737
|
},
|
|
592
738
|
children: /* @__PURE__ */ jsxRuntime.jsx(MiniSummary, { summary })
|
|
@@ -791,10 +937,6 @@ function MiniSummary({ summary }) {
|
|
|
791
937
|
} else if (summary.kind === "git") {
|
|
792
938
|
icon = /* @__PURE__ */ jsxRuntime.jsx(ui$1.IconDiff, { size: 13 });
|
|
793
939
|
text = "更改";
|
|
794
|
-
trail = /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sp-git-delta", children: [
|
|
795
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sp-add", children: `+${String(summary.added)}` }),
|
|
796
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sp-del", children: `−${String(summary.removed)}` })
|
|
797
|
-
] });
|
|
798
940
|
} else if (summary.kind === "goal-done") {
|
|
799
941
|
icon = /* @__PURE__ */ jsxRuntime.jsx(ui$1.IconTarget, { size: 13, className: "sp-icon-done" });
|
|
800
942
|
text = summary.text;
|
|
@@ -1149,10 +1291,7 @@ function GitSection({
|
|
|
1149
1291
|
open,
|
|
1150
1292
|
separated,
|
|
1151
1293
|
onToggle,
|
|
1152
|
-
trail:
|
|
1153
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sp-add", children: `+${String(git.added)}` }),
|
|
1154
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sp-del", children: `−${String(git.removed)}` })
|
|
1155
|
-
] }),
|
|
1294
|
+
trail: null,
|
|
1156
1295
|
children: /* @__PURE__ */ jsxRuntime.jsxs("ul", { className: "sp-list", children: [
|
|
1157
1296
|
/* @__PURE__ */ jsxRuntime.jsx("li", { className: "sp-row", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1158
1297
|
"button",
|