abtars 0.1.0-alpha.1

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.
Files changed (312) hide show
  1. package/LICENSE +190 -0
  2. package/README.md +84 -0
  3. package/bundle/_registry.generated-M4WY2MMI.js +35 -0
  4. package/bundle/_registry.generated-M4WY2MMI.js.map +7 -0
  5. package/bundle/abtars-browser.js +162 -0
  6. package/bundle/abtars-browser.js.map +7 -0
  7. package/bundle/abtars-cli.js +1438 -0
  8. package/bundle/abtars-cli.js.map +7 -0
  9. package/bundle/abtars-restart.js +12 -0
  10. package/bundle/abtars-restart.js.map +7 -0
  11. package/bundle/abtars-rss.js +165 -0
  12. package/bundle/abtars-rss.js.map +7 -0
  13. package/bundle/abtars-task.js +258 -0
  14. package/bundle/abtars-task.js.map +7 -0
  15. package/bundle/abtars.js +4072 -0
  16. package/bundle/abtars.js.map +7 -0
  17. package/bundle/agent-api-rate-limit-OQNFMXTZ.js +38 -0
  18. package/bundle/agent-api-rate-limit-OQNFMXTZ.js.map +7 -0
  19. package/bundle/agent-registry-LT4JNQH6.js +18 -0
  20. package/bundle/agent-registry-LT4JNQH6.js.map +7 -0
  21. package/bundle/agents/default.md +29 -0
  22. package/bundle/anthropic-adapter-2APTH3LA.js +40 -0
  23. package/bundle/anthropic-adapter-2APTH3LA.js.map +7 -0
  24. package/bundle/bridge-lock-transport-4AC2G5G6.js +39 -0
  25. package/bundle/bridge-lock-transport-4AC2G5G6.js.map +7 -0
  26. package/bundle/browse-delivery-JXBY36GK.js +17 -0
  27. package/bundle/browse-delivery-JXBY36GK.js.map +7 -0
  28. package/bundle/browser-ELNDVPLC.js +18 -0
  29. package/bundle/browser-ELNDVPLC.js.map +7 -0
  30. package/bundle/capability-CIL3G4FI.js +17 -0
  31. package/bundle/capability-CIL3G4FI.js.map +7 -0
  32. package/bundle/chunk-265TPOPC.js +289 -0
  33. package/bundle/chunk-265TPOPC.js.map +7 -0
  34. package/bundle/chunk-2UENBO6M.js +223 -0
  35. package/bundle/chunk-2UENBO6M.js.map +7 -0
  36. package/bundle/chunk-2UPU3OW6.js +67 -0
  37. package/bundle/chunk-2UPU3OW6.js.map +7 -0
  38. package/bundle/chunk-2XU2X4OI.js +125 -0
  39. package/bundle/chunk-2XU2X4OI.js.map +7 -0
  40. package/bundle/chunk-3B7BBE4F.js +758 -0
  41. package/bundle/chunk-3B7BBE4F.js.map +7 -0
  42. package/bundle/chunk-3E545J66.js +69 -0
  43. package/bundle/chunk-3E545J66.js.map +7 -0
  44. package/bundle/chunk-5R2ANXQ7.js +510 -0
  45. package/bundle/chunk-5R2ANXQ7.js.map +7 -0
  46. package/bundle/chunk-6CPN4IGS.js +507 -0
  47. package/bundle/chunk-6CPN4IGS.js.map +7 -0
  48. package/bundle/chunk-6NR3OHEW.js +88 -0
  49. package/bundle/chunk-6NR3OHEW.js.map +7 -0
  50. package/bundle/chunk-6SETMHNN.js +206 -0
  51. package/bundle/chunk-6SETMHNN.js.map +7 -0
  52. package/bundle/chunk-6UCRKRWR.js +644 -0
  53. package/bundle/chunk-6UCRKRWR.js.map +7 -0
  54. package/bundle/chunk-AR6GO6YC.js +83 -0
  55. package/bundle/chunk-AR6GO6YC.js.map +7 -0
  56. package/bundle/chunk-AZJIODTQ.js +54 -0
  57. package/bundle/chunk-AZJIODTQ.js.map +7 -0
  58. package/bundle/chunk-BHMZ4RCC.js +3706 -0
  59. package/bundle/chunk-BHMZ4RCC.js.map +7 -0
  60. package/bundle/chunk-BQ2L4GMG.js +9175 -0
  61. package/bundle/chunk-BQ2L4GMG.js.map +7 -0
  62. package/bundle/chunk-BSSBCSCL.js +159 -0
  63. package/bundle/chunk-BSSBCSCL.js.map +7 -0
  64. package/bundle/chunk-BUUVFUPO.js +157 -0
  65. package/bundle/chunk-BUUVFUPO.js.map +7 -0
  66. package/bundle/chunk-CEVRHKJY.js +131 -0
  67. package/bundle/chunk-CEVRHKJY.js.map +7 -0
  68. package/bundle/chunk-CWOHNFUV.js +39 -0
  69. package/bundle/chunk-CWOHNFUV.js.map +7 -0
  70. package/bundle/chunk-D2DCBO6M.js +228 -0
  71. package/bundle/chunk-D2DCBO6M.js.map +7 -0
  72. package/bundle/chunk-FMWKEPM7.js +31 -0
  73. package/bundle/chunk-FMWKEPM7.js.map +7 -0
  74. package/bundle/chunk-GRNENTPA.js +145 -0
  75. package/bundle/chunk-GRNENTPA.js.map +7 -0
  76. package/bundle/chunk-GST5T3WZ.js +93 -0
  77. package/bundle/chunk-GST5T3WZ.js.map +7 -0
  78. package/bundle/chunk-GUQVJC3U.js +299 -0
  79. package/bundle/chunk-GUQVJC3U.js.map +7 -0
  80. package/bundle/chunk-HX7Y7EYP.js +3659 -0
  81. package/bundle/chunk-HX7Y7EYP.js.map +7 -0
  82. package/bundle/chunk-JCJS4ZIB.js +296 -0
  83. package/bundle/chunk-JCJS4ZIB.js.map +7 -0
  84. package/bundle/chunk-JW6RU47G.js +184 -0
  85. package/bundle/chunk-JW6RU47G.js.map +7 -0
  86. package/bundle/chunk-LSPKJQCI.js +24 -0
  87. package/bundle/chunk-LSPKJQCI.js.map +7 -0
  88. package/bundle/chunk-M6VBAPNT.js +16 -0
  89. package/bundle/chunk-M6VBAPNT.js.map +7 -0
  90. package/bundle/chunk-MPX525QO.js +129 -0
  91. package/bundle/chunk-MPX525QO.js.map +7 -0
  92. package/bundle/chunk-MW6WDLU7.js +130 -0
  93. package/bundle/chunk-MW6WDLU7.js.map +7 -0
  94. package/bundle/chunk-NT3OBORC.js +215 -0
  95. package/bundle/chunk-NT3OBORC.js.map +7 -0
  96. package/bundle/chunk-NWDBD4PA.js +50 -0
  97. package/bundle/chunk-NWDBD4PA.js.map +7 -0
  98. package/bundle/chunk-OP7BTAWY.js +29 -0
  99. package/bundle/chunk-OP7BTAWY.js.map +7 -0
  100. package/bundle/chunk-PLCY3GFH.js +77 -0
  101. package/bundle/chunk-PLCY3GFH.js.map +7 -0
  102. package/bundle/chunk-PNEDC45Y.js +97 -0
  103. package/bundle/chunk-PNEDC45Y.js.map +7 -0
  104. package/bundle/chunk-QBGBT5QS.js +81 -0
  105. package/bundle/chunk-QBGBT5QS.js.map +7 -0
  106. package/bundle/chunk-RVE2N7FA.js +70 -0
  107. package/bundle/chunk-RVE2N7FA.js.map +7 -0
  108. package/bundle/chunk-TZHIDLDS.js +71910 -0
  109. package/bundle/chunk-TZHIDLDS.js.map +7 -0
  110. package/bundle/chunk-UCQ2WC3B.js +126 -0
  111. package/bundle/chunk-UCQ2WC3B.js.map +7 -0
  112. package/bundle/chunk-UHRP745J.js +214 -0
  113. package/bundle/chunk-UHRP745J.js.map +7 -0
  114. package/bundle/chunk-V76TVMCM.js +58 -0
  115. package/bundle/chunk-V76TVMCM.js.map +7 -0
  116. package/bundle/chunk-VVEDVGCR.js +981 -0
  117. package/bundle/chunk-VVEDVGCR.js.map +7 -0
  118. package/bundle/chunk-W6FAL35D.js +102 -0
  119. package/bundle/chunk-W6FAL35D.js.map +7 -0
  120. package/bundle/chunk-X6TERNVJ.js +15902 -0
  121. package/bundle/chunk-X6TERNVJ.js.map +7 -0
  122. package/bundle/chunk-X76UX47U.js +47 -0
  123. package/bundle/chunk-X76UX47U.js.map +7 -0
  124. package/bundle/chunk-XREWVCUO.js +518 -0
  125. package/bundle/chunk-XREWVCUO.js.map +7 -0
  126. package/bundle/chunk-Y6XAEX2Q.js +408 -0
  127. package/bundle/chunk-Y6XAEX2Q.js.map +7 -0
  128. package/bundle/chunk-YOCTDKKL.js +28 -0
  129. package/bundle/chunk-YOCTDKKL.js.map +7 -0
  130. package/bundle/chunk-ZXPXCDA6.js +160 -0
  131. package/bundle/chunk-ZXPXCDA6.js.map +7 -0
  132. package/bundle/commands-BHVUOU3V.js +31 -0
  133. package/bundle/commands-BHVUOU3V.js.map +7 -0
  134. package/bundle/completion-buffer-P253ONKF.js +13 -0
  135. package/bundle/completion-buffer-P253ONKF.js.map +7 -0
  136. package/bundle/config-RGSDAPZN.js +19 -0
  137. package/bundle/config-RGSDAPZN.js.map +7 -0
  138. package/bundle/config-show-ERTATR6E.js +40 -0
  139. package/bundle/config-show-ERTATR6E.js.map +7 -0
  140. package/bundle/context-HCEGZNDC.js +72 -0
  141. package/bundle/context-HCEGZNDC.js.map +7 -0
  142. package/bundle/delegation-tools-GYTS2D6A.js +27 -0
  143. package/bundle/delegation-tools-GYTS2D6A.js.map +7 -0
  144. package/bundle/deploy-lib-import-32ZFKHWP.js +49 -0
  145. package/bundle/deploy-lib-import-32ZFKHWP.js.map +7 -0
  146. package/bundle/digital-signature-OFCGSHWO.js +13 -0
  147. package/bundle/digital-signature-OFCGSHWO.js.map +7 -0
  148. package/bundle/direct-api-transport-YR7SXXNN.js +860 -0
  149. package/bundle/direct-api-transport-YR7SXXNN.js.map +7 -0
  150. package/bundle/discord-adapter-YYWVMPPU.js +584 -0
  151. package/bundle/discord-adapter-YYWVMPPU.js.map +7 -0
  152. package/bundle/dist-MTMKARCP.js +1969 -0
  153. package/bundle/dist-MTMKARCP.js.map +7 -0
  154. package/bundle/dns-wakeup-27M7D2MR.js +107 -0
  155. package/bundle/dns-wakeup-27M7D2MR.js.map +7 -0
  156. package/bundle/doctor-QNUSDY73.js +248 -0
  157. package/bundle/doctor-QNUSDY73.js.map +7 -0
  158. package/bundle/ensure-invariants-NMXNS476.js +49 -0
  159. package/bundle/ensure-invariants-NMXNS476.js.map +7 -0
  160. package/bundle/env-schema-2KBHBDGN.js +19 -0
  161. package/bundle/env-schema-2KBHBDGN.js.map +7 -0
  162. package/bundle/esm-DDP6NCZG.js +100663 -0
  163. package/bundle/esm-DDP6NCZG.js.map +7 -0
  164. package/bundle/fallback-policy-L4QV2PEJ.js +46 -0
  165. package/bundle/fallback-policy-L4QV2PEJ.js.map +7 -0
  166. package/bundle/health-check-SPA7NT6N.js +56 -0
  167. package/bundle/health-check-SPA7NT6N.js.map +7 -0
  168. package/bundle/hook-system-6Q5YTR53.js +17 -0
  169. package/bundle/hook-system-6Q5YTR53.js.map +7 -0
  170. package/bundle/hotskills-K7BM4YLB.js +12 -0
  171. package/bundle/hotskills-K7BM4YLB.js.map +7 -0
  172. package/bundle/install-6HRZVKUM.js +15 -0
  173. package/bundle/install-6HRZVKUM.js.map +7 -0
  174. package/bundle/install-log-IAPHYKD4.js +28 -0
  175. package/bundle/install-log-IAPHYKD4.js.map +7 -0
  176. package/bundle/install-manifest-SPQRUNXL.js +102 -0
  177. package/bundle/install-manifest-SPQRUNXL.js.map +7 -0
  178. package/bundle/install-validate-PVLZXYLQ.js +53 -0
  179. package/bundle/install-validate-PVLZXYLQ.js.map +7 -0
  180. package/bundle/irc-adapter-OI5UZSQF.js +293 -0
  181. package/bundle/irc-adapter-OI5UZSQF.js.map +7 -0
  182. package/bundle/irc-config-55YO6EGB.js +88 -0
  183. package/bundle/irc-config-55YO6EGB.js.map +7 -0
  184. package/bundle/logs-ZNYXX5PA.js +19 -0
  185. package/bundle/logs-ZNYXX5PA.js.map +7 -0
  186. package/bundle/media-utils-XNNDTYFI.js +4662 -0
  187. package/bundle/media-utils-XNNDTYFI.js.map +7 -0
  188. package/bundle/message-pipeline-LLH5SYMO.js +33 -0
  189. package/bundle/message-pipeline-LLH5SYMO.js.map +7 -0
  190. package/bundle/meta.json +41304 -0
  191. package/bundle/model-health-registry-35LQNVQR.js +11 -0
  192. package/bundle/model-health-registry-35LQNVQR.js.map +7 -0
  193. package/bundle/notification-Y5S5MMLV.js +13 -0
  194. package/bundle/notification-Y5S5MMLV.js.map +7 -0
  195. package/bundle/openrouter-credits-EDY7ETAU.js +32 -0
  196. package/bundle/openrouter-credits-EDY7ETAU.js.map +7 -0
  197. package/bundle/passwd-RRFV4CC5.js +133 -0
  198. package/bundle/passwd-RRFV4CC5.js.map +7 -0
  199. package/bundle/paths-G33RZWZ7.js +17 -0
  200. package/bundle/paths-G33RZWZ7.js.map +7 -0
  201. package/bundle/peer-client-52XYMNI7.js +156 -0
  202. package/bundle/peer-client-52XYMNI7.js.map +7 -0
  203. package/bundle/peer-config-VK6EDLN5.js +16 -0
  204. package/bundle/peer-config-VK6EDLN5.js.map +7 -0
  205. package/bundle/peer-sessions-EAXTNQ36.js +49 -0
  206. package/bundle/peer-sessions-EAXTNQ36.js.map +7 -0
  207. package/bundle/pending-callback-RIMQZ7FJ.js +40 -0
  208. package/bundle/pending-callback-RIMQZ7FJ.js.map +7 -0
  209. package/bundle/phase-transport-KYERDL2O.js +22 -0
  210. package/bundle/phase-transport-KYERDL2O.js.map +7 -0
  211. package/bundle/public/css/dashboard.css +542 -0
  212. package/bundle/public/index.html +180 -0
  213. package/bundle/public/js/app.js +437 -0
  214. package/bundle/public/memory-universe.js +384 -0
  215. package/bundle/responses-adapter-AAQTY3K4.js +30 -0
  216. package/bundle/responses-adapter-AAQTY3K4.js.map +7 -0
  217. package/bundle/restore-ZE3SEPSS.js +46 -0
  218. package/bundle/restore-ZE3SEPSS.js.map +7 -0
  219. package/bundle/self-healer-utils-DMUUXC47.js +43 -0
  220. package/bundle/self-healer-utils-DMUUXC47.js.map +7 -0
  221. package/bundle/skill-stats-LLEXEXLR.js +22 -0
  222. package/bundle/skill-stats-LLEXEXLR.js.map +7 -0
  223. package/bundle/sleep-OYIUOVQD.js +19 -0
  224. package/bundle/sleep-OYIUOVQD.js.map +7 -0
  225. package/bundle/soul-loader-54WCVNLJ.js +16 -0
  226. package/bundle/soul-loader-54WCVNLJ.js.map +7 -0
  227. package/bundle/src-JL4PVO23.js +8 -0
  228. package/bundle/src-JL4PVO23.js.map +7 -0
  229. package/bundle/sse-parser-anthropic-P7CE2MH2.js +72 -0
  230. package/bundle/sse-parser-anthropic-P7CE2MH2.js.map +7 -0
  231. package/bundle/sse-parser-responses-EQQA5FWN.js +63 -0
  232. package/bundle/sse-parser-responses-EQQA5FWN.js.map +7 -0
  233. package/bundle/ssrf-guard-FZCBYIVW.js +64 -0
  234. package/bundle/ssrf-guard-FZCBYIVW.js.map +7 -0
  235. package/bundle/start-FH3GRMJ4.js +35 -0
  236. package/bundle/start-FH3GRMJ4.js.map +7 -0
  237. package/bundle/stream-single-WSG4D53C.js +33 -0
  238. package/bundle/stream-single-WSG4D53C.js.map +7 -0
  239. package/bundle/stt-2UH3RITX.js +14 -0
  240. package/bundle/stt-2UH3RITX.js.map +7 -0
  241. package/bundle/subagent-runtime-LE2ZXH3G.js +12 -0
  242. package/bundle/subagent-runtime-LE2ZXH3G.js.map +7 -0
  243. package/bundle/system-message-T5R3EYYN.js +30 -0
  244. package/bundle/system-message-T5R3EYYN.js.map +7 -0
  245. package/bundle/system-status-KQ6KHFJ6.js +189 -0
  246. package/bundle/system-status-KQ6KHFJ6.js.map +7 -0
  247. package/bundle/task-store-K7CQDEPI.js +22 -0
  248. package/bundle/task-store-K7CQDEPI.js.map +7 -0
  249. package/bundle/telegram-adapter-2V3XUMT5.js +1060 -0
  250. package/bundle/telegram-adapter-2V3XUMT5.js.map +7 -0
  251. package/bundle/tool-registry-MU3OX4UI.js +38 -0
  252. package/bundle/tool-registry-MU3OX4UI.js.map +7 -0
  253. package/bundle/tool-sandbox-VYOK4ZOA.js +20 -0
  254. package/bundle/tool-sandbox-VYOK4ZOA.js.map +7 -0
  255. package/bundle/transport-config-YLXU33RO.js +57 -0
  256. package/bundle/transport-config-YLXU33RO.js.map +7 -0
  257. package/bundle/update-QCW5LXRN.js +13 -0
  258. package/bundle/update-QCW5LXRN.js.map +7 -0
  259. package/bundle/update-check-27KZSAP6.js +12 -0
  260. package/bundle/update-check-27KZSAP6.js.map +7 -0
  261. package/bundle/usage-tracker-OVVEVMOY.js +17 -0
  262. package/bundle/usage-tracker-OVVEVMOY.js.map +7 -0
  263. package/bundle/user-registry-D4SD73UV.js +16 -0
  264. package/bundle/user-registry-D4SD73UV.js.map +7 -0
  265. package/core/professor.json +14 -0
  266. package/core/prompts/browsing_prompt.md +39 -0
  267. package/core/prompts/compaction.md +32 -0
  268. package/core/skills/memory/classification/SKILL.md +37 -0
  269. package/core/skills/memory/memory-anomalies/SKILL.md +39 -0
  270. package/core/skills/memory/memory-search/SKILL.md +48 -0
  271. package/core/skills/memory/topic-save/SKILL.md +44 -0
  272. package/core/skills/ops/cron/SKILL.md +51 -0
  273. package/core/skills/ops/gdrive-backup/SKILL.md +15 -0
  274. package/core/skills/ops/session-start/SKILL.md +11 -0
  275. package/core/skills/ops/skill-authoring/SKILL.md +54 -0
  276. package/core/skills/ops/system-health/SKILL.md +104 -0
  277. package/core/skills/ops/troubleshooting/SKILL.md +48 -0
  278. package/core/skills/ops/trust-gating/SKILL.md +30 -0
  279. package/core/skills/tools/a2a-communication/SKILL.md +68 -0
  280. package/core/skills/tools/browse-delegate/SKILL.md +27 -0
  281. package/core/skills/tools/browser/SKILL.md +36 -0
  282. package/core/skills/tools/clawhub/SKILL.md +44 -0
  283. package/core/skills/tools/delegation/SKILL.md +48 -0
  284. package/core/skills/tools/fxtwitter/SKILL.md +52 -0
  285. package/core/skills/tools/gmail/SKILL.md +44 -0
  286. package/core/skills/tools/irc-chat/SKILL.md +84 -0
  287. package/core/skills/tools/linear/SKILL.md +90 -0
  288. package/core/skills/tools/mcporter/SKILL.md +46 -0
  289. package/core/skills/tools/model-scout/SKILL.md +132 -0
  290. package/core/skills/tools/model-scout/scout-add-model.py +67 -0
  291. package/core/skills/tools/model-scout/scout-ollama.py +116 -0
  292. package/core/skills/tools/model-scout/scout-openrouter.py +85 -0
  293. package/core/skills/tools/nlm/SKILL.md +40 -0
  294. package/core/skills/tools/todo/SKILL.md +30 -0
  295. package/core/skills/tools/twitterX/SKILL.md +52 -0
  296. package/core/skills/tools/twitterX/scripts/abtars-tweet.js +532 -0
  297. package/core/skills/tools/twitterX/scripts/package.json +1 -0
  298. package/core/skills/tools/web-fetch/SKILL.md +29 -0
  299. package/package.json +59 -0
  300. package/scripts/abtars-daemon.service +23 -0
  301. package/scripts/abtars-fetch.sh +42 -0
  302. package/scripts/abtars-watchdog.service +13 -0
  303. package/scripts/abtars.sh +14 -0
  304. package/scripts/abtars@.service +21 -0
  305. package/scripts/browser-patchright.sh +79 -0
  306. package/scripts/com.abtars.daemon.plist +24 -0
  307. package/scripts/com.abtars.watchdog.plist +27 -0
  308. package/scripts/daily-backup.sh +62 -0
  309. package/scripts/doctor.sh +553 -0
  310. package/scripts/hooks/audit-logger.sh +22 -0
  311. package/scripts/upgrade-deps.sh +64 -0
  312. package/scripts/watchdog.sh +309 -0
