@tschmz/imp 0.1.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.
Files changed (377) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/LICENSE +201 -0
  3. package/README.md +21 -0
  4. package/config.example.json +143 -0
  5. package/dist/agents/default-system-prompt.d.ts +1 -0
  6. package/dist/agents/default-system-prompt.js +67 -0
  7. package/dist/agents/default-system-prompt.js.map +1 -0
  8. package/dist/agents/registry.d.ts +6 -0
  9. package/dist/agents/registry.js +12 -0
  10. package/dist/agents/registry.js.map +1 -0
  11. package/dist/application/backup-use-cases.d.ts +28 -0
  12. package/dist/application/backup-use-cases.js +571 -0
  13. package/dist/application/backup-use-cases.js.map +1 -0
  14. package/dist/application/commands/agent-command.d.ts +2 -0
  15. package/dist/application/commands/agent-command.js +61 -0
  16. package/dist/application/commands/agent-command.js.map +1 -0
  17. package/dist/application/commands/config-command.d.ts +2 -0
  18. package/dist/application/commands/config-command.js +39 -0
  19. package/dist/application/commands/config-command.js.map +1 -0
  20. package/dist/application/commands/conversation-context.d.ts +6 -0
  21. package/dist/application/commands/conversation-context.js +35 -0
  22. package/dist/application/commands/conversation-context.js.map +1 -0
  23. package/dist/application/commands/export-command.d.ts +2 -0
  24. package/dist/application/commands/export-command.js +25 -0
  25. package/dist/application/commands/export-command.js.map +1 -0
  26. package/dist/application/commands/help-command.d.ts +3 -0
  27. package/dist/application/commands/help-command.js +40 -0
  28. package/dist/application/commands/help-command.js.map +1 -0
  29. package/dist/application/commands/history-command.d.ts +2 -0
  30. package/dist/application/commands/history-command.js +23 -0
  31. package/dist/application/commands/history-command.js.map +1 -0
  32. package/dist/application/commands/logs-command.d.ts +2 -0
  33. package/dist/application/commands/logs-command.js +42 -0
  34. package/dist/application/commands/logs-command.js.map +1 -0
  35. package/dist/application/commands/new-command.d.ts +2 -0
  36. package/dist/application/commands/new-command.js +37 -0
  37. package/dist/application/commands/new-command.js.map +1 -0
  38. package/dist/application/commands/parse-inbound-command.d.ts +15 -0
  39. package/dist/application/commands/parse-inbound-command.js +33 -0
  40. package/dist/application/commands/parse-inbound-command.js.map +1 -0
  41. package/dist/application/commands/ping-command.d.ts +2 -0
  42. package/dist/application/commands/ping-command.js +18 -0
  43. package/dist/application/commands/ping-command.js.map +1 -0
  44. package/dist/application/commands/priority-inbound-commands.d.ts +2 -0
  45. package/dist/application/commands/priority-inbound-commands.js +14 -0
  46. package/dist/application/commands/priority-inbound-commands.js.map +1 -0
  47. package/dist/application/commands/registry.d.ts +7 -0
  48. package/dist/application/commands/registry.js +38 -0
  49. package/dist/application/commands/registry.js.map +1 -0
  50. package/dist/application/commands/reload-command.d.ts +2 -0
  51. package/dist/application/commands/reload-command.js +23 -0
  52. package/dist/application/commands/reload-command.js.map +1 -0
  53. package/dist/application/commands/rename-command.d.ts +2 -0
  54. package/dist/application/commands/rename-command.js +36 -0
  55. package/dist/application/commands/rename-command.js.map +1 -0
  56. package/dist/application/commands/renderers.d.ts +13 -0
  57. package/dist/application/commands/renderers.js +238 -0
  58. package/dist/application/commands/renderers.js.map +1 -0
  59. package/dist/application/commands/reset-command.d.ts +2 -0
  60. package/dist/application/commands/reset-command.js +36 -0
  61. package/dist/application/commands/reset-command.js.map +1 -0
  62. package/dist/application/commands/restart-command.d.ts +2 -0
  63. package/dist/application/commands/restart-command.js +23 -0
  64. package/dist/application/commands/restart-command.js.map +1 -0
  65. package/dist/application/commands/restore-command.d.ts +2 -0
  66. package/dist/application/commands/restore-command.js +52 -0
  67. package/dist/application/commands/restore-command.js.map +1 -0
  68. package/dist/application/commands/status-command.d.ts +2 -0
  69. package/dist/application/commands/status-command.js +24 -0
  70. package/dist/application/commands/status-command.js.map +1 -0
  71. package/dist/application/commands/types.d.ts +49 -0
  72. package/dist/application/commands/types.js +2 -0
  73. package/dist/application/commands/types.js.map +1 -0
  74. package/dist/application/commands/utils.d.ts +4 -0
  75. package/dist/application/commands/utils.js +26 -0
  76. package/dist/application/commands/utils.js.map +1 -0
  77. package/dist/application/commands/whoami-command.d.ts +2 -0
  78. package/dist/application/commands/whoami-command.js +27 -0
  79. package/dist/application/commands/whoami-command.js.map +1 -0
  80. package/dist/application/config-key-path.d.ts +2 -0
  81. package/dist/application/config-key-path.js +65 -0
  82. package/dist/application/config-key-path.js.map +1 -0
  83. package/dist/application/get-config-value-use-case.d.ts +4 -0
  84. package/dist/application/get-config-value-use-case.js +30 -0
  85. package/dist/application/get-config-value-use-case.js.map +1 -0
  86. package/dist/application/handle-incoming-message.d.ts +7 -0
  87. package/dist/application/handle-incoming-message.js +56 -0
  88. package/dist/application/handle-incoming-message.js.map +1 -0
  89. package/dist/application/inbound/dispatch-command.d.ts +2 -0
  90. package/dist/application/inbound/dispatch-command.js +23 -0
  91. package/dist/application/inbound/dispatch-command.js.map +1 -0
  92. package/dist/application/inbound/execute-agent.d.ts +2 -0
  93. package/dist/application/inbound/execute-agent.js +41 -0
  94. package/dist/application/inbound/execute-agent.js.map +1 -0
  95. package/dist/application/inbound/persist-conversation.d.ts +2 -0
  96. package/dist/application/inbound/persist-conversation.js +7 -0
  97. package/dist/application/inbound/persist-conversation.js.map +1 -0
  98. package/dist/application/inbound/resolve-conversation.d.ts +2 -0
  99. package/dist/application/inbound/resolve-conversation.js +19 -0
  100. package/dist/application/inbound/resolve-conversation.js.map +1 -0
  101. package/dist/application/inbound/resolve-skills.d.ts +2 -0
  102. package/dist/application/inbound/resolve-skills.js +73 -0
  103. package/dist/application/inbound/resolve-skills.js.map +1 -0
  104. package/dist/application/inbound/run-hooks-start.d.ts +2 -0
  105. package/dist/application/inbound/run-hooks-start.js +4 -0
  106. package/dist/application/inbound/run-hooks-start.js.map +1 -0
  107. package/dist/application/inbound/run-hooks-success-error.d.ts +3 -0
  108. package/dist/application/inbound/run-hooks-success-error.js +18 -0
  109. package/dist/application/inbound/run-hooks-success-error.js.map +1 -0
  110. package/dist/application/inbound/types.d.ts +21 -0
  111. package/dist/application/inbound/types.js +2 -0
  112. package/dist/application/inbound/types.js.map +1 -0
  113. package/dist/application/init-config-use-case.d.ts +5 -0
  114. package/dist/application/init-config-use-case.js +62 -0
  115. package/dist/application/init-config-use-case.js.map +1 -0
  116. package/dist/application/message-processor.d.ts +19 -0
  117. package/dist/application/message-processor.js +122 -0
  118. package/dist/application/message-processor.js.map +1 -0
  119. package/dist/application/reload-config-use-case.d.ts +15 -0
  120. package/dist/application/reload-config-use-case.js +26 -0
  121. package/dist/application/reload-config-use-case.js.map +1 -0
  122. package/dist/application/run-daemon-use-case.d.ts +27 -0
  123. package/dist/application/run-daemon-use-case.js +42 -0
  124. package/dist/application/run-daemon-use-case.js.map +1 -0
  125. package/dist/application/runtime-target.d.ts +25 -0
  126. package/dist/application/runtime-target.js +41 -0
  127. package/dist/application/runtime-target.js.map +1 -0
  128. package/dist/application/service-use-cases.d.ts +45 -0
  129. package/dist/application/service-use-cases.js +100 -0
  130. package/dist/application/service-use-cases.js.map +1 -0
  131. package/dist/application/set-config-value-use-case.d.ts +5 -0
  132. package/dist/application/set-config-value-use-case.js +87 -0
  133. package/dist/application/set-config-value-use-case.js.map +1 -0
  134. package/dist/application/validate-config-use-case.d.ts +3 -0
  135. package/dist/application/validate-config-use-case.js +14 -0
  136. package/dist/application/validate-config-use-case.js.map +1 -0
  137. package/dist/application/view-logs-use-case.d.ts +6 -0
  138. package/dist/application/view-logs-use-case.js +14 -0
  139. package/dist/application/view-logs-use-case.js.map +1 -0
  140. package/dist/cli/create-cli.d.ts +68 -0
  141. package/dist/cli/create-cli.js +188 -0
  142. package/dist/cli/create-cli.js.map +1 -0
  143. package/dist/config/default-app-config.d.ts +20 -0
  144. package/dist/config/default-app-config.js +138 -0
  145. package/dist/config/default-app-config.js.map +1 -0
  146. package/dist/config/discover-config-path.d.ts +10 -0
  147. package/dist/config/discover-config-path.js +71 -0
  148. package/dist/config/discover-config-path.js.map +1 -0
  149. package/dist/config/init-app-config.d.ts +13 -0
  150. package/dist/config/init-app-config.js +31 -0
  151. package/dist/config/init-app-config.js.map +1 -0
  152. package/dist/config/load-app-config.d.ts +2 -0
  153. package/dist/config/load-app-config.js +29 -0
  154. package/dist/config/load-app-config.js.map +1 -0
  155. package/dist/config/prompt-init-config.d.ts +15 -0
  156. package/dist/config/prompt-init-config.js +201 -0
  157. package/dist/config/prompt-init-config.js.map +1 -0
  158. package/dist/config/resolve-runtime-config.d.ts +8 -0
  159. package/dist/config/resolve-runtime-config.js +122 -0
  160. package/dist/config/resolve-runtime-config.js.map +1 -0
  161. package/dist/config/schema.d.ts +3 -0
  162. package/dist/config/schema.js +203 -0
  163. package/dist/config/schema.js.map +1 -0
  164. package/dist/config/secret-value.d.ts +20 -0
  165. package/dist/config/secret-value.js +69 -0
  166. package/dist/config/secret-value.js.map +1 -0
  167. package/dist/config/types.d.ts +76 -0
  168. package/dist/config/types.js +2 -0
  169. package/dist/config/types.js.map +1 -0
  170. package/dist/config/validate-secret-references.d.ts +7 -0
  171. package/dist/config/validate-secret-references.js +14 -0
  172. package/dist/config/validate-secret-references.js.map +1 -0
  173. package/dist/daemon/bootstrap/acquire-runtime-state.d.ts +6 -0
  174. package/dist/daemon/bootstrap/acquire-runtime-state.js +19 -0
  175. package/dist/daemon/bootstrap/acquire-runtime-state.js.map +1 -0
  176. package/dist/daemon/bootstrap/build-runtime-components.d.ts +21 -0
  177. package/dist/daemon/bootstrap/build-runtime-components.js +26 -0
  178. package/dist/daemon/bootstrap/build-runtime-components.js.map +1 -0
  179. package/dist/daemon/bootstrap/prepare-runtime-filesystem.d.ts +2 -0
  180. package/dist/daemon/bootstrap/prepare-runtime-filesystem.js +11 -0
  181. package/dist/daemon/bootstrap/prepare-runtime-filesystem.js.map +1 -0
  182. package/dist/daemon/create-daemon.d.ts +13 -0
  183. package/dist/daemon/create-daemon.js +98 -0
  184. package/dist/daemon/create-daemon.js.map +1 -0
  185. package/dist/daemon/runtime-bootstrap.d.ts +12 -0
  186. package/dist/daemon/runtime-bootstrap.js +24 -0
  187. package/dist/daemon/runtime-bootstrap.js.map +1 -0
  188. package/dist/daemon/runtime-runner.d.ts +18 -0
  189. package/dist/daemon/runtime-runner.js +126 -0
  190. package/dist/daemon/runtime-runner.js.map +1 -0
  191. package/dist/daemon/runtime-shutdown.d.ts +15 -0
  192. package/dist/daemon/runtime-shutdown.js +50 -0
  193. package/dist/daemon/runtime-shutdown.js.map +1 -0
  194. package/dist/daemon/runtime-state.d.ts +10 -0
  195. package/dist/daemon/runtime-state.js +90 -0
  196. package/dist/daemon/runtime-state.js.map +1 -0
  197. package/dist/daemon/types.d.ts +63 -0
  198. package/dist/daemon/types.js +2 -0
  199. package/dist/daemon/types.js.map +1 -0
  200. package/dist/domain/agent.d.ts +51 -0
  201. package/dist/domain/agent.js +2 -0
  202. package/dist/domain/agent.js.map +1 -0
  203. package/dist/domain/conversation.d.ts +51 -0
  204. package/dist/domain/conversation.js +2 -0
  205. package/dist/domain/conversation.js.map +1 -0
  206. package/dist/domain/errors.d.ts +13 -0
  207. package/dist/domain/errors.js +27 -0
  208. package/dist/domain/errors.js.map +1 -0
  209. package/dist/domain/message.d.ts +27 -0
  210. package/dist/domain/message.js +2 -0
  211. package/dist/domain/message.js.map +1 -0
  212. package/dist/files/backup.d.ts +2 -0
  213. package/dist/files/backup.js +7 -0
  214. package/dist/files/backup.js.map +1 -0
  215. package/dist/files/managed-file.d.ts +11 -0
  216. package/dist/files/managed-file.js +82 -0
  217. package/dist/files/managed-file.js.map +1 -0
  218. package/dist/files/tar-archive.d.ts +7 -0
  219. package/dist/files/tar-archive.js +308 -0
  220. package/dist/files/tar-archive.js.map +1 -0
  221. package/dist/index.d.ts +2 -0
  222. package/dist/index.js +2 -0
  223. package/dist/index.js.map +1 -0
  224. package/dist/logging/daemon-startup-failure-reporter.d.ts +2 -0
  225. package/dist/logging/daemon-startup-failure-reporter.js +19 -0
  226. package/dist/logging/daemon-startup-failure-reporter.js.map +1 -0
  227. package/dist/logging/file-logger.d.ts +3 -0
  228. package/dist/logging/file-logger.js +87 -0
  229. package/dist/logging/file-logger.js.map +1 -0
  230. package/dist/logging/types.d.ts +34 -0
  231. package/dist/logging/types.js +2 -0
  232. package/dist/logging/types.js.map +1 -0
  233. package/dist/logging/view-logs.d.ts +27 -0
  234. package/dist/logging/view-logs.js +171 -0
  235. package/dist/logging/view-logs.js.map +1 -0
  236. package/dist/main.d.ts +2 -0
  237. package/dist/main.js +109 -0
  238. package/dist/main.js.map +1 -0
  239. package/dist/plugins/hook-runner.d.ts +11 -0
  240. package/dist/plugins/hook-runner.js +41 -0
  241. package/dist/plugins/hook-runner.js.map +1 -0
  242. package/dist/plugins/index.d.ts +2 -0
  243. package/dist/plugins/index.js +2 -0
  244. package/dist/plugins/index.js.map +1 -0
  245. package/dist/plugins/types.d.ts +64 -0
  246. package/dist/plugins/types.js +2 -0
  247. package/dist/plugins/types.js.map +1 -0
  248. package/dist/runtime/agent-execution.d.ts +42 -0
  249. package/dist/runtime/agent-execution.js +109 -0
  250. package/dist/runtime/agent-execution.js.map +1 -0
  251. package/dist/runtime/context.d.ts +20 -0
  252. package/dist/runtime/context.js +2 -0
  253. package/dist/runtime/context.js.map +1 -0
  254. package/dist/runtime/create-oauth-api-key-resolver.d.ts +9 -0
  255. package/dist/runtime/create-oauth-api-key-resolver.js +66 -0
  256. package/dist/runtime/create-oauth-api-key-resolver.js.map +1 -0
  257. package/dist/runtime/create-pi-agent-engine.d.ts +28 -0
  258. package/dist/runtime/create-pi-agent-engine.js +150 -0
  259. package/dist/runtime/create-pi-agent-engine.js.map +1 -0
  260. package/dist/runtime/mcp-tool-cache.d.ts +13 -0
  261. package/dist/runtime/mcp-tool-cache.js +43 -0
  262. package/dist/runtime/mcp-tool-cache.js.map +1 -0
  263. package/dist/runtime/mcp-tool-runtime.d.ts +76 -0
  264. package/dist/runtime/mcp-tool-runtime.js +180 -0
  265. package/dist/runtime/mcp-tool-runtime.js.map +1 -0
  266. package/dist/runtime/message-mapping.d.ts +11 -0
  267. package/dist/runtime/message-mapping.js +129 -0
  268. package/dist/runtime/message-mapping.js.map +1 -0
  269. package/dist/runtime/model-resolution.d.ts +5 -0
  270. package/dist/runtime/model-resolution.js +13 -0
  271. package/dist/runtime/model-resolution.js.map +1 -0
  272. package/dist/runtime/pipeline/execute-agent-stage.d.ts +12 -0
  273. package/dist/runtime/pipeline/execute-agent-stage.js +25 -0
  274. package/dist/runtime/pipeline/execute-agent-stage.js.map +1 -0
  275. package/dist/runtime/pipeline/resolve-model-stage.d.ts +8 -0
  276. package/dist/runtime/pipeline/resolve-model-stage.js +9 -0
  277. package/dist/runtime/pipeline/resolve-model-stage.js.map +1 -0
  278. package/dist/runtime/pipeline/resolve-prompt-stage.d.ts +12 -0
  279. package/dist/runtime/pipeline/resolve-prompt-stage.js +30 -0
  280. package/dist/runtime/pipeline/resolve-prompt-stage.js.map +1 -0
  281. package/dist/runtime/pipeline/resolve-tools-stage.d.ts +27 -0
  282. package/dist/runtime/pipeline/resolve-tools-stage.js +46 -0
  283. package/dist/runtime/pipeline/resolve-tools-stage.js.map +1 -0
  284. package/dist/runtime/prompt-template.d.ts +54 -0
  285. package/dist/runtime/prompt-template.js +78 -0
  286. package/dist/runtime/prompt-template.js.map +1 -0
  287. package/dist/runtime/system-prompt-cache.d.ts +33 -0
  288. package/dist/runtime/system-prompt-cache.js +77 -0
  289. package/dist/runtime/system-prompt-cache.js.map +1 -0
  290. package/dist/runtime/system-prompt-resolution.d.ts +22 -0
  291. package/dist/runtime/system-prompt-resolution.js +170 -0
  292. package/dist/runtime/system-prompt-resolution.js.map +1 -0
  293. package/dist/runtime/tool-resolution.d.ts +19 -0
  294. package/dist/runtime/tool-resolution.js +281 -0
  295. package/dist/runtime/tool-resolution.js.map +1 -0
  296. package/dist/runtime/types.d.ts +23 -0
  297. package/dist/runtime/types.js +2 -0
  298. package/dist/runtime/types.js.map +1 -0
  299. package/dist/service/install-plan.d.ts +21 -0
  300. package/dist/service/install-plan.js +71 -0
  301. package/dist/service/install-plan.js.map +1 -0
  302. package/dist/service/install-service.d.ts +32 -0
  303. package/dist/service/install-service.js +80 -0
  304. package/dist/service/install-service.js.map +1 -0
  305. package/dist/service/linux-service-environment.d.ts +5 -0
  306. package/dist/service/linux-service-environment.js +61 -0
  307. package/dist/service/linux-service-environment.js.map +1 -0
  308. package/dist/service/manage-service.d.ts +14 -0
  309. package/dist/service/manage-service.js +36 -0
  310. package/dist/service/manage-service.js.map +1 -0
  311. package/dist/service/platforms/get-service-platform-adapter.d.ts +3 -0
  312. package/dist/service/platforms/get-service-platform-adapter.js +12 -0
  313. package/dist/service/platforms/get-service-platform-adapter.js.map +1 -0
  314. package/dist/service/platforms/linux-systemd-user-adapter.d.ts +2 -0
  315. package/dist/service/platforms/linux-systemd-user-adapter.js +99 -0
  316. package/dist/service/platforms/linux-systemd-user-adapter.js.map +1 -0
  317. package/dist/service/platforms/macos-launchd-adapter.d.ts +2 -0
  318. package/dist/service/platforms/macos-launchd-adapter.js +122 -0
  319. package/dist/service/platforms/macos-launchd-adapter.js.map +1 -0
  320. package/dist/service/platforms/service-platform-adapter.d.ts +35 -0
  321. package/dist/service/platforms/service-platform-adapter.js +16 -0
  322. package/dist/service/platforms/service-platform-adapter.js.map +1 -0
  323. package/dist/service/platforms/windows-winsw-adapter.d.ts +2 -0
  324. package/dist/service/platforms/windows-winsw-adapter.js +47 -0
  325. package/dist/service/platforms/windows-winsw-adapter.js.map +1 -0
  326. package/dist/service/service-error.d.ts +7 -0
  327. package/dist/service/service-error.js +45 -0
  328. package/dist/service/service-error.js.map +1 -0
  329. package/dist/service/service-installer.d.ts +8 -0
  330. package/dist/service/service-installer.js +40 -0
  331. package/dist/service/service-installer.js.map +1 -0
  332. package/dist/service/service-operation-result.d.ts +9 -0
  333. package/dist/service/service-operation-result.js +2 -0
  334. package/dist/service/service-operation-result.js.map +1 -0
  335. package/dist/service/uninstall-service.d.ts +13 -0
  336. package/dist/service/uninstall-service.js +45 -0
  337. package/dist/service/uninstall-service.js.map +1 -0
  338. package/dist/skills/discovery.d.ts +10 -0
  339. package/dist/skills/discovery.js +216 -0
  340. package/dist/skills/discovery.js.map +1 -0
  341. package/dist/skills/types.d.ts +20 -0
  342. package/dist/skills/types.js +2 -0
  343. package/dist/skills/types.js.map +1 -0
  344. package/dist/storage/fs-store.d.ts +3 -0
  345. package/dist/storage/fs-store.js +707 -0
  346. package/dist/storage/fs-store.js.map +1 -0
  347. package/dist/storage/types.d.ts +29 -0
  348. package/dist/storage/types.js +2 -0
  349. package/dist/storage/types.js.map +1 -0
  350. package/dist/tools/registry.d.ts +7 -0
  351. package/dist/tools/registry.js +18 -0
  352. package/dist/tools/registry.js.map +1 -0
  353. package/dist/tools/types.d.ts +14 -0
  354. package/dist/tools/types.js +2 -0
  355. package/dist/tools/types.js.map +1 -0
  356. package/dist/transports/builtins.d.ts +1 -0
  357. package/dist/transports/builtins.js +15 -0
  358. package/dist/transports/builtins.js.map +1 -0
  359. package/dist/transports/registry.d.ts +21 -0
  360. package/dist/transports/registry.js +28 -0
  361. package/dist/transports/registry.js.map +1 -0
  362. package/dist/transports/telegram/openai-voice-transcriber.d.ts +18 -0
  363. package/dist/transports/telegram/openai-voice-transcriber.js +75 -0
  364. package/dist/transports/telegram/openai-voice-transcriber.js.map +1 -0
  365. package/dist/transports/telegram/render-telegram-message.d.ts +2 -0
  366. package/dist/transports/telegram/render-telegram-message.js +458 -0
  367. package/dist/transports/telegram/render-telegram-message.js.map +1 -0
  368. package/dist/transports/telegram/telegram-transport.d.ts +56 -0
  369. package/dist/transports/telegram/telegram-transport.js +414 -0
  370. package/dist/transports/telegram/telegram-transport.js.map +1 -0
  371. package/dist/transports/telegram/transport-adapter.d.ts +33 -0
  372. package/dist/transports/telegram/transport-adapter.js +62 -0
  373. package/dist/transports/telegram/transport-adapter.js.map +1 -0
  374. package/dist/transports/types.d.ts +15 -0
  375. package/dist/transports/types.js +2 -0
  376. package/dist/transports/types.js.map +1 -0
  377. package/package.json +49 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,19 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ## 0.1.0 - 2026-04-12
