siclaw 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 (460) hide show
  1. package/LICENSE +190 -0
  2. package/README.md +268 -0
  3. package/dist/agentbox/gateway-client.d.ts +41 -0
  4. package/dist/agentbox/gateway-client.js +108 -0
  5. package/dist/agentbox/gateway-client.js.map +1 -0
  6. package/dist/agentbox/http-server.d.ts +12 -0
  7. package/dist/agentbox/http-server.js +700 -0
  8. package/dist/agentbox/http-server.js.map +1 -0
  9. package/dist/agentbox/mcp-sync.d.ts +6 -0
  10. package/dist/agentbox/mcp-sync.js +26 -0
  11. package/dist/agentbox/mcp-sync.js.map +1 -0
  12. package/dist/agentbox/resource-handlers.d.ts +40 -0
  13. package/dist/agentbox/resource-handlers.js +116 -0
  14. package/dist/agentbox/resource-handlers.js.map +1 -0
  15. package/dist/agentbox/resource-sync.d.ts +28 -0
  16. package/dist/agentbox/resource-sync.js +74 -0
  17. package/dist/agentbox/resource-sync.js.map +1 -0
  18. package/dist/agentbox/session.d.ts +145 -0
  19. package/dist/agentbox/session.js +444 -0
  20. package/dist/agentbox/session.js.map +1 -0
  21. package/dist/agentbox-main.d.ts +7 -0
  22. package/dist/agentbox-main.js +90 -0
  23. package/dist/agentbox-main.js.map +1 -0
  24. package/dist/cli-main.d.ts +1 -0
  25. package/dist/cli-main.js +187 -0
  26. package/dist/cli-main.js.map +1 -0
  27. package/dist/cli-setup.d.ts +17 -0
  28. package/dist/cli-setup.js +247 -0
  29. package/dist/cli-setup.js.map +1 -0
  30. package/dist/core/agent-factory.d.ts +52 -0
  31. package/dist/core/agent-factory.js +547 -0
  32. package/dist/core/agent-factory.js.map +1 -0
  33. package/dist/core/brain-session.d.ts +67 -0
  34. package/dist/core/brain-session.js +15 -0
  35. package/dist/core/brain-session.js.map +1 -0
  36. package/dist/core/brains/claude-sdk-brain.d.ts +76 -0
  37. package/dist/core/brains/claude-sdk-brain.js +403 -0
  38. package/dist/core/brains/claude-sdk-brain.js.map +1 -0
  39. package/dist/core/brains/pi-agent-brain.d.ts +28 -0
  40. package/dist/core/brains/pi-agent-brain.js +84 -0
  41. package/dist/core/brains/pi-agent-brain.js.map +1 -0
  42. package/dist/core/config.d.ts +109 -0
  43. package/dist/core/config.js +294 -0
  44. package/dist/core/config.js.map +1 -0
  45. package/dist/core/extensions/context-pruning.d.ts +38 -0
  46. package/dist/core/extensions/context-pruning.js +162 -0
  47. package/dist/core/extensions/context-pruning.js.map +1 -0
  48. package/dist/core/extensions/deep-investigation.d.ts +2 -0
  49. package/dist/core/extensions/deep-investigation.js +541 -0
  50. package/dist/core/extensions/deep-investigation.js.map +1 -0
  51. package/dist/core/extensions/memory-flush.d.ts +20 -0
  52. package/dist/core/extensions/memory-flush.js +120 -0
  53. package/dist/core/extensions/memory-flush.js.map +1 -0
  54. package/dist/core/llm-proxy.d.ts +37 -0
  55. package/dist/core/llm-proxy.js +578 -0
  56. package/dist/core/llm-proxy.js.map +1 -0
  57. package/dist/core/mcp-client.d.ts +80 -0
  58. package/dist/core/mcp-client.js +285 -0
  59. package/dist/core/mcp-client.js.map +1 -0
  60. package/dist/core/prompt.d.ts +1 -0
  61. package/dist/core/prompt.js +64 -0
  62. package/dist/core/prompt.js.map +1 -0
  63. package/dist/core/tool-adapter.d.ts +45 -0
  64. package/dist/core/tool-adapter.js +154 -0
  65. package/dist/core/tool-adapter.js.map +1 -0
  66. package/dist/cron/cron-api.d.ts +9 -0
  67. package/dist/cron/cron-api.js +94 -0
  68. package/dist/cron/cron-api.js.map +1 -0
  69. package/dist/cron/cron-coordinator.d.ts +29 -0
  70. package/dist/cron/cron-coordinator.js +150 -0
  71. package/dist/cron/cron-coordinator.js.map +1 -0
  72. package/dist/cron/cron-executor.d.ts +15 -0
  73. package/dist/cron/cron-executor.js +90 -0
  74. package/dist/cron/cron-executor.js.map +1 -0
  75. package/dist/cron/cron-matcher.d.ts +19 -0
  76. package/dist/cron/cron-matcher.js +114 -0
  77. package/dist/cron/cron-matcher.js.map +1 -0
  78. package/dist/cron/cron-scheduler.d.ts +42 -0
  79. package/dist/cron/cron-scheduler.js +91 -0
  80. package/dist/cron/cron-scheduler.js.map +1 -0
  81. package/dist/cron/gateway-client.d.ts +32 -0
  82. package/dist/cron/gateway-client.js +91 -0
  83. package/dist/cron/gateway-client.js.map +1 -0
  84. package/dist/cron-main.d.ts +10 -0
  85. package/dist/cron-main.js +75 -0
  86. package/dist/cron-main.js.map +1 -0
  87. package/dist/gateway/agentbox/client.d.ts +187 -0
  88. package/dist/gateway/agentbox/client.js +314 -0
  89. package/dist/gateway/agentbox/client.js.map +1 -0
  90. package/dist/gateway/agentbox/index.d.ts +10 -0
  91. package/dist/gateway/agentbox/index.js +11 -0
  92. package/dist/gateway/agentbox/index.js.map +1 -0
  93. package/dist/gateway/agentbox/k8s-spawner.d.ts +70 -0
  94. package/dist/gateway/agentbox/k8s-spawner.js +466 -0
  95. package/dist/gateway/agentbox/k8s-spawner.js.map +1 -0
  96. package/dist/gateway/agentbox/local-spawner.d.ts +63 -0
  97. package/dist/gateway/agentbox/local-spawner.js +234 -0
  98. package/dist/gateway/agentbox/local-spawner.js.map +1 -0
  99. package/dist/gateway/agentbox/manager.d.ts +121 -0
  100. package/dist/gateway/agentbox/manager.js +325 -0
  101. package/dist/gateway/agentbox/manager.js.map +1 -0
  102. package/dist/gateway/agentbox/process-spawner.d.ts +21 -0
  103. package/dist/gateway/agentbox/process-spawner.js +168 -0
  104. package/dist/gateway/agentbox/process-spawner.js.map +1 -0
  105. package/dist/gateway/agentbox/spawner.d.ts +33 -0
  106. package/dist/gateway/agentbox/spawner.js +10 -0
  107. package/dist/gateway/agentbox/spawner.js.map +1 -0
  108. package/dist/gateway/agentbox/types.d.ts +39 -0
  109. package/dist/gateway/agentbox/types.js +5 -0
  110. package/dist/gateway/agentbox/types.js.map +1 -0
  111. package/dist/gateway/auth/bind-code-store.d.ts +31 -0
  112. package/dist/gateway/auth/bind-code-store.js +73 -0
  113. package/dist/gateway/auth/bind-code-store.js.map +1 -0
  114. package/dist/gateway/auth/index.d.ts +9 -0
  115. package/dist/gateway/auth/index.js +10 -0
  116. package/dist/gateway/auth/index.js.map +1 -0
  117. package/dist/gateway/auth/jwt.d.ts +23 -0
  118. package/dist/gateway/auth/jwt.js +82 -0
  119. package/dist/gateway/auth/jwt.js.map +1 -0
  120. package/dist/gateway/auth/login.d.ts +26 -0
  121. package/dist/gateway/auth/login.js +74 -0
  122. package/dist/gateway/auth/login.js.map +1 -0
  123. package/dist/gateway/auth/middleware.d.ts +23 -0
  124. package/dist/gateway/auth/middleware.js +67 -0
  125. package/dist/gateway/auth/middleware.js.map +1 -0
  126. package/dist/gateway/auth/oauth2.d.ts +57 -0
  127. package/dist/gateway/auth/oauth2.js +113 -0
  128. package/dist/gateway/auth/oauth2.js.map +1 -0
  129. package/dist/gateway/auth/user-store.d.ts +95 -0
  130. package/dist/gateway/auth/user-store.js +291 -0
  131. package/dist/gateway/auth/user-store.js.map +1 -0
  132. package/dist/gateway/channels/channel-manager.d.ts +42 -0
  133. package/dist/gateway/channels/channel-manager.js +156 -0
  134. package/dist/gateway/channels/channel-manager.js.map +1 -0
  135. package/dist/gateway/channels/channel-rpc.d.ts +9 -0
  136. package/dist/gateway/channels/channel-rpc.js +104 -0
  137. package/dist/gateway/channels/channel-rpc.js.map +1 -0
  138. package/dist/gateway/channels/channel-store.d.ts +32 -0
  139. package/dist/gateway/channels/channel-store.js +114 -0
  140. package/dist/gateway/channels/channel-store.js.map +1 -0
  141. package/dist/gateway/channels/discord.d.ts +5 -0
  142. package/dist/gateway/channels/discord.js +177 -0
  143. package/dist/gateway/channels/discord.js.map +1 -0
  144. package/dist/gateway/channels/lark-format.d.ts +41 -0
  145. package/dist/gateway/channels/lark-format.js +620 -0
  146. package/dist/gateway/channels/lark-format.js.map +1 -0
  147. package/dist/gateway/channels/lark.d.ts +5 -0
  148. package/dist/gateway/channels/lark.js +1000 -0
  149. package/dist/gateway/channels/lark.js.map +1 -0
  150. package/dist/gateway/channels/slack.d.ts +5 -0
  151. package/dist/gateway/channels/slack.js +170 -0
  152. package/dist/gateway/channels/slack.js.map +1 -0
  153. package/dist/gateway/channels/telegram.d.ts +5 -0
  154. package/dist/gateway/channels/telegram.js +173 -0
  155. package/dist/gateway/channels/telegram.js.map +1 -0
  156. package/dist/gateway/channels/utils.d.ts +34 -0
  157. package/dist/gateway/channels/utils.js +115 -0
  158. package/dist/gateway/channels/utils.js.map +1 -0
  159. package/dist/gateway/config.d.ts +14 -0
  160. package/dist/gateway/config.js +12 -0
  161. package/dist/gateway/config.js.map +1 -0
  162. package/dist/gateway/cron/notify.d.ts +14 -0
  163. package/dist/gateway/cron/notify.js +40 -0
  164. package/dist/gateway/cron/notify.js.map +1 -0
  165. package/dist/gateway/db/dialect-helpers.d.ts +8 -0
  166. package/dist/gateway/db/dialect-helpers.js +26 -0
  167. package/dist/gateway/db/dialect-helpers.js.map +1 -0
  168. package/dist/gateway/db/index.d.ts +20 -0
  169. package/dist/gateway/db/index.js +140 -0
  170. package/dist/gateway/db/index.js.map +1 -0
  171. package/dist/gateway/db/init-schema.d.ts +8 -0
  172. package/dist/gateway/db/init-schema.js +385 -0
  173. package/dist/gateway/db/init-schema.js.map +1 -0
  174. package/dist/gateway/db/migrate-sqlite.d.ts +8 -0
  175. package/dist/gateway/db/migrate-sqlite.js +335 -0
  176. package/dist/gateway/db/migrate-sqlite.js.map +1 -0
  177. package/dist/gateway/db/repositories/chat-repo.d.ts +64 -0
  178. package/dist/gateway/db/repositories/chat-repo.js +115 -0
  179. package/dist/gateway/db/repositories/chat-repo.js.map +1 -0
  180. package/dist/gateway/db/repositories/config-repo.d.ts +164 -0
  181. package/dist/gateway/db/repositories/config-repo.js +267 -0
  182. package/dist/gateway/db/repositories/config-repo.js.map +1 -0
  183. package/dist/gateway/db/repositories/credential-repo.d.ts +51 -0
  184. package/dist/gateway/db/repositories/credential-repo.js +70 -0
  185. package/dist/gateway/db/repositories/credential-repo.js.map +1 -0
  186. package/dist/gateway/db/repositories/env-repo.d.ts +37 -0
  187. package/dist/gateway/db/repositories/env-repo.js +74 -0
  188. package/dist/gateway/db/repositories/env-repo.js.map +1 -0
  189. package/dist/gateway/db/repositories/mcp-server-repo.d.ts +97 -0
  190. package/dist/gateway/db/repositories/mcp-server-repo.js +83 -0
  191. package/dist/gateway/db/repositories/mcp-server-repo.js.map +1 -0
  192. package/dist/gateway/db/repositories/model-config-repo.d.ts +141 -0
  193. package/dist/gateway/db/repositories/model-config-repo.js +439 -0
  194. package/dist/gateway/db/repositories/model-config-repo.js.map +1 -0
  195. package/dist/gateway/db/repositories/notification-repo.d.ts +50 -0
  196. package/dist/gateway/db/repositories/notification-repo.js +105 -0
  197. package/dist/gateway/db/repositories/notification-repo.js.map +1 -0
  198. package/dist/gateway/db/repositories/permission-repo.d.ts +28 -0
  199. package/dist/gateway/db/repositories/permission-repo.js +74 -0
  200. package/dist/gateway/db/repositories/permission-repo.js.map +1 -0
  201. package/dist/gateway/db/repositories/skill-content-repo.d.ts +29 -0
  202. package/dist/gateway/db/repositories/skill-content-repo.js +90 -0
  203. package/dist/gateway/db/repositories/skill-content-repo.js.map +1 -0
  204. package/dist/gateway/db/repositories/skill-repo.d.ts +170 -0
  205. package/dist/gateway/db/repositories/skill-repo.js +185 -0
  206. package/dist/gateway/db/repositories/skill-repo.js.map +1 -0
  207. package/dist/gateway/db/repositories/skill-review-repo.d.ts +44 -0
  208. package/dist/gateway/db/repositories/skill-review-repo.js +44 -0
  209. package/dist/gateway/db/repositories/skill-review-repo.js.map +1 -0
  210. package/dist/gateway/db/repositories/skill-version-repo.d.ts +30 -0
  211. package/dist/gateway/db/repositories/skill-version-repo.js +56 -0
  212. package/dist/gateway/db/repositories/skill-version-repo.js.map +1 -0
  213. package/dist/gateway/db/repositories/system-config-repo.d.ts +21 -0
  214. package/dist/gateway/db/repositories/system-config-repo.js +86 -0
  215. package/dist/gateway/db/repositories/system-config-repo.js.map +1 -0
  216. package/dist/gateway/db/repositories/user-env-config-repo.d.ts +32 -0
  217. package/dist/gateway/db/repositories/user-env-config-repo.js +79 -0
  218. package/dist/gateway/db/repositories/user-env-config-repo.js.map +1 -0
  219. package/dist/gateway/db/repositories/user-repo.d.ts +59 -0
  220. package/dist/gateway/db/repositories/user-repo.js +83 -0
  221. package/dist/gateway/db/repositories/user-repo.js.map +1 -0
  222. package/dist/gateway/db/repositories/vote-repo.d.ts +26 -0
  223. package/dist/gateway/db/repositories/vote-repo.js +97 -0
  224. package/dist/gateway/db/repositories/vote-repo.js.map +1 -0
  225. package/dist/gateway/db/repositories/workspace-repo.d.ts +27 -0
  226. package/dist/gateway/db/repositories/workspace-repo.js +145 -0
  227. package/dist/gateway/db/repositories/workspace-repo.js.map +1 -0
  228. package/dist/gateway/db/schema-mysql.d.ts +3897 -0
  229. package/dist/gateway/db/schema-mysql.js +354 -0
  230. package/dist/gateway/db/schema-mysql.js.map +1 -0
  231. package/dist/gateway/db/schema-sqlite.d.ts +4147 -0
  232. package/dist/gateway/db/schema-sqlite.js +345 -0
  233. package/dist/gateway/db/schema-sqlite.js.map +1 -0
  234. package/dist/gateway/db/schema.d.ts +3869 -0
  235. package/dist/gateway/db/schema.js +16 -0
  236. package/dist/gateway/db/schema.js.map +1 -0
  237. package/dist/gateway/mcp-config-builder.d.ts +8 -0
  238. package/dist/gateway/mcp-config-builder.js +39 -0
  239. package/dist/gateway/mcp-config-builder.js.map +1 -0
  240. package/dist/gateway/output-redactor.d.ts +27 -0
  241. package/dist/gateway/output-redactor.js +101 -0
  242. package/dist/gateway/output-redactor.js.map +1 -0
  243. package/dist/gateway/plugins/api.d.ts +181 -0
  244. package/dist/gateway/plugins/api.js +28 -0
  245. package/dist/gateway/plugins/api.js.map +1 -0
  246. package/dist/gateway/plugins/channel-bridge.d.ts +72 -0
  247. package/dist/gateway/plugins/channel-bridge.js +586 -0
  248. package/dist/gateway/plugins/channel-bridge.js.map +1 -0
  249. package/dist/gateway/plugins/loader.d.ts +2 -0
  250. package/dist/gateway/plugins/loader.js +83 -0
  251. package/dist/gateway/plugins/loader.js.map +1 -0
  252. package/dist/gateway/plugins/runtime.d.ts +25 -0
  253. package/dist/gateway/plugins/runtime.js +64 -0
  254. package/dist/gateway/plugins/runtime.js.map +1 -0
  255. package/dist/gateway/resource-notifier.d.ts +36 -0
  256. package/dist/gateway/resource-notifier.js +123 -0
  257. package/dist/gateway/resource-notifier.js.map +1 -0
  258. package/dist/gateway/rpc-methods.d.ts +34 -0
  259. package/dist/gateway/rpc-methods.js +3198 -0
  260. package/dist/gateway/rpc-methods.js.map +1 -0
  261. package/dist/gateway/security/cert-manager.d.ts +77 -0
  262. package/dist/gateway/security/cert-manager.js +280 -0
  263. package/dist/gateway/security/cert-manager.js.map +1 -0
  264. package/dist/gateway/security/mtls-middleware.d.ts +33 -0
  265. package/dist/gateway/security/mtls-middleware.js +89 -0
  266. package/dist/gateway/security/mtls-middleware.js.map +1 -0
  267. package/dist/gateway/server.d.ts +54 -0
  268. package/dist/gateway/server.js +1146 -0
  269. package/dist/gateway/server.js.map +1 -0
  270. package/dist/gateway/skill-labels.d.ts +16 -0
  271. package/dist/gateway/skill-labels.js +79 -0
  272. package/dist/gateway/skill-labels.js.map +1 -0
  273. package/dist/gateway/skills/file-writer.d.ts +75 -0
  274. package/dist/gateway/skills/file-writer.js +320 -0
  275. package/dist/gateway/skills/file-writer.js.map +1 -0
  276. package/dist/gateway/skills/script-evaluator.d.ts +42 -0
  277. package/dist/gateway/skills/script-evaluator.js +204 -0
  278. package/dist/gateway/skills/script-evaluator.js.map +1 -0
  279. package/dist/gateway/skills/skill-bundle.d.ts +34 -0
  280. package/dist/gateway/skills/skill-bundle.js +83 -0
  281. package/dist/gateway/skills/skill-bundle.js.map +1 -0
  282. package/dist/gateway/web/dist/assets/index-BF6CtvnV.css +1 -0
  283. package/dist/gateway/web/dist/assets/index-Dumzqsr-.js +680 -0
  284. package/dist/gateway/web/dist/assets/index-n4IMHP1Q.js +675 -0
  285. package/dist/gateway/web/dist/index.html +14 -0
  286. package/dist/gateway/web/dist/noise.png +1 -0
  287. package/dist/gateway/web/dist/robots.txt +2 -0
  288. package/dist/gateway/web/dist/vite.svg +1 -0
  289. package/dist/gateway/ws-protocol.d.ts +68 -0
  290. package/dist/gateway/ws-protocol.js +106 -0
  291. package/dist/gateway/ws-protocol.js.map +1 -0
  292. package/dist/gateway-main.d.ts +1 -0
  293. package/dist/gateway-main.js +129 -0
  294. package/dist/gateway-main.js.map +1 -0
  295. package/dist/lib/s3-backup.d.ts +28 -0
  296. package/dist/lib/s3-backup.js +85 -0
  297. package/dist/lib/s3-backup.js.map +1 -0
  298. package/dist/lib/s3-storage.d.ts +45 -0
  299. package/dist/lib/s3-storage.js +210 -0
  300. package/dist/lib/s3-storage.js.map +1 -0
  301. package/dist/memory/chunker.d.ts +15 -0
  302. package/dist/memory/chunker.js +94 -0
  303. package/dist/memory/chunker.js.map +1 -0
  304. package/dist/memory/embeddings.d.ts +14 -0
  305. package/dist/memory/embeddings.js +143 -0
  306. package/dist/memory/embeddings.js.map +1 -0
  307. package/dist/memory/index.d.ts +18 -0
  308. package/dist/memory/index.js +15 -0
  309. package/dist/memory/index.js.map +1 -0
  310. package/dist/memory/indexer.d.ts +70 -0
  311. package/dist/memory/indexer.js +567 -0
  312. package/dist/memory/indexer.js.map +1 -0
  313. package/dist/memory/mmr.d.ts +22 -0
  314. package/dist/memory/mmr.js +82 -0
  315. package/dist/memory/mmr.js.map +1 -0
  316. package/dist/memory/schema.d.ts +2 -0
  317. package/dist/memory/schema.js +85 -0
  318. package/dist/memory/schema.js.map +1 -0
  319. package/dist/memory/session-summarizer.d.ts +19 -0
  320. package/dist/memory/session-summarizer.js +139 -0
  321. package/dist/memory/session-summarizer.js.map +1 -0
  322. package/dist/memory/stop-words.d.ts +13 -0
  323. package/dist/memory/stop-words.js +132 -0
  324. package/dist/memory/stop-words.js.map +1 -0
  325. package/dist/memory/temporal-decay.d.ts +20 -0
  326. package/dist/memory/temporal-decay.js +63 -0
  327. package/dist/memory/temporal-decay.js.map +1 -0
  328. package/dist/memory/types.d.ts +40 -0
  329. package/dist/memory/types.js +2 -0
  330. package/dist/memory/types.js.map +1 -0
  331. package/dist/shared/resource-sync.d.ts +80 -0
  332. package/dist/shared/resource-sync.js +24 -0
  333. package/dist/shared/resource-sync.js.map +1 -0
  334. package/dist/tools/command-sets.d.ts +61 -0
  335. package/dist/tools/command-sets.js +845 -0
  336. package/dist/tools/command-sets.js.map +1 -0
  337. package/dist/tools/create-skill.d.ts +2 -0
  338. package/dist/tools/create-skill.js +169 -0
  339. package/dist/tools/create-skill.js.map +1 -0
  340. package/dist/tools/credential-list.d.ts +8 -0
  341. package/dist/tools/credential-list.js +139 -0
  342. package/dist/tools/credential-list.js.map +1 -0
  343. package/dist/tools/deep-search/engine.d.ts +40 -0
  344. package/dist/tools/deep-search/engine.js +594 -0
  345. package/dist/tools/deep-search/engine.js.map +1 -0
  346. package/dist/tools/deep-search/events.d.ts +11 -0
  347. package/dist/tools/deep-search/events.js +10 -0
  348. package/dist/tools/deep-search/events.js.map +1 -0
  349. package/dist/tools/deep-search/format.d.ts +11 -0
  350. package/dist/tools/deep-search/format.js +143 -0
  351. package/dist/tools/deep-search/format.js.map +1 -0
  352. package/dist/tools/deep-search/prompts.d.ts +30 -0
  353. package/dist/tools/deep-search/prompts.js +237 -0
  354. package/dist/tools/deep-search/prompts.js.map +1 -0
  355. package/dist/tools/deep-search/sre-knowledge.d.ts +21 -0
  356. package/dist/tools/deep-search/sre-knowledge.js +112 -0
  357. package/dist/tools/deep-search/sre-knowledge.js.map +1 -0
  358. package/dist/tools/deep-search/sub-agent.d.ts +71 -0
  359. package/dist/tools/deep-search/sub-agent.js +401 -0
  360. package/dist/tools/deep-search/sub-agent.js.map +1 -0
  361. package/dist/tools/deep-search/tool.d.ts +9 -0
  362. package/dist/tools/deep-search/tool.js +201 -0
  363. package/dist/tools/deep-search/tool.js.map +1 -0
  364. package/dist/tools/deep-search/types.d.ts +67 -0
  365. package/dist/tools/deep-search/types.js +41 -0
  366. package/dist/tools/deep-search/types.js.map +1 -0
  367. package/dist/tools/dp-tools.d.ts +47 -0
  368. package/dist/tools/dp-tools.js +170 -0
  369. package/dist/tools/dp-tools.js.map +1 -0
  370. package/dist/tools/fork-skill.d.ts +2 -0
  371. package/dist/tools/fork-skill.js +93 -0
  372. package/dist/tools/fork-skill.js.map +1 -0
  373. package/dist/tools/k8s-checks.d.ts +18 -0
  374. package/dist/tools/k8s-checks.js +105 -0
  375. package/dist/tools/k8s-checks.js.map +1 -0
  376. package/dist/tools/kubeconfig-resolver.d.ts +11 -0
  377. package/dist/tools/kubeconfig-resolver.js +53 -0
  378. package/dist/tools/kubeconfig-resolver.js.map +1 -0
  379. package/dist/tools/kubectl.d.ts +12 -0
  380. package/dist/tools/kubectl.js +169 -0
  381. package/dist/tools/kubectl.js.map +1 -0
  382. package/dist/tools/manage-schedule.d.ts +3 -0
  383. package/dist/tools/manage-schedule.js +189 -0
  384. package/dist/tools/manage-schedule.js.map +1 -0
  385. package/dist/tools/memory-get.d.ts +2 -0
  386. package/dist/tools/memory-get.js +99 -0
  387. package/dist/tools/memory-get.js.map +1 -0
  388. package/dist/tools/memory-search.d.ts +3 -0
  389. package/dist/tools/memory-search.js +93 -0
  390. package/dist/tools/memory-search.js.map +1 -0
  391. package/dist/tools/netns-script.d.ts +3 -0
  392. package/dist/tools/netns-script.js +394 -0
  393. package/dist/tools/netns-script.js.map +1 -0
  394. package/dist/tools/node-exec.d.ts +18 -0
  395. package/dist/tools/node-exec.js +342 -0
  396. package/dist/tools/node-exec.js.map +1 -0
  397. package/dist/tools/node-script.d.ts +3 -0
  398. package/dist/tools/node-script.js +266 -0
  399. package/dist/tools/node-script.js.map +1 -0
  400. package/dist/tools/pod-exec.d.ts +4 -0
  401. package/dist/tools/pod-exec.js +146 -0
  402. package/dist/tools/pod-exec.js.map +1 -0
  403. package/dist/tools/pod-nsenter-exec.d.ts +3 -0
  404. package/dist/tools/pod-nsenter-exec.js +333 -0
  405. package/dist/tools/pod-nsenter-exec.js.map +1 -0
  406. package/dist/tools/pod-script.d.ts +3 -0
  407. package/dist/tools/pod-script.js +176 -0
  408. package/dist/tools/pod-script.js.map +1 -0
  409. package/dist/tools/restricted-bash.d.ts +41 -0
  410. package/dist/tools/restricted-bash.js +503 -0
  411. package/dist/tools/restricted-bash.js.map +1 -0
  412. package/dist/tools/run-skill.d.ts +3 -0
  413. package/dist/tools/run-skill.js +169 -0
  414. package/dist/tools/run-skill.js.map +1 -0
  415. package/dist/tools/sanitize-env.d.ts +14 -0
  416. package/dist/tools/sanitize-env.js +95 -0
  417. package/dist/tools/sanitize-env.js.map +1 -0
  418. package/dist/tools/script-resolver.d.ts +35 -0
  419. package/dist/tools/script-resolver.js +213 -0
  420. package/dist/tools/script-resolver.js.map +1 -0
  421. package/dist/tools/tool-render.d.ts +20 -0
  422. package/dist/tools/tool-render.js +77 -0
  423. package/dist/tools/tool-render.js.map +1 -0
  424. package/dist/tools/update-skill.d.ts +2 -0
  425. package/dist/tools/update-skill.js +169 -0
  426. package/dist/tools/update-skill.js.map +1 -0
  427. package/package.json +106 -0
  428. package/settings.example.json +74 -0
  429. package/siclaw.mjs +48 -0
  430. package/skills/core/cluster-events/SKILL.md +150 -0
  431. package/skills/core/deep-investigation/SKILL.md +87 -0
  432. package/skills/core/deep-investigation/default-memory.md +8 -0
  433. package/skills/core/deployment-rollout-debug/SKILL.md +144 -0
  434. package/skills/core/dns-debug/SKILL.md +144 -0
  435. package/skills/core/find-node/SKILL.md +23 -0
  436. package/skills/core/find-node/scripts/find-node.sh +9 -0
  437. package/skills/core/hpa-debug/SKILL.md +159 -0
  438. package/skills/core/image-pull-debug/SKILL.md +151 -0
  439. package/skills/core/ingress-debug/SKILL.md +189 -0
  440. package/skills/core/job-debug/SKILL.md +180 -0
  441. package/skills/core/meta.json +23 -0
  442. package/skills/core/node-health-check/SKILL.md +150 -0
  443. package/skills/core/node-logs/SKILL.md +68 -0
  444. package/skills/core/node-logs/scripts/get-node-logs.sh +78 -0
  445. package/skills/core/node-ping-gateway/SKILL.md +54 -0
  446. package/skills/core/node-ping-gateway/scripts/ping-node-gateway.sh +71 -0
  447. package/skills/core/node-show-gateway/SKILL.md +55 -0
  448. package/skills/core/node-show-gateway/scripts/show-node-gateway.sh +90 -0
  449. package/skills/core/pod-crash-debug/SKILL.md +135 -0
  450. package/skills/core/pod-pending-debug/SKILL.md +146 -0
  451. package/skills/core/pod-ping-gateway/SKILL.md +44 -0
  452. package/skills/core/pod-ping-gateway/scripts/ping-gateway.sh +76 -0
  453. package/skills/core/pod-show-gateway/SKILL.md +54 -0
  454. package/skills/core/pod-show-gateway/scripts/show-gateway.sh +115 -0
  455. package/skills/core/pvc-debug/SKILL.md +169 -0
  456. package/skills/core/service-debug/SKILL.md +164 -0
  457. package/skills/extension/.gitkeep +0 -0
  458. package/skills/platform/create-skill/SKILL.md +288 -0
  459. package/skills/platform/manage-skill/SKILL.md +23 -0
  460. package/skills/platform/update-skill/SKILL.md +52 -0
