@xopcai/xopc 0.0.219 → 0.0.220
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-slG02hSm.js → activity-store-DeKZ36Jy.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DZ6ETNIk.js → agent-avatar-dicebear-D0hZfdkn.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-DxaIH0Ep.js → agents-Bu0NfWuh.js} +1 -1
- package/dist/gateway/static/root/assets/{api-Tz57QxiN.js → api-yLnYUedB.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-DdR1L4LR.js → app-management-settings-panel-C2kZNEHz.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-wYbwqmee.js → appearance-settings-DQ7H35sN.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-CyWr6KyO.js → apps-page-Tty2xaUG.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-DKXa160O.js → archive-plugin-CBArbTPH.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-CzwA9g2y.js → attachment-load-oc6DRj4G.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-DwAXyWAY.js → automations-page-CHPEUpz8.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-CL7ieYIt.js → automations-workspace-9uYkHmdI.js} +1 -1
- package/dist/gateway/static/root/assets/{binary-plugins-DoQ_DnT7.js → binary-plugins-BRBd0X7_.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-Bj_Uxxng.js → block-editor-ZgM-Z4Qv.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-BYa_FNC1.js → browser-settings-page-BT3mEm00.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-D4roXE6r.js → browser-workflow-inputs-DxD74a4c.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-CleKTAKD.js → browser-workflows-page-Dpc7NqZf.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-DYG37N0k.js → capabilities-settings-panel-DHlfRj4M.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-presets-api-wtEN6Ss6.js → capability-presets-api-B9ID97j6.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-presets-settings-panel-C0Q4dFq-.js → capability-presets-settings-panel-D2FkREUX.js} +1 -1
- package/dist/gateway/static/root/assets/{channel-recipient-api-DhuS2RJ3.js → channel-recipient-api-DCNn6MWL.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-settings-CpO6Xg0n.js → channels-settings-D4YcKMtf.js} +1 -1
- package/dist/gateway/static/root/assets/channels-status-swr-B8XWrzKM.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-ClQMDe2n.js → chat-terminal-dock-MvNpjcUs.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-BvyiPdKU.js → connectors-page-Bd6K9bDk.js} +1 -1
- package/dist/gateway/static/root/assets/{cron-expression-4DvCFs-v.js → cron-expression-BSXX9uY0.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-B6FSjt4Z.js → date-picker-CiHNkkIS.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-Za18eMp1.js → dependency-picker-DQyh2ZXE.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DUUf3yyJ.js → desktop-pet-DnAHU-zA.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-Dwx3GfB8.js → desktop-pet-settings-DUdhIBBB.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-C6dfTCsl.js → directory-picker-path-field-B3gFQt8x.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-Cordpg4X.js → extension-debug-page-Lq-gRApw.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-Dw0dGyMl.js → extension-page-D0ROxJmY.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-B2pUMaXm.js → extension-settings-page-B2tS6mFy.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-DAZUOEQh.js → gateway-config-api-DJqWfVi6.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-BIqRg-zo.js → gateway-config-swr-CnwF9Vso.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-ik2f-pmV.js → gateway-settings-B3thenPX.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-BFjWYOCS.js → gateway-startup-retry-DdJJZR8M.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-BE81XJ8F.js → heartbeat-settings-C_g-ZGSE.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-BTWXJu_m.js → home-page-Cgwx66kc.js} +1 -1
- package/dist/gateway/static/root/assets/{image-generation-api-HXAWlgm6.js → image-generation-api-Dtt9M5qz.js} +1 -1
- package/dist/gateway/static/root/assets/index-Cf0qTkBK.css +2 -0
- package/dist/gateway/static/root/assets/{index-B6gWYy08.js → index-V9g9-SWT.js} +9 -9
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-ROqQ_Xlo.js → keyboard-shortcuts-settings-cJqkmQdP.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-Dcaf190G.js → local-app-workbench-page-CmjLMdly.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-Be79cyMG.js → local-apps-page-BiuP2pkl.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-DfK-Hofd.js → locale-store-D3Q2yEAb.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-C2pjbXno.js → logs-page-BTlxGPho.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-CRspx0oY.js → management-settings-Z1gJUwP_.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-G3PTpGw3.js → markdown-split-DuOmpGgE.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-D4FPJZ91.js → markdown-view-WYArkdrc.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-DT0P7j7u.js → media-plugins-DKPh3Mud.js} +1 -1
- package/dist/gateway/static/root/assets/messages-BQHpB4VI.js +3 -0
- package/dist/gateway/static/root/assets/{notes-api-q7HjYO07.js → notes-api-DMEon7Zv.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-Cgl2h7AR.js → notes-page-BG4gV8WG.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-workbench-DFMQYyGJ.js → notes-workbench-D3LMBO2X.js} +2 -2
- package/dist/gateway/static/root/assets/{product-open-page-ComKLO4D.js → product-open-page-BjJf4QOB.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-DUFmQscH.js → project-detail-page-C59tYJG-.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-CTWxt3dv.js → projects-page-Di7W-Fg8.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-BBoJ7khF.js → registry-api-DRyvynb5.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-qmG-3qjj.js → remote-access-hub-BYOKveWT.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-CXHQc53b.js → runtime-tools-settings-panel-DC6t_-db.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-3jTDF2lJ.js → schema-form-DSTWtpjp.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-D_We4_MV.js → sessions-page-CJMNQsxK.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-FJxZw08y.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-CUDozALU.js → settings-form-section-ZzEMNLYS.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-H3ZH6a6l.js → settings-loading-skeleton-D7-bkbcW.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-tx29z21o.js → settings-page-PaTpLbmi.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-VunfXpTX.js → setup-status-panel-Bnpim6NY.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-MyThymEx.js → share-preview-page-Cxcw0ksa.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-DkZvY1cr.js → shares-settings-DBqmV7ZY.js} +1 -1
- package/dist/gateway/static/root/assets/skill-reload-api-UgLQaWoz.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-BOOyMnno.js → skills-page-Dby4iAYe.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-Bl5Yv3Cx.js → skills-page.utils-nlzJ5Y1V.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-DwQ3O1ta.js → system-settings-panel-vOsgnzDl.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-BwOyrADL.js → task-detail-page-CRy8Wl5g.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-Br4BtK4x.js → theme-store-CvnEHGyP.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-DRS3RwS9.js → use-autosave-BTNZHulv.js} +1 -1
- package/dist/gateway/static/root/assets/{user-context-page-ClV2r3Cr.js → user-context-page-BT8F4mh5.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-CGTE5156.js → voice-api-key-field-DDJ2-3Tx.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-CW-HKD7h.js → work-discovery-overlay-DV_qiKSD.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-Dtr9fDC8.js → workflow-run-setup-panel--AcvRw1w.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-CDOyNgZf.js → workflows-page-CwvskVvU.js} +1 -1
- package/dist/gateway/static/root/index.html +12 -12
- package/dist/package.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/extension-marketplace.js +1 -1
- package/dist/src/cli/commands/extension.js +1 -1
- package/dist/src/connectors/connected-source-understanding.js +6 -5
- package/dist/src/connectors/learning-coordinator.js +11 -2
- package/dist/src/extensions/update.js +1 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
- package/dist/src/gateway/hono/routes/understanding-sources.d.ts +9 -0
- package/dist/src/gateway/hono/routes/understanding-sources.js +47 -14
- package/dist/src/gateway/hono/routes/work-discovery.js +13 -3
- package/dist/src/gateway/service/agent-runner.d.ts +4 -0
- package/dist/src/gateway/service/agent-runner.js +6 -0
- package/dist/src/gateway/service/config-coordinator.js +1 -1
- package/dist/src/gateway/service/run-gateway-agent.js +13 -8
- package/dist/src/gateway/service/sessions-api.d.ts +9 -0
- package/dist/src/gateway/service/sessions-api.js +3 -0
- package/dist/src/gateway/service.js +2 -1
- package/dist/src/infra/update-runner.js +1 -1
- package/dist/src/knowledge/connected-knowledge-pipeline.d.ts +6 -0
- package/dist/src/knowledge/connected-knowledge-pipeline.js +35 -4
- package/dist/src/retrieval/queryProfile.d.ts +2 -0
- package/dist/src/retrieval/queryProfile.js +11 -1
- package/dist/src/storage/sqlite/index.d.ts +2 -2
- package/dist/src/storage/sqlite/index.js +3 -3
- package/dist/src/storage/sqlite/knowledge-repository.d.ts +5 -1
- package/dist/src/storage/sqlite/knowledge-repository.js +16 -1
- package/dist/src/storage/sqlite/memory-records-repository.d.ts +2 -0
- package/dist/src/storage/sqlite/memory-records-repository.js +21 -1
- package/dist/src/storage/sqlite/migrations/133_archive_legacy_work_discovery_profile_facts.sql +11 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/migrations/runner.ts +1 -1
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/session-repository.js +2 -2
- package/dist/src/tasks/home-query-service.d.ts +14 -0
- package/dist/src/tasks/home-query-service.js +19 -2
- package/dist/src/user-context/consolidation.d.ts +1 -0
- package/dist/src/user-context/consolidation.js +62 -2
- package/dist/src/user-context/focus-lifecycle.d.ts +2 -0
- package/dist/src/user-context/focus-lifecycle.js +26 -0
- package/dist/src/user-context/planner.js +46 -13
- package/dist/src/work-discovery/analyzer.js +6 -4
- package/dist/src/work-discovery/index.js +2 -2
- package/dist/src/work-discovery/service.d.ts +12 -3
- package/dist/src/work-discovery/service.js +164 -83
- package/dist/src/work-discovery/source-repository.d.ts +1 -0
- package/dist/src/work-discovery/source-repository.js +10 -4
- package/dist/src/work-discovery/types.d.ts +2 -1
- package/package.json +3 -3
- package/dist/gateway/static/root/assets/channels-status-swr-CXhPeiNj.js +0 -1
- package/dist/gateway/static/root/assets/index-CDkuz_YC.css +0 -2
- package/dist/gateway/static/root/assets/messages-B701TEZ5.js +0 -3
- package/dist/gateway/static/root/assets/settings-advanced-gate-B_QhPgU0.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DVDOh1iY.js +0 -1
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png?v=20260713-1" />
|
|
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
|
-
<title>XOPC —
|
|
14
|
-
<script type="module" crossorigin src="/assets/index-
|
|
13
|
+
<title>XOPC — Keep what matters moving.</title>
|
|
14
|
+
<script type="module" crossorigin src="/assets/index-V9g9-SWT.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,13 +24,13 @@
|
|
|
24
24
|
<link rel="modulepreload" crossorigin href="/assets/download-Dk-ZjtO6.js">
|
|
25
25
|
<link rel="modulepreload" crossorigin href="/assets/plus-Q2yW6OE7.js">
|
|
26
26
|
<link rel="modulepreload" crossorigin href="/assets/x-B_N4OPjy.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-BQHpB4VI.js">
|
|
28
|
+
<link rel="modulepreload" crossorigin href="/assets/locale-store-D3Q2yEAb.js">
|
|
29
29
|
<link rel="modulepreload" crossorigin href="/assets/cn-JdwAhgNB.js">
|
|
30
30
|
<link rel="modulepreload" crossorigin href="/assets/schemas-zIBW3wiV.js">
|
|
31
31
|
<link rel="modulepreload" crossorigin href="/assets/product-delivery-tRr-7IxY.js">
|
|
32
32
|
<link rel="modulepreload" crossorigin href="/assets/copy-to-clipboard-HOJ79TWv.js">
|
|
33
|
-
<link rel="modulepreload" crossorigin href="/assets/markdown-view-
|
|
33
|
+
<link rel="modulepreload" crossorigin href="/assets/markdown-view-WYArkdrc.js">
|
|
34
34
|
<link rel="modulepreload" crossorigin href="/assets/dist-DY4Af0fY.js">
|
|
35
35
|
<link rel="modulepreload" crossorigin href="/assets/vendor-swr-BIWyz7Rc.js">
|
|
36
36
|
<link rel="modulepreload" crossorigin href="/assets/check-DUBLcKHA.js">
|
|
@@ -44,25 +44,25 @@
|
|
|
44
44
|
<link rel="modulepreload" crossorigin href="/assets/eye-CABVeTq0.js">
|
|
45
45
|
<link rel="modulepreload" crossorigin href="/assets/file-code-corner-byQA1VfD.js">
|
|
46
46
|
<link rel="modulepreload" crossorigin href="/assets/globe-DSSGFWFn.js">
|
|
47
|
-
<link rel="modulepreload" crossorigin href="/assets/notes-api-
|
|
47
|
+
<link rel="modulepreload" crossorigin href="/assets/notes-api-DMEon7Zv.js">
|
|
48
48
|
<link rel="modulepreload" crossorigin href="/assets/loader-circle-CifKLtgG.js">
|
|
49
49
|
<link rel="modulepreload" crossorigin href="/assets/rotate-cw-LIg3Am9S.js">
|
|
50
50
|
<link rel="modulepreload" crossorigin href="/assets/search-DA7gz22f.js">
|
|
51
51
|
<link rel="modulepreload" crossorigin href="/assets/middleware-Pd0e8Igk.js">
|
|
52
52
|
<link rel="modulepreload" crossorigin href="/assets/tool-activity-R8V9l6nk.js">
|
|
53
53
|
<link rel="modulepreload" crossorigin href="/assets/button-CSEbl4zT.js">
|
|
54
|
-
<link rel="modulepreload" crossorigin href="/assets/gateway-startup-retry-
|
|
55
|
-
<link rel="modulepreload" crossorigin href="/assets/registry-api-
|
|
54
|
+
<link rel="modulepreload" crossorigin href="/assets/gateway-startup-retry-DdJJZR8M.js">
|
|
55
|
+
<link rel="modulepreload" crossorigin href="/assets/registry-api-DRyvynb5.js">
|
|
56
56
|
<link rel="modulepreload" crossorigin href="/assets/config-reload-event-Bjh2zoKp.js">
|
|
57
|
-
<link rel="modulepreload" crossorigin href="/assets/gateway-config-swr-
|
|
57
|
+
<link rel="modulepreload" crossorigin href="/assets/gateway-config-swr-CnwF9Vso.js">
|
|
58
58
|
<link rel="modulepreload" crossorigin href="/assets/electron-env-DH5wF8X8.js">
|
|
59
59
|
<link rel="modulepreload" crossorigin href="/assets/form-field-width-DJw_jULe.js">
|
|
60
60
|
<link rel="modulepreload" crossorigin href="/assets/interaction-BmQogeqz.js">
|
|
61
61
|
<link rel="modulepreload" crossorigin href="/assets/is-masked-secret-DOkL5b_X.js">
|
|
62
|
-
<link rel="modulepreload" crossorigin href="/assets/activity-store-
|
|
63
|
-
<link rel="modulepreload" crossorigin href="/assets/theme-store-
|
|
62
|
+
<link rel="modulepreload" crossorigin href="/assets/activity-store-DeKZ36Jy.js">
|
|
63
|
+
<link rel="modulepreload" crossorigin href="/assets/theme-store-CvnEHGyP.js">
|
|
64
64
|
<link rel="stylesheet" crossorigin href="/assets/markdown-view-DD_PgVue.css">
|
|
65
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
65
|
+
<link rel="stylesheet" crossorigin href="/assets/index-Cf0qTkBK.css">
|
|
66
66
|
</head>
|
|
67
67
|
<body>
|
|
68
68
|
<div id="root"></div>
|
package/dist/package.js
CHANGED
|
@@ -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 v133).`,
|
|
56
56
|
hints: []
|
|
57
57
|
};
|
|
58
58
|
}
|
|
@@ -3,9 +3,9 @@ import { init_loader, loadConfig } from "../../config/loader.js";
|
|
|
3
3
|
import { downloadExtensionStoreZipBuffer, resolveExtensionZipDownloadUrl, resolveExtensionsStoreBaseUrl, verifyStoreArtifactSha256 } from "../../agent/skills/marketplace/adapters/store/store-api-client.js";
|
|
4
4
|
import { getContextWithOpts } from "../context.js";
|
|
5
5
|
import { getExtensionLockfileManager } from "../../extensions/lockfile.js";
|
|
6
|
-
import { fetchRegistry, findExtension, getExtensionMarketplaceStoreBaseUrl, listExtensions, searchExtensions } from "../../extensions/marketplace.js";
|
|
7
6
|
import { installFromLocal, installFromNpm, peekExtensionManifestFromStoreZip } from "../../extensions/install.js";
|
|
8
7
|
import { commitStagedExtensionInstall, finalizeStagedExtensionInstall, rollbackStagedExtensionInstall, stageExtensionStoreZip } from "../../extensions/install-transaction.js";
|
|
8
|
+
import { fetchRegistry, findExtension, getExtensionMarketplaceStoreBaseUrl, listExtensions, searchExtensions } from "../../extensions/marketplace.js";
|
|
9
9
|
import { colors } from "../utils/colors.js";
|
|
10
10
|
import { validateExtensionPackageDirectory } from "./extension-pack.js";
|
|
11
11
|
import { join, resolve } from "node:path";
|
|
@@ -7,8 +7,8 @@ import { checkEngineCompatibility } from "../../extensions/engine-check.js";
|
|
|
7
7
|
import { ExtensionLoader } from "../../extensions/loader.js";
|
|
8
8
|
import { getContextWithOpts } from "../context.js";
|
|
9
9
|
import { getExtensionLockfileManager } from "../../extensions/lockfile.js";
|
|
10
|
-
import { collectExtensionPackageDependencyIssues } from "../../extensions/package-contract.js";
|
|
11
10
|
import { checkAllExtensionsHealth, getExtensionHealthChecker } from "../../extensions/health.js";
|
|
11
|
+
import { collectExtensionPackageDependencyIssues } from "../../extensions/package-contract.js";
|
|
12
12
|
import { colors } from "../utils/colors.js";
|
|
13
13
|
import { createExtensionCreateCommand } from "./extension-create.js";
|
|
14
14
|
import { createExtensionDevCommand } from "./extension-dev.js";
|
|
@@ -3,6 +3,7 @@ import { listKnowledgeSourceItems } from "../storage/sqlite/knowledge-repository
|
|
|
3
3
|
import "../storage/sqlite/index.js";
|
|
4
4
|
import { upsertUserFocus } from "../user-context/sources/repository.js";
|
|
5
5
|
import { claimRegisteredExtraction } from "../user-context/extraction/registry.js";
|
|
6
|
+
import { focusLifecycle } from "../user-context/focus-lifecycle.js";
|
|
6
7
|
import { allowsRemoteSourceProcessing } from "../user-context/sources/processing-policy.js";
|
|
7
8
|
import { analyzeUnderstandingSources } from "../work-discovery/analyzer.js";
|
|
8
9
|
import { createHash } from "node:crypto";
|
|
@@ -61,8 +62,7 @@ function connectedItemsForUnderstanding(items) {
|
|
|
61
62
|
}
|
|
62
63
|
function understandingKind(category) {
|
|
63
64
|
if (category === "preference") return "preference";
|
|
64
|
-
if (category === "
|
|
65
|
-
if (category === "focus") return "current_state";
|
|
65
|
+
if (category === "routine") return "routine";
|
|
66
66
|
return "project_context";
|
|
67
67
|
}
|
|
68
68
|
function understandingCandidate(candidate) {
|
|
@@ -72,9 +72,9 @@ function understandingCandidate(candidate) {
|
|
|
72
72
|
content: candidate.statement,
|
|
73
73
|
canonicalKey: `connected-semantic:${candidate.category}:${createHash("sha256").update(normalized).digest("hex").slice(0, 20)}`,
|
|
74
74
|
confidence: candidate.confidence === "high" ? .9 : candidate.confidence === "medium" ? .72 : .55,
|
|
75
|
-
importance:
|
|
75
|
+
importance: .68,
|
|
76
76
|
explicitness: "inferred",
|
|
77
|
-
durability: candidate.category === "
|
|
77
|
+
durability: candidate.category === "routine" ? "recurring" : "durable",
|
|
78
78
|
sensitivity: "personal",
|
|
79
79
|
disclosurePolicy: "referenceable"
|
|
80
80
|
};
|
|
@@ -139,7 +139,8 @@ async function deriveConnectedSourceUnderstanding(input) {
|
|
|
139
139
|
status: "candidate",
|
|
140
140
|
confidence: candidate.confidence === "high" ? .9 : candidate.confidence === "medium" ? .72 : .55,
|
|
141
141
|
evidenceRefs: candidate.evidenceRefs,
|
|
142
|
-
sourceRunId: input.sourceRunId
|
|
142
|
+
sourceRunId: input.sourceRunId,
|
|
143
|
+
...focusLifecycle(candidate.horizon)
|
|
143
144
|
}));
|
|
144
145
|
finishContextExtractionRun({
|
|
145
146
|
runId: extraction.run.id,
|
|
@@ -2,7 +2,6 @@ import { createLogger } from "../utils/logger/index.js";
|
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
3
|
import { finishContextExtractionRun } from "../storage/sqlite/context-extraction-repository.js";
|
|
4
4
|
import { claimNextConnectorLearningJob, enqueueConnectorLearningJob, listConnectorLearningJobs, recoverStaleConnectorLearningJobs, setConnectorLearningPaused, updateConnectorLearningJob } from "../storage/sqlite/connector-learning-repository.js";
|
|
5
|
-
import { pruneBoundedKnowledgeSourceItems } from "../storage/sqlite/knowledge-repository.js";
|
|
6
5
|
import { getConnectorInstallation, listConnectorConnections, upsertConnectorConnection } from "../storage/sqlite/connector-repository.js";
|
|
7
6
|
import { getConnectorAccount, reconcileConnectorAccount } from "../storage/sqlite/connector-account-repository.js";
|
|
8
7
|
import { getConnectorSyncPolicyForConnection } from "../storage/sqlite/connector-sync-policy-repository.js";
|
|
@@ -13,6 +12,8 @@ import { buildConnectorLearningArguments, getConnectorLearningPlan } from "./lea
|
|
|
13
12
|
import { getConnectorDefinition } from "./catalog.js";
|
|
14
13
|
import { createUnderstandingSourceRun, getUnderstandingSourceGrant, listUnderstandingSourceRuns, updateUnderstandingSourceGrantCheckpoint, updateUnderstandingSourceRun, upsertUnderstandingSourceGrant, upsertUserFocus } from "../user-context/sources/repository.js";
|
|
15
14
|
import { claimRegisteredExtraction } from "../user-context/extraction/registry.js";
|
|
15
|
+
import { getWorkspacePath } from "../config/workspace-path-helpers.js";
|
|
16
|
+
import { ConnectedKnowledgePipeline } from "../knowledge/connected-knowledge-pipeline.js";
|
|
16
17
|
import { ConnectedUnderstandingPipeline } from "../knowledge/connected-understanding-pipeline.js";
|
|
17
18
|
import "../knowledge/index.js";
|
|
18
19
|
import { ingestComposioConnectedSource } from "./connected-source-ingestion.js";
|
|
@@ -322,7 +323,15 @@ function startConnectorLearningCoordinator(options) {
|
|
|
322
323
|
lastCollectedAt: Date.now()
|
|
323
324
|
});
|
|
324
325
|
publish(completed);
|
|
325
|
-
|
|
326
|
+
const retention = new ConnectedKnowledgePipeline({
|
|
327
|
+
agentId: job.agentId,
|
|
328
|
+
workspaceId: getWorkspacePath(options.getConfig())
|
|
329
|
+
}).pruneBoundedRetention(job.sourceInstanceId, Date.now() - plan.bootstrapWindowDays * 24 * 60 * 6e4);
|
|
330
|
+
if (retention.rawDeleted || retention.derivedDeleted) log.info({
|
|
331
|
+
jobId: job.id,
|
|
332
|
+
sourceInstanceId: job.sourceInstanceId,
|
|
333
|
+
...retention
|
|
334
|
+
}, "Connected source retention pruned");
|
|
326
335
|
const syncPolicy = getConnectorSyncPolicyForConnection(job.connectionId);
|
|
327
336
|
if (syncPolicy?.scanEnabled === false) return;
|
|
328
337
|
const intervalMinutes = syncPolicy?.intervalMinutes ?? plan.intervalMinutes;
|
|
@@ -4,8 +4,8 @@ import { init_paths, resolveBundledExtensionsDir, resolveExtensionsDir } from ".
|
|
|
4
4
|
import { init_loader, loadConfig } from "../config/loader.js";
|
|
5
5
|
import { downloadExtensionStoreZipBuffer, resolveExtensionZipDownloadUrl, resolveExtensionsStoreBaseUrl, verifyStoreArtifactSha256 } from "../agent/skills/marketplace/adapters/store/store-api-client.js";
|
|
6
6
|
import { getExtensionLockfileManager } from "./lockfile.js";
|
|
7
|
-
import { findExtension } from "./marketplace.js";
|
|
8
7
|
import { installExtensionFromStoreZip, installFromNpm } from "./install.js";
|
|
8
|
+
import { findExtension } from "./marketplace.js";
|
|
9
9
|
import { join } from "node:path";
|
|
10
10
|
import { existsSync, readFileSync, readdirSync, rmSync } from "node:fs";
|
|
11
11
|
import semver from "semver";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getAllModels, getAvailableModels, init_providers } from "../../../providers/index.js";
|
|
2
2
|
import { ActivationPlanner } from "../../../extensions/activation-planner.js";
|
|
3
3
|
import { mergeActivationContext } from "../../../extensions/activation-context.js";
|
|
4
|
-
import { buildWhenContextSnapshot } from "../../../extensions/when-context.js";
|
|
5
4
|
import { fetchRegistry, listExtensions, searchExtensions } from "../../../extensions/marketplace.js";
|
|
5
|
+
import { buildWhenContextSnapshot } from "../../../extensions/when-context.js";
|
|
6
6
|
import { createOAuthAsyncHandler } from "../oauth-async.js";
|
|
7
7
|
import { createOAuthHandler } from "../oauth.js";
|
|
8
8
|
import { extensionAssetMimeType } from "../lib/extension-assets.js";
|
|
@@ -2,11 +2,20 @@ import type { Hono } from 'hono';
|
|
|
2
2
|
import type { AuthenticatedRouteDeps } from './deps.js';
|
|
3
3
|
export declare function sourceRevocationImpact(grantId: string): {
|
|
4
4
|
grant: import("../../../user-context/sources/types.js").UnderstandingSourceGrant;
|
|
5
|
+
sourceInstanceId: string;
|
|
5
6
|
understandingIds: string[];
|
|
6
7
|
focusIds: string[];
|
|
7
8
|
derivedCount: number;
|
|
8
9
|
understandingCount: number;
|
|
9
10
|
focusCount: number;
|
|
11
|
+
memoryRecordCount: number;
|
|
10
12
|
boundedRawCount: number;
|
|
11
13
|
};
|
|
14
|
+
export declare function applySourceRevocationChoices(impact: NonNullable<ReturnType<typeof sourceRevocationImpact>>, options: {
|
|
15
|
+
derived: 'delete' | 'retain';
|
|
16
|
+
raw: 'delete' | 'retain';
|
|
17
|
+
}): {
|
|
18
|
+
derivedDeleted: number;
|
|
19
|
+
rawDeleted: number;
|
|
20
|
+
};
|
|
12
21
|
export declare function registerUnderstandingSourceRoutes(authenticated: Hono, deps: AuthenticatedRouteDeps): void;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { deleteUnderstanding, listUnderstandingEvidence, listUnderstandings, setUnderstandingStatus } from "../../../storage/sqlite/user-context-repository.js";
|
|
2
|
+
import { countKnowledgeSourceItems, deleteKnowledgeSourceItems } from "../../../storage/sqlite/knowledge-repository.js";
|
|
3
|
+
import { countMemoryRecordsBySourceInstanceId, deleteMemoryRecordsBySourceInstanceId } from "../../../storage/sqlite/memory-records-repository.js";
|
|
2
4
|
import { getConnectorAccount } from "../../../storage/sqlite/connector-account-repository.js";
|
|
3
5
|
import "../../../storage/sqlite/index.js";
|
|
4
6
|
import { init_agent_scope, resolveDefaultAgentId } from "../../../agent/agent-scope.js";
|
|
@@ -44,14 +46,33 @@ function sourceRevocationImpact(grantId) {
|
|
|
44
46
|
if ((focus.sourceRunId ? getUnderstandingSourceRun(focus.sourceRunId) : null)?.grantId !== grantId) return [];
|
|
45
47
|
return listUserFocusEvidence(focus.id).some((entry) => !belongs(entry)) ? [] : [focus];
|
|
46
48
|
});
|
|
49
|
+
const memoryRecordCount = sourceInstanceId ? countMemoryRecordsBySourceInstanceId(sourceInstanceId) : 0;
|
|
50
|
+
const boundedRawCount = sourceInstanceId ? countKnowledgeSourceItems(sourceInstanceId) : 0;
|
|
47
51
|
return {
|
|
48
52
|
grant,
|
|
53
|
+
sourceInstanceId,
|
|
49
54
|
understandingIds: understandings.map((item) => item.id),
|
|
50
55
|
focusIds: focuses.map((item) => item.id),
|
|
51
|
-
derivedCount: understandings.length + focuses.length,
|
|
56
|
+
derivedCount: understandings.length + focuses.length + memoryRecordCount,
|
|
52
57
|
understandingCount: understandings.length,
|
|
53
58
|
focusCount: focuses.length,
|
|
54
|
-
|
|
59
|
+
memoryRecordCount,
|
|
60
|
+
boundedRawCount
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
function applySourceRevocationChoices(impact, options) {
|
|
64
|
+
let derivedDeleted = 0;
|
|
65
|
+
for (const id of impact.focusIds) if (options.derived === "delete") {
|
|
66
|
+
if (deleteUserFocus(id)) derivedDeleted += 1;
|
|
67
|
+
} else updateUserFocus(id, { status: "paused" });
|
|
68
|
+
for (const id of impact.understandingIds) if (options.derived === "delete") {
|
|
69
|
+
if (deleteUnderstanding(id)) derivedDeleted += 1;
|
|
70
|
+
} else setUnderstandingStatus(id, "needs_review");
|
|
71
|
+
if (options.derived === "delete" && impact.sourceInstanceId) derivedDeleted += deleteMemoryRecordsBySourceInstanceId(impact.sourceInstanceId);
|
|
72
|
+
const rawDeleted = options.raw === "delete" && impact.sourceInstanceId ? deleteKnowledgeSourceItems(impact.sourceInstanceId) : 0;
|
|
73
|
+
return {
|
|
74
|
+
derivedDeleted,
|
|
75
|
+
rawDeleted
|
|
55
76
|
};
|
|
56
77
|
}
|
|
57
78
|
function registerUnderstandingSourceRoutes(authenticated, deps) {
|
|
@@ -168,17 +189,18 @@ function registerUnderstandingSourceRoutes(authenticated, deps) {
|
|
|
168
189
|
const connectionId = accountId ? getConnectorAccount(accountId)?.currentConnectionId : void 0;
|
|
169
190
|
if (connectionId) deps.service.setConnectorLearningPaused(connectionId, true);
|
|
170
191
|
const grant = revokeUnderstandingSourceGrant(grantId);
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
192
|
+
const deleted = grant && impact ? applySourceRevocationChoices(impact, {
|
|
193
|
+
derived,
|
|
194
|
+
raw
|
|
195
|
+
}) : {
|
|
196
|
+
derivedDeleted: 0,
|
|
197
|
+
rawDeleted: 0
|
|
198
|
+
};
|
|
177
199
|
return grant ? c.json({
|
|
178
200
|
ok: true,
|
|
179
201
|
grant,
|
|
180
202
|
impact,
|
|
181
|
-
|
|
203
|
+
...deleted
|
|
182
204
|
}) : c.json({
|
|
183
205
|
ok: false,
|
|
184
206
|
error: "Source grant not found"
|
|
@@ -232,15 +254,21 @@ function registerUnderstandingSourceRoutes(authenticated, deps) {
|
|
|
232
254
|
sources: service.listDirectorySources()
|
|
233
255
|
}));
|
|
234
256
|
authenticated.post("/api/understanding/sources/work-folders", limited, async (c) => {
|
|
235
|
-
const
|
|
257
|
+
const body = await c.req.json().catch(() => null);
|
|
258
|
+
const rootPath = stringField(body, "rootPath");
|
|
259
|
+
const processingPolicy = stringField(body, "processingPolicy");
|
|
236
260
|
if (!rootPath) return c.json({
|
|
237
261
|
ok: false,
|
|
238
262
|
error: "Missing rootPath"
|
|
239
263
|
}, 400);
|
|
264
|
+
if (processingPolicy !== "local_only" && processingPolicy !== "remote_allowed") return c.json({
|
|
265
|
+
ok: false,
|
|
266
|
+
error: "Explicit processingPolicy is required"
|
|
267
|
+
}, 400);
|
|
240
268
|
try {
|
|
241
269
|
return c.json({
|
|
242
270
|
ok: true,
|
|
243
|
-
source: await service.grantDirectorySource(rootPath)
|
|
271
|
+
source: await service.grantDirectorySource(rootPath, processingPolicy)
|
|
244
272
|
}, 201);
|
|
245
273
|
} catch (error) {
|
|
246
274
|
return c.json({
|
|
@@ -268,14 +296,19 @@ function registerUnderstandingSourceRoutes(authenticated, deps) {
|
|
|
268
296
|
});
|
|
269
297
|
authenticated.post("/api/understanding/bootstrap", limited, async (c) => {
|
|
270
298
|
const body = await c.req.json().catch(() => null);
|
|
271
|
-
const items = body && typeof body === "object" && Array.isArray(body.items) ? body.items.slice(0,
|
|
299
|
+
const items = body && typeof body === "object" && Array.isArray(body.items) ? body.items.slice(0, 1200) : [];
|
|
300
|
+
const processingPolicy = stringField(body, "processingPolicy");
|
|
272
301
|
if (!items.length) return c.json({
|
|
273
302
|
ok: false,
|
|
274
303
|
error: "No understanding source items were provided"
|
|
275
304
|
}, 400);
|
|
305
|
+
if (processingPolicy !== "local_only" && processingPolicy !== "remote_allowed") return c.json({
|
|
306
|
+
ok: false,
|
|
307
|
+
error: "Explicit processingPolicy is required"
|
|
308
|
+
}, 400);
|
|
276
309
|
try {
|
|
277
310
|
const checkpoints = body && typeof body === "object" && body.sourceCheckpoints && typeof body.sourceCheckpoints === "object" ? body.sourceCheckpoints : void 0;
|
|
278
|
-
const result = await service.importUnderstandingSources(items, c.req.raw.signal, stringField(body, "workDiscoveryRunId") || void 0, checkpoints);
|
|
311
|
+
const result = await service.importUnderstandingSources(items, processingPolicy, c.req.raw.signal, stringField(body, "workDiscoveryRunId") || void 0, checkpoints);
|
|
279
312
|
return c.json({
|
|
280
313
|
ok: true,
|
|
281
314
|
...result
|
|
@@ -348,4 +381,4 @@ function registerUnderstandingSourceRoutes(authenticated, deps) {
|
|
|
348
381
|
});
|
|
349
382
|
}
|
|
350
383
|
//#endregion
|
|
351
|
-
export { registerUnderstandingSourceRoutes, sourceRevocationImpact };
|
|
384
|
+
export { applySourceRevocationChoices, registerUnderstandingSourceRoutes, sourceRevocationImpact };
|
|
@@ -86,7 +86,8 @@ function registerWorkDiscoveryRoutes(authenticated, deps) {
|
|
|
86
86
|
const candidates = await service.discoverCandidates(c.req.raw.signal);
|
|
87
87
|
return c.json({
|
|
88
88
|
ok: true,
|
|
89
|
-
candidates
|
|
89
|
+
candidates,
|
|
90
|
+
processingTarget: service.getModelProcessingTarget()
|
|
90
91
|
});
|
|
91
92
|
} catch (error) {
|
|
92
93
|
return c.json({
|
|
@@ -100,13 +101,22 @@ function registerWorkDiscoveryRoutes(authenticated, deps) {
|
|
|
100
101
|
ok: false,
|
|
101
102
|
error: "Work discovery is disabled"
|
|
102
103
|
}, 404);
|
|
103
|
-
const
|
|
104
|
+
const body = await c.req.json().catch(() => null);
|
|
105
|
+
const idempotencyKey = stringField(body, "idempotencyKey");
|
|
106
|
+
const processingPolicy = stringField(body, "processingPolicy");
|
|
104
107
|
if (!idempotencyKey) return c.json({
|
|
105
108
|
ok: false,
|
|
106
109
|
error: "Missing idempotencyKey"
|
|
107
110
|
}, 400);
|
|
111
|
+
if (processingPolicy !== "local_only" && processingPolicy !== "remote_allowed") return c.json({
|
|
112
|
+
ok: false,
|
|
113
|
+
error: "Explicit processingPolicy is required"
|
|
114
|
+
}, 400);
|
|
108
115
|
try {
|
|
109
|
-
const run = await service.startQuickRun({
|
|
116
|
+
const run = await service.startQuickRun({
|
|
117
|
+
idempotencyKey,
|
|
118
|
+
processingPolicy
|
|
119
|
+
});
|
|
110
120
|
return c.json({
|
|
111
121
|
ok: true,
|
|
112
122
|
run
|
|
@@ -57,6 +57,10 @@ export declare class GatewayAgentRunner {
|
|
|
57
57
|
/** True when a webchat agent run is currently in-flight for `sessionKey`. */
|
|
58
58
|
hasActiveRun(sessionKey: string): boolean;
|
|
59
59
|
getActiveRunId(sessionKey: string): string | undefined;
|
|
60
|
+
listActiveRuns(): Array<{
|
|
61
|
+
sessionKey: string;
|
|
62
|
+
runId: string;
|
|
63
|
+
}>;
|
|
60
64
|
getClarifyBridge(): ClarifyBridge;
|
|
61
65
|
/** Called from `GatewayService.stop()` so the bridge gets cleaned up. */
|
|
62
66
|
disposeClarifyBridge(): void;
|
|
@@ -77,6 +77,12 @@ var GatewayAgentRunner = class {
|
|
|
77
77
|
getActiveRunId(sessionKey) {
|
|
78
78
|
return this.activeWebchatRunBySession.get(sessionKey);
|
|
79
79
|
}
|
|
80
|
+
listActiveRuns() {
|
|
81
|
+
return [...this.activeWebchatRunBySession.entries()].map(([sessionKey, runId]) => ({
|
|
82
|
+
sessionKey,
|
|
83
|
+
runId
|
|
84
|
+
}));
|
|
85
|
+
}
|
|
80
86
|
getClarifyBridge() {
|
|
81
87
|
return this.clarifyBridge;
|
|
82
88
|
}
|
|
@@ -8,8 +8,8 @@ import { reloadImageGenerationProviders } from "../../agent/image/generation/pro
|
|
|
8
8
|
import "../../agent/mcp/bundle-mcp-tools.js";
|
|
9
9
|
import { ConfigHotReloader } from "../../config/reload.js";
|
|
10
10
|
import "../../config/index.js";
|
|
11
|
-
import { sanitizeTunnelConfig } from "../../tunnel/tunnel-config.js";
|
|
12
11
|
import { computeBundledExtensionExtensionsPatch } from "../../extensions/bundled-extension-activation.js";
|
|
12
|
+
import { sanitizeTunnelConfig } from "../../tunnel/tunnel-config.js";
|
|
13
13
|
//#region src/gateway/service/config-coordinator.ts
|
|
14
14
|
init_providers();
|
|
15
15
|
init_logger();
|
|
@@ -98,13 +98,7 @@ async function* runGatewayAgent(deps, message, channel, chatId, origin, attachme
|
|
|
98
98
|
const emitAndYield = function* (events) {
|
|
99
99
|
for (const event of events) {
|
|
100
100
|
if (taskRun) captureTaskEvent(event);
|
|
101
|
-
if (channel === "webchat") {
|
|
102
|
-
publishRealtime(`run:${runId}`, event.type, event);
|
|
103
|
-
if (event.type === "run_start") publishRealtime("sessions", "run.started", {
|
|
104
|
-
sessionKey: streamSessionKey,
|
|
105
|
-
runId
|
|
106
|
-
});
|
|
107
|
-
}
|
|
101
|
+
if (channel === "webchat") publishRealtime(`run:${runId}`, event.type, event);
|
|
108
102
|
yield event;
|
|
109
103
|
}
|
|
110
104
|
};
|
|
@@ -126,6 +120,10 @@ async function* runGatewayAgent(deps, message, channel, chatId, origin, attachme
|
|
|
126
120
|
if (!activeWebchatRunBySession.has(sessionKey)) {
|
|
127
121
|
activeWebchatRunBySession.set(sessionKey, runId);
|
|
128
122
|
registeredActiveWebchatRun = true;
|
|
123
|
+
publishRealtime("sessions", "run.started", {
|
|
124
|
+
sessionKey,
|
|
125
|
+
runId
|
|
126
|
+
});
|
|
129
127
|
}
|
|
130
128
|
let streamError;
|
|
131
129
|
try {
|
|
@@ -172,7 +170,14 @@ async function* runGatewayAgent(deps, message, channel, chatId, origin, attachme
|
|
|
172
170
|
summary: streamError
|
|
173
171
|
};
|
|
174
172
|
} finally {
|
|
175
|
-
if (registeredActiveWebchatRun && activeWebchatRunBySession.get(sessionKey) === runId)
|
|
173
|
+
if (registeredActiveWebchatRun && activeWebchatRunBySession.get(sessionKey) === runId) {
|
|
174
|
+
activeWebchatRunBySession.delete(sessionKey);
|
|
175
|
+
publishRealtime("sessions", "run.completed", {
|
|
176
|
+
sessionKey,
|
|
177
|
+
runId,
|
|
178
|
+
status: terminalStatus
|
|
179
|
+
});
|
|
180
|
+
}
|
|
176
181
|
runAbortControllers.delete(runId);
|
|
177
182
|
const assistantPlainText = agentService.getLastAssistantPlainText(sessionKey);
|
|
178
183
|
const reviewHint = agentService.takeTaskReviewStreamHint(sessionKey);
|
|
@@ -22,6 +22,11 @@ export interface GatewaySessionsApiOptions {
|
|
|
22
22
|
getAgentService: () => AgentService;
|
|
23
23
|
/** Read-only view of in-flight webchat runs (per session key → run id). */
|
|
24
24
|
getActiveWebchatRunId: (sessionKey: string) => string | undefined;
|
|
25
|
+
/** Snapshot of all in-flight webchat runs for workspace briefing surfaces. */
|
|
26
|
+
listActiveWebchatRuns: () => Array<{
|
|
27
|
+
sessionKey: string;
|
|
28
|
+
runId: string;
|
|
29
|
+
}>;
|
|
25
30
|
}
|
|
26
31
|
export declare class GatewaySessionsApi {
|
|
27
32
|
private readonly opts;
|
|
@@ -47,6 +52,10 @@ export declare class GatewaySessionsApi {
|
|
|
47
52
|
active: boolean;
|
|
48
53
|
runId?: string;
|
|
49
54
|
};
|
|
55
|
+
listActiveRuns(): Array<{
|
|
56
|
+
sessionKey: string;
|
|
57
|
+
runId: string;
|
|
58
|
+
}>;
|
|
50
59
|
getMessagePage(key: string, options?: {
|
|
51
60
|
offset?: number;
|
|
52
61
|
limit?: number;
|
|
@@ -405,7 +405,8 @@ var GatewayService = class {
|
|
|
405
405
|
this.sessions = new GatewaySessionsApi({
|
|
406
406
|
sessionIndex: this.sessionIndex,
|
|
407
407
|
getAgentService: () => this.ensureAgentService(),
|
|
408
|
-
getActiveWebchatRunId: (sk) => this.agentRunner.getActiveRunId(sk)
|
|
408
|
+
getActiveWebchatRunId: (sk) => this.agentRunner.getActiveRunId(sk),
|
|
409
|
+
listActiveWebchatRuns: () => this.agentRunner.listActiveRuns()
|
|
409
410
|
});
|
|
410
411
|
this.marketplace = new GatewayMarketplaceService({
|
|
411
412
|
getConfig: () => this.config,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { runPostUpdateExtensionSync } from "../extensions/update.js";
|
|
1
2
|
import "./update-channels.js";
|
|
2
3
|
import { compareSemver, resolveNpmChannelTag } from "./update-check.js";
|
|
3
4
|
import { readPackageName, readPackageVersion } from "./package-json.js";
|
|
@@ -7,7 +8,6 @@ import { runGlobalPackageUpdateSteps } from "./package-update-steps.js";
|
|
|
7
8
|
import { resolveStableNodePath } from "./stable-node-path.js";
|
|
8
9
|
import { trimLogTail } from "./update-log.js";
|
|
9
10
|
import { maybeRestartGatewayAfterUpdate } from "./update-restart.js";
|
|
10
|
-
import { runPostUpdateExtensionSync } from "../extensions/update.js";
|
|
11
11
|
import path from "node:path";
|
|
12
12
|
import fs from "node:fs/promises";
|
|
13
13
|
//#region src/infra/update-runner.ts
|
|
@@ -11,11 +11,17 @@ export type KnowledgeSynthesisBatchResult = {
|
|
|
11
11
|
failed: number;
|
|
12
12
|
recordIds: string[];
|
|
13
13
|
};
|
|
14
|
+
export type ConnectedKnowledgePruneResult = {
|
|
15
|
+
rawDeleted: number;
|
|
16
|
+
derivedDeleted: number;
|
|
17
|
+
};
|
|
14
18
|
export declare class ConnectedKnowledgePipeline {
|
|
15
19
|
private readonly options;
|
|
16
20
|
private readonly workerId;
|
|
17
21
|
private readonly batchSize;
|
|
18
22
|
constructor(options: ConnectedKnowledgePipelineOptions);
|
|
19
23
|
processPending(sourceInstanceId?: string): Promise<KnowledgeSynthesisBatchResult>;
|
|
24
|
+
/** Remove bounded raw items and every content-bearing memory derived only from them. */
|
|
25
|
+
pruneBoundedRetention(sourceInstanceId: string, olderThanMs: number): ConnectedKnowledgePruneResult;
|
|
20
26
|
private rebuildDailySummary;
|
|
21
27
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
-
import { attachMemoryEvidence, claimKnowledgeSourceItems, completeKnowledgeSourceItemSynthesis, deleteMemoryEvidenceForRecord, listKnowledgeSourceItems } from "../storage/sqlite/knowledge-repository.js";
|
|
4
|
-
import { getMemoryRecord, upsertMemoryRecord } from "../storage/sqlite/memory-records-repository.js";
|
|
3
|
+
import { attachMemoryEvidence, claimKnowledgeSourceItems, completeKnowledgeSourceItemSynthesis, deleteMemoryEvidenceForRecord, listKnowledgeSourceItems, pruneBoundedKnowledgeSourceItems } from "../storage/sqlite/knowledge-repository.js";
|
|
4
|
+
import { deleteMemoryRecord, getMemoryRecord, upsertMemoryRecord } from "../storage/sqlite/memory-records-repository.js";
|
|
5
5
|
import "../storage/sqlite/index.js";
|
|
6
6
|
import { createHash, randomUUID } from "node:crypto";
|
|
7
7
|
//#region src/knowledge/connected-knowledge-pipeline.ts
|
|
@@ -180,13 +180,43 @@ var ConnectedKnowledgePipeline = class {
|
|
|
180
180
|
}
|
|
181
181
|
return result;
|
|
182
182
|
}
|
|
183
|
-
|
|
183
|
+
/** Remove bounded raw items and every content-bearing memory derived only from them. */
|
|
184
|
+
pruneBoundedRetention(sourceInstanceId, olderThanMs) {
|
|
185
|
+
const expired = [];
|
|
186
|
+
for (let offset = 0;; offset += 500) {
|
|
187
|
+
const page = listKnowledgeSourceItems({
|
|
188
|
+
sourceInstanceId,
|
|
189
|
+
retentionClass: "bounded",
|
|
190
|
+
retentionBeforeMs: olderThanMs,
|
|
191
|
+
includeDeleted: true,
|
|
192
|
+
limit: 500,
|
|
193
|
+
offset
|
|
194
|
+
});
|
|
195
|
+
expired.push(...page);
|
|
196
|
+
if (page.length < 500) break;
|
|
197
|
+
}
|
|
198
|
+
if (!expired.length) return {
|
|
199
|
+
rawDeleted: 0,
|
|
200
|
+
derivedDeleted: 0
|
|
201
|
+
};
|
|
202
|
+
const affectedDays = new Set(expired.map(dayFor));
|
|
203
|
+
let derivedDeleted = 0;
|
|
204
|
+
for (const item of expired) if (deleteMemoryRecord(knowledgeRecordId(item.id))) derivedDeleted += 1;
|
|
205
|
+
const rawDeleted = pruneBoundedKnowledgeSourceItems(sourceInstanceId, olderThanMs);
|
|
206
|
+
for (const day of affectedDays) if (this.rebuildDailySummary(sourceInstanceId, day, true)) derivedDeleted += 1;
|
|
207
|
+
return {
|
|
208
|
+
rawDeleted,
|
|
209
|
+
derivedDeleted
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
rebuildDailySummary(sourceInstanceId, day, deleteWhenEmpty = false) {
|
|
184
213
|
const items = listKnowledgeSourceItems({
|
|
185
214
|
sourceInstanceId,
|
|
186
215
|
limit: 500
|
|
187
216
|
}).filter((item) => dayFor(item) === day && item.synthesisStatus === "completed").slice(0, MAX_SUMMARY_ITEMS);
|
|
188
217
|
if (items.length === 0) {
|
|
189
218
|
const existing = getMemoryRecord(summaryRecordId(sourceInstanceId, day));
|
|
219
|
+
if (existing && deleteWhenEmpty) return deleteMemoryRecord(existing.id);
|
|
190
220
|
if (existing) upsertMemoryRecord({
|
|
191
221
|
id: existing.id,
|
|
192
222
|
providerId: "connected-knowledge",
|
|
@@ -210,7 +240,7 @@ var ConnectedKnowledgePipeline = class {
|
|
|
210
240
|
expiresAt: existing.expiresAt,
|
|
211
241
|
canonicalKey: existing.canonicalKey
|
|
212
242
|
});
|
|
213
|
-
return;
|
|
243
|
+
return false;
|
|
214
244
|
}
|
|
215
245
|
const sourceProvider = providerId(items[0]);
|
|
216
246
|
const lines = [`# ${sourceProvider} updates for ${day}`, ""];
|
|
@@ -263,6 +293,7 @@ var ConnectedKnowledgePipeline = class {
|
|
|
263
293
|
confidence: .72,
|
|
264
294
|
observedAt: item.occurredAt ?? item.sourceUpdatedAt
|
|
265
295
|
});
|
|
296
|
+
return false;
|
|
266
297
|
}
|
|
267
298
|
};
|
|
268
299
|
//#endregion
|
|
@@ -12,6 +12,8 @@ export interface RetrievalQueryProfile {
|
|
|
12
12
|
identifiers: string[];
|
|
13
13
|
intentKinds: string[];
|
|
14
14
|
timeHints: RetrievalTimeHint[];
|
|
15
|
+
selfReview: boolean;
|
|
15
16
|
scope: RetrievalScope;
|
|
16
17
|
}
|
|
18
|
+
export declare function isSelfReviewQuery(query: string): boolean;
|
|
17
19
|
export declare function buildRetrievalQueryProfile(query: string, scope?: RetrievalScope): RetrievalQueryProfile;
|