qlogicagent 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 (450) hide show
  1. package/README.md +45 -0
  2. package/dist/agent/agent.d.ts +44 -0
  3. package/dist/agent/agent.d.ts.map +1 -0
  4. package/dist/agent/agent.js +114 -0
  5. package/dist/agent/agent.js.map +1 -0
  6. package/dist/agent/tool-loop.d.ts +65 -0
  7. package/dist/agent/tool-loop.d.ts.map +1 -0
  8. package/dist/agent/tool-loop.js +576 -0
  9. package/dist/agent/tool-loop.js.map +1 -0
  10. package/dist/agent/types.d.ts +176 -0
  11. package/dist/agent/types.d.ts.map +1 -0
  12. package/dist/agent/types.js +15 -0
  13. package/dist/agent/types.js.map +1 -0
  14. package/dist/cli/main.d.ts +12 -0
  15. package/dist/cli/main.d.ts.map +1 -0
  16. package/dist/cli/main.js +24 -0
  17. package/dist/cli/main.js.map +1 -0
  18. package/dist/cli/stdio-server.d.ts +46 -0
  19. package/dist/cli/stdio-server.d.ts.map +1 -0
  20. package/dist/cli/stdio-server.js +464 -0
  21. package/dist/cli/stdio-server.js.map +1 -0
  22. package/dist/config/config.d.ts +18 -0
  23. package/dist/config/config.d.ts.map +1 -0
  24. package/dist/config/config.js +22 -0
  25. package/dist/config/config.js.map +1 -0
  26. package/dist/contracts/hooks.d.ts +121 -0
  27. package/dist/contracts/hooks.d.ts.map +1 -0
  28. package/dist/contracts/hooks.js +8 -0
  29. package/dist/contracts/hooks.js.map +1 -0
  30. package/dist/contracts/index.d.ts +11 -0
  31. package/dist/contracts/index.d.ts.map +1 -0
  32. package/dist/contracts/index.js +11 -0
  33. package/dist/contracts/index.js.map +1 -0
  34. package/dist/contracts/planner.d.ts +36 -0
  35. package/dist/contracts/planner.d.ts.map +1 -0
  36. package/dist/contracts/planner.js +3 -0
  37. package/dist/contracts/planner.js.map +1 -0
  38. package/dist/contracts/skill-candidate.d.ts +64 -0
  39. package/dist/contracts/skill-candidate.d.ts.map +1 -0
  40. package/dist/contracts/skill-candidate.js +196 -0
  41. package/dist/contracts/skill-candidate.js.map +1 -0
  42. package/dist/contracts/todo.d.ts +15 -0
  43. package/dist/contracts/todo.d.ts.map +1 -0
  44. package/dist/contracts/todo.js +10 -0
  45. package/dist/contracts/todo.js.map +1 -0
  46. package/dist/index.d.ts +14 -0
  47. package/dist/index.d.ts.map +1 -0
  48. package/dist/index.js +16 -0
  49. package/dist/index.js.map +1 -0
  50. package/dist/llm/builtin-providers.d.ts +11 -0
  51. package/dist/llm/builtin-providers.d.ts.map +1 -0
  52. package/dist/llm/builtin-providers.js +532 -0
  53. package/dist/llm/builtin-providers.js.map +1 -0
  54. package/dist/llm/index.d.ts +16 -0
  55. package/dist/llm/index.d.ts.map +1 -0
  56. package/dist/llm/index.js +15 -0
  57. package/dist/llm/index.js.map +1 -0
  58. package/dist/llm/llm-client.d.ts +44 -0
  59. package/dist/llm/llm-client.d.ts.map +1 -0
  60. package/dist/llm/llm-client.js +68 -0
  61. package/dist/llm/llm-client.js.map +1 -0
  62. package/dist/llm/model-catalog.d.ts +54 -0
  63. package/dist/llm/model-catalog.d.ts.map +1 -0
  64. package/dist/llm/model-catalog.js +192 -0
  65. package/dist/llm/model-catalog.js.map +1 -0
  66. package/dist/llm/provider-def.d.ts +60 -0
  67. package/dist/llm/provider-def.d.ts.map +1 -0
  68. package/dist/llm/provider-def.js +13 -0
  69. package/dist/llm/provider-def.js.map +1 -0
  70. package/dist/llm/provider-registry.d.ts +55 -0
  71. package/dist/llm/provider-registry.d.ts.map +1 -0
  72. package/dist/llm/provider-registry.js +148 -0
  73. package/dist/llm/provider-registry.js.map +1 -0
  74. package/dist/llm/transport.d.ts +63 -0
  75. package/dist/llm/transport.d.ts.map +1 -0
  76. package/dist/llm/transport.js +28 -0
  77. package/dist/llm/transport.js.map +1 -0
  78. package/dist/llm/transports/anthropic-messages.d.ts +32 -0
  79. package/dist/llm/transports/anthropic-messages.d.ts.map +1 -0
  80. package/dist/llm/transports/anthropic-messages.js +294 -0
  81. package/dist/llm/transports/anthropic-messages.js.map +1 -0
  82. package/dist/llm/transports/openai-chat.d.ts +37 -0
  83. package/dist/llm/transports/openai-chat.d.ts.map +1 -0
  84. package/dist/llm/transports/openai-chat.js +166 -0
  85. package/dist/llm/transports/openai-chat.js.map +1 -0
  86. package/dist/orchestration/agent-registry.d.ts +42 -0
  87. package/dist/orchestration/agent-registry.d.ts.map +1 -0
  88. package/dist/orchestration/agent-registry.js +117 -0
  89. package/dist/orchestration/agent-registry.js.map +1 -0
  90. package/dist/orchestration/approval-aware-tool-plan.d.ts +33 -0
  91. package/dist/orchestration/approval-aware-tool-plan.d.ts.map +1 -0
  92. package/dist/orchestration/approval-aware-tool-plan.js +88 -0
  93. package/dist/orchestration/approval-aware-tool-plan.js.map +1 -0
  94. package/dist/orchestration/context-compression.d.ts +221 -0
  95. package/dist/orchestration/context-compression.d.ts.map +1 -0
  96. package/dist/orchestration/context-compression.js +584 -0
  97. package/dist/orchestration/context-compression.js.map +1 -0
  98. package/dist/orchestration/conversation-repair.d.ts +62 -0
  99. package/dist/orchestration/conversation-repair.d.ts.map +1 -0
  100. package/dist/orchestration/conversation-repair.js +430 -0
  101. package/dist/orchestration/conversation-repair.js.map +1 -0
  102. package/dist/orchestration/curator-scheduler.d.ts +120 -0
  103. package/dist/orchestration/curator-scheduler.d.ts.map +1 -0
  104. package/dist/orchestration/curator-scheduler.js +136 -0
  105. package/dist/orchestration/curator-scheduler.js.map +1 -0
  106. package/dist/orchestration/embedded-failover-policy.d.ts +111 -0
  107. package/dist/orchestration/embedded-failover-policy.d.ts.map +1 -0
  108. package/dist/orchestration/embedded-failover-policy.js +169 -0
  109. package/dist/orchestration/embedded-failover-policy.js.map +1 -0
  110. package/dist/orchestration/error-classification.d.ts +13 -0
  111. package/dist/orchestration/error-classification.d.ts.map +1 -0
  112. package/dist/orchestration/error-classification.js +78 -0
  113. package/dist/orchestration/error-classification.js.map +1 -0
  114. package/dist/orchestration/failover-classification.d.ts +9 -0
  115. package/dist/orchestration/failover-classification.d.ts.map +1 -0
  116. package/dist/orchestration/failover-classification.js +382 -0
  117. package/dist/orchestration/failover-classification.js.map +1 -0
  118. package/dist/orchestration/failover-error.d.ts +34 -0
  119. package/dist/orchestration/failover-error.d.ts.map +1 -0
  120. package/dist/orchestration/failover-error.js +199 -0
  121. package/dist/orchestration/failover-error.js.map +1 -0
  122. package/dist/orchestration/fork-subagent.d.ts +101 -0
  123. package/dist/orchestration/fork-subagent.d.ts.map +1 -0
  124. package/dist/orchestration/fork-subagent.js +99 -0
  125. package/dist/orchestration/fork-subagent.js.map +1 -0
  126. package/dist/orchestration/index.d.ts +121 -0
  127. package/dist/orchestration/index.d.ts.map +1 -0
  128. package/dist/orchestration/index.js +268 -0
  129. package/dist/orchestration/index.js.map +1 -0
  130. package/dist/orchestration/memory-flush-policy.d.ts +58 -0
  131. package/dist/orchestration/memory-flush-policy.d.ts.map +1 -0
  132. package/dist/orchestration/memory-flush-policy.js +86 -0
  133. package/dist/orchestration/memory-flush-policy.js.map +1 -0
  134. package/dist/orchestration/memory-provider.d.ts +15 -0
  135. package/dist/orchestration/memory-provider.d.ts.map +1 -0
  136. package/dist/orchestration/memory-provider.js +3 -0
  137. package/dist/orchestration/memory-provider.js.map +1 -0
  138. package/dist/orchestration/parallel-tool-calls.d.ts +42 -0
  139. package/dist/orchestration/parallel-tool-calls.d.ts.map +1 -0
  140. package/dist/orchestration/parallel-tool-calls.js +60 -0
  141. package/dist/orchestration/parallel-tool-calls.js.map +1 -0
  142. package/dist/orchestration/prompt-cache-strategy.d.ts +127 -0
  143. package/dist/orchestration/prompt-cache-strategy.d.ts.map +1 -0
  144. package/dist/orchestration/prompt-cache-strategy.js +229 -0
  145. package/dist/orchestration/prompt-cache-strategy.js.map +1 -0
  146. package/dist/orchestration/reactive-compact.d.ts +74 -0
  147. package/dist/orchestration/reactive-compact.d.ts.map +1 -0
  148. package/dist/orchestration/reactive-compact.js +79 -0
  149. package/dist/orchestration/reactive-compact.js.map +1 -0
  150. package/dist/orchestration/retry-loop.d.ts +23 -0
  151. package/dist/orchestration/retry-loop.d.ts.map +1 -0
  152. package/dist/orchestration/retry-loop.js +25 -0
  153. package/dist/orchestration/retry-loop.js.map +1 -0
  154. package/dist/orchestration/skill-candidate.d.ts +53 -0
  155. package/dist/orchestration/skill-candidate.d.ts.map +1 -0
  156. package/dist/orchestration/skill-candidate.js +142 -0
  157. package/dist/orchestration/skill-candidate.js.map +1 -0
  158. package/dist/orchestration/skill-consolidation.d.ts +124 -0
  159. package/dist/orchestration/skill-consolidation.d.ts.map +1 -0
  160. package/dist/orchestration/skill-consolidation.js +221 -0
  161. package/dist/orchestration/skill-consolidation.js.map +1 -0
  162. package/dist/orchestration/skill-improvement.d.ts +60 -0
  163. package/dist/orchestration/skill-improvement.d.ts.map +1 -0
  164. package/dist/orchestration/skill-improvement.js +67 -0
  165. package/dist/orchestration/skill-improvement.js.map +1 -0
  166. package/dist/orchestration/skill-similarity.d.ts +99 -0
  167. package/dist/orchestration/skill-similarity.d.ts.map +1 -0
  168. package/dist/orchestration/skill-similarity.js +132 -0
  169. package/dist/orchestration/skill-similarity.js.map +1 -0
  170. package/dist/orchestration/streaming-tool-executor.d.ts +74 -0
  171. package/dist/orchestration/streaming-tool-executor.d.ts.map +1 -0
  172. package/dist/orchestration/streaming-tool-executor.js +97 -0
  173. package/dist/orchestration/streaming-tool-executor.js.map +1 -0
  174. package/dist/orchestration/team-orchestration.d.ts +196 -0
  175. package/dist/orchestration/team-orchestration.d.ts.map +1 -0
  176. package/dist/orchestration/team-orchestration.js +370 -0
  177. package/dist/orchestration/team-orchestration.js.map +1 -0
  178. package/dist/orchestration/team-tool-loop-wiring.d.ts +93 -0
  179. package/dist/orchestration/team-tool-loop-wiring.d.ts.map +1 -0
  180. package/dist/orchestration/team-tool-loop-wiring.js +148 -0
  181. package/dist/orchestration/team-tool-loop-wiring.js.map +1 -0
  182. package/dist/orchestration/tool-choice-policy.d.ts +55 -0
  183. package/dist/orchestration/tool-choice-policy.d.ts.map +1 -0
  184. package/dist/orchestration/tool-choice-policy.js +165 -0
  185. package/dist/orchestration/tool-choice-policy.js.map +1 -0
  186. package/dist/orchestration/tool-loop-state.d.ts +51 -0
  187. package/dist/orchestration/tool-loop-state.d.ts.map +1 -0
  188. package/dist/orchestration/tool-loop-state.js +134 -0
  189. package/dist/orchestration/tool-loop-state.js.map +1 -0
  190. package/dist/orchestration/tool-schema.d.ts +40 -0
  191. package/dist/orchestration/tool-schema.d.ts.map +1 -0
  192. package/dist/orchestration/tool-schema.js +298 -0
  193. package/dist/orchestration/tool-schema.js.map +1 -0
  194. package/dist/orchestration/transcript-repair.d.ts +43 -0
  195. package/dist/orchestration/transcript-repair.d.ts.map +1 -0
  196. package/dist/orchestration/transcript-repair.js +427 -0
  197. package/dist/orchestration/transcript-repair.js.map +1 -0
  198. package/dist/orchestration/turn-loop-guard.d.ts +87 -0
  199. package/dist/orchestration/turn-loop-guard.d.ts.map +1 -0
  200. package/dist/orchestration/turn-loop-guard.js +93 -0
  201. package/dist/orchestration/turn-loop-guard.js.map +1 -0
  202. package/dist/orchestration/web-browser-policy.d.ts +18 -0
  203. package/dist/orchestration/web-browser-policy.d.ts.map +1 -0
  204. package/dist/orchestration/web-browser-policy.js +40 -0
  205. package/dist/orchestration/web-browser-policy.js.map +1 -0
  206. package/dist/runtime/context-compression.d.ts +62 -0
  207. package/dist/runtime/context-compression.d.ts.map +1 -0
  208. package/dist/runtime/context-compression.js +275 -0
  209. package/dist/runtime/context-compression.js.map +1 -0
  210. package/dist/runtime/hook-registry.d.ts +13 -0
  211. package/dist/runtime/hook-registry.d.ts.map +1 -0
  212. package/dist/runtime/hook-registry.js +54 -0
  213. package/dist/runtime/hook-registry.js.map +1 -0
  214. package/dist/runtime/memory-hooks.d.ts +24 -0
  215. package/dist/runtime/memory-hooks.d.ts.map +1 -0
  216. package/dist/runtime/memory-hooks.js +66 -0
  217. package/dist/runtime/memory-hooks.js.map +1 -0
  218. package/dist/runtime/tool-eligibility.d.ts +60 -0
  219. package/dist/runtime/tool-eligibility.d.ts.map +1 -0
  220. package/dist/runtime/tool-eligibility.js +112 -0
  221. package/dist/runtime/tool-eligibility.js.map +1 -0
  222. package/dist/skills/index.d.ts +109 -0
  223. package/dist/skills/index.d.ts.map +1 -0
  224. package/dist/skills/index.js +83 -0
  225. package/dist/skills/index.js.map +1 -0
  226. package/dist/skills/memory-extractor.d.ts +65 -0
  227. package/dist/skills/memory-extractor.d.ts.map +1 -0
  228. package/dist/skills/memory-extractor.js +174 -0
  229. package/dist/skills/memory-extractor.js.map +1 -0
  230. package/dist/skills/memory-query-tool.d.ts +44 -0
  231. package/dist/skills/memory-query-tool.d.ts.map +1 -0
  232. package/dist/skills/memory-query-tool.js +128 -0
  233. package/dist/skills/memory-query-tool.js.map +1 -0
  234. package/dist/skills/memory-store.d.ts +67 -0
  235. package/dist/skills/memory-store.d.ts.map +1 -0
  236. package/dist/skills/memory-store.js +229 -0
  237. package/dist/skills/memory-store.js.map +1 -0
  238. package/dist/skills/memory-tool.d.ts +68 -0
  239. package/dist/skills/memory-tool.d.ts.map +1 -0
  240. package/dist/skills/memory-tool.js +193 -0
  241. package/dist/skills/memory-tool.js.map +1 -0
  242. package/dist/skills/portable-tool.d.ts +72 -0
  243. package/dist/skills/portable-tool.d.ts.map +1 -0
  244. package/dist/skills/portable-tool.js +15 -0
  245. package/dist/skills/portable-tool.js.map +1 -0
  246. package/dist/skills/qmemory-adapter.d.ts +53 -0
  247. package/dist/skills/qmemory-adapter.d.ts.map +1 -0
  248. package/dist/skills/qmemory-adapter.js +166 -0
  249. package/dist/skills/qmemory-adapter.js.map +1 -0
  250. package/dist/skills/skill-frontmatter.d.ts +20 -0
  251. package/dist/skills/skill-frontmatter.d.ts.map +1 -0
  252. package/dist/skills/skill-frontmatter.js +345 -0
  253. package/dist/skills/skill-frontmatter.js.map +1 -0
  254. package/dist/skills/skill-guard.d.ts +24 -0
  255. package/dist/skills/skill-guard.d.ts.map +1 -0
  256. package/dist/skills/skill-guard.js +230 -0
  257. package/dist/skills/skill-guard.js.map +1 -0
  258. package/dist/skills/skill-loader.d.ts +17 -0
  259. package/dist/skills/skill-loader.d.ts.map +1 -0
  260. package/dist/skills/skill-loader.js +304 -0
  261. package/dist/skills/skill-loader.js.map +1 -0
  262. package/dist/skills/skill-source.d.ts +120 -0
  263. package/dist/skills/skill-source.d.ts.map +1 -0
  264. package/dist/skills/skill-source.js +127 -0
  265. package/dist/skills/skill-source.js.map +1 -0
  266. package/dist/skills/skill-types.d.ts +200 -0
  267. package/dist/skills/skill-types.d.ts.map +1 -0
  268. package/dist/skills/skill-types.js +7 -0
  269. package/dist/skills/skill-types.js.map +1 -0
  270. package/dist/skills/think-tool.d.ts +17 -0
  271. package/dist/skills/think-tool.d.ts.map +1 -0
  272. package/dist/skills/think-tool.js +60 -0
  273. package/dist/skills/think-tool.js.map +1 -0
  274. package/dist/skills/todo-tool.d.ts +64 -0
  275. package/dist/skills/todo-tool.d.ts.map +1 -0
  276. package/dist/skills/todo-tool.js +115 -0
  277. package/dist/skills/todo-tool.js.map +1 -0
  278. package/dist/skills/tools/agent-tool.d.ts +92 -0
  279. package/dist/skills/tools/agent-tool.d.ts.map +1 -0
  280. package/dist/skills/tools/agent-tool.js +143 -0
  281. package/dist/skills/tools/agent-tool.js.map +1 -0
  282. package/dist/skills/tools/apply-patch-tool.d.ts +30 -0
  283. package/dist/skills/tools/apply-patch-tool.d.ts.map +1 -0
  284. package/dist/skills/tools/apply-patch-tool.js +185 -0
  285. package/dist/skills/tools/apply-patch-tool.js.map +1 -0
  286. package/dist/skills/tools/ask-user-tool.d.ts +81 -0
  287. package/dist/skills/tools/ask-user-tool.d.ts.map +1 -0
  288. package/dist/skills/tools/ask-user-tool.js +122 -0
  289. package/dist/skills/tools/ask-user-tool.js.map +1 -0
  290. package/dist/skills/tools/brief-tool.d.ts +75 -0
  291. package/dist/skills/tools/brief-tool.d.ts.map +1 -0
  292. package/dist/skills/tools/brief-tool.js +96 -0
  293. package/dist/skills/tools/brief-tool.js.map +1 -0
  294. package/dist/skills/tools/browser-tool.d.ts +115 -0
  295. package/dist/skills/tools/browser-tool.d.ts.map +1 -0
  296. package/dist/skills/tools/browser-tool.js +156 -0
  297. package/dist/skills/tools/browser-tool.js.map +1 -0
  298. package/dist/skills/tools/checkpoint-tool.d.ts +67 -0
  299. package/dist/skills/tools/checkpoint-tool.d.ts.map +1 -0
  300. package/dist/skills/tools/checkpoint-tool.js +103 -0
  301. package/dist/skills/tools/checkpoint-tool.js.map +1 -0
  302. package/dist/skills/tools/config-tool.d.ts +64 -0
  303. package/dist/skills/tools/config-tool.d.ts.map +1 -0
  304. package/dist/skills/tools/config-tool.js +144 -0
  305. package/dist/skills/tools/config-tool.js.map +1 -0
  306. package/dist/skills/tools/cron-tool.d.ts +117 -0
  307. package/dist/skills/tools/cron-tool.d.ts.map +1 -0
  308. package/dist/skills/tools/cron-tool.js +176 -0
  309. package/dist/skills/tools/cron-tool.js.map +1 -0
  310. package/dist/skills/tools/edit-tool.d.ts +44 -0
  311. package/dist/skills/tools/edit-tool.d.ts.map +1 -0
  312. package/dist/skills/tools/edit-tool.js +71 -0
  313. package/dist/skills/tools/edit-tool.js.map +1 -0
  314. package/dist/skills/tools/exec-tool.d.ts +103 -0
  315. package/dist/skills/tools/exec-tool.d.ts.map +1 -0
  316. package/dist/skills/tools/exec-tool.js +134 -0
  317. package/dist/skills/tools/exec-tool.js.map +1 -0
  318. package/dist/skills/tools/image-generate-tool.d.ts +63 -0
  319. package/dist/skills/tools/image-generate-tool.d.ts.map +1 -0
  320. package/dist/skills/tools/image-generate-tool.js +68 -0
  321. package/dist/skills/tools/image-generate-tool.js.map +1 -0
  322. package/dist/skills/tools/instructions-tool.d.ts +104 -0
  323. package/dist/skills/tools/instructions-tool.d.ts.map +1 -0
  324. package/dist/skills/tools/instructions-tool.js +188 -0
  325. package/dist/skills/tools/instructions-tool.js.map +1 -0
  326. package/dist/skills/tools/lsp-tool.d.ts +154 -0
  327. package/dist/skills/tools/lsp-tool.d.ts.map +1 -0
  328. package/dist/skills/tools/lsp-tool.js +228 -0
  329. package/dist/skills/tools/lsp-tool.js.map +1 -0
  330. package/dist/skills/tools/mcp-client-types.d.ts +270 -0
  331. package/dist/skills/tools/mcp-client-types.d.ts.map +1 -0
  332. package/dist/skills/tools/mcp-client-types.js +54 -0
  333. package/dist/skills/tools/mcp-client-types.js.map +1 -0
  334. package/dist/skills/tools/mcp-tool.d.ts +250 -0
  335. package/dist/skills/tools/mcp-tool.d.ts.map +1 -0
  336. package/dist/skills/tools/mcp-tool.js +504 -0
  337. package/dist/skills/tools/mcp-tool.js.map +1 -0
  338. package/dist/skills/tools/memory-tool.d.ts +75 -0
  339. package/dist/skills/tools/memory-tool.d.ts.map +1 -0
  340. package/dist/skills/tools/memory-tool.js +89 -0
  341. package/dist/skills/tools/memory-tool.js.map +1 -0
  342. package/dist/skills/tools/monitor-tool.d.ts +114 -0
  343. package/dist/skills/tools/monitor-tool.d.ts.map +1 -0
  344. package/dist/skills/tools/monitor-tool.js +132 -0
  345. package/dist/skills/tools/monitor-tool.js.map +1 -0
  346. package/dist/skills/tools/music-generate-tool.d.ts +56 -0
  347. package/dist/skills/tools/music-generate-tool.d.ts.map +1 -0
  348. package/dist/skills/tools/music-generate-tool.js +63 -0
  349. package/dist/skills/tools/music-generate-tool.js.map +1 -0
  350. package/dist/skills/tools/notify-tool.d.ts +54 -0
  351. package/dist/skills/tools/notify-tool.d.ts.map +1 -0
  352. package/dist/skills/tools/notify-tool.js +63 -0
  353. package/dist/skills/tools/notify-tool.js.map +1 -0
  354. package/dist/skills/tools/patch-tool.d.ts +46 -0
  355. package/dist/skills/tools/patch-tool.d.ts.map +1 -0
  356. package/dist/skills/tools/patch-tool.js +506 -0
  357. package/dist/skills/tools/patch-tool.js.map +1 -0
  358. package/dist/skills/tools/pdf-tool.d.ts +67 -0
  359. package/dist/skills/tools/pdf-tool.d.ts.map +1 -0
  360. package/dist/skills/tools/pdf-tool.js +89 -0
  361. package/dist/skills/tools/pdf-tool.js.map +1 -0
  362. package/dist/skills/tools/plan-mode-tool.d.ts +60 -0
  363. package/dist/skills/tools/plan-mode-tool.d.ts.map +1 -0
  364. package/dist/skills/tools/plan-mode-tool.js +123 -0
  365. package/dist/skills/tools/plan-mode-tool.js.map +1 -0
  366. package/dist/skills/tools/read-tool.d.ts +52 -0
  367. package/dist/skills/tools/read-tool.d.ts.map +1 -0
  368. package/dist/skills/tools/read-tool.js +85 -0
  369. package/dist/skills/tools/read-tool.js.map +1 -0
  370. package/dist/skills/tools/repl-tool.d.ts +71 -0
  371. package/dist/skills/tools/repl-tool.d.ts.map +1 -0
  372. package/dist/skills/tools/repl-tool.js +70 -0
  373. package/dist/skills/tools/repl-tool.js.map +1 -0
  374. package/dist/skills/tools/search-tool.d.ts +113 -0
  375. package/dist/skills/tools/search-tool.d.ts.map +1 -0
  376. package/dist/skills/tools/search-tool.js +226 -0
  377. package/dist/skills/tools/search-tool.js.map +1 -0
  378. package/dist/skills/tools/send-message-tool.d.ts +52 -0
  379. package/dist/skills/tools/send-message-tool.d.ts.map +1 -0
  380. package/dist/skills/tools/send-message-tool.js +77 -0
  381. package/dist/skills/tools/send-message-tool.js.map +1 -0
  382. package/dist/skills/tools/skill-list-tool.d.ts +34 -0
  383. package/dist/skills/tools/skill-list-tool.d.ts.map +1 -0
  384. package/dist/skills/tools/skill-list-tool.js +55 -0
  385. package/dist/skills/tools/skill-list-tool.js.map +1 -0
  386. package/dist/skills/tools/skill-manage-tool.d.ts +74 -0
  387. package/dist/skills/tools/skill-manage-tool.d.ts.map +1 -0
  388. package/dist/skills/tools/skill-manage-tool.js +154 -0
  389. package/dist/skills/tools/skill-manage-tool.js.map +1 -0
  390. package/dist/skills/tools/skill-view-tool.d.ts +38 -0
  391. package/dist/skills/tools/skill-view-tool.d.ts.map +1 -0
  392. package/dist/skills/tools/skill-view-tool.js +73 -0
  393. package/dist/skills/tools/skill-view-tool.js.map +1 -0
  394. package/dist/skills/tools/sleep-tool.d.ts +50 -0
  395. package/dist/skills/tools/sleep-tool.d.ts.map +1 -0
  396. package/dist/skills/tools/sleep-tool.js +82 -0
  397. package/dist/skills/tools/sleep-tool.js.map +1 -0
  398. package/dist/skills/tools/structured-output-tool.d.ts +117 -0
  399. package/dist/skills/tools/structured-output-tool.d.ts.map +1 -0
  400. package/dist/skills/tools/structured-output-tool.js +177 -0
  401. package/dist/skills/tools/structured-output-tool.js.map +1 -0
  402. package/dist/skills/tools/task-tool.d.ts +105 -0
  403. package/dist/skills/tools/task-tool.d.ts.map +1 -0
  404. package/dist/skills/tools/task-tool.js +162 -0
  405. package/dist/skills/tools/task-tool.js.map +1 -0
  406. package/dist/skills/tools/team-tool.d.ts +90 -0
  407. package/dist/skills/tools/team-tool.d.ts.map +1 -0
  408. package/dist/skills/tools/team-tool.js +106 -0
  409. package/dist/skills/tools/team-tool.js.map +1 -0
  410. package/dist/skills/tools/tool-search-tool.d.ts +52 -0
  411. package/dist/skills/tools/tool-search-tool.d.ts.map +1 -0
  412. package/dist/skills/tools/tool-search-tool.js +111 -0
  413. package/dist/skills/tools/tool-search-tool.js.map +1 -0
  414. package/dist/skills/tools/tts-tool.d.ts +39 -0
  415. package/dist/skills/tools/tts-tool.d.ts.map +1 -0
  416. package/dist/skills/tools/tts-tool.js +46 -0
  417. package/dist/skills/tools/tts-tool.js.map +1 -0
  418. package/dist/skills/tools/video-edit-tool.d.ts +70 -0
  419. package/dist/skills/tools/video-edit-tool.d.ts.map +1 -0
  420. package/dist/skills/tools/video-edit-tool.js +75 -0
  421. package/dist/skills/tools/video-edit-tool.js.map +1 -0
  422. package/dist/skills/tools/video-generate-tool.d.ts +63 -0
  423. package/dist/skills/tools/video-generate-tool.d.ts.map +1 -0
  424. package/dist/skills/tools/video-generate-tool.js +67 -0
  425. package/dist/skills/tools/video-generate-tool.js.map +1 -0
  426. package/dist/skills/tools/video-merge-tool.d.ts +106 -0
  427. package/dist/skills/tools/video-merge-tool.d.ts.map +1 -0
  428. package/dist/skills/tools/video-merge-tool.js +93 -0
  429. package/dist/skills/tools/video-merge-tool.js.map +1 -0
  430. package/dist/skills/tools/video-upscale-tool.d.ts +46 -0
  431. package/dist/skills/tools/video-upscale-tool.d.ts.map +1 -0
  432. package/dist/skills/tools/video-upscale-tool.js +53 -0
  433. package/dist/skills/tools/video-upscale-tool.js.map +1 -0
  434. package/dist/skills/tools/web-fetch-tool.d.ts +79 -0
  435. package/dist/skills/tools/web-fetch-tool.d.ts.map +1 -0
  436. package/dist/skills/tools/web-fetch-tool.js +93 -0
  437. package/dist/skills/tools/web-fetch-tool.js.map +1 -0
  438. package/dist/skills/tools/web-search-tool.d.ts +58 -0
  439. package/dist/skills/tools/web-search-tool.d.ts.map +1 -0
  440. package/dist/skills/tools/web-search-tool.js +87 -0
  441. package/dist/skills/tools/web-search-tool.js.map +1 -0
  442. package/dist/skills/tools/worktree-tool.d.ts +70 -0
  443. package/dist/skills/tools/worktree-tool.d.ts.map +1 -0
  444. package/dist/skills/tools/worktree-tool.js +148 -0
  445. package/dist/skills/tools/worktree-tool.js.map +1 -0
  446. package/dist/skills/tools/write-tool.d.ts +46 -0
  447. package/dist/skills/tools/write-tool.d.ts.map +1 -0
  448. package/dist/skills/tools/write-tool.js +82 -0
  449. package/dist/skills/tools/write-tool.js.map +1 -0
  450. package/package.json +41 -0
