chatlab-cli 0.36.1 → 0.37.0
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/{chat-command-XPJ43KSW.mjs → chat-command-WBAJBKIE.mjs} +15 -16
- package/dist/{chat-command-XPJ43KSW.mjs.map → chat-command-WBAJBKIE.mjs.map} +1 -1
- package/dist/chunk-2TV7M4CC.mjs +101 -0
- package/dist/chunk-2TV7M4CC.mjs.map +1 -0
- package/dist/{chunk-Q3NEL2KK.mjs → chunk-4J4MA3RC.mjs} +2606 -671
- package/dist/chunk-4J4MA3RC.mjs.map +1 -0
- package/dist/{chunk-NFTCEJBJ.mjs → chunk-5YOHLJFB.mjs} +98 -284
- package/dist/chunk-5YOHLJFB.mjs.map +1 -0
- package/dist/{chunk-L7TIIVAY.mjs → chunk-CR2MU7LN.mjs} +49 -55
- package/dist/chunk-CR2MU7LN.mjs.map +1 -0
- package/dist/{chunk-2JPFBIAG.mjs → chunk-DKIYHA3O.mjs} +284 -31
- package/dist/chunk-DKIYHA3O.mjs.map +1 -0
- package/dist/{chunk-FJOGBUXU.mjs → chunk-DQR2YS3I.mjs} +1930 -33
- package/dist/chunk-DQR2YS3I.mjs.map +1 -0
- package/dist/{chunk-JOVL7OTW.mjs → chunk-EJBBVLUN.mjs} +3 -3
- package/dist/chunk-EJBBVLUN.mjs.map +1 -0
- package/dist/{chunk-X2QBH24F.mjs → chunk-FM3GXNEO.mjs} +1643 -3
- package/dist/chunk-FM3GXNEO.mjs.map +1 -0
- package/dist/{chunk-R73XMAB2.mjs → chunk-MSMDLDPB.mjs} +96 -5
- package/dist/chunk-MSMDLDPB.mjs.map +1 -0
- package/dist/{chunk-NQHZPSW2.mjs → chunk-N2WGG3MS.mjs} +2 -2
- package/dist/{chunk-67HNPYZJ.mjs → chunk-RXMSZIYD.mjs} +3 -3
- package/dist/{chunk-5MJO4AJB.mjs → chunk-SQWN4GTQ.mjs} +2 -2
- package/dist/cli.mjs +9 -9
- package/dist/contacts-worker.mjs +2 -2
- package/dist/global-insight-worker.mjs +1 -1
- package/dist/{http-5RVY5J5U.mjs → http-X6OEOOSH.mjs} +12 -12
- package/dist/{import-ILTWVHKU.mjs → import-WBJ6YIQ7.mjs} +7 -7
- package/dist/index.mjs +12 -12
- package/dist/{mcp-Y2YXOFB4.mjs → mcp-FR6OKWKL.mjs} +8 -8
- package/dist/people-relationships-worker.mjs +2 -2
- package/dist/semantic-index-worker.mjs +1 -1
- package/dist/{src-OV5ZNE3Z.mjs → src-WE5HNN2O.mjs} +44 -14
- package/dist/{stream-import-XOUM3Z5W.mjs → stream-import-YYQVZDGQ.mjs} +7 -7
- package/dist/{worker-runtime-JNGURHDM.mjs → worker-runtime-YGB5ZDE4.mjs} +5 -5
- package/dist-cli-web/assets/AISettingsTab-Co2sM1iY.js +1 -0
- package/dist-cli-web/assets/{AboutTab-CxI8zJNz.js → AboutTab-DQ8r6mYE.js} +1 -1
- package/dist-cli-web/assets/ActionToolsPanel-CmYpw8Mt.css +1 -0
- package/dist-cli-web/assets/ActionToolsPanel.vue_vue_type_script_setup_true_lang--RPlmfIu.js +75 -0
- package/dist-cli-web/assets/{Alert-_MYcI_E2.js → Alert-DU1tLAAg.js} +1 -1
- package/dist-cli-web/assets/ApiSettingsTab-D5g5b79L.js +2 -0
- package/dist-cli-web/assets/BatchManageTab-BFUyVaGU.js +1 -0
- package/dist-cli-web/assets/{BufferResource-i64DlwQT.js → BufferResource-C-RfYwQW.js} +1 -1
- package/dist-cli-web/assets/{CanvasRenderer-B76mEt9A.js → CanvasRenderer-Dz7JAMrR.js} +1 -1
- package/dist-cli-web/assets/CardDecoration-D28DI1G9.js +1 -0
- package/dist-cli-web/assets/ChatRecordDrawer-Cph819yY.js +1 -0
- package/dist-cli-web/assets/{ChatRecordWorkspace-CyfPIlIy.js → ChatRecordWorkspace-BAfERdPc.js} +1 -1
- package/dist-cli-web/assets/Checkbox-B8uqt13j.js +1 -0
- package/dist-cli-web/assets/DataDirCleanupNotice-3sGBE5vU.js +1 -0
- package/dist-cli-web/assets/{DatePicker.vue_vue_type_script_setup_true_lang-DqNBNa1D.js → DatePicker.vue_vue_type_script_setup_true_lang-CQuub8-f.js} +1 -1
- package/dist-cli-web/assets/{DebugToolsPanel-CbNsD9co.js → DebugToolsPanel-Cwkr0BOY.js} +1 -1
- package/dist-cli-web/assets/EChart.vue_vue_type_script_setup_true_lang-BuLujQCF.js +1 -0
- package/dist-cli-web/assets/EChartBar.vue_vue_type_script_setup_true_lang-DuA5xbcC.js +1 -0
- package/dist-cli-web/assets/EChartLine.vue_vue_type_script_setup_true_lang-CvmMEfYq.js +1 -0
- package/dist-cli-web/assets/EChartWordcloud-CHVtyPR7.js +1 -0
- package/dist-cli-web/assets/FileDropZone.vue_vue_type_script_setup_true_lang-BKPy9Qv-.js +1 -0
- package/dist-cli-web/assets/{Filter-yxkeHO78.js → Filter-CMfRHIoK.js} +1 -1
- package/dist-cli-web/assets/GlobalTaskBar-Jz6MASCu.js +1 -0
- package/dist-cli-web/assets/GlobalTaskBar-haLzezqY.css +1 -0
- package/dist-cli-web/assets/GroupRelationshipGalaxyView-Ch4obfEq.js +1 -0
- package/dist-cli-web/assets/Label-CuryuymO.js +1 -0
- package/dist-cli-web/assets/LoadingState.vue_vue_type_script_setup_true_lang-CoeQsaiL.js +1 -0
- package/dist-cli-web/assets/MessageExportModal-JqGZ-iLr.js +1 -0
- package/dist-cli-web/assets/PageHeader-CPLgiKT8.css +1 -0
- package/dist-cli-web/assets/PageHeader-D4up77TB.js +1 -0
- package/dist-cli-web/assets/{PageTabs.vue_vue_type_script_setup_true_lang-_j82asQU.js → PageTabs.vue_vue_type_script_setup_true_lang-DYQRFk9s.js} +1 -1
- package/dist-cli-web/assets/{RelationshipGalaxyCanvas-BODk18aA.js → RelationshipGalaxyCanvas-Cn7Eta5U.js} +3 -3
- package/dist-cli-web/assets/{RelationshipGalaxyThreeCanvas-BJyuRiC-.js → RelationshipGalaxyThreeCanvas-LlaX57z6.js} +1 -1
- package/dist-cli-web/assets/{RenderTargetSystem-CVMvAUSv.js → RenderTargetSystem-JhA2PUFi.js} +1 -1
- package/dist-cli-web/assets/{RovingFocusItem-DC_06OmN.js → RovingFocusItem-DHaiTb4j.js} +1 -1
- package/dist-cli-web/assets/{ScreenCaptureModal-DrBFDOtC.js → ScreenCaptureModal-Bxhyt5g1.js} +1 -1
- package/dist-cli-web/assets/SectionTabs.vue_vue_type_script_setup_true_lang-BlAje3Tf.js +1 -0
- package/dist-cli-web/assets/Select-Beeqv0wU.js +1 -0
- package/dist-cli-web/assets/SettingsModal-DV8yDBJs.js +2 -0
- package/dist-cli-web/assets/{StorageTab-B0ebN0f8.js → StorageTab-B7GHadia.js} +1 -1
- package/dist-cli-web/assets/Switch-u4zlvUMa.js +1 -0
- package/dist-cli-web/assets/{Tabs-N3Q-Mpqi.js → Tabs-B7-Koq3x.js} +1 -1
- package/dist-cli-web/assets/Tabs-RWKHwtfM.js +1 -0
- package/dist-cli-web/assets/ThemeCard.vue_vue_type_script_setup_true_lang-ndsa3-aT.js +1 -0
- package/dist-cli-web/assets/{TimeSelect.vue_vue_type_script_setup_true_lang-Ccunouyf.js → TimeSelect.vue_vue_type_script_setup_true_lang-DKa1flT-.js} +1 -1
- package/dist-cli-web/assets/{VisuallyHiddenInput-OAJEt_Y5.js → VisuallyHiddenInput-DGDqcvUy.js} +1 -1
- package/dist-cli-web/assets/{WebGLRenderer-DuUeftYD.js → WebGLRenderer-ifvgA1fe.js} +1 -1
- package/dist-cli-web/assets/{WebGPURenderer-DoWQxiWZ.js → WebGPURenderer-DwzmuWF0.js} +1 -1
- package/dist-cli-web/assets/aiChat-BY4C3UQe.js +8 -0
- package/dist-cli-web/assets/base-BWDX-164.js +1 -0
- package/dist-cli-web/assets/{browserAll-Cb-mtR2y.js → browserAll-CSIIETeE.js} +1 -1
- package/dist-cli-web/assets/chatMessages--r0obAVw.css +1 -0
- package/dist-cli-web/assets/chatMessages-Zywjea1n.js +147 -0
- package/dist-cli-web/assets/cli-web-BRY49NWe.js +1 -0
- package/dist-cli-web/assets/{fetch-BbcFaCRB.js → fetch-Bf4cqeM3.js} +1 -1
- package/dist-cli-web/assets/{fetch-B-6tyYWu.js → fetch-BiXab0IF.js} +1 -1
- package/dist-cli-web/assets/{fetch-DEub4tOo.js → fetch-C8CcoTWY.js} +1 -1
- package/dist-cli-web/assets/{fetch-Qs38Hx1V.js → fetch-Co2vLmiE.js} +1 -1
- package/dist-cli-web/assets/{fetch-DLTlYnDB.js → fetch-D3nLtFBi.js} +1 -1
- package/dist-cli-web/assets/{fetch-BkA_so1e.js → fetch-DNSDHSqQ.js} +1 -1
- package/dist-cli-web/assets/{fetch-sYDJ-Zs8.js → fetch-DeHqF6yL.js} +1 -1
- package/dist-cli-web/assets/{fetch-B4PYy5JS.js → fetch-jx1VdM9j.js} +3 -3
- package/dist-cli-web/assets/{fetch-CW2fKvGp.js → fetch-mYSeL4Ki.js} +1 -1
- package/dist-cli-web/assets/fetch-qBaUXqFt.js +1 -0
- package/dist-cli-web/assets/{fetch-BzXuAaT3.js → fetch-r6mhEGrP.js} +1 -1
- package/dist-cli-web/assets/{fetch-AvsnJLWJ.js → fetch-wzv71PYy.js} +1 -1
- package/dist-cli-web/assets/{host-DYIkQqvY.js → host-1emQf9_4.js} +1 -1
- package/dist-cli-web/assets/{host-B6SQ6OGo.js → host-jXJHyyOX.js} +1 -1
- package/dist-cli-web/assets/index-2dJCozDq.js +64 -0
- package/dist-cli-web/assets/index-6ejRbH3h.js +2 -0
- package/dist-cli-web/assets/index-B4mJkX_d.js +1 -0
- package/dist-cli-web/assets/index-B7biznha.js +1 -0
- package/dist-cli-web/assets/index-BOcFyPCa.js +1 -0
- package/dist-cli-web/assets/index-BQ463TS7.js +1 -0
- package/dist-cli-web/assets/index-BZpR015e.css +1 -0
- package/dist-cli-web/assets/index-BgelKQTW.css +1 -0
- package/dist-cli-web/assets/index-C1A1FwpO.css +1 -0
- package/dist-cli-web/assets/index-CIIyg_o9.css +1 -0
- package/dist-cli-web/assets/{index-CShh95fU.js → index-CYc_VLgK.js} +1 -1
- package/dist-cli-web/assets/index-ClHMs0-a.js +2 -0
- package/dist-cli-web/assets/{index-D64XYYts.js → index-Cw0IhKZ6.js} +10 -10
- package/dist-cli-web/assets/{index-C_OS8Y8W.js → index-DOqbUvhA.js} +1 -1
- package/dist-cli-web/assets/index-DnpnIyle.js +135 -0
- package/dist-cli-web/assets/index-LV9LfFNu.js +1 -0
- package/dist-cli-web/assets/index-kePiJ3ca.js +137 -0
- package/dist-cli-web/assets/index-slDUxib2.js +1 -0
- package/dist-cli-web/assets/{people-page-header-0jvXFFnh.js → people-page-header-Cx5r9Bk2.js} +1 -1
- package/dist-cli-web/assets/{prompt-BPYj29Vq.js → prompt-BggEDxxi.js} +1 -1
- package/dist-cli-web/assets/{semantic-index-config-builder-vO37z355.js → semantic-index-config-builder-1sO0aEc1.js} +1 -1
- package/dist-cli-web/assets/{service-D29Vftq9.js → service-Bvq1fRkC.js} +1 -1
- package/dist-cli-web/assets/service-DkPheDt8.js +1 -0
- package/dist-cli-web/assets/service-DvI8O_7K.js +1 -0
- package/dist-cli-web/assets/useFormControl-B0aShtLp.js +1 -0
- package/dist-cli-web/assets/useTable-DC7oxmBl.js +1 -0
- package/dist-cli-web/assets/{useToast-BA0EwImD.js → useToast-CCPBE-Sy.js} +1 -1
- package/dist-cli-web/assets/{vendor-echarts-hTLhTs52.js → vendor-echarts-C9ugTmum.js} +1 -1
- package/dist-cli-web/assets/{vendor-echarts-wordcloud-B8CF_NgP.js → vendor-echarts-wordcloud-DNiU8Psq.js} +1 -1
- package/dist-cli-web/assets/{webworkerAll-ZPE_yGnC.js → webworkerAll-FCJk6reG.js} +1 -1
- package/dist-cli-web/index.html +2 -2
- package/package.json +1 -1
- package/dist/chunk-2JPFBIAG.mjs.map +0 -1
- package/dist/chunk-6QP47LID.mjs +0 -41
- package/dist/chunk-6QP47LID.mjs.map +0 -1
- package/dist/chunk-FJOGBUXU.mjs.map +0 -1
- package/dist/chunk-JOVL7OTW.mjs.map +0 -1
- package/dist/chunk-L7TIIVAY.mjs.map +0 -1
- package/dist/chunk-NFTCEJBJ.mjs.map +0 -1
- package/dist/chunk-Q3NEL2KK.mjs.map +0 -1
- package/dist/chunk-R73XMAB2.mjs.map +0 -1
- package/dist/chunk-X2QBH24F.mjs.map +0 -1
- package/dist-cli-web/assets/AISettingsTab-vvjijrc5.js +0 -1
- package/dist-cli-web/assets/ActionToolsPanel-Dp-ojXjO.css +0 -1
- package/dist-cli-web/assets/ActionToolsPanel.vue_vue_type_script_setup_true_lang-w0hHEodr.js +0 -110
- package/dist-cli-web/assets/ApiSettingsTab-CK7U6dVA.js +0 -2
- package/dist-cli-web/assets/BatchManageTab-1WnEqqpB.js +0 -1
- package/dist-cli-web/assets/ChatRecordDrawer-Bp6OSCrz.js +0 -1
- package/dist-cli-web/assets/Checkbox-Ci7IeRw1.js +0 -1
- package/dist-cli-web/assets/DataDirCleanupNotice-Dh63pOLt.js +0 -1
- package/dist-cli-web/assets/EChart.vue_vue_type_script_setup_true_lang-YeqmodwE.js +0 -1
- package/dist-cli-web/assets/EChartBar.vue_vue_type_script_setup_true_lang-C3pZmq0v.js +0 -1
- package/dist-cli-web/assets/EChartLine.vue_vue_type_script_setup_true_lang-Co6olfwv.js +0 -1
- package/dist-cli-web/assets/EChartWordcloud-rDusZwSq.js +0 -1
- package/dist-cli-web/assets/GlobalTaskBar-BlZ-fFiq.js +0 -1
- package/dist-cli-web/assets/GlobalTaskBar-COW_uBX6.css +0 -1
- package/dist-cli-web/assets/GroupRelationshipGalaxyView-BXQBX0zJ.js +0 -1
- package/dist-cli-web/assets/Label-CFAZFBQX.js +0 -1
- package/dist-cli-web/assets/LoadingState.vue_vue_type_script_setup_true_lang-CwgpqtMZ.js +0 -1
- package/dist-cli-web/assets/MessageExportModal-DU71grc7.js +0 -1
- package/dist-cli-web/assets/PageHeader-BDPf4NuI.js +0 -1
- package/dist-cli-web/assets/PageHeader-XIXMTomn.css +0 -1
- package/dist-cli-web/assets/SectionTabs.vue_vue_type_script_setup_true_lang-C-Zj2biH.js +0 -1
- package/dist-cli-web/assets/Select-DLK2LYhO.js +0 -1
- package/dist-cli-web/assets/SettingsModal-DqaR4Dx5.js +0 -2
- package/dist-cli-web/assets/Switch-CokhQWxm.js +0 -1
- package/dist-cli-web/assets/Tabs-D1UiZNaZ.js +0 -1
- package/dist-cli-web/assets/ThemeCard.vue_vue_type_script_setup_true_lang-OT-I0mbU.js +0 -1
- package/dist-cli-web/assets/aiChat-CdADfRnU.js +0 -8
- package/dist-cli-web/assets/cli-web-BHQCZLLg.js +0 -1
- package/dist-cli-web/assets/fetch-ul8-uQIb.js +0 -1
- package/dist-cli-web/assets/index--IEkRjKe.js +0 -64
- package/dist-cli-web/assets/index-9iaY_EWG.js +0 -1
- package/dist-cli-web/assets/index-B4J99zv3.css +0 -1
- package/dist-cli-web/assets/index-BBeqtL8d.css +0 -1
- package/dist-cli-web/assets/index-BnaLj2dx.css +0 -1
- package/dist-cli-web/assets/index-C7omDgiJ.js +0 -2
- package/dist-cli-web/assets/index-CHsM84U1.js +0 -2
- package/dist-cli-web/assets/index-CL8u01Pf.js +0 -137
- package/dist-cli-web/assets/index-DrCc8p_I.css +0 -1
- package/dist-cli-web/assets/index-UpTe1KzQ.js +0 -1
- package/dist-cli-web/assets/index-a8Hw6eD8.js +0 -1
- package/dist-cli-web/assets/index-jwjzZNKm.js +0 -1
- package/dist-cli-web/assets/index-pkxlF8Ee.js +0 -1
- package/dist-cli-web/assets/index-sWxuTsa7.js +0 -36
- package/dist-cli-web/assets/service-CVoA9yNf.js +0 -1
- package/dist-cli-web/assets/service-DMysyLCa.js +0 -1
- package/dist-cli-web/assets/useFormControl-DVawP2DO.js +0 -1
- package/dist-cli-web/assets/useTable-Bv3R_Hux.js +0 -1
- /package/dist/{chunk-NQHZPSW2.mjs.map → chunk-N2WGG3MS.mjs.map} +0 -0
- /package/dist/{chunk-67HNPYZJ.mjs.map → chunk-RXMSZIYD.mjs.map} +0 -0
- /package/dist/{chunk-5MJO4AJB.mjs.map → chunk-SQWN4GTQ.mjs.map} +0 -0
- /package/dist/{http-5RVY5J5U.mjs.map → http-X6OEOOSH.mjs.map} +0 -0
- /package/dist/{import-ILTWVHKU.mjs.map → import-WBJ6YIQ7.mjs.map} +0 -0
- /package/dist/{mcp-Y2YXOFB4.mjs.map → mcp-FR6OKWKL.mjs.map} +0 -0
- /package/dist/{src-OV5ZNE3Z.mjs.map → src-WE5HNN2O.mjs.map} +0 -0
- /package/dist/{stream-import-XOUM3Z5W.mjs.map → stream-import-YYQVZDGQ.mjs.map} +0 -0
- /package/dist/{worker-runtime-JNGURHDM.mjs.map → worker-runtime-YGB5ZDE4.mjs.map} +0 -0
|
@@ -11,14 +11,15 @@ import {
|
|
|
11
11
|
getServerAiLogger,
|
|
12
12
|
getSkillManagerCore,
|
|
13
13
|
initServerAiLogger
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-MSMDLDPB.mjs";
|
|
15
15
|
import {
|
|
16
16
|
AGENT_TOOL_REGISTRY,
|
|
17
17
|
CoreDataProvider
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-FM3GXNEO.mjs";
|
|
19
19
|
import {
|
|
20
|
+
prepareUnixSocket,
|
|
20
21
|
resolveCliLocalEmbeddingRuntimeConfig
|
|
21
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-2TV7M4CC.mjs";
|
|
22
23
|
import {
|
|
23
24
|
analyzeIncrementalImport,
|
|
24
25
|
analyzeNewImport,
|
|
@@ -26,10 +27,10 @@ import {
|
|
|
26
27
|
autoImportBatch,
|
|
27
28
|
incrementalImport,
|
|
28
29
|
streamImport
|
|
29
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-RXMSZIYD.mjs";
|
|
30
31
|
import {
|
|
31
32
|
assertCliDataDirCompatible
|
|
32
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-SQWN4GTQ.mjs";
|
|
33
34
|
import {
|
|
34
35
|
getVersion
|
|
35
36
|
} from "./chunk-5ADKYYNA.mjs";
|
|
@@ -58,11 +59,10 @@ import {
|
|
|
58
59
|
getPendingNodeDataDirMigration,
|
|
59
60
|
hasPendingElectronDataWarning,
|
|
60
61
|
importDemoSessions,
|
|
61
|
-
initNlpDir,
|
|
62
62
|
isDictDownloaded,
|
|
63
63
|
segmentText,
|
|
64
64
|
serializeChatLabToJsonl
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-5YOHLJFB.mjs";
|
|
66
66
|
import {
|
|
67
67
|
ArchiveImportError,
|
|
68
68
|
ArchiveImportSourceManager,
|
|
@@ -77,6 +77,7 @@ import {
|
|
|
77
77
|
TempDbWriter,
|
|
78
78
|
createChatLabTempDir,
|
|
79
79
|
createContactsService,
|
|
80
|
+
createCrossChatAnalysisService,
|
|
80
81
|
createGlobalInsightService,
|
|
81
82
|
createNavigationLayoutService,
|
|
82
83
|
createPeopleRelationshipsService,
|
|
@@ -102,9 +103,10 @@ import {
|
|
|
102
103
|
session_service_exports,
|
|
103
104
|
streamParseFileInfo,
|
|
104
105
|
summary_service_exports
|
|
105
|
-
} from "./chunk-
|
|
106
|
+
} from "./chunk-DQR2YS3I.mjs";
|
|
106
107
|
import {
|
|
107
108
|
AIChatManager,
|
|
109
|
+
AIMemoryService,
|
|
108
110
|
ALL_MIGRATIONS,
|
|
109
111
|
ANNUAL_SUMMARY_PLUGIN_ID,
|
|
110
112
|
BUILTIN_MODELS,
|
|
@@ -169,16 +171,20 @@ import {
|
|
|
169
171
|
getWeekdayActivity,
|
|
170
172
|
getYearlyActivity,
|
|
171
173
|
initAppLogger,
|
|
174
|
+
initNlpDir,
|
|
172
175
|
isNewerStableVersion,
|
|
176
|
+
linkAIMemorySources,
|
|
177
|
+
listAIMemoriesWithSourceStatus,
|
|
173
178
|
loadConfig,
|
|
174
179
|
mergeRulesForLocale,
|
|
175
180
|
queryMessages,
|
|
181
|
+
resolveAIMemorySourceStatus,
|
|
176
182
|
runSimpleLlmStream,
|
|
177
183
|
stripAvatarFields,
|
|
178
184
|
validateApiKey,
|
|
179
185
|
verifyCliDataPath,
|
|
180
186
|
writeConfigField
|
|
181
|
-
} from "./chunk-
|
|
187
|
+
} from "./chunk-4J4MA3RC.mjs";
|
|
182
188
|
|
|
183
189
|
// src/http/index.ts
|
|
184
190
|
import * as fs11 from "fs";
|
|
@@ -810,14 +816,16 @@ function registerNodePlugins(server2, context, plugins) {
|
|
|
810
816
|
}
|
|
811
817
|
|
|
812
818
|
// ../../packages/http-routes/src/routes/web/ai-agent-stream.ts
|
|
819
|
+
import { randomUUID } from "crypto";
|
|
813
820
|
var activeAgentAborts = /* @__PURE__ */ new Map();
|
|
814
|
-
function registerAiAgentStreamRoutes(server2, ctx) {
|
|
821
|
+
function registerAiAgentStreamRoutes(server2, ctx, memoryProvenanceCoordinator) {
|
|
815
822
|
if (!ctx.runAgentStream) return;
|
|
816
823
|
const runAgentStream = ctx.runAgentStream;
|
|
817
824
|
server2.post("/_web/ai/agent/stream", async (request, reply) => {
|
|
818
|
-
const requestId = `req_${
|
|
825
|
+
const requestId = `req_${randomUUID()}`;
|
|
819
826
|
const abortController = new AbortController();
|
|
820
827
|
activeAgentAborts.set(requestId, abortController);
|
|
828
|
+
memoryProvenanceCoordinator?.begin(requestId, request.body.aiChatId);
|
|
821
829
|
reply.raw.writeHead(200, {
|
|
822
830
|
"Content-Type": "text/event-stream",
|
|
823
831
|
"Cache-Control": "no-cache",
|
|
@@ -849,6 +857,11 @@ data: ${JSON.stringify(data)}
|
|
|
849
857
|
request.body,
|
|
850
858
|
(chunk) => {
|
|
851
859
|
if (chunk.type === "done") emittedDone = true;
|
|
860
|
+
if (chunk.type === "memory_change" && chunk.memoryId) {
|
|
861
|
+
memoryProvenanceCoordinator?.record(requestId, chunk.memoryId);
|
|
862
|
+
safeSendSSE(chunk.type, { ...chunk, provenanceToken: requestId });
|
|
863
|
+
return;
|
|
864
|
+
}
|
|
852
865
|
safeSendSSE(chunk.type, chunk);
|
|
853
866
|
},
|
|
854
867
|
abortController.signal
|
|
@@ -857,6 +870,8 @@ data: ${JSON.stringify(data)}
|
|
|
857
870
|
const msg = error instanceof Error ? error.message : String(error);
|
|
858
871
|
safeSendSSE("error", { type: "error", error: { name: "ServerError", message: msg } });
|
|
859
872
|
} finally {
|
|
873
|
+
const expectedParentMessageId = ctx.aiChatManager?.getAIChat(request.body.aiChatId)?.activeMessageId ?? null;
|
|
874
|
+
memoryProvenanceCoordinator?.complete(requestId, expectedParentMessageId);
|
|
860
875
|
releaseInteractiveWork();
|
|
861
876
|
if (!emittedDone) safeSendSSE("done", { type: "done", isFinished: true });
|
|
862
877
|
activeAgentAborts.delete(requestId);
|
|
@@ -947,6 +962,13 @@ function registerAiChatRoutes(server2, ctx) {
|
|
|
947
962
|
if (!sessionId) return [];
|
|
948
963
|
return cm.getAIChats(sessionId);
|
|
949
964
|
});
|
|
965
|
+
server2.post("/_web/ai/global-chats", async (request) => {
|
|
966
|
+
const { title, assistantId } = request.body;
|
|
967
|
+
return cm.createGlobalAIChat(title, assistantId);
|
|
968
|
+
});
|
|
969
|
+
server2.get("/_web/ai/global-chats", async () => {
|
|
970
|
+
return cm.getGlobalAIChats();
|
|
971
|
+
});
|
|
950
972
|
server2.get("/_web/ai/chats/:id", async (request, reply) => {
|
|
951
973
|
const conv = cm.getAIChat(request.params.id);
|
|
952
974
|
if (!conv) return reply.code(404).send({ error: "AI chat not found" });
|
|
@@ -958,8 +980,14 @@ function registerAiChatRoutes(server2, ctx) {
|
|
|
958
980
|
server2.delete("/_web/ai/chats/:id", async (request) => {
|
|
959
981
|
return cm.deleteAIChat(request.params.id);
|
|
960
982
|
});
|
|
983
|
+
server2.post("/_web/ai/chats/:id/message-pair", async (request) => {
|
|
984
|
+
return cm.addMessagePair(request.params.id, request.body.userMessage, request.body.assistantMessage);
|
|
985
|
+
});
|
|
986
|
+
server2.post("/_web/ai/chats/:id/replace-latest-message-round", async (request) => {
|
|
987
|
+
return cm.replaceLatestMessageRound(request.params.id, request.body);
|
|
988
|
+
});
|
|
961
989
|
server2.post("/_web/ai/chats/:id/messages", async (request) => {
|
|
962
|
-
const { role, content, dataKeywords, dataMessageCount, contentBlocks, tokenUsage } = request.body;
|
|
990
|
+
const { role, content, dataKeywords, dataMessageCount, contentBlocks, tokenUsage, entityRefs } = request.body;
|
|
963
991
|
return cm.addMessage(
|
|
964
992
|
request.params.id,
|
|
965
993
|
role,
|
|
@@ -967,7 +995,8 @@ function registerAiChatRoutes(server2, ctx) {
|
|
|
967
995
|
dataKeywords,
|
|
968
996
|
dataMessageCount,
|
|
969
997
|
contentBlocks,
|
|
970
|
-
tokenUsage
|
|
998
|
+
tokenUsage,
|
|
999
|
+
entityRefs
|
|
971
1000
|
);
|
|
972
1001
|
});
|
|
973
1002
|
server2.get("/_web/ai/chats/:id/messages", async (request) => {
|
|
@@ -989,11 +1018,11 @@ function registerAiChatRoutes(server2, ctx) {
|
|
|
989
1018
|
return cm.forkAIChat(request.params.id, upToMessageId, title);
|
|
990
1019
|
});
|
|
991
1020
|
server2.put("/_web/ai/messages/:messageId/content", async (request, reply) => {
|
|
992
|
-
const { content } = request.body;
|
|
1021
|
+
const { content, entityRefs } = request.body;
|
|
993
1022
|
if (!content || typeof content !== "string") {
|
|
994
1023
|
return reply.code(400).send({ error: "content is required" });
|
|
995
1024
|
}
|
|
996
|
-
cm.updateMessageContent(request.params.messageId, content);
|
|
1025
|
+
cm.updateMessageContent(request.params.messageId, content, entityRefs);
|
|
997
1026
|
return { success: true };
|
|
998
1027
|
});
|
|
999
1028
|
server2.post("/_web/ai/chats/:id/messages/:messageId/delete-relink", async (request, reply) => {
|
|
@@ -1005,11 +1034,19 @@ function registerAiChatRoutes(server2, ctx) {
|
|
|
1005
1034
|
return { success: true };
|
|
1006
1035
|
});
|
|
1007
1036
|
server2.post("/_web/ai/chats/:id/messages/insert-after", async (request, reply) => {
|
|
1008
|
-
const { afterMessageId, role, content, contentBlocks, tokenUsage } = request.body;
|
|
1037
|
+
const { afterMessageId, role, content, contentBlocks, tokenUsage, entityRefs } = request.body;
|
|
1009
1038
|
if (!afterMessageId || typeof afterMessageId !== "string") {
|
|
1010
1039
|
return reply.code(400).send({ error: "afterMessageId is required" });
|
|
1011
1040
|
}
|
|
1012
|
-
return cm.insertMessageAfter(
|
|
1041
|
+
return cm.insertMessageAfter(
|
|
1042
|
+
request.params.id,
|
|
1043
|
+
afterMessageId,
|
|
1044
|
+
role,
|
|
1045
|
+
content,
|
|
1046
|
+
contentBlocks,
|
|
1047
|
+
tokenUsage,
|
|
1048
|
+
entityRefs
|
|
1049
|
+
);
|
|
1013
1050
|
});
|
|
1014
1051
|
server2.get("/_web/ai/chats/:id/token-usage", async (request) => {
|
|
1015
1052
|
return cm.getAIChatTokenUsage(request.params.id);
|
|
@@ -1336,6 +1373,127 @@ function registerAiLogRoutes(server2, ctx) {
|
|
|
1336
1373
|
});
|
|
1337
1374
|
}
|
|
1338
1375
|
|
|
1376
|
+
// ../../packages/http-routes/src/routes/web/ai-memories.ts
|
|
1377
|
+
function parseScope(input) {
|
|
1378
|
+
const scopeType = input.scopeType;
|
|
1379
|
+
if (scopeType !== "global" && scopeType !== "self" && scopeType !== "contact" && scopeType !== "group") {
|
|
1380
|
+
throw new Error("scopeType must be global, self, contact, or group");
|
|
1381
|
+
}
|
|
1382
|
+
return {
|
|
1383
|
+
scopeType,
|
|
1384
|
+
scopeId: typeof input.scopeId === "string" ? input.scopeId : null
|
|
1385
|
+
};
|
|
1386
|
+
}
|
|
1387
|
+
function sendBadRequest(reply, error) {
|
|
1388
|
+
return reply.code(400).send({ error: error instanceof Error ? error.message : String(error) });
|
|
1389
|
+
}
|
|
1390
|
+
function registerAiMemoryRoutes(server2, ctx, memoryProvenanceCoordinator) {
|
|
1391
|
+
const memoryService = ctx.aiMemoryService;
|
|
1392
|
+
if (!memoryService) return;
|
|
1393
|
+
const aiChatManager2 = ctx.aiChatManager;
|
|
1394
|
+
const withSourceStatus = (entry) => ({
|
|
1395
|
+
...entry,
|
|
1396
|
+
sourceStatus: aiChatManager2 ? resolveAIMemorySourceStatus(entry, aiChatManager2) : entry.sourceAIChatId ? "unavailable" : "none"
|
|
1397
|
+
});
|
|
1398
|
+
server2.get("/_web/ai/memories", async (request, reply) => {
|
|
1399
|
+
try {
|
|
1400
|
+
const { scopeType, scopeId } = request.query;
|
|
1401
|
+
if (!scopeType) {
|
|
1402
|
+
if (scopeId != null) throw new Error("scopeType is required when scopeId is provided");
|
|
1403
|
+
return aiChatManager2 ? listAIMemoriesWithSourceStatus(memoryService, aiChatManager2) : memoryService.list().map((entry) => ({
|
|
1404
|
+
...entry,
|
|
1405
|
+
sourceStatus: entry.sourceAIChatId ? "unavailable" : "none"
|
|
1406
|
+
}));
|
|
1407
|
+
}
|
|
1408
|
+
const scope = parseScope({ scopeType, scopeId });
|
|
1409
|
+
return aiChatManager2 ? listAIMemoriesWithSourceStatus(memoryService, aiChatManager2, scope) : memoryService.list(scope).map((entry) => ({
|
|
1410
|
+
...entry,
|
|
1411
|
+
sourceStatus: entry.sourceAIChatId ? "unavailable" : "none"
|
|
1412
|
+
}));
|
|
1413
|
+
} catch (error) {
|
|
1414
|
+
return sendBadRequest(reply, error);
|
|
1415
|
+
}
|
|
1416
|
+
});
|
|
1417
|
+
server2.post("/_web/ai/memories/link-sources", async (request, reply) => {
|
|
1418
|
+
if (!aiChatManager2) {
|
|
1419
|
+
return reply.code(503).send({ error: "AI conversation storage is unavailable" });
|
|
1420
|
+
}
|
|
1421
|
+
try {
|
|
1422
|
+
const body = request.body ?? {};
|
|
1423
|
+
const input = {
|
|
1424
|
+
provenanceToken: body.provenanceToken ?? "",
|
|
1425
|
+
aiChatId: body.aiChatId ?? "",
|
|
1426
|
+
userMessageId: body.userMessageId ?? "",
|
|
1427
|
+
assistantMessageId: body.assistantMessageId ?? "",
|
|
1428
|
+
memoryIds: body.memoryIds ?? []
|
|
1429
|
+
};
|
|
1430
|
+
if (!memoryProvenanceCoordinator) throw new Error("Memory provenance coordination is unavailable");
|
|
1431
|
+
const provenance = memoryProvenanceCoordinator.validate(input.provenanceToken, input.aiChatId, input.memoryIds);
|
|
1432
|
+
const result = linkAIMemorySources(memoryService, aiChatManager2, input, provenance);
|
|
1433
|
+
memoryProvenanceCoordinator.consume(input.provenanceToken);
|
|
1434
|
+
return result;
|
|
1435
|
+
} catch (error) {
|
|
1436
|
+
return sendBadRequest(reply, error);
|
|
1437
|
+
}
|
|
1438
|
+
});
|
|
1439
|
+
server2.post("/_web/ai/memories", async (request, reply) => {
|
|
1440
|
+
try {
|
|
1441
|
+
const scope = parseScope(request.body ?? {});
|
|
1442
|
+
return withSourceStatus(
|
|
1443
|
+
memoryService.create({
|
|
1444
|
+
...scope,
|
|
1445
|
+
content: request.body?.content ?? "",
|
|
1446
|
+
sourceType: "user",
|
|
1447
|
+
sourceAIChatId: null,
|
|
1448
|
+
sourceMessageId: null
|
|
1449
|
+
})
|
|
1450
|
+
);
|
|
1451
|
+
} catch (error) {
|
|
1452
|
+
return sendBadRequest(reply, error);
|
|
1453
|
+
}
|
|
1454
|
+
});
|
|
1455
|
+
server2.put("/_web/ai/memories/:id", async (request, reply) => {
|
|
1456
|
+
if (!memoryService.get(request.params.id)) {
|
|
1457
|
+
return reply.code(404).send({ error: "AI memory not found" });
|
|
1458
|
+
}
|
|
1459
|
+
try {
|
|
1460
|
+
return withSourceStatus(
|
|
1461
|
+
memoryService.update(request.params.id, {
|
|
1462
|
+
content: request.body?.content ?? "",
|
|
1463
|
+
sourceType: "user",
|
|
1464
|
+
sourceAIChatId: null,
|
|
1465
|
+
sourceMessageId: null
|
|
1466
|
+
})
|
|
1467
|
+
);
|
|
1468
|
+
} catch (error) {
|
|
1469
|
+
return sendBadRequest(reply, error);
|
|
1470
|
+
}
|
|
1471
|
+
});
|
|
1472
|
+
server2.delete("/_web/ai/memories/:id", async (request, reply) => {
|
|
1473
|
+
if (!memoryService.forget(request.params.id)) {
|
|
1474
|
+
return reply.code(404).send({ error: "AI memory not found" });
|
|
1475
|
+
}
|
|
1476
|
+
return { success: true };
|
|
1477
|
+
});
|
|
1478
|
+
server2.post("/_web/ai/memories/clear", async (request, reply) => {
|
|
1479
|
+
const { all, scopeType, scopeId } = request.body ?? {};
|
|
1480
|
+
if (all === true) {
|
|
1481
|
+
if (scopeType || scopeId != null) {
|
|
1482
|
+
return reply.code(400).send({ error: "all cannot be combined with a scope" });
|
|
1483
|
+
}
|
|
1484
|
+
return { success: true, cleared: memoryService.clear() };
|
|
1485
|
+
}
|
|
1486
|
+
if (!scopeType) {
|
|
1487
|
+
return reply.code(400).send({ error: "A scope or all: true is required" });
|
|
1488
|
+
}
|
|
1489
|
+
try {
|
|
1490
|
+
return { success: true, cleared: memoryService.clear(parseScope({ scopeType, scopeId })) };
|
|
1491
|
+
} catch (error) {
|
|
1492
|
+
return sendBadRequest(reply, error);
|
|
1493
|
+
}
|
|
1494
|
+
});
|
|
1495
|
+
}
|
|
1496
|
+
|
|
1339
1497
|
// ../../packages/http-routes/src/routes/web/ai-semantic-index.ts
|
|
1340
1498
|
import path2 from "path";
|
|
1341
1499
|
function registerSemanticIndexRoutes(server2, ctx) {
|
|
@@ -1627,10 +1785,53 @@ function registerAiToolRoutes(server2, ctx) {
|
|
|
1627
1785
|
});
|
|
1628
1786
|
}
|
|
1629
1787
|
|
|
1788
|
+
// ../../packages/http-routes/src/routes/web/memory-provenance-coordinator.ts
|
|
1789
|
+
var MemoryProvenanceCoordinator = class {
|
|
1790
|
+
pending = /* @__PURE__ */ new Map();
|
|
1791
|
+
begin(token, aiChatId) {
|
|
1792
|
+
this.pending.set(token, {
|
|
1793
|
+
aiChatId,
|
|
1794
|
+
expectedParentMessageId: null,
|
|
1795
|
+
memoryIds: /* @__PURE__ */ new Set(),
|
|
1796
|
+
completed: false
|
|
1797
|
+
});
|
|
1798
|
+
}
|
|
1799
|
+
record(token, memoryId) {
|
|
1800
|
+
const changeSet = this.pending.get(token);
|
|
1801
|
+
if (!changeSet || changeSet.completed) return;
|
|
1802
|
+
changeSet.memoryIds.add(memoryId);
|
|
1803
|
+
}
|
|
1804
|
+
complete(token, expectedParentMessageId) {
|
|
1805
|
+
const changeSet = this.pending.get(token);
|
|
1806
|
+
if (!changeSet) return;
|
|
1807
|
+
if (changeSet.memoryIds.size === 0) {
|
|
1808
|
+
this.pending.delete(token);
|
|
1809
|
+
return;
|
|
1810
|
+
}
|
|
1811
|
+
changeSet.expectedParentMessageId = expectedParentMessageId;
|
|
1812
|
+
changeSet.completed = true;
|
|
1813
|
+
}
|
|
1814
|
+
validate(token, aiChatId, memoryIds) {
|
|
1815
|
+
const changeSet = this.pending.get(token);
|
|
1816
|
+
if (!changeSet || !changeSet.completed || changeSet.aiChatId !== aiChatId) {
|
|
1817
|
+
throw new Error("Memory provenance token is invalid");
|
|
1818
|
+
}
|
|
1819
|
+
const requestedIds = new Set(memoryIds);
|
|
1820
|
+
if (requestedIds.size !== changeSet.memoryIds.size || [...requestedIds].some((memoryId) => !changeSet.memoryIds.has(memoryId))) {
|
|
1821
|
+
throw new Error("Memory IDs do not match the agent turn change set");
|
|
1822
|
+
}
|
|
1823
|
+
return { expectedParentMessageId: changeSet.expectedParentMessageId };
|
|
1824
|
+
}
|
|
1825
|
+
consume(token) {
|
|
1826
|
+
this.pending.delete(token);
|
|
1827
|
+
}
|
|
1828
|
+
};
|
|
1829
|
+
|
|
1630
1830
|
// ../../packages/http-routes/src/routes/web/register-ai.ts
|
|
1631
1831
|
var REQUIRED_AI_DEPENDENCIES = [
|
|
1632
1832
|
"aiDataDir",
|
|
1633
1833
|
"aiChatManager",
|
|
1834
|
+
"aiMemoryService",
|
|
1634
1835
|
"assistantManager",
|
|
1635
1836
|
"skillManagerCore",
|
|
1636
1837
|
"llmConfigStore",
|
|
@@ -1646,13 +1847,15 @@ function assertRequiredAiContext(ctx) {
|
|
|
1646
1847
|
}
|
|
1647
1848
|
function registerAiRoutes(server2, ctx, options) {
|
|
1648
1849
|
if (options?.requireAi) assertRequiredAiContext(ctx);
|
|
1850
|
+
const memoryProvenanceCoordinator = new MemoryProvenanceCoordinator();
|
|
1649
1851
|
registerAiAssistantRoutes(server2, ctx);
|
|
1650
1852
|
registerAiSkillRoutes(server2, ctx);
|
|
1651
1853
|
registerAiLlmRoutes(server2, ctx);
|
|
1652
1854
|
registerAiLlmStreamRoutes(server2, ctx);
|
|
1653
|
-
registerAiAgentStreamRoutes(server2, ctx);
|
|
1855
|
+
registerAiAgentStreamRoutes(server2, ctx, memoryProvenanceCoordinator);
|
|
1654
1856
|
registerAiToolRoutes(server2, ctx);
|
|
1655
1857
|
registerAiChatRoutes(server2, ctx);
|
|
1858
|
+
registerAiMemoryRoutes(server2, ctx, memoryProvenanceCoordinator);
|
|
1656
1859
|
registerAiChatTopicRoutes(server2, ctx);
|
|
1657
1860
|
registerAiSummaryRoutes(server2, ctx);
|
|
1658
1861
|
registerAiLogRoutes(server2, ctx);
|
|
@@ -1971,7 +2174,9 @@ function registerAnalyticsRoutes(server2, ctx) {
|
|
|
1971
2174
|
async (request) => {
|
|
1972
2175
|
const id = request.params.id;
|
|
1973
2176
|
const filter = parseTimeFilter(request.query);
|
|
1974
|
-
return cached("repeat", id, { ...filter }, () => getRepeatAnalysis(adapter.ensureReadonly(id), filter)
|
|
2177
|
+
return cached("repeat", id, { ...filter }, () => getRepeatAnalysis(adapter.ensureReadonly(id), filter), {
|
|
2178
|
+
extraVersion: "originator-id-v1"
|
|
2179
|
+
});
|
|
1975
2180
|
}
|
|
1976
2181
|
);
|
|
1977
2182
|
}
|
|
@@ -3140,7 +3345,8 @@ function registerAutomationRoutes(server2, ctx) {
|
|
|
3140
3345
|
enabled: true,
|
|
3141
3346
|
port: automation.serverInfo.port,
|
|
3142
3347
|
token: automation.serverInfo.token,
|
|
3143
|
-
host: automation.serverInfo.host
|
|
3348
|
+
host: automation.serverInfo.host,
|
|
3349
|
+
socket: automation.serverInfo.socket
|
|
3144
3350
|
};
|
|
3145
3351
|
});
|
|
3146
3352
|
server2.get("/_web/automation/data-sources", async (_request, reply) => {
|
|
@@ -3235,7 +3441,7 @@ function registerAutomationRoutes(server2, ctx) {
|
|
|
3235
3441
|
// src/http/routes/web/import.ts
|
|
3236
3442
|
import * as fs7 from "fs";
|
|
3237
3443
|
import * as path8 from "path";
|
|
3238
|
-
import { randomUUID } from "crypto";
|
|
3444
|
+
import { randomUUID as randomUUID2 } from "crypto";
|
|
3239
3445
|
import { pipeline } from "stream/promises";
|
|
3240
3446
|
|
|
3241
3447
|
// src/http/routes/web/helpers.ts
|
|
@@ -3290,7 +3496,7 @@ function registerImportRoutes2(server2, dbManager2, options = {}) {
|
|
|
3290
3496
|
limits: { fileSize: ARCHIVE_UPLOAD_LIMIT }
|
|
3291
3497
|
});
|
|
3292
3498
|
if (!data) return reply.code(400).send({ success: false, error: "error.no_file_selected" });
|
|
3293
|
-
const uploadPath = path8.join(getChatLabTempScopeDir("imports"), `archive-${
|
|
3499
|
+
const uploadPath = path8.join(getChatLabTempScopeDir("imports"), `archive-${randomUUID2()}.zip`);
|
|
3294
3500
|
try {
|
|
3295
3501
|
await pipeline(data.file, fs7.createWriteStream(uploadPath, { flags: "wx" }));
|
|
3296
3502
|
if (data.file.truncated) {
|
|
@@ -3440,7 +3646,7 @@ data: ${JSON.stringify(eventData)}
|
|
|
3440
3646
|
const parts = request.parts();
|
|
3441
3647
|
if (!parts) return reply.code(400).send({ error: "No files uploaded" });
|
|
3442
3648
|
const requestedBatchId = request.headers["x-chatlab-import-batch-id"];
|
|
3443
|
-
const batchId = typeof requestedBatchId === "string" && requestedBatchId ? requestedBatchId :
|
|
3649
|
+
const batchId = typeof requestedBatchId === "string" && requestedBatchId ? requestedBatchId : randomUUID2();
|
|
3444
3650
|
if (activeBatchControllers.has(batchId)) {
|
|
3445
3651
|
return reply.code(409).send({ error: "Batch import id is already active" });
|
|
3446
3652
|
}
|
|
@@ -3761,10 +3967,10 @@ function registerWebRoutes2(server2, dbManager2, options) {
|
|
|
3761
3967
|
const resolvedPathProvider = options?.pathProvider ?? fallbackPathProvider;
|
|
3762
3968
|
const ai = options?.aiContext;
|
|
3763
3969
|
const cliStreamImport = async (dm, filePath) => {
|
|
3764
|
-
const { streamImport: streamImport2 } = await import("./stream-import-
|
|
3970
|
+
const { streamImport: streamImport2 } = await import("./stream-import-YYQVZDGQ.mjs");
|
|
3765
3971
|
const result = await streamImport2(dm, filePath);
|
|
3766
3972
|
if (!result.success) {
|
|
3767
|
-
const { IMPORT_IN_PROGRESS_ERROR_KEY: IMPORT_IN_PROGRESS_ERROR_KEY2, ImportInProgressError: ImportInProgressError2 } = await import("./src-
|
|
3973
|
+
const { IMPORT_IN_PROGRESS_ERROR_KEY: IMPORT_IN_PROGRESS_ERROR_KEY2, ImportInProgressError: ImportInProgressError2 } = await import("./src-WE5HNN2O.mjs");
|
|
3768
3974
|
if (result.error === IMPORT_IN_PROGRESS_ERROR_KEY2) throw new ImportInProgressError2();
|
|
3769
3975
|
throw new Error(result.error || "Import failed");
|
|
3770
3976
|
}
|
|
@@ -3789,6 +3995,9 @@ function registerWebRoutes2(server2, dbManager2, options) {
|
|
|
3789
3995
|
getVersion,
|
|
3790
3996
|
nativeBinding: options?.nativeBinding,
|
|
3791
3997
|
semanticIndexService,
|
|
3998
|
+
contactsService: options?.contactsService,
|
|
3999
|
+
globalInsightService: options?.globalInsightService,
|
|
4000
|
+
preferencesManager: options?.preferencesManager,
|
|
3792
4001
|
analyticsService,
|
|
3793
4002
|
getCurrentAiLogPath: () => getServerAiLogger()?.getExistingLogPath() ?? null,
|
|
3794
4003
|
openDirectory: openDirectoryPath,
|
|
@@ -3822,6 +4031,7 @@ function registerWebRoutes2(server2, dbManager2, options) {
|
|
|
3822
4031
|
...ai && {
|
|
3823
4032
|
aiDataDir: ai.aiDataDir,
|
|
3824
4033
|
aiChatManager: ai.aiChatManager,
|
|
4034
|
+
aiMemoryService: ai.aiMemoryService,
|
|
3825
4035
|
assistantManager: ai.assistantManager,
|
|
3826
4036
|
skillManagerCore: ai.skillManagerCore,
|
|
3827
4037
|
llmConfigStore: ai.llmConfigStore,
|
|
@@ -4795,6 +5005,7 @@ function cleanupSync() {
|
|
|
4795
5005
|
var server = null;
|
|
4796
5006
|
var dbManager = null;
|
|
4797
5007
|
var aiChatManager = null;
|
|
5008
|
+
var aiMemoryService = null;
|
|
4798
5009
|
function resolveNativeBinding2() {
|
|
4799
5010
|
if (process.versions.electron) return void 0;
|
|
4800
5011
|
const nativePath = resolveCliPath("native/better_sqlite3.node");
|
|
@@ -4817,7 +5028,9 @@ async function startHttpServer(options) {
|
|
|
4817
5028
|
let config = loadConfig();
|
|
4818
5029
|
const port = options?.port ?? config.api.port;
|
|
4819
5030
|
const host = options?.host ?? config.api.host;
|
|
5031
|
+
const socket = options?.socket;
|
|
4820
5032
|
const token = options?.token ?? ensureToken(config);
|
|
5033
|
+
if (socket) await prepareUnixSocket(socket);
|
|
4821
5034
|
const pendingMigration = applyPendingNodeDataDirMigrationIfNeeded();
|
|
4822
5035
|
if (!pendingMigration.skipped) {
|
|
4823
5036
|
if (pendingMigration.success) {
|
|
@@ -4848,8 +5061,30 @@ async function startHttpServer(options) {
|
|
|
4848
5061
|
await migrationRunner.run();
|
|
4849
5062
|
const nativeBinding = resolveNativeBinding2();
|
|
4850
5063
|
dbManager = new DatabaseManager(pathProvider, { nativeBinding, runtime });
|
|
5064
|
+
const sessionAdapter = createDatabaseManagerAdapter(dbManager);
|
|
5065
|
+
const contactsService = createContactsService({
|
|
5066
|
+
adapter: sessionAdapter,
|
|
5067
|
+
pathProvider,
|
|
5068
|
+
runtimeIdentity: runtime,
|
|
5069
|
+
nativeBinding
|
|
5070
|
+
});
|
|
5071
|
+
const preferencesManager = new PreferencesManager(pathProvider.getSystemDir());
|
|
5072
|
+
const globalInsightService = createGlobalInsightService({
|
|
5073
|
+
adapter: sessionAdapter,
|
|
5074
|
+
pathProvider,
|
|
5075
|
+
runtimeIdentity: runtime,
|
|
5076
|
+
nativeBinding,
|
|
5077
|
+
getExcludedSessionIds: () => preferencesManager.load().ownerExcludedSessionIds
|
|
5078
|
+
});
|
|
5079
|
+
const crossChatAnalysisService = createCrossChatAnalysisService({
|
|
5080
|
+
adapter: sessionAdapter,
|
|
5081
|
+
contactsService,
|
|
5082
|
+
globalInsightService,
|
|
5083
|
+
getExcludedSessionIds: () => preferencesManager.load().ownerExcludedSessionIds
|
|
5084
|
+
});
|
|
4851
5085
|
const aiDataDir = pathProvider.getAiDataDir();
|
|
4852
5086
|
aiChatManager = new AIChatManager(aiDataDir, { nativeBinding });
|
|
5087
|
+
aiMemoryService = new AIMemoryService(aiDataDir, { nativeBinding });
|
|
4853
5088
|
const assistantManager = getAssistantManager(aiDataDir);
|
|
4854
5089
|
const skillManagerCore = getSkillManagerCore(aiDataDir);
|
|
4855
5090
|
const llmRuntimeStores = createLlmRuntimeStores(aiDataDir);
|
|
@@ -4858,7 +5093,10 @@ async function startHttpServer(options) {
|
|
|
4858
5093
|
initServerAiLogger(pathProvider.getLogsDir());
|
|
4859
5094
|
appLogger.info("ai-config", "Shared LLM configuration store initialized", { aiDataDir });
|
|
4860
5095
|
appLogger.info("temp-workspace", "Temporary workspace initialized", { root: pathProvider.getTempDir() });
|
|
4861
|
-
appLogger.info(
|
|
5096
|
+
appLogger.info(
|
|
5097
|
+
"server",
|
|
5098
|
+
socket ? `HTTP server starting on Unix socket ${socket}` : `HTTP server starting on ${host}:${port}`
|
|
5099
|
+
);
|
|
4862
5100
|
logNativeParserStatus();
|
|
4863
5101
|
setAuthToken(token);
|
|
4864
5102
|
setRequireAuth(!!(options?.requireAuth ?? config.api.require_auth));
|
|
@@ -4886,10 +5124,14 @@ async function startHttpServer(options) {
|
|
|
4886
5124
|
pathProvider,
|
|
4887
5125
|
nativeBinding,
|
|
4888
5126
|
runtimeIdentity: runtime,
|
|
5127
|
+
contactsService,
|
|
5128
|
+
globalInsightService,
|
|
5129
|
+
preferencesManager,
|
|
4889
5130
|
semanticIndexService,
|
|
4890
5131
|
aiContext: {
|
|
4891
5132
|
aiDataDir,
|
|
4892
5133
|
aiChatManager,
|
|
5134
|
+
aiMemoryService,
|
|
4893
5135
|
assistantManager,
|
|
4894
5136
|
skillManagerCore,
|
|
4895
5137
|
llmConfigStore,
|
|
@@ -4897,11 +5139,14 @@ async function startHttpServer(options) {
|
|
|
4897
5139
|
customModelStore,
|
|
4898
5140
|
runAgentStream: createCliRunAgentStream(dbManager, aiChatManager, {
|
|
4899
5141
|
llmConfigStore,
|
|
4900
|
-
semanticIndexService
|
|
5142
|
+
semanticIndexService,
|
|
5143
|
+
crossChatAnalysisService,
|
|
5144
|
+
sessionAdapter,
|
|
5145
|
+
memoryService: aiMemoryService
|
|
4901
5146
|
})
|
|
4902
5147
|
}
|
|
4903
5148
|
});
|
|
4904
|
-
initSync(server, dbManager, pathProvider, { port, host, token });
|
|
5149
|
+
initSync(server, dbManager, pathProvider, { port, host, socket, token });
|
|
4905
5150
|
if (options?.webRoot && fs11.existsSync(options.webRoot)) {
|
|
4906
5151
|
registerProxyRoutes(server);
|
|
4907
5152
|
const fastifyStatic = await import("@fastify/static");
|
|
@@ -4914,8 +5159,12 @@ async function startHttpServer(options) {
|
|
|
4914
5159
|
return reply.sendFile("index.html");
|
|
4915
5160
|
});
|
|
4916
5161
|
}
|
|
4917
|
-
|
|
4918
|
-
|
|
5162
|
+
if (socket) {
|
|
5163
|
+
await server.listen({ path: socket });
|
|
5164
|
+
} else {
|
|
5165
|
+
await server.listen({ port, host });
|
|
5166
|
+
}
|
|
5167
|
+
return socket ? { socket, token } : { port, host, token };
|
|
4919
5168
|
}
|
|
4920
5169
|
async function stopHttpServer() {
|
|
4921
5170
|
if (!server) return;
|
|
@@ -4927,6 +5176,10 @@ async function stopHttpServer() {
|
|
|
4927
5176
|
aiChatManager.close();
|
|
4928
5177
|
aiChatManager = null;
|
|
4929
5178
|
}
|
|
5179
|
+
if (aiMemoryService) {
|
|
5180
|
+
aiMemoryService.close();
|
|
5181
|
+
aiMemoryService = null;
|
|
5182
|
+
}
|
|
4930
5183
|
if (dbManager) {
|
|
4931
5184
|
dbManager.closeAll();
|
|
4932
5185
|
dbManager = null;
|
|
@@ -4943,4 +5196,4 @@ export {
|
|
|
4943
5196
|
startHttpServer,
|
|
4944
5197
|
stopHttpServer
|
|
4945
5198
|
};
|
|
4946
|
-
//# sourceMappingURL=chunk-
|
|
5199
|
+
//# sourceMappingURL=chunk-DKIYHA3O.mjs.map
|