@oratis/lisa 0.8.0 → 0.11.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 (320) hide show
  1. package/README.md +123 -16
  2. package/README.zh-CN.md +101 -15
  3. package/completions/_lisa +56 -0
  4. package/completions/lisa.bash +35 -1
  5. package/completions/lisa.fish +18 -1
  6. package/dist/advisor/engine.d.ts +7 -0
  7. package/dist/advisor/engine.d.ts.map +1 -1
  8. package/dist/advisor/engine.js +12 -0
  9. package/dist/advisor/engine.js.map +1 -1
  10. package/dist/agent.d.ts +14 -0
  11. package/dist/agent.d.ts.map +1 -1
  12. package/dist/agent.js +58 -7
  13. package/dist/agent.js.map +1 -1
  14. package/dist/agents/managed.d.ts +108 -0
  15. package/dist/agents/managed.d.ts.map +1 -0
  16. package/dist/agents/managed.js +241 -0
  17. package/dist/agents/managed.js.map +1 -0
  18. package/dist/agents/pty.d.ts +155 -0
  19. package/dist/agents/pty.d.ts.map +1 -0
  20. package/dist/agents/pty.js +299 -0
  21. package/dist/agents/pty.js.map +1 -0
  22. package/dist/approval.d.ts +13 -0
  23. package/dist/approval.d.ts.map +1 -1
  24. package/dist/approval.js +25 -2
  25. package/dist/approval.js.map +1 -1
  26. package/dist/autonomy/runs.d.ts +33 -0
  27. package/dist/autonomy/runs.d.ts.map +1 -0
  28. package/dist/autonomy/runs.js +106 -0
  29. package/dist/autonomy/runs.js.map +1 -0
  30. package/dist/channels/feishu.d.ts.map +1 -1
  31. package/dist/channels/feishu.js +65 -0
  32. package/dist/channels/feishu.js.map +1 -1
  33. package/dist/channels/router.d.ts +7 -0
  34. package/dist/channels/router.d.ts.map +1 -1
  35. package/dist/channels/router.js +1 -1
  36. package/dist/channels/router.js.map +1 -1
  37. package/dist/cli/agents-pty.d.ts +18 -0
  38. package/dist/cli/agents-pty.d.ts.map +1 -0
  39. package/dist/cli/agents-pty.js +182 -0
  40. package/dist/cli/agents-pty.js.map +1 -0
  41. package/dist/cli/agents.d.ts +2 -0
  42. package/dist/cli/agents.d.ts.map +1 -0
  43. package/dist/cli/agents.js +65 -0
  44. package/dist/cli/agents.js.map +1 -0
  45. package/dist/cli/consent.d.ts +2 -0
  46. package/dist/cli/consent.d.ts.map +1 -0
  47. package/dist/cli/consent.js +57 -0
  48. package/dist/cli/consent.js.map +1 -0
  49. package/dist/cli/model.d.ts +2 -0
  50. package/dist/cli/model.d.ts.map +1 -0
  51. package/dist/cli/model.js +121 -0
  52. package/dist/cli/model.js.map +1 -0
  53. package/dist/cli/sense.d.ts +2 -0
  54. package/dist/cli/sense.d.ts.map +1 -0
  55. package/dist/cli/sense.js +36 -0
  56. package/dist/cli/sense.js.map +1 -0
  57. package/dist/cli.js +117 -12
  58. package/dist/cli.js.map +1 -1
  59. package/dist/consent/blacklist.d.ts +28 -0
  60. package/dist/consent/blacklist.d.ts.map +1 -0
  61. package/dist/consent/blacklist.js +78 -0
  62. package/dist/consent/blacklist.js.map +1 -0
  63. package/dist/consent/store.d.ts +45 -0
  64. package/dist/consent/store.d.ts.map +1 -0
  65. package/dist/consent/store.js +126 -0
  66. package/dist/consent/store.js.map +1 -0
  67. package/dist/control/policy.d.ts +13 -0
  68. package/dist/control/policy.d.ts.map +1 -0
  69. package/dist/control/policy.js +57 -0
  70. package/dist/control/policy.js.map +1 -0
  71. package/dist/heartbeat/runner.d.ts.map +1 -1
  72. package/dist/heartbeat/runner.js +70 -14
  73. package/dist/heartbeat/runner.js.map +1 -1
  74. package/dist/idle/runner.d.ts.map +1 -1
  75. package/dist/idle/runner.js +87 -17
  76. package/dist/idle/runner.js.map +1 -1
  77. package/dist/integrations/aider/observer.d.ts +21 -1
  78. package/dist/integrations/aider/observer.d.ts.map +1 -1
  79. package/dist/integrations/aider/observer.js +110 -1
  80. package/dist/integrations/aider/observer.js.map +1 -1
  81. package/dist/integrations/claude-code/liveness.d.ts +10 -0
  82. package/dist/integrations/claude-code/liveness.d.ts.map +1 -0
  83. package/dist/integrations/claude-code/liveness.js +62 -0
  84. package/dist/integrations/claude-code/liveness.js.map +1 -0
  85. package/dist/integrations/claude-code/watcher.d.ts +39 -4
  86. package/dist/integrations/claude-code/watcher.d.ts.map +1 -1
  87. package/dist/integrations/claude-code/watcher.js +94 -57
  88. package/dist/integrations/claude-code/watcher.js.map +1 -1
  89. package/dist/integrations/codex/observer.d.ts +19 -6
  90. package/dist/integrations/codex/observer.d.ts.map +1 -1
  91. package/dist/integrations/codex/observer.js +228 -4
  92. package/dist/integrations/codex/observer.js.map +1 -1
  93. package/dist/integrations/dispatch-ledger.d.ts +30 -1
  94. package/dist/integrations/dispatch-ledger.d.ts.map +1 -1
  95. package/dist/integrations/dispatch-ledger.js +75 -9
  96. package/dist/integrations/dispatch-ledger.js.map +1 -1
  97. package/dist/integrations/git/branch.d.ts +11 -0
  98. package/dist/integrations/git/branch.d.ts.map +1 -0
  99. package/dist/integrations/git/branch.js +49 -0
  100. package/dist/integrations/git/branch.js.map +1 -0
  101. package/dist/integrations/git/observer.d.ts +39 -0
  102. package/dist/integrations/git/observer.d.ts.map +1 -0
  103. package/dist/integrations/git/observer.js +252 -0
  104. package/dist/integrations/git/observer.js.map +1 -0
  105. package/dist/integrations/github-pr/observer.d.ts.map +1 -1
  106. package/dist/integrations/github-pr/observer.js +7 -2
  107. package/dist/integrations/github-pr/observer.js.map +1 -1
  108. package/dist/integrations/hub.d.ts +8 -0
  109. package/dist/integrations/hub.d.ts.map +1 -1
  110. package/dist/integrations/hub.js +39 -1
  111. package/dist/integrations/hub.js.map +1 -1
  112. package/dist/integrations/managed/observer.d.ts +17 -0
  113. package/dist/integrations/managed/observer.d.ts.map +1 -0
  114. package/dist/integrations/managed/observer.js +46 -0
  115. package/dist/integrations/managed/observer.js.map +1 -0
  116. package/dist/integrations/opencode/observer.d.ts +53 -5
  117. package/dist/integrations/opencode/observer.d.ts.map +1 -1
  118. package/dist/integrations/opencode/observer.js +242 -20
  119. package/dist/integrations/opencode/observer.js.map +1 -1
  120. package/dist/integrations/pty/observer.d.ts +25 -0
  121. package/dist/integrations/pty/observer.d.ts.map +1 -0
  122. package/dist/integrations/pty/observer.js +48 -0
  123. package/dist/integrations/pty/observer.js.map +1 -0
  124. package/dist/integrations/registry.d.ts.map +1 -1
  125. package/dist/integrations/registry.js +5 -0
  126. package/dist/integrations/registry.js.map +1 -1
  127. package/dist/integrations/shell/observer.d.ts +33 -0
  128. package/dist/integrations/shell/observer.d.ts.map +1 -0
  129. package/dist/integrations/shell/observer.js +223 -0
  130. package/dist/integrations/shell/observer.js.map +1 -0
  131. package/dist/integrations/takoapi/a2a.d.ts +38 -0
  132. package/dist/integrations/takoapi/a2a.d.ts.map +1 -0
  133. package/dist/integrations/takoapi/a2a.js +70 -0
  134. package/dist/integrations/takoapi/a2a.js.map +1 -0
  135. package/dist/integrations/takoapi/ledger.d.ts +32 -0
  136. package/dist/integrations/takoapi/ledger.d.ts.map +1 -0
  137. package/dist/integrations/takoapi/ledger.js +96 -0
  138. package/dist/integrations/takoapi/ledger.js.map +1 -0
  139. package/dist/integrations/takoapi/observer.d.ts +39 -0
  140. package/dist/integrations/takoapi/observer.d.ts.map +1 -0
  141. package/dist/integrations/takoapi/observer.js +102 -0
  142. package/dist/integrations/takoapi/observer.js.map +1 -0
  143. package/dist/integrations/types.d.ts +17 -0
  144. package/dist/integrations/types.d.ts.map +1 -1
  145. package/dist/mcp/client.d.ts +5 -0
  146. package/dist/mcp/client.d.ts.map +1 -1
  147. package/dist/mcp/client.js +1 -1
  148. package/dist/mcp/client.js.map +1 -1
  149. package/dist/mcp/config.d.ts +4 -0
  150. package/dist/mcp/config.d.ts.map +1 -1
  151. package/dist/mcp/config.js +34 -0
  152. package/dist/mcp/config.js.map +1 -1
  153. package/dist/memory/embedding.d.ts +45 -0
  154. package/dist/memory/embedding.d.ts.map +1 -0
  155. package/dist/memory/embedding.js +139 -0
  156. package/dist/memory/embedding.js.map +1 -0
  157. package/dist/memory/search_tool.d.ts.map +1 -1
  158. package/dist/memory/search_tool.js +6 -2
  159. package/dist/memory/search_tool.js.map +1 -1
  160. package/dist/memory/vector.d.ts +14 -3
  161. package/dist/memory/vector.d.ts.map +1 -1
  162. package/dist/memory/vector.js +50 -0
  163. package/dist/memory/vector.js.map +1 -1
  164. package/dist/model/local.d.ts +43 -0
  165. package/dist/model/local.d.ts.map +1 -0
  166. package/dist/model/local.js +118 -0
  167. package/dist/model/local.js.map +1 -0
  168. package/dist/model/plan-usage.d.ts +41 -0
  169. package/dist/model/plan-usage.d.ts.map +1 -0
  170. package/dist/model/plan-usage.js +168 -0
  171. package/dist/model/plan-usage.js.map +1 -0
  172. package/dist/model/plans.d.ts +73 -0
  173. package/dist/model/plans.d.ts.map +1 -0
  174. package/dist/model/plans.js +246 -0
  175. package/dist/model/plans.js.map +1 -0
  176. package/dist/orchestrator/recent-recap.d.ts +2 -0
  177. package/dist/orchestrator/recent-recap.d.ts.map +1 -0
  178. package/dist/orchestrator/recent-recap.js +20 -0
  179. package/dist/orchestrator/recent-recap.js.map +1 -0
  180. package/dist/providers/anthropic.d.ts +1 -0
  181. package/dist/providers/anthropic.d.ts.map +1 -1
  182. package/dist/providers/anthropic.js +10 -2
  183. package/dist/providers/anthropic.js.map +1 -1
  184. package/dist/providers/fallback.d.ts +23 -0
  185. package/dist/providers/fallback.d.ts.map +1 -0
  186. package/dist/providers/fallback.js +29 -0
  187. package/dist/providers/fallback.js.map +1 -0
  188. package/dist/providers/gemini.d.ts +2 -0
  189. package/dist/providers/gemini.d.ts.map +1 -1
  190. package/dist/providers/gemini.js +24 -10
  191. package/dist/providers/gemini.js.map +1 -1
  192. package/dist/providers/openai.d.ts.map +1 -1
  193. package/dist/providers/openai.js +4 -1
  194. package/dist/providers/openai.js.map +1 -1
  195. package/dist/providers/registry.d.ts +18 -2
  196. package/dist/providers/registry.d.ts.map +1 -1
  197. package/dist/providers/registry.js +56 -9
  198. package/dist/providers/registry.js.map +1 -1
  199. package/dist/reflect.d.ts +55 -0
  200. package/dist/reflect.d.ts.map +1 -1
  201. package/dist/reflect.js +148 -54
  202. package/dist/reflect.js.map +1 -1
  203. package/dist/sense/log.d.ts +9 -0
  204. package/dist/sense/log.d.ts.map +1 -0
  205. package/dist/sense/log.js +63 -0
  206. package/dist/sense/log.js.map +1 -0
  207. package/dist/sense/screen.d.ts +43 -0
  208. package/dist/sense/screen.d.ts.map +1 -0
  209. package/dist/sense/screen.js +107 -0
  210. package/dist/sense/screen.js.map +1 -0
  211. package/dist/sense/service.d.ts +16 -0
  212. package/dist/sense/service.d.ts.map +1 -0
  213. package/dist/sense/service.js +33 -0
  214. package/dist/sense/service.js.map +1 -0
  215. package/dist/sense/types.d.ts +35 -0
  216. package/dist/sense/types.d.ts.map +1 -0
  217. package/dist/sense/types.js +11 -0
  218. package/dist/sense/types.js.map +1 -0
  219. package/dist/sense/voice.d.ts +28 -0
  220. package/dist/sense/voice.d.ts.map +1 -0
  221. package/dist/sense/voice.js +64 -0
  222. package/dist/sense/voice.js.map +1 -0
  223. package/dist/soul/git.d.ts.map +1 -1
  224. package/dist/soul/git.js +35 -16
  225. package/dist/soul/git.js.map +1 -1
  226. package/dist/soul/store.d.ts +22 -0
  227. package/dist/soul/store.d.ts.map +1 -1
  228. package/dist/soul/store.js +69 -14
  229. package/dist/soul/store.js.map +1 -1
  230. package/dist/soul/summary.d.ts +10 -0
  231. package/dist/soul/summary.d.ts.map +1 -0
  232. package/dist/soul/summary.js +57 -0
  233. package/dist/soul/summary.js.map +1 -0
  234. package/dist/soul/tools.d.ts.map +1 -1
  235. package/dist/soul/tools.js +13 -24
  236. package/dist/soul/tools.js.map +1 -1
  237. package/dist/soul/types.d.ts +9 -0
  238. package/dist/soul/types.d.ts.map +1 -1
  239. package/dist/soul/types.js.map +1 -1
  240. package/dist/subagent.d.ts +7 -0
  241. package/dist/subagent.d.ts.map +1 -1
  242. package/dist/subagent.js +3 -1
  243. package/dist/subagent.js.map +1 -1
  244. package/dist/tools/dispatch_agent.d.ts +13 -1
  245. package/dist/tools/dispatch_agent.d.ts.map +1 -1
  246. package/dist/tools/dispatch_agent.js +56 -12
  247. package/dist/tools/dispatch_agent.js.map +1 -1
  248. package/dist/tools/dispatch_status.d.ts +22 -0
  249. package/dist/tools/dispatch_status.d.ts.map +1 -0
  250. package/dist/tools/dispatch_status.js +57 -0
  251. package/dist/tools/dispatch_status.js.map +1 -0
  252. package/dist/tools/github.d.ts +34 -0
  253. package/dist/tools/github.d.ts.map +1 -0
  254. package/dist/tools/github.js +140 -0
  255. package/dist/tools/github.js.map +1 -0
  256. package/dist/tools/github_link.d.ts +36 -0
  257. package/dist/tools/github_link.d.ts.map +1 -0
  258. package/dist/tools/github_link.js +127 -0
  259. package/dist/tools/github_link.js.map +1 -0
  260. package/dist/tools/mcp.d.ts +28 -0
  261. package/dist/tools/mcp.d.ts.map +1 -0
  262. package/dist/tools/mcp.js +55 -0
  263. package/dist/tools/mcp.js.map +1 -0
  264. package/dist/tools/npm_info.d.ts +21 -0
  265. package/dist/tools/npm_info.d.ts.map +1 -0
  266. package/dist/tools/npm_info.js +102 -0
  267. package/dist/tools/npm_info.js.map +1 -0
  268. package/dist/tools/registry.d.ts +29 -0
  269. package/dist/tools/registry.d.ts.map +1 -1
  270. package/dist/tools/registry.js +75 -0
  271. package/dist/tools/registry.js.map +1 -1
  272. package/dist/tools/run_on_plan.d.ts +46 -0
  273. package/dist/tools/run_on_plan.d.ts.map +1 -0
  274. package/dist/tools/run_on_plan.js +89 -0
  275. package/dist/tools/run_on_plan.js.map +1 -0
  276. package/dist/tools/takoapi.d.ts +60 -0
  277. package/dist/tools/takoapi.d.ts.map +1 -0
  278. package/dist/tools/takoapi.js +181 -0
  279. package/dist/tools/takoapi.js.map +1 -0
  280. package/dist/tools/validate.d.ts +22 -0
  281. package/dist/tools/validate.d.ts.map +1 -0
  282. package/dist/tools/validate.js +50 -0
  283. package/dist/tools/validate.js.map +1 -0
  284. package/dist/voice/dictation.d.ts +51 -0
  285. package/dist/voice/dictation.d.ts.map +1 -0
  286. package/dist/voice/dictation.js +70 -0
  287. package/dist/voice/dictation.js.map +1 -0
  288. package/dist/web/agent-roster.d.ts +56 -0
  289. package/dist/web/agent-roster.d.ts.map +1 -0
  290. package/dist/web/agent-roster.js +109 -0
  291. package/dist/web/agent-roster.js.map +1 -0
  292. package/dist/web/devices.d.ts +27 -0
  293. package/dist/web/devices.d.ts.map +1 -0
  294. package/dist/web/devices.js +113 -0
  295. package/dist/web/devices.js.map +1 -0
  296. package/dist/web/island.d.ts +5 -1
  297. package/dist/web/island.d.ts.map +1 -1
  298. package/dist/web/island.js +427 -67
  299. package/dist/web/island.js.map +1 -1
  300. package/dist/web/lisa-client.d.ts +20 -0
  301. package/dist/web/lisa-client.d.ts.map +1 -0
  302. package/dist/web/lisa-client.js +1323 -0
  303. package/dist/web/lisa-client.js.map +1 -0
  304. package/dist/web/lisa-css.d.ts +13 -0
  305. package/dist/web/lisa-css.d.ts.map +1 -0
  306. package/dist/web/lisa-css.js +1163 -0
  307. package/dist/web/lisa-css.js.map +1 -0
  308. package/dist/web/lisa-html.d.ts +1 -1
  309. package/dist/web/lisa-html.d.ts.map +1 -1
  310. package/dist/web/lisa-html.js +16 -2091
  311. package/dist/web/lisa-html.js.map +1 -1
  312. package/dist/web/push.d.ts +76 -0
  313. package/dist/web/push.d.ts.map +1 -0
  314. package/dist/web/push.js +163 -0
  315. package/dist/web/push.js.map +1 -0
  316. package/dist/web/server.d.ts +19 -0
  317. package/dist/web/server.d.ts.map +1 -1
  318. package/dist/web/server.js +898 -65
  319. package/dist/web/server.js.map +1 -1
  320. package/package.json +5 -2
