@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
package/lib/plugins/commands.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import { mkdirSync, writeFileSync, readFileSync } from 'node:fs';
|
|
12
12
|
import { spawn } from 'node:child_process';
|
|
13
13
|
import { dirname, join } from 'node:path';
|
|
14
|
-
import {
|
|
14
|
+
import { collectReviewScope, listReviewBranches, listReviewCommits, reviewStatusText, reviewTaskText, } from '../core/git-info.js';
|
|
15
15
|
import { estimateTokens } from '../core/compact.js';
|
|
16
16
|
import { exportSessionMarkdown } from '../core/session-export.js';
|
|
17
17
|
import { checkForUpdate } from '../core/update-check.js';
|
|
@@ -20,7 +20,7 @@ import { discoverThirdPartyUiArtifacts, readUiPluginManifestReport } from '../co
|
|
|
20
20
|
import { dscPath } from '../core/path-policy.js';
|
|
21
21
|
import { trustUiPlugin } from '../core/plugin-registry.js';
|
|
22
22
|
import { DSC_VERSION } from '../core/version.js';
|
|
23
|
-
import { addExtraSpec, allSpecs, BUILT_IN_COMMANDS, expandCommand, helpText, removeExtraSpec, } from '../core/commands-completion.js';
|
|
23
|
+
import { addExtraSpec, allSpecs, BUILT_IN_COMMANDS, expandCommand, helpText, removeExtraSpec, shellHelpText, } from '../core/commands-completion.js';
|
|
24
24
|
/** 当前壳的 `@dsc/ui` 契约版本(内置清单顶层那个);读不到就不设门(发现层会给出问题清单)。 */
|
|
25
25
|
function shellApiVersionForTrust() {
|
|
26
26
|
return readUiPluginManifestReport().apiVersion;
|
|
@@ -32,6 +32,22 @@ export const commandsPlugin = {
|
|
|
32
32
|
provide: 'commands',
|
|
33
33
|
apply(ctx) {
|
|
34
34
|
const registry = new Map();
|
|
35
|
+
/**
|
|
36
|
+
* `/help` 的文本按通道给:壳只列 `shell: true` 那批,终端列全量。
|
|
37
|
+
* 两处共用一个注册表,但能跑的范围不同——文本必须跟着范围走(2026-10-27 查账)。
|
|
38
|
+
*/
|
|
39
|
+
const helpFor = (ui) => ui.shell === true ? shellHelpText() : helpText(service.specs());
|
|
40
|
+
/**
|
|
41
|
+
* 内置命令的 spec:**只从那张表取**,这里不再抄一份 args / description。
|
|
42
|
+
*
|
|
43
|
+
* 为什么原先抄过:注册要一个完整 CommandSpec,而 handler 是这一侧的事。但注册时
|
|
44
|
+
* `register` 本来就会用 BUILT_IN 行覆盖它(下面那行 `builtin ?? spec`),抄的那份
|
|
45
|
+
* 永远不生效——于是它只是第二份说明书,改文案时改错地方、也不会有人发现。
|
|
46
|
+
*
|
|
47
|
+
* @param name 内置命令名
|
|
48
|
+
* @returns 表里那一行;表里没有(理论上不该发生)时给一个只有名字的空壳
|
|
49
|
+
*/
|
|
50
|
+
const builtinSpec = (name) => BUILT_IN_COMMANDS.find((entry) => entry.name === name) ?? { name, args: '', description: '' };
|
|
35
51
|
const service = {
|
|
36
52
|
register(spec, handler) {
|
|
37
53
|
// duringTask 以 BUILT_IN 表为准(spec 单一真源):内置名注册时把声明合并进来,
|
|
@@ -58,12 +74,12 @@ export const commandsPlugin = {
|
|
|
58
74
|
const command = parts[0] ?? '';
|
|
59
75
|
const args = parts.slice(1);
|
|
60
76
|
if (command === '') {
|
|
61
|
-
ui.notice(
|
|
77
|
+
ui.notice(helpFor(ui));
|
|
62
78
|
return true;
|
|
63
79
|
}
|
|
64
80
|
const entry = registry.get(command);
|
|
65
81
|
if (entry === undefined) {
|
|
66
|
-
ui.notice(`未知命令:/${command}(/help
|
|
82
|
+
ui.notice(`未知命令:/${command}(/help 查看命令清单)`);
|
|
67
83
|
return true;
|
|
68
84
|
}
|
|
69
85
|
// T44:可用性矩阵统一在派发这一闸——回合跑着的时候 deny 的命令挡下,
|
|
@@ -78,16 +94,12 @@ export const commandsPlugin = {
|
|
|
78
94
|
},
|
|
79
95
|
};
|
|
80
96
|
// ---- 内置命令注册 ----
|
|
81
|
-
service.register(
|
|
82
|
-
service.register(
|
|
83
|
-
service.register(
|
|
84
|
-
service.register(
|
|
85
|
-
service.register(
|
|
86
|
-
service.register({
|
|
87
|
-
name: 'model',
|
|
88
|
-
args: '<[端点/]模型名>',
|
|
89
|
-
description: '切换模型,下一次请求生效(无参数打开选择器)',
|
|
90
|
-
}, ({ args, runtime, ui }) => {
|
|
97
|
+
service.register(builtinSpec('help'), ({ ui }) => ui.notice(helpFor(ui)));
|
|
98
|
+
service.register(builtinSpec('new'), ({ runtime }) => void runtime.openSession(undefined));
|
|
99
|
+
service.register(builtinSpec('resume'), ({ ui }) => ui.openPicker());
|
|
100
|
+
service.register(builtinSpec('agents'), ({ ui }) => ui.openAgents?.());
|
|
101
|
+
service.register(builtinSpec('settings'), ({ ui }) => ui.openSettings?.());
|
|
102
|
+
service.register(builtinSpec('model'), ({ args, runtime, ui }) => {
|
|
91
103
|
const model = args[0];
|
|
92
104
|
if (model === undefined || model === '') {
|
|
93
105
|
// 裸 /model 直接开选择器;用法提示只活在补全面板里(打 / 就能看到),
|
|
@@ -97,7 +109,7 @@ export const commandsPlugin = {
|
|
|
97
109
|
}
|
|
98
110
|
void runtime.setModel(model);
|
|
99
111
|
});
|
|
100
|
-
service.register(
|
|
112
|
+
service.register(builtinSpec('status'), ({ ui }) => {
|
|
101
113
|
const session = ctx.session.current();
|
|
102
114
|
const messages = session.messages;
|
|
103
115
|
const compact = ctx.get('compact');
|
|
@@ -111,13 +123,13 @@ export const commandsPlugin = {
|
|
|
111
123
|
autoCompactPercent: compact !== undefined ? compact.describe().autoCompactPercent : 80,
|
|
112
124
|
}));
|
|
113
125
|
});
|
|
114
|
-
service.register(
|
|
126
|
+
service.register(builtinSpec('usage'), ({ runtime, ui }) => {
|
|
115
127
|
void runtime
|
|
116
128
|
.usageStats()
|
|
117
129
|
.then((stats) => ui.notice(usageReport(stats)))
|
|
118
130
|
.catch((cause) => ui.notice(`/usage 失败:${cause instanceof Error ? cause.message : String(cause)}`));
|
|
119
131
|
});
|
|
120
|
-
service.register(
|
|
132
|
+
service.register(builtinSpec('export'), ({ args, ui }) => {
|
|
121
133
|
const session = ctx.session.current();
|
|
122
134
|
if (session.messages.length === 0) {
|
|
123
135
|
ui.notice('这个会话还没有消息,没东西可导出。');
|
|
@@ -142,39 +154,143 @@ export const commandsPlugin = {
|
|
|
142
154
|
}
|
|
143
155
|
ui.notice(`已导出 ${session.messages.length} 条消息 → ${target}`);
|
|
144
156
|
});
|
|
145
|
-
|
|
146
|
-
|
|
157
|
+
// ── /review:先选范围,再派只读审查队友(T45)────────────────────────────
|
|
158
|
+
//
|
|
159
|
+
// 范围分四档,与 codex /review 同口径:不传参数就先问「审什么」——diff 从哪来
|
|
160
|
+
// 决定了这次审查在看什么,默认只审未提交改动会让「分支相对 main 改了什么」
|
|
161
|
+
// 这种最常见的诉求每次都得自己先跑 git diff 再贴过来。
|
|
162
|
+
// 传了参数(`/review 只看安全`)就按未提交改动审,那句话是关注点。
|
|
163
|
+
/** 范围卡的四个选项(顺序即展示顺序)。 */
|
|
164
|
+
const REVIEW_SCOPE_OPTIONS = [
|
|
165
|
+
{ label: '对比基准分支', description: '从共同祖先审查当前分支的更改' },
|
|
166
|
+
{ label: '审查未提交的更改', description: '暂存、未暂存与未跟踪的净改动' },
|
|
167
|
+
{ label: '审查某次提交', description: '挑一个提交看它改了什么' },
|
|
168
|
+
{ label: '自定义审查要求', description: '写一段要求,按它审当前改动' },
|
|
169
|
+
];
|
|
170
|
+
/** 界面在用户点「跳过」时交回的原文(`answerOf` 的口径);与空串一样算没答。 */
|
|
171
|
+
const SKIPPED_ANSWER = '(用户跳过了这一题)';
|
|
172
|
+
/**
|
|
173
|
+
* 弹一张卡问一句,返回答案原文(空串 = 没答 / 跳过 / 没有提问通道)。
|
|
174
|
+
*
|
|
175
|
+
* 为什么这里的信号是自己 new 的:斜杠命令这条路口**没有回合取消信号**(它不是模型
|
|
176
|
+
* 发起的那一轮工具调用),所以卡只能由用户自己答完或跳过。这个控制器因此不会主动
|
|
177
|
+
* abort,只是为了满足 ask 的契约参数。
|
|
178
|
+
*/
|
|
179
|
+
const askInCard = async (ask, question, signal) => {
|
|
180
|
+
const answer = await ask.ask({
|
|
181
|
+
question: question.question,
|
|
182
|
+
header: '代码审查',
|
|
183
|
+
options: question.options,
|
|
184
|
+
multiSelect: false,
|
|
185
|
+
allowFreeText: true,
|
|
186
|
+
}, signal);
|
|
187
|
+
const text = answer.trim();
|
|
188
|
+
return text === SKIPPED_ANSWER ? '' : text;
|
|
189
|
+
};
|
|
190
|
+
/**
|
|
191
|
+
* 问出这次要审的范围;用户取消或空答返回 null(调用方收口成「审查已取消」)。
|
|
192
|
+
*
|
|
193
|
+
* 在范围卡上直接写自由文本时按「自定义审查要求」理解:用户写了话就是有要求,
|
|
194
|
+
* 再追问一遍「你要什么要求」是废话。
|
|
195
|
+
*/
|
|
196
|
+
const pickReviewTarget = async (cwd, ask, signal) => {
|
|
197
|
+
const choice = await askInCard(ask, { question: '选择审查范围', options: REVIEW_SCOPE_OPTIONS }, signal);
|
|
198
|
+
if (choice === '')
|
|
199
|
+
return null;
|
|
200
|
+
if (choice === '审查未提交的更改')
|
|
201
|
+
return { kind: 'worktree' };
|
|
202
|
+
if (choice === '自定义审查要求') {
|
|
203
|
+
const instructions = await askInCard(ask, { question: '写一段审查要求,按它审当前的未提交改动', options: [] }, signal);
|
|
204
|
+
return instructions === '' ? null : { kind: 'custom', instructions };
|
|
205
|
+
}
|
|
206
|
+
if (choice === '对比基准分支') {
|
|
207
|
+
const branches = await listReviewBranches(cwd);
|
|
208
|
+
const ref = await askInCard(ask, { question: '选择基准分支,也可以直接填写分支名或引用', options: branches.map((branch) => ({ label: branch })) }, signal);
|
|
209
|
+
return ref === '' ? null : { kind: 'base', ref };
|
|
210
|
+
}
|
|
211
|
+
if (choice === '审查某次提交') {
|
|
212
|
+
const commits = await listReviewCommits(cwd);
|
|
213
|
+
const labels = commits.map((commit) => `${commit.sha.slice(0, 10)} ${commit.subject}`.trim());
|
|
214
|
+
const answer = await askInCard(ask, { question: '选择提交,也可以直接填写提交 SHA', options: labels.map((label) => ({ label })) }, signal);
|
|
215
|
+
if (answer === '')
|
|
216
|
+
return null;
|
|
217
|
+
const at = labels.indexOf(answer);
|
|
218
|
+
const picked = at < 0 ? undefined : commits[at];
|
|
219
|
+
// 手填的 SHA 认不出来也照样交给 git:它自己会报「找不到这个引用」
|
|
220
|
+
return picked === undefined
|
|
221
|
+
? { kind: 'commit', ref: answer }
|
|
222
|
+
: { kind: 'commit', ref: picked.sha, ...(picked.subject === '' ? {} : { title: picked.subject }) };
|
|
223
|
+
}
|
|
224
|
+
// 认不出的答案就是用户在卡上直接写的要求
|
|
225
|
+
return { kind: 'custom', instructions: choice };
|
|
226
|
+
};
|
|
227
|
+
service.register(builtinSpec('review'), ({ args, runtime, ui }) => {
|
|
228
|
+
const session = ctx.session.current();
|
|
229
|
+
const cwd = session.meta.cwd;
|
|
147
230
|
const focus = args.join(' ').trim();
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
231
|
+
// 本命令自己的信号(见 askInCard 的说明):命令这条路口没有回合取消信号。
|
|
232
|
+
const signal = new AbortController().signal;
|
|
233
|
+
void (async () => {
|
|
234
|
+
const ask = ctx.get('ask');
|
|
235
|
+
let target;
|
|
236
|
+
if (focus !== '') {
|
|
237
|
+
// 有参数 = 审未提交改动,那句话是关注点(不再弹卡,按回车就开跑)
|
|
238
|
+
target = { kind: 'worktree' };
|
|
239
|
+
}
|
|
240
|
+
else if (ask === undefined) {
|
|
241
|
+
// 没有提问通道(ask 插件关着):退回默认口径,别让命令整个不可用
|
|
242
|
+
ui.notice('这个会话没有提问卡通道,/review 按未提交改动审。');
|
|
243
|
+
target = { kind: 'worktree' };
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
target = await pickReviewTarget(cwd, ask, signal);
|
|
247
|
+
}
|
|
248
|
+
if (target === null) {
|
|
249
|
+
ui.notice('审查已取消。');
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
const scope = await collectReviewScope(cwd, target, session.meta.id);
|
|
253
|
+
if (scope === null) {
|
|
151
254
|
ui.notice('这里不是 git 仓库,/review 没有可审查的改动。');
|
|
152
255
|
return;
|
|
153
256
|
}
|
|
154
|
-
if (
|
|
155
|
-
ui.notice(
|
|
257
|
+
if (scope.diffBytes === 0 && scope.untracked.length === 0) {
|
|
258
|
+
ui.notice(`这个范围里没有可审查的改动(${scope.label})。`);
|
|
156
259
|
return;
|
|
157
260
|
}
|
|
261
|
+
// 自定义要求已经写进 scope.target,不再算一次「关注点」(否则任务书里会出现两遍)
|
|
262
|
+
const effectiveFocus = target.kind === 'custom' ? '' : focus;
|
|
158
263
|
// T18:subagent 插件开着就走只读审查队友——后台审,findings 直接出卡片,
|
|
159
|
-
//
|
|
264
|
+
// 不占用当前会话的模型轮;插件没开(或额度满)回落主会话审查轮。
|
|
160
265
|
const review = ctx.get('review');
|
|
161
266
|
if (review !== undefined) {
|
|
162
|
-
const spawned = review.spawn({
|
|
267
|
+
const spawned = review.spawn({ scope, focus: effectiveFocus });
|
|
163
268
|
if (spawned.ok) {
|
|
164
|
-
ui.notice(`已派出只读审查队友 ${spawned.name}
|
|
269
|
+
ui.notice(`已派出只读审查队友 ${spawned.name}(范围:${scope.label}),结论出来后直接出现在会话里;/review-status 看状态,/review-cancel 取消`);
|
|
165
270
|
return;
|
|
166
271
|
}
|
|
167
272
|
ui.notice(`/review 没派出审查队友(${spawned.reason}),改在本会话里审`);
|
|
168
273
|
}
|
|
169
274
|
// 组装一条审查请求走正常对话轮(runtime.submit → agent.followup):
|
|
170
275
|
// 回复就是审查意见,与用户自己贴着 diff 问「帮我看看」同一条链路。
|
|
171
|
-
runtime.submit(
|
|
172
|
-
})
|
|
173
|
-
.
|
|
174
|
-
ui.notice(`/review 失败:${cause instanceof Error ? cause.message : String(cause)}`);
|
|
276
|
+
runtime.submit(reviewTaskText(scope, effectiveFocus));
|
|
277
|
+
})().catch((cause) => {
|
|
278
|
+
ui.notice(`/review 失败:${errText(cause)}`);
|
|
175
279
|
});
|
|
176
280
|
});
|
|
177
|
-
service.register(
|
|
281
|
+
service.register(builtinSpec('review-status'), ({ ui }) => {
|
|
282
|
+
// 审查通道不存在(subagent 插件关着)时就是「没有记录」,与没跑过审查同一种回答
|
|
283
|
+
ui.notice(reviewStatusText(ctx.get('review')?.status() ?? null));
|
|
284
|
+
});
|
|
285
|
+
service.register(builtinSpec('review-cancel'), ({ ui }) => {
|
|
286
|
+
const review = ctx.get('review');
|
|
287
|
+
if (review === undefined) {
|
|
288
|
+
ui.notice('审查通道没开着(subagent 插件关着),当前没有在跑的审查。');
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
ui.notice(review.cancel() ? '已取消这次审查。' : '当前没有在跑的审查。');
|
|
292
|
+
});
|
|
293
|
+
service.register(builtinSpec('diff'), ({ args, runtime, ui }) => {
|
|
178
294
|
const file = args[0];
|
|
179
295
|
void runtime
|
|
180
296
|
.dock('git-diff', file === undefined ? {} : { file })
|
|
@@ -184,7 +300,7 @@ export const commandsPlugin = {
|
|
|
184
300
|
})
|
|
185
301
|
.catch((cause) => ui.notice(`/diff 失败:${cause instanceof Error ? cause.message : String(cause)}`));
|
|
186
302
|
});
|
|
187
|
-
service.register(
|
|
303
|
+
service.register(builtinSpec('copy'), ({ runtime, ui }) => {
|
|
188
304
|
const entries = runtime.getSnapshot().entries;
|
|
189
305
|
let text = null;
|
|
190
306
|
for (let index = entries.length - 1; index >= 0; index -= 1) {
|
|
@@ -232,18 +348,14 @@ export const commandsPlugin = {
|
|
|
232
348
|
: `「${args[0]}」匹配到 ${matches.length} 个档位,请写全`);
|
|
233
349
|
return;
|
|
234
350
|
}
|
|
235
|
-
|
|
351
|
+
const picked = matches[0];
|
|
352
|
+
runtime.setPolicy(picked.id);
|
|
353
|
+
// 回执在这里给:approval 的 setter 不再往对话里写(启动时会被复算刷好几行),
|
|
354
|
+
// 而斜杠命令是用户主动要的那一下,没个回音就像没生效。
|
|
355
|
+
ui.notice(`权限模式已切到「${picked.label}」`);
|
|
236
356
|
};
|
|
237
|
-
service.register(
|
|
238
|
-
|
|
239
|
-
args: '[readonly|auto-edit|full-access]',
|
|
240
|
-
description: '查看或切换权限模式(自动放行集那一轴)',
|
|
241
|
-
}, switchPolicy);
|
|
242
|
-
service.register({
|
|
243
|
-
name: 'reviewer',
|
|
244
|
-
args: '[user|auto-review]',
|
|
245
|
-
description: '查看或切换审批审阅者(要问的事先给谁看)',
|
|
246
|
-
}, ({ args, runtime, ui }) => {
|
|
357
|
+
service.register(builtinSpec('policy'), switchPolicy);
|
|
358
|
+
service.register(builtinSpec('reviewer'), ({ args, runtime, ui }) => {
|
|
247
359
|
const surface = runtime.getSnapshot().surfaces.policy;
|
|
248
360
|
const query = args[0]?.toLowerCase() ?? '';
|
|
249
361
|
if (query === '') {
|
|
@@ -261,13 +373,11 @@ export const commandsPlugin = {
|
|
|
261
373
|
: `「${args[0]}」匹配到 ${matches.length} 个审阅者,请写全`);
|
|
262
374
|
return;
|
|
263
375
|
}
|
|
264
|
-
|
|
376
|
+
const picked = matches[0];
|
|
377
|
+
runtime.setReviewer(picked.id);
|
|
378
|
+
ui.notice(`审批审阅者已切到「${picked.label}」${picked.id === 'auto-review' ? ':要问的事先给模型判官,判不出来仍会问你' : ''}`);
|
|
265
379
|
});
|
|
266
|
-
service.register({
|
|
267
|
-
name: 'permission',
|
|
268
|
-
args: '[预设名]',
|
|
269
|
-
description: '查看或切换打包权限预设(沙箱 + 权限模式 + 审阅者三合一)',
|
|
270
|
-
}, ({ args, runtime, ui }) => {
|
|
380
|
+
service.register(builtinSpec('permission'), ({ args, runtime, ui }) => {
|
|
271
381
|
const presets = runtime.getSnapshot().surfaces.permissionPresets;
|
|
272
382
|
const query = args[0] ?? '';
|
|
273
383
|
if (query === '') {
|
|
@@ -294,7 +404,7 @@ export const commandsPlugin = {
|
|
|
294
404
|
if (!result.ok)
|
|
295
405
|
ui.notice(result.error);
|
|
296
406
|
});
|
|
297
|
-
service.register(
|
|
407
|
+
service.register(builtinSpec('effort'), ({ args, runtime, ui }) => {
|
|
298
408
|
const levels = [
|
|
299
409
|
{ id: 'default', label: '默认(不声明思考字段,跟随端点)' },
|
|
300
410
|
{ id: 'off', label: '关闭思考' },
|
|
@@ -323,7 +433,7 @@ export const commandsPlugin = {
|
|
|
323
433
|
service.register(
|
|
324
434
|
// dsh 语义:整本分叉成「可恢复的副本」,现场会话与跑动回合不动(kimi-code
|
|
325
435
|
// 的 fork)。按分叉点选副本走 /resume 里的 Ctrl+F,这里只做整本。
|
|
326
|
-
|
|
436
|
+
builtinSpec('fork'), ({ runtime, ui }) => {
|
|
327
437
|
// sessionId 是 uuid,当文件用会按进程 cwd 解析出 ENOENT(0.6.66 实锤:
|
|
328
438
|
// C:\Windows\System32\<uuid>);落盘一律走 sessionPath。
|
|
329
439
|
const path = runtime.getSnapshot().status.sessionPath;
|
|
@@ -349,7 +459,7 @@ export const commandsPlugin = {
|
|
|
349
459
|
service.register(
|
|
350
460
|
// 思考块显示切换:与 Ctrl+T 同一状态(会话内生效,不持久化——持久化的
|
|
351
461
|
// 默认值在设置「新会话的思考块默认摊开」)。没有思考块的端忽略回调。
|
|
352
|
-
|
|
462
|
+
builtinSpec('thinking'), ({ args, ui }) => {
|
|
353
463
|
if (ui.toggleThinking === undefined) {
|
|
354
464
|
ui.notice('当前界面不支持会话内切换思考块(桌面端在设置里改「新会话的思考块默认摊开」)。');
|
|
355
465
|
return;
|
|
@@ -365,7 +475,7 @@ export const commandsPlugin = {
|
|
|
365
475
|
}
|
|
366
476
|
ui.toggleThinking(query === 'on');
|
|
367
477
|
});
|
|
368
|
-
service.register(
|
|
478
|
+
service.register(builtinSpec('plugins'), ({ runtime, ui }) => {
|
|
369
479
|
const plugins = runtime.listPlugins();
|
|
370
480
|
if (plugins.length === 0) {
|
|
371
481
|
ui.notice('没有已挂载的插件(内核自带服务不在此列)。');
|
|
@@ -387,7 +497,7 @@ export const commandsPlugin = {
|
|
|
387
497
|
service.register(
|
|
388
498
|
// 只查不装(0.6.50 起的边界):结果与设置「关于」的检查按钮同一份回执口径,
|
|
389
499
|
// 终端打不开浏览器,新版时把发布页 URL 一并给出。
|
|
390
|
-
|
|
500
|
+
builtinSpec('update'), ({ ui }) => {
|
|
391
501
|
void checkForUpdate()
|
|
392
502
|
.then((result) => {
|
|
393
503
|
if (!result.ok) {
|
|
@@ -398,7 +508,7 @@ export const commandsPlugin = {
|
|
|
398
508
|
})
|
|
399
509
|
.catch((cause) => ui.notice(`/update 失败:${errText(cause)}`));
|
|
400
510
|
});
|
|
401
|
-
service.register(
|
|
511
|
+
service.register(builtinSpec('ui-trust'), ({ args, ui }) => {
|
|
402
512
|
const name = args[0] ?? '';
|
|
403
513
|
if (name === '') {
|
|
404
514
|
// 列出当前等着被确认的(discover 的 problems 里就有它们的名字)。
|
|
@@ -436,7 +546,7 @@ export const commandsPlugin = {
|
|
|
436
546
|
' 生效:重启宿主(或刷新浏览器页面)后装载;停用走 plugins.json 的启停或插件中心',
|
|
437
547
|
].join('\n'));
|
|
438
548
|
});
|
|
439
|
-
service.register(
|
|
549
|
+
service.register(builtinSpec('exit'), ({ runtime }) => runtime.exit());
|
|
440
550
|
serviceRef = service;
|
|
441
551
|
ctx.provide('commands', service);
|
|
442
552
|
},
|
package/lib/plugins/compact.d.ts
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
* 摘要调用复用主对话前缀(2026-10-03):系统提示词取自 prompt 服务、工具目录取自 tools 服务,
|
|
12
12
|
* 摘要请求因此是上一次真实请求的前缀扩展,命中服务端 KV 缓存(见 core/compact.ts 的 context 参数)。
|
|
13
13
|
*
|
|
14
|
-
*
|
|
15
|
-
* read-state 文件数、read-state 字符预算)读自己的插件配置,
|
|
14
|
+
* 九个可调值(保留条数、保留尾部的窗口占比、自动压缩触发线、安全余量、压一次不够时最多再压几次、
|
|
15
|
+
* 锚点索引字符预算、用户原话字符预算、read-state 文件数、read-state 字符预算)读自己的插件配置,
|
|
16
16
|
* 并以设置分区的面目交给界面;保存后本插件立刻重读,下一次压缩就用新值。
|
|
17
17
|
*
|
|
18
18
|
* @module dsc/plugins/compact
|