@xopcai/xopc 0.0.167 → 0.0.169
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-DjEDu38T.js → activity-store-DumQD8EX.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DQULz7qY.js → agent-avatar-dicebear-CNI1HQdV.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-CnzkBgKC.js → agents-DfpeWAnu.js} +2 -2
- package/dist/gateway/static/root/assets/{api-DwVCuPOb.js → api-D7eNcGmE.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-DOjWALVF.js → app-management-settings-panel-BPbnbnFn.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-C31COUIC.js → appearance-settings-WWFCDver.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-lSC486eu.js → apps-page-B27faKqW.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-DQPvLqfx.js → archive-plugin-Cu2dsFtI.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-DwT1x1rc.js → attachment-load-C9mycbtr.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-suggestion-card-ByYBiiMR.js → automation-suggestion-card-DtHqVViI.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-iZTnc1YZ.js → automations-page-BoH5grBX.js} +1 -1
- package/dist/gateway/static/root/assets/{binary-plugins-CRXiHoZS.js → binary-plugins-DqrPRyjm.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-CHO6ILiz.js → block-editor-B9dc3pqc.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-C-OOPZcJ.js → browser-settings-page-CK2fnxHY.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-3UaarfXS.js → browser-workflow-inputs-70k5yvTc.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-BFaa-N_D.js → browser-workflows-page-DBNuaWwR.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-BayH0Uom.js → capabilities-settings-panel-gg9GXU00.js} +6 -6
- package/dist/gateway/static/root/assets/{capability-presets-api-DdCHSzcA.js → capability-presets-api-CvV4M4Oe.js} +1 -1
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-A1qGVyll.js +1 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-BOkLI89e.js → channel-recipient-api-BnLOBd7v.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-settings-C-Spmwr5.js → channels-settings-H4vCzqiD.js} +1 -1
- package/dist/gateway/static/root/assets/channels-status-swr-DtswVkDX.js +1 -0
- package/dist/gateway/static/root/assets/{chunk-KS7C4IRE-uQ0fehio.js → chunk-KS7C4IRE-BMhrPKJC.js} +2 -2
- package/dist/gateway/static/root/assets/{connector-logo-CbcC0T6i.js → connector-logo-CYQPu4Nn.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-DpDmJ3Nx.js → connectors-page-DphVkloc.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-CR7RGQff.js → desktop-pet-Deb8fsr-.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-BudmCcPE.js → desktop-pet-settings-DHTY5Ku1.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-BLG2Oe6z.js → directory-picker-path-field-cGL2aEB6.js} +1 -1
- package/dist/gateway/static/root/assets/{dreaming-settings-BwBGC0SG.js → dreaming-settings-C2XF2wL4.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-Pr65_hLC.js → extension-debug-page-F8AzDx0d.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-BuJDcoKn.js → extension-page-ZrX_Ge87.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-B3802tn5.js → extension-settings-page-VypAD6ok.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-D-NVkfts.js → gateway-config-api-C-UsxEKi.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-DIdsKVXv.js → gateway-settings-ChG26Coy.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-qnEmj-vL.js → gateway-startup-retry-D73V3EVy.js} +1 -1
- package/dist/gateway/static/root/assets/{goal-create-dialog-51j_DxgV.js → goal-create-dialog-B6aBG2KK.js} +1 -1
- package/dist/gateway/static/root/assets/{goal-detail-page-CeqMr5GF.js → goal-detail-page-B_G9oVL1.js} +3 -3
- package/dist/gateway/static/root/assets/{goals-config-api-BkVBh7ct.js → goals-config-api-fv7JLhjy.js} +1 -1
- package/dist/gateway/static/root/assets/{goals-page-lf3oM4Xa.js → goals-page-BQmg_7aD.js} +1 -1
- package/dist/gateway/static/root/assets/{goals-settings-Cg7MJLvx.js → goals-settings-DlfyneMz.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-BV3kJOcX.js → heartbeat-settings-BPyFbSbh.js} +1 -1
- package/dist/gateway/static/root/assets/image-generation-api-CSKX7PsM.js +1 -0
- package/dist/gateway/static/root/assets/index-DJtuKve9.js +199 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-B9K5rTZZ.js → keyboard-shortcuts-settings-BUxrnWH_.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-ehzr9CBG.js → local-app-workbench-page-Dzlj4fH8.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-BBx6mfAD.js → local-apps-page-BsZMeDnS.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-tnRLWdx2.js → locale-store-DXq-Y8Bi.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-xuwEkusZ.js → logs-page-Bg1B-cKU.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-DRDddIt8.js → markdown-split-Cmaw70yM.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-Dn3hxhOV.js → media-plugins-Blqj_oJD.js} +1 -1
- package/dist/gateway/static/root/assets/{messages-B1EG4gdu.js → messages-Cj_n7gUv.js} +2 -2
- package/dist/gateway/static/root/assets/notes-page-B6Fdlf_s.js +1 -0
- package/dist/gateway/static/root/assets/{notes-workbench-DXGXn5XF.js → notes-workbench-4HYPR6Hb.js} +2 -2
- package/dist/gateway/static/root/assets/{page-tabs-P2BEd1D8.js → page-tabs-D6zFoyJY.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-DrkjmW0F.js → preview-open-alternatives-BLoo7Ad8.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-CGzMEowb.js → product-open-page-0-tt2dp7.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-IiE2ddWb.js → project-detail-page-CGa68F1d.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-DGOVhaYI.js → projects-page-BXmIeErj.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-l_y_Shgl.js → remote-access-hub-bxrIHaRt.js} +1 -1
- package/dist/gateway/static/root/assets/{save-bar-controls-BkGrufxl.js → save-bar-controls-9ujl7LRy.js} +1 -1
- package/dist/gateway/static/root/assets/{schedule-field-A8tDpL-9.js → schedule-field-e80Mj-0z.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-N6_hDWgx.js → schema-form-DYZQD-PL.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-CAX4ipPv.js → sessions-page-D_7ms_LG.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-VLuu9WHc.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-Bb6yYt5f.js → settings-form-section-Clt3p-mk.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-Q_Vh6HEl.js → settings-loading-skeleton-CTuS66nC.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-CjOtQpbR.js → settings-page-CMP_owwc.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-CtESNNdx.js → settings-page-layout-BWUV_wx6.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-CGxHXgJB.js → setup-status-panel-CAClgrxi.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-C65IsFmd.js → share-preview-page-tISZJtRK.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-Ct3fcbHr.js → shares-settings-t-hP0QDv.js} +1 -1
- package/dist/gateway/static/root/assets/skill-reload-api-CYRaxTqs.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-FeieOEn3.js → skills-page-C6CXLWnN.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-CdUl2I0D.js → system-settings-panel-6u0k0wJi.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-H9T49Iar.js → theme-store-DSpAOJ9G.js} +1 -1
- package/dist/gateway/static/root/assets/{time-picker-EkhqT3fS.js → time-picker-BF3f8el1.js} +1 -1
- package/dist/gateway/static/root/assets/{typed-models-lib-5xRRUE9Y.js → typed-models-lib-CyRCjjGS.js} +1 -1
- package/dist/gateway/static/root/assets/{use-channel-catalog-UACJTyH0.js → use-channel-catalog-B_Igd7ec.js} +1 -1
- package/dist/gateway/static/root/assets/{user-context-page-DHiRvd4i.js → user-context-page-B3zeQLeM.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-Bql0SPCp.js → voice-api-key-field-BanJk_cf.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-BcmZux7y.js → work-discovery-page-BCANmOUS.js} +1 -1
- package/dist/gateway/static/root/assets/{work-item-detail-page-D94Q5zVD.js → work-item-detail-page-t5xiIEFv.js} +1 -1
- package/dist/gateway/static/root/assets/{work-page-DdFBMDcB.js → work-page-CEI3zs-y.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-Dow7ZztR.js → workflow-run-setup-panel-DCXTQx7p.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-wOVSoduy.js → workflows-page-B8FRLCHp.js} +3 -3
- package/dist/gateway/static/root/index.html +7 -7
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.js +12 -5
- package/dist/src/agent/memory/dreaming/config.js +1 -1
- package/dist/src/agent/models/manager.d.ts +5 -0
- package/dist/src/agent/models/manager.js +8 -0
- package/dist/src/agent/prompt/sections/messaging-runtime.js +1 -1
- package/dist/src/agent/prompt/sections/tooling.js +1 -1
- package/dist/src/agent/tools/communication.js +25 -7
- package/dist/src/agent-runtime/index.js +1 -1
- package/dist/src/agent-runtime/runtime-profile.js +1 -1
- package/dist/src/channels/plugin-registry.js +6 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.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/hono/routes/composer-history.d.ts +3 -0
- package/dist/src/gateway/hono/routes/composer-history.js +28 -0
- package/dist/src/gateway/hono/routes/index.js +2 -0
- package/dist/src/session/client-history.d.ts +2 -0
- package/dist/src/session/client-history.js +2 -0
- package/dist/src/session/patch-metadata.d.ts +2 -0
- package/dist/src/session/patch-metadata.js +2 -0
- package/dist/src/storage/sqlite/composer-input-history-repository.d.ts +12 -0
- package/dist/src/storage/sqlite/composer-input-history-repository.js +42 -0
- package/dist/src/storage/sqlite/index.d.ts +1 -0
- package/dist/src/storage/sqlite/index.js +2 -1
- package/dist/src/storage/sqlite/migrations/059_composer_input_history.sql +8 -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/tui/backends/embedded-backend.d.ts +5 -1
- package/dist/src/tui/backends/embedded-backend.js +53 -9
- package/dist/src/tui/backends/gateway-sse-backend.d.ts +3 -1
- package/dist/src/tui/backends/gateway-sse-backend.js +23 -3
- package/dist/src/tui/components/custom-editor.d.ts +1 -0
- package/dist/src/tui/components/custom-editor.js +6 -0
- package/dist/src/tui/tui-backend.d.ts +11 -0
- package/dist/src/tui/tui-empty-session-cleanup.d.ts +11 -0
- package/dist/src/tui/tui-empty-session-cleanup.js +37 -0
- package/dist/src/tui/tui-submit.d.ts +1 -0
- package/dist/src/tui/tui-submit.js +1 -1
- package/dist/src/tui/tui.js +101 -17
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-JlhjAhT7.js +0 -2
- package/dist/gateway/static/root/assets/channels-status-swr-ZrqadU60.js +0 -1
- package/dist/gateway/static/root/assets/index-B24B26og.js +0 -199
- package/dist/gateway/static/root/assets/notes-page-BtKHSb4z.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-eVlH9brU.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-ElA5kabh.js +0 -1
|
@@ -11,29 +11,29 @@
|
|
|
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-DJtuKve9.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">
|
|
18
18
|
<link rel="modulepreload" crossorigin href="/assets/dist-CxGUk8J-.js">
|
|
19
19
|
<link rel="modulepreload" crossorigin href="/assets/Combination-14nmIgxH.js">
|
|
20
20
|
<link rel="modulepreload" crossorigin href="/assets/dist-C230izr8.js">
|
|
21
|
-
<link rel="modulepreload" crossorigin href="/assets/chunk-KS7C4IRE-
|
|
21
|
+
<link rel="modulepreload" crossorigin href="/assets/chunk-KS7C4IRE-BMhrPKJC.js">
|
|
22
22
|
<link rel="modulepreload" crossorigin href="/assets/vendor-swr-BIWyz7Rc.js">
|
|
23
23
|
<link rel="modulepreload" crossorigin href="/assets/createLucideIcon-DPHK1VkS.js">
|
|
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-Cj_n7gUv.js">
|
|
28
|
+
<link rel="modulepreload" crossorigin href="/assets/locale-store-DXq-Y8Bi.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-
|
|
34
|
+
<link rel="modulepreload" crossorigin href="/assets/gateway-startup-retry-D73V3EVy.js">
|
|
35
|
+
<link rel="modulepreload" crossorigin href="/assets/activity-store-DumQD8EX.js">
|
|
36
|
+
<link rel="modulepreload" crossorigin href="/assets/theme-store-DSpAOJ9G.js">
|
|
37
37
|
<link rel="stylesheet" crossorigin href="/assets/index-DfE2j0g8.css">
|
|
38
38
|
</head>
|
|
39
39
|
<body>
|
package/dist/package.js
CHANGED
|
@@ -649,7 +649,17 @@ var AgentManager = class {
|
|
|
649
649
|
if (isMemorySubsystemEnabled(cfg) && shouldRegisterCuratedMemoryTool(cfg)) rt.builtinMemoryStore.loadFromDiskSync();
|
|
650
650
|
const activeProjectContext = buildActiveProjectContextForPrompt(sessionKey);
|
|
651
651
|
const activeSelfVerifyContext = this.getSelfVerifyPromptContext(sessionKey, profile.agentId);
|
|
652
|
-
const
|
|
652
|
+
const profileModelRef = profile.primaryModelRef?.trim() || this.defaultModel;
|
|
653
|
+
const modelManager = this.config.getModelManager?.();
|
|
654
|
+
const initialModelRef = modelManager?.resolveInitialModelForSession(sessionKey, profileModelRef, profile.fallbacks) ?? profileModelRef;
|
|
655
|
+
let created;
|
|
656
|
+
try {
|
|
657
|
+
created = this.createAgentForProfile(sessionKey, profile, initialModelRef, resolvedPath, rt, activeProjectContext, activeSelfVerifyContext);
|
|
658
|
+
} catch (err) {
|
|
659
|
+
modelManager?.clearSessionProfileDefault(sessionKey);
|
|
660
|
+
throw err;
|
|
661
|
+
}
|
|
662
|
+
const { agent, registeredToolNames } = created;
|
|
653
663
|
this.agents.set(sessionKey, {
|
|
654
664
|
agent,
|
|
655
665
|
sessionKey,
|
|
@@ -663,8 +673,6 @@ var AgentManager = class {
|
|
|
663
673
|
activeSelfVerifyContext,
|
|
664
674
|
skillEnvPassthroughKeys: /* @__PURE__ */ new Set()
|
|
665
675
|
});
|
|
666
|
-
const modelRef = profile.primaryModelRef?.trim() || this.defaultModel;
|
|
667
|
-
this.config.getModelManager?.().setSessionProfileDefault(sessionKey, modelRef, profile.fallbacks);
|
|
668
676
|
log.debug({
|
|
669
677
|
sessionKey,
|
|
670
678
|
totalAgents: this.agents.size,
|
|
@@ -822,8 +830,7 @@ var AgentManager = class {
|
|
|
822
830
|
const inst = sessionKey?.trim() ? this.agents.get(sessionKey.trim()) : void 0;
|
|
823
831
|
return this.resolveCapabilityCatalogForInstance(inst);
|
|
824
832
|
}
|
|
825
|
-
createAgentForProfile(sessionKey, profile, resolvedWorkspacePath, rt, activeProjectContext, activeSelfVerifyContext) {
|
|
826
|
-
const modelRef = profile.primaryModelRef?.trim() || this.defaultModel;
|
|
833
|
+
createAgentForProfile(sessionKey, profile, modelRef, resolvedWorkspacePath, rt, activeProjectContext, activeSelfVerifyContext) {
|
|
827
834
|
const model = this.resolveModelStringToModel(modelRef);
|
|
828
835
|
let agent;
|
|
829
836
|
const contextFiles = this.resolveContextFilesForSession(sessionKey, profile);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DEFAULT_DEEP_CRON, DEFAULT_LIGHT_CRON, DEFAULT_REM_CRON } from "./constants.js";
|
|
2
1
|
import { buildMemoryRuntime } from "../../../agent-runtime/memory-runtime.js";
|
|
2
|
+
import { DEFAULT_DEEP_CRON, DEFAULT_LIGHT_CRON, DEFAULT_REM_CRON } from "./constants.js";
|
|
3
3
|
//#region src/agent/memory/dreaming/config.ts
|
|
4
4
|
function clampScore(value, fallback) {
|
|
5
5
|
if (!Number.isFinite(value)) return fallback;
|
|
@@ -31,6 +31,11 @@ export declare class ModelManager {
|
|
|
31
31
|
* Cleared by {@link updateFromConfig} or {@link clearSessionProfileDefault}.
|
|
32
32
|
*/
|
|
33
33
|
setSessionProfileDefault(sessionKey: string, modelRef: string, fallbacks?: string[]): void;
|
|
34
|
+
/**
|
|
35
|
+
* Register the profile model and return the model that should initialize the
|
|
36
|
+
* session agent. An existing per-session override always wins.
|
|
37
|
+
*/
|
|
38
|
+
resolveInitialModelForSession(sessionKey: string, profileModelRef: string, fallbacks?: string[]): string;
|
|
34
39
|
clearSessionProfileDefault(sessionKey: string): void;
|
|
35
40
|
/**
|
|
36
41
|
* Get current model name
|
|
@@ -44,6 +44,14 @@ var ModelManager = class {
|
|
|
44
44
|
if (cleanFallbacks.length > 0) this.sessionProfileFallbacks.set(sessionKey, cleanFallbacks);
|
|
45
45
|
else this.sessionProfileFallbacks.delete(sessionKey);
|
|
46
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Register the profile model and return the model that should initialize the
|
|
49
|
+
* session agent. An existing per-session override always wins.
|
|
50
|
+
*/
|
|
51
|
+
resolveInitialModelForSession(sessionKey, profileModelRef, fallbacks = []) {
|
|
52
|
+
this.setSessionProfileDefault(sessionKey, profileModelRef, fallbacks);
|
|
53
|
+
return this.getModelForSession(sessionKey);
|
|
54
|
+
}
|
|
47
55
|
clearSessionProfileDefault(sessionKey) {
|
|
48
56
|
this.sessionProfileDefaults.delete(sessionKey);
|
|
49
57
|
this.sessionProfileFallbacks.delete(sessionKey);
|
|
@@ -3,7 +3,7 @@ import { NO_REPLY } from "../../../heartbeat/tokens.js";
|
|
|
3
3
|
function buildMessagingSection(params) {
|
|
4
4
|
if (params.isMinimal || params.channels.length === 0) return "";
|
|
5
5
|
const channelList = params.channels.join(", ");
|
|
6
|
-
const messageToolLine = params.hasSendMessage ? `- Use \`send_message\` for proactive sends + channel actions` : "- Outbound messaging tools are not available in this session";
|
|
6
|
+
const messageToolLine = params.hasSendMessage ? `- Use \`send_message\` for proactive sends + channel actions; provide \`channel\` and \`chat_id\` together for a cross-channel destination` : "- Outbound messaging tools are not available in this session";
|
|
7
7
|
return [
|
|
8
8
|
"## Messaging",
|
|
9
9
|
`- Reply in current session → automatically routes to the source channel (${channelList})`,
|
|
@@ -57,7 +57,7 @@ const CORE_TOOL_SUMMARIES = {
|
|
|
57
57
|
web_fetch: "Fetch and extract readable content from a URL",
|
|
58
58
|
web_extract: "Extract structured content from a URL",
|
|
59
59
|
browser_use: "Control the configured browser",
|
|
60
|
-
send_message: "Send messages to the current channel",
|
|
60
|
+
send_message: "Send messages to the current conversation or an explicit configured channel",
|
|
61
61
|
send_media: "Send media attachments to the current channel",
|
|
62
62
|
memory_search: "Semantic search over indexed memory sources",
|
|
63
63
|
memory_get: "Read specific lines from memory sources returned by search",
|
|
@@ -6,6 +6,9 @@ init_logger();
|
|
|
6
6
|
const log = createLogger("MessageTool");
|
|
7
7
|
const MessageSendSchema = Type.Object({
|
|
8
8
|
content: Type.String({ description: "The message content to send" }),
|
|
9
|
+
channel: Type.Optional(Type.String({ description: "Configured destination channel (for example weixin or telegram). Defaults to the current channel." })),
|
|
10
|
+
chat_id: Type.Optional(Type.String({ description: "Destination chat/peer id. Required when channel is provided." })),
|
|
11
|
+
accountId: Type.Optional(Type.String({ description: "Optional account id for a multi-account destination channel." })),
|
|
9
12
|
mediaUrl: Type.Optional(Type.String({ description: "URL of the media to send" })),
|
|
10
13
|
mediaType: Type.Optional(Type.Enum({
|
|
11
14
|
photo: "photo",
|
|
@@ -36,7 +39,9 @@ const MessageSendSchema = Type.Object({
|
|
|
36
39
|
function createMessageTool(bus, getContext) {
|
|
37
40
|
return {
|
|
38
41
|
name: "send_message",
|
|
39
|
-
description: `Send a message to the
|
|
42
|
+
description: `Send a message to the current conversation or an explicit configured channel.
|
|
43
|
+
|
|
44
|
+
For a proactive cross-channel send, provide both \`channel\` and \`chat_id\` (for example \`channel: "weixin"\`). Use \`accountId\` when the destination has multiple configured accounts. Omit destination fields to reply to the current conversation.
|
|
40
45
|
|
|
41
46
|
TTS (Text-to-Speech) is handled automatically by the system based on configuration:
|
|
42
47
|
- trigger=off: Never use voice
|
|
@@ -50,18 +55,31 @@ When TTS is enabled, you may also use the \`text_to_speech\` tool to send a stan
|
|
|
50
55
|
async execute(_toolCallId, params, _signal) {
|
|
51
56
|
const p = params;
|
|
52
57
|
const ctx = getContext();
|
|
53
|
-
|
|
58
|
+
const requestedChannel = p.channel?.trim();
|
|
59
|
+
const requestedChatId = p.chat_id?.trim();
|
|
60
|
+
if (Boolean(requestedChannel) !== Boolean(requestedChatId)) return {
|
|
61
|
+
content: [{
|
|
62
|
+
type: "text",
|
|
63
|
+
text: "Error: channel and chat_id must be provided together"
|
|
64
|
+
}],
|
|
65
|
+
details: {}
|
|
66
|
+
};
|
|
67
|
+
if (!ctx && (!requestedChannel || !requestedChatId)) return {
|
|
54
68
|
content: [{
|
|
55
69
|
type: "text",
|
|
56
70
|
text: "Error: No active conversation context"
|
|
57
71
|
}],
|
|
58
72
|
details: {}
|
|
59
73
|
};
|
|
74
|
+
const channel = requestedChannel || ctx.channel;
|
|
75
|
+
const chatId = requestedChatId || ctx.chatId;
|
|
76
|
+
const accountId = p.accountId?.trim();
|
|
60
77
|
try {
|
|
61
78
|
const msg = {
|
|
62
|
-
channel
|
|
63
|
-
chat_id:
|
|
79
|
+
channel,
|
|
80
|
+
chat_id: chatId,
|
|
64
81
|
content: p.content,
|
|
82
|
+
...accountId ? { metadata: { accountId } } : {},
|
|
65
83
|
mediaUrl: p.mediaUrl,
|
|
66
84
|
mediaType: p.mediaType,
|
|
67
85
|
replyToMessageId: p.replyTo,
|
|
@@ -83,10 +101,10 @@ When TTS is enabled, you may also use the \`text_to_speech\` tool to send a stan
|
|
|
83
101
|
log.error({
|
|
84
102
|
err: error,
|
|
85
103
|
errorMessage: em,
|
|
86
|
-
channel
|
|
87
|
-
chatId
|
|
104
|
+
channel,
|
|
105
|
+
chatId,
|
|
88
106
|
contentPreview: String(p.content ?? "").slice(0, 100)
|
|
89
|
-
}, `send_message: outbound publish failed (${
|
|
107
|
+
}, `send_message: outbound publish failed (${channel}/${chatId}): ${em}`);
|
|
90
108
|
return {
|
|
91
109
|
content: [{
|
|
92
110
|
type: "text",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { buildMemoryRuntime } from "./memory-runtime.js";
|
|
2
1
|
import { checkBoundary } from "./boundary-guard.js";
|
|
3
2
|
import { resolveModelRole } from "./model-router.js";
|
|
4
3
|
import { buildRuntimeToolRegistry } from "./tool-registry.js";
|
|
4
|
+
import { buildMemoryRuntime } from "./memory-runtime.js";
|
|
5
5
|
import { resolveWorkflow, validateWorkflowForRuntime } from "./workflow-runtime.js";
|
|
6
6
|
import { buildAgentRuntimeProfile } from "./runtime-profile.js";
|
|
7
7
|
import { appendAgentRunEvent, createAgentRunTrace, finishAgentRunTrace, hashEffectiveManifest } from "./run-trace.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { buildAgentManifestPromptSection } from "../agent-manifest/prompt.js";
|
|
2
2
|
import "../agent-manifest/index.js";
|
|
3
|
-
import { buildMemoryRuntime } from "./memory-runtime.js";
|
|
4
3
|
import { checkBoundary } from "./boundary-guard.js";
|
|
5
4
|
import { resolveModelRole } from "./model-router.js";
|
|
6
5
|
import { buildRuntimeToolRegistry } from "./tool-registry.js";
|
|
6
|
+
import { buildMemoryRuntime } from "./memory-runtime.js";
|
|
7
7
|
import { resolveWorkflow, validateWorkflowForRuntime } from "./workflow-runtime.js";
|
|
8
8
|
//#region src/agent-runtime/runtime-profile.ts
|
|
9
9
|
function buildAgentRuntimeProfile(params) {
|
|
@@ -7,7 +7,12 @@ const log = createLogger("ChannelPluginRegistry");
|
|
|
7
7
|
var ChannelPluginRegistry = class {
|
|
8
8
|
plugins = /* @__PURE__ */ new Map();
|
|
9
9
|
register(plugin) {
|
|
10
|
-
|
|
10
|
+
const current = this.plugins.get(plugin.id);
|
|
11
|
+
if (current === plugin) {
|
|
12
|
+
log.debug({ channel: plugin.id }, "Channel plugin already registered");
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
if (current) log.warn({ channel: plugin.id }, "Channel plugin already registered, overwriting");
|
|
11
16
|
this.plugins.set(plugin.id, plugin);
|
|
12
17
|
syncChannelPluginsFromManager(this.all());
|
|
13
18
|
log.debug({ channel: plugin.id }, "Registered channel plugin");
|
|
@@ -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 v59).`,
|
|
56
56
|
hints: []
|
|
57
57
|
};
|
|
58
58
|
}
|
|
@@ -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";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { appendComposerInputHistory, clearComposerInputHistory, listComposerInputHistory } from "../../../storage/sqlite/composer-input-history-repository.js";
|
|
2
|
+
import "../../../storage/sqlite/index.js";
|
|
3
|
+
//#region src/gateway/hono/routes/composer-history.ts
|
|
4
|
+
const MAX_TEXT_LENGTH = 1e5;
|
|
5
|
+
function registerComposerHistoryRoutes(authenticated, deps) {
|
|
6
|
+
authenticated.get("/api/composer-history", (c) => {
|
|
7
|
+
return c.json({ items: listComposerInputHistory() });
|
|
8
|
+
});
|
|
9
|
+
authenticated.post("/api/composer-history", deps.strictRateLimitMiddleware, async (c) => {
|
|
10
|
+
const body = await c.req.json().catch(() => null);
|
|
11
|
+
const text = body && typeof body === "object" && typeof body.text === "string" ? body.text.trim() : "";
|
|
12
|
+
if (!text) return c.json({ error: "text is required" }, 400);
|
|
13
|
+
if (text.length > MAX_TEXT_LENGTH) return c.json({ error: "text is too long" }, 413);
|
|
14
|
+
const result = appendComposerInputHistory(text);
|
|
15
|
+
if (result.inserted) deps.service.emit("composer-history.appended", result.item);
|
|
16
|
+
return c.json(result);
|
|
17
|
+
});
|
|
18
|
+
authenticated.delete("/api/composer-history", deps.strictRateLimitMiddleware, (c) => {
|
|
19
|
+
const cleared = clearComposerInputHistory();
|
|
20
|
+
if (cleared > 0) deps.service.emit("composer-history.cleared", { cleared });
|
|
21
|
+
return c.json({
|
|
22
|
+
ok: true,
|
|
23
|
+
cleared
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { registerComposerHistoryRoutes };
|
|
@@ -8,6 +8,7 @@ import { registerSearchRoutes } from "./search.js";
|
|
|
8
8
|
import { registerMobileRoutes } from "./mobile.js";
|
|
9
9
|
import { registerTaskOutcomeRoutes } from "./task-outcomes.js";
|
|
10
10
|
import { registerInteractionStateRoutes } from "./interaction-state.js";
|
|
11
|
+
import { registerComposerHistoryRoutes } from "./composer-history.js";
|
|
11
12
|
import { registerLocalAppsRoutes } from "./local-apps.js";
|
|
12
13
|
import { registerWorkDiscoveryRoutes } from "./work-discovery.js";
|
|
13
14
|
import { mountAppLazyRoutePrefixes, registerAuthenticatedLazyRouteFallback } from "./lazy-fallback.js";
|
|
@@ -25,6 +26,7 @@ function registerCoreAuthenticatedRoutes(authenticated, deps) {
|
|
|
25
26
|
registerMobileRoutes(authenticated, deps);
|
|
26
27
|
registerTaskOutcomeRoutes(authenticated, deps);
|
|
27
28
|
registerInteractionStateRoutes(authenticated, deps);
|
|
29
|
+
registerComposerHistoryRoutes(authenticated, deps);
|
|
28
30
|
}
|
|
29
31
|
function registerAuthenticatedRoutes(app, authenticated, deps) {
|
|
30
32
|
registerCoreAuthenticatedRoutes(authenticated, deps);
|
|
@@ -7,6 +7,8 @@ export interface ClientHistoryMessage {
|
|
|
7
7
|
content: string;
|
|
8
8
|
displayIndex?: number;
|
|
9
9
|
rawContent?: string | unknown[];
|
|
10
|
+
/** Persisted inbound attachment metadata used by chat clients to reload media. */
|
|
11
|
+
media?: Message['media'];
|
|
10
12
|
timestamp?: number;
|
|
11
13
|
kind?: 'message' | 'compaction' | 'context' | 'bash' | 'custom' | 'branch';
|
|
12
14
|
tokensBefore?: number;
|
|
@@ -111,6 +111,7 @@ function messagesToClientHistory(messages, opts) {
|
|
|
111
111
|
out.push({
|
|
112
112
|
role: m.role,
|
|
113
113
|
content: text,
|
|
114
|
+
...m.media?.length ? { media: m.media } : {},
|
|
114
115
|
timestamp: parseTimestamp(m.timestamp)
|
|
115
116
|
});
|
|
116
117
|
continue;
|
|
@@ -410,6 +411,7 @@ function transcriptRowsToClientHistory(rows, opts) {
|
|
|
410
411
|
role: messageRow.role,
|
|
411
412
|
kind: "message",
|
|
412
413
|
content: flattenMessageContent(messageRow.content ?? ""),
|
|
414
|
+
...messageRow.media?.length ? { media: messageRow.media } : {},
|
|
413
415
|
...displayIndex !== void 0 ? { displayIndex } : {},
|
|
414
416
|
timestamp: parseTimestampValue(messageRow.timestamp)
|
|
415
417
|
});
|
|
@@ -8,5 +8,7 @@ export type SessionPatchBody = {
|
|
|
8
8
|
/** When true, `tags` replaces the tag list; otherwise tags are union-merged. */
|
|
9
9
|
replaceTags?: boolean;
|
|
10
10
|
customData?: Record<string, unknown>;
|
|
11
|
+
hiddenFromSessionList?: boolean;
|
|
12
|
+
projectId?: string;
|
|
11
13
|
};
|
|
12
14
|
export declare function applySessionPatchToMetadata(existing: SessionMetadata, patch: SessionPatchBody): Partial<SessionMetadata>;
|
|
@@ -15,6 +15,8 @@ function applySessionPatchToMetadata(existing, patch) {
|
|
|
15
15
|
...existing.customData ?? {},
|
|
16
16
|
...patch.customData
|
|
17
17
|
};
|
|
18
|
+
if (typeof patch.hiddenFromSessionList === "boolean") out.hiddenFromSessionList = patch.hiddenFromSessionList;
|
|
19
|
+
if (typeof patch.projectId === "string") out.projectId = patch.projectId.trim() || void 0;
|
|
18
20
|
return out;
|
|
19
21
|
}
|
|
20
22
|
//#endregion
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const COMPOSER_INPUT_HISTORY_LIMIT = 100;
|
|
2
|
+
export interface ComposerInputHistoryItem {
|
|
3
|
+
id: number;
|
|
4
|
+
text: string;
|
|
5
|
+
createdAt: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function listComposerInputHistory(limit?: number): ComposerInputHistoryItem[];
|
|
8
|
+
export declare function appendComposerInputHistory(text: string, now?: number): {
|
|
9
|
+
item: ComposerInputHistoryItem;
|
|
10
|
+
inserted: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare function clearComposerInputHistory(): number;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { getSqliteDatabase, runSqliteWriteTransaction } from "./transaction.js";
|
|
2
|
+
//#region src/storage/sqlite/composer-input-history-repository.ts
|
|
3
|
+
const COMPOSER_INPUT_HISTORY_LIMIT = 100;
|
|
4
|
+
function fromRow(row) {
|
|
5
|
+
return {
|
|
6
|
+
id: row.id,
|
|
7
|
+
text: row.text,
|
|
8
|
+
createdAt: row.created_at
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
function listComposerInputHistory(limit = 100) {
|
|
12
|
+
const boundedLimit = Number.isFinite(limit) ? Math.min(100, Math.max(1, Math.trunc(limit))) : 100;
|
|
13
|
+
return getSqliteDatabase().prepare("SELECT id, text, created_at FROM composer_input_history ORDER BY id DESC LIMIT ?").all(boundedLimit).map(fromRow);
|
|
14
|
+
}
|
|
15
|
+
function appendComposerInputHistory(text, now = Date.now()) {
|
|
16
|
+
const normalized = text.trim();
|
|
17
|
+
if (!normalized) throw new Error("Composer history text is required");
|
|
18
|
+
return runSqliteWriteTransaction((db) => {
|
|
19
|
+
const latest = db.prepare("SELECT id, text, created_at FROM composer_input_history ORDER BY id DESC LIMIT 1").get();
|
|
20
|
+
if (latest?.text === normalized) return {
|
|
21
|
+
item: fromRow(latest),
|
|
22
|
+
inserted: false
|
|
23
|
+
};
|
|
24
|
+
const result = db.prepare("INSERT INTO composer_input_history (text, created_at) VALUES (?, ?)").run(normalized, now);
|
|
25
|
+
const id = Number(result.lastInsertRowid);
|
|
26
|
+
db.prepare(`DELETE FROM composer_input_history
|
|
27
|
+
WHERE id NOT IN (SELECT id FROM composer_input_history ORDER BY id DESC LIMIT ?)`).run(100);
|
|
28
|
+
return {
|
|
29
|
+
item: {
|
|
30
|
+
id,
|
|
31
|
+
text: normalized,
|
|
32
|
+
createdAt: now
|
|
33
|
+
},
|
|
34
|
+
inserted: true
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function clearComposerInputHistory() {
|
|
39
|
+
return Number(runSqliteWriteTransaction((db) => db.prepare("DELETE FROM composer_input_history").run().changes));
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
export { COMPOSER_INPUT_HISTORY_LIMIT, appendComposerInputHistory, clearComposerInputHistory, listComposerInputHistory };
|
|
@@ -5,6 +5,7 @@ export { DatabaseSchemaMigrationGapError, DatabaseSchemaTooNewError, } from './m
|
|
|
5
5
|
export { discoverSqlMigrations, listRegisteredMigrationTargets } from './migrations/discover.js';
|
|
6
6
|
export { closeXopcDatabase, getXopcDatabase, isXopcDatabaseOpen, openXopcDatabase, requireXopcDatabase, resetXopcDatabaseSingletonForTest, type OpenXopcDatabaseOptions, type XopcDatabase, } from './connection.js';
|
|
7
7
|
export { getSqliteDatabase, runSqliteWriteTransaction } from './transaction.js';
|
|
8
|
+
export { appendComposerInputHistory, clearComposerInputHistory, listComposerInputHistory, COMPOSER_INPUT_HISTORY_LIMIT, type ComposerInputHistoryItem, } from './composer-input-history-repository.js';
|
|
8
9
|
export { getInteractionState, setInteractionState, updateInteractionStateFromMessage, type InteractionState, } from './interaction-state-repository.js';
|
|
9
10
|
export { buildRelationshipPrompt, getRelationshipSettings, isProactiveSupportAllowed, updateRelationshipSettings, type RelationshipSettings, type SupportMode, } from './relationship-settings-repository.js';
|
|
10
11
|
export { completeTaskOutcome, findTaskOutcomeForAssistant, getTaskOutcome, listTaskOutcomes, setTaskOutcomeFeedback, startTaskOutcome, summarizeTaskOutcomes, updateTaskOutcome, type TaskContract, type TaskEvidence, type TaskFeedbackOutcome, type TaskOutcome, type TaskOutcomeMetrics, type TaskOutcomeStatus, } from './task-outcome-repository.js';
|
|
@@ -6,6 +6,7 @@ import { XOPC_DB_BASELINE_SCHEMA_VERSION, XOPC_DB_SCHEMA_VERSION, applyPendingMi
|
|
|
6
6
|
import { ensureXopcDatabaseSchema } from "./schema.js";
|
|
7
7
|
import { closeXopcDatabase, getXopcDatabase, isXopcDatabaseOpen, openXopcDatabase, requireXopcDatabase, resetXopcDatabaseSingletonForTest } from "./connection.js";
|
|
8
8
|
import { getSqliteDatabase, runSqliteWriteTransaction } from "./transaction.js";
|
|
9
|
+
import { COMPOSER_INPUT_HISTORY_LIMIT, appendComposerInputHistory, clearComposerInputHistory, listComposerInputHistory } from "./composer-input-history-repository.js";
|
|
9
10
|
import { getInteractionState, setInteractionState, updateInteractionStateFromMessage } from "./interaction-state-repository.js";
|
|
10
11
|
import { buildRelationshipPrompt, getRelationshipSettings, isProactiveSupportAllowed, updateRelationshipSettings } from "./relationship-settings-repository.js";
|
|
11
12
|
import { completeTaskOutcome, findTaskOutcomeForAssistant, getTaskOutcome, listTaskOutcomes, setTaskOutcomeFeedback, startTaskOutcome, summarizeTaskOutcomes, updateTaskOutcome } from "./task-outcome-repository.js";
|
|
@@ -24,4 +25,4 @@ import { appendConnectorExecutionAudit, claimConnectorWebhookDelivery, completeC
|
|
|
24
25
|
import { getUserTrustPolicy, setUserTrustPolicy } from "./user-trust-repository.js";
|
|
25
26
|
import { consumeMemoryReferenceConsent, decideMemoryReferenceConsent, ensureMemoryReferenceConsentRequest, hasMemoryReferenceConsent, listMemoryReferenceConsents, revokeMemoryReferenceConsent } from "./memory-reference-consent-repository.js";
|
|
26
27
|
import { getUserProfilePromptState, setUserProfilePromptState } from "./user-profile-setup-repository.js";
|
|
27
|
-
export { DatabaseSchemaMigrationGapError, DatabaseSchemaTooNewError, SCHEMA_META_SCHEMA_VERSION_KEY, USER_UNDERSTANDING_REMEDIATION_POLICY, XOPC_DB_BASELINE_SCHEMA_VERSION, XOPC_DB_FILENAME, XOPC_DB_SCHEMA_VERSION, appendConnectorExecutionAudit, appendMemorySignal, appendMemoryTraceEvent, appendTranscriptEntry, applyPendingMigrations, attachMemoryEvidence, buildDefaultSessionMetadata, buildGlobalSessionStats, buildRelationshipPrompt, captureCompactionCheckpoint, claimConnectorWebhookDelivery, claimKnowledgeSourceItems, classifyStoredRow, closeXopcDatabase, completeConnectorWebhookDelivery, completeKnowledgeSourceItemSynthesis, completeTaskOutcome, consumeConnectorApproval, consumeMemoryReferenceConsent, createConnectorApproval, createObjectLinkRecord, decideConnectorApproval, decideMemoryReferenceConsent, deleteConnectorConnection, deleteConnectorInstallation, deleteMemoryEvidenceForRecord, deleteMemoryRecord, deleteNoteAgentContextRecord, deleteNoteRecord, deleteSessionConfig, deleteSessionRecord, discoverSqlMigrations, ensureMemoryReferenceConsentRequest, ensureSessionRecord, ensureXopcDatabaseSchema, estimateTokensFromMessages, extractFtsContent, findLatestMemoryInjectTrace, findSessionKeyBySessionId, findTaskOutcomeForAssistant, finishKnowledgeSyncRun, getActivityEventRecord, getCachedConnectorCatalogEntry, getCompactionCheckpointDetail, getConnectorApproval, getConnectorConnection, getConnectorInstallation, getCurrentSessionId, getGlobalSessionStats, getInteractionState, getKnowledgeConsumerWatermark, getKnowledgeSourceCursor, getKnowledgeSourceItem, getMemoryProviderState, getMemoryRecord, getNoteAgentContextRecord, getNoteRecord, getRelationshipSettings, getSessionConfig, getSessionMetadata, getSessionPersistedLevels, getSqliteDatabase, getTaskOutcome, getUserProfilePromptState, getUserTrustPolicy, getXopcDatabase, hasMemoryReferenceConsent, hasSessionConfig, hasUnresolvedMemoryConflict, incrementSessionStatsOnAppend, inspectSchemaMigrationStatus, isProactiveSupportAllowed, isXopcDatabaseOpen, listActivityRecords, listCachedConnectorCatalogEntries, listCompactionCheckpoints, listConnectorActionMetadata, listConnectorApprovals, listConnectorConnections, listConnectorExecutionAudit, listConnectorInstallations, listKnowledgeSourceChanges, listKnowledgeSourceItems, listKnowledgeSyncRuns, listMemoryEvidence, listMemoryRecords, listMemoryReferenceConsents, listMemorySignals, listMemoryTraceEvents, listNoteRecords, listObjectActivityRecords, listObjectLinkRecords, listProjectActivityRecords, listRegisteredMigrationTargets, listSessionMetadata, listSessionsByAgent, listTaskOutcomes, loadCheckpointRows, loadLlmMessagesForSession, loadTranscriptRows, loadTranscriptRowsForSession, markMemoryRecordsConflicted, metadataToSessionInsert, openXopcDatabase, paginateTranscriptMessages, patchSessionMetadata, readSchemaVersion, readSchemaVersionForTest, recordActivityEvent, releaseConnectorWebhookDelivery, replaceConnectorCatalogEntries, replaceTranscriptRows, requireXopcDatabase, resetSessionRecord, resetXopcDatabaseSingletonForTest, resolveMigrationsDir, resolveSessionAgentId, resolveXopcDatabasePath, restoreCompactionCheckpoint, revokeMemoryReferenceConsent, runSqliteWriteTransaction, searchMemoryIndex, searchMemoryRecords, sessionConfigRowToConfig, sessionRowToMetadata, setInteractionState, setKnowledgeConsumerWatermark, setKnowledgeSourceCursor, setKnowledgeSourceItemSynthesisStatus, setLatestMemoryInjectFeedback, setMemoryProviderState, setMemoryTraceFeedback, setSessionConfig, setTaskOutcomeFeedback, setUserProfilePromptState, setUserTrustPolicy, startKnowledgeSyncRun, startTaskOutcome, summarizeMemoryRecallFeedback, summarizeTaskOutcomes, summarizeUserUnderstandingQuality, syncMemoryIndex, transcriptEntryRowToStoredRow, updateInteractionStateFromMessage, updateRelationshipSettings, updateSessionConfig, updateSessionStats, updateTaskOutcome, upsertConnectorActionMetadata, upsertConnectorCatalogEntry, upsertConnectorConnection, upsertConnectorInstallation, upsertKnowledgeSourceItems, upsertMemoryRecord, upsertNoteAgentContextRecord, upsertNoteRecord };
|
|
28
|
+
export { COMPOSER_INPUT_HISTORY_LIMIT, DatabaseSchemaMigrationGapError, DatabaseSchemaTooNewError, SCHEMA_META_SCHEMA_VERSION_KEY, USER_UNDERSTANDING_REMEDIATION_POLICY, XOPC_DB_BASELINE_SCHEMA_VERSION, XOPC_DB_FILENAME, XOPC_DB_SCHEMA_VERSION, appendComposerInputHistory, appendConnectorExecutionAudit, appendMemorySignal, appendMemoryTraceEvent, appendTranscriptEntry, applyPendingMigrations, attachMemoryEvidence, buildDefaultSessionMetadata, buildGlobalSessionStats, buildRelationshipPrompt, captureCompactionCheckpoint, claimConnectorWebhookDelivery, claimKnowledgeSourceItems, classifyStoredRow, clearComposerInputHistory, closeXopcDatabase, completeConnectorWebhookDelivery, completeKnowledgeSourceItemSynthesis, completeTaskOutcome, consumeConnectorApproval, consumeMemoryReferenceConsent, createConnectorApproval, createObjectLinkRecord, decideConnectorApproval, decideMemoryReferenceConsent, deleteConnectorConnection, deleteConnectorInstallation, deleteMemoryEvidenceForRecord, deleteMemoryRecord, deleteNoteAgentContextRecord, deleteNoteRecord, deleteSessionConfig, deleteSessionRecord, discoverSqlMigrations, ensureMemoryReferenceConsentRequest, ensureSessionRecord, ensureXopcDatabaseSchema, estimateTokensFromMessages, extractFtsContent, findLatestMemoryInjectTrace, findSessionKeyBySessionId, findTaskOutcomeForAssistant, finishKnowledgeSyncRun, getActivityEventRecord, getCachedConnectorCatalogEntry, getCompactionCheckpointDetail, getConnectorApproval, getConnectorConnection, getConnectorInstallation, getCurrentSessionId, getGlobalSessionStats, getInteractionState, getKnowledgeConsumerWatermark, getKnowledgeSourceCursor, getKnowledgeSourceItem, getMemoryProviderState, getMemoryRecord, getNoteAgentContextRecord, getNoteRecord, getRelationshipSettings, getSessionConfig, getSessionMetadata, getSessionPersistedLevels, getSqliteDatabase, getTaskOutcome, getUserProfilePromptState, getUserTrustPolicy, getXopcDatabase, hasMemoryReferenceConsent, hasSessionConfig, hasUnresolvedMemoryConflict, incrementSessionStatsOnAppend, inspectSchemaMigrationStatus, isProactiveSupportAllowed, isXopcDatabaseOpen, listActivityRecords, listCachedConnectorCatalogEntries, listCompactionCheckpoints, listComposerInputHistory, listConnectorActionMetadata, listConnectorApprovals, listConnectorConnections, listConnectorExecutionAudit, listConnectorInstallations, listKnowledgeSourceChanges, listKnowledgeSourceItems, listKnowledgeSyncRuns, listMemoryEvidence, listMemoryRecords, listMemoryReferenceConsents, listMemorySignals, listMemoryTraceEvents, listNoteRecords, listObjectActivityRecords, listObjectLinkRecords, listProjectActivityRecords, listRegisteredMigrationTargets, listSessionMetadata, listSessionsByAgent, listTaskOutcomes, loadCheckpointRows, loadLlmMessagesForSession, loadTranscriptRows, loadTranscriptRowsForSession, markMemoryRecordsConflicted, metadataToSessionInsert, openXopcDatabase, paginateTranscriptMessages, patchSessionMetadata, readSchemaVersion, readSchemaVersionForTest, recordActivityEvent, releaseConnectorWebhookDelivery, replaceConnectorCatalogEntries, replaceTranscriptRows, requireXopcDatabase, resetSessionRecord, resetXopcDatabaseSingletonForTest, resolveMigrationsDir, resolveSessionAgentId, resolveXopcDatabasePath, restoreCompactionCheckpoint, revokeMemoryReferenceConsent, runSqliteWriteTransaction, searchMemoryIndex, searchMemoryRecords, sessionConfigRowToConfig, sessionRowToMetadata, setInteractionState, setKnowledgeConsumerWatermark, setKnowledgeSourceCursor, setKnowledgeSourceItemSynthesisStatus, setLatestMemoryInjectFeedback, setMemoryProviderState, setMemoryTraceFeedback, setSessionConfig, setTaskOutcomeFeedback, setUserProfilePromptState, setUserTrustPolicy, startKnowledgeSyncRun, startTaskOutcome, summarizeMemoryRecallFeedback, summarizeTaskOutcomes, summarizeUserUnderstandingQuality, syncMemoryIndex, transcriptEntryRowToStoredRow, updateInteractionStateFromMessage, updateRelationshipSettings, updateSessionConfig, updateSessionStats, updateTaskOutcome, upsertConnectorActionMetadata, upsertConnectorCatalogEntry, upsertConnectorConnection, upsertConnectorInstallation, upsertKnowledgeSourceItems, upsertMemoryRecord, upsertNoteAgentContextRecord, upsertNoteRecord };
|
|
@@ -3,7 +3,7 @@ import type { ApplyMigrationsOptions } from './types.js';
|
|
|
3
3
|
/** Baseline schema version applied from schema.sql on first open. */
|
|
4
4
|
export declare const XOPC_DB_BASELINE_SCHEMA_VERSION = 11;
|
|
5
5
|
/** Latest schema version this release supports (increment when adding migrations). */
|
|
6
|
-
export declare const XOPC_DB_SCHEMA_VERSION =
|
|
6
|
+
export declare const XOPC_DB_SCHEMA_VERSION = 59;
|
|
7
7
|
export declare function resolveMigrationsDir(override?: string): string;
|
|
8
8
|
/**
|
|
9
9
|
* Apply sequential SQL migrations from (currentVersion + 1) through targetVersion.
|
|
@@ -12,7 +12,7 @@ const log = createLogger("Sqlite:Migrations");
|
|
|
12
12
|
/** Baseline schema version applied from schema.sql on first open. */
|
|
13
13
|
const XOPC_DB_BASELINE_SCHEMA_VERSION = 11;
|
|
14
14
|
/** Latest schema version this release supports (increment when adding migrations). */
|
|
15
|
-
const XOPC_DB_SCHEMA_VERSION =
|
|
15
|
+
const XOPC_DB_SCHEMA_VERSION = 59;
|
|
16
16
|
const MODULE_DIR = dirname(fileURLToPath(import.meta.url));
|
|
17
17
|
function resolveMigrationsDir(override) {
|
|
18
18
|
if (override) return override;
|
|
@@ -46,7 +46,7 @@ function applySingleMigration(db, migration) {
|
|
|
46
46
|
* Each step runs in its own transaction and updates schema_meta on success.
|
|
47
47
|
*/
|
|
48
48
|
function applyPendingMigrations(db, options = {}) {
|
|
49
|
-
const targetVersion = options.targetVersion ??
|
|
49
|
+
const targetVersion = options.targetVersion ?? 59;
|
|
50
50
|
let currentVersion = readSchemaVersion(db);
|
|
51
51
|
if (currentVersion > targetVersion) throw new DatabaseSchemaTooNewError(currentVersion, targetVersion);
|
|
52
52
|
if (currentVersion >= targetVersion) return currentVersion;
|
|
@@ -62,7 +62,7 @@ function applyPendingMigrations(db, options = {}) {
|
|
|
62
62
|
}
|
|
63
63
|
/** Inspect schema version without mutating the database. */
|
|
64
64
|
function inspectSchemaMigrationStatus(db, options = {}) {
|
|
65
|
-
const appVersion = options.targetVersion ??
|
|
65
|
+
const appVersion = options.targetVersion ?? 59;
|
|
66
66
|
const dbVersion = readSchemaVersion(db);
|
|
67
67
|
if (dbVersion > appVersion) return {
|
|
68
68
|
dbVersion,
|
|
@@ -19,7 +19,7 @@ const log = createLogger('Sqlite:Migrations');
|
|
|
19
19
|
export const XOPC_DB_BASELINE_SCHEMA_VERSION = 11;
|
|
20
20
|
|
|
21
21
|
/** Latest schema version this release supports (increment when adding migrations). */
|
|
22
|
-
export const XOPC_DB_SCHEMA_VERSION =
|
|
22
|
+
export const XOPC_DB_SCHEMA_VERSION = 59;
|
|
23
23
|
|
|
24
24
|
const MODULE_DIR = dirname(fileURLToPath(import.meta.url));
|
|
25
25
|
|
|
@@ -31,7 +31,7 @@ function ensureXopcDatabaseSchema(db) {
|
|
|
31
31
|
bootstrapFreshDatabase(db);
|
|
32
32
|
currentVersion = 11;
|
|
33
33
|
}
|
|
34
|
-
applyPendingMigrations(db, { targetVersion:
|
|
34
|
+
applyPendingMigrations(db, { targetVersion: 59 });
|
|
35
35
|
}
|
|
36
36
|
//#endregion
|
|
37
37
|
export { SCHEMA_META_SCHEMA_VERSION_KEY, XOPC_DB_BASELINE_SCHEMA_VERSION, XOPC_DB_SCHEMA_VERSION, ensureSchemaMetaTable, ensureXopcDatabaseSchema, readSchemaVersion, readSchemaVersionForTest, setSchemaVersion };
|
|
@@ -2,7 +2,7 @@ import type { ExtensionRegistryImpl } from '../../extensions/loader.js';
|
|
|
2
2
|
import { type SessionTimelineItem } from '../../session/transcript-outline.js';
|
|
3
3
|
import { type Config } from '../../config/schema.js';
|
|
4
4
|
import type { ExportFormat } from '../../session/types.js';
|
|
5
|
-
import type { ChatSendOptions, HistoryMessage, TuiBackend, TuiCompactionResult, TuiEvent, TuiModelChoice, TuiShareRequest, TuiShareResult, TuiSessionStats, TuiSessionItem, TuiTranscriptTreeEntry, TuiAgentInfo, TuiWorkspaceFileSearchEntry, TuiWorkflowRunStartRequest, TuiWorkflowRunStartResult, TuiStartupProjectResult } from '../tui-backend.js';
|
|
5
|
+
import type { ChatSendOptions, HistoryMessage, TuiBackend, TuiCompactionResult, TuiComposerHistoryItem, TuiEvent, TuiModelChoice, TuiShareRequest, TuiShareResult, TuiSessionStats, TuiSessionItem, TuiTranscriptTreeEntry, TuiAgentInfo, TuiWorkspaceFileSearchEntry, TuiWorkflowRunStartRequest, TuiWorkflowRunStartResult, TuiStartupProjectResult } from '../tui-backend.js';
|
|
6
6
|
import type { SessionInfo } from '../tui-types.js';
|
|
7
7
|
interface EmbeddedBackendOptions {
|
|
8
8
|
config?: Config;
|
|
@@ -33,9 +33,12 @@ export declare class EmbeddedBackend implements TuiBackend {
|
|
|
33
33
|
onDisconnected?: (reason: string) => void;
|
|
34
34
|
constructor(opts?: EmbeddedBackendOptions);
|
|
35
35
|
get connectionLabel(): string;
|
|
36
|
+
getComposerInputHistory(): Promise<TuiComposerHistoryItem[]>;
|
|
37
|
+
recordComposerInputHistory(text: string): Promise<TuiComposerHistoryItem>;
|
|
36
38
|
start(): void;
|
|
37
39
|
private ensureAgent;
|
|
38
40
|
private createAgent;
|
|
41
|
+
private refreshXopcCloudModels;
|
|
39
42
|
stop(): void;
|
|
40
43
|
getActiveSignal(): AbortSignal | undefined;
|
|
41
44
|
private getWorkflowRunService;
|
|
@@ -100,6 +103,7 @@ export declare class EmbeddedBackend implements TuiBackend {
|
|
|
100
103
|
}>;
|
|
101
104
|
getSessionInfo(sessionKey: string): Promise<SessionInfo>;
|
|
102
105
|
listModels(): Promise<TuiModelChoice[]>;
|
|
106
|
+
refreshModels(): Promise<void>;
|
|
103
107
|
resetSession(sessionKey: string): Promise<void>;
|
|
104
108
|
patchSession(sessionKey: string, patch: Record<string, unknown>): Promise<void>;
|
|
105
109
|
compactSession(sessionKey: string, options?: {
|