@xopcai/xopc 0.0.312 → 0.0.314
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/{auth-C3yV1y_l.js → auth-DKo-NMUY.js} +18 -1
- package/dist/browser-ext/dist/background.js +68 -2
- package/dist/browser-ext/dist/sidepanel.html +1 -1
- package/dist/browser-ext/dist/sidepanel.js +1 -1
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/feishu/src/outbound/media-load.js +1 -1
- package/dist/extensions/telegram/src/inbound-processor.js +1 -1
- package/dist/extensions/telegram/src/plugin.js +2 -2
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BVIJMP8w.js → agent-avatar-dicebear-BFkjfurL.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-BdOZ6q8Z.js +1 -0
- package/dist/gateway/static/root/assets/{agents-D6g_SeWI.js → agents-CCcavsHq.js} +1 -1
- package/dist/gateway/static/root/assets/{api-_aHQA8bd.js → api-BYhRsTAc.js} +1 -1
- package/dist/gateway/static/root/assets/{app-link-CKueEVbT.js → app-link-nL8iPwEr.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-CLg_aXYG.js → app-management-settings-panel-B4kihr-A.js} +1 -1
- package/dist/gateway/static/root/assets/appearance-settings-N9sYmNOx.js +1 -0
- package/dist/gateway/static/root/assets/apps-page-BMcy10_s.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-CHO3heHX.js → archive-plugin-k_SuYWyV.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-BsmsBCI2.js → attachment-load-DRv5QWUK.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-CftigJlf.js → automations-page-CkJV3DN0.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-BEa2doeR.js +7 -0
- package/dist/gateway/static/root/assets/{binary-plugins-CRCLWBo2.js → binary-plugins-Dg3h3TA7.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-D0LDiOTT.js → block-editor-DVhdHntT.js} +29 -29
- package/dist/gateway/static/root/assets/{browser-automation-inputs-C611KRBx.js → browser-automation-inputs-BMRYUW8_.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-Djyv3vy-.js → browser-automations-page-Byv6-FY2.js} +2 -2
- package/dist/gateway/static/root/assets/browser-settings-page-DRCHGFpO.js +3 -0
- package/dist/gateway/static/root/assets/capabilities-D0S3DuAD.js +1 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-mxRP0gl0.js +8 -0
- package/dist/gateway/static/root/assets/channels-settings-DBt_6GsB.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-CIsKqdET.js → chat-terminal-dock-D4AHa51o.js} +2 -2
- package/dist/gateway/static/root/assets/{computer-settings-page-C0YL9J7m.js → computer-settings-page-eXPe500D.js} +1 -1
- package/dist/gateway/static/root/assets/connector-service-page-BQTFlq_k.js +1 -0
- package/dist/gateway/static/root/assets/connectors-page-BKeBWwcI.js +2 -0
- package/dist/gateway/static/root/assets/conversation-identity-Cw0n9uzK.js +1 -0
- package/dist/gateway/static/root/assets/{date-picker-CDsfv8R0.js → date-picker-7MtovynY.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-DvhPj3CZ.js → dependency-picker-Bj_xkXID.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-Cyg8XMpL.js → desktop-pet-CTmba9zH.js} +1 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-DNM_BlWN.js +1 -0
- package/dist/gateway/static/root/assets/device-pairing-wizard-C2XE0QhT.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-D-AVJU3q.js → extension-debug-page-J_olaL7e.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-DrFoQ9xt.js → extension-page-pK5RvqN8.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-DxWjESC1.js → extension-settings-page-BwroEN08.js} +1 -1
- package/dist/gateway/static/root/assets/files-BK6enEvD.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-config-swr-DUDX42qY.js → gateway-config-swr-FuJTIg_a.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-settings-CLLDp23J.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-Cf8OxlvY.js → gateway-startup-retry-CKg_gu8_.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-B5Epb1PH.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-D2YorS--.js → image-generation-api-Bo6NZ7zb.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-BKucJlXI.js → imports-page-C8-hX8gS.js} +1 -1
- package/dist/gateway/static/root/assets/index-14F1yGJI.js +89 -0
- package/dist/gateway/static/root/assets/index-cB7rWIDY.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BxLXD-yU.js → keyboard-shortcuts-settings-BkBEjUZD.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-6jC3vQpY.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-BAsQJQKJ.js → local-apps-page-CrbKIixo.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-DA0Z5jM_.js → locale-store-CvGwNbml.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-DBHlZts9.js +2 -0
- package/dist/gateway/static/root/assets/management-settings-DsUWLu5m.js +1 -0
- package/dist/gateway/static/root/assets/{markdown-view-DYGPxPee.js → markdown-view-nXo5nrsv.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-CQtQzLyg.js → media-plugins-upxXJ-4l.js} +1 -1
- package/dist/gateway/static/root/assets/messages-B_AwRroN.js +3 -0
- package/dist/gateway/static/root/assets/note-detail-panel-0Q9TOtJG.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-D0NmcwNw.js +8 -0
- package/dist/gateway/static/root/assets/page-context-capture-button-DUyA-K4L.js +1 -0
- package/dist/gateway/static/root/assets/{page-tabs-B6DjkyMM.js → page-tabs-Cl-NFPNr.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-Dn57uLhr.js → preview-open-alternatives-DX81PwJ3.js} +1 -1
- package/dist/gateway/static/root/assets/product-delivery-chCjIpvu.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-H2YMk8TY.js → product-open-page-CrfIGwm8.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-BVfVrYmn.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-nM9a9XNS.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-C0DCx3wv.js → registry-api-CHxgohY0.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-C8b_k88G.js +1 -0
- package/dist/gateway/static/root/assets/runtime-tools-settings-panel-D3dLOW04.js +5 -0
- package/dist/gateway/static/root/assets/scenes-page-DEowreZV.js +2 -0
- package/dist/gateway/static/root/assets/{schema-form-CblI9WUA.js → schema-form-ZxuIvD2_.js} +1 -1
- package/dist/gateway/static/root/assets/schemas-88fK3zzl.js +64 -0
- package/dist/gateway/static/root/assets/sessions-page-B_nPhera.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-BqhIOuus.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-BAaVyxJH.js → settings-form-section-TZRfg4yo.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-CKNPbm5q.js → settings-page-a8qcJpdZ.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-DqNCGKxQ.js → settings-page-layout-BfvlRT9q.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-CRj5Ruqn.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-BzMfp_HM.js → share-preview-page-DCt1pTWB.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-BNbXPk--.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-CNMCLbav.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-DIht92q6.js → skills-page-BIOcg44X.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-DLYRiEn3.js → skills-page.utils-CgZdzT4I.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-yYs4YgYk.js → system-settings-panel-_YaRncA6.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-CAcfAG-c.js +1 -0
- package/dist/gateway/static/root/assets/tasks-CDR_RVbQ.js +1 -0
- package/dist/gateway/static/root/assets/{tunnel-api-BasDYxvx.js → tunnel-api-uOupJOoS.js} +1 -1
- package/dist/gateway/static/root/assets/turn-outcome-D0SnyZ3Z.js +1 -0
- package/dist/gateway/static/root/assets/{use-autosave-CWAUHhcb.js → use-autosave-BezzHBLE.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-BFFeneDq.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-Kc4UlxZs.js → voice-api-key-field-BmYifdwL.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-DTyMdGOR.js → voice-config-api-D_5Q2_A3.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-BPC_c9dO.js → work-discovery-overlay-4DmyEckJ.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-DBTciOrq.js → workflow-run-setup-panel-DeZe8bTZ.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-Sv4hEc6W.js +6 -0
- package/dist/gateway/static/root/index.html +16 -16
- package/dist/package.js +1 -1
- package/dist/packages/computer-control-contract/src/index.js +10 -1
- package/dist/packages/gateway-contract/src/app-context.js +55 -0
- package/dist/packages/gateway-contract/src/automations.js +16 -17
- package/dist/packages/gateway-contract/src/capabilities.js +1078 -0
- package/dist/packages/gateway-contract/src/extension-capabilities.js +26 -0
- package/dist/packages/gateway-contract/src/home.js +3 -3
- package/dist/packages/gateway-contract/src/index.js +8 -0
- package/dist/packages/gateway-contract/src/product-delivery.js +19 -4
- package/dist/packages/gateway-contract/src/scenes.js +199 -0
- package/dist/packages/gateway-contract/src/task-runs.js +8 -4
- package/dist/packages/gateway-contract/src/tasks.js +5 -4
- package/dist/packages/realtime-client/src/index.js +17 -4
- package/dist/src/agent/agent-manager.d.ts +1 -0
- package/dist/src/agent/agent-manager.js +1 -0
- package/dist/src/agent/child-agent-factory.d.ts +2 -0
- package/dist/src/agent/child-agent-factory.js +5 -0
- package/dist/src/agent/commands/approved-verification.d.ts +14 -0
- package/dist/src/agent/commands/approved-verification.js +48 -0
- package/dist/src/agent/context/execution-scope.js +2 -1
- package/dist/src/agent/context/project-context.js +2 -1
- package/dist/src/agent/external-tools/cliProvider.js +123 -75
- package/dist/src/agent/external-tools/composio-provider.d.ts +1 -1
- package/dist/src/agent/external-tools/composio-provider.js +70 -12
- package/dist/src/agent/external-tools/endpoint-provider.js +14 -1
- package/dist/src/agent/inbound/turn-dispatcher.d.ts +2 -0
- package/dist/src/agent/inbound/turn-dispatcher.js +2 -1
- package/dist/src/agent/memory/compaction-chunks.d.ts +6 -1
- package/dist/src/agent/memory/compaction-chunks.js +16 -3
- package/dist/src/agent/memory/compaction-ledger.d.ts +3 -1
- package/dist/src/agent/memory/compaction-ledger.js +31 -18
- package/dist/src/agent/memory/compaction-request.d.ts +2 -0
- package/dist/src/agent/memory/compaction-request.js +6 -1
- package/dist/src/agent/memory/compaction.d.ts +19 -1
- package/dist/src/agent/memory/compaction.js +112 -30
- package/dist/src/agent/service/process-direct-streaming.d.ts +3 -0
- package/dist/src/agent/service/process-direct-streaming.js +19 -10
- package/dist/src/agent/service.js +1 -0
- package/dist/src/agent/service.types.d.ts +1 -0
- package/dist/src/agent/skills/config.js +2 -0
- package/dist/src/agent/skills/format-skills-prompt.js +14 -1
- package/dist/src/agent/skills/index.js +16 -8
- package/dist/src/agent/skills/types.d.ts +1 -1
- package/dist/src/agent/source-context/app-context.d.ts +4 -0
- package/dist/src/agent/source-context/app-context.js +36 -0
- package/dist/src/agent/source-context/injector.js +1 -0
- package/dist/src/agent/source-context/types.d.ts +5 -1
- package/dist/src/agent/tasks/task-judge-service.js +2 -1
- package/dist/src/agent/tool-manuals/computer.d.ts +1 -1
- package/dist/src/agent/tool-manuals/computer.js +1 -1
- package/dist/src/agent/tools/automation-tool.d.ts +12 -1
- package/dist/src/agent/tools/automation-tool.js +106 -32
- package/dist/src/agent/tools/factory.d.ts +1 -0
- package/dist/src/agent/tools/factory.js +6 -1
- package/dist/src/agent/tools/scoped-workspace-tools.d.ts +8 -0
- package/dist/src/agent/tools/scoped-workspace-tools.js +81 -0
- package/dist/src/agent/tools/xopc-use-tool.d.ts +6 -3
- package/dist/src/agent/tools/xopc-use-tool.js +997 -908
- package/dist/src/agent/workflow/subagent-runner.js +1 -0
- package/dist/src/agent-config/index.js +2 -2
- package/dist/src/agent-config/schema.d.ts +5 -0
- package/dist/src/agent-config/schema.js +14 -10
- package/dist/src/automations/api/routes.js +244 -164
- package/dist/src/automations/capabilities/drafts.d.ts +4 -0
- package/dist/src/automations/capabilities/drafts.js +95 -0
- package/dist/src/automations/capabilities/read.d.ts +4 -0
- package/dist/src/automations/capabilities/read.js +119 -0
- package/dist/src/automations/capabilities/write.d.ts +349 -0
- package/dist/src/automations/capabilities/write.js +172 -0
- package/dist/src/automations/domain/index.js +2 -2
- package/dist/src/automations/domain/validation.d.ts +77 -77
- package/dist/src/automations/domain/validation.js +9 -6
- package/dist/src/automations/draft/automation-draft-validator.d.ts +2 -2
- package/dist/src/automations/index.js +6 -6
- package/dist/src/automations/service/automation-service.d.ts +31 -0
- package/dist/src/automations/service/automation-service.js +213 -75
- package/dist/src/automations/service/index.js +2 -2
- package/dist/src/automations/storage/automation-repository.d.ts +2 -0
- package/dist/src/automations/storage/automation-repository.js +9 -1
- package/dist/src/automations/storage/automation-run-repository.d.ts +4 -1
- package/dist/src/automations/storage/automation-run-repository.js +16 -3
- package/dist/src/automations/storage/index.js +3 -3
- package/dist/src/browser/automations/schema.d.ts +1 -1
- package/dist/src/browser/automations/service.d.ts +1 -1
- package/dist/src/browser/observation/format.js +4 -0
- package/dist/src/capabilities/adapters/http.d.ts +4 -0
- package/dist/src/capabilities/adapters/http.js +44 -0
- package/dist/src/capabilities/readiness/from-config.js +11 -7
- package/dist/src/capabilities/runtime/app-context.d.ts +3 -0
- package/dist/src/capabilities/runtime/app-context.js +72 -0
- package/dist/src/capabilities/runtime/atomic-operations.d.ts +11 -0
- package/dist/src/capabilities/runtime/atomic-operations.js +34 -0
- package/dist/src/capabilities/runtime/dispatcher.d.ts +67 -0
- package/dist/src/capabilities/runtime/dispatcher.js +170 -0
- package/dist/src/capabilities/runtime/errors.d.ts +6 -0
- package/dist/src/capabilities/runtime/errors.js +11 -0
- package/dist/src/capabilities/runtime/external-operations.d.ts +16 -0
- package/dist/src/capabilities/runtime/external-operations.js +92 -0
- package/dist/src/capabilities/runtime/product.d.ts +12 -0
- package/dist/src/capabilities/runtime/product.js +69 -0
- package/dist/src/capabilities/runtime/settings.d.ts +3 -0
- package/dist/src/capabilities/runtime/settings.js +27 -0
- package/dist/src/channels/index.js +2 -2
- package/dist/src/channels/manager.js +1 -1
- package/dist/src/cli/cli-log-level-preset.d.ts +2 -0
- package/dist/src/cli/cli-log-level-preset.js +4 -0
- package/dist/src/cli/command-catalog.js +4 -0
- package/dist/src/cli/command-loaders.js +1 -0
- package/dist/src/cli/command-manifest.js +4 -0
- package/dist/src/cli/commands/channels.js +1 -1
- package/dist/src/cli/commands/connectors.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/extension-marketplace.js +1 -1
- package/dist/src/cli/commands/mcp.d.ts +1 -0
- package/dist/src/cli/commands/mcp.js +51 -0
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard.js +1 -1
- package/dist/src/cli/commands/project.js +1 -1
- package/dist/src/computer/broker.d.ts +0 -1
- package/dist/src/computer/broker.js +4 -6
- package/dist/src/computer/evaluation-harness.d.ts +45 -0
- package/dist/src/computer/evaluation-harness.js +108 -0
- package/dist/src/computer/model-adapter.d.ts +37 -2
- package/dist/src/computer/model-adapter.js +333 -42
- package/dist/src/computer/model-policy.d.ts +4 -1
- package/dist/src/computer/model-policy.js +11 -3
- package/dist/src/computer/release-gate.d.ts +22 -0
- package/dist/src/computer/release-gate.js +19 -0
- package/dist/src/computer/runtime.js +14 -10
- package/dist/src/computer/task-state.d.ts +1 -0
- package/dist/src/computer/task-state.js +1 -0
- package/dist/src/config/models-json.d.ts +14 -8
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/config/schema.d.ts +4 -0
- package/dist/src/config/schema.js +3 -9
- package/dist/src/connectors/composio-sessions.d.ts +4 -2
- package/dist/src/connectors/composio-sessions.js +10 -9
- package/dist/src/connectors/composio.js +10 -8
- package/dist/src/discussions/action-tasks.js +2 -1
- package/dist/src/discussions/recording.js +1 -1
- package/dist/src/execution-environments/local-worktree-manager.d.ts +1 -0
- package/dist/src/execution-environments/local-worktree-manager.js +13 -2
- package/dist/src/extensions/activation-context.js +3 -3
- package/dist/src/extensions/api.js +1 -1
- package/dist/src/extensions/normalize-manifest.js +6 -1
- package/dist/src/extensions/sdk/index.js +1 -1
- package/dist/src/extensions/sdk/media.js +1 -1
- package/dist/src/extensions/types/manifest.d.ts +3 -0
- package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
- package/dist/src/gateway/hono/lib/config-payload.d.ts +1 -0
- package/dist/src/gateway/hono/middleware/scopes.js +1 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +5 -2
- package/dist/src/gateway/hono/routes/capability-operations.d.ts +3 -0
- package/dist/src/gateway/hono/routes/capability-operations.js +52 -0
- package/dist/src/gateway/hono/routes/lazy-bundles.js +16 -0
- package/dist/src/gateway/hono/routes/local-app-capabilities.d.ts +4 -0
- package/dist/src/gateway/hono/routes/local-app-capabilities.js +41 -0
- package/dist/src/gateway/hono/routes/local-apps.js +41 -9
- package/dist/src/gateway/hono/routes/models.js +2 -2
- package/dist/src/gateway/hono/routes/notes.js +215 -146
- package/dist/src/gateway/hono/routes/projects.js +217 -374
- package/dist/src/gateway/hono/routes/scenes.js +188 -75
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +60 -16
- package/dist/src/gateway/hono/routes/session-input-handler.js +43 -1
- package/dist/src/gateway/hono/routes/sessions.js +17 -0
- package/dist/src/gateway/hono/routes/status.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +182 -326
- package/dist/src/gateway/hono/routes/user-model-refresh.js +1 -1
- package/dist/src/gateway/hono/routes/voice.js +4 -4
- package/dist/src/gateway/hono/routes/workflows.js +1 -1
- package/dist/src/gateway/media-access.js +2 -1
- package/dist/src/gateway/mobile-privacy.js +2 -2
- package/dist/src/gateway/scenes/host.js +14 -3
- package/dist/src/gateway/scenes/mailContext.js +1 -1
- package/dist/src/gateway/scenes/slackThreadSource.d.ts +41 -0
- package/dist/src/gateway/scenes/slackThreadSource.js +168 -0
- package/dist/src/gateway/security/gateway-scopes.d.ts +1 -1
- package/dist/src/gateway/security/gateway-scopes.js +5 -0
- package/dist/src/gateway/service/app-context-access.d.ts +11 -0
- package/dist/src/gateway/service/app-context-access.js +70 -0
- package/dist/src/gateway/service/run-gateway-agent.js +11 -2
- package/dist/src/gateway/service/session-input-coordinator.js +54 -15
- package/dist/src/gateway/service/sessions-api.d.ts +1 -0
- package/dist/src/gateway/service/sessions-api.js +3 -0
- package/dist/src/gateway/service/task-conversation-query-service.d.ts +3 -1
- package/dist/src/gateway/service/task-conversation-query-service.js +32 -3
- package/dist/src/gateway/service.d.ts +3 -0
- package/dist/src/gateway/service.js +69 -15
- package/dist/src/gateway/session-context-summary.js +2 -1
- package/dist/src/{tasks/task-outbox-dispatcher.d.ts → infra/domain-outbox-dispatcher.d.ts} +2 -2
- package/dist/src/{tasks/task-outbox-dispatcher.js → infra/domain-outbox-dispatcher.js} +10 -9
- package/dist/src/infra/operation-context.d.ts +2 -0
- package/dist/src/infra/operation-context.js +16 -0
- package/dist/src/local-apps/capabilities/contracts.d.ts +2 -0
- package/dist/src/local-apps/capabilities/contracts.js +32 -0
- package/dist/src/local-apps/capabilities/read.d.ts +3 -0
- package/dist/src/local-apps/capabilities/read.js +48 -0
- package/dist/src/local-apps/capabilities/runtime.d.ts +16 -0
- package/dist/src/local-apps/capabilities/runtime.js +66 -0
- package/dist/src/local-apps/capabilities/write.d.ts +3 -0
- package/dist/src/local-apps/capabilities/write.js +35 -0
- package/dist/src/local-apps/release-lock.d.ts +2 -0
- package/dist/src/local-apps/release-lock.js +20 -0
- package/dist/src/local-apps/runtime-entry.d.ts +0 -2
- package/dist/src/local-apps/runtime-entry.js +1 -14
- package/dist/src/local-apps/scaffold.js +4 -1
- package/dist/src/local-apps/service.d.ts +24 -1
- package/dist/src/local-apps/service.js +186 -43
- package/dist/src/local-apps/store.js +0 -2
- package/dist/src/mcp/capability-server.d.ts +4 -0
- package/dist/src/mcp/capability-server.js +96 -0
- package/dist/src/mcp/channel-bridge.js +1 -1
- package/dist/src/mcp/gateway-http-client.d.ts +7 -0
- package/dist/src/mcp/gateway-http-client.js +27 -5
- package/dist/src/media-understanding/openai-compatible-audio.js +1 -1
- package/dist/src/notes/agent-context.js +1 -1
- package/dist/src/notes/capabilities/read.d.ts +3 -0
- package/dist/src/notes/capabilities/read.js +96 -0
- package/dist/src/notes/capabilities/write.d.ts +7 -0
- package/dist/src/notes/capabilities/write.js +152 -0
- package/dist/src/notes/index.js +1 -1
- package/dist/src/notes/service.d.ts +12 -4
- package/dist/src/notes/service.js +188 -175
- package/dist/src/notes/store.d.ts +14 -9
- package/dist/src/notes/store.js +81 -21
- package/dist/src/notifications/service.d.ts +1 -0
- package/dist/src/notifications/service.js +5 -0
- package/dist/src/platform/client.d.ts +1 -1
- package/dist/src/platform/contracts.d.ts +1 -1
- package/dist/src/projects/capabilities/read.d.ts +3 -0
- package/dist/src/projects/capabilities/read.js +81 -0
- package/dist/src/projects/capabilities/write.d.ts +9 -0
- package/dist/src/projects/capabilities/write.js +260 -0
- package/dist/src/projects/index.js +2 -2
- package/dist/src/projects/project-change-events.d.ts +2 -0
- package/dist/src/projects/project-change-events.js +18 -0
- package/dist/src/projects/project-service.d.ts +11 -0
- package/dist/src/projects/project-service.js +121 -42
- package/dist/src/projects/project-store.js +12 -2
- package/dist/src/projects/project-workspace-creation.d.ts +3 -0
- package/dist/src/projects/project-workspace-creation.js +45 -0
- package/dist/src/projects/workspace-project.js +6 -0
- package/dist/src/providers/model-catalog-types.d.ts +2 -1
- package/dist/src/providers/model-reference-auditor.js +4 -4
- package/dist/src/providers/model-supplements.js +13 -3
- package/dist/src/providers/presentation.js +3 -3
- package/dist/src/providers/xopc-cloud-model-source.js +4 -2
- package/dist/src/realtime/runtime.js +4 -0
- package/dist/src/scenes/capabilities/read.d.ts +3 -0
- package/dist/src/scenes/capabilities/read.js +187 -0
- package/dist/src/scenes/capabilities/write.d.ts +3 -0
- package/dist/src/scenes/capabilities/write.js +151 -0
- package/dist/src/scenes/contracts.d.ts +2 -105
- package/dist/src/scenes/contracts.js +3 -88
- package/dist/src/scenes/execution.d.ts +1 -1
- package/dist/src/scenes/httpServices.d.ts +2 -0
- package/dist/src/scenes/inbox.d.ts +1 -0
- package/dist/src/scenes/inbox.js +7 -7
- package/dist/src/scenes/preferences.d.ts +3 -24
- package/dist/src/scenes/preferences.js +8 -30
- package/dist/src/scenes/repository.d.ts +1 -0
- package/dist/src/scenes/repository.js +7 -3
- package/dist/src/scenes/resultNotifications.js +2 -2
- package/dist/src/scenes/schedule.d.ts +1 -8
- package/dist/src/scenes/schedule.js +3 -15
- package/dist/src/scenes/service.d.ts +6 -0
- package/dist/src/scenes/service.js +29 -25
- package/dist/src/scenes/taskFollowUp/agentExecutor.d.ts +36 -0
- package/dist/src/scenes/taskFollowUp/agentExecutor.js +149 -0
- package/dist/src/scenes/taskFollowUp/branchInventory.d.ts +38 -0
- package/dist/src/scenes/taskFollowUp/branchInventory.js +70 -0
- package/dist/src/scenes/taskFollowUp/contracts.d.ts +91 -0
- package/dist/src/scenes/taskFollowUp/contracts.js +100 -0
- package/dist/src/scenes/taskFollowUp/resources.d.ts +19 -0
- package/dist/src/scenes/taskFollowUp/resources.js +97 -0
- package/dist/src/scenes/taskFollowUp/service.d.ts +810 -0
- package/dist/src/scenes/taskFollowUp/service.js +710 -0
- package/dist/src/scenes/taskFollowUp/workspaceFingerprint.d.ts +2 -0
- package/dist/src/scenes/taskFollowUp/workspaceFingerprint.js +46 -0
- package/dist/src/scenes/templates.d.ts +2 -2
- package/dist/src/scenes/templates.js +1 -1
- package/dist/src/session/session-find.d.ts +17 -0
- package/dist/src/session/session-find.js +56 -0
- package/dist/src/session/store.d.ts +4 -0
- package/dist/src/session/store.js +43 -7
- package/dist/src/share/note-share-revocation.d.ts +3 -0
- package/dist/src/share/note-share-revocation.js +26 -0
- package/dist/src/storage/sqlite/migrations/190_scene_development.sql +37 -0
- package/dist/src/storage/sqlite/migrations/191_scene_task_follow_up.sql +27 -0
- package/dist/src/storage/sqlite/migrations/192_capability_operations.sql +20 -0
- package/dist/src/storage/sqlite/migrations/193_note_file_cleanup.sql +8 -0
- package/dist/src/storage/sqlite/migrations/194_capability_external_outcomes.sql +11 -0
- package/dist/src/storage/sqlite/migrations/195_automation_deleted_revisions.sql +4 -0
- package/dist/src/storage/sqlite/migrations/196_automation_run_requests.sql +23 -0
- package/dist/src/storage/sqlite/migrations/197_note_deletion_cleanup.sql +8 -0
- package/dist/src/storage/sqlite/migrations/198_project_workspace_creation.sql +7 -0
- package/dist/src/storage/sqlite/migrations/199_scene_resource_events.sql +488 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +6 -3
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/transaction.d.ts +5 -0
- package/dist/src/storage/sqlite/transaction.js +34 -3
- package/dist/src/tasks/capabilities/management.d.ts +195 -0
- package/dist/src/tasks/capabilities/management.js +111 -0
- package/dist/src/tasks/capabilities/read.d.ts +2 -0
- package/dist/src/tasks/capabilities/read.js +141 -0
- package/dist/src/tasks/capabilities/relations.d.ts +204 -0
- package/dist/src/tasks/capabilities/relations.js +140 -0
- package/dist/src/tasks/capabilities/runs.d.ts +2 -0
- package/dist/src/tasks/capabilities/runs.js +89 -0
- package/dist/src/tasks/capabilities/write.d.ts +207 -0
- package/dist/src/tasks/capabilities/write.js +107 -0
- package/dist/src/tasks/home-query-service.js +3 -2
- package/dist/src/tasks/index.d.ts +0 -1
- package/dist/src/tasks/index.js +9 -9
- package/dist/src/tasks/project-operating-view-service.js +2 -1
- package/dist/src/tasks/task-application-service.d.ts +1 -0
- package/dist/src/tasks/task-application-service.js +3 -2
- package/dist/src/tasks/task-change-events.js +5 -3
- package/dist/src/tasks/task-context-assembler.js +2 -1
- package/dist/src/tasks/task-deletion-service.js +2 -1
- package/dist/src/tasks/task-dependency-service.js +2 -1
- package/dist/src/tasks/task-handoff-service.js +2 -1
- package/dist/src/tasks/task-read-model-projector.js +2 -1
- package/dist/src/tasks/task-repository.d.ts +12 -7
- package/dist/src/tasks/task-repository.js +175 -154
- package/dist/src/tasks/task-run-coordinator.js +2 -1
- package/dist/src/tasks/task-run-dispatcher.js +2 -1
- package/dist/src/tasks/task-run-repository.d.ts +1 -0
- package/dist/src/tasks/task-run-repository.js +29 -14
- package/dist/src/tasks/task-signal-service.js +2 -1
- package/dist/src/tui/backends/embedded-backend.js +1 -1
- package/dist/src/tui/backends/gateway-realtime-backend.js +1 -1
- package/dist/src/tui/tui-commands.js +1 -1
- package/dist/src/user-context/config.d.ts +13 -0
- package/dist/src/user-context/config.js +2 -0
- package/dist/src/voice/platform-catalog.d.ts +1 -1
- package/dist/src/voice/realtime/runtime.js +3 -3
- package/dist/src/voice/stt/providers/alibaba-transcription.js +1 -1
- package/dist/src/voice/stt/providers/xopc-cloud-transcription.js +1 -1
- package/dist/src/voice/tts/providers/xopc-cloud-speech.js +1 -1
- package/dist/src/work-discovery/incremental-repository.js +1 -1
- package/dist/src/work-discovery/index.js +1 -1
- package/dist/src/work-discovery/repository.d.ts +1 -1
- package/dist/src/work-discovery/repository.js +3 -2
- package/dist/src/work-discovery/service.d.ts +4 -0
- package/dist/src/work-discovery/service.js +36 -11
- package/dist/src/workflows/context/workflow-context.js +3 -2
- package/dist/src/workflows/service/workflow-run-service.js +2 -1
- package/package.json +6 -2
- package/skills/THIRD_PARTY_NOTICES.md +2 -2
- package/skills/documents/xlsx/SKILL.md +5 -0
- package/skills/engineering/build-xopc-local-app/SKILL.md +2 -0
- package/skills/tools/find-skills/SKILL.md +3 -0
- package/dist/gateway/static/root/assets/activity-store-DVUTs1fk.js +0 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-K3hTmu9d.js +0 -1
- package/dist/gateway/static/root/assets/appearance-settings-CU52MfIT.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-ZpA1-6ad.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-IEAxKRME.js +0 -7
- package/dist/gateway/static/root/assets/browser-settings-page-CU4VWsmX.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-settings-panel-C9XQk3HL.js +0 -8
- package/dist/gateway/static/root/assets/channels-settings-Bqlhjooi.js +0 -1
- package/dist/gateway/static/root/assets/connector-service-page-BmH17JnO.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-zkx8Q-e6.js +0 -2
- package/dist/gateway/static/root/assets/desktop-pet-settings-CE4GOlMM.js +0 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-CdKJqnnw.js +0 -1
- package/dist/gateway/static/root/assets/files-Be5viEFY.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-CGOW0-b4.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-D4um_sV7.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-CgXp2zq4.js +0 -1
- package/dist/gateway/static/root/assets/home-page-D6Idk732.js +0 -1
- package/dist/gateway/static/root/assets/index-1wIKA-kM.css +0 -1
- package/dist/gateway/static/root/assets/index-PFQHPGgi.js +0 -79
- package/dist/gateway/static/root/assets/local-app-workbench-page-BmAqTRb4.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-ZjVYXXyM.js +0 -2
- package/dist/gateway/static/root/assets/management-settings-CSTkYVOZ.js +0 -1
- package/dist/gateway/static/root/assets/messages-4BtQKYlM.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-DuXCt-MM.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-BjOgBVq5.js +0 -8
- package/dist/gateway/static/root/assets/product-delivery-CrAI8ZEa.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-0zi4-i9X.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-B18OxmJj.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-z-DxbuaE.js +0 -1
- package/dist/gateway/static/root/assets/runtime-tools-settings-panel-DGsBTbo6.js +0 -5
- package/dist/gateway/static/root/assets/scenes-page-Bgba03B_.js +0 -1
- package/dist/gateway/static/root/assets/schemas-BaskVM5g.js +0 -64
- package/dist/gateway/static/root/assets/sessions-page-B1t3bMsm.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CBX0Ezhf.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-Bw71C2X3.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-BoVDQolc.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DtTptpAt.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-vgkiGo-D.js +0 -1
- package/dist/gateway/static/root/assets/theme-store-CegIlB8d.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-CAGafNfP.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-CSxHVs1p.js +0 -6
- package/skills/creative/algorithmic-art/SKILL.md +0 -44
- package/skills/creative/algorithmic-art/templates/generator-template.js +0 -27
- package/skills/creative/algorithmic-art/templates/viewer.html +0 -27
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { runGit } from "../../execution-environments/git.js";
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import { createHash } from "node:crypto";
|
|
4
|
+
import { lstat, readFile, readlink } from "node:fs/promises";
|
|
5
|
+
//#region src/scenes/taskFollowUp/workspaceFingerprint.ts
|
|
6
|
+
/** Bind verification to tracked and non-ignored files without executing repository code. */
|
|
7
|
+
async function workspaceFingerprint(workspace) {
|
|
8
|
+
const hash = createHash("sha256");
|
|
9
|
+
hash.update(await runGit(workspace, ["rev-parse", "HEAD"]));
|
|
10
|
+
hash.update(await runGit(workspace, [
|
|
11
|
+
"symbolic-ref",
|
|
12
|
+
"--quiet",
|
|
13
|
+
"HEAD"
|
|
14
|
+
]));
|
|
15
|
+
const paths = [...new Set((await runGit(workspace, [
|
|
16
|
+
"ls-files",
|
|
17
|
+
"-z",
|
|
18
|
+
"--cached",
|
|
19
|
+
"--others",
|
|
20
|
+
"--exclude-standard"
|
|
21
|
+
])).split("\0").filter(Boolean))].sort();
|
|
22
|
+
if (paths.length > 2e4) throw new Error("Workspace verification file budget exceeded");
|
|
23
|
+
let bytes = 0;
|
|
24
|
+
for (const path of paths) {
|
|
25
|
+
const file = resolve(workspace, path);
|
|
26
|
+
hash.update(JSON.stringify(path));
|
|
27
|
+
const stat = await lstat(file).catch((error) => {
|
|
28
|
+
if (error.code === "ENOENT") return void 0;
|
|
29
|
+
throw error;
|
|
30
|
+
});
|
|
31
|
+
if (!stat) {
|
|
32
|
+
hash.update("deleted");
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
hash.update(String(stat.mode));
|
|
36
|
+
if (stat.isSymbolicLink()) hash.update(await readlink(file));
|
|
37
|
+
else if (stat.isFile()) {
|
|
38
|
+
bytes += stat.size;
|
|
39
|
+
if (bytes > 256 * 1024 * 1024) throw new Error("Workspace verification size budget exceeded");
|
|
40
|
+
hash.update(await readFile(file));
|
|
41
|
+
} else throw new Error("Submodules and special files require a separate verification workspace");
|
|
42
|
+
}
|
|
43
|
+
return hash.digest("hex");
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { workspaceFingerprint };
|
|
@@ -27,7 +27,7 @@ export declare const mailFollowUpTemplate: {
|
|
|
27
27
|
maxOutputTokens: number;
|
|
28
28
|
};
|
|
29
29
|
};
|
|
30
|
-
allowedOutcomeKinds: ("artifact" | "receipt" | "decision" | "
|
|
30
|
+
allowedOutcomeKinds: ("artifact" | "receipt" | "decision" | "no_change" | "observation" | "state_change" | "effect_proposal")[];
|
|
31
31
|
allowedEffectHandlers: string[];
|
|
32
32
|
};
|
|
33
33
|
export declare const familyPlanTemplate: {
|
|
@@ -59,6 +59,6 @@ export declare const familyPlanTemplate: {
|
|
|
59
59
|
maxOutputTokens: number;
|
|
60
60
|
};
|
|
61
61
|
};
|
|
62
|
-
allowedOutcomeKinds: ("artifact" | "receipt" | "decision" | "
|
|
62
|
+
allowedOutcomeKinds: ("artifact" | "receipt" | "decision" | "no_change" | "observation" | "state_change" | "effect_proposal")[];
|
|
63
63
|
allowedEffectHandlers: string[];
|
|
64
64
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type FindableMessage = {
|
|
2
|
+
role: string;
|
|
3
|
+
content: string | unknown[];
|
|
4
|
+
displayIndex?: number;
|
|
5
|
+
};
|
|
6
|
+
export type SessionFindMatch = {
|
|
7
|
+
displayIndex: number;
|
|
8
|
+
occurrence: number;
|
|
9
|
+
};
|
|
10
|
+
export type SessionFindResult = {
|
|
11
|
+
query: string;
|
|
12
|
+
total: number;
|
|
13
|
+
truncated: boolean;
|
|
14
|
+
matches: SessionFindMatch[];
|
|
15
|
+
};
|
|
16
|
+
export declare function findSessionMessages(messages: readonly FindableMessage[], rawQuery: string, limit?: number): SessionFindResult;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { markdownToIR } from "../markdown/ir.js";
|
|
2
|
+
//#region src/session/session-find.ts
|
|
3
|
+
function searchableMessageText(message) {
|
|
4
|
+
if (message.role !== "user" && message.role !== "assistant") return "";
|
|
5
|
+
if (typeof message.content === "string") return markdownToIR(message.content, { tableMode: "bullets" }).text;
|
|
6
|
+
return message.content.flatMap((block) => {
|
|
7
|
+
if (!block || typeof block !== "object") return [];
|
|
8
|
+
const value = block;
|
|
9
|
+
return value.type === "text" && value.presentation !== "pending" && value.presentation !== "narration" && typeof value.text === "string" ? [markdownToIR(value.text, { tableMode: "bullets" }).text] : [];
|
|
10
|
+
}).join("\n");
|
|
11
|
+
}
|
|
12
|
+
function countLiteralMatches(text, query) {
|
|
13
|
+
const haystack = text.toLowerCase();
|
|
14
|
+
const needle = query.toLowerCase();
|
|
15
|
+
let count = 0;
|
|
16
|
+
let from = 0;
|
|
17
|
+
while (from <= haystack.length - needle.length) {
|
|
18
|
+
const index = haystack.indexOf(needle, from);
|
|
19
|
+
if (index < 0) break;
|
|
20
|
+
count += 1;
|
|
21
|
+
from = index + needle.length;
|
|
22
|
+
}
|
|
23
|
+
return count;
|
|
24
|
+
}
|
|
25
|
+
function findSessionMessages(messages, rawQuery, limit = 1e3) {
|
|
26
|
+
const query = rawQuery.trim();
|
|
27
|
+
const cappedLimit = Math.min(1e3, Math.max(1, Math.trunc(limit)));
|
|
28
|
+
if (!query) return {
|
|
29
|
+
query,
|
|
30
|
+
total: 0,
|
|
31
|
+
truncated: false,
|
|
32
|
+
matches: []
|
|
33
|
+
};
|
|
34
|
+
const matches = [];
|
|
35
|
+
const occurrencesByDisplayIndex = /* @__PURE__ */ new Map();
|
|
36
|
+
let total = 0;
|
|
37
|
+
messages.forEach((message, messageIndex) => {
|
|
38
|
+
const displayIndex = Number.isInteger(message.displayIndex) && message.displayIndex >= 0 ? message.displayIndex : messageIndex;
|
|
39
|
+
const count = countLiteralMatches(searchableMessageText(message), query);
|
|
40
|
+
const occurrenceOffset = occurrencesByDisplayIndex.get(displayIndex) ?? 0;
|
|
41
|
+
total += count;
|
|
42
|
+
for (let occurrence = 0; occurrence < count && matches.length < cappedLimit; occurrence += 1) matches.push({
|
|
43
|
+
displayIndex,
|
|
44
|
+
occurrence: occurrenceOffset + occurrence
|
|
45
|
+
});
|
|
46
|
+
occurrencesByDisplayIndex.set(displayIndex, occurrenceOffset + count);
|
|
47
|
+
});
|
|
48
|
+
return {
|
|
49
|
+
query,
|
|
50
|
+
total,
|
|
51
|
+
truncated: total > matches.length,
|
|
52
|
+
matches
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
export { findSessionMessages };
|
|
@@ -10,6 +10,7 @@ import type { SessionMetadata, SessionDetail, SessionListQuery, PaginatedResult,
|
|
|
10
10
|
import { SessionStatus } from './types.js';
|
|
11
11
|
import type { Message } from './types.js';
|
|
12
12
|
import type { SessionTranscriptUpdate } from './transcript-events.js';
|
|
13
|
+
import { type SessionFindResult } from './session-find.js';
|
|
13
14
|
export interface SessionStoreOptions {
|
|
14
15
|
config: Config;
|
|
15
16
|
}
|
|
@@ -43,6 +44,8 @@ export declare class SessionStore {
|
|
|
43
44
|
private compactor;
|
|
44
45
|
private compactionHooks;
|
|
45
46
|
private readonly compactionTails;
|
|
47
|
+
private compactionCheckpoint;
|
|
48
|
+
private clearCompactionCheckpoint;
|
|
46
49
|
constructor(options: SessionStoreOptions, windowConfig?: Partial<WindowConfig>, compactionConfig?: Partial<CompactionConfig>);
|
|
47
50
|
/** Refresh policy for subsequent compactions without changing an in-flight request. */
|
|
48
51
|
updateConfig(config: Config): void;
|
|
@@ -176,6 +179,7 @@ export declare class SessionStore {
|
|
|
176
179
|
}): Promise<AgentMessage[]>;
|
|
177
180
|
estimateTokenUsage(_key: string, messages: AgentMessage[]): Promise<number>;
|
|
178
181
|
searchInSession(key: string, keyword: string): Promise<Message[]>;
|
|
182
|
+
findInSession(key: string, query: string, limit?: number): Promise<SessionFindResult | null>;
|
|
179
183
|
recallSession(key: string, query: string, options?: {
|
|
180
184
|
limit?: number;
|
|
181
185
|
beforeSeq?: number;
|
|
@@ -13,6 +13,7 @@ import { getSessionConfig, setSessionConfig } from "../storage/sqlite/config-rep
|
|
|
13
13
|
import "../storage/sqlite/index.js";
|
|
14
14
|
import { init_agent_session_key, resolveAgentIdFromConversationId } from "../routing/agent-session-key.js";
|
|
15
15
|
import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
16
|
+
import { DurableState } from "../storage/sqlite/durable-state.js";
|
|
16
17
|
import { transcriptRowsToClientHistory } from "./client-history.js";
|
|
17
18
|
import { SessionCompactor } from "../agent/memory/compaction.js";
|
|
18
19
|
import { resolveCompactionPolicy } from "../agent/memory/compaction-policy.js";
|
|
@@ -23,6 +24,7 @@ import { SlidingWindow } from "../agent/memory/window.js";
|
|
|
23
24
|
import { isAppendOnlyLlmTranscriptMessage } from "./transcript-stats.js";
|
|
24
25
|
import { backfillStructuredTurnOutcomes } from "./turn-outcome-projector.js";
|
|
25
26
|
import { computeTranscriptUserRoundDeleteRange } from "./user-round-delete.js";
|
|
27
|
+
import { findSessionMessages } from "./session-find.js";
|
|
26
28
|
//#region src/session/store.ts
|
|
27
29
|
init_paths_state();
|
|
28
30
|
init_agent_session_key();
|
|
@@ -45,6 +47,27 @@ var SessionStore = class {
|
|
|
45
47
|
compactor;
|
|
46
48
|
compactionHooks = {};
|
|
47
49
|
compactionTails = /* @__PURE__ */ new Map();
|
|
50
|
+
compactionCheckpoint(key) {
|
|
51
|
+
const state = new DurableState("session-compaction-progress", key);
|
|
52
|
+
return {
|
|
53
|
+
load: () => state.get("active"),
|
|
54
|
+
save: (checkpoint) => state.set("active", checkpoint),
|
|
55
|
+
clear: () => {
|
|
56
|
+
state.delete("active");
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
clearCompactionCheckpoint(key, checkpoint = this.compactionCheckpoint(key)) {
|
|
61
|
+
try {
|
|
62
|
+
checkpoint.clear();
|
|
63
|
+
} catch (err) {
|
|
64
|
+
log.warn({
|
|
65
|
+
err,
|
|
66
|
+
conversationId: key,
|
|
67
|
+
phase: "checkpoint_clear"
|
|
68
|
+
}, "Compaction checkpoint cleanup failed");
|
|
69
|
+
}
|
|
70
|
+
}
|
|
48
71
|
constructor(options, windowConfig, compactionConfig) {
|
|
49
72
|
this.options = options;
|
|
50
73
|
this.window = new SlidingWindow(windowConfig);
|
|
@@ -276,10 +299,13 @@ var SessionStore = class {
|
|
|
276
299
|
return this.runStoreMutation(async () => {
|
|
277
300
|
requireXopcDatabase();
|
|
278
301
|
const task = resetSessionRecord(key, this.resolveWorkspaceCwd(key));
|
|
279
|
-
if (task)
|
|
280
|
-
key
|
|
281
|
-
|
|
282
|
-
|
|
302
|
+
if (task) {
|
|
303
|
+
this.clearCompactionCheckpoint(key);
|
|
304
|
+
log.info({
|
|
305
|
+
key,
|
|
306
|
+
...task
|
|
307
|
+
}, "Session reset");
|
|
308
|
+
}
|
|
283
309
|
return task;
|
|
284
310
|
});
|
|
285
311
|
}
|
|
@@ -287,7 +313,10 @@ var SessionStore = class {
|
|
|
287
313
|
return this.runStoreMutation(async () => {
|
|
288
314
|
requireXopcDatabase();
|
|
289
315
|
const ok = deleteSessionRecord(key);
|
|
290
|
-
if (ok)
|
|
316
|
+
if (ok) {
|
|
317
|
+
this.clearCompactionCheckpoint(key);
|
|
318
|
+
log.info({ key }, "Session deleted");
|
|
319
|
+
}
|
|
291
320
|
return ok;
|
|
292
321
|
});
|
|
293
322
|
}
|
|
@@ -538,20 +567,23 @@ var SessionStore = class {
|
|
|
538
567
|
messageCount: messages.length,
|
|
539
568
|
tokenCount
|
|
540
569
|
});
|
|
570
|
+
const checkpoint = executionOptions?.checkpoint ?? this.compactionCheckpoint(key);
|
|
541
571
|
const result = await this.compactor.compact(snapshot.entries, model, instructions, force, {
|
|
542
572
|
...executionOptions,
|
|
543
|
-
conversationId: key
|
|
573
|
+
conversationId: key,
|
|
574
|
+
checkpoint
|
|
544
575
|
});
|
|
545
576
|
executionOptions?.signal?.throwIfAborted();
|
|
546
577
|
if (result.compacted) {
|
|
547
578
|
const compacted = await this.applyCompaction(key, result, snapshot);
|
|
579
|
+
this.clearCompactionCheckpoint(key, checkpoint);
|
|
548
580
|
await this.runCompactionHook("after", {
|
|
549
581
|
conversationId: key,
|
|
550
582
|
messageCount: compacted.length,
|
|
551
583
|
tokenCount: result.tokensAfter,
|
|
552
584
|
compactedCount: Math.max(0, Math.min(messages.length, result.firstKeptIndex))
|
|
553
585
|
});
|
|
554
|
-
}
|
|
586
|
+
} else this.clearCompactionCheckpoint(key, checkpoint);
|
|
555
587
|
return result;
|
|
556
588
|
});
|
|
557
589
|
}
|
|
@@ -593,6 +625,10 @@ var SessionStore = class {
|
|
|
593
625
|
const q = keyword.toLowerCase();
|
|
594
626
|
return this.convertMessages(messages.filter((m) => this.extractTextContent(this.messageContent(m)).toLowerCase().includes(q)));
|
|
595
627
|
}
|
|
628
|
+
async findInSession(key, query, limit) {
|
|
629
|
+
if (!await this.getMetadata(key)) return null;
|
|
630
|
+
return findSessionMessages(transcriptRowsToClientHistory(await this.loadTranscriptRows(key)), query, limit);
|
|
631
|
+
}
|
|
596
632
|
recallSession(key, query, options) {
|
|
597
633
|
requireXopcDatabase();
|
|
598
634
|
return searchSessionTranscript(key, query, options);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { init_transaction, runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
|
|
2
|
+
import { DurableState } from "../storage/sqlite/durable-state.js";
|
|
3
|
+
//#region src/share/note-share-revocation.ts
|
|
4
|
+
init_transaction();
|
|
5
|
+
/** SQLite-only revocation for compound note deletion transactions. */
|
|
6
|
+
function revokeNoteShareRecords(noteId) {
|
|
7
|
+
return runSqliteWriteTransaction(() => {
|
|
8
|
+
const shares = new DurableState("shares");
|
|
9
|
+
const revoked = [];
|
|
10
|
+
for (const record of shares.values()) {
|
|
11
|
+
if (record.kind !== "note" || record.sourceNoteId !== noteId || record.revoked) continue;
|
|
12
|
+
shares.set(record.id, {
|
|
13
|
+
...record,
|
|
14
|
+
revoked: true
|
|
15
|
+
});
|
|
16
|
+
revoked.push(record.id);
|
|
17
|
+
}
|
|
18
|
+
return revoked;
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function canRemoveRevokedNoteShareArtifact(id) {
|
|
22
|
+
const record = new DurableState("shares").get(id);
|
|
23
|
+
return !record || record.kind === "note" && record.revoked;
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { canRemoveRevokedNoteShareArtifact, revokeNoteShareRecords };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
-- Scene-specific source and delivery metadata; Task and TaskRun remain authoritative.
|
|
2
|
+
CREATE TABLE scene_development_bindings (
|
|
3
|
+
activation_id TEXT PRIMARY KEY REFERENCES scene_activations(id) ON DELETE CASCADE,
|
|
4
|
+
task_id TEXT NOT NULL UNIQUE REFERENCES tasks(task_id) ON DELETE CASCADE,
|
|
5
|
+
source_key TEXT NOT NULL UNIQUE,
|
|
6
|
+
input_json TEXT NOT NULL CHECK(json_valid(input_json)),
|
|
7
|
+
environment_id TEXT REFERENCES execution_environments(environment_id),
|
|
8
|
+
resource_operation_id TEXT,
|
|
9
|
+
observed_revision INTEGER NOT NULL DEFAULT 0,
|
|
10
|
+
delivered_revision INTEGER NOT NULL DEFAULT 0,
|
|
11
|
+
delivered_decisions_hash TEXT NOT NULL DEFAULT '',
|
|
12
|
+
applied_revision INTEGER NOT NULL DEFAULT 0,
|
|
13
|
+
executing_run_id TEXT REFERENCES task_runs(run_id),
|
|
14
|
+
last_error TEXT,
|
|
15
|
+
next_poll_at INTEGER NOT NULL DEFAULT 0,
|
|
16
|
+
failures INTEGER NOT NULL DEFAULT 0,
|
|
17
|
+
created_at INTEGER NOT NULL
|
|
18
|
+
);
|
|
19
|
+
CREATE TABLE scene_development_revisions (
|
|
20
|
+
activation_id TEXT NOT NULL REFERENCES scene_development_bindings(activation_id) ON DELETE CASCADE,
|
|
21
|
+
revision INTEGER NOT NULL,
|
|
22
|
+
source_hash TEXT NOT NULL,
|
|
23
|
+
content TEXT NOT NULL,
|
|
24
|
+
observed_at INTEGER NOT NULL,
|
|
25
|
+
PRIMARY KEY(activation_id, revision)
|
|
26
|
+
);
|
|
27
|
+
CREATE INDEX scene_development_poll ON scene_development_bindings(next_poll_at);
|
|
28
|
+
CREATE TABLE scene_development_branch_links (
|
|
29
|
+
owner_id TEXT NOT NULL,
|
|
30
|
+
workspace_id TEXT NOT NULL,
|
|
31
|
+
project_id TEXT NOT NULL REFERENCES projects(project_id) ON DELETE CASCADE,
|
|
32
|
+
branch_ref TEXT NOT NULL,
|
|
33
|
+
task_id TEXT NOT NULL REFERENCES tasks(task_id) ON DELETE CASCADE,
|
|
34
|
+
confirmed_sha TEXT NOT NULL,
|
|
35
|
+
confirmed_at INTEGER NOT NULL,
|
|
36
|
+
PRIMARY KEY(owner_id, workspace_id, project_id, branch_ref)
|
|
37
|
+
);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
-- Preserve experimental records and resources without automatically widening authority.
|
|
2
|
+
ALTER TABLE scene_development_bindings RENAME TO scene_task_bindings;
|
|
3
|
+
ALTER TABLE scene_development_revisions RENAME TO scene_task_revisions;
|
|
4
|
+
ALTER TABLE scene_development_branch_links RENAME TO scene_task_branch_links;
|
|
5
|
+
ALTER TABLE scene_task_bindings RENAME COLUMN applied_revision TO processed_revision;
|
|
6
|
+
ALTER TABLE scene_task_bindings ADD COLUMN continuation_attempts INTEGER NOT NULL DEFAULT 0;
|
|
7
|
+
ALTER TABLE scene_task_bindings ADD COLUMN continuation_requested INTEGER NOT NULL DEFAULT 0;
|
|
8
|
+
UPDATE scene_task_bindings SET input_json = json_patch(json_object(
|
|
9
|
+
'source', json_object('provider', 'slack_thread', 'reference', json_extract(input_json, '$.thread')),
|
|
10
|
+
'goal', json_extract(input_json, '$.goal'),
|
|
11
|
+
'instruction', 'Follow the delegated goal using current discussion. Do not publish, commit, push, merge or deploy.',
|
|
12
|
+
'projectId', json_extract(input_json, '$.projectId'),
|
|
13
|
+
'resource', 'worktree',
|
|
14
|
+
'capabilities', json(CASE WHEN json_extract(input_json, '$.mode') = 'code'
|
|
15
|
+
THEN CASE WHEN json_extract(input_json, '$.verificationCommand') IS NOT NULL
|
|
16
|
+
THEN '["workspace.read","workspace.write","verification.run"]' ELSE '["workspace.read","workspace.write"]' END
|
|
17
|
+
ELSE '["workspace.read"]' END)
|
|
18
|
+
), json_object('sourceUrl', json_extract(input_json, '$.sourceUrl'), 'verificationCommand',
|
|
19
|
+
CASE WHEN json_extract(input_json, '$.mode') = 'code' THEN json_extract(input_json, '$.verificationCommand') ELSE NULL END)),
|
|
20
|
+
last_error = 'Configuration migrated. Review permissions and resume explicitly.', next_poll_at = 0;
|
|
21
|
+
-- Original verified receipts remain authoritative; processed is not a verification claim.
|
|
22
|
+
UPDATE scene_activations SET status = CASE WHEN status = 'archived' THEN status ELSE 'paused' END,
|
|
23
|
+
revision = revision + 1,
|
|
24
|
+
permissions_json = json_set(permissions_json, '$.contextProviders', json('["connected_source"]'),
|
|
25
|
+
'$.effectHandlers', json((SELECT json_group_array(value) FROM scene_task_bindings b,
|
|
26
|
+
json_each(b.input_json, '$.capabilities') WHERE b.activation_id = scene_activations.id AND value <> 'workspace.read')))
|
|
27
|
+
WHERE id IN (SELECT activation_id FROM scene_task_bindings);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
CREATE TABLE capability_operations (
|
|
2
|
+
operation_id TEXT PRIMARY KEY,
|
|
3
|
+
principal_id TEXT NOT NULL,
|
|
4
|
+
capability_id TEXT NOT NULL,
|
|
5
|
+
idempotency_key TEXT NOT NULL,
|
|
6
|
+
request_digest TEXT NOT NULL,
|
|
7
|
+
descriptor_digest TEXT NOT NULL,
|
|
8
|
+
result_json TEXT NOT NULL CHECK (json_valid(result_json)),
|
|
9
|
+
created_at INTEGER NOT NULL,
|
|
10
|
+
UNIQUE(principal_id, capability_id, idempotency_key)
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
CREATE TABLE capability_invocations (
|
|
14
|
+
invocation_id TEXT PRIMARY KEY,
|
|
15
|
+
operation_id TEXT NOT NULL REFERENCES capability_operations(operation_id) ON DELETE CASCADE,
|
|
16
|
+
surface TEXT NOT NULL,
|
|
17
|
+
replayed INTEGER NOT NULL CHECK (replayed IN (0, 1)),
|
|
18
|
+
created_at INTEGER NOT NULL
|
|
19
|
+
);
|
|
20
|
+
CREATE INDEX capability_invocations_operation ON capability_invocations(operation_id, created_at);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
ALTER TABLE capability_operations ADD COLUMN state TEXT NOT NULL DEFAULT 'succeeded'
|
|
2
|
+
CHECK (state IN ('running', 'succeeded', 'failed', 'unknown'));
|
|
3
|
+
ALTER TABLE capability_operations ADD COLUMN generation INTEGER NOT NULL DEFAULT 1;
|
|
4
|
+
ALTER TABLE capability_operations ADD COLUMN recovery_mode TEXT NOT NULL DEFAULT 'atomic'
|
|
5
|
+
CHECK (recovery_mode IN ('atomic', 'manual', 'provider-idempotent'));
|
|
6
|
+
ALTER TABLE capability_operations ADD COLUMN lease_expires_at INTEGER;
|
|
7
|
+
ALTER TABLE capability_operations ADD COLUMN evidence_json TEXT CHECK (evidence_json IS NULL OR json_valid(evidence_json));
|
|
8
|
+
ALTER TABLE capability_invocations ADD COLUMN state TEXT NOT NULL DEFAULT 'succeeded'
|
|
9
|
+
CHECK (state IN ('running', 'succeeded', 'failed', 'unknown'));
|
|
10
|
+
ALTER TABLE capability_invocations ADD COLUMN finished_at INTEGER;
|
|
11
|
+
ALTER TABLE domain_outbox ADD COLUMN operation_id TEXT;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
CREATE TABLE automation_run_requests (
|
|
2
|
+
run_id TEXT PRIMARY KEY,
|
|
3
|
+
automation_json TEXT NOT NULL CHECK (json_valid(automation_json))
|
|
4
|
+
);
|
|
5
|
+
|
|
6
|
+
-- Freeze the configuration previously used to resume pre-upgrade queued runs.
|
|
7
|
+
-- Remove only top-level optional fields; merge-patch would erase null workflow inputs.
|
|
8
|
+
INSERT INTO automation_run_requests (run_id, automation_json)
|
|
9
|
+
SELECT r.run_id, json_remove(json_object(
|
|
10
|
+
'id', a.automation_id, 'name', r.automation_name, 'description', a.description,
|
|
11
|
+
'projectId', a.project_id, 'enabled', json(CASE WHEN a.enabled = 1 THEN 'true' ELSE 'false' END),
|
|
12
|
+
'trigger', json(r.trigger_snapshot_json), 'action', json(r.action_snapshot_json),
|
|
13
|
+
'safety', json(a.safety_json), 'conversationMode', a.conversation_mode,
|
|
14
|
+
'notificationPolicy', a.notification_policy, 'completionWebhookUrl', a.completion_webhook_url,
|
|
15
|
+
'reliability', json(a.reliability_json), 'state', json(a.state_json),
|
|
16
|
+
'createdAtMs', a.created_at_ms, 'updatedAtMs', a.updated_at_ms
|
|
17
|
+
),
|
|
18
|
+
CASE WHEN a.description IS NULL THEN '$.description' ELSE '$.__absent' END,
|
|
19
|
+
CASE WHEN a.project_id IS NULL THEN '$.projectId' ELSE '$.__absent' END,
|
|
20
|
+
CASE WHEN a.safety_json IS NULL THEN '$.safety' ELSE '$.__absent' END,
|
|
21
|
+
CASE WHEN a.completion_webhook_url IS NULL THEN '$.completionWebhookUrl' ELSE '$.__absent' END,
|
|
22
|
+
CASE WHEN a.reliability_json IS NULL THEN '$.reliability' ELSE '$.__absent' END
|
|
23
|
+
) FROM automation_runs r JOIN automations a ON a.automation_id = r.automation_id WHERE r.status = 'queued';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
CREATE TABLE note_deletion_cleanup (
|
|
2
|
+
kind TEXT NOT NULL CHECK(kind IN ('media', 'share')),
|
|
3
|
+
object_id TEXT NOT NULL,
|
|
4
|
+
created_at INTEGER NOT NULL,
|
|
5
|
+
attempts INTEGER NOT NULL DEFAULT 0,
|
|
6
|
+
next_attempt_at INTEGER NOT NULL DEFAULT 0,
|
|
7
|
+
PRIMARY KEY(kind, object_id)
|
|
8
|
+
);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
CREATE TABLE project_workspace_creation (
|
|
2
|
+
project_id TEXT PRIMARY KEY REFERENCES projects(project_id) ON DELETE CASCADE,
|
|
3
|
+
workspace_root TEXT NOT NULL,
|
|
4
|
+
created_at INTEGER NOT NULL,
|
|
5
|
+
attempts INTEGER NOT NULL DEFAULT 0,
|
|
6
|
+
next_attempt_at INTEGER NOT NULL DEFAULT 0
|
|
7
|
+
);
|