@xopcai/xopc 0.0.176 → 0.0.178
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-DsFM1upC.js → activity-store-BzGX__8I.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DvdMLOga.js → agent-avatar-dicebear-BzxntcaZ.js} +1 -1
- package/dist/gateway/static/root/assets/agents-DC9F12Kw.js +2 -0
- package/dist/gateway/static/root/assets/{api-BdPLCCBm.js → api-hi6f2Xtp.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-DMLDOHul.js → app-management-settings-panel-fTY1F7ac.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-DbI9foFR.js → appearance-settings-BZ-IxQfB.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-5bKr05Fa.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-Dfdxuwvb.js → archive-plugin-ZSLLG8wB.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-Dn3RlnYD.js → attachment-load-D4YktqIF.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-suggestion-card-Bc0Y7A9u.js → automation-suggestion-card-B7mxFRtf.js} +1 -1
- package/dist/gateway/static/root/assets/automations-page-Dg6dmt5g.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-0XtB-xC0.js → binary-plugins-BIkPxfxj.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-C4fXWbEE.js → block-editor-Q3v_YQom.js} +6 -6
- package/dist/gateway/static/root/assets/{browser-settings-page-lC86-drr.js → browser-settings-page-BHoo6Rpq.js} +4 -4
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-CZmzNymN.js → browser-workflow-inputs-M5lTEW1I.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-CBYM9HqG.js → browser-workflows-page-B3T1KYk4.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-BlsqN8Fu.js +7 -0
- package/dist/gateway/static/root/assets/{capability-presets-api-BiJxmmhW.js → capability-presets-api-DE09c0VB.js} +1 -1
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-DJeT8_B4.js +1 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-BKTUZDp-.js → channel-recipient-api-CFR5FBfS.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-C4VVjYEm.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-vdf8kB16.js +1 -0
- package/dist/gateway/static/root/assets/{connector-logo-Pr4RIKjj.js → connector-logo-B1mD-3pM.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-DNcrDThX.js +2 -0
- package/dist/gateway/static/root/assets/desktop-pet-B1urphOZ.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-settings-CEQacUDF.js → desktop-pet-settings-DTL6J3EP.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-DWnxdZtc.js → directory-picker-path-field-BYQJ2XUS.js} +1 -1
- package/dist/gateway/static/root/assets/{dreaming-settings-D2e2w2Ho.js → dreaming-settings-BXcb8fwx.js} +3 -3
- package/dist/gateway/static/root/assets/{extension-debug-page-BLjTGbv3.js → extension-debug-page-O1Xu1r4Q.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-D2_UC6hy.js → extension-page-C2Jraq8l.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BsH6o_PX.js → extension-settings-page-DcXQDTpG.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-C-DkC6UJ.js → gateway-config-api-DmPIZrvg.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-DEOGiimF.js → gateway-settings-DmObBx9b.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-BlSLh1TF.js → gateway-startup-retry-BZEkOdPm.js} +1 -1
- package/dist/gateway/static/root/assets/{goal-create-dialog-CSFcRE_N.js → goal-create-dialog-BRhmmBe9.js} +1 -1
- package/dist/gateway/static/root/assets/goal-detail-page-C1k7_s_O.js +4 -0
- package/dist/gateway/static/root/assets/{goals-config-api-CcdS9qek.js → goals-config-api-Fwu1wjEP.js} +1 -1
- package/dist/gateway/static/root/assets/{goals-page-BAcErdch.js → goals-page-hOu9uA3q.js} +2 -2
- package/dist/gateway/static/root/assets/{goals-settings-BY7crl0z.js → goals-settings-DY-JjvHz.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-DtTkS0gs.js → heartbeat-settings-BtKu2NWT.js} +1 -1
- package/dist/gateway/static/root/assets/{image-generation-api-WGgkbwDZ.js → image-generation-api-05Gg8wsU.js} +1 -1
- package/dist/gateway/static/root/assets/{index-2UImfRDC.js → index-C0CGebQ1.js} +65 -65
- package/dist/gateway/static/root/assets/index-eqq25gvV.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-C5lpWQ3f.js → keyboard-shortcuts-settings-CfmDR9Sc.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-EjsNT7nJ.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-b05wWvXG.js → local-apps-page-Df8BW1A_.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-sToMfHX_.js → locale-store-CTwSy7yW.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-cDE1jLJv.js → logs-page-Dswjlraa.js} +3 -3
- package/dist/gateway/static/root/assets/{markdown-split-0gPVst5y.js → markdown-split-B3FvKbaP.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-Rxyq_KTm.js → media-plugins-DsjrvvB6.js} +1 -1
- package/dist/gateway/static/root/assets/messages-DP6tPKk-.js +3 -0
- package/dist/gateway/static/root/assets/{notes-page-DRhNDl_Q.js → notes-page-tuzIwy3c.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-DSh3-hMY.js +4 -0
- package/dist/gateway/static/root/assets/{page-tabs-cOEOQqHh.js → page-tabs-ke9s4nYi.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-BopOLFvu.js → preview-open-alternatives-Cp1eI4S9.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-DWVPmmOq.js → product-open-page-dXQCMAtH.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-D0QPRHR_.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-CI5Vz62F.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-S1jpzBS5.js +1 -0
- package/dist/gateway/static/root/assets/{save-bar-controls-BfZmKe1t.js → save-bar-controls-Bl30zjHc.js} +1 -1
- package/dist/gateway/static/root/assets/{schedule-field-Cpi4jCRV.js → schedule-field-DqhmXQKo.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-OXFkcZQe.js → schema-form-DkUCy6vf.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-CTm66k7h.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-CU52AUVD.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-BwqkZCHJ.js → settings-form-section-C6ZbNpdy.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-BbqH_S3Y.js → settings-loading-skeleton-Bk58_cr7.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-BoxC-JSa.js → settings-page-k8iE_NdX.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-Ddu2iGaW.js → settings-page-layout-DgFSya2e.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-z1Lwv0js.js → setup-status-panel-B_KDlyZA.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-CVazOFjy.js → share-preview-page-CV7nL_J9.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-DK6XK95e.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-Bvv_u4ii.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-BGHvVbay.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-DgyB1tSo.js → skills-page.utils-kahBIHg0.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-BoLSQL65.js → system-settings-panel-JV3-MG5F.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-CBNcGOfj.js → theme-store-DFLyzoLO.js} +1 -1
- package/dist/gateway/static/root/assets/{time-picker-gochWrny.js → time-picker-XwpxdZFr.js} +1 -1
- package/dist/gateway/static/root/assets/{typed-models-lib-DvRnr7YB.js → typed-models-lib-60Aqo-UJ.js} +1 -1
- package/dist/gateway/static/root/assets/{use-channel-catalog-CA9BFVB7.js → use-channel-catalog-CnTkHDnw.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-DBCMk-Vn.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-v8tgylEZ.js → voice-api-key-field-CNa8qUgS.js} +1 -1
- package/dist/gateway/static/root/assets/work-discovery-page-C1UIdsCl.js +1 -0
- package/dist/gateway/static/root/assets/work-item-detail-page-DEAQepB8.js +1 -0
- package/dist/gateway/static/root/assets/work-page-D5qYmCTq.js +3 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-CC3cJn5k.js → workflow-run-setup-panel-yV_x595t.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-yrK17ZZ5.js +11 -0
- package/dist/gateway/static/root/index.html +7 -7
- package/dist/package.js +1 -1
- package/dist/src/agent/embedded/model-runtime.js +3 -0
- package/dist/src/agent/embedded/run-for-session.js +18 -5
- package/dist/src/agent/embedded/run-turn.js +6 -3
- package/dist/src/agent/embedded/types.d.ts +2 -0
- package/dist/src/automations/service/automation-service.d.ts +3 -0
- package/dist/src/automations/service/automation-service.js +37 -7
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
- package/dist/src/cli/commands/update.js +1 -1
- package/dist/src/connectors/composio-sessions.js +1 -1
- package/dist/src/gateway/hono/routes/home.d.ts +18 -2
- package/dist/src/gateway/hono/routes/home.js +19 -0
- package/dist/src/gateway/hono/routes/index.js +2 -2
- package/dist/src/gateway/hono/routes/local-apps.js +1 -1
- package/dist/src/gateway/hono/routes/proactive.d.ts +4 -0
- package/dist/src/gateway/hono/routes/proactive.js +157 -0
- package/dist/src/gateway/hono/routes/projects.js +2 -2
- package/dist/src/gateway/hono/routes/update.js +2 -2
- package/dist/src/gateway/index.js +1 -1
- package/dist/src/gateway/run-loop.js +1 -1
- package/dist/src/gateway/service.d.ts +10 -1
- package/dist/src/gateway/service.js +36 -36
- package/dist/src/infra/gateway-processes.js +1 -1
- package/dist/src/infra/update-restart.js +1 -1
- package/dist/src/infra/update-runner.js +2 -2
- package/dist/src/infra/update-startup.js +1 -1
- package/dist/src/mcp/channel-bridge.js +1 -1
- package/dist/src/mobile/notification-service.d.ts +1 -0
- package/dist/src/mobile/notification-service.js +38 -18
- package/dist/src/mobile/notification-types.d.ts +2 -2
- package/dist/src/proactive/events/envelope.d.ts +2 -0
- package/dist/src/proactive/events/envelope.js +54 -0
- package/dist/src/proactive/events/publisher.d.ts +4 -0
- package/dist/src/proactive/events/repository.d.ts +9 -0
- package/dist/src/proactive/events/repository.js +62 -0
- package/dist/src/proactive/events/types.d.ts +44 -0
- package/dist/src/proactive/events/types.js +15 -0
- package/dist/src/proactive/execution/agent-executor.d.ts +16 -0
- package/dist/src/proactive/execution/agent-executor.js +104 -0
- package/dist/src/proactive/execution/context.d.ts +31 -0
- package/dist/src/proactive/execution/context.js +72 -0
- package/dist/src/proactive/execution/insight.d.ts +4 -0
- package/dist/src/proactive/execution/insight.js +74 -0
- package/dist/src/proactive/execution/repository.d.ts +23 -0
- package/dist/src/proactive/execution/repository.js +122 -0
- package/dist/src/proactive/execution/types.d.ts +54 -0
- package/dist/src/proactive/execution/types.js +1 -0
- package/dist/src/proactive/execution/worker.d.ts +15 -0
- package/dist/src/proactive/execution/worker.js +96 -0
- package/dist/src/proactive/inbox/repository.d.ts +24 -0
- package/dist/src/proactive/inbox/repository.js +117 -0
- package/dist/src/proactive/inbox/service.d.ts +17 -0
- package/dist/src/proactive/inbox/service.js +22 -0
- package/dist/src/proactive/inbox/types.d.ts +38 -0
- package/dist/src/proactive/inbox/types.js +1 -0
- package/dist/src/proactive/inbox/worker.d.ts +12 -0
- package/dist/src/proactive/inbox/worker.js +56 -0
- package/dist/src/proactive/index.d.ts +17 -0
- package/dist/src/proactive/index.js +11 -0
- package/dist/src/proactive/routing/batch-repository.d.ts +27 -0
- package/dist/src/proactive/routing/batch-repository.js +56 -0
- package/dist/src/proactive/routing/matcher.d.ts +5 -0
- package/dist/src/proactive/routing/matcher.js +56 -0
- package/dist/src/proactive/routing/types.d.ts +44 -0
- package/dist/src/proactive/routing/types.js +1 -0
- package/dist/src/proactive/scenarios/prompt-composer.d.ts +14 -0
- package/dist/src/proactive/scenarios/prompt-composer.js +24 -0
- package/dist/src/proactive/scenarios/repository.d.ts +23 -0
- package/dist/src/proactive/scenarios/repository.js +162 -0
- package/dist/src/proactive/scenarios/service.d.ts +15 -0
- package/dist/src/proactive/scenarios/service.js +26 -0
- package/dist/src/proactive/scenarios/types.d.ts +36 -0
- package/dist/src/proactive/scenarios/types.js +1 -0
- package/dist/src/proactive/service.d.ts +18 -0
- package/dist/src/proactive/service.js +61 -0
- package/dist/src/projects/project-service.d.ts +3 -1
- package/dist/src/projects/project-service.js +62 -32
- package/dist/src/providers/provider-auth-service.js +3 -0
- package/dist/src/providers/register-bundled-oauth-flows.d.ts +2 -0
- package/dist/src/providers/register-bundled-oauth-flows.js +16 -0
- package/dist/src/session/store.d.ts +2 -0
- package/dist/src/session/store.js +30 -0
- package/dist/src/storage/sqlite/migrations/068_proactive_event_spine.sql +71 -0
- package/dist/src/storage/sqlite/migrations/069_proactive_scenario_control.sql +69 -0
- package/dist/src/storage/sqlite/migrations/070_proactive_execution.sql +55 -0
- package/dist/src/storage/sqlite/migrations/071_proactive_inbox.sql +45 -0
- package/dist/src/storage/sqlite/migrations/072_proactive_judgments.sql +14 -0
- package/dist/src/storage/sqlite/migrations/073_enable_default_proactive_scenarios.sql +13 -0
- package/dist/src/storage/sqlite/migrations/074_deduplicate_blocked_work_routing.sql +5 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/migrations/runner.ts +1 -1
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/work-discovery/thread-service.d.ts +1 -3
- package/dist/src/work-discovery/thread-service.js +13 -25
- package/dist/src/work-items/work-item-service.d.ts +3 -1
- package/dist/src/work-items/work-item-service.js +67 -36
- package/package.json +3 -11
- package/dist/gateway/static/root/assets/agents-BVjlpbeZ.js +0 -2
- package/dist/gateway/static/root/assets/api-Bop4IQRW.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-njqxLWYD.js +0 -1
- package/dist/gateway/static/root/assets/automations-page-D-eweHZJ.js +0 -6
- package/dist/gateway/static/root/assets/capabilities-settings-panel-6tYNfHqJ.js +0 -7
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-Co-ymbd9.js +0 -1
- package/dist/gateway/static/root/assets/channels-settings-D46eVjaQ.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-BMRAO4zZ.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-Dw1eYbRi.js +0 -2
- package/dist/gateway/static/root/assets/copy-VueTIC2x.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-B8cZuQUt.js +0 -1
- package/dist/gateway/static/root/assets/focus-detail-page-BBXUtxRB.js +0 -1
- package/dist/gateway/static/root/assets/goal-detail-page-VjRArfAJ.js +0 -4
- package/dist/gateway/static/root/assets/index-CS9sVShT.css +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-Cl0fcPL4.js +0 -2
- package/dist/gateway/static/root/assets/messages-CarlxqXV.js +0 -3
- package/dist/gateway/static/root/assets/notes-workbench-BKNBk0Uf.js +0 -4
- package/dist/gateway/static/root/assets/project-detail-page-BhjEXNQW.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-B80e69PH.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CwdVob6H.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-BGt3Asj6.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BnTdM9Nn.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-C4lXuyQj.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DSuIDkeI.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-xgZczqVe.js +0 -2
- package/dist/gateway/static/root/assets/user-context-page-CEfIy4WZ.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-page-B-3MClaf.js +0 -1
- package/dist/gateway/static/root/assets/work-item-detail-page-CEsFEdax.js +0 -1
- package/dist/gateway/static/root/assets/work-page-CT9AHnq6.js +0 -3
- package/dist/gateway/static/root/assets/workflows-page-C-1-_Zp1.js +0 -11
- package/dist/src/focuses/candidate-repository.d.ts +0 -15
- package/dist/src/focuses/candidate-repository.js +0 -91
- package/dist/src/focuses/index.d.ts +0 -7
- package/dist/src/focuses/index.js +0 -7
- package/dist/src/focuses/insight-repository.d.ts +0 -22
- package/dist/src/focuses/insight-repository.js +0 -77
- package/dist/src/focuses/prompts.d.ts +0 -2
- package/dist/src/focuses/prompts.js +0 -18
- package/dist/src/focuses/reconciler.d.ts +0 -5
- package/dist/src/focuses/reconciler.js +0 -26
- package/dist/src/focuses/repository.d.ts +0 -61
- package/dist/src/focuses/repository.js +0 -214
- package/dist/src/focuses/run-processor.d.ts +0 -18
- package/dist/src/focuses/run-processor.js +0 -162
- package/dist/src/focuses/service.d.ts +0 -42
- package/dist/src/focuses/service.js +0 -241
- package/dist/src/focuses/types.d.ts +0 -89
- package/dist/src/gateway/hono/routes/focuses.d.ts +0 -3
- package/dist/src/gateway/hono/routes/focuses.js +0 -319
- /package/dist/src/{focuses/types.js → proactive/events/publisher.js} +0 -0
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png?v=20260713-1" />
|
|
12
12
|
<link rel="manifest" href="/site.webmanifest?v=20260713-1" />
|
|
13
13
|
<title>XOPC — Turn goals into loops. Keep what matters moving.</title>
|
|
14
|
-
<script type="module" crossorigin src="/assets/index-
|
|
14
|
+
<script type="module" crossorigin src="/assets/index-C0CGebQ1.js"></script>
|
|
15
15
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-aKtaBQYM.js">
|
|
16
16
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-zJ_50EbN.js">
|
|
17
17
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react-BOUWij0V.js">
|
|
@@ -24,17 +24,17 @@
|
|
|
24
24
|
<link rel="modulepreload" crossorigin href="/assets/check-DUBLcKHA.js">
|
|
25
25
|
<link rel="modulepreload" crossorigin href="/assets/circle-alert-BEjgurr2.js">
|
|
26
26
|
<link rel="modulepreload" crossorigin href="/assets/middleware-Pd0e8Igk.js">
|
|
27
|
-
<link rel="modulepreload" crossorigin href="/assets/messages-
|
|
28
|
-
<link rel="modulepreload" crossorigin href="/assets/locale-store-
|
|
27
|
+
<link rel="modulepreload" crossorigin href="/assets/messages-DP6tPKk-.js">
|
|
28
|
+
<link rel="modulepreload" crossorigin href="/assets/locale-store-CTwSy7yW.js">
|
|
29
29
|
<link rel="modulepreload" crossorigin href="/assets/cn-JdwAhgNB.js">
|
|
30
30
|
<link rel="modulepreload" crossorigin href="/assets/schemas-DgQq6Z5S.js">
|
|
31
31
|
<link rel="modulepreload" crossorigin href="/assets/product-delivery-BTRT9kCS.js">
|
|
32
32
|
<link rel="modulepreload" crossorigin href="/assets/config-reload-event-Bjh2zoKp.js">
|
|
33
33
|
<link rel="modulepreload" crossorigin href="/assets/copy-to-clipboard-HOJ79TWv.js">
|
|
34
|
-
<link rel="modulepreload" crossorigin href="/assets/gateway-startup-retry-
|
|
35
|
-
<link rel="modulepreload" crossorigin href="/assets/activity-store-
|
|
36
|
-
<link rel="modulepreload" crossorigin href="/assets/theme-store-
|
|
37
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
34
|
+
<link rel="modulepreload" crossorigin href="/assets/gateway-startup-retry-BZEkOdPm.js">
|
|
35
|
+
<link rel="modulepreload" crossorigin href="/assets/activity-store-BzGX__8I.js">
|
|
36
|
+
<link rel="modulepreload" crossorigin href="/assets/theme-store-DFLyzoLO.js">
|
|
37
|
+
<link rel="stylesheet" crossorigin href="/assets/index-eqq25gvV.css">
|
|
38
38
|
</head>
|
|
39
39
|
<body>
|
|
40
40
|
<div id="root"></div>
|
package/dist/package.js
CHANGED
|
@@ -2,6 +2,7 @@ import { init_paths, resolveModelsJsonPath } from "../../config/paths.js";
|
|
|
2
2
|
import { init_sync_provider_auth, resolveProviderApiKeySync } from "../../auth/sync-provider-auth.js";
|
|
3
3
|
import { CredentialResolver, init_credentials } from "../../auth/credentials.js";
|
|
4
4
|
import { XopcModelCredentialStore, init_model_credential_store } from "../../auth/model-credential-store.js";
|
|
5
|
+
import { init_register_bundled_oauth_flows, registerBundledOAuthFlows } from "../../providers/register-bundled-oauth-flows.js";
|
|
5
6
|
import { init_register_runtime_providers, registerRuntimeProviders } from "../../providers/register-runtime-providers.js";
|
|
6
7
|
import { getApiKeySync, init_providers } from "../../providers/index.js";
|
|
7
8
|
import { InMemoryModelsStore } from "@earendil-works/pi-ai";
|
|
@@ -12,11 +13,13 @@ init_model_credential_store();
|
|
|
12
13
|
init_sync_provider_auth();
|
|
13
14
|
init_paths();
|
|
14
15
|
init_providers();
|
|
16
|
+
init_register_bundled_oauth_flows();
|
|
15
17
|
init_register_runtime_providers();
|
|
16
18
|
function resolveEmbeddedProviderApiKeySync(providerId) {
|
|
17
19
|
return resolveProviderApiKeySync(providerId) ?? getApiKeySync(providerId);
|
|
18
20
|
}
|
|
19
21
|
async function createEmbeddedModelRuntime(providerId) {
|
|
22
|
+
registerBundledOAuthFlows();
|
|
20
23
|
const resolver = new CredentialResolver();
|
|
21
24
|
const credentials = new XopcModelCredentialStore(resolver);
|
|
22
25
|
const modelRuntime = await ModelRuntime.create({
|
|
@@ -91,13 +91,15 @@ async function runEmbeddedTurnForSession(params) {
|
|
|
91
91
|
}, "Agent model fallback candidates resolved");
|
|
92
92
|
let lastResult;
|
|
93
93
|
let lastError;
|
|
94
|
+
let resumeLastUserMessage = false;
|
|
94
95
|
const primaryModelRef = modelRef;
|
|
95
|
-
const beforeLen = Array.isArray(agent.state?.messages) ? agent.state.messages.length : void 0;
|
|
96
96
|
for (let i = 0; i < resolvedCandidates.length; i++) {
|
|
97
97
|
const candidate = resolvedCandidates[i];
|
|
98
98
|
const candidateModelRef = candidate.ref;
|
|
99
99
|
const isFallbackAttempt = i > 0;
|
|
100
100
|
const candidateModel = candidate.model;
|
|
101
|
+
const hasNextCandidate = i + 1 < resolvedCandidates.length;
|
|
102
|
+
const rowsBeforeAttempt = hasNextCandidate ? await sessionStore.loadTranscriptRows(sessionKey) : void 0;
|
|
101
103
|
if (typeof mm.applyResolvedModel === "function") mm.applyResolvedModel(agent, candidateModel, candidateModelRef);
|
|
102
104
|
agentManager.setModelForSession(sessionKey, candidateModelRef);
|
|
103
105
|
if (isFallbackAttempt) log.info({
|
|
@@ -123,7 +125,8 @@ async function runEmbeddedTurnForSession(params) {
|
|
|
123
125
|
sessionStore,
|
|
124
126
|
timeoutMs: resolveAgentTurnTimeoutMs(config),
|
|
125
127
|
abortSignal: params.abortSignal,
|
|
126
|
-
onEvent: params.onEvent
|
|
128
|
+
onEvent: params.onEvent,
|
|
129
|
+
resumeLastUserMessage
|
|
127
130
|
});
|
|
128
131
|
if (turnResult.ok) {
|
|
129
132
|
if (isFallbackAttempt) log.info({
|
|
@@ -137,7 +140,6 @@ async function runEmbeddedTurnForSession(params) {
|
|
|
137
140
|
return turnResult;
|
|
138
141
|
}
|
|
139
142
|
lastResult = turnResult;
|
|
140
|
-
const hasNextCandidate = i + 1 < resolvedCandidates.length;
|
|
141
143
|
log.warn({
|
|
142
144
|
sessionKey,
|
|
143
145
|
runId,
|
|
@@ -150,7 +152,6 @@ async function runEmbeddedTurnForSession(params) {
|
|
|
150
152
|
} catch (err) {
|
|
151
153
|
lastError = err;
|
|
152
154
|
if (err instanceof DOMException && err.name === "AbortError") throw err;
|
|
153
|
-
const hasNextCandidate = i + 1 < resolvedCandidates.length;
|
|
154
155
|
log.warn({
|
|
155
156
|
err,
|
|
156
157
|
sessionKey,
|
|
@@ -161,7 +162,19 @@ async function runEmbeddedTurnForSession(params) {
|
|
|
161
162
|
hasNextCandidate
|
|
162
163
|
}, hasNextCandidate ? "Agent model call threw, trying fallback" : "Agent model call threw, no fallback remains");
|
|
163
164
|
}
|
|
164
|
-
if (
|
|
165
|
+
if (hasNextCandidate && rowsBeforeAttempt) {
|
|
166
|
+
const preparation = await sessionStore.prepareModelFallback(sessionKey, rowsBeforeAttempt);
|
|
167
|
+
if (preparation === "unsafe") {
|
|
168
|
+
log.warn({
|
|
169
|
+
sessionKey,
|
|
170
|
+
runId,
|
|
171
|
+
modelRef: candidateModelRef,
|
|
172
|
+
attempt: i + 1
|
|
173
|
+
}, "Agent model fallback skipped because the failed attempt changed the transcript");
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
resumeLastUserMessage = preparation === "resume";
|
|
177
|
+
}
|
|
165
178
|
}
|
|
166
179
|
if (lastResult) return lastResult;
|
|
167
180
|
if (lastError instanceof Error) throw lastError;
|
|
@@ -206,9 +206,12 @@ async function runXopcEmbeddedTurn(params) {
|
|
|
206
206
|
}
|
|
207
207
|
try {
|
|
208
208
|
await runAgentTurnWithTimeout(session.agent, async () => {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
209
|
+
if (params.resumeLastUserMessage) await session.agent.continue();
|
|
210
|
+
else {
|
|
211
|
+
const text = userMessageToPromptText(userMessage);
|
|
212
|
+
const images = params.images ?? [];
|
|
213
|
+
await session.prompt(text, images.length > 0 ? { images } : void 0);
|
|
214
|
+
}
|
|
212
215
|
await session.agent.waitForIdle();
|
|
213
216
|
await maybeRetryTurnAfterTransientLlmFailure(session.agent, {
|
|
214
217
|
sessionKey,
|
|
@@ -89,6 +89,8 @@ export type RunXopcEmbeddedTurnParams = {
|
|
|
89
89
|
abortSignal?: AbortSignal;
|
|
90
90
|
onEvent?: (event: EmbeddedStreamEvent) => void;
|
|
91
91
|
images?: ImageContent[];
|
|
92
|
+
/** Continue from the persisted trailing user row instead of appending it again. */
|
|
93
|
+
resumeLastUserMessage?: boolean;
|
|
92
94
|
};
|
|
93
95
|
export type RunXopcEmbeddedTurnResult = {
|
|
94
96
|
ok: boolean;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ProactiveSignalPublisher } from '../../proactive/events/publisher.js';
|
|
1
2
|
import type { Automation, AutomationDeps, AutomationEvent, AutomationMetrics, AutomationProductEventRun, AutomationRun, AutomationRunEvent } from '../domain/types.js';
|
|
2
3
|
import { type CreateAutomationInput, type UpdateAutomationInput } from '../domain/validation.js';
|
|
3
4
|
export declare class AutomationAlreadyRunningError extends Error {
|
|
@@ -6,6 +7,7 @@ export declare class AutomationAlreadyRunningError extends Error {
|
|
|
6
7
|
constructor(automationId: string, runningRunId?: string);
|
|
7
8
|
}
|
|
8
9
|
export declare class AutomationService {
|
|
10
|
+
private readonly signals?;
|
|
9
11
|
private readonly executor;
|
|
10
12
|
private timer;
|
|
11
13
|
private stopped;
|
|
@@ -13,6 +15,7 @@ export declare class AutomationService {
|
|
|
13
15
|
private deps;
|
|
14
16
|
private maxConcurrentRuns;
|
|
15
17
|
private readonly activeRuns;
|
|
18
|
+
constructor(signals?: ProactiveSignalPublisher);
|
|
16
19
|
setDeps(deps: AutomationDeps): void;
|
|
17
20
|
initialize(options?: {
|
|
18
21
|
maxConcurrentRuns?: number;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
+
import { runSqliteWriteTransaction } from "../../storage/sqlite/transaction.js";
|
|
3
4
|
import { computeNextAutomationRunAtMs, timerDelayUntil } from "../domain/schedule.js";
|
|
4
5
|
import { AutomationSchema, CreateAutomationSchema, UpdateAutomationSchema } from "../domain/validation.js";
|
|
5
6
|
import { AutomationActionExecutor } from "./action-executor.js";
|
|
@@ -28,6 +29,9 @@ var AutomationService = class {
|
|
|
28
29
|
deps = {};
|
|
29
30
|
maxConcurrentRuns = DEFAULT_MAX_CONCURRENT_RUNS;
|
|
30
31
|
activeRuns = /* @__PURE__ */ new Map();
|
|
32
|
+
constructor(signals) {
|
|
33
|
+
this.signals = signals;
|
|
34
|
+
}
|
|
31
35
|
setDeps(deps) {
|
|
32
36
|
this.deps = {
|
|
33
37
|
...this.deps,
|
|
@@ -321,14 +325,40 @@ var AutomationService = class {
|
|
|
321
325
|
endedAtMs,
|
|
322
326
|
durationMs: endedAtMs - startedAtMs
|
|
323
327
|
};
|
|
324
|
-
saveAutomationRun(run);
|
|
325
|
-
this.appendRunEvent(run, "run.completed", `Automation run ${status}`, {
|
|
326
|
-
status,
|
|
327
|
-
durationMs: run.durationMs,
|
|
328
|
-
error
|
|
329
|
-
});
|
|
330
328
|
this.activeRuns.delete(initialRun.id);
|
|
331
|
-
|
|
329
|
+
runSqliteWriteTransaction(() => {
|
|
330
|
+
saveAutomationRun(run);
|
|
331
|
+
this.appendRunEvent(run, "run.completed", `Automation run ${status}`, {
|
|
332
|
+
status,
|
|
333
|
+
durationMs: run.durationMs,
|
|
334
|
+
error
|
|
335
|
+
});
|
|
336
|
+
this.finishAutomationRun(automation.id, status, error, endedAtMs);
|
|
337
|
+
if (status === "failed" || status === "timeout") this.signals?.publish({
|
|
338
|
+
type: "automation.run_failed.v1",
|
|
339
|
+
schemaVersion: 1,
|
|
340
|
+
source: {
|
|
341
|
+
kind: "automations",
|
|
342
|
+
id: automation.id
|
|
343
|
+
},
|
|
344
|
+
subject: {
|
|
345
|
+
kind: "automation_run",
|
|
346
|
+
id: run.id
|
|
347
|
+
},
|
|
348
|
+
actor: { kind: "system" },
|
|
349
|
+
scope: { workspaceId: "default" },
|
|
350
|
+
occurredAt: new Date(endedAtMs).toISOString(),
|
|
351
|
+
dedupeKey: `automation_run:${run.id}:failed`,
|
|
352
|
+
sensitivity: "personal",
|
|
353
|
+
payload: {
|
|
354
|
+
automationId: automation.id,
|
|
355
|
+
status,
|
|
356
|
+
error,
|
|
357
|
+
summary: run.summary,
|
|
358
|
+
durationMs: run.durationMs
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
});
|
|
332
362
|
try {
|
|
333
363
|
this.deps.onRunCompleted?.(run);
|
|
334
364
|
} catch (err) {
|
|
@@ -52,7 +52,7 @@ async function checkDatabaseSchema(ctx) {
|
|
|
52
52
|
id: "database-schema",
|
|
53
53
|
label: "Database schema",
|
|
54
54
|
status: "pass",
|
|
55
|
-
message: `SQLite schema v${status.dbVersion} (current release
|
|
55
|
+
message: `SQLite schema v${status.dbVersion} (current release v74).`,
|
|
56
56
|
hints: []
|
|
57
57
|
};
|
|
58
58
|
}
|
|
@@ -3,8 +3,8 @@ import { loadConfig } from "../../../config/loader.js";
|
|
|
3
3
|
import "../../../config/index.js";
|
|
4
4
|
import { isRestartEnabled } from "../../../config/commands.flags.js";
|
|
5
5
|
import { resolveGatewayService } from "../../../daemon/service.js";
|
|
6
|
-
import { findVerifiedGatewayListenerPidsOnPortSync, formatGatewayPidList, signalVerifiedGatewayPidSync } from "../../../infra/gateway-processes.js";
|
|
7
6
|
import { authorizeGatewaySigusr1Restart, writeGatewayRestartIntentSync } from "../../../infra/restart.js";
|
|
7
|
+
import { findVerifiedGatewayListenerPidsOnPortSync, formatGatewayPidList, signalVerifiedGatewayPidSync } from "../../../infra/gateway-processes.js";
|
|
8
8
|
import { runServiceRestart, runServiceStop } from "./lifecycle-core.js";
|
|
9
9
|
import { DEFAULT_RESTART_HEALTH_ATTEMPTS, renderGatewayPortHealthDiagnostics, waitForGatewayHealthyListener } from "./restart-health.js";
|
|
10
10
|
import { parsePortFromArgs, renderGatewayServiceStartHints, resolveGatewayPortFromConfig } from "./shared.js";
|
|
@@ -2,9 +2,9 @@ import { PACKAGE_VERSION, init_package_version } from "../../package-version.js"
|
|
|
2
2
|
import { loadConfig } from "../../config/loader.js";
|
|
3
3
|
import { formatExamples, register } from "../registry.js";
|
|
4
4
|
import "../../config/index.js";
|
|
5
|
+
import { acquireUpdateLock } from "../../infra/update-lock.js";
|
|
5
6
|
import { normalizeUpdateChannel } from "../../infra/update-channels.js";
|
|
6
7
|
import { compareSemver, resolveNpmChannelTag } from "../../infra/update-check.js";
|
|
7
|
-
import { acquireUpdateLock } from "../../infra/update-lock.js";
|
|
8
8
|
import { formatUpdateApiResult, resolveUpdateInstallSurface, runGatewayUpdateWithPostSteps } from "../../infra/update-runner.js";
|
|
9
9
|
import { Command } from "commander";
|
|
10
10
|
//#region src/cli/commands/update.ts
|
|
@@ -76,7 +76,7 @@ var ComposioSessionsAdapter = class {
|
|
|
76
76
|
try {
|
|
77
77
|
[{Composio}, {PiProvider}] = await Promise.all([import("@composio/core"), import("@composio/experimental")]);
|
|
78
78
|
} catch (cause) {
|
|
79
|
-
throw new Error("
|
|
79
|
+
throw new Error("The xopc installation is missing the bundled Composio runtime. Reinstall @xopcai/xopc and restart the gateway.", { cause });
|
|
80
80
|
}
|
|
81
81
|
return new Composio({
|
|
82
82
|
apiKey,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Hono } from 'hono';
|
|
2
2
|
import { type HomeAttentionSubjectKind } from '../../../storage/sqlite/index.js';
|
|
3
3
|
import type { AuthenticatedRouteDeps } from './deps.js';
|
|
4
|
-
type HomeDecisionKind = 'work_item' | 'goal' | 'connector_approval' | 'goal_evidence';
|
|
5
|
-
type HomeDecisionReason = 'needs_input' | 'in_review' | 'blocked' | 'overdue' | 'due_soon' | 'approval_required';
|
|
4
|
+
type HomeDecisionKind = 'agent_judgment' | 'work_item' | 'goal' | 'connector_approval' | 'goal_evidence';
|
|
5
|
+
type HomeDecisionReason = 'needs_input' | 'in_review' | 'blocked' | 'overdue' | 'due_soon' | 'decision_needed' | 'approval_required';
|
|
6
6
|
type HomeAttention = {
|
|
7
7
|
id: string;
|
|
8
8
|
kind: HomeAttentionSubjectKind;
|
|
@@ -25,6 +25,22 @@ type HomeDecision = {
|
|
|
25
25
|
projectId?: string;
|
|
26
26
|
projectName?: string;
|
|
27
27
|
updatedAt: number;
|
|
28
|
+
judgment?: {
|
|
29
|
+
inboxItemId: string;
|
|
30
|
+
whyNow: string;
|
|
31
|
+
impact: string;
|
|
32
|
+
workDone: string;
|
|
33
|
+
recommendation: string;
|
|
34
|
+
confidence: number;
|
|
35
|
+
decision?: {
|
|
36
|
+
question: string;
|
|
37
|
+
options: Array<{
|
|
38
|
+
id: string;
|
|
39
|
+
label: string;
|
|
40
|
+
consequence: string;
|
|
41
|
+
}>;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
28
44
|
response?: {
|
|
29
45
|
kind: 'connector_approval';
|
|
30
46
|
approvalId: string;
|
|
@@ -245,6 +245,25 @@ function registerHomeRoutes(authenticated, deps) {
|
|
|
245
245
|
const latestAutomationRuns = [...automationRuns].sort((left, right) => right.createdAtMs - left.createdAtMs).filter((run, index, all) => all.findIndex((candidate) => candidate.automationId === run.automationId) === index);
|
|
246
246
|
const automationsById = new Map(automations.map((automation) => [automation.id, automation]));
|
|
247
247
|
const decisions = [
|
|
248
|
+
...service.proactiveInbox.list({ limit: 20 }).filter((item) => item.status === "unread" || item.status === "read").map((item) => ({
|
|
249
|
+
id: `agent-judgment:${item.id}`,
|
|
250
|
+
kind: "agent_judgment",
|
|
251
|
+
title: item.insight.title,
|
|
252
|
+
detail: item.insight.summary,
|
|
253
|
+
reason: "decision_needed",
|
|
254
|
+
urgency: item.insight.urgency === "critical" || item.insight.urgency === "high" ? "now" : "soon",
|
|
255
|
+
href: `/work?judgment=${encodeURIComponent(item.id)}`,
|
|
256
|
+
updatedAt: Date.parse(item.updatedAt),
|
|
257
|
+
judgment: {
|
|
258
|
+
inboxItemId: item.id,
|
|
259
|
+
whyNow: item.insight.whyNow,
|
|
260
|
+
impact: item.insight.impact,
|
|
261
|
+
workDone: item.insight.workDone,
|
|
262
|
+
recommendation: item.insight.recommendation,
|
|
263
|
+
confidence: item.insight.confidence,
|
|
264
|
+
...item.insight.decision ? { decision: item.insight.decision } : {}
|
|
265
|
+
}
|
|
266
|
+
})),
|
|
248
267
|
...activeWorkItems.map((item) => decisionFromWorkItem(item, projectsById.get(item.projectId)?.name ?? "Project", nowMs)).filter((item) => Boolean(item)),
|
|
249
268
|
...activeGoals.map((goal) => decisionFromGoal(goal, goal.projectId ? projectsById.get(goal.projectId)?.name : void 0)).filter((item) => Boolean(item)),
|
|
250
269
|
...connectorApprovals.filter((approval) => Date.parse(approval.expiresAt) > nowMs).map((approval) => ({
|
|
@@ -12,7 +12,7 @@ import { registerInteractionStateRoutes } from "./interaction-state.js";
|
|
|
12
12
|
import { registerComposerHistoryRoutes } from "./composer-history.js";
|
|
13
13
|
import { registerLocalAppsRoutes } from "./local-apps.js";
|
|
14
14
|
import { registerWorkDiscoveryRoutes } from "./work-discovery.js";
|
|
15
|
-
import {
|
|
15
|
+
import { registerProactiveRoutes } from "./proactive.js";
|
|
16
16
|
import { mountAppLazyRoutePrefixes, registerAuthenticatedLazyRouteFallback } from "./lazy-fallback.js";
|
|
17
17
|
//#region src/gateway/hono/routes/index.ts
|
|
18
18
|
function registerCoreAuthenticatedRoutes(authenticated, deps) {
|
|
@@ -25,7 +25,7 @@ function registerCoreAuthenticatedRoutes(authenticated, deps) {
|
|
|
25
25
|
registerProjectSkillRoutes(authenticated, deps);
|
|
26
26
|
registerLocalAppsRoutes(authenticated, deps);
|
|
27
27
|
registerWorkDiscoveryRoutes(authenticated, deps);
|
|
28
|
-
|
|
28
|
+
registerProactiveRoutes(authenticated, deps);
|
|
29
29
|
registerSearchRoutes(authenticated, deps);
|
|
30
30
|
registerMobileRoutes(authenticated, deps);
|
|
31
31
|
registerTaskOutcomeRoutes(authenticated, deps);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readLocalAppAcceptanceConfig } from "../../../local-apps/acceptance.js";
|
|
2
|
-
import { LOCAL_APP_RUNTIME_BRIDGE_HASH, injectLocalAppRuntimeBridge } from "../../../local-apps/preview-runtime-bridge.js";
|
|
3
2
|
import { extensionAssetMimeType } from "../lib/extension-assets.js";
|
|
3
|
+
import { LOCAL_APP_RUNTIME_BRIDGE_HASH, injectLocalAppRuntimeBridge } from "../../../local-apps/preview-runtime-bridge.js";
|
|
4
4
|
import { relative, resolve } from "node:path";
|
|
5
5
|
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
6
6
|
//#region src/gateway/hono/routes/local-apps.ts
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Hono } from 'hono';
|
|
2
|
+
import type { AuthenticatedRouteDeps } from './deps.js';
|
|
3
|
+
/** User-facing judgment inbox plus internal diagnostics. There is intentionally no proactive control-panel API. */
|
|
4
|
+
export declare function registerProactiveRoutes(authenticated: Hono, deps: AuthenticatedRouteDeps): void;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
//#region src/gateway/hono/routes/proactive.ts
|
|
2
|
+
function positiveInt(value, fallback) {
|
|
3
|
+
const parsed = Number(value);
|
|
4
|
+
return Number.isInteger(parsed) && parsed > 0 ? parsed : fallback;
|
|
5
|
+
}
|
|
6
|
+
/** User-facing judgment inbox plus internal diagnostics. There is intentionally no proactive control-panel API. */
|
|
7
|
+
function registerProactiveRoutes(authenticated, deps) {
|
|
8
|
+
authenticated.get("/api/inbox/judgments", (c) => {
|
|
9
|
+
const status = c.req.query("status");
|
|
10
|
+
if (status && ![
|
|
11
|
+
"unread",
|
|
12
|
+
"read",
|
|
13
|
+
"snoozed",
|
|
14
|
+
"resolved"
|
|
15
|
+
].includes(status)) return c.json({
|
|
16
|
+
ok: false,
|
|
17
|
+
error: "Invalid inbox status"
|
|
18
|
+
}, 400);
|
|
19
|
+
return c.json({
|
|
20
|
+
ok: true,
|
|
21
|
+
items: deps.service.proactiveInbox.list({
|
|
22
|
+
...status ? { status } : {},
|
|
23
|
+
limit: positiveInt(c.req.query("limit"), 50)
|
|
24
|
+
})
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
authenticated.post("/api/inbox/judgments/:itemId/transition", deps.strictRateLimitMiddleware, async (c) => {
|
|
28
|
+
const body = await c.req.json().catch(() => null);
|
|
29
|
+
if (!body || ![
|
|
30
|
+
"unread",
|
|
31
|
+
"read",
|
|
32
|
+
"snoozed",
|
|
33
|
+
"resolved"
|
|
34
|
+
].includes(String(body.status))) return c.json({
|
|
35
|
+
ok: false,
|
|
36
|
+
error: "Valid status is required"
|
|
37
|
+
}, 400);
|
|
38
|
+
try {
|
|
39
|
+
return c.json({
|
|
40
|
+
ok: true,
|
|
41
|
+
item: deps.service.proactiveInbox.transition(c.req.param("itemId"), {
|
|
42
|
+
status: body.status,
|
|
43
|
+
...typeof body.snoozedUntil === "string" ? { snoozedUntil: body.snoozedUntil } : {},
|
|
44
|
+
...typeof body.resolution === "string" ? { resolution: body.resolution } : {}
|
|
45
|
+
})
|
|
46
|
+
});
|
|
47
|
+
} catch (error) {
|
|
48
|
+
return c.json({
|
|
49
|
+
ok: false,
|
|
50
|
+
error: error instanceof Error ? error.message : String(error)
|
|
51
|
+
}, 400);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
authenticated.post("/api/inbox/judgments/:itemId/decisions", deps.strictRateLimitMiddleware, async (c) => {
|
|
55
|
+
const body = await c.req.json().catch(() => null);
|
|
56
|
+
if (!body || typeof body.choice !== "string") return c.json({
|
|
57
|
+
ok: false,
|
|
58
|
+
error: "choice is required"
|
|
59
|
+
}, 400);
|
|
60
|
+
try {
|
|
61
|
+
return c.json({
|
|
62
|
+
ok: true,
|
|
63
|
+
item: deps.service.proactiveInbox.decide(c.req.param("itemId"), body.choice, typeof body.note === "string" ? body.note : "")
|
|
64
|
+
}, 201);
|
|
65
|
+
} catch (error) {
|
|
66
|
+
return c.json({
|
|
67
|
+
ok: false,
|
|
68
|
+
error: error instanceof Error ? error.message : String(error)
|
|
69
|
+
}, 400);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
authenticated.post("/api/inbox/judgments/:itemId/feedback", deps.strictRateLimitMiddleware, async (c) => {
|
|
73
|
+
const body = await c.req.json().catch(() => null);
|
|
74
|
+
if (!body || body.rating !== "useful" && body.rating !== "not_useful") return c.json({
|
|
75
|
+
ok: false,
|
|
76
|
+
error: "Valid rating is required"
|
|
77
|
+
}, 400);
|
|
78
|
+
try {
|
|
79
|
+
deps.service.proactiveInbox.feedback(c.req.param("itemId"), body.rating, typeof body.note === "string" ? body.note : "");
|
|
80
|
+
return c.json({ ok: true }, 201);
|
|
81
|
+
} catch (error) {
|
|
82
|
+
return c.json({
|
|
83
|
+
ok: false,
|
|
84
|
+
error: error instanceof Error ? error.message : String(error)
|
|
85
|
+
}, 400);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
authenticated.post("/api/inbox/judgments/:itemId/instructions", deps.strictRateLimitMiddleware, async (c) => {
|
|
89
|
+
const body = await c.req.json().catch(() => null);
|
|
90
|
+
if (!body || typeof body.instruction !== "string" || !body.instruction.trim()) return c.json({
|
|
91
|
+
ok: false,
|
|
92
|
+
error: "instruction is required"
|
|
93
|
+
}, 400);
|
|
94
|
+
try {
|
|
95
|
+
return c.json({
|
|
96
|
+
ok: true,
|
|
97
|
+
...deps.service.proactiveInbox.instruct(c.req.param("itemId"), body.instruction)
|
|
98
|
+
}, 201);
|
|
99
|
+
} catch (error) {
|
|
100
|
+
return c.json({
|
|
101
|
+
ok: false,
|
|
102
|
+
error: error instanceof Error ? error.message : String(error)
|
|
103
|
+
}, 400);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
authenticated.get("/api/internal/proactive/insights", (c) => c.json({
|
|
107
|
+
ok: true,
|
|
108
|
+
insights: deps.service.proactiveInsights()
|
|
109
|
+
}));
|
|
110
|
+
authenticated.get("/api/internal/proactive/scenarios", (c) => c.json({
|
|
111
|
+
ok: true,
|
|
112
|
+
scenarios: deps.service.proactiveScenarios.list(),
|
|
113
|
+
subscriptions: deps.service.proactiveScenarios.subscriptions()
|
|
114
|
+
}));
|
|
115
|
+
authenticated.post("/api/internal/proactive/events", deps.strictRateLimitMiddleware, async (c) => {
|
|
116
|
+
const body = await c.req.json().catch(() => null);
|
|
117
|
+
if (!body || typeof body !== "object" || Array.isArray(body)) return c.json({
|
|
118
|
+
ok: false,
|
|
119
|
+
error: "Event body must be an object"
|
|
120
|
+
}, 400);
|
|
121
|
+
try {
|
|
122
|
+
const result = deps.service.proactive.publish(body);
|
|
123
|
+
return c.json({
|
|
124
|
+
ok: true,
|
|
125
|
+
...result
|
|
126
|
+
}, result.inserted ? 201 : 200);
|
|
127
|
+
} catch (error) {
|
|
128
|
+
return c.json({
|
|
129
|
+
ok: false,
|
|
130
|
+
error: error instanceof Error ? error.message : String(error)
|
|
131
|
+
}, 400);
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
authenticated.get("/api/internal/proactive/events", (c) => {
|
|
135
|
+
const events = deps.service.proactive.listEvents({
|
|
136
|
+
limit: positiveInt(c.req.query("limit"), 50),
|
|
137
|
+
...c.req.query("type") ? { type: c.req.query("type") } : {}
|
|
138
|
+
}).map((event) => event.sensitivity === "public" || event.sensitivity === "personal" ? event : {
|
|
139
|
+
...event,
|
|
140
|
+
payload: { redacted: true }
|
|
141
|
+
});
|
|
142
|
+
return c.json({
|
|
143
|
+
ok: true,
|
|
144
|
+
events
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
authenticated.get("/api/internal/proactive/batches", (c) => c.json({
|
|
148
|
+
ok: true,
|
|
149
|
+
batches: deps.service.proactive.listBatches({ limit: positiveInt(c.req.query("limit"), 50) })
|
|
150
|
+
}));
|
|
151
|
+
authenticated.get("/api/internal/proactive/health", (c) => c.json({
|
|
152
|
+
ok: true,
|
|
153
|
+
health: deps.service.proactive.health()
|
|
154
|
+
}));
|
|
155
|
+
}
|
|
156
|
+
//#endregion
|
|
157
|
+
export { registerProactiveRoutes };
|
|
@@ -15,7 +15,7 @@ import { inferProjectKind } from "../../../projects/project-kind.js";
|
|
|
15
15
|
import { inferSuggestedProjectDefaultAgentId } from "../../../projects/project-agent-suggestion.js";
|
|
16
16
|
import { buildProjectLoopOverview } from "../../../projects/project-loop.js";
|
|
17
17
|
import "../../../projects/index.js";
|
|
18
|
-
import { WORK_ITEM_ATTACHMENT_MAX_BYTES
|
|
18
|
+
import { WORK_ITEM_ATTACHMENT_MAX_BYTES } from "../../../work-items/work-item-service.js";
|
|
19
19
|
import { buildWorkItemAgentContext } from "../../../work-items/agent-context.js";
|
|
20
20
|
import "../../../work-items/index.js";
|
|
21
21
|
import { createGatewayRouteLogger } from "../lib/route-logger.js";
|
|
@@ -373,7 +373,7 @@ function registerProjectsRoutes(authenticated, deps) {
|
|
|
373
373
|
const { service } = deps;
|
|
374
374
|
const activity = new ActivityService();
|
|
375
375
|
const goals = new GoalService();
|
|
376
|
-
const workItems =
|
|
376
|
+
const workItems = service.workItems;
|
|
377
377
|
authenticated.post("/api/projects", async (c) => {
|
|
378
378
|
const body = await c.req.json().catch(() => ({}));
|
|
379
379
|
const name = textField(body, "name")?.trim();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { PACKAGE_VERSION, init_package_version } from "../../../package-version.js";
|
|
2
2
|
import { loadConfig } from "../../../config/loader.js";
|
|
3
3
|
import "../../../config/index.js";
|
|
4
|
-
import { normalizeUpdateChannel } from "../../../infra/update-channels.js";
|
|
5
4
|
import { acquireUpdateLock } from "../../../infra/update-lock.js";
|
|
6
|
-
import {
|
|
5
|
+
import { normalizeUpdateChannel } from "../../../infra/update-channels.js";
|
|
7
6
|
import { getUpdateAvailable, runGatewayUpdateCheck } from "../../../infra/update-startup.js";
|
|
8
7
|
import { createGatewayRouteLogger } from "../lib/route-logger.js";
|
|
8
|
+
import { formatUpdateApiResult, runGatewayUpdateWithPostSteps } from "../../../infra/update-runner.js";
|
|
9
9
|
import { streamSSE } from "hono/streaming";
|
|
10
10
|
//#region src/gateway/hono/routes/update.ts
|
|
11
11
|
init_package_version();
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { buildDefaultCorsOrigins, isAllInterfacesHost, isLoopbackHost, resolveEffectiveGatewayPort, resolveGatewayServiceListenPort } from "./host.js";
|
|
2
2
|
import { defaultGatewayBindMode, isContainerEnvironment, resolveGatewayBindHost, resolveGatewayBindHostSync, resolveGatewayBindMode, resolveGatewayEffectiveHost } from "../config/gateway-bind.js";
|
|
3
|
-
import { checkPortAvailable, forceFreePortAndWait, listPortListeners, parseLsofOutput } from "./ports.js";
|
|
4
3
|
import { assertGatewayAuthConfigured, extractToken, resolveGatewayAuth, validateToken } from "./auth.js";
|
|
5
4
|
import { resolveGatewayListenHost, resolveGatewayListenPlan } from "./listen.js";
|
|
6
5
|
import { buckets } from "./rate-limit/buckets.js";
|
|
@@ -14,6 +13,7 @@ import { createHonoApp } from "./hono/app.js";
|
|
|
14
13
|
import { GatewayServer } from "./server.js";
|
|
15
14
|
import { GatewayLockError, acquireGatewayLock } from "./lock.js";
|
|
16
15
|
import { runGatewayLoop } from "./run-loop.js";
|
|
16
|
+
import { checkPortAvailable, forceFreePortAndWait, listPortListeners, parseLsofOutput } from "./ports.js";
|
|
17
17
|
import { apiError, apiOk } from "./protocol.js";
|
|
18
18
|
import "./hono/index.js";
|
|
19
19
|
import { assertSecureGatewayHttpUrl, assertSecureWebSocketUrl, isInsecurePrivateWsAllowed, isSecureWebSocketUrl } from "./ws-security.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { loadConfig } from "../config/loader.js";
|
|
2
2
|
import "../config/index.js";
|
|
3
3
|
import { isRestartEnabled } from "../config/commands.flags.js";
|
|
4
|
-
import { consumeGatewayRestartIntentSync, consumeGatewaySigusr1RestartAuthorization, isGatewaySigusr1RestartExternallyAllowed, resetGatewayRestartStateForInProcessRestart, scheduleGatewaySigusr1Restart, setGatewaySigusr1RestartPolicy } from "../infra/restart.js";
|
|
5
4
|
import { runBootstrapMigrationsSync } from "../migrations/runner.js";
|
|
6
5
|
import { restartGatewayProcessWithFreshPid } from "./respawn.js";
|
|
7
6
|
import { acquireGatewayLock } from "./lock.js";
|
|
7
|
+
import { consumeGatewayRestartIntentSync, consumeGatewaySigusr1RestartAuthorization, isGatewaySigusr1RestartExternallyAllowed, resetGatewayRestartStateForInProcessRestart, scheduleGatewaySigusr1Restart, setGatewaySigusr1RestartPolicy } from "../infra/restart.js";
|
|
8
8
|
//#region src/gateway/run-loop.ts
|
|
9
9
|
/**
|
|
10
10
|
* Gateway Run Loop - Core run loop for gateway process management
|
|
@@ -12,7 +12,9 @@ import { AgentRunRelay } from './agent-run-relay.js';
|
|
|
12
12
|
import { type EnqueueGoalRunOptions } from '../goals/index.js';
|
|
13
13
|
import { ProjectService } from '../projects/index.js';
|
|
14
14
|
import { LocalAppService } from '../local-apps/index.js';
|
|
15
|
+
import { WorkItemService } from '../work-items/index.js';
|
|
15
16
|
import { type BrowserRecipeService } from '../browser/recipes/index.js';
|
|
17
|
+
import { listInsights, ProactiveEventService, ProactiveInboxService, ProactiveInboxWorker, ProactiveScenarioService, ProactiveWorker } from '../proactive/index.js';
|
|
16
18
|
import { GatewaySessionsApi } from './service/sessions-api.js';
|
|
17
19
|
import { GatewayMarketplaceService } from './service/marketplace-service.js';
|
|
18
20
|
import { GatewayAgentRunner } from './service/agent-runner.js';
|
|
@@ -68,7 +70,6 @@ export declare class GatewayService {
|
|
|
68
70
|
private connectedKnowledgeCoordinator;
|
|
69
71
|
private stopAutomationProductEventBridge;
|
|
70
72
|
private stopSessionTranscriptAutomationEvents;
|
|
71
|
-
private stopFocusReconciler;
|
|
72
73
|
/**
|
|
73
74
|
* Webchat agent invocation surface (`runAgent`, `abortAgentRun`, `steer*`,
|
|
74
75
|
* `submitClarifyResponse`, clarify-bridge dispatch). Owns the
|
|
@@ -90,8 +91,16 @@ export declare class GatewayService {
|
|
|
90
91
|
readonly marketplace: GatewayMarketplaceService;
|
|
91
92
|
/** First-class project grouping surface. */
|
|
92
93
|
readonly projects: ProjectService;
|
|
94
|
+
readonly workItems: WorkItemService;
|
|
93
95
|
/** Local user-created apps, their coder projects, previews, and installs. */
|
|
94
96
|
readonly localApps: LocalAppService;
|
|
97
|
+
/** Unified durable event spine for proactive scenarios. */
|
|
98
|
+
readonly proactiveScenarios: ProactiveScenarioService;
|
|
99
|
+
readonly proactive: ProactiveEventService;
|
|
100
|
+
readonly proactiveInbox: ProactiveInboxService;
|
|
101
|
+
readonly proactiveInsights: typeof listInsights;
|
|
102
|
+
readonly proactiveWorker: ProactiveWorker;
|
|
103
|
+
readonly proactiveInboxWorker: ProactiveInboxWorker;
|
|
95
104
|
constructor(serviceConfig?: GatewayServiceConfig);
|
|
96
105
|
/** Lazy AgentService — constructed on first use or during `start()`. */
|
|
97
106
|
get agentService(): AgentService;
|