@xopcai/xopc 0.0.459 → 0.0.462
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/dist/assets/{pcm-capture-worklet-CGN9Mlhg.js → pcm-capture-worklet-Df5TcFw4.js} +4 -2
- package/dist/browser-ext/dist/sidepanel.js +3 -2
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agents-CGUdvmIT.js → agents-DC0lHtl5.js} +3 -3
- package/dist/gateway/static/root/assets/{apps-page-M2XD1Pzu.js → apps-page-QLOYw2QR.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-task-card-CiJmJ7_h.js → automation-task-card-CJbIHRxN.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-CVjgENMO.js → automations-page-DpKnqajR.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-CGPWyL0P.js → automations-workspace-BXT_EDON.js} +2 -2
- package/dist/gateway/static/root/assets/{block-editor-CmnkluMF.js → block-editor-DrZyRQQ0.js} +5 -5
- package/dist/gateway/static/root/assets/{capabilities-DDqDvCBs.js → capabilities-Dr-vvMez.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-hSb-qEgL.js +1 -0
- package/dist/gateway/static/root/assets/capabilities-page-CnU0htlO.js +2 -0
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-CvF8VRTv.js → capabilities-settings-panel-B08mjrGB.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-BDVQ6Z7A.js → channels-B--IHNs4.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-chart-block-stPJEZ90.js → chat-chart-block-ClCZyIi0.js} +1 -1
- package/dist/gateway/static/root/assets/chat-page-U2a7d6wP.js +71 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-B4uA_W6R.js → chat-terminal-dock-eneTvxV3.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-DyzDVVfz.js → connectors-page-Bs29RvXz.js} +1 -1
- package/dist/gateway/static/root/assets/constants-Bg1wM2nv.js +1 -0
- package/dist/gateway/static/root/assets/diagnostics-Bo0Z42P_.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-BPwRrP3L.js → extension-debug-page-Bn_5xu_M.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-iframe-host-DIH4TcdH.js → extension-iframe-host-Vs6USa0c.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-message-router-C9JDpo_7.js → extension-message-router-GIekDj_w.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CLDoL5N8.js → extension-page-C_3bIjSB.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-BPIoHw4r.js → extension-provider-D-LolObs.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BO_UKeG8.js → extension-settings-page-BV51dk16.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-DefKShSW.js +8 -0
- package/dist/gateway/static/root/assets/index-CChzK_5b.css +1 -0
- package/dist/gateway/static/root/assets/index-CEBDMkde.js +11 -0
- package/dist/gateway/static/root/assets/{local-app-workbench-page-D8oqDDAn.js → local-app-workbench-page-CfnixDO3.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-BlxIaCCQ.js → markdown-view-CNJaAdNN.js} +39 -39
- package/dist/gateway/static/root/assets/note-detail-panel-D_l5jkV9.js +7 -0
- package/dist/gateway/static/root/assets/note-image-lightbox-D6mvMSKr.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-CdXA-g9r.js → notes-api-BOIM9Q_D.js} +1 -1
- package/dist/gateway/static/root/assets/notes-page-R4uJroeD.js +8 -0
- package/dist/gateway/static/root/assets/{page-context-capture-button-Dibmspef.js → page-context-capture-button-B_Vdo2Ai.js} +1 -1
- package/dist/gateway/static/root/assets/pcm-capture-worklet-CpXsv44v.js +1 -0
- package/dist/gateway/static/root/assets/personal-page-BsONyPfQ.js +1 -0
- package/dist/gateway/static/root/assets/personal-profile-settings-C4CxmQLQ.js +1 -0
- package/dist/gateway/static/root/assets/{personal-settings-panel-BppxtWBl.js → personal-settings-panel-CnxI2TL0.js} +1 -1
- package/dist/gateway/static/root/assets/{product-automation-feedback-D51I7Lg3.js → product-automation-feedback-CGso8wGv.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-WkF2j_c-.js → product-preview-content-Dgtb4LF7.js} +1 -1
- package/dist/gateway/static/root/assets/product-preview-modal-C35EWUps.js +2 -0
- package/dist/gateway/static/root/assets/project-detail-page-xNSy6SAv.js +7 -0
- package/dist/gateway/static/root/assets/recording-upload-CFX7CANT.js +1 -0
- package/dist/gateway/static/root/assets/route-preload-Dwb_N8L-.js +2 -0
- package/dist/gateway/static/root/assets/routine-panel-KH1VaEdC.js +2 -0
- package/dist/gateway/static/root/assets/session-manager-63NaXb1s.js +25 -0
- package/dist/gateway/static/root/assets/{settings-page-D2qkIrUg.js → settings-page-8MiJzbbl.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-fV5USZb1.js → share-preview-page-Cqy-7-rd.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-sl40lqND.js → shares-settings-BDr50uTV.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-FTd0Z7Ey.js → skills-page-DReUQ4Ug.js} +1 -1
- package/dist/gateway/static/root/assets/star-CnYNmpLd.js +1 -0
- package/dist/gateway/static/root/assets/task-detail-page-DxKXoBbE.js +3 -0
- package/dist/gateway/static/root/assets/{task-result-evidence-CSJeB9AH.js → task-result-evidence-CW_tN93T.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-CO7XLI4x.js → use-composer-attachments-Xn6eUus2.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-BXXeXnT0.js → use-file-preview-expanded-D0IBFhM9.js} +1 -1
- package/dist/gateway/static/root/assets/use-realtime-voice-B5IsKrRW.js +1 -0
- package/dist/gateway/static/root/assets/{use-workspace-tree-D27u-eoX.js → use-workspace-tree-7X2ydgS8.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-settings-BiqJ0tlf.js → voice-settings-57pwZeKD.js} +1 -1
- package/dist/gateway/static/root/assets/workspace-api-Dd_UDfeo.js +2 -0
- package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-NffP-UXC.js → workspace-file-preview-dialog-Clj9hMj5.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-preview-store-Do31QQH5.js → workspace-preview-store-imhtuEIP.js} +1 -1
- package/dist/gateway/static/root/index.html +27 -26
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/follow-ups.js +97 -0
- package/dist/packages/gateway-contract/src/home.js +1 -0
- package/dist/packages/gateway-contract/src/index.js +4 -0
- package/dist/packages/gateway-contract/src/observation-starters.js +95 -0
- package/dist/packages/gateway-contract/src/observation.js +7 -0
- package/dist/packages/gateway-contract/src/task-research-result.js +3 -0
- package/dist/src/agent/agent-manager.d.ts +1 -1
- package/dist/src/agent/background-review/prompts.d.ts +1 -0
- package/dist/src/agent/background-review/prompts.js +7 -1
- package/dist/src/agent/background-review/run-background-review.js +85 -7
- package/dist/src/agent/coding/run-verification.d.ts +14 -7
- package/dist/src/agent/coding/run-verification.js +28 -6
- package/dist/src/agent/context/coordinator.js +1 -1
- package/dist/src/agent/context/deep-recall.js +1 -1
- package/dist/src/agent/embedded/execution-tool-policy.d.ts +1 -0
- package/dist/src/agent/embedded/execution-tool-policy.js +4 -2
- package/dist/src/agent/embedded/run-for-session.d.ts +2 -0
- package/dist/src/agent/embedded/run-for-session.js +9 -0
- package/dist/src/agent/embedded/run-turn.js +63 -14
- package/dist/src/agent/embedded/types.d.ts +2 -0
- package/dist/src/agent/inbound/turn-dispatcher.d.ts +1 -0
- package/dist/src/agent/inbound/turn-dispatcher.js +1 -0
- package/dist/src/agent/service/direct-turn-helpers.d.ts +1 -0
- package/dist/src/agent/service/direct-turn-helpers.js +17 -2
- package/dist/src/agent/service/process-direct-streaming.d.ts +1 -0
- package/dist/src/agent/service/process-direct-streaming.js +1 -0
- package/dist/src/agent/service.d.ts +1 -1
- package/dist/src/agent/tasks/task-judge-service.js +1 -0
- package/dist/src/agent/tool-manuals/browser.d.ts +1 -1
- package/dist/src/agent/tool-manuals/browser.js +3 -1
- package/dist/src/agent/tools/factory.d.ts +1 -1
- package/dist/src/agent/tools/factory.js +1 -1
- package/dist/src/agent/tools/personal-request-tool.js +36 -4
- package/dist/src/agent/tools/personal-task-tool.d.ts +7 -1
- package/dist/src/agent/tools/personal-task-tool.js +68 -3
- package/dist/src/agent/tools/session-search-tool.js +1 -1
- package/dist/src/agent/tools/task-collaboration-tool.d.ts +1 -1
- package/dist/src/agent/tools/task-collaboration-tool.js +54 -3
- package/dist/src/agent/tools/task-result-tool.js +31 -0
- package/dist/src/agent/tools/xopc-use-tool.js +50 -19
- package/dist/src/automations/capabilities/write.d.ts +2 -2
- package/dist/src/automations/domain/validation.d.ts +4 -4
- package/dist/src/automations/draft/automation-draft-validator.d.ts +1 -1
- package/dist/src/browser/drivers/browser-driver.d.ts +1 -0
- package/dist/src/browser/drivers/create-driver.js +2 -11
- package/dist/src/browser/drivers/playwright-driver.d.ts +5 -2
- package/dist/src/browser/drivers/playwright-driver.js +83 -38
- package/dist/src/browser/runtime/browser-runtime.d.ts +5 -0
- package/dist/src/browser/runtime/browser-runtime.js +71 -9
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/computer/diagnostics.d.ts +4 -4
- package/dist/src/computer/errors.d.ts +4 -4
- package/dist/src/computer/evaluation.d.ts +3 -3
- package/dist/src/computer/flows.d.ts +1 -1
- package/dist/src/computer/runtime.d.ts +3 -3
- package/dist/src/config/schema.d.ts +6 -2
- package/dist/src/config/schema.js +3 -0
- package/dist/src/connectors/connected-source-understanding.js +11 -3
- package/dist/src/connectors/learning-coordinator.js +45 -11
- package/dist/src/discussions/recording.js +13 -6
- package/dist/src/endpoint-tools/device-host.d.ts +2 -2
- package/dist/src/gateway/hono/lib/config-payload.d.ts +4 -0
- package/dist/src/gateway/hono/routes/home.js +52 -1
- package/dist/src/gateway/hono/routes/projects.js +1 -1
- package/dist/src/gateway/hono/routes/session-command-handler.js +15 -1
- package/dist/src/gateway/hono/routes/user-model.js +1 -1
- package/dist/src/gateway/service/agent-runner.d.ts +2 -8
- package/dist/src/gateway/service/agent-runner.js +1 -0
- package/dist/src/gateway/service/config-coordinator.d.ts +5 -1
- package/dist/src/gateway/service/run-gateway-agent.d.ts +13 -8
- package/dist/src/gateway/service/run-gateway-agent.js +5 -2
- package/dist/src/gateway/service/session-input-coordinator.d.ts +4 -0
- package/dist/src/gateway/service/session-input-coordinator.js +6 -1
- package/dist/src/gateway/service.d.ts +1 -0
- package/dist/src/gateway/service.js +8 -1
- package/dist/src/home-intelligence/follow-ups.d.ts +36 -0
- package/dist/src/home-intelligence/follow-ups.js +496 -0
- package/dist/src/home-intelligence/host.d.ts +80 -4
- package/dist/src/home-intelligence/host.js +122 -2
- package/dist/src/home-intelligence/observation-starters.d.ts +3 -0
- package/dist/src/home-intelligence/observation-starters.js +27 -0
- package/dist/src/home-intelligence/observation.d.ts +1 -1
- package/dist/src/home-intelligence/observation.js +16 -4
- package/dist/src/local-apps/automation-proposals.d.ts +4 -4
- package/dist/src/local-apps/capabilities/projections.d.ts +38 -38
- package/dist/src/memory-learning/choice-observations.d.ts +9 -0
- package/dist/src/memory-learning/choice-observations.js +155 -0
- package/dist/src/memory-learning/evidence-repair.d.ts +12 -0
- package/dist/src/memory-learning/evidence-repair.js +31 -0
- package/dist/src/memory-learning/repository.d.ts +1 -0
- package/dist/src/memory-learning/repository.js +43 -5
- package/dist/src/memory-learning/source-learning.js +52 -7
- package/dist/src/memory-learning/task-receipts.js +19 -10
- package/dist/src/memory-learning/transcript-source.js +7 -0
- package/dist/src/memory-learning/work-candidate.d.ts +14 -0
- package/dist/src/memory-learning/work-candidate.js +17 -2
- package/dist/src/memory-learning/work-capture.d.ts +1 -0
- package/dist/src/memory-learning/work-capture.js +28 -10
- package/dist/src/memory-learning/work-review.d.ts +46 -0
- package/dist/src/memory-learning/work-review.js +209 -0
- package/dist/src/notes/agent-context.js +1 -1
- package/dist/src/personal-agent/communication.d.ts +1 -1
- package/dist/src/personal-agent/communication.js +1 -1
- package/dist/src/personal-agent/default-style.d.ts +1 -1
- package/dist/src/personal-agent/default-style.js +1 -1
- package/dist/src/personal-agent/proactivity/repository.d.ts +1 -1
- package/dist/src/personal-agent/prompts.js +4 -4
- package/dist/src/personal-agent/reply-composer.d.ts +1 -1
- package/dist/src/personal-agent/reply-composer.js +52 -34
- package/dist/src/personal-agent/reply-style.d.ts +2 -2
- package/dist/src/personal-agent/reply-style.js +3 -2
- package/dist/src/personal-agent/request-repository.d.ts +3 -0
- package/dist/src/personal-agent/request-service.d.ts +2 -0
- package/dist/src/personal-agent/request-service.js +8 -2
- package/dist/src/phone/contracts.d.ts +1 -1
- package/dist/src/projects/capabilities/write.js +1 -1
- package/dist/src/projects/index.js +1 -1
- package/dist/src/projects/project-service.js +1 -1
- package/dist/src/storage/sqlite/schema.d.ts +2 -2
- package/dist/src/storage/sqlite/schema.js +7 -7
- package/dist/src/storage/sqlite/schema.sql +22 -0
- package/dist/src/storage/sqlite/upgrades/274_home_followups.sql +21 -0
- package/dist/src/tasks/capabilities/management.d.ts +3 -3
- package/dist/src/tasks/capabilities/relations.d.ts +3 -3
- package/dist/src/tasks/capabilities/write.d.ts +4 -4
- package/dist/src/tasks/capabilities/write.js +2 -0
- package/dist/src/tasks/home-query-service.js +4 -2
- package/dist/src/tasks/task-allocation-service.js +10 -2
- package/dist/src/tasks/task-application-service.d.ts +4 -0
- package/dist/src/tasks/task-application-service.js +6 -1
- package/dist/src/tasks/task-context-assembler.js +7 -2
- package/dist/src/tasks/task-contract-planner.js +3 -3
- package/dist/src/tasks/task-conversation-summary.d.ts +64 -0
- package/dist/src/tasks/task-conversation-summary.js +105 -0
- package/dist/src/tasks/task-delay-notice.d.ts +4 -0
- package/dist/src/tasks/task-delay-notice.js +113 -0
- package/dist/src/tasks/task-deletion-service.js +6 -1
- package/dist/src/tasks/task-handoff.d.ts +21 -0
- package/dist/src/tasks/task-handoff.js +77 -1
- package/dist/src/tasks/task-json-acceptance.d.ts +22 -0
- package/dist/src/tasks/task-json-acceptance.js +96 -0
- package/dist/src/tasks/task-main-update-decision-service.js +17 -21
- package/dist/src/tasks/task-main-update-delivery.js +34 -7
- package/dist/src/tasks/task-notification-preference.d.ts +16 -0
- package/dist/src/tasks/task-notification-preference.js +42 -0
- package/dist/src/tasks/task-origin-repository.d.ts +1 -0
- package/dist/src/tasks/task-origin-repository.js +3 -0
- package/dist/src/tasks/task-read-model-projector.js +1 -1
- package/dist/src/tasks/task-repository.js +1 -0
- package/dist/src/tasks/task-research-repair.d.ts +19 -1
- package/dist/src/tasks/task-research-repair.js +14 -4
- package/dist/src/tasks/task-research-result.d.ts +12 -0
- package/dist/src/tasks/task-research-result.js +5 -0
- package/dist/src/tasks/task-result-delivery-repository.d.ts +4 -1
- package/dist/src/tasks/task-result-delivery-repository.js +8 -5
- package/dist/src/tasks/task-result-delivery-service.js +9 -1
- package/dist/src/tasks/task-run-coordinator.js +45 -10
- package/dist/src/usage/cloud-wire.d.ts +1 -0
- package/dist/src/user-context/config.d.ts +8 -0
- package/dist/src/user-context/config.js +10 -0
- package/dist/src/user-model/capture/evidence-policy.d.ts +2 -0
- package/dist/src/user-model/capture/evidence-policy.js +8 -1
- package/dist/src/user-model/capture/executor.js +16 -4
- package/dist/src/user-model/capture/semantic.d.ts +4 -0
- package/dist/src/user-model/capture/semantic.js +3 -0
- package/dist/src/user-model/index.js +1 -1
- package/dist/src/user-model/observation-repository.d.ts +6 -0
- package/dist/src/user-model/observation-repository.js +12 -0
- package/dist/src/user-model/repository.js +10 -1
- package/dist/src/voice/realtime/agentEngine.js +29 -7
- package/dist/src/voice/realtime/pcmPlaybackEcho.d.ts +10 -0
- package/dist/src/voice/realtime/pcmPlaybackEcho.js +56 -0
- package/dist/src/voice/realtime/playback-echo.d.ts +3 -0
- package/dist/src/voice/realtime/playback-echo.js +35 -5
- package/dist/src/voice/realtime/runtime.js +6 -1
- package/dist/src/voice/realtime/turnPolicy.js +1 -1
- package/package.json +15 -9
- package/dist/gateway/static/root/assets/capabilities-DB713nRi.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-page-D2hq4cgE.js +0 -2
- package/dist/gateway/static/root/assets/chat-page-BhPw56Vc.js +0 -71
- package/dist/gateway/static/root/assets/constants-DpkUgykJ.js +0 -1
- package/dist/gateway/static/root/assets/discussion-annotation-sync-fwPPMPv9.js +0 -1
- package/dist/gateway/static/root/assets/home-page-BPPe4JXB.js +0 -7
- package/dist/gateway/static/root/assets/index-D0_qnBzh.css +0 -1
- package/dist/gateway/static/root/assets/index-Hv71yddc.js +0 -11
- package/dist/gateway/static/root/assets/note-detail-panel-DLPwJGh0.js +0 -7
- package/dist/gateway/static/root/assets/note-image-lightbox-CqK_uJ6Y.js +0 -1
- package/dist/gateway/static/root/assets/notes-page-DpfN5bZZ.js +0 -8
- package/dist/gateway/static/root/assets/pcm-capture-worklet-uW_SEACy.js +0 -1
- package/dist/gateway/static/root/assets/personal-page-BBGjwkAC.js +0 -1
- package/dist/gateway/static/root/assets/personal-profile-settings-HMQY9lz9.js +0 -1
- package/dist/gateway/static/root/assets/product-preview-modal-DMHOKocl.js +0 -2
- package/dist/gateway/static/root/assets/project-detail-page-Dj_PuT7k.js +0 -7
- package/dist/gateway/static/root/assets/recording-upload-CyZSl2DJ.js +0 -1
- package/dist/gateway/static/root/assets/route-preload-gas8e1we.js +0 -2
- package/dist/gateway/static/root/assets/routine-panel-CXs4PjW0.js +0 -2
- package/dist/gateway/static/root/assets/session-manager-D2LaQymu.js +0 -25
- package/dist/gateway/static/root/assets/task-detail-page-_5TEldtl.js +0 -3
- package/dist/gateway/static/root/assets/use-realtime-voice-C7iWQuUv.js +0 -1
- package/dist/gateway/static/root/assets/workspace-api-LghfbP5g.js +0 -2
|
@@ -137,8 +137,9 @@ export declare const ComputerEvaluationRunSchema: z.ZodObject<{
|
|
|
137
137
|
when: "when";
|
|
138
138
|
label: "label";
|
|
139
139
|
text: "text";
|
|
140
|
-
kind: "kind";
|
|
141
140
|
status: "status";
|
|
141
|
+
steps: "steps";
|
|
142
|
+
kind: "kind";
|
|
142
143
|
durationMs: "durationMs";
|
|
143
144
|
role: "role";
|
|
144
145
|
to: "to";
|
|
@@ -154,7 +155,6 @@ export declare const ComputerEvaluationRunSchema: z.ZodObject<{
|
|
|
154
155
|
deltaY: "deltaY";
|
|
155
156
|
refs: "refs";
|
|
156
157
|
pixels: "pixels";
|
|
157
|
-
steps: "steps";
|
|
158
158
|
coordinate: "coordinate";
|
|
159
159
|
unknown_field: "unknown_field";
|
|
160
160
|
proposal: "proposal";
|
|
@@ -288,7 +288,7 @@ export declare function computerReportMeasurements(report: ComputerSessionReport
|
|
|
288
288
|
action: "type" | "key" | "unknown" | "answer" | "wait" | "typeText" | "batch" | "terminate" | "activate" | "showMenu" | "click" | "drag" | "setValue" | "pressKeys" | "scroll" | "activateSequence" | "interact" | "takeover" | "finished" | "button_plan" | "activate_sequence" | "show_menu" | "set_value" | "left_click" | "right_click" | "double_click" | "hscroll";
|
|
289
289
|
stage: "plan" | "schema" | "converted_action" | "typing_target" | "keyboard";
|
|
290
290
|
issues: {
|
|
291
|
-
path: (number | "reason" | "keys" | "value" | "name" | "time" | "from" | "action" | "when" | "label" | "text" | "
|
|
291
|
+
path: (number | "reason" | "keys" | "value" | "name" | "time" | "from" | "action" | "when" | "label" | "text" | "status" | "steps" | "kind" | "durationMs" | "role" | "to" | "actions" | "count" | "x" | "y" | "point" | "arguments" | "ref" | "button" | "deltaX" | "deltaY" | "refs" | "pixels" | "coordinate" | "unknown_field" | "proposal" | "claimedSuccess")[];
|
|
292
292
|
code: "custom" | "invalid_type" | "unrecognized_keys" | "invalid_union" | "invalid_value" | "invalid_format" | "too_big" | "too_small" | "not_multiple_of" | "missing_point" | "outside_frame" | "editable_target_missing" | "editable_target_ambiguous" | "invalid_context" | "unsupported_key" | "plan_not_grounded";
|
|
293
293
|
action: "type" | "key" | "unknown" | "answer" | "wait" | "typeText" | "batch" | "terminate" | "activate" | "showMenu" | "click" | "drag" | "setValue" | "pressKeys" | "scroll" | "activateSequence" | "interact" | "takeover" | "finished" | "button_plan" | "activate_sequence" | "show_menu" | "set_value" | "left_click" | "right_click" | "double_click" | "hscroll";
|
|
294
294
|
}[];
|
|
@@ -24,8 +24,8 @@ export declare const ComputerFlowSchema: z.ZodObject<{
|
|
|
24
24
|
text: z.ZodString;
|
|
25
25
|
}, z.core.$strict>]>;
|
|
26
26
|
coverage: z.ZodDefault<z.ZodEnum<{
|
|
27
|
-
partial: "partial";
|
|
28
27
|
complete: "complete";
|
|
28
|
+
partial: "partial";
|
|
29
29
|
}>>;
|
|
30
30
|
createdAt: z.ZodNumber;
|
|
31
31
|
expiresAt: z.ZodNumber;
|
|
@@ -9,9 +9,9 @@ import { ComputerDiagnosticSchema } from './errors.js';
|
|
|
9
9
|
import { type ComputerVerification } from './task-state.js';
|
|
10
10
|
declare const Reply: z.ZodObject<{
|
|
11
11
|
status: z.ZodEnum<{
|
|
12
|
+
paused: "paused";
|
|
12
13
|
ready: "ready";
|
|
13
14
|
running: "running";
|
|
14
|
-
paused: "paused";
|
|
15
15
|
stopped: "stopped";
|
|
16
16
|
pending_authorization: "pending_authorization";
|
|
17
17
|
pending_action: "pending_action";
|
|
@@ -131,8 +131,9 @@ declare const Reply: z.ZodObject<{
|
|
|
131
131
|
when: "when";
|
|
132
132
|
label: "label";
|
|
133
133
|
text: "text";
|
|
134
|
-
kind: "kind";
|
|
135
134
|
status: "status";
|
|
135
|
+
steps: "steps";
|
|
136
|
+
kind: "kind";
|
|
136
137
|
durationMs: "durationMs";
|
|
137
138
|
role: "role";
|
|
138
139
|
to: "to";
|
|
@@ -148,7 +149,6 @@ declare const Reply: z.ZodObject<{
|
|
|
148
149
|
deltaY: "deltaY";
|
|
149
150
|
refs: "refs";
|
|
150
151
|
pixels: "pixels";
|
|
151
|
-
steps: "steps";
|
|
152
152
|
coordinate: "coordinate";
|
|
153
153
|
unknown_field: "unknown_field";
|
|
154
154
|
proposal: "proposal";
|
|
@@ -875,8 +875,8 @@ export declare const VoiceConfigSchema: z.ZodOptional<z.ZodObject<{
|
|
|
875
875
|
auto: "auto";
|
|
876
876
|
}>>;
|
|
877
877
|
language: z.ZodOptional<z.ZodEnum<{
|
|
878
|
-
en: "en";
|
|
879
878
|
zh: "zh";
|
|
879
|
+
en: "en";
|
|
880
880
|
}>>;
|
|
881
881
|
input: z.ZodOptional<z.ZodObject<{
|
|
882
882
|
refinement: z.ZodOptional<z.ZodObject<{
|
|
@@ -1424,6 +1424,9 @@ export declare const ConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
1424
1424
|
remote_allowed: "remote_allowed";
|
|
1425
1425
|
}>>;
|
|
1426
1426
|
extraction: z.ZodDefault<z.ZodObject<{
|
|
1427
|
+
crossSessionObservations: z.ZodDefault<z.ZodBoolean>;
|
|
1428
|
+
observationWindowDays: z.ZodDefault<z.ZodNumber>;
|
|
1429
|
+
maxObservationEvidence: z.ZodDefault<z.ZodNumber>;
|
|
1427
1430
|
reviewIntervalTurns: z.ZodDefault<z.ZodNumber>;
|
|
1428
1431
|
maxHistoryMessages: z.ZodDefault<z.ZodNumber>;
|
|
1429
1432
|
maxDurationMs: z.ZodDefault<z.ZodNumber>;
|
|
@@ -1457,6 +1460,7 @@ export declare const ConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
1457
1460
|
learning: z.ZodOptional<z.ZodObject<{
|
|
1458
1461
|
idleFlushMs: z.ZodDefault<z.ZodNumber>;
|
|
1459
1462
|
maxBatchChars: z.ZodDefault<z.ZodNumber>;
|
|
1463
|
+
evidenceReview: z.ZodDefault<z.ZodBoolean>;
|
|
1460
1464
|
maxDailyBatches: z.ZodDefault<z.ZodNumber>;
|
|
1461
1465
|
}, z.core.$strict>>;
|
|
1462
1466
|
readScopes: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
@@ -2213,8 +2217,8 @@ export declare const ConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
2213
2217
|
auto: "auto";
|
|
2214
2218
|
}>>;
|
|
2215
2219
|
language: z.ZodOptional<z.ZodEnum<{
|
|
2216
|
-
en: "en";
|
|
2217
2220
|
zh: "zh";
|
|
2221
|
+
en: "en";
|
|
2218
2222
|
}>>;
|
|
2219
2223
|
input: z.ZodOptional<z.ZodObject<{
|
|
2220
2224
|
refinement: z.ZodOptional<z.ZodObject<{
|
|
@@ -1078,6 +1078,9 @@ workDiscoveryOnboarding: z.boolean().default(true) }).strict().default({ workDis
|
|
|
1078
1078
|
showMemoryReferences: true,
|
|
1079
1079
|
processingPolicy: "remote_allowed",
|
|
1080
1080
|
extraction: {
|
|
1081
|
+
crossSessionObservations: true,
|
|
1082
|
+
observationWindowDays: 30,
|
|
1083
|
+
maxObservationEvidence: 6,
|
|
1081
1084
|
reviewIntervalTurns: 10,
|
|
1082
1085
|
maxHistoryMessages: 80,
|
|
1083
1086
|
maxDurationMs: 12e4
|
|
@@ -154,8 +154,15 @@ async function deriveConnectedSourceUnderstanding(input) {
|
|
|
154
154
|
}
|
|
155
155
|
const sourceRun = getUnderstandingSourceRun(input.sourceRunId);
|
|
156
156
|
const consentReceipt = sourceRun ? getActiveUnderstandingConsent(sourceRun.grantId) ?? void 0 : void 0;
|
|
157
|
+
const allowPersonal = input.config.userContext.enabled && input.config.userContext.userModel.enabled && input.config.userContext.userModel.writePolicy === "allow" && consentReceipt?.purposes.includes("personalization");
|
|
158
|
+
const allowWork = input.config.userContext.enabled && input.config.userContext.knowledgeMemory.enabled && input.config.userContext.knowledgeMemory.writePolicy === "allow" && consentReceipt?.purposes.includes("work_assistance");
|
|
159
|
+
if (!allowPersonal && !allowWork) return {
|
|
160
|
+
created: 0,
|
|
161
|
+
knowledgeCount: 0,
|
|
162
|
+
status: "completed"
|
|
163
|
+
};
|
|
157
164
|
const modelItems = itemsAllowedByConsent(items, consentReceipt);
|
|
158
|
-
recordConnectedSourceObservations({
|
|
165
|
+
if (allowPersonal) recordConnectedSourceObservations({
|
|
159
166
|
items: sourceItems,
|
|
160
167
|
consent: consentReceipt,
|
|
161
168
|
sourceGrantId: sourceRun?.grantId
|
|
@@ -182,7 +189,7 @@ async function deriveConnectedSourceUnderstanding(input) {
|
|
|
182
189
|
const byRef = new Map(modelItems.map((item) => [item.evidenceRef, item]));
|
|
183
190
|
const outputs = [];
|
|
184
191
|
let created = 0;
|
|
185
|
-
for (const candidate of analysis.profileCandidates.filter(isPortraitCandidate)) {
|
|
192
|
+
for (const candidate of allowPersonal ? analysis.profileCandidates.filter(isPortraitCandidate) : []) {
|
|
186
193
|
const policy = candidatePolicy(candidate);
|
|
187
194
|
const evidenceItems = durableEvidence(candidate, byRef);
|
|
188
195
|
const candidateKey = `connected-profile:${candidate.category}:${candidate.factKey}`;
|
|
@@ -271,7 +278,7 @@ async function deriveConnectedSourceUnderstanding(input) {
|
|
|
271
278
|
const item = byRef.get(ref);
|
|
272
279
|
return item?.ownerAttribution === "user" ? [item] : [];
|
|
273
280
|
});
|
|
274
|
-
if (consentReceipt?.allowedDomains.includes("goals") && !consentReceipt.deniedDomains.includes("goals") && thread.confidence !== "low" && goalEvidence.length) {
|
|
281
|
+
if (allowPersonal && consentReceipt?.allowedDomains.includes("goals") && !consentReceipt.deniedDomains.includes("goals") && thread.confidence !== "low" && goalEvidence.length) {
|
|
275
282
|
const observedAt = Math.max(...goalEvidence.map((item) => item.occurredAt ?? item.modifiedAt ?? Date.now()));
|
|
276
283
|
const validityDays = thread.horizon === "current" ? 30 : thread.horizon === "ongoing" ? 90 : 365;
|
|
277
284
|
let goalCreated = false;
|
|
@@ -335,6 +342,7 @@ async function deriveConnectedSourceUnderstanding(input) {
|
|
|
335
342
|
}
|
|
336
343
|
if (goalCreated) created += 1;
|
|
337
344
|
}
|
|
345
|
+
if (!allowWork) continue;
|
|
338
346
|
const evidence = evidenceRefs.flatMap((ref) => {
|
|
339
347
|
const evidenceItem = byRef.get(ref);
|
|
340
348
|
const sourceItem = sourceItems.find((item) => `knowledge-source://${item.id}` === ref);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
+
import { getSqliteDatabase } from "../storage/sqlite/transaction.js";
|
|
3
4
|
import { getConnectorAccount, reconcileConnectorAccount } from "../storage/sqlite/connector-account-repository.js";
|
|
4
5
|
import { getConnectorInstallation, listConnectorConnections, upsertConnectorConnection } from "../storage/sqlite/connector-repository.js";
|
|
5
6
|
import { claimNextConnectorLearningJob, enqueueConnectorLearningJob, listConnectorLearningJobs, recoverStaleConnectorLearningJobs, setConnectorLearningPaused, updateConnectorLearningJob } from "../storage/sqlite/connector-learning-repository.js";
|
|
@@ -7,6 +8,7 @@ import { pruneBoundedKnowledgeSourceItems } from "../storage/sqlite/knowledge-re
|
|
|
7
8
|
import { getConnectorSyncPolicyForConnection } from "../storage/sqlite/connector-sync-policy-repository.js";
|
|
8
9
|
import "../storage/sqlite/index.js";
|
|
9
10
|
import { getActiveUnderstandingConsent, grantUnderstandingConsent } from "../user-context/sources/consent-repository.js";
|
|
11
|
+
import { canAccessConnectorAccount } from "./account-access.js";
|
|
10
12
|
import { connectorIdentityKey, normalizeConnectorIdentity } from "./connector-identity.js";
|
|
11
13
|
import { ComposioSessionsAdapter } from "./composio-sessions.js";
|
|
12
14
|
import { buildConnectorLearningArguments, getConnectorLearningPlan } from "./learning-recipes.js";
|
|
@@ -31,9 +33,19 @@ function connectorSourceCategory(toolkit) {
|
|
|
31
33
|
if (toolkit === "github" || toolkit === "linear") return "code_activity";
|
|
32
34
|
return "files";
|
|
33
35
|
}
|
|
36
|
+
function consentWasRevoked(grantId) {
|
|
37
|
+
return !getActiveUnderstandingConsent(grantId) && Boolean(getSqliteDatabase().prepare("SELECT 1 FROM understanding_consent_receipts WHERE grant_id = ? LIMIT 1").get(grantId));
|
|
38
|
+
}
|
|
34
39
|
function ensureUnderstandingSourceRun(job, toolkit, displayName, config) {
|
|
35
|
-
|
|
36
|
-
if (existing
|
|
40
|
+
let existing = listUnderstandingSourceGrants({ includeRevoked: true }).find((grant) => grant.sourceKey === `connector-account:${job.accountId}`);
|
|
41
|
+
if (existing && (existing.status === "revoked" || consentWasRevoked(existing.id))) throw new Error("Source authorization was revoked.");
|
|
42
|
+
if (existing && existing.config.sourceInstanceId !== job.sourceInstanceId) existing = upsertUnderstandingSourceGrant({
|
|
43
|
+
...existing,
|
|
44
|
+
config: {
|
|
45
|
+
...existing.config,
|
|
46
|
+
sourceInstanceId: job.sourceInstanceId
|
|
47
|
+
}
|
|
48
|
+
});
|
|
37
49
|
const grant = existing ?? upsertUnderstandingSourceGrant({
|
|
38
50
|
sourceKey: `connector-account:${job.accountId}`,
|
|
39
51
|
adapterId: `connector:${job.connectorId}`,
|
|
@@ -46,6 +58,7 @@ function ensureUnderstandingSourceRun(job, toolkit, displayName, config) {
|
|
|
46
58
|
config: {
|
|
47
59
|
connectorId: job.connectorId,
|
|
48
60
|
accountId: job.accountId,
|
|
61
|
+
sourceInstanceId: job.sourceInstanceId,
|
|
49
62
|
readOnly: true
|
|
50
63
|
}
|
|
51
64
|
});
|
|
@@ -92,7 +105,7 @@ function ensureUnderstandingSourceRun(job, toolkit, displayName, config) {
|
|
|
92
105
|
});
|
|
93
106
|
}
|
|
94
107
|
function learningEnabled(config) {
|
|
95
|
-
return config.userContext.enabled && config.userContext.userModel.enabled;
|
|
108
|
+
return config.userContext.enabled && (config.userContext.userModel.enabled || config.userContext.knowledgeMemory.enabled);
|
|
96
109
|
}
|
|
97
110
|
function startConnectorLearningCoordinator(options) {
|
|
98
111
|
const intervalMs = Math.max(2e3, Math.min(options.intervalMs ?? 1e4, 6e4));
|
|
@@ -107,8 +120,9 @@ function startConnectorLearningCoordinator(options) {
|
|
|
107
120
|
const connection = listConnectorConnections().find((item) => item.id === connectionId && item.status === "active");
|
|
108
121
|
if (!connection) return null;
|
|
109
122
|
if (!connection.accountId) throw new Error(`Connector account is missing for connection ${connection.id}.`);
|
|
110
|
-
|
|
111
|
-
if (
|
|
123
|
+
const installation = getConnectorInstallation(connection.installationId);
|
|
124
|
+
if (!installation || !canAccessConnectorAccount(connection, installation, options.resolveAgentId())) return null;
|
|
125
|
+
if (listUnderstandingSourceGrants({ includeRevoked: true }).some((grant) => grant.sourceKey === `connector-account:${connection.accountId}` && (grant.status === "revoked" || consentWasRevoked(grant.id)))) return null;
|
|
112
126
|
if (request.reason === "manual") {
|
|
113
127
|
const active = listConnectorLearningJobs({
|
|
114
128
|
accountId: connection.accountId,
|
|
@@ -346,6 +360,7 @@ function startConnectorLearningCoordinator(options) {
|
|
|
346
360
|
if (running || stopped) return;
|
|
347
361
|
running = true;
|
|
348
362
|
try {
|
|
363
|
+
recoverAuthorizedConnections();
|
|
349
364
|
for (let count = 0; count < 10; count += 1) {
|
|
350
365
|
const job = claimNextConnectorLearningJob();
|
|
351
366
|
if (!job) break;
|
|
@@ -380,13 +395,32 @@ function startConnectorLearningCoordinator(options) {
|
|
|
380
395
|
running = false;
|
|
381
396
|
}
|
|
382
397
|
}
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
for (const connection of activeAccountConnections())
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
398
|
+
function recoverAuthorizedConnections() {
|
|
399
|
+
if (!learningEnabled(options.getConfig())) return;
|
|
400
|
+
for (const connection of activeAccountConnections()) {
|
|
401
|
+
const jobs = listConnectorLearningJobs({
|
|
402
|
+
accountId: connection.accountId,
|
|
403
|
+
limit: 100
|
|
404
|
+
});
|
|
405
|
+
if (jobs.some((job) => [
|
|
406
|
+
"queued",
|
|
407
|
+
"running",
|
|
408
|
+
"failed",
|
|
409
|
+
"paused"
|
|
410
|
+
].includes(job.status))) continue;
|
|
411
|
+
const policy = getConnectorSyncPolicyForConnection(connection.id);
|
|
412
|
+
if (!policy?.scanEnabled) continue;
|
|
413
|
+
const last = jobs[0];
|
|
414
|
+
const nextRunAt = last ? Date.parse(last.updatedAt) + (policy.intervalMinutes ?? 30) * 6e4 : void 0;
|
|
415
|
+
enqueueConnection(connection.id, {
|
|
416
|
+
reason: "schedule",
|
|
417
|
+
nextRunAt,
|
|
418
|
+
idempotencyKey: last ? `recovery:${connection.accountId}:${last.id}` : void 0
|
|
419
|
+
});
|
|
420
|
+
}
|
|
389
421
|
}
|
|
422
|
+
recoverStaleConnectorLearningJobs(Date.now());
|
|
423
|
+
recoverAuthorizedConnections();
|
|
390
424
|
timer = setTimeout(() => {
|
|
391
425
|
runNow();
|
|
392
426
|
timer = setInterval(() => void runNow(), intervalMs);
|
|
@@ -79,11 +79,12 @@ function validateRecordingManifest(capture, input) {
|
|
|
79
79
|
"seal"
|
|
80
80
|
].includes(event.kind)))) throw invalid("Invalid recording events");
|
|
81
81
|
if (input.epochs !== void 0) {
|
|
82
|
-
if (input.containerMode || !Array.isArray(input.epochs) || input.epochs.length <
|
|
82
|
+
if (input.containerMode || !Array.isArray(input.epochs) || input.epochs.length < 1 || input.epochs.length > 100 || input.epochs.some((epoch, index) => !epoch || !Number.isSafeInteger(epoch.firstChunk) || (index === 0 ? epoch.firstChunk !== 0 : epoch.firstChunk <= input.epochs[index - 1].firstChunk) || epoch.firstChunk >= input.chunkCount || !Number.isSafeInteger(epoch.startedAt) || epoch.startedAt < 0 || epoch.previousEndedAt !== void 0 && (!Number.isSafeInteger(epoch.previousEndedAt) || epoch.previousEndedAt < 0) || typeof epoch.mimeType !== "string" || ![
|
|
83
83
|
"audio/webm",
|
|
84
84
|
"audio/mp4",
|
|
85
85
|
"audio/ogg",
|
|
86
|
-
"audio/wav"
|
|
86
|
+
"audio/wav",
|
|
87
|
+
"audio/mpeg"
|
|
87
88
|
].includes(epoch.mimeType.split(";")[0]))) throw invalid("Invalid recording epochs");
|
|
88
89
|
}
|
|
89
90
|
const mimeType = input.mimeType.split(";")[0];
|
|
@@ -156,8 +157,8 @@ async function completeRecording(capture, input, notes, assertLease, signal) {
|
|
|
156
157
|
} finally {
|
|
157
158
|
await file.close();
|
|
158
159
|
}
|
|
159
|
-
let durationMs = 0;
|
|
160
|
-
await forEachNormalizedAudioSegment({
|
|
160
|
+
let durationMs = epochs?.reduce((total, epoch) => total + epoch.durationMs, 0) ?? 0;
|
|
161
|
+
if (!epochs) await forEachNormalizedAudioSegment({
|
|
161
162
|
filePath: target,
|
|
162
163
|
segmentSeconds: 30,
|
|
163
164
|
maxDurationSeconds: DISCUSSION_MAX_SAVED_DURATION_MS / 1e3,
|
|
@@ -197,7 +198,7 @@ async function completeRecording(capture, input, notes, assertLease, signal) {
|
|
|
197
198
|
}
|
|
198
199
|
}
|
|
199
200
|
const attachment = await notes.addAttachment(capture.noteId, {
|
|
200
|
-
name: input.epochs ? "meeting-resumed.wav" : input.fileName.trim().slice(0, 200) || "meeting.webm",
|
|
201
|
+
name: input.epochs ? input.epochs.length === 1 ? "meeting-import.wav" : "meeting-resumed.wav" : input.fileName.trim().slice(0, 200) || "meeting.webm",
|
|
201
202
|
buffer: { filePath: target },
|
|
202
203
|
mimeType: outputMime,
|
|
203
204
|
duration: Math.round(durationMs / 1e3),
|
|
@@ -299,12 +300,18 @@ async function assembleEpochs(capture, input, notes, output, signal, assertLease
|
|
|
299
300
|
await output.writeFile(pcm);
|
|
300
301
|
});
|
|
301
302
|
if (!epochSamples) throw invalid("Recording epoch has no decodable audio");
|
|
303
|
+
if (input.epochs.length === 1 && epochSamples < 16e3) throw invalid("Recording must contain at least one second of audio");
|
|
302
304
|
const epochDuration = epochSamples / 16;
|
|
303
305
|
epochs.push(epoch.mimeType.includes("wav") ? pcmEpoch(epochDuration, (samples - epochSamples) / 16) : await probeMediaEpoch(path, epochDuration, (samples - epochSamples) / 16, signal));
|
|
304
306
|
assertLease();
|
|
305
307
|
signal.throwIfAborted();
|
|
306
308
|
const sha256 = await hashFile(path, signal);
|
|
307
|
-
const extension =
|
|
309
|
+
const extension = {
|
|
310
|
+
"audio/mp4": "m4a",
|
|
311
|
+
"audio/ogg": "ogg",
|
|
312
|
+
"audio/wav": "wav",
|
|
313
|
+
"audio/mpeg": "mp3"
|
|
314
|
+
}[epoch.mimeType.split(";")[0]] ?? "webm";
|
|
308
315
|
const attachment = await notes.addAttachment(capture.noteId, {
|
|
309
316
|
name: `recording-part-${capture.id}-${index + 1}.${extension}`,
|
|
310
317
|
buffer: { filePath: path },
|
|
@@ -6,8 +6,8 @@ export declare const deviceHostConfigSchema: z.ZodObject<{
|
|
|
6
6
|
identityPath: z.ZodString;
|
|
7
7
|
displayName: z.ZodString;
|
|
8
8
|
providers: z.ZodArray<z.ZodObject<{
|
|
9
|
-
title: z.ZodString;
|
|
10
9
|
summary: z.ZodString;
|
|
10
|
+
title: z.ZodString;
|
|
11
11
|
localId: z.ZodString;
|
|
12
12
|
gatewayFormInput: z.ZodOptional<z.ZodLiteral<1>>;
|
|
13
13
|
server: z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -66,8 +66,8 @@ export declare function readDeviceHostConfig(path: string): Promise<{
|
|
|
66
66
|
identityPath: string;
|
|
67
67
|
displayName: string;
|
|
68
68
|
providers: {
|
|
69
|
-
title: string;
|
|
70
69
|
summary: string;
|
|
70
|
+
title: string;
|
|
71
71
|
localId: string;
|
|
72
72
|
policies: Record<string, {
|
|
73
73
|
sensitivity: "public" | "personal";
|
|
@@ -236,6 +236,9 @@ export declare function buildSafeWebConfigPayload(service: GatewayService, optio
|
|
|
236
236
|
showMemoryReferences: boolean;
|
|
237
237
|
processingPolicy: "local_only" | "remote_allowed";
|
|
238
238
|
extraction: {
|
|
239
|
+
crossSessionObservations: boolean;
|
|
240
|
+
observationWindowDays: number;
|
|
241
|
+
maxObservationEvidence: number;
|
|
239
242
|
reviewIntervalTurns: number;
|
|
240
243
|
maxHistoryMessages: number;
|
|
241
244
|
maxDurationMs: number;
|
|
@@ -264,6 +267,7 @@ export declare function buildSafeWebConfigPayload(service: GatewayService, optio
|
|
|
264
267
|
learning?: {
|
|
265
268
|
idleFlushMs: number;
|
|
266
269
|
maxBatchChars: number;
|
|
270
|
+
evidenceReview: boolean;
|
|
267
271
|
maxDailyBatches: number;
|
|
268
272
|
};
|
|
269
273
|
allowedProviderIds?: string[];
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { FollowUpCommandSchema, FollowUpCreateSchema } from "../../../../packages/gateway-contract/src/follow-ups.js";
|
|
2
|
+
import { ObservationPrepareRequestSchema } from "../../../../packages/gateway-contract/src/observation-starters.js";
|
|
1
3
|
import { ObservationCommandRequestSchema, ObservationTrialRequestSchema, RoutineAdoptRequestSchema, RoutineCommandRequestSchema } from "../../../../packages/gateway-contract/src/observation.js";
|
|
2
4
|
import { HomeAdviceMetricsSchema, HomeAdvisorRefreshRequestSchema, HomeOpportunityActionRequestSchema, HomeOpportunityFeedbackRequestSchema, HomeOpportunityFeedbackUndoRequestSchema, HomeOpportunityHistoryResponseSchema } from "../../../../packages/gateway-contract/src/home.js";
|
|
3
5
|
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
@@ -6,8 +8,8 @@ import { acknowledgeHomeAttention } from "../../../storage/sqlite/home-attention
|
|
|
6
8
|
import "../../../storage/sqlite/index.js";
|
|
7
9
|
import { HomeQueryService, buildHomeWorkbench, decisionFromTask } from "../../../tasks/home-query-service.js";
|
|
8
10
|
import { resumeApprovedConnectorAction } from "../../../connectors/approval-resume.js";
|
|
9
|
-
import { HomeOpportunityActionError, HomeOpportunityNotFoundError } from "../../../home-intelligence/application-service.js";
|
|
10
11
|
import { ObservationConflictError } from "../../../home-intelligence/observation.js";
|
|
12
|
+
import { HomeOpportunityActionError, HomeOpportunityNotFoundError } from "../../../home-intelligence/application-service.js";
|
|
11
13
|
//#region src/gateway/hono/routes/home.ts
|
|
12
14
|
init_src();
|
|
13
15
|
/** Register the unified work-home read model and its decision actions. */
|
|
@@ -21,6 +23,39 @@ function registerHomeRoutes(authenticated, deps) {
|
|
|
21
23
|
observation: service.currentConfig.userContext.enabled && service.currentConfig.userContext.homeIntelligence.enabled ? service.homeIntelligence.getObservation() : void 0
|
|
22
24
|
});
|
|
23
25
|
});
|
|
26
|
+
authenticated.get("/api/home/follow-ups", (c) => c.json({ items: service.homeIntelligence.followUps.list() }));
|
|
27
|
+
authenticated.post("/api/home/follow-ups", deps.strictRateLimitMiddleware, async (c) => {
|
|
28
|
+
const parsed = FollowUpCreateSchema.safeParse(await c.req.json().catch(() => null));
|
|
29
|
+
if (!parsed.success) return c.json({
|
|
30
|
+
ok: false,
|
|
31
|
+
error: "Invalid continuing goal"
|
|
32
|
+
}, 400);
|
|
33
|
+
try {
|
|
34
|
+
return c.json(service.homeIntelligence.followUps.create(parsed.data));
|
|
35
|
+
} catch (err) {
|
|
36
|
+
if (err instanceof ObservationConflictError) return c.json({
|
|
37
|
+
ok: false,
|
|
38
|
+
error: err.message
|
|
39
|
+
}, 409);
|
|
40
|
+
throw err;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
authenticated.post("/api/home/follow-ups/:id/command", deps.strictRateLimitMiddleware, async (c) => {
|
|
44
|
+
const parsed = FollowUpCommandSchema.safeParse(await c.req.json().catch(() => null));
|
|
45
|
+
if (!parsed.success) return c.json({
|
|
46
|
+
ok: false,
|
|
47
|
+
error: "Invalid goal action"
|
|
48
|
+
}, 400);
|
|
49
|
+
try {
|
|
50
|
+
return c.json(await service.homeIntelligence.followUps.command(c.req.param("id"), parsed.data));
|
|
51
|
+
} catch (err) {
|
|
52
|
+
if (err instanceof ObservationConflictError) return c.json({
|
|
53
|
+
ok: false,
|
|
54
|
+
error: err.message
|
|
55
|
+
}, 409);
|
|
56
|
+
throw err;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
24
59
|
authenticated.get("/api/home/routines", (c) => c.json({ items: service.homeIntelligence.routines?.list() ?? [] }));
|
|
25
60
|
authenticated.post("/api/home/routines/adopt", deps.strictRateLimitMiddleware, async (c) => {
|
|
26
61
|
const parsed = RoutineAdoptRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
@@ -78,6 +113,22 @@ function registerHomeRoutes(authenticated, deps) {
|
|
|
78
113
|
throw err;
|
|
79
114
|
}
|
|
80
115
|
});
|
|
116
|
+
authenticated.post("/api/home/observation/prepare", deps.strictRateLimitMiddleware, async (c) => {
|
|
117
|
+
const parsed = ObservationPrepareRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
118
|
+
if (!parsed.success) return c.json({
|
|
119
|
+
ok: false,
|
|
120
|
+
error: "Invalid draft request"
|
|
121
|
+
}, 400);
|
|
122
|
+
try {
|
|
123
|
+
return c.json(service.homeIntelligence.prepareObservation(parsed.data));
|
|
124
|
+
} catch (err) {
|
|
125
|
+
if (err instanceof ObservationConflictError) return c.json({
|
|
126
|
+
ok: false,
|
|
127
|
+
error: err.message
|
|
128
|
+
}, 409);
|
|
129
|
+
throw err;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
81
132
|
authenticated.post("/api/home/observation/trial", deps.strictRateLimitMiddleware, async (c) => {
|
|
82
133
|
const parsed = ObservationTrialRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
83
134
|
if (!parsed.success) return c.json({
|
|
@@ -9,10 +9,10 @@ import "../../../activity/index.js";
|
|
|
9
9
|
import { listKnowledgeItems, writeKnowledgeItem } from "../../../knowledge-memory/repository.js";
|
|
10
10
|
import "../../../knowledge-memory/index.js";
|
|
11
11
|
import { resolveEffectiveAgentProfile } from "../../../config/agent-profile.js";
|
|
12
|
+
import { ProjectWorkspaceConflictError, ProjectWorkspaceMissingError } from "../../../projects/workspace-project.js";
|
|
12
13
|
import { TaskReadModelProjector } from "../../../tasks/task-read-model-projector.js";
|
|
13
14
|
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
14
15
|
import "../../../capabilities/runtime/dispatcher.js";
|
|
15
|
-
import { ProjectWorkspaceConflictError, ProjectWorkspaceMissingError } from "../../../projects/workspace-project.js";
|
|
16
16
|
import { inferProjectExecutionMode, inferProjectKind } from "../../../projects/project-kind.js";
|
|
17
17
|
import { ProjectDeletionBlockedError, ProjectWorkspaceInUseError } from "../../../projects/project-service.js";
|
|
18
18
|
import { resolveProjectAgentId } from "../../../projects/project-agent.js";
|
|
@@ -6,6 +6,7 @@ import { parseUserTurnDocument, userTurnDocumentRefIds } from "../../../../packa
|
|
|
6
6
|
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
7
7
|
import { SessionInputControlConflict, init_session_input_control_repository } from "../../../storage/sqlite/session-input-control-repository.js";
|
|
8
8
|
import { endpointTurnClaimSchema, init_src as init_src$1 } from "../../../../packages/endpoint-tools-protocol/src/index.js";
|
|
9
|
+
import { getSessionInputById, init_session_input_repository } from "../../../storage/sqlite/session-input-repository.js";
|
|
9
10
|
import { recordDeviceExecutionActor } from "../../../endpoint-tools/execution-actor.js";
|
|
10
11
|
import { validateWebchatAttachments, validateWebchatContent } from "../../chat-limits.js";
|
|
11
12
|
import { parseSlashCommand } from "../../../chat-commands/command-parse.js";
|
|
@@ -23,6 +24,7 @@ init_session_input_control_repository();
|
|
|
23
24
|
init_src();
|
|
24
25
|
init_src$1();
|
|
25
26
|
init_logger();
|
|
27
|
+
init_session_input_repository();
|
|
26
28
|
const log = createLogger("Gateway:SessionCommand");
|
|
27
29
|
function commandError(c, error) {
|
|
28
30
|
if (error instanceof SessionInputControlConflict) return c.json({
|
|
@@ -45,6 +47,7 @@ function commandError(c, error) {
|
|
|
45
47
|
throw error;
|
|
46
48
|
}
|
|
47
49
|
async function handleSessionCommand(c, deps, materialize = false) {
|
|
50
|
+
const receivedAt = performance.now();
|
|
48
51
|
const id = conversationIdSchema.safeParse(c.req.param("conversationId"));
|
|
49
52
|
const body = await c.req.json().catch(() => null);
|
|
50
53
|
const parsed = materialize ? sessionMaterializeCommandSchema.safeParse(body) : sessionInputCommandSchema.safeParse(body);
|
|
@@ -130,6 +133,8 @@ async function handleSessionCommand(c, deps, materialize = false) {
|
|
|
130
133
|
if (command.input.appContext) contexts.push(await deps.service.prepareSessionAppContext(command.input.appContext, principal, id.data, command.clientMessageId));
|
|
131
134
|
return contexts;
|
|
132
135
|
});
|
|
136
|
+
const receiveMs = performance.now() - receivedAt;
|
|
137
|
+
c.header("Server-Timing", `session_input;dur=${receiveMs.toFixed(3)}`, { append: true });
|
|
133
138
|
if ("input" in command) recordDeviceExecutionActor(id.data, command.clientMessageId, principal);
|
|
134
139
|
deps.service.emit("session.input-state", payload.inputState);
|
|
135
140
|
if ("kind" in command && command.kind === "start") deps.service.emit("session.updated", { key: id.data });
|
|
@@ -173,9 +178,18 @@ async function handleSessionInputReceipt(c, deps) {
|
|
|
173
178
|
message: "Conversation was deleted"
|
|
174
179
|
}
|
|
175
180
|
}, 410);
|
|
181
|
+
const payload = await sessionCommandSnapshot(deps.service, receipt);
|
|
182
|
+
const input = receipt.inputId ? getSessionInputById(id.data, receipt.inputId) : void 0;
|
|
183
|
+
const execution = input?.clientMessageId === receipt.clientMessageId && input.expectedTranscriptId === receipt.transcriptId ? {
|
|
184
|
+
runId: input.runId,
|
|
185
|
+
status: input.status
|
|
186
|
+
} : void 0;
|
|
176
187
|
return c.json({
|
|
177
188
|
ok: true,
|
|
178
|
-
payload:
|
|
189
|
+
payload: {
|
|
190
|
+
...payload,
|
|
191
|
+
execution
|
|
192
|
+
}
|
|
179
193
|
});
|
|
180
194
|
} catch (error) {
|
|
181
195
|
return commandError(c, error);
|
|
@@ -3,13 +3,13 @@ import { createCollaborationRule, getCollaborationRule, listCollaborationRules,
|
|
|
3
3
|
import { getActiveUnderstandingConsent } from "../../../user-context/sources/consent-repository.js";
|
|
4
4
|
import { KnowledgeReviewConflictError, deleteKnowledgeItem, getKnowledgeItem, listKnowledgeItems, reviewKnowledgeItem, searchKnowledgeItems, setKnowledgeScope } from "../../../knowledge-memory/repository.js";
|
|
5
5
|
import "../../../knowledge-memory/index.js";
|
|
6
|
+
import { listUserAssertionEdges, listUserModelObservations } from "../../../user-model/observation-repository.js";
|
|
6
7
|
import { createPriorityWindow, createUserGoal, listPriorityWindows, listUserGoals, setUserGoalStatus, updatePriorityWindow, updateUserGoal } from "../../../user-model/goals.js";
|
|
7
8
|
import { deleteUserAssertion, getAssertionSlot, getUserAssertion, listUserAssertionSources, listUserAssertions, reconcileAssertion, setAssertionStatus, setUserAssertionScope } from "../../../user-model/repository.js";
|
|
8
9
|
import { canUseAssertion } from "../../../user-model/usage-policy.js";
|
|
9
10
|
import { applyUserProfilePatch, getUserProfileSnapshot } from "../../../user-model/profile.js";
|
|
10
11
|
import { memoryVersion } from "../../../user-context/memory-version.js";
|
|
11
12
|
import { listActionRuleSuggestions } from "../../../user-model/action-rule-suggestions.js";
|
|
12
|
-
import { listUserAssertionEdges, listUserModelObservations } from "../../../user-model/observation-repository.js";
|
|
13
13
|
import { bootstrapUserModel } from "../../../user-model/bootstrap.js";
|
|
14
14
|
import "../../../user-model/index.js";
|
|
15
15
|
import { listMemoryMaintenanceRuns } from "../../../memory-maintenance/service.js";
|
|
@@ -9,6 +9,7 @@ import type { SessionIndex } from '../../session/index.js';
|
|
|
9
9
|
import { type ClarificationStreamEvent } from '../ephemeral-clarification-waiter.js';
|
|
10
10
|
import type { ClarifyRequestPayload, ClarifyRequestResult } from '../../agent/tools/clarify-tool.js';
|
|
11
11
|
import type { GatewayPrincipal } from '../security/gateway-principal.js';
|
|
12
|
+
import { type RunGatewayAgentOptions } from './run-gateway-agent.js';
|
|
12
13
|
import { NextTurnSuggestionService } from '../next-turn-suggestions/service.js';
|
|
13
14
|
import { type ActiveExecution, type ActiveExecutionKind } from './active-execution.js';
|
|
14
15
|
import type { UserTurnAttachment, UserTurnInput } from '../user-turn-input.js';
|
|
@@ -63,14 +64,7 @@ export declare class GatewayAgentRunner {
|
|
|
63
64
|
}): void;
|
|
64
65
|
unregisterExternalWebchatRun(conversationId: string, runId: string): void;
|
|
65
66
|
cancelClarificationForRun(runId: string): void;
|
|
66
|
-
runAgent(message: string, channel: string, chatId: string, origin: TurnOrigin, attachments?: UserTurnAttachment[], thinking?: string, runOptions?: {
|
|
67
|
-
inputReceivedAtMs?: number;
|
|
68
|
-
signal?: AbortSignal;
|
|
69
|
-
runId?: string;
|
|
70
|
-
taskRunId?: string;
|
|
71
|
-
sourceContexts?: AgentSourceContext[];
|
|
72
|
-
presentation?: 'voice';
|
|
73
|
-
}): AsyncGenerator<{
|
|
67
|
+
runAgent(message: string, channel: string, chatId: string, origin: TurnOrigin, attachments?: UserTurnAttachment[], thinking?: string, runOptions?: RunGatewayAgentOptions): AsyncGenerator<{
|
|
74
68
|
type: string;
|
|
75
69
|
[key: string]: unknown;
|
|
76
70
|
}, {
|
|
@@ -92,6 +92,7 @@ var GatewayAgentRunner = class {
|
|
|
92
92
|
execute: async (input) => {
|
|
93
93
|
const generator = this.runAgent(input.content, "webchat", input.conversationId, input.origin, input.attachments, input.thinking, {
|
|
94
94
|
inputReceivedAtMs: input.inputReceivedAtMs,
|
|
95
|
+
inputIdentity: input.inputIdentity,
|
|
95
96
|
runId: input.runId,
|
|
96
97
|
taskRunId: input.taskRunId,
|
|
97
98
|
sourceContexts: input.sourceContexts,
|
|
@@ -48,6 +48,9 @@ export declare class GatewayConfigCoordinator {
|
|
|
48
48
|
showMemoryReferences: boolean;
|
|
49
49
|
processingPolicy: "local_only" | "remote_allowed";
|
|
50
50
|
extraction: {
|
|
51
|
+
crossSessionObservations: boolean;
|
|
52
|
+
observationWindowDays: number;
|
|
53
|
+
maxObservationEvidence: number;
|
|
51
54
|
reviewIntervalTurns: number;
|
|
52
55
|
maxHistoryMessages: number;
|
|
53
56
|
maxDurationMs: number;
|
|
@@ -76,6 +79,7 @@ export declare class GatewayConfigCoordinator {
|
|
|
76
79
|
learning?: {
|
|
77
80
|
idleFlushMs: number;
|
|
78
81
|
maxBatchChars: number;
|
|
82
|
+
evidenceReview: boolean;
|
|
79
83
|
maxDailyBatches: number;
|
|
80
84
|
};
|
|
81
85
|
allowedProviderIds?: string[];
|
|
@@ -692,7 +696,7 @@ export declare class GatewayConfigCoordinator {
|
|
|
692
696
|
};
|
|
693
697
|
};
|
|
694
698
|
languageMode?: "manual" | "auto";
|
|
695
|
-
language?: "
|
|
699
|
+
language?: "zh" | "en";
|
|
696
700
|
input?: {
|
|
697
701
|
refinement?: {
|
|
698
702
|
mode: "off" | "custom" | "punctuation" | "light";
|
|
@@ -8,6 +8,18 @@ import type { UserTurnAttachment } from '../user-turn-input.js';
|
|
|
8
8
|
import type { AgentSourceContext } from '../../agent/source-context/types.js';
|
|
9
9
|
import { type ActiveExecution } from './active-execution.js';
|
|
10
10
|
export type RunGatewayAgentYield = ChatStreamEvent;
|
|
11
|
+
export type RunGatewayAgentOptions = {
|
|
12
|
+
inputReceivedAtMs?: number;
|
|
13
|
+
inputIdentity?: {
|
|
14
|
+
inputId: string;
|
|
15
|
+
clientMessageId: string;
|
|
16
|
+
};
|
|
17
|
+
signal?: AbortSignal;
|
|
18
|
+
runId?: string;
|
|
19
|
+
taskRunId?: string;
|
|
20
|
+
sourceContexts?: AgentSourceContext[];
|
|
21
|
+
presentation?: 'voice';
|
|
22
|
+
};
|
|
11
23
|
export type RunGatewayAgentDeps = {
|
|
12
24
|
config: Config;
|
|
13
25
|
agentService: AgentService;
|
|
@@ -23,14 +35,7 @@ export type RunGatewayAgentDeps = {
|
|
|
23
35
|
/**
|
|
24
36
|
* @param runOptions.signal — When set (e.g. client disconnect), aborts in-flight generation and persists partial output.
|
|
25
37
|
*/
|
|
26
|
-
export declare function runGatewayAgent(deps: RunGatewayAgentDeps, message: string, channel: string, chatId: string, origin: TurnOrigin, attachments?: UserTurnAttachment[], thinking?: string, runOptions?: {
|
|
27
|
-
inputReceivedAtMs?: number;
|
|
28
|
-
signal?: AbortSignal;
|
|
29
|
-
runId?: string;
|
|
30
|
-
taskRunId?: string;
|
|
31
|
-
sourceContexts?: AgentSourceContext[];
|
|
32
|
-
presentation?: 'voice';
|
|
33
|
-
}): AsyncGenerator<RunGatewayAgentYield, {
|
|
38
|
+
export declare function runGatewayAgent(deps: RunGatewayAgentDeps, message: string, channel: string, chatId: string, origin: TurnOrigin, attachments?: UserTurnAttachment[], thinking?: string, runOptions?: RunGatewayAgentOptions): AsyncGenerator<RunGatewayAgentYield, {
|
|
34
39
|
status: string;
|
|
35
40
|
summary: string;
|
|
36
41
|
}, unknown>;
|