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 @@
1
+ {"version":3,"file":"instructions-tool.d.ts","sourceRoot":"","sources":["../../../src/skills/tools/instructions-tool.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,YAAY,EAAsB,MAAM,qBAAqB,CAAC;AAI5E,uCAAuC;AACvC,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,4CAA4C;AAC5C,M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MAAM,yBAAyB;;;;;;;;;;;;;;;;;CAkB5B,CAAC;AAEX,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,oBAAoB,GAAG,YAAY,CAAC,uBAAuB,CAAC,CAkC7G;AAID,eAAO,MAAM,6BAA6B,EAAG,qBAA8B,CAAC;AAE5E,MAAM,WAAW,wBAAwB;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;CAa7B,CAAC;AAEX,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,oBAAoB,GAAG,YAAY,CAAC,wBAAwB,CAAC,CA+B/G"}
@@ -0,0 +1,188 @@
1
+ // ============================================================
2
+ // Instructions Tool — CRUD for project instruction files (.md).
3
+ //
4
+ // Runtime-agnostic: the actual file I/O is injected via deps.
5
+ // Gateway provides InstructionsModule; Hub provides HTTP client;
6
+ // Electron provides IPC bridge.
7
+ //
8
+ // Category: project-management
9
+ // ============================================================
10
+ // ── instructions_list ───────────────────────────────────────
11
+ export const INSTRUCTIONS_LIST_TOOL_NAME = "instructions_list";
12
+ export const INSTRUCTIONS_LIST_SCHEMA = {
13
+ type: "object",
14
+ properties: {
15
+ project_id: {
16
+ type: "string",
17
+ description: 'Project ID to list instructions for. Use "default" for the default project.',
18
+ },
19
+ },
20
+ required: ["project_id"],
21
+ };
22
+ export function createInstructionsListTool(deps) {
23
+ return {
24
+ name: INSTRUCTIONS_LIST_TOOL_NAME,
25
+ label: "List Instructions",
26
+ description: "List all instruction files (.md) in a project's .instructions/ directory. " +
27
+ "Instructions define agent behavior rules, coding standards, and project context. " +
28
+ "Returns filename, path, size, and last modified time for each file.",
29
+ parameters: INSTRUCTIONS_LIST_SCHEMA,
30
+ isReadOnly: true,
31
+ isConcurrencySafe: true,
32
+ searchHint: "list project instructions rules coding standards behavior guidelines",
33
+ execute: async (_toolCallId, params) => {
34
+ const files = deps.list(params.project_id);
35
+ if (files.length === 0) {
36
+ return {
37
+ content: [{ type: "text", text: "No instruction files found for this project." }],
38
+ details: { projectId: params.project_id, count: 0 },
39
+ };
40
+ }
41
+ const listing = files
42
+ .map((f) => `- ${f.filename} (${f.size} bytes, updated ${f.updatedAt})`)
43
+ .join("\n");
44
+ return {
45
+ content: [{ type: "text", text: `Found ${files.length} instruction file(s):\n${listing}` }],
46
+ details: { projectId: params.project_id, count: files.length, files },
47
+ };
48
+ },
49
+ };
50
+ }
51
+ // ── instructions_read ───────────────────────────────────────
52
+ export const INSTRUCTIONS_READ_TOOL_NAME = "instructions_read";
53
+ export const INSTRUCTIONS_READ_SCHEMA = {
54
+ type: "object",
55
+ properties: {
56
+ project_id: {
57
+ type: "string",
58
+ description: 'Project ID. Use "default" for the default project.',
59
+ },
60
+ filename: {
61
+ type: "string",
62
+ description: 'Instruction file name (e.g. "code-style.md"). Supports sub-paths like "testing/unit-test.md".',
63
+ },
64
+ },
65
+ required: ["project_id", "filename"],
66
+ };
67
+ export function createInstructionsReadTool(deps) {
68
+ return {
69
+ name: INSTRUCTIONS_READ_TOOL_NAME,
70
+ label: "Read Instruction",
71
+ description: "Read the content of a specific instruction file (.md) from a project. " +
72
+ "Use instructions_list first to discover available files.",
73
+ parameters: INSTRUCTIONS_READ_SCHEMA,
74
+ isReadOnly: true,
75
+ isConcurrencySafe: true,
76
+ searchHint: "read instruction file content rules coding standard",
77
+ execute: async (_toolCallId, params) => {
78
+ const file = deps.read(params.project_id, params.filename);
79
+ if (!file) {
80
+ return {
81
+ content: [{ type: "text", text: `Instruction file not found: ${params.filename}` }],
82
+ details: { projectId: params.project_id, filename: params.filename, error: "not_found" },
83
+ };
84
+ }
85
+ return {
86
+ content: [{ type: "text", text: file.content }],
87
+ details: { projectId: params.project_id, filename: file.filename, size: file.size },
88
+ };
89
+ },
90
+ };
91
+ }
92
+ // ── instructions_write ──────────────────────────────────────
93
+ export const INSTRUCTIONS_WRITE_TOOL_NAME = "instructions_write";
94
+ export const INSTRUCTIONS_WRITE_SCHEMA = {
95
+ type: "object",
96
+ properties: {
97
+ project_id: {
98
+ type: "string",
99
+ description: 'Project ID. Use "default" for the default project.',
100
+ },
101
+ filename: {
102
+ type: "string",
103
+ description: 'Instruction file name ending in .md (e.g. "code-style.md"). Sub-paths like "testing/unit-test.md" are supported.',
104
+ },
105
+ content: {
106
+ type: "string",
107
+ description: "Markdown content for the instruction file.",
108
+ },
109
+ },
110
+ required: ["project_id", "filename", "content"],
111
+ };
112
+ export function createInstructionsWriteTool(deps) {
113
+ return {
114
+ name: INSTRUCTIONS_WRITE_TOOL_NAME,
115
+ label: "Write Instruction",
116
+ description: "Create or overwrite an instruction file (.md) in a project. " +
117
+ "Instructions define agent behavior rules, coding standards, and project context. " +
118
+ "The file must end in .md. Sub-directories are created automatically.",
119
+ parameters: INSTRUCTIONS_WRITE_SCHEMA,
120
+ searchHint: "write create instruction file rules coding standard",
121
+ execute: async (_toolCallId, params) => {
122
+ if (!params.filename.endsWith(".md")) {
123
+ return {
124
+ content: [{ type: "text", text: "Filename must end with .md" }],
125
+ details: { error: "invalid_filename" },
126
+ };
127
+ }
128
+ if (params.filename.includes("..")) {
129
+ return {
130
+ content: [{ type: "text", text: "Path traversal not allowed" }],
131
+ details: { error: "path_traversal" },
132
+ };
133
+ }
134
+ const file = deps.write(params.project_id, params.filename, params.content);
135
+ return {
136
+ content: [
137
+ { type: "text", text: `Instruction file written: ${file.filename} (${file.size} bytes)` },
138
+ ],
139
+ details: { projectId: params.project_id, filename: file.filename, size: file.size },
140
+ };
141
+ },
142
+ };
143
+ }
144
+ // ── instructions_delete ─────────────────────────────────────
145
+ export const INSTRUCTIONS_DELETE_TOOL_NAME = "instructions_delete";
146
+ export const INSTRUCTIONS_DELETE_SCHEMA = {
147
+ type: "object",
148
+ properties: {
149
+ project_id: {
150
+ type: "string",
151
+ description: 'Project ID. Use "default" for the default project.',
152
+ },
153
+ filename: {
154
+ type: "string",
155
+ description: "Instruction file name to delete (e.g. \"code-style.md\").",
156
+ },
157
+ },
158
+ required: ["project_id", "filename"],
159
+ };
160
+ export function createInstructionsDeleteTool(deps) {
161
+ return {
162
+ name: INSTRUCTIONS_DELETE_TOOL_NAME,
163
+ label: "Delete Instruction",
164
+ description: "Delete an instruction file (.md) from a project. This cannot be undone.",
165
+ parameters: INSTRUCTIONS_DELETE_SCHEMA,
166
+ searchHint: "delete remove instruction file",
167
+ execute: async (_toolCallId, params) => {
168
+ if (params.filename.includes("..")) {
169
+ return {
170
+ content: [{ type: "text", text: "Path traversal not allowed" }],
171
+ details: { error: "path_traversal" },
172
+ };
173
+ }
174
+ const ok = deps.remove(params.project_id, params.filename);
175
+ if (!ok) {
176
+ return {
177
+ content: [{ type: "text", text: `Instruction file not found: ${params.filename}` }],
178
+ details: { projectId: params.project_id, filename: params.filename, error: "not_found" },
179
+ };
180
+ }
181
+ return {
182
+ content: [{ type: "text", text: `Instruction file deleted: ${params.filename}` }],
183
+ details: { projectId: params.project_id, filename: params.filename },
184
+ };
185
+ },
186
+ };
187
+ }
188
+ //# sourceMappingURL=instructions-tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instructions-tool.js","sourceRoot":"","sources":["../../../src/skills/tools/instructions-tool.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,gEAAgE;AAChE,EAAE;AACF,8DAA8D;AAC9D,iEAAiE;AACjE,gCAAgC;AAChC,EAAE;AACF,+BAA+B;AAC/B,+DAA+D;AAiC/D,+DAA+D;AAE/D,MAAM,CAAC,MAAM,2BAA2B,GAAG,mBAA4B,CAAC;AAMxE,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,IAAI,EAAE,QAAiB;IACvB,UAAU,EAAE;QACV,UAAU,EAAE;YACV,IAAI,EAAE,QAAiB;YACvB,WAAW,EAAE,6EAA6E;SAC3F;KACF;IACD,QAAQ,EAAE,CAAC,YAAY,CAAU;CACzB,CAAC;AAEX,MAAM,UAAU,0BAA0B,CAAC,IAA0B;IACnE,OAAO;QACL,IAAI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IAAI,EAAE,4BAA4B,EAAE,CAAC;oBAC/D,OAAO,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE;iBACrC,CAAC;YACJ,CAAC;YAED,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;YAC3D,IAAI,CAAC,EAAE,EAAE,CAAC;gBACR,OAAO;oBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,+BAA+B,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC;oBACnF,OAAO,EAAE,EAAE,SAAS,EAAE,MAAM,CAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE;iBACzF,CAAC;YACJ,CAAC;YAED,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,6BAA6B,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC;gBACjF,OAAO,EAAE,EAAE,SAAS,EAAE,MAAM,CAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE;aACrE,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,154 @@
1
+ import type { PortableTool } from "../portable-tool.js";
2
+ export declare const LSP_TOOL_NAME: "lsp";
3
+ export type LspOperation = "goToDefinition" | "findReferences" | "hover" | "documentSymbol" | "diagnostics" | "completion" | "signatureHelp" | "rename" | "codeAction";
4
+ export interface LspToolParams {
5
+ /** LSP operation to perform */
6
+ operation: LspOperation;
7
+ /** File path (absolute or relative to workspace root) */
8
+ filePath: string;
9
+ /** Line number (1-indexed) */
10
+ line?: number;
11
+ /** Character position (1-indexed) */
12
+ character?: number;
13
+ /** New name (for rename operation) */
14
+ newName?: string;
15
+ /** Include context lines around results */
16
+ includeContext?: boolean;
17
+ }
18
+ export declare const LSP_TOOL_SCHEMA: {
19
+ readonly type: "object";
20
+ readonly properties: {
21
+ readonly operation: {
22
+ readonly type: "string";
23
+ readonly enum: readonly ["goToDefinition", "findReferences", "hover", "documentSymbol", "diagnostics", "completion", "signatureHelp", "rename", "codeAction"];
24
+ readonly description: string;
25
+ };
26
+ readonly filePath: {
27
+ readonly type: "string";
28
+ readonly description: "File path. Absolute or relative to workspace root.";
29
+ };
30
+ readonly line: {
31
+ readonly type: "number";
32
+ readonly description: "Line number (1-indexed). Required for positional operations.";
33
+ };
34
+ readonly character: {
35
+ readonly type: "number";
36
+ readonly description: "Character position (1-indexed). Required for positional operations.";
37
+ };
38
+ readonly newName: {
39
+ readonly type: "string";
40
+ readonly description: "New name for rename operation.";
41
+ };
42
+ readonly includeContext: {
43
+ readonly type: "boolean";
44
+ readonly description: "Include surrounding code context in results (default: true).";
45
+ };
46
+ };
47
+ readonly required: readonly ["operation", "filePath"];
48
+ };
49
+ export interface LspLocation {
50
+ filePath: string;
51
+ line: number;
52
+ character: number;
53
+ endLine?: number;
54
+ endCharacter?: number;
55
+ context?: string;
56
+ }
57
+ export interface LspSymbol {
58
+ name: string;
59
+ kind: string;
60
+ range: {
61
+ startLine: number;
62
+ endLine: number;
63
+ };
64
+ children?: LspSymbol[];
65
+ }
66
+ export interface LspDiagnostic {
67
+ message: string;
68
+ severity: "error" | "warning" | "info" | "hint";
69
+ line: number;
70
+ character: number;
71
+ source?: string;
72
+ code?: string | number;
73
+ }
74
+ export interface LspHoverInfo {
75
+ contents: string;
76
+ range?: {
77
+ startLine: number;
78
+ startCharacter: number;
79
+ endLine: number;
80
+ endCharacter: number;
81
+ };
82
+ }
83
+ export interface LspCompletion {
84
+ label: string;
85
+ kind: string;
86
+ detail?: string;
87
+ insertText?: string;
88
+ }
89
+ export interface LspRenameEdit {
90
+ filePath: string;
91
+ edits: Array<{
92
+ line: number;
93
+ character: number;
94
+ endLine: number;
95
+ endCharacter: number;
96
+ newText: string;
97
+ }>;
98
+ }
99
+ export interface LspCodeAction {
100
+ title: string;
101
+ kind?: string;
102
+ isPreferred?: boolean;
103
+ }
104
+ export type LspResult = {
105
+ type: "locations";
106
+ locations: LspLocation[];
107
+ } | {
108
+ type: "symbols";
109
+ symbols: LspSymbol[];
110
+ } | {
111
+ type: "diagnostics";
112
+ diagnostics: LspDiagnostic[];
113
+ } | {
114
+ type: "hover";
115
+ hover: LspHoverInfo | null;
116
+ } | {
117
+ type: "completions";
118
+ completions: LspCompletion[];
119
+ } | {
120
+ type: "rename";
121
+ edits: LspRenameEdit[];
122
+ } | {
123
+ type: "codeActions";
124
+ actions: LspCodeAction[];
125
+ } | {
126
+ type: "signatureHelp";
127
+ signatures: string[];
128
+ };
129
+ /**
130
+ * Host-provided LSP backend.
131
+ * The host manages language server lifecycle and connections.
132
+ */
133
+ export interface LspToolDeps {
134
+ /** Execute an LSP operation. Host dispatches to appropriate language server. */
135
+ executeOperation(params: {
136
+ operation: LspOperation;
137
+ filePath: string;
138
+ line?: number;
139
+ character?: number;
140
+ newName?: string;
141
+ includeContext?: boolean;
142
+ }): Promise<LspResult>;
143
+ /** Check if file exists and get its size */
144
+ statFile?(filePath: string): Promise<{
145
+ exists: boolean;
146
+ size: number;
147
+ } | null>;
148
+ /** Resolve relative path to absolute */
149
+ resolvePath(filePath: string): string;
150
+ /** List supported language IDs (e.g. ['typescript', 'python', 'rust']) */
151
+ supportedLanguages?(): string[];
152
+ }
153
+ export declare function createLspTool(deps: LspToolDeps): PortableTool<LspToolParams>;
154
+ //# sourceMappingURL=lsp-tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lsp-tool.d.ts","sourceRoot":"","sources":["../../../src/skills/tools/lsp-tool.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAsB,MAAM,qBAAqB,CAAC;AAE5E,eAAO,MAAM,aAAa,EAAG,KAAc,CAAC;AAE5C,MAAM,MAAM,YAAY,GACpB,gBAAgB,GAChB,gBAAgB,GAChB,OAAO,GACP,gB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GAC1C;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,OAAO,EAAE,aAAa,EAAE,CAAA;CAAE,GACjD;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,UAAU,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAMpD;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,gFAAgF;IAChF,gBAAgB,CAAC,MAAM,EAAE;QACvB,SAAS,EAAE,YAAY,CAAC;QACxB,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,cAAc,CAAC,EAAE,OAAO,CAAC;KAC1B,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IAEvB,4CAA4C;IAC5C,QAAQ,CAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC,CAAC;IAE/E,wCAAwC;IACxC,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAEtC,0EAA0E;IAC1E,kBAAkB,CAAC,IAAI,MAAM,EAAE,CAAC;CACjC;AAaD,wBAAgB,aAAa,CAAC,IAAI,EAAE,WAAW,GAAG,YAAY,CAAC,aAAa,CAAC,CAiF5E"}
@@ -0,0 +1,228 @@
1
+ // ============================================================
2
+ // LSP Tool — Language Server Protocol code intelligence.
3
+ // Reference: claude-code-haha/src/tools/LSPTool/LSPTool.ts
4
+ // Category: coding (read-only)
5
+ // ============================================================
6
+ export const LSP_TOOL_NAME = "lsp";
7
+ export const LSP_TOOL_SCHEMA = {
8
+ type: "object",
9
+ properties: {
10
+ operation: {
11
+ type: "string",
12
+ enum: [
13
+ "goToDefinition",
14
+ "findReferences",
15
+ "hover",
16
+ "documentSymbol",
17
+ "diagnostics",
18
+ "completion",
19
+ "signatureHelp",
20
+ "rename",
21
+ "codeAction",
22
+ ],
23
+ description: "LSP operation:\n" +
24
+ "- goToDefinition: jump to symbol definition\n" +
25
+ "- findReferences: find all usages of a symbol\n" +
26
+ "- hover: get type/docs for symbol at position\n" +
27
+ "- documentSymbol: list all symbols in file (classes, functions, etc)\n" +
28
+ "- diagnostics: get errors/warnings for a file\n" +
29
+ "- completion: get completions at position\n" +
30
+ "- signatureHelp: get function signature at call site\n" +
31
+ "- rename: preview rename of symbol\n" +
32
+ "- codeAction: get available quick-fixes/refactorings",
33
+ },
34
+ filePath: {
35
+ type: "string",
36
+ description: "File path. Absolute or relative to workspace root.",
37
+ },
38
+ line: {
39
+ type: "number",
40
+ description: "Line number (1-indexed). Required for positional operations.",
41
+ },
42
+ character: {
43
+ type: "number",
44
+ description: "Character position (1-indexed). Required for positional operations.",
45
+ },
46
+ newName: {
47
+ type: "string",
48
+ description: "New name for rename operation.",
49
+ },
50
+ includeContext: {
51
+ type: "boolean",
52
+ description: "Include surrounding code context in results (default: true).",
53
+ },
54
+ },
55
+ required: ["operation", "filePath"],
56
+ };
57
+ // ── Dependencies ────────────────────────────────────────────
58
+ const MAX_FILE_SIZE = 10 * 1024 * 1024; // 10MB
59
+ // Positional operations require line and character
60
+ const POSITIONAL_OPS = [
61
+ "goToDefinition",
62
+ "findReferences",
63
+ "hover",
64
+ "completion",
65
+ "signatureHelp",
66
+ "rename",
67
+ "codeAction",
68
+ ];
69
+ export function createLspTool(deps) {
70
+ return {
71
+ name: LSP_TOOL_NAME,
72
+ label: "LSP",
73
+ description: "Query language servers for code intelligence. Supports go-to-definition, find-references, " +
74
+ "hover (type info), document symbols, diagnostics (errors/warnings), completions, " +
75
+ "signature help, rename preview, and code actions. Read-only — does not modify files.",
76
+ parameters: LSP_TOOL_SCHEMA,
77
+ execute: async (_toolCallId, params) => {
78
+ if (!params.filePath || params.filePath.trim().length === 0) {
79
+ return {
80
+ content: [{ type: "text", text: "Error: filePath is required." }],
81
+ details: { type: "lsp", error: "missing_filePath" },
82
+ };
83
+ }
84
+ // Block UNC paths (NTLM credential leak risk on Windows)
85
+ if (params.filePath.startsWith("\\\\") || params.filePath.startsWith("//")) {
86
+ return {
87
+ content: [{ type: "text", text: "Error: UNC paths are not allowed." }],
88
+ details: { type: "lsp", error: "unc_blocked" },
89
+ };
90
+ }
91
+ // Validate positional params
92
+ if (POSITIONAL_OPS.includes(params.operation)) {
93
+ if (params.line == null || params.character == null) {
94
+ return {
95
+ content: [{ type: "text", text: `Error: line and character are required for ${params.operation}.` }],
96
+ details: { type: "lsp", error: "missing_position" },
97
+ };
98
+ }
99
+ if (params.line < 1 || params.character < 1) {
100
+ return {
101
+ content: [{ type: "text", text: "Error: line and character must be ≥ 1." }],
102
+ details: { type: "lsp", error: "invalid_position" },
103
+ };
104
+ }
105
+ }
106
+ // Rename requires newName
107
+ if (params.operation === "rename" && !params.newName) {
108
+ return {
109
+ content: [{ type: "text", text: "Error: newName is required for rename operation." }],
110
+ details: { type: "lsp", error: "missing_newName" },
111
+ };
112
+ }
113
+ const resolved = deps.resolvePath(params.filePath);
114
+ // File size check
115
+ if (deps.statFile) {
116
+ const stat = await deps.statFile(resolved);
117
+ if (!stat || !stat.exists) {
118
+ return {
119
+ content: [{ type: "text", text: `Error: file not found: ${params.filePath}` }],
120
+ details: { type: "lsp", error: "file_not_found" },
121
+ };
122
+ }
123
+ if (stat.size > MAX_FILE_SIZE) {
124
+ return {
125
+ content: [{ type: "text", text: `Error: file too large (${(stat.size / 1024 / 1024).toFixed(1)}MB, max 10MB).` }],
126
+ details: { type: "lsp", error: "file_too_large" },
127
+ };
128
+ }
129
+ }
130
+ const result = await deps.executeOperation({
131
+ operation: params.operation,
132
+ filePath: resolved,
133
+ line: params.line,
134
+ character: params.character,
135
+ newName: params.newName,
136
+ includeContext: params.includeContext ?? true,
137
+ });
138
+ return { content: [{ type: "text", text: formatLspResult(params.operation, result) }], details: { type: "lsp", operation: params.operation } };
139
+ },
140
+ };
141
+ }
142
+ // ── Output formatting ───────────────────────────────────────
143
+ function formatLspResult(operation, result) {
144
+ switch (result.type) {
145
+ case "locations": {
146
+ if (result.locations.length === 0)
147
+ return "No results found.";
148
+ const lines = [`Found ${result.locations.length} location(s):`, ""];
149
+ for (const loc of result.locations.slice(0, 50)) {
150
+ lines.push(` ${loc.filePath}:${loc.line}:${loc.character}`);
151
+ if (loc.context)
152
+ lines.push(` ${loc.context.trim()}`);
153
+ }
154
+ if (result.locations.length > 50)
155
+ lines.push(` ... and ${result.locations.length - 50} more`);
156
+ return lines.join("\n");
157
+ }
158
+ case "symbols": {
159
+ if (result.symbols.length === 0)
160
+ return "No symbols found.";
161
+ const lines = [`Document symbols (${result.symbols.length}):`, ""];
162
+ for (const sym of result.symbols) {
163
+ lines.push(` ${sym.kind} ${sym.name} (L${sym.range.startLine}-${sym.range.endLine})`);
164
+ if (sym.children) {
165
+ for (const child of sym.children.slice(0, 10)) {
166
+ lines.push(` ${child.kind} ${child.name} (L${child.range.startLine})`);
167
+ }
168
+ if (sym.children.length > 10)
169
+ lines.push(` ... and ${sym.children.length - 10} more`);
170
+ }
171
+ }
172
+ return lines.join("\n");
173
+ }
174
+ case "diagnostics": {
175
+ if (result.diagnostics.length === 0)
176
+ return "No diagnostics (clean file).";
177
+ const lines = [`Diagnostics (${result.diagnostics.length}):`, ""];
178
+ for (const d of result.diagnostics) {
179
+ const icon = d.severity === "error" ? "❌" : d.severity === "warning" ? "⚠️" : "ℹ️";
180
+ lines.push(` ${icon} L${d.line}:${d.character} [${d.source || ""}${d.code ? `:${d.code}` : ""}] ${d.message}`);
181
+ }
182
+ return lines.join("\n");
183
+ }
184
+ case "hover": {
185
+ if (!result.hover)
186
+ return "No hover information available.";
187
+ return result.hover.contents;
188
+ }
189
+ case "completions": {
190
+ if (result.completions.length === 0)
191
+ return "No completions available.";
192
+ const lines = [`Completions (${result.completions.length}):`, ""];
193
+ for (const c of result.completions.slice(0, 20)) {
194
+ lines.push(` [${c.kind}] ${c.label}${c.detail ? ` — ${c.detail}` : ""}`);
195
+ }
196
+ if (result.completions.length > 20)
197
+ lines.push(` ... and ${result.completions.length - 20} more`);
198
+ return lines.join("\n");
199
+ }
200
+ case "signatureHelp": {
201
+ if (result.signatures.length === 0)
202
+ return "No signature information available.";
203
+ return result.signatures.join("\n");
204
+ }
205
+ case "rename": {
206
+ if (result.edits.length === 0)
207
+ return "No edits generated for rename.";
208
+ const total = result.edits.reduce((sum, f) => sum + f.edits.length, 0);
209
+ const lines = [`Rename would affect ${total} location(s) in ${result.edits.length} file(s):`, ""];
210
+ for (const file of result.edits) {
211
+ lines.push(` ${file.filePath} (${file.edits.length} edits)`);
212
+ }
213
+ return lines.join("\n");
214
+ }
215
+ case "codeActions": {
216
+ if (result.actions.length === 0)
217
+ return "No code actions available.";
218
+ const lines = [`Available code actions (${result.actions.length}):`, ""];
219
+ for (const a of result.actions) {
220
+ lines.push(` ${a.isPreferred ? "★" : "-"} ${a.title}${a.kind ? ` [${a.kind}]` : ""}`);
221
+ }
222
+ return lines.join("\n");
223
+ }
224
+ default:
225
+ return "Unknown result type.";
226
+ }
227
+ }
228
+ //# sourceMappingURL=lsp-tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lsp-tool.js","sourceRoot":"","sources":["../../../src/skills/tools/lsp-tool.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,yDAAyD;AACzD,2DAA2D;AAC3D,+BAA+B;AAC/B,+DAA+D;AAI/D,MAAM,CAAC,MAAM,aAAa,GAAG,KAAc,CAAC;AA4B5C,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,QAAiB;IACvB,UAAU,EAAE;QACV,SAAS,EAAE;YACT,IAAI,EAAE,QAAiB;YACvB,IAAI,EAAE;gBACJ,gBAAgB;gBAChB,gBAAgB;gBAChB,OAAO;gBACP,gBAAgB;gBAChB,aAAa;gBACb,YAAY;gBACZ,eAAe;gBACf,QAAQ;gBACR,YAAY;aACb;YACD,WA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