6
+
7
+ ### Added
8
+
9
+ - Local `imp` daemon for running persistent personal AI agent endpoints.
10
+ - Configurable agents with model selection, prompt customization, tools, optional skills, and optional workspaces.
11
+ - Telegram endpoint support with persistent conversation sessions and agent routing.
12
+ - Telegram commands for session management, agent switching, status, config, logs, and runtime control.
13
+ - Built-in tool configuration for filesystem and shell-oriented agent workflows.
14
+ - MCP server configuration for agent tools.
15
+ - Skill discovery from configured skill paths and workspace-local `.skills` directories.
16
+ - Config CLI for initialization, validation, inspection, updates, and reloads.
17
+ - Backup and restore commands for config, agent files, and conversation data.
18
+ - Foreground daemon mode and background service management for Linux and macOS.
19
+ - Optional Telegram voice transcription through OpenAI transcription models.
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Thomas Schmitz
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,21 @@
1
+ # imp
2
+
3
+ `imp` is a local daemon for running personal AI agents behind persistent conversation endpoints.
4
+
5
+ It is meant for personal automation where conversation sessions should keep context, agents should be reachable through communication channels such as Telegram, and the runtime should remain under local control.
6
+
7
+ `imp` is early-stage and can still change.
8
+
9
+ ## Core Concepts
10
+
11
+ ### Agents
12
+
13
+ Agents define how `imp` should answer within a conversation. An agent combines a model, prompt customization, tools, optional skills, and an optional workspace. Multiple agents can live in one daemon so different roles can share the same runtime while keeping their own behavior and working context.
14
+
15
+ ### Endpoints
16
+
17
+ Endpoints define where conversations enter the system. Today, Telegram is the supported endpoint type. Endpoints are transport-facing, own their runtime files and conversation store, and route messages to a default agent unless a conversation selects another configured agent.
18
+
19
+ ### Transports
20
+
21
+ Transports connect endpoint types to external systems. The built-in Telegram transport receives Telegram messages, sends them into `imp`, and delivers responses back to Telegram. The transport registry is the extension point for adding other endpoint types later.
@@ -0,0 +1,143 @@
1
+ {
2
+ "instance": {
3
+ "name": "home"
4
+ },
5
+ "paths": {
6
+ "dataRoot": "/var/lib/imp"
7
+ },
8
+ "logging": {
9
+ "level": "info"
10
+ },
11
+ "defaults": {
12
+ "agentId": "default"
13
+ },
14
+ "agents": [
15
+ {
16
+ "id": "default",
17
+ "model": {
18
+ "provider": "openai-codex",
19
+ "modelId": "gpt-5.4"
20
+ },
21
+ "authFile": "/var/lib/imp/auth.json",
22
+ "tools": [
23
+ "read",
24
+ "bash",
25
+ "edit",
26
+ "write",
27
+ "grep",
28
+ "find",
29
+ "ls"
30
+ ],
31
+ "prompt": {
32
+ "instructions": [
33
+ {
34
+ "file": "/var/lib/imp/agents/default/AGENTS.md"
35
+ }
36
+ ]
37
+ },
38
+ "workspace": {
39
+ "cwd": "/var/lib/imp/agents/default/workspace",
40
+ "shellPath": [
41
+ "/home/example/.local/bin",
42
+ "/usr/local/bin",
43
+ "/usr/bin",
44
+ "/bin"
45
+ ]
46
+ },
47
+ "skills": {
48
+ "paths": [
49
+ "/path/to/shared-skills"
50
+ ]
51
+ }
52
+ },
53
+ {
54
+ "id": "ops",
55
+ "name": "Operations",
56
+ "model": {
57
+ "provider": "openai",
58
+ "modelId": "gpt-5.4"
59
+ },
60
+ "tools": [
61
+ "read",
62
+ "bash",
63
+ "edit",
64
+ "write",
65
+ "grep",
66
+ "find",
67
+ "ls"
68
+ ],
69
+ "prompt": {
70
+ "base": {
71
+ "text": "You are a concise operations assistant focused on diagnostics, runbooks, and safe remediation steps."
72
+ },
73
+ "instructions": [
74
+ {
75
+ "file": "/var/lib/imp/agents/ops/AGENTS.md"
76
+ }
77
+ ],
78
+ "references": [
79
+ {
80
+ "file": "/var/lib/imp/agents/ops/RUNBOOK.md"
81
+ }
82
+ ]
83
+ },
84
+ "workspace": {
85
+ "cwd": "/var/lib/imp/agents/ops/workspace",
86
+ "shellPath": [
87
+ "/usr/local/bin",
88
+ "/usr/bin",
89
+ "/bin"
90
+ ]
91
+ },
92
+ "inference": {
93
+ "metadata": {
94
+ "app": "imp",
95
+ "role": "ops"
96
+ },
97
+ "request": {
98
+ "store": true,
99
+ "reasoning": {
100
+ "effort": "medium"
101
+ },
102
+ "text": {
103
+ "verbosity": "low"
104
+ }
105
+ }
106
+ }
107
+ }
108
+ ],
109
+ "endpoints": [
110
+ {
111
+ "id": "private-telegram",
112
+ "type": "telegram",
113
+ "enabled": true,
114
+ "token": {
115
+ "env": "IMP_PRIVATE_TELEGRAM_BOT_TOKEN"
116
+ },
117
+ "access": {
118
+ "allowedUserIds": []
119
+ },
120
+ "voice": {
121
+ "enabled": true,
122
+ "transcription": {
123
+ "provider": "openai",
124
+ "model": "gpt-4o-mini-transcribe"
125
+ }
126
+ }
127
+ },
128
+ {
129
+ "id": "ops-telegram",
130
+ "type": "telegram",
131
+ "enabled": false,
132
+ "token": {
133
+ "file": "./secrets/ops-telegram.token"
134
+ },
135
+ "access": {
136
+ "allowedUserIds": []
137
+ },
138
+ "routing": {
139
+ "defaultAgentId": "ops"
140
+ }
141
+ }
142
+ ]
143
+ }
@@ -0,0 +1 @@
1
+ export declare const DEFAULT_AGENT_SYSTEM_PROMPT: string;
@@ -0,0 +1,67 @@
1
+ export const DEFAULT_AGENT_SYSTEM_PROMPT = `
2
+ You are a helpful assistant running through a local Imp daemon.
3
+
4
+ # Runtime Context
5
+
6
+ - Agent: {{agent.id}}
7
+ - Model: {{agent.model.provider}}/{{agent.model.modelId}}
8
+ - Transport: {{transport.kind}}
9
+ {{#if agent.workspace.cwd}}- Workspace: {{agent.workspace.cwd}}{{/if}}
10
+
11
+ # Core Behavior
12
+
13
+ - Be direct, concise, and technically precise.
14
+ - Prefer concrete next steps over abstract discussion.
15
+ - State important assumptions when they affect correctness.
16
+ - When information is missing, say what is missing and what you infer.
17
+ - Distinguish clearly between observed facts and inferences.
18
+ - Do not invent files, commands, APIs, or results.
19
+ - Treat these core behavior rules as higher priority than agent-specific instructions.
20
+
21
+ # Working Style
22
+
23
+ - Focus on the user's stated goal and the current repository or runtime context.
24
+ - Prefer safe, incremental changes that are easy to review.
25
+ - Preserve existing project conventions unless the user asks for a redesign.
26
+ - Call out real risks, regressions, and missing validation instead of offering blanket reassurance.
27
+ - Use agent-specific instructions to specialize your role, scope, and workflow for the current agent.
28
+ - Treat agent-specific instructions as a refinement layer, not as permission to ignore the truthfulness, observation, and verification rules above.
29
+
30
+ # Tooling And Execution
31
+
32
+ - If tools or filesystem access are available, use them to inspect the real environment before making claims.
33
+ - Base technical answers on the files, configuration, and outputs you can observe.
34
+ - Prefer structure-first exploration. Use file names, symbols, and entry points to orient before drilling into implementation details.
35
+ - If you notice gaps, recurring friction, or errors in your runtime environment, tooling, or context that affect the task, say so explicitly.
36
+ - When proposing commands, prefer explicit, copy-pasteable CLI commands.
37
+
38
+ {{#if skills.length}}
39
+ # Skills
40
+
41
+ You have access to the following skills.
42
+ Treat this list as a catalog, not as full skill instructions.
43
+ Use the load_skill tool when a listed skill is relevant to the user's request.
44
+ Use exact skill names when loading or referring to skills.
45
+ The catalog lists path, name, and description only.
46
+
47
+ {{#each skills}}
48
+ <AVAILABLE-SKILL name="{{instructionAttr name}}" from="{{instructionAttr directoryPath}}">
49
+ {{description}}
50
+ </AVAILABLE-SKILL>
51
+
52
+ {{/each}}
53
+ {{/if}}
54
+
55
+ # Communication
56
+
57
+ - Keep responses compact by default.
58
+ - You are chatting through Telegram. Format final responses for plain, reliable Telegram delivery.
59
+ - Prefer short paragraphs and short bullet lists over long, deeply nested structure.
60
+ - Use only simple Markdown-style formatting when it helps: inline code, fenced code blocks, bold, italic, blockquotes, and normal links.
61
+ - Avoid complex or unusual formatting such as tables, deeply nested lists, raw HTML, or mixed formatting that may render inconsistently.
62
+ - If a response is long, split it into a few clear chunks instead of one dense wall of text.
63
+ - In your final answer, explicitly call out relevant errors, missing context, tooling gaps, or environment issues you observed during the task.
64
+ - Summaries should emphasize outcomes, changed behavior, and any remaining risk.
65
+ - For reviews, prioritize findings, broken behavior, and test gaps.
66
+ `.trim();
67
+ //# sourceMappingURL=default-system-prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default-system-prompt.js","sourceRoot":"","sources":["../../src/agents/default-system-prompt.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,2BAA2B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiE1C,CAAC,IAAI,EAAE,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { AgentDefinition } from "../domain/agent.js";
2
+ export interface AgentRegistry {
3
+ list(): AgentDefinition[];
4
+ get(id: string): AgentDefinition | undefined;
5
+ }
6
+ export declare function createAgentRegistry(agents: AgentDefinition[]): AgentRegistry;
@@ -0,0 +1,12 @@
1
+ export function createAgentRegistry(agents) {
2
+ const byId = new Map(agents.map((agent) => [agent.id, agent]));
3
+ return {
4
+ list() {
5
+ return agents.slice();
6
+ },
7
+ get(id) {
8
+ return byId.get(id);
9
+ },
10
+ };
11
+ }
12
+ //# sourceMappingURL=registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/agents/registry.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,mBAAmB,CAAC,MAAyB;IAC3D,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAE/D,OAAO;QACL,IAAI;YACF,OAAO,MAAM,CAAC,KAAK,EAAE,CAAC;QACxB,CAAC;QACD,GAAG,CAAC,EAAU;YACZ,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACtB,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { discoverConfigPath, getDefaultUserConfigPath } from "../config/discover-config-path.js";
2
+ import { loadAppConfig } from "../config/load-app-config.js";
3
+ export interface BackupUseCases {
4
+ createBackup: (options: BackupCreateOptions) => Promise<void>;
5
+ restoreBackup: (options: BackupRestoreOptions) => Promise<void>;
6
+ }
7
+ export interface BackupCreateOptions {
8
+ configPath?: string;
9
+ outputPath?: string;
10
+ only?: string;
11
+ force: boolean;
12
+ }
13
+ export interface BackupRestoreOptions {
14
+ configPath?: string;
15
+ dataRoot?: string;
16
+ inputPath: string;
17
+ only?: string;
18
+ force: boolean;
19
+ }
20
+ export type BackupScope = "config" | "agents" | "conversations";
21
+ interface BackupDependencies {
22
+ discoverConfigPath: typeof discoverConfigPath;
23
+ getDefaultUserConfigPath: typeof getDefaultUserConfigPath;
24
+ loadAppConfig: typeof loadAppConfig;
25
+ writeOutput: (line: string) => void;
26
+ }
27
+ export declare function createBackupUseCases(dependencies?: Partial<BackupDependencies>): BackupUseCases;
28
+ export {};