@@ -0,0 +1,103 @@
1
+ // ============================================================
2
+ // Checkpoint Manager — transparent file history snapshots.
3
+ // Reference: hermes-agent-main/tools/checkpoint_manager.py
4
+ // Category: infrastructure (LLM does NOT directly invoke)
5
+ // ============================================================
6
+ export const CHECKPOINT_TOOL_NAME = "checkpoint";
7
+ export const CHECKPOINT_TOOL_SCHEMA = {
8
+ type: "object",
9
+ properties: {
10
+ action: {
11
+ type: "string",
12
+ enum: ["create", "list", "restore", "diff"],
13
+ description: "Action: create (snapshot current state), list (show checkpoints), " +
14
+ "restore (revert to checkpoint), diff (show changes since checkpoint).",
15
+ },
16
+ checkpointId: {
17
+ type: "string",
18
+ description: "Checkpoint ID. Required for restore and diff.",
19
+ },
20
+ message: {
21
+ type: "string",
22
+ description: "Optional descriptive message for the checkpoint.",
23
+ },
24
+ paths: {
25
+ type: "array",
26
+ items: { type: "string" },
27
+ description: "File paths to restore (partial restore). Omit to restore everything.",
28
+ },
29
+ },
30
+ required: ["action"],
31
+ };
32
+ const COMMIT_HASH_PATTERN = /^[0-9a-fA-F]{4,64}$/;
33
+ export function createCheckpointTool(deps) {
34
+ return {
35
+ name: CHECKPOINT_TOOL_NAME,
36
+ label: "Checkpoint",
37
+ description: "Manage workspace checkpoints (shadow snapshots independent of user's git). " +
38
+ "Create snapshots before risky operations, list history, restore on errors, " +
39
+ "or diff to see what changed. Checkpoints do NOT affect user's .git.",
40
+ parameters: CHECKPOINT_TOOL_SCHEMA,
41
+ execute: async (_toolCallId, params) => {
42
+ switch (params.action) {
43
+ case "create": {
44
+ const r = await deps.createCheckpoint(params.message);
45
+ if (!r.success) {
46
+ return { content: [{ type: "text", text: `Error: ${r.error}` }], details: { type: "checkpoint", error: r.error } };
47
+ }
48
+ return {
49
+ content: [{ type: "text", text: `Checkpoint created: ${r.checkpoint.id}\nMessage: ${r.checkpoint.message}\nFiles: ${r.checkpoint.fileCount}` }],
50
+ details: { type: "checkpoint", action: "create", checkpointId: r.checkpoint.id },
51
+ };
52
+ }
53
+ case "list": {
54
+ const r = await deps.listCheckpoints();
55
+ if (!r.checkpoints || r.checkpoints.length === 0) {
56
+ return { content: [{ type: "text", text: "No checkpoints available." }], details: { type: "checkpoint", action: "list", count: 0 } };
57
+ }
58
+ const lines = [`Checkpoints (${r.checkpoints.length}):`, ""];
59
+ for (const cp of r.checkpoints) {
60
+ lines.push(`- ${cp.id.slice(0, 8)} [${cp.timestamp}] ${cp.message} (${cp.fileCount} files)`);
61
+ }
62
+ return { content: [{ type: "text", text: lines.join("\n") }], details: { type: "checkpoint", action: "list", count: r.checkpoints.length } };
63
+ }
64
+ case "restore": {
65
+ if (!params.checkpointId) {
66
+ return { content: [{ type: "text", text: "Error: checkpointId required for restore." }], details: { type: "checkpoint", error: "missing_id" } };
67
+ }
68
+ if (!COMMIT_HASH_PATTERN.test(params.checkpointId)) {
69
+ return { content: [{ type: "text", text: "Error: invalid checkpoint ID format." }], details: { type: "checkpoint", error: "invalid_id" } };
70
+ }
71
+ const r = await deps.restoreCheckpoint(params.checkpointId, params.paths);
72
+ if (!r.success) {
73
+ return { content: [{ type: "text", text: `Error: ${r.error}` }], details: { type: "checkpoint", error: r.error } };
74
+ }
75
+ const scope = params.paths ? `(${params.paths.length} files)` : "(full workspace)";
76
+ return {
77
+ content: [{ type: "text", text: `Restored to checkpoint ${params.checkpointId.slice(0, 8)} ${scope}` }],
78
+ details: { type: "checkpoint", action: "restore", checkpointId: params.checkpointId },
79
+ };
80
+ }
81
+ case "diff": {
82
+ if (!params.checkpointId) {
83
+ return { content: [{ type: "text", text: "Error: checkpointId required for diff." }], details: { type: "checkpoint", error: "missing_id" } };
84
+ }
85
+ if (!COMMIT_HASH_PATTERN.test(params.checkpointId)) {
86
+ return { content: [{ type: "text", text: "Error: invalid checkpoint ID format." }], details: { type: "checkpoint", error: "invalid_id" } };
87
+ }
88
+ const r = await deps.diffCheckpoint(params.checkpointId);
89
+ if (!r.success) {
90
+ return { content: [{ type: "text", text: `Error: ${r.error}` }], details: { type: "checkpoint", error: r.error } };
91
+ }
92
+ return {
93
+ content: [{ type: "text", text: r.diff || "(no changes since checkpoint)" }],
94
+ details: { type: "checkpoint", action: "diff", checkpointId: params.checkpointId },
95
+ };
96
+ }
97
+ default:
98
+ return { content: [{ type: "text", text: `Error: unknown action "${params.action}".` }], details: { type: "checkpoint", error: "unknown_action" } };
99
+ }
100
+ },
101
+ };
102
+ }
103
+ //# sourceMappingURL=checkpoint-tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkpoint-tool.js","sourceRoot":"","sources":["../../../src/skills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C,CAAC;oBACzD,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;wBACf,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC;oBACrH,CAAC;oBACD,OAAO;wBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,IAAI,+BAA+B,EAAE,CAAC;wBAC5E,OAAO,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE;qBACnF,CAAC;gBACJ,CAAC;gBAED;oBACE,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,0BAA0B,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,CAAC;YACxJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,64 @@
1
+ import type { PortableTool } from "../portable-tool.js";
2
+ export declare const CONFIG_TOOL_NAME: "config";
3
+ export type ConfigAction = "get" | "set" | "list" | "reset";
4
+ export interface ConfigToolParams {
5
+ /** Config action */
6
+ action: ConfigAction;
7
+ /** Setting key path (e.g. "model", "language", "theme") */
8
+ key?: string;
9
+ /** Value to set (for 'set' action) */
10
+ value?: string | boolean | number;
11
+ }
12
+ export declare const CONFIG_TOOL_SCHEMA: {
13
+ readonly type: "object";
14
+ readonly properties: {
15
+ readonly action: {
16
+ readonly type: "string";
17
+ readonly enum: readonly ["get", "set", "list", "reset"];
18
+ readonly description: string;
19
+ };
20
+ readonly key: {
21
+ readonly type: "string";
22
+ readonly description: string;
23
+ };
24
+ readonly value: {
25
+ readonly description: "Value to set. Type depends on the setting. Required for 'set' action.";
26
+ };
27
+ };
28
+ readonly required: readonly ["action"];
29
+ };
30
+ export interface ConfigSetting {
31
+ key: string;
32
+ value: unknown;
33
+ type: "string" | "boolean" | "number" | "enum";
34
+ description: string;
35
+ options?: string[];
36
+ readOnly?: boolean;
37
+ }
38
+ export interface ConfigResult {
39
+ success: boolean;
40
+ setting?: ConfigSetting;
41
+ settings?: ConfigSetting[];
42
+ previousValue?: unknown;
43
+ error?: string;
44
+ }
45
+ /** Keys that cannot be modified by LLM (security-critical) */
46
+ export declare const CONFIG_READONLY_KEYS: readonly string[];
47
+ /**
48
+ * Host-provided config backend.
49
+ * Manages persistent agent settings with safety guardrails.
50
+ */
51
+ export interface ConfigToolDeps {
52
+ /** Get a single config value */
53
+ getConfig(key: string): Promise<ConfigResult>;
54
+ /** Set a config value (respects readonly/whitelist) */
55
+ setConfig(key: string, value: unknown): Promise<ConfigResult>;
56
+ /** List all available config settings */
57
+ listConfig(): Promise<ConfigResult>;
58
+ /** Reset a setting to default */
59
+ resetConfig(key: string): Promise<ConfigResult>;
60
+ /** Check if a key is supported/valid */
61
+ isValidKey?(key: string): boolean;
62
+ }
63
+ export declare function createConfigTool(deps: ConfigToolDeps): PortableTool<ConfigToolParams>;
64
+ //# sourceMappingURL=config-tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-tool.d.ts","sourceRoot":"","sources":["../../../src/skills/tools/config-tool.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAsB,MAAM,qBAAqB,CAAC;AAE5E,eAAO,MAAM,gBAAgB,EAAG,QAAiB,CAAC;AAElD,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC;AAE5D,MAAM,WAAW,gBAAgB;IAC/B,oBAAoB;IACpB,MAAM,EAAE,YAA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B,gBAAgB,CAAC,IAAI,EAAE,cAAc,GAAG,YAAY,CAAC,gBAAgB,CAAC,CA8GrF"}
@@ -0,0 +1,144 @@
1
+ // ============================================================
2
+ // Config Tool — agent configuration management (read/write preferences).
3
+ // Reference: claude-code-haha/src/tools/ConfigTool/ConfigTool.ts
4
+ // Category: system
5
+ // ============================================================
6
+ export const CONFIG_TOOL_NAME = "config";
7
+ export const CONFIG_TOOL_SCHEMA = {
8
+ type: "object",
9
+ properties: {
10
+ action: {
11
+ type: "string",
12
+ enum: ["get", "set", "list", "reset"],
13
+ description: "Action:\n" +
14
+ "- get: Read a config setting\n" +
15
+ "- set: Write a config setting\n" +
16
+ "- list: List all available settings\n" +
17
+ "- reset: Reset a setting to default",
18
+ },
19
+ key: {
20
+ type: "string",
21
+ description: "Config key path (e.g. 'model', 'language', 'theme', 'permissions.defaultMode'). " +
22
+ "Required for get/set/reset.",
23
+ },
24
+ value: {
25
+ description: "Value to set. Type depends on the setting. Required for 'set' action.",
26
+ },
27
+ },
28
+ required: ["action"],
29
+ };
30
+ /** Keys that cannot be modified by LLM (security-critical) */
31
+ export const CONFIG_READONLY_KEYS = [
32
+ "permissions.securityPolicy",
33
+ "api.key",
34
+ "api.secret",
35
+ "auth.token",
36
+ "system.adminMode",
37
+ ];
38
+ export function createConfigTool(deps) {
39
+ return {
40
+ name: CONFIG_TOOL_NAME,
41
+ label: "Config",
42
+ description: "Read and write agent configuration settings. " +
43
+ "Supports preferences like model selection, language, theme, tool enablement, etc. " +
44
+ "Security-critical settings (API keys, permissions) are read-only. " +
45
+ "Changes persist across sessions.",
46
+ parameters: CONFIG_TOOL_SCHEMA,
47
+ execute: async (_toolCallId, params) => {
48
+ switch (params.action) {
49
+ case "get": {
50
+ if (!params.key) {
51
+ return { content: [{ type: "text", text: "Error: key is required for get." }], details: { type: "config", error: "missing_key" } };
52
+ }
53
+ if (deps.isValidKey && !deps.isValidKey(params.key)) {
54
+ return { content: [{ type: "text", text: `Error: unknown config key "${params.key}". Use action='list' to see available settings.` }], details: { type: "config", error: "unknown_key" } };
55
+ }
56
+ const result = await deps.getConfig(params.key);
57
+ if (!result.success) {
58
+ return { content: [{ type: "text", text: `Error: ${result.error}` }], details: { type: "config", error: result.error } };
59
+ }
60
+ const s = result.setting;
61
+ const lines = [
62
+ `${s.key} = ${JSON.stringify(s.value)}`,
63
+ ` Type: ${s.type}${s.options ? ` (${s.options.join(" | ")})` : ""}`,
64
+ ` ${s.description}`,
65
+ ];
66
+ if (s.readOnly)
67
+ lines.push(" ⚠️ Read-only (cannot be changed)");
68
+ return {
69
+ content: [{ type: "text", text: lines.join("\n") }],
70
+ details: { type: "config", action: "get", key: params.key, value: s.value },
71
+ };
72
+ }
73
+ case "set": {
74
+ if (!params.key) {
75
+ return { content: [{ type: "text", text: "Error: key is required for set." }], details: { type: "config", error: "missing_key" } };
76
+ }
77
+ if (params.value === undefined) {
78
+ return { content: [{ type: "text", text: "Error: value is required for set." }], details: { type: "config", error: "missing_value" } };
79
+ }
80
+ // Block security-critical keys
81
+ if (CONFIG_READONLY_KEYS.includes(params.key)) {
82
+ return {
83
+ content: [{ type: "text", text: `Error: "${params.key}" is a security-critical setting and cannot be modified.` }],
84
+ details: { type: "config", error: "readonly_key" },
85
+ };
86
+ }
87
+ if (deps.isValidKey && !deps.isValidKey(params.key)) {
88
+ return { content: [{ type: "text", text: `Error: unknown config key "${params.key}".` }], details: { type: "config", error: "unknown_key" } };
89
+ }
90
+ const result = await deps.setConfig(params.key, params.value);
91
+ if (!result.success) {
92
+ return { content: [{ type: "text", text: `Error: ${result.error}` }], details: { type: "config", error: result.error } };
93
+ }
94
+ return {
95
+ content: [{ type: "text", text: `Updated "${params.key}": ${JSON.stringify(result.previousValue)} → ${JSON.stringify(params.value)}` }],
96
+ details: { type: "config", action: "set", key: params.key, previousValue: result.previousValue, newValue: params.value },
97
+ };
98
+ }
99
+ case "list": {
100
+ const result = await deps.listConfig();
101
+ if (!result.settings || result.settings.length === 0) {
102
+ return { content: [{ type: "text", text: "No config settings available." }], details: { type: "config", action: "list", count: 0 } };
103
+ }
104
+ const lines = [`Available settings (${result.settings.length}):`, ""];
105
+ for (const s of result.settings) {
106
+ const ro = s.readOnly ? " [read-only]" : "";
107
+ const val = JSON.stringify(s.value);
108
+ lines.push(` ${s.key} = ${val}${ro}`);
109
+ lines.push(` ${s.description}`);
110
+ }
111
+ return {
112
+ content: [{ type: "text", text: lines.join("\n") }],
113
+ details: { type: "config", action: "list", count: result.settings.length },
114
+ };
115
+ }
116
+ case "reset": {
117
+ if (!params.key) {
118
+ return { content: [{ type: "text", text: "Error: key is required for reset." }], details: { type: "config", error: "missing_key" } };
119
+ }
120
+ if (CONFIG_READONLY_KEYS.includes(params.key)) {
121
+ return {
122
+ content: [{ type: "text", text: `Error: "${params.key}" cannot be reset (security-critical).` }],
123
+ details: { type: "config", error: "readonly_key" },
124
+ };
125
+ }
126
+ const result = await deps.resetConfig(params.key);
127
+ if (!result.success) {
128
+ return { content: [{ type: "text", text: `Error: ${result.error}` }], details: { type: "config", error: result.error } };
129
+ }
130
+ return {
131
+ content: [{ type: "text", text: `Reset "${params.key}" to default: ${JSON.stringify(result.setting?.value)}` }],
132
+ details: { type: "config", action: "reset", key: params.key, value: result.setting?.value },
133
+ };
134
+ }
135
+ default:
136
+ return {
137
+ content: [{ type: "text", text: `Error: unknown action "${params.action}".` }],
138
+ details: { type: "config", error: "unknown_action" },
139
+ };
140
+ }
141
+ },
142
+ };
143
+ }
144
+ //# sourceMappingURL=config-tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-tool.js","sourceRoot":"","sources":["../../../src/skills/tools/config-tool.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,yEAAyE;AACzE,iEAAiE;AACjE,mBAAmB;AACnB,+DAA+D;AAI/D,MAAM,CAAC,MAAM,gBAAgB,GAAG,QAAiB,CAAC;AAalD,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,QAAiB;IACv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H,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,117 @@
1
+ import type { PortableTool } from "../portable-tool.js";
2
+ export declare const CRON_TOOL_NAME: "cron";
3
+ export type CronAction = "create" | "list" | "get" | "update" | "delete" | "pause" | "resume" | "trigger";
4
+ export interface CronToolParams {
5
+ action: CronAction;
6
+ /** Job ID (required for get/update/delete/pause/resume/trigger) */
7
+ jobId?: string;
8
+ /** Task prompt to execute on schedule */
9
+ prompt?: string;
10
+ /** Cron expression or shorthand ('5m', '1h', '0 9 * * *') */
11
+ schedule?: string;
12
+ /** Human-readable job name */
13
+ name?: string;
14
+ /** Repeat count (null = infinite) */
15
+ repeat?: number | null;
16
+ /** Allowed tools for the scheduled task */
17
+ allowedTools?: string[];
18
+ /** Whether the job is enabled */
19
+ enabled?: boolean;
20
+ }
21
+ export declare const CRON_TOOL_SCHEMA: {
22
+ readonly type: "object";
23
+ readonly properties: {
24
+ readonly action: {
25
+ readonly type: "string";
26
+ readonly enum: readonly ["create", "list", "get", "update", "delete", "pause", "resume", "trigger"];
27
+ readonly description: "CRUD action: create/list/get/update/delete/pause/resume/trigger.";
28
+ };
29
+ readonly jobId: {
30
+ readonly type: "string";
31
+ readonly description: "Job ID. Required for get/update/delete/pause/resume/trigger.";
32
+ };
33
+ readonly prompt: {
34
+ readonly type: "string";
35
+ readonly description: "Task prompt to execute on schedule. Required for create.";
36
+ };
37
+ readonly schedule: {
38
+ readonly type: "string";
39
+ readonly description: string;
40
+ };
41
+ readonly name: {
42
+ readonly type: "string";
43
+ readonly description: "Human-readable job name.";
44
+ };
45
+ readonly repeat: {
46
+ readonly type: "number";
47
+ readonly description: "Number of times to repeat (null = infinite). Default: null.";
48
+ };
49
+ readonly allowedTools: {
50
+ readonly type: "array";
51
+ readonly items: {
52
+ readonly type: "string";
53
+ };
54
+ readonly description: "Tools the scheduled task is allowed to use.";
55
+ };
56
+ readonly enabled: {
57
+ readonly type: "boolean";
58
+ readonly description: "Whether the job is enabled (for update).";
59
+ };
60
+ };
61
+ readonly required: readonly ["action"];
62
+ };
63
+ export interface CronJob {
64
+ id: string;
65
+ name: string;
66
+ prompt: string;
67
+ schedule: string;
68
+ scheduleDisplay: string;
69
+ state: "scheduled" | "paused";
70
+ enabled: boolean;
71
+ repeat: {
72
+ times: number | null;
73
+ completed: number;
74
+ };
75
+ nextRunAt?: string;
76
+ lastRunAt?: string;
77
+ lastStatus?: "success" | "error" | null;
78
+ allowedTools?: string[];
79
+ }
80
+ export interface CronResult {
81
+ success: boolean;
82
+ job?: CronJob;
83
+ jobs?: CronJob[];
84
+ error?: string;
85
+ }
86
+ /**
87
+ * Host-provided cron scheduler backend.
88
+ * Jobs are persisted locally and survive restarts.
89
+ */
90
+ export interface CronToolDeps {
91
+ createJob(params: {
92
+ prompt: string;
93
+ schedule: string;
94
+ name?: string;
95
+ repeat?: number | null;
96
+ allowedTools?: string[];
97
+ }): Promise<CronResult>;
98
+ listJobs(): Promise<CronResult>;
99
+ getJob(jobId: string): Promise<CronResult>;
100
+ updateJob(jobId: string, updates: Partial<{
101
+ prompt: string;
102
+ schedule: string;
103
+ name: string;
104
+ enabled: boolean;
105
+ repeat: number | null;
106
+ allowedTools: string[];
107
+ }>): Promise<CronResult>;
108
+ deleteJob(jobId: string): Promise<CronResult>;
109
+ pauseJob(jobId: string): Promise<CronResult>;
110
+ resumeJob(jobId: string): Promise<CronResult>;
111
+ triggerJob(jobId: string): Promise<CronResult>;
112
+ /** Validate cron schedule expression. Returns error or null. */
113
+ validateSchedule?(schedule: string): string | null;
114
+ }
115
+ export declare const MAX_CRON_JOBS = 50;
116
+ export declare function createCronTool(deps: CronToolDeps): PortableTool<CronToolParams>;
117
+ //# sourceMappingURL=cron-tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cron-tool.d.ts","sourceRoot":"","sources":["../../../src/skills/tools/cron-tool.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAsB,MAAM,qBAAqB,CAAC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AC,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;CACpD;AAED,eAAO,MAAM,aAAa,KAAK,CAAC;AAEhC,wBAAgB,cAAc,CAAC,IAAI,EAAE,YAAY,GAAG,YAAY,CAAC,cAAc,CAAC,CAmG/E"}
@@ -0,0 +1,176 @@
1
+ // ============================================================
2
+ // Cron Tool — scheduled task management (CRUD).
3
+ // Reference: hermes-agent-main/tools/cronjob_tools.py
4
+ // Category: system
5
+ // ============================================================
6
+ export const CRON_TOOL_NAME = "cron";
7
+ export const CRON_TOOL_SCHEMA = {
8
+ type: "object",
9
+ properties: {
10
+ action: {
11
+ type: "string",
12
+ enum: ["create", "list", "get", "update", "delete", "pause", "resume", "trigger"],
13
+ description: "CRUD action: create/list/get/update/delete/pause/resume/trigger.",
14
+ },
15
+ jobId: {
16
+ type: "string",
17
+ description: "Job ID. Required for get/update/delete/pause/resume/trigger.",
18
+ },
19
+ prompt: {
20
+ type: "string",
21
+ description: "Task prompt to execute on schedule. Required for create.",
22
+ },
23
+ schedule: {
24
+ type: "string",
25
+ description: "Schedule expression. Supports:\n" +
26
+ "- Cron: '0 9 * * *' (every day at 9am)\n" +
27
+ "- Shorthand: '5m' (every 5 min), '1h' (hourly), '1d' (daily)\n" +
28
+ "Required for create.",
29
+ },
30
+ name: {
31
+ type: "string",
32
+ description: "Human-readable job name.",
33
+ },
34
+ repeat: {
35
+ type: "number",
36
+ description: "Number of times to repeat (null = infinite). Default: null.",
37
+ },
38
+ allowedTools: {
39
+ type: "array",
40
+ items: { type: "string" },
41
+ description: "Tools the scheduled task is allowed to use.",
42
+ },
43
+ enabled: {
44
+ type: "boolean",
45
+ description: "Whether the job is enabled (for update).",
46
+ },
47
+ },
48
+ required: ["action"],
49
+ };
50
+ export const MAX_CRON_JOBS = 50;
51
+ export function createCronTool(deps) {
52
+ return {
53
+ name: CRON_TOOL_NAME,
54
+ label: "Cron",
55
+ description: "Manage scheduled tasks. Create recurring jobs with cron expressions or shorthand " +
56
+ "('5m', '1h', '0 9 * * *'). Jobs persist locally and survive restarts. " +
57
+ "Actions: create, list, get, update, delete, pause, resume, trigger (run now).",
58
+ parameters: CRON_TOOL_SCHEMA,
59
+ execute: async (_toolCallId, params) => {
60
+ switch (params.action) {
61
+ case "create": {
62
+ if (!params.prompt) {
63
+ return { content: [{ type: "text", text: "Error: prompt is required for create." }], details: { type: "cron", error: "missing_prompt" } };
64
+ }
65
+ if (!params.schedule) {
66
+ return { content: [{ type: "text", text: "Error: schedule is required for create." }], details: { type: "cron", error: "missing_schedule" } };
67
+ }
68
+ if (deps.validateSchedule) {
69
+ const err = deps.validateSchedule(params.schedule);
70
+ if (err)
71
+ return { content: [{ type: "text", text: `Error: invalid schedule — ${err}` }], details: { type: "cron", error: "invalid_schedule" } };
72
+ }
73
+ // Check max jobs limit
74
+ const existing = await deps.listJobs();
75
+ if (existing.jobs && existing.jobs.length >= MAX_CRON_JOBS) {
76
+ return { content: [{ type: "text", text: `Error: maximum ${MAX_CRON_JOBS} jobs reached. Delete unused jobs first.` }], details: { type: "cron", error: "max_jobs_reached" } };
77
+ }
78
+ const r = await deps.createJob({ prompt: params.prompt, schedule: params.schedule, name: params.name, repeat: params.repeat, allowedTools: params.allowedTools });
79
+ if (!r.success)
80
+ return { content: [{ type: "text", text: `Error: ${r.error}` }], details: { type: "cron", error: r.error } };
81
+ return { content: [{ type: "text", text: formatJob(r.job) }], details: { type: "cron", action: "create", jobId: r.job.id } };
82
+ }
83
+ case "list": {
84
+ const r = await deps.listJobs();
85
+ if (!r.jobs || r.jobs.length === 0) {
86
+ return { content: [{ type: "text", text: "No scheduled jobs." }], details: { type: "cron", action: "list", count: 0 } };
87
+ }
88
+ const lines = [`Scheduled jobs (${r.jobs.length}):`, ""];
89
+ for (const j of r.jobs) {
90
+ lines.push(`- **${j.name || j.id}** [${j.state}] ${j.scheduleDisplay} — next: ${j.nextRunAt || "N/A"}`);
91
+ }
92
+ return { content: [{ type: "text", text: lines.join("\n") }], details: { type: "cron", action: "list", count: r.jobs.length } };
93
+ }
94
+ case "get": {
95
+ if (!params.jobId)
96
+ return { content: [{ type: "text", text: "Error: jobId required." }], details: { type: "cron", error: "missing_jobId" } };
97
+ const r = await deps.getJob(params.jobId);
98
+ if (!r.success)
99
+ return { content: [{ type: "text", text: `Error: ${r.error}` }], details: { type: "cron", error: r.error } };
100
+ return { content: [{ type: "text", text: formatJob(r.job) }], details: { type: "cron", action: "get", jobId: params.jobId } };
101
+ }
102
+ case "update": {
103
+ if (!params.jobId)
104
+ return { content: [{ type: "text", text: "Error: jobId required." }], details: { type: "cron", error: "missing_jobId" } };
105
+ const updates = {};
106
+ if (params.prompt !== undefined)
107
+ updates.prompt = params.prompt;
108
+ if (params.schedule !== undefined)
109
+ updates.schedule = params.schedule;
110
+ if (params.name !== undefined)
111
+ updates.name = params.name;
112
+ if (params.enabled !== undefined)
113
+ updates.enabled = params.enabled;
114
+ if (params.repeat !== undefined)
115
+ updates.repeat = params.repeat;
116
+ if (params.allowedTools !== undefined)
117
+ updates.allowedTools = params.allowedTools;
118
+ const r = await deps.updateJob(params.jobId, updates);
119
+ if (!r.success)
120
+ return { content: [{ type: "text", text: `Error: ${r.error}` }], details: { type: "cron", error: r.error } };
121
+ return { content: [{ type: "text", text: `Job updated.\n${formatJob(r.job)}` }], details: { type: "cron", action: "update", jobId: params.jobId } };
122
+ }
123
+ case "delete": {
124
+ if (!params.jobId)
125
+ return { content: [{ type: "text", text: "Error: jobId required." }], details: { type: "cron", error: "missing_jobId" } };
126
+ const r = await deps.deleteJob(params.jobId);
127
+ if (!r.success)
128
+ return { content: [{ type: "text", text: `Error: ${r.error}` }], details: { type: "cron", error: r.error } };
129
+ return { content: [{ type: "text", text: `Job ${params.jobId} deleted.` }], details: { type: "cron", action: "delete", jobId: params.jobId } };
130
+ }
131
+ case "pause": {
132
+ if (!params.jobId)
133
+ return { content: [{ type: "text", text: "Error: jobId required." }], details: { type: "cron", error: "missing_jobId" } };
134
+ const r = await deps.pauseJob(params.jobId);
135
+ if (!r.success)
136
+ return { content: [{ type: "text", text: `Error: ${r.error}` }], details: { type: "cron", error: r.error } };
137
+ return { content: [{ type: "text", text: `Job ${params.jobId} paused.` }], details: { type: "cron", action: "pause", jobId: params.jobId } };
138
+ }
139
+ case "resume": {
140
+ if (!params.jobId)
141
+ return { content: [{ type: "text", text: "Error: jobId required." }], details: { type: "cron", error: "missing_jobId" } };
142
+ const r = await deps.resumeJob(params.jobId);
143
+ if (!r.success)
144
+ return { content: [{ type: "text", text: `Error: ${r.error}` }], details: { type: "cron", error: r.error } };
145
+ return { content: [{ type: "text", text: `Job ${params.jobId} resumed.` }], details: { type: "cron", action: "resume", jobId: params.jobId } };
146
+ }
147
+ case "trigger": {
148
+ if (!params.jobId)
149
+ return { content: [{ type: "text", text: "Error: jobId required." }], details: { type: "cron", error: "missing_jobId" } };
150
+ const r = await deps.triggerJob(params.jobId);
151
+ if (!r.success)
152
+ return { content: [{ type: "text", text: `Error: ${r.error}` }], details: { type: "cron", error: r.error } };
153
+ return { content: [{ type: "text", text: `Job ${params.jobId} triggered (running now).` }], details: { type: "cron", action: "trigger", jobId: params.jobId } };
154
+ }
155
+ default:
156
+ return { content: [{ type: "text", text: `Error: unknown action "${params.action}".` }], details: { type: "cron", error: "unknown_action" } };
157
+ }
158
+ },
159
+ };
160
+ }
161
+ function formatJob(job) {
162
+ const lines = [
163
+ `Job: ${job.name || job.id}`,
164
+ `ID: ${job.id}`,
165
+ `Schedule: ${job.scheduleDisplay} (${job.schedule})`,
166
+ `State: ${job.state}`,
167
+ `Repeat: ${job.repeat.times === null ? "infinite" : `${job.repeat.completed}/${job.repeat.times}`}`,
168
+ ];
169
+ if (job.nextRunAt)
170
+ lines.push(`Next run: ${job.nextRunAt}`);
171
+ if (job.lastRunAt)
172
+ lines.push(`Last run: ${job.lastRunAt} (${job.lastStatus || "unknown"})`);
173
+ lines.push(`Prompt: ${job.prompt.slice(0, 100)}${job.prompt.length > 100 ? "..." : ""}`);
174
+ return lines.join("\n");
175
+ }
176
+ //# sourceMappingURL=cron-tool.js.map