@xopcai/xopc 0.0.278 → 0.0.282
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/dist/browser-ext/_locales/en/messages.json +34 -4
- package/dist/browser-ext/_locales/zh_CN/messages.json +34 -4
- package/dist/browser-ext/dist/assets/{auth-ClQTK565.js → auth-DB30ywek.js} +18 -53
- package/dist/browser-ext/dist/assets/pcm-capture-worklet-CGN9Mlhg.js +39 -0
- package/dist/browser-ext/dist/assets/{sidepanel-CeGqObOa.css → sidepanel-BbSQr-6P.css} +40 -6
- package/dist/browser-ext/dist/background.js +1 -1
- package/dist/browser-ext/dist/sidepanel.html +2 -2
- package/dist/browser-ext/dist/sidepanel.js +1219 -191
- package/dist/browser-ext/manifest.json +2 -1
- package/dist/extensions/feishu/src/adapters/cli-login.js +3 -3
- package/dist/extensions/feishu/src/outbound/media-load.js +1 -1
- package/dist/extensions/telegram/src/inbound-processor.js +2 -2
- package/dist/extensions/telegram/src/outbound-sender.js +1 -1
- package/dist/extensions/telegram/src/plugin.js +2 -2
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/weixin/src/api/api.js +2 -2
- package/dist/extensions/weixin/src/auth/accounts.js +12 -12
- package/dist/extensions/weixin/src/messaging/debug-mode.js +5 -5
- package/dist/extensions/weixin/src/messaging/inbound.js +11 -11
- package/dist/gateway/static/root/assets/{activity-store-SJZ5fS17.js → activity-store-iPtG94qr.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-lRVOwbrK.js → agent-avatar-dicebear-Cny5rATT.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-OyQ8OVZv.js +1 -0
- package/dist/gateway/static/root/assets/{agents-DNQNTDkU.js → agents-DJeh_Ewo.js} +1 -1
- package/dist/gateway/static/root/assets/{api-CnJAVHBu.js → api-KMJzMqvZ.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-oHTY5PDs.js → app-management-settings-panel-ZqQKaZEI.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-B0YnZ3ig.js → appearance-settings-CfXsQkKO.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-k-QnVhKW.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-D4x142le.js → archive-plugin-BrW53Hap.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-zibD2Hod.js → attachment-load-DkfFWHiS.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-Dkp7gp_S.js → automations-page-e-5we6kD.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-DPnlkws1.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-CfUzu1Hc.js → binary-plugins-CWIswfXA.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-r5nCBBan.js → block-editor-CfeF1OmA.js} +3 -3
- package/dist/gateway/static/root/assets/{browser-automation-inputs-DcVLoIzc.js → browser-automation-inputs-BTIufVbM.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-BnL4JnTM.js → browser-automations-page-DnsuWKRu.js} +2 -2
- package/dist/gateway/static/root/assets/browser-settings-page-C8xyhnxx.js +8 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CBllOLTT.js +8 -0
- package/dist/gateway/static/root/assets/channels-settings-C-A-VUE2.js +1 -0
- package/dist/gateway/static/root/assets/{channels-status-swr-BTT2sIGg.js → channels-status-swr-DMYQNs-J.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-CWVnJtBp.js → chat-terminal-dock-C_Fw1R3A.js} +2 -2
- package/dist/gateway/static/root/assets/connectors-page-CtsMo3H4.js +2 -0
- package/dist/gateway/static/root/assets/{date-picker-XjPSlgq_.js → date-picker-CPFxjTrN.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-CkyfEP88.js → dependency-picker-C_5KqzjI.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-BAE_NVx5.js → desktop-pet-DLJsC5D6.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-BUw6V2R9.js → desktop-pet-settings-BdI1iSgz.js} +1 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-BnvPLhc9.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-giBeIVUT.js → extension-debug-page-BNS_TkZQ.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-Bqo9bNtx.js → extension-page-DMSDZ7Mb.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BX-6AA3k.js → extension-settings-page-CeGCWMt0.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-config-swr-Cpmyrr6j.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-DKOTYUma.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-CVTa5HSS.js → gateway-startup-retry-DoiPeb65.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-DWFAopk_.js → heartbeat-settings-gsdL_Yij.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-CbeAdS1T.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-DtMRG1oF.js → image-generation-api-CqjHWl2T.js} +1 -1
- package/dist/gateway/static/root/assets/index-B_Sg5BKz.css +2 -0
- package/dist/gateway/static/root/assets/index-enFXJJCU.js +74 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BKGPpBnV.js → keyboard-shortcuts-settings-CCLtJ8s8.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-DzC6SrXj.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-B06ToOxB.js → local-apps-page-3LdgP3NO.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-BkJ7g35d.js → locale-store-1urrBBCQ.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-DibI1GsP.js → logs-page-DHClKtm6.js} +2 -2
- package/dist/gateway/static/root/assets/{management-settings-DJ6yMZCd.js → management-settings-BaCo9Nuo.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-DF3aJP_5.js → markdown-view-BZmcFIWa.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-CdrLNAks.js → media-plugins-BMjJppvG.js} +1 -1
- package/dist/gateway/static/root/assets/messages-DYFcjtmG.js +3 -0
- package/dist/gateway/static/root/assets/note-detail-panel-hYO2jNhL.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-BT66x22W.js +8 -0
- package/dist/gateway/static/root/assets/{page-tabs-B7LA4z-x.js → page-tabs-BCszXX_F.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-DTQRN7WR.js → preview-open-alternatives-CyM0sanh.js} +1 -1
- package/dist/gateway/static/root/assets/proactive-page-CVDGA5sB.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-BazdmFYo.js → product-open-page-lXAbj85Z.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-Bp6TAMPM.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-UhOIiDcg.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-CTq8EECj.js → registry-api-CxQstD00.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-DJIkMFT4.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-D-DZf4I1.js → runtime-tools-settings-panel-BUFCgRdZ.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-B-Yj9DVW.js → schema-form-B01ksA8M.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-CQOAwPDt.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-CFuqbGI-.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-BxPUqwY6.js → settings-form-section-DvnjZBa3.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-zLn8lIrs.js → settings-page-DZRkpbCh.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-DVaEiAVY.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-DAc_FkVc.js → share-preview-page-vz0UK56q.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-XiCqMDAe.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-C3D8WanU.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-CxMWwR6A.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-BR5bk2vT.js → skills-page.utils-BryVNYll.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-C0ptJutB.js → system-settings-panel-mKFDe6aZ.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-Cb0RZNcJ.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-mV6Cm2vj.js → theme-store-Dc5s20V3.js} +1 -1
- package/dist/gateway/static/root/assets/tunnel-api-FcI3wKy3.js +1 -0
- package/dist/gateway/static/root/assets/{use-autosave-Dc5aN2px.js → use-autosave-CDgdtjTC.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-Cnshc-Un.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-CY0DpJui.js → voice-api-key-field-Ce8cb5mN.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-D3DdcH4H.js → voice-config-api-Mk78BrpP.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-Brg9yJBr.js → work-discovery-overlay-CacFTtXe.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-D3fq7boB.js → workflow-run-setup-panel-V-5HuEUq.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-1OJimIfo.js +6 -0
- package/dist/gateway/static/root/index.html +10 -11
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/discussions.js +17 -0
- package/dist/packages/gateway-contract/src/proactive.js +4 -2
- package/dist/src/agent/agent-manager.js +14 -14
- package/dist/src/agent/agent-scope.js +2 -2
- package/dist/src/agent/background-review/run-background-review.js +3 -3
- package/dist/src/agent/context/coordinator.js +3 -3
- package/dist/src/agent/context/execution-context.js +4 -4
- package/dist/src/agent/context/execution-scope.js +2 -2
- package/dist/src/agent/context/project-context.d.ts +1 -0
- package/dist/src/agent/context/project-context.js +16 -8
- package/dist/src/agent/embedded/index.js +2 -2
- package/dist/src/agent/embedded/run-for-session.js +4 -4
- package/dist/src/agent/embedded/run-turn.js +2 -2
- package/dist/src/agent/embedded/session-tool-result-guard.js +3 -3
- package/dist/src/agent/external-tools/composio-provider.js +1 -1
- package/dist/src/agent/external-tools/gateway-tools.js +1 -1
- package/dist/src/agent/external-tools/mcp-provider.js +2 -2
- package/dist/src/agent/image/generation/openai-images-provider.js +1 -1
- package/dist/src/agent/image/generation/providers/dashscope.js +1 -1
- package/dist/src/agent/image/generation/providers/fal.js +1 -1
- package/dist/src/agent/image/generation/providers/google.js +1 -1
- package/dist/src/agent/image/generation/runtime.js +1 -1
- package/dist/src/agent/image/index.js +1 -1
- package/dist/src/agent/image/load-image-media.js +1 -1
- package/dist/src/agent/inbound/attachment-pipeline.js +1 -1
- package/dist/src/agent/inbound/inbound-loop.js +2 -2
- package/dist/src/agent/index.js +1 -1
- package/dist/src/agent/mcp/bundle-mcp-gateway.js +1 -1
- package/dist/src/agent/mcp/bundle-mcp-runtime.js +2 -2
- package/dist/src/agent/mcp/index.js +2 -2
- package/dist/src/agent/mcp/mcp-transport.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-manager.js +1 -1
- package/dist/src/agent/memory/index.js +2 -2
- package/dist/src/agent/messaging/outbound-coordinator.js +1 -1
- package/dist/src/agent/orchestration/agent-orchestrator.js +5 -5
- package/dist/src/agent/prompt/service-prompt-builder.js +2 -2
- package/dist/src/agent/sandbox/exec-policy.js +1 -1
- package/dist/src/agent/service/direct-turn-helpers.js +6 -6
- package/dist/src/agent/service/process-direct-one-shot.js +1 -1
- package/dist/src/agent/service/process-direct-streaming.js +5 -5
- package/dist/src/agent/service/webchat-tts.js +2 -2
- package/dist/src/agent/service.js +18 -18
- package/dist/src/agent/skills/filesystem-watcher.js +1 -1
- package/dist/src/agent/skills/hub-pull.js +3 -3
- package/dist/src/agent/skills/marketplace/adapters/store/adapter.js +1 -1
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.js +1 -1
- package/dist/src/agent/source-context/task-context.d.ts +3 -0
- package/dist/src/agent/source-context/task-context.js +24 -0
- package/dist/src/agent/source-context/types.d.ts +2 -2
- package/dist/src/agent/source-context/types.js +1 -1
- package/dist/src/agent/tasks/task-judge-service.js +2 -2
- package/dist/src/agent/tool-manuals/xopc-use.d.ts +1 -1
- package/dist/src/agent/tool-manuals/xopc-use.js +1 -0
- package/dist/src/agent/tools/create-share-tool.js +3 -3
- package/dist/src/agent/tools/delegate-tool.js +3 -3
- package/dist/src/agent/tools/executor.js +1 -1
- package/dist/src/agent/tools/factory.js +13 -13
- package/dist/src/agent/tools/image-generate-tool.js +3 -3
- package/dist/src/agent/tools/index.js +5 -5
- package/dist/src/agent/tools/list-dir.js +1 -1
- package/dist/src/agent/tools/publish-artifacts.js +2 -2
- package/dist/src/agent/tools/read.js +1 -1
- package/dist/src/agent/tools/review-workspace.js +1 -1
- package/dist/src/agent/tools/send-media.js +2 -2
- package/dist/src/agent/tools/skills-tools.js +1 -1
- package/dist/src/agent/tools/tts-tool.js +1 -1
- package/dist/src/agent/tools/user-context-tool.js +1 -1
- package/dist/src/agent/tools/write.js +2 -2
- package/dist/src/agent/tools/xopc-use-tool.js +4 -4
- package/dist/src/agent/workflow/subagent-runner.js +1 -1
- package/dist/src/capabilities/store-connector.js +1 -1
- package/dist/src/channels/attachments/voice-stt-webchat.js +2 -2
- package/dist/src/channels/index.js +2 -2
- package/dist/src/channels/outbound-sender.js +1 -1
- package/dist/src/channels/pairing/allow-from-file.js +9 -9
- package/dist/src/channels/pairing/pairing-store.js +6 -6
- package/dist/src/chat-commands/builtins/config.js +2 -2
- package/dist/src/chat-commands/builtins/review.js +1 -1
- package/dist/src/chat-commands/builtins/session.js +1 -1
- package/dist/src/chat-commands/builtins/thinking.js +1 -1
- package/dist/src/chat-commands/builtins/tts.js +1 -1
- package/dist/src/chat-commands/builtins/understanding.js +1 -1
- package/dist/src/chat-commands/builtins/workflow.js +2 -2
- package/dist/src/chat-commands/context.js +2 -2
- package/dist/src/chat-commands/index.js +3 -3
- package/dist/src/cli/commands/agent.js +6 -6
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/config.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/extension-dev.js +1 -1
- package/dist/src/cli/commands/extension.js +1 -1
- package/dist/src/cli/commands/gateway/shared.js +1 -1
- package/dist/src/cli/commands/gateway/token.js +1 -1
- package/dist/src/cli/commands/image.js +1 -1
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/commands/onboard.js +1 -1
- package/dist/src/cli/commands/project.js +2 -2
- package/dist/src/cli/commands/runtime.js +1 -1
- package/dist/src/cli/commands/skills.js +2 -2
- package/dist/src/cli/commands/tui.js +1 -1
- package/dist/src/cli/commands/tunnel.js +3 -3
- package/dist/src/cli/extension-cli-register.js +4 -4
- package/dist/src/cli/utils/gateway-client.js +1 -1
- package/dist/src/config/index.js +2 -2
- package/dist/src/connectors/connected-source-understanding.js +2 -2
- package/dist/src/connectors/connection-recovery-service.js +3 -3
- package/dist/src/discussions/action-tasks.d.ts +21 -0
- package/dist/src/discussions/action-tasks.js +93 -0
- package/dist/src/discussions/analyzer.d.ts +21 -1
- package/dist/src/discussions/analyzer.js +229 -62
- package/dist/src/discussions/audio-repair.d.ts +8 -0
- package/dist/src/discussions/audio-repair.js +41 -0
- package/dist/src/discussions/edits.d.ts +22 -0
- package/dist/src/discussions/edits.js +81 -0
- package/dist/src/discussions/errors.d.ts +4 -0
- package/dist/src/discussions/errors.js +10 -0
- package/dist/src/discussions/export.d.ts +2 -0
- package/dist/src/discussions/export.js +23 -0
- package/dist/src/discussions/index.js +3 -2
- package/dist/src/discussions/live-worker.js +2 -2
- package/dist/src/discussions/organizer-worker.js +14 -5
- package/dist/src/discussions/organizer.d.ts +1 -1
- package/dist/src/discussions/organizer.js +60 -24
- package/dist/src/discussions/reconcile.d.ts +22 -0
- package/dist/src/discussions/reconcile.js +55 -0
- package/dist/src/discussions/recording.d.ts +9 -0
- package/dist/src/discussions/recording.js +219 -0
- package/dist/src/discussions/recordingJobs.d.ts +14 -0
- package/dist/src/discussions/recordingJobs.js +69 -0
- package/dist/src/discussions/repository.d.ts +4 -2
- package/dist/src/discussions/repository.js +15 -10
- package/dist/src/discussions/revisions.d.ts +12 -0
- package/dist/src/discussions/revisions.js +36 -0
- package/dist/src/discussions/sealer.d.ts +1 -0
- package/dist/src/discussions/sealer.js +62 -12
- package/dist/src/discussions/service.d.ts +16 -15
- package/dist/src/discussions/service.js +177 -91
- package/dist/src/discussions/types.d.ts +4 -139
- package/dist/src/discussions/types.js +1 -11
- package/dist/src/extensions/api.js +3 -3
- package/dist/src/extensions/bundled-extension-activation.js +1 -1
- package/dist/src/extensions/index.js +1 -1
- package/dist/src/extensions/loader.js +1 -1
- package/dist/src/extensions/sdk/index.js +1 -1
- package/dist/src/files/file-service.d.ts +1 -0
- package/dist/src/files/file-service.js +77 -0
- package/dist/src/gateway/agents-admin.js +3 -3
- package/dist/src/gateway/chat-stream/mapper.js +2 -2
- package/dist/src/gateway/device-routes.js +2 -2
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/heartbeat/service.js +1 -1
- package/dist/src/gateway/hono/app.js +6 -5
- package/dist/src/gateway/hono/lib/config-payload.js +2 -2
- package/dist/src/gateway/hono/lib/static-ui.js +1 -0
- package/dist/src/gateway/hono/routes/agents.js +1 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
- package/dist/src/gateway/hono/routes/browser.js +1 -1
- package/dist/src/gateway/hono/routes/commands-skills.js +3 -3
- package/dist/src/gateway/hono/routes/config-patch/gateway.js +1 -1
- package/dist/src/gateway/hono/routes/context-sources.js +1 -2
- package/dist/src/gateway/hono/routes/discussions.js +126 -19
- package/dist/src/gateway/hono/routes/files.js +1 -22
- package/dist/src/gateway/hono/routes/index.js +0 -2
- package/dist/src/gateway/hono/routes/lazy-bundles.js +16 -0
- package/dist/src/gateway/hono/routes/mcp.js +2 -2
- package/dist/src/gateway/hono/routes/media.js +1 -1
- package/dist/src/gateway/hono/routes/models.js +4 -4
- package/dist/src/gateway/hono/routes/notes.js +1 -1
- package/dist/src/gateway/hono/routes/proactive-control.js +4 -38
- package/dist/src/gateway/hono/routes/project-understanding.d.ts +3 -0
- package/dist/src/gateway/hono/routes/project-understanding.js +65 -0
- package/dist/src/gateway/hono/routes/projects.js +22 -6
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +2 -2
- package/dist/src/gateway/hono/routes/session-input-handler.js +2 -2
- package/dist/src/gateway/hono/routes/sessions.js +1 -1
- package/dist/src/gateway/hono/routes/shares.js +3 -3
- package/dist/src/gateway/hono/routes/site-shares.js +1 -1
- package/dist/src/gateway/hono/routes/status.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +4 -3
- package/dist/src/gateway/hono/routes/user-model.js +4 -4
- package/dist/src/gateway/hono/routes/voice.js +3 -3
- package/dist/src/gateway/hono/routes/work-discovery.d.ts +0 -2
- package/dist/src/gateway/hono/routes/work-discovery.js +2 -16
- package/dist/src/gateway/hono/routes/workflows.js +4 -4
- package/dist/src/gateway/image-generation-setup.js +1 -1
- package/dist/src/gateway/lock.js +10 -10
- package/dist/src/gateway/media-access.js +2 -2
- package/dist/src/gateway/ports.js +6 -6
- package/dist/src/gateway/security/gateway-scopes.js +1 -2
- package/dist/src/gateway/server.js +1 -1
- package/dist/src/gateway/service/agent-runner.js +2 -2
- package/dist/src/gateway/service/config-coordinator.js +3 -3
- package/dist/src/gateway/service/marketplace-service.js +3 -3
- package/dist/src/gateway/service/run-gateway-agent.js +3 -3
- package/dist/src/gateway/service.d.ts +3 -0
- package/dist/src/gateway/service.js +42 -27
- package/dist/src/gateway/session-context-summary.js +2 -2
- package/dist/src/gateway/workspace-editor-path.js +2 -2
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/infra/gateway-processes.js +2 -2
- package/dist/src/infra/path-env.js +3 -3
- package/dist/src/infra/update-global.js +10 -10
- package/dist/src/knowledge-memory/repository.d.ts +2 -0
- package/dist/src/knowledge-memory/repository.js +3 -1
- package/dist/src/local-apps/service.js +1 -1
- package/dist/src/media-shared/http/ssrf-guard.js +1 -1
- package/dist/src/media-understanding/audio-transcription-runner.d.ts +1 -0
- package/dist/src/media-understanding/audio-transcription-runner.js +1 -0
- package/dist/src/media-understanding/runner.js +1 -0
- package/dist/src/media-understanding/types.d.ts +8 -0
- package/dist/src/notes/agent-context.js +3 -3
- package/dist/src/notes/service.d.ts +3 -1
- package/dist/src/notes/store.d.ts +3 -1
- package/dist/src/notes/store.js +5 -3
- package/dist/src/proactive/actions/service.js +1 -1
- package/dist/src/proactive/execution/agent-executor.js +1 -1
- package/dist/src/proactive/execution/context.js +1 -1
- package/dist/src/proactive/execution/worker.js +1 -1
- package/dist/src/proactive/experience.d.ts +38 -21
- package/dist/src/proactive/experience.js +109 -13
- package/dist/src/proactive/follow-ups.js +1 -1
- package/dist/src/proactive/inbox/cards.js +9 -3
- package/dist/src/proactive/inbox/delivery.js +2 -2
- package/dist/src/proactive/inbox/digest.js +2 -2
- package/dist/src/proactive/inbox/notification-policy.js +1 -1
- package/dist/src/proactive/inbox/repository.js +1 -1
- package/dist/src/proactive/inbox/service.js +1 -1
- package/dist/src/proactive/index.js +1 -1
- package/dist/src/proactive/maintenance.js +0 -1
- package/dist/src/proactive/scenarios/control.d.ts +0 -35
- package/dist/src/proactive/scenarios/control.js +7 -53
- package/dist/src/proactive/temporal/worker.js +1 -1
- package/dist/src/projects/project-skill-service.js +2 -2
- package/dist/src/projects/project-store.js +6 -4
- package/dist/src/providers/model-reference-auditor.js +1 -1
- package/dist/src/remote-access/exposure-manager.js +1 -1
- package/dist/src/session/client-history.d.ts +1 -1
- package/dist/src/session/client-history.js +1 -1
- package/dist/src/session/index.js +2 -2
- package/dist/src/session/session-title.js +1 -1
- package/dist/src/session/store.js +3 -3
- package/dist/src/session/thinking-resolve.js +1 -1
- package/dist/src/share/share-store.js +1 -1
- package/dist/src/share/share-thumbnail.js +1 -1
- package/dist/src/share/site-share-store.js +1 -1
- package/dist/src/storage/sqlite/connection.js +9 -9
- package/dist/src/storage/sqlite/migrations/166_remove_proactive_previews.sql +1 -0
- package/dist/src/storage/sqlite/migrations/167_discussion_recording_chunks.sql +7 -0
- package/dist/src/storage/sqlite/migrations/168_discussion_evidence.sql +16 -0
- package/dist/src/storage/sqlite/migrations/169_discussion_action_tasks.sql +8 -0
- package/dist/src/storage/sqlite/migrations/170_discussion_edits.sql +8 -0
- package/dist/src/storage/sqlite/migrations/171_discussion_recording_jobs.sql +14 -0
- package/dist/src/storage/sqlite/migrations/172_project_understanding.sql +3 -0
- package/dist/src/storage/sqlite/migrations/173_mobile_discussion_source.sql +5 -0
- package/dist/src/storage/sqlite/migrations/__tests__/mobile-discussion-source.test.ts +20 -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/migrations/runner.ts +1 -1
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/tasks/execution-context.js +1 -1
- package/dist/src/tasks/home-query-service.js +1 -1
- package/dist/src/tasks/index.js +3 -3
- package/dist/src/tasks/task-application-service.js +1 -1
- package/dist/src/tasks/task-context-assembler.js +1 -1
- package/dist/src/tasks/task-handoff-service.js +1 -1
- package/dist/src/tasks/task-repository.d.ts +1 -0
- package/dist/src/tasks/task-repository.js +4 -0
- package/dist/src/tasks/task-run-coordinator.js +1 -1
- package/dist/src/tui/backends/embedded-backend.js +9 -9
- package/dist/src/tui/backends/gateway-realtime-backend.js +2 -2
- package/dist/src/tui/extension-host/load-extensions.js +1 -1
- package/dist/src/tui/tui-command-formatters.js +1 -1
- package/dist/src/tui/tui-commands.js +5 -5
- package/dist/src/tui/tui-picker-overlay.js +1 -1
- package/dist/src/tui/tui-skills-autocomplete.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +4 -4
- package/dist/src/tui/tui.js +2 -2
- package/dist/src/tunnel/gateway-lifecycle.js +1 -1
- package/dist/src/voice/audio/normalize.js +28 -5
- package/dist/src/voice/local/runtime-worker.js +1 -1
- package/dist/src/voice/realtime/memory-context.js +3 -3
- package/dist/src/voice/stt/index.js +2 -2
- package/dist/src/voice/stt/preflight.js +1 -1
- package/dist/src/voice/stt/providers/local-transcription.js +1 -1
- package/dist/src/voice/stt/transcribe-core.js +2 -1
- package/dist/src/voice/stt/types.d.ts +1 -0
- package/dist/src/voice/tts/index.js +3 -3
- package/dist/src/voice/tts/merge-config.js +1 -1
- package/dist/src/voice/tts/payload.js +1 -1
- package/dist/src/voice/tts/speak-core.js +1 -1
- package/dist/src/work-discovery/analyzer.d.ts +1 -0
- package/dist/src/work-discovery/analyzer.js +28 -22
- package/dist/src/work-discovery/index.js +3 -3
- package/dist/src/work-discovery/investigator.js +1 -1
- package/dist/src/work-discovery/project-understanding.d.ts +7 -0
- package/dist/src/work-discovery/project-understanding.js +38 -0
- package/dist/src/work-discovery/repository.d.ts +3 -1
- package/dist/src/work-discovery/repository.js +18 -5
- package/dist/src/work-discovery/service.d.ts +8 -0
- package/dist/src/work-discovery/service.js +164 -16
- package/dist/src/work-discovery/types.d.ts +2 -0
- package/dist/src/workflows/context/workflow-context.js +1 -1
- package/dist/src/workflows/service/workflow-run-service.js +4 -4
- package/dist/src/workflows/service/workflow-session-bridge.js +1 -1
- package/package.json +3 -3
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-DAqn5DdL.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-Bh0etSmL.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-w4McwueN.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-DxX-t0EJ.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CvacBQAI.js +0 -8
- package/dist/gateway/static/root/assets/channels-settings-CJzSNo-L.js +0 -1
- package/dist/gateway/static/root/assets/config-reload-event-Bjh2zoKp.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-DNBhBT0b.js +0 -2
- package/dist/gateway/static/root/assets/device-pairing-wizard-DsR5NQEC.js +0 -1
- package/dist/gateway/static/root/assets/gateway-config-swr-cd8owslz.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-Dil7vuyU.js +0 -1
- package/dist/gateway/static/root/assets/home-page-Dpeuvazg.js +0 -1
- package/dist/gateway/static/root/assets/index-B03HGpzt.js +0 -74
- package/dist/gateway/static/root/assets/index-CXF9-BpI.css +0 -2
- package/dist/gateway/static/root/assets/local-app-workbench-page-CBtemxFc.js +0 -2
- package/dist/gateway/static/root/assets/messages-BGc-OJWg.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-GOxomxOK.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-CQBgk3_x.js +0 -8
- package/dist/gateway/static/root/assets/proactive-card-BF3741px.js +0 -1
- package/dist/gateway/static/root/assets/proactive-page-1EM217v0.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-B1Pm-fQd.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-DUrxyNR9.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-C6VzHUwx.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-DtemHfkv.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-ByEVQe0c.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-BwIrk3Jx.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-Dwdv6QyS.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-CDzQWN60.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-CO5XVkbY.js +0 -2
- package/dist/gateway/static/root/assets/task-detail-page-DOjcKOzQ.js +0 -1
- package/dist/gateway/static/root/assets/tunnel-api-BABuQvGD.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-UhsSP_pC.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-S7XXNBWa.js +0 -6
- package/dist/src/proactive/scenarios/preview.d.ts +0 -13
- package/dist/src/proactive/scenarios/preview.js +0 -81
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import { getSqliteDatabase } from "../../../storage/sqlite/transaction.js";
|
|
2
1
|
import { ProactiveConflict, proactivePreferences, updateProactivePreferences } from "../../../proactive/policy/service.js";
|
|
3
|
-
import {
|
|
4
|
-
import { controlledSubscriptions, createControlledSubscription, requireSubscription, templateCatalog, updateControlledSubscription } from "../../../proactive/scenarios/control.js";
|
|
5
|
-
import { cardChanges, getCard, listCards, performCardAction } from "../../../proactive/inbox/cards.js";
|
|
6
|
-
import { digestCards } from "../../../proactive/inbox/digest.js";
|
|
2
|
+
import { updateControlledSubscription } from "../../../proactive/scenarios/control.js";
|
|
7
3
|
import { listMailFollowUps, mailFollowUpSources, startMailFollowUp, updateMailFollowUp } from "../../../proactive/follow-ups.js";
|
|
4
|
+
import { cardChanges, getCard, performCardAction } from "../../../proactive/inbox/cards.js";
|
|
8
5
|
import { checkDelegation, delegationOverview, startDelegation } from "../../../proactive/experience.js";
|
|
6
|
+
import { recordProactivePresence } from "../../../proactive/policy/presence.js";
|
|
7
|
+
import { digestCards } from "../../../proactive/inbox/digest.js";
|
|
9
8
|
import { acknowledgeBrowserProbe, listBrowserProbes, prepareBrowserPush, registerBrowserPush, testBrowserPush, unregisterBrowserPush } from "../../../notifications/web-push.js";
|
|
10
|
-
import { ReadonlyProactiveAgentExecutor } from "../../../proactive/execution/agent-executor.js";
|
|
11
9
|
import { proactiveMetrics } from "../../../proactive/metrics.js";
|
|
12
|
-
import { previewSubscription } from "../../../proactive/scenarios/preview.js";
|
|
13
10
|
import { ZodError } from "zod";
|
|
14
11
|
//#region src/gateway/hono/routes/proactive-control.ts
|
|
15
12
|
function registerProactiveControlRoutes(app, deps) {
|
|
@@ -94,14 +91,6 @@ function registerProactiveControlRoutes(app, deps) {
|
|
|
94
91
|
ok: true,
|
|
95
92
|
cards: digestCards(c.req.param("id"), workspace())
|
|
96
93
|
}));
|
|
97
|
-
app.post("/api/proactive/subscriptions/:id/preview", deps.strictRateLimitMiddleware, async (c) => c.json({
|
|
98
|
-
ok: true,
|
|
99
|
-
...await previewSubscription(workspace(), c.req.param("id"), new ReadonlyProactiveAgentExecutor(() => deps.service.getConfig()), c.req.raw.signal)
|
|
100
|
-
}));
|
|
101
|
-
app.get("/api/proactive/templates", (c) => c.json({
|
|
102
|
-
ok: true,
|
|
103
|
-
templates: templateCatalog(workspace())
|
|
104
|
-
}));
|
|
105
94
|
app.get("/api/proactive/preferences", (c) => c.json({
|
|
106
95
|
ok: true,
|
|
107
96
|
preferences: proactivePreferences(workspace())
|
|
@@ -110,33 +99,10 @@ function registerProactiveControlRoutes(app, deps) {
|
|
|
110
99
|
ok: true,
|
|
111
100
|
preferences: updateProactivePreferences(workspace(), await c.req.json())
|
|
112
101
|
}));
|
|
113
|
-
app.get("/api/proactive/subscriptions", (c) => c.json({
|
|
114
|
-
ok: true,
|
|
115
|
-
subscriptions: controlledSubscriptions(workspace())
|
|
116
|
-
}));
|
|
117
|
-
app.post("/api/proactive/subscriptions", deps.strictRateLimitMiddleware, async (c) => c.json({
|
|
118
|
-
ok: true,
|
|
119
|
-
subscription: createControlledSubscription(workspace(), await c.req.json())
|
|
120
|
-
}, 201));
|
|
121
102
|
app.patch("/api/proactive/subscriptions/:id", deps.strictRateLimitMiddleware, async (c) => c.json({
|
|
122
103
|
ok: true,
|
|
123
104
|
subscription: updateControlledSubscription(workspace(), c.req.param("id"), await c.req.json())
|
|
124
105
|
}));
|
|
125
|
-
app.get("/api/proactive/subscriptions/:id/runs", (c) => {
|
|
126
|
-
requireSubscription(c.req.param("id"), workspace());
|
|
127
|
-
return c.json({
|
|
128
|
-
ok: true,
|
|
129
|
-
runs: getSqliteDatabase().prepare(`SELECT run_id AS id, status, outcome_reason AS reason,
|
|
130
|
-
started_at AS startedAt, completed_at AS completedAt, error_message AS error, attempt, next_attempt_at AS nextAttemptAt FROM proactive_runs WHERE subscription_id = ? ORDER BY started_at DESC LIMIT 30`).all(c.req.param("id"))
|
|
131
|
-
});
|
|
132
|
-
});
|
|
133
|
-
app.get("/api/proactive/cards", (c) => c.json({
|
|
134
|
-
ok: true,
|
|
135
|
-
...listCards(workspace(), {
|
|
136
|
-
status: c.req.query("status"),
|
|
137
|
-
before: c.req.query("before")
|
|
138
|
-
})
|
|
139
|
-
}));
|
|
140
106
|
app.get("/api/inbox/judgments/changes", (c) => {
|
|
141
107
|
const cursor = Number(c.req.query("cursor") ?? 0);
|
|
142
108
|
if (!Number.isSafeInteger(cursor) || cursor < 0) return c.json({
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { getProjectUnderstandingRun } from "../../../work-discovery/repository.js";
|
|
2
|
+
import { getProjectUnderstandingOverview, saveProjectUnderstandingOverview } from "../../../work-discovery/project-understanding.js";
|
|
3
|
+
//#region src/gateway/hono/routes/project-understanding.ts
|
|
4
|
+
function registerProjectUnderstandingRoutes(authenticated, deps) {
|
|
5
|
+
const { service } = deps;
|
|
6
|
+
authenticated.get("/api/projects/:id/understanding", (c) => {
|
|
7
|
+
const projectId = c.req.param("id");
|
|
8
|
+
if (!service.projects.get(projectId)) return c.json({
|
|
9
|
+
ok: false,
|
|
10
|
+
error: "Project not found"
|
|
11
|
+
}, 404);
|
|
12
|
+
const run = getProjectUnderstandingRun(projectId);
|
|
13
|
+
const overview = getProjectUnderstandingOverview(projectId);
|
|
14
|
+
return c.json({
|
|
15
|
+
ok: true,
|
|
16
|
+
status: run?.status ?? "not_started",
|
|
17
|
+
overview: overview?.content ?? null,
|
|
18
|
+
updatedAt: overview?.updatedAt ?? null
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
authenticated.post("/api/projects/:id/understanding", (c) => {
|
|
22
|
+
const projectId = c.req.param("id");
|
|
23
|
+
if (!service.projects.get(projectId)) return c.json({
|
|
24
|
+
ok: false,
|
|
25
|
+
error: "Project not found"
|
|
26
|
+
}, 404);
|
|
27
|
+
try {
|
|
28
|
+
const run = deps.service.workDiscovery.startProjectUnderstanding(projectId);
|
|
29
|
+
return c.json({
|
|
30
|
+
ok: true,
|
|
31
|
+
status: run.status
|
|
32
|
+
}, 202);
|
|
33
|
+
} catch (error) {
|
|
34
|
+
return c.json({
|
|
35
|
+
ok: false,
|
|
36
|
+
error: error instanceof Error ? error.message : String(error)
|
|
37
|
+
}, 400);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
authenticated.patch("/api/projects/:id/understanding", async (c) => {
|
|
41
|
+
const projectId = c.req.param("id");
|
|
42
|
+
if (!service.projects.get(projectId)) return c.json({
|
|
43
|
+
ok: false,
|
|
44
|
+
error: "Project not found"
|
|
45
|
+
}, 404);
|
|
46
|
+
const body = await c.req.json().catch(() => ({}));
|
|
47
|
+
const content = body && typeof body.content === "string" ? body.content.trim() : void 0;
|
|
48
|
+
if (!content || content.length > 6e3) return c.json({
|
|
49
|
+
ok: false,
|
|
50
|
+
error: "Overview must contain 1–6000 characters"
|
|
51
|
+
}, 400);
|
|
52
|
+
const overview = saveProjectUnderstandingOverview({
|
|
53
|
+
projectId,
|
|
54
|
+
content,
|
|
55
|
+
correctedByUser: true
|
|
56
|
+
});
|
|
57
|
+
return c.json({
|
|
58
|
+
ok: true,
|
|
59
|
+
overview: overview.content,
|
|
60
|
+
updatedAt: overview.updatedAt
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
export { registerProjectUnderstandingRoutes };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { createLogger } from "../../../utils/logger/index.js";
|
|
2
|
+
import { init_logger } from "../../../utils/logger.js";
|
|
1
3
|
import { getSqliteDatabase } from "../../../storage/sqlite/transaction.js";
|
|
2
4
|
import { getSessionMetadata } from "../../../storage/sqlite/session-repository.js";
|
|
3
5
|
import { loadTranscriptRowsForSession } from "../../../storage/sqlite/transcript-repository.js";
|
|
@@ -5,6 +7,8 @@ import "../../../storage/sqlite/index.js";
|
|
|
5
7
|
import { ActivityService } from "../../../activity/service.js";
|
|
6
8
|
import "../../../activity/index.js";
|
|
7
9
|
import { resolveEffectiveAgentProfile } from "../../../config/agent-profile.js";
|
|
10
|
+
import { TaskRepository } from "../../../tasks/task-repository.js";
|
|
11
|
+
import { TaskReadModelProjector } from "../../../tasks/task-read-model-projector.js";
|
|
8
12
|
import { ExecutionEnvironmentStore } from "../../../execution-environments/store.js";
|
|
9
13
|
import { listKnowledgeItems, writeKnowledgeItem } from "../../../knowledge-memory/repository.js";
|
|
10
14
|
import "../../../knowledge-memory/index.js";
|
|
@@ -14,15 +18,16 @@ import { isValidProjectAgentId, normalizeProjectAgentId, resolveProjectAgentId }
|
|
|
14
18
|
import { inferSuggestedProjectDefaultAgentId } from "../../../projects/project-agent-suggestion.js";
|
|
15
19
|
import { buildProjectLoopOverview } from "../../../projects/project-loop.js";
|
|
16
20
|
import "../../../projects/index.js";
|
|
17
|
-
import { TaskRepository } from "../../../tasks/task-repository.js";
|
|
18
|
-
import { TaskReadModelProjector } from "../../../tasks/task-read-model-projector.js";
|
|
19
21
|
import { TaskApplicationService } from "../../../tasks/task-application-service.js";
|
|
20
22
|
import { defineTaskContract } from "../../../tasks/task-contract-definition.js";
|
|
21
23
|
import { ProjectOperatingViewService, summarizeProjectOperatingView } from "../../../tasks/project-operating-view-service.js";
|
|
22
24
|
import "../../../tasks/index.js";
|
|
25
|
+
import { getProjectUnderstandingRun } from "../../../work-discovery/repository.js";
|
|
23
26
|
import { parseActivityIncludeRelated, parseActivityQuery } from "./activity.js";
|
|
24
27
|
import { randomUUID } from "node:crypto";
|
|
25
28
|
//#region src/gateway/hono/routes/projects.ts
|
|
29
|
+
init_logger();
|
|
30
|
+
const log = createLogger("Projects");
|
|
26
31
|
function parseProjectStatus(raw) {
|
|
27
32
|
return raw === "planned" || raw === "active" || raw === "paused" || raw === "completed" || raw === "cancelled" || raw === "archived" ? raw : void 0;
|
|
28
33
|
}
|
|
@@ -34,9 +39,6 @@ function parseLimit(raw, fallback = 50) {
|
|
|
34
39
|
const n = Number.parseInt(raw, 10);
|
|
35
40
|
return Number.isFinite(n) ? Math.min(500, Math.max(1, n)) : fallback;
|
|
36
41
|
}
|
|
37
|
-
function isHiddenEmptyProjectChatShell(session) {
|
|
38
|
-
return session.hiddenFromSessionList === true && session.messageCount === 0 && (session.customData?.origin === "automation" || session.customData?.genericNewChatShell !== false && Boolean(session.routing?.peerId?.startsWith("chat_")));
|
|
39
|
-
}
|
|
40
42
|
function textField(body, key) {
|
|
41
43
|
const value = body[key];
|
|
42
44
|
return typeof value === "string" ? value : void 0;
|
|
@@ -151,6 +153,10 @@ function registerProjectsRoutes(authenticated, deps) {
|
|
|
151
153
|
const body = await c.req.json().catch(() => ({}));
|
|
152
154
|
const name = textField(body, "name")?.trim();
|
|
153
155
|
const workspaceRoot = textField(body, "workspaceRoot")?.trim();
|
|
156
|
+
if (body.autoUnderstand !== void 0 && typeof body.autoUnderstand !== "boolean") return c.json({
|
|
157
|
+
ok: false,
|
|
158
|
+
error: "autoUnderstand must be a boolean"
|
|
159
|
+
}, 400);
|
|
154
160
|
if (!name && !workspaceRoot) return c.json({
|
|
155
161
|
ok: false,
|
|
156
162
|
error: "Missing name"
|
|
@@ -192,6 +198,14 @@ function registerProjectsRoutes(authenticated, deps) {
|
|
|
192
198
|
ownerId: textField(body, "ownerId"),
|
|
193
199
|
targetAt: optionalNumberField(body, "targetAt") ?? void 0
|
|
194
200
|
});
|
|
201
|
+
if (body.autoUnderstand === true) try {
|
|
202
|
+
deps.service.workDiscovery.startProjectUnderstanding(project.id);
|
|
203
|
+
} catch (err) {
|
|
204
|
+
log.warn({
|
|
205
|
+
err,
|
|
206
|
+
projectId: project.id
|
|
207
|
+
}, "Project created but understanding could not be queued");
|
|
208
|
+
}
|
|
195
209
|
return c.json({
|
|
196
210
|
ok: true,
|
|
197
211
|
project: enrichProjectWorkspace(service, project)
|
|
@@ -691,6 +705,8 @@ function registerProjectsRoutes(authenticated, deps) {
|
|
|
691
705
|
code: "execution_environments_exist",
|
|
692
706
|
error: "Delete the project execution environments before deleting the project"
|
|
693
707
|
}, 409);
|
|
708
|
+
const understandingRun = getProjectUnderstandingRun(projectId);
|
|
709
|
+
if (understandingRun) deps.service.workDiscovery.cancelRun(understandingRun.id);
|
|
694
710
|
service.projects.delete(projectId);
|
|
695
711
|
return c.json({ ok: true });
|
|
696
712
|
});
|
|
@@ -700,7 +716,7 @@ function registerProjectsRoutes(authenticated, deps) {
|
|
|
700
716
|
const sessions = await Promise.all(keys.map((key) => service.sessions.getSession(key)));
|
|
701
717
|
return c.json({
|
|
702
718
|
ok: true,
|
|
703
|
-
sessions: sessions.filter((session) => session && !
|
|
719
|
+
sessions: sessions.filter((session) => session && !session.hiddenFromSessionList)
|
|
704
720
|
});
|
|
705
721
|
} catch (error) {
|
|
706
722
|
return c.json({
|
|
@@ -74,7 +74,7 @@ export declare function submitSessionInput(c: Context, deps: AuthenticatedRouteD
|
|
|
74
74
|
documentId?: string;
|
|
75
75
|
}[];
|
|
76
76
|
contextSnapshots?: {
|
|
77
|
-
kind: import("../../../agent/source-context/types.js").SessionSourceBinding["kind"] | "browser_page";
|
|
77
|
+
kind: import("../../../agent/source-context/types.js").SessionSourceBinding["kind"] | "task" | "browser_page";
|
|
78
78
|
sourceId: string;
|
|
79
79
|
version: string;
|
|
80
80
|
title: string;
|
|
@@ -180,7 +180,7 @@ export declare function replaceLatestSessionTurn(c: Context, deps: Authenticated
|
|
|
180
180
|
documentId?: string;
|
|
181
181
|
}[];
|
|
182
182
|
contextSnapshots?: {
|
|
183
|
-
kind: import("../../../agent/source-context/types.js").SessionSourceBinding["kind"] | "browser_page";
|
|
183
|
+
kind: import("../../../agent/source-context/types.js").SessionSourceBinding["kind"] | "task" | "browser_page";
|
|
184
184
|
sourceId: string;
|
|
185
185
|
version: string;
|
|
186
186
|
title: string;
|
|
@@ -24,7 +24,7 @@ async function submitSessionInput(c, deps, sessionKey) {
|
|
|
24
24
|
ok: false,
|
|
25
25
|
error: {
|
|
26
26
|
code: "BAD_REQUEST",
|
|
27
|
-
message: `contextRefs must contain at most ${MAX_TURN_CONTEXTS} valid
|
|
27
|
+
message: `contextRefs must contain at most ${MAX_TURN_CONTEXTS} valid note or task references`
|
|
28
28
|
}
|
|
29
29
|
}, 400);
|
|
30
30
|
const browserContexts = browserPageContextsInputSchema.safeParse(body.browserContexts ?? []);
|
|
@@ -170,7 +170,7 @@ async function replaceLatestSessionTurn(c, deps, sessionKey, targetTurnId) {
|
|
|
170
170
|
ok: false,
|
|
171
171
|
error: {
|
|
172
172
|
code: "BAD_REQUEST",
|
|
173
|
-
message: `contextRefs must contain at most ${MAX_TURN_CONTEXTS} valid
|
|
173
|
+
message: `contextRefs must contain at most ${MAX_TURN_CONTEXTS} valid note or task references`
|
|
174
174
|
}
|
|
175
175
|
}, 400);
|
|
176
176
|
const content = typeof body.content === "string" ? body.content : "";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { deleteBrowserTabBinding } from "../../../storage/sqlite/browser-tab-binding-repository.js";
|
|
2
2
|
import { SessionDiscoveryQuerySchema } from "../../../../packages/gateway-contract/src/session-identity.js";
|
|
3
3
|
import { buildSessionKey, init_session_key } from "../../../routing/session-key.js";
|
|
4
|
-
import { SessionEnvironmentService } from "../../../execution-environments/session-environment-service.js";
|
|
5
4
|
import { resolveProjectAgentId } from "../../../projects/project-agent.js";
|
|
6
5
|
import "../../../projects/index.js";
|
|
7
6
|
import { messagesToClientHistory } from "../../../session/client-history.js";
|
|
8
7
|
import { evictEmbeddedSessionRunner } from "../../../agent/embedded/session-runner.js";
|
|
8
|
+
import { SessionEnvironmentService } from "../../../execution-environments/session-environment-service.js";
|
|
9
9
|
import { deleteMediaUrisNoLongerReferenced } from "../../../media/session-references.js";
|
|
10
10
|
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
11
11
|
import { createGatewayRouteLogger, logRouteError } from "../lib/route-logger.js";
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { loadCompactionSourceSnapshot } from "../../../storage/sqlite/transcript-repository.js";
|
|
2
2
|
import "../../../storage/sqlite/index.js";
|
|
3
|
-
import { resolveGatewayEffectiveHost } from "../../../config/gateway-bind.js";
|
|
4
3
|
import { FileServiceError } from "../../../files/file-service.js";
|
|
5
|
-
import {
|
|
6
|
-
import { getGatewayFileSpaceService } from "../../file-space-service.js";
|
|
4
|
+
import { resolveGatewayEffectiveHost } from "../../../config/gateway-bind.js";
|
|
7
5
|
import { SHARE_CONFIG_DEFAULTS } from "../../../share/share-types.js";
|
|
8
6
|
import { resolveSiteShareConfig } from "../../../share/site-share-config.js";
|
|
9
7
|
import { logShareAudit } from "../../../share/share-audit.js";
|
|
@@ -14,8 +12,10 @@ import { SessionShareService, SessionShareSnapshotConflictError } from "../../..
|
|
|
14
12
|
import { HostedPublicationPublisher, HostedSessionShareBuilder, HostedShareAuthorizationError, HostedShareBindingStore, HostedShareRemoteError } from "../../../share/hosted-session-share.js";
|
|
15
13
|
import { HostedStaticSitePublicationBuilder } from "../../../share/hosted-static-site-publication.js";
|
|
16
14
|
import { publishHostedStaticSite } from "../../../share/hosted-static-site-publish.js";
|
|
15
|
+
import { resolveReverseProxyPublicUrl } from "../../public-url.js";
|
|
17
16
|
import { audienceDefaults, cleanupStagedSite, decideShareKind, forgetStagedSite, makeDescription, makeTitle, probeShareTarget, rememberStagedSite, stageSingleHtmlAsSite } from "../../../share/share-auto.js";
|
|
18
17
|
import { deleteThumbnail, placeholderSvg, readThumbnail, scheduleThumbnail, thumbnailContentType, thumbnailExists } from "../../../share/share-thumbnail.js";
|
|
18
|
+
import { getGatewayFileSpaceService } from "../../file-space-service.js";
|
|
19
19
|
import { getClientIpFromHeaders } from "../../security/loopback.js";
|
|
20
20
|
import { SHARED_HTML_CSP } from "../../security/csp.js";
|
|
21
21
|
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { resolveGatewayEffectiveHost } from "../../../config/gateway-bind.js";
|
|
2
|
-
import { resolveReverseProxyPublicUrl } from "../../public-url.js";
|
|
3
2
|
import { resolveSiteShareConfig } from "../../../share/site-share-config.js";
|
|
4
3
|
import { getSiteShareStore } from "../../../share/site-share-store.js";
|
|
5
4
|
import { resolveSiteShareUrl } from "../../../share/share-url.js";
|
|
5
|
+
import { resolveReverseProxyPublicUrl } from "../../public-url.js";
|
|
6
6
|
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
7
7
|
import { createHash } from "node:crypto";
|
|
8
8
|
//#region src/gateway/hono/routes/site-shares.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getDefaultModelSync, init_providers, resolveModel } from "../../../providers/index.js";
|
|
2
|
+
import { getGatewayAgentEffectiveConfig } from "../../agents-admin.js";
|
|
2
3
|
import { isSTTAvailable } from "../../../voice/stt/availability.js";
|
|
3
4
|
import { mergeSttConfigFromAppConfig } from "../../../voice/stt/config.js";
|
|
4
5
|
import "../../../voice/stt/index.js";
|
|
5
|
-
import { getGatewayAgentEffectiveConfig } from "../../agents-admin.js";
|
|
6
6
|
import { createHash } from "node:crypto";
|
|
7
7
|
//#region src/gateway/hono/routes/status.ts
|
|
8
8
|
init_providers();
|
|
@@ -4,14 +4,14 @@ import { TaskBoardPositionRequestSchema, TaskCommandRequestSchema, TaskContextIn
|
|
|
4
4
|
import { ProjectMonitoringUpdateSchema } from "../../../../packages/gateway-contract/src/project-monitoring.js";
|
|
5
5
|
import { enqueueTaskChangedEvent } from "../../../tasks/task-change-events.js";
|
|
6
6
|
import { TaskRunRepository } from "../../../tasks/task-run-repository.js";
|
|
7
|
-
import { resolveProjectAgentId } from "../../../projects/project-agent.js";
|
|
8
|
-
import { TaskContextRepository } from "../../../tasks/task-context-repository.js";
|
|
9
7
|
import { TaskRepository } from "../../../tasks/task-repository.js";
|
|
8
|
+
import { TaskConversationRepository } from "../../../tasks/task-conversation-repository.js";
|
|
10
9
|
import { TaskReadModelProjector } from "../../../tasks/task-read-model-projector.js";
|
|
10
|
+
import { resolveProjectAgentId } from "../../../projects/project-agent.js";
|
|
11
|
+
import { TaskContextRepository } from "../../../tasks/task-context-repository.js";
|
|
11
12
|
import { TaskDependencyError, TaskDependencyService } from "../../../tasks/task-dependency-service.js";
|
|
12
13
|
import { TaskApplicationService } from "../../../tasks/task-application-service.js";
|
|
13
14
|
import { ProjectMonitoringService } from "../../../tasks/project-monitoring-service.js";
|
|
14
|
-
import { TaskConversationRepository } from "../../../tasks/task-conversation-repository.js";
|
|
15
15
|
import { ProjectOperatingViewService } from "../../../tasks/project-operating-view-service.js";
|
|
16
16
|
import { TaskValueMetricsService } from "../../../tasks/task-value-metrics-service.js";
|
|
17
17
|
import { TaskHandoffService } from "../../../tasks/task-handoff-service.js";
|
|
@@ -49,6 +49,7 @@ function registerTaskRoutes(authenticated, deps) {
|
|
|
49
49
|
return c.json({
|
|
50
50
|
ok: true,
|
|
51
51
|
items: tasks.list({
|
|
52
|
+
search: c.req.query("search"),
|
|
52
53
|
...phase.success ? { phase: phase.data } : {},
|
|
53
54
|
limit
|
|
54
55
|
}).map((task) => {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { createCollaborationRule, getCollaborationRule, listCollaborationRules, setCollaborationRuleStatus } from "../../../storage/sqlite/collaboration-rule-repository.js";
|
|
2
|
+
import { getKnowledgeItem, listKnowledgeItems, searchKnowledgeItems, setKnowledgeStatus } from "../../../knowledge-memory/repository.js";
|
|
3
|
+
import "../../../knowledge-memory/index.js";
|
|
2
4
|
import { createPriorityWindow, createUserGoal, listPriorityWindows, listUserGoals, setUserGoalStatus } from "../../../user-model/goals.js";
|
|
3
5
|
import { getAssertionSlot, getUserAssertion, listUserAssertionSources, listUserAssertions, reconcileAssertion, setAssertionStatus } from "../../../user-model/repository.js";
|
|
4
6
|
import { applyUserProfilePatch, getUserProfileSnapshot } from "../../../user-model/profile.js";
|
|
5
7
|
import { bootstrapUserModel } from "../../../user-model/bootstrap.js";
|
|
6
8
|
import "../../../user-model/index.js";
|
|
7
|
-
import { getKnowledgeItem, listKnowledgeItems, searchKnowledgeItems, setKnowledgeStatus } from "../../../knowledge-memory/repository.js";
|
|
8
|
-
import "../../../knowledge-memory/index.js";
|
|
9
|
-
import { listUnderstandingSourceGrants } from "../../../user-context/sources/repository.js";
|
|
10
|
-
import { getExecutionContextAudit, recordExecutionContextFeedback } from "../../../agent/context/audit.js";
|
|
11
9
|
import { listMemoryMaintenanceRuns } from "../../../memory-maintenance/service.js";
|
|
12
10
|
import "../../../memory-maintenance/index.js";
|
|
11
|
+
import { getExecutionContextAudit, recordExecutionContextFeedback } from "../../../agent/context/audit.js";
|
|
12
|
+
import { listUnderstandingSourceGrants } from "../../../user-context/sources/repository.js";
|
|
13
13
|
import { userInfo } from "node:os";
|
|
14
14
|
//#region src/gateway/hono/routes/user-model.ts
|
|
15
15
|
function object(value) {
|
|
@@ -2,17 +2,17 @@ import { getDefaultModelSync, init_providers, resolveModel } from "../../../prov
|
|
|
2
2
|
import { completeWithResolvedCredentials } from "../../../providers/model-call.js";
|
|
3
3
|
import { resolveTtsProviderConfigSlice } from "../../../voice/tts/config-slice.js";
|
|
4
4
|
import { isTTSAvailable, resolveSpeechProvider } from "../../../voice/tts/factory.js";
|
|
5
|
-
import { mergeTtsConfigFromAppConfig } from "../../../voice/tts/merge-config.js";
|
|
6
5
|
import { speak, speakStream } from "../../../voice/tts/speak-core.js";
|
|
6
|
+
import { mergeTtsConfigFromAppConfig } from "../../../voice/tts/merge-config.js";
|
|
7
7
|
import { getLocalVoiceRuntimeClient } from "../../../voice/local/runtime-client.js";
|
|
8
8
|
import { getAudioDecoderStatus } from "../../../voice/audio/normalize.js";
|
|
9
9
|
import { resolveSttProviderConfigSlice } from "../../../voice/stt/config-slice.js";
|
|
10
|
-
import { isSTTAvailable } from "../../../voice/stt/availability.js";
|
|
11
|
-
import "../../../voice/tts/index.js";
|
|
12
10
|
import { STTTranscriptionError, transcribe } from "../../../voice/stt/transcribe-core.js";
|
|
11
|
+
import { isSTTAvailable } from "../../../voice/stt/availability.js";
|
|
13
12
|
import { mergeSttConfigFromAppConfig } from "../../../voice/stt/config.js";
|
|
14
13
|
import "../../../voice/stt/index.js";
|
|
15
14
|
import { listSttProvidersForApi } from "../../../voice/stt/list-providers.js";
|
|
15
|
+
import "../../../voice/tts/index.js";
|
|
16
16
|
import { withModelConfigLock } from "../../../session/model-config-lock.js";
|
|
17
17
|
import { createVoiceSessionRequestSchema } from "../../../../packages/realtime-protocol/src/voice.js";
|
|
18
18
|
import { resolveOmniRoute } from "../../../voice/realtime/omniRoute.js";
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import type { Hono } from 'hono';
|
|
2
|
-
import { WorkDiscoveryService } from '../../../work-discovery/service.js';
|
|
3
2
|
import type { AuthenticatedRouteDeps } from './deps.js';
|
|
4
|
-
export declare function getWorkDiscoveryService(deps: AuthenticatedRouteDeps): WorkDiscoveryService;
|
|
5
3
|
export declare function registerWorkDiscoveryRoutes(authenticated: Hono, deps: AuthenticatedRouteDeps): void;
|
|
@@ -2,30 +2,16 @@ import { getAgentDefaultModelRef, init_schema } from "../../../config/schema.js"
|
|
|
2
2
|
import { init_providers, resolveModel } from "../../../providers/index.js";
|
|
3
3
|
import { isLocalModelBaseUrl } from "../../../providers/model-call.js";
|
|
4
4
|
import { previewWorkDiscoveryRoot } from "../../../work-discovery/probe.js";
|
|
5
|
-
import { WorkDiscoveryService } from "../../../work-discovery/service.js";
|
|
6
5
|
//#region src/gateway/hono/routes/work-discovery.ts
|
|
7
6
|
init_schema();
|
|
8
7
|
init_providers();
|
|
9
|
-
const services = /* @__PURE__ */ new WeakMap();
|
|
10
|
-
function getWorkDiscoveryService(deps) {
|
|
11
|
-
const existing = services.get(deps.service);
|
|
12
|
-
if (existing) return existing;
|
|
13
|
-
const service = new WorkDiscoveryService({
|
|
14
|
-
projects: deps.service.projects,
|
|
15
|
-
sessions: deps.service.sessionIndexInstance,
|
|
16
|
-
getConfig: () => deps.service.currentConfig,
|
|
17
|
-
emit: (type, payload) => deps.service.emit(type, payload)
|
|
18
|
-
});
|
|
19
|
-
services.set(deps.service, service);
|
|
20
|
-
return service;
|
|
21
|
-
}
|
|
22
8
|
function stringField(body, field) {
|
|
23
9
|
if (!body || typeof body !== "object") return "";
|
|
24
10
|
const value = body[field];
|
|
25
11
|
return typeof value === "string" ? value.trim() : "";
|
|
26
12
|
}
|
|
27
13
|
function registerWorkDiscoveryRoutes(authenticated, deps) {
|
|
28
|
-
const service =
|
|
14
|
+
const service = deps.service.workDiscovery;
|
|
29
15
|
const limited = deps.strictRateLimitMiddleware;
|
|
30
16
|
authenticated.get("/api/onboarding/work-discovery", (c) => c.json({
|
|
31
17
|
enabled: service.isEnabled(),
|
|
@@ -268,4 +254,4 @@ function registerWorkDiscoveryRoutes(authenticated, deps) {
|
|
|
268
254
|
});
|
|
269
255
|
}
|
|
270
256
|
//#endregion
|
|
271
|
-
export {
|
|
257
|
+
export { registerWorkDiscoveryRoutes };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { init_agent_scope, resolveDefaultAgentId } from "../../../agent/agent-scope.js";
|
|
2
|
-
import { validateWorkflowDefinitionInput } from "../../../workflows/domain/validation.js";
|
|
3
|
-
import { WorkflowNameConflictError, WorkflowRevisionConflictError, createWorkflowCatalog } from "../../../agent/workflow/catalog.js";
|
|
4
2
|
import { resolveProjectAgentId } from "../../../projects/project-agent.js";
|
|
5
3
|
import "../../../projects/index.js";
|
|
6
4
|
import { messagesToClientHistory } from "../../../session/client-history.js";
|
|
5
|
+
import { validateWorkflowDefinitionInput } from "../../../workflows/domain/validation.js";
|
|
6
|
+
import { WorkflowNameConflictError, WorkflowRevisionConflictError, createWorkflowCatalog } from "../../../agent/workflow/catalog.js";
|
|
7
7
|
import "../../../workflows/domain/index.js";
|
|
8
8
|
import { resolveWorkflowRunArtifactsDir } from "../../../workflows/store/paths.js";
|
|
9
9
|
import { WorkflowDraftService } from "../../../workflows/draft/workflow-draft-service.js";
|
|
10
|
-
import { WorkflowDraftConflictError, WorkflowDraftStore } from "../../../workflows/authoring/workflow-draft-store.js";
|
|
11
|
-
import "../../../workflows/authoring/index.js";
|
|
12
10
|
import "../../../workflows/draft/index.js";
|
|
13
11
|
import { ProjectWorkflowPresetRepository } from "../../../workflows/project-presets/project-workflow-preset-repository.js";
|
|
12
|
+
import { WorkflowDraftConflictError, WorkflowDraftStore } from "../../../workflows/authoring/workflow-draft-store.js";
|
|
13
|
+
import "../../../workflows/authoring/index.js";
|
|
14
14
|
import { basename, join } from "node:path";
|
|
15
15
|
import { readFile, stat } from "node:fs/promises";
|
|
16
16
|
//#region src/gateway/hono/routes/workflows.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ConfigSchema, init_schema } from "../config/schema.js";
|
|
2
2
|
import { init_agent_scope, normalizeAgentId } from "../agent/agent-scope.js";
|
|
3
|
+
import { resolveEffectiveAgentConfigForAgent } from "../config/agent-profile.js";
|
|
3
4
|
import { fetchWithTimeoutGuarded } from "../media-shared/http/provider-http.js";
|
|
4
5
|
import "../media-shared/http/index.js";
|
|
5
|
-
import { resolveEffectiveAgentConfigForAgent } from "../config/agent-profile.js";
|
|
6
6
|
import { getImageGenerationProvider, listImageGenerationProvidersSummary } from "../agent/image/generation/provider-registry.js";
|
|
7
7
|
//#region src/gateway/image-generation-setup.ts
|
|
8
8
|
init_agent_scope();
|
package/dist/src/gateway/lock.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import
|
|
2
|
+
import fs from "node:fs";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
import net from "node:net";
|
|
5
|
-
import fs from "node:fs/promises";
|
|
5
|
+
import fs$1 from "node:fs/promises";
|
|
6
6
|
import { homedir } from "os";
|
|
7
7
|
//#region src/gateway/lock.ts
|
|
8
8
|
/**
|
|
@@ -57,7 +57,7 @@ function isPidAlive(pid) {
|
|
|
57
57
|
function readLinuxStartTime(pid) {
|
|
58
58
|
if (process.platform !== "linux") return null;
|
|
59
59
|
try {
|
|
60
|
-
const raw =
|
|
60
|
+
const raw = fs.readFileSync(`/proc/${pid}/stat`, "utf8").trim();
|
|
61
61
|
const closeParen = raw.lastIndexOf(")");
|
|
62
62
|
if (closeParen < 0) return null;
|
|
63
63
|
const fields = raw.slice(closeParen + 1).trim().split(/\s+/);
|
|
@@ -69,7 +69,7 @@ function readLinuxStartTime(pid) {
|
|
|
69
69
|
}
|
|
70
70
|
async function readLockPayload(lockPath) {
|
|
71
71
|
try {
|
|
72
|
-
const raw = await fs.readFile(lockPath, "utf8");
|
|
72
|
+
const raw = await fs$1.readFile(lockPath, "utf8");
|
|
73
73
|
const parsed = JSON.parse(raw);
|
|
74
74
|
if (typeof parsed.pid !== "number") return null;
|
|
75
75
|
if (typeof parsed.createdAt !== "string") return null;
|
|
@@ -105,11 +105,11 @@ async function acquireGatewayLock(configPath, opts = {}) {
|
|
|
105
105
|
const staleMs = opts.staleMs ?? DEFAULT_STALE_MS;
|
|
106
106
|
const port = opts.port;
|
|
107
107
|
const lockPath = resolveLockPath(configPath);
|
|
108
|
-
await fs.mkdir(path.dirname(lockPath), { recursive: true });
|
|
108
|
+
await fs$1.mkdir(path.dirname(lockPath), { recursive: true });
|
|
109
109
|
const startedAt = Date.now();
|
|
110
110
|
let lastPayload = null;
|
|
111
111
|
while (Date.now() - startedAt < timeoutMs) try {
|
|
112
|
-
const handle = await fs.open(lockPath, "wx");
|
|
112
|
+
const handle = await fs$1.open(lockPath, "wx");
|
|
113
113
|
const startTime = process.platform === "linux" ? readLinuxStartTime(process.pid) : null;
|
|
114
114
|
const payload = {
|
|
115
115
|
pid: process.pid,
|
|
@@ -124,7 +124,7 @@ async function acquireGatewayLock(configPath, opts = {}) {
|
|
|
124
124
|
configPath,
|
|
125
125
|
release: async () => {
|
|
126
126
|
await handle.close().catch(() => void 0);
|
|
127
|
-
await fs.rm(lockPath, { force: true });
|
|
127
|
+
await fs$1.rm(lockPath, { force: true });
|
|
128
128
|
console.log(`[GatewayLock] Lock released: lockPath=${lockPath}`);
|
|
129
129
|
}
|
|
130
130
|
};
|
|
@@ -135,7 +135,7 @@ async function acquireGatewayLock(configPath, opts = {}) {
|
|
|
135
135
|
const ownerStatus = ownerPid ? await resolveOwnerStatus(ownerPid, lastPayload, port) : "unknown";
|
|
136
136
|
if (ownerStatus === "dead" && ownerPid) {
|
|
137
137
|
console.warn(`[GatewayLock] Cleaning up stale gateway lock: pid=${ownerPid}`);
|
|
138
|
-
await fs.rm(lockPath, { force: true });
|
|
138
|
+
await fs$1.rm(lockPath, { force: true });
|
|
139
139
|
continue;
|
|
140
140
|
}
|
|
141
141
|
if (ownerStatus !== "alive") {
|
|
@@ -145,14 +145,14 @@ async function acquireGatewayLock(configPath, opts = {}) {
|
|
|
145
145
|
stale = Number.isFinite(createdAt) ? Date.now() - createdAt > staleMs : false;
|
|
146
146
|
}
|
|
147
147
|
if (!stale) try {
|
|
148
|
-
const st = await fs.stat(lockPath);
|
|
148
|
+
const st = await fs$1.stat(lockPath);
|
|
149
149
|
stale = Date.now() - st.mtimeMs > staleMs;
|
|
150
150
|
} catch {
|
|
151
151
|
stale = false;
|
|
152
152
|
}
|
|
153
153
|
if (stale) {
|
|
154
154
|
console.warn(`[GatewayLock] Removing stale lock file: lockPath=${lockPath}`);
|
|
155
|
-
await fs.rm(lockPath, { force: true });
|
|
155
|
+
await fs$1.rm(lockPath, { force: true });
|
|
156
156
|
continue;
|
|
157
157
|
}
|
|
158
158
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { FileServiceError } from "../files/file-service.js";
|
|
2
|
-
import { TaskContextRepository } from "../tasks/task-context-repository.js";
|
|
3
1
|
import { TaskRepository } from "../tasks/task-repository.js";
|
|
2
|
+
import { FileServiceError } from "../files/file-service.js";
|
|
4
3
|
import { resolveMediaReference } from "../media/media-reference.js";
|
|
5
4
|
import { pendingTranscriptReferencesMediaUri } from "../agent/inbound/attachment-pipeline.js";
|
|
5
|
+
import { TaskContextRepository } from "../tasks/task-context-repository.js";
|
|
6
6
|
import { messagesReferenceMediaUri } from "../media/session-references.js";
|
|
7
7
|
//#region src/gateway/media-access.ts
|
|
8
8
|
/** Resolve media only when the supplied session or task references it. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
-
import
|
|
3
|
+
import fs from "node:fs";
|
|
4
4
|
import { execFileSync } from "node:child_process";
|
|
5
5
|
import net from "node:net";
|
|
6
6
|
//#region src/gateway/ports.ts
|
|
@@ -54,7 +54,7 @@ function listPortListenersViaProc(port) {
|
|
|
54
54
|
for (const procFile of ["/proc/net/tcp", "/proc/net/tcp6"]) {
|
|
55
55
|
let content;
|
|
56
56
|
try {
|
|
57
|
-
content =
|
|
57
|
+
content = fs.readFileSync(procFile, "utf-8");
|
|
58
58
|
} catch {
|
|
59
59
|
continue;
|
|
60
60
|
}
|
|
@@ -68,7 +68,7 @@ function listPortListenersViaProc(port) {
|
|
|
68
68
|
if (inodeSet.size === 0) return results;
|
|
69
69
|
let pidDirs;
|
|
70
70
|
try {
|
|
71
|
-
pidDirs =
|
|
71
|
+
pidDirs = fs.readdirSync("/proc").filter((name) => /^\d+$/.test(name));
|
|
72
72
|
} catch {
|
|
73
73
|
return results;
|
|
74
74
|
}
|
|
@@ -76,14 +76,14 @@ function listPortListenersViaProc(port) {
|
|
|
76
76
|
const fdDir = `/proc/${pidStr}/fd`;
|
|
77
77
|
let fds;
|
|
78
78
|
try {
|
|
79
|
-
fds =
|
|
79
|
+
fds = fs.readdirSync(fdDir);
|
|
80
80
|
} catch {
|
|
81
81
|
continue;
|
|
82
82
|
}
|
|
83
83
|
for (const fd of fds) {
|
|
84
84
|
let target;
|
|
85
85
|
try {
|
|
86
|
-
target =
|
|
86
|
+
target = fs.readlinkSync(`${fdDir}/${fd}`);
|
|
87
87
|
} catch {
|
|
88
88
|
continue;
|
|
89
89
|
}
|
|
@@ -93,7 +93,7 @@ function listPortListenersViaProc(port) {
|
|
|
93
93
|
if (!results.some((p) => p.pid === pid)) {
|
|
94
94
|
let command;
|
|
95
95
|
try {
|
|
96
|
-
command =
|
|
96
|
+
command = fs.readFileSync(`/proc/${pidStr}/comm`, "utf-8").trim();
|
|
97
97
|
} catch {}
|
|
98
98
|
results.push({
|
|
99
99
|
pid,
|
|
@@ -63,7 +63,6 @@ function requiredGatewayScope(method, path) {
|
|
|
63
63
|
if (path.startsWith("/api/agents") || path.startsWith("/api/models")) return methodScope(method, "agents.read", "gateway.admin");
|
|
64
64
|
if (path.startsWith("/api/sessions") || path.startsWith("/api/side-chats")) return methodScope(method, "sessions.read", "sessions.write");
|
|
65
65
|
if (path.startsWith("/api/tasks")) return methodScope(method, "tasks.read", "tasks.write");
|
|
66
|
-
if (method === "POST" && /^\/api\/proactive\/subscriptions\/[^/]+\/preview$/.test(path)) return "agents.run";
|
|
67
66
|
if (/^\/api\/inbox\/judgments\/[^/]+\/workflow$/.test(path)) return methodScope(method, "automations.read", "automations.write");
|
|
68
67
|
if (method === "POST" && /^\/api\/inbox\/judgments\/[^/]+\/prepare$/.test(path)) return "automations.write";
|
|
69
68
|
if (path.startsWith("/api/proactive/web-push")) return "notifications.self";
|
|
@@ -73,7 +72,7 @@ function requiredGatewayScope(method, path) {
|
|
|
73
72
|
if (path.startsWith("/api/workflows")) return methodScope(method, "automations.read", "automations.write");
|
|
74
73
|
if (path.startsWith("/api/voice") || path.startsWith("/api/media") || path.startsWith("/api/clarifications")) return "sessions.write";
|
|
75
74
|
if (path.startsWith("/api/commands") || path.startsWith("/api/skills")) return methodScope(method, "agents.read", "gateway.admin");
|
|
76
|
-
if (path.startsWith("/api/workspace") || path.startsWith("/api/files") || path.startsWith("/api/projects") || path.startsWith("/api/notes") || path.startsWith("/api/shares")) return methodScope(method, "workspace.read", "workspace.write");
|
|
75
|
+
if (path === "/api/discussions" || path.startsWith("/api/discussions/") || path === "/api/discussion-capture/settings" || path.startsWith("/api/workspace") || path.startsWith("/api/files") || path.startsWith("/api/projects") || path.startsWith("/api/notes") || path.startsWith("/api/shares")) return methodScope(method, "workspace.read", "workspace.write");
|
|
77
76
|
return "gateway.admin";
|
|
78
77
|
}
|
|
79
78
|
function hasGatewayScope(granted, required) {
|