@@ -0,0 +1,28 @@
1
+ /**
2
+ * mcp (integration) — manage LISA's MCP server connections, so she can connect
3
+ * any integration that ships an MCP server (GitHub, Linear, Sentry, Postgres,
4
+ * filesystem, …) on request, rather than each needing a bespoke tool. MCP is
5
+ * the standard way to "add all the integrations an agent might use".
6
+ *
7
+ * list — configured MCP servers (from ~/.lisa/mcp.json)
8
+ * add — add a server (name + command [+ args/env]); connects on next start
9
+ * remove — remove a server
10
+ *
11
+ * Servers connect at startup, so add/remove take effect after a restart
12
+ * (`lisa serve --web`). Their tools then appear in LISA's toolset automatically.
13
+ */
14
+ import type { ToolDefinition } from "../types.js";
15
+ interface McpInput {
16
+ action: "list" | "add" | "remove";
17
+ name?: string;
18
+ /** For add: the server command, e.g. "npx". */
19
+ command?: string;
20
+ /** For add: command args, e.g. ["-y","@modelcontextprotocol/server-filesystem","/path"]. */
21
+ args?: string[];
22
+ /** For add: env vars the server needs (e.g. API tokens). */
23
+ env?: Record<string, string>;
24
+ enabled?: boolean;
25
+ }
26
+ export declare const mcpTool: ToolDefinition<McpInput, string>;
27
+ export {};
28
+ //# sourceMappingURL=mcp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/tools/mcp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGlD,UAAU,QAAQ;IAChB,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4FAA4F;IAC5F,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,4DAA4D;IAC5D,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,OAAO,EAAE,cAAc,CAAC,QAAQ,EAAE,MAAM,CA0DpD,CAAC"}
@@ -0,0 +1,55 @@
1
+ import { loadMcpConfig, saveMcpServer, deleteMcpServer, MCP_CONFIG_PATH } from "../mcp/config.js";
2
+ export const mcpTool = {
3
+ name: "mcp",
4
+ description: "Manage MCP server connections — the standard way to add external integrations (GitHub, Linear, " +
5
+ "Sentry, Postgres, filesystem, …) whose tools then appear in LISA's toolset. action:'list' shows " +
6
+ "configured servers; 'add' (name + command [+ args/env]) adds one; 'remove' (name) deletes one. " +
7
+ "Servers connect at startup, so add/remove take effect after restarting `lisa serve --web`. Use " +
8
+ "when the user wants to connect a new integration via its MCP server.",
9
+ inputSchema: {
10
+ type: "object",
11
+ properties: {
12
+ action: { type: "string", enum: ["list", "add", "remove"] },
13
+ name: { type: "string", description: "Server name (for add/remove)." },
14
+ command: { type: "string", description: "Executable for add, e.g. 'npx'." },
15
+ args: { type: "array", items: { type: "string" }, description: "Args for add, e.g. ['-y','@scope/server-x']." },
16
+ env: { type: "object", additionalProperties: { type: "string" }, description: "Env vars the server needs (e.g. API tokens)." },
17
+ enabled: { type: "boolean", description: "Whether the server is enabled (default true)." },
18
+ },
19
+ required: ["action"],
20
+ additionalProperties: false,
21
+ },
22
+ async execute(input) {
23
+ if (input.action === "list") {
24
+ const servers = await loadMcpConfig();
25
+ if (servers.length === 0) {
26
+ return `(no MCP servers configured — add one with mcp action:'add', or edit ${MCP_CONFIG_PATH})`;
27
+ }
28
+ return (`${servers.length} MCP server(s) in ${MCP_CONFIG_PATH}:\n` +
29
+ servers
30
+ .map((s) => ` ${s.name}${s.enabled === false ? " (disabled)" : ""}: ${s.command} ${(s.args ?? []).join(" ")}`.trimEnd())
31
+ .join("\n"));
32
+ }
33
+ if (input.action === "remove") {
34
+ if (!input.name)
35
+ return "(remove needs a name — from mcp action:'list')";
36
+ const ok = await deleteMcpServer(input.name);
37
+ return ok
38
+ ? `Removed MCP server "${input.name}". Restart \`lisa serve --web\` for it to disconnect.`
39
+ : `(no MCP server named "${input.name}")`;
40
+ }
41
+ // add
42
+ if (!input.name || !input.command) {
43
+ return "(add needs a name and a command, e.g. name:'filesystem' command:'npx' args:['-y','@modelcontextprotocol/server-filesystem','/path'])";
44
+ }
45
+ await saveMcpServer(input.name, {
46
+ command: input.command,
47
+ args: input.args ?? [],
48
+ env: input.env,
49
+ enabled: input.enabled ?? true,
50
+ });
51
+ return (`Added MCP server "${input.name}": ${input.command} ${(input.args ?? []).join(" ")}`.trimEnd() +
52
+ `\nRestart \`lisa serve --web\` to connect it — its tools then appear in my toolset automatically.`);
53
+ },
54
+ };
55
+ //# sourceMappingURL=mcp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../src/tools/mcp.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAclG,MAAM,CAAC,MAAM,OAAO,GAAqC;IACvD,IAAI,EAAE,KAAK;IACX,WAAW,EACT,iGAAiG;QACjG,kGAAkG;QAClG,iGAAiG;QACjG,iGAAiG;QACjG,sEAAsE;IACxE,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,EAAE;YAC3D,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,+BAA+B,EAAE;YACtE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,iCAAiC,EAAE;YAC3E,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,WAAW,EAAE,8CAA8C,EAAE;YAC/G,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,oBAAoB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,WAAW,EAAE,8CAA8C,EAAE;YAC9H,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,+CAA+C,EAAE;SAC3F;QACD,QAAQ,EAAE,CAAC,QAAQ,CAAC;QACpB,oBAAoB,EAAE,KAAK;KAC5B;IACD,KAAK,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AI,IAAI,EAAE;YACtB,GAAG,EAAE,KAAK,CAAC,GAAG;YACd,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,IAAI;SAC/B,CAAC,CAAC;QACH,OAAO,CACL,qBAAqB,KAAK,CAAC,IAAI,MAAM,KAAK,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE;YAC9F,mGAAmG,CACpG,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * npm_info (integration) — the npm registry, the external service every JS
3
+ * agent touches. view a package's metadata, find outdated deps in a repo, or
4
+ * audit it for known vulnerabilities. No auth; uses the local npm CLI.
5
+ */
6
+ import type { ToolDefinition } from "../types.js";
7
+ interface NpmInput {
8
+ action: "view" | "outdated" | "audit";
9
+ /** Package name for view (optionally name@range). */
10
+ package?: string;
11
+ cwd?: string;
12
+ }
13
+ /** Pure: format `npm view --json` metadata. Exported for tests. */
14
+ export declare function formatView(json: string): string;
15
+ /** Pure: format `npm outdated --json`. Exported for tests. */
16
+ export declare function formatOutdated(json: string): string;
17
+ /** Pure: summarise `npm audit --json` (npm v7+ shape). Exported for tests. */
18
+ export declare function formatAudit(json: string): string;
19
+ export declare const npmInfoTool: ToolDefinition<NpmInput, string>;
20
+ export {};
21
+ //# sourceMappingURL=npm_info.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"npm_info.d.ts","sourceRoot":"","sources":["../../src/tools/npm_info.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGlD,UAAU,QAAQ;IAChB,MAAM,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC;IACtC,qDAAqD;IACrD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,mEAAmE;AACnE,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAa/C;AAED,8DAA8D;AAC9D,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAMnD;AAED,8EAA8E;AAC9E,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAShD;AAED,eAAO,MAAM,WAAW,EAAE,cAAc,CAAC,QAAQ,EAAE,MAAM,CA2CxD,CAAC"}
@@ -0,0 +1,102 @@
1
+ import { runIn, isDir, gitRoot } from "./exec-util.js";
2
+ /** Pure: format `npm view --json` metadata. Exported for tests. */
3
+ export function formatView(json) {
4
+ let d;
5
+ try {
6
+ d = JSON.parse(json);
7
+ }
8
+ catch {
9
+ return json.trim();
10
+ }
11
+ if (Array.isArray(d))
12
+ d = d[d.length - 1]; // version range → newest match
13
+ const lines = [
14
+ `${d.name}@${d.version}`,
15
+ d.description ? ` ${d.description}` : "",
16
+ d.license ? ` license: ${d.license}` : "",
17
+ d.homepage ? ` homepage: ${d.homepage}` : "",
18
+ d.deprecated ? ` ⚠ DEPRECATED: ${d.deprecated}` : "",
19
+ d.dist?.unpackedSize ? ` size: ${Math.round(d.dist.unpackedSize / 1024)} KB` : "",
20
+ ].filter(Boolean);
21
+ return lines.join("\n");
22
+ }
23
+ /** Pure: format `npm outdated --json`. Exported for tests. */
24
+ export function formatOutdated(json) {
25
+ let d;
26
+ try {
27
+ d = JSON.parse(json || "{}");
28
+ }
29
+ catch {
30
+ return json.trim();
31
+ }
32
+ const names = Object.keys(d);
33
+ if (names.length === 0)
34
+ return "(all dependencies up to date)";
35
+ return `${names.length} outdated:\n` + names.map((n) => ` ${n}: ${d[n].current ?? "?"} → ${d[n].latest ?? "?"}`).join("\n");
36
+ }
37
+ /** Pure: summarise `npm audit --json` (npm v7+ shape). Exported for tests. */
38
+ export function formatAudit(json) {
39
+ let d;
40
+ try {
41
+ d = JSON.parse(json);
42
+ }
43
+ catch {
44
+ return json.trim();
45
+ }
46
+ const v = d?.metadata?.vulnerabilities;
47
+ if (!v)
48
+ return "(no audit data)";
49
+ const total = (v.critical ?? 0) + (v.high ?? 0) + (v.moderate ?? 0) + (v.low ?? 0) + (v.info ?? 0);
50
+ if (total === 0)
51
+ return "(no known vulnerabilities)";
52
+ const parts = ["critical", "high", "moderate", "low", "info"].filter((k) => v[k]).map((k) => `${v[k]} ${k}`);
53
+ return `${total} vulnerabilit${total === 1 ? "y" : "ies"}: ${parts.join(", ")} (run \`npm audit\` for detail)`;
54
+ }
55
+ export const npmInfoTool = {
56
+ name: "npm_info",
57
+ description: "npm registry info: action:'view' (package — latest version, description, license, deprecation), " +
58
+ "'outdated' (which of a repo's dependencies have newer versions), 'audit' (known vulnerabilities in " +
59
+ "a repo). Use when the user asks about a package, whether deps are current, or for a security pass. " +
60
+ "Read-only; no auth; uses the local npm CLI.",
61
+ inputSchema: {
62
+ type: "object",
63
+ properties: {
64
+ action: { type: "string", enum: ["view", "outdated", "audit"] },
65
+ package: { type: "string", description: "Package name (optionally name@range) for action:'view'." },
66
+ cwd: { type: "string", description: "Repo path for outdated/audit. Defaults to current directory." },
67
+ },
68
+ required: ["action"],
69
+ additionalProperties: false,
70
+ },
71
+ async execute(input, ctx) {
72
+ if (input.action === "view") {
73
+ if (!input.package)
74
+ return "(view needs a package name)";
75
+ const r = await runIn(ctx.cwd, "npm", ["view", input.package, "--json"], { timeoutMs: 20000, signal: ctx.signal, maxBytes: 200_000 });
76
+ if (r.spawnError)
77
+ return "(npm isn't installed)";
78
+ if (r.code !== 0)
79
+ return `(npm view failed: ${r.stderr.trim().slice(0, 160) || "no such package?"})`;
80
+ return formatView(r.stdout);
81
+ }
82
+ const cwd = input.cwd && input.cwd.startsWith("/") ? input.cwd : ctx.cwd;
83
+ if (!(await isDir(cwd)))
84
+ return `(not a directory: ${cwd})`;
85
+ const root = (await gitRoot(cwd, ctx.signal)) ?? cwd;
86
+ if (input.action === "outdated") {
87
+ // npm outdated exits non-zero when there ARE outdated deps — that's not an error.
88
+ const r = await runIn(root, "npm", ["outdated", "--json"], { timeoutMs: 60000, signal: ctx.signal, maxBytes: 200_000 });
89
+ if (r.spawnError)
90
+ return "(npm isn't installed)";
91
+ return formatOutdated(r.stdout || "{}");
92
+ }
93
+ // audit
94
+ const r = await runIn(root, "npm", ["audit", "--json"], { timeoutMs: 60000, signal: ctx.signal, maxBytes: 400_000 });
95
+ if (r.spawnError)
96
+ return "(npm isn't installed)";
97
+ if (!r.stdout.trim())
98
+ return `(npm audit produced no output${r.stderr ? ": " + r.stderr.trim().slice(0, 120) : ""})`;
99
+ return formatAudit(r.stdout);
100
+ },
101
+ };
102
+ //# sourceMappingURL=npm_info.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"npm_info.js","sourceRoot":"","sources":["../../src/tools/npm_info.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AASvD,mEAAmE;AACnE,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,IAAI,CAAM,CAAC;IACX,IAAI,CAAC;QAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAAC,CAAC;IAAC,MAAM,CAAC;QAAC,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;IAAC,CAAC;IAC3D,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,+BAA+B;IAC1E,MAAM,KAAK,GAAG;QACZ,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,OAAO,EAAE;QACxB,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE;QACzC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,OAAO,EAAE,CAAC,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Options {
12
12
  export declare function buildToolRegistry(opts?: ToolRegistryOptions): ToolDefinition[];
