@xopcai/xopc 0.0.176 → 0.0.177
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-Wu2ikfbM.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DvdMLOga.js → agent-avatar-dicebear-B0_biISn.js} +1 -1
- package/dist/gateway/static/root/assets/agents-TpIpJk59.js +2 -0
- package/dist/gateway/static/root/assets/{api-BdPLCCBm.js → api-DljBt-N5.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-DMLDOHul.js → app-management-settings-panel-CKoZRi7Y.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-DbI9foFR.js → appearance-settings-DOdXhNDo.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-Cxbn5hy8.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-Dfdxuwvb.js → archive-plugin-D18gyP76.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-Dn3RlnYD.js → attachment-load-CZh9fc8u.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-suggestion-card-Bc0Y7A9u.js → automation-suggestion-card-DKrVoiiK.js} +1 -1
- package/dist/gateway/static/root/assets/automations-page-DYv16QMU.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-0XtB-xC0.js → binary-plugins-DdSyGL6M.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-C4fXWbEE.js → block-editor-BOpNApiX.js} +6 -6
- package/dist/gateway/static/root/assets/{browser-settings-page-lC86-drr.js → browser-settings-page-DlcqaGu1.js} +4 -4
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-CZmzNymN.js → browser-workflow-inputs-C0SnSj_R.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-CBYM9HqG.js → browser-workflows-page-CzlzH7HA.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-QPX4wsGZ.js +7 -0
- package/dist/gateway/static/root/assets/{capability-presets-api-BiJxmmhW.js → capability-presets-api-RM6S7ES5.js} +1 -1
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-DmCeusO8.js +1 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-BKTUZDp-.js → channel-recipient-api-B4sha-30.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-HcKoP1wm.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-D3xr2enH.js +1 -0
- package/dist/gateway/static/root/assets/{connector-logo-Pr4RIKjj.js → connector-logo-BPsKIyoM.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-DwbThFvd.js +2 -0
- package/dist/gateway/static/root/assets/desktop-pet-DjL1GWON.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-settings-CEQacUDF.js → desktop-pet-settings-u_abAXh7.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-DWnxdZtc.js → directory-picker-path-field-BoZGualI.js} +1 -1
- package/dist/gateway/static/root/assets/{dreaming-settings-D2e2w2Ho.js → dreaming-settings-s3gn3f9h.js} +3 -3
- package/dist/gateway/static/root/assets/{extension-debug-page-BLjTGbv3.js → extension-debug-page-DIbMngCF.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-D2_UC6hy.js → extension-page-D94f2bWQ.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BsH6o_PX.js → extension-settings-page-B7TI13ex.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-C-DkC6UJ.js → gateway-config-api-Do77rV8R.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-DEOGiimF.js → gateway-settings-Dt1PNJmb.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-BlSLh1TF.js → gateway-startup-retry-WaXTw3fi.js} +1 -1
- package/dist/gateway/static/root/assets/{goal-create-dialog-CSFcRE_N.js → goal-create-dialog-DEiOOLGU.js} +1 -1
- package/dist/gateway/static/root/assets/goal-detail-page-C1Qj4o1K.js +4 -0
- package/dist/gateway/static/root/assets/{goals-config-api-CcdS9qek.js → goals-config-api-BL0fAEns.js} +1 -1
- package/dist/gateway/static/root/assets/{goals-page-BAcErdch.js → goals-page-qJDcEDzc.js} +2 -2
- package/dist/gateway/static/root/assets/{goals-settings-BY7crl0z.js → goals-settings-DV3ZlrdI.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-DtTkS0gs.js → heartbeat-settings-C3kzg6ai.js} +1 -1
- package/dist/gateway/static/root/assets/{image-generation-api-WGgkbwDZ.js → image-generation-api-BgISY8i-.js} +1 -1
- package/dist/gateway/static/root/assets/{index-2UImfRDC.js → index-C1h0zkNo.js} +65 -65
- package/dist/gateway/static/root/assets/index-Da36E3WH.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-C5lpWQ3f.js → keyboard-shortcuts-settings-0KSmaPu0.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-DcD4mVId.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-b05wWvXG.js → local-apps-page-BMrU8u7w.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-sToMfHX_.js → locale-store-DVGhFXRz.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-cDE1jLJv.js → logs-page-CW5m9Cov.js} +3 -3
- package/dist/gateway/static/root/assets/{markdown-split-0gPVst5y.js → markdown-split-BVqbtN9o.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-Rxyq_KTm.js → media-plugins-Dr_wtkNJ.js} +1 -1
- package/dist/gateway/static/root/assets/messages-r8L6Ur3A.js +3 -0
- package/dist/gateway/static/root/assets/{notes-page-DRhNDl_Q.js → notes-page-BWZRXsq6.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-DdnwNz9x.js +4 -0
- package/dist/gateway/static/root/assets/{page-tabs-cOEOQqHh.js → page-tabs-DWWgy0bF.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-BopOLFvu.js → preview-open-alternatives-Bnfs93ZP.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-DWVPmmOq.js → product-open-page-BR7QFmT-.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-B8GeS4dl.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-DOeu1Hk_.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-De94rxnE.js +1 -0
- package/dist/gateway/static/root/assets/{save-bar-controls-BfZmKe1t.js → save-bar-controls-BzS-rRTP.js} +1 -1
- package/dist/gateway/static/root/assets/{schedule-field-Cpi4jCRV.js → schedule-field-Cl2IIDAN.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-OXFkcZQe.js → schema-form-BjKjp5eZ.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-A7p8G0OJ.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-BsGzjmqx.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-BwqkZCHJ.js → settings-form-section-BSDNBfHn.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-BbqH_S3Y.js → settings-loading-skeleton-BD4peoAv.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-BoxC-JSa.js → settings-page-S-P3U7at.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-Ddu2iGaW.js → settings-page-layout-BQTLh-86.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-z1Lwv0js.js → setup-status-panel-W3p6kNyA.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-CVazOFjy.js → share-preview-page-DQjMxyvw.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-Xo3N99PO.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-ByPEG5t1.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-C019Ml5q.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-DgyB1tSo.js → skills-page.utils-CXnpudm6.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-BoLSQL65.js → system-settings-panel-BhFwdYJP.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-CBNcGOfj.js → theme-store-DQI-HPL-.js} +1 -1
- package/dist/gateway/static/root/assets/{time-picker-gochWrny.js → time-picker-C0DCya4U.js} +1 -1
- package/dist/gateway/static/root/assets/{typed-models-lib-DvRnr7YB.js → typed-models-lib-C-M3Fv2N.js} +1 -1
- package/dist/gateway/static/root/assets/{use-channel-catalog-CA9BFVB7.js → use-channel-catalog-Bndq4y4I.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-fYBzpus-.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-v8tgylEZ.js → voice-api-key-field-p_g4UI1-.js} +1 -1
- package/dist/gateway/static/root/assets/work-discovery-page-DI0gCZRw.js +1 -0
- package/dist/gateway/static/root/assets/work-item-detail-page-DnBRP2wI.js +1 -0
- package/dist/gateway/static/root/assets/work-page-Z-nUaS_n.js +3 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-CC3cJn5k.js → workflow-run-setup-panel-CHEXVvhH.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-BDfwnM-Y.js +11 -0
- package/dist/gateway/static/root/index.html +7 -7
- package/dist/package.js +1 -1
- 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/config/agent-profile.js +1 -1
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/heartbeat/service.js +1 -1
- package/dist/src/gateway/hono/routes/browser-install.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/heartbeat/index.js +1 -1
- 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/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 +1 -1
- 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-C1h0zkNo.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-r8L6Ur3A.js">
|
|
28
|
+
<link rel="modulepreload" crossorigin href="/assets/locale-store-DVGhFXRz.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-WaXTw3fi.js">
|
|
35
|
+
<link rel="modulepreload" crossorigin href="/assets/activity-store-Wu2ikfbM.js">
|
|
36
|
+
<link rel="modulepreload" crossorigin href="/assets/theme-store-DQI-HPL-.js">
|
|
37
|
+
<link rel="stylesheet" crossorigin href="/assets/index-Da36E3WH.css">
|
|
38
38
|
</head>
|
|
39
39
|
<body>
|
|
40
40
|
<div id="root"></div>
|
package/dist/package.js
CHANGED
|
@@ -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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { init_agent_scope, normalizeAgentId, resolveAgentWorkspaceDir } from "../agent/agent-scope.js";
|
|
2
1
|
import { resolveEffectiveAgentManifest } from "../agent-manifest/resolver.js";
|
|
3
2
|
import "../agent-manifest/index.js";
|
|
3
|
+
import { init_agent_scope, normalizeAgentId, resolveAgentWorkspaceDir } from "../agent/agent-scope.js";
|
|
4
4
|
import { init_session_key, parseSessionKey } from "../routing/session-key.js";
|
|
5
5
|
import { agentExists, getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
6
6
|
//#region src/config/agent-profile.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { init_agent_scope, listAgentEntries, normalizeAgentId, resolveAgentDir, resolveAgentProfileDir, resolveAgentWorkspaceDir, resolveDefaultAgentId, resolveUserPath, validateAgentIdForNewAgent } from "../agent/agent-scope.js";
|
|
2
1
|
import { resolveEffectiveAgentManifest } from "../agent-manifest/resolver.js";
|
|
2
|
+
import { init_agent_scope, listAgentEntries, normalizeAgentId, resolveAgentDir, resolveAgentProfileDir, resolveAgentWorkspaceDir, resolveDefaultAgentId, resolveUserPath, validateAgentIdForNewAgent } from "../agent/agent-scope.js";
|
|
3
3
|
import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
4
4
|
import { WORKSPACE_FILES, init_paths, resolveUserProfilePath } from "../config/paths.js";
|
|
5
5
|
import { AGENT_PROFILE_MARKDOWN_SYSTEM_FILES, REQUIRED_AGENT_PROFILE_MARKDOWN_FILE_SET } from "../agent/context/workspace.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { shouldSilence, stripHeartbeatToken } from "../../heartbeat/tokens.js";
|
|
4
|
+
import { appendCronEventLines } from "../../heartbeat/event-prompt.js";
|
|
4
5
|
import { isWithinActiveHours } from "../../heartbeat/active-hours.js";
|
|
5
6
|
import { isHeartbeatContentEmpty } from "../../heartbeat/content-check.js";
|
|
6
|
-
import { appendCronEventLines } from "../../heartbeat/event-prompt.js";
|
|
7
7
|
import { createHeartbeatWake } from "../../heartbeat/wake.js";
|
|
8
8
|
import { resolveHeartbeatMdPath } from "../workspace-heartbeat-path.js";
|
|
9
9
|
import { readFile } from "fs/promises";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { acquireBrowserInstallLock, cancelBrowserInstall } from "../../../browser/install-lock.js";
|
|
2
1
|
import { createGatewayRouteLogger } from "../lib/route-logger.js";
|
|
2
|
+
import { acquireBrowserInstallLock, cancelBrowserInstall } from "../../../browser/install-lock.js";
|
|
3
3
|
import { runPlaywrightChromiumInstallWithProgress } from "../../../browser/providers/playwright-install.js";
|
|
4
4
|
import { streamSSE } from "hono/streaming";
|
|
5
5
|
//#region src/gateway/hono/routes/browser-install.ts
|
|
@@ -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;
|