@xopcai/xopc 0.0.302 → 0.0.306
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/README.zh-CN.md +4 -4
- package/dist/browser-ext/dist/assets/{auth-B_9ZuGDx.js → auth-C3yV1y_l.js} +67 -22
- package/dist/browser-ext/dist/background.js +4 -4
- package/dist/browser-ext/dist/sidepanel.html +1 -1
- package/dist/browser-ext/dist/sidepanel.js +3 -3
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/feishu/xopc.extension.json +0 -3
- package/dist/extensions/telegram/xopc.extension.json +1 -4
- package/dist/extensions/weixin/xopc.extension.json +0 -3
- package/dist/gateway/static/root/assets/{activity-store-DCi5rh4e.js → activity-store-DLtim-_I.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-C0zP6W2B.js → agent-avatar-dicebear-iQXtiilH.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CxOv4ivK.js +1 -0
- package/dist/gateway/static/root/assets/agents-DzKx7z3k.js +1 -0
- package/dist/gateway/static/root/assets/{api-CAV9PN9i.js → api-DfSU0-lD.js} +1 -1
- package/dist/gateway/static/root/assets/api-gpHh07OL.js +1 -0
- package/dist/gateway/static/root/assets/app-management-settings-panel-BpYFKz7B.js +1 -0
- package/dist/gateway/static/root/assets/{appearance-settings-ZFjV_opr.js → appearance-settings-BQfR5vrq.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-BceB7JHZ.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-MaKWrpgC.js → archive-plugin-BxOvZ-ZX.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-IfqbP2BN.js → attachment-load-B0FzTMAJ.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-CeI2NGSO.js → automations-page-BpXuPaPg.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-Cn_p8zY_.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-jvQ6FaBZ.js → binary-plugins-BP7wfpqy.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-D4ZIVQbk.css → block-editor-BdOTO0Yo.css} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-B7U3qlB3.js → block-editor-oMLvdnOQ.js} +3 -3
- package/dist/gateway/static/root/assets/{browser-automation-inputs-BGT0xoTv.js → browser-automation-inputs-DTxSZ00u.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-DvLAwoiQ.js → browser-automations-page-IbJnwEY4.js} +2 -2
- package/dist/gateway/static/root/assets/browser-settings-page-CCUO3G23.js +3 -0
- package/dist/gateway/static/root/assets/button-CS04eWY9.js +1 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-BjMb5H2_.js +8 -0
- package/dist/gateway/static/root/assets/channels-settings-P22-_i13.js +1 -0
- package/dist/gateway/static/root/assets/{channels-status-swr-C_icwbWj.js → channels-status-swr-D2AmAoty.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-BtL71IOs.js → chat-terminal-dock-B-yI3Mi1.js} +2 -2
- package/dist/gateway/static/root/assets/{computer-settings-page-Bu6ZJtmS.js → computer-settings-page-CWx_jnng.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-BLgPORmH.js +2 -0
- package/dist/gateway/static/root/assets/cron-expression-DMRRL4Zg.js +2 -0
- package/dist/gateway/static/root/assets/date-picker-BSwL0e6E.js +1 -0
- package/dist/gateway/static/root/assets/{dependency-picker-BNugauiZ.js → dependency-picker-BQTspLzC.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DTy_3-OY.js → desktop-pet-C3lFxDF6.js} +1 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-Y8pjpXFE.js +1 -0
- package/dist/gateway/static/root/assets/device-pairing-wizard-DM4_GMzo.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-C3F7RiGW.js → extension-debug-page-CVGiGVcR.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-C0jhcCT_.js → extension-page-g3JtCP_y.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CNvJQkrr.js → extension-settings-page-CjpoKV1f.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-D5AM8cyQ.js → gateway-config-swr-BSvXXpKM.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-BDCpS7U1.js +1 -0
- package/dist/gateway/static/root/assets/gateway-realtime-store-BGmP1obI.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-CYG9WCZn.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-CSJWdnFs.js → gateway-startup-retry-Caf8g3sC.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-Cd1VJsHe.js → heartbeat-settings-Cl834-SS.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-CB_XVtIM.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-BNh604hw.js → image-generation-api-BwEWBUVC.js} +1 -1
- package/dist/gateway/static/root/assets/imports-page-CoMlgSIA.js +1 -0
- package/dist/gateway/static/root/assets/index-CI37dTAn.css +1 -0
- package/dist/gateway/static/root/assets/index-Do9MltC4.js +79 -0
- package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-CNq5D4pe.js +1 -0
- package/dist/gateway/static/root/assets/local-app-workbench-page-BxQlEje6.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-DyrFxW3G.js → local-apps-page-DQnRA598.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-DLK05Y1a.js → locale-store-D16nmbaN.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-CT5GrcMs.js +2 -0
- package/dist/gateway/static/root/assets/management-settings-DKcO5fQ-.js +1 -0
- package/dist/gateway/static/root/assets/{markdown-view-B8maDRWh.js → markdown-view-DCp4BlZP.js} +2 -2
- package/dist/gateway/static/root/assets/{media-plugins-5DakFba_.js → media-plugins-Cy64sn_C.js} +1 -1
- package/dist/gateway/static/root/assets/messages-C-9oo69N.js +3 -0
- package/dist/gateway/static/root/assets/note-detail-panel-5dc3LKTL.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-AbwxgXuG.js +8 -0
- package/dist/gateway/static/root/assets/{page-tabs-DzJpglJJ.js → page-tabs-CgEoHSVT.js} +1 -1
- package/dist/gateway/static/root/assets/{popover-select-DldSX8GX.js → popover-select-9i-ZtHXL.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-Dj6LJsuQ.js → preview-open-alternatives-Ck2uKTbf.js} +1 -1
- package/dist/gateway/static/root/assets/{proactive-page-CwudBdrQ.js → proactive-page-Dr1mCJhZ.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-CujZXOea.js → product-open-page-DbZvJ5GE.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-DnE1zI1c.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-BD0nLYxk.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-BMFL4vis.js → registry-api-DcQdwpPu.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-TYuE6A3S.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DV554qyN.js → runtime-tools-settings-panel-CPwdgWKo.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-Bh2Er67B.js → schema-form-8psK4cFO.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-BcWDQQFX.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-DzGQX6Hq.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-BsdM7P1d.js → settings-form-section-D_Gsz5rl.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-3yEAqoME.js → settings-page-C_Tj_mkZ.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-CE2X89qN.js +1 -0
- package/dist/gateway/static/root/assets/share-preview-page-B_M_oPsT.js +2 -0
- package/dist/gateway/static/root/assets/shares-settings-BL4H9Iym.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-WMKIgUOp.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-DYgwzl5B.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-dHBD7YqU.js → skills-page.utils-Cuh6s2HM.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-lItR5Kah.js → system-settings-panel-aassGyNb.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-BjeRslap.js +1 -0
- package/dist/gateway/static/root/assets/theme-store-RUBQBsFP.js +1 -0
- package/dist/gateway/static/root/assets/tunnel-api-DJYcPWIV.js +1 -0
- package/dist/gateway/static/root/assets/{use-autosave-DO50_g_S.js → use-autosave-QGYG7oMZ.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-PrRsd4go.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-k7tWLXzM.js → voice-api-key-field-D1s0gIRW.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-bZqN8-UF.js → voice-config-api-D2goEn5e.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-BHI6gO_u.js → work-discovery-overlay-DkFW9aJ6.js} +1 -1
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-BYToUPUY.js +3 -0
- package/dist/gateway/static/root/assets/workflows-page-Z8iZe9YP.js +6 -0
- package/dist/gateway/static/root/index.html +14 -12
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/device-pairing.js +100 -7
- package/dist/packages/gateway-contract/src/gateway-scopes.js +53 -0
- package/dist/packages/gateway-contract/src/index.js +2 -0
- package/dist/packages/realtime-client/src/index.js +14 -2
- package/dist/packages/realtime-protocol/src/index.js +18 -14
- package/dist/src/agent/agent-instance-gateway.d.ts +2 -0
- package/dist/src/agent/agent-manager.d.ts +2 -0
- package/dist/src/agent/agent-manager.js +40 -12
- package/dist/src/agent/agent-scope.d.ts +4 -1
- package/dist/src/agent/agent-scope.js +19 -3
- package/dist/src/agent/commands/command-isolation.js +11 -9
- package/dist/src/agent/commands/command-registry.js +18 -33
- package/dist/src/agent/context/audit.js +12 -2
- package/dist/src/agent/context/coordinator.d.ts +13 -3
- package/dist/src/agent/context/coordinator.js +27 -11
- package/dist/src/agent/context/execution-context.js +42 -22
- package/dist/src/agent/context/execution-context.types.d.ts +4 -2
- package/dist/src/agent/context/execution-scope.d.ts +2 -2
- package/dist/src/agent/context/execution-scope.js +1 -1
- package/dist/src/agent/context/project-context.d.ts +2 -2
- package/dist/src/agent/context/project-context.js +3 -3
- package/dist/src/agent/embedded/run-for-session.d.ts +1 -0
- package/dist/src/agent/embedded/run-for-session.js +7 -1
- package/dist/src/agent/inbound/attachment-pipeline.d.ts +2 -0
- package/dist/src/agent/inbound/attachment-pipeline.js +3 -3
- package/dist/src/agent/inbound/inbound-loop.js +1 -0
- package/dist/src/agent/inbound/turn-dispatcher.js +3 -3
- package/dist/src/agent/mcp/mcp-stdio-transport.js +5 -2
- package/dist/src/agent/memory/compaction-promotion.js +7 -2
- package/dist/src/agent/memory/create-memory-manager.js +1 -0
- package/dist/src/agent/memory/manager.d.ts +6 -0
- package/dist/src/agent/memory/manager.js +74 -39
- package/dist/src/agent/memory/runtime.d.ts +3 -3
- package/dist/src/agent/memory/runtime.js +11 -4
- package/dist/src/agent/orchestration/agent-orchestrator.js +4 -1
- package/dist/src/agent/prompt/cache-boundary.d.ts +2 -0
- package/dist/src/agent/prompt/cache-boundary.js +10 -1
- package/dist/src/agent/service/build-direct-message-content.d.ts +1 -0
- package/dist/src/agent/service/build-direct-message-content.js +2 -1
- package/dist/src/agent/service/direct-turn-helpers.js +3 -2
- package/dist/src/agent/service/process-direct-streaming.d.ts +3 -1
- package/dist/src/agent/service/process-direct-streaming.js +3 -2
- package/dist/src/agent/service/webchat-tts.d.ts +0 -4
- package/dist/src/agent/service/webchat-tts.js +20 -19
- package/dist/src/agent/tools/factory.js +3 -3
- package/dist/src/agent/tools/knowledge-memory-tool.d.ts +2 -2
- package/dist/src/agent/tools/knowledge-memory-tool.js +7 -7
- package/dist/src/browser/native-messaging-host.js +2 -2
- package/dist/src/channels/attachments/voice-stt-webchat.d.ts +3 -0
- package/dist/src/channels/attachments/voice-stt-webchat.js +22 -9
- package/dist/src/cli/commands/agent.js +2 -0
- package/dist/src/cli/commands/config.js +8 -9
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/extension-marketplace.js +69 -44
- package/dist/src/cli/commands/extension-pack.js +0 -2
- package/dist/src/cli/commands/extension.js +4 -25
- package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
- package/dist/src/cli/commands/onboard/gateway.js +2 -1
- package/dist/src/cli/commands/update.js +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +5 -2
- package/dist/src/config/index.js +2 -2
- package/dist/src/config/loader.d.ts +1 -0
- package/dist/src/config/loader.js +14 -1
- package/dist/src/config/schema.d.ts +10 -3
- package/dist/src/config/schema.js +10 -2
- package/dist/src/execution-environments/local-worktree-manager.js +17 -15
- package/dist/src/execution-environments/store.js +4 -2
- package/dist/src/execution-environments/types.d.ts +3 -0
- package/dist/src/execution-environments/types.js +2 -1
- package/dist/src/execution-environments/worktree-safety.d.ts +8 -0
- package/dist/src/execution-environments/worktree-safety.js +43 -0
- package/dist/src/extensions/activation-planner.d.ts +1 -1
- package/dist/src/extensions/activation-planner.js +1 -1
- package/dist/src/extensions/api-version.d.ts +4 -0
- package/dist/src/extensions/api-version.js +15 -0
- package/dist/src/extensions/api.d.ts +3 -9
- package/dist/src/extensions/api.js +26 -32
- package/dist/src/extensions/config-validation.d.ts +8 -0
- package/dist/src/extensions/config-validation.js +25 -0
- package/dist/src/extensions/extension-registry-impl.d.ts +20 -9
- package/dist/src/extensions/extension-registry-impl.js +79 -11
- package/dist/src/extensions/hooks.d.ts +1 -1
- package/dist/src/extensions/index.d.ts +2 -1
- package/dist/src/extensions/install-transaction.d.ts +2 -0
- package/dist/src/extensions/install-transaction.js +32 -21
- package/dist/src/extensions/install.js +18 -1
- package/dist/src/extensions/loader.d.ts +5 -5
- package/dist/src/extensions/loader.js +109 -47
- package/dist/src/extensions/lockfile.d.ts +3 -5
- package/dist/src/extensions/lockfile.js +41 -14
- package/dist/src/extensions/normalize-manifest.js +6 -60
- package/dist/src/extensions/sdk/index.d.ts +3 -2
- package/dist/src/extensions/sdk/index.js +2 -2
- package/dist/src/extensions/sdk/testing.js +0 -4
- package/dist/src/extensions/security.js +5 -7
- package/dist/src/extensions/types/core.d.ts +0 -5
- package/dist/src/extensions/types/index.d.ts +1 -1
- package/dist/src/extensions/types/manifest.d.ts +1 -25
- package/dist/src/extensions/types/providers.d.ts +1 -1
- package/dist/src/extensions/types/registration.d.ts +0 -12
- package/dist/src/extensions/update.js +71 -30
- package/dist/src/gateway/heartbeat/service.js +2 -2
- package/dist/src/gateway/hono/lib/config-payload.d.ts +3 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +47 -10
- package/dist/src/gateway/hono/routes/devices.js +10 -7
- package/dist/src/gateway/hono/routes/endpoint-compatibility.js +6 -0
- package/dist/src/gateway/hono/routes/extension-gateway.js +0 -33
- package/dist/src/gateway/hono/routes/imports.js +1 -1
- package/dist/src/gateway/hono/routes/lazy-bundles.js +0 -1
- package/dist/src/gateway/hono/routes/local-apps.js +1 -1
- package/dist/src/gateway/hono/routes/realtime.js +30 -8
- package/dist/src/gateway/hono/routes/update.js +2 -2
- package/dist/src/gateway/hono/routes/user-model.js +25 -6
- package/dist/src/gateway/index.js +5 -2
- package/dist/src/gateway/lock.d.ts +2 -0
- package/dist/src/gateway/lock.js +31 -14
- package/dist/src/gateway/run-loop.js +3 -2
- package/dist/src/gateway/security/gateway-scopes.d.ts +2 -5
- package/dist/src/gateway/security/gateway-scopes.js +3 -45
- package/dist/src/gateway/security/index.js +2 -1
- package/dist/src/gateway/service/config-coordinator.js +1 -1
- package/dist/src/gateway/service.js +11 -7
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/imports/importService.d.ts +1 -1
- package/dist/src/imports/inventory.js +16 -2
- package/dist/src/imports/productImport.js +5 -5
- package/dist/src/imports/types.d.ts +3 -3
- package/dist/src/infra/exec.d.ts +2 -2
- package/dist/src/infra/exec.js +32 -27
- package/dist/src/infra/gateway-processes.js +1 -1
- package/dist/src/infra/run-command.js +15 -50
- package/dist/src/infra/update-restart.js +1 -1
- package/dist/src/infra/update-runner.js +2 -2
- package/dist/src/infra/update-startup.js +1 -1
- package/dist/src/knowledge/connected-knowledge-pipeline.js +13 -3
- package/dist/src/knowledge-memory/domain.d.ts +17 -1
- package/dist/src/knowledge-memory/index.js +2 -2
- package/dist/src/knowledge-memory/repository.d.ts +26 -4
- package/dist/src/knowledge-memory/repository.js +171 -36
- package/dist/src/mcp/channel-bridge.js +7 -3
- package/dist/src/media-understanding/registry.js +6 -1
- package/dist/src/migrations/knowledge-memory-read-policy-config.d.ts +2 -0
- package/dist/src/migrations/knowledge-memory-read-policy-config.js +48 -0
- package/dist/src/migrations/runner.js +2 -1
- package/dist/src/process/bounded-output.d.ts +10 -0
- package/dist/src/process/bounded-output.js +41 -0
- package/dist/src/process/kill-tree.d.ts +6 -17
- package/dist/src/process/kill-tree.js +43 -75
- package/dist/src/process/process-spec.d.ts +39 -0
- package/dist/src/process/process-spec.js +13 -0
- package/dist/src/process/run-process.d.ts +4 -0
- package/dist/src/process/run-process.js +97 -0
- package/dist/src/providers/plugin-registry.d.ts +1 -1
- package/dist/src/providers/plugin-registry.js +6 -0
- package/dist/src/realtime/runtime.js +3 -1
- package/dist/src/session/store.js +1 -1
- package/dist/src/storage/sqlite/device-pairing-approval.js +1 -1
- package/dist/src/storage/sqlite/index.d.ts +1 -1
- package/dist/src/storage/sqlite/index.js +2 -2
- package/dist/src/storage/sqlite/migrations/180_execution_environment_ownership.sql +7 -0
- package/dist/src/storage/sqlite/migrations/181_knowledge_item_status_events.sql +12 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/schema.sql +13 -0
- package/dist/src/storage/sqlite/transcript-repository.d.ts +4 -0
- package/dist/src/storage/sqlite/transcript-repository.js +36 -1
- package/dist/src/tui/backends/embedded-backend.d.ts +24 -8
- package/dist/src/tui/backends/embedded-backend.js +114 -10
- package/dist/src/tui/backends/gateway-realtime-backend.d.ts +18 -0
- package/dist/src/tui/backends/gateway-realtime-backend.js +32 -5
- package/dist/src/tui/components/assistant-message.d.ts +4 -1
- package/dist/src/tui/components/assistant-message.js +10 -2
- package/dist/src/tui/components/cell-render-mode.d.ts +4 -0
- package/dist/src/tui/components/cell-render-mode.js +1 -0
- package/dist/src/tui/components/chat-log.d.ts +17 -4
- package/dist/src/tui/components/chat-log.js +68 -50
- package/dist/src/tui/components/custom-editor.d.ts +2 -2
- package/dist/src/tui/components/custom-editor.js +5 -1
- package/dist/src/tui/components/pending-input-preview.d.ts +9 -0
- package/dist/src/tui/components/pending-input-preview.js +33 -0
- package/dist/src/tui/components/semantic-cell.d.ts +17 -0
- package/dist/src/tui/components/semantic-cell.js +29 -0
- package/dist/src/tui/components/tool-execution.d.ts +5 -1
- package/dist/src/tui/components/tool-execution.js +33 -10
- package/dist/src/tui/components/transcript-overlay.d.ts +29 -0
- package/dist/src/tui/components/transcript-overlay.js +114 -0
- package/dist/src/tui/components/tui-bottom-bar.js +3 -1
- package/dist/src/tui/components/user-message.d.ts +5 -1
- package/dist/src/tui/components/user-message.js +12 -1
- package/dist/src/tui/extension-host/load-extensions.d.ts +1 -1
- package/dist/src/tui/extension-host/runtime-context.js +2 -1
- package/dist/src/tui/extension-host/runtime.d.ts +1 -1
- package/dist/src/tui/format-tui-hotkeys.js +8 -1
- package/dist/src/tui/tui-agent-events.js +31 -0
- package/dist/src/tui/tui-backend.d.ts +23 -11
- package/dist/src/tui/tui-backend.js +1 -9
- package/dist/src/tui/tui-chat-input-state.d.ts +25 -0
- package/dist/src/tui/tui-chat-input-state.js +36 -0
- package/dist/src/tui/tui-command-formatters.js +2 -1
- package/dist/src/tui/tui-commands.js +1 -1
- package/dist/src/tui/tui-types.d.ts +2 -1
- package/dist/src/tui/tui-types.js +2 -1
- package/dist/src/tui/tui.js +122 -30
- package/dist/src/tui/xopc-tui-keybindings.d.ts +23 -3
- package/dist/src/tui/xopc-tui-keybindings.js +22 -2
- package/dist/src/user-context/access-policy.d.ts +2 -2
- package/dist/src/user-context/access-policy.js +10 -2
- package/dist/src/user-context/config.d.ts +23 -6
- package/dist/src/user-context/config.js +54 -7
- package/dist/src/voice/platform-streams.js +11 -1
- package/dist/src/voice/realtime/omniEngine.js +13 -1
- package/dist/src/voice/realtime/runtime.js +2 -1
- package/dist/src/voice/tts/audio.js +1 -1
- package/dist/src/voice/tts/speech-registry.js +6 -1
- package/package.json +9 -7
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-D0ITeUFb.js +0 -1
- package/dist/gateway/static/root/assets/agents-DcfWhk2S.js +0 -1
- package/dist/gateway/static/root/assets/api-fPapljyb.js +0 -1
- package/dist/gateway/static/root/assets/app-management-settings-panel-U3yDRzKF.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-FgMHY1Pr.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-DxaiBwrD.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-CHrfg3BX.js +0 -3
- package/dist/gateway/static/root/assets/button-CGlRPNzi.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DpYDPk_o.js +0 -8
- package/dist/gateway/static/root/assets/channels-settings-DMq-NBUQ.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-LsEiI9L5.js +0 -2
- package/dist/gateway/static/root/assets/cron-expression-B25FHn4w.js +0 -2
- package/dist/gateway/static/root/assets/date-picker-CzVHO7z9.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-CXfnejTb.js +0 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-CxKwfncn.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-CQTcIvlZ.js +0 -1
- package/dist/gateway/static/root/assets/home-page-B_uyfCGq.js +0 -1
- package/dist/gateway/static/root/assets/imports-page-DXNfRmk9.js +0 -1
- package/dist/gateway/static/root/assets/index-BAqVpc1H.css +0 -1
- package/dist/gateway/static/root/assets/index-hlU8MUEz.js +0 -79
- package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-CgW5_XVP.js +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-C4h3qDRL.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-Goy_QHfL.js +0 -2
- package/dist/gateway/static/root/assets/management-settings-DgQyGEpR.js +0 -1
- package/dist/gateway/static/root/assets/messages-C9h8SImu.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-lcZby9NY.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-CDGPPI-W.js +0 -8
- package/dist/gateway/static/root/assets/project-detail-page-CyAf_sK-.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-BW5m_HhZ.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-B4JgwB0s.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-D5SmvlQ1.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-DDALROy_.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-BOHNZ-S3.js +0 -1
- package/dist/gateway/static/root/assets/share-preview-page-wV056nz2.js +0 -2
- package/dist/gateway/static/root/assets/shares-settings-io4NzfJL.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-CERFaxLj.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-CtwUqvsE.js +0 -2
- package/dist/gateway/static/root/assets/task-detail-page-CCKc67a-.js +0 -1
- package/dist/gateway/static/root/assets/theme-store-KfFEGMlp.js +0 -1
- package/dist/gateway/static/root/assets/tunnel-api-DPyLgmWw.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-CcnGgH1n.js +0 -2
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-jEMtNIG8.js +0 -3
- package/dist/gateway/static/root/assets/workflows-page-CX4bcAD-.js +0 -6
- package/dist/src/extensions/when-context.d.ts +0 -6
- package/dist/src/extensions/when-context.js +0 -26
- package/dist/src/extensions/when-expression.d.ts +0 -11
- package/dist/src/extensions/when-expression.js +0 -213
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DEFAULT_ACK_MAX_CHARS, HEARTBEAT_OK, NO_REPLY, shouldSilence, stripHeartbeatToken } from "./tokens.js";
|
|
2
|
-
import { appendCronEventLines } from "./event-prompt.js";
|
|
3
2
|
import { isWithinActiveHours } from "./active-hours.js";
|
|
4
3
|
import { isHeartbeatContentEmpty } from "./content-check.js";
|
|
4
|
+
import { appendCronEventLines } from "./event-prompt.js";
|
|
5
5
|
import { createHeartbeatWake } from "./wake.js";
|
|
6
6
|
export { DEFAULT_ACK_MAX_CHARS, HEARTBEAT_OK, NO_REPLY, appendCronEventLines, createHeartbeatWake, isHeartbeatContentEmpty, isWithinActiveHours, shouldSilence, stripHeartbeatToken };
|
|
@@ -23,7 +23,7 @@ export declare class ImportService {
|
|
|
23
23
|
}>): import("./types.js").ImportPlan;
|
|
24
24
|
describeSkills(scan: ImportScan, target: ImportTarget): {
|
|
25
25
|
candidate: import("./types.js").ImportCandidate;
|
|
26
|
-
status:
|
|
26
|
+
status: "ready" | "blocked" | "conflict" | "existing";
|
|
27
27
|
reason: string;
|
|
28
28
|
targetName: string;
|
|
29
29
|
}[];
|
|
@@ -93,7 +93,21 @@ async function scanProduct(service, source, owner = "gateway-owner") {
|
|
|
93
93
|
});
|
|
94
94
|
for (const candidate of relevant.candidates) {
|
|
95
95
|
if (candidate.kind === "mcp") {
|
|
96
|
-
inventory.
|
|
96
|
+
inventory.candidates.push({
|
|
97
|
+
id: candidate.id,
|
|
98
|
+
kind: "connection",
|
|
99
|
+
parentId: parent?.id,
|
|
100
|
+
name: candidate.name,
|
|
101
|
+
description: candidate.description,
|
|
102
|
+
displayPath: candidate.location,
|
|
103
|
+
location: candidate.location,
|
|
104
|
+
scope: candidate.scope,
|
|
105
|
+
status: candidate.compatibility === "needs_setup" ? "requires_setup" : "blocked",
|
|
106
|
+
reason: candidate.findings.join("; ") || void 0,
|
|
107
|
+
suggested: false,
|
|
108
|
+
candidate,
|
|
109
|
+
scanId: scan.id
|
|
110
|
+
});
|
|
97
111
|
continue;
|
|
98
112
|
}
|
|
99
113
|
const item = {
|
|
@@ -192,7 +206,7 @@ function previewInventoryItem(service, owner, inventoryId, itemId) {
|
|
|
192
206
|
text: item.reason ?? "",
|
|
193
207
|
truncated: false
|
|
194
208
|
};
|
|
195
|
-
const text = item.kind === "context" ? item.candidate?.content ?? "" : item.kind === "skill" ? Buffer.from(service.readSnapshot(item.scanId, item.id).find((f) => f.path === "SKILL.md").data, "base64").toString("utf8") : item.displayPath;
|
|
209
|
+
const text = item.kind === "context" ? item.candidate?.content ?? "" : item.kind === "skill" ? Buffer.from(service.readSnapshot(item.scanId, item.id).find((f) => f.path === "SKILL.md").data, "base64").toString("utf8") : item.kind === "connection" ? JSON.stringify(item.candidate?.mcp ?? {}, null, 2) : item.displayPath;
|
|
196
210
|
return {
|
|
197
211
|
text: text.slice(0, 2e4),
|
|
198
212
|
truncated: text.length > 2e4
|
|
@@ -30,7 +30,7 @@ function selectedItems(inventory, ids) {
|
|
|
30
30
|
if (!ids.length || new Set(ids).size !== ids.length) throw new ImportError("invalid_selection", "Select at least one item; duplicate selections are not allowed");
|
|
31
31
|
return ids.map((id) => {
|
|
32
32
|
const item = inventory.candidates.find((c) => c.id === id);
|
|
33
|
-
if (!item || item.status === "blocked" || item.status === "existing" && item.kind !== "project") throw new ImportError("invalid_selection", "Select available items from this list");
|
|
33
|
+
if (!item || item.kind === "connection" || item.status === "blocked" || item.status === "requires_setup" || item.status === "existing" && item.kind !== "project") throw new ImportError("invalid_selection", "Select available items from this list");
|
|
34
34
|
if (item.parentId && !ids.includes(item.parentId)) throw new ImportError("missing_parent", "Select the project entry along with its contents");
|
|
35
35
|
return item;
|
|
36
36
|
}).sort((a, b) => Number(b.kind === "project") - Number(a.kind === "project"));
|
|
@@ -55,7 +55,7 @@ async function preflight(service, inventory, items, retry) {
|
|
|
55
55
|
if (digest(readRegularFile(item.location, 128 * 1024).toString("utf8").trim()) !== candidate.hash) stale();
|
|
56
56
|
const projectId = parent ? projects.findByWorkspaceRoot(parent.location)?.id : void 0;
|
|
57
57
|
if ((!parent || projectId) && existingContext(candidate, projectId)) stale();
|
|
58
|
-
} else {
|
|
58
|
+
} else if (item.kind === "skill") {
|
|
59
59
|
if (parent && !service.isWorkspaceTrusted(parent.location)) stale();
|
|
60
60
|
if (fileHash(readTree(item.location)) !== candidate.hash) stale();
|
|
61
61
|
service.readSnapshot(item.scanId, candidate.id);
|
|
@@ -69,7 +69,7 @@ async function preflight(service, inventory, items, retry) {
|
|
|
69
69
|
projectId: parent?.projectId
|
|
70
70
|
});
|
|
71
71
|
if ([...existing.flatMap((e) => [e.name, e.directory]), ...reserved].some((n) => n.toLowerCase() === item.targetName.toLowerCase())) stale();
|
|
72
|
-
}
|
|
72
|
+
} else throw new ImportError("invalid_selection", "Connections must be configured separately");
|
|
73
73
|
} catch (error) {
|
|
74
74
|
if (error instanceof ImportError && error.code === "inventory_stale") throw error;
|
|
75
75
|
stale();
|
|
@@ -115,7 +115,7 @@ async function execute(service, repo, inventory, run) {
|
|
|
115
115
|
entry.status = status === "created" ? "imported" : "existing";
|
|
116
116
|
persist();
|
|
117
117
|
});
|
|
118
|
-
else {
|
|
118
|
+
else if (item.kind === "skill") {
|
|
119
119
|
const key = `${run.id}:${item.id}`;
|
|
120
120
|
let job = service.jobByKey(key);
|
|
121
121
|
if (!job) {
|
|
@@ -143,7 +143,7 @@ async function execute(service, repo, inventory, run) {
|
|
|
143
143
|
if (!["active", "skipped"].includes(published.status)) throw new ImportError("publish_failed", published.error ?? "Could not publish the skill. Retry this item.");
|
|
144
144
|
entry.targetId = join(item.targetRoot, item.targetName);
|
|
145
145
|
entry.status = published.status === "active" ? "imported" : "existing";
|
|
146
|
-
}
|
|
146
|
+
} else throw new ImportError("invalid_selection", "Connections must be configured separately");
|
|
147
147
|
} catch (error) {
|
|
148
148
|
entry.status = "failed";
|
|
149
149
|
delete entry.targetId;
|
|
@@ -70,10 +70,10 @@ export declare class ImportError extends Error {
|
|
|
70
70
|
readonly status: 400 | 403 | 404 | 409 | 413;
|
|
71
71
|
constructor(code: string, message: string, status?: 400 | 403 | 404 | 409 | 413);
|
|
72
72
|
}
|
|
73
|
-
export type InventoryStatus = 'ready' | 'existing' | 'conflict' | 'blocked';
|
|
73
|
+
export type InventoryStatus = 'ready' | 'existing' | 'conflict' | 'requires_setup' | 'blocked';
|
|
74
74
|
export interface InventoryItem {
|
|
75
75
|
id: string;
|
|
76
|
-
kind: 'skill' | 'context' | 'project';
|
|
76
|
+
kind: 'skill' | 'context' | 'project' | 'connection';
|
|
77
77
|
parentId?: string;
|
|
78
78
|
name: string;
|
|
79
79
|
description: string;
|
|
@@ -112,7 +112,7 @@ export interface ImportSelection {
|
|
|
112
112
|
}
|
|
113
113
|
export interface ImportRunItem {
|
|
114
114
|
candidateId: string;
|
|
115
|
-
kind: InventoryItem['kind']
|
|
115
|
+
kind: Exclude<InventoryItem['kind'], 'connection'>;
|
|
116
116
|
name: string;
|
|
117
117
|
status: 'pending' | 'imported' | 'existing' | 'failed';
|
|
118
118
|
targetId?: string;
|
package/dist/src/infra/exec.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ChildProcess } from 'node:child_process';
|
|
2
2
|
export type ExecResult = {
|
|
3
3
|
stdout: string;
|
|
4
4
|
stderr: string;
|
|
@@ -13,4 +13,4 @@ export type ExecOptions = {
|
|
|
13
13
|
export declare function runExec(file: string, args: string[], opts?: ExecOptions): Promise<ExecResult>;
|
|
14
14
|
export declare function spawnDetached(file: string, args: string[], opts: {
|
|
15
15
|
stdio?: 'ignore' | 'pipe';
|
|
16
|
-
}):
|
|
16
|
+
}): ChildProcess;
|
package/dist/src/infra/exec.js
CHANGED
|
@@ -1,37 +1,42 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ProcessExitError } from "../process/process-spec.js";
|
|
2
|
+
import { runProcess, spawnProcess } from "../process/run-process.js";
|
|
2
3
|
//#region src/infra/exec.ts
|
|
3
|
-
function execFileAsync(file, args, opts) {
|
|
4
|
-
return new Promise((resolve, reject) => {
|
|
5
|
-
execFile(file, args, {
|
|
6
|
-
encoding: "utf8",
|
|
7
|
-
maxBuffer: opts.maxBuffer ?? 1024 * 1024,
|
|
8
|
-
cwd: opts.cwd,
|
|
9
|
-
env: opts.env,
|
|
10
|
-
timeout: opts.timeoutMs
|
|
11
|
-
}, (err, stdout, stderr) => {
|
|
12
|
-
if (err) {
|
|
13
|
-
const enriched = err;
|
|
14
|
-
enriched.stdout = typeof stdout === "string" ? stdout : String(stdout ?? "");
|
|
15
|
-
enriched.stderr = typeof stderr === "string" ? stderr : String(stderr ?? "");
|
|
16
|
-
reject(enriched);
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
resolve({
|
|
20
|
-
stdout: typeof stdout === "string" ? stdout : String(stdout ?? ""),
|
|
21
|
-
stderr: typeof stderr === "string" ? stderr : String(stderr ?? "")
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
4
|
/** Run a subprocess and capture stdout/stderr (OpenClaw-aligned). */
|
|
27
5
|
async function runExec(file, args, opts = {}) {
|
|
28
|
-
|
|
6
|
+
const result = await runProcess({
|
|
7
|
+
program: file,
|
|
8
|
+
args,
|
|
9
|
+
cwd: opts.cwd,
|
|
10
|
+
env: opts.env,
|
|
11
|
+
timeoutMs: opts.timeoutMs,
|
|
12
|
+
maxOutputBytes: opts.maxBuffer,
|
|
13
|
+
terminationPolicy: "tree"
|
|
14
|
+
});
|
|
15
|
+
if (result.exitCode !== 0) {
|
|
16
|
+
const error = new ProcessExitError({
|
|
17
|
+
program: file,
|
|
18
|
+
args
|
|
19
|
+
}, result);
|
|
20
|
+
error.stdout = result.stdout;
|
|
21
|
+
error.stderr = result.stderr;
|
|
22
|
+
throw error;
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
stdout: result.stdout,
|
|
26
|
+
stderr: result.stderr
|
|
27
|
+
};
|
|
29
28
|
}
|
|
30
29
|
function spawnDetached(file, args, opts) {
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
const handle = spawnProcess({
|
|
31
|
+
program: file,
|
|
32
|
+
args,
|
|
33
33
|
detached: false
|
|
34
34
|
});
|
|
35
|
+
if (opts.stdio === "ignore") {
|
|
36
|
+
handle.child.stdout?.resume();
|
|
37
|
+
handle.child.stderr?.resume();
|
|
38
|
+
}
|
|
39
|
+
return handle.child;
|
|
35
40
|
}
|
|
36
41
|
//#endregion
|
|
37
42
|
export { runExec, spawnDetached };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { listPortListeners } from "../gateway/ports.js";
|
|
2
1
|
import { isGatewayArgv, parseProcCmdline } from "./gateway-process-argv.js";
|
|
2
|
+
import { listPortListeners } from "../gateway/ports.js";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import { spawnSync } from "node:child_process";
|
|
5
5
|
//#region src/infra/gateway-processes.ts
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { runProcess } from "../process/run-process.js";
|
|
2
2
|
//#region src/infra/run-command.ts
|
|
3
3
|
const MAX_CAPTURE_BYTES = 512 * 1024;
|
|
4
|
-
function appendCaptured(current, chunk) {
|
|
5
|
-
const next = current + chunk.toString();
|
|
6
|
-
if (next.length <= MAX_CAPTURE_BYTES) return next;
|
|
7
|
-
return next.slice(-MAX_CAPTURE_BYTES);
|
|
8
|
-
}
|
|
9
4
|
function createDefaultCommandRunner() {
|
|
10
5
|
return (argv, options) => runCommandWithTimeout(argv, options);
|
|
11
6
|
}
|
|
@@ -16,50 +11,20 @@ function runCommandWithTimeout(argv, options) {
|
|
|
16
11
|
stdout: "",
|
|
17
12
|
stderr: "empty argv"
|
|
18
13
|
});
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const finish = (result) => {
|
|
34
|
-
if (settled) return;
|
|
35
|
-
settled = true;
|
|
36
|
-
clearTimeout(timeoutId);
|
|
37
|
-
resolve(result);
|
|
38
|
-
};
|
|
39
|
-
const timeoutId = setTimeout(() => {
|
|
40
|
-
child.kill("SIGTERM");
|
|
41
|
-
}, options.timeoutMs);
|
|
42
|
-
child.stdout?.on("data", (chunk) => {
|
|
43
|
-
stdout = appendCaptured(stdout, chunk);
|
|
44
|
-
});
|
|
45
|
-
child.stderr?.on("data", (chunk) => {
|
|
46
|
-
stderr = appendCaptured(stderr, chunk);
|
|
47
|
-
});
|
|
48
|
-
child.on("error", (err) => {
|
|
49
|
-
finish({
|
|
50
|
-
code: null,
|
|
51
|
-
stdout,
|
|
52
|
-
stderr: stderr || err.message
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
child.on("close", (code) => {
|
|
56
|
-
finish({
|
|
57
|
-
code,
|
|
58
|
-
stdout,
|
|
59
|
-
stderr
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
});
|
|
14
|
+
return runProcess({
|
|
15
|
+
program: command,
|
|
16
|
+
args,
|
|
17
|
+
cwd: options.cwd,
|
|
18
|
+
env: options.env,
|
|
19
|
+
timeoutMs: options.timeoutMs,
|
|
20
|
+
maxOutputBytes: MAX_CAPTURE_BYTES,
|
|
21
|
+
terminationPolicy: "tree",
|
|
22
|
+
...process.platform === "win32" ? { shell: process.env.ComSpec && process.env.ComSpec.trim() || "cmd.exe" } : {}
|
|
23
|
+
}).then((result) => ({
|
|
24
|
+
code: result.exitCode,
|
|
25
|
+
stdout: result.stdout,
|
|
26
|
+
stderr: result.stderr
|
|
27
|
+
}));
|
|
63
28
|
}
|
|
64
29
|
//#endregion
|
|
65
30
|
export { createDefaultCommandRunner, runCommandWithTimeout };
|
|
@@ -4,8 +4,8 @@ import { init_paths, resolveConfigPath } from "../config/paths.js";
|
|
|
4
4
|
import { init_loader, loadConfig } from "../config/loader.js";
|
|
5
5
|
import { isRestartEnabled } from "../config/commands.flags.js";
|
|
6
6
|
import { resolveGatewayService } from "../daemon/service.js";
|
|
7
|
-
import { authorizeGatewaySigusr1Restart, writeGatewayRestartIntentSync } from "./restart.js";
|
|
8
7
|
import { findVerifiedGatewayListenerPidsOnPortSync, signalVerifiedGatewayPidSync } from "./gateway-processes.js";
|
|
8
|
+
import { authorizeGatewaySigusr1Restart, writeGatewayRestartIntentSync } from "./restart.js";
|
|
9
9
|
import { refreshGatewayServiceAfterUpdate } from "./update-service-refresh.js";
|
|
10
10
|
//#region src/infra/update-restart.ts
|
|
11
11
|
init_loader();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { runPostUpdateExtensionSync } from "../extensions/update.js";
|
|
2
|
-
import "./update-channels.js";
|
|
3
|
-
import { compareSemver, resolveNpmChannelTag } from "./update-check.js";
|
|
4
2
|
import { readPackageName, readPackageVersion } from "./package-json.js";
|
|
5
3
|
import { createDefaultCommandRunner, runCommandWithTimeout } from "./run-command.js";
|
|
6
4
|
import { XOPC_PACKAGE_NAME, cleanupGlobalRenameDirs, createGlobalInstallEnv, detectGlobalInstallManagerForRoot, resolveGlobalInstallSpec, resolveGlobalInstallTarget } from "./update-global.js";
|
|
7
5
|
import { runGlobalPackageUpdateSteps } from "./package-update-steps.js";
|
|
8
6
|
import { resolveStableNodePath } from "./stable-node-path.js";
|
|
7
|
+
import "./update-channels.js";
|
|
8
|
+
import { compareSemver, resolveNpmChannelTag } from "./update-check.js";
|
|
9
9
|
import { trimLogTail } from "./update-log.js";
|
|
10
10
|
import { maybeRestartGatewayAfterUpdate } from "./update-restart.js";
|
|
11
11
|
import path from "node:path";
|
|
@@ -3,9 +3,9 @@ import { init_paths_state, resolveUpdateCheckStatePath } from "../config/paths-s
|
|
|
3
3
|
import { createLogger } from "../utils/logger/index.js";
|
|
4
4
|
import { init_logger } from "../utils/logger.js";
|
|
5
5
|
import { init_write_file_atomic, writeTextAtomic } from "./write-file-atomic.js";
|
|
6
|
-
import { acquireUpdateLock } from "./update-lock.js";
|
|
7
6
|
import { normalizeUpdateChannel } from "./update-channels.js";
|
|
8
7
|
import { compareSemver, detectInstallKind, resolveNpmChannelTag, resolvePackageRoot } from "./update-check.js";
|
|
8
|
+
import { acquireUpdateLock } from "./update-lock.js";
|
|
9
9
|
import { createHash, randomUUID } from "node:crypto";
|
|
10
10
|
import { readFile } from "node:fs/promises";
|
|
11
11
|
//#region src/infra/update-startup.ts
|
|
@@ -2,7 +2,7 @@ import { createLogger } from "../utils/logger/index.js";
|
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
3
|
import { claimKnowledgeSourceItems, completeKnowledgeSourceItemSynthesis, listKnowledgeSourceItems, pruneBoundedKnowledgeSourceItems } from "../storage/sqlite/knowledge-repository.js";
|
|
4
4
|
import "../storage/sqlite/index.js";
|
|
5
|
-
import { listKnowledgeItems,
|
|
5
|
+
import { listKnowledgeItems, transitionKnowledgeStatus, writeKnowledgeItem } from "../knowledge-memory/repository.js";
|
|
6
6
|
import "../knowledge-memory/index.js";
|
|
7
7
|
import { randomUUID } from "node:crypto";
|
|
8
8
|
//#region src/knowledge/connected-knowledge-pipeline.ts
|
|
@@ -54,7 +54,12 @@ var ConnectedKnowledgePipeline = class {
|
|
|
54
54
|
limit: 2e3
|
|
55
55
|
}).find((entry) => entry.canonicalKey === `source-item:${item.sourceInstanceId}:${item.externalId}`);
|
|
56
56
|
if (item.deletedAt) {
|
|
57
|
-
if (existing)
|
|
57
|
+
if (existing) transitionKnowledgeStatus({
|
|
58
|
+
id: existing.id,
|
|
59
|
+
status: "archived",
|
|
60
|
+
actor: "runtime",
|
|
61
|
+
reason: "Connected source item was deleted."
|
|
62
|
+
});
|
|
58
63
|
completeKnowledgeSourceItemSynthesis({
|
|
59
64
|
itemId: item.id,
|
|
60
65
|
workerId: this.workerId,
|
|
@@ -139,7 +144,12 @@ var ConnectedKnowledgePipeline = class {
|
|
|
139
144
|
recordClass: "source_index",
|
|
140
145
|
limit: 2e3
|
|
141
146
|
})) if (typeof item.source.sourceItemId === "string" && expiredIds.has(item.source.sourceItemId)) {
|
|
142
|
-
if (
|
|
147
|
+
if (transitionKnowledgeStatus({
|
|
148
|
+
id: item.id,
|
|
149
|
+
status: "archived",
|
|
150
|
+
actor: "maintenance",
|
|
151
|
+
reason: "Connected source retention window expired."
|
|
152
|
+
})) derivedDeleted += 1;
|
|
143
153
|
}
|
|
144
154
|
return {
|
|
145
155
|
rawDeleted: pruneBoundedKnowledgeSourceItems(sourceInstanceId, olderThanMs),
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import type { UserModelScope } from '../user-model/domain.js';
|
|
2
2
|
export type KnowledgeKind = 'project_fact' | 'workspace_fact' | 'decision' | 'task_lesson' | 'commitment' | 'open_question' | 'episode' | 'note';
|
|
3
3
|
export type KnowledgeStatus = 'candidate' | 'active' | 'needs_review' | 'stale' | 'archived' | 'rejected';
|
|
4
|
+
export type KnowledgeReviewAction = 'approve' | 'edit_and_approve' | 'reject' | 'archive';
|
|
5
|
+
export type KnowledgeStatusActor = 'user' | 'agent' | 'runtime' | 'maintenance' | 'migration';
|
|
4
6
|
export type KnowledgeOriginClass = 'owner' | 'agent' | 'system' | 'untrusted';
|
|
5
7
|
export type KnowledgeRecordClass = 'memory' | 'source_index';
|
|
6
|
-
export type
|
|
8
|
+
export type KnowledgeVisibilityScope = UserModelScope['type'];
|
|
9
|
+
export type KnowledgeContentSource = 'memory' | 'local_import' | 'connector';
|
|
10
|
+
export interface KnowledgeReadPolicy {
|
|
11
|
+
scopes: readonly KnowledgeVisibilityScope[];
|
|
12
|
+
contentSources: readonly KnowledgeContentSource[];
|
|
13
|
+
}
|
|
7
14
|
export interface KnowledgeItem {
|
|
8
15
|
id: string;
|
|
9
16
|
principalId: string;
|
|
@@ -34,3 +41,12 @@ export interface KnowledgeVisibilityContext {
|
|
|
34
41
|
projectId?: string;
|
|
35
42
|
conversationId: string;
|
|
36
43
|
}
|
|
44
|
+
export interface KnowledgeStatusEvent {
|
|
45
|
+
id: string;
|
|
46
|
+
knowledgeId: string;
|
|
47
|
+
fromStatus?: KnowledgeStatus;
|
|
48
|
+
toStatus: KnowledgeStatus;
|
|
49
|
+
actor: KnowledgeStatusActor;
|
|
50
|
+
reason: string;
|
|
51
|
+
createdAt: number;
|
|
52
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { getKnowledgeItem,
|
|
2
|
-
export { getKnowledgeItem,
|
|
1
|
+
import { KnowledgeReviewConflictError, classifyKnowledgeContentSource, getKnowledgeItem, knowledgeItemAllowed, listKnowledgeItems, listKnowledgeStatusEvents, reviewKnowledgeItem, searchKnowledgeItems, transitionKnowledgeStatus, writeKnowledgeItem } from "./repository.js";
|
|
2
|
+
export { KnowledgeReviewConflictError, classifyKnowledgeContentSource, getKnowledgeItem, knowledgeItemAllowed, listKnowledgeItems, listKnowledgeStatusEvents, reviewKnowledgeItem, searchKnowledgeItems, transitionKnowledgeStatus, writeKnowledgeItem };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type UserModelScope } from '../user-model/domain.js';
|
|
2
|
-
import type { KnowledgeItem, KnowledgeKind, KnowledgeOriginClass, KnowledgeRecordClass,
|
|
2
|
+
import type { KnowledgeItem, KnowledgeKind, KnowledgeOriginClass, KnowledgeRecordClass, KnowledgeContentSource, KnowledgeReadPolicy, KnowledgeStatus, KnowledgeReviewAction, KnowledgeStatusActor, KnowledgeStatusEvent, KnowledgeVisibilityContext } from './domain.js';
|
|
3
3
|
export interface WriteKnowledgeInput {
|
|
4
4
|
principalId?: string;
|
|
5
5
|
kind: KnowledgeKind;
|
|
@@ -23,6 +23,9 @@ export interface WriteKnowledgeInput {
|
|
|
23
23
|
replaceExisting?: boolean;
|
|
24
24
|
now?: number;
|
|
25
25
|
}
|
|
26
|
+
export declare class KnowledgeReviewConflictError extends Error {
|
|
27
|
+
constructor(message: string);
|
|
28
|
+
}
|
|
26
29
|
export declare function writeKnowledgeItem(input: WriteKnowledgeInput): {
|
|
27
30
|
item: KnowledgeItem;
|
|
28
31
|
created: boolean;
|
|
@@ -36,7 +39,25 @@ export declare function listKnowledgeItems(input?: {
|
|
|
36
39
|
recordClass?: KnowledgeRecordClass;
|
|
37
40
|
limit?: number;
|
|
38
41
|
}): KnowledgeItem[];
|
|
39
|
-
export declare function
|
|
42
|
+
export declare function transitionKnowledgeStatus(input: {
|
|
43
|
+
id: string;
|
|
44
|
+
status: KnowledgeStatus;
|
|
45
|
+
actor: KnowledgeStatusActor;
|
|
46
|
+
reason: string;
|
|
47
|
+
expectedStatus?: KnowledgeStatus;
|
|
48
|
+
content?: string;
|
|
49
|
+
now?: number;
|
|
50
|
+
}): KnowledgeItem | undefined;
|
|
51
|
+
export declare function reviewKnowledgeItem(input: {
|
|
52
|
+
id: string;
|
|
53
|
+
action: KnowledgeReviewAction;
|
|
54
|
+
actor: KnowledgeStatusActor;
|
|
55
|
+
reason: string;
|
|
56
|
+
expectedStatus?: KnowledgeStatus;
|
|
57
|
+
content?: string;
|
|
58
|
+
now?: number;
|
|
59
|
+
}): KnowledgeItem | undefined;
|
|
60
|
+
export declare function listKnowledgeStatusEvents(knowledgeId: string): KnowledgeStatusEvent[];
|
|
40
61
|
export declare function searchKnowledgeItems(input: {
|
|
41
62
|
query: string;
|
|
42
63
|
context: KnowledgeVisibilityContext;
|
|
@@ -44,7 +65,8 @@ export declare function searchKnowledgeItems(input: {
|
|
|
44
65
|
asOf?: number;
|
|
45
66
|
recordClass?: KnowledgeRecordClass;
|
|
46
67
|
trustedOnly?: boolean;
|
|
47
|
-
|
|
68
|
+
policy?: KnowledgeReadPolicy;
|
|
48
69
|
limit?: number;
|
|
49
70
|
}): KnowledgeItem[];
|
|
50
|
-
export declare function
|
|
71
|
+
export declare function classifyKnowledgeContentSource(item: KnowledgeItem): KnowledgeContentSource;
|
|
72
|
+
export declare function knowledgeItemAllowed(item: KnowledgeItem, policy: KnowledgeReadPolicy): boolean;
|