13
13
  export declare const READ_ONLY_TOOL_NAMES: Set<string>;
14
14
  export declare function readOnlySubset(tools: ToolDefinition[]): ToolDefinition[];
15
+ /**
16
+ * Tools that must NOT be available to self-driven autonomous runs (desire
17
+ * heartbeats, idle reflection / Reve). These runs execute unattended on a timer with
18
+ * prompts that Lisa wrote herself — if an indirect prompt injection (e.g. via
19
+ * web_fetch content) plants a malicious actionable desire, these are the tools
20
+ * that would turn it into persistent code execution. Soul / memory / journal /
21
+ * skill tools stay available: autonomous time is for self-work, not ops.
22
+ *
23
+ * User-defined heartbeat tasks (~/.lisa/heartbeat.json) keep the full toolset —
24
+ * those prompts are authored by the user, same trust as typing into the REPL.
25
+ *
26
+ * Escape hatch: LISA_AUTONOMOUS_FULL_TOOLS=1 restores the old behavior.
27
+ */
28
+ export declare const AUTONOMOUS_BLOCKED_TOOL_NAMES: Set<string>;
29
+ export declare function autonomousSubset(tools: ToolDefinition[]): ToolDefinition[];
30
+ /**
31
+ * Tools that must NOT be reachable from remote-origin surfaces (IM channels:
32
+ * Telegram / Discord / Slack / Feishu / iMessage / webhook) by default.
33
+ * A channel message comes from whoever can reach the bot — with an empty
34
+ * allow-list that can be anyone, and even with one it's a remote, replayable
35
+ * surface. Mutating fs / shell / process-spawning / GitHub-writing tools turn
36
+ * a single hostile message into local code execution, so they're off unless
37
+ * the channel entry opts in with `"unsafeFullTools": true`.
38
+ *
39
+ * skill_manage is also blocked: a remotely planted skill becomes persistent
40
+ * prompt material for later full-tool local sessions.
41
+ */
42
+ export declare const REMOTE_BLOCKED_TOOL_NAMES: Set<string>;
43
+ export declare function remoteSafeSubset(tools: ToolDefinition[]): ToolDefinition[];
15
44
  //# sourceMappingURL=registry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/tools/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAwClD,MAAM,WAAW,mBAAmB;IAClC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC;CAC1B;AAED,wBAAgB,iBAAiB,CAAC,IAAI,GAAE,mBAAwB,GAAG,cAAc,EAAE,CAoDlF;AAED,eAAO,MAAM,oBAAoB,aAU/B,CAAC;AAEH,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,cAAc,EAAE,CAExE"}
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/tools/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AA+ClD,MAAM,WAAW,mBAAmB;IAClC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC;CAC1B;AAED,wBAAgB,iBAAiB,CAAC,IAAI,GAAE,mBAAwB,GAAG,cAAc,EAAE,CA2DlF;AAED,eAAO,MAAM,oBAAoB,aAU/B,CAAC;AAEH,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,cAAc,EAAE,CAExE;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,6BAA6B,aAkBxC,CAAC;AAEH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,cAAc,EAAE,CAG1E;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,yBAAyB,aAQpC,CAAC;AAEH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,cAAc,EAAE,CAE1E"}
@@ -8,8 +8,14 @@ import { reviewDiffTool } from "./review_diff.js";
8
8
  import { runChecksTool } from "./run_checks.js";
