@xopcai/xopc 0.0.277 → 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/telegram/xopc.extension.json +1 -1
- 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-Cavbls0E.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-DlDTItrB.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-5gS0_LWl.js → app-management-settings-panel-ZqQKaZEI.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-DHzZCJon.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-Ia98yZe3.js → archive-plugin-BrW53Hap.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-DiWW88c8.js → attachment-load-DkfFWHiS.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-BuhTeGRJ.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-DDD48cJv.js → binary-plugins-CWIswfXA.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-0AWVCD3F.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-BKOYX5xV.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-CW9Byi8V.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-gdYmKC8W.js → date-picker-CPFxjTrN.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-40BYmiMc.js → dependency-picker-C_5KqzjI.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-By1z6tKE.js → desktop-pet-DLJsC5D6.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-ByjJqx9H.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-DQO65KbM.js → extension-debug-page-BNS_TkZQ.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-Db32jip6.js → extension-page-DMSDZ7Mb.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CL8Wx8lf.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-CRXWu2q6.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-CjehhHPz.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-CrIdaTrK.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-FfSwV_VH.js → logs-page-DHClKtm6.js} +2 -2
- package/dist/gateway/static/root/assets/{management-settings-BakV5aOw.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-Blv9U6Jp.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-BQfVtLLC.js → page-tabs-BCszXX_F.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-kjHFiO81.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-BhJlopSW.js → runtime-tools-settings-panel-BUFCgRdZ.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-cxoO_5I1.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-BiRTWiBi.js → settings-form-section-DvnjZBa3.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-D-Cb71pq.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-DciHfTay.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-CU7PALQB.js → skills-page.utils-BryVNYll.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-GpjNbqvM.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-LvCiBidm.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-BlGysZxj.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-DvIQOR5x.js → work-discovery-overlay-CacFTtXe.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-JIp60bXT.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 +4 -4
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/commands/command-isolation.d.ts +1 -0
- package/dist/src/agent/commands/command-isolation.js +17 -1
- package/dist/src/agent/commands/commandMounts.d.ts +2 -0
- package/dist/src/agent/commands/commandMounts.js +32 -0
- package/dist/src/agent/context/project-context.d.ts +1 -0
- package/dist/src/agent/context/project-context.js +12 -4
- package/dist/src/agent/embedded/model-runtime.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +1 -1
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +1 -1
- package/dist/src/agent/sandbox/command-validator.js +0 -20
- package/dist/src/agent/sandbox/exec-policy.d.ts +1 -0
- package/dist/src/agent/sandbox/exec-policy.js +4 -4
- package/dist/src/agent/sandbox/fileAccess.d.ts +7 -0
- package/dist/src/agent/sandbox/fileAccess.js +100 -0
- package/dist/src/agent/sandbox/path-policy.d.ts +2 -0
- package/dist/src/agent/sandbox/path-policy.js +54 -17
- package/dist/src/agent/sandbox/sanitize-env-vars.js +10 -9
- package/dist/src/agent/service.js +2 -2
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/hub-lock.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 +3 -3
- 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/apply-patch.js +25 -38
- package/dist/src/agent/tools/create-share-tool.js +11 -3
- package/dist/src/agent/tools/exec-command.js +2 -1
- package/dist/src/agent/tools/find.js +5 -3
- package/dist/src/agent/tools/grep.js +21 -4
- package/dist/src/agent/tools/image-generate-tool.js +3 -4
- package/dist/src/agent/tools/list-dir.js +2 -1
- package/dist/src/agent/tools/managed-job-tool.js +1 -0
- package/dist/src/agent/tools/publish-artifacts.js +4 -3
- package/dist/src/agent/tools/read.js +8 -5
- package/dist/src/agent/tools/repository-search.d.ts +2 -0
- package/dist/src/agent/tools/repository-search.js +51 -7
- package/dist/src/agent/tools/review-workspace.js +76 -10
- package/dist/src/agent/tools/send-media.js +4 -3
- package/dist/src/agent/tools/tool-paths.js +3 -1
- package/dist/src/agent/tools/write.js +4 -17
- package/dist/src/agent/tools/xopc-use-tool.js +2 -2
- package/dist/src/agent-config/schema.d.ts +24 -0
- package/dist/src/agent-config/schema.js +2 -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/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +21 -20
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/config/index.js +4 -4
- package/dist/src/config/loader.js +2 -2
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/config/schema.d.ts +16 -0
- 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 +1 -1
- 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 +61 -11
- 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/lockfile.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 +1 -1
- package/dist/src/gateway/chat-stream/mapper.js +2 -2
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/hono/app.js +3 -2
- package/dist/src/gateway/hono/lib/config-payload.d.ts +1 -0
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/lib/static-ui.js +1 -0
- 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/models.js +1 -1
- package/dist/src/gateway/hono/routes/proactive-control.js +2 -36
- 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 +20 -4
- 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/shares.js +22 -1
- package/dist/src/gateway/hono/routes/tasks.js +2 -1
- 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/security/gateway-scopes.js +1 -2
- package/dist/src/gateway/service/agent-runner.js +2 -2
- package/dist/src/gateway/service/config-coordinator.js +1 -1
- package/dist/src/gateway/service.d.ts +3 -0
- package/dist/src/gateway/service.js +28 -13
- package/dist/src/knowledge-memory/repository.d.ts +2 -0
- package/dist/src/knowledge-memory/repository.js +3 -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/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/experience.d.ts +38 -21
- package/dist/src/proactive/experience.js +113 -12
- package/dist/src/proactive/inbox/cards.js +7 -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/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-registry.js +1 -1
- package/dist/src/providers/register-runtime-providers.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/share/share-store.js +5 -1
- 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/home-query-service.js +2 -2
- package/dist/src/tasks/task-application-service.js +77 -3
- package/dist/src/tasks/task-context-assembler.js +1 -0
- package/dist/src/tasks/task-repository.d.ts +1 -0
- package/dist/src/tasks/task-repository.js +4 -0
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/tui/tui.js +1 -1
- package/dist/src/voice/audio/normalize.js +28 -5
- package/dist/src/voice/stt/transcribe-core.js +1 -0
- package/dist/src/voice/stt/types.d.ts +1 -0
- 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 +163 -15
- package/dist/src/work-discovery/types.d.ts +2 -0
- package/dist/src/workflows/service/workflow-run-service.js +2 -2
- package/package.json +3 -3
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-DyCyuJpi.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-__yzruGu.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-DaisbmEh.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-C7zjxscU.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-7kZMT1r6.js +0 -8
- package/dist/gateway/static/root/assets/channels-settings-BKUh6hzO.js +0 -1
- package/dist/gateway/static/root/assets/config-reload-event-Bjh2zoKp.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-m8J-F3u8.js +0 -2
- package/dist/gateway/static/root/assets/device-pairing-wizard-CfWQfz7a.js +0 -1
- package/dist/gateway/static/root/assets/gateway-config-swr-cd8owslz.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-wLly-Kc1.js +0 -1
- package/dist/gateway/static/root/assets/home-page-FqgSwpmy.js +0 -1
- package/dist/gateway/static/root/assets/index-5UchbidQ.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-DtYZa4GK.js +0 -2
- package/dist/gateway/static/root/assets/messages-BGc-OJWg.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-JbvyGdEX.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-Dm7mE2FK.js +0 -8
- package/dist/gateway/static/root/assets/proactive-card-Ap_wfos3.js +0 -1
- package/dist/gateway/static/root/assets/proactive-page-D1lEuanT.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-h00lfcVI.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-C2Bo1FAL.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-_bZYAl49.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-F7CHsvPa.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-DtZSUX4H.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-VPfBsNVv.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-BS2pnWO0.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DX344nVV.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-BhfKUsv7.js +0 -2
- package/dist/gateway/static/root/assets/task-detail-page-CElcQ9Sh.js +0 -1
- package/dist/gateway/static/root/assets/tunnel-api-Bhi_x_h4.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-BydARq2C.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-B972t6zx.js +0 -6
- package/dist/src/proactive/scenarios/preview.d.ts +0 -13
- package/dist/src/proactive/scenarios/preview.js +0 -81
|
@@ -1571,7 +1571,28 @@ function registerShareRoutes(authenticated, deps) {
|
|
|
1571
1571
|
const patch = {};
|
|
1572
1572
|
if (typeof body.extendTtlMs === "number") patch.extendTtlMs = body.extendTtlMs;
|
|
1573
1573
|
if (body.maxViews === null || typeof body.maxViews === "number") patch.maxViews = body.maxViews;
|
|
1574
|
-
const
|
|
1574
|
+
const existing = store.getById(id);
|
|
1575
|
+
if (patch.extendTtlMs !== void 0 && existing) {
|
|
1576
|
+
if (existing.revoked) return c.json({
|
|
1577
|
+
ok: false,
|
|
1578
|
+
error: { message: "This share was revoked and cannot be restored" }
|
|
1579
|
+
}, 409);
|
|
1580
|
+
if (existing.kind === "file" || existing.kind === "directory") {
|
|
1581
|
+
if (!(await store.validateFileIntegrity(existing)).valid) return c.json({
|
|
1582
|
+
ok: false,
|
|
1583
|
+
error: { message: "The original artifact is missing or was replaced. Generate a new artifact from the task." }
|
|
1584
|
+
}, 410);
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
let updated;
|
|
1588
|
+
try {
|
|
1589
|
+
updated = store.update(id, patch);
|
|
1590
|
+
} catch (error) {
|
|
1591
|
+
return c.json({
|
|
1592
|
+
ok: false,
|
|
1593
|
+
error: { message: error instanceof Error ? error.message : "Cannot renew share" }
|
|
1594
|
+
}, 400);
|
|
1595
|
+
}
|
|
1575
1596
|
if (!updated) return c.json({
|
|
1576
1597
|
ok: false,
|
|
1577
1598
|
error: { message: "Not found" }
|
|
@@ -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) => {
|
|
@@ -406,7 +407,7 @@ function registerTaskRoutes(authenticated, deps) {
|
|
|
406
407
|
latest: result.model
|
|
407
408
|
}, 409);
|
|
408
409
|
}
|
|
409
|
-
if (parsed.data.command?.type === "add_wait" && parsed.data.command.wait.kind === "paused" || parsed.data.command?.type === "close") {
|
|
410
|
+
if (parsed.data.command?.type === "add_wait" && parsed.data.command.wait.kind === "paused" || parsed.data.command?.type === "close" || parsed.data.command?.type === "resolve_wait" && parsed.data.command.resolution?.kind === "task_approval" && parsed.data.command.resolution.decision === "deny") {
|
|
410
411
|
const activeRun = runs.getActiveRoot(c.req.param("id"));
|
|
411
412
|
if (activeRun?.sessionKey) {
|
|
412
413
|
const liveRunId = deps.service.getActiveWebchatRunId(activeRun.sessionKey);
|
|
@@ -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 };
|
|
@@ -7,10 +7,10 @@ import { WorkflowNameConflictError, WorkflowRevisionConflictError, createWorkflo
|
|
|
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
|
|
@@ -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) {
|
|
@@ -85,9 +85,9 @@ var GatewayAgentRunner = class {
|
|
|
85
85
|
sourceId
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
|
-
if (unique.size > MAX_TURN_CONTEXTS) throw new Error(`A message can reference at most ${MAX_TURN_CONTEXTS}
|
|
88
|
+
if (unique.size > MAX_TURN_CONTEXTS) throw new Error(`A message can reference at most ${MAX_TURN_CONTEXTS} sources`);
|
|
89
89
|
const contexts = await Promise.all([...unique.values()].map((ref) => opts.resolveTurnContext(ref)));
|
|
90
|
-
if (contexts.some((context) => context === null)) throw new Error("A referenced
|
|
90
|
+
if (contexts.some((context) => context === null)) throw new Error("A referenced source is unavailable or has changed; select it again");
|
|
91
91
|
return fitSourceContextsToBudget(contexts.filter((context) => context !== null));
|
|
92
92
|
},
|
|
93
93
|
steer: (sessionKey, content) => opts.getAgentService().turnDispatcher.steerWebchatSession(sessionKey, content),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { loadConfig, saveConfig } from "../../config/loader.js";
|
|
4
3
|
import { getModelRegistry } from "../../providers/model-registry.js";
|
|
4
|
+
import { loadConfig, saveConfig } from "../../config/loader.js";
|
|
5
5
|
import { init_providers } from "../../providers/index.js";
|
|
6
6
|
import { disposeAllSessionMcpRuntimes } from "../../agent/mcp/bundle-mcp-runtime.js";
|
|
7
7
|
import { reloadImageGenerationProviders } from "../../agent/image/generation/provider-registry.js";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { WorkDiscoveryService } from '../work-discovery/service.js';
|
|
1
2
|
import { ConnectionRecoveryService } from '../connectors/connection-recovery-service.js';
|
|
2
3
|
import { AgentService } from '../agent/service.js';
|
|
3
4
|
import { MessageBus } from '../infra/bus/index.js';
|
|
@@ -98,6 +99,8 @@ export declare class GatewayService {
|
|
|
98
99
|
readonly marketplace: GatewayMarketplaceService;
|
|
99
100
|
/** First-class project grouping surface. */
|
|
100
101
|
readonly projects: ProjectService;
|
|
102
|
+
private _workDiscovery;
|
|
103
|
+
get workDiscovery(): WorkDiscoveryService;
|
|
101
104
|
readonly discussions: DiscussionService;
|
|
102
105
|
readonly discussionWorker: DiscussionOrganizerWorker;
|
|
103
106
|
readonly discussionLiveWorker: DiscussionLiveWorker;
|
|
@@ -12,16 +12,19 @@ import { getSessionConfig } from "../storage/sqlite/config-repository.js";
|
|
|
12
12
|
import "../storage/sqlite/index.js";
|
|
13
13
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
14
14
|
import { init_agent_scope, listAgentEntries, normalizeAgentId, resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../agent/agent-scope.js";
|
|
15
|
-
import { buildSessionKey, init_session_key, sanitizeSegment } from "../routing/session-key.js";
|
|
16
|
-
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
17
|
-
import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
18
15
|
import { init_paths, resolveConfigPath, resolveExtensionsDir } from "../config/paths.js";
|
|
16
|
+
import { prewarmModelRegistry } from "../providers/model-registry.js";
|
|
19
17
|
import { areExtensionsGloballyDisabled } from "../extensions/discover-extensions.js";
|
|
20
18
|
import { buildExtensionMetadataSnapshot } from "../extensions/extension-metadata-snapshot.js";
|
|
21
19
|
import { buildChannelCatalogForConfig, buildChannelCatalogFromSnapshot, init_channel_catalog_service } from "../channels/catalog/channel-catalog-service.js";
|
|
22
20
|
import { loadConfig, saveConfig } from "../config/loader.js";
|
|
23
|
-
import {
|
|
21
|
+
import { buildSessionKey, init_session_key, sanitizeSegment } from "../routing/session-key.js";
|
|
22
|
+
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
24
23
|
import { init_providers, providers_exports } from "../providers/index.js";
|
|
24
|
+
import { AutomationService } from "../automations/service/automation-service.js";
|
|
25
|
+
import { onAutomationProductEvent, publishAutomationProductEvent } from "../automations/product-events.js";
|
|
26
|
+
import "../automations/index.js";
|
|
27
|
+
import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
25
28
|
import { TaskRepository } from "../tasks/task-repository.js";
|
|
26
29
|
import { TaskConversationRepository } from "../tasks/task-conversation-repository.js";
|
|
27
30
|
import { getEmbeddedExecutionSession } from "../agent/embedded/execution-context.js";
|
|
@@ -35,9 +38,6 @@ import { ProactiveScenarioService } from "../proactive/scenarios/service.js";
|
|
|
35
38
|
import { ProactiveEventService } from "../proactive/service.js";
|
|
36
39
|
import { TaskApplicationService } from "../tasks/task-application-service.js";
|
|
37
40
|
import { ProactiveInboxService } from "../proactive/inbox/service.js";
|
|
38
|
-
import { AutomationService } from "../automations/service/automation-service.js";
|
|
39
|
-
import { onAutomationProductEvent, publishAutomationProductEvent } from "../automations/product-events.js";
|
|
40
|
-
import "../automations/index.js";
|
|
41
41
|
import { TaskOutboxDispatcher } from "../tasks/task-outbox-dispatcher.js";
|
|
42
42
|
import { TaskRunDispatcher } from "../tasks/task-run-dispatcher.js";
|
|
43
43
|
import { TaskSignalService } from "../tasks/task-signal-service.js";
|
|
@@ -56,12 +56,6 @@ import { registerClarificationChannelRuntime } from "./clarify-runtime.js";
|
|
|
56
56
|
import { ChannelManager } from "../channels/manager.js";
|
|
57
57
|
import { getWorkspacePath } from "../config/workspace-path-helpers.js";
|
|
58
58
|
import "../config/index.js";
|
|
59
|
-
import { DiscussionService } from "../discussions/service.js";
|
|
60
|
-
import { DiscussionOrganizer } from "../discussions/organizer.js";
|
|
61
|
-
import { DiscussionLiveWorker } from "../discussions/live-worker.js";
|
|
62
|
-
import { DiscussionOrganizerWorker } from "../discussions/organizer-worker.js";
|
|
63
|
-
import { DiscussionSealer } from "../discussions/sealer.js";
|
|
64
|
-
import "../discussions/index.js";
|
|
65
59
|
import { ManagedComposioEventPoller } from "../connectors/composio-managed-events.js";
|
|
66
60
|
import { startConnectedKnowledgeCoordinator } from "../knowledge/coordinator.js";
|
|
67
61
|
import "../knowledge/index.js";
|
|
@@ -69,12 +63,20 @@ import { ConnectionRecoveryService } from "../connectors/connection-recovery-ser
|
|
|
69
63
|
import { startConnectorLearningCoordinator } from "../connectors/learning-coordinator.js";
|
|
70
64
|
import { ConnectedSourceChangePublisher } from "../connectors/source-change-publisher.js";
|
|
71
65
|
import { startConnectorSupervisor } from "../connectors/supervisor.js";
|
|
66
|
+
import { DiscussionService } from "../discussions/service.js";
|
|
67
|
+
import { DiscussionOrganizer } from "../discussions/organizer.js";
|
|
68
|
+
import { DiscussionLiveWorker } from "../discussions/live-worker.js";
|
|
69
|
+
import { DiscussionOrganizerWorker } from "../discussions/organizer-worker.js";
|
|
70
|
+
import { DiscussionSealer } from "../discussions/sealer.js";
|
|
71
|
+
import "../discussions/index.js";
|
|
72
72
|
import { EndpointToolRuntime } from "../endpoint-tools/runtime.js";
|
|
73
73
|
import "../endpoint-tools/index.js";
|
|
74
74
|
import { assertGatewayAuthConfigured, extractToken, resolveGatewayAuth, validateToken } from "./auth.js";
|
|
75
75
|
import { prepareAutomationAgentSession } from "./automation-agent-session.js";
|
|
76
76
|
import { stopTailscaleExposure } from "./tailscale-lifecycle.js";
|
|
77
|
+
import { buildTaskAgentContext } from "../agent/source-context/task-context.js";
|
|
77
78
|
import { deliverProactiveCard } from "../proactive/inbox/delivery.js";
|
|
79
|
+
import { WorkDiscoveryService } from "../work-discovery/service.js";
|
|
78
80
|
import { buildVoiceMemoryContext } from "../voice/realtime/memory-context.js";
|
|
79
81
|
import { buildVoicePersonaContext } from "../voice/realtime/persona-context.js";
|
|
80
82
|
import { voiceMemoryBudget, voicePersonaBudget } from "../voice/realtime/conversation-context.js";
|
|
@@ -305,6 +307,15 @@ var GatewayService = class {
|
|
|
305
307
|
marketplace;
|
|
306
308
|
/** First-class project grouping surface. */
|
|
307
309
|
projects;
|
|
310
|
+
_workDiscovery;
|
|
311
|
+
get workDiscovery() {
|
|
312
|
+
return this._workDiscovery ??= new WorkDiscoveryService({
|
|
313
|
+
projects: this.projects,
|
|
314
|
+
sessions: this.sessionIndex,
|
|
315
|
+
getConfig: () => this.config,
|
|
316
|
+
emit: (type, payload) => this.emit(type, payload)
|
|
317
|
+
});
|
|
318
|
+
}
|
|
308
319
|
discussions;
|
|
309
320
|
discussionWorker;
|
|
310
321
|
discussionLiveWorker;
|
|
@@ -440,6 +451,7 @@ var GatewayService = class {
|
|
|
440
451
|
}
|
|
441
452
|
});
|
|
442
453
|
this.discussionSealer = new DiscussionSealer({
|
|
454
|
+
processRecordingJob: () => this.discussions.processRecordingJob(),
|
|
443
455
|
notes: this.notesService,
|
|
444
456
|
getConfig: () => this.config,
|
|
445
457
|
onUpdated: emitDiscussion
|
|
@@ -460,6 +472,7 @@ var GatewayService = class {
|
|
|
460
472
|
getChannelManager: () => this.channelManager,
|
|
461
473
|
getConfig: () => this.config,
|
|
462
474
|
resolveTurnContext: async (ref) => {
|
|
475
|
+
if (ref.kind === "task") return buildTaskAgentContext(new TaskRepository().get(ref.sourceId), ref.expectedVersion);
|
|
463
476
|
if (ref.kind !== "note") return null;
|
|
464
477
|
const note = await this.notesService.getNote(ref.sourceId);
|
|
465
478
|
if (!note || note.status === "trashed") return null;
|
|
@@ -918,6 +931,7 @@ var GatewayService = class {
|
|
|
918
931
|
}, `Model registry prewarm failed: ${em}`);
|
|
919
932
|
}
|
|
920
933
|
this.modelCatalogSync.start();
|
|
934
|
+
if (this.running) this.workDiscovery.resumeProjectUnderstanding();
|
|
921
935
|
if (!this.extensionLoader || areExtensionsGloballyDisabled(this.config)) return;
|
|
922
936
|
try {
|
|
923
937
|
if (trace) await trace.measure("extensions.deferred-load", () => this.loadDeferredExtensions());
|
|
@@ -1226,6 +1240,7 @@ var GatewayService = class {
|
|
|
1226
1240
|
this.stopRealtimeLogBridge?.();
|
|
1227
1241
|
this.stopRealtimeLogBridge = null;
|
|
1228
1242
|
log.debug("Stopping gateway service...");
|
|
1243
|
+
await this._workDiscovery?.stop();
|
|
1229
1244
|
this.readiness.markStarting();
|
|
1230
1245
|
this.endpointTools.close();
|
|
1231
1246
|
await this.sideChats.disposeAll();
|
|
@@ -30,6 +30,8 @@ export declare function writeKnowledgeItem(input: WriteKnowledgeInput): {
|
|
|
30
30
|
export declare function getKnowledgeItem(id: string): KnowledgeItem | undefined;
|
|
31
31
|
export declare function listKnowledgeItems(input?: {
|
|
32
32
|
principalId?: string;
|
|
33
|
+
scope?: UserModelScope;
|
|
34
|
+
canonicalKey?: string;
|
|
33
35
|
statuses?: KnowledgeStatus[];
|
|
34
36
|
recordClass?: KnowledgeRecordClass;
|
|
35
37
|
limit?: number;
|
|
@@ -106,7 +106,9 @@ function listKnowledgeItems(input = {}) {
|
|
|
106
106
|
return getSqliteDatabase().prepare(`SELECT * FROM knowledge_items
|
|
107
107
|
WHERE principal_id = ? AND status IN (${placeholders})
|
|
108
108
|
${input.recordClass ? "AND record_class = ?" : ""}
|
|
109
|
-
|
|
109
|
+
${input.scope ? "AND scope_type = ? AND COALESCE(scope_id, '') = COALESCE(?, '')" : ""}
|
|
110
|
+
${input.canonicalKey ? "AND canonical_key = ?" : ""}
|
|
111
|
+
ORDER BY importance DESC, updated_at DESC LIMIT ?`).all(input.principalId ?? "local-owner", ...statuses, ...input.recordClass ? [input.recordClass] : [], ...input.scope ? [input.scope.type, input.scope.id ?? null] : [], ...input.canonicalKey ? [input.canonicalKey] : [], Math.max(1, Math.min(2e3, input.limit ?? 200))).map(fromRow);
|
|
110
112
|
}
|
|
111
113
|
function setKnowledgeStatus(id, status, now = Date.now()) {
|
|
112
114
|
return getSqliteDatabase().prepare(`UPDATE knowledge_items SET status = ?, updated_at = ?
|
|
@@ -24,6 +24,7 @@ async function runAudioTranscription(options) {
|
|
|
24
24
|
const outputs = result.outputs.map((entry) => ({
|
|
25
25
|
attachmentIndex: entry.attachmentIndex,
|
|
26
26
|
text: entry.text,
|
|
27
|
+
...entry.segments ? { segments: entry.segments } : {},
|
|
27
28
|
provider: entry.provider,
|
|
28
29
|
...entry.model ? { model: entry.model } : {},
|
|
29
30
|
...entry.language ? { language: entry.language } : {},
|
|
@@ -118,6 +118,7 @@ async function runCapability(options) {
|
|
|
118
118
|
provider: provider.id,
|
|
119
119
|
model: callResult.model,
|
|
120
120
|
...callResult.language ? { language: callResult.language } : {},
|
|
121
|
+
...callResult.segments ? { segments: callResult.segments } : {},
|
|
121
122
|
...callResult.durationSeconds !== void 0 ? { durationSeconds: callResult.durationSeconds } : {}
|
|
122
123
|
});
|
|
123
124
|
break;
|
|
@@ -58,6 +58,7 @@ export interface CapabilityAttachmentInput {
|
|
|
58
58
|
mime?: string;
|
|
59
59
|
}
|
|
60
60
|
export interface MediaUnderstandingOutput {
|
|
61
|
+
segments?: AudioTranscriptionSegment[];
|
|
61
62
|
kind: MediaUnderstandingKind;
|
|
62
63
|
attachmentIndex: number;
|
|
63
64
|
text: string;
|
|
@@ -104,7 +105,14 @@ export interface AudioTranscriptionRequest {
|
|
|
104
105
|
timeoutMs: number;
|
|
105
106
|
signal?: AbortSignal;
|
|
106
107
|
}
|
|
108
|
+
export interface AudioTranscriptionSegment {
|
|
109
|
+
text: string;
|
|
110
|
+
startMs: number;
|
|
111
|
+
endMs: number;
|
|
112
|
+
speaker?: string;
|
|
113
|
+
}
|
|
107
114
|
export interface AudioTranscriptionResult {
|
|
115
|
+
segments?: AudioTranscriptionSegment[];
|
|
108
116
|
text: string;
|
|
109
117
|
model?: string;
|
|
110
118
|
/** Provider-reported language (e.g. 'zh', 'en'). */
|
|
@@ -49,7 +49,9 @@ export declare class NotesService {
|
|
|
49
49
|
listProjectSummaries(): import("./types.js").NoteProjectSummary[];
|
|
50
50
|
addAttachment(noteId: string, file: {
|
|
51
51
|
name: string;
|
|
52
|
-
buffer: Buffer
|
|
52
|
+
buffer: Buffer | {
|
|
53
|
+
filePath: string;
|
|
54
|
+
};
|
|
53
55
|
mimeType: string;
|
|
54
56
|
duration?: number;
|
|
55
57
|
retainWithoutReference?: boolean;
|
|
@@ -14,7 +14,9 @@ export declare class NotesStore {
|
|
|
14
14
|
offset: number;
|
|
15
15
|
hasMore: boolean;
|
|
16
16
|
}>;
|
|
17
|
-
saveAttachment(noteId: string, fileName: string, buffer: Buffer
|
|
17
|
+
saveAttachment(noteId: string, fileName: string, buffer: Buffer | {
|
|
18
|
+
filePath: string;
|
|
19
|
+
}): Promise<{
|
|
18
20
|
relativePath: string;
|
|
19
21
|
size: number;
|
|
20
22
|
}>;
|
package/dist/src/notes/store.js
CHANGED
|
@@ -9,7 +9,7 @@ import "../storage/sqlite/index.js";
|
|
|
9
9
|
import { resolveNoteMediaDir } from "./paths.js";
|
|
10
10
|
import { join } from "node:path";
|
|
11
11
|
import { randomUUID } from "node:crypto";
|
|
12
|
-
import { mkdir, rm, writeFile } from "node:fs/promises";
|
|
12
|
+
import { copyFile, mkdir, rm, stat, writeFile } from "node:fs/promises";
|
|
13
13
|
//#region src/notes/store.ts
|
|
14
14
|
init_logger();
|
|
15
15
|
const log = createLogger("NotesStore");
|
|
@@ -61,10 +61,12 @@ var NotesStore = class {
|
|
|
61
61
|
const mediaDir = resolveNoteMediaDir(noteId);
|
|
62
62
|
await mkdir(mediaDir, { recursive: true });
|
|
63
63
|
const safeName = `${randomUUID().slice(0, 8)}_${fileName.replace(/[^a-zA-Z0-9._-]/g, "_")}`;
|
|
64
|
-
|
|
64
|
+
const filePath = join(mediaDir, safeName);
|
|
65
|
+
if (Buffer.isBuffer(buffer)) await writeFile(filePath, buffer);
|
|
66
|
+
else await copyFile(buffer.filePath, filePath);
|
|
65
67
|
return {
|
|
66
68
|
relativePath: safeName,
|
|
67
|
-
size:
|
|
69
|
+
size: (await stat(filePath)).size
|
|
68
70
|
};
|
|
69
71
|
}
|
|
70
72
|
resolveAttachmentPath(noteId, relativePath) {
|
|
@@ -1,6 +1,25 @@
|
|
|
1
|
+
import { getCard } from './inbox/cards.js';
|
|
2
|
+
type SceneKind = 'project_momentum' | 'meeting_preparation' | 'communication_follow_up';
|
|
3
|
+
type SceneStatus = 'needs_decision' | 'prepared' | 'changed' | 'following';
|
|
4
|
+
interface SceneMoment {
|
|
5
|
+
id: string;
|
|
6
|
+
kind: SceneKind;
|
|
7
|
+
status: SceneStatus;
|
|
8
|
+
title: string;
|
|
9
|
+
promise: string;
|
|
10
|
+
moment: string;
|
|
11
|
+
relevance: string;
|
|
12
|
+
help: string;
|
|
13
|
+
arrangementId: string;
|
|
14
|
+
manageRoute: string;
|
|
15
|
+
object: {
|
|
16
|
+
label: string;
|
|
17
|
+
route: string;
|
|
18
|
+
} | null;
|
|
19
|
+
card: ReturnType<typeof getCard> | null;
|
|
20
|
+
updatedAt: string;
|
|
21
|
+
}
|
|
1
22
|
export declare function startDelegation(workspace: string, value: unknown): {
|
|
2
|
-
effectiveLevel: "off" | "active" | "quiet" | "balanced";
|
|
3
|
-
schedule: Record<string, import("node:sqlite").SQLOutputValue>;
|
|
4
23
|
revision: number;
|
|
5
24
|
level: "off" | "active" | "quiet" | "balanced";
|
|
6
25
|
delivery: "digest" | "inbox" | "important";
|
|
@@ -22,6 +41,7 @@ export declare function checkDelegation(workspace: string, id: string): {
|
|
|
22
41
|
status: "queued";
|
|
23
42
|
};
|
|
24
43
|
export declare function delegationOverview(workspace: string): {
|
|
44
|
+
scenes: SceneMoment[];
|
|
25
45
|
followUps: {
|
|
26
46
|
id: string;
|
|
27
47
|
subscriptionId: string;
|
|
@@ -39,31 +59,28 @@ export declare function delegationOverview(workspace: string): {
|
|
|
39
59
|
lastSyncedAt: string;
|
|
40
60
|
syncFailed: boolean;
|
|
41
61
|
}[];
|
|
42
|
-
needsDecision: import("@xopcai/gateway-contract/src/proactive.js").ProactiveCard[];
|
|
43
|
-
prepared: import("@xopcai/gateway-contract/src/proactive.js").ProactiveCard[];
|
|
44
|
-
updates: import("@xopcai/gateway-contract/src/proactive.js").ProactiveCard[];
|
|
45
62
|
delegations: {
|
|
46
|
-
effectiveEnabled: boolean;
|
|
47
|
-
project: Record<string, import("node:sqlite").SQLOutputValue>;
|
|
48
|
-
latestRun: Record<string, import("node:sqlite").SQLOutputValue>;
|
|
49
|
-
pending: boolean;
|
|
50
|
-
effectiveLevel: "off" | "active" | "quiet" | "balanced";
|
|
51
|
-
schedule: Record<string, import("node:sqlite").SQLOutputValue>;
|
|
52
|
-
revision: number;
|
|
53
|
-
level: "off" | "active" | "quiet" | "balanced";
|
|
54
|
-
delivery: "digest" | "inbox" | "important";
|
|
55
|
-
completedAt: string;
|
|
56
|
-
scanIntervalMinutes: number;
|
|
57
|
-
userInstructions: string;
|
|
58
63
|
id: string;
|
|
59
64
|
scenarioKey: string;
|
|
60
|
-
|
|
61
|
-
scopeKind: "workspace" | "project";
|
|
65
|
+
scopeKind: "project" | "workspace";
|
|
62
66
|
scopeId: string;
|
|
63
67
|
enabled: boolean;
|
|
64
|
-
|
|
65
|
-
|
|
68
|
+
revision: number;
|
|
69
|
+
delivery: "digest" | "inbox" | "important";
|
|
70
|
+
completedAt: string;
|
|
71
|
+
userInstructions: string;
|
|
66
72
|
updatedAt: string;
|
|
73
|
+
effectiveEnabled: boolean;
|
|
74
|
+
project: {
|
|
75
|
+
name: string;
|
|
76
|
+
status: string;
|
|
77
|
+
};
|
|
78
|
+
projectMonitoring: {
|
|
79
|
+
mode: "observe" | "ask_before_action" | "auto_low_risk";
|
|
80
|
+
allowedActions: string[];
|
|
81
|
+
};
|
|
82
|
+
checking: boolean;
|
|
67
83
|
}[];
|
|
68
84
|
};
|
|
69
85
|
export declare function completeDeliveredProjects(now?: Date): void;
|
|
86
|
+
export {};
|
|
@@ -36,6 +36,11 @@ function checkDelegation(workspace, id) {
|
|
|
36
36
|
if (!effectiveProactivePolicy(id).enabled) throw new Error("Resume this service before checking");
|
|
37
37
|
if (sub.scopeKind !== "project") throw new Error("This service checks when connected sources change");
|
|
38
38
|
return runSqliteWriteTransaction((db) => {
|
|
39
|
+
const retry = db.prepare("SELECT run_id FROM proactive_runs WHERE subscription_id = ? AND status = 'retryable' ORDER BY started_at DESC LIMIT 1").get(id);
|
|
40
|
+
if (retry) {
|
|
41
|
+
db.prepare("UPDATE proactive_runs SET next_attempt_at = ? WHERE run_id = ? AND status = 'retryable'").run((/* @__PURE__ */ new Date()).toISOString(), retry.run_id);
|
|
42
|
+
return { status: "queued" };
|
|
43
|
+
}
|
|
39
44
|
if (db.prepare("SELECT 1 FROM proactive_signal_batches WHERE subscription_id = ? AND status IN ('collecting', 'ready', 'processing')").get(id)) return { status: "queued" };
|
|
40
45
|
const last = db.prepare("SELECT MAX(started_at) AS at FROM proactive_runs WHERE subscription_id = ?").get(id);
|
|
41
46
|
if (last.at && Date.parse(last.at) > Date.now() - 6e4) throw new ProactiveConflict("A check just finished; try again in a minute");
|
|
@@ -55,21 +60,117 @@ function delegationOverview(workspace) {
|
|
|
55
60
|
AND (i.expires_at IS NULL OR i.expires_at > ?)
|
|
56
61
|
ORDER BY CASE WHEN x.action_status = 'approval_required' THEN 0 WHEN x.artifact_json IS NOT NULL THEN 1 ELSE 2 END,
|
|
57
62
|
x.value_score DESC, i.updated_at DESC LIMIT 100`).all(workspace, now).map((row) => getCard(row.inbox_item_id, workspace)).filter((card) => !["withdrawn", "expired"].includes(card.status));
|
|
63
|
+
const followUps = listMailFollowUps(workspace);
|
|
64
|
+
const delegations = controlledSubscriptions(workspace).map((sub) => ({
|
|
65
|
+
id: sub.id,
|
|
66
|
+
scenarioKey: sub.scenarioKey,
|
|
67
|
+
scopeKind: sub.scopeKind,
|
|
68
|
+
scopeId: sub.scopeId,
|
|
69
|
+
enabled: sub.enabled,
|
|
70
|
+
revision: sub.revision,
|
|
71
|
+
delivery: sub.delivery,
|
|
72
|
+
completedAt: sub.completedAt,
|
|
73
|
+
userInstructions: sub.userInstructions,
|
|
74
|
+
updatedAt: sub.updatedAt,
|
|
75
|
+
effectiveEnabled: effectiveProactivePolicy(sub.id).enabled,
|
|
76
|
+
project: sub.scopeKind === "project" ? db.prepare("SELECT name, status FROM projects WHERE project_id = ?").get(sub.scopeId) ?? null : null,
|
|
77
|
+
projectMonitoring: sub.scopeKind === "project" ? projectMonitoring(sub.scopeId) : null,
|
|
78
|
+
checking: Boolean(db.prepare("SELECT 1 FROM proactive_signal_batches WHERE subscription_id = ? AND status IN ('collecting', 'ready', 'processing')").get(sub.id))
|
|
79
|
+
}));
|
|
58
80
|
return {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
updates: cards.filter((card) => !card.artifact && !card.decision),
|
|
63
|
-
delegations: controlledSubscriptions(workspace).map((sub) => ({
|
|
64
|
-
...sub,
|
|
65
|
-
effectiveEnabled: effectiveProactivePolicy(sub.id).enabled,
|
|
66
|
-
project: sub.scopeKind === "project" ? db.prepare("SELECT name, status FROM projects WHERE project_id = ?").get(sub.scopeId) ?? null : null,
|
|
67
|
-
latestRun: db.prepare(`SELECT status, outcome_reason AS reason, completed_at AS completedAt, started_at AS startedAt, error_message AS error
|
|
68
|
-
FROM proactive_runs WHERE subscription_id = ? ORDER BY started_at DESC LIMIT 1`).get(sub.id) ?? null,
|
|
69
|
-
pending: Boolean(db.prepare("SELECT 1 FROM proactive_signal_batches WHERE subscription_id = ? AND status IN ('collecting', 'ready', 'processing')").get(sub.id))
|
|
70
|
-
}))
|
|
81
|
+
scenes: projectSceneMoments(cards, delegations, followUps),
|
|
82
|
+
followUps,
|
|
83
|
+
delegations
|
|
71
84
|
};
|
|
72
85
|
}
|
|
86
|
+
function projectMonitoring(projectId) {
|
|
87
|
+
const row = getSqliteDatabase().prepare("SELECT mode, allowed_actions_json FROM project_monitoring_policies WHERE project_id = ?").get(projectId);
|
|
88
|
+
return row ? {
|
|
89
|
+
mode: row.mode,
|
|
90
|
+
allowedActions: JSON.parse(row.allowed_actions_json)
|
|
91
|
+
} : {
|
|
92
|
+
mode: "observe",
|
|
93
|
+
allowedActions: []
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
function projectSceneMoments(cards, delegations, followUps) {
|
|
97
|
+
const latestCardBySubscription = /* @__PURE__ */ new Map();
|
|
98
|
+
for (const card of cards) {
|
|
99
|
+
const previous = latestCardBySubscription.get(card.subscriptionId);
|
|
100
|
+
if (!previous || previous.updatedAt < card.updatedAt) latestCardBySubscription.set(card.subscriptionId, card);
|
|
101
|
+
}
|
|
102
|
+
const moments = [];
|
|
103
|
+
for (const sub of delegations) {
|
|
104
|
+
if (!sub.effectiveEnabled || sub.completedAt || ![
|
|
105
|
+
"project_delivery_risk",
|
|
106
|
+
"meeting_preparation",
|
|
107
|
+
"discussion_follow_up"
|
|
108
|
+
].includes(sub.scenarioKey)) continue;
|
|
109
|
+
const card = latestCardBySubscription.get(sub.id) ?? null;
|
|
110
|
+
const project = sub.project;
|
|
111
|
+
const kind = sub.scenarioKey === "meeting_preparation" ? "meeting_preparation" : sub.scenarioKey === "discussion_follow_up" ? "communication_follow_up" : "project_momentum";
|
|
112
|
+
const object = project ? {
|
|
113
|
+
label: project.name,
|
|
114
|
+
route: `/projects/${encodeURIComponent(sub.scopeId)}`
|
|
115
|
+
} : card?.evidence.find((item) => item.route) ? (() => {
|
|
116
|
+
const item = card.evidence.find((value) => value.route);
|
|
117
|
+
return {
|
|
118
|
+
label: item.label,
|
|
119
|
+
route: item.route
|
|
120
|
+
};
|
|
121
|
+
})() : null;
|
|
122
|
+
moments.push({
|
|
123
|
+
id: `scene:${sub.id}`,
|
|
124
|
+
kind,
|
|
125
|
+
status: sceneStatus(card),
|
|
126
|
+
title: project?.name ?? card?.title ?? (kind === "meeting_preparation" ? "Meeting preparation" : kind === "communication_follow_up" ? "Conversation follow-up" : "Project follow-through"),
|
|
127
|
+
promise: sub.userInstructions,
|
|
128
|
+
moment: card?.whyNow ?? (kind === "meeting_preparation" ? "Waiting for the next relevant meeting" : kind === "communication_follow_up" ? "Watching for a meaningful follow-up" : "Watching the project for a meaningful change"),
|
|
129
|
+
relevance: card?.summary ?? sub.userInstructions,
|
|
130
|
+
help: card?.workDone || card?.recommendation || (kind === "meeting_preparation" ? "I will bring back a brief before the meeting." : kind === "communication_follow_up" ? "I will return when the discussion needs a next step." : "I will return when the goal, commitment, or delivery risk changes."),
|
|
131
|
+
arrangementId: sub.id,
|
|
132
|
+
manageRoute: `/assistant-work?delegation=${encodeURIComponent(sub.id)}`,
|
|
133
|
+
object,
|
|
134
|
+
card,
|
|
135
|
+
updatedAt: card?.updatedAt ?? sub.updatedAt
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
for (const follow of followUps) {
|
|
139
|
+
if (!follow.enabled || follow.status !== "watching") continue;
|
|
140
|
+
const card = cards.find((item) => item.communication?.id === follow.id) ?? null;
|
|
141
|
+
moments.push({
|
|
142
|
+
id: `scene:${follow.id}`,
|
|
143
|
+
kind: "communication_follow_up",
|
|
144
|
+
status: sceneStatus(card),
|
|
145
|
+
title: follow.subject ?? "Communication follow-up",
|
|
146
|
+
promise: follow.instructions,
|
|
147
|
+
moment: card?.whyNow ?? (follow.latestDirection === "received" ? "A reply arrived" : `Waiting until ${follow.dueAt}`),
|
|
148
|
+
relevance: card?.summary ?? follow.instructions,
|
|
149
|
+
help: card?.workDone || card?.recommendation || "I will watch the thread and prepare the next step when it matters.",
|
|
150
|
+
arrangementId: follow.subscriptionId,
|
|
151
|
+
manageRoute: `/assistant-work?follow-up=${encodeURIComponent(follow.id)}`,
|
|
152
|
+
object: follow.sessionKey ? {
|
|
153
|
+
label: follow.subject ?? "Open conversation",
|
|
154
|
+
route: `/chat/${encodeURIComponent(follow.sessionKey)}`
|
|
155
|
+
} : null,
|
|
156
|
+
card,
|
|
157
|
+
updatedAt: card?.updatedAt ?? follow.lastCheckedAt ?? follow.dueAt
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
const priority = {
|
|
161
|
+
needs_decision: 0,
|
|
162
|
+
prepared: 1,
|
|
163
|
+
changed: 2,
|
|
164
|
+
following: 3
|
|
165
|
+
};
|
|
166
|
+
return moments.sort((a, b) => priority[a.status] - priority[b.status] || b.updatedAt.localeCompare(a.updatedAt));
|
|
167
|
+
}
|
|
168
|
+
function sceneStatus(card) {
|
|
169
|
+
if (!card) return "following";
|
|
170
|
+
if (card.decision && card.actionStatus !== "completed") return "needs_decision";
|
|
171
|
+
if (card.artifact) return "prepared";
|
|
172
|
+
return "changed";
|
|
173
|
+
}
|
|
73
174
|
function completeDeliveredProjects(now = /* @__PURE__ */ new Date()) {
|
|
74
175
|
const db = getSqliteDatabase();
|
|
75
176
|
const rows = db.prepare(`SELECT s.subscription_id, s.workspace_id FROM proactive_scenario_subscriptions s
|