@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { init_agent_scope, listAgentEntries, normalizeAgentId, resolveAgentDir, resolveAgentProfileDir, resolveAgentWorkspaceDir, resolveDefaultAgentId, resolveUserPath, validateAgentIdForNewAgent } from "../agent/agent-scope.js";
|
|
2
|
-
import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
3
2
|
import { WORKSPACE_FILES, init_paths } from "../config/paths.js";
|
|
3
|
+
import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
4
4
|
import { AGENT_PROFILE_MARKDOWN_SYSTEM_FILES, REQUIRED_AGENT_PROFILE_MARKDOWN_FILE_SET } from "../agent/context/workspace.js";
|
|
5
5
|
import { isPathUnderWorkspace, resolveWorkspaceSafePath } from "./workspace-editor-path.js";
|
|
6
6
|
import { seedAgentProfileMarkdownFiles } from "../agent/context/workspace-seed.js";
|
|
@@ -442,9 +442,9 @@ function userMessageDisplayMetadata(value) {
|
|
|
442
442
|
if (!Array.isArray(rows)) return void 0;
|
|
443
443
|
const sourceContexts = rows.flatMap((value) => {
|
|
444
444
|
const row = asRecord(value);
|
|
445
|
-
if (row?.kind !== "note" || typeof row.sourceId !== "string" || typeof row.version !== "string" || typeof row.title !== "string") return [];
|
|
445
|
+
if (row?.kind !== "note" && row?.kind !== "task" || typeof row.sourceId !== "string" || typeof row.version !== "string" || typeof row.title !== "string") return [];
|
|
446
446
|
return [{
|
|
447
|
-
kind:
|
|
447
|
+
kind: row.kind,
|
|
448
448
|
sourceId: row.sourceId,
|
|
449
449
|
version: row.version,
|
|
450
450
|
title: row.title,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { init_paths_state, resolveStateDir } from "../config/paths-state.js";
|
|
2
2
|
import { init_agent_scope, resolveAgentProfileDir } from "../agent/agent-scope.js";
|
|
3
|
-
import { extractProfileAgentId } from "../config/agent-profile.js";
|
|
4
3
|
import { init_paths, resolveConfigPath, resolveSkillsDir } from "../config/paths.js";
|
|
4
|
+
import { extractProfileAgentId } from "../config/agent-profile.js";
|
|
5
5
|
import { isBareProfileMarkdownFileName, resolveProfileMarkdownPathIfBareName } from "../agent/tools/tool-paths.js";
|
|
6
6
|
import { isPathUnderWorkspace, resolveWorkspaceSafePath } from "./workspace-editor-path.js";
|
|
7
7
|
import { basename, isAbsolute, resolve } from "node:path";
|
|
@@ -180,8 +180,9 @@ function createHonoApp(config) {
|
|
|
180
180
|
};
|
|
181
181
|
const isFileUploadRequest = (path, method, contentType) => method === "POST" && /^\/api\/files\/spaces\/[^/]+\/upload$/.test(path) && contentType?.includes("multipart/form-data") === true;
|
|
182
182
|
const discussionUploadBodyMax = (path, method, contentType) => {
|
|
183
|
-
if (method !== "PUT"
|
|
184
|
-
if (/^\/api\/discussions\/[^/]+\/recording
|
|
183
|
+
if (method !== "PUT") return void 0;
|
|
184
|
+
if (/^\/api\/discussions\/[^/]+\/recording\/chunks\/\d+$/.test(path)) return 8 * 1024 * 1024;
|
|
185
|
+
if (contentType?.includes("multipart/form-data") !== true) return void 0;
|
|
185
186
|
if (/^\/api\/discussions\/[^/]+\/segments\/\d+$/.test(path)) return 2 * 1024 * 1024;
|
|
186
187
|
};
|
|
187
188
|
app.use("/api/skills/upload", bodyLimit({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ContextPlanningConfigSchema, KnowledgeMemoryConfigSchema, UserModelConfigSchema, init_config } from "../../../user-context/config.js";
|
|
2
2
|
import { init_agent_scope, listAgentEntries, normalizeAgentId, resolveDefaultAgentId } from "../../../agent/agent-scope.js";
|
|
3
3
|
import { resolveModelsJsonPath } from "../../../config/paths.js";
|
|
4
|
-
import { buildChannelCatalogForConfig, buildChannelCatalogFromSnapshot, getChannelSetupStatus, init_channel_catalog_service } from "../../../channels/catalog/channel-catalog-service.js";
|
|
5
4
|
import { init_models_json, loadModelsJson } from "../../../config/models-json.js";
|
|
6
5
|
import { CredentialResolver, init_credentials } from "../../../auth/credentials.js";
|
|
6
|
+
import { buildChannelCatalogForConfig, buildChannelCatalogFromSnapshot, getChannelSetupStatus, init_channel_catalog_service } from "../../../channels/catalog/channel-catalog-service.js";
|
|
7
7
|
import { getProviderRegistry, init_plugin_registry } from "../../../providers/plugin-registry.js";
|
|
8
8
|
import { getAllProviders, init_providers, isProviderConfigured } from "../../../providers/index.js";
|
|
9
9
|
import { normalizeConfiguredMcpServers } from "../../../config/mcp-config-normalize.js";
|
|
@@ -7,7 +7,6 @@ import { setAssertionStatus } from "../../../user-model/repository.js";
|
|
|
7
7
|
import "../../../user-model/index.js";
|
|
8
8
|
import { listConnectedContentCandidates, readConnectedContent } from "../../../connectors/content-enrichment.js";
|
|
9
9
|
import { getUnderstandingSourceGrant, listUnderstandingSourceGrants, listUnderstandingSourceRuns, revokeUnderstandingSourceGrant, updateUnderstandingSourceGrantPolicies } from "../../../user-context/sources/repository.js";
|
|
10
|
-
import { getWorkDiscoveryService } from "./work-discovery.js";
|
|
11
10
|
import { listUnderstandingSourceDefinitions } from "../../../user-context/sources/catalog.js";
|
|
12
11
|
import { randomUUID } from "node:crypto";
|
|
13
12
|
//#region src/gateway/hono/routes/context-sources.ts
|
|
@@ -38,7 +37,7 @@ function markContextSourceAssertionsForReview(grantId) {
|
|
|
38
37
|
return ids.length;
|
|
39
38
|
}
|
|
40
39
|
function registerContextSourceRoutes(authenticated, deps) {
|
|
41
|
-
const service =
|
|
40
|
+
const service = deps.service.workDiscovery;
|
|
42
41
|
const limited = deps.strictRateLimitMiddleware;
|
|
43
42
|
authenticated.get("/api/context-sources/catalog", (c) => {
|
|
44
43
|
const requested = c.req.query("platform");
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import { DISCUSSION_STATUSES } from "
|
|
2
|
-
import {
|
|
1
|
+
import { DISCUSSION_STATUSES } from "../../../../packages/gateway-contract/src/discussions.js";
|
|
2
|
+
import { hasGatewayScope } from "../../security/gateway-scopes.js";
|
|
3
|
+
import { DiscussionServiceError } from "../../../discussions/errors.js";
|
|
4
|
+
import { convertMeetingAction, meetingActionTasks } from "../../../discussions/action-tasks.js";
|
|
5
|
+
import { MeetingEditSchema } from "../../../discussions/edits.js";
|
|
6
|
+
import { exportDiscussion } from "../../../discussions/export.js";
|
|
3
7
|
import "../../../discussions/index.js";
|
|
8
|
+
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
9
|
+
import { createReadStream } from "node:fs";
|
|
10
|
+
import { stat } from "node:fs/promises";
|
|
11
|
+
import { Readable } from "node:stream";
|
|
4
12
|
//#region src/gateway/hono/routes/discussions.ts
|
|
5
13
|
function errorResponse(error) {
|
|
6
14
|
if (!(error instanceof DiscussionServiceError)) return null;
|
|
@@ -42,7 +50,8 @@ function registerDiscussionRoutes(authenticated, deps) {
|
|
|
42
50
|
clientRequestId: typeof body.clientRequestId === "string" ? body.clientRequestId : "",
|
|
43
51
|
...typeof body.contextProjectId === "string" && body.contextProjectId.trim() ? { contextProjectId: body.contextProjectId.trim() } : {},
|
|
44
52
|
consentPolicyVersion: Number(body.consentPolicyVersion),
|
|
45
|
-
source: body.source === "electron" ? "electron" : "web"
|
|
53
|
+
source: body.source === "mobile" ? "mobile" : body.source === "electron" ? "electron" : "web",
|
|
54
|
+
...body.recordedAt !== void 0 ? { recordedAt: typeof body.recordedAt === "number" ? body.recordedAt : NaN } : {}
|
|
46
55
|
});
|
|
47
56
|
return c.json(detail, 201);
|
|
48
57
|
} catch (error) {
|
|
@@ -74,7 +83,7 @@ function registerDiscussionRoutes(authenticated, deps) {
|
|
|
74
83
|
return detail ? c.json(detail) : c.json({ error: "Discussion not found" }, 404);
|
|
75
84
|
});
|
|
76
85
|
authenticated.get("/api/discussions/:id/transcript", (c) => {
|
|
77
|
-
const transcript = service.discussions.transcript(c.req.param("id"));
|
|
86
|
+
const transcript = service.discussions.transcript(c.req.param("id"), c.req.query("revision") === void 0 ? void 0 : Number(c.req.query("revision")));
|
|
78
87
|
return transcript ? c.json(transcript) : c.json({ error: "Discussion not found" }, 404);
|
|
79
88
|
});
|
|
80
89
|
authenticated.put("/api/discussions/:id/segments/:sequence", mediaRateLimitMiddleware, async (c) => {
|
|
@@ -107,36 +116,134 @@ function registerDiscussionRoutes(authenticated, deps) {
|
|
|
107
116
|
authenticated.patch("/api/discussions/:id/segments/:sequence", strictRateLimitMiddleware, async (c) => {
|
|
108
117
|
const body = await c.req.json().catch(() => ({}));
|
|
109
118
|
try {
|
|
110
|
-
return c.json(service.discussions.correctSegment(c.req.param("id"), Number.parseInt(c.req.param("sequence"), 10), typeof body.displayText === "string" ? body.displayText : "", Number(body.expectedRevision)));
|
|
119
|
+
return c.json(service.discussions.correctSegment(c.req.param("id"), Number.parseInt(c.req.param("sequence"), 10), typeof body.displayText === "string" ? body.displayText : "", Number(body.expectedRevision), typeof body.speakerLabel === "string" ? body.speakerLabel : void 0, body.applyToSpeakerGroup === true, typeof body.expectedTranscriptRevision === "number" ? body.expectedTranscriptRevision : void 0));
|
|
111
120
|
} catch (error) {
|
|
112
121
|
const response = errorResponse(error);
|
|
113
122
|
if (response) return c.json(response.body, response.status);
|
|
114
123
|
throw error;
|
|
115
124
|
}
|
|
116
125
|
});
|
|
117
|
-
authenticated.
|
|
118
|
-
const body = await
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
126
|
+
authenticated.post("/api/discussions/:id/organize", strictRateLimitMiddleware, async (c) => {
|
|
127
|
+
const body = await c.req.json().catch(() => ({}));
|
|
128
|
+
try {
|
|
129
|
+
return c.json(await service.discussions.reorganize(c.req.param("id"), typeof body.template === "string" ? body.template : "general"), 202);
|
|
130
|
+
} catch (error) {
|
|
131
|
+
const response = errorResponse(error);
|
|
132
|
+
if (response) return c.json(response.body, response.status);
|
|
133
|
+
throw error;
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
authenticated.patch("/api/discussions/:id/summary", strictRateLimitMiddleware, async (c) => {
|
|
137
|
+
const parsed = MeetingEditSchema.safeParse(await c.req.json().catch(() => null));
|
|
138
|
+
if (!parsed.success) return c.json({ error: "Invalid meeting edit" }, 400);
|
|
122
139
|
try {
|
|
123
|
-
|
|
124
|
-
name: file.name,
|
|
125
|
-
buffer: Buffer.from(await file.arrayBuffer()),
|
|
126
|
-
mimeType: file.type
|
|
127
|
-
}, Number(body.durationMs));
|
|
128
|
-
return detail ? c.json(detail, 201) : c.json({ error: "Discussion not found" }, 404);
|
|
140
|
+
return c.json(service.discussions.editSummary(c.req.param("id"), parsed.data));
|
|
129
141
|
} catch (error) {
|
|
130
142
|
const response = errorResponse(error);
|
|
131
143
|
if (response) return c.json(response.body, response.status);
|
|
132
144
|
throw error;
|
|
133
145
|
}
|
|
134
146
|
});
|
|
135
|
-
authenticated.
|
|
147
|
+
authenticated.get("/api/discussions/:id/actions", async (c) => {
|
|
148
|
+
if (!await service.discussions.get(c.req.param("id"))) return c.json({ error: "Discussion not found" }, 404);
|
|
149
|
+
return c.json(meetingActionTasks(c.req.param("id")));
|
|
150
|
+
});
|
|
151
|
+
authenticated.post("/api/discussions/:id/actions/:actionId/convert", strictRateLimitMiddleware, async (c) => {
|
|
152
|
+
if (!hasGatewayScope(getGatewayPrincipal(c).scopes, "tasks.write")) return c.json({ error: "Task write permission required" }, 403);
|
|
136
153
|
const body = await c.req.json().catch(() => ({}));
|
|
137
154
|
try {
|
|
138
|
-
|
|
139
|
-
|
|
155
|
+
return c.json(convertMeetingAction(c.req.param("id"), c.req.param("actionId"), Number(body.organizationRevision)));
|
|
156
|
+
} catch (error) {
|
|
157
|
+
const response = errorResponse(error);
|
|
158
|
+
if (response) return c.json(response.body, response.status);
|
|
159
|
+
throw error;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
authenticated.get("/api/discussions/:id/export", async (c) => {
|
|
163
|
+
const detail = await service.discussions.get(c.req.param("id"));
|
|
164
|
+
if (!detail) return c.json({ error: "Discussion not found" }, 404);
|
|
165
|
+
const format = c.req.query("format") ?? "md";
|
|
166
|
+
try {
|
|
167
|
+
const text = exportDiscussion(detail, format);
|
|
168
|
+
c.header("Content-Disposition", `attachment; filename="meeting.${format}"`);
|
|
169
|
+
c.header("Cache-Control", "no-store");
|
|
170
|
+
return c.text(text);
|
|
171
|
+
} catch (error) {
|
|
172
|
+
const response = errorResponse(error);
|
|
173
|
+
if (response) return c.json(response.body, response.status);
|
|
174
|
+
throw error;
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
authenticated.get("/api/discussions/:id/audio", async (c) => {
|
|
178
|
+
const detail = await service.discussions.get(c.req.param("id"));
|
|
179
|
+
if (!detail?.discussion.audioAttachmentId || detail.discussion.audioDeletedAt) return c.json({ error: "Recording unavailable" }, 404);
|
|
180
|
+
const attachment = await service.notesServiceInstance.getAttachmentPath(detail.note.id, detail.discussion.audioAttachmentId);
|
|
181
|
+
if (!attachment) return c.json({ error: "Recording unavailable" }, 404);
|
|
182
|
+
const info = await stat(attachment.filePath).catch(() => null);
|
|
183
|
+
if (!info) return c.json({ error: "Recording unavailable" }, 404);
|
|
184
|
+
let start = 0;
|
|
185
|
+
let end = info.size - 1;
|
|
186
|
+
const range = c.req.header("range");
|
|
187
|
+
if (range) {
|
|
188
|
+
const match = /^bytes=(\d*)-(\d*)$/.exec(range);
|
|
189
|
+
if (!match || !match[1] && !match[2]) return c.body(null, 416, { "Content-Range": `bytes */${info.size}` });
|
|
190
|
+
if (!match[1]) start = Math.max(0, info.size - Number(match[2]));
|
|
191
|
+
else {
|
|
192
|
+
start = Number(match[1]);
|
|
193
|
+
if (match[2]) end = Math.min(end, Number(match[2]));
|
|
194
|
+
}
|
|
195
|
+
if (!Number.isSafeInteger(start) || !Number.isSafeInteger(end) || start > end || start >= info.size) return c.body(null, 416, { "Content-Range": `bytes */${info.size}` });
|
|
196
|
+
c.header("Content-Range", `bytes ${start}-${end}/${info.size}`);
|
|
197
|
+
}
|
|
198
|
+
c.header("Content-Type", attachment.mimeType);
|
|
199
|
+
c.header("Accept-Ranges", "bytes");
|
|
200
|
+
c.header("Content-Length", String(end - start + 1));
|
|
201
|
+
c.header("Cache-Control", "no-store");
|
|
202
|
+
return c.body(Readable.toWeb(createReadStream(attachment.filePath, {
|
|
203
|
+
start,
|
|
204
|
+
end
|
|
205
|
+
})), range ? 206 : 200);
|
|
206
|
+
});
|
|
207
|
+
authenticated.get("/api/discussions/:id/recording/chunks", (c) => {
|
|
208
|
+
try {
|
|
209
|
+
return c.json(service.discussions.recordingChunks(c.req.param("id")));
|
|
210
|
+
} catch (error) {
|
|
211
|
+
const response = errorResponse(error);
|
|
212
|
+
if (response) return c.json(response.body, response.status);
|
|
213
|
+
throw error;
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
authenticated.put("/api/discussions/:id/recording/chunks/:sequence", mediaRateLimitMiddleware, async (c) => {
|
|
217
|
+
if (!c.req.raw.body) return c.json({ error: "Missing audio body" }, 400);
|
|
218
|
+
try {
|
|
219
|
+
return c.json(await service.discussions.uploadRecordingChunk(c.req.param("id"), Number(c.req.param("sequence")), c.req.header("x-audio-sha256") ?? "", c.req.raw.body), 201);
|
|
220
|
+
} catch (error) {
|
|
221
|
+
const response = errorResponse(error);
|
|
222
|
+
if (response) return c.json(response.body, response.status);
|
|
223
|
+
throw error;
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
authenticated.get("/api/discussions/:id/recording/job", (c) => {
|
|
227
|
+
try {
|
|
228
|
+
const job = service.discussions.recordingJob(c.req.param("id"));
|
|
229
|
+
return job ? c.json(job) : c.json({ error: "Recording job not found" }, 404);
|
|
230
|
+
} catch (error) {
|
|
231
|
+
const response = errorResponse(error);
|
|
232
|
+
if (response) return c.json(response.body, response.status);
|
|
233
|
+
throw error;
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
authenticated.post("/api/discussions/:id/capture/seal", strictRateLimitMiddleware, async (c) => {
|
|
237
|
+
const body = await c.req.json().catch(() => ({}));
|
|
238
|
+
if (body.containerMode !== void 0 && body.containerMode !== "independent_wav") return c.json({ error: "Unsupported container mode" }, 400);
|
|
239
|
+
try {
|
|
240
|
+
return c.json(await service.discussions.sealRecording(c.req.param("id"), {
|
|
241
|
+
lastSequence: Number(body.lastSequence),
|
|
242
|
+
chunkCount: Number(body.chunkCount),
|
|
243
|
+
mimeType: typeof body.mimeType === "string" ? body.mimeType : "",
|
|
244
|
+
fileName: typeof body.fileName === "string" ? body.fileName : "",
|
|
245
|
+
...body.containerMode === "independent_wav" ? { containerMode: "independent_wav" } : {}
|
|
246
|
+
}), 202);
|
|
140
247
|
} catch (error) {
|
|
141
248
|
const response = errorResponse(error);
|
|
142
249
|
if (response) return c.json(response.body, response.status);
|
|
@@ -34,25 +34,6 @@ function contentDisposition(disposition, fileName) {
|
|
|
34
34
|
const sanitized = fileName.replace(/[\u0000-\u001f\u007f]/g, "_");
|
|
35
35
|
return `${disposition}; filename="${sanitized.replace(/[^\x20-\x7e]/g, "_").replace(/["\\]/g, "_")}"; filename*=UTF-8''${encodeURIComponent(sanitized).replace(/['()*]/g, (character) => `%${character.charCodeAt(0).toString(16).toUpperCase()}`)}`;
|
|
36
36
|
}
|
|
37
|
-
async function collectFiles(files, spaceId, max) {
|
|
38
|
-
const output = [];
|
|
39
|
-
const directories = [""];
|
|
40
|
-
const visited = /* @__PURE__ */ new Set();
|
|
41
|
-
const space = await files.get(spaceId);
|
|
42
|
-
while (directories.length && output.length < max) {
|
|
43
|
-
const directory = directories.shift();
|
|
44
|
-
const canonical = await resolveFilePath(space.root, directory).catch(() => null);
|
|
45
|
-
if (!canonical || visited.has(canonical)) continue;
|
|
46
|
-
visited.add(canonical);
|
|
47
|
-
const children = await files.children(spaceId, directory);
|
|
48
|
-
for (const child of children) {
|
|
49
|
-
if (child.kind === "directory") directories.push(child.relativePath);
|
|
50
|
-
else output.push(child);
|
|
51
|
-
if (output.length >= max) break;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return output;
|
|
55
|
-
}
|
|
56
37
|
function registerFilesRoutes(authenticated, deps) {
|
|
57
38
|
const files = getGatewayFileSpaceService(deps.service);
|
|
58
39
|
registerFileReferenceRoutes(authenticated, deps);
|
|
@@ -96,9 +77,7 @@ function registerFilesRoutes(authenticated, deps) {
|
|
|
96
77
|
authenticated.get("/api/files/recent", async (c) => {
|
|
97
78
|
try {
|
|
98
79
|
const limit = Math.min(100, Math.max(1, Number(c.req.query("limit")) || 50));
|
|
99
|
-
|
|
100
|
-
const items = (await Promise.all(spaces.map((space) => collectFiles(files, space.id, 5e3)))).flat().sort((a, b) => b.modifiedAt - a.modifiedAt).slice(0, limit);
|
|
101
|
-
return c.json({ items });
|
|
80
|
+
return c.json({ items: await files.recent(limit) });
|
|
102
81
|
} catch (error) {
|
|
103
82
|
return errorResponse(c, error);
|
|
104
83
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { registerConnectionWaitRoutes } from "./connection-waits.js";
|
|
2
2
|
import { registerActivityRoutes } from "./activity.js";
|
|
3
3
|
import { registerAgentStreamRoutes } from "./agent-stream.js";
|
|
4
|
-
import { registerDiscussionRoutes } from "./discussions.js";
|
|
5
4
|
import { registerSessionsRoutes } from "./sessions.js";
|
|
6
5
|
import { registerExecutionEnvironmentRoutes } from "./execution-environments.js";
|
|
7
6
|
import { registerSideChatRoutes } from "./side-chats.js";
|
|
@@ -32,7 +31,6 @@ function registerCoreAuthenticatedRoutes(authenticated, deps) {
|
|
|
32
31
|
registerExecutionEnvironmentRoutes(authenticated, deps);
|
|
33
32
|
registerSideChatRoutes(authenticated, deps);
|
|
34
33
|
registerActivityRoutes(authenticated, deps);
|
|
35
|
-
registerDiscussionRoutes(authenticated, deps);
|
|
36
34
|
registerProjectsRoutes(authenticated, deps);
|
|
37
35
|
registerProjectSkillRoutes(authenticated, deps);
|
|
38
36
|
registerLocalAppsRoutes(authenticated, deps);
|
|
@@ -3,6 +3,14 @@ function startsWithAny(path, prefixes) {
|
|
|
3
3
|
return prefixes.some((prefix) => path === prefix || path.startsWith(`${prefix}/`));
|
|
4
4
|
}
|
|
5
5
|
const AUTHENTICATED_LAZY_ROUTE_BUNDLES = [
|
|
6
|
+
{
|
|
7
|
+
id: "project-understanding",
|
|
8
|
+
match: (path) => /^\/api\/projects\/[^/]+\/understanding$/.test(path),
|
|
9
|
+
load: async () => {
|
|
10
|
+
const { registerProjectUnderstandingRoutes } = await import("./project-understanding.js");
|
|
11
|
+
return { register: registerProjectUnderstandingRoutes };
|
|
12
|
+
}
|
|
13
|
+
},
|
|
6
14
|
{
|
|
7
15
|
id: "browser-session",
|
|
8
16
|
match: (path) => path === "/api/browser-session",
|
|
@@ -210,6 +218,14 @@ const AUTHENTICATED_LAZY_ROUTE_BUNDLES = [
|
|
|
210
218
|
return { register: registerAutomationRoutes };
|
|
211
219
|
}
|
|
212
220
|
},
|
|
221
|
+
{
|
|
222
|
+
id: "discussions",
|
|
223
|
+
match: (path) => path === "/api/discussions" || path.startsWith("/api/discussions/") || path === "/api/discussion-capture/settings",
|
|
224
|
+
load: async () => {
|
|
225
|
+
const { registerDiscussionRoutes } = await import("./discussions.js");
|
|
226
|
+
return { register: registerDiscussionRoutes };
|
|
227
|
+
}
|
|
228
|
+
},
|
|
213
229
|
{
|
|
214
230
|
id: "notes",
|
|
215
231
|
match: (path) => startsWithAny(path, ["/api/notes"]) && !/^\/api\/notes\/[^/]+\/hosted-publications(?:\/.*)?$/.test(path),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { resolveModelsJsonPath } from "../../../config/paths.js";
|
|
2
1
|
import { init_resolve_config_value, testApiKeyResolution } from "../../../config/resolve-config-value.js";
|
|
2
|
+
import { resolveModelsJsonPath } from "../../../config/paths.js";
|
|
3
3
|
import { init_models_json, loadModelsJson, saveModelsJson, validateModelsConfig } from "../../../config/models-json.js";
|
|
4
4
|
import { getModelCatalogStore, init_model_catalog_store } from "../../../providers/model-catalog-store.js";
|
|
5
5
|
import { getModelRegistry } from "../../../providers/model-registry.js";
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import { getSqliteDatabase } from "../../../storage/sqlite/transaction.js";
|
|
2
1
|
import { ProactiveConflict, proactivePreferences, updateProactivePreferences } from "../../../proactive/policy/service.js";
|
|
3
|
-
import {
|
|
2
|
+
import { updateControlledSubscription } from "../../../proactive/scenarios/control.js";
|
|
4
3
|
import { listMailFollowUps, mailFollowUpSources, startMailFollowUp, updateMailFollowUp } from "../../../proactive/follow-ups.js";
|
|
5
|
-
import { cardChanges, getCard,
|
|
4
|
+
import { cardChanges, getCard, performCardAction } from "../../../proactive/inbox/cards.js";
|
|
6
5
|
import { checkDelegation, delegationOverview, startDelegation } from "../../../proactive/experience.js";
|
|
7
6
|
import { recordProactivePresence } from "../../../proactive/policy/presence.js";
|
|
8
7
|
import { digestCards } from "../../../proactive/inbox/digest.js";
|
|
9
8
|
import { acknowledgeBrowserProbe, listBrowserProbes, prepareBrowserPush, registerBrowserPush, testBrowserPush, unregisterBrowserPush } from "../../../notifications/web-push.js";
|
|
10
|
-
import { ReadonlyProactiveAgentExecutor } from "../../../proactive/execution/agent-executor.js";
|
|
11
9
|
import { proactiveMetrics } from "../../../proactive/metrics.js";
|
|
12
|
-
import { previewSubscription } from "../../../proactive/scenarios/preview.js";
|
|
13
10
|
import { ZodError } from "zod";
|
|
14
11
|
//#region src/gateway/hono/routes/proactive-control.ts
|
|
15
12
|
function registerProactiveControlRoutes(app, deps) {
|
|
@@ -94,14 +91,6 @@ function registerProactiveControlRoutes(app, deps) {
|
|
|
94
91
|
ok: true,
|
|
95
92
|
cards: digestCards(c.req.param("id"), workspace())
|
|
96
93
|
}));
|
|
97
|
-
app.post("/api/proactive/subscriptions/:id/preview", deps.strictRateLimitMiddleware, async (c) => c.json({
|
|
98
|
-
ok: true,
|
|
99
|
-
...await previewSubscription(workspace(), c.req.param("id"), new ReadonlyProactiveAgentExecutor(() => deps.service.getConfig()), c.req.raw.signal)
|
|
100
|
-
}));
|
|
101
|
-
app.get("/api/proactive/templates", (c) => c.json({
|
|
102
|
-
ok: true,
|
|
103
|
-
templates: templateCatalog(workspace())
|
|
104
|
-
}));
|
|
105
94
|
app.get("/api/proactive/preferences", (c) => c.json({
|
|
106
95
|
ok: true,
|
|
107
96
|
preferences: proactivePreferences(workspace())
|
|
@@ -110,33 +99,10 @@ function registerProactiveControlRoutes(app, deps) {
|
|
|
110
99
|
ok: true,
|
|
111
100
|
preferences: updateProactivePreferences(workspace(), await c.req.json())
|
|
112
101
|
}));
|
|
113
|
-
app.get("/api/proactive/subscriptions", (c) => c.json({
|
|
114
|
-
ok: true,
|
|
115
|
-
subscriptions: controlledSubscriptions(workspace())
|
|
116
|
-
}));
|
|
117
|
-
app.post("/api/proactive/subscriptions", deps.strictRateLimitMiddleware, async (c) => c.json({
|
|
118
|
-
ok: true,
|
|
119
|
-
subscription: createControlledSubscription(workspace(), await c.req.json())
|
|
120
|
-
}, 201));
|
|
121
102
|
app.patch("/api/proactive/subscriptions/:id", deps.strictRateLimitMiddleware, async (c) => c.json({
|
|
122
103
|
ok: true,
|
|
123
104
|
subscription: updateControlledSubscription(workspace(), c.req.param("id"), await c.req.json())
|
|
124
105
|
}));
|
|
125
|
-
app.get("/api/proactive/subscriptions/:id/runs", (c) => {
|
|
126
|
-
requireSubscription(c.req.param("id"), workspace());
|
|
127
|
-
return c.json({
|
|
128
|
-
ok: true,
|
|
129
|
-
runs: getSqliteDatabase().prepare(`SELECT run_id AS id, status, outcome_reason AS reason,
|
|
130
|
-
started_at AS startedAt, completed_at AS completedAt, error_message AS error FROM proactive_runs WHERE subscription_id = ? ORDER BY started_at DESC LIMIT 30`).all(c.req.param("id"))
|
|
131
|
-
});
|
|
132
|
-
});
|
|
133
|
-
app.get("/api/proactive/cards", (c) => c.json({
|
|
134
|
-
ok: true,
|
|
135
|
-
...listCards(workspace(), {
|
|
136
|
-
status: c.req.query("status"),
|
|
137
|
-
before: c.req.query("before")
|
|
138
|
-
})
|
|
139
|
-
}));
|
|
140
106
|
app.get("/api/inbox/judgments/changes", (c) => {
|
|
141
107
|
const cursor = Number(c.req.query("cursor") ?? 0);
|
|
142
108
|
if (!Number.isSafeInteger(cursor) || cursor < 0) return c.json({
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { getProjectUnderstandingRun } from "../../../work-discovery/repository.js";
|
|
2
|
+
import { getProjectUnderstandingOverview, saveProjectUnderstandingOverview } from "../../../work-discovery/project-understanding.js";
|
|
3
|
+
//#region src/gateway/hono/routes/project-understanding.ts
|
|
4
|
+
function registerProjectUnderstandingRoutes(authenticated, deps) {
|
|
5
|
+
const { service } = deps;
|
|
6
|
+
authenticated.get("/api/projects/:id/understanding", (c) => {
|
|
7
|
+
const projectId = c.req.param("id");
|
|
8
|
+
if (!service.projects.get(projectId)) return c.json({
|
|
9
|
+
ok: false,
|
|
10
|
+
error: "Project not found"
|
|
11
|
+
}, 404);
|
|
12
|
+
const run = getProjectUnderstandingRun(projectId);
|
|
13
|
+
const overview = getProjectUnderstandingOverview(projectId);
|
|
14
|
+
return c.json({
|
|
15
|
+
ok: true,
|
|
16
|
+
status: run?.status ?? "not_started",
|
|
17
|
+
overview: overview?.content ?? null,
|
|
18
|
+
updatedAt: overview?.updatedAt ?? null
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
authenticated.post("/api/projects/:id/understanding", (c) => {
|
|
22
|
+
const projectId = c.req.param("id");
|
|
23
|
+
if (!service.projects.get(projectId)) return c.json({
|
|
24
|
+
ok: false,
|
|
25
|
+
error: "Project not found"
|
|
26
|
+
}, 404);
|
|
27
|
+
try {
|
|
28
|
+
const run = deps.service.workDiscovery.startProjectUnderstanding(projectId);
|
|
29
|
+
return c.json({
|
|
30
|
+
ok: true,
|
|
31
|
+
status: run.status
|
|
32
|
+
}, 202);
|
|
33
|
+
} catch (error) {
|
|
34
|
+
return c.json({
|
|
35
|
+
ok: false,
|
|
36
|
+
error: error instanceof Error ? error.message : String(error)
|
|
37
|
+
}, 400);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
authenticated.patch("/api/projects/:id/understanding", async (c) => {
|
|
41
|
+
const projectId = c.req.param("id");
|
|
42
|
+
if (!service.projects.get(projectId)) return c.json({
|
|
43
|
+
ok: false,
|
|
44
|
+
error: "Project not found"
|
|
45
|
+
}, 404);
|
|
46
|
+
const body = await c.req.json().catch(() => ({}));
|
|
47
|
+
const content = body && typeof body.content === "string" ? body.content.trim() : void 0;
|
|
48
|
+
if (!content || content.length > 6e3) return c.json({
|
|
49
|
+
ok: false,
|
|
50
|
+
error: "Overview must contain 1–6000 characters"
|
|
51
|
+
}, 400);
|
|
52
|
+
const overview = saveProjectUnderstandingOverview({
|
|
53
|
+
projectId,
|
|
54
|
+
content,
|
|
55
|
+
correctedByUser: true
|
|
56
|
+
});
|
|
57
|
+
return c.json({
|
|
58
|
+
ok: true,
|
|
59
|
+
overview: overview.content,
|
|
60
|
+
updatedAt: overview.updatedAt
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
export { registerProjectUnderstandingRoutes };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { createLogger } from "../../../utils/logger/index.js";
|
|
2
|
+
import { init_logger } from "../../../utils/logger.js";
|
|
1
3
|
import { getSqliteDatabase } from "../../../storage/sqlite/transaction.js";
|
|
2
4
|
import { getSessionMetadata } from "../../../storage/sqlite/session-repository.js";
|
|
3
5
|
import { loadTranscriptRowsForSession } from "../../../storage/sqlite/transcript-repository.js";
|
|
@@ -20,9 +22,12 @@ import { TaskApplicationService } from "../../../tasks/task-application-service.
|
|
|
20
22
|
import { defineTaskContract } from "../../../tasks/task-contract-definition.js";
|
|
21
23
|
import { ProjectOperatingViewService, summarizeProjectOperatingView } from "../../../tasks/project-operating-view-service.js";
|
|
22
24
|
import "../../../tasks/index.js";
|
|
25
|
+
import { getProjectUnderstandingRun } from "../../../work-discovery/repository.js";
|
|
23
26
|
import { parseActivityIncludeRelated, parseActivityQuery } from "./activity.js";
|
|
24
27
|
import { randomUUID } from "node:crypto";
|
|
25
28
|
//#region src/gateway/hono/routes/projects.ts
|
|
29
|
+
init_logger();
|
|
30
|
+
const log = createLogger("Projects");
|
|
26
31
|
function parseProjectStatus(raw) {
|
|
27
32
|
return raw === "planned" || raw === "active" || raw === "paused" || raw === "completed" || raw === "cancelled" || raw === "archived" ? raw : void 0;
|
|
28
33
|
}
|
|
@@ -34,9 +39,6 @@ function parseLimit(raw, fallback = 50) {
|
|
|
34
39
|
const n = Number.parseInt(raw, 10);
|
|
35
40
|
return Number.isFinite(n) ? Math.min(500, Math.max(1, n)) : fallback;
|
|
36
41
|
}
|
|
37
|
-
function isHiddenEmptyProjectChatShell(session) {
|
|
38
|
-
return session.hiddenFromSessionList === true && session.messageCount === 0 && (session.customData?.origin === "automation" || session.customData?.genericNewChatShell !== false && Boolean(session.routing?.peerId?.startsWith("chat_")));
|
|
39
|
-
}
|
|
40
42
|
function textField(body, key) {
|
|
41
43
|
const value = body[key];
|
|
42
44
|
return typeof value === "string" ? value : void 0;
|
|
@@ -151,6 +153,10 @@ function registerProjectsRoutes(authenticated, deps) {
|
|
|
151
153
|
const body = await c.req.json().catch(() => ({}));
|
|
152
154
|
const name = textField(body, "name")?.trim();
|
|
153
155
|
const workspaceRoot = textField(body, "workspaceRoot")?.trim();
|
|
156
|
+
if (body.autoUnderstand !== void 0 && typeof body.autoUnderstand !== "boolean") return c.json({
|
|
157
|
+
ok: false,
|
|
158
|
+
error: "autoUnderstand must be a boolean"
|
|
159
|
+
}, 400);
|
|
154
160
|
if (!name && !workspaceRoot) return c.json({
|
|
155
161
|
ok: false,
|
|
156
162
|
error: "Missing name"
|
|
@@ -192,6 +198,14 @@ function registerProjectsRoutes(authenticated, deps) {
|
|
|
192
198
|
ownerId: textField(body, "ownerId"),
|
|
193
199
|
targetAt: optionalNumberField(body, "targetAt") ?? void 0
|
|
194
200
|
});
|
|
201
|
+
if (body.autoUnderstand === true) try {
|
|
202
|
+
deps.service.workDiscovery.startProjectUnderstanding(project.id);
|
|
203
|
+
} catch (err) {
|
|
204
|
+
log.warn({
|
|
205
|
+
err,
|
|
206
|
+
projectId: project.id
|
|
207
|
+
}, "Project created but understanding could not be queued");
|
|
208
|
+
}
|
|
195
209
|
return c.json({
|
|
196
210
|
ok: true,
|
|
197
211
|
project: enrichProjectWorkspace(service, project)
|
|
@@ -691,6 +705,8 @@ function registerProjectsRoutes(authenticated, deps) {
|
|
|
691
705
|
code: "execution_environments_exist",
|
|
692
706
|
error: "Delete the project execution environments before deleting the project"
|
|
693
707
|
}, 409);
|
|
708
|
+
const understandingRun = getProjectUnderstandingRun(projectId);
|
|
709
|
+
if (understandingRun) deps.service.workDiscovery.cancelRun(understandingRun.id);
|
|
694
710
|
service.projects.delete(projectId);
|
|
695
711
|
return c.json({ ok: true });
|
|
696
712
|
});
|
|
@@ -700,7 +716,7 @@ function registerProjectsRoutes(authenticated, deps) {
|
|
|
700
716
|
const sessions = await Promise.all(keys.map((key) => service.sessions.getSession(key)));
|
|
701
717
|
return c.json({
|
|
702
718
|
ok: true,
|
|
703
|
-
sessions: sessions.filter((session) => session && !
|
|
719
|
+
sessions: sessions.filter((session) => session && !session.hiddenFromSessionList)
|
|
704
720
|
});
|
|
705
721
|
} catch (error) {
|
|
706
722
|
return c.json({
|
|
@@ -74,7 +74,7 @@ export declare function submitSessionInput(c: Context, deps: AuthenticatedRouteD
|
|
|
74
74
|
documentId?: string;
|
|
75
75
|
}[];
|
|
76
76
|
contextSnapshots?: {
|
|
77
|
-
kind: import("../../../agent/source-context/types.js").SessionSourceBinding["kind"] | "browser_page";
|
|
77
|
+
kind: import("../../../agent/source-context/types.js").SessionSourceBinding["kind"] | "task" | "browser_page";
|
|
78
78
|
sourceId: string;
|
|
79
79
|
version: string;
|
|
80
80
|
title: string;
|
|
@@ -180,7 +180,7 @@ export declare function replaceLatestSessionTurn(c: Context, deps: Authenticated
|
|
|
180
180
|
documentId?: string;
|
|
181
181
|
}[];
|
|
182
182
|
contextSnapshots?: {
|
|
183
|
-
kind: import("../../../agent/source-context/types.js").SessionSourceBinding["kind"] | "browser_page";
|
|
183
|
+
kind: import("../../../agent/source-context/types.js").SessionSourceBinding["kind"] | "task" | "browser_page";
|
|
184
184
|
sourceId: string;
|
|
185
185
|
version: string;
|
|
186
186
|
title: string;
|
|
@@ -24,7 +24,7 @@ async function submitSessionInput(c, deps, sessionKey) {
|
|
|
24
24
|
ok: false,
|
|
25
25
|
error: {
|
|
26
26
|
code: "BAD_REQUEST",
|
|
27
|
-
message: `contextRefs must contain at most ${MAX_TURN_CONTEXTS} valid
|
|
27
|
+
message: `contextRefs must contain at most ${MAX_TURN_CONTEXTS} valid note or task references`
|
|
28
28
|
}
|
|
29
29
|
}, 400);
|
|
30
30
|
const browserContexts = browserPageContextsInputSchema.safeParse(body.browserContexts ?? []);
|
|
@@ -170,7 +170,7 @@ async function replaceLatestSessionTurn(c, deps, sessionKey, targetTurnId) {
|
|
|
170
170
|
ok: false,
|
|
171
171
|
error: {
|
|
172
172
|
code: "BAD_REQUEST",
|
|
173
|
-
message: `contextRefs must contain at most ${MAX_TURN_CONTEXTS} valid
|
|
173
|
+
message: `contextRefs must contain at most ${MAX_TURN_CONTEXTS} valid note or task references`
|
|
174
174
|
}
|
|
175
175
|
}, 400);
|
|
176
176
|
const content = typeof body.content === "string" ? body.content : "";
|