@@ -0,0 +1,160 @@
1
+ import { createRequire as __bundleCreateRequire } from 'node:module'; import { fileURLToPath as __bundleFileURLToPath } from 'node:url'; import { dirname as __bundleDirname } from 'node:path'; const require = __bundleCreateRequire(import.meta.url); const __chunk_filename = __bundleFileURLToPath(import.meta.url); const __chunk_dirname = __bundleDirname(__chunk_filename);
2
+ import {
3
+ init_log_and_swallow,
4
+ logAndSwallow
5
+ } from "./chunk-FMWKEPM7.js";
6
+
7
+ // src/cli/commands/restart.ts
8
+ init_log_and_swallow();
9
+ import { existsSync, readFileSync } from "node:fs";
10
+ import { execSync } from "node:child_process";
11
+ import { join } from "node:path";
12
+ function abtarsHome() {
13
+ return process.env["ABTARS_HOME"] ?? join(process.env["HOME"] ?? "", ".abtars");
14
+ }
15
+ function readJsonField(file, field) {
16
+ try {
17
+ const data = JSON.parse(readFileSync(file, "utf-8"));
18
+ return data[field];
19
+ } catch {
20
+ return void 0;
21
+ }
22
+ }
23
+ function pidAlive(pid) {
24
+ try {
25
+ process.kill(pid, 0);
26
+ return true;
27
+ } catch {
28
+ return false;
29
+ }
30
+ }
31
+ function killPortHolder(port) {
32
+ try {
33
+ const pid = execSync(`lsof -ti :${port}`, { encoding: "utf-8", timeout: 3e3 }).trim();
34
+ if (!pid) return;
35
+ process.stdout.write(`\u{1F6D1} Killing stale process on port ${port} (pid ${pid})...
36
+ `);
37
+ try {
38
+ execSync(`kill ${pid}`, { timeout: 3e3, stdio: "pipe" });
39
+ } catch {
40
+ }
41
+ for (let i = 0; i < 5; i++) {
42
+ try {
43
+ execSync(`lsof -ti :${port}`, { stdio: "pipe", timeout: 1e3 });
44
+ } catch {
45
+ return;
46
+ }
47
+ try {
48
+ execSync("sleep 1", { timeout: 2e3, stdio: "pipe" });
49
+ } catch {
50
+ }
51
+ }
52
+ try {
53
+ execSync(`kill -9 ${pid}`, { timeout: 1e3, stdio: "pipe" });
54
+ } catch {
55
+ }
56
+ } catch {
57
+ }
58
+ }
59
+ async function spawnLauncher(home, argv) {
60
+ const { spawn } = await import("node:child_process");
61
+ const launcher = join(home, "abtars.sh");
62
+ if (!existsSync(launcher)) {
63
+ process.stderr.write(`Launcher not found: ${launcher}
64
+ `);
65
+ return 1;
66
+ }
67
+ const child = spawn(launcher, argv, { detached: true, stdio: "ignore", cwd: home });
68
+ child.unref();
69
+ process.stdout.write(`\u267B\uFE0F Bridge starting (args: ${argv.join(" ")})...
70
+ `);
71
+ return 0;
72
+ }
73
+ async function killBridge(pid) {
74
+ try {
75
+ const cmdline = readFileSync(`/proc/${pid}/cmdline`, "utf-8");
76
+ if (!cmdline.includes("abtars") && !cmdline.includes("main.js") && !cmdline.includes("bundle")) {
77
+ process.stdout.write(`\u26A0\uFE0F PID ${pid} is not abtars \u2014 stale PID file
78
+ `);
79
+ return;
80
+ }
81
+ } catch (err) {
82
+ logAndSwallow("restart", "op", err);
83
+ }
84
+ try {
85
+ process.kill(pid, "SIGTERM");
86
+ } catch {
87
+ return;
88
+ }
89
+ process.stdout.write(`\u{1F6D1} Killing bridge (PID ${pid})...
90
+ `);
91
+ for (let i = 0; i < 20; i++) {
92
+ await new Promise((r) => setTimeout(r, 500));
93
+ if (!pidAlive(pid)) return;
94
+ }
95
+ try {
96
+ process.kill(pid, "SIGKILL");
97
+ } catch (err) {
98
+ logAndSwallow("restart", "op", err);
99
+ }
100
+ await new Promise((r) => setTimeout(r, 1e3));
101
+ }
102
+ async function restart(opts) {
103
+ const home = abtarsHome();
104
+ const lockFile = join(home, "bridge.lock");
105
+ const cold = opts.cold ?? false;
106
+ const bridgePid = readJsonField(lockFile, "pid");
107
+ const bridgeAlive = bridgePid != null && bridgePid > 0 && pidAlive(bridgePid);
108
+ if (cold) {
109
+ const manifestPath = join(home, "manifest.json");
110
+ const installMode = readJsonField(manifestPath, "installMode");
111
+ if (!installMode) {
112
+ process.stderr.write("\u274C installMode not set in manifest.json. Run 'abtars install' first.\n");
113
+ return 1;
114
+ }
115
+ if (installMode === "supervised-daemon") {
116
+ const platform = process.platform;
117
+ if (platform === "darwin") {
118
+ process.stderr.write(`Cold restart under supervised-daemon requires sudo:
119
+ sudo -k launchctl kickstart -k system/com.abtars.daemon
120
+ `);
121
+ } else {
122
+ process.stderr.write(`Cold restart under supervised-daemon requires sudo:
123
+ sudo -k systemctl restart abtars
124
+ `);
125
+ }
126
+ return 1;
127
+ }
128
+ const doctorPath = join(home, "scripts", "doctor.sh");
129
+ if (existsSync(doctorPath)) {
130
+ process.stdout.write("\u{1FA7A} Health check...\n");
131
+ try {
132
+ const { execSync: execSync2 } = await import("node:child_process");
133
+ execSync2(`bash "${doctorPath}" --fix`, { stdio: "inherit", timeout: 3e4 });
134
+ } catch (err) {
135
+ process.stderr.write(`\u26A0\uFE0F doctor --fix failed: ${err instanceof Error ? err.message : String(err)}
136
+ `);
137
+ }
138
+ }
139
+ if (bridgeAlive) await killBridge(bridgePid);
140
+ killPortHolder(3100);
141
+ const { updateBridgeLockField } = await import("./bridge-lock-transport-4AC2G5G6.js");
142
+ updateBridgeLockField("restartRequested", null);
143
+ const argv = [];
144
+ return spawnLauncher(home, argv);
145
+ }
146
+ if (bridgeAlive) {
147
+ const { writeRestartRequested } = await import("./bridge-lock-transport-4AC2G5G6.js");
148
+ writeRestartRequested("restart");
149
+ process.stdout.write(`\u267B\uFE0F Restart requested (PID ${bridgePid}) \u2014 bridge will restart within 30s
150
+ `);
151
+ return 0;
152
+ }
153
+ process.stdout.write("Bridge not running. Use --cold to start.\n");
154
+ return 1;
155
+ }
156
+
157
+ export {
158
+ restart
159
+ };
160
+ //# sourceMappingURL=chunk-ZXPXCDA6.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/cli/commands/restart.ts"],
4
+ "sourcesContent": ["/**\n * abtars restart [--cold] \u2014 unified restart command.\n * Warm (default): writeRestartRequested \u2192 main.ts internal loop restarts.\n * Cold (--cold): kill process + spawn new launcher. Always, both modes.\n */\n\nimport { logAndSwallow } from \"../../components/log-and-swallow.js\";\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { execSync } from \"node:child_process\";\nimport { join } from \"node:path\";\n\nfunction abtarsHome(): string {\n return process.env[\"ABTARS_HOME\"] ?? join(process.env[\"HOME\"] ?? \"\", \".abtars\");\n}\n\nfunction readJsonField(file: string, field: string): unknown {\n try {\n const data = JSON.parse(readFileSync(file, \"utf-8\"));\n return data[field];\n } catch { return undefined; }\n}\n\nfunction pidAlive(pid: number): boolean {\n try { process.kill(pid, 0); return true; } catch { return false; }\n}\n\n/** #686: Kill any process holding port 3100 before spawning a new bridge. */\nfunction killPortHolder(port: number): void {\n try {\n const pid = execSync(`lsof -ti :${port}`, { encoding: \"utf-8\", timeout: 3000 }).trim();\n if (!pid) return;\n process.stdout.write(`\uD83D\uDED1 Killing stale process on port ${port} (pid ${pid})...\\n`);\n try { execSync(`kill ${pid}`, { timeout: 3000, stdio: \"pipe\" }); } catch { /* */ }\n for (let i = 0; i < 5; i++) {\n try { execSync(`lsof -ti :${port}`, { stdio: \"pipe\", timeout: 1000 }); } catch { return; }\n try { execSync(\"sleep 1\", { timeout: 2000, stdio: \"pipe\" }); } catch { /* */ }\n }\n try { execSync(`kill -9 ${pid}`, { timeout: 1000, stdio: \"pipe\" }); } catch { /* */ }\n } catch { /* no process on port \u2014 good */ }\n}\n\nasync function spawnLauncher(home: string, argv: string[]): Promise<number> {\n const { spawn } = await import(\"node:child_process\");\n const launcher = join(home, \"abtars.sh\");\n if (!existsSync(launcher)) {\n process.stderr.write(`Launcher not found: ${launcher}\\n`);\n return 1;\n }\n const child = spawn(launcher, argv, { detached: true, stdio: \"ignore\", cwd: home });\n child.unref();\n process.stdout.write(`\u267B\uFE0F Bridge starting (args: ${argv.join(\" \")})...\\n`);\n return 0;\n}\n\nasync function killBridge(pid: number): Promise<void> {\n // Verify PID is actually the bridge (Linux /proc, fallback: skip check)\n try {\n const cmdline = readFileSync(`/proc/${pid}/cmdline`, \"utf-8\");\n if (!cmdline.includes(\"abtars\") && !cmdline.includes(\"main.js\") && !cmdline.includes(\"bundle\")) {\n process.stdout.write(`\u26A0\uFE0F PID ${pid} is not abtars \u2014 stale PID file\\n`);\n return;\n }\n } catch (err) { logAndSwallow(\"restart\", \"op\", err); }\n\n try { process.kill(pid, \"SIGTERM\"); } catch { return; }\n process.stdout.write(`\uD83D\uDED1 Killing bridge (PID ${pid})...\\n`);\n\n for (let i = 0; i < 20; i++) {\n await new Promise(r => setTimeout(r, 500));\n if (!pidAlive(pid)) return;\n }\n try { process.kill(pid, \"SIGKILL\"); } catch (err) { logAndSwallow(\"restart\", \"op\", err); }\n await new Promise(r => setTimeout(r, 1000));\n}\n\nexport async function restart(opts: { cold?: boolean }): Promise<number> {\n const home = abtarsHome();\n const lockFile = join(home, \"bridge.lock\");\n const cold = opts.cold ?? false;\n\n const bridgePid = readJsonField(lockFile, \"pid\") as number | undefined;\n const bridgeAlive = bridgePid != null && bridgePid > 0 && pidAlive(bridgePid);\n\n if (cold) {\n // Under supervised-daemon, cold restart requires sudo \u2014 refuse and print instructions\n const manifestPath = join(home, \"manifest.json\");\n const installMode = readJsonField(manifestPath, \"installMode\") as string | undefined;\n if (!installMode) {\n process.stderr.write(\"\u274C installMode not set in manifest.json. Run 'abtars install' first.\\n\");\n return 1;\n }\n if (installMode === \"supervised-daemon\") {\n const platform = process.platform;\n if (platform === \"darwin\") {\n process.stderr.write(`Cold restart under supervised-daemon requires sudo:\\n sudo -k launchctl kickstart -k system/com.abtars.daemon\\n`);\n } else {\n process.stderr.write(`Cold restart under supervised-daemon requires sudo:\\n sudo -k systemctl restart abtars\\n`);\n }\n return 1;\n }\n\n // Run doctor before spawning\n const doctorPath = join(home, \"scripts\", \"doctor.sh\");\n if (existsSync(doctorPath)) {\n process.stdout.write(\"\uD83E\uDE7A Health check...\\n\");\n try {\n const { execSync } = await import(\"node:child_process\");\n execSync(`bash \"${doctorPath}\" --fix`, { stdio: \"inherit\", timeout: 30_000 });\n } catch (err) {\n process.stderr.write(`\u26A0\uFE0F doctor --fix failed: ${err instanceof Error ? err.message : String(err)}\\n`);\n }\n }\n\n if (bridgeAlive) await killBridge(bridgePid!);\n killPortHolder(3100);\n // Clear stale restart requests so the new bridge doesn't restart again (#731)\n const { updateBridgeLockField } = await import(\"../../components/transport/bridge-lock-transport.js\");\n updateBridgeLockField(\"restartRequested\", null);\n const argv: string[] = []; // #534: env is SSoT \u2014 no CLI args needed\n return spawnLauncher(home, argv);\n }\n\n // Warm restart\n if (bridgeAlive) {\n const { writeRestartRequested } = await import(\"../../components/transport/bridge-lock-transport.js\");\n writeRestartRequested(\"restart\");\n process.stdout.write(`\u267B\uFE0F Restart requested (PID ${bridgePid}) \u2014 bridge will restart within 30s\\n`);\n return 0;\n }\n\n process.stdout.write(\"Bridge not running. Use --cold to start.\\n\");\n return 1;\n}\n"],
5
+ "mappings": "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",
6
+ "names": ["execSync"]
7
+ }
@@ -0,0 +1,31 @@
1
+ import { createRequire as __bundleCreateRequire } from 'node:module'; import { fileURLToPath as __bundleFileURLToPath } from 'node:url'; import { dirname as __bundleDirname } from 'node:path'; const require = __bundleCreateRequire(import.meta.url); const __chunk_filename = __bundleFileURLToPath(import.meta.url); const __chunk_dirname = __bundleDirname(__chunk_filename);
2
+ import {
3
+ handleCommand,
4
+ killWakeInhibit,
5
+ registerCommand,
6
+ triggerNewSession,
7
+ triggerResetSession
8
+ } from "./chunk-BHMZ4RCC.js";
9
+ import "./chunk-HX7Y7EYP.js";
10
+ import "./chunk-V76TVMCM.js";
11
+ import "./chunk-X6TERNVJ.js";
12
+ import "./chunk-UCQ2WC3B.js";
13
+ import "./chunk-GST5T3WZ.js";
14
+ import "./chunk-OP7BTAWY.js";
15
+ import "./chunk-GRNENTPA.js";
16
+ import "./chunk-CEVRHKJY.js";
17
+ import "./chunk-PLCY3GFH.js";
18
+ import "./chunk-M6VBAPNT.js";
19
+ import "./chunk-FMWKEPM7.js";
20
+ import "./chunk-JCJS4ZIB.js";
21
+ import "./chunk-BUUVFUPO.js";
22
+ import "./chunk-X76UX47U.js";
23
+ import "./chunk-NWDBD4PA.js";
24
+ export {
25
+ handleCommand,
26
+ killWakeInhibit,
27
+ registerCommand,
28
+ triggerNewSession,
29
+ triggerResetSession
30
+ };
31
+ //# sourceMappingURL=commands-BHVUOU3V.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,13 @@
1
+ import { createRequire as __bundleCreateRequire } from 'node:module'; import { fileURLToPath as __bundleFileURLToPath } from 'node:url'; import { dirname as __bundleDirname } from 'node:path'; const require = __bundleCreateRequire(import.meta.url); const __chunk_filename = __bundleFileURLToPath(import.meta.url); const __chunk_dirname = __bundleDirname(__chunk_filename);
2
+ import {
3
+ addCompletion,
4
+ drainCompletions,
5
+ hasCompletions
6
+ } from "./chunk-LSPKJQCI.js";
7
+ import "./chunk-NWDBD4PA.js";
8
+ export {
9
+ addCompletion,
10
+ drainCompletions,
11
+ hasCompletions
12
+ };
13
+ //# sourceMappingURL=completion-buffer-P253ONKF.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,19 @@
1
+ import { createRequire as __bundleCreateRequire } from 'node:module'; import { fileURLToPath as __bundleFileURLToPath } from 'node:url'; import { dirname as __bundleDirname } from 'node:path'; const require = __bundleCreateRequire(import.meta.url); const __chunk_filename = __bundleFileURLToPath(import.meta.url); const __chunk_dirname = __bundleDirname(__chunk_filename);
2
+ import {
3
+ isValidSnowflake,
4
+ loadAndValidateConfig
5
+ } from "./chunk-2UENBO6M.js";
6
+ import "./chunk-GST5T3WZ.js";
7
+ import "./chunk-YOCTDKKL.js";
8
+ import "./chunk-JCJS4ZIB.js";
9
+ import "./chunk-BUUVFUPO.js";
10
+ import {
11
+ abtarsHome
12
+ } from "./chunk-X76UX47U.js";
13
+ import "./chunk-NWDBD4PA.js";
14
+ export {
15
+ abtarsHome,
16
+ isValidSnowflake,
17
+ loadAndValidateConfig
18
+ };
19
+ //# sourceMappingURL=config-RGSDAPZN.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,40 @@
1
+ import { createRequire as __bundleCreateRequire } from 'node:module'; import { fileURLToPath as __bundleFileURLToPath } from 'node:url'; import { dirname as __bundleDirname } from 'node:path'; const require = __bundleCreateRequire(import.meta.url); const __chunk_filename = __bundleFileURLToPath(import.meta.url); const __chunk_dirname = __bundleDirname(__chunk_filename);
2
+ import "./chunk-NWDBD4PA.js";
3
+
4
+ // src/cli/commands/config-show.ts
5
+ import { readFileSync } from "node:fs";
6
+ import { join } from "node:path";
7
+ function abtarsHome() {
8
+ return process.env["ABTARS_HOME"] ?? join(process.env["HOME"] ?? "", ".abtars");
9
+ }
10
+ var SECRET_PATTERNS = ["TOKEN", "KEY", "SECRET", "PASSWORD", "PASSWD"];
11
+ function isSecret(name) {
12
+ return SECRET_PATTERNS.some((p) => name.includes(p));
13
+ }
14
+ async function configShow() {
15
+ const envFile = join(abtarsHome(), "config", ".env");
16
+ let lines;
17
+ try {
18
+ lines = readFileSync(envFile, "utf-8").split("\n");
19
+ } catch {
20
+ process.stderr.write(`Cannot read ${envFile}
21
+ `);
22
+ return 1;
23
+ }
24
+ for (const line of lines) {
25
+ const trimmed = line.trim();
26
+ if (!trimmed || trimmed.startsWith("#")) continue;
27
+ const eq = trimmed.indexOf("=");
28
+ if (eq < 1) continue;
29
+ const key = trimmed.slice(0, eq);
30
+ const val = trimmed.slice(eq + 1);
31
+ const display = isSecret(key) && val.length > 4 ? val.slice(0, 4) + "****" : val;
32
+ process.stdout.write(`${key}=${display}
33
+ `);
34
+ }
35
+ return 0;
36
+ }
37
+ export {
38
+ configShow
39
+ };
40
+ //# sourceMappingURL=config-show-ERTATR6E.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/cli/commands/config-show.ts"],
4
+ "sourcesContent": ["import { readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\n\nfunction abtarsHome(): string {\n return process.env[\"ABTARS_HOME\"] ?? join(process.env[\"HOME\"] ?? \"\", \".abtars\");\n}\n\nconst SECRET_PATTERNS = [\"TOKEN\", \"KEY\", \"SECRET\", \"PASSWORD\", \"PASSWD\"];\n\nfunction isSecret(name: string): boolean {\n return SECRET_PATTERNS.some(p => name.includes(p));\n}\n\nexport async function configShow(): Promise<number> {\n // Read .env file directly to show what's configured\n const envFile = join(abtarsHome(), \"config\", \".env\");\n let lines: string[];\n try {\n lines = readFileSync(envFile, \"utf-8\").split(\"\\n\");\n } catch {\n process.stderr.write(`Cannot read ${envFile}\\n`);\n return 1;\n }\n\n for (const line of lines) {\n const trimmed = line.trim();\n if (!trimmed || trimmed.startsWith(\"#\")) continue;\n const eq = trimmed.indexOf(\"=\");\n if (eq < 1) continue;\n const key = trimmed.slice(0, eq);\n const val = trimmed.slice(eq + 1);\n const display = isSecret(key) && val.length > 4 ? val.slice(0, 4) + \"****\" : val;\n process.stdout.write(`${key}=${display}\\n`);\n }\n return 0;\n}\n"],
5
+ "mappings": ";;;;AAAA,SAAS,oBAAoB;AAC7B,SAAS,YAAY;AAErB,SAAS,aAAqB;AAC5B,SAAO,QAAQ,IAAI,aAAa,KAAK,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,SAAS;AAChF;AAEA,IAAM,kBAAkB,CAAC,SAAS,OAAO,UAAU,YAAY,QAAQ;AAEvE,SAAS,SAAS,MAAuB;AACvC,SAAO,gBAAgB,KAAK,OAAK,KAAK,SAAS,CAAC,CAAC;AACnD;AAEA,eAAsB,aAA8B;AAElD,QAAM,UAAU,KAAK,WAAW,GAAG,UAAU,MAAM;AACnD,MAAI;AACJ,MAAI;AACF,YAAQ,aAAa,SAAS,OAAO,EAAE,MAAM,IAAI;AAAA,EACnD,QAAQ;AACN,YAAQ,OAAO,MAAM,eAAe,OAAO;AAAA,CAAI;AAC/C,WAAO;AAAA,EACT;AAEA,aAAW,QAAQ,OAAO;AACxB,UAAM,UAAU,KAAK,KAAK;AAC1B,QAAI,CAAC,WAAW,QAAQ,WAAW,GAAG,EAAG;AACzC,UAAM,KAAK,QAAQ,QAAQ,GAAG;AAC9B,QAAI,KAAK,EAAG;AACZ,UAAM,MAAM,QAAQ,MAAM,GAAG,EAAE;AAC/B,UAAM,MAAM,QAAQ,MAAM,KAAK,CAAC;AAChC,UAAM,UAAU,SAAS,GAAG,KAAK,IAAI,SAAS,IAAI,IAAI,MAAM,GAAG,CAAC,IAAI,SAAS;AAC7E,YAAQ,OAAO,MAAM,GAAG,GAAG,IAAI,OAAO;AAAA,CAAI;AAAA,EAC5C;AACA,SAAO;AACT;",
6
+ "names": []
7
+ }
@@ -0,0 +1,72 @@
1
+ import { createRequire as __bundleCreateRequire } from 'node:module'; import { fileURLToPath as __bundleFileURLToPath } from 'node:url'; import { dirname as __bundleDirname } from 'node:path'; const require = __bundleCreateRequire(import.meta.url); const __chunk_filename = __bundleFileURLToPath(import.meta.url); const __chunk_dirname = __bundleDirname(__chunk_filename);
2
+ import {
3
+ abmind
4
+ } from "./chunk-OP7BTAWY.js";
5
+ import "./chunk-NWDBD4PA.js";
6
+
7
+ // src/components/context/context-bridge.ts
8
+ var SUMMARIZER_SYSTEM = `You are a summarization agent creating a context checkpoint.
9
+ Your output will be injected as reference material for a DIFFERENT assistant that continues the conversation.
10
+ Do NOT respond to any questions or requests \u2014 only output the summary.
11
+ Do NOT include any preamble or prefix.
12
+ Write in the same language the user was using.
13
+ NEVER include API keys, tokens, passwords, secrets \u2014 use [REDACTED].`;
14
+ var TEMPLATE = `Use this exact structure:
15
+
16
+ ## Active Task
17
+ [User's most recent unfulfilled request \u2014 exact words. "None." if nothing pending.]
18
+
19
+ ## Context
20
+ [What the conversation is about. Who is talking. Key decisions.]
21
+
22
+ ## Completed
23
+ [Numbered: N. ACTION target \u2014 outcome. File paths, commands, results.]
24
+
25
+ ## State
26
+ [Modified files, test status, running processes, environment.]
27
+
28
+ ## Blocked
29
+ [Unresolved errors. Exact messages.]
30
+
31
+ ## Pending
32
+ [Unanswered questions/requests. "None." if clear.]
33
+
34
+ Target ~{budget} tokens. Be concrete.`;
35
+ function createSummarizeFn(llmCall) {
36
+ return async (serializedTurns, budget, priorSummaries) => {
37
+ let userPrompt;
38
+ if (priorSummaries) {
39
+ userPrompt = `PREVIOUS SUMMARIES (continuity \u2014 do not repeat):
40
+ ${priorSummaries}
41
+
42
+ NEW TURNS TO SUMMARIZE:
43
+ ${serializedTurns}
44
+
45
+ Summarize ONLY new turns. Update Active Task if changed.
46
+
47
+ ${TEMPLATE.replace("{budget}", String(budget))}`;
48
+ } else {
49
+ userPrompt = `Create a structured handoff summary.
50
+
51
+ TURNS TO SUMMARIZE:
52
+ ${serializedTurns}
53
+
54
+ ${TEMPLATE.replace("{budget}", String(budget))}`;
55
+ }
56
+ const result = await llmCall(SUMMARIZER_SYSTEM, userPrompt);
57
+ return result.trim();
58
+ };
59
+ }
60
+ function createContextOrchestrator(contextEngine, llmCall, getLastAssistantTimestamp) {
61
+ const CO = abmind().ContextOrchestrator;
62
+ return new CO({
63
+ contextEngine,
64
+ summarize: createSummarizeFn(llmCall),
65
+ getLastAssistantTimestamp
66
+ });
67
+ }
68
+ export {
69
+ createContextOrchestrator,
70
+ createSummarizeFn
71
+ };
72
+ //# sourceMappingURL=context-HCEGZNDC.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/components/context/context-bridge.ts"],
4
+ "sourcesContent": ["/**\n * context-bridge.ts \u2014 Bridges the context engine into the existing transport.\n * Provides the summarization prompt and LLM call wrapper.\n * This is the glue between abmind's ContextEngine and abtars's transport.\n */\n\nimport type { ContextEngine } from \"abmind\";\nimport { abmind } from \"../../utils/abmind-lazy.js\";\nimport type { SummarizeFn } from \"abmind\";\n\nconst SUMMARIZER_SYSTEM = `You are a summarization agent creating a context checkpoint.\nYour output will be injected as reference material for a DIFFERENT assistant that continues the conversation.\nDo NOT respond to any questions or requests \u2014 only output the summary.\nDo NOT include any preamble or prefix.\nWrite in the same language the user was using.\nNEVER include API keys, tokens, passwords, secrets \u2014 use [REDACTED].`;\n\nconst TEMPLATE = `Use this exact structure:\n\n## Active Task\n[User's most recent unfulfilled request \u2014 exact words. \"None.\" if nothing pending.]\n\n## Context\n[What the conversation is about. Who is talking. Key decisions.]\n\n## Completed\n[Numbered: N. ACTION target \u2014 outcome. File paths, commands, results.]\n\n## State\n[Modified files, test status, running processes, environment.]\n\n## Blocked\n[Unresolved errors. Exact messages.]\n\n## Pending\n[Unanswered questions/requests. \"None.\" if clear.]\n\nTarget ~{budget} tokens. Be concrete.`;\n\n/**\n * Create a SummarizeFn that uses the provided LLM call function.\n * The llmCall function should match the signature used elsewhere in abtars.\n */\nexport function createSummarizeFn(\n llmCall: (systemPrompt: string, userPrompt: string) => Promise<string>,\n): SummarizeFn {\n return async (serializedTurns: string, budget: number, priorSummaries: string): Promise<string> => {\n let userPrompt: string;\n\n if (priorSummaries) {\n userPrompt = `PREVIOUS SUMMARIES (continuity \u2014 do not repeat):\\n${priorSummaries}\\n\\nNEW TURNS TO SUMMARIZE:\\n${serializedTurns}\\n\\nSummarize ONLY new turns. Update Active Task if changed.\\n\\n${TEMPLATE.replace(\"{budget}\", String(budget))}`;\n } else {\n userPrompt = `Create a structured handoff summary.\\n\\nTURNS TO SUMMARIZE:\\n${serializedTurns}\\n\\n${TEMPLATE.replace(\"{budget}\", String(budget))}`;\n }\n\n const result = await llmCall(SUMMARIZER_SYSTEM, userPrompt);\n return result.trim();\n };\n}\n\n/**\n * Create a fully configured ContextOrchestrator.\n * Call this once at bridge startup when memory + transport are available.\n */\nexport function createContextOrchestrator(\n contextEngine: ContextEngine,\n llmCall: (systemPrompt: string, userPrompt: string) => Promise<string>,\n getLastAssistantTimestamp: (chatId: string) => number | null,\n): any {\n const CO = abmind()!.ContextOrchestrator;\n return new CO({\n contextEngine,\n summarize: createSummarizeFn(llmCall),\n getLastAssistantTimestamp,\n });\n}\n"],
5
+ "mappings": ";;;;;;;AAUA,IAAM,oBAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAO1B,IAAM,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA0BV,SAAS,kBACd,SACa;AACb,SAAO,OAAO,iBAAyB,QAAgB,mBAA4C;AACjG,QAAI;AAEJ,QAAI,gBAAgB;AAClB,mBAAa;AAAA,EAAqD,cAAc;AAAA;AAAA;AAAA,EAAgC,eAAe;AAAA;AAAA;AAAA;AAAA,EAAmE,SAAS,QAAQ,YAAY,OAAO,MAAM,CAAC,CAAC;AAAA,IAChP,OAAO;AACL,mBAAa;AAAA;AAAA;AAAA,EAAgE,eAAe;AAAA;AAAA,EAAO,SAAS,QAAQ,YAAY,OAAO,MAAM,CAAC,CAAC;AAAA,IACjJ;AAEA,UAAM,SAAS,MAAM,QAAQ,mBAAmB,UAAU;AAC1D,WAAO,OAAO,KAAK;AAAA,EACrB;AACF;AAMO,SAAS,0BACd,eACA,SACA,2BACK;AACL,QAAM,KAAK,OAAO,EAAG;AACrB,SAAO,IAAI,GAAG;AAAA,IACZ;AAAA,IACA,WAAW,kBAAkB,OAAO;AAAA,IACpC;AAAA,EACF,CAAC;AACH;",
6
+ "names": []
7
+ }
@@ -0,0 +1,27 @@
1
+ import { createRequire as __bundleCreateRequire } from 'node:module'; import { fileURLToPath as __bundleFileURLToPath } from 'node:url'; import { dirname as __bundleDirname } from 'node:path'; const require = __bundleCreateRequire(import.meta.url); const __chunk_filename = __bundleFileURLToPath(import.meta.url); const __chunk_dirname = __bundleDirname(__chunk_filename);
2
+ import {
3
+ checkSessionTool,
4
+ consumePendingInstruction,
5
+ getActiveBackgrounds,
6
+ getDelegationTools,
7
+ sendToSessionTool,
8
+ setDelegationDeps,
9
+ spawnSessionTool,
10
+ terminateSessionTool
11
+ } from "./chunk-UHRP745J.js";
12
+ import "./chunk-LSPKJQCI.js";
13
+ import "./chunk-JCJS4ZIB.js";
14
+ import "./chunk-BUUVFUPO.js";
15
+ import "./chunk-X76UX47U.js";
16
+ import "./chunk-NWDBD4PA.js";
17
+ export {
18
+ checkSessionTool,
19
+ consumePendingInstruction,
20
+ getActiveBackgrounds,
21
+ getDelegationTools,
22
+ sendToSessionTool,
23
+ setDelegationDeps,
24
+ spawnSessionTool,
25
+ terminateSessionTool
26
+ };
27
+ //# sourceMappingURL=delegation-tools-GYTS2D6A.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,49 @@
1
+ import { createRequire as __bundleCreateRequire } from 'node:module'; import { fileURLToPath as __bundleFileURLToPath } from 'node:url'; import { dirname as __bundleDirname } from 'node:path'; const require = __bundleCreateRequire(import.meta.url); const __chunk_filename = __bundleFileURLToPath(import.meta.url); const __chunk_dirname = __bundleDirname(__chunk_filename);
2
+ import {
3
+ LockHeldError,
4
+ RETENTION,
5
+ acquireLock,
6
+ activate,
7
+ emptyManifest,
8
+ hashFile,
9
+ inspectLock,
10
+ isUnsafeRemovalTarget,
11
+ listReleases,
12
+ packagePaths,
13
+ planRemoval,
14
+ pruneReleases,
15
+ readCurrent,
16
+ readManifest,
17
+ releaseExists,
18
+ removePath,
19
+ resolveAbmindHome,
20
+ resolveAbtarsHome,
21
+ resolveUserBinDir,
22
+ safeCopyTree,
23
+ writeManifest
24
+ } from "./chunk-265TPOPC.js";
25
+ import "./chunk-NWDBD4PA.js";
26
+ export {
27
+ LockHeldError,
28
+ RETENTION,
29
+ acquireLock,
30
+ activate,
31
+ emptyManifest,
32
+ hashFile,
33
+ inspectLock,
34
+ isUnsafeRemovalTarget,
35
+ listReleases,
36
+ packagePaths,
37
+ planRemoval,
38
+ pruneReleases,
39
+ readCurrent,
40
+ readManifest,
41
+ releaseExists,
42
+ removePath,
43
+ resolveAbmindHome,
44
+ resolveAbtarsHome,
45
+ resolveUserBinDir,
46
+ safeCopyTree,
47
+ writeManifest
48
+ };
49
+ //# sourceMappingURL=deploy-lib-import-32ZFKHWP.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,13 @@
1
+ import { createRequire as __bundleCreateRequire } from 'node:module'; import { fileURLToPath as __bundleFileURLToPath } from 'node:url'; import { dirname as __bundleDirname } from 'node:path'; const require = __bundleCreateRequire(import.meta.url); const __chunk_filename = __bundleFileURLToPath(import.meta.url); const __chunk_dirname = __bundleDirname(__chunk_filename);
2
+ import {
3
+ signMessage,
4
+ stripSigTag,
5
+ verifyMessage
6
+ } from "./chunk-CWOHNFUV.js";
7
+ import "./chunk-NWDBD4PA.js";
8
+ export {
9
+ signMessage,
10
+ stripSigTag,
11
+ verifyMessage
12
+ };
13
+ //# sourceMappingURL=digital-signature-OFCGSHWO.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }