@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
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
2
|
+
import "../../../capabilities/runtime/dispatcher.js";
|
|
1
3
|
import { readLocalAppAcceptanceConfig } from "../../../local-apps/acceptance.js";
|
|
4
|
+
import { createProductDispatcher } from "../../../capabilities/runtime/product.js";
|
|
2
5
|
import { extensionAssetMimeType } from "../lib/extension-assets.js";
|
|
6
|
+
import { capabilityHttpContext, capabilityHttpError } from "../../../capabilities/adapters/http.js";
|
|
3
7
|
import { LOCAL_APP_RUNTIME_BRIDGE_HASH, injectLocalAppRuntimeBridge } from "../../../local-apps/preview-runtime-bridge.js";
|
|
4
8
|
import { relative, resolve } from "node:path";
|
|
5
9
|
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
10
|
+
import { randomUUID } from "node:crypto";
|
|
6
11
|
//#region src/gateway/hono/routes/local-apps.ts
|
|
7
12
|
const LOCAL_APP_PREVIEW_CSP = `default-src 'self'; script-src 'self' 'sha256-${LOCAL_APP_RUNTIME_BRIDGE_HASH}'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:; connect-src 'none'; frame-ancestors 'self'; frame-src 'none'; base-uri 'none'; object-src 'none'; form-action 'none'`;
|
|
8
13
|
function registerPublicLocalAppPreviewRoutes(app, service) {
|
|
@@ -49,7 +54,14 @@ function registerPublicLocalAppPreviewRoutes(app, service) {
|
|
|
49
54
|
});
|
|
50
55
|
}
|
|
51
56
|
function registerLocalAppsRoutes(app, deps) {
|
|
52
|
-
|
|
57
|
+
const capabilities = createProductDispatcher(void 0, { getLocalApps: () => deps.service.localApps });
|
|
58
|
+
app.get("/api/local-apps", async (c) => {
|
|
59
|
+
try {
|
|
60
|
+
return c.json(await capabilities.call("xopc.local_apps.list", {}, capabilityHttpContext(c)));
|
|
61
|
+
} catch (error) {
|
|
62
|
+
return capabilityHttpError(c, error);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
53
65
|
app.post("/api/local-apps", async (c) => {
|
|
54
66
|
const body = await c.req.json();
|
|
55
67
|
if (typeof body.name !== "string" || typeof body.idea !== "string") return c.json({ error: "name and idea are required" }, 400);
|
|
@@ -60,17 +72,37 @@ function registerLocalAppsRoutes(app, deps) {
|
|
|
60
72
|
});
|
|
61
73
|
return c.json({ app: appDetail }, 201);
|
|
62
74
|
});
|
|
63
|
-
app.get("/api/local-apps/:id", (c) => {
|
|
64
|
-
|
|
65
|
-
|
|
75
|
+
app.get("/api/local-apps/:id", async (c) => {
|
|
76
|
+
try {
|
|
77
|
+
return c.json(await capabilities.call("xopc.local_apps.get", { id: c.req.param("id") }, capabilityHttpContext(c)));
|
|
78
|
+
} catch (error) {
|
|
79
|
+
return capabilityHttpError(c, error);
|
|
80
|
+
}
|
|
66
81
|
});
|
|
67
|
-
app.post("/api/local-apps/:id/validate", (c) => {
|
|
68
|
-
|
|
82
|
+
app.post("/api/local-apps/:id/validate", async (c) => {
|
|
83
|
+
try {
|
|
84
|
+
return c.json(await capabilities.call("xopc.local_apps.validate", { id: c.req.param("id") }, capabilityHttpContext(c)));
|
|
85
|
+
} catch (error) {
|
|
86
|
+
return capabilityHttpError(c, error);
|
|
87
|
+
}
|
|
69
88
|
});
|
|
70
89
|
app.post("/api/local-apps/:id/acceptance-runs", async (c) => {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
90
|
+
try {
|
|
91
|
+
const body = await c.req.json().catch(() => {
|
|
92
|
+
throw new CapabilityError("INVALID_INPUT", "Invalid JSON body");
|
|
93
|
+
});
|
|
94
|
+
const caller = capabilityHttpContext(c);
|
|
95
|
+
const operation = "xopc.local_apps.record_acceptance";
|
|
96
|
+
return c.json(await capabilities.call(operation, {
|
|
97
|
+
...body,
|
|
98
|
+
id: c.req.param("id")
|
|
99
|
+
}, caller, {
|
|
100
|
+
...capabilities.describe(operation, caller),
|
|
101
|
+
idempotencyKey: c.req.header("idempotency-key") ?? randomUUID()
|
|
102
|
+
}), 201);
|
|
103
|
+
} catch (error) {
|
|
104
|
+
return capabilityHttpError(c, error);
|
|
105
|
+
}
|
|
74
106
|
});
|
|
75
107
|
app.post("/api/local-apps/:id/install", async (c) => {
|
|
76
108
|
const appDetail = await deps.service.localApps.install(c.req.param("id"));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolveModelsJsonPath } from "../../../config/paths.js";
|
|
2
2
|
import { init_resolve_config_value, testApiKeyResolution } from "../../../config/resolve-config-value.js";
|
|
3
|
-
import { computerModelProfile, init_model_policy } from "../../../computer/model-policy.js";
|
|
3
|
+
import { computerModelProfile, init_model_policy, isDedicatedComputerModel } from "../../../computer/model-policy.js";
|
|
4
4
|
import { init_models_json, loadModelsJson, saveModelsJson, validateModelsConfig } from "../../../config/models-json.js";
|
|
5
5
|
import { getModelCatalogStore, init_model_catalog_store } from "../../../providers/model-catalog-store.js";
|
|
6
6
|
import { getModelRegistry } from "../../../providers/model-registry.js";
|
|
@@ -306,7 +306,7 @@ function registerModelsRoutes(authenticated, deps) {
|
|
|
306
306
|
reasoning: m.reasoning ?? false,
|
|
307
307
|
thinking: getModelThinking(m),
|
|
308
308
|
vision: m.input?.includes("image") ?? false,
|
|
309
|
-
recommended: !
|
|
309
|
+
recommended: !isDedicatedComputerModel(m) && isRecommendedModel(m.provider, m.id),
|
|
310
310
|
cost: {
|
|
311
311
|
input: m.cost?.input ?? 0,
|
|
312
312
|
output: m.cost?.output ?? 0
|
|
@@ -1,18 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NoteDeleteOutputSchema, NoteGetOutputSchema, ProductReadContracts } from "../../../../packages/gateway-contract/src/capabilities.js";
|
|
2
|
+
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
2
3
|
import { init_session_key, resolveConversationId } from "../../../routing/session-key.js";
|
|
3
4
|
import { agentExists, getDefaultAgentId, init_resolve_route } from "../../../routing/resolve-route.js";
|
|
5
|
+
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
6
|
+
import "../../../capabilities/runtime/dispatcher.js";
|
|
4
7
|
import { resolveGatewayEffectiveHost } from "../../../config/gateway-bind.js";
|
|
5
8
|
import { getShareStore } from "../../../share/share-store.js";
|
|
6
9
|
import { resolveShareUrl } from "../../../share/share-url.js";
|
|
7
10
|
import { resolveReverseProxyPublicUrl } from "../../public-url.js";
|
|
11
|
+
import { createProductDispatcher } from "../../../capabilities/runtime/product.js";
|
|
8
12
|
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
13
|
+
import { capabilityHttpContext, capabilityHttpError } from "../../../capabilities/adapters/http.js";
|
|
9
14
|
import { NoteShareService, NoteShareVersionConflictError } from "../../../share/note-share-service.js";
|
|
10
15
|
import { createReadStream } from "node:fs";
|
|
11
|
-
import { createHash } from "node:crypto";
|
|
16
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
12
17
|
import { access, stat } from "node:fs/promises";
|
|
13
18
|
import { Readable } from "node:stream";
|
|
14
19
|
import { stream } from "hono/streaming";
|
|
15
20
|
//#region src/gateway/hono/routes/notes.ts
|
|
21
|
+
init_src();
|
|
16
22
|
init_session_key();
|
|
17
23
|
init_resolve_route();
|
|
18
24
|
const VALID_KINDS = new Set([
|
|
@@ -72,7 +78,15 @@ function noteThreadName(note) {
|
|
|
72
78
|
}
|
|
73
79
|
function registerNotesRoutes(authenticated, deps) {
|
|
74
80
|
const { service } = deps;
|
|
75
|
-
const
|
|
81
|
+
const capabilities = createProductDispatcher(() => service.notesServiceInstance, { getProjects: () => service.projects });
|
|
82
|
+
const invokeRead = async (c, operation, input) => ProductReadContracts[operation].output.parse(await capabilities.call(operation, input, capabilityHttpContext(c)));
|
|
83
|
+
const invokeNote = async (c, operation, input, key) => {
|
|
84
|
+
const context = capabilityHttpContext(c);
|
|
85
|
+
return NoteGetOutputSchema.parse(await capabilities.call(operation, input, context, {
|
|
86
|
+
...capabilities.describe(operation, context),
|
|
87
|
+
idempotencyKey: key ?? randomUUID()
|
|
88
|
+
}));
|
|
89
|
+
};
|
|
76
90
|
const shareConfig = () => {
|
|
77
91
|
const raw = (service.currentConfig?.gateway)?.share;
|
|
78
92
|
return raw && typeof raw === "object" ? raw : {};
|
|
@@ -88,26 +102,6 @@ function registerNotesRoutes(authenticated, deps) {
|
|
|
88
102
|
gatewayPort: service.currentConfig?.gateway?.port ?? 18790,
|
|
89
103
|
reverseProxyPublicUrl: resolveReverseProxyPublicUrl(service.currentConfig)
|
|
90
104
|
});
|
|
91
|
-
const linkNoteToProject = (note, projectId) => {
|
|
92
|
-
if (!projectId) return;
|
|
93
|
-
const project = service.projects.get(projectId);
|
|
94
|
-
if (!project) return;
|
|
95
|
-
objectLinks.create({
|
|
96
|
-
id: `note:${note.id}:project:${project.id}`,
|
|
97
|
-
from: {
|
|
98
|
-
kind: "note",
|
|
99
|
-
id: note.id,
|
|
100
|
-
title: note.title
|
|
101
|
-
},
|
|
102
|
-
to: {
|
|
103
|
-
kind: "project",
|
|
104
|
-
id: project.id,
|
|
105
|
-
title: project.name
|
|
106
|
-
},
|
|
107
|
-
relation: "belongs_to",
|
|
108
|
-
source: "user"
|
|
109
|
-
});
|
|
110
|
-
};
|
|
111
105
|
authenticated.post("/api/notes/quick-capture", async (c) => {
|
|
112
106
|
const body = await c.req.json().catch(() => ({}));
|
|
113
107
|
const text = typeof body.text === "string" ? body.text.trim() : "";
|
|
@@ -115,106 +109,110 @@ function registerNotesRoutes(authenticated, deps) {
|
|
|
115
109
|
const source = parseCaptureSource(body);
|
|
116
110
|
const idempotencyKey = readIdempotencyKey(c.req.header("idempotency-key"));
|
|
117
111
|
if (idempotencyKey && idempotencyKey.length > 200) return c.json({ error: "Idempotency-Key is too long" }, 400);
|
|
118
|
-
|
|
119
|
-
|
|
112
|
+
try {
|
|
113
|
+
return c.json(await invokeNote(c, "xopc.notes.capture", {
|
|
114
|
+
text,
|
|
115
|
+
capturedVia: source
|
|
116
|
+
}, idempotencyKey), 201);
|
|
117
|
+
} catch (error) {
|
|
118
|
+
return capabilityHttpError(c, error);
|
|
119
|
+
}
|
|
120
120
|
});
|
|
121
121
|
authenticated.get("/api/notes", async (c) => {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
unassigned: c.req.query("unassigned") === "true" || void 0,
|
|
138
|
-
agentEdited: c.req.query("agentEdited") === "true" || void 0,
|
|
139
|
-
search: search || void 0,
|
|
140
|
-
pinned: pinnedRaw === "true" ? true : pinnedRaw === "false" ? false : void 0,
|
|
141
|
-
limit: limitRaw ? parseInt(limitRaw, 10) : void 0,
|
|
142
|
-
offset: offsetRaw ? parseInt(offsetRaw, 10) : void 0,
|
|
143
|
-
sortBy: sortBy === "createdAt" || sortBy === "updatedAt" || sortBy === "lastOpenedAt" ? sortBy : void 0,
|
|
144
|
-
sortOrder: sortOrder === "asc" || sortOrder === "desc" ? sortOrder : void 0
|
|
145
|
-
});
|
|
146
|
-
return c.json(result);
|
|
122
|
+
try {
|
|
123
|
+
const input = { ...c.req.query() };
|
|
124
|
+
for (const key of ["limit", "offset"]) if (input[key] !== void 0) input[key] = Number(input[key]);
|
|
125
|
+
for (const key of [
|
|
126
|
+
"pinned",
|
|
127
|
+
"unassigned",
|
|
128
|
+
"agentEdited"
|
|
129
|
+
]) {
|
|
130
|
+
if (input[key] === "true") input[key] = true;
|
|
131
|
+
if (input[key] === "false") input[key] = false;
|
|
132
|
+
}
|
|
133
|
+
return c.json(await capabilities.call("xopc.notes.list", input, capabilityHttpContext(c)));
|
|
134
|
+
} catch (error) {
|
|
135
|
+
return capabilityHttpError(c, error);
|
|
136
|
+
}
|
|
147
137
|
});
|
|
148
|
-
authenticated.get("/api/notes/project-summaries", (c) => {
|
|
149
|
-
|
|
138
|
+
authenticated.get("/api/notes/project-summaries", async (c) => {
|
|
139
|
+
try {
|
|
140
|
+
return c.json(await invokeRead(c, "xopc.notes.project_summaries", {}));
|
|
141
|
+
} catch (error) {
|
|
142
|
+
return capabilityHttpError(c, error);
|
|
143
|
+
}
|
|
150
144
|
});
|
|
151
145
|
authenticated.post("/api/notes", async (c) => {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
146
|
+
try {
|
|
147
|
+
const contentType = c.req.header("content-type") || "";
|
|
148
|
+
const idempotencyKey = readIdempotencyKey(c.req.header("idempotency-key"));
|
|
149
|
+
if (idempotencyKey && idempotencyKey.length > 200) return c.json({ error: "Idempotency-Key is too long" }, 400);
|
|
150
|
+
if (contentType.includes("multipart/form-data")) {
|
|
151
|
+
let body;
|
|
152
|
+
try {
|
|
153
|
+
body = await c.req.parseBody({ all: true });
|
|
154
|
+
} catch {
|
|
155
|
+
return c.json({ error: "Invalid multipart body" }, 400);
|
|
156
|
+
}
|
|
157
|
+
const markdown = typeof body.markdown === "string" ? body.markdown.trim() : void 0;
|
|
158
|
+
const kindRaw = typeof body.kind === "string" ? body.kind : void 0;
|
|
159
|
+
const tagsRaw = typeof body.tags === "string" ? body.tags : void 0;
|
|
160
|
+
const source = parseCaptureSource(body);
|
|
161
|
+
const projectId = typeof body.projectId === "string" && body.projectId.trim() ? body.projectId.trim() : void 0;
|
|
162
|
+
if (projectId && !service.projects.get(projectId)) return c.json({ error: "Project not found" }, 400);
|
|
163
|
+
const { note } = await invokeNote(c, "xopc.notes.create", {
|
|
164
|
+
markdown,
|
|
165
|
+
kind: kindRaw && VALID_KINDS.has(kindRaw) ? kindRaw : void 0,
|
|
166
|
+
tags: tagsRaw ? tagsRaw.split(",").map((t) => t.trim()).filter(Boolean) : void 0,
|
|
167
|
+
capturedVia: source,
|
|
168
|
+
projectId
|
|
169
|
+
}, idempotencyKey);
|
|
170
|
+
const file = body.file;
|
|
171
|
+
if (file && typeof file === "object") {
|
|
172
|
+
let buf = null;
|
|
173
|
+
let fileName = "upload";
|
|
174
|
+
let mimeType = "application/octet-stream";
|
|
175
|
+
if (file instanceof File) {
|
|
176
|
+
buf = Buffer.from(await file.arrayBuffer());
|
|
177
|
+
fileName = file.name || fileName;
|
|
178
|
+
mimeType = file.type || mimeType;
|
|
179
|
+
} else if (typeof file.arrayBuffer === "function") buf = Buffer.from(await file.arrayBuffer());
|
|
180
|
+
if (buf) {
|
|
181
|
+
const durationRaw = body.duration;
|
|
182
|
+
const duration = typeof durationRaw === "string" ? parseInt(durationRaw, 10) : typeof durationRaw === "number" ? durationRaw : void 0;
|
|
183
|
+
await service.notesServiceInstance.addAttachment(note.id, {
|
|
184
|
+
name: fileName,
|
|
185
|
+
buffer: buf,
|
|
186
|
+
mimeType,
|
|
187
|
+
duration: Number.isFinite(duration) ? duration : void 0,
|
|
188
|
+
retainWithoutReference: kindRaw === "voice"
|
|
189
|
+
}, idempotencyKey);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
const full = await service.notesServiceInstance.getNote(note.id);
|
|
193
|
+
return c.json({ note: full }, 201);
|
|
161
194
|
}
|
|
195
|
+
const body = await c.req.json().catch(() => ({}));
|
|
196
|
+
const title = typeof body.title === "string" ? body.title.trim() : void 0;
|
|
162
197
|
const markdown = typeof body.markdown === "string" ? body.markdown.trim() : void 0;
|
|
163
198
|
const kindRaw = typeof body.kind === "string" ? body.kind : void 0;
|
|
164
|
-
const tagsRaw =
|
|
199
|
+
const tagsRaw = Array.isArray(body.tags) ? body.tags.filter((t) => typeof t === "string") : void 0;
|
|
165
200
|
const source = parseCaptureSource(body);
|
|
166
201
|
const projectId = typeof body.projectId === "string" && body.projectId.trim() ? body.projectId.trim() : void 0;
|
|
167
202
|
if (projectId && !service.projects.get(projectId)) return c.json({ error: "Project not found" }, 400);
|
|
168
|
-
const note = await
|
|
203
|
+
const { note } = await invokeNote(c, "xopc.notes.create", {
|
|
204
|
+
title,
|
|
169
205
|
markdown,
|
|
170
206
|
kind: kindRaw && VALID_KINDS.has(kindRaw) ? kindRaw : void 0,
|
|
171
|
-
tags: tagsRaw
|
|
172
|
-
capturedVia: source
|
|
207
|
+
tags: tagsRaw,
|
|
208
|
+
capturedVia: source,
|
|
209
|
+
pinned: body.pinned === true,
|
|
210
|
+
projectId
|
|
173
211
|
}, idempotencyKey);
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
let buf = null;
|
|
178
|
-
let fileName = "upload";
|
|
179
|
-
let mimeType = "application/octet-stream";
|
|
180
|
-
if (file instanceof File) {
|
|
181
|
-
buf = Buffer.from(await file.arrayBuffer());
|
|
182
|
-
fileName = file.name || fileName;
|
|
183
|
-
mimeType = file.type || mimeType;
|
|
184
|
-
} else if (typeof file.arrayBuffer === "function") buf = Buffer.from(await file.arrayBuffer());
|
|
185
|
-
if (buf) {
|
|
186
|
-
const durationRaw = body.duration;
|
|
187
|
-
const duration = typeof durationRaw === "string" ? parseInt(durationRaw, 10) : typeof durationRaw === "number" ? durationRaw : void 0;
|
|
188
|
-
await service.notesServiceInstance.addAttachment(note.id, {
|
|
189
|
-
name: fileName,
|
|
190
|
-
buffer: buf,
|
|
191
|
-
mimeType,
|
|
192
|
-
duration: Number.isFinite(duration) ? duration : void 0,
|
|
193
|
-
retainWithoutReference: kindRaw === "voice"
|
|
194
|
-
}, idempotencyKey);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
const full = await service.notesServiceInstance.getNote(note.id);
|
|
198
|
-
return c.json({ note: full }, 201);
|
|
212
|
+
return c.json({ note }, 201);
|
|
213
|
+
} catch (error) {
|
|
214
|
+
return capabilityHttpError(c, error);
|
|
199
215
|
}
|
|
200
|
-
const body = await c.req.json().catch(() => ({}));
|
|
201
|
-
const title = typeof body.title === "string" ? body.title.trim() : void 0;
|
|
202
|
-
const markdown = typeof body.markdown === "string" ? body.markdown.trim() : void 0;
|
|
203
|
-
const kindRaw = typeof body.kind === "string" ? body.kind : void 0;
|
|
204
|
-
const tagsRaw = Array.isArray(body.tags) ? body.tags.filter((t) => typeof t === "string") : void 0;
|
|
205
|
-
const source = parseCaptureSource(body);
|
|
206
|
-
const projectId = typeof body.projectId === "string" && body.projectId.trim() ? body.projectId.trim() : void 0;
|
|
207
|
-
if (projectId && !service.projects.get(projectId)) return c.json({ error: "Project not found" }, 400);
|
|
208
|
-
const note = await service.notesServiceInstance.createNote({
|
|
209
|
-
title,
|
|
210
|
-
markdown,
|
|
211
|
-
kind: kindRaw && VALID_KINDS.has(kindRaw) ? kindRaw : void 0,
|
|
212
|
-
tags: tagsRaw,
|
|
213
|
-
capturedVia: source,
|
|
214
|
-
pinned: body.pinned === true
|
|
215
|
-
}, idempotencyKey);
|
|
216
|
-
linkNoteToProject(note, projectId);
|
|
217
|
-
return c.json({ note }, 201);
|
|
218
216
|
});
|
|
219
217
|
authenticated.post("/api/notes/sync", async (c) => {
|
|
220
218
|
const body = await c.req.json().catch(() => ({}));
|
|
@@ -367,15 +365,23 @@ function registerNotesRoutes(authenticated, deps) {
|
|
|
367
365
|
const content = typeof body.content === "string" ? body.content.trim() : "";
|
|
368
366
|
const heading = typeof body.heading === "string" && body.heading.trim() ? body.heading.trim() : void 0;
|
|
369
367
|
if (!content) return c.json({ error: "Missing required field: content" }, 400);
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
368
|
+
try {
|
|
369
|
+
return c.json(await invokeNote(c, "xopc.notes.append", {
|
|
370
|
+
id: c.req.param("id"),
|
|
371
|
+
content,
|
|
372
|
+
heading,
|
|
373
|
+
expectedRevision: body.expectedRevision
|
|
374
|
+
}, readIdempotencyKey(c.req.header("idempotency-key"))));
|
|
375
|
+
} catch (error) {
|
|
376
|
+
return capabilityHttpError(c, error);
|
|
377
|
+
}
|
|
373
378
|
});
|
|
374
379
|
authenticated.get("/api/notes/:id", async (c) => {
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
380
|
+
try {
|
|
381
|
+
return c.json(await capabilities.call("xopc.notes.get", { id: c.req.param("id") }, capabilityHttpContext(c)));
|
|
382
|
+
} catch (error) {
|
|
383
|
+
return capabilityHttpError(c, error);
|
|
384
|
+
}
|
|
379
385
|
});
|
|
380
386
|
authenticated.get("/api/notes/:id/shares", async (c) => {
|
|
381
387
|
const note = await service.notesServiceInstance.getNote(c.req.param("id"));
|
|
@@ -499,51 +505,114 @@ function registerNotesRoutes(authenticated, deps) {
|
|
|
499
505
|
const body = await c.req.json().catch(() => ({}));
|
|
500
506
|
const patch = buildNotePatch(body);
|
|
501
507
|
const trigger = body.trigger === "ai_edit" || body.trigger === "sync" || body.trigger === "restore" ? body.trigger : "edit";
|
|
502
|
-
const
|
|
503
|
-
if (!
|
|
504
|
-
|
|
508
|
+
const current = await service.notesServiceInstance.getNote(id);
|
|
509
|
+
if (!current) return c.json(noteNotFound(), 404);
|
|
510
|
+
if (c.req.header("idempotency-key") && body.expectedRevision === void 0) return c.json({
|
|
511
|
+
ok: false,
|
|
512
|
+
error: {
|
|
513
|
+
code: "INVALID_INPUT",
|
|
514
|
+
message: "Idempotent note updates require expectedRevision from the original read"
|
|
515
|
+
}
|
|
516
|
+
}, 400);
|
|
517
|
+
try {
|
|
518
|
+
return c.json(await invokeNote(c, "xopc.notes.update", {
|
|
519
|
+
id,
|
|
520
|
+
patch,
|
|
521
|
+
trigger,
|
|
522
|
+
expectedRevision: body.expectedRevision ?? current.remoteVersion ?? 1
|
|
523
|
+
}, readIdempotencyKey(c.req.header("idempotency-key"))));
|
|
524
|
+
} catch (error) {
|
|
525
|
+
return capabilityHttpError(c, error);
|
|
526
|
+
}
|
|
505
527
|
});
|
|
506
528
|
authenticated.delete("/api/notes/:id", async (c) => {
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
529
|
+
try {
|
|
530
|
+
const id = c.req.param("id");
|
|
531
|
+
const raw = await c.req.text();
|
|
532
|
+
let body = {};
|
|
533
|
+
if (raw) {
|
|
534
|
+
try {
|
|
535
|
+
body = JSON.parse(raw);
|
|
536
|
+
} catch {
|
|
537
|
+
throw new CapabilityError("INVALID_INPUT", "Invalid JSON body");
|
|
538
|
+
}
|
|
539
|
+
if (!body || typeof body !== "object" || Array.isArray(body)) throw new CapabilityError("INVALID_INPUT", "Expected an object");
|
|
540
|
+
}
|
|
541
|
+
const key = readIdempotencyKey(c.req.header("idempotency-key"));
|
|
542
|
+
if (key && body.expectedRevision === void 0) throw new CapabilityError("INVALID_INPUT", "Stable retries require the original expectedRevision");
|
|
543
|
+
let expectedRevision = body.expectedRevision;
|
|
544
|
+
if (expectedRevision === void 0) {
|
|
545
|
+
const note = await service.notesServiceInstance.getNote(id);
|
|
546
|
+
if (!note) throw new CapabilityError("NOT_FOUND", "Note not found");
|
|
547
|
+
expectedRevision = note.remoteVersion ?? 1;
|
|
548
|
+
}
|
|
549
|
+
const caller = capabilityHttpContext(c);
|
|
550
|
+
const operation = "xopc.notes.delete";
|
|
551
|
+
return c.json(NoteDeleteOutputSchema.parse(await capabilities.call(operation, {
|
|
552
|
+
...body,
|
|
553
|
+
id,
|
|
554
|
+
expectedRevision
|
|
555
|
+
}, caller, {
|
|
556
|
+
...capabilities.describe(operation, caller),
|
|
557
|
+
idempotencyKey: key ?? randomUUID()
|
|
558
|
+
})));
|
|
559
|
+
} catch (error) {
|
|
560
|
+
return capabilityHttpError(c, error);
|
|
561
|
+
}
|
|
515
562
|
});
|
|
516
563
|
authenticated.get("/api/notes/:id/history", async (c) => {
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
564
|
+
try {
|
|
565
|
+
return c.json(await invokeRead(c, "xopc.notes.history", { id: c.req.param("id") }));
|
|
566
|
+
} catch (error) {
|
|
567
|
+
return capabilityHttpError(c, error);
|
|
568
|
+
}
|
|
520
569
|
});
|
|
521
570
|
authenticated.get("/api/notes/:id/history/:timestamp", async (c) => {
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
571
|
+
try {
|
|
572
|
+
return c.json(await invokeRead(c, "xopc.notes.snapshot", {
|
|
573
|
+
id: c.req.param("id"),
|
|
574
|
+
timestamp: Number(c.req.param("timestamp"))
|
|
575
|
+
}));
|
|
576
|
+
} catch (error) {
|
|
577
|
+
return capabilityHttpError(c, error);
|
|
578
|
+
}
|
|
528
579
|
});
|
|
529
580
|
authenticated.post("/api/notes/:id/history/restore", async (c) => {
|
|
530
581
|
const id = c.req.param("id");
|
|
531
582
|
const body = await c.req.json().catch(() => ({}));
|
|
532
583
|
const timestamp = typeof body.timestamp === "number" ? body.timestamp : 0;
|
|
533
584
|
if (!timestamp) return c.json({ error: "Missing required field: timestamp" }, 400);
|
|
534
|
-
const
|
|
535
|
-
if (!
|
|
536
|
-
return c.json({
|
|
585
|
+
const current = await service.notesServiceInstance.getNote(id);
|
|
586
|
+
if (!current) return c.json(noteNotFound(), 404);
|
|
587
|
+
if (c.req.header("idempotency-key") && body.expectedRevision === void 0) return c.json({
|
|
588
|
+
ok: false,
|
|
589
|
+
error: {
|
|
590
|
+
code: "INVALID_INPUT",
|
|
591
|
+
message: "Idempotent restore requires expectedRevision from the original read"
|
|
592
|
+
}
|
|
593
|
+
}, 400);
|
|
594
|
+
try {
|
|
595
|
+
return c.json(await invokeNote(c, "xopc.notes.restore", {
|
|
596
|
+
id,
|
|
597
|
+
timestamp,
|
|
598
|
+
expectedRevision: body.expectedRevision ?? current.remoteVersion ?? 1
|
|
599
|
+
}, readIdempotencyKey(c.req.header("idempotency-key"))));
|
|
600
|
+
} catch (error) {
|
|
601
|
+
return capabilityHttpError(c, error);
|
|
602
|
+
}
|
|
537
603
|
});
|
|
538
604
|
authenticated.post("/api/notes/:id/ai/edit", async (c) => {
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
605
|
+
try {
|
|
606
|
+
const body = await c.req.json().catch(() => {
|
|
607
|
+
throw new CapabilityError("INVALID_INPUT", "Invalid JSON body");
|
|
608
|
+
});
|
|
609
|
+
return c.json(await capabilities.call("xopc.notes.preview_edit", {
|
|
610
|
+
...body,
|
|
611
|
+
id: c.req.param("id")
|
|
612
|
+
}, capabilityHttpContext(c)));
|
|
613
|
+
} catch (error) {
|
|
614
|
+
return capabilityHttpError(c, error);
|
|
615
|
+
}
|
|
547
616
|
});
|
|
548
617
|
authenticated.post("/api/notes/:id/media", async (c) => {
|
|
549
618
|
const noteId = c.req.param("id");
|