package/LICENSE ADDED
@@ -0,0 +1,190 @@
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 the 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 the 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 any 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
+ Copyright 2025 Scitix
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,268 @@
1
+ <div align="center">
2
+
3
+ <img src="docs/assets/logo.png" alt="Siclaw Logo" width="400" />
4
+
5
+ # Siclaw
6
+
7
+ **AI Agent platform for SRE — the collaborative AI foundation for your team**
8
+
9
+ [![CI](https://github.com/scitix/siclaw/actions/workflows/ci.yml/badge.svg)](https://github.com/scitix/siclaw/actions/workflows/ci.yml)
10
+ [![Node.js](https://img.shields.io/badge/Node.js-%3E%3D22-339933?logo=node.js&logoColor=white)](https://nodejs.org/)
11
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.9-3178C6?logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
12
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
13
+
14
+
15
+ </div>
16
+
17
+ ---
18
+
19
+ Siclaw is an AI Agent platform for DevOps / SRE, inspired by [OpenClaw](https://github.com/openclaw) and designed to be the collaborative AI foundation for engineering teams. Unlike general-purpose coding agents, Siclaw is built for **read-only infrastructure diagnostics** — the agent observes, analyzes, and reports, but never mutates your environment directly. When remediation is needed, Siclaw integrates with your existing change management systems to execute changes through established, auditable workflows. Describe a problem in plain language and the agent runs kubectl, reads logs, traces network paths, and delivers a root-cause analysis — from a terminal, a web UI, or your team's IM workspace.
20
+
21
+ ## Features
22
+
23
+ - **Deep Investigation** — Hypothesis-driven 4-phase diagnostic engine (context gathering → hypothesis generation → parallel validation → root-cause conclusion), bringing Deep Research to SRE with cross-system, multi-dimensional fault analysis
24
+ - **Investigation Memory** — Accumulates structured knowledge from every deep investigation into a local hybrid store (vector + full-text); surfaces relevant past experience during hypothesis generation so the agent gets smarter with every incident resolved
25
+ - **Security Governance** — Strict permission layer between agent and infrastructure: read-only by default, command whitelist, write operations require per-item approval, credentials isolated by workspace — zero accidental mutations in production
26
+ - **Team Collaboration** — Multi-workspace, multi-user management (SSO/OAuth2), isolated AgentBox sandboxes per user, designed for multi-team, multi-environment enterprise scenarios
27
+ - **Alert-Driven Operations** — Webhook triggers connect to your existing monitoring stack (Prometheus, PagerDuty, custom), automatically launching agent investigations when alerts fire
28
+ - **Scheduled Tasks** — Cron-based recurring jobs for routine health checks, periodic diagnostics, or any agent task — manageable via Web UI or natural language
29
+ - **Skill System** — AI-generated diagnostic skills with automated risk-level review, supporting creation, forking, and hot-reload via Web UI or natural language — organize across core / team / personal tiers to codify your team's operational expertise into reusable, shareable runbooks
30
+ - **Extensible** — [MCP](https://modelcontextprotocol.io) tool servers for custom data source integrations
31
+ - **Multi-Channel Access** — Terminal TUI, Web UI, or IM bots (Slack, Discord, Telegram, Lark)
32
+
33
+ ## Architecture
34
+
35
+ ![Siclaw System Architecture](docs/assets/architecture.svg)
36
+
37
+ > Three deployment modes share one agent core: **TUI** (single-user terminal),
38
+ > **Local Server** (Gateway + SQLite, multi-user), **Kubernetes** (isolated AgentBox pod per user).
39
+ > The Knowledge System feeds the agent with accumulated investigation experience (IM Phase 0–1 ✓)
40
+ > and team-wide knowledge via Qdrant (KR0 — in progress).
41
+
42
+ ## Prerequisites
43
+
44
+ - **Node.js >= 22.12.0** — [Download](https://nodejs.org/)
45
+ - **npm** — Comes with Node.js
46
+ - **kubectl** + **kubeconfig** — Required for Kubernetes diagnostics only ([Install guide](https://kubernetes.io/docs/tasks/tools/)); not needed for TUI or Local Server mode without K8s access
47
+
48
+ ## Quick Start
49
+
50
+ Siclaw supports three deployment profiles. Pick the one that fits your use case.
51
+
52
+ ### 1. TUI Mode — Personal, local, lowest barrier
53
+
54
+ Run the agent directly in your terminal. No server, no database. All operations are read-only by default — safe to run on your workstation.
55
+
56
+ ```bash
57
+ # Install
58
+ npm install siclaw
59
+
60
+ # Run (interactive — prompts for LLM provider on first launch)
61
+ npx siclaw
62
+
63
+ # Single-shot
64
+ npx siclaw --prompt "Why is pod nginx-abc in CrashLoopBackOff?"
65
+
66
+ # Continue last session
67
+ npx siclaw --continue
68
+ ```
69
+
70
+ <details>
71
+ <summary><b>Build from source</b></summary>
72
+
73
+ ```bash
74
+ git clone https://github.com/scitix/siclaw.git && cd siclaw
75
+ npm ci && npm run build
76
+ npm link # register `siclaw` command globally
77
+
78
+ siclaw # TUI mode
79
+ siclaw --prompt "..." # single-shot mode
80
+
81
+ # Uninstall: npm unlink siclaw -g
82
+ ```
83
+
84
+ </details>
85
+
86
+ > **Tip:** Any OpenAI-compatible endpoint works — swap `baseUrl` for DeepSeek, Qwen, Kimi, or a local Ollama server.
87
+
88
+ ### 2. Local Server — VM or laptop, recommended for daily use
89
+
90
+ A lightweight web UI backed by SQLite. No MySQL, no Docker required — just start the server and configure everything in the browser. Siclaw enforces strict read-only access by default (command whitelist, no write operations without approval), so you can safely deploy it on your own workstation without worrying about unintended changes to your clusters.
91
+
92
+ ```bash
93
+ npm install siclaw
94
+
95
+ # Start the server (SQLite database is created automatically)
96
+ npx siclaw local
97
+
98
+ # Open http://localhost:3000
99
+ # Login: admin / admin (default credentials)
100
+ # Go to Settings to configure your LLM provider
101
+ ```
102
+
103
+ <details>
104
+ <summary><b>Build from source</b></summary>
105
+
106
+ ```bash
107
+ git clone https://github.com/scitix/siclaw.git && cd siclaw
108
+ npm ci && npm run build && npm run build:web
109
+ npm link # register `siclaw` command globally
110
+
111
+ siclaw local # start local server
112
+
113
+ # Uninstall: npm unlink siclaw -g
114
+ ```
115
+
116
+ </details>
117
+
118
+ The server uses SQLite by default and auto-generates a JWT secret on first run. All configuration — LLM providers, models, credentials — is done through the **Settings** page in the web UI.
119
+
120
+ ### 3. Kubernetes — Team / enterprise
121
+
122
+ Full multi-user deployment with isolated AgentBox pods, SSO, and IM channels. Just prepare a MySQL database and deploy with Helm:
123
+
124
+ ```bash
125
+ helm upgrade --install siclaw ./helm/siclaw \
126
+ --namespace siclaw --create-namespace \
127
+ --set database.url="mysql://user:pass@host:3306/siclaw"
128
+ ```
129
+
130
+ <details>
131
+ <summary><b>Using a custom image registry</b></summary>
132
+
133
+ If you need to build and push images to your own registry:
134
+
135
+ ```bash
136
+ # Build and push images
137
+ make docker push REGISTRY=registry.example.com/myteam
138
+
139
+ # Deploy with custom registry
140
+ helm upgrade --install siclaw ./helm/siclaw \
141
+ --namespace siclaw --create-namespace \
142
+ --set image.registry="registry.example.com/myteam" \
143
+ --set database.url="mysql://user:pass@host:3306/siclaw"
144
+ ```
145
+
146
+ </details>
147
+
148
+ See [`helm/siclaw/`](helm/siclaw/) for values reference, and [`k8s/README.md`](k8s/README.md) for the full deployment guide.
149
+
150
+ ## Configuration
151
+
152
+ ### settings.json (TUI mode)
153
+
154
+ Minimal example — copy `settings.example.json` to `.siclaw/config/settings.json`:
155
+
156
+ ```json
157
+ {
158
+ "providers": {
159
+ "default": {
160
+ "baseUrl": "https://api.openai.com/v1",
161
+ "apiKey": "sk-YOUR-KEY",
162
+ "models": [{ "id": "gpt-4o", "name": "GPT-4o" }]
163
+ }
164
+ }
165
+ }
166
+ ```
167
+
168
+ <details>
169
+ <summary><b>Full settings.json reference</b></summary>
170
+
171
+ ```json
172
+ {
173
+ "providers": {
174
+ "provider-name": {
175
+ "baseUrl": "https://api.example.com/v1",
176
+ "apiKey": "your-key",
177
+ "api": "openai-completions",
178
+ "authHeader": true,
179
+ "models": [
180
+ {
181
+ "id": "model-id",
182
+ "name": "Display Name",
183
+ "reasoning": false,
184
+ "contextWindow": 128000,
185
+ "maxTokens": 16384,
186
+ "cost": { "input": 2.5, "output": 10.0, "cacheRead": 0.5, "cacheWrite": 3.0 }
187
+ }
188
+ ]
189
+ }
190
+ },
191
+ "default": { "provider": "provider-name", "modelId": "model-id" },
192
+ "embedding": {
193
+ "baseUrl": "https://api.example.com/v1",
194
+ "apiKey": "your-key",
195
+ "model": "BAAI/bge-m3",
196
+ "dimensions": 1024
197
+ },
198
+ "mcpServers": {
199
+ "server-name": {
200
+ "command": "npx",
201
+ "args": ["-y", "@some/mcp-server"]
202
+ }
203
+ },
204
+ "debugImage": "busybox:latest",
205
+ "debug": false
206
+ }
207
+ ```
208
+
209
+ </details>
210
+
211
+ <details>
212
+ <summary><b>IM Channels — Slack / Discord / Telegram / Lark</b></summary>
213
+
214
+ ### Slack
215
+
216
+ Configure a Slack bot in **Settings > Channels**. You'll need:
217
+ - Bot token and signing secret from the [Slack API](https://api.slack.com/apps)
218
+
219
+ ### Discord
220
+
221
+ Configure a Discord bot in **Settings > Channels**. You'll need:
222
+ - Bot token from the [Discord Developer Portal](https://discord.com/developers/applications)
223
+ - Scopes: `bot`, `messages.read`
224
+
225
+ ### Telegram
226
+
227
+ Configure a Telegram bot in **Settings > Channels**. You'll need:
228
+ - Bot token from [@BotFather](https://t.me/BotFather)
229
+
230
+ ### Lark
231
+
232
+ Configure a Lark bot in **Settings > Channels** of the web UI. You'll need:
233
+ - App ID and App Secret from the [Lark Open Platform](https://open.larksuite.com/)
234
+ - Event subscription URL: `https://your-domain/api/channels/feishu/event`
235
+ - Scopes: `im:message`, `im:message.group_at_msg`, `im:resource`
236
+
237
+ </details>
238
+
239
+ ## Tech Stack
240
+
241
+ | Layer | Technology |
242
+ |-------|-----------|
243
+ | Runtime | Node.js 22+ (ESM-only) |
244
+ | Language | TypeScript 5.9 |
245
+ | Agent | [pi-coding-agent](https://github.com/badlogic/pi-mono) / [claude-agent-sdk](https://github.com/anthropics/claude-agent-sdk) |
246
+ | Database (gateway) | MySQL or SQLite (via [sql.js](https://github.com/sql-js/sql.js)) + Drizzle ORM |
247
+ | Database (memory) | node:sqlite + FTS5 + bge-m3 embeddings |
248
+ | Frontend | React + Vite + Tailwind CSS |
249
+ | K8s Client | @kubernetes/client-node |
250
+ | MCP | @modelcontextprotocol/sdk |
251
+ | Realtime | WebSocket (ws) |
252
+
253
+ ## Community
254
+
255
+ - [GitHub Issues](https://github.com/scitix/siclaw/issues) — Bug reports and feature requests
256
+ - [GitHub Discussions](https://github.com/scitix/siclaw/discussions) — Questions, ideas, and general discussion
257
+
258
+ <!-- TODO: Add Discord invite link once server is created -->
259
+
260
+ ## Contributing
261
+
262
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, architecture overview, and pull request guidelines.
263
+
264
+ Looking for a place to start? Check out issues labeled [`good first issue`](https://github.com/scitix/siclaw/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22).
265
+
266
+ ## License
267
+
268
+ [Apache License 2.0](LICENSE)
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Gateway Client for AgentBox
3
+ *
4
+ * HTTP client that uses mTLS client certificates to call Gateway's internal APIs.
5
+ * Used by AgentBox to query metadata (settings, cron jobs, etc.)
6
+ */
7
+ export interface GatewayClientOptions {
8
+ gatewayUrl: string;
9
+ certPath?: string;
10
+ }
11
+ export interface CronJob {
12
+ id: string;
13
+ name: string;
14
+ schedule: string;
15
+ status: string;
16
+ description?: string | null;
17
+ lastRunAt?: string | null;
18
+ lastResult?: string | null;
19
+ }
20
+ export declare class GatewayClient {
21
+ private gatewayUrl;
22
+ private tlsOptions;
23
+ constructor(options: GatewayClientOptions);
24
+ /**
25
+ * Fetch settings (providers, models, embedding config) from Gateway
26
+ */
27
+ fetchSettings(): Promise<any>;
28
+ /**
29
+ * List cron jobs for a user
30
+ */
31
+ listCronJobs(userId: string): Promise<CronJob[]>;
32
+ /**
33
+ * Return a GatewayClientLike adapter for use with resource handlers.
34
+ * Keeps `request()` private while exposing a minimal interface.
35
+ */
36
+ toClientLike(): import("../shared/resource-sync.js").GatewayClientLike;
37
+ /**
38
+ * Make HTTP(S) request to Gateway with mTLS authentication
39
+ */
40
+ private request;
41
+ }
@@ -0,0 +1,108 @@
1
+ /**
2
+ * Gateway Client for AgentBox
3
+ *
4
+ * HTTP client that uses mTLS client certificates to call Gateway's internal APIs.
5
+ * Used by AgentBox to query metadata (settings, cron jobs, etc.)
6
+ */
7
+ import https from "node:https";
8
+ import fs from "node:fs";
9
+ import path from "node:path";
10
+ export class GatewayClient {
11
+ gatewayUrl;
12
+ tlsOptions = null;
13
+ constructor(options) {
14
+ this.gatewayUrl = options.gatewayUrl.replace(/\/$/, ""); // Remove trailing slash
15
+ // Load client certificates if certPath provided
16
+ const certPath = options.certPath || process.env.SICLAW_CERT_PATH || "/etc/siclaw/certs";
17
+ const certFile = path.join(certPath, "tls.crt");
18
+ const keyFile = path.join(certPath, "tls.key");
19
+ const caFile = path.join(certPath, "ca.crt");
20
+ // Check if certificate files exist
21
+ if (fs.existsSync(certFile) && fs.existsSync(keyFile) && fs.existsSync(caFile)) {
22
+ this.tlsOptions = {
23
+ cert: fs.readFileSync(certFile),
24
+ key: fs.readFileSync(keyFile),
25
+ ca: fs.readFileSync(caFile),
26
+ rejectUnauthorized: true, // Verify Gateway's certificate
27
+ };
28
+ console.log(`[gateway-client] Loaded client certificates from ${certPath}`);
29
+ }
30
+ else {
31
+ console.warn(`[gateway-client] Client certificates not found at ${certPath}, will use plain HTTP`);
32
+ }
33
+ }
34
+ /**
35
+ * Fetch settings (providers, models, embedding config) from Gateway
36
+ */
37
+ async fetchSettings() {
38
+ return this.request("/api/internal/settings", "GET");
39
+ }
40
+ /**
41
+ * List cron jobs for a user
42
+ */
43
+ async listCronJobs(userId) {
44
+ const data = await this.request(`/api/internal/cron-list?userId=${encodeURIComponent(userId)}`, "GET");
45
+ return data.jobs || [];
46
+ }
47
+ /**
48
+ * Return a GatewayClientLike adapter for use with resource handlers.
49
+ * Keeps `request()` private while exposing a minimal interface.
50
+ */
51
+ toClientLike() {
52
+ return {
53
+ request: (p, m, b) => this.request(p, m, b),
54
+ };
55
+ }
56
+ /**
57
+ * Make HTTP(S) request to Gateway with mTLS authentication
58
+ */
59
+ request(path, method = "GET", body) {
60
+ return new Promise((resolve, reject) => {
61
+ const url = new URL(path, this.gatewayUrl);
62
+ const isHttps = url.protocol === "https:";
63
+ const requestOptions = {
64
+ hostname: url.hostname,
65
+ port: url.port || (isHttps ? 443 : 80),
66
+ path: url.pathname + url.search,
67
+ method,
68
+ headers: {
69
+ "Content-Type": "application/json",
70
+ },
71
+ ...(isHttps && this.tlsOptions ? this.tlsOptions : {}),
72
+ };
73
+ const client = isHttps ? https : require("http");
74
+ const req = client.request(requestOptions, (res) => {
75
+ let data = "";
76
+ res.on("data", (chunk) => {
77
+ data += chunk.toString();
78
+ });
79
+ res.on("end", () => {
80
+ if (res.statusCode === 200) {
81
+ try {
82
+ const json = JSON.parse(data);
83
+ resolve(json);
84
+ }
85
+ catch (err) {
86
+ reject(new Error(`Failed to parse JSON response: ${data}`));
87
+ }
88
+ }
89
+ else {
90
+ reject(new Error(`Gateway returned ${res.statusCode}: ${data}`));
91
+ }
92
+ });
93
+ });
94
+ req.on("error", (err) => {
95
+ reject(new Error(`Gateway request failed: ${err.message}`));
96
+ });
97
+ req.setTimeout(5000, () => {
98
+ req.destroy();
99
+ reject(new Error("Gateway request timeout"));
100
+ });
101
+ if (body) {
102
+ req.write(JSON.stringify(body));
103
+ }
104
+ req.end();
105
+ });
106
+ }
107
+ }
108
+ //# sourceMappingURL=gateway-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gateway-client.js","sourceRoot":"","sources":["../../src/agentbox/gateway-client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAE,MAAM,SAAS,C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C,CAAC,CAAC;YAC/C,CAAC,CAAC,CAAC;YAEH,IAAI,IAAI,EAAE,CAAC;gBACT,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;YAClC,CAAC;YAED,GAAG,CAAC,GAAG,EAAE,CAAC;QACZ,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * AgentBox HTTP Server
3
+ *
4
+ * Provides HTTP API for Gateway to call, with SSE streaming support.
5
+ */
6
+ import http from "node:http";
7
+ import https from "node:https";
8
+ import type { AgentBoxSessionManager } from "./session.js";
9
+ /**
10
+ * Create HTTP or HTTPS server (auto-detects certificates)
11
+ */
12
+ export declare function createHttpServer(sessionManager: AgentBoxSessionManager): http.Server | https.Server;