@waq666/pneuma 0.0.0-stage → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +144 -2
- package/bin/dsc.js +91 -0
- package/bin/headless.cjs +40 -0
- package/lib/adapter/core-runtime.d.ts +11 -0
- package/lib/adapter/core-runtime.js +259 -0
- package/lib/adapter/host.d.ts +18 -0
- package/lib/adapter/host.js +14 -0
- package/lib/adapter/runtime.d.ts +15 -0
- package/lib/adapter/runtime.js +290 -0
- package/lib/adapter/transcript.d.ts +184 -0
- package/lib/adapter/transcript.js +605 -0
- package/lib/app/AgentsOverlay.d.ts +18 -0
- package/lib/app/AgentsOverlay.js +63 -0
- package/lib/app/App.d.ts +13 -0
- package/lib/app/App.js +1498 -0
- package/lib/app/ApprovalCard.d.ts +12 -0
- package/lib/app/ApprovalCard.js +76 -0
- package/lib/app/AskCard.d.ts +20 -0
- package/lib/app/AskCard.js +45 -0
- package/lib/app/ChatView.d.ts +32 -0
- package/lib/app/ChatView.js +198 -0
- package/lib/app/Composer.d.ts +50 -0
- package/lib/app/Composer.js +282 -0
- package/lib/app/DiffBlock.d.ts +6 -0
- package/lib/app/DiffBlock.js +37 -0
- package/lib/app/MarkdownView.d.ts +6 -0
- package/lib/app/MarkdownView.js +99 -0
- package/lib/app/ModelPicker.d.ts +7 -0
- package/lib/app/ModelPicker.js +18 -0
- package/lib/app/PlanReviewCard.d.ts +13 -0
- package/lib/app/PlanReviewCard.js +54 -0
- package/lib/app/PresetPicker.d.ts +11 -0
- package/lib/app/PresetPicker.js +19 -0
- package/lib/app/PreviewOverlay.d.ts +14 -0
- package/lib/app/PreviewOverlay.js +22 -0
- package/lib/app/SessionPicker.d.ts +43 -0
- package/lib/app/SessionPicker.js +56 -0
- package/lib/app/SettingsOverlay.d.ts +32 -0
- package/lib/app/SettingsOverlay.js +157 -0
- package/lib/app/SkillsPicker.d.ts +7 -0
- package/lib/app/SkillsPicker.js +19 -0
- package/lib/app/StatusBar.d.ts +22 -0
- package/lib/app/StatusBar.js +272 -0
- package/lib/app/TaskStrips.d.ts +13 -0
- package/lib/app/TaskStrips.js +40 -0
- package/lib/app/ToolCard.d.ts +5 -0
- package/lib/app/ToolCard.js +40 -0
- package/lib/app/TranscriptOverlay.d.ts +12 -0
- package/lib/app/TranscriptOverlay.js +17 -0
- package/lib/app/Welcome.d.ts +6 -0
- package/lib/app/Welcome.js +66 -0
- package/lib/app/attach.d.ts +16 -0
- package/lib/app/attach.js +58 -0
- package/lib/app/click.d.ts +27 -0
- package/lib/app/click.js +89 -0
- package/lib/app/clipboard-image.d.ts +11 -0
- package/lib/app/clipboard-image.js +66 -0
- package/lib/app/cursor.d.ts +4 -0
- package/lib/app/cursor.js +24 -0
- package/lib/app/hello.d.ts +11 -0
- package/lib/app/hello.js +8 -0
- package/lib/app/history-store.d.ts +4 -0
- package/lib/app/history-store.js +41 -0
- package/lib/app/image-blocks.d.ts +12 -0
- package/lib/app/image-blocks.js +125 -0
- package/lib/app/markdown.d.ts +54 -0
- package/lib/app/markdown.js +189 -0
- package/lib/app/settings-model.d.ts +69 -0
- package/lib/app/settings-model.js +114 -0
- package/lib/app/theme.d.ts +166 -0
- package/lib/app/theme.js +141 -0
- package/lib/boot.d.ts +1 -0
- package/lib/boot.js +34 -0
- package/lib/commands.d.ts +49 -0
- package/lib/commands.js +115 -0
- package/lib/contract.d.ts +1973 -0
- package/lib/contract.js +36 -0
- package/lib/core/agent-roles.d.ts +52 -0
- package/lib/core/agent-roles.js +274 -0
- package/lib/core/approval-floor.d.ts +183 -0
- package/lib/core/approval-floor.js +679 -0
- package/lib/core/approval.d.ts +42 -0
- package/lib/core/approval.js +8 -0
- package/lib/core/audit.d.ts +61 -0
- package/lib/core/audit.js +59 -0
- package/lib/core/boot-notices.d.ts +6 -0
- package/lib/core/boot-notices.js +61 -0
- package/lib/core/cdp/actions.d.ts +182 -0
- package/lib/core/cdp/actions.js +649 -0
- package/lib/core/cdp/launch.d.ts +192 -0
- package/lib/core/cdp/launch.js +491 -0
- package/lib/core/cdp/snapshot.d.ts +139 -0
- package/lib/core/cdp/snapshot.js +316 -0
- package/lib/core/cdp/transport.d.ts +160 -0
- package/lib/core/cdp/transport.js +359 -0
- package/lib/core/command-policy.d.ts +108 -0
- package/lib/core/command-policy.js +580 -0
- package/lib/core/commands-completion.d.ts +78 -0
- package/lib/core/commands-completion.js +167 -0
- package/lib/core/compact-anchors.d.ts +76 -0
- package/lib/core/compact-anchors.js +284 -0
- package/lib/core/compact.d.ts +110 -0
- package/lib/core/compact.js +210 -0
- package/lib/core/config-store.d.ts +38 -0
- package/lib/core/config-store.js +307 -0
- package/lib/core/config.d.ts +36 -0
- package/lib/core/config.js +124 -0
- package/lib/core/connection-test.d.ts +60 -0
- package/lib/core/connection-test.js +84 -0
- package/lib/core/desktop-control.d.ts +298 -0
- package/lib/core/desktop-control.js +1311 -0
- package/lib/core/diff-text.d.ts +74 -0
- package/lib/core/diff-text.js +257 -0
- package/lib/core/dock-browser.d.ts +137 -0
- package/lib/core/dock-browser.js +146 -0
- package/lib/core/dock-ops.d.ts +59 -0
- package/lib/core/dock-ops.js +104 -0
- package/lib/core/dock-session.d.ts +39 -0
- package/lib/core/dock-session.js +28 -0
- package/lib/core/dsh-compat/hook.d.ts +18 -0
- package/lib/core/dsh-compat/hook.js +52 -0
- package/lib/core/dsh-compat/resolve-hook.d.ts +5 -0
- package/lib/core/dsh-compat/resolve-hook.js +59 -0
- package/lib/core/dsh-compat/tools-facade.d.ts +47 -0
- package/lib/core/dsh-compat/tools-facade.js +108 -0
- package/lib/core/err-text.d.ts +13 -0
- package/lib/core/err-text.js +15 -0
- package/lib/core/events.d.ts +149 -0
- package/lib/core/events.js +1 -0
- package/lib/core/git-exec.d.ts +23 -0
- package/lib/core/git-exec.js +72 -0
- package/lib/core/git-info.d.ts +47 -0
- package/lib/core/git-info.js +157 -0
- package/lib/core/goal.d.ts +89 -0
- package/lib/core/goal.js +189 -0
- package/lib/core/hooks.d.ts +272 -0
- package/lib/core/hooks.js +818 -0
- package/lib/core/host-browser-link.d.ts +59 -0
- package/lib/core/host-browser-link.js +9 -0
- package/lib/core/host-methods.d.ts +25 -0
- package/lib/core/host-methods.js +103 -0
- package/lib/core/image-diet.d.ts +77 -0
- package/lib/core/image-diet.js +127 -0
- package/lib/core/learnings/ledger.d.ts +73 -0
- package/lib/core/learnings/ledger.js +273 -0
- package/lib/core/learnings/skill-write.d.ts +250 -0
- package/lib/core/learnings/skill-write.js +854 -0
- package/lib/core/learnings/store.d.ts +102 -0
- package/lib/core/learnings/store.js +266 -0
- package/lib/core/lifecycle-hooks.d.ts +189 -0
- package/lib/core/lifecycle-hooks.js +576 -0
- package/lib/core/llm.d.ts +272 -0
- package/lib/core/llm.js +548 -0
- package/lib/core/lockfile.d.ts +17 -0
- package/lib/core/lockfile.js +110 -0
- package/lib/core/loop.d.ts +185 -0
- package/lib/core/loop.js +587 -0
- package/lib/core/lsp/client.d.ts +189 -0
- package/lib/core/lsp/client.js +690 -0
- package/lib/core/lsp/framing.d.ts +84 -0
- package/lib/core/lsp/framing.js +181 -0
- package/lib/core/lsp/line-shift.d.ts +28 -0
- package/lib/core/lsp/line-shift.js +127 -0
- package/lib/core/lsp/manager.d.ts +93 -0
- package/lib/core/lsp/manager.js +418 -0
- package/lib/core/lsp/normalize.d.ts +32 -0
- package/lib/core/lsp/normalize.js +139 -0
- package/lib/core/lsp/servers.d.ts +106 -0
- package/lib/core/lsp/servers.js +352 -0
- package/lib/core/lsp/uri.d.ts +76 -0
- package/lib/core/lsp/uri.js +179 -0
- package/lib/core/market.d.ts +51 -0
- package/lib/core/market.js +358 -0
- package/lib/core/mcp.d.ts +201 -0
- package/lib/core/mcp.js +836 -0
- package/lib/core/memory-eval.d.ts +158 -0
- package/lib/core/memory-eval.js +215 -0
- package/lib/core/memory.d.ts +266 -0
- package/lib/core/memory.js +703 -0
- package/lib/core/mention.d.ts +57 -0
- package/lib/core/mention.js +129 -0
- package/lib/core/microcompact.d.ts +48 -0
- package/lib/core/microcompact.js +79 -0
- package/lib/core/migrate.d.ts +56 -0
- package/lib/core/migrate.js +134 -0
- package/lib/core/model-caps.d.ts +83 -0
- package/lib/core/model-caps.js +150 -0
- package/lib/core/model-discovery.d.ts +19 -0
- package/lib/core/model-discovery.js +69 -0
- package/lib/core/modes.d.ts +72 -0
- package/lib/core/modes.js +152 -0
- package/lib/core/native-bridge.d.ts +135 -0
- package/lib/core/native-bridge.js +563 -0
- package/lib/core/path-policy.d.ts +32 -0
- package/lib/core/path-policy.js +248 -0
- package/lib/core/permission-presets.d.ts +67 -0
- package/lib/core/permission-presets.js +75 -0
- package/lib/core/plugin-loader.d.ts +36 -0
- package/lib/core/plugin-loader.js +294 -0
- package/lib/core/plugin-registry.d.ts +113 -0
- package/lib/core/plugin-registry.js +256 -0
- package/lib/core/prefs.d.ts +82 -0
- package/lib/core/prefs.js +372 -0
- package/lib/core/presets.d.ts +80 -0
- package/lib/core/presets.js +373 -0
- package/lib/core/pricing.d.ts +90 -0
- package/lib/core/pricing.js +126 -0
- package/lib/core/prompt.d.ts +92 -0
- package/lib/core/prompt.js +339 -0
- package/lib/core/ptc.d.ts +66 -0
- package/lib/core/ptc.js +70 -0
- package/lib/core/remote/frames.d.ts +91 -0
- package/lib/core/remote/frames.js +174 -0
- package/lib/core/remote/notify.d.ts +54 -0
- package/lib/core/remote/notify.js +77 -0
- package/lib/core/remote/owner.d.ts +32 -0
- package/lib/core/remote/owner.js +75 -0
- package/lib/core/remote/pairing.d.ts +104 -0
- package/lib/core/remote/pairing.js +261 -0
- package/lib/core/remote/push.d.ts +80 -0
- package/lib/core/remote/push.js +222 -0
- package/lib/core/remote/store.d.ts +18 -0
- package/lib/core/remote/store.js +59 -0
- package/lib/core/remote/tickets.d.ts +20 -0
- package/lib/core/remote/tickets.js +49 -0
- package/lib/core/remote/uploads.d.ts +63 -0
- package/lib/core/remote/uploads.js +161 -0
- package/lib/core/request-attribution.d.ts +26 -0
- package/lib/core/request-attribution.js +86 -0
- package/lib/core/request-invariant.d.ts +61 -0
- package/lib/core/request-invariant.js +199 -0
- package/lib/core/sandbox/backends.d.ts +64 -0
- package/lib/core/sandbox/backends.js +194 -0
- package/lib/core/sandbox/execpolicy.d.ts +93 -0
- package/lib/core/sandbox/execpolicy.js +452 -0
- package/lib/core/sandbox/net-proxy.d.ts +31 -0
- package/lib/core/sandbox/net-proxy.js +162 -0
- package/lib/core/sandbox/policy.d.ts +211 -0
- package/lib/core/sandbox/policy.js +559 -0
- package/lib/core/sandbox/win/abi.d.ts +161 -0
- package/lib/core/sandbox/win/abi.js +169 -0
- package/lib/core/sandbox/win/account.d.ts +71 -0
- package/lib/core/sandbox/win/account.js +206 -0
- package/lib/core/sandbox/win/acl.d.ts +54 -0
- package/lib/core/sandbox/win/acl.js +339 -0
- package/lib/core/sandbox/win/backend.d.ts +61 -0
- package/lib/core/sandbox/win/backend.js +249 -0
- package/lib/core/sandbox/win/doctor.d.ts +24 -0
- package/lib/core/sandbox/win/doctor.js +272 -0
- package/lib/core/sandbox/win/ffi.d.ts +107 -0
- package/lib/core/sandbox/win/ffi.js +166 -0
- package/lib/core/sandbox/win/net-abi.d.ts +154 -0
- package/lib/core/sandbox/win/net-abi.js +316 -0
- package/lib/core/sandbox/win/runner-entry.d.ts +35 -0
- package/lib/core/sandbox/win/runner-entry.js +391 -0
- package/lib/core/sandbox/win/setup.d.ts +60 -0
- package/lib/core/sandbox/win/setup.js +986 -0
- package/lib/core/sandbox/win/token.d.ts +35 -0
- package/lib/core/sandbox/win/token.js +238 -0
- package/lib/core/sandbox/win/wfp.d.ts +41 -0
- package/lib/core/sandbox/win/wfp.js +200 -0
- package/lib/core/sandbox/win/workspace-sid.d.ts +9 -0
- package/lib/core/sandbox/win/workspace-sid.js +45 -0
- package/lib/core/schedule/rule.d.ts +184 -0
- package/lib/core/schedule/rule.js +745 -0
- package/lib/core/schedule/runner.d.ts +185 -0
- package/lib/core/schedule/runner.js +678 -0
- package/lib/core/schedule/store.d.ts +182 -0
- package/lib/core/schedule/store.js +455 -0
- package/lib/core/secrets.d.ts +41 -0
- package/lib/core/secrets.js +150 -0
- package/lib/core/session-export.d.ts +18 -0
- package/lib/core/session-export.js +73 -0
- package/lib/core/session-index.d.ts +159 -0
- package/lib/core/session-index.js +683 -0
- package/lib/core/session-meta.d.ts +41 -0
- package/lib/core/session-meta.js +97 -0
- package/lib/core/session.d.ts +356 -0
- package/lib/core/session.js +998 -0
- package/lib/core/skills.d.ts +60 -0
- package/lib/core/skills.js +171 -0
- package/lib/core/spill.d.ts +159 -0
- package/lib/core/spill.js +329 -0
- package/lib/core/surface-registry.d.ts +45 -0
- package/lib/core/surface-registry.js +67 -0
- package/lib/core/team-board.d.ts +95 -0
- package/lib/core/team-board.js +316 -0
- package/lib/core/throughput.d.ts +46 -0
- package/lib/core/throughput.js +40 -0
- package/lib/core/todo-reminder.d.ts +44 -0
- package/lib/core/todo-reminder.js +55 -0
- package/lib/core/todo.d.ts +81 -0
- package/lib/core/todo.js +222 -0
- package/lib/core/token-estimate.d.ts +55 -0
- package/lib/core/token-estimate.js +82 -0
- package/lib/core/tool-guards.d.ts +103 -0
- package/lib/core/tool-guards.js +77 -0
- package/lib/core/tool-search.d.ts +152 -0
- package/lib/core/tool-search.js +311 -0
- package/lib/core/tools/bash.d.ts +281 -0
- package/lib/core/tools/bash.js +871 -0
- package/lib/core/tools/command-runner.d.ts +84 -0
- package/lib/core/tools/command-runner.js +68 -0
- package/lib/core/tools/fs-tools.d.ts +23 -0
- package/lib/core/tools/fs-tools.js +247 -0
- package/lib/core/tools/index.d.ts +8 -0
- package/lib/core/tools/index.js +4 -0
- package/lib/core/tools/sandbox-args.d.ts +51 -0
- package/lib/core/tools/sandbox-args.js +90 -0
- package/lib/core/tools/search-tools.d.ts +3 -0
- package/lib/core/tools/search-tools.js +153 -0
- package/lib/core/tools.d.ts +96 -0
- package/lib/core/tools.js +53 -0
- package/lib/core/ui-boot-source.d.ts +71 -0
- package/lib/core/ui-boot-source.js +121 -0
- package/lib/core/ui-bundles.d.ts +249 -0
- package/lib/core/ui-bundles.js +830 -0
- package/lib/core/ui-combo.d.ts +49 -0
- package/lib/core/ui-combo.js +55 -0
- package/lib/core/ui-events.d.ts +81 -0
- package/lib/core/ui-events.js +364 -0
- package/lib/core/ui-hmr.d.ts +36 -0
- package/lib/core/ui-hmr.js +128 -0
- package/lib/core/ui-methods.d.ts +69 -0
- package/lib/core/ui-methods.js +341 -0
- package/lib/core/ui-route.d.ts +69 -0
- package/lib/core/ui-route.js +122 -0
- package/lib/core/ui-server.d.ts +75 -0
- package/lib/core/ui-server.js +369 -0
- package/lib/core/ui-trust.d.ts +47 -0
- package/lib/core/ui-trust.js +164 -0
- package/lib/core/untrusted.d.ts +30 -0
- package/lib/core/untrusted.js +48 -0
- package/lib/core/update-check.d.ts +81 -0
- package/lib/core/update-check.js +177 -0
- package/lib/core/usage-log.d.ts +82 -0
- package/lib/core/usage-log.js +306 -0
- package/lib/core/version.d.ts +1 -0
- package/lib/core/version.js +37 -0
- package/lib/core/web-http.d.ts +57 -0
- package/lib/core/web-http.js +137 -0
- package/lib/core/web-static.d.ts +31 -0
- package/lib/core/web-static.js +75 -0
- package/lib/headless.d.ts +1 -0
- package/lib/headless.js +31 -0
- package/lib/host/kernel.d.ts +33 -0
- package/lib/host/kernel.js +451 -0
- package/lib/index.d.ts +41 -0
- package/lib/index.js +35 -0
- package/lib/plugins/agent.d.ts +2 -0
- package/lib/plugins/agent.js +274 -0
- package/lib/plugins/approval-floor.d.ts +2 -0
- package/lib/plugins/approval-floor.js +223 -0
- package/lib/plugins/approval.d.ts +16 -0
- package/lib/plugins/approval.js +674 -0
- package/lib/plugins/ask.d.ts +2 -0
- package/lib/plugins/ask.js +245 -0
- package/lib/plugins/browser.d.ts +68 -0
- package/lib/plugins/browser.js +1341 -0
- package/lib/plugins/commands.d.ts +23 -0
- package/lib/plugins/commands.js +498 -0
- package/lib/plugins/compact.d.ts +21 -0
- package/lib/plugins/compact.js +274 -0
- package/lib/plugins/computer-use.d.ts +47 -0
- package/lib/plugins/computer-use.js +539 -0
- package/lib/plugins/desktop-dock.d.ts +2 -0
- package/lib/plugins/desktop-dock.js +626 -0
- package/lib/plugins/dock-browser.d.ts +34 -0
- package/lib/plugins/dock-browser.js +765 -0
- package/lib/plugins/dsh-compat.d.ts +25 -0
- package/lib/plugins/dsh-compat.js +37 -0
- package/lib/plugins/file-review.d.ts +108 -0
- package/lib/plugins/file-review.js +393 -0
- package/lib/plugins/git.d.ts +26 -0
- package/lib/plugins/git.js +132 -0
- package/lib/plugins/goal.d.ts +20 -0
- package/lib/plugins/goal.js +245 -0
- package/lib/plugins/guards.d.ts +14 -0
- package/lib/plugins/guards.js +18 -0
- package/lib/plugins/hooks.d.ts +19 -0
- package/lib/plugins/hooks.js +583 -0
- package/lib/plugins/host-stdio.d.ts +88 -0
- package/lib/plugins/host-stdio.js +317 -0
- package/lib/plugins/image-diet.d.ts +17 -0
- package/lib/plugins/image-diet.js +85 -0
- package/lib/plugins/lifecycle-hooks.d.ts +26 -0
- package/lib/plugins/lifecycle-hooks.js +338 -0
- package/lib/plugins/llm.d.ts +13 -0
- package/lib/plugins/llm.js +215 -0
- package/lib/plugins/lsp.d.ts +54 -0
- package/lib/plugins/lsp.js +608 -0
- package/lib/plugins/mcp.d.ts +16 -0
- package/lib/plugins/mcp.js +673 -0
- package/lib/plugins/memory.d.ts +17 -0
- package/lib/plugins/memory.js +858 -0
- package/lib/plugins/microcompact.d.ts +18 -0
- package/lib/plugins/microcompact.js +119 -0
- package/lib/plugins/mode.d.ts +18 -0
- package/lib/plugins/mode.js +115 -0
- package/lib/plugins/permission-presets.d.ts +18 -0
- package/lib/plugins/permission-presets.js +135 -0
- package/lib/plugins/plan.d.ts +2 -0
- package/lib/plugins/plan.js +192 -0
- package/lib/plugins/plugin-manager.d.ts +2 -0
- package/lib/plugins/plugin-manager.js +165 -0
- package/lib/plugins/presets.d.ts +2 -0
- package/lib/plugins/presets.js +182 -0
- package/lib/plugins/prompt.d.ts +2 -0
- package/lib/plugins/prompt.js +264 -0
- package/lib/plugins/ptc.d.ts +2 -0
- package/lib/plugins/ptc.js +272 -0
- package/lib/plugins/remote/http.d.ts +11 -0
- package/lib/plugins/remote/http.js +11 -0
- package/lib/plugins/remote/routes.d.ts +24 -0
- package/lib/plugins/remote/routes.js +384 -0
- package/lib/plugins/remote/types.d.ts +135 -0
- package/lib/plugins/remote/types.js +87 -0
- package/lib/plugins/remote.d.ts +17 -0
- package/lib/plugins/remote.js +1028 -0
- package/lib/plugins/runtime-api.d.ts +16 -0
- package/lib/plugins/runtime-api.js +99 -0
- package/lib/plugins/runtime.d.ts +10 -0
- package/lib/plugins/runtime.js +451 -0
- package/lib/plugins/sandbox.d.ts +2 -0
- package/lib/plugins/sandbox.js +761 -0
- package/lib/plugins/schedule.d.ts +26 -0
- package/lib/plugins/schedule.js +538 -0
- package/lib/plugins/self-improve.d.ts +61 -0
- package/lib/plugins/self-improve.js +953 -0
- package/lib/plugins/session-search.d.ts +16 -0
- package/lib/plugins/session-search.js +308 -0
- package/lib/plugins/session-title.d.ts +19 -0
- package/lib/plugins/session-title.js +109 -0
- package/lib/plugins/session.d.ts +7 -0
- package/lib/plugins/session.js +296 -0
- package/lib/plugins/settings.d.ts +3 -0
- package/lib/plugins/settings.js +705 -0
- package/lib/plugins/skills.d.ts +2 -0
- package/lib/plugins/skills.js +360 -0
- package/lib/plugins/spill.d.ts +16 -0
- package/lib/plugins/spill.js +200 -0
- package/lib/plugins/subagent.d.ts +2 -0
- package/lib/plugins/subagent.js +862 -0
- package/lib/plugins/surfaces.d.ts +11 -0
- package/lib/plugins/surfaces.js +20 -0
- package/lib/plugins/team.d.ts +16 -0
- package/lib/plugins/team.js +149 -0
- package/lib/plugins/todo.d.ts +19 -0
- package/lib/plugins/todo.js +188 -0
- package/lib/plugins/tool-search.d.ts +2 -0
- package/lib/plugins/tool-search.js +425 -0
- package/lib/plugins/tools-default.d.ts +12 -0
- package/lib/plugins/tools-default.js +275 -0
- package/lib/plugins/tools.d.ts +16 -0
- package/lib/plugins/tools.js +62 -0
- package/lib/plugins/transcript.d.ts +15 -0
- package/lib/plugins/transcript.js +311 -0
- package/lib/plugins/tui.d.ts +2 -0
- package/lib/plugins/tui.js +98 -0
- package/lib/plugins/waiting.d.ts +12 -0
- package/lib/plugins/waiting.js +34 -0
- package/lib/plugins/web-search.d.ts +14 -0
- package/lib/plugins/web-search.js +263 -0
- package/lib/plugins/webserver.d.ts +48 -0
- package/lib/plugins/webserver.js +228 -0
- package/lib/remote/assets/app-DAcUCOEn.js +14 -0
- package/lib/remote/assets/icon-192.png +0 -0
- package/lib/remote/assets/icon-512.png +0 -0
- package/lib/remote/assets/index.html +34 -0
- package/lib/remote/assets/manifest.json +27 -0
- package/lib/remote/assets/style-DIB6729x.css +1 -0
- package/lib/remote/assets/sw.js +66 -0
- package/lib/services/types.d.ts +1228 -0
- package/lib/services/types.js +1 -0
- package/lib/tools/config-cli.d.ts +1 -0
- package/lib/tools/config-cli.js +89 -0
- package/lib/ui/arrival.d.ts +72 -0
- package/lib/ui/arrival.js +105 -0
- package/lib/ui/assets/app-B70nVIKd.js +69 -0
- package/lib/ui/assets/chunk-2UxHyX5q.js +1 -0
- package/lib/ui/assets/chunk-B1dDrJ26.js +1 -0
- package/lib/ui/assets/chunk-B6aJPvgy.js +1 -0
- package/lib/ui/assets/chunk-BEwlwnbL.js +1 -0
- package/lib/ui/assets/chunk-BGcgwlCI.js +12 -0
- package/lib/ui/assets/chunk-BIGW1oBm.js +1 -0
- package/lib/ui/assets/chunk-BPQ3VLAy.js +1 -0
- package/lib/ui/assets/chunk-BRH0KZbk.js +141 -0
- package/lib/ui/assets/chunk-BX6H_ySx.js +1 -0
- package/lib/ui/assets/chunk-B_P3UbPa.js +1 -0
- package/lib/ui/assets/chunk-B_TYUkTI.js +1 -0
- package/lib/ui/assets/chunk-B_vNuMnf.js +1 -0
- package/lib/ui/assets/chunk-BajyYBss.js +10 -0
- package/lib/ui/assets/chunk-BdnUsdx6.js +1 -0
- package/lib/ui/assets/chunk-Buea-lGh.js +1 -0
- package/lib/ui/assets/chunk-C0PvZCCE.js +1 -0
- package/lib/ui/assets/chunk-C0m74zRD.js +1 -0
- package/lib/ui/assets/chunk-C27-OAKa.js +1 -0
- package/lib/ui/assets/chunk-C2oV4EkX.js +1 -0
- package/lib/ui/assets/chunk-C7zT0LnQ.js +1 -0
- package/lib/ui/assets/chunk-C9GSunVT.js +1 -0
- package/lib/ui/assets/chunk-C9tS-k6U.js +1 -0
- package/lib/ui/assets/chunk-CHLpvVh8.js +1 -0
- package/lib/ui/assets/chunk-CLxacb5B.js +1 -0
- package/lib/ui/assets/chunk-COt5Ahok.js +1 -0
- package/lib/ui/assets/chunk-CPTIWCL2.js +1 -0
- package/lib/ui/assets/chunk-CQLl-L-p.js +1 -0
- package/lib/ui/assets/chunk-CUWRgxuq.js +55 -0
- package/lib/ui/assets/chunk-CWanVSXC.js +1 -0
- package/lib/ui/assets/chunk-Cf5RLm7j.js +1 -0
- package/lib/ui/assets/chunk-CickPsom.js +1 -0
- package/lib/ui/assets/chunk-Cj5Yp3dK.js +1 -0
- package/lib/ui/assets/chunk-Cmh6b_Ma.js +1 -0
- package/lib/ui/assets/chunk-Cp-IABpG.js +1 -0
- package/lib/ui/assets/chunk-CqE71os6.js +1 -0
- package/lib/ui/assets/chunk-CtKP3W-j.js +1 -0
- package/lib/ui/assets/chunk-Cvjx9yec.js +1 -0
- package/lib/ui/assets/chunk-CxGP3dtY.js +1 -0
- package/lib/ui/assets/chunk-CylS5w8V.js +1 -0
- package/lib/ui/assets/chunk-D38fbIBN.js +1 -0
- package/lib/ui/assets/chunk-D97Zzqfu.js +1 -0
- package/lib/ui/assets/chunk-DAi9KRSo.js +1 -0
- package/lib/ui/assets/chunk-DHK4yRfg.js +1 -0
- package/lib/ui/assets/chunk-DJeabLx-.js +1 -0
- package/lib/ui/assets/chunk-DNRxmY5a.js +1 -0
- package/lib/ui/assets/chunk-DNSN1z5r.js +1 -0
- package/lib/ui/assets/chunk-DNasK_ZG.js +1 -0
- package/lib/ui/assets/chunk-DPvrY3IQ.js +1 -0
- package/lib/ui/assets/chunk-DXmwc3jG.js +1 -0
- package/lib/ui/assets/chunk-Dd0kTxKP.js +1 -0
- package/lib/ui/assets/chunk-De0Btta0.js +1 -0
- package/lib/ui/assets/chunk-Des-eS-w.js +1 -0
- package/lib/ui/assets/chunk-Df6bDoY_.js +1 -0
- package/lib/ui/assets/chunk-DijEV5ha.js +1 -0
- package/lib/ui/assets/chunk-DkvoVjww.js +1 -0
- package/lib/ui/assets/chunk-DlC-OlHO.js +1 -0
- package/lib/ui/assets/chunk-DnzrXTVv.js +1 -0
- package/lib/ui/assets/chunk-Dualf0xi.js +1 -0
- package/lib/ui/assets/chunk-EXT84bkm.js +1 -0
- package/lib/ui/assets/chunk-GwR3hkPK.js +1 -0
- package/lib/ui/assets/chunk-P80f7IUj.js +1 -0
- package/lib/ui/assets/chunk-VOosw3JB.js +1 -0
- package/lib/ui/assets/chunk-YQ4lDkt_.js +140 -0
- package/lib/ui/assets/chunk-Yzrsuije.js +1 -0
- package/lib/ui/assets/chunk-Z72CF80r.js +1 -0
- package/lib/ui/assets/chunk-g9-lgVsj.js +1 -0
- package/lib/ui/assets/chunk-vGWfd6FD.js +1 -0
- package/lib/ui/assets/chunk-wDzz0qaB.js +1 -0
- package/lib/ui/assets/chunk-ySF7HWmS.js +1 -0
- package/lib/ui/assets/icon.png +0 -0
- package/lib/ui/assets/index.html +14 -0
- package/lib/ui/assets/pdf.worker.min-CjEcRF4W.mjs +28 -0
- package/lib/ui/assets/style-Bq01xH_b.css +1 -0
- package/lib/ui/frames.d.ts +67 -0
- package/lib/ui/frames.js +146 -0
- package/lib/ui/index.d.ts +59 -0
- package/lib/ui/index.js +50 -0
- package/lib/ui/manifest.d.ts +172 -0
- package/lib/ui/manifest.js +158 -0
- package/lib/ui/plugin.d.ts +161 -0
- package/lib/ui/plugin.js +7 -0
- package/lib/ui/plugins/browser/client.js +290 -0
- package/lib/ui/plugins/browser/icon.png +0 -0
- package/lib/ui/plugins/composer/client.js +1843 -0
- package/lib/ui/plugins/composer/icon.png +0 -0
- package/lib/ui/plugins/files/client.js +646 -0
- package/lib/ui/plugins/files/icon.png +0 -0
- package/lib/ui/plugins/manifest.json +107 -0
- package/lib/ui/plugins/plugins/client.js +682 -0
- package/lib/ui/plugins/plugins/icon.png +0 -0
- package/lib/ui/plugins/preview/client.js +197 -0
- package/lib/ui/plugins/preview/icon.png +0 -0
- package/lib/ui/plugins/prompt/client.js +653 -0
- package/lib/ui/plugins/prompt/icon.png +0 -0
- package/lib/ui/plugins/sessions/client.js +1577 -0
- package/lib/ui/plugins/sessions/icon.png +0 -0
- package/lib/ui/plugins/settings/client.js +5470 -0
- package/lib/ui/plugins/settings/icon.png +0 -0
- package/lib/ui/plugins/skills/client.js +485 -0
- package/lib/ui/plugins/skills/icon.png +0 -0
- package/lib/ui/plugins/status/client.js +1420 -0
- package/lib/ui/plugins/status/icon.png +0 -0
- package/lib/ui/plugins/statusbar/client.js +504 -0
- package/lib/ui/plugins/statusbar/icon.png +0 -0
- package/lib/ui/plugins/tasks/client.js +52 -0
- package/lib/ui/plugins/tasks/icon.png +0 -0
- package/lib/ui/plugins/team/client.js +527 -0
- package/lib/ui/plugins/team/icon.png +0 -0
- package/lib/ui/plugins/terminal/client.js +232 -0
- package/lib/ui/plugins/terminal/icon.png +0 -0
- package/lib/ui/plugins/trace/client.js +1376 -0
- package/lib/ui/plugins/trace/icon.png +0 -0
- package/lib/ui/plugins/transcript/client.js +2661 -0
- package/lib/ui/plugins/transcript/icon.png +0 -0
- package/lib/ui/scoped-slots.d.ts +20 -0
- package/lib/ui/scoped-slots.js +21 -0
- package/lib/ui/sdk/@dsc/ui/index.d.ts +242 -0
- package/lib/ui/sdk/@dsc/ui/package.json +16 -0
- package/lib/ui/sdk/@dsc/ui-core/contract.d.ts +1973 -0
- package/lib/ui/sdk/@dsc/ui-core/core/diff-text.d.ts +74 -0
- package/lib/ui/sdk/@dsc/ui-core/core/dock-browser.d.ts +137 -0
- package/lib/ui/sdk/@dsc/ui-core/core/dock-ops.d.ts +59 -0
- package/lib/ui/sdk/@dsc/ui-core/core/model-caps.d.ts +83 -0
- package/lib/ui/sdk/@dsc/ui-core/core/native-bridge.d.ts +135 -0
- package/lib/ui/sdk/@dsc/ui-core/core/token-estimate.d.ts +55 -0
- package/lib/ui/sdk/@dsc/ui-core/package.json +16 -0
- package/lib/ui/sdk/@dsc/ui-core/ui/arrival.d.ts +72 -0
- package/lib/ui/sdk/@dsc/ui-core/ui/frames.d.ts +67 -0
- package/lib/ui/sdk/@dsc/ui-core/ui/index.d.ts +59 -0
- package/lib/ui/sdk/@dsc/ui-core/ui/manifest.d.ts +172 -0
- package/lib/ui/sdk/@dsc/ui-core/ui/plugin.d.ts +161 -0
- package/lib/ui/sdk/@dsc/ui-core/ui/scoped-slots.d.ts +20 -0
- package/lib/ui/sdk/@dsc/ui-core/ui/services-react.d.ts +27 -0
- package/lib/ui/sdk/@dsc/ui-core/ui/services.d.ts +63 -0
- package/lib/ui/sdk/@dsc/ui-core/ui/slots-react.d.ts +28 -0
- package/lib/ui/sdk/@dsc/ui-core/ui/slots.d.ts +481 -0
- package/lib/ui/sdk/@dsc/ui-core/ui/store.d.ts +89 -0
- package/lib/ui/sdk/@dsc/ui-dockkit/dock-model.d.ts +238 -0
- package/lib/ui/sdk/@dsc/ui-dockkit/dock-state.d.ts +163 -0
- package/lib/ui/sdk/@dsc/ui-dockkit/dock.d.ts +24 -0
- package/lib/ui/sdk/@dsc/ui-dockkit/index.d.ts +15 -0
- package/lib/ui/sdk/@dsc/ui-dockkit/package.json +16 -0
- package/lib/ui/sdk/@dsc/ui-layout/app.d.ts +74 -0
- package/lib/ui/sdk/@dsc/ui-layout/appearance.d.ts +70 -0
- package/lib/ui/sdk/@dsc/ui-layout/host-channel.d.ts +112 -0
- package/lib/ui/sdk/@dsc/ui-layout/index.d.ts +34 -0
- package/lib/ui/sdk/@dsc/ui-layout/package.json +16 -0
- package/lib/ui/sdk/@dsc/ui-layout/page-state.d.ts +14 -0
- package/lib/ui/sdk/@dsc/ui-layout/review-pane.d.ts +21 -0
- package/lib/ui/sdk/@dsc/ui-layout/runtime-context.d.ts +44 -0
- package/lib/ui/sdk/@dsc/ui-layout/thread-view.d.ts +28 -0
- package/lib/ui/sdk/@dsc/ui-layout/update-button.d.ts +21 -0
- package/lib/ui/sdk/@dsc/ui-primitives/code-file-icon-artwork.d.ts +53 -0
- package/lib/ui/sdk/@dsc/ui-primitives/code-view.d.ts +15 -0
- package/lib/ui/sdk/@dsc/ui-primitives/compat.d.ts +27 -0
- package/lib/ui/sdk/@dsc/ui-primitives/completion-sound.d.ts +24 -0
- package/lib/ui/sdk/@dsc/ui-primitives/confirm.d.ts +33 -0
- package/lib/ui/sdk/@dsc/ui-primitives/css.d.ts +47 -0
- package/lib/ui/sdk/@dsc/ui-primitives/diff-rows.d.ts +20 -0
- package/lib/ui/sdk/@dsc/ui-primitives/file-icons.d.ts +38 -0
- package/lib/ui/sdk/@dsc/ui-primitives/file-type-classify.d.ts +66 -0
- package/lib/ui/sdk/@dsc/ui-primitives/file-type-icon.d.ts +57 -0
- package/lib/ui/sdk/@dsc/ui-primitives/highlight.d.ts +24 -0
- package/lib/ui/sdk/@dsc/ui-primitives/hover-delay.d.ts +17 -0
- package/lib/ui/sdk/@dsc/ui-primitives/icons.d.ts +109 -0
- package/lib/ui/sdk/@dsc/ui-primitives/index.d.ts +55 -0
- package/lib/ui/sdk/@dsc/ui-primitives/lang-table.d.ts +10 -0
- package/lib/ui/sdk/@dsc/ui-primitives/markdown.d.ts +20 -0
- package/lib/ui/sdk/@dsc/ui-primitives/native.d.ts +41 -0
- package/lib/ui/sdk/@dsc/ui-primitives/package.json +16 -0
- package/lib/ui/sdk/@dsc/ui-primitives/panels.d.ts +86 -0
- package/lib/ui/sdk/@dsc/ui-primitives/paths.d.ts +11 -0
- package/lib/ui/sdk/@dsc/ui-primitives/pdf-view.d.ts +13 -0
- package/lib/ui/sdk/@dsc/ui-primitives/plugin-text.d.ts +15 -0
- package/lib/ui/sdk/@dsc/ui-primitives/select.d.ts +35 -0
- package/lib/ui/sdk/@dsc/ui-primitives/table-view.d.ts +23 -0
- package/lib/ui/sdk/@dsc/ui-primitives/thread-resizer.d.ts +22 -0
- package/lib/ui/sdk/@dsc/ui-primitives/time.d.ts +33 -0
- package/lib/ui/sdk/@dsc/ui-primitives/toast.d.ts +16 -0
- package/lib/ui/sdk/@dsc/ui-primitives/tokens.d.ts +14 -0
- package/lib/ui/sdk/@dsc/ui-primitives/tool-args.d.ts +49 -0
- package/lib/ui/sdk/@dsc/ui-primitives/tool-summary.d.ts +64 -0
- package/lib/ui/sdk/@dsc/ui-renderer/boot.d.ts +121 -0
- package/lib/ui/sdk/@dsc/ui-renderer/hmr.d.ts +43 -0
- package/lib/ui/sdk/@dsc/ui-renderer/index.d.ts +20 -0
- package/lib/ui/sdk/@dsc/ui-renderer/package.json +16 -0
- package/lib/ui/sdk/@dsc/ui-slots/index.d.ts +19 -0
- package/lib/ui/sdk/@dsc/ui-slots/package.json +16 -0
- package/lib/ui/sdk/@dsc/ui-slots/slots-react.d.ts +48 -0
- package/lib/ui/sdk/@dsc/ui-slots/slots.d.ts +102 -0
- package/lib/ui/services-react.d.ts +27 -0
- package/lib/ui/services-react.js +32 -0
- package/lib/ui/services.d.ts +63 -0
- package/lib/ui/services.js +121 -0
- package/lib/ui/slots-ink.d.ts +26 -0
- package/lib/ui/slots-ink.js +78 -0
- package/lib/ui/slots-react.d.ts +28 -0
- package/lib/ui/slots-react.js +88 -0
- package/lib/ui/slots.d.ts +481 -0
- package/lib/ui/slots.js +550 -0
- package/lib/ui/store.d.ts +89 -0
- package/lib/ui/store.js +62 -0
- package/lib/ui/tui-plugin-api.d.ts +23 -0
- package/lib/ui/tui-plugin-api.js +23 -0
- package/lib/ui/tui-plugins.d.ts +47 -0
- package/lib/ui/tui-plugins.js +220 -0
- package/package.json +58 -6
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* surfaces 插件:provide `surfaces` 服务——界面快照的片段注册表。
|
|
3
|
+
*
|
|
4
|
+
* 每个功能点把自己那块状态投影登记进来(模式登记模式、清单登记清单……),
|
|
5
|
+
* 装配快照的那一层(transcript 插件)只问注册表要全部片段,不认识任何具体功能。
|
|
6
|
+
* 注册表本体在 core/surface-registry.ts,这里挂成服务。
|
|
7
|
+
*
|
|
8
|
+
* @module dsc/plugins/surfaces
|
|
9
|
+
*/
|
|
10
|
+
import type { Plugin } from '@deepseek-ai/cordis';
|
|
11
|
+
export declare const surfacesPlugin: Plugin.Object;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SurfaceRegistry } from '../core/surface-registry.js';
|
|
2
|
+
export const surfacesPlugin = {
|
|
3
|
+
name: 'surfaces',
|
|
4
|
+
provide: 'surfaces',
|
|
5
|
+
apply(ctx) {
|
|
6
|
+
const registry = new SurfaceRegistry();
|
|
7
|
+
const service = {
|
|
8
|
+
register(id, read) {
|
|
9
|
+
return registry.register({ id, read });
|
|
10
|
+
},
|
|
11
|
+
build() {
|
|
12
|
+
return registry.build();
|
|
13
|
+
},
|
|
14
|
+
get ids() {
|
|
15
|
+
return registry.ids;
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
ctx.provide('surfaces', service);
|
|
19
|
+
},
|
|
20
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 智能体团队(官方插件,默认关闭)。
|
|
3
|
+
*
|
|
4
|
+
* 叠在「子智能体」之上的协作层(对照 dsh 的团队档:成员列表 + 共享任务看板):
|
|
5
|
+
* 打开后模型多出 `team_task` 工具——共享任务板,登记要做的事、看谁在做什么、
|
|
6
|
+
* 认领和结项。看板按会话各一块(`~/.dsc/team/boards/<会话 id>.json`):
|
|
7
|
+
* 切到别的会话就是另一块板(对照 dsh 团队挂在 lead 会话之下)。
|
|
8
|
+
*
|
|
9
|
+
* 只开本插件不开子智能体也能用:一块只有 lead 在写的看板,就是一份共享 todo。
|
|
10
|
+
* 两个都开时,队友(子智能体插件派出的)转发 team_task 会带上自己的名字,
|
|
11
|
+
* 认领人因此记得住是谁,lead 一眼能看出哪条活在谁手里。
|
|
12
|
+
*
|
|
13
|
+
* @module dsc/plugins/team
|
|
14
|
+
*/
|
|
15
|
+
import type { Plugin } from '@deepseek-ai/cordis';
|
|
16
|
+
export declare const teamPlugin: Plugin.Object;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { BOARDS_DIR, boardCreate, boardUpdate, isReady, readBoard, resetBoard, } from '../core/team-board.js';
|
|
2
|
+
/** 主会话这一方在任务板上的名字。 */
|
|
3
|
+
const LEAD = 'lead';
|
|
4
|
+
/** 这次调用的署名:队友转发来的带 caller,主会话自己调就是 lead。 */
|
|
5
|
+
function callerOf(runCtx) {
|
|
6
|
+
return runCtx.caller?.name ?? LEAD;
|
|
7
|
+
}
|
|
8
|
+
export const teamPlugin = {
|
|
9
|
+
name: 'team',
|
|
10
|
+
inject: ['session', 'tools', 'prompt', 'settings'],
|
|
11
|
+
apply(ctx, _passed) {
|
|
12
|
+
async function runTeamTask(args, runCtx) {
|
|
13
|
+
const sessionId = ctx.session.current().meta.id;
|
|
14
|
+
const caller = callerOf(runCtx);
|
|
15
|
+
const action = String(args.action ?? '');
|
|
16
|
+
const board = readBoard(sessionId);
|
|
17
|
+
const id = String(args.id ?? '');
|
|
18
|
+
const revision = Number(args.expected_revision ?? board.revision);
|
|
19
|
+
const ownerDefault = caller;
|
|
20
|
+
try {
|
|
21
|
+
switch (action) {
|
|
22
|
+
case 'create': {
|
|
23
|
+
const scopes = Array.isArray(args.write_scopes) ? args.write_scopes.map(String) : [];
|
|
24
|
+
const blocked = Array.isArray(args.blocked_by) ? args.blocked_by.map(String) : [];
|
|
25
|
+
const created = boardCreate(sessionId, {
|
|
26
|
+
subject: String(args.subject ?? ''),
|
|
27
|
+
description: String(args.description ?? ''),
|
|
28
|
+
blockedBy: blocked,
|
|
29
|
+
writeScopes: scopes,
|
|
30
|
+
});
|
|
31
|
+
const warnings = created.warnings.length === 0 ? '' : `\n提醒(不拦你,最后看 diff 裁决):\n${created.warnings.map((line) => `- ${line}`).join('\n')}`;
|
|
32
|
+
if (args.claim_now !== true)
|
|
33
|
+
return `已建 ${created.task.id}:${created.task.subject}${warnings}`;
|
|
34
|
+
// 认领走正常的 claim:依赖没做完一样会被拦下,正好复用同一套校验
|
|
35
|
+
try {
|
|
36
|
+
boardUpdate(sessionId, created.task.id, created.board.revision, 'claim', { owner: ownerDefault });
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
return `已建 ${created.task.id}:${created.task.subject},但没能认领:${error instanceof Error ? error.message : String(error)}${warnings}`;
|
|
40
|
+
}
|
|
41
|
+
return `已建 ${created.task.id}:${created.task.subject},状态直接进 in_progress(认领人 ${ownerDefault})${warnings}`;
|
|
42
|
+
}
|
|
43
|
+
case 'list': {
|
|
44
|
+
if (board.tasks.length === 0)
|
|
45
|
+
return '本会话的任务板是空的(team_task action=create 建第一条)';
|
|
46
|
+
const lines = board.tasks.map((task) => {
|
|
47
|
+
const ready = isReady(board, task);
|
|
48
|
+
return `- ${task.id} [${task.status}${ready ? ' · 可开工' : ''}] ${task.subject}${task.owner === null ? '' : ` @${task.owner}`}${task.blockedBy.length === 0 ? '' : ` 依赖 ${task.blockedBy.join('、')}`}${task.writeScopes.length === 0 ? '' : ` 作用域 ${task.writeScopes.join(', ')}`}`;
|
|
49
|
+
});
|
|
50
|
+
return `本会话任务板第 ${board.revision} 版:\n${lines.join('\n')}\n(改状态要带 expected_revision=${board.revision})`;
|
|
51
|
+
}
|
|
52
|
+
case 'get': {
|
|
53
|
+
const task = board.tasks.find((entry) => entry.id === id);
|
|
54
|
+
if (task === undefined)
|
|
55
|
+
return `任务板上没有 ${id}`;
|
|
56
|
+
return `第 ${board.revision} 版里的 ${task.id}:\n标题:${task.subject}\n说明:${task.description || '(空)'}\n状态:${task.status},认领人 ${task.owner ?? '(无)'}\n依赖:${task.blockedBy.join('、') || '(无)'}\n作用域:${task.writeScopes.join(', ') || '(未声明)'}`;
|
|
57
|
+
}
|
|
58
|
+
case 'claim':
|
|
59
|
+
case 'release':
|
|
60
|
+
case 'complete':
|
|
61
|
+
case 'reopen':
|
|
62
|
+
case 'delete':
|
|
63
|
+
case 'set_dependencies': {
|
|
64
|
+
const payload = {};
|
|
65
|
+
if (action === 'claim')
|
|
66
|
+
payload.owner = String(args.owner ?? ownerDefault);
|
|
67
|
+
if (action === 'set_dependencies') {
|
|
68
|
+
payload.blockedBy = Array.isArray(args.blocked_by) ? args.blocked_by.map(String) : [];
|
|
69
|
+
}
|
|
70
|
+
const result = boardUpdate(sessionId, id, revision, action, payload);
|
|
71
|
+
const ready = result.board.tasks.filter((task) => isReady(result.board, task)).map((task) => task.id);
|
|
72
|
+
return `${id} → ${result.task.status}${result.task.owner === null ? '' : `(${result.task.owner})`},任务板第 ${result.board.revision} 版。现在可开工:${ready.join('、') || '(无)'}`;
|
|
73
|
+
}
|
|
74
|
+
default:
|
|
75
|
+
return `不认识的 action「${action}」。要用的值:create / list / get / claim / release / complete / reopen / set_dependencies / delete`;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
return `任务板操作没做成:${error instanceof Error ? error.message : String(error)}`;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
const teamTaskTool = () => ({
|
|
83
|
+
name: 'team_task',
|
|
84
|
+
description: '共享任务板(本会话):登记要做的事、看谁在做什么、认领和结项。' +
|
|
85
|
+
'改状态要带 expected_revision(list 返回的那一版),别人抢先改过就会失败,重来一次即可。',
|
|
86
|
+
parameters: {
|
|
87
|
+
type: 'object',
|
|
88
|
+
properties: {
|
|
89
|
+
action: {
|
|
90
|
+
type: 'string',
|
|
91
|
+
enum: ['create', 'list', 'get', 'claim', 'release', 'complete', 'reopen', 'set_dependencies', 'delete'],
|
|
92
|
+
description: '要做什么',
|
|
93
|
+
},
|
|
94
|
+
subject: { type: 'string', description: 'create 必填:任务标题' },
|
|
95
|
+
description: { type: 'string', description: 'create:任务的详细说明(背景、验收口径)' },
|
|
96
|
+
id: { type: 'string', description: '除 create/list 外必填:任务 id,例如 t3' },
|
|
97
|
+
expected_revision: { type: 'number', description: '你看到的任务板版本号,来自上一次 list/create' },
|
|
98
|
+
owner: { type: 'string', description: 'claim 时的认领人;不填就是你自己' },
|
|
99
|
+
claim_now: { type: 'boolean', description: 'create:true = 建完直接算你认领(状态直接进 in_progress)' },
|
|
100
|
+
write_scopes: { type: 'array', items: { type: 'string' }, description: 'create:这个任务打算改的路径前缀,用于提醒别人别撞车' },
|
|
101
|
+
blocked_by: { type: 'array', items: { type: 'string' }, description: 'create/set_dependencies:依赖哪些任务 id' },
|
|
102
|
+
},
|
|
103
|
+
required: ['action'],
|
|
104
|
+
},
|
|
105
|
+
risk: 'read',
|
|
106
|
+
run: (args, runCtx) => runTeamTask(args, runCtx),
|
|
107
|
+
});
|
|
108
|
+
const offTool = ctx.tools.register(teamTaskTool());
|
|
109
|
+
const offPrompt = ctx.prompt.register('team', () => {
|
|
110
|
+
const board = readBoard(ctx.session.current().meta.id);
|
|
111
|
+
const lines = board.tasks.slice(0, 20).map((task) => {
|
|
112
|
+
const ready = isReady(board, task);
|
|
113
|
+
return `- ${task.id} [${task.status}${ready ? ' · 可开工' : ''}] ${task.subject}${task.owner === null ? '' : ` @${task.owner}`}`;
|
|
114
|
+
});
|
|
115
|
+
return `# 智能体团队(共享任务板)
|
|
116
|
+
本会话有一块共享任务板,你可以用 team_task 工具登记要做的事、认领和结项;队友和你看到的是同一块板。
|
|
117
|
+
${lines.length === 0 ? '板上还没有任务。' : `板上的任务:\n${lines.join('\n')}`}
|
|
118
|
+
|
|
119
|
+
任务板的规矩:
|
|
120
|
+
1. 多人协作先上任务板:create 时写清 write_scopes(打算改哪些路径),别人 claim 时才抢不过你;改状态要带 expected_revision。
|
|
121
|
+
2. 认领前先 list:依赖没完成的任务开不了工;完成一条,等它的人就能开工。`;
|
|
122
|
+
});
|
|
123
|
+
// ── 设置分区 ────────────────────────────────────────────────────────────
|
|
124
|
+
const fields = () => [
|
|
125
|
+
{ type: 'info', label: '任务板目录', text: BOARDS_DIR, mono: true, copyable: true, help: '每个会话各一块板(<会话 id>.json),切会话就是另一块板。' },
|
|
126
|
+
{ type: 'button', action: 'clear-board', label: '清空本会话任务板', style: 'ghost', help: '仅清空当前会话的任务条目,不影响其他会话与队友运行记录。' },
|
|
127
|
+
];
|
|
128
|
+
const section = {
|
|
129
|
+
id: 'team',
|
|
130
|
+
title: '智能体团队',
|
|
131
|
+
subtitle: '启用团队协作、共享任务看板;成员列表跟随「子智能体」插件',
|
|
132
|
+
fields,
|
|
133
|
+
values: () => ({}),
|
|
134
|
+
action: (name) => {
|
|
135
|
+
if (name === 'clear-board') {
|
|
136
|
+
return `本会话的任务板清空了(去掉 ${resetBoard(ctx.session.current().meta.id)} 条)`;
|
|
137
|
+
}
|
|
138
|
+
throw new Error(`这个分区没有这个按钮:${name}`);
|
|
139
|
+
},
|
|
140
|
+
};
|
|
141
|
+
const offSection = ctx.settings.registerSection(section);
|
|
142
|
+
// ── 卸载 ────────────────────────────────────────────────────────────────
|
|
143
|
+
return () => {
|
|
144
|
+
offSection();
|
|
145
|
+
offPrompt();
|
|
146
|
+
offTool();
|
|
147
|
+
};
|
|
148
|
+
},
|
|
149
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* todo 插件:provide `todo` 服务——模型自己维护、界面实时显示的那张任务清单。
|
|
3
|
+
*
|
|
4
|
+
* 这个功能点由这几块组成,全在自己文件里:
|
|
5
|
+
* 1. 工具 `todo_write`(整表替换或按 id 合并);
|
|
6
|
+
* 2. 命令 `/todo [clear]`;
|
|
7
|
+
* 3. 界面快照里的 `todos` 那片投影(注册进 surfaces 注册表);
|
|
8
|
+
* 4. 会话状态条目 `todos`(恢复历史会话时清单跟着回来)与压缩后要原样带过去的清单文本;
|
|
9
|
+
* 5. 「todo-reminder」节流提醒投影(order 800,默认关):距上次写清单过了 N 个用户回合、
|
|
10
|
+
* 且还有未完成项时,往请求末尾补一条 user 提醒。逻辑在 `core/todo-reminder.ts`(纯函数,
|
|
11
|
+
* 可被探针直读),配置走本插件的设置分区。
|
|
12
|
+
*
|
|
13
|
+
* 形状抄三家:整表替换与四态来自 Codex 的 `update_plan`(`protocol/src/plan_tool.rs:9-28`)
|
|
14
|
+
* 与 DSH 的 `todo_write`;id / 子任务 / 单调 revision 来自 Hermes(`tools/todo_tool.py:9-32`)。
|
|
15
|
+
*
|
|
16
|
+
* @module dsc/plugins/todo
|
|
17
|
+
*/
|
|
18
|
+
import type { Plugin } from '@deepseek-ai/cordis';
|
|
19
|
+
export declare const todoPlugin: Plugin.Object;
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { resolvePluginConfig, writePluginConfig } from '../core/plugin-registry.js';
|
|
2
|
+
import { appendTodoReminder } from '../core/todo-reminder.js';
|
|
3
|
+
import { TodoStore } from '../core/todo.js';
|
|
4
|
+
/** 配置键(`~/.dsc/plugins.json` 条目树里 `file` 等于这个名字那一项的 `config`)。 */
|
|
5
|
+
const CONFIG_KEY = 'todo';
|
|
6
|
+
/** 节流提醒的默认值:默认关(不给所有会话凭空加 token),每 10 个用户回合提醒一次。 */
|
|
7
|
+
const REMINDER_DEFAULTS = { enabled: false, everyTurns: 10 };
|
|
8
|
+
/** 从插件配置读节流提醒的开关与间隔,并把间隔夹回 1..100。 */
|
|
9
|
+
function readReminderConfig() {
|
|
10
|
+
const raw = resolvePluginConfig(CONFIG_KEY);
|
|
11
|
+
const num = Number(raw.everyTurns);
|
|
12
|
+
return {
|
|
13
|
+
enabled: raw.enabled === true || raw.enabled === 'true',
|
|
14
|
+
everyTurns: Number.isFinite(num)
|
|
15
|
+
? Math.min(Math.max(Math.round(num), 1), 100)
|
|
16
|
+
: REMINDER_DEFAULTS.everyTurns,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/** 任务清单工具:写入即回显整表,模型看到的和用户看到的是同一份。 */
|
|
20
|
+
function todoTool(store, onWrite) {
|
|
21
|
+
return {
|
|
22
|
+
name: 'todo_write',
|
|
23
|
+
description: '维护本次任务的用户可见清单:传 todos 数组整表替换,或 merge:true 只改给出的那几条(必须带 id)。' +
|
|
24
|
+
'状态只有 pending / in_progress / completed / cancelled 四种,同一时刻最多一条 in_progress。' +
|
|
25
|
+
'什么时候用:3 步以上的活开工前先立清单,做完一步立刻改状态。' +
|
|
26
|
+
'什么时候不用:一两步就完的事别立清单,纯问答也别立;不要用它在计划模式里代替计划文件。',
|
|
27
|
+
parameters: {
|
|
28
|
+
type: 'object',
|
|
29
|
+
properties: {
|
|
30
|
+
todos: {
|
|
31
|
+
type: 'array',
|
|
32
|
+
description: '任务清单',
|
|
33
|
+
items: {
|
|
34
|
+
type: 'object',
|
|
35
|
+
properties: {
|
|
36
|
+
id: { type: 'string', description: '条目 id(不给自动生成;merge 模式必须给)' },
|
|
37
|
+
content: { type: 'string', description: '一句话动作描述(≤300 字)' },
|
|
38
|
+
status: { type: 'string', description: 'pending | in_progress | completed | cancelled' },
|
|
39
|
+
parent: { type: 'string', description: '父任务 id(表示这是它的子任务)' },
|
|
40
|
+
},
|
|
41
|
+
required: ['content'],
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
merge: { type: 'boolean', description: 'true = 按 id 合并更新;默认 false = 整表替换' },
|
|
45
|
+
},
|
|
46
|
+
required: ['todos'],
|
|
47
|
+
},
|
|
48
|
+
risk: 'read',
|
|
49
|
+
async run(args) {
|
|
50
|
+
const list = Array.isArray(args.todos) ? args.todos : null;
|
|
51
|
+
if (list === null)
|
|
52
|
+
throw new Error('todos 必须是数组');
|
|
53
|
+
const result = store.write(list, args.merge === true);
|
|
54
|
+
onWrite();
|
|
55
|
+
const progress = store.progress();
|
|
56
|
+
const notes = result.notes.length > 0 ? `\n注意:${result.notes.join(';')}` : '';
|
|
57
|
+
if (store.read().length === 0)
|
|
58
|
+
return '清单已清空。';
|
|
59
|
+
return `清单已更新(${progress.done}/${progress.total} 完成)\n${store.formatForPrompt()}${notes}`;
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
export const todoPlugin = {
|
|
64
|
+
name: 'todo',
|
|
65
|
+
inject: ['session', 'tools', 'commands', 'surfaces', 'compact', 'prompt', 'settings'],
|
|
66
|
+
provide: 'todo',
|
|
67
|
+
apply(ctx) {
|
|
68
|
+
const todos = new TodoStore();
|
|
69
|
+
const restored = ctx.session.current().state('todos');
|
|
70
|
+
if (restored !== undefined)
|
|
71
|
+
todos.restore(restored);
|
|
72
|
+
const touch = () => ctx.emit('dsc/changed');
|
|
73
|
+
const writeTodos = (list, merge) => {
|
|
74
|
+
const result = todos.write(list, merge);
|
|
75
|
+
ctx.session.current().appendState('todos', result.items);
|
|
76
|
+
touch();
|
|
77
|
+
return result;
|
|
78
|
+
};
|
|
79
|
+
const service = {
|
|
80
|
+
todoView() {
|
|
81
|
+
const progress = todos.progress();
|
|
82
|
+
return {
|
|
83
|
+
items: todos.read(),
|
|
84
|
+
revision: todos.rev,
|
|
85
|
+
done: progress.done,
|
|
86
|
+
total: progress.total,
|
|
87
|
+
active: progress.active,
|
|
88
|
+
};
|
|
89
|
+
},
|
|
90
|
+
writeTodos,
|
|
91
|
+
clearTodos() {
|
|
92
|
+
todos.clear();
|
|
93
|
+
ctx.session.current().appendState('todos', []);
|
|
94
|
+
ctx.emit('dsc/notice', '任务清单已清空');
|
|
95
|
+
touch();
|
|
96
|
+
},
|
|
97
|
+
todoPrompt() {
|
|
98
|
+
return todos.empty ? '' : `本次任务清单(当前进度,照它继续,别重建):\n${todos.formatForPrompt()}`;
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
ctx.provide('todo', service);
|
|
102
|
+
ctx.tools.register(todoTool(todos, () => ctx.emit('dsc/changed')));
|
|
103
|
+
ctx.surfaces.register('todos', () => service.todoView());
|
|
104
|
+
// 压缩摘要会把清单改写走样,所以整表要原样带过去(压缩插件只问注册表要文本)。
|
|
105
|
+
ctx.compact.registerCarry(() => service.todoPrompt());
|
|
106
|
+
// ── 节流提醒投影(默认关)──────────────────────────────────────────────
|
|
107
|
+
// 长会话里模型会把「做完一步就改状态」忘掉,光靠工具说明里的静态叮嘱拉不回来。
|
|
108
|
+
// 这条投影每 N 个用户回合往请求末尾补一条 user 提醒(ZCode 的节流注入思路),
|
|
109
|
+
// 代价是多一条 user 消息的 token,所以默认关、用户自己开。
|
|
110
|
+
let reminder = readReminderConfig();
|
|
111
|
+
const applyReminder = (patch) => {
|
|
112
|
+
writePluginConfig(CONFIG_KEY, patch);
|
|
113
|
+
reminder = readReminderConfig();
|
|
114
|
+
};
|
|
115
|
+
const offReminder = ctx.prompt.registerProjection('todo-reminder', (messages) => appendTodoReminder(messages, {
|
|
116
|
+
enabled: reminder.enabled,
|
|
117
|
+
everyTurns: reminder.everyTurns,
|
|
118
|
+
hasOpenTodos: todos.read().some((item) => item.status === 'pending' || item.status === 'in_progress'),
|
|
119
|
+
}),
|
|
120
|
+
// order 800:排在 env-facts(600) 之后(提醒要落在环境快照之后,也在 drop-images(900) 之前)
|
|
121
|
+
{ order: 800 });
|
|
122
|
+
const reminderFields = [
|
|
123
|
+
{
|
|
124
|
+
type: 'switch',
|
|
125
|
+
key: 'enabled',
|
|
126
|
+
label: '每过若干回合提醒一次未完成任务',
|
|
127
|
+
help: '开启后,距上次更新任务清单超过设定回合数且清单里还有未完成项时,往下一轮请求末尾补一条提醒。默认关(省 token)。',
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
type: 'number',
|
|
131
|
+
key: 'everyTurns',
|
|
132
|
+
label: '每隔几个用户回合提醒一次',
|
|
133
|
+
min: 1,
|
|
134
|
+
max: 100,
|
|
135
|
+
step: 1,
|
|
136
|
+
help: '数值越小提醒越勤、token 花得越多;只在上面那条开着时生效。',
|
|
137
|
+
},
|
|
138
|
+
];
|
|
139
|
+
const reminderSection = {
|
|
140
|
+
id: CONFIG_KEY,
|
|
141
|
+
title: '任务清单',
|
|
142
|
+
subtitle: '未完成任务的节流提醒',
|
|
143
|
+
order: 45,
|
|
144
|
+
fields: () => reminderFields,
|
|
145
|
+
// 每次打开都现读磁盘:手改 plugins.json 也能看到真值。
|
|
146
|
+
values: () => {
|
|
147
|
+
reminder = readReminderConfig();
|
|
148
|
+
return { enabled: reminder.enabled, everyTurns: reminder.everyTurns };
|
|
149
|
+
},
|
|
150
|
+
save: (key, value) => {
|
|
151
|
+
if (key === 'enabled') {
|
|
152
|
+
applyReminder({ enabled: value === true || value === 'true' });
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
if (key === 'everyTurns') {
|
|
156
|
+
const num = Number(value);
|
|
157
|
+
if (!Number.isFinite(num))
|
|
158
|
+
return '这里要填一个数字';
|
|
159
|
+
if (num < 1 || num > 100)
|
|
160
|
+
return '间隔要在 1 到 100 之间';
|
|
161
|
+
applyReminder({ everyTurns: Math.round(num) });
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
return `这个分区没有这项:${key}`;
|
|
165
|
+
},
|
|
166
|
+
};
|
|
167
|
+
const offReminderSection = ctx.settings.registerSection(reminderSection);
|
|
168
|
+
ctx.commands.register({ name: 'todo', args: '[clear]', description: '查看或清空本次任务清单' }, ({ args, ui }) => {
|
|
169
|
+
if (args[0] === 'clear') {
|
|
170
|
+
service.clearTodos();
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
const text = todos.formatForPrompt();
|
|
174
|
+
ui.notice(text === '' ? '当前没有任务清单。' : text);
|
|
175
|
+
});
|
|
176
|
+
ctx.on('dsc/session-open', ({ session }) => {
|
|
177
|
+
const items = session.state('todos');
|
|
178
|
+
todos.clear();
|
|
179
|
+
if (items !== undefined)
|
|
180
|
+
todos.restore(items);
|
|
181
|
+
touch();
|
|
182
|
+
});
|
|
183
|
+
return () => {
|
|
184
|
+
offReminder();
|
|
185
|
+
offReminderSection();
|
|
186
|
+
};
|
|
187
|
+
},
|
|
188
|
+
};
|