@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,208 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 契约分域:session
|
|
3
|
+
*
|
|
4
|
+
* 从 `src/contract.ts` 拆出来的一个域(纯搬移,逐字未改)。调用方照旧 import
|
|
5
|
+
* `../contract.js`——那份文件现在只做转出,导出面一个没少。
|
|
6
|
+
*
|
|
7
|
+
* @module dsc/contract/session
|
|
8
|
+
*/
|
|
9
|
+
/** /resume 会话选择器与侧栏的一行。 */
|
|
10
|
+
export interface SessionSummary {
|
|
11
|
+
/** jsonl 的绝对路径(UI 侧的会话标识就是它)。 */
|
|
12
|
+
id: string;
|
|
13
|
+
cwd: string;
|
|
14
|
+
createdAt: number;
|
|
15
|
+
/** 最后一次写入日志的时间(文件 mtime),「按最近使用」排序的键。 */
|
|
16
|
+
updatedAt: number;
|
|
17
|
+
/** 会话标题:用户改名 → 自动生成(T16)→ 首条用户消息截断;都没有时 undefined。 */
|
|
18
|
+
title?: string;
|
|
19
|
+
/** 置顶时间;undefined = 未置顶。 */
|
|
20
|
+
pinnedAt?: number;
|
|
21
|
+
/** 归档时间;undefined = 还在活动区。归档不等于删除,恢复后回到列表。 */
|
|
22
|
+
archivedAt?: number;
|
|
23
|
+
/**
|
|
24
|
+
* 这一行是**当前**那条还没发过消息的会话:路径已经定下,但文件还没落盘
|
|
25
|
+
* (宿主 `refresh()` 为它补的临时行,切走就没了)。
|
|
26
|
+
*
|
|
27
|
+
* 界面据此把它当“只读回执”画:改名 / 置顶 / 归档 / 分叉都按路径找文件,
|
|
28
|
+
* 文件还不存在,点了只会弹失败——这类动作对它一律不给。
|
|
29
|
+
*/
|
|
30
|
+
unsaved?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/** 归档列表的一行(设置 → 归档)。 */
|
|
33
|
+
export interface ArchivedSessionView {
|
|
34
|
+
/** 归档区里那个 jsonl 的绝对路径(恢复与永久删除都以它为准)。 */
|
|
35
|
+
path: string;
|
|
36
|
+
cwd: string;
|
|
37
|
+
title?: string;
|
|
38
|
+
createdAt: number;
|
|
39
|
+
updatedAt: number;
|
|
40
|
+
/** 归档时间;老数据没记过就退化成文件时间。 */
|
|
41
|
+
archivedAt: number;
|
|
42
|
+
}
|
|
43
|
+
/** 归档页的一页数据:条目 + 回收站情况。 */
|
|
44
|
+
export interface ArchivedPage {
|
|
45
|
+
items: ArchivedSessionView[];
|
|
46
|
+
/** 回收站目录:永久删除的会话先进这里,保留 30 天。 */
|
|
47
|
+
trashDir: string;
|
|
48
|
+
/** 回收站里现有的文件数(超过 30 天的在下一次读归档页时清掉)。 */
|
|
49
|
+
trashCount: number;
|
|
50
|
+
}
|
|
51
|
+
/** 会话排序方式:手动(工作区按拖动顺序)、按最近写入时间,或按创建时间。 */
|
|
52
|
+
export type SessionSortKey = 'manual' | 'recent' | 'created';
|
|
53
|
+
/** 列表分组方式:按工作区分组、按工作区目录树嵌套,或平铺成单列表。 */
|
|
54
|
+
export type SessionGroupKey = 'workspace' | 'tree' | 'flat';
|
|
55
|
+
/** 已归档会话在侧栏里的显隐:隐藏(默认)、并入列表一起看,或只看归档。 */
|
|
56
|
+
export type ArchivedFilter = 'hide' | 'show' | 'only';
|
|
57
|
+
/** 主题模式:固定深色、固定浅色,或跟着系统的浅色偏好走。 */
|
|
58
|
+
export type ThemeMode = 'dark' | 'light' | 'claude' | 'system';
|
|
59
|
+
/**
|
|
60
|
+
* 全局字号缩放倍数(1 = 正文 13px 基准)。桌面端把它直接写成 `--dsc-font-scale`。
|
|
61
|
+
*
|
|
62
|
+
* 0.6 之前的存档里这里是 `'sm' | 'md' | 'lg'` 三档字符串,读档时迁移成
|
|
63
|
+
* 0.92 / 1 / 1.12(见 core/prefs.ts 的 readPrefs)。
|
|
64
|
+
*/
|
|
65
|
+
export type UiFontSize = number;
|
|
66
|
+
/** 密度档位:行高与纵向内距的整体缩放(紧凑 / 标准 / 宽松)。 */
|
|
67
|
+
export type UiDensity = 'compact' | 'standard' | 'roomy';
|
|
68
|
+
/**
|
|
69
|
+
* 过程折叠程度:对话流里「思考 / 工具调用」这些过程条目的展示档位。
|
|
70
|
+
*
|
|
71
|
+
* 四档与 dsh 的展示档位一一对应(packages/client/ui-chat/src/client/presentation-policy.ts:24-53),
|
|
72
|
+
* 每档开哪几项能力见 desktop/src/renderer/appearance.ts 的 PROCESS_FOLD_POLICIES:
|
|
73
|
+
*
|
|
74
|
+
* - `compact`:整轮折叠 + 阶段分组 + 不显示思考行摘要 + 组头不带实时详情;
|
|
75
|
+
* - `standard`:整轮折叠 + 阶段分组 + 摘要 + 组头带实时详情(默认);
|
|
76
|
+
* - `detailed`:整轮折叠,但**只有历史轮**才分组——正在跑的那一轮直接摊开;
|
|
77
|
+
* - `verbose`:整轮不折、阶段也不分组,过程条目逐条摊开。
|
|
78
|
+
*
|
|
79
|
+
* 为什么 `detailed` 和 `verbose` 都要有:dsh 里 `detailed` 是桌面端的实际默认档
|
|
80
|
+
* (ui-chat/src/client/apply.ts 里非 dsh 桌面端走 detailed),它的意思是「想看细节,但不想
|
|
81
|
+
* 每次都把历史摊开」——整轮照折,只有运行中的那一轮摊着。`verbose` 才是「什么都不折」。
|
|
82
|
+
* dsc 0.6.3 的三档里 `detailed` 曾经等于现在的 `verbose`,本次按 dsh 的语义改回
|
|
83
|
+
* 「折叠 + 只折历史轮」,原来那种「全摊开」的行为改由 `verbose` 承担。
|
|
84
|
+
*/
|
|
85
|
+
export type UiProcessFold = 'compact' | 'standard' | 'detailed' | 'verbose';
|
|
86
|
+
/**
|
|
87
|
+
* TUI 底部状态栏各段的显隐(存在 `~/.dsc/settings.json` 的 `ui.statusBar`)。
|
|
88
|
+
* 全部必填:读档由 {@link normalizeStatusBarPrefs} 补齐,消费方不需要判缺。
|
|
89
|
+
* 出厂口径对齐 dsh 底栏设置的默认——只留「身份 + 在看什么」,effort/模式/
|
|
90
|
+
* Token 累计/会话 ID 这类设定完就不再看的默认收掉,要的在 设置 → 终端界面 →
|
|
91
|
+
* 状态栏 子页里打开。
|
|
92
|
+
*/
|
|
93
|
+
export interface StatusBarPrefsView {
|
|
94
|
+
/** 模型名。 */
|
|
95
|
+
model: boolean;
|
|
96
|
+
/** 思考强度(effort 档位)。 */
|
|
97
|
+
effort: boolean;
|
|
98
|
+
/** 缓存命中率。 */
|
|
99
|
+
cache: boolean;
|
|
100
|
+
/** Token 累计(input/output)。 */
|
|
101
|
+
tokens: boolean;
|
|
102
|
+
/** 本会话费用估算(仅 DeepSeek 官方端点有数据)。 */
|
|
103
|
+
cost: boolean;
|
|
104
|
+
/** 会话模式(执行/计划/探索/免打扰)。 */
|
|
105
|
+
mode: boolean;
|
|
106
|
+
/** 权限模式。 */
|
|
107
|
+
policy: boolean;
|
|
108
|
+
/** 上下文用量百分比。 */
|
|
109
|
+
ctx: boolean;
|
|
110
|
+
/** 工作目录。 */
|
|
111
|
+
cwd: boolean;
|
|
112
|
+
/** 当前会话短 id。 */
|
|
113
|
+
session: boolean;
|
|
114
|
+
}
|
|
115
|
+
/** 侧栏界面偏好,存在 `~/.dsc/settings.json`,桌面端与以后别的界面共用。 */
|
|
116
|
+
export interface UiPrefsView {
|
|
117
|
+
sessionSort: SessionSortKey;
|
|
118
|
+
/** 侧栏会话列表的分组方式。 */
|
|
119
|
+
sessionGroup: SessionGroupKey;
|
|
120
|
+
/** 已归档会话在侧栏里的显隐。 */
|
|
121
|
+
archivedFilter: ArchivedFilter;
|
|
122
|
+
/** 手动拖出来的工作区顺序(cwd 绝对路径);没拖过是空数组。 */
|
|
123
|
+
workspaceOrder: string[];
|
|
124
|
+
/** 工作区显示名别名:cwd → 想要的名字。 */
|
|
125
|
+
workspaceAliases: Record<string, string>;
|
|
126
|
+
/** 主题模式。 */
|
|
127
|
+
themeMode: ThemeMode;
|
|
128
|
+
/** 字号缩放倍数(设置页滑杆可调范围 0.85–1.35)。 */
|
|
129
|
+
fontSize: UiFontSize;
|
|
130
|
+
/** 按钮缩放倍数(设置页滑杆可调范围 0.9–1.5),桌面端把它写成 `--dsc-btn-scale`。 */
|
|
131
|
+
buttonScale: number;
|
|
132
|
+
/** 密度档位。 */
|
|
133
|
+
density: UiDensity;
|
|
134
|
+
/** 过程折叠程度(紧凑 / 标准 / 详细 / 逐条摊开),默认 standard。 */
|
|
135
|
+
processFold: UiProcessFold;
|
|
136
|
+
/**
|
|
137
|
+
* 定稿的思考行默认展开吗(默认 false = 折叠成一行「思考过程」)。
|
|
138
|
+
*
|
|
139
|
+
* 为什么与 {@link processFold} 分成两套:档位管的是「整轮折不折、阶段要不要分组」这一层
|
|
140
|
+
* 结构,这两项管的是最里层「单条思考 / 单张工具卡默认长什么样」。dsh 没有这两项——它的
|
|
141
|
+
* 可选性只体现在四个档位加上每层手动开合,所以这是 dsc 自己的增量(用户要求「可选折叠
|
|
142
|
+
* 思考、工具调用」)。两条轴正交:档位是粗档,这两项是在档位之上的默认态微调。
|
|
143
|
+
*
|
|
144
|
+
* 只管**定稿**条目:跑动中的那一段思考永远是展开的(它是「现在在干什么」的唯一线索,
|
|
145
|
+
* 见 ThinkingBlock 的 showPreview 那条同样的理由)。用户手点的展开态优先于这里的默认值。
|
|
146
|
+
*/
|
|
147
|
+
reasoningDefaultOpen: boolean;
|
|
148
|
+
/** 工具卡默认展开吗(默认 false = 只显示一行「工具名 + 状态」)。口径同 {@link reasoningDefaultOpen}。 */
|
|
149
|
+
toolDefaultOpen: boolean;
|
|
150
|
+
/**
|
|
151
|
+
* 侧栏各工作区分组的展开状态(cwd → 展开?),对齐 dsh 的 groupExpansion:
|
|
152
|
+
* 点工作区行只切换它自己,别的组不跟着动;关掉再开也记得住。
|
|
153
|
+
* 键缺失 = 用默认(活动组与树模式父组展开,其余收起)。
|
|
154
|
+
*/
|
|
155
|
+
sessionExpansion: Record<string, boolean>;
|
|
156
|
+
/**
|
|
157
|
+
* 「手动排序」档下各工作区里会话行的顺序(cwd → 会话 jsonl 路径序列),
|
|
158
|
+
* 对齐 dsh 的 sessionOrderByAccount:会话行拖完落在这里,置顶块照旧排最前。
|
|
159
|
+
* 键缺失或表里没有的会话按最近使用排在后面。
|
|
160
|
+
*/
|
|
161
|
+
sessionOrder: Record<string, string[]>;
|
|
162
|
+
/**
|
|
163
|
+
* 一轮干完(跑动 → 空闲)时播一声完成提示音吗(默认开)。桌面端行为偏好:
|
|
164
|
+
* 声音由桌面渲染层用 Web Audio 现场合成,远程界面(手机浏览器)不消费这几项。
|
|
165
|
+
*/
|
|
166
|
+
turnCompleteSound: boolean;
|
|
167
|
+
/** 完成提示音的音色编号(1–14,设置里选中即试听);读档越界时夹回。 */
|
|
168
|
+
turnCompleteSoundVariant: number;
|
|
169
|
+
/**
|
|
170
|
+
* 窗口不在前台(最小化 / 缩托盘 / 失焦)时,一轮干完弹一条系统通知吗(默认开)。
|
|
171
|
+
* 通知由桌面主进程创建,点击唤回主窗口;前台时不弹——那时提示音已经足够。
|
|
172
|
+
*/
|
|
173
|
+
turnCompleteNotify: boolean;
|
|
174
|
+
/** TUI 底部状态栏各段的显隐;读档缺键由 {@link normalizeStatusBarPrefs} 回落默认。 */
|
|
175
|
+
statusBar: StatusBarPrefsView;
|
|
176
|
+
/**
|
|
177
|
+
* 窗口几何:侧栏宽 / 正文列宽 / 右侧栏宽 / 并排审查宽 + 侧栏收起。
|
|
178
|
+
*
|
|
179
|
+
* 为什么不能只放 localStorage:宿主每次启动、每次切工作目录都会换一个端口
|
|
180
|
+
* (见 `ui-server` 的 `port ?? 0`),而 localStorage 按**源**隔离——换了端口就是一份
|
|
181
|
+
* 空存储,用户拖出来的宽度每次重开都回默认(外观镜像踩过同一个坑,见 ui-shell 的
|
|
182
|
+
* `appearance.ts`)。所以这一份跟其它界面偏好一起落进 `~/.dsc/settings.json`。
|
|
183
|
+
*
|
|
184
|
+
* 仍是**本机**的窗口几何,不是跨机器偏好;值由壳的世界限夹,读档这里只挡脏值。
|
|
185
|
+
*/
|
|
186
|
+
panelWidths: PanelWidthsView;
|
|
187
|
+
}
|
|
188
|
+
/** 面板几何(px;缺键 = 这一项没拖过,用样式表默认)。 */
|
|
189
|
+
export interface PanelWidthsView {
|
|
190
|
+
/** 侧栏宽(200–420)。 */
|
|
191
|
+
sidebar?: number;
|
|
192
|
+
/** 正文列宽(≥480)。 */
|
|
193
|
+
thread?: number;
|
|
194
|
+
/** 右侧栏宽(300–820)。 */
|
|
195
|
+
dock?: number;
|
|
196
|
+
/** 并排审查面板宽。 */
|
|
197
|
+
diff?: number;
|
|
198
|
+
/** 侧栏收起(Ctrl+B)。 */
|
|
199
|
+
collapsed?: boolean;
|
|
200
|
+
}
|
|
201
|
+
/** 状态栏段显隐的出厂默认(口径见 {@link StatusBarPrefsView})。 */
|
|
202
|
+
export declare const DEFAULT_STATUS_BAR_PREFS: StatusBarPrefsView;
|
|
203
|
+
/**
|
|
204
|
+
* 把老存档 / 老宿主 / 手改坏档里的 `ui.statusBar` 归一成全键视图:对象缺失或
|
|
205
|
+
* 单键缺失都回落出厂默认(与 prefs.ts 的读档白名单同一口径,坏档不拦启动)。
|
|
206
|
+
* 桌面渲染层与 TUI 共用这一份——prefs.ts 带着 node 内置模块,渲染层 import 不得。
|
|
207
|
+
*/
|
|
208
|
+
export declare function normalizeStatusBarPrefs(value: unknown): StatusBarPrefsView;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 契约分域:session
|
|
3
|
+
*
|
|
4
|
+
* 从 `src/contract.ts` 拆出来的一个域(纯搬移,逐字未改)。调用方照旧 import
|
|
5
|
+
* `../contract.js`——那份文件现在只做转出,导出面一个没少。
|
|
6
|
+
*
|
|
7
|
+
* @module dsc/contract/session
|
|
8
|
+
*/
|
|
9
|
+
// @@imports@@
|
|
10
|
+
/** 状态栏段显隐的出厂默认(口径见 {@link StatusBarPrefsView})。 */
|
|
11
|
+
export const DEFAULT_STATUS_BAR_PREFS = {
|
|
12
|
+
model: true,
|
|
13
|
+
effort: false,
|
|
14
|
+
cache: true,
|
|
15
|
+
tokens: false,
|
|
16
|
+
cost: true,
|
|
17
|
+
mode: false,
|
|
18
|
+
policy: true,
|
|
19
|
+
ctx: true,
|
|
20
|
+
cwd: true,
|
|
21
|
+
session: false,
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* 把老存档 / 老宿主 / 手改坏档里的 `ui.statusBar` 归一成全键视图:对象缺失或
|
|
25
|
+
* 单键缺失都回落出厂默认(与 prefs.ts 的读档白名单同一口径,坏档不拦启动)。
|
|
26
|
+
* 桌面渲染层与 TUI 共用这一份——prefs.ts 带着 node 内置模块,渲染层 import 不得。
|
|
27
|
+
*/
|
|
28
|
+
export function normalizeStatusBarPrefs(value) {
|
|
29
|
+
const source = typeof value === 'object' && value !== null ? value : {};
|
|
30
|
+
const merged = { ...DEFAULT_STATUS_BAR_PREFS };
|
|
31
|
+
for (const key of Object.keys(DEFAULT_STATUS_BAR_PREFS)) {
|
|
32
|
+
if (typeof source[key] === 'boolean')
|
|
33
|
+
merged[key] = source[key];
|
|
34
|
+
}
|
|
35
|
+
return merged;
|
|
36
|
+
}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 契约分域:settings
|
|
3
|
+
*
|
|
4
|
+
* 从 `src/contract.ts` 拆出来的一个域(纯搬移,逐字未改)。调用方照旧 import
|
|
5
|
+
* `../contract.js`——那份文件现在只做转出,导出面一个没少。
|
|
6
|
+
*
|
|
7
|
+
* @module dsc/contract/settings
|
|
8
|
+
*/
|
|
9
|
+
import type { EffortMap, Modality, ThinkingLevel, ThinkingParam } from './mode.js';
|
|
10
|
+
/** 设置项的值类型(要过 IPC,只能是这三类)。 */
|
|
11
|
+
export type SettingsValue = string | number | boolean;
|
|
12
|
+
/** 下拉选项。 */
|
|
13
|
+
export interface SettingsOption {
|
|
14
|
+
value: string;
|
|
15
|
+
label: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* 设置分区里的一个控件。内置分区与外部插件声明的分区共用这一张渲染表,
|
|
19
|
+
* 所以字段必须可 JSON 序列化——插件给的是声明和回调,不是 React 组件。
|
|
20
|
+
*/
|
|
21
|
+
export type SettingsField = {
|
|
22
|
+
type: 'text';
|
|
23
|
+
key: string;
|
|
24
|
+
label: string;
|
|
25
|
+
placeholder?: string;
|
|
26
|
+
help?: string;
|
|
27
|
+
mono?: boolean;
|
|
28
|
+
group?: string;
|
|
29
|
+
} | {
|
|
30
|
+
type: 'number';
|
|
31
|
+
key: string;
|
|
32
|
+
label: string;
|
|
33
|
+
min?: number;
|
|
34
|
+
max?: number;
|
|
35
|
+
step?: number;
|
|
36
|
+
help?: string;
|
|
37
|
+
group?: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* 下拉。`derivedLabelKey` 是给**派生值**用的:当前值不在 `options` 里时(如权限预设的
|
|
41
|
+
* `custom`——它是三根旋钮拼出来的状态,不是可选项),壳去 `values[derivedLabelKey]` 读
|
|
42
|
+
* 显示名,并把这一行渲染成**置灰只读**。派生值本来就选不了(宿主 `use('custom')` 会当场拒),
|
|
43
|
+
* 画成能点的下拉只会让人以为能选、点了还报错。
|
|
44
|
+
*/
|
|
45
|
+
| {
|
|
46
|
+
type: 'select';
|
|
47
|
+
key: string;
|
|
48
|
+
label: string;
|
|
49
|
+
options: SettingsOption[];
|
|
50
|
+
derivedLabelKey?: string;
|
|
51
|
+
help?: string;
|
|
52
|
+
group?: string;
|
|
53
|
+
} | {
|
|
54
|
+
type: 'switch';
|
|
55
|
+
key: string;
|
|
56
|
+
label: string;
|
|
57
|
+
help?: string;
|
|
58
|
+
group?: string;
|
|
59
|
+
} | {
|
|
60
|
+
type: 'info';
|
|
61
|
+
label?: string;
|
|
62
|
+
text: string;
|
|
63
|
+
mono?: boolean;
|
|
64
|
+
copyable?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* 行内动作(画在「复制 / 打开」右边)。**壳认得 id 才画**,认不出的整条跳过——
|
|
67
|
+
* 这样宿主多声明一条不会让旧壳画出点不动的按钮。
|
|
68
|
+
*
|
|
69
|
+
* 现有的两个:`switch-config-file`(选一份配置文件当活动配置)、
|
|
70
|
+
* `reset-config-file`(改回出厂那份)。它们要在桌面端开系统文件对话框,
|
|
71
|
+
* 所以由壳就地处理(不经宿主动作表)。
|
|
72
|
+
*/
|
|
73
|
+
actions?: readonly SettingsInfoAction[];
|
|
74
|
+
help?: string;
|
|
75
|
+
group?: string;
|
|
76
|
+
} | {
|
|
77
|
+
type: 'button';
|
|
78
|
+
action: string;
|
|
79
|
+
label: string;
|
|
80
|
+
style?: 'primary' | 'ghost';
|
|
81
|
+
help?: string;
|
|
82
|
+
group?: string;
|
|
83
|
+
};
|
|
84
|
+
/** 信息行上的一个动作按钮(见 `SettingsField` 的 info 分支)。 */
|
|
85
|
+
export interface SettingsInfoAction {
|
|
86
|
+
/** 壳认得的动作 id;认不出的不画。 */
|
|
87
|
+
id: string;
|
|
88
|
+
/** 按钮文字(2–4 字动词,无标点)。 */
|
|
89
|
+
label: string;
|
|
90
|
+
/** 悬浮说明。 */
|
|
91
|
+
tip?: string;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* 分区内的一个分组(dsh 同款机制):`fields` 里带 `group: id` 的字段收进这组,
|
|
95
|
+
* TUI 在根页只画一行「组标题 … ›」,Enter 进子页才见到组内字段;桌面端不做
|
|
96
|
+
* 子页导航,渲染成组头(相邻同组字段聚在一张组标题下)。组的 key 仍是分区里
|
|
97
|
+
* 的扁平键,values/save 链路与顶层字段零差别。
|
|
98
|
+
*/
|
|
99
|
+
export interface SettingsGroupView {
|
|
100
|
+
id: string;
|
|
101
|
+
title: string;
|
|
102
|
+
/** 聚焦组行时提示条里的一句话说明。 */
|
|
103
|
+
description?: string;
|
|
104
|
+
}
|
|
105
|
+
/** 一个设置分区的投影(顺序由 order 决定,小者在前)。 */
|
|
106
|
+
export interface SettingsSectionView {
|
|
107
|
+
id: string;
|
|
108
|
+
title: string;
|
|
109
|
+
/** nav 行下方的一句话说明。 */
|
|
110
|
+
subtitle?: string;
|
|
111
|
+
order: number;
|
|
112
|
+
/** 分组声明(display 顺序);字段按 `group` id 归组,没进组的字段留在根页。 */
|
|
113
|
+
groups?: SettingsGroupView[];
|
|
114
|
+
/**
|
|
115
|
+
* 内核内置分区,或声明了 inSettings 的插件代管分区(插件里的内核级功能,
|
|
116
|
+
* 例如远程控制:它登记在插件上,但界面归设置页)。
|
|
117
|
+
*/
|
|
118
|
+
builtin: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* true = 内容要由桌面端自己画(模型、技能这类结构化界面),
|
|
121
|
+
* 此时 fields 为空,数据走 getModelConfig / listSkills 等专门的方法。
|
|
122
|
+
*/
|
|
123
|
+
custom: boolean;
|
|
124
|
+
fields: SettingsField[];
|
|
125
|
+
}
|
|
126
|
+
/** 分区控件的值表。 */
|
|
127
|
+
export type SettingsValues = Record<string, SettingsValue>;
|
|
128
|
+
/**
|
|
129
|
+
* 配对数据的结构化载荷:桌面端据此弹「连接手机」弹窗(画码与二维码),
|
|
130
|
+
* 手机端也可以扫 {@link PairShareData.url} 直接把码带进登录框。
|
|
131
|
+
*
|
|
132
|
+
* 为什么不是只给一句 notice 文案:文案里的码一闪就没了,用户错过就得重新生成;
|
|
133
|
+
* 弹窗要一直挂在屏幕上,界面就必须拿到「码 + 可扫地址 + 过期时刻」这三个字段。
|
|
134
|
+
*/
|
|
135
|
+
export interface PairShareData {
|
|
136
|
+
/** 载荷种类;今天只有配对码这一种,将来加别的一起收在这条判别位上。 */
|
|
137
|
+
kind: 'pair-code';
|
|
138
|
+
/** 8 位配对码。明文只在宿主内存与这条载荷里出现,绝不落盘、不进日志。 */
|
|
139
|
+
code: string;
|
|
140
|
+
/** 带 `?code=` 的完整访问地址:手机扫码打开即带上码,也可以整串复制。 */
|
|
141
|
+
url: string;
|
|
142
|
+
/** 过期时刻(epoch 毫秒);到点这张码就用不了了。 */
|
|
143
|
+
expiresAt: number;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* 「用系统浏览器打开一个链接」的载荷:检查更新发现新版时随回执带给桌面端,
|
|
147
|
+
* 界面据此打开发布页(宿主自己够不着 shell)。
|
|
148
|
+
*/
|
|
149
|
+
export interface LinkShareData {
|
|
150
|
+
kind: 'url';
|
|
151
|
+
/** 要打开的地址;桌面端只放行 http/https。 */
|
|
152
|
+
url: string;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* 「有一个能就地装的新版」的载荷:检查更新发现新版、且发布资产里挑得出安装器时随回执带给界面,
|
|
156
|
+
* 界面据此在行内给一颗「立即更新」。
|
|
157
|
+
*
|
|
158
|
+
* 与 {@link LinkShareData} 的分工:挑得出安装器就就地更新(下载与启动安装程序由桌面主进程做,
|
|
159
|
+
* 见原生桥的 `installUpdate`);挑不出安装器才退回打开发布页。
|
|
160
|
+
*/
|
|
161
|
+
export interface UpdateShareData {
|
|
162
|
+
kind: 'update';
|
|
163
|
+
/** 更新源上的新版本号(原样,可能带 `v` 前缀)。 */
|
|
164
|
+
version: string;
|
|
165
|
+
}
|
|
166
|
+
/** 写入或动作成功时的载荷:提示条文案之外,还可以带一份结构化数据给界面画弹窗。 */
|
|
167
|
+
export interface SettingsMutationOk {
|
|
168
|
+
notice?: string;
|
|
169
|
+
data?: PairShareData | LinkShareData | UpdateShareData;
|
|
170
|
+
}
|
|
171
|
+
/** 写入或动作的结果:失败原因直接显示在控件下方。 */
|
|
172
|
+
export type SettingsMutation = ({
|
|
173
|
+
ok: true;
|
|
174
|
+
} & SettingsMutationOk) | {
|
|
175
|
+
ok: false;
|
|
176
|
+
error: string;
|
|
177
|
+
};
|
|
178
|
+
/** 端点里的一个模型。 */
|
|
179
|
+
export interface ProviderModelView {
|
|
180
|
+
id: string;
|
|
181
|
+
name: string;
|
|
182
|
+
contextWindow: number;
|
|
183
|
+
maxTokens: number;
|
|
184
|
+
/** 这个模型支持的思考档位;空数组 = 没有思考开关,界面只留「默认」。 */
|
|
185
|
+
thinkingLevels: ThinkingLevel[];
|
|
186
|
+
/** 档位走哪个请求字段(见 {@link ThinkingParam})。 */
|
|
187
|
+
thinkingParam: ThinkingParam;
|
|
188
|
+
/** `reasoning-effort` 时档位 → 线上值;没写的档用内置缺省值。 */
|
|
189
|
+
effortMap: EffortMap;
|
|
190
|
+
/** 能接受的输入类型;没勾照片就不能往这个模型发图。 */
|
|
191
|
+
modalities: Modality[];
|
|
192
|
+
}
|
|
193
|
+
/** 一个端点(API key 只报告状态,永不回传值)。 */
|
|
194
|
+
export interface ProviderView {
|
|
195
|
+
name: string;
|
|
196
|
+
displayName: string;
|
|
197
|
+
baseUrl: string;
|
|
198
|
+
/** config.yaml 里 apiKeyEnv 指向的环境变量名 / 凭据库 key 名。 */
|
|
199
|
+
keyRef: string;
|
|
200
|
+
/** 该 key 是否已取得(环境变量或凭据库)。 */
|
|
201
|
+
keyConfigured: boolean;
|
|
202
|
+
models: ProviderModelView[];
|
|
203
|
+
}
|
|
204
|
+
/** 模型配置全貌。 */
|
|
205
|
+
export interface ModelConfigView {
|
|
206
|
+
providers: ProviderView[];
|
|
207
|
+
defaultProvider: string;
|
|
208
|
+
defaultModel: string;
|
|
209
|
+
/** 采样温度;null = 跟随端点默认。 */
|
|
210
|
+
temperature: number | null;
|
|
211
|
+
/** 配置文件绝对路径(关于分区与错误提示都要用)。 */
|
|
212
|
+
configFile: string;
|
|
213
|
+
credentialsFile: string;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* 一次端点连接测试的结果(设置 → 模型每张卡上的「测试连接」)。
|
|
217
|
+
*
|
|
218
|
+
* 判定口径在 core/connection-test:**流正常收尾即通**;失败一律带一句可直接展示的
|
|
219
|
+
* 说明(永不包含 key)。
|
|
220
|
+
*/
|
|
221
|
+
export interface ConnectionTestOutcome {
|
|
222
|
+
ok: boolean;
|
|
223
|
+
/** 从发出到收尾花了多久(毫秒)。失败时也报——「等 20 秒才断」本身有诊断价值。 */
|
|
224
|
+
ms: number;
|
|
225
|
+
/** 模型回的话(单行、截断到 80 字;可能为空:输出被预算截断时就是这样)。 */
|
|
226
|
+
reply: string;
|
|
227
|
+
/** 失败原因(可直接展示)。 */
|
|
228
|
+
error?: string;
|
|
229
|
+
}
|
|
230
|
+
/** 连接测试结果 + 测的是哪个模型(界面要把它写在那张卡上)。 */
|
|
231
|
+
export interface ConnectionTestView extends ConnectionTestOutcome {
|
|
232
|
+
model: string;
|
|
233
|
+
}
|
|
234
|
+
/** 新增或编辑一个端点的入参(apiKey 单独走 setProviderKey)。 */
|
|
235
|
+
export interface ProviderDraft {
|
|
236
|
+
/** null = 新增;否则为被编辑端点的原名字(支持改名)。 */
|
|
237
|
+
oldName: string | null;
|
|
238
|
+
name: string;
|
|
239
|
+
displayName: string;
|
|
240
|
+
baseUrl: string;
|
|
241
|
+
models: ProviderModelView[];
|
|
242
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|