9
9
  import { prStatusTool } from "./pr_status.js";
10
10
  import { dispatchAgentTool } from "./dispatch_agent.js";
11
+ import { runOnPlanTool } from "./run_on_plan.js";
12
+ import { dispatchStatusTool } from "./dispatch_status.js";
11
13
  import { scheduledDispatchTool } from "./scheduled_dispatch.js";
12
14
  import { compareAgentsTool } from "./compare_agents.js";
15
+ import { githubLinkTool } from "./github_link.js";
16
+ import { githubTool } from "./github.js";
17
+ import { npmInfoTool } from "./npm_info.js";
18
+ import { mcpTool } from "./mcp.js";
13
19
  import { signalAgentTool } from "./signal_agent.js";
14
20
  import { agentRecapTool } from "./agent_recap.js";
15
21
  import { skillManageTool } from "../skills/tool.js";
@@ -25,6 +31,7 @@ import { redeployTool } from "./redeploy.js";
25
31
  import { setMoodTool } from "./set_mood.js";
26
32
  import { webFetchTool } from "./web_fetch.js";
27
33
  import { webSearchTool } from "./web_search.js";
34
+ import { takoapiTool } from "./takoapi.js";
28
35
  import { writeTool } from "./write.js";
29
36
  export function buildToolRegistry(opts = {}) {
30
37
  const tools = [
@@ -50,6 +57,7 @@ export function buildToolRegistry(opts = {}) {
50
57
  desireCloseTool,
51
58
  webFetchTool,
52
59
  webSearchTool,
60
+ takoapiTool,
53
61
  redeployTool,
54
62
  // Orchestration (docs/ORCHESTRATOR_PLAN.md): observe → advise → dispatch → control.
55
63
  listAgentsTool,
@@ -60,8 +68,14 @@ export function buildToolRegistry(opts = {}) {
60
68
  prStatusTool,
61
69
  adviseNowTool,
62
70
  dispatchAgentTool,
71
+ runOnPlanTool,
72
+ dispatchStatusTool,
63
73
  scheduledDispatchTool,
64
74
  compareAgentsTool,
75
+ githubLinkTool,
76
+ githubTool,
77
+ npmInfoTool,
78
+ mcpTool,
65
79
  signalAgentTool,
66
80
  agentRecapTool,
67
81
  ];
@@ -94,4 +108,65 @@ export const READ_ONLY_TOOL_NAMES = new Set([
94
108
  export function readOnlySubset(tools) {
95
109
  return tools.filter((t) => READ_ONLY_TOOL_NAMES.has(t.name));
96
110
  }
111
+ /**
112
+ * Tools that must NOT be available to self-driven autonomous runs (desire
113
+ * heartbeats, idle reflection / Reve). These runs execute unattended on a timer with
114
+ * prompts that Lisa wrote herself — if an indirect prompt injection (e.g. via
115
+ * web_fetch content) plants a malicious actionable desire, these are the tools
116
+ * that would turn it into persistent code execution. Soul / memory / journal /
117
+ * skill tools stay available: autonomous time is for self-work, not ops.
118
+ *
119
+ * User-defined heartbeat tasks (~/.lisa/heartbeat.json) keep the full toolset —
120
+ * those prompts are authored by the user, same trust as typing into the REPL.
121
+ *
122
+ * Escape hatch: LISA_AUTONOMOUS_FULL_TOOLS=1 restores the old behavior.
123
+ */
124
+ export const AUTONOMOUS_BLOCKED_TOOL_NAMES = new Set([
125
+ "bash",
126
+ "write",
127
+ "edit",
128
+ "apply_patch",
129
+ "redeploy",
130
+ "task",
131
+ "dispatch_agent",
132
+ "run_on_plan",
133
+ "signal_agent",
134
+ "scheduled_dispatch",
135
+ "compare_agents",
136
+ "run_checks",
137
+ "github",
138
+ "mcp",
139
+ // takoapi calls spend the user's TAKO_KEY and send data to a remote agent —
140
+ // not something an unattended/remote-origin run should do on its own.
141
+ "takoapi",
142
+ ]);
143
+ export function autonomousSubset(tools) {
144
+ if (process.env.LISA_AUTONOMOUS_FULL_TOOLS === "1")
145
+ return tools;
146
+ return tools.filter((t) => !AUTONOMOUS_BLOCKED_TOOL_NAMES.has(t.name));
147
+ }
148
+ /**
149
+ * Tools that must NOT be reachable from remote-origin surfaces (IM channels:
150
+ * Telegram / Discord / Slack / Feishu / iMessage / webhook) by default.
151
+ * A channel message comes from whoever can reach the bot — with an empty
152
+ * allow-list that can be anyone, and even with one it's a remote, replayable
153
+ * surface. Mutating fs / shell / process-spawning / GitHub-writing tools turn
154
+ * a single hostile message into local code execution, so they're off unless
155
+ * the channel entry opts in with `"unsafeFullTools": true`.
156
+ *
157
+ * skill_manage is also blocked: a remotely planted skill becomes persistent
158
+ * prompt material for later full-tool local sessions.
159
+ */
160
+ export const REMOTE_BLOCKED_TOOL_NAMES = new Set([
161
+ ...AUTONOMOUS_BLOCKED_TOOL_NAMES,
162
+ "skill_manage",
163
+ // dispatch_status surfaces the raw output of dispatched agents — read-only,
164
+ // but richer content than the structural observers and not for remote-origin
165
+ // (channel) callers. NOT autonomous-blocked: an autonomous run may read the
166
+ // result of work it dispatched.
167
+ "dispatch_status",
168
+ ]);
169
+ export function remoteSafeSubset(tools) {
170
+ return tools.filter((t) => !REMOTE_BLOCKED_TOOL_NAMES.has(t.name));
171
+ }
97
172
  //# sourceMappingURL=registry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/tools/registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,eAAe,EACf,cAAc,EACd,aAAa,EACb,YAAY,GACb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AED;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,IAAI,GAAG,CAAC;IACnD,MAAM;IACN,OAAO;IACP,MAAM;IACN,aAAa;IACb,UAAU;IACV,MAAM;IACN,gBAAgB;IAChB,aAAa;IACb,cAAc;IACd,oBAAoB;IACpB,gBAAgB;IAChB,YAAY;IACZ,QAAQ;IACR,KAAK;IACL,4EAA4E;IAC5E,sEAAsE;IACtE,SAAS;CACV,CAAC,CAAC;AAEH,MAAM,UAAU,gBAAgB,CAAC,KAAuB;IACtD,IAAI,OAAO,CAAC,GAAG,CAAC,0BAA0B,KAAK,GAAG;QAAE,OAAO,KAAK,CAAC;IACjE,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,6BAA6B,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACzE,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,GAAG,CAAC;IAC/C,GAAG,6BAA6B;IAChC,cAAc;IACd,4EAA4E;IAC5E,6EAA6E;IAC7E,4EAA4E;IAC5E,gCAAgC;IAChC,iBAAiB;CAClB,CAAC,CAAC;AAEH,MAAM,UAAU,gBAAgB,CAAC,KAAuB;IACtD,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACrE,CAAC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * run_on_plan (CODING_PLANS Phase 2) — delegate a coding task to a subscription
3
+ * "coding plan" instead of a metered API key.
4
+ *
5
+ * The mechanism is the sanctioned one from docs/CODING_PLANS.md: LISA does NOT
6
+ * touch the vendor's subscription token. It runs the vendor's OWN CLI that the
7
+ * user is already logged into — `claude -p "<task>"` / `codex exec "<task>"` —
8
+ * via the same `launchAgent` path `dispatch_agent` uses. Because that CLI owns
9
+ * its subscription auth, the work bills to the plan, not an API key.
10
+ *
11
+ * This is a thin, plan-aware wrapper over dispatch: it resolves the selected
12
+ * plan (`lisa model use plan://…`, stored as LISA_CODING_PLAN) or an explicit
13
+ * one, presence-/login-checks it (plans.ts, no secrets read), then hands off to
14
+ * launchAgent. Same safety posture as dispatch_agent — it spawns an autonomous,
15
+ * file-mutating process, so it's approval-gated and excluded from the autonomous
16
+ * / remote-safe toolsets.
17
+ */
18
+ import type { ToolDefinition } from "../types.js";
19
+ import { type DispatchAgentKind } from "./dispatch_agent.js";
20
+ import { type PlanId, type PlanStatus } from "../model/plans.js";
21
+ interface RunOnPlanInput {
22
+ task: string;
23
+ /** "claude" | "codex" | "plan://claude" | … Default: the selected plan. */
24
+ plan?: string;
25
+ cwd?: string;
26
+ /** Override the same-cwd conflict guard (default false). */
27
+ force?: boolean;
28
+ }
29
+ /** Resolve a loose plan argument (id or `plan://id`) or the configured default. Pure. */
30
+ export declare function resolvePlanId(raw: string | undefined, env?: Record<string, string | undefined>): PlanId | null;
31
+ export type PlanRunCheck = {
32
+ ok: true;
33
+ kind: DispatchAgentKind;
34
+ } | {
35
+ ok: false;
36
+ message: string;
37
+ };
38
+ /**
39
+ * Decide whether a resolved plan can be delegated to, given its detected status.
40
+ * Pure — the tool composes this with detectPlan() + launchAgent(). Returns the
41
+ * dispatch kind to launch, or a user-facing refusal message.
42
+ */
43
+ export declare function planRunPreCheck(planId: PlanId, status: PlanStatus): PlanRunCheck;
44
+ export declare const runOnPlanTool: ToolDefinition<RunOnPlanInput, string>;
45
+ export {};
46
+ //# sourceMappingURL=run_on_plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run_on_plan.d.ts","sourceRoot":"","sources":["../../src/tools/run_on_plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAiC,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC5F,OAAO,EAOL,KAAK,MAAM,EACX,KAAK,UAAU,EAChB,MAAM,mBAAmB,CAAC;AAE3B,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,4DAA4D;IAC5D,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,yFAAyF;AACzF,wBAAgB,aAAa,CAC3B,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,GACpD,MAAM,GAAG,IAAI,CAMf;AAED,MAAM,MAAM,YAAY,GACpB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,iBAAiB,CAAA;CAAE,GACrC;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnC;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,YAAY,CAIhF;AAED,eAAO,MAAM,aAAa,EAAE,cAAc,CAAC,cAAc,EAAE,MAAM,CAwEhE,CAAC"}
@@ -0,0 +1,89 @@
1
+ import { activeAgentInCwd, launchAgent } from "./dispatch_agent.js";
2
+ import { detectPlan, parsePlanRef, planDispatchKind, planPreflight, selectedPlan, PLAN_IDS, } from "../model/plans.js";
3
+ /** Resolve a loose plan argument (id or `plan://id`) or the configured default. Pure. */
4
+ export function resolvePlanId(raw, env = process.env) {
5
+ if (!raw || !raw.trim())
6
+ return selectedPlan(env);
7
+ const viaRef = parsePlanRef(raw);
8
+ if (viaRef)
9
+ return viaRef;
10
+ const v = raw.trim().toLowerCase();
11
+ return PLAN_IDS.includes(v) ? v : null;
12
+ }
13
+ /**
14
+ * Decide whether a resolved plan can be delegated to, given its detected status.
15
+ * Pure — the tool composes this with detectPlan() + launchAgent(). Returns the
16
+ * dispatch kind to launch, or a user-facing refusal message.
17
+ */
18
+ export function planRunPreCheck(planId, status) {
19
+ const pf = planPreflight(status);
20
+ if (!pf.ok)
21
+ return { ok: false, message: `Can't run on your ${planId} plan: ${pf.reason}.` };
22
+ return { ok: true, kind: planDispatchKind(planId) };
23
+ }
24
+ export const runOnPlanTool = {
25
+ name: "run_on_plan",
26
+ description: "Delegate a coding task to the user's subscription coding plan (Claude Pro/Max, " +
27
+ "ChatGPT/Codex, or GitHub Copilot) instead of a metered API key. Runs the vendor's own " +
28
+ "CLI that the user is logged into (claude -p / codex exec / copilot -p), so the work " +
29
+ "bills to their subscription, not an API key. Uses the plan selected via " +
30
+ "`lisa model use plan://…` unless you pass one " +
31
+ "in `plan`. The agent runs autonomously in the background and appears in the session " +
32
+ "monitor; this returns a handle and does NOT wait for it to finish (check dispatch_status). " +
33
+ "Spawns an autonomous process, so it requires user approval. Use when the user wants " +
34
+ "coding work run on their subscription rather than spending API tokens.",
35
+ inputSchema: {
36
+ type: "object",
37
+ properties: {
38
+ task: {
39
+ type: "string",
40
+ description: "The coding task/prompt (passed as a single argument, never a shell string).",
41
+ minLength: 1,
42
+ },
43
+ plan: {
44
+ type: "string",
45
+ description: "Which coding plan to use: \"claude\", \"codex\", or \"copilot\" (or plan://<id>). " +
46
+ "Defaults to the plan selected with `lisa model use plan://…`.",
47
+ },
48
+ cwd: {
49
+ type: "string",
50
+ description: "Absolute working directory. Defaults to the current directory.",
51
+ },
52
+ force: {
53
+ type: "boolean",
54
+ description: "Launch even if another agent is already active in this directory (default false).",
55
+ },
56
+ },
57
+ required: ["task"],
58
+ additionalProperties: false,
59
+ },
60
+ async execute(input, ctx) {
61
+ const planId = resolvePlanId(input.plan);
62
+ if (!planId) {
63
+ return input.plan
64
+ ? `Unknown coding plan "${input.plan}". Use one of: ${PLAN_IDS.join(", ")} (or plan://<id>).`
65
+ : "No coding plan selected. Pick one with `lisa model use plan://claude` (or pass " +
66
+ 'plan: "claude" | "codex"). See docs/CODING_PLANS.md.';
67
+ }
68
+ const check = planRunPreCheck(planId, detectPlan(planId));
69
+ if (!check.ok)
70
+ return check.message;
71
+ const cwd = input.cwd && input.cwd.startsWith("/") ? input.cwd : ctx.cwd;
72
+ if (!input.force) {
73
+ const clash = activeAgentInCwd(cwd);
74
+ if (clash) {
75
+ return (`Refusing to run on your ${planId} plan in ${cwd}: ${clash} is already active there. ` +
76
+ `Running two agents in one directory risks clobbering changes. ` +
77
+ `Wait for it to finish, pick another directory, or pass force:true.`);
78
+ }
79
+ }
80
+ const { pid, error, id } = await launchAgent(check.kind, input.task, cwd, ctx.log);
81
+ if (error)
82
+ return error;
83
+ ctx.log(`[plan] ran on ${planId} via ${check.kind} (pid ${pid}) in ${cwd}: ${input.task.slice(0, 80)}`);
84
+ return (`Running on your ${planId} plan — launched ${check.kind} (pid ${pid}) in ${cwd}. ` +
85
+ `This spends your subscription, not an API key. It runs autonomously; I won't block on it — ` +
86
+ `read its output with dispatch_status${id ? ` (id ${id})` : ""}, or signal_agent to list/cancel.`);
87
+ },
88
+ };
89
+ //# sourceMappingURL=run_on_plan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run_on_plan.js","sourceRoot":"","sources":["../../src/tools/run_on_plan.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAA0B,MAAM,qBAAqB,CAAC;AAC5F,OAAO,EACL,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,QAAQ,GAGT,MAAM,mBAAmB,CAAC;AAW3B,yFAAyF;AACzF,MAAM,UAAU,aAAa,CAC3B,GAAuB,EACvB,MAA0C,OAAO,CAAC,GAAG;IAErD,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE;QAAE,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC;IAClD,MAAM,MAAM,GAAG,YA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B,GAAG,CAAC,GAAG,CAAC,iBAAiB,MAAM,QAAQ,KAAK,CAAC,IAAI,SAAS,GAAG,QAAQ,GAAG,KAAK,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;QACxG,OAAO,CACL,mBAAmB,MAAM,oBAAoB,KAAK,CAAC,IAAI,SAAS,GAAG,QAAQ,GAAG,IAAI;YAClF,6FAA6F;YAC7F,uCAAuC,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,mCAAmC,CAClG,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * `takoapi` tool — reach remote agents through TakoAPI (PLAN_DISPATCH_v1.0 D2a).
3
+ *
4
+ * TakoAPI (https://takoapi.com) is "OpenRouter for agents": one key, any
5
+ * registered agent. This tool lets Lisa, mid-conversation, DISCOVER a remote
6
+ * agent by capability and CALL it (A2A `message`) — delegating a task that a
7
+ * specialized remote agent handles better than she would directly. The richer
8
+ * native hub integration (remote agents as first-class sessions) is D2b; this
9
+ * is the near-free discover+call entry point.
10
+ *
11
+ * Outbound + spends the user's TAKO_KEY, so it's gated out of autonomous and
12
+ * remote-origin runs (see AUTONOMOUS_BLOCKED_TOOL_NAMES). The HTTP layer is
13
+ * injectable so the logic is unit-testable without hitting the network.
14
+ */
15
+ import type { ToolDefinition } from "../types.js";
16
+ export interface HttpResponse {
17
+ ok: boolean;
18
+ status: number;
19
+ body: string;
20
+ }
21
+ export interface TakoFetcher {
22
+ get(url: string): Promise<HttpResponse>;
23
+ postJson(url: string, body: unknown, headers: Record<string, string>): Promise<HttpResponse>;
24
+ }
25
+ /** Format a /api/registry response into a readable agent list. Pure. */
26
+ export declare function formatRegistry(body: string, limit?: number): string;
27
+ /** Pull a text reply out of an A2A / OpenAI-shim response, tolerating shapes. Pure. */
28
+ export declare function extractAgentReply(body: string): string;
29
+ /** Discover agents in the public registry (no auth). */
30
+ export declare function takoDiscover(query: string, f?: TakoFetcher): Promise<string>;
31
+ export interface TakoCallResult {
32
+ /** Did we reach the agent and get a non-error response? */
33
+ ok: boolean;
34
+ status: number;
35
+ /** Formatted reply (or a human error string) — what the tool returns to LISA. */
36
+ reply: string;
37
+ /** A2A TaskState observed for the call (D2b ledger). "completed" for a plain
38
+ * sync reply; the agent's own task state if the response carried a Task. */
39
+ taskState: string;
40
+ /** A2A task id, if the response carried one. */
41
+ taskId?: string;
42
+ }
43
+ /**
44
+ * Call an agent via the A2A message endpoint with the user's key, returning both
45
+ * the reply and the observed A2A task state (for the D2b call ledger). Pure
46
+ * w.r.t. fs — recording is the caller's job, so existing `takoCall` tests stay
47
+ * side-effect-free.
48
+ */
49
+ export declare function takoCallDetailed(slug: string, text: string, key: string, f?: TakoFetcher): Promise<TakoCallResult>;
50
+ /** Call an agent via the A2A message endpoint with the user's key. */
51
+ export declare function takoCall(slug: string, text: string, key: string, f?: TakoFetcher): Promise<string>;
52
+ interface TakoInput {
53
+ action: "discover" | "call";
54
+ query?: string;
55
+ slug?: string;
56
+ text?: string;
57
+ }
58
+ export declare const takoapiTool: ToolDefinition<TakoInput, string>;
59
+ export {};
60
+ //# sourceMappingURL=takoapi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"takoapi.d.ts","sourceRoot":"","sources":["../../src/tools/takoapi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AASlD,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AACD,MAAM,WAAW,WAAW;IAC1B,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IACxC,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,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