@xopcai/xopc 0.0.278 → 0.0.283
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-DQ74xqLi.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-SElFkQd6.js +1 -0
- package/dist/gateway/static/root/assets/{agents-DNQNTDkU.js → agents-DYazUaZ6.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-B42TpqIb.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-B0YnZ3ig.js → appearance-settings-D9Lfe7Sk.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-BzrodN8C.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-D4x142le.js → archive-plugin-BdmQwj4x.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-zibD2Hod.js → attachment-load-B4S0_nji.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-preview-renderer-CfEDFYPE.js → attachment-preview-renderer-wzIchDSv.js} +4 -4
- package/dist/gateway/static/root/assets/attachment-process-heavy-Db4nTY5N.js +5 -0
- package/dist/gateway/static/root/assets/{automations-page-Dkp7gp_S.js → automations-page-B3TmHNjQ.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace--A4I0jMu.js +6 -0
- package/dist/gateway/static/root/assets/binary-plugins-B3cXF_DP.js +2 -0
- package/dist/gateway/static/root/assets/{block-editor-r5nCBBan.js → block-editor-05zyBXBe.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-DRBA9nwe.js} +2 -2
- package/dist/gateway/static/root/assets/browser-settings-page-DDTXUNWK.js +8 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-Ll5UeXq5.js +8 -0
- package/dist/gateway/static/root/assets/channels-settings-BzL15bkU.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-Dx5KQyo5.js} +2 -2
- package/dist/gateway/static/root/assets/connectors-page-RPw1AOMb.js +2 -0
- package/dist/gateway/static/root/assets/{date-picker-XjPSlgq_.js → date-picker-CkDROZoe.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-CkyfEP88.js → dependency-picker-Bl8HcvzL.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-BAE_NVx5.js → desktop-pet-BcknAjbW.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-BUw6V2R9.js → desktop-pet-settings-BuCpXQPm.js} +1 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-D0_tCX49.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-giBeIVUT.js → extension-debug-page-qRpb2FFa.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-Bqo9bNtx.js → extension-page-C7gs9wu4.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BX-6AA3k.js → extension-settings-page-CyJP1CMZ.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-config-swr-Cpmyrr6j.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-DOeeTdWE.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-CV6Dolcn.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-Djw1H_Go.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-CHgOG1aR.js +74 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BKGPpBnV.js → keyboard-shortcuts-settings-B3XqA41D.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-BPqgyYJq.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-B06ToOxB.js → local-apps-page-BcIVYp0J.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-BHax3XlS.js} +2 -2
- package/dist/gateway/static/root/assets/{management-settings-DJ6yMZCd.js → management-settings-DNFCdgzR.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-BDxNhoBC.js} +1 -1
- package/dist/gateway/static/root/assets/messages-DYFcjtmG.js +3 -0
- package/dist/gateway/static/root/assets/note-detail-panel-Cs46LFXO.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-BUkcn_0t.js +8 -0
- package/dist/gateway/static/root/assets/{page-tabs-B7LA4z-x.js → page-tabs-agH3a2PI.js} +1 -1
- package/dist/gateway/static/root/assets/pdf-runtime-DU_sMPjG.js +2 -0
- package/dist/gateway/static/root/assets/pdf.worker.min-B4E34YdZ.js +48 -0
- package/dist/gateway/static/root/assets/{preview-open-alternatives-DTQRN7WR.js → preview-open-alternatives-XEZ7zDOP.js} +1 -1
- package/dist/gateway/static/root/assets/proactive-page-Bn484J9v.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-LcH21ixD.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-DelBiwyB.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-3BjFYXCf.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-D-DZf4I1.js → runtime-tools-settings-panel-DErKZlVJ.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-B-Yj9DVW.js → schema-form-DhCmJQVJ.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-CVFirgVd.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-DyfBpqkY.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-BxPUqwY6.js → settings-form-section-Dg6chotg.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-zLn8lIrs.js → settings-page-LyuN5N3M.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-CrXhTzHr.js +1 -0
- package/dist/gateway/static/root/assets/share-preview-page-CZvmf4Ob.js +2 -0
- package/dist/gateway/static/root/assets/shares-settings-DyM_D8hM.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-Bys58-15.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-sWNvFo6D.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-BR5bk2vT.js → skills-page.utils-Eu0WVHTS.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-C0ptJutB.js → system-settings-panel-DQKkM7B2.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-B18NcZQJ.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-TKQpPVd6.js +1 -0
- package/dist/gateway/static/root/assets/{use-autosave-Dc5aN2px.js → use-autosave-CkVlrFk1.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-ul-zr58b.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-CY0DpJui.js → voice-api-key-field-B12fFN-L.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-CT9Zy36i.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-D3fq7boB.js → workflow-run-setup-panel-BwefQliE.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-BY_AWs7S.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 +17 -17
- package/dist/src/agent/agent-scope.js +2 -2
- package/dist/src/agent/background-review/run-background-review.js +4 -4
- 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/model-runtime.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +5 -5
- 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/image/tool-model-config.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/mcp/oauth/mcp-oauth-store.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 +19 -19
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/filesystem-watcher.js +1 -1
- package/dist/src/agent/skills/hub-lock.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 +5 -5
- 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 +6 -6
- package/dist/src/agent/workflow/subagent-runner.js +1 -1
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +2 -2
- package/dist/src/auth/oauth/xopc-cloud.js +1 -1
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +2 -2
- package/dist/src/browser/providers/browser-ext-install.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/doctor/checks/provider-auth.js +3 -3
- 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/models.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 +5 -5
- package/dist/src/config/loader.js +2 -2
- package/dist/src/config/models-json.js +1 -1
- 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/lockfile.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 +4 -4
- 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 +2 -2
- package/dist/src/gateway/hono/app.js +6 -5
- package/dist/src/gateway/hono/lib/config-payload.js +3 -3
- 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 +5 -5
- 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 +2 -2
- 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 +4 -4
- 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 +45 -30
- package/dist/src/gateway/session-context-summary.js +2 -2
- package/dist/src/gateway/workspace-editor-path.js +2 -2
- 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/auth-runtime/resolve-auth.js +1 -1
- package/dist/src/providers/index.js +2 -2
- package/dist/src/providers/model-reference-auditor.js +1 -1
- package/dist/src/providers/model-registry.js +1 -1
- package/dist/src/providers/register-runtime-providers.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 +3 -3
- 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 +5 -5
- package/dist/src/tui/tui.js +3 -3
- 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 +165 -17
- 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 +6 -6
- package/dist/src/workflows/service/workflow-session-bridge.js +1 -1
- package/package.json +4 -4
- 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/attachment-process-heavy-C5CqLCsX.js +0 -5
- package/dist/gateway/static/root/assets/automations-workspace-w4McwueN.js +0 -6
- package/dist/gateway/static/root/assets/binary-plugins-CfUzu1Hc.js +0 -2
- 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/excel-worksheet-utils-DpdB-DjU.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/pdf.worker.min-CHFwMXne.mjs +0 -29
- 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/share-preview-page-DAc_FkVc.js +0 -2
- 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
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
//#region src/discussions/audio-repair.ts
|
|
2
|
+
/** Subtract already confirmed ranges without guessing word-level boundaries. */
|
|
3
|
+
function missingAudioRanges(start, end, confirmed) {
|
|
4
|
+
let cursor = start;
|
|
5
|
+
const missing = [];
|
|
6
|
+
for (const range of [...confirmed].sort((a, b) => a.startedAtMs - b.startedAtMs)) {
|
|
7
|
+
if (range.endedAtMs <= cursor || range.startedAtMs >= end) continue;
|
|
8
|
+
if (range.startedAtMs > cursor) missing.push({
|
|
9
|
+
startedAtMs: cursor,
|
|
10
|
+
endedAtMs: Math.min(end, range.startedAtMs)
|
|
11
|
+
});
|
|
12
|
+
cursor = Math.max(cursor, Math.min(end, range.endedAtMs));
|
|
13
|
+
}
|
|
14
|
+
if (cursor < end) missing.push({
|
|
15
|
+
startedAtMs: cursor,
|
|
16
|
+
endedAtMs: end
|
|
17
|
+
});
|
|
18
|
+
return missing;
|
|
19
|
+
}
|
|
20
|
+
function slicePcmWav(audio, startMs, endMs) {
|
|
21
|
+
const start = Math.max(0, Math.round(startMs * audio.sampleRate / 1e3));
|
|
22
|
+
const end = Math.min(audio.samples.length, Math.round(endMs * audio.sampleRate / 1e3));
|
|
23
|
+
const samples = audio.samples.subarray(start, end);
|
|
24
|
+
const output = Buffer.alloc(44 + samples.length * 2);
|
|
25
|
+
output.write("RIFF", 0);
|
|
26
|
+
output.writeUInt32LE(output.length - 8, 4);
|
|
27
|
+
output.write("WAVEfmt ", 8);
|
|
28
|
+
output.writeUInt32LE(16, 16);
|
|
29
|
+
output.writeUInt16LE(1, 20);
|
|
30
|
+
output.writeUInt16LE(1, 22);
|
|
31
|
+
output.writeUInt32LE(audio.sampleRate, 24);
|
|
32
|
+
output.writeUInt32LE(audio.sampleRate * 2, 28);
|
|
33
|
+
output.writeUInt16LE(2, 32);
|
|
34
|
+
output.writeUInt16LE(16, 34);
|
|
35
|
+
output.write("data", 36);
|
|
36
|
+
output.writeUInt32LE(samples.length * 2, 40);
|
|
37
|
+
samples.forEach((sample, index) => output.writeInt16LE(Math.round(Math.max(-1, Math.min(1, sample)) * 32767), 44 + index * 2));
|
|
38
|
+
return output;
|
|
39
|
+
}
|
|
40
|
+
//#endregion
|
|
41
|
+
export { missingAudioRanges, slicePcmWav };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { DiscussionOrganization } from './types.js';
|
|
3
|
+
export declare const MeetingEditSchema: z.ZodObject<{
|
|
4
|
+
kind: z.ZodEnum<{
|
|
5
|
+
summary: "summary";
|
|
6
|
+
risks: "risks";
|
|
7
|
+
decisions: "decisions";
|
|
8
|
+
actionItems: "actionItems";
|
|
9
|
+
openQuestions: "openQuestions";
|
|
10
|
+
}>;
|
|
11
|
+
itemId: z.ZodString;
|
|
12
|
+
expectedRevision: z.ZodNumber;
|
|
13
|
+
text: z.ZodOptional<z.ZodString>;
|
|
14
|
+
owner: z.ZodOptional<z.ZodString>;
|
|
15
|
+
dueDate: z.ZodOptional<z.ZodString>;
|
|
16
|
+
ignored: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
type Edit = z.infer<typeof MeetingEditSchema>;
|
|
19
|
+
/** Preserve explicit user changes, with the immutable source revision they edited. */
|
|
20
|
+
export declare function applyMeetingEdits(id: string, organization: DiscussionOrganization): DiscussionOrganization;
|
|
21
|
+
export declare function editMeeting(id: string, input: Edit): import("@xopcai/gateway-contract/src/discussions.js").DiscussionOrganizationRecord;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { getSqliteDatabase, runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
|
|
2
|
+
import { DiscussionServiceError } from "./errors.js";
|
|
3
|
+
import { completeDiscussionOrganization, createDiscussionOrganization, getDiscussionCapture, getLatestDiscussionOrganization } from "./repository.js";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
const MeetingEditSchema = z.object({
|
|
6
|
+
kind: z.enum([
|
|
7
|
+
"summary",
|
|
8
|
+
"decisions",
|
|
9
|
+
"actionItems",
|
|
10
|
+
"risks",
|
|
11
|
+
"openQuestions"
|
|
12
|
+
]),
|
|
13
|
+
itemId: z.string().max(100),
|
|
14
|
+
expectedRevision: z.number().int().positive(),
|
|
15
|
+
text: z.string().trim().min(1).max(2e4).optional(),
|
|
16
|
+
owner: z.string().trim().max(200).optional(),
|
|
17
|
+
dueDate: z.string().trim().max(100).optional(),
|
|
18
|
+
ignored: z.boolean().optional()
|
|
19
|
+
});
|
|
20
|
+
/** Preserve explicit user changes, with the immutable source revision they edited. */
|
|
21
|
+
function applyMeetingEdits(id, organization) {
|
|
22
|
+
const edited = structuredClone(organization);
|
|
23
|
+
const rows = getSqliteDatabase().prepare("SELECT kind, item_id, value_json FROM discussion_edits WHERE discussion_id=?").all(id);
|
|
24
|
+
for (const row of rows) {
|
|
25
|
+
if (row.kind === "summary") {
|
|
26
|
+
edited.summary = JSON.parse(row.value_json).text;
|
|
27
|
+
edited.summaryEditedByUser = true;
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
const value = JSON.parse(row.value_json);
|
|
31
|
+
const list = edited[row.kind];
|
|
32
|
+
const index = list.findIndex((item) => item.id === row.item_id);
|
|
33
|
+
if (index < 0) list.push(value);
|
|
34
|
+
else list[index] = {
|
|
35
|
+
...value,
|
|
36
|
+
supersededBy: list[index].supersededBy ?? value.supersededBy,
|
|
37
|
+
disputedBy: list[index].disputedBy ?? value.disputedBy
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
return edited;
|
|
41
|
+
}
|
|
42
|
+
function editMeeting(id, input) {
|
|
43
|
+
return runSqliteWriteTransaction((db) => {
|
|
44
|
+
const capture = getDiscussionCapture(id);
|
|
45
|
+
if (!capture) throw new DiscussionServiceError("not_found", "Discussion not found");
|
|
46
|
+
if (capture.status !== "completed" && capture.status !== "needs_attention") throw new DiscussionServiceError("conflict", "Wait for meeting processing to finish");
|
|
47
|
+
const previous = getLatestDiscussionOrganization(id);
|
|
48
|
+
if (!previous?.organization || previous.revision !== input.expectedRevision) throw new DiscussionServiceError("conflict", "Meeting summary changed; reload before editing");
|
|
49
|
+
let value;
|
|
50
|
+
if (input.kind === "summary") {
|
|
51
|
+
if (!input.text) throw new DiscussionServiceError("invalid_input", "Summary text is required");
|
|
52
|
+
value = { text: input.text };
|
|
53
|
+
} else {
|
|
54
|
+
const item = previous.organization[input.kind].find((candidate) => candidate.id === input.itemId);
|
|
55
|
+
if (!item) throw new DiscussionServiceError("not_found", "Meeting item not found");
|
|
56
|
+
value = {
|
|
57
|
+
...item,
|
|
58
|
+
evidenceRevision: item.evidenceRevision ?? previous.transcriptRevision,
|
|
59
|
+
editedByUser: true,
|
|
60
|
+
reviewedChangeId: item.supersededBy ?? item.disputedBy
|
|
61
|
+
};
|
|
62
|
+
if (input.text !== void 0) if ("title" in value) value.title = input.text;
|
|
63
|
+
else value.text = input.text;
|
|
64
|
+
if ("title" in value) {
|
|
65
|
+
if (input.owner !== void 0) value.owner = input.owner || void 0;
|
|
66
|
+
if (input.dueDate !== void 0) value.dueDate = input.dueDate || void 0;
|
|
67
|
+
}
|
|
68
|
+
if (input.ignored !== void 0) value.ignored = input.ignored;
|
|
69
|
+
}
|
|
70
|
+
db.prepare("INSERT INTO discussion_edits (discussion_id,kind,item_id,value_json,updated_at) VALUES (?,?,?,?,?) ON CONFLICT(discussion_id,kind,item_id) DO UPDATE SET value_json=excluded.value_json,updated_at=excluded.updated_at").run(id, input.kind, input.kind === "summary" ? "summary" : input.itemId, JSON.stringify(value), Date.now());
|
|
71
|
+
return completeDiscussionOrganization(createDiscussionOrganization({
|
|
72
|
+
discussionId: id,
|
|
73
|
+
transcriptRevision: previous.transcriptRevision,
|
|
74
|
+
inputTranscriptSha256: previous.inputTranscriptSha256,
|
|
75
|
+
promptVersion: previous.promptVersion,
|
|
76
|
+
modelRef: previous.modelRef
|
|
77
|
+
}).id, applyMeetingEdits(id, previous.organization));
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
//#endregion
|
|
81
|
+
export { MeetingEditSchema, applyMeetingEdits, editMeeting };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DiscussionServiceError } from "./errors.js";
|
|
2
|
+
//#region src/discussions/export.ts
|
|
3
|
+
const time = (ms) => `${String(Math.floor(ms / 36e5)).padStart(2, "0")}:${String(Math.floor(ms / 6e4) % 60).padStart(2, "0")}:${String(Math.floor(ms / 1e3) % 60).padStart(2, "0")},${String(Math.round(ms) % 1e3).padStart(3, "0")}`;
|
|
4
|
+
function exportDiscussion(detail, format) {
|
|
5
|
+
const segments = detail.transcript.segments.filter((segment) => segment.status === "confirmed");
|
|
6
|
+
if (format === "txt") return segments.map((segment) => `${time(segment.startedAtMs)} ${segment.speakerLabel ?? ""}\n${segment.displayText ?? segment.rawText ?? ""}`).join("\n\n");
|
|
7
|
+
if (format === "srt") return segments.map((segment, index) => `${index + 1}\n${time(segment.startedAtMs)} --> ${time(segment.endedAtMs)}\n${segment.speakerLabel ? `${segment.speakerLabel}: ` : ""}${segment.displayText ?? segment.rawText ?? ""}`).join("\n\n");
|
|
8
|
+
if (format !== "md") throw new DiscussionServiceError("invalid_input", "Unsupported export format");
|
|
9
|
+
const organization = detail.organization?.organization;
|
|
10
|
+
if (!organization) throw new DiscussionServiceError("conflict", "Meeting summary is not ready");
|
|
11
|
+
return [
|
|
12
|
+
`# ${organization.title}`,
|
|
13
|
+
organization.summary,
|
|
14
|
+
...[
|
|
15
|
+
["Decisions", organization.decisions.filter((item) => !item.ignored && !item.supersededBy).map((item) => item.text)],
|
|
16
|
+
["Actions", organization.actionItems.filter((item) => !item.ignored && !item.supersededBy).map((item) => `${item.title}${item.owner ? ` · ${item.owner}` : ""}${item.dueDate ? ` · ${item.dueDate}` : ""}`)],
|
|
17
|
+
["Risks", organization.risks.filter((item) => !item.ignored && !item.supersededBy).map((item) => item.text)],
|
|
18
|
+
["Open questions", organization.openQuestions.filter((item) => !item.ignored && !item.supersededBy).map((item) => item.text)]
|
|
19
|
+
].map(([title, items]) => `## ${title}\n\n${items.map((text) => `- ${text}`).join("\n")}`)
|
|
20
|
+
].join("\n\n");
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { exportDiscussion };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { DISCUSSION_AUDIO_MAX_BYTES, DISCUSSION_MAX_DURATION_MS, DISCUSSION_STATUSES } from "../../packages/gateway-contract/src/discussions.js";
|
|
2
|
+
import { DiscussionServiceError } from "./errors.js";
|
|
1
3
|
import { analyzeDiscussion } from "./analyzer.js";
|
|
2
|
-
import {
|
|
3
|
-
import { DISCUSSION_AUDIO_MAX_BYTES, DISCUSSION_MAX_DURATION_MS, DiscussionService, DiscussionServiceError } from "./service.js";
|
|
4
|
+
import { DiscussionService } from "./service.js";
|
|
4
5
|
import { DiscussionOrganizer } from "./organizer.js";
|
|
5
6
|
import { DiscussionLiveWorker } from "./live-worker.js";
|
|
6
7
|
import { DiscussionOrganizerWorker } from "./organizer-worker.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
3
|
import { ObjectLinkService } from "../activity/service.js";
|
|
4
|
-
import { isSTTAvailable } from "../voice/stt/availability.js";
|
|
5
4
|
import { transcribe } from "../voice/stt/transcribe-core.js";
|
|
5
|
+
import { isSTTAvailable } from "../voice/stt/availability.js";
|
|
6
6
|
import { mergeSttConfigFromAppConfig } from "../voice/stt/config.js";
|
|
7
7
|
import "../voice/stt/index.js";
|
|
8
|
-
import { enrichLiveDiscussion } from "./analyzer.js";
|
|
9
8
|
import { claimNextDiscussionTranscriptSegment, completeDiscussionTranscriptSegment, getDiscussionCapture, listDiscussionTranscriptSegments, retryOrFailDiscussionTranscriptSegment, updateDiscussionCapture } from "./repository.js";
|
|
10
9
|
import { assembleDiscussionTranscript } from "./transcript.js";
|
|
10
|
+
import { enrichLiveDiscussion } from "./analyzer.js";
|
|
11
11
|
import { acceptRankedProject, findExactProjectMention } from "./project-inference.js";
|
|
12
12
|
import { randomUUID } from "node:crypto";
|
|
13
13
|
//#region src/discussions/live-worker.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
-
import { claimNextDiscussionCapture, getDiscussionCapture, releaseDiscussionWorkLease, updateDiscussionCapture } from "./repository.js";
|
|
3
|
+
import { claimNextDiscussionCapture, getDiscussionCapture, releaseDiscussionWorkLease, renewDiscussionWorkLease, updateDiscussionCapture } from "./repository.js";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
5
|
//#region src/discussions/organizer-worker.ts
|
|
6
6
|
init_logger();
|
|
@@ -31,13 +31,20 @@ var DiscussionOrganizerWorker = class {
|
|
|
31
31
|
try {
|
|
32
32
|
const capture = claimNextDiscussionCapture(this.owner);
|
|
33
33
|
if (!capture) return;
|
|
34
|
+
const controller = new AbortController();
|
|
35
|
+
const renewal = setInterval(() => {
|
|
36
|
+
if (!renewDiscussionWorkLease(capture.id, this.owner)) controller.abort();
|
|
37
|
+
}, 3e4);
|
|
38
|
+
renewal.unref();
|
|
34
39
|
try {
|
|
35
|
-
await this.processor.process(capture, this.owner);
|
|
36
|
-
releaseDiscussionWorkLease(capture.id);
|
|
40
|
+
await this.processor.process(capture, this.owner, controller.signal);
|
|
41
|
+
releaseDiscussionWorkLease(capture.id, this.owner);
|
|
37
42
|
} catch (error) {
|
|
38
43
|
const message = error instanceof Error ? error.message : String(error);
|
|
39
|
-
|
|
40
|
-
|
|
44
|
+
const ownsLease = renewDiscussionWorkLease(capture.id, this.owner);
|
|
45
|
+
releaseDiscussionWorkLease(capture.id, this.owner);
|
|
46
|
+
const current = getDiscussionCapture(capture.id);
|
|
47
|
+
const updated = ownsLease && current && updateDiscussionCapture(capture.id, {
|
|
41
48
|
status: "needs_attention",
|
|
42
49
|
failureStage: "organization",
|
|
43
50
|
failureCode: "organization_failed",
|
|
@@ -48,6 +55,8 @@ var DiscussionOrganizerWorker = class {
|
|
|
48
55
|
err: error,
|
|
49
56
|
discussionId: capture.id
|
|
50
57
|
}, `Discussion organization failed: ${message}`);
|
|
58
|
+
} finally {
|
|
59
|
+
clearInterval(renewal);
|
|
51
60
|
}
|
|
52
61
|
} finally {
|
|
53
62
|
this.running = false;
|
|
@@ -17,6 +17,6 @@ export declare class DiscussionOrganizer {
|
|
|
17
17
|
private readonly deps;
|
|
18
18
|
private readonly objectLinks;
|
|
19
19
|
constructor(deps: DiscussionOrganizerDeps);
|
|
20
|
-
process(capture: DiscussionCapture,
|
|
20
|
+
process(capture: DiscussionCapture, owner: string, signal?: AbortSignal): Promise<DiscussionCapture>;
|
|
21
21
|
private linkProject;
|
|
22
22
|
}
|
|
@@ -1,18 +1,22 @@
|
|
|
1
|
+
import { runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
|
|
1
2
|
import { ObjectLinkService } from "../activity/service.js";
|
|
3
|
+
import { completeDiscussionOrganization, createDiscussionOrganization, getDiscussionCapture, getLatestDiscussionOrganization, listDiscussionTranscriptSegments, renewDiscussionWorkLease, updateDiscussionCapture } from "./repository.js";
|
|
4
|
+
import { saveTranscriptRevision } from "./revisions.js";
|
|
2
5
|
import { analyzeDiscussion } from "./analyzer.js";
|
|
3
|
-
import {
|
|
6
|
+
import { applyMeetingEdits } from "./edits.js";
|
|
4
7
|
import { acceptRankedProject, findExactProjectMention } from "./project-inference.js";
|
|
5
8
|
//#region src/discussions/organizer.ts
|
|
6
|
-
const PROMPT_VERSION = "discussion-
|
|
9
|
+
const PROMPT_VERSION = "discussion-evidence-v2";
|
|
7
10
|
var DiscussionOrganizer = class {
|
|
8
11
|
objectLinks = new ObjectLinkService();
|
|
9
12
|
constructor(deps) {
|
|
10
13
|
this.deps = deps;
|
|
11
14
|
}
|
|
12
|
-
async process(capture,
|
|
15
|
+
async process(capture, owner, signal) {
|
|
13
16
|
const transcript = capture.canonicalTranscript?.trim();
|
|
14
17
|
const inputHash = capture.canonicalTranscriptSha256;
|
|
15
18
|
if (!transcript || !inputHash) throw new Error("Canonical discussion transcript is missing");
|
|
19
|
+
const transcriptRevision = saveTranscriptRevision(capture.id);
|
|
16
20
|
const projects = this.deps.projects.list({
|
|
17
21
|
status: "active",
|
|
18
22
|
limit: 100
|
|
@@ -20,18 +24,35 @@ var DiscussionOrganizer = class {
|
|
|
20
24
|
const result = this.deps.organizeTranscript ? await this.deps.organizeTranscript(transcript, capture, signal) : await analyzeDiscussion({
|
|
21
25
|
config: this.deps.getConfig(),
|
|
22
26
|
transcript,
|
|
27
|
+
segments: listDiscussionTranscriptSegments(capture.id),
|
|
28
|
+
discussionId: capture.id,
|
|
29
|
+
template: capture.template,
|
|
23
30
|
projects: projects.map(({ id, name }) => ({
|
|
24
31
|
id,
|
|
25
32
|
name
|
|
26
33
|
})),
|
|
27
34
|
signal
|
|
28
35
|
});
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
36
|
+
signal?.throwIfAborted();
|
|
37
|
+
if (!renewDiscussionWorkLease(capture.id, owner)) throw new Error("Meeting processing lease lost");
|
|
38
|
+
if (getDiscussionCapture(capture.id)?.canonicalTranscriptSha256 !== inputHash) throw new Error("Transcript changed during organization");
|
|
39
|
+
const previous = getLatestDiscussionOrganization(capture.id)?.organization;
|
|
40
|
+
if (previous) {
|
|
41
|
+
const signature = (refs) => JSON.stringify([...refs].sort((a, b) => a - b));
|
|
42
|
+
for (const kind of [
|
|
43
|
+
"decisions",
|
|
44
|
+
"actionItems",
|
|
45
|
+
"risks",
|
|
46
|
+
"openQuestions"
|
|
47
|
+
]) for (const item of result.organization[kind]) {
|
|
48
|
+
const candidates = previous[kind].filter((old) => signature(old.evidenceSegmentIds) === signature(item.evidenceSegmentIds));
|
|
49
|
+
const label = (value) => "title" in value ? value.title : value.text;
|
|
50
|
+
const exact = previous[kind].filter((old) => label(old) === label(item));
|
|
51
|
+
const matches = exact.length ? exact : candidates;
|
|
52
|
+
const currentMatches = result.organization[kind].filter((other) => signature(other.evidenceSegmentIds) === signature(item.evidenceSegmentIds));
|
|
53
|
+
if (matches.length === 1 && (label(matches[0]) === label(item) && result.organization[kind].filter((other) => label(other) === label(item)).length === 1 || currentMatches.length === 1)) item.id = matches[0].id;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
35
56
|
let inferredProject;
|
|
36
57
|
if (!capture.projectId) {
|
|
37
58
|
const exact = findExactProjectMention(transcript, projects);
|
|
@@ -50,23 +71,38 @@ var DiscussionOrganizer = class {
|
|
|
50
71
|
if (!note) throw new Error("Discussion note is missing");
|
|
51
72
|
const title = result.organization.title.trim().slice(0, 200);
|
|
52
73
|
if (note.title?.startsWith("Discussion ·") && title) await this.deps.notes.updateNote(capture.noteId, { title }, "ai_edit");
|
|
53
|
-
const updated =
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
74
|
+
const updated = runSqliteWriteTransaction(() => {
|
|
75
|
+
signal?.throwIfAborted();
|
|
76
|
+
if (!renewDiscussionWorkLease(capture.id, owner)) throw new Error("Meeting processing lease lost");
|
|
77
|
+
if (getDiscussionCapture(capture.id)?.canonicalTranscriptSha256 !== inputHash) throw new Error("Transcript changed during organization");
|
|
78
|
+
const record = createDiscussionOrganization({
|
|
79
|
+
discussionId: capture.id,
|
|
80
|
+
transcriptRevision,
|
|
81
|
+
inputTranscriptSha256: inputHash,
|
|
82
|
+
promptVersion: PROMPT_VERSION,
|
|
83
|
+
modelRef: result.modelRef
|
|
84
|
+
});
|
|
85
|
+
result.organization = applyMeetingEdits(capture.id, result.organization);
|
|
86
|
+
completeDiscussionOrganization(record.id, result.organization);
|
|
87
|
+
const published = updateDiscussionCapture(capture.id, {
|
|
88
|
+
status: "completed",
|
|
89
|
+
generatedTitle: title,
|
|
90
|
+
...inferredProject ? {
|
|
91
|
+
projectId: inferredProject.id,
|
|
92
|
+
projectInferenceScore: inferredProject.score,
|
|
93
|
+
projectInferenceSource: inferredProject.source
|
|
94
|
+
} : {},
|
|
95
|
+
failureStage: void 0,
|
|
96
|
+
failureCode: void 0,
|
|
97
|
+
failureMessage: void 0,
|
|
98
|
+
completedAt: capture.completedAt ?? Date.now()
|
|
99
|
+
}, ["organizing"]);
|
|
100
|
+
if (!published) throw new Error("Discussion changed while applying organization");
|
|
101
|
+
return published;
|
|
102
|
+
});
|
|
67
103
|
if (inferredProject) this.linkProject(updated, inferredProject.id);
|
|
68
104
|
this.deps.onUpdated?.(updated);
|
|
69
|
-
this.deps.onCompleted?.(updated, result.organization);
|
|
105
|
+
if (!capture.completedAt) this.deps.onCompleted?.(updated, result.organization);
|
|
70
106
|
return updated;
|
|
71
107
|
}
|
|
72
108
|
linkProject(capture, projectId) {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { DiscussionOrganization } from './types.js';
|
|
3
|
+
type Candidate = {
|
|
4
|
+
id: string;
|
|
5
|
+
kind: string;
|
|
6
|
+
text: string;
|
|
7
|
+
evidenceSegmentIds: number[];
|
|
8
|
+
};
|
|
9
|
+
export declare const MeetingChangesSchema: z.ZodObject<{
|
|
10
|
+
changes: z.ZodArray<z.ZodObject<{
|
|
11
|
+
fromId: z.ZodString;
|
|
12
|
+
toId: z.ZodString;
|
|
13
|
+
relation: z.ZodEnum<{
|
|
14
|
+
supersedes: "supersedes";
|
|
15
|
+
contradicts: "contradicts";
|
|
16
|
+
}>;
|
|
17
|
+
}, z.core.$strip>>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
export type MeetingChange = z.infer<typeof MeetingChangesSchema>['changes'][number];
|
|
20
|
+
/** Relations can only point from an earlier fact to an actual later fact. */
|
|
21
|
+
export declare function reconcileMeetingChapters(chapters: DiscussionOrganization[], compare: (earlier: Candidate[], later: Candidate[]) => Promise<MeetingChange[]>): Promise<MeetingChange[]>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/discussions/reconcile.ts
|
|
3
|
+
const MeetingChangesSchema = z.object({ changes: z.array(z.object({
|
|
4
|
+
fromId: z.string(),
|
|
5
|
+
toId: z.string(),
|
|
6
|
+
relation: z.enum(["supersedes", "contradicts"])
|
|
7
|
+
})).max(200) });
|
|
8
|
+
function groups(items) {
|
|
9
|
+
const result = [];
|
|
10
|
+
let current = [];
|
|
11
|
+
let size = 0;
|
|
12
|
+
for (const item of items) {
|
|
13
|
+
const length = JSON.stringify(item).length;
|
|
14
|
+
if (length > 12e3) throw new Error("Meeting fact exceeds reconciliation input budget");
|
|
15
|
+
if (current.length && size + length > 12e3) {
|
|
16
|
+
result.push(current);
|
|
17
|
+
current = [];
|
|
18
|
+
size = 0;
|
|
19
|
+
}
|
|
20
|
+
current.push(item);
|
|
21
|
+
size += length;
|
|
22
|
+
}
|
|
23
|
+
if (current.length) result.push(current);
|
|
24
|
+
return result;
|
|
25
|
+
}
|
|
26
|
+
/** Relations can only point from an earlier fact to an actual later fact. */
|
|
27
|
+
async function reconcileMeetingChapters(chapters, compare) {
|
|
28
|
+
const earlier = [];
|
|
29
|
+
const changes = /* @__PURE__ */ new Map();
|
|
30
|
+
for (const chapter of chapters) {
|
|
31
|
+
const later = [];
|
|
32
|
+
for (const kind of [
|
|
33
|
+
"decisions",
|
|
34
|
+
"actionItems",
|
|
35
|
+
"risks",
|
|
36
|
+
"openQuestions"
|
|
37
|
+
]) for (const item of chapter[kind]) later.push({
|
|
38
|
+
id: item.id,
|
|
39
|
+
kind,
|
|
40
|
+
text: "title" in item ? item.title : item.text,
|
|
41
|
+
evidenceSegmentIds: item.evidenceSegmentIds
|
|
42
|
+
});
|
|
43
|
+
for (const left of groups(earlier)) for (const right of groups(later)) {
|
|
44
|
+
const output = await compare(left, right);
|
|
45
|
+
for (const change of output) {
|
|
46
|
+
if (change.fromId === change.toId || !left.some((item) => item.id === change.fromId) || !right.some((item) => item.id === change.toId)) throw new Error("Meeting change refers to an invalid or unordered fact");
|
|
47
|
+
changes.set(`${change.fromId}:${change.toId}`, change);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
earlier.push(...later.filter((item) => item.kind === "decisions" || item.kind === "actionItems"));
|
|
51
|
+
}
|
|
52
|
+
return [...changes.values()];
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
export { MeetingChangesSchema, reconcileMeetingChapters };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type DiscussionRecordingChunk, type DiscussionRecordingManifest } from '@xopcai/gateway-contract';
|
|
2
|
+
import type { NotesService } from '../notes/service.js';
|
|
3
|
+
import type { DiscussionCapture } from './types.js';
|
|
4
|
+
export declare function listRecordingChunks(id: string): DiscussionRecordingChunk[];
|
|
5
|
+
/** Called under the discussion mutation queue. Receipt follows durable disk write. */
|
|
6
|
+
export declare function saveRecordingChunk(capture: DiscussionCapture, sequence: number, sha256: string, body: ReadableStream<Uint8Array>): Promise<DiscussionRecordingChunk>;
|
|
7
|
+
export declare function validateRecordingManifest(capture: DiscussionCapture, input: DiscussionRecordingManifest): void;
|
|
8
|
+
export declare function completeRecording(capture: DiscussionCapture, input: DiscussionRecordingManifest, notes: NotesService, assertLease: () => void, signal: AbortSignal): Promise<DiscussionCapture>;
|
|
9
|
+
export declare function removeRecordingChunks(capture: DiscussionCapture): Promise<void>;
|