@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
|
@@ -8,6 +8,12 @@ const TARGET_SAMPLE_RATE = 16e3;
|
|
|
8
8
|
const MAX_DECODED_DURATION_SECONDS = 900;
|
|
9
9
|
const MAX_DECODED_BYTES = TARGET_SAMPLE_RATE * 4 * MAX_DECODED_DURATION_SECONDS;
|
|
10
10
|
const MAX_SEGMENTED_DURATION_SECONDS = 1800;
|
|
11
|
+
const LOCAL_AUDIO_INPUT_OPTIONS = [
|
|
12
|
+
"-protocol_whitelist",
|
|
13
|
+
"file,pipe",
|
|
14
|
+
"-format_whitelist",
|
|
15
|
+
"wav,matroska,webm,ogg,mp3,mov"
|
|
16
|
+
];
|
|
11
17
|
var AudioNormalizationError = class extends Error {
|
|
12
18
|
code = "unsupported_audio_codec";
|
|
13
19
|
constructor(message, options) {
|
|
@@ -73,23 +79,30 @@ function runFfmpeg(args, options = {}) {
|
|
|
73
79
|
let outputBytes = 0;
|
|
74
80
|
let errorBytes = 0;
|
|
75
81
|
let settled = false;
|
|
82
|
+
let terminationError;
|
|
83
|
+
let killTimer;
|
|
76
84
|
const finish = (error) => {
|
|
77
85
|
if (settled) return;
|
|
78
86
|
settled = true;
|
|
87
|
+
if (killTimer) clearTimeout(killTimer);
|
|
79
88
|
options.signal?.removeEventListener("abort", abort);
|
|
80
89
|
if (error) reject(error);
|
|
81
90
|
else resolve(Buffer.concat(stdout));
|
|
82
91
|
};
|
|
83
|
-
const
|
|
92
|
+
const terminate = (error) => {
|
|
93
|
+
if (terminationError || settled) return;
|
|
94
|
+
terminationError = error;
|
|
84
95
|
child.kill("SIGTERM");
|
|
85
|
-
|
|
96
|
+
killTimer = setTimeout(() => child.kill("SIGKILL"), 2e3);
|
|
97
|
+
killTimer.unref();
|
|
86
98
|
};
|
|
99
|
+
const abort = () => terminate(new AudioNormalizationError("Audio decoding was cancelled"));
|
|
87
100
|
options.signal?.addEventListener("abort", abort, { once: true });
|
|
88
101
|
child.stdout.on("data", (chunk) => {
|
|
102
|
+
if (terminationError) return;
|
|
89
103
|
outputBytes += chunk.length;
|
|
90
104
|
if (options.maxOutputBytes != null && outputBytes > options.maxOutputBytes) {
|
|
91
|
-
|
|
92
|
-
finish(new AudioNormalizationError("Decoded audio exceeds the supported duration"));
|
|
105
|
+
terminate(new AudioNormalizationError("Decoded audio exceeds the supported duration"));
|
|
93
106
|
return;
|
|
94
107
|
}
|
|
95
108
|
stdout.push(chunk);
|
|
@@ -105,6 +118,10 @@ function runFfmpeg(args, options = {}) {
|
|
|
105
118
|
});
|
|
106
119
|
child.once("close", (code) => {
|
|
107
120
|
if (settled) return;
|
|
121
|
+
if (terminationError) {
|
|
122
|
+
finish(terminationError);
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
108
125
|
if (code === 0) finish();
|
|
109
126
|
else finish(new AudioNormalizationError(Buffer.concat(stderr).toString("utf8").trim() || `Unsupported or corrupt audio (decoder exit ${code})`));
|
|
110
127
|
});
|
|
@@ -123,6 +140,7 @@ async function decodeAudioToMonoFloat32(input) {
|
|
|
123
140
|
if (!(error instanceof UnsupportedWavEncodingError)) throw error;
|
|
124
141
|
}
|
|
125
142
|
const bytes = await runFfmpeg([
|
|
143
|
+
...LOCAL_AUDIO_INPUT_OPTIONS,
|
|
126
144
|
"-i",
|
|
127
145
|
"pipe:0",
|
|
128
146
|
"-map",
|
|
@@ -159,6 +177,7 @@ async function forEachNormalizedAudioSegment(input, consume) {
|
|
|
159
177
|
const outputPattern = join(directory, "segment-%05d.wav");
|
|
160
178
|
try {
|
|
161
179
|
await runFfmpeg([
|
|
180
|
+
...LOCAL_AUDIO_INPUT_OPTIONS,
|
|
162
181
|
"-i",
|
|
163
182
|
input.filePath,
|
|
164
183
|
"-map",
|
|
@@ -184,11 +203,15 @@ async function forEachNormalizedAudioSegment(input, consume) {
|
|
|
184
203
|
if (files.length === 0) throw new AudioNormalizationError("Audio decoder produced no segments");
|
|
185
204
|
let decodedDurationSeconds = 0;
|
|
186
205
|
for (const file of files) {
|
|
206
|
+
input.signal?.throwIfAborted();
|
|
187
207
|
const decoded = decodeWavToMonoFloat32(await readFile(join(directory, file)));
|
|
188
208
|
decodedDurationSeconds += decoded.durationSeconds;
|
|
189
209
|
if (decodedDurationSeconds > maxDurationSeconds + .05) throw new AudioNormalizationError(`Decoded audio exceeds the ${Math.round(maxDurationSeconds)} second limit`);
|
|
190
210
|
}
|
|
191
|
-
for (let index = 0; index < files.length; index += 1)
|
|
211
|
+
for (let index = 0; index < files.length; index += 1) {
|
|
212
|
+
input.signal?.throwIfAborted();
|
|
213
|
+
await consume(await readFile(join(directory, files[index])), index);
|
|
214
|
+
}
|
|
192
215
|
return files.length;
|
|
193
216
|
} finally {
|
|
194
217
|
await rm(directory, {
|
|
@@ -82,6 +82,7 @@ async function transcribe(audioBuffer, config, options) {
|
|
|
82
82
|
const fallbackFrom = chosen.provider && chosen.provider !== primaryProvider ? primaryProvider : void 0;
|
|
83
83
|
return {
|
|
84
84
|
text: output.text,
|
|
85
|
+
...output.segments ? { segments: output.segments } : {},
|
|
85
86
|
provider: chosen.provider ?? "unknown",
|
|
86
87
|
...output.durationSeconds !== void 0 ? { duration: output.durationSeconds } : {},
|
|
87
88
|
...output.language || options?.language ? { language: output.language ?? options?.language } : {},
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* (see src/media-understanding/types.ts).
|
|
7
7
|
*/
|
|
8
8
|
export interface STTResult {
|
|
9
|
+
segments?: import('../../media-understanding/types.js').AudioTranscriptionSegment[];
|
|
9
10
|
/** Transcribed text. */
|
|
10
11
|
text: string;
|
|
11
12
|
/** Provider that performed the transcription (e.g. "alibaba", "openai"). */
|
|
@@ -184,27 +184,33 @@ async function analyzeWorkContext(input) {
|
|
|
184
184
|
"You help a user resume real work in one explicitly selected local folder.",
|
|
185
185
|
"Analyze only the supplied bounded snapshot. Never claim that you ran commands, tests, or inspected anything absent from it.",
|
|
186
186
|
"Return only one JSON object with projectSummary, currentState, uncertainties, suggestions, profileCandidates, workThreads, conversationStarter, lowConfidence, and contextQuestion.",
|
|
187
|
-
"profileCandidates contains only durable user-specific role, responsibility, preference, routine, communication, boundary, or relationship facts that are directly supported and would remain useful outside this repository snapshot.",
|
|
188
|
-
"Do not put the project stack, packages, architecture, deployment setup, repository conventions, or current task in profileCandidates. Put project facts in projectSummary/currentState and current work in workThreads.",
|
|
189
|
-
"Each profile candidate has category (role, responsibility, preference, routine, communication, boundary, or relationship), factKey, statement, confidence, and evidence.",
|
|
190
|
-
"Put current or desired outcomes in workThreads, not profileCandidates. Emit boundary or relationship only when directly stated in user-authored evidence; never infer private relationship labels or expanded permissions.",
|
|
191
|
-
"factKey is a stable language-neutral lowercase identifier such as workflow:code-review:github; equivalent facts in different languages must use the same factKey.",
|
|
192
187
|
USER_FACING_UNDERSTANDING_WRITING_GUIDANCE,
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
188
|
+
...input.projectOverviewOnly ? [
|
|
189
|
+
"This request is background project understanding. Return empty suggestions, profileCandidates, and workThreads; omit conversationStarter and contextQuestion. Do not ask the user to make decisions.",
|
|
190
|
+
"Use projectSummary to describe the documented purpose and structure, and currentState for startup/test commands, project conventions, and constraints. Cite the supporting relative file paths inline.",
|
|
191
|
+
"Keep the overview concise. Distinguish documented facts from interpretations. Put missing goals and uncertain assumptions in uncertainties; never treat inferred goals as user-confirmed."
|
|
192
|
+
] : [
|
|
193
|
+
"profileCandidates contains only durable user-specific role, responsibility, preference, routine, communication, boundary, or relationship facts that are directly supported and would remain useful outside this repository snapshot.",
|
|
194
|
+
"Do not put the project stack, packages, architecture, deployment setup, repository conventions, or current task in profileCandidates. Put project facts in projectSummary/currentState and current work in workThreads.",
|
|
195
|
+
"Each profile candidate has category (role, responsibility, preference, routine, communication, boundary, or relationship), factKey, statement, confidence, and evidence.",
|
|
196
|
+
"Put current or desired outcomes in workThreads, not profileCandidates. Emit boundary or relationship only when directly stated in user-authored evidence; never infer private relationship labels or expanded permissions.",
|
|
197
|
+
"factKey is a stable language-neutral lowercase identifier such as workflow:code-review:github; equivalent facts in different languages must use the same factKey.",
|
|
198
|
+
"Do not infer sensitive traits, identity, health, finances, political views, or anything not directly supported by the work evidence.",
|
|
199
|
+
"workThreads contains every distinct evidence-backed work stream with topicKey, title, summary, horizon, status, confidence, and evidenceRefs. Do not merge unrelated streams to force a fixed count.",
|
|
200
|
+
"horizon is current, ongoing, or long_term. status is active, paused, blocked, completed, or uncertain.",
|
|
201
|
+
"topicKey is a short stable topic identifier. evidenceRefs must use exact relative paths from the snapshot or git://recent-state.",
|
|
202
|
+
"Distinguish one-off recent edits from work sustained across multiple days. Prefer one current thread and only add ongoing or long_term threads when evidence supports them.",
|
|
203
|
+
"For a normal result, suggestions must contain exactly 3 materially different next steps.",
|
|
204
|
+
"Each suggestion must include actionType, title, rationale, evidence, actionPrompt, confidence, expectedTask, estimatedMinutes, risk, and verification.",
|
|
205
|
+
"actionType must be summarize_recent_work, inspect_related_tests, or plan_next_step.",
|
|
206
|
+
"risk must be analysis, command, or file_write. estimatedMinutes is an integer from 1 to 30.",
|
|
207
|
+
"verification is a short array describing how the user can tell the task is real.",
|
|
208
|
+
"Each evidence item contains an optional exact relative path from the snapshot and one concrete observation.",
|
|
209
|
+
"actionPrompt asks the assistant to investigate or continue the step; it does not silently authorize file changes.",
|
|
210
|
+
"conversationStarter is one concise, editable first-person prompt the user can send immediately. Ground it in the most important visible project or directory signal, ask the assistant to explain before acting, and never silently authorize file changes.",
|
|
211
|
+
"Always return conversationStarter, including when confidence is low.",
|
|
212
|
+
"If the current objective is unclear or fewer than three credible suggestions exist, set lowConfidence=true, return suggestions=[], and ask one concise contextQuestion."
|
|
213
|
+
],
|
|
208
214
|
"Use Simplified Chinese for every user-facing string when the visible snapshot documents are mainly Chinese; otherwise use English.",
|
|
209
215
|
"",
|
|
210
216
|
input.candidateContext?.length ? `Other ranked local work projects (metadata only):\n${JSON.stringify(input.candidateContext.slice(0, 8).map((candidate) => ({
|
|
@@ -220,7 +226,7 @@ async function analyzeWorkContext(input) {
|
|
|
220
226
|
].join("\n"),
|
|
221
227
|
timestamp: Date.now()
|
|
222
228
|
}] }, {
|
|
223
|
-
maxTokens: WORK_ANALYSIS_MAX_TOKENS,
|
|
229
|
+
maxTokens: input.projectOverviewOnly ? 2e3 : WORK_ANALYSIS_MAX_TOKENS,
|
|
224
230
|
temperature: .1,
|
|
225
231
|
signal: input.signal
|
|
226
232
|
});
|
|
@@ -232,7 +238,7 @@ async function analyzeWorkContext(input) {
|
|
|
232
238
|
const suggestions = Array.isArray(parsed.suggestions) ? parsed.suggestions.map((value) => validateSuggestion(value, allowedPaths)).filter((value) => Boolean(value)) : [];
|
|
233
239
|
const profileCandidates = Array.isArray(parsed.profileCandidates) ? parsed.profileCandidates.map((value) => validateProfileCandidate(value)).filter((value) => Boolean(value)) : [];
|
|
234
240
|
const workThreadCandidates = Array.isArray(parsed.workThreads) ? parsed.workThreads.map((value) => validateWorkThreadCandidate(value, allowedThreadRefs)).filter((value) => Boolean(value)) : [];
|
|
235
|
-
if (parsed.lowConfidence === true || suggestions.length !== 3) {
|
|
241
|
+
if (parsed.lowConfidence === true || !input.projectOverviewOnly && suggestions.length !== 3) {
|
|
236
242
|
const fallback = lowConfidenceResult(input.snapshot, typeof parsed.contextQuestion === "string" ? parsed.contextQuestion.trim().slice(0, 500) : void 0, typeof parsed.conversationStarter === "string" ? parsed.conversationStarter : void 0);
|
|
237
243
|
const projectSummary = typeof parsed.projectSummary === "string" && parsed.projectSummary.trim() ? parsed.projectSummary.trim().slice(0, 1200) : fallback.projectSummary;
|
|
238
244
|
const currentState = typeof parsed.currentState === "string" && parsed.currentState.trim() ? parsed.currentState.trim().slice(0, 1200) : fallback.currentState;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { analyzeUnderstandingSources, analyzeWorkContext, workDiscoveryResultMarkdown } from "./analyzer.js";
|
|
2
|
-
import { WORK_DISCOVERY_SCAN_POLICY_VERSION, canonicalWorkDiscoveryRoot, previewWorkDiscoveryRoot, probeWorkDiscoveryRoot, readWorkDiscoveryTextExcerpt, searchWorkDiscoveryText, summarizeWorkContextSnapshot } from "./probe.js";
|
|
3
2
|
import { discoverWorkCandidates, resolvePersonalWorkRoots } from "./candidate-discovery.js";
|
|
4
3
|
import { workDiscoveryFingerprintsEqual } from "./incremental.js";
|
|
5
|
-
import { createWorkDiscoveryRun, getWorkDiscoveryOnboardingState, getWorkDiscoveryRun, getWorkDiscoveryRunByIdempotencyKey, setWorkDiscoveryFeedback, setWorkDiscoveryOnboardingState, updateWorkDiscoveryRun } from "./repository.js";
|
|
4
|
+
import { createWorkDiscoveryRun, getProjectUnderstandingRun, getWorkDiscoveryOnboardingState, getWorkDiscoveryRun, getWorkDiscoveryRunByIdempotencyKey, listPendingProjectUnderstandingRuns, setWorkDiscoveryFeedback, setWorkDiscoveryOnboardingState, updateWorkDiscoveryRun } from "./repository.js";
|
|
6
5
|
import { findActiveWorkDiscoverySourceRefresh, listWorkDiscoverySourceRefreshes, recordWorkDiscoverySourceRefresh, updateWorkDiscoverySourceRefreshForRun } from "./incremental-repository.js";
|
|
7
6
|
import { appendWorkUnderstandingEvidence, createWorkUnderstandingInvestigation, getWorkUnderstandingInvestigation, getWorkUnderstandingInvestigationForRun, listWorkUnderstandingEvidence, resetWorkUnderstandingInvestigation, updateWorkUnderstandingEvidenceObservation, updateWorkUnderstandingInvestigation } from "./investigation-repository.js";
|
|
7
|
+
import { WORK_DISCOVERY_SCAN_POLICY_VERSION, canonicalWorkDiscoveryRoot, previewWorkDiscoveryRoot, probeWorkDiscoveryRoot, readWorkDiscoveryTextExcerpt, searchWorkDiscoveryText, summarizeWorkContextSnapshot } from "./probe.js";
|
|
8
8
|
import { DEFAULT_WORK_INVESTIGATION_BUDGET, investigateWorkContext } from "./investigator.js";
|
|
9
9
|
import { persistWorkThreadsFromDiscovery } from "./thread-service.js";
|
|
10
10
|
import { getWorkDiscoveryDirectorySource, listWorkDiscoveryDirectorySources, revokeWorkDiscoveryDirectorySource, upsertWorkDiscoveryDirectorySource } from "./source-repository.js";
|
|
11
11
|
import { WorkDiscoveryService, normalizeUnderstandingSourceItems } from "./service.js";
|
|
12
12
|
import { evaluateQuickUnderstandingCase, evaluateWorkUnderstandingCase, meetsQuickUnderstandingGate } from "./evaluation.js";
|
|
13
|
-
export { DEFAULT_WORK_INVESTIGATION_BUDGET, WORK_DISCOVERY_SCAN_POLICY_VERSION, WorkDiscoveryService, analyzeUnderstandingSources, analyzeWorkContext, appendWorkUnderstandingEvidence, canonicalWorkDiscoveryRoot, createWorkDiscoveryRun, createWorkUnderstandingInvestigation, discoverWorkCandidates, evaluateQuickUnderstandingCase, evaluateWorkUnderstandingCase, findActiveWorkDiscoverySourceRefresh, getWorkDiscoveryDirectorySource, getWorkDiscoveryOnboardingState, getWorkDiscoveryRun, getWorkDiscoveryRunByIdempotencyKey, getWorkUnderstandingInvestigation, getWorkUnderstandingInvestigationForRun, investigateWorkContext, listWorkDiscoveryDirectorySources, listWorkDiscoverySourceRefreshes, listWorkUnderstandingEvidence, meetsQuickUnderstandingGate, normalizeUnderstandingSourceItems, persistWorkThreadsFromDiscovery, previewWorkDiscoveryRoot, probeWorkDiscoveryRoot, readWorkDiscoveryTextExcerpt, recordWorkDiscoverySourceRefresh, resetWorkUnderstandingInvestigation, resolvePersonalWorkRoots, revokeWorkDiscoveryDirectorySource, searchWorkDiscoveryText, setWorkDiscoveryFeedback, setWorkDiscoveryOnboardingState, summarizeWorkContextSnapshot, updateWorkDiscoveryRun, updateWorkDiscoverySourceRefreshForRun, updateWorkUnderstandingEvidenceObservation, updateWorkUnderstandingInvestigation, upsertWorkDiscoveryDirectorySource, workDiscoveryFingerprintsEqual, workDiscoveryResultMarkdown };
|
|
13
|
+
export { DEFAULT_WORK_INVESTIGATION_BUDGET, WORK_DISCOVERY_SCAN_POLICY_VERSION, WorkDiscoveryService, analyzeUnderstandingSources, analyzeWorkContext, appendWorkUnderstandingEvidence, canonicalWorkDiscoveryRoot, createWorkDiscoveryRun, createWorkUnderstandingInvestigation, discoverWorkCandidates, evaluateQuickUnderstandingCase, evaluateWorkUnderstandingCase, findActiveWorkDiscoverySourceRefresh, getProjectUnderstandingRun, getWorkDiscoveryDirectorySource, getWorkDiscoveryOnboardingState, getWorkDiscoveryRun, getWorkDiscoveryRunByIdempotencyKey, getWorkUnderstandingInvestigation, getWorkUnderstandingInvestigationForRun, investigateWorkContext, listPendingProjectUnderstandingRuns, listWorkDiscoveryDirectorySources, listWorkDiscoverySourceRefreshes, listWorkUnderstandingEvidence, meetsQuickUnderstandingGate, normalizeUnderstandingSourceItems, persistWorkThreadsFromDiscovery, previewWorkDiscoveryRoot, probeWorkDiscoveryRoot, readWorkDiscoveryTextExcerpt, recordWorkDiscoverySourceRefresh, resetWorkUnderstandingInvestigation, resolvePersonalWorkRoots, revokeWorkDiscoveryDirectorySource, searchWorkDiscoveryText, setWorkDiscoveryFeedback, setWorkDiscoveryOnboardingState, summarizeWorkContextSnapshot, updateWorkDiscoveryRun, updateWorkDiscoverySourceRefreshForRun, updateWorkUnderstandingEvidenceObservation, updateWorkUnderstandingInvestigation, upsertWorkDiscoveryDirectorySource, workDiscoveryFingerprintsEqual, workDiscoveryResultMarkdown };
|
|
@@ -3,8 +3,8 @@ import { init_logger } from "../utils/logger.js";
|
|
|
3
3
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
4
4
|
import { init_providers, resolveModel } from "../providers/index.js";
|
|
5
5
|
import { completeWithResolvedCredentials } from "../providers/model-call.js";
|
|
6
|
-
import { readWorkDiscoveryTextExcerpt, searchWorkDiscoveryText } from "./probe.js";
|
|
7
6
|
import { appendWorkUnderstandingEvidence, createWorkUnderstandingInvestigation, getWorkUnderstandingInvestigationForRun, resetWorkUnderstandingInvestigation, updateWorkUnderstandingEvidenceObservation, updateWorkUnderstandingInvestigation } from "./investigation-repository.js";
|
|
7
|
+
import { readWorkDiscoveryTextExcerpt, searchWorkDiscoveryText } from "./probe.js";
|
|
8
8
|
import { createHash } from "node:crypto";
|
|
9
9
|
//#region src/work-discovery/investigator.ts
|
|
10
10
|
init_schema();
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function getProjectUnderstandingOverview(projectId: string): import("../knowledge-memory/domain.js").KnowledgeItem;
|
|
2
|
+
export declare function saveProjectUnderstandingOverview(input: {
|
|
3
|
+
projectId: string;
|
|
4
|
+
content: string;
|
|
5
|
+
correctedByUser?: boolean;
|
|
6
|
+
evidenceRefs?: string[];
|
|
7
|
+
}): import("../knowledge-memory/domain.js").KnowledgeItem;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { listKnowledgeItems, writeKnowledgeItem } from "../knowledge-memory/repository.js";
|
|
2
|
+
import "../knowledge-memory/index.js";
|
|
3
|
+
//#region src/work-discovery/project-understanding.ts
|
|
4
|
+
function getProjectUnderstandingOverview(projectId) {
|
|
5
|
+
return listKnowledgeItems({
|
|
6
|
+
scope: {
|
|
7
|
+
type: "project",
|
|
8
|
+
id: projectId
|
|
9
|
+
},
|
|
10
|
+
statuses: ["active"],
|
|
11
|
+
canonicalKey: `project-understanding:${projectId}`,
|
|
12
|
+
limit: 1
|
|
13
|
+
})[0];
|
|
14
|
+
}
|
|
15
|
+
function saveProjectUnderstandingOverview(input) {
|
|
16
|
+
const existing = getProjectUnderstandingOverview(input.projectId);
|
|
17
|
+
if (!input.correctedByUser && existing?.originClass === "owner") return existing;
|
|
18
|
+
return writeKnowledgeItem({
|
|
19
|
+
kind: "project_fact",
|
|
20
|
+
scope: {
|
|
21
|
+
type: "project",
|
|
22
|
+
id: input.projectId
|
|
23
|
+
},
|
|
24
|
+
canonicalKey: `project-understanding:${input.projectId}`,
|
|
25
|
+
content: input.content.slice(0, 6e3),
|
|
26
|
+
status: "active",
|
|
27
|
+
importance: .9,
|
|
28
|
+
confidence: input.correctedByUser ? 1 : .7,
|
|
29
|
+
originClass: input.correctedByUser ? "owner" : "agent",
|
|
30
|
+
source: {
|
|
31
|
+
provider: "project-understanding",
|
|
32
|
+
evidenceRefs: input.evidenceRefs ?? []
|
|
33
|
+
},
|
|
34
|
+
replaceExisting: true
|
|
35
|
+
}).item;
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
export { getProjectUnderstandingOverview, saveProjectUnderstandingOverview };
|
|
@@ -8,10 +8,12 @@ export declare function setWorkDiscoveryOnboardingState(input: {
|
|
|
8
8
|
export declare function createWorkDiscoveryRun(run: WorkDiscoveryRun): WorkDiscoveryRun;
|
|
9
9
|
export declare function getWorkDiscoveryRun(id: string): WorkDiscoveryRun | null;
|
|
10
10
|
export declare function getWorkDiscoveryRunByIdempotencyKey(key: string): WorkDiscoveryRun | null;
|
|
11
|
+
export declare function getProjectUnderstandingRun(projectId: string): WorkDiscoveryRun | null;
|
|
12
|
+
export declare function listPendingProjectUnderstandingRuns(): WorkDiscoveryRun[];
|
|
11
13
|
export declare function setWorkDiscoveryFeedback(input: {
|
|
12
14
|
runId: string;
|
|
13
15
|
recognitionDecision: WorkDiscoveryRecognitionDecision;
|
|
14
16
|
correctedIntent?: string;
|
|
15
17
|
nowMs?: number;
|
|
16
18
|
}): WorkDiscoveryFeedback;
|
|
17
|
-
export declare function updateWorkDiscoveryRun(id: string, patch: Partial<Pick<WorkDiscoveryRun, 'status' | 'stage' | 'snapshot' | 'result' | 'errorCode' | 'errorMessage' | 'startedAt' | 'completedAt' | 'canceledAt'>>): WorkDiscoveryRun | null;
|
|
19
|
+
export declare function updateWorkDiscoveryRun(id: string, patch: Partial<Pick<WorkDiscoveryRun, 'status' | 'stage' | 'snapshot' | 'result' | 'errorCode' | 'errorMessage' | 'startedAt' | 'completedAt' | 'canceledAt' | 'attempts'>>): WorkDiscoveryRun | null;
|
|
@@ -21,6 +21,8 @@ function onboardingFromRow(row) {
|
|
|
21
21
|
function runFromRow(row) {
|
|
22
22
|
return {
|
|
23
23
|
id: row.id,
|
|
24
|
+
mode: row.mode,
|
|
25
|
+
attempts: row.attempts,
|
|
24
26
|
idempotencyKey: row.idempotency_key,
|
|
25
27
|
source: row.source,
|
|
26
28
|
status: row.status,
|
|
@@ -85,8 +87,8 @@ function createWorkDiscoveryRun(run) {
|
|
|
85
87
|
db.prepare(`INSERT INTO work_discovery_runs (
|
|
86
88
|
id, idempotency_key, source, status, stage, root_path, project_id, session_key,
|
|
87
89
|
agent_id, model_ref, scan_policy_version, snapshot_summary_json, result_json,
|
|
88
|
-
error_code, error_message, created_at, started_at, completed_at, canceled_at
|
|
89
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`).run(run.id, run.idempotencyKey, run.source, run.status, run.stage ?? null, run.rootPath, run.projectId, run.sessionKey, run.agentId, run.modelRef, run.scanPolicyVersion, run.snapshot ? JSON.stringify(run.snapshot) : null, run.result ? JSON.stringify(run.result) : null, run.errorCode ?? null, run.errorMessage ?? null, run.createdAt, run.startedAt ?? null, run.completedAt ?? null, run.canceledAt ?? null);
|
|
90
|
+
error_code, error_message, created_at, started_at, completed_at, canceled_at, mode, attempts
|
|
91
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`).run(run.id, run.idempotencyKey, run.source, run.status, run.stage ?? null, run.rootPath, run.projectId, run.sessionKey, run.agentId, run.modelRef, run.scanPolicyVersion, run.snapshot ? JSON.stringify(run.snapshot) : null, run.result ? JSON.stringify(run.result) : null, run.errorCode ?? null, run.errorMessage ?? null, run.createdAt, run.startedAt ?? null, run.completedAt ?? null, run.canceledAt ?? null, run.mode ?? "interactive", run.attempts ?? 0);
|
|
90
92
|
});
|
|
91
93
|
return getWorkDiscoveryRun(run.id);
|
|
92
94
|
}
|
|
@@ -98,6 +100,17 @@ function getWorkDiscoveryRunByIdempotencyKey(key) {
|
|
|
98
100
|
const { db } = requireXopcDatabase();
|
|
99
101
|
return readRun(db, "idempotency_key", key);
|
|
100
102
|
}
|
|
103
|
+
function getProjectUnderstandingRun(projectId) {
|
|
104
|
+
const { db } = requireXopcDatabase();
|
|
105
|
+
const row = db.prepare(`SELECT * FROM work_discovery_runs
|
|
106
|
+
WHERE project_id = ? AND mode = 'background' ORDER BY created_at DESC, rowid DESC LIMIT 1`).get(projectId);
|
|
107
|
+
return row ? runFromRow(row) : null;
|
|
108
|
+
}
|
|
109
|
+
function listPendingProjectUnderstandingRuns() {
|
|
110
|
+
const { db } = requireXopcDatabase();
|
|
111
|
+
return db.prepare(`SELECT * FROM work_discovery_runs
|
|
112
|
+
WHERE mode = 'background' AND status IN ('queued', 'probing', 'analyzing')`).all().map(runFromRow);
|
|
113
|
+
}
|
|
101
114
|
function setWorkDiscoveryFeedback(input) {
|
|
102
115
|
const now = input.nowMs ?? Date.now();
|
|
103
116
|
runSqliteWriteTransaction((db) => {
|
|
@@ -122,10 +135,10 @@ function updateWorkDiscoveryRun(id, patch) {
|
|
|
122
135
|
runSqliteWriteTransaction((db) => {
|
|
123
136
|
db.prepare(`UPDATE work_discovery_runs SET
|
|
124
137
|
status = ?, stage = ?, snapshot_summary_json = ?, result_json = ?,
|
|
125
|
-
error_code = ?, error_message = ?, started_at = ?, completed_at = ?, canceled_at = ?
|
|
126
|
-
WHERE id = ?`).run(next.status, next.stage ?? null, next.snapshot ? JSON.stringify(next.snapshot) : null, next.result ? JSON.stringify(next.result) : null, next.errorCode ?? null, next.errorMessage ?? null, next.startedAt ?? null, next.completedAt ?? null, next.canceledAt ?? null, id);
|
|
138
|
+
error_code = ?, error_message = ?, started_at = ?, completed_at = ?, canceled_at = ?, attempts = ?
|
|
139
|
+
WHERE id = ?`).run(next.status, next.stage ?? null, next.snapshot ? JSON.stringify(next.snapshot) : null, next.result ? JSON.stringify(next.result) : null, next.errorCode ?? null, next.errorMessage ?? null, next.startedAt ?? null, next.completedAt ?? null, next.canceledAt ?? null, next.attempts ?? 0, id);
|
|
127
140
|
});
|
|
128
141
|
return getWorkDiscoveryRun(id);
|
|
129
142
|
}
|
|
130
143
|
//#endregion
|
|
131
|
-
export { createWorkDiscoveryRun, getWorkDiscoveryOnboardingState, getWorkDiscoveryRun, getWorkDiscoveryRunByIdempotencyKey, setWorkDiscoveryFeedback, setWorkDiscoveryOnboardingState, updateWorkDiscoveryRun };
|
|
144
|
+
export { createWorkDiscoveryRun, getProjectUnderstandingRun, getWorkDiscoveryOnboardingState, getWorkDiscoveryRun, getWorkDiscoveryRunByIdempotencyKey, listPendingProjectUnderstandingRuns, setWorkDiscoveryFeedback, setWorkDiscoveryOnboardingState, updateWorkDiscoveryRun };
|
|
@@ -15,9 +15,17 @@ export interface WorkDiscoveryServiceOptions {
|
|
|
15
15
|
export declare class WorkDiscoveryService {
|
|
16
16
|
private readonly options;
|
|
17
17
|
private readonly abortControllers;
|
|
18
|
+
private readonly executions;
|
|
19
|
+
private stopped;
|
|
18
20
|
private readonly candidateContexts;
|
|
19
21
|
private readonly activity;
|
|
20
22
|
constructor(options: WorkDiscoveryServiceOptions);
|
|
23
|
+
startProjectUnderstanding(projectId: string): WorkDiscoveryRun;
|
|
24
|
+
resumeProjectUnderstanding(): void;
|
|
25
|
+
stop(): Promise<void>;
|
|
26
|
+
private trackExecution;
|
|
27
|
+
private scheduleProjectUnderstanding;
|
|
28
|
+
private runProjectUnderstanding;
|
|
21
29
|
isEnabled(): boolean;
|
|
22
30
|
getOnboardingState(): WorkDiscoveryOnboardingState;
|
|
23
31
|
dismissOnboarding(): WorkDiscoveryOnboardingState;
|