@xopcai/xopc 0.0.227 → 0.0.229
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/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-BevwE16n.js → activity-store-M0nAY5XB.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BggVQrEZ.js → agent-avatar-dicebear-CsFAJTIN.js} +1 -1
- package/dist/gateway/static/root/assets/agents-DA4b6_0C.js +68 -0
- package/dist/gateway/static/root/assets/{api-Bx_BpIt8.js → api-BywYxpaS.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-BtKP9n2r.js → app-management-settings-panel-7KcMWuah.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BoH2NAUX.js → appearance-settings-Cqlw7Fif.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-CsnhdGZ2.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-DnceUyxm.js → archive-plugin-7_DXaMTP.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-Bh8_9gkr.js → attachment-load-q4pDpqkF.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-ZKeAAVxD.js → automations-page-BuTqjKGX.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-CD0E2ThS.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-Cy9er6w-.js → binary-plugins-DUce1Bsc.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-Cc0wWvNX.js → block-editor-D8Ejp-QR.js} +3 -3
- package/dist/gateway/static/root/assets/browser-settings-page-CY1k3MMd.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-BS7rpLLl.js → browser-workflow-inputs-8NC2qDRF.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-BdBVUZXm.js → browser-workflows-page-BDvZbR9v.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-D1VfotHQ.js +7 -0
- package/dist/gateway/static/root/assets/{capability-presets-api-D1Lqz0Tt.js → capability-presets-api-o0y9WgAI.js} +1 -1
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-DXHqRLpU.js +3 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-CGuEl-l2.js → channel-recipient-api-C5ABr73b.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-DrFL57M_.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-38FsOnR0.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-CdX_7aQh.js → chat-terminal-dock-h1CKexNz.js} +2 -2
- package/dist/gateway/static/root/assets/connectors-page-DUAyfFCF.js +2 -0
- package/dist/gateway/static/root/assets/{cron-expression-BnSQc4Ek.js → cron-expression-DlaQQOId.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-BbuG7zQ_.js → date-picker-8R1sXJKb.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-snZeqOmG.js → dependency-picker-CWur0821.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DJQ8JoR1.js → desktop-pet-Knl-zNDU.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-B9txsRtv.js → desktop-pet-settings-CAQMLVtd.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-D7WKWkNB.js → directory-picker-path-field-Caaz4Rw5.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-D_7cOCj2.js → extension-debug-page-B965Mc15.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-Bwu47iUb.js → extension-page-C0UnkBi5.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-Dwg4dSZM.js → extension-settings-page-BUSIAZCR.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-jURUSte_.js → gateway-config-api-DkH0eEgy.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-6SQXF1yR.js → gateway-config-swr-BWGjnmDl.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-UklJOMLX.js → gateway-settings-BBgLDm6I.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-DqWaxyvZ.js → gateway-startup-retry-B_zrtccP.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-Djs_nduD.js → heartbeat-settings-BtEHVXWD.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-5SU2TNJj.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-Bxmt6LEr.js → image-generation-api-YKP2me5Z.js} +1 -1
- package/dist/gateway/static/root/assets/index-BNWhgmjs.js +70 -0
- package/dist/gateway/static/root/assets/index-D_hrEKXM.css +2 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-ByVsCH3d.js → keyboard-shortcuts-settings-CsRz8NrS.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-DYPEUgpP.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-D19R-xsz.js → local-apps-page-CTBNUG4a.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-Ci1Qi0Q-.js → locale-store-CXhjfe4q.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-B0P7rG2B.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-G0y7zmfY.js → management-settings-YqUAEwQo.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-B69d2HWt.js → markdown-split-dxpSCXb8.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-DD_PgVue.css → markdown-view-CLzTdVLW.css} +1 -1
- package/dist/gateway/static/root/assets/markdown-view-DvM5PWEH.js +201 -0
- package/dist/gateway/static/root/assets/{media-plugins-6TWEQgN_.js → media-plugins-CJ00i1Lg.js} +1 -1
- package/dist/gateway/static/root/assets/messages-BMdD0LWk.js +3 -0
- package/dist/gateway/static/root/assets/{notes-api-DLsnnZCS.js → notes-api-BFsOGYkd.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-CkRJJKDm.js → notes-page-DEnbnkIt.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-DmVYu_Oc.js +4 -0
- package/dist/gateway/static/root/assets/{product-open-page-HxArIvoN.js → product-open-page-BHxo9U95.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-DV2nGmsq.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-BNIFwFfc.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-lEar5FOV.js → registry-api-BFZrVYfy.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-DLXqKiA_.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-Bf03UNGD.js → runtime-tools-settings-panel-BpQ2GI-0.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-CIXMBgx5.js → schema-form-HE1G26Lx.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-DWaXf_25.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-JFCbnCL2.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-DgdB26mE.js → settings-form-section-CXAn0Xhy.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-efk5W6lG.js → settings-loading-skeleton-DsFu7Bcv.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-BHVf4gEP.js → settings-page-C4iib9nO.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-WK0dGNMv.js → setup-status-panel-BA83Wr1d.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-Cod-w2qm.js → share-preview-page-BOGl3s6M.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-CUqQ31gt.js → shares-settings-Q2MdGaBi.js} +1 -1
- package/dist/gateway/static/root/assets/skill-reload-api-cFtfVeFU.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-DwCcipqK.js → skills-page-CdaFtNw9.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-3WSbtl3S.js → skills-page.utils-DYaAddUL.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-C5VxqC_s.js → system-settings-panel-Co7gilRd.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-5B1pswu8.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-Dd89g_ki.js → theme-store-DOdCjyuw.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-CeV8VJh2.js → use-autosave-DnnZtMpA.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-Dr1FKjXv.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-EmJ-8aZu.js → voice-api-key-field-wetUpi3i.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-zsk6E3Mi.js → work-discovery-overlay-tbTWASJJ.js} +1 -1
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-Dy0fDs8w.js +3 -0
- package/dist/gateway/static/root/assets/workflows-page-IVP3GSkI.js +5 -0
- package/dist/gateway/static/root/index.html +12 -12
- package/dist/gateway/static/root/notification-sw.js +1 -1
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/notifications.js +56 -0
- package/dist/packages/gateway-contract/src/turn-outcome.js +114 -0
- package/dist/src/agent/agent-instance-gateway.d.ts +1 -1
- package/dist/src/agent/agent-manager.d.ts +1 -1
- package/dist/src/agent/agent-manager.js +18 -3
- package/dist/src/agent/background-review/prompts.d.ts +8 -2
- package/dist/src/agent/background-review/prompts.js +25 -12
- package/dist/src/agent/background-review/run-background-review.d.ts +7 -2
- package/dist/src/agent/background-review/run-background-review.js +175 -160
- package/dist/src/agent/lifecycle/timeout-wrapper.d.ts +1 -0
- package/dist/src/agent/lifecycle/timeout-wrapper.js +7 -6
- package/dist/src/agent/mcp/mcp-transport-config.d.ts +1 -1
- package/dist/src/agent/mcp/mcp-transport-config.js +1 -1
- package/dist/src/agent/memory/index.d.ts +1 -1
- package/dist/src/agent/memory/index.js +2 -2
- package/dist/src/agent/memory/manager.d.ts +1 -11
- package/dist/src/agent/memory/manager.js +0 -16
- package/dist/src/agent/memory/understanding/service.d.ts +0 -11
- package/dist/src/agent/memory/understanding/service.js +7 -173
- package/dist/src/agent/memory/user-context-coordinator.d.ts +1 -3
- package/dist/src/agent/memory/user-context-coordinator.js +3 -66
- package/dist/src/agent/orchestration/agent-orchestrator.js +1 -1
- package/dist/src/agent/orchestration/run-agent-turn-with-timeout.d.ts +2 -2
- package/dist/src/agent/orchestration/run-agent-turn-with-timeout.js +4 -4
- package/dist/src/agent/service/direct-turn-helpers.js +1 -1
- package/dist/src/agent/tools/create-share-tool.js +14 -1
- package/dist/src/agent/tools/exec-command.js +3 -3
- package/dist/src/agent/tools/execute-code-tool.js +1 -1
- package/dist/src/agent/tools/executor.js +2 -2
- package/dist/src/agent/tools/image-generate-tool.js +12 -0
- package/dist/src/agent/tools/send-media.js +11 -0
- package/dist/src/agent/tools/xopc-use-tool.js +1 -1
- package/dist/src/cli/command-loaders.js +1 -0
- package/dist/src/cli/command-manifest.js +4 -0
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/history.d.ts +1 -0
- package/dist/src/cli/commands/history.js +50 -0
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/config/schema.d.ts +4 -0
- package/dist/src/config/schema.js +1 -0
- package/dist/src/connectors/connected-source-understanding.js +35 -21
- package/dist/src/connectors/learning-coordinator.js +1 -42
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/chat-stream/mapper.d.ts +2 -0
- package/dist/src/gateway/chat-stream/mapper.js +5 -0
- package/dist/src/gateway/chat-stream/protocol.d.ts +3 -2
- package/dist/src/gateway/chat-stream/turn-outcome-collector.d.ts +16 -0
- package/dist/src/gateway/chat-stream/turn-outcome-collector.js +111 -0
- package/dist/src/gateway/hono/lib/static-ui.js +7 -5
- package/dist/src/gateway/hono/routes/index.js +2 -0
- package/dist/src/gateway/hono/routes/mobile.js +18 -40
- package/dist/src/gateway/hono/routes/notifications.d.ts +3 -0
- package/dist/src/gateway/hono/routes/notifications.js +45 -0
- package/dist/src/gateway/hono/routes/sessions.js +31 -0
- package/dist/src/gateway/hono/routes/tasks.js +1 -1
- package/dist/src/gateway/hono/routes/understanding-sources.js +4 -1
- package/dist/src/gateway/hono/routes/you.js +29 -11
- package/dist/src/gateway/service/agent-runner.js +6 -2
- package/dist/src/gateway/service/run-gateway-agent.js +58 -2
- package/dist/src/gateway/service/sessions-api.d.ts +6 -0
- package/dist/src/gateway/service/sessions-api.js +60 -3
- package/dist/src/gateway/service.d.ts +2 -2
- package/dist/src/gateway/service.js +8 -7
- package/dist/src/history/ctx/exporter.d.ts +14 -0
- package/dist/src/history/ctx/exporter.js +99 -0
- package/dist/src/history/ctx/format.d.ts +25 -0
- package/dist/src/history/ctx/format.js +282 -0
- package/dist/src/knowledge/index.d.ts +0 -1
- package/dist/src/knowledge/index.js +1 -2
- package/dist/src/media/session-references.d.ts +6 -0
- package/dist/src/media/session-references.js +24 -3
- package/dist/src/notifications/device-store.d.ts +16 -0
- package/dist/src/notifications/device-store.js +96 -0
- package/dist/src/notifications/planner.d.ts +6 -0
- package/dist/src/notifications/planner.js +160 -0
- package/dist/src/notifications/service.d.ts +18 -0
- package/dist/src/notifications/service.js +184 -0
- package/dist/src/notifications/store.d.ts +53 -0
- package/dist/src/notifications/store.js +184 -0
- package/dist/src/notifications/types.d.ts +29 -0
- package/dist/src/notifications/types.js +14 -0
- package/dist/src/session/client-history.d.ts +3 -1
- package/dist/src/session/client-history.js +13 -0
- package/dist/src/session/index.d.ts +1 -1
- package/dist/src/session/manager.d.ts +1 -0
- package/dist/src/session/manager.js +6 -0
- package/dist/src/session/store.d.ts +15 -0
- package/dist/src/session/store.js +58 -0
- package/dist/src/storage/sqlite/index.d.ts +2 -2
- package/dist/src/storage/sqlite/index.js +3 -3
- package/dist/src/storage/sqlite/migrations/136_product_notifications.sql +79 -0
- package/dist/src/storage/sqlite/migrations/137_understanding_status_audit.sql +71 -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/storage/sqlite/session-input-repository.d.ts +5 -0
- package/dist/src/storage/sqlite/session-input-repository.js +9 -1
- package/dist/src/storage/sqlite/user-context-repository.d.ts +16 -4
- package/dist/src/storage/sqlite/user-context-repository.js +56 -12
- package/dist/src/tasks/index.js +2 -2
- package/dist/src/tasks/task-application-service.js +42 -6
- package/dist/src/tasks/task-change-events.d.ts +9 -0
- package/dist/src/tasks/task-change-events.js +17 -1
- package/dist/src/tasks/task-outbox-dispatcher.js +5 -1
- package/dist/src/tasks/task-run-dispatcher.js +4 -2
- package/dist/src/tasks/task-run-repository.js +13 -0
- package/dist/src/user-context/config.d.ts +8 -0
- package/dist/src/user-context/config.js +3 -0
- package/dist/src/user-context/consolidation.js +16 -4
- package/dist/src/user-context/extraction/executor.d.ts +22 -0
- package/dist/src/user-context/extraction/executor.js +142 -0
- package/dist/src/user-context/extraction/registry.d.ts +1 -1
- package/dist/src/user-context/extraction/registry.js +5 -34
- package/dist/src/user-context/extraction/repair.js +4 -1
- package/dist/src/user-context/extraction/semantic.d.ts +18 -0
- package/dist/src/user-context/extraction/semantic.js +148 -0
- package/dist/src/user-context/understandingQuality.js +4 -0
- package/dist/src/work-discovery/analyzer.js +9 -4
- package/dist/src/work-discovery/service.d.ts +1 -0
- package/dist/src/work-discovery/service.js +5 -4
- package/dist/src/work-discovery/types.d.ts +1 -0
- package/package.json +14 -8
- package/dist/gateway/static/root/assets/agents-TJpjRHnr.js +0 -68
- package/dist/gateway/static/root/assets/apps-page-CZ4Da51l.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-2Y00PvJU.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-CbJD27_j.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-Dv8y6OuP.js +0 -7
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-TZmjzWzt.js +0 -3
- package/dist/gateway/static/root/assets/channels-settings-g-68dutA.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-D7KsAeWh.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-DXA0rAvQ.js +0 -2
- package/dist/gateway/static/root/assets/home-page-i6bXCHdo.js +0 -1
- package/dist/gateway/static/root/assets/index-BBBE89vm.css +0 -2
- package/dist/gateway/static/root/assets/index-BsD5wygl.js +0 -74
- package/dist/gateway/static/root/assets/local-app-workbench-page-BCKEDMlP.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-Cy9YQK7j.js +0 -2
- package/dist/gateway/static/root/assets/markdown-view-CBM-v2ph.js +0 -69
- package/dist/gateway/static/root/assets/mermaid-render-BbqDc_LQ.js +0 -134
- package/dist/gateway/static/root/assets/messages-CtOJwGW3.js +0 -3
- package/dist/gateway/static/root/assets/notes-workbench-B10T3hGX.js +0 -4
- package/dist/gateway/static/root/assets/project-detail-page-DsqRlgsy.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-Bu2PN8OK.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CXACdJ2f.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-CS2knWDT.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-ByFGk0q_.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DweAPjI8.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-DEj-BFMP.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-f7yh7aD5.js +0 -1
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-CBAYvm3G.js +0 -3
- package/dist/gateway/static/root/assets/workflows-page-BN0JmHrG.js +0 -5
- package/dist/src/agent/memory/understanding/correction.d.ts +0 -3
- package/dist/src/agent/memory/understanding/correction.js +0 -39
- package/dist/src/knowledge/connected-understanding-pipeline.d.ts +0 -17
- package/dist/src/knowledge/connected-understanding-pipeline.js +0 -278
- package/dist/src/mobile/notification-service.d.ts +0 -9
- package/dist/src/mobile/notification-service.js +0 -156
- package/dist/src/mobile/notification-store.d.ts +0 -28
- package/dist/src/mobile/notification-store.js +0 -132
- package/dist/src/mobile/notification-types.d.ts +0 -37
- package/dist/src/mobile/notification-types.js +0 -9
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const TurnOutcomeDeliverableKindSchema = z.enum([
|
|
3
|
+
"document",
|
|
4
|
+
"spreadsheet",
|
|
5
|
+
"presentation",
|
|
6
|
+
"pdf",
|
|
7
|
+
"image",
|
|
8
|
+
"video",
|
|
9
|
+
"audio",
|
|
10
|
+
"site",
|
|
11
|
+
"archive",
|
|
12
|
+
"file"
|
|
13
|
+
]);
|
|
14
|
+
const TurnOutcomeArtifactLocationSchema = z.enum([
|
|
15
|
+
"workspace",
|
|
16
|
+
"external_host",
|
|
17
|
+
"worktree",
|
|
18
|
+
"remote_runtime",
|
|
19
|
+
"artifact_store"
|
|
20
|
+
]);
|
|
21
|
+
const TurnOutcomeArtifactAvailabilitySchema = z.enum([
|
|
22
|
+
"materializing",
|
|
23
|
+
"available",
|
|
24
|
+
"expired",
|
|
25
|
+
"missing",
|
|
26
|
+
"failed"
|
|
27
|
+
]);
|
|
28
|
+
const TurnOutcomeArtifactCapabilitySchema = z.enum([
|
|
29
|
+
"preview",
|
|
30
|
+
"download",
|
|
31
|
+
"open",
|
|
32
|
+
"import",
|
|
33
|
+
"share",
|
|
34
|
+
"regenerate"
|
|
35
|
+
]);
|
|
36
|
+
const TurnOutcomeDeliverableSchema = z.object({
|
|
37
|
+
artifactId: z.string().min(1),
|
|
38
|
+
title: z.string().min(1),
|
|
39
|
+
kind: TurnOutcomeDeliverableKindSchema,
|
|
40
|
+
mimeType: z.string().optional(),
|
|
41
|
+
sizeBytes: z.number().nonnegative().optional(),
|
|
42
|
+
availability: TurnOutcomeArtifactAvailabilitySchema,
|
|
43
|
+
location: TurnOutcomeArtifactLocationSchema,
|
|
44
|
+
capabilities: z.array(TurnOutcomeArtifactCapabilitySchema),
|
|
45
|
+
uri: z.string().optional(),
|
|
46
|
+
workspaceRelativePath: z.string().optional(),
|
|
47
|
+
shareUrl: z.string().url().optional(),
|
|
48
|
+
thumbnailUrl: z.string().optional(),
|
|
49
|
+
expiresAt: z.string().optional()
|
|
50
|
+
});
|
|
51
|
+
const TurnOutcomeChangedFileSchema = z.object({
|
|
52
|
+
path: z.string().min(1),
|
|
53
|
+
status: z.enum([
|
|
54
|
+
"added",
|
|
55
|
+
"modified",
|
|
56
|
+
"deleted",
|
|
57
|
+
"renamed"
|
|
58
|
+
]).optional(),
|
|
59
|
+
added: z.number().nonnegative().optional(),
|
|
60
|
+
removed: z.number().nonnegative().optional()
|
|
61
|
+
});
|
|
62
|
+
const TurnOutcomeChangeSetSchema = z.object({
|
|
63
|
+
changeSetId: z.string().min(1),
|
|
64
|
+
files: z.array(TurnOutcomeChangedFileSchema),
|
|
65
|
+
added: z.number().nonnegative(),
|
|
66
|
+
removed: z.number().nonnegative(),
|
|
67
|
+
diff: z.string(),
|
|
68
|
+
diffTruncated: z.boolean().optional(),
|
|
69
|
+
environment: z.enum([
|
|
70
|
+
"workspace",
|
|
71
|
+
"worktree",
|
|
72
|
+
"remote_runtime"
|
|
73
|
+
])
|
|
74
|
+
});
|
|
75
|
+
const TurnOutcomeEvidenceSchema = z.object({
|
|
76
|
+
evidenceId: z.string().min(1),
|
|
77
|
+
kind: z.enum([
|
|
78
|
+
"check",
|
|
79
|
+
"screenshot",
|
|
80
|
+
"video",
|
|
81
|
+
"log"
|
|
82
|
+
]),
|
|
83
|
+
label: z.string().min(1),
|
|
84
|
+
status: z.enum([
|
|
85
|
+
"passed",
|
|
86
|
+
"failed",
|
|
87
|
+
"warning"
|
|
88
|
+
]),
|
|
89
|
+
durationMs: z.number().nonnegative().optional(),
|
|
90
|
+
command: z.string().optional(),
|
|
91
|
+
artifactId: z.string().optional()
|
|
92
|
+
});
|
|
93
|
+
const TurnOutcomeSchema = z.object({
|
|
94
|
+
version: z.literal(1),
|
|
95
|
+
outcomeId: z.string().min(1),
|
|
96
|
+
runId: z.string().min(1),
|
|
97
|
+
turnId: z.string().min(1),
|
|
98
|
+
status: z.enum([
|
|
99
|
+
"succeeded",
|
|
100
|
+
"partial",
|
|
101
|
+
"failed"
|
|
102
|
+
]),
|
|
103
|
+
summary: z.string().optional(),
|
|
104
|
+
deliverables: z.array(TurnOutcomeDeliverableSchema),
|
|
105
|
+
changeSet: TurnOutcomeChangeSetSchema.optional(),
|
|
106
|
+
evidence: z.array(TurnOutcomeEvidenceSchema),
|
|
107
|
+
createdAt: z.string()
|
|
108
|
+
});
|
|
109
|
+
function parseTurnOutcome(value) {
|
|
110
|
+
const parsed = TurnOutcomeSchema.safeParse(value);
|
|
111
|
+
return parsed.success ? parsed.data : null;
|
|
112
|
+
}
|
|
113
|
+
//#endregion
|
|
114
|
+
export { TurnOutcomeDeliverableSchema, parseTurnOutcome };
|
|
@@ -44,7 +44,7 @@ export interface AgentInstanceGateway {
|
|
|
44
44
|
/** Build the bounded, policy-filtered context used for this model turn. */
|
|
45
45
|
prepareUserTurnContext(userMessage: AgentMessage, sessionKey: string, turnId: string): Promise<import('./memory/context/types.js').UserContextPlan>;
|
|
46
46
|
/** Post-turn: sync external memory providers, queue next prefetch. */
|
|
47
|
-
afterAgentTurn(sessionKey: string, userPlainText: string): Promise<import('./memory/understanding/types.js').UnderstandingReviewResult | undefined>;
|
|
47
|
+
afterAgentTurn(sessionKey: string, userPlainText: string, turnId: string): Promise<import('./memory/understanding/types.js').UnderstandingReviewResult | undefined>;
|
|
48
48
|
/** Bump the per-session "turns since memory review" counter. */
|
|
49
49
|
beginBackgroundReviewUserTurn(sessionKey: string): void;
|
|
50
50
|
/** Fire-and-forget review (memory + skill nudges) once the main turn finishes. */
|
|
@@ -206,7 +206,7 @@ export declare class AgentManager implements AgentInstanceGateway {
|
|
|
206
206
|
* After a completed turn: sync external providers and queue next-turn prefetch.
|
|
207
207
|
* Delegates to {@link UserContextCoordinator}.
|
|
208
208
|
*/
|
|
209
|
-
afterAgentTurn(sessionKey: string, userPlainText: string): Promise<import('./memory/understanding/types.js').UnderstandingReviewResult | undefined>;
|
|
209
|
+
afterAgentTurn(sessionKey: string, userPlainText: string, turnId: string): Promise<import('./memory/understanding/types.js').UnderstandingReviewResult | undefined>;
|
|
210
210
|
/**
|
|
211
211
|
* Call once per user turn before the main embedded agent turn.
|
|
212
212
|
* Delegates to {@link BackgroundReviewCoordinator}.
|
|
@@ -8,6 +8,7 @@ import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
|
8
8
|
import { applyConfigOverrides } from "../config/runtime-overrides.js";
|
|
9
9
|
import { expandWorkspacePathString, init_workspace_path } from "../config/workspace-path.js";
|
|
10
10
|
import { init_agent_scope, resolveAgentProfileDir } from "./agent-scope.js";
|
|
11
|
+
import { init_session_key, parseSessionKey } from "../routing/session-key.js";
|
|
11
12
|
import { resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
12
13
|
import { init_paths, resolveBundledSkillsDir } from "../config/paths.js";
|
|
13
14
|
import { init_sync_provider_auth, resolveProviderApiKeySync } from "../auth/sync-provider-auth.js";
|
|
@@ -36,6 +37,7 @@ import { evictAllEmbeddedSessionRunners, evictEmbeddedSessionRunner } from "./em
|
|
|
36
37
|
import { isMemorySubsystemEnabled } from "./memory/memory-config.js";
|
|
37
38
|
import { UserContextCoordinator } from "./memory/user-context-coordinator.js";
|
|
38
39
|
import { WorkspaceRuntimeRegistry } from "./workspace-runtime/registry.js";
|
|
40
|
+
import { runTurnUnderstandingReview } from "./background-review/run-background-review.js";
|
|
39
41
|
import { BackgroundReviewCoordinator } from "./background-review/coordinator.js";
|
|
40
42
|
import { maybeRequestChannelExecApproval } from "../channels/exec-approval-runtime.js";
|
|
41
43
|
import { checkBoundary } from "../agent-runtime/boundary-guard.js";
|
|
@@ -59,6 +61,7 @@ init_sync_provider_auth();
|
|
|
59
61
|
init_providers();
|
|
60
62
|
init_credentials();
|
|
61
63
|
init_paths();
|
|
64
|
+
init_session_key();
|
|
62
65
|
const log = createLogger("AgentManager");
|
|
63
66
|
var AgentManager = class {
|
|
64
67
|
agents = /* @__PURE__ */ new Map();
|
|
@@ -131,7 +134,6 @@ var AgentManager = class {
|
|
|
131
134
|
this.userContext = new UserContextCoordinator({
|
|
132
135
|
getConfig: () => this.config.config,
|
|
133
136
|
isEnabledForSession: (sessionKey) => this.isUserContextEnabledForSession(sessionKey),
|
|
134
|
-
getAgentIdForSession: (sk) => this.agents.get(sk)?.effectiveProfile.agentId ?? "main",
|
|
135
137
|
getWorkspaceIdForSession: (sk) => this.getResolvedWorkspaceForSession(sk),
|
|
136
138
|
getProjectIdForSession: (sk) => getSessionMetadata(sk)?.projectId,
|
|
137
139
|
getMemoryManagerForSession: (sk) => this.getMemoryManagerForSession(sk),
|
|
@@ -299,8 +301,21 @@ var AgentManager = class {
|
|
|
299
301
|
* After a completed turn: sync external providers and queue next-turn prefetch.
|
|
300
302
|
* Delegates to {@link UserContextCoordinator}.
|
|
301
303
|
*/
|
|
302
|
-
afterAgentTurn(sessionKey, userPlainText) {
|
|
303
|
-
|
|
304
|
+
async afterAgentTurn(sessionKey, userPlainText, turnId) {
|
|
305
|
+
await this.userContext.afterTurn(sessionKey, userPlainText);
|
|
306
|
+
if (!this.isUserContextEnabledForSession(sessionKey)) return void 0;
|
|
307
|
+
const parsed = parseSessionKey(sessionKey);
|
|
308
|
+
if (parsed && parsed.peerKind !== "direct") return void 0;
|
|
309
|
+
const instance = this.agents.get(sessionKey);
|
|
310
|
+
if (!instance) return void 0;
|
|
311
|
+
return runTurnUnderstandingReview({
|
|
312
|
+
sessionKey,
|
|
313
|
+
turnId,
|
|
314
|
+
userText: userPlainText,
|
|
315
|
+
mainAgent: instance.agent,
|
|
316
|
+
memoryManager: this.getMemoryManagerForSession(sessionKey),
|
|
317
|
+
getConfig: () => this.mergedConfig()
|
|
318
|
+
});
|
|
304
319
|
}
|
|
305
320
|
/**
|
|
306
321
|
* Call once per user turn before the main embedded agent turn.
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export declare
|
|
1
|
+
export declare const UNDERSTANDING_INTERPRETER_SYSTEM_PROMPT = "You are xopc's user-understanding interpreter. You do not chat with the user and cannot write storage. Distinguish memory commands, memory questions, corrections, forgetting, durable user assertions, and ordinary task requests. Return strict JSON only. Never treat assistant text as evidence of a fact about the user.";
|
|
2
|
+
export declare function buildUnderstandingInterpreterPrompt(options: {
|
|
3
|
+
mode: 'turn' | 'transcript';
|
|
4
|
+
availableTargets?: Array<{
|
|
5
|
+
id: string;
|
|
6
|
+
statement: string;
|
|
7
|
+
}>;
|
|
8
|
+
}): string;
|
|
@@ -1,21 +1,34 @@
|
|
|
1
1
|
import { USER_FACING_UNDERSTANDING_WRITING_GUIDANCE } from "../../user-context/understanding-writing.js";
|
|
2
2
|
//#region src/agent/background-review/prompts.ts
|
|
3
|
-
const
|
|
3
|
+
const UNDERSTANDING_INTERPRETER_SYSTEM_PROMPT = `You are xopc's user-understanding interpreter. You do not chat with the user and cannot write storage. Distinguish memory commands, memory questions, corrections, forgetting, durable user assertions, and ordinary task requests. Return strict JSON only. Never treat assistant text as evidence of a fact about the user.`;
|
|
4
|
+
function buildUnderstandingInterpreterPrompt(options) {
|
|
5
|
+
const targets = options.availableTargets?.length ? `\nOnly these understanding IDs may be targeted for confirm, correction, or forgetting:\n${options.availableTargets.map((item) => `- ${item.id}: ${item.statement}`).join("\n")}` : "\nNo existing understanding IDs are available to target.";
|
|
6
|
+
return `Interpret the evidence-tagged conversation above for ${options.mode === "turn" ? "the latest user turn" : "durable transcript synthesis"}.
|
|
4
7
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
2. Has the user expressed expectations about how you should behave, their work style, emotional-support preferences, boundaries, or how they want you to communicate?
|
|
8
|
-
3. Has the user explicitly corrected a prior assumption? Prefer the correction and do not preserve the contradicted interpretation.
|
|
8
|
+
Return exactly this JSON shape:
|
|
9
|
+
{"intent":"none","candidates":[],"targetUnderstandingIds":[],"abstentionReason":"..."}
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
Allowed intents: memory_create, memory_query, memory_confirm, memory_correct, memory_forget, user_assertion, task_request, none.
|
|
12
|
+
|
|
13
|
+
Candidate shape:
|
|
14
|
+
{"factKey":"communication:concise","statement":"...","kind":"preference","explicitness":"observed","durability":"durable","scopeHint":"global","confidence":0.8,"importance":0.7,"sensitivity":"normal","disclosurePolicy":"referenceable","evidence":[{"ref":"entry-id","quote":"exact quote from that user message"}],"selfContained":true,"unresolvedReferences":[]}
|
|
12
15
|
|
|
13
16
|
Allowed kinds: preference, boundary, relationship, routine, current_state, long_term_goal, project_context, task_lesson, derived_insight.
|
|
14
|
-
Every reviewed message is prefixed with an evidence_ref. Every candidate must list the exact one or more evidence_ref values that support it. Omit a candidate when no exact message supports it. Only include facts supported by the conversation and likely to matter in a future session. A temporary mood or one-off reaction is current context, not durable identity; omit it unless the user describes a recurring pattern that will matter later. Never include passwords, tokens, credentials, or speculative diagnoses. Use {"candidates":[]} when nothing qualifies.
|
|
15
17
|
|
|
16
|
-
|
|
18
|
+
Rules:
|
|
19
|
+
- A question such as “Do you remember this goal?” is memory_query and creates no candidate.
|
|
20
|
+
- A request to create, summarize, update, investigate, or track a goal is task_request, not a user goal.
|
|
21
|
+
- Every candidate needs an exact quote from one or more user messages. Assistant messages may resolve context but never count as evidence.
|
|
22
|
+
- Extract zero to eight independent candidates; do not collapse multiple facts into one.
|
|
23
|
+
- factKey must be a stable language-neutral lowercase identifier using letters, digits, colons, or hyphens. Equivalent facts in different languages must use the same factKey.
|
|
24
|
+
- Set selfContained=false and list unresolvedReferences for unresolved words such as this, that, it, 这个, 那个, or 它.
|
|
25
|
+
- Omit temporary reactions and one-off task instructions.
|
|
26
|
+
- Never include passwords, credentials, regulated identifiers, or speculative diagnoses.
|
|
27
|
+
- For transcript mode, use explicitness=inferred unless the latest user message is itself an explicit memory command or correction.
|
|
28
|
+
- If evidence is insufficient, return candidates=[] and explain abstentionReason.
|
|
17
29
|
|
|
18
|
-
|
|
19
|
-
|
|
30
|
+
${USER_FACING_UNDERSTANDING_WRITING_GUIDANCE}
|
|
31
|
+
${targets}`;
|
|
32
|
+
}
|
|
20
33
|
//#endregion
|
|
21
|
-
export {
|
|
34
|
+
export { UNDERSTANDING_INTERPRETER_SYSTEM_PROMPT, buildUnderstandingInterpreterPrompt };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Agent } from '@earendil-works/pi-agent-core';
|
|
2
2
|
import type { Config } from '../../config/schema.js';
|
|
3
3
|
import type { MemoryManager } from '../memory/manager.js';
|
|
4
|
-
import type {
|
|
4
|
+
import type { UnderstandingReviewResult } from '../memory/understanding/types.js';
|
|
5
5
|
import type { BackgroundReviewSettings } from './settings.js';
|
|
6
6
|
export interface RunBackgroundReviewParams {
|
|
7
7
|
sessionKey: string;
|
|
@@ -10,5 +10,10 @@ export interface RunBackgroundReviewParams {
|
|
|
10
10
|
memoryManager: MemoryManager;
|
|
11
11
|
getConfig: () => Config | undefined;
|
|
12
12
|
}
|
|
13
|
-
export
|
|
13
|
+
export interface RunTurnUnderstandingParams extends Omit<RunBackgroundReviewParams, 'settings'> {
|
|
14
|
+
turnId: string;
|
|
15
|
+
userText: string;
|
|
16
|
+
maxHistoryMessages?: number;
|
|
17
|
+
}
|
|
18
|
+
export declare function runTurnUnderstandingReview(params: RunTurnUnderstandingParams): Promise<UnderstandingReviewResult>;
|
|
14
19
|
export declare function runBackgroundReviewTurn(params: RunBackgroundReviewParams): Promise<void>;
|