teleton 0.8.4 → 0.8.6
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/README.md +40 -17
- package/dist/{bootstrap-NNEI3Z5H.js → bootstrap-PFBH6ALD.js} +11 -8
- package/dist/bridge-guards-HZTNH7IB.js +9 -0
- package/dist/{chunk-NH2CNRKJ.js → chunk-2UUGRY5B.js} +151 -159
- package/dist/{chunk-UMUONAD6.js → chunk-4MFN75ZK.js} +5941 -2716
- package/dist/{chunk-LC4TV3KL.js → chunk-4MG2AROG.js} +5 -7
- package/dist/{chunk-LZQOX6YY.js → chunk-6IFNQWIM.js} +7714 -8748
- package/dist/chunk-7KI25UJU.js +215 -0
- package/dist/chunk-AX5NBEHX.js +12 -0
- package/dist/{chunk-5LOHRZYY.js → chunk-BLUES3FJ.js} +80 -101
- package/dist/{chunk-CUE4UZXR.js → chunk-BT2I3ETV.js} +3 -3
- package/dist/chunk-CXTZPOTA.js +107 -0
- package/dist/{chunk-LVTKJQ7O.js → chunk-D3GT6YIY.js} +59 -7
- package/dist/chunk-EKCXKL5M.js +53 -0
- package/dist/{chunk-XDZDOKIF.js → chunk-F6S3L3OV.js} +3 -3
- package/dist/{chunk-C4NKJT2Z.js → chunk-J4WDJ7XS.js} +1 -1
- package/dist/{chunk-G7PCW63M.js → chunk-JYF2MM5I.js} +147 -113
- package/dist/{chunk-NVKBBTI6.js → chunk-K3QSIIMZ.js} +9 -6
- package/dist/{chunk-EYWNOHMJ.js → chunk-L653KKCR.js} +1 -0
- package/dist/chunk-OMQIAWEU.js +273 -0
- package/dist/chunk-PCT7GYBP.js +274 -0
- package/dist/chunk-QYZBWU2D.js +139 -0
- package/dist/{chunk-WTDAICGT.js → chunk-R6W4DJRK.js} +7 -7
- package/dist/{chunk-5SEMA47R.js → chunk-RILOEIK6.js} +1 -1
- package/dist/{chunk-6OOHHJ4N.js → chunk-TFTNZZDH.js} +20 -20
- package/dist/chunk-TTOZCZWE.js +96 -0
- package/dist/chunk-UJ54YT2T.js +12 -0
- package/dist/{chunk-GHMXWAXI.js → chunk-ULVL2W3D.js} +211 -445
- package/dist/{chunk-NQ6FZKCE.js → chunk-V3S3NXBQ.js} +3 -1
- package/dist/{chunk-H7MFXJZK.js → chunk-WSL4KIOI.js} +31 -26
- package/dist/{chunk-35MX4ZUI.js → chunk-Z5WY7BSB.js} +5 -5
- package/dist/{chunk-ALKAAG4O.js → chunk-ZGKE3OTA.js} +112 -49
- package/dist/{chunk-JROBTXWY.js → chunk-ZHRDETCX.js} +38 -4
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +272 -159
- package/dist/{client-5KD25NOP.js → client-S5UIK6OG.js} +10 -8
- package/dist/daily-logs-3WXGYAQF.js +25 -0
- package/dist/{get-my-gifts-Y7EN7RK4.js → get-my-gifts-3YSYM3LI.js} +3 -2
- package/dist/harden-permissions-PV5SGV5D.js +100 -0
- package/dist/index.d.ts +923 -0
- package/dist/index.js +29 -20
- package/dist/knowledge-RRWUIO3G.js +19 -0
- package/dist/{local-IHKJFQJS.js → local-MSZAXWUL.js} +3 -3
- package/dist/mcp-loader-OELDFR63.js +15 -0
- package/dist/{memory-QMJRM3XJ.js → memory-6U6HGRK2.js} +23 -12
- package/dist/memory-hook-T7Y235KY.js +19 -0
- package/dist/messages-KV5ADNJB.js +17 -0
- package/dist/{migrate-5VBAP52B.js → migrate-AX3HOKOO.js} +10 -7
- package/dist/{paths-XA2RJH4S.js → paths-WMVV7ZAJ.js} +1 -1
- package/dist/{server-WWGVDFPW.js → server-MFRYOGHR.js} +21 -23
- package/dist/{server-AJCOURH7.js → server-SFLCAZFR.js} +221 -27
- package/dist/{setup-server-VDY64CWW.js → setup-server-YWAPKZVE.js} +26 -26
- package/dist/{store-BY7S6IFN.js → store-PGHQASBC.js} +11 -8
- package/dist/{task-dependency-resolver-L6UUMTHK.js → task-dependency-resolver-YQKADDEU.js} +24 -10
- package/dist/{task-executor-XBNJLUCS.js → task-executor-LWAWD225.js} +4 -4
- package/dist/{tool-adapter-IVX2XQJE.js → tool-adapter-VKLUZSQS.js} +1 -1
- package/dist/{tool-index-FTERJSZK.js → tool-index-YEWDF5CK.js} +5 -5
- package/dist/{transcript-IM7G25OS.js → transcript-4Y3Z2BJ3.js} +3 -3
- package/dist/web/assets/Config-MNxA69ib.js +1 -0
- package/dist/web/assets/Conversations-Dk958paA.js +1 -0
- package/dist/web/assets/Dashboard-dM18fGOm.js +1 -0
- package/dist/web/assets/Hooks-D2griQnI.js +1 -0
- package/dist/web/assets/Mcp-CtWNzwsz.js +1 -0
- package/dist/web/assets/Memory-CfLwH45G.js +1 -0
- package/dist/web/assets/Plugins-3hoJprFo.js +1 -0
- package/dist/web/assets/SearchInput-CpcETdpE.js +1 -0
- package/dist/web/assets/Soul-BSxE73aK.js +1 -0
- package/dist/web/assets/Tasks-DkCkfu3A.js +1 -0
- package/dist/web/assets/TelegramSettingsPanel-BRzc5G6e.js +1 -0
- package/dist/web/assets/Tools-Du8B8Mb4.js +1 -0
- package/dist/web/assets/Wallet-BLILP2Gn.js +1 -0
- package/dist/web/assets/Workspace-qklcXpXV.js +1 -0
- package/dist/web/assets/index-BwEPTTKp.js +90 -0
- package/dist/web/assets/index-noejUsK7.css +1 -0
- package/dist/web/assets/{index.es-DitvF-9H.js → index.es-DdpKlnGb.js} +1 -1
- package/dist/web/assets/useToolManager-tdxkKn3H.js +1 -0
- package/dist/web/assets/utils-CnsbSMo4.js +1 -0
- package/dist/web/index.html +2 -2
- package/package.json +7 -12
- package/src/templates/HEARTBEAT.md +5 -0
- package/dist/memory-hook-VUNWZ3NY.js +0 -19
- package/dist/web/assets/index-BfYCdwLI.js +0 -80
- package/dist/web/assets/index-DmlyQVhR.css +0 -1
- package/dist/{chunk-WFTC3JJW.js → chunk-3NO7QU7W.js} +1 -1
package/dist/index.js
CHANGED
|
@@ -1,30 +1,39 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TeletonApp,
|
|
3
3
|
main
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-XDZDOKIF.js";
|
|
11
|
-
import "./chunk-GHMXWAXI.js";
|
|
12
|
-
import "./chunk-ALKAAG4O.js";
|
|
13
|
-
import "./chunk-3UFPFWYP.js";
|
|
4
|
+
} from "./chunk-4MFN75ZK.js";
|
|
5
|
+
import "./chunk-K3QSIIMZ.js";
|
|
6
|
+
import "./chunk-7KI25UJU.js";
|
|
7
|
+
import "./chunk-6IFNQWIM.js";
|
|
8
|
+
import "./chunk-ZHRDETCX.js";
|
|
9
|
+
import "./chunk-2UUGRY5B.js";
|
|
14
10
|
import "./chunk-7TECSLJ4.js";
|
|
15
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-AX5NBEHX.js";
|
|
12
|
+
import "./chunk-F6S3L3OV.js";
|
|
13
|
+
import "./chunk-ULVL2W3D.js";
|
|
14
|
+
import "./chunk-QYZBWU2D.js";
|
|
15
|
+
import "./chunk-OMQIAWEU.js";
|
|
16
|
+
import "./chunk-4L66JHQE.js";
|
|
17
|
+
import "./chunk-TTOZCZWE.js";
|
|
18
|
+
import "./chunk-Z5WY7BSB.js";
|
|
16
19
|
import "./chunk-VFA7QMCZ.js";
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-ZGKE3OTA.js";
|
|
21
|
+
import "./chunk-UJ54YT2T.js";
|
|
22
|
+
import "./chunk-WSL4KIOI.js";
|
|
23
|
+
import "./chunk-EKCXKL5M.js";
|
|
24
|
+
import "./chunk-3UFPFWYP.js";
|
|
25
|
+
import "./chunk-PCT7GYBP.js";
|
|
26
|
+
import "./chunk-CXTZPOTA.js";
|
|
27
|
+
import "./chunk-J4WDJ7XS.js";
|
|
28
|
+
import "./chunk-D3GT6YIY.js";
|
|
29
|
+
import "./chunk-R6W4DJRK.js";
|
|
30
|
+
import "./chunk-TFTNZZDH.js";
|
|
21
31
|
import "./chunk-XQUHC3JZ.js";
|
|
22
32
|
import "./chunk-R4YSJ4EY.js";
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-4L66JHQE.js";
|
|
33
|
+
import "./chunk-4MG2AROG.js";
|
|
34
|
+
import "./chunk-BT2I3ETV.js";
|
|
35
|
+
import "./chunk-L653KKCR.js";
|
|
36
|
+
import "./chunk-V3S3NXBQ.js";
|
|
28
37
|
import "./chunk-3RG5ZIWI.js";
|
|
29
38
|
export {
|
|
30
39
|
TeletonApp,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
KnowledgeIndexer,
|
|
3
|
+
getKnowledgeIndexer,
|
|
4
|
+
setKnowledgeIndexer
|
|
5
|
+
} from "./chunk-OMQIAWEU.js";
|
|
6
|
+
import "./chunk-Z5WY7BSB.js";
|
|
7
|
+
import "./chunk-VFA7QMCZ.js";
|
|
8
|
+
import "./chunk-J4WDJ7XS.js";
|
|
9
|
+
import "./chunk-XQUHC3JZ.js";
|
|
10
|
+
import "./chunk-R4YSJ4EY.js";
|
|
11
|
+
import "./chunk-BT2I3ETV.js";
|
|
12
|
+
import "./chunk-L653KKCR.js";
|
|
13
|
+
import "./chunk-V3S3NXBQ.js";
|
|
14
|
+
import "./chunk-3RG5ZIWI.js";
|
|
15
|
+
export {
|
|
16
|
+
KnowledgeIndexer,
|
|
17
|
+
getKnowledgeIndexer,
|
|
18
|
+
setKnowledgeIndexer
|
|
19
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LocalEmbeddingProvider
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-BT2I3ETV.js";
|
|
4
|
+
import "./chunk-L653KKCR.js";
|
|
5
|
+
import "./chunk-V3S3NXBQ.js";
|
|
6
6
|
import "./chunk-3RG5ZIWI.js";
|
|
7
7
|
export {
|
|
8
8
|
LocalEmbeddingProvider
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
closeMcpServers,
|
|
3
|
+
loadMcpServers,
|
|
4
|
+
registerMcpTools
|
|
5
|
+
} from "./chunk-7KI25UJU.js";
|
|
6
|
+
import "./chunk-AX5NBEHX.js";
|
|
7
|
+
import "./chunk-3UFPFWYP.js";
|
|
8
|
+
import "./chunk-R4YSJ4EY.js";
|
|
9
|
+
import "./chunk-V3S3NXBQ.js";
|
|
10
|
+
import "./chunk-3RG5ZIWI.js";
|
|
11
|
+
export {
|
|
12
|
+
closeMcpServers,
|
|
13
|
+
loadMcpServers,
|
|
14
|
+
registerMcpTools
|
|
15
|
+
};
|
|
@@ -3,9 +3,7 @@ import {
|
|
|
3
3
|
ChatStore,
|
|
4
4
|
ContextBuilder,
|
|
5
5
|
HybridSearch,
|
|
6
|
-
KnowledgeIndexer,
|
|
7
6
|
MemoryDatabase,
|
|
8
|
-
MessageStore,
|
|
9
7
|
SessionStore,
|
|
10
8
|
UserStore,
|
|
11
9
|
closeDatabase,
|
|
@@ -17,7 +15,21 @@ import {
|
|
|
17
15
|
parseTemporalIntent,
|
|
18
16
|
runMigrations,
|
|
19
17
|
setSchemaVersion
|
|
20
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-ULVL2W3D.js";
|
|
19
|
+
import "./chunk-QYZBWU2D.js";
|
|
20
|
+
import {
|
|
21
|
+
KnowledgeIndexer,
|
|
22
|
+
getKnowledgeIndexer,
|
|
23
|
+
setKnowledgeIndexer
|
|
24
|
+
} from "./chunk-OMQIAWEU.js";
|
|
25
|
+
import {
|
|
26
|
+
TaskStore,
|
|
27
|
+
getTaskStore
|
|
28
|
+
} from "./chunk-4L66JHQE.js";
|
|
29
|
+
import {
|
|
30
|
+
MessageStore,
|
|
31
|
+
pruneOldMessages
|
|
32
|
+
} from "./chunk-TTOZCZWE.js";
|
|
21
33
|
import {
|
|
22
34
|
AnthropicEmbeddingProvider,
|
|
23
35
|
CachedEmbeddingProvider,
|
|
@@ -26,20 +38,16 @@ import {
|
|
|
26
38
|
deserializeEmbedding,
|
|
27
39
|
hashText,
|
|
28
40
|
serializeEmbedding
|
|
29
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-Z5WY7BSB.js";
|
|
30
42
|
import "./chunk-VFA7QMCZ.js";
|
|
31
|
-
import "./chunk-
|
|
43
|
+
import "./chunk-J4WDJ7XS.js";
|
|
32
44
|
import "./chunk-XQUHC3JZ.js";
|
|
33
45
|
import "./chunk-R4YSJ4EY.js";
|
|
34
46
|
import {
|
|
35
47
|
LocalEmbeddingProvider
|
|
36
|
-
} from "./chunk-
|
|
37
|
-
import "./chunk-
|
|
38
|
-
import "./chunk-
|
|
39
|
-
import {
|
|
40
|
-
TaskStore,
|
|
41
|
-
getTaskStore
|
|
42
|
-
} from "./chunk-4L66JHQE.js";
|
|
48
|
+
} from "./chunk-BT2I3ETV.js";
|
|
49
|
+
import "./chunk-L653KKCR.js";
|
|
50
|
+
import "./chunk-V3S3NXBQ.js";
|
|
43
51
|
import "./chunk-3RG5ZIWI.js";
|
|
44
52
|
export {
|
|
45
53
|
AnthropicEmbeddingProvider,
|
|
@@ -62,12 +70,15 @@ export {
|
|
|
62
70
|
ensureSchema,
|
|
63
71
|
ensureVectorTables,
|
|
64
72
|
getDatabase,
|
|
73
|
+
getKnowledgeIndexer,
|
|
65
74
|
getSchemaVersion,
|
|
66
75
|
getTaskStore,
|
|
67
76
|
hashText,
|
|
68
77
|
initializeMemory,
|
|
69
78
|
parseTemporalIntent,
|
|
79
|
+
pruneOldMessages,
|
|
70
80
|
runMigrations,
|
|
71
81
|
serializeEmbedding,
|
|
82
|
+
setKnowledgeIndexer,
|
|
72
83
|
setSchemaVersion
|
|
73
84
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
consolidateOldMemoryFiles,
|
|
3
|
+
saveSessionMemory
|
|
4
|
+
} from "./chunk-ZGKE3OTA.js";
|
|
5
|
+
import "./chunk-3UFPFWYP.js";
|
|
6
|
+
import "./chunk-J4WDJ7XS.js";
|
|
7
|
+
import "./chunk-D3GT6YIY.js";
|
|
8
|
+
import "./chunk-R6W4DJRK.js";
|
|
9
|
+
import "./chunk-TFTNZZDH.js";
|
|
10
|
+
import "./chunk-XQUHC3JZ.js";
|
|
11
|
+
import "./chunk-R4YSJ4EY.js";
|
|
12
|
+
import "./chunk-4MG2AROG.js";
|
|
13
|
+
import "./chunk-L653KKCR.js";
|
|
14
|
+
import "./chunk-V3S3NXBQ.js";
|
|
15
|
+
import "./chunk-3RG5ZIWI.js";
|
|
16
|
+
export {
|
|
17
|
+
consolidateOldMemoryFiles,
|
|
18
|
+
saveSessionMemory
|
|
19
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MessageStore,
|
|
3
|
+
pruneOldMessages
|
|
4
|
+
} from "./chunk-TTOZCZWE.js";
|
|
5
|
+
import "./chunk-Z5WY7BSB.js";
|
|
6
|
+
import "./chunk-VFA7QMCZ.js";
|
|
7
|
+
import "./chunk-J4WDJ7XS.js";
|
|
8
|
+
import "./chunk-XQUHC3JZ.js";
|
|
9
|
+
import "./chunk-R4YSJ4EY.js";
|
|
10
|
+
import "./chunk-BT2I3ETV.js";
|
|
11
|
+
import "./chunk-L653KKCR.js";
|
|
12
|
+
import "./chunk-V3S3NXBQ.js";
|
|
13
|
+
import "./chunk-3RG5ZIWI.js";
|
|
14
|
+
export {
|
|
15
|
+
MessageStore,
|
|
16
|
+
pruneOldMessages
|
|
17
|
+
};
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getDatabase
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-ULVL2W3D.js";
|
|
4
|
+
import "./chunk-QYZBWU2D.js";
|
|
5
|
+
import "./chunk-OMQIAWEU.js";
|
|
6
|
+
import "./chunk-4L66JHQE.js";
|
|
7
|
+
import "./chunk-TTOZCZWE.js";
|
|
8
|
+
import "./chunk-Z5WY7BSB.js";
|
|
5
9
|
import "./chunk-VFA7QMCZ.js";
|
|
6
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-J4WDJ7XS.js";
|
|
7
11
|
import "./chunk-XQUHC3JZ.js";
|
|
8
12
|
import "./chunk-R4YSJ4EY.js";
|
|
9
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-BT2I3ETV.js";
|
|
10
14
|
import {
|
|
11
15
|
TELETON_ROOT
|
|
12
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-L653KKCR.js";
|
|
13
17
|
import {
|
|
14
18
|
createLogger
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-4L66JHQE.js";
|
|
19
|
+
} from "./chunk-V3S3NXBQ.js";
|
|
17
20
|
import "./chunk-3RG5ZIWI.js";
|
|
18
21
|
|
|
19
22
|
// src/session/migrate.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createSetupRoutes
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BLUES3FJ.js";
|
|
4
4
|
import {
|
|
5
5
|
createConfigRoutes,
|
|
6
6
|
createHooksRoutes,
|
|
@@ -16,36 +16,34 @@ import {
|
|
|
16
16
|
createToolsRoutes,
|
|
17
17
|
createWorkspaceRoutes,
|
|
18
18
|
logInterceptor
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-JYF2MM5I.js";
|
|
20
20
|
import {
|
|
21
21
|
ensureTlsCert
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-XDZDOKIF.js";
|
|
28
|
-
import "./chunk-GHMXWAXI.js";
|
|
29
|
-
import "./chunk-ALKAAG4O.js";
|
|
30
|
-
import "./chunk-3UFPFWYP.js";
|
|
22
|
+
} from "./chunk-RILOEIK6.js";
|
|
23
|
+
import "./chunk-3NO7QU7W.js";
|
|
24
|
+
import "./chunk-6IFNQWIM.js";
|
|
25
|
+
import "./chunk-ZHRDETCX.js";
|
|
26
|
+
import "./chunk-2UUGRY5B.js";
|
|
31
27
|
import "./chunk-7TECSLJ4.js";
|
|
32
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-AX5NBEHX.js";
|
|
29
|
+
import "./chunk-QYZBWU2D.js";
|
|
30
|
+
import "./chunk-4L66JHQE.js";
|
|
33
31
|
import "./chunk-VFA7QMCZ.js";
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-
|
|
36
|
-
import "./chunk-
|
|
37
|
-
import "./chunk-
|
|
32
|
+
import "./chunk-EKCXKL5M.js";
|
|
33
|
+
import "./chunk-3UFPFWYP.js";
|
|
34
|
+
import "./chunk-PCT7GYBP.js";
|
|
35
|
+
import "./chunk-CXTZPOTA.js";
|
|
36
|
+
import "./chunk-J4WDJ7XS.js";
|
|
37
|
+
import "./chunk-R6W4DJRK.js";
|
|
38
|
+
import "./chunk-TFTNZZDH.js";
|
|
38
39
|
import "./chunk-XQUHC3JZ.js";
|
|
39
40
|
import "./chunk-R4YSJ4EY.js";
|
|
40
|
-
import "./chunk-LC4TV3KL.js";
|
|
41
|
-
import "./chunk-CUE4UZXR.js";
|
|
42
41
|
import {
|
|
43
42
|
TELETON_ROOT
|
|
44
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-L653KKCR.js";
|
|
45
44
|
import {
|
|
46
45
|
createLogger
|
|
47
|
-
} from "./chunk-
|
|
48
|
-
import "./chunk-4L66JHQE.js";
|
|
46
|
+
} from "./chunk-V3S3NXBQ.js";
|
|
49
47
|
import "./chunk-3RG5ZIWI.js";
|
|
50
48
|
|
|
51
49
|
// src/api/server.ts
|
|
@@ -290,8 +288,8 @@ function createAgentRoutes(lifecycle) {
|
|
|
290
288
|
}
|
|
291
289
|
await lifecycle.start();
|
|
292
290
|
log.info("Agent restarted via Management API");
|
|
293
|
-
} catch (
|
|
294
|
-
log.error({ err }, "Agent restart failed");
|
|
291
|
+
} catch (error) {
|
|
292
|
+
log.error({ err: error }, "Agent restart failed");
|
|
295
293
|
}
|
|
296
294
|
})().catch(() => {
|
|
297
295
|
});
|
|
@@ -13,41 +13,49 @@ import {
|
|
|
13
13
|
createToolsRoutes,
|
|
14
14
|
createWorkspaceRoutes,
|
|
15
15
|
logInterceptor
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
import
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
} from "./chunk-JYF2MM5I.js";
|
|
17
|
+
import "./chunk-3NO7QU7W.js";
|
|
18
|
+
import {
|
|
19
|
+
formatTransactions
|
|
20
|
+
} from "./chunk-6IFNQWIM.js";
|
|
21
|
+
import {
|
|
22
|
+
getCachedTonClient,
|
|
23
|
+
getWalletAddress,
|
|
24
|
+
getWalletBalance,
|
|
25
|
+
readRawConfig,
|
|
26
|
+
writeRawConfig
|
|
27
|
+
} from "./chunk-ZHRDETCX.js";
|
|
28
|
+
import "./chunk-2UUGRY5B.js";
|
|
25
29
|
import "./chunk-7TECSLJ4.js";
|
|
26
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-AX5NBEHX.js";
|
|
31
|
+
import "./chunk-QYZBWU2D.js";
|
|
32
|
+
import "./chunk-4L66JHQE.js";
|
|
27
33
|
import "./chunk-VFA7QMCZ.js";
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import
|
|
30
|
-
|
|
31
|
-
|
|
34
|
+
import "./chunk-EKCXKL5M.js";
|
|
35
|
+
import {
|
|
36
|
+
getErrorMessage
|
|
37
|
+
} from "./chunk-3UFPFWYP.js";
|
|
38
|
+
import "./chunk-PCT7GYBP.js";
|
|
39
|
+
import "./chunk-CXTZPOTA.js";
|
|
40
|
+
import "./chunk-J4WDJ7XS.js";
|
|
41
|
+
import "./chunk-TFTNZZDH.js";
|
|
32
42
|
import "./chunk-XQUHC3JZ.js";
|
|
33
43
|
import "./chunk-R4YSJ4EY.js";
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-CUE4UZXR.js";
|
|
36
|
-
import "./chunk-EYWNOHMJ.js";
|
|
44
|
+
import "./chunk-L653KKCR.js";
|
|
37
45
|
import {
|
|
38
46
|
createLogger
|
|
39
|
-
} from "./chunk-
|
|
40
|
-
import "./chunk-4L66JHQE.js";
|
|
47
|
+
} from "./chunk-V3S3NXBQ.js";
|
|
41
48
|
import "./chunk-3RG5ZIWI.js";
|
|
42
49
|
|
|
43
50
|
// src/webui/server.ts
|
|
44
|
-
import { Hono } from "hono";
|
|
51
|
+
import { Hono as Hono3 } from "hono";
|
|
45
52
|
import { serve } from "@hono/node-server";
|
|
46
53
|
import { cors } from "hono/cors";
|
|
47
54
|
import { streamSSE } from "hono/streaming";
|
|
48
55
|
import { bodyLimit } from "hono/body-limit";
|
|
49
56
|
import { setCookie, getCookie, deleteCookie } from "hono/cookie";
|
|
50
|
-
import { existsSync
|
|
57
|
+
import { existsSync } from "fs";
|
|
58
|
+
import { readFile } from "fs/promises";
|
|
51
59
|
import { join, dirname, resolve, relative } from "path";
|
|
52
60
|
import { fileURLToPath } from "url";
|
|
53
61
|
|
|
@@ -70,6 +78,128 @@ function safeCompare(a, b) {
|
|
|
70
78
|
return timingSafeEqual(bufA, bufB);
|
|
71
79
|
}
|
|
72
80
|
|
|
81
|
+
// src/webui/routes/conversations.ts
|
|
82
|
+
import { Hono } from "hono";
|
|
83
|
+
function createConversationRoutes(deps) {
|
|
84
|
+
const app = new Hono();
|
|
85
|
+
app.get("/", (c) => {
|
|
86
|
+
try {
|
|
87
|
+
const chats = deps.memory.db.prepare(
|
|
88
|
+
`
|
|
89
|
+
SELECT c.id, c.type, c.title, c.username,
|
|
90
|
+
(SELECT COUNT(*) FROM tg_messages m WHERE m.chat_id = c.id) as message_count,
|
|
91
|
+
(SELECT MAX(timestamp) FROM tg_messages m WHERE m.chat_id = c.id) as last_message_at,
|
|
92
|
+
(SELECT text FROM tg_messages m WHERE m.chat_id = c.id ORDER BY timestamp DESC LIMIT 1) as last_message
|
|
93
|
+
FROM tg_chats c
|
|
94
|
+
ORDER BY last_message_at DESC NULLS LAST
|
|
95
|
+
`
|
|
96
|
+
).all();
|
|
97
|
+
const response = {
|
|
98
|
+
success: true,
|
|
99
|
+
data: chats
|
|
100
|
+
};
|
|
101
|
+
return c.json(response);
|
|
102
|
+
} catch (error) {
|
|
103
|
+
const response = {
|
|
104
|
+
success: false,
|
|
105
|
+
error: getErrorMessage(error)
|
|
106
|
+
};
|
|
107
|
+
return c.json(response, 500);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
app.get("/:chatId/messages", (c) => {
|
|
111
|
+
try {
|
|
112
|
+
const chatId = c.req.param("chatId");
|
|
113
|
+
const limit = Number(c.req.query("limit") || "50");
|
|
114
|
+
const offset = Number(c.req.query("offset") || "0");
|
|
115
|
+
const messages = deps.memory.db.prepare(
|
|
116
|
+
`
|
|
117
|
+
SELECT id, chat_id, sender_id, text, is_from_agent, has_media, media_type, timestamp
|
|
118
|
+
FROM tg_messages
|
|
119
|
+
WHERE chat_id = ?
|
|
120
|
+
ORDER BY timestamp DESC
|
|
121
|
+
LIMIT ? OFFSET ?
|
|
122
|
+
`
|
|
123
|
+
).all(chatId, limit, offset);
|
|
124
|
+
const response = {
|
|
125
|
+
success: true,
|
|
126
|
+
data: messages
|
|
127
|
+
};
|
|
128
|
+
return c.json(response);
|
|
129
|
+
} catch (error) {
|
|
130
|
+
const response = {
|
|
131
|
+
success: false,
|
|
132
|
+
error: getErrorMessage(error)
|
|
133
|
+
};
|
|
134
|
+
return c.json(response, 500);
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
return app;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// src/webui/routes/wallet.ts
|
|
141
|
+
import { Hono as Hono2 } from "hono";
|
|
142
|
+
import { Address } from "@ton/core";
|
|
143
|
+
function createWalletRoutes(_deps) {
|
|
144
|
+
const app = new Hono2();
|
|
145
|
+
app.get("/", async (c) => {
|
|
146
|
+
try {
|
|
147
|
+
const address = getWalletAddress();
|
|
148
|
+
if (!address) {
|
|
149
|
+
const response2 = {
|
|
150
|
+
success: true,
|
|
151
|
+
data: { address: null, balance: "0" }
|
|
152
|
+
};
|
|
153
|
+
return c.json(response2);
|
|
154
|
+
}
|
|
155
|
+
const balanceResult = await getWalletBalance(address);
|
|
156
|
+
const response = {
|
|
157
|
+
success: true,
|
|
158
|
+
data: {
|
|
159
|
+
address,
|
|
160
|
+
balance: balanceResult?.balance ?? "0"
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
return c.json(response);
|
|
164
|
+
} catch (error) {
|
|
165
|
+
const response = {
|
|
166
|
+
success: false,
|
|
167
|
+
error: getErrorMessage(error)
|
|
168
|
+
};
|
|
169
|
+
return c.json(response, 500);
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
app.get("/transactions", async (c) => {
|
|
173
|
+
try {
|
|
174
|
+
const address = getWalletAddress();
|
|
175
|
+
if (!address) {
|
|
176
|
+
const response2 = {
|
|
177
|
+
success: false,
|
|
178
|
+
error: "No wallet configured"
|
|
179
|
+
};
|
|
180
|
+
return c.json(response2, 404);
|
|
181
|
+
}
|
|
182
|
+
const limit = Math.min(Number(c.req.query("limit") || "20"), 50);
|
|
183
|
+
const client = await getCachedTonClient();
|
|
184
|
+
const addressObj = Address.parse(address);
|
|
185
|
+
const transactions = await client.getTransactions(addressObj, { limit });
|
|
186
|
+
const formatted = formatTransactions(transactions);
|
|
187
|
+
const response = {
|
|
188
|
+
success: true,
|
|
189
|
+
data: formatted
|
|
190
|
+
};
|
|
191
|
+
return c.json(response);
|
|
192
|
+
} catch (error) {
|
|
193
|
+
const response = {
|
|
194
|
+
success: false,
|
|
195
|
+
error: getErrorMessage(error)
|
|
196
|
+
};
|
|
197
|
+
return c.json(response, 500);
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
return app;
|
|
201
|
+
}
|
|
202
|
+
|
|
73
203
|
// src/webui/server.ts
|
|
74
204
|
var log = createLogger("WebUI");
|
|
75
205
|
function findWebDist() {
|
|
@@ -100,7 +230,7 @@ var WebUIServer = class {
|
|
|
100
230
|
authToken;
|
|
101
231
|
constructor(deps) {
|
|
102
232
|
this.deps = deps;
|
|
103
|
-
this.app = new
|
|
233
|
+
this.app = new Hono3();
|
|
104
234
|
this.authToken = deps.config.auth_token || generateToken();
|
|
105
235
|
this.setupMiddleware();
|
|
106
236
|
this.setupRoutes();
|
|
@@ -213,6 +343,8 @@ var WebUIServer = class {
|
|
|
213
343
|
this.app.route("/api/marketplace", createMarketplaceRoutes(this.deps));
|
|
214
344
|
this.app.route("/api/hooks", createHooksRoutes(this.deps));
|
|
215
345
|
this.app.route("/api/ton-proxy", createTonProxyRoutes(this.deps));
|
|
346
|
+
this.app.route("/api/conversations", createConversationRoutes(this.deps));
|
|
347
|
+
this.app.route("/api/wallet", createWalletRoutes(this.deps));
|
|
216
348
|
this.app.post("/api/agent/start", async (c) => {
|
|
217
349
|
const lifecycle = this.deps.lifecycle;
|
|
218
350
|
if (!lifecycle) {
|
|
@@ -258,6 +390,68 @@ var WebUIServer = class {
|
|
|
258
390
|
error: lifecycle.getError() ?? null
|
|
259
391
|
});
|
|
260
392
|
});
|
|
393
|
+
this.app.get("/api/agent/mode", (c) => {
|
|
394
|
+
const raw = readRawConfig(this.deps.configPath);
|
|
395
|
+
const telegram = raw?.telegram || {};
|
|
396
|
+
const currentMode = telegram.mode || "user";
|
|
397
|
+
const hasBotToken = !!telegram.bot_token;
|
|
398
|
+
const hasUserCredentials = !!(telegram.api_id && telegram.api_hash && telegram.phone);
|
|
399
|
+
return c.json({
|
|
400
|
+
mode: currentMode,
|
|
401
|
+
canSwitchToBot: hasBotToken,
|
|
402
|
+
canSwitchToUser: hasUserCredentials
|
|
403
|
+
});
|
|
404
|
+
});
|
|
405
|
+
this.app.post("/api/agent/mode", async (c) => {
|
|
406
|
+
const lifecycle = this.deps.lifecycle;
|
|
407
|
+
if (!lifecycle) {
|
|
408
|
+
return c.json({ error: "Agent lifecycle not available" }, 503);
|
|
409
|
+
}
|
|
410
|
+
const body = await c.req.json();
|
|
411
|
+
if (body.mode !== "user" && body.mode !== "bot") {
|
|
412
|
+
return c.json({ error: "Invalid mode" }, 400);
|
|
413
|
+
}
|
|
414
|
+
const raw = readRawConfig(this.deps.configPath);
|
|
415
|
+
if (!raw?.telegram) {
|
|
416
|
+
return c.json({ error: "No telegram config found" }, 400);
|
|
417
|
+
}
|
|
418
|
+
if (body.mode === "bot") {
|
|
419
|
+
const token = body.botToken || raw.telegram.bot_token;
|
|
420
|
+
if (!token) {
|
|
421
|
+
return c.json({ error: "Bot token required" }, 400);
|
|
422
|
+
}
|
|
423
|
+
if (body.botToken) {
|
|
424
|
+
try {
|
|
425
|
+
const resp = await fetch(`https://api.telegram.org/bot${body.botToken}/getMe`);
|
|
426
|
+
const result = await resp.json();
|
|
427
|
+
if (!result.ok) {
|
|
428
|
+
return c.json(
|
|
429
|
+
{ error: `Invalid bot token: ${result.description || "validation failed"}` },
|
|
430
|
+
400
|
|
431
|
+
);
|
|
432
|
+
}
|
|
433
|
+
} catch {
|
|
434
|
+
return c.json({ error: "Failed to validate bot token (network error)" }, 400);
|
|
435
|
+
}
|
|
436
|
+
raw.telegram.bot_token = body.botToken;
|
|
437
|
+
}
|
|
438
|
+
} else {
|
|
439
|
+
if (body.userCredentials) {
|
|
440
|
+
raw.telegram.api_id = body.userCredentials.apiId;
|
|
441
|
+
raw.telegram.api_hash = body.userCredentials.apiHash;
|
|
442
|
+
raw.telegram.phone = body.userCredentials.phone;
|
|
443
|
+
}
|
|
444
|
+
if (!raw.telegram.api_id || !raw.telegram.api_hash || !raw.telegram.phone) {
|
|
445
|
+
return c.json({ error: "User credentials (api_id, api_hash, phone) required" }, 400);
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
raw.telegram.mode = body.mode;
|
|
449
|
+
writeRawConfig(raw, this.deps.configPath);
|
|
450
|
+
lifecycle.stop().then(() => lifecycle.start()).catch((err) => {
|
|
451
|
+
log.error({ err }, "Mode switch restart failed");
|
|
452
|
+
});
|
|
453
|
+
return c.json({ success: true, mode: body.mode, restarting: true });
|
|
454
|
+
});
|
|
261
455
|
this.app.get("/api/agent/events", (c) => {
|
|
262
456
|
const lifecycle = this.deps.lifecycle;
|
|
263
457
|
if (!lifecycle) {
|
|
@@ -305,7 +499,7 @@ var WebUIServer = class {
|
|
|
305
499
|
});
|
|
306
500
|
const webDist = findWebDist();
|
|
307
501
|
if (webDist) {
|
|
308
|
-
const indexHtml =
|
|
502
|
+
const indexHtml = readFile(join(webDist, "index.html"), "utf-8");
|
|
309
503
|
const mimeTypes = {
|
|
310
504
|
js: "application/javascript",
|
|
311
505
|
css: "text/css",
|
|
@@ -318,14 +512,14 @@ var WebUIServer = class {
|
|
|
318
512
|
woff2: "font/woff2",
|
|
319
513
|
woff: "font/woff"
|
|
320
514
|
};
|
|
321
|
-
this.app.get("*", (c) => {
|
|
515
|
+
this.app.get("*", async (c) => {
|
|
322
516
|
const filePath = resolve(join(webDist, c.req.path));
|
|
323
517
|
const rel = relative(webDist, filePath);
|
|
324
518
|
if (rel.startsWith("..") || resolve(filePath) !== filePath) {
|
|
325
|
-
return c.html(indexHtml);
|
|
519
|
+
return c.html(await indexHtml);
|
|
326
520
|
}
|
|
327
521
|
try {
|
|
328
|
-
const content =
|
|
522
|
+
const content = await readFile(filePath);
|
|
329
523
|
const ext = filePath.split(".").pop() || "";
|
|
330
524
|
if (mimeTypes[ext]) {
|
|
331
525
|
const immutable = c.req.path.startsWith("/assets/");
|
|
@@ -336,7 +530,7 @@ var WebUIServer = class {
|
|
|
336
530
|
}
|
|
337
531
|
} catch {
|
|
338
532
|
}
|
|
339
|
-
return c.html(indexHtml);
|
|
533
|
+
return c.html(await indexHtml);
|
|
340
534
|
});
|
|
341
535
|
}
|
|
342
536
|
this.app.onError((err, c) => {
|