pi-web-ui 0.117.0 → 0.118.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/CHANGELOG.md +48 -2
- package/README.md +69 -138
- package/README.zh-CN.md +70 -179
- package/README.zh-TW.md +3 -1
- package/bin/device-hub-cli.mjs +147 -43
- package/bin/frp-manager.mjs +4 -80
- package/bin/hub-upgrade.mjs +561 -0
- package/bin/pi-device-hub.mjs +0 -1
- package/bin/pi-web-ui.mjs +56 -444
- package/deploy/nginx-subpath.conf +0 -33
- package/deploy/pi-web-ui.service +0 -20
- package/dist/server/agent-formatters.js +4 -38
- package/dist/server/agent-service-daemon.js +160 -374
- package/dist/server/agent-service.js +875 -2978
- package/dist/server/approval-audit.js +2 -23
- package/dist/server/approval-default-rules.js +0 -6
- package/dist/server/approval-rules.js +7 -105
- package/dist/server/ask-user-question-tool.js +1 -12
- package/dist/server/atomic-file.js +33 -5
- package/dist/server/attachment-store.js +0 -36
- package/dist/server/attachments.js +3 -112
- package/dist/server/auth-cookie.js +0 -21
- package/dist/server/bash-tool.js +1 -32
- package/dist/server/bg-servers.js +0 -96
- package/dist/server/browser-page-tool.js +11 -62
- package/dist/server/builtin-modules.js +7 -0
- package/dist/server/canvas/canvas-agent-tool.js +58 -47
- package/dist/server/canvas/canvas-cards.js +0 -14
- package/dist/server/canvas/canvas-dispatch.js +7 -4
- package/dist/server/canvas/canvas-orchestrator.js +167 -181
- package/dist/server/canvas/canvas-runtime-messages.js +30 -0
- package/dist/server/canvas/canvas-scheduled-task.js +0 -3
- package/dist/server/canvas/canvas-scheduler.js +5 -7
- package/dist/server/canvas/canvas-store.js +24 -35
- package/dist/server/canvas/canvas-validation.js +17 -14
- package/dist/server/canvas/canvas-workspace.js +26 -30
- package/dist/server/canvas/pstack-skills-data.js +0 -5
- package/dist/server/claim-files-tool.js +1 -15
- package/dist/server/claim-store.js +5 -49
- package/dist/server/client-id-utils.js +0 -16
- package/dist/server/client-state.js +6 -213
- package/dist/server/communicate-tool.js +0 -3
- package/dist/server/compact-context-tool.js +0 -30
- package/dist/server/compacted-history.js +0 -35
- package/dist/server/compaction-instructions.js +0 -13
- package/dist/server/compaction-markers.js +3 -76
- package/dist/server/compaction-state.js +0 -21
- package/dist/server/composer-drafts.js +0 -34
- package/dist/server/context-budget-runner.js +0 -11
- package/dist/server/context-budget.js +1 -70
- package/dist/server/context-evidence.js +0 -14
- package/dist/server/context-usage.js +0 -12
- package/dist/server/control-socket.js +4 -48
- package/dist/server/conversation-communication.js +0 -10
- package/dist/server/conversation-identity.js +0 -1
- package/dist/server/conversation-read-tool.js +0 -58
- package/dist/server/conversation-tool-names.js +0 -1
- package/dist/server/conversation-tool.js +0 -1
- package/dist/server/conversation-touches.js +4 -75
- package/dist/server/dangling-tools.js +0 -82
- package/dist/server/delegate-mode.js +0 -36
- package/dist/server/delegate-task.js +2 -28
- package/dist/server/device-center/approval-summary.js +0 -1
- package/dist/server/device-center/bot-catalog.js +0 -3
- package/dist/server/device-center/bot-execution.js +0 -8
- package/dist/server/device-center/bot-presets.js +0 -1
- package/dist/server/device-center/bots.js +0 -1
- package/dist/server/device-center/collab-service.js +1 -3
- package/dist/server/device-center/collab-tool.js +0 -10
- package/dist/server/device-center/connector.js +21 -11
- package/dist/server/device-center/delivery-authority.js +0 -3
- package/dist/server/device-center/delivery-subject.js +0 -1
- package/dist/server/device-center/desktop-linux.js +3 -15
- package/dist/server/device-center/desktop-native.js +1 -10
- package/dist/server/device-center/desktop-page.js +2 -3
- package/dist/server/device-center/desktop-setup.js +1 -3
- package/dist/server/device-center/desktop.js +1 -7
- package/dist/server/device-center/device-integration.js +1 -27
- package/dist/server/device-center/device-lan-access.js +403 -0
- package/dist/server/device-center/device-lan.js +484 -0
- package/dist/server/device-center/device-portals.js +0 -3
- package/dist/server/device-center/execution-failure.js +0 -2
- package/dist/server/device-center/execution-guides.js +0 -1
- package/dist/server/device-center/execution-instructions.js +0 -1
- package/dist/server/device-center/execution-settings.js +0 -1
- package/dist/server/device-center/execution-system-prompt.js +0 -3
- package/dist/server/device-center/execution-workspace.js +1 -4
- package/dist/server/device-center/executor.js +0 -27
- package/dist/server/device-center/file-sync-paths.js +0 -5
- package/dist/server/device-center/file-sync.js +0 -10
- package/dist/server/device-center/group-context-delta.js +0 -8
- package/dist/server/device-center/group-context-message.js +0 -14
- package/dist/server/device-center/group-context.js +0 -19
- package/dist/server/device-center/group-events.js +0 -2
- package/dist/server/device-center/group-plan-guard.js +1 -35
- package/dist/server/device-center/group-router-runtime.js +182 -0
- package/dist/server/device-center/group-router-worker.js +178 -0
- package/dist/server/device-center/group-router.js +359 -0
- package/dist/server/device-center/hub-auth.js +24 -2
- package/dist/server/device-center/hub-conversations.js +0 -12
- package/dist/server/device-center/hub-deliveries.js +0 -1
- package/dist/server/device-center/hub-integration.js +0 -8
- package/dist/server/device-center/hub-locks.js +1 -5
- package/dist/server/device-center/hub-mobile.js +147 -0
- package/dist/server/device-center/hub-orchestration.js +400 -0
- package/dist/server/device-center/hub-page.js +25 -7
- package/dist/server/device-center/hub-setup.js +0 -6
- package/dist/server/device-center/hub-transaction-log.js +0 -22
- package/dist/server/device-center/hub-upgrade.js +162 -0
- package/dist/server/device-center/hub-webhooks.js +1 -3
- package/dist/server/device-center/hub.js +210 -86
- package/dist/server/device-center/human-interaction.js +1 -4
- package/dist/server/device-center/integration-errors.js +0 -2
- package/dist/server/device-center/integration-verification.js +0 -2
- package/dist/server/device-center/local-hub.js +0 -2
- package/dist/server/device-center/local-publication.js +1 -8
- package/dist/server/device-center/local-verification-job.js +0 -2
- package/dist/server/device-center/local-verification.js +0 -1
- package/dist/server/device-center/local.js +267 -39
- package/dist/server/device-center/main.js +14 -1
- package/dist/server/device-center/mobile-notification-forwarder.js +292 -0
- package/dist/server/device-center/native-desktop/macos.js +0 -1
- package/dist/server/device-center/native-desktop/windows.js +0 -1
- package/dist/server/device-center/partition-log.js +0 -31
- package/dist/server/device-center/path-portal.js +42 -12
- package/dist/server/device-center/publication-journal.js +0 -7
- package/dist/server/device-center/publish-intent.js +0 -5
- package/dist/server/device-center/relay.js +85 -30
- package/dist/server/device-center/report-upload.js +0 -1
- package/dist/server/device-center/runtime.js +1 -18
- package/dist/server/device-center/store.js +13 -33
- package/dist/server/device-center/task-context-budget.js +0 -3
- package/dist/server/device-center/task-error.js +0 -1
- package/dist/server/device-center/task-journal.js +6 -23
- package/dist/server/device-center/task-outcome.js +0 -13
- package/dist/server/device-center/task-plan.js +0 -1
- package/dist/server/device-center/task-progress.js +0 -16
- package/dist/server/device-center/task-recovery.js +5 -88
- package/dist/server/device-center/task-report-outbox.js +0 -4
- package/dist/server/device-center/task-report.js +2 -10
- package/dist/server/device-center/task-scheduler.js +1 -35
- package/dist/server/device-center/task-settlement.js +0 -18
- package/dist/server/device-center/task-state.js +0 -12
- package/dist/server/device-center/task-workspace.js +0 -50
- package/dist/server/device-center/transfer-stream.js +5 -45
- package/dist/server/device-center/transfers.js +2 -10
- package/dist/server/device-center/verification-limits.js +0 -1
- package/dist/server/device-center/work-contract.js +1 -73
- package/dist/server/device-center/work-items.js +317 -0
- package/dist/server/device-center/workspaces.js +0 -1
- package/dist/server/dispatch-domain-handlers.js +190 -32
- package/dist/server/dispatch-plugin-handlers.js +2 -19
- package/dist/server/dsh/dsh-agent-service.js +69 -599
- package/dist/server/dsh/dsh-client.js +7 -111
- package/dist/server/dsh/dsh-market-service.js +4 -25
- package/dist/server/dsh/dsh-serialize.js +0 -49
- package/dist/server/dsh/dsh-sessions.js +0 -37
- package/dist/server/dsh/dsh-usage.js +0 -37
- package/dist/server/dsh/preset-clones.js +1 -65
- package/dist/server/dsh/runtime/custom-prompt.mjs +0 -14
- package/dist/server/dsh/runtime/goal-rpc.mjs +7 -176
- package/dist/server/dsh/runtime/launcher.mjs +2 -53
- package/dist/server/dsh/runtime/override.patch.yml +0 -29
- package/dist/server/dsh/runtime/runtime-root.mjs +0 -54
- package/dist/server/durable/durable-agent-service.js +5 -23
- package/dist/server/durable/durable-driver.js +12 -73
- package/dist/server/durable/durable-event-projector.js +1 -50
- package/dist/server/durable/durable-loader.js +0 -12
- package/dist/server/durable/durable-models.js +11 -80
- package/dist/server/durable/durable-storage.js +1 -17
- package/dist/server/durable/durable-tools.js +2 -20
- package/dist/server/durable/index.js +0 -3
- package/dist/server/edit-soft-tool.js +2 -81
- package/dist/server/engine-capabilities.js +0 -13
- package/dist/server/engine-catalog.js +74 -0
- package/dist/server/engine-cli.js +89 -0
- package/dist/server/engine-probe.js +35 -217
- package/dist/server/ensure-bash.js +2 -28
- package/dist/server/eval-tool.js +1 -50
- package/dist/server/evidence-tool-hooks.js +0 -2
- package/dist/server/file-archives.js +0 -10
- package/dist/server/file-save.js +1 -12
- package/dist/server/file-transfer-routes.js +0 -11
- package/dist/server/files-service.js +18 -271
- package/dist/server/global-loader.js +9 -89
- package/dist/server/goal-evidence.js +1 -35
- package/dist/server/goal-review-gate.js +0 -58
- package/dist/server/goal-service.js +19 -422
- package/dist/server/hashline-engine.js +8 -112
- package/dist/server/host-guard.js +0 -24
- package/dist/server/host-metrics.js +0 -6
- package/dist/server/http-proxy.js +1 -7
- package/dist/server/i18n.js +5 -72
- package/dist/server/icon-svg.js +0 -15
- package/dist/server/index.js +177 -680
- package/dist/server/json-utils.js +0 -12
- package/dist/server/launch-origin.js +0 -44
- package/dist/server/left-panel-running.js +0 -9
- package/dist/server/load-timing.js +1 -4
- package/dist/server/load-tools-tool.js +0 -20
- package/dist/server/locales.js +1 -46
- package/dist/server/lsp-tool.js +13 -126
- package/dist/server/managed.js +0 -48
- package/dist/server/marker-service.js +1 -22
- package/dist/server/markers/builtins/action.js +0 -19
- package/dist/server/markers/builtins/notify.js +1 -9
- package/dist/server/markers/builtins/rename.js +0 -13
- package/dist/server/markers/index.js +0 -3
- package/dist/server/markers/marker.js +0 -13
- package/dist/server/markers/registry.js +0 -3
- package/dist/server/markers/store.js +1 -12
- package/dist/server/market-service.js +7 -43
- package/dist/server/mcp-agent-tool.js +0 -10
- package/dist/server/mcp-bridge.js +6 -138
- package/dist/server/mcp-hot-reload.js +0 -25
- package/dist/server/mcp-manager.js +2 -44
- package/dist/server/mcp-oauth-login.js +0 -2
- package/dist/server/mcp-oauth-ui.js +1 -4
- package/dist/server/mcp-oauth.js +5 -79
- package/dist/server/mcp-project-runtime.js +0 -4
- package/dist/server/message-deletion.js +0 -2
- package/dist/server/message-entry-resolver.js +0 -8
- package/dist/server/message-window.js +0 -71
- package/dist/server/mobile-notification-events.js +16 -0
- package/dist/server/mobile-origin.js +79 -0
- package/dist/server/mobile-push.js +523 -0
- package/dist/server/model-admin.js +19 -358
- package/dist/server/model-enrich.js +0 -19
- package/dist/server/model-resolver.js +2 -61
- package/dist/server/native-cli-discovery.js +115 -0
- package/dist/server/native-cli-model.js +71 -0
- package/dist/server/native-cli-references.js +214 -0
- package/dist/server/native-cli-remote-cleanup.js +58 -0
- package/dist/server/native-cli-remote-files.js +282 -0
- package/dist/server/native-cli-routes.js +68 -0
- package/dist/server/native-cli-runtime.js +1 -0
- package/dist/server/native-cli-session-hooks.js +170 -0
- package/dist/server/native-cli-session.js +585 -0
- package/dist/server/native-cli-state.js +82 -0
- package/dist/server/native-cli.js +210 -0
- package/dist/server/net-guard.js +9 -71
- package/dist/server/office-parse.js +0 -50
- package/dist/server/orphan-manager.js +0 -18
- package/dist/server/patch-bash-process.js +0 -4
- package/dist/server/patch-executable-lookup.js +0 -77
- package/dist/server/patch-node-pty.js +3 -43
- package/dist/server/patch-remote-catalog.js +1 -32
- package/dist/server/patch-tool.js +0 -15
- package/dist/server/payload-limits.js +0 -5
- package/dist/server/pending-question.js +0 -5
- package/dist/server/permission-preset.js +4 -33
- package/dist/server/persona-chain.js +0 -26
- package/dist/server/pkg-info.js +1 -17
- package/dist/server/plan-manager.js +2 -49
- package/dist/server/plan-mode.js +0 -97
- package/dist/server/plan-update-tool.js +1 -15
- package/dist/server/plugin-api-catalog.js +6 -4
- package/dist/server/plugin-assets.js +1 -35
- package/dist/server/plugin-bundled.js +68 -0
- package/dist/server/plugin-catalog-sync.js +0 -37
- package/dist/server/plugin-catalog.js +13 -67
- package/dist/server/plugin-chat-attachments.js +0 -1
- package/dist/server/plugin-conversation-view.js +0 -20
- package/dist/server/plugin-dom.js +1 -23
- package/dist/server/plugin-facilities.js +4 -115
- package/dist/server/plugin-grants.js +2 -90
- package/dist/server/plugin-install-spec.js +0 -43
- package/dist/server/plugin-installer.js +34 -75
- package/dist/server/plugin-llm.js +4 -38
- package/dist/server/plugin-manifest-validate.js +0 -31
- package/dist/server/plugin-permissions.js +1 -24
- package/dist/server/plugin-project.js +7 -129
- package/dist/server/plugin-removal.js +1 -8
- package/dist/server/plugin-schedule.js +1 -38
- package/dist/server/plugin-secrets.js +3 -16
- package/dist/server/plugin-tool-guard.js +1 -28
- package/dist/server/plugin-ui-slots.js +0 -4
- package/dist/server/plugin-updater.js +15 -90
- package/dist/server/plugins.js +71 -619
- package/dist/server/present-files-tool.js +0 -57
- package/dist/server/preset-fields.js +9 -62
- package/dist/server/preset-plugin-dependencies.js +0 -2
- package/dist/server/preset-share.js +3 -172
- package/dist/server/process-utils.js +4 -80
- package/dist/server/prompt-assembler.js +2 -30
- package/dist/server/prompt-base-store.js +0 -47
- package/dist/server/prompt-composer.js +21 -98
- package/dist/server/prompt-templates.js +0 -2
- package/dist/server/protocol-version.js +1 -11
- package/dist/server/protocol.js +0 -5
- package/dist/server/queue-modes.js +0 -3
- package/dist/server/queue-utils.js +0 -40
- package/dist/server/quick-ask-context.js +384 -0
- package/dist/server/quick-ask-settings.js +34 -1
- package/dist/server/quick-ask.js +123 -27
- package/dist/server/read-tool.js +0 -65
- package/dist/server/reasoning-registry.js +1 -29
- package/dist/server/remote-cli-persistence.js +373 -0
- package/dist/server/remote-native-cli.js +78 -0
- package/dist/server/remote-ssh-service.js +481 -190
- package/dist/server/request-context.js +0 -9
- package/dist/server/resolve-global-sdk.js +0 -26
- package/dist/server/sandbox-data.js +0 -1
- package/dist/server/sandbox-engines.js +0 -1
- package/dist/server/sandbox-runtime-gate.js +0 -3
- package/dist/server/sandbox-service.js +0 -41
- package/dist/server/sandbox-tool.js +0 -20
- package/dist/server/schedule-agent-tool.js +2 -31
- package/dist/server/scheduler-tasks.js +3 -54
- package/dist/server/scm-commitmsg.js +0 -53
- package/dist/server/scm.js +3 -48
- package/dist/server/sdk-builtin-extensions.js +2 -29
- package/dist/server/sdk-origin.js +0 -45
- package/dist/server/serialize.js +2 -92
- package/dist/server/server-config.js +0 -11
- package/dist/server/session-branch.js +1 -87
- package/dist/server/session-list-scan.js +17 -25
- package/dist/server/session-open.js +2 -26
- package/dist/server/session-parser.js +1 -55
- package/dist/server/session-scan.js +1 -17
- package/dist/server/session-search.js +0 -56
- package/dist/server/settings-service.js +11 -126
- package/dist/server/setup-config.js +0 -2
- package/dist/server/setup-page.js +0 -9
- package/dist/server/skill-content-filler.js +0 -17
- package/dist/server/skill-discovery.js +5 -92
- package/dist/server/skill-maintenance.js +1 -28
- package/dist/server/skill-tool.js +0 -30
- package/dist/server/slash-commands.js +5 -50
- package/dist/server/soft-cap.js +0 -42
- package/dist/server/startup-banner.js +0 -8
- package/dist/server/subagent-handoff.js +0 -11
- package/dist/server/subagent-helpers.js +2 -17
- package/dist/server/subagent-notify.js +0 -19
- package/dist/server/subagent-security-gate.js +0 -50
- package/dist/server/subagent-task.js +0 -9
- package/dist/server/subagent-templates-hant.js +0 -10
- package/dist/server/subagent-templates.js +3 -103
- package/dist/server/subagents.js +1 -87
- package/dist/server/system-screenshot-windows.js +259 -0
- package/dist/server/system-screenshot.js +77 -0
- package/dist/server/tabs.js +3 -48
- package/dist/server/terminals.js +559 -586
- package/dist/server/text-quote.js +0 -12
- package/dist/server/text-sniff.js +2 -52
- package/dist/server/themes.js +2 -41
- package/dist/server/tool-approval.js +0 -47
- package/dist/server/tool-guards.js +0 -90
- package/dist/server/tool-host-factories.js +1 -16
- package/dist/server/tool-info.js +0 -13
- package/dist/server/tool-manager.js +1 -229
- package/dist/server/tool-overrides.js +1 -46
- package/dist/server/tool-prompt-overrides.js +1 -30
- package/dist/server/tool-prompts.js +0 -14
- package/dist/server/tool-signature.js +0 -25
- package/dist/server/transcript-prepare.js +1 -19
- package/dist/server/tts-routes.js +58 -0
- package/dist/server/tts-service.js +106 -0
- package/dist/server/tts-system.js +160 -0
- package/dist/server/turn-timing.js +0 -1
- package/dist/server/unauthorized-page.js +0 -8
- package/dist/server/universal/driver-base.js +2 -31
- package/dist/server/universal/drivers/claude-code.js +12 -172
- package/dist/server/universal/drivers/codex.js +12 -35
- package/dist/server/universal/drivers/mock-driver.js +1 -11
- package/dist/server/universal/index.js +0 -3
- package/dist/server/universal/session-store.js +4 -21
- package/dist/server/universal/universal-attachments.js +2 -36
- package/dist/server/universal/universal-service.js +5 -24
- package/dist/server/universal/universal-session.js +26 -148
- package/dist/server/universal/universal-types.js +0 -3
- package/dist/server/update-check.js +6 -182
- package/dist/server/uploads.js +4 -43
- package/dist/server/virtual-tui.js +2 -27
- package/dist/server/vision-bridge.js +0 -27
- package/dist/server/wait-subscription-scan.js +13 -115
- package/dist/server/webui-context.js +2 -87
- package/dist/server/workspace-handle.js +1 -56
- package/dist/server/workspace-snapshot.js +7 -113
- package/dist/server/worktree-service.js +2 -53
- package/dist/server/worktree-tool.js +0 -11
- package/dist/server/ws-client-id.js +0 -18
- package/dist/server/ws-pending-queue.js +0 -7
- package/dist/server/ws-unknown-types.js +0 -17
- package/docs/README.md +24 -17
- package/docs/architecture-plugins.md +37 -1
- package/docs/device-center.md +28 -2
- package/docs/device-desktop.md +3 -3
- package/docs/group-orchestration.md +142 -0
- package/docs/hub-upgrade-release-testing.md +46 -0
- package/extensions/webui.ts +3 -74
- package/package.json +7 -3
- package/plugin-sdk/README.md +6 -0
- package/plugin-sdk/client-utils.mjs +0 -7
- package/plugin-sdk/client.d.ts +0 -1
- package/plugin-sdk/client.mjs +1 -31
- package/plugin-sdk/import-check.mjs +4 -51
- package/plugin-sdk/index.d.ts +120 -119
- package/plugin-sdk/index.mjs +0 -6
- package/plugin-sdk/ssh-host-trust.mjs +0 -12
- package/plugin-sdk/testing.d.ts +0 -1
- package/plugin-sdk/testing.mjs +31 -86
- package/plugins/catalog.json +52 -4
- package/plugins/superagent/README.md +110 -0
- package/plugins/superagent/client/entry.mjs +21 -0
- package/plugins/superagent/index.mjs +8 -0
- package/plugins/superagent/main.mjs +218 -0
- package/plugins/superagent/manifest.json +15 -0
- package/plugins/superagent/server.mjs +572 -0
- package/plugins/superagent/style.css +167 -0
- package/themes/aetheris.css +1 -31
- package/themes/ayu-light.css +0 -1
- package/themes/bases/flow-base.css +2 -83
- package/themes/bases/obsidian-base.css +2 -37
- package/themes/bases/statusbar-flat-base.css +0 -1
- package/themes/bases/zhujian-base.css +0 -63
- package/themes/bases/zhupi-base.css +0 -64
- package/themes/catppuccin-latte.css +0 -1
- package/themes/catppuccin.css +0 -1
- package/themes/claude-code-dark.css +0 -1
- package/themes/codex.css +0 -1
- package/themes/dark-teal.css +22 -54
- package/themes/everforest-light.css +0 -1
- package/themes/flow-cristallo.css +1 -9
- package/themes/flow-ink.css +1 -10
- package/themes/flow-light.css +1 -10
- package/themes/flow-obsidian.css +1 -10
- package/themes/flow-zurich.css +1 -10
- package/themes/flow.css +1 -9
- package/themes/geist.css +0 -1
- package/themes/gruvbox-light.css +0 -1
- package/themes/kanagawa-lotus.css +0 -1
- package/themes/md-preview.css +1 -2
- package/themes/mist.css +0 -1
- package/themes/nord.css +0 -1
- package/themes/one-dark.css +0 -1
- package/themes/paper.css +0 -1
- package/themes/rose-pine-dawn.css +0 -1
- package/themes/sakura.css +0 -1
- package/themes/solarized-light.css +0 -1
- package/themes/tokyo-night.css +0 -1
- package/themes/translucent.css +4 -35
- package/themes/transparent.css +4 -41
- package/themes/vs-code-dark.css +0 -1
- package/themes/wallpaper-flow.css +3 -17
- package/themes/wallpaper-obsidian.css +1 -4
- package/themes/white.css +0 -1
- package/web/dist/.build-assets.json +1 -1
- package/web/dist/assets/{BgTasksModal-BjNRIUIc.js → BgTasksModal-D-x7kA63.js} +1 -1
- package/web/dist/assets/CanvasStudio-CAWcs9tm.js +1579 -0
- package/web/dist/assets/DeviceCenter-Dc0whRcu.js +3 -0
- package/web/dist/assets/DeviceExecutionSettings-BoX7-0h7.js +1 -0
- package/web/dist/assets/DeviceGroups-C_fZMNeK.js +1 -0
- package/web/dist/assets/{Dropdown-CQtstPGv.js → Dropdown-CTgVLUbp.js} +1 -1
- package/web/dist/assets/FilePreview-C6W0PvaK.js +2 -0
- package/web/dist/assets/GlobalSearchModal-HR9LSspC.js +1 -0
- package/web/dist/assets/GroupConversation-C81YjF2C.js +61 -0
- package/web/dist/assets/GroupWorkItems-BIvZtr10.js +1 -0
- package/web/dist/assets/{HintTip-ChTW8o1m.js → HintTip-Da6qc566.js} +1 -1
- package/web/dist/assets/ModelConfigModal-DhSyuIuV.js +2 -0
- package/web/dist/assets/NativeCliPanel-CU1rZmyu.js +5 -0
- package/web/dist/assets/{PiSetupModal-BX5rUuoI.js → PiSetupModal-DZKY5Wiw.js} +1 -1
- package/web/dist/assets/ProviderOAuthControls-CIL85nA7.js +1 -0
- package/web/dist/assets/{SCMPanel-DPAyY2sW.js → SCMPanel-CuEgzAlO.js} +2 -2
- package/web/dist/assets/SettingsModal-Cdu5h29p.js +33 -0
- package/web/dist/assets/TermXterm-Bt5WKAxP.js +3 -0
- package/web/dist/assets/TerminalPanel-BCIBV8se.js +1 -0
- package/web/dist/assets/TuiOverlayModal-3NDd9T97.js +1 -0
- package/web/dist/assets/app-globals-CZjFtI4F.js +129 -0
- package/web/dist/assets/canvas-client-WkhM55mR.js +1 -0
- package/web/dist/assets/composer-bridge-CImnjDHq.js +1 -0
- package/web/dist/assets/desktop-B8NZ3KW-.js +1 -0
- package/web/dist/assets/index-CQc3VrWa.css +1 -0
- package/web/dist/assets/index-D_AGu4Zv.js +404 -0
- package/web/dist/assets/plugin-host-uqZGpvCs.js +1 -0
- package/web/dist/assets/{remote-ssh-client-Dzi-eEyE.js → remote-ssh-client-Cdf-cTUe.js} +1 -1
- package/web/dist/assets/theme-DGL7hLUs.js +1 -0
- package/web/dist/index.html +11 -10
- package/web/dist/sw.js +15 -61
- package/web/public/sw.js +14 -60
- package/web/dist/assets/BgTasksModal-C0zuU8FE.js +0 -1
- package/web/dist/assets/CanvasStudio-BWvdmJ0M.js +0 -1579
- package/web/dist/assets/CanvasStudio-VQFjmTGq.js +0 -1579
- package/web/dist/assets/DeviceCenter-DI9_0aBB.js +0 -3
- package/web/dist/assets/DeviceCenter-DsNtXqzY.js +0 -3
- package/web/dist/assets/DeviceExecutionSettings-BLP1Su5G.js +0 -1
- package/web/dist/assets/DeviceGroups-2Pvk0Cds.js +0 -1
- package/web/dist/assets/DeviceGroups-CP7CcyPD.js +0 -1
- package/web/dist/assets/FilePreview-BMB2tNyT.js +0 -2
- package/web/dist/assets/FilePreview-RGFQUbJo.js +0 -2
- package/web/dist/assets/GlobalSearchModal-BM5wxiqU.js +0 -1
- package/web/dist/assets/GlobalSearchModal-DGv_WINq.js +0 -1
- package/web/dist/assets/GroupConversation-B7SnuXj1.js +0 -61
- package/web/dist/assets/GroupConversation-Dda69q-2.js +0 -61
- package/web/dist/assets/ModelConfigModal-C-0Z4hUZ.js +0 -2
- package/web/dist/assets/ModelConfigModal-yqeadyab.js +0 -2
- package/web/dist/assets/ProviderOAuthControls-DY4SCfXg.js +0 -1
- package/web/dist/assets/SCMPanel-C4KbQvvK.js +0 -2
- package/web/dist/assets/SettingsModal-DxZp6D_g.js +0 -32
- package/web/dist/assets/SettingsModal-WhQzaOPt.js +0 -32
- package/web/dist/assets/TerminalPanel-D4By_RVc.js +0 -3
- package/web/dist/assets/TerminalPanel-lZw8-i3j.js +0 -3
- package/web/dist/assets/TuiOverlayModal-C3pAVuC8.js +0 -1
- package/web/dist/assets/TuiOverlayModal-D7_rEXcJ.js +0 -1
- package/web/dist/assets/app-globals-KqOVtmp1.js +0 -123
- package/web/dist/assets/canvas-client-BY6ojmle.js +0 -1
- package/web/dist/assets/desktop-CV6KKp9R.js +0 -1
- package/web/dist/assets/index-BawF7ZP5.js +0 -397
- package/web/dist/assets/index-BoGCoq5X.js +0 -397
- package/web/dist/assets/index-CVW9FoY2.css +0 -1
- package/web/dist/assets/plugin-host-Dn8Dd6SC.js +0 -1
- package/web/dist/assets/theme-D_bihpdN.js +0 -1
|
@@ -1,25 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* pi-web-ui DSH runtime launcher (DshEngine的运行时子进程).
|
|
4
|
-
*
|
|
5
|
-
* 组合 = 全局/本地 dsh 运行时树里的 dsh-base bundle patch + 本文件同目录的
|
|
6
|
-
* override patch(挂 stdio JSON-RPC 服务插件 + pin 会话持久化/人设/沙箱)。
|
|
7
|
-
* 与官方 dsh CLI 的 profile 机制无关 —— 直接以 boot() 组合静态入口,绕开
|
|
8
|
-
* $DSH_HOME/profiles 初始化。
|
|
9
|
-
*
|
|
10
|
-
* 运行时树解析顺序(实现见 runtime-root.mjs,支持 flat / dsh 嵌套两种布局):
|
|
11
|
-
* 1. $PI_WEB_DSH_RUNTIME — 显式指定 node_modules 根(含 @deepseek-ai/dsh-base)
|
|
12
|
-
* 2. 本包 node_modules — 若 pi-web-ui 完整安装了 dsh 依赖树
|
|
13
|
-
* 3. execPath 邻近 node_modules — fnm / 独立 node 的稳定布局
|
|
14
|
-
* 4. `npm root -g` — 全局 dsh 安装(`npm i -g @deepseek-ai/dsh`)
|
|
15
|
-
*
|
|
16
|
-
* JSON-RPC 服务插件(dsh-sdk-jsonrpc-server)按项目依赖解析:override patch
|
|
17
|
-
* 里的 name 由 $PI_WEB_DSH_JSONRPC_ENTRY 用 !!js 求值成绝对路径(指向项目
|
|
18
|
-
* node_modules),其 peer 依赖从项目树自洽解析 —— cordis loader 的裸包解析
|
|
19
|
-
* 只有单一 base,所以混树只能走绝对路径挂载。
|
|
20
|
-
*
|
|
21
|
-
* 协议:newline-delimited JSON-RPC 2.0 于 stdio(stdout 只承载协议帧)。
|
|
22
|
-
*/
|
|
23
2
|
import { dirname, join, resolve } from "node:path";
|
|
24
3
|
import { readdirSync } from "node:fs";
|
|
25
4
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
@@ -49,7 +28,6 @@ if (!runtimeBase) {
|
|
|
49
28
|
|
|
50
29
|
process.env.PI_WEB_DSH_RUNTIME_BASE = runtimeBase;
|
|
51
30
|
|
|
52
|
-
// 检查版本族兼容性(默认宽松尝试运行;若需严格匹配可设置 PI_WEB_DSH_STRICT_VERSION=1)
|
|
53
31
|
if (!compatibility?.compatible) {
|
|
54
32
|
const strictVer = process.env.PI_WEB_DSH_STRICT_VERSION === "1" || process.env.PI_WEB_DSH_STRICT_VERSION === "true";
|
|
55
33
|
const verMsg =
|
|
@@ -81,8 +59,6 @@ const runConfig = process.env.DSH_CORDIS_CONFIG ?? join(HERE, "cordis.yml");
|
|
|
81
59
|
const baseBundlePatch = join(runtimeBase, "@deepseek-ai", "dsh-base", "cordis.patch.yml");
|
|
82
60
|
const overridePatch = join(HERE, "override.patch.yml");
|
|
83
61
|
|
|
84
|
-
// 用户 patch 层:<dataDir>/dsh-patches/*.yml(按文件名序,在 override 之后)。
|
|
85
|
-
// 引擎(DshClientSession)负责在重启运行时前创建目录;launcher 只负责加载。
|
|
86
62
|
const userPatchDir = process.env.PI_WEB_DSH_DATA_DIR
|
|
87
63
|
? join(process.env.PI_WEB_DSH_DATA_DIR, "dsh-patches")
|
|
88
64
|
: (process.env.PI_WEB_DSH_PATCH_DIR ?? null);
|
|
@@ -94,28 +70,16 @@ if (userPatchDir) {
|
|
|
94
70
|
userPatchFiles.push(join(userPatchDir, name));
|
|
95
71
|
}
|
|
96
72
|
}
|
|
97
|
-
} catch {
|
|
98
|
-
// 目录不存在/不可读 = 无用户 patch,静默跳过。
|
|
99
|
-
}
|
|
73
|
+
} catch {}
|
|
100
74
|
}
|
|
101
75
|
userPatchFiles.sort((a, b) => a.localeCompare(b));
|
|
102
76
|
|
|
103
|
-
// preset-plane patch 路径(服务端生成的 agent-plane 下沉层,见
|
|
104
|
-
// server/dsh/preset-clones.ts)。实际加载在 boot import 之后;缺失/不可读 =
|
|
105
|
-
// 回落 legacy 单组合(roster 不挂,会话走 host 直连),静默跳过。
|
|
106
77
|
const presetPlanePatch = process.env.PI_WEB_DSH_PRESET_PATCH ?? null;
|
|
107
78
|
|
|
108
|
-
// ---------------------------------------------------------------------------
|
|
109
|
-
// boot
|
|
110
|
-
// ---------------------------------------------------------------------------
|
|
111
|
-
|
|
112
79
|
const { boot, installFailLoud, loadOverlayPatches } = await import(
|
|
113
80
|
pathToFileURL(join(runtimeBase, "@deepseek-ai", "dsh-app-boot", "lib", "index.js")).href
|
|
114
81
|
);
|
|
115
82
|
|
|
116
|
-
// cordis loader 只对 entry 的 config 做 !!js 插值,name 字段不支持。
|
|
117
|
-
// sdk-jsonrpc 走本地扩展插件 goal-rpc.mjs(官方 server 类 + goal RPC 方法);
|
|
118
|
-
// 官方入口(base 类)通过 env PI_WEB_DSH_JSONRPC_ENTRY 传给 wrapper。
|
|
119
83
|
const jsonrpcWrapper = join(HERE, "goal-rpc.mjs");
|
|
120
84
|
const _jsonrpcEntry = process.env.PI_WEB_DSH_JSONRPC_ENTRY
|
|
121
85
|
? resolve(process.env.PI_WEB_DSH_JSONRPC_ENTRY)
|
|
@@ -129,9 +93,6 @@ const _jsonrpcEntry = process.env.PI_WEB_DSH_JSONRPC_ENTRY
|
|
|
129
93
|
);
|
|
130
94
|
|
|
131
95
|
const overrideList = loadOverlayPatches(BIN_NAME, overridePatch);
|
|
132
|
-
// cordis loader 只对 entry 的 config 做 !!js 插值,name 字段不支持——
|
|
133
|
-
// 插件绝对路径在这里用 JS 写回(sdk-jsonrpc → 本地 goal-rpc wrapper;
|
|
134
|
-
// 用户 patch 若用 id 覆盖 sdk-jsonrpc 或 insert 同名 entry 也拿到 wrapper)。
|
|
135
96
|
const fixJsonrpcName = (patch) => {
|
|
136
97
|
if (patch.id === "sdk-jsonrpc") {
|
|
137
98
|
patch.name = jsonrpcWrapper;
|
|
@@ -150,7 +111,6 @@ const userPatchLists = userPatchFiles.map((file) => {
|
|
|
150
111
|
}
|
|
151
112
|
});
|
|
152
113
|
for (const list of userPatchLists) for (const patch of list) fixJsonrpcName(patch);
|
|
153
|
-
// preset-plane patch(服务端生成;override 之后、用户 patch 之前)。
|
|
154
114
|
let presetPlaneLists = [];
|
|
155
115
|
if (presetPlanePatch) {
|
|
156
116
|
try {
|
|
@@ -161,26 +121,16 @@ if (presetPlanePatch) {
|
|
|
161
121
|
}
|
|
162
122
|
}
|
|
163
123
|
for (const patch of presetPlaneLists) fixJsonrpcName(patch);
|
|
164
|
-
// patches 参数必须是扁平列表(boot → mountRootInclude → Include.applyPatches →
|
|
165
|
-
// applyEntryPatches 逐个消费;数组嵌套会被当无 id 的 patch 跳过)。
|
|
166
124
|
const patches = [
|
|
167
125
|
...loadOverlayPatches(BIN_NAME, baseBundlePatch),
|
|
168
126
|
...overrideList,
|
|
169
127
|
...presetPlaneLists,
|
|
170
|
-
// 用户 patch:同样按文件展开为扁平 patch entry 列表(一个文件可含多 entry)。
|
|
171
128
|
...userPatchLists.flat(),
|
|
172
129
|
];
|
|
173
130
|
|
|
174
131
|
let ctx;
|
|
175
132
|
try {
|
|
176
|
-
ctx = await boot(
|
|
177
|
-
BIN_NAME,
|
|
178
|
-
runConfig,
|
|
179
|
-
patches,
|
|
180
|
-
undefined,
|
|
181
|
-
// 裸包名(dsh-base 组合行)锚定到运行时树;jsonrpc 行走绝对路径。
|
|
182
|
-
pathToFileURL(runtimeBase + "/").href,
|
|
183
|
-
);
|
|
133
|
+
ctx = await boot(BIN_NAME, runConfig, patches, undefined, pathToFileURL(runtimeBase + "/").href);
|
|
184
134
|
} catch (err) {
|
|
185
135
|
const seen = new Set();
|
|
186
136
|
let isTypertFailure = false;
|
|
@@ -227,7 +177,6 @@ const release = () => {
|
|
|
227
177
|
};
|
|
228
178
|
installFailLoud(BIN_NAME, process, release);
|
|
229
179
|
|
|
230
|
-
// stdin EOF = 客户端消失 → 有序释放后退出。
|
|
231
180
|
process.stdin.resume();
|
|
232
181
|
process.stdin.on("end", release);
|
|
233
182
|
process.stdin.on("close", release);
|
|
@@ -1,45 +1,32 @@
|
|
|
1
|
-
# pi-web-ui DSH runtime overrides — applies AFTER the dsh-base bundle patch
|
|
2
|
-
# (loaded from the runtime tree). Rows that restate a base row use id-targeted
|
|
3
|
-
# REPLACE (last write wins per row); new rows come in a plain insert block.
|
|
4
1
|
# !!js 表达式由 Cordis Loader 在挂载时求值(boot 暴露 dshHomePath,process.env
|
|
5
|
-
# 直读)。
|
|
6
2
|
|
|
7
|
-
# 会话持久化根 —— 覆盖 base 的 dshHomePath('sessions'),让 pi-web-ui 指向自己的数据目录。
|
|
8
3
|
- id: session-persistence-jsonl
|
|
9
4
|
name: "@deepseek-ai/dsh-session-persistence-jsonl"
|
|
10
5
|
config:
|
|
11
6
|
root: !!js process.env.DSH_SESSION_ROOT ?? dshHomePath('sessions')
|
|
12
7
|
|
|
13
|
-
# Agent 默认模型 —— initialize() 每次都带 provider/model,这里只兜底。
|
|
14
8
|
- id: agent-default-model
|
|
15
9
|
name: "@deepseek-ai/dsh-agent-default-model"
|
|
16
10
|
config:
|
|
17
11
|
provider: !!js process.env.DSH_DEFAULT_PROVIDER ?? 'deepseek-official'
|
|
18
12
|
model: !!js process.env.DSH_DEFAULT_MODEL ?? 'deepseek-v4-flash'
|
|
19
13
|
|
|
20
|
-
# 部署人设(默认空;pi-web-ui 设置面板可注入)。
|
|
21
|
-
# 键名必须是 personaPrefix(dsh-system-prompt schema;persona: 会被 zod 静默丢弃)。
|
|
22
14
|
- id: system-prompt
|
|
23
15
|
name: "@deepseek-ai/dsh-system-prompt"
|
|
24
16
|
config:
|
|
25
17
|
personaPrefix: !!js process.env.DSH_PERSONA ?? ''
|
|
26
18
|
|
|
27
|
-
# 沙箱工作区根(workspace-write 权限模式的护栏边界)。
|
|
28
19
|
- id: sandbox-policy
|
|
29
20
|
name: "@deepseek-ai/dsh-sandbox-policy"
|
|
30
21
|
config:
|
|
31
22
|
mode: !!js process.env.DSH_PERMISSION_MODE ?? 'workspace-write'
|
|
32
23
|
workspaceRoot: !!js process.env.DSH_CWD ?? process.cwd()
|
|
33
24
|
|
|
34
|
-
# 无头 JSON-RPC 服务:没有交互用户来应答审批弹窗;工具在 workspace-write
|
|
35
|
-
# 沙箱内直接执行,用户的 Stop 按钮就是控制手段。
|
|
36
25
|
- id: approval
|
|
37
26
|
name: "@deepseek-ai/dsh-user-approval"
|
|
38
27
|
config:
|
|
39
28
|
policy: "never"
|
|
40
29
|
|
|
41
|
-
# 权限预设表 —— 与 approval=never 组合匹配。patch 语义:整行 config 全量替换,
|
|
42
|
-
# 必须重述 base 的全部预设并补上 (workspace-write, never) 组合,显式 defaultPreset。
|
|
43
30
|
- id: permission
|
|
44
31
|
name: "@deepseek-ai/dsh-permission-presets"
|
|
45
32
|
config:
|
|
@@ -58,32 +45,16 @@
|
|
|
58
45
|
approval: never
|
|
59
46
|
defaultPreset: workspace-write-never
|
|
60
47
|
|
|
61
|
-
# ── 新行(plain insert)─────────────────────────────────────────────────────
|
|
62
48
|
- insert:
|
|
63
|
-
# pi-web-ui 自定义系统提示词(设置面板):独立 host section,随 standard/ptc/
|
|
64
|
-
# cordis 下发;minimal(complete:true)按官方语义压住。文本走环境变量
|
|
65
|
-
# PI_WEB_DSH_CUSTOM_PROMPT(Node 侧维护,变化即重启运行时)。
|
|
66
49
|
- id: pi-webui-custom-prompt
|
|
67
50
|
name: ./custom-prompt.mjs
|
|
68
|
-
# PTC mode 的 TypeScript 运行时(preset 的 tool-presentation 行等它;
|
|
69
|
-
# 无此行时 ptc 预设能挂但不出 run_code,PTC 名存实亡)。
|
|
70
51
|
- id: code-runtime
|
|
71
52
|
name: "@deepseek-ai/dsh-code-runtime-worker-thread"
|
|
72
|
-
# 子代理模型选择开关(standard/ptc/cordis 的 tool-subagent 行
|
|
73
|
-
# modelSelectionSettings: true 要求它在 Host scope;缺失则整组 mount 失败)。
|
|
74
53
|
- id: subagent-model-selection-settings
|
|
75
54
|
name: "@deepseek-ai/dsh-tool-subagent/model-selection-settings"
|
|
76
|
-
# cordis 模式的宿主执行器(tool-cordis 等 dynamicCordisRunner/cordisInspect;
|
|
77
|
-
# 缺失则 cordis 预设 mount 失败)。与官方 dsh-web-app 的 cordis-host-runner 同位。
|
|
78
55
|
- id: cordis-host-runner
|
|
79
56
|
name: "@deepseek-ai/dsh-cordis-host-runner"
|
|
80
|
-
# 模型提问工具:ask_user_question → ctx.userQuestions(base 已挂 user-questions
|
|
81
|
-
# 服务)→ goal-rpc wrapper 注册的 provider 桥到浏览器对话框。
|
|
82
57
|
- id: tool-ask-user
|
|
83
58
|
name: "@deepseek-ai/dsh-tool-ask-user"
|
|
84
|
-
# Stdio JSON-RPC 服务插件(inject: agents)。name 用 !!js 求值为绝对路径
|
|
85
|
-
# (指向项目 node_modules 里的 dsh-sdk-jsonrpc-server),因为 cordis loader
|
|
86
|
-
# 的裸包解析只认 bareModuleBaseUrl(运行时树),混树挂载必须走绝对路径;
|
|
87
|
-
# 该插件的 peer 依赖从项目树自洽解析。
|
|
88
59
|
- id: sdk-jsonrpc
|
|
89
60
|
name: !!js process.env.PI_WEB_DSH_JSONRPC_ENTRY
|
|
@@ -1,21 +1,4 @@
|
|
|
1
|
-
// Shared runtime-tree resolution for the pi-web-ui DSH runtime.
|
|
2
|
-
// Used by launcher.mjs (boot-time) and dev/dsh-probes/probe-mixed.mjs (self-check).
|
|
3
|
-
//
|
|
4
|
-
// A "runtime tree" is a node_modules root that directly contains the dsh
|
|
5
|
-
// runtime packages: `@deepseek-ai/dsh-base` (with its cordis.patch.yml
|
|
6
|
-
// bundle) and `@deepseek-ai/dsh-app-boot`. Two layouts are accepted:
|
|
7
|
-
//
|
|
8
|
-
// flat: <root>/@deepseek-ai/dsh-base/cordis.patch.yml
|
|
9
|
-
// (a node_modules root where the runtime packages live top-level)
|
|
10
|
-
//
|
|
11
|
-
// nested: <root>/@deepseek-ai/dsh/node_modules/@deepseek-ai/…
|
|
12
|
-
// (`npm i -g @deepseek-ai/dsh` installs the CLI package with its
|
|
13
1
|
// OWN nested runtime tree of ~196 packages; the global root itself
|
|
14
|
-
// only holds the `dsh` package)
|
|
15
|
-
//
|
|
16
|
-
// The returned value is always the *bare-module base dir*: the node_modules
|
|
17
|
-
// root that directly contains the runtime packages. That is what
|
|
18
|
-
// boot(bareModuleBaseUrl) anchors bare package names (dsh-base rows) to.
|
|
19
2
|
import { existsSync, readFileSync, realpathSync } from "node:fs";
|
|
20
3
|
import { delimiter, dirname, join, resolve } from "node:path";
|
|
21
4
|
import { homedir } from "node:os";
|
|
@@ -23,10 +6,8 @@ import { fileURLToPath } from "node:url";
|
|
|
23
6
|
|
|
24
7
|
const HERE = dirname(fileURLToPath(import.meta.url));
|
|
25
8
|
|
|
26
|
-
/** 兜底固定的 DSH 版本族,与 package.json / lockfile 对齐 */
|
|
27
9
|
export const FALLBACK_DSH_VERSION = "0.2.1-rc.2";
|
|
28
10
|
|
|
29
|
-
/** Given a candidate node_modules root, return the bare-module base dir, or null. */
|
|
30
11
|
export function runtimeBaseFor(root) {
|
|
31
12
|
if (root == null) return null;
|
|
32
13
|
const flatScope = join(root, "@deepseek-ai");
|
|
@@ -46,7 +27,6 @@ export function runtimeBaseFor(root) {
|
|
|
46
27
|
return null;
|
|
47
28
|
}
|
|
48
29
|
|
|
49
|
-
/** 向上查找 pi-web-ui 包根目录(支持源码态 server/ 与构建态 dist/) */
|
|
50
30
|
export function findLocalPackageRoot(startDir = HERE) {
|
|
51
31
|
let cur = resolve(startDir);
|
|
52
32
|
for (let i = 0; i < 6; i++) {
|
|
@@ -64,11 +44,6 @@ export function findLocalPackageRoot(startDir = HERE) {
|
|
|
64
44
|
return null;
|
|
65
45
|
}
|
|
66
46
|
|
|
67
|
-
/**
|
|
68
|
-
* 提取 DSH 版本族。
|
|
69
|
-
* 在 pre-release(0.x)阶段,按 major.minor 分族(如 0.1.x 同族,0.2.x 同族),
|
|
70
|
-
* 既隔离 0.1 与 0.2 底层重大协议断裂,又避免 patch/rc 微调时过度阻断;正式版(>=1.0)按 major 分族。
|
|
71
|
-
*/
|
|
72
47
|
export function getDshFamily(version) {
|
|
73
48
|
if (!version || typeof version !== "string") return "";
|
|
74
49
|
const clean = version.replace(/^[v^~]/, "").trim();
|
|
@@ -81,7 +56,6 @@ export function getDshFamily(version) {
|
|
|
81
56
|
return `${major}`;
|
|
82
57
|
}
|
|
83
58
|
|
|
84
|
-
/** 读取运行时树中已安装的 @deepseek-ai/dsh-base 版本 */
|
|
85
59
|
export function getRuntimeDshVersion(runtimeBase) {
|
|
86
60
|
if (!runtimeBase) return null;
|
|
87
61
|
const pkgPath = join(runtimeBase, "@deepseek-ai", "dsh-base", "package.json");
|
|
@@ -95,7 +69,6 @@ export function getRuntimeDshVersion(runtimeBase) {
|
|
|
95
69
|
return null;
|
|
96
70
|
}
|
|
97
71
|
|
|
98
|
-
/** 读取 pi-web-ui 本地期望绑定的 DSH 版本 */
|
|
99
72
|
export function getExpectedDshVersion(pkgRoot) {
|
|
100
73
|
const root = pkgRoot || findLocalPackageRoot(HERE);
|
|
101
74
|
if (root) {
|
|
@@ -118,7 +91,6 @@ export function getExpectedDshVersion(pkgRoot) {
|
|
|
118
91
|
return FALLBACK_DSH_VERSION;
|
|
119
92
|
}
|
|
120
93
|
|
|
121
|
-
/** 校验运行时树与 pi-web-ui 依赖的版本族兼容性 */
|
|
122
94
|
export function checkDshRuntimeCompatibility(runtimeBase, expectedVersion) {
|
|
123
95
|
const runtimeVersion = getRuntimeDshVersion(runtimeBase);
|
|
124
96
|
const expected = expectedVersion || getExpectedDshVersion();
|
|
@@ -134,7 +106,6 @@ export function checkDshRuntimeCompatibility(runtimeBase, expectedVersion) {
|
|
|
134
106
|
};
|
|
135
107
|
}
|
|
136
108
|
|
|
137
|
-
/** 解析 .npmrc 内容中的 prefix 配置值 */
|
|
138
109
|
export function parseNpmrcPrefix(content) {
|
|
139
110
|
if (!content || typeof content !== "string") return null;
|
|
140
111
|
const lines = content.split(/\r?\n/);
|
|
@@ -156,7 +127,6 @@ export function parseNpmrcPrefix(content) {
|
|
|
156
127
|
return null;
|
|
157
128
|
}
|
|
158
129
|
|
|
159
|
-
/** 从常见 npmrc 位置发现用户与系统配置的 prefix */
|
|
160
130
|
export function findPrefixFromNpmrc() {
|
|
161
131
|
const prefixes = [];
|
|
162
132
|
const npmrcLocations = [
|
|
@@ -189,7 +159,6 @@ export function findPrefixFromNpmrc() {
|
|
|
189
159
|
return prefixes;
|
|
190
160
|
}
|
|
191
161
|
|
|
192
|
-
/** 从 $PATH 中探测 dsh / pi-web-ui / npm 二进制并推导 node_modules 候选 */
|
|
193
162
|
export function findCandidatesFromPath() {
|
|
194
163
|
const candidates = [];
|
|
195
164
|
const rawPath = process.env.PATH || process.env.Path || "";
|
|
@@ -229,7 +198,6 @@ export function findCandidatesFromPath() {
|
|
|
229
198
|
} catch {}
|
|
230
199
|
if (!binExists) continue;
|
|
231
200
|
|
|
232
|
-
// a) 符号链接真实路径反查 node_modules 根
|
|
233
201
|
try {
|
|
234
202
|
const real = realpathSync(binPath);
|
|
235
203
|
const nmIdx = real.lastIndexOf("node_modules");
|
|
@@ -239,11 +207,9 @@ export function findCandidatesFromPath() {
|
|
|
239
207
|
}
|
|
240
208
|
} catch {}
|
|
241
209
|
|
|
242
|
-
// b) Windows npm 全局安装常见布局:<prefix>/dsh.cmd,对应 <prefix>/node_modules
|
|
243
210
|
candidates.push({ path: join(dir, "node_modules"), source: `path:${bin} (adjacent)` });
|
|
244
211
|
candidates.push({ path: join(dir, "lib", "node_modules"), source: `path:${bin} (lib)` });
|
|
245
212
|
|
|
246
|
-
// c) POSIX npm 全局安装常见布局:<prefix>/bin/dsh,对应 <prefix>/lib/node_modules
|
|
247
213
|
const parent = dirname(dir);
|
|
248
214
|
if (parent && parent !== dir) {
|
|
249
215
|
candidates.push({ path: join(parent, "lib", "node_modules"), source: `path:${bin} (parent/lib)` });
|
|
@@ -254,17 +220,6 @@ export function findCandidatesFromPath() {
|
|
|
254
220
|
return candidates;
|
|
255
221
|
}
|
|
256
222
|
|
|
257
|
-
/**
|
|
258
|
-
* 完整运行时树探测与详情收集(纯 fs 操作,无子进程 spawn,杜绝 Android/Termux 死锁)。
|
|
259
|
-
* 顺序:
|
|
260
|
-
* 1. $PI_WEB_DSH_RUNTIME — 显式指定最高优先级
|
|
261
|
-
* 2. 本包(pi-web-ui)的 node_modules
|
|
262
|
-
* 3. execPath 邻近 node_modules
|
|
263
|
-
* 4. 从 $PATH 二进制推断的全局目录(支持符号链接 realpath 反查)
|
|
264
|
-
* 5. 从 .npmrc prefix 配置派生的全局目录
|
|
265
|
-
* 6. 环境变量 NPM_CONFIG_PREFIX / npm_config_prefix / PREFIX
|
|
266
|
-
* 7. 系统常见全局 node_modules 目录
|
|
267
|
-
*/
|
|
268
223
|
export async function resolveRuntimeBaseWithDetails() {
|
|
269
224
|
const scannedPaths = [];
|
|
270
225
|
const seenPaths = new Set();
|
|
@@ -323,7 +278,6 @@ export async function resolveRuntimeBaseWithDetails() {
|
|
|
323
278
|
return base;
|
|
324
279
|
};
|
|
325
280
|
|
|
326
|
-
// 1. $PI_WEB_DSH_RUNTIME — 显式指定
|
|
327
281
|
const explicit = process.env.PI_WEB_DSH_RUNTIME;
|
|
328
282
|
if (explicit) {
|
|
329
283
|
const base = probe(explicit, "env:PI_WEB_DSH_RUNTIME");
|
|
@@ -336,7 +290,6 @@ export async function resolveRuntimeBaseWithDetails() {
|
|
|
336
290
|
}
|
|
337
291
|
}
|
|
338
292
|
|
|
339
|
-
// 2. 本包(pi-web-ui)的 node_modules
|
|
340
293
|
const pkgRoot = findLocalPackageRoot(HERE);
|
|
341
294
|
if (pkgRoot) {
|
|
342
295
|
probe(join(pkgRoot, "node_modules"), "local:packageRoot");
|
|
@@ -344,23 +297,19 @@ export async function resolveRuntimeBaseWithDetails() {
|
|
|
344
297
|
probe(join(resolve(HERE, "..", "..", ".."), "node_modules"), "local:relative-3");
|
|
345
298
|
probe(join(resolve(HERE, "..", "..", "..", ".."), "node_modules"), "local:relative-4");
|
|
346
299
|
|
|
347
|
-
// 3. execPath 邻近 node_modules
|
|
348
300
|
probe(join(dirname(process.execPath), "node_modules"), "execPath:adjacent");
|
|
349
301
|
probe(join(dirname(process.execPath), "..", "lib", "node_modules"), "execPath:parent-lib");
|
|
350
302
|
probe(join(dirname(process.execPath), "..", "node_modules"), "execPath:parent");
|
|
351
303
|
|
|
352
|
-
// 4. 从 $PATH 中探测到的候选
|
|
353
304
|
for (const cand of findCandidatesFromPath()) {
|
|
354
305
|
probe(cand.path, cand.source);
|
|
355
306
|
}
|
|
356
307
|
|
|
357
|
-
// 5. 从 npmrc 中探测到的 prefix
|
|
358
308
|
for (const p of findPrefixFromNpmrc()) {
|
|
359
309
|
probe(join(p, "lib", "node_modules"), "npmrc:prefix-lib");
|
|
360
310
|
probe(join(p, "node_modules"), "npmrc:prefix");
|
|
361
311
|
}
|
|
362
312
|
|
|
363
|
-
// 6. 环境变量里的前缀
|
|
364
313
|
const envPrefixes = [process.env.NPM_CONFIG_PREFIX, process.env.npm_config_prefix, process.env.PREFIX];
|
|
365
314
|
for (const p of envPrefixes) {
|
|
366
315
|
if (p) {
|
|
@@ -369,7 +318,6 @@ export async function resolveRuntimeBaseWithDetails() {
|
|
|
369
318
|
}
|
|
370
319
|
}
|
|
371
320
|
|
|
372
|
-
// 7. 常见系统默认路径
|
|
373
321
|
if (process.platform === "win32") {
|
|
374
322
|
if (process.env.APPDATA) probe(join(process.env.APPDATA, "npm", "node_modules"), "default:win-appdata");
|
|
375
323
|
if (process.env.LOCALAPPDATA)
|
|
@@ -387,7 +335,6 @@ export async function resolveRuntimeBaseWithDetails() {
|
|
|
387
335
|
probe(join(home, ".npm-global", "node_modules"), "default:posix-npm-global-flat");
|
|
388
336
|
}
|
|
389
337
|
|
|
390
|
-
// 若存在同版本族的有效树,优先选择;否则回退至首个可用树(由 launcher 报错指引版本)
|
|
391
338
|
const chosenBase = firstCompatibleBase || firstFoundBase || null;
|
|
392
339
|
const compatibility = chosenBase ? checkDshRuntimeCompatibility(chosenBase, expectedVersion) : null;
|
|
393
340
|
|
|
@@ -398,7 +345,6 @@ export async function resolveRuntimeBaseWithDetails() {
|
|
|
398
345
|
};
|
|
399
346
|
}
|
|
400
347
|
|
|
401
|
-
/** 供已有代码直接获取有效 runtimeBase 路径 */
|
|
402
348
|
export async function resolveRuntimeBase() {
|
|
403
349
|
const { base } = await resolveRuntimeBaseWithDetails();
|
|
404
350
|
return base;
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* durable-agent-service.ts — Pi Durable 独立智能体引擎顶层服务(实现 EngineService)。
|
|
3
|
-
*
|
|
4
|
-
* 职责:
|
|
5
|
-
* 1. 管理 Pi Durable 驱动及会话调度;
|
|
6
|
-
* 2. 借助通用宿主底座(UniversalSession)提供完整 160+ 个 Web UI 交互契约;
|
|
7
|
-
* 3. 负责安静停机(quiesce)、状态汇总(serviceStatus)与生命周期销毁。
|
|
8
|
-
*/
|
|
9
1
|
import { existsSync } from "node:fs";
|
|
10
2
|
import { UniversalSessionStore } from "../universal/session-store.js";
|
|
11
3
|
import { UniversalSession } from "../universal/universal-session.js";
|
|
@@ -41,9 +33,7 @@ export class DurableAgentService {
|
|
|
41
33
|
effectiveCwd = saved.lastCwd;
|
|
42
34
|
}
|
|
43
35
|
}
|
|
44
|
-
catch {
|
|
45
|
-
/* fallback */
|
|
46
|
-
}
|
|
36
|
+
catch { }
|
|
47
37
|
}
|
|
48
38
|
if (typeof this.stateStore?.remember === "function") {
|
|
49
39
|
this.stateStore.remember(clientId, effectiveCwd);
|
|
@@ -86,9 +76,7 @@ export class DurableAgentService {
|
|
|
86
76
|
}
|
|
87
77
|
this.sessions.clear();
|
|
88
78
|
}
|
|
89
|
-
recordInterruptedRuns() {
|
|
90
|
-
// Durable 引擎自带事务级检查点,无需手动序列化内存临时态
|
|
91
|
-
}
|
|
79
|
+
recordInterruptedRuns() { }
|
|
92
80
|
noteSocketOpen() {
|
|
93
81
|
this.socketCount++;
|
|
94
82
|
}
|
|
@@ -133,15 +121,9 @@ export class DurableAgentService {
|
|
|
133
121
|
pendingMessages() {
|
|
134
122
|
return 0;
|
|
135
123
|
}
|
|
136
|
-
applyPluginAgentTools() {
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
applyPluginCommandCatalog() {
|
|
140
|
-
// 斜杠命令热重载通知
|
|
141
|
-
}
|
|
142
|
-
applyPluginMarkers() {
|
|
143
|
-
// 插件标记热重载通知
|
|
144
|
-
}
|
|
124
|
+
applyPluginAgentTools() { }
|
|
125
|
+
applyPluginCommandCatalog() { }
|
|
126
|
+
applyPluginMarkers() { }
|
|
145
127
|
refreshBackgroundServers() {
|
|
146
128
|
for (const session of this.sessions.values()) {
|
|
147
129
|
session.listBgServers();
|