@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
|
@@ -150,7 +150,8 @@ function performCardAction(id, workspaceId, value) {
|
|
|
150
150
|
if (card.status === "withdrawn" || card.status === "expired" || card.status === "resolved" && ![
|
|
151
151
|
"useful",
|
|
152
152
|
"not_useful",
|
|
153
|
-
"retry"
|
|
153
|
+
"retry",
|
|
154
|
+
"refine"
|
|
154
155
|
].includes(input.actionId)) throw new ProactiveConflict("Card is no longer actionable");
|
|
155
156
|
applyCardAction(card, workspaceId, input);
|
|
156
157
|
const result = getCard(id, workspaceId);
|
|
@@ -162,6 +163,7 @@ function applyCardAction(card, workspaceId, input) {
|
|
|
162
163
|
const service = new ProactiveInboxService();
|
|
163
164
|
if (input.taskDraft && (input.actionId !== "decide" || input.choice !== "approve" || !card.taskDraft)) throw new Error("Task draft requires a pending approval");
|
|
164
165
|
if (input.artifact && input.actionId !== "edit_artifact") throw new Error("Artifact requires an edit action");
|
|
166
|
+
if (input.instruction && input.actionId !== "refine") throw new Error("Instruction requires a refine action");
|
|
165
167
|
switch (input.actionId) {
|
|
166
168
|
case "edit_artifact":
|
|
167
169
|
if (!input.artifact || !card.artifact || input.artifact.kind !== card.artifact.kind) throw new Error("An existing artifact is required");
|
|
@@ -177,6 +179,10 @@ function applyCardAction(card, workspaceId, input) {
|
|
|
177
179
|
case "not_useful":
|
|
178
180
|
service.feedback(card.id, input.actionId);
|
|
179
181
|
break;
|
|
182
|
+
case "refine":
|
|
183
|
+
if (!input.instruction) throw new Error("Refinement instruction required");
|
|
184
|
+
service.instruct(card.id, input.instruction);
|
|
185
|
+
break;
|
|
180
186
|
case "read":
|
|
181
187
|
service.transition(card.id, { status: "read" });
|
|
182
188
|
break;
|
|
@@ -14,7 +14,6 @@ function pruneProactiveHistory(now = /* @__PURE__ */ new Date()) {
|
|
|
14
14
|
db.prepare("DELETE FROM proactive_notification_budget WHERE created_at < ?").run(cutoff);
|
|
15
15
|
db.prepare("DELETE FROM proactive_presence WHERE expires_at <= ?").run(now.getTime());
|
|
16
16
|
db.prepare("DELETE FROM proactive_delivery_decisions WHERE created_at < ?").run(cutoff);
|
|
17
|
-
db.prepare("DELETE FROM proactive_preview_runs WHERE created_at < ?").run(cutoff);
|
|
18
17
|
db.prepare("DELETE FROM proactive_push_probes WHERE created_at < ?").run(Date.parse(cutoff));
|
|
19
18
|
db.prepare("DELETE FROM proactive_digest_queue WHERE consumed_at < ?").run(cutoff);
|
|
20
19
|
db.prepare("DELETE FROM proactive_digests WHERE created_at < ?").run(cutoff);
|
|
@@ -1,36 +1,5 @@
|
|
|
1
1
|
export declare function requireSubscription(id: string, workspaceId: string): import("./types.js").ScenarioSubscription;
|
|
2
|
-
export declare function templateCatalog(workspaceId?: string): {
|
|
3
|
-
parameterSchema: {
|
|
4
|
-
type: string;
|
|
5
|
-
properties: {
|
|
6
|
-
scanIntervalMinutes: {
|
|
7
|
-
type: string;
|
|
8
|
-
minimum: number;
|
|
9
|
-
maximum: number;
|
|
10
|
-
};
|
|
11
|
-
userInstructions: {
|
|
12
|
-
type: string;
|
|
13
|
-
maxLength: number;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
calendarSource?: {
|
|
18
|
-
status: string;
|
|
19
|
-
lastSourceUpdatedAt: string;
|
|
20
|
-
};
|
|
21
|
-
key: string;
|
|
22
|
-
version: number;
|
|
23
|
-
title: string;
|
|
24
|
-
description: string;
|
|
25
|
-
scopeKind: "project" | "workspace";
|
|
26
|
-
eventTypes: string[];
|
|
27
|
-
contextProviderIds: string[];
|
|
28
|
-
scheduled: boolean;
|
|
29
|
-
requiresCalendar: boolean;
|
|
30
|
-
}[];
|
|
31
2
|
export declare function controlledSubscriptions(workspaceId: string): {
|
|
32
|
-
effectiveLevel: "off" | "active" | "quiet" | "balanced";
|
|
33
|
-
schedule: Record<string, import("node:sqlite").SQLOutputValue>;
|
|
34
3
|
revision: number;
|
|
35
4
|
level: "off" | "active" | "quiet" | "balanced";
|
|
36
5
|
delivery: "digest" | "inbox" | "important";
|
|
@@ -48,8 +17,6 @@ export declare function controlledSubscriptions(workspaceId: string): {
|
|
|
48
17
|
updatedAt: string;
|
|
49
18
|
}[];
|
|
50
19
|
export declare function createControlledSubscription(workspaceId: string, value: unknown): {
|
|
51
|
-
effectiveLevel: "off" | "active" | "quiet" | "balanced";
|
|
52
|
-
schedule: Record<string, import("node:sqlite").SQLOutputValue>;
|
|
53
20
|
revision: number;
|
|
54
21
|
level: "off" | "active" | "quiet" | "balanced";
|
|
55
22
|
delivery: "digest" | "inbox" | "important";
|
|
@@ -67,8 +34,6 @@ export declare function createControlledSubscription(workspaceId: string, value:
|
|
|
67
34
|
updatedAt: string;
|
|
68
35
|
};
|
|
69
36
|
export declare function updateControlledSubscription(workspaceId: string, id: string, value: unknown): {
|
|
70
|
-
effectiveLevel: "off" | "active" | "quiet" | "balanced";
|
|
71
|
-
schedule: Record<string, import("node:sqlite").SQLOutputValue>;
|
|
72
37
|
revision: number;
|
|
73
38
|
level: "off" | "active" | "quiet" | "balanced";
|
|
74
39
|
delivery: "digest" | "inbox" | "important";
|
|
@@ -1,51 +1,17 @@
|
|
|
1
1
|
import { getSqliteDatabase, runSqliteWriteTransaction } from "../../storage/sqlite/transaction.js";
|
|
2
2
|
import { ProactiveSubscriptionCreateSchema, ProactiveSubscriptionSettingsSchema, ProactiveSubscriptionUpdateSchema } from "../../../packages/gateway-contract/src/proactive.js";
|
|
3
|
-
import { ProactiveConflict,
|
|
4
|
-
import { createPromptDraft, getScenario, getSubscription,
|
|
3
|
+
import { ProactiveConflict, subscriptionSettings } from "../policy/service.js";
|
|
4
|
+
import { createPromptDraft, getScenario, getSubscription, listSubscriptions, publishPromptRevision, upsertSubscription } from "./repository.js";
|
|
5
5
|
//#region src/proactive/scenarios/control.ts
|
|
6
6
|
function requireSubscription(id, workspaceId) {
|
|
7
7
|
const sub = getSubscription(id);
|
|
8
8
|
if (!sub || sub.workspaceId !== workspaceId) throw new Error("Subscription not found");
|
|
9
9
|
return sub;
|
|
10
10
|
}
|
|
11
|
-
function templateCatalog(workspaceId) {
|
|
12
|
-
return listScenarios().map((scenario) => ({
|
|
13
|
-
key: scenario.key,
|
|
14
|
-
version: scenario.version,
|
|
15
|
-
title: scenario.title,
|
|
16
|
-
description: scenario.description,
|
|
17
|
-
scopeKind: ["project_delivery_risk", "blocked_work"].includes(scenario.key) ? "project" : "workspace",
|
|
18
|
-
eventTypes: scenario.eventTypes,
|
|
19
|
-
contextProviderIds: scenario.contextProviderIds,
|
|
20
|
-
scheduled: [
|
|
21
|
-
"project_delivery_risk",
|
|
22
|
-
"blocked_work",
|
|
23
|
-
"meeting_preparation"
|
|
24
|
-
].includes(scenario.key),
|
|
25
|
-
requiresCalendar: scenario.key === "meeting_preparation",
|
|
26
|
-
...workspaceId && scenario.key === "meeting_preparation" ? { calendarSource: calendarSourceStatus(workspaceId) } : {},
|
|
27
|
-
parameterSchema: {
|
|
28
|
-
type: "object",
|
|
29
|
-
properties: {
|
|
30
|
-
scanIntervalMinutes: {
|
|
31
|
-
type: "integer",
|
|
32
|
-
minimum: 15,
|
|
33
|
-
maximum: 10080
|
|
34
|
-
},
|
|
35
|
-
userInstructions: {
|
|
36
|
-
type: "string",
|
|
37
|
-
maxLength: 12e3
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}));
|
|
42
|
-
}
|
|
43
11
|
function controlledSubscriptions(workspaceId) {
|
|
44
12
|
return listSubscriptions().filter((sub) => sub.workspaceId === workspaceId).map((sub) => ({
|
|
45
13
|
...sub,
|
|
46
|
-
...subscriptionSettings(sub.id)
|
|
47
|
-
effectiveLevel: effectiveProactivePolicy(sub.id).level,
|
|
48
|
-
schedule: getSqliteDatabase().prepare("SELECT next_due_at AS nextDueAt, last_checked_at AS lastCheckedAt FROM proactive_schedule_state WHERE subscription_id = ?").get(sub.id) ?? null
|
|
14
|
+
...subscriptionSettings(sub.id)
|
|
49
15
|
}));
|
|
50
16
|
}
|
|
51
17
|
function saveSettings(id, value, revision) {
|
|
@@ -57,9 +23,9 @@ function saveSettings(id, value, revision) {
|
|
|
57
23
|
}
|
|
58
24
|
function createControlledSubscription(workspaceId, value) {
|
|
59
25
|
const input = ProactiveSubscriptionCreateSchema.parse(value);
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
if (input.scopeKind !==
|
|
26
|
+
if (!getScenario(input.scenarioKey)) throw new Error("Scenario not found");
|
|
27
|
+
const scopeKind = ["project_delivery_risk", "blocked_work"].includes(input.scenarioKey) ? "project" : "workspace";
|
|
28
|
+
if (input.scopeKind !== scopeKind) throw new Error("Invalid scenario scope");
|
|
63
29
|
if (input.scopeKind === "project" && !getSqliteDatabase().prepare("SELECT 1 FROM projects WHERE project_id = ?").get(input.scopeId)) throw new Error("Project not found");
|
|
64
30
|
const scopeId = input.scopeKind === "workspace" ? workspaceId : input.scopeId;
|
|
65
31
|
return runSqliteWriteTransaction(() => {
|
|
@@ -92,17 +58,5 @@ function updateControlledSubscription(workspaceId, id, value) {
|
|
|
92
58
|
return controlledSubscriptions(workspaceId).find((item) => item.id === id);
|
|
93
59
|
});
|
|
94
60
|
}
|
|
95
|
-
function calendarSourceStatus(workspaceId) {
|
|
96
|
-
const row = getSqliteDatabase().prepare(`SELECT COUNT(*) AS count, MAX(k.updated_at) AS lastSourceUpdatedAt FROM knowledge_source_items k
|
|
97
|
-
JOIN connector_connections c ON c.id = json_extract(k.metadata_json, '$.connectionId')
|
|
98
|
-
JOIN connector_sync_policies p ON p.account_id = c.account_id
|
|
99
|
-
WHERE k.item_type = 'calendar_event' AND k.deleted_at IS NULL AND k.sensitivity NOT IN ('secret', 'regulated')
|
|
100
|
-
AND json_extract(k.metadata_json, '$.workspaceId') = ? AND c.status = 'active' AND p.scan_enabled = 1 AND p.proactive_enabled = 1
|
|
101
|
-
AND (json_array_length(p.allowed_scenario_keys_json) = 0 OR EXISTS (SELECT 1 FROM json_each(p.allowed_scenario_keys_json) WHERE value = 'meeting_preparation'))`).get(workspaceId);
|
|
102
|
-
return {
|
|
103
|
-
status: row.count ? "available" : "waiting_for_authorized_data",
|
|
104
|
-
lastSourceUpdatedAt: row.lastSourceUpdatedAt ? new Date(row.lastSourceUpdatedAt).toISOString() : null
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
61
|
//#endregion
|
|
108
|
-
export { controlledSubscriptions, createControlledSubscription, requireSubscription,
|
|
62
|
+
export { controlledSubscriptions, createControlledSubscription, requireSubscription, updateControlledSubscription };
|
|
@@ -223,7 +223,7 @@ var ProjectStore = class {
|
|
|
223
223
|
}
|
|
224
224
|
listWithSidebarSessions(query = {}) {
|
|
225
225
|
const projectConditions = [];
|
|
226
|
-
const sessionConditions = [
|
|
226
|
+
const sessionConditions = [];
|
|
227
227
|
const params = [];
|
|
228
228
|
if (query.status) {
|
|
229
229
|
const statuses = Array.isArray(query.status) ? query.status : [query.status];
|
|
@@ -241,19 +241,21 @@ var ProjectStore = class {
|
|
|
241
241
|
}
|
|
242
242
|
sessionConditions.push(`(${clauses.join(" OR ")})`);
|
|
243
243
|
}
|
|
244
|
-
const whereParts = [...projectConditions, ...sessionConditions];
|
|
244
|
+
const whereParts = [...projectConditions, ...sessionConditions.length ? [`(s.session_key IS NULL OR (${sessionConditions.join(" AND ")}))`] : []];
|
|
245
245
|
const where = whereParts.length ? `WHERE ${whereParts.join(" AND ")}` : "";
|
|
246
246
|
const limit = clampLimit(query.limit, 50);
|
|
247
247
|
const offset = Math.max(0, Math.floor(query.offset ?? 0));
|
|
248
248
|
const db = getSqliteDatabase();
|
|
249
249
|
const total = db.prepare(`SELECT COUNT(DISTINCT p.project_id) AS total
|
|
250
250
|
FROM projects p
|
|
251
|
-
JOIN sessions s ON s.project_id = p.project_id
|
|
251
|
+
LEFT JOIN sessions s ON s.project_id = p.project_id
|
|
252
|
+
AND s.hidden_from_session_list = 0 AND s.session_type = 'chat'
|
|
252
253
|
${where}`).get(...params).total;
|
|
253
254
|
return {
|
|
254
255
|
items: db.prepare(`SELECT p.*
|
|
255
256
|
FROM projects p
|
|
256
|
-
JOIN sessions s ON s.project_id = p.project_id
|
|
257
|
+
LEFT JOIN sessions s ON s.project_id = p.project_id
|
|
258
|
+
AND s.hidden_from_session_list = 0 AND s.session_type = 'chat'
|
|
257
259
|
${where}
|
|
258
260
|
GROUP BY p.project_id
|
|
259
261
|
ORDER BY
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { init_sync_provider_auth, resolveProviderApiKeyForAgentSync } from "../../auth/sync-provider-auth.js";
|
|
2
1
|
import { getApiKeyFromEnv, init_env_keys } from "../env-keys.js";
|
|
2
|
+
import { init_sync_provider_auth, resolveProviderApiKeyForAgentSync } from "../../auth/sync-provider-auth.js";
|
|
3
3
|
import { getDefaultAuthProfileStore } from "./auth-profile-store.js";
|
|
4
4
|
//#region src/providers/auth-runtime/resolve-auth.ts
|
|
5
5
|
init_env_keys();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __esmMin, __exportAll } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
3
|
-
import { getModelOAuthProviderIds, init_registry } from "../auth/oauth/registry.js";
|
|
4
|
-
import { hasProviderAuthOnDiskSync, init_sync_provider_auth } from "../auth/sync-provider-auth.js";
|
|
5
3
|
import { PROVIDER_ENV_MAP, getApiKeyFromEnv, init_env_keys } from "./env-keys.js";
|
|
6
4
|
import { init_model_ref, splitProviderModelRef } from "./model-ref.js";
|
|
7
5
|
import { ModelRegistry, getModelRegistry, init_model_registry, prewarmModelRegistry, resetModelRegistry } from "./model-registry.js";
|
|
6
|
+
import { getModelOAuthProviderIds, init_registry } from "../auth/oauth/registry.js";
|
|
8
7
|
import { CredentialResolver, hasCredentials, init_credentials } from "../auth/credentials.js";
|
|
8
|
+
import { hasProviderAuthOnDiskSync, init_sync_provider_auth } from "../auth/sync-provider-auth.js";
|
|
9
9
|
import { EXTENSION_PROVIDER_BASE_URL, init_constants } from "./constants.js";
|
|
10
10
|
import { applyOfficialModelMetadataCorrections, getSupplementalModels, init_model_supplements } from "./model-supplements.js";
|
|
11
11
|
import { getProviderRegistry, init_plugin_registry } from "./plugin-registry.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { createLogger } from "../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../utils/logger.js";
|
|
4
|
-
import { resolveModelsJsonPath } from "../config/paths.js";
|
|
5
4
|
import { init_resolve_config_value, resolveConfigValue, resolveHeaders } from "../config/resolve-config-value.js";
|
|
5
|
+
import { resolveModelsJsonPath } from "../config/paths.js";
|
|
6
6
|
import { getDefaultModelValues, init_models_json, validateModelsConfig } from "../config/models-json.js";
|
|
7
7
|
import { getApiKeyFromEnv, init_env_keys } from "./env-keys.js";
|
|
8
8
|
import { getModelCatalogStore, init_model_catalog_store } from "./model-catalog-store.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { getOAuthProviderDefinition, init_registry } from "../auth/oauth/registry.js";
|
|
3
2
|
import { getModelCatalogStore, init_model_catalog_store } from "./model-catalog-store.js";
|
|
3
|
+
import { getOAuthProviderDefinition, init_registry } from "../auth/oauth/registry.js";
|
|
4
4
|
import { XOPC_CLOUD_PROVIDER_ID, init_xopc_cloud_config, resolveXopcModelRouterUrl } from "./xopc-cloud-config.js";
|
|
5
5
|
//#region src/providers/register-runtime-providers.ts
|
|
6
6
|
function registerRuntimeProvider(modelRuntime, source) {
|
|
@@ -15,7 +15,7 @@ export interface ClientHistoryMessage {
|
|
|
15
15
|
/** Whitelisted display metadata; never includes source snapshot text. */
|
|
16
16
|
metadata?: {
|
|
17
17
|
sourceContexts?: Array<{
|
|
18
|
-
kind: 'note' | 'browser_page';
|
|
18
|
+
kind: 'note' | 'task' | 'browser_page';
|
|
19
19
|
sourceId: string;
|
|
20
20
|
version: string;
|
|
21
21
|
title: string;
|
|
@@ -9,7 +9,7 @@ function sourceContextDisplayMetadata(metadata) {
|
|
|
9
9
|
const sourceContexts = rows.flatMap((value) => {
|
|
10
10
|
if (!value || typeof value !== "object" || Array.isArray(value)) return [];
|
|
11
11
|
const row = value;
|
|
12
|
-
if (row.kind !== "note" && row.kind !== "browser_page" || typeof row.sourceId !== "string" || typeof row.version !== "string" || typeof row.title !== "string") return [];
|
|
12
|
+
if (row.kind !== "note" && row.kind !== "task" && row.kind !== "browser_page" || typeof row.sourceId !== "string" || typeof row.version !== "string" || typeof row.title !== "string") return [];
|
|
13
13
|
return [{
|
|
14
14
|
kind: row.kind,
|
|
15
15
|
sourceId: row.sourceId,
|
|
@@ -588,7 +588,11 @@ var ShareStore = class {
|
|
|
588
588
|
return runSqliteWriteTransaction(() => {
|
|
589
589
|
const record = this.shares.get(id);
|
|
590
590
|
if (!record) return null;
|
|
591
|
-
if (patch.extendTtlMs !== void 0)
|
|
591
|
+
if (patch.extendTtlMs !== void 0) {
|
|
592
|
+
if (record.revoked) throw new Error("Revoked shares cannot be renewed");
|
|
593
|
+
if (!Number.isFinite(patch.extendTtlMs) || patch.extendTtlMs < 6e4 || patch.extendTtlMs > this.config.maxTtlMs) throw new Error("Share duration is outside the configured limits");
|
|
594
|
+
record.expiresAt = new Date(Date.now() + patch.extendTtlMs).toISOString();
|
|
595
|
+
}
|
|
592
596
|
if (patch.maxViews !== void 0) record.maxViews = patch.maxViews;
|
|
593
597
|
this.shares.set(record.id, record);
|
|
594
598
|
logShareAudit("share.update", {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
DROP TABLE IF EXISTS proactive_preview_runs;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
CREATE TABLE discussion_recording_chunks (
|
|
2
|
+
discussion_id TEXT NOT NULL REFERENCES discussion_captures(id) ON DELETE CASCADE,
|
|
3
|
+
sequence INTEGER NOT NULL CHECK(sequence >= 0),
|
|
4
|
+
sha256 TEXT NOT NULL,
|
|
5
|
+
bytes INTEGER NOT NULL CHECK(bytes > 0),
|
|
6
|
+
PRIMARY KEY(discussion_id, sequence)
|
|
7
|
+
);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
CREATE TABLE discussion_transcript_revisions (
|
|
2
|
+
discussion_id TEXT NOT NULL REFERENCES discussion_captures(id) ON DELETE CASCADE,
|
|
3
|
+
revision INTEGER NOT NULL,
|
|
4
|
+
segments_json TEXT NOT NULL,
|
|
5
|
+
created_at INTEGER NOT NULL,
|
|
6
|
+
PRIMARY KEY(discussion_id, revision)
|
|
7
|
+
);
|
|
8
|
+
ALTER TABLE discussion_organizations ADD COLUMN transcript_revision INTEGER NOT NULL DEFAULT 0;
|
|
9
|
+
UPDATE discussion_organizations SET transcript_revision = COALESCE((SELECT transcript_revision FROM discussion_captures WHERE id = discussion_id), 0);
|
|
10
|
+
UPDATE discussion_organizations SET organization_json = json_set(organization_json, '$.decisions', json(COALESCE((SELECT json_group_array(json_object('id', lower(hex(randomblob(8))), 'text', value, 'evidenceSegmentIds', json('[]'))) FROM json_each(organization_json, '$.decisions')), '[]'))) WHERE organization_json IS NOT NULL;
|
|
11
|
+
UPDATE discussion_organizations SET organization_json = json_set(organization_json, '$.risks', json(COALESCE((SELECT json_group_array(json_object('id', lower(hex(randomblob(8))), 'text', value, 'evidenceSegmentIds', json('[]'))) FROM json_each(organization_json, '$.risks')), '[]'))) WHERE organization_json IS NOT NULL;
|
|
12
|
+
UPDATE discussion_organizations SET organization_json = json_set(organization_json, '$.openQuestions', json(COALESCE((SELECT json_group_array(json_object('id', lower(hex(randomblob(8))), 'text', value, 'evidenceSegmentIds', json('[]'))) FROM json_each(organization_json, '$.openQuestions')), '[]'))) WHERE organization_json IS NOT NULL;
|
|
13
|
+
UPDATE discussion_organizations SET organization_json = json_set(organization_json, '$.chapters', json('[]'), '$.actionItems', json(COALESCE((SELECT json_group_array(json_set(value, '$.evidenceSegmentIds', json('[]'))) FROM json_each(organization_json, '$.actionItems')), '[]'))) WHERE organization_json IS NOT NULL;
|
|
14
|
+
|
|
15
|
+
ALTER TABLE discussion_captures ADD COLUMN organization_template TEXT NOT NULL DEFAULT 'general';
|
|
16
|
+
CREATE TABLE discussion_analysis_chunks (discussion_id TEXT NOT NULL REFERENCES discussion_captures(id) ON DELETE CASCADE, input_hash TEXT NOT NULL, result_json TEXT NOT NULL, PRIMARY KEY (discussion_id, input_hash));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
CREATE TABLE discussion_action_tasks (
|
|
2
|
+
discussion_id TEXT NOT NULL REFERENCES discussion_captures(id) ON DELETE CASCADE,
|
|
3
|
+
action_id TEXT NOT NULL,
|
|
4
|
+
task_id TEXT NOT NULL,
|
|
5
|
+
organization_revision INTEGER NOT NULL,
|
|
6
|
+
created_at INTEGER NOT NULL,
|
|
7
|
+
PRIMARY KEY(discussion_id, action_id)
|
|
8
|
+
);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
CREATE TABLE discussion_edits (
|
|
2
|
+
discussion_id TEXT NOT NULL REFERENCES discussion_captures(id) ON DELETE CASCADE,
|
|
3
|
+
kind TEXT NOT NULL CHECK (kind IN ('summary', 'decisions', 'actionItems', 'risks', 'openQuestions')),
|
|
4
|
+
item_id TEXT NOT NULL,
|
|
5
|
+
value_json TEXT NOT NULL,
|
|
6
|
+
updated_at INTEGER NOT NULL,
|
|
7
|
+
PRIMARY KEY (discussion_id, kind, item_id)
|
|
8
|
+
);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
CREATE TABLE discussion_recording_jobs (
|
|
2
|
+
id TEXT PRIMARY KEY,
|
|
3
|
+
discussion_id TEXT NOT NULL UNIQUE REFERENCES discussion_captures(id) ON DELETE CASCADE,
|
|
4
|
+
input_json TEXT NOT NULL,
|
|
5
|
+
manifest_hash TEXT NOT NULL,
|
|
6
|
+
state TEXT NOT NULL CHECK(state IN ('queued', 'running', 'completed', 'failed', 'cancelled')),
|
|
7
|
+
lease_owner TEXT,
|
|
8
|
+
lease_until INTEGER,
|
|
9
|
+
error TEXT,
|
|
10
|
+
created_at INTEGER NOT NULL,
|
|
11
|
+
updated_at INTEGER NOT NULL
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
CREATE INDEX discussion_recording_jobs_pending ON discussion_recording_jobs(state, created_at);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
ALTER TABLE discussion_captures ADD COLUMN source_new TEXT NOT NULL DEFAULT 'web'
|
|
2
|
+
CHECK (source_new IN ('web', 'electron', 'mobile'));
|
|
3
|
+
UPDATE discussion_captures SET source_new = source;
|
|
4
|
+
ALTER TABLE discussion_captures DROP COLUMN source;
|
|
5
|
+
ALTER TABLE discussion_captures RENAME COLUMN source_new TO source;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { DatabaseSync } from 'node:sqlite';
|
|
3
|
+
import { expect, it } from 'vitest';
|
|
4
|
+
|
|
5
|
+
it('extends the source constraint without deleting existing captures or cascading children', () => {
|
|
6
|
+
const db = new DatabaseSync(':memory:');
|
|
7
|
+
try {
|
|
8
|
+
db.exec(`PRAGMA foreign_keys=ON;
|
|
9
|
+
CREATE TABLE discussion_captures(id TEXT PRIMARY KEY, source TEXT NOT NULL CHECK(source IN ('web','electron')));
|
|
10
|
+
CREATE TABLE chunks(capture_id TEXT REFERENCES discussion_captures(id) ON DELETE CASCADE, sequence INTEGER);
|
|
11
|
+
INSERT INTO discussion_captures VALUES ('first','electron');
|
|
12
|
+
INSERT INTO chunks VALUES ('first',0);`);
|
|
13
|
+
db.exec(readFileSync(new URL('../173_mobile_discussion_source.sql', import.meta.url), 'utf8'));
|
|
14
|
+
expect(db.prepare('SELECT source FROM discussion_captures').get()?.source).toBe('electron');
|
|
15
|
+
expect(db.prepare('SELECT count(*) AS count FROM chunks').get()?.count).toBe(1);
|
|
16
|
+
db.exec("INSERT INTO discussion_captures VALUES ('second','mobile')");
|
|
17
|
+
expect(() => db.exec("INSERT INTO discussion_captures VALUES ('third','unknown')")).toThrow();
|
|
18
|
+
expect(db.prepare('PRAGMA foreign_key_check').all()).toEqual([]);
|
|
19
|
+
} finally { db.close(); }
|
|
20
|
+
});
|
|
@@ -3,7 +3,7 @@ import type { ApplyMigrationsOptions } from './types.js';
|
|
|
3
3
|
/** Baseline schema version applied from schema.sql on first open. */
|
|
4
4
|
export declare const XOPC_DB_BASELINE_SCHEMA_VERSION = 11;
|
|
5
5
|
/** Latest schema version this release supports (increment when adding migrations). */
|
|
6
|
-
export declare const XOPC_DB_SCHEMA_VERSION =
|
|
6
|
+
export declare const XOPC_DB_SCHEMA_VERSION = 173;
|
|
7
7
|
export declare function resolveMigrationsDir(override?: string): string;
|
|
8
8
|
/**
|
|
9
9
|
* Apply sequential SQL migrations from (currentVersion + 1) through targetVersion.
|
|
@@ -12,7 +12,7 @@ const log = createLogger("Sqlite:Migrations");
|
|
|
12
12
|
/** Baseline schema version applied from schema.sql on first open. */
|
|
13
13
|
const XOPC_DB_BASELINE_SCHEMA_VERSION = 11;
|
|
14
14
|
/** Latest schema version this release supports (increment when adding migrations). */
|
|
15
|
-
const XOPC_DB_SCHEMA_VERSION =
|
|
15
|
+
const XOPC_DB_SCHEMA_VERSION = 173;
|
|
16
16
|
const MODULE_DIR = dirname(fileURLToPath(import.meta.url));
|
|
17
17
|
function backupBeforeTaskCutover(db, databasePath) {
|
|
18
18
|
db.exec("PRAGMA wal_checkpoint(FULL)");
|
|
@@ -57,7 +57,7 @@ function applySingleMigration(db, migration) {
|
|
|
57
57
|
* Each step runs in its own transaction and updates schema_meta on success.
|
|
58
58
|
*/
|
|
59
59
|
function applyPendingMigrations(db, options = {}) {
|
|
60
|
-
const targetVersion = options.targetVersion ??
|
|
60
|
+
const targetVersion = options.targetVersion ?? 173;
|
|
61
61
|
let currentVersion = readSchemaVersion(db);
|
|
62
62
|
if (currentVersion > targetVersion) throw new DatabaseSchemaTooNewError(currentVersion, targetVersion);
|
|
63
63
|
if (currentVersion >= targetVersion) return currentVersion;
|
|
@@ -94,7 +94,7 @@ function applyPendingMigrations(db, options = {}) {
|
|
|
94
94
|
}
|
|
95
95
|
/** Inspect schema version without mutating the database. */
|
|
96
96
|
function inspectSchemaMigrationStatus(db, options = {}) {
|
|
97
|
-
const appVersion = options.targetVersion ??
|
|
97
|
+
const appVersion = options.targetVersion ?? 173;
|
|
98
98
|
const dbVersion = readSchemaVersion(db);
|
|
99
99
|
if (dbVersion > appVersion) return {
|
|
100
100
|
dbVersion,
|
|
@@ -19,7 +19,7 @@ const log = createLogger('Sqlite:Migrations');
|
|
|
19
19
|
export const XOPC_DB_BASELINE_SCHEMA_VERSION = 11;
|
|
20
20
|
|
|
21
21
|
/** Latest schema version this release supports (increment when adding migrations). */
|
|
22
|
-
export const XOPC_DB_SCHEMA_VERSION =
|
|
22
|
+
export const XOPC_DB_SCHEMA_VERSION = 173;
|
|
23
23
|
|
|
24
24
|
const MODULE_DIR = dirname(fileURLToPath(import.meta.url));
|
|
25
25
|
|
|
@@ -2,10 +2,10 @@ import { isHomeAttentionAcknowledged } from "../storage/sqlite/home-attention-re
|
|
|
2
2
|
import { getRelationshipSettings } from "../storage/sqlite/relationship-settings-repository.js";
|
|
3
3
|
import { listConnectorApprovals } from "../storage/sqlite/connector-repository.js";
|
|
4
4
|
import "../storage/sqlite/index.js";
|
|
5
|
-
import { TaskRepository } from "./task-repository.js";
|
|
6
|
-
import { TaskReadModelProjector } from "./task-read-model-projector.js";
|
|
7
5
|
import "../automations/domain/defaults.js";
|
|
8
6
|
import "../automations/index.js";
|
|
7
|
+
import { TaskRepository } from "./task-repository.js";
|
|
8
|
+
import { TaskReadModelProjector } from "./task-read-model-projector.js";
|
|
9
9
|
import { AttentionGovernor } from "./attention-governor.js";
|
|
10
10
|
import { listGatewayAgents } from "../gateway/agents-admin.js";
|
|
11
11
|
//#region src/tasks/home-query-service.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getSqliteDatabase, runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
|
|
2
|
-
import { verifiedTaskCriteria } from "../../packages/gateway-contract/src/tasks.js";
|
|
2
|
+
import { TaskExecutorSelectionSchema, verifiedTaskCriteria } from "../../packages/gateway-contract/src/tasks.js";
|
|
3
3
|
import { enqueueTaskAttentionRequiredEvent, enqueueTaskChangedEvent } from "./task-change-events.js";
|
|
4
4
|
import { TaskRunRepository } from "./task-run-repository.js";
|
|
5
5
|
import { TaskRepository } from "./task-repository.js";
|
|
@@ -261,18 +261,92 @@ var TaskApplicationService = class {
|
|
|
261
261
|
reason: "not_found",
|
|
262
262
|
model
|
|
263
263
|
};
|
|
264
|
-
else if (wait.condition.type === "connection") result = {
|
|
264
|
+
else if (wait.status !== "active" || task.phase === "closed" || wait.condition.type === "connection") result = {
|
|
265
265
|
ok: false,
|
|
266
266
|
reason: "invalid_transition",
|
|
267
267
|
model
|
|
268
268
|
};
|
|
269
269
|
else {
|
|
270
|
+
const response = input.command.resolution;
|
|
271
|
+
if (response?.kind === "task_approval") {
|
|
272
|
+
if (actor.kind !== "user" || wait.kind !== "approval" || typeof wait.condition.capability !== "string" || response.decision !== "approve" && response.decision !== "deny") {
|
|
273
|
+
result = {
|
|
274
|
+
ok: false,
|
|
275
|
+
reason: "invalid_transition",
|
|
276
|
+
model
|
|
277
|
+
};
|
|
278
|
+
break;
|
|
279
|
+
}
|
|
280
|
+
if (response.decision === "deny") {
|
|
281
|
+
if (!this.#runs.listActiveWaits(task.id).some((item) => item.kind === "paused")) this.#runs.createWait({
|
|
282
|
+
taskId: task.id,
|
|
283
|
+
kind: "paused",
|
|
284
|
+
reason: "Approval declined by user",
|
|
285
|
+
condition: { approvalWaitId: wait.id }
|
|
286
|
+
});
|
|
287
|
+
const active = this.#runs.getActiveRoot(task.id);
|
|
288
|
+
if (active && [
|
|
289
|
+
"queued",
|
|
290
|
+
"running",
|
|
291
|
+
"verifying"
|
|
292
|
+
].includes(active.status)) this.#runs.setStatus({
|
|
293
|
+
runId: active.id,
|
|
294
|
+
expectedVersion: active.version,
|
|
295
|
+
from: [active.status],
|
|
296
|
+
to: "waiting",
|
|
297
|
+
actor
|
|
298
|
+
});
|
|
299
|
+
result = {
|
|
300
|
+
ok: true,
|
|
301
|
+
model: this.#projector.get(task.id)
|
|
302
|
+
};
|
|
303
|
+
break;
|
|
304
|
+
}
|
|
305
|
+
this.#context.grant({
|
|
306
|
+
taskId: task.id,
|
|
307
|
+
capability: wait.condition.capability,
|
|
308
|
+
scope: {
|
|
309
|
+
waitId: wait.id,
|
|
310
|
+
contractVersion: task.latestContractVersion
|
|
311
|
+
},
|
|
312
|
+
grantedBy: actor
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
if (response?.kind === "user_answer") {
|
|
316
|
+
if (actor.kind !== "user" || wait.kind !== "user_input" || typeof response.answer !== "string" || !response.answer.trim() || response.answer.length > 12e3) {
|
|
317
|
+
result = {
|
|
318
|
+
ok: false,
|
|
319
|
+
reason: "invalid_transition",
|
|
320
|
+
model
|
|
321
|
+
};
|
|
322
|
+
break;
|
|
323
|
+
}
|
|
324
|
+
this.#context.add({
|
|
325
|
+
taskId: task.id,
|
|
326
|
+
targetKind: "source",
|
|
327
|
+
targetId: wait.id,
|
|
328
|
+
role: "input",
|
|
329
|
+
title: wait.reason,
|
|
330
|
+
pinned: true,
|
|
331
|
+
metadata: { userAnswer: response.answer.trim() },
|
|
332
|
+
createdBy: actor
|
|
333
|
+
});
|
|
334
|
+
}
|
|
270
335
|
this.#runs.resolveWait({
|
|
271
336
|
waitId: wait.id,
|
|
272
337
|
actor,
|
|
273
338
|
resolution: input.command.resolution
|
|
274
339
|
});
|
|
275
|
-
|
|
340
|
+
const executor = TaskExecutorSelectionSchema.safeParse(wait.condition.executor);
|
|
341
|
+
result = response?.kind === "task_approval" && executor.success && !this.#runs.getActiveRoot(task.id) && this.#runs.listActiveWaits(task.id).length === 0 ? this.start(task.id, task.version, executor.data, {
|
|
342
|
+
idempotencyKey: input.idempotencyKey,
|
|
343
|
+
actor,
|
|
344
|
+
correlationId: input.idempotencyKey
|
|
345
|
+
}) : {
|
|
346
|
+
ok: true,
|
|
347
|
+
model: this.#projector.get(task.id)
|
|
348
|
+
};
|
|
349
|
+
if (result.ok === false && result.reason === "blocked") result = {
|
|
276
350
|
ok: true,
|
|
277
351
|
model: this.#projector.get(task.id)
|
|
278
352
|
};
|
|
@@ -124,6 +124,7 @@ function buildTaskExecutionDirective(sessionKey) {
|
|
|
124
124
|
`Remaining acceptance criteria: ${remainingCriteria.join("; ")}`,
|
|
125
125
|
contract.constraints.length ? `Constraints: ${contract.constraints.join("; ")}` : "",
|
|
126
126
|
contract.approvalRequired.length ? `Authority required: ${contract.approvalRequired.join("; ")}` : "",
|
|
127
|
+
...new TaskContextRepository().list(task.id).filter((edge) => typeof edge.metadata.userAnswer === "string").slice(-20).map((edge) => `User response to ${edge.title ?? "question"}: ${JSON.stringify(edge.metadata.userAnswer)}`),
|
|
127
128
|
handoffPayload ? `Handoff snapshot: ${handoffPayload}` : "",
|
|
128
129
|
"Take safe in-scope steps and produce inspectable evidence. Do not claim completion without verification.",
|
|
129
130
|
"</xopc_task_execution>"
|
|
@@ -104,6 +104,10 @@ var TaskRepository = class {
|
|
|
104
104
|
clauses.push("project_id = ?");
|
|
105
105
|
params.push(input.projectId);
|
|
106
106
|
}
|
|
107
|
+
if (input.search?.trim()) {
|
|
108
|
+
clauses.push("(instr(lower(title), lower(?)) > 0 OR instr(lower(coalesce(body, '')), lower(?)) > 0)");
|
|
109
|
+
params.push(input.search.trim(), input.search.trim());
|
|
110
|
+
}
|
|
107
111
|
const limit = Math.max(1, Math.min(200, Math.floor(input.limit ?? 50)));
|
|
108
112
|
params.push(limit);
|
|
109
113
|
return getSqliteDatabase().prepare(`SELECT * FROM tasks${clauses.length ? ` WHERE ${clauses.join(" AND ")}` : ""}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolveStateDir } from "../config/paths-state.js";
|
|
2
|
-
import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
3
2
|
import { init_paths, resolveAgentProfileDir, resolveBundledSkillsDir } from "../config/paths.js";
|
|
3
|
+
import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
4
4
|
import { resolveBootstrapFilesSync } from "../agent/bootstrap/bootstrap-files.js";
|
|
5
5
|
import { createSkillConfigManager, isSkillEnabled } from "../agent/skills/config.js";
|
|
6
6
|
import { loadSkills } from "../agent/skills/index.js";
|
package/dist/src/tui/tui.js
CHANGED
|
@@ -2,10 +2,10 @@ import { version } from "../../package.js";
|
|
|
2
2
|
import { resolveStateDir, resolveXopcDatabasePath } from "../config/paths-state.js";
|
|
3
3
|
import { parseAgentSessionKey } from "../routing/session-key-utils.js";
|
|
4
4
|
import { init_agent_session_key, normalizeAgentId } from "../routing/agent-session-key.js";
|
|
5
|
-
import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
6
5
|
import { init_paths } from "../config/paths.js";
|
|
7
6
|
import { loadConfig } from "../config/loader.js";
|
|
8
7
|
import { getAllModels, getAllProviders, getApiKey, init_providers, isProviderConfiguredSync } from "../providers/index.js";
|
|
8
|
+
import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
9
9
|
import { ProjectTrustStore, hasTrustRequiringProjectResources } from "../project-trust/trust-store.js";
|
|
10
10
|
import { MAX_WEBCHAT_ATTACHMENT_FILE_BYTES } from "../gateway/chat-limits.js";
|
|
11
11
|
import { renderWorkflowFinalSummary, renderWorkflowPanel } from "../agent/workflow/snapshot.js";
|