@executioncontrolprotocol/cli 0.51.0 → 0.60.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 (316) hide show
  1. package/README.md +6 -161
  2. package/bin/dev.js +7 -8
  3. package/bin/ecp.js +6 -8
  4. package/bin/run.cmd +2 -3
  5. package/bin/run.js +1 -2
  6. package/bin/setup-env.js +42 -0
  7. package/dist/commands/app.d.ts +22 -0
  8. package/dist/commands/app.d.ts.map +1 -0
  9. package/dist/commands/app.js +75 -0
  10. package/dist/commands/app.js.map +1 -0
  11. package/dist/commands/commit.d.ts +24 -0
  12. package/dist/commands/commit.d.ts.map +1 -0
  13. package/dist/commands/commit.js +76 -0
  14. package/dist/commands/commit.js.map +1 -0
  15. package/dist/commands/config/secrets/list.d.ts +17 -0
  16. package/dist/commands/config/secrets/list.d.ts.map +1 -0
  17. package/dist/commands/config/secrets/list.js +41 -0
  18. package/dist/commands/config/secrets/list.js.map +1 -0
  19. package/dist/commands/config/secrets/set.d.ts +21 -0
  20. package/dist/commands/config/secrets/set.d.ts.map +1 -0
  21. package/dist/commands/config/secrets/set.js +86 -0
  22. package/dist/commands/config/secrets/set.js.map +1 -0
  23. package/dist/commands/config/secrets/unset.d.ts +20 -0
  24. package/dist/commands/config/secrets/unset.d.ts.map +1 -0
  25. package/dist/commands/config/secrets/unset.js +42 -0
  26. package/dist/commands/config/secrets/unset.js.map +1 -0
  27. package/dist/commands/execute.d.ts +27 -0
  28. package/dist/commands/execute.d.ts.map +1 -0
  29. package/dist/commands/execute.js +92 -0
  30. package/dist/commands/execute.js.map +1 -0
  31. package/dist/commands/host/logs.d.ts +19 -0
  32. package/dist/commands/host/logs.d.ts.map +1 -0
  33. package/dist/commands/host/logs.js +53 -0
  34. package/dist/commands/host/logs.js.map +1 -0
  35. package/dist/commands/host/reload.d.ts +15 -0
  36. package/dist/commands/host/reload.d.ts.map +1 -0
  37. package/dist/commands/host/reload.js +17 -0
  38. package/dist/commands/host/reload.js.map +1 -0
  39. package/dist/commands/host/restart.d.ts +18 -0
  40. package/dist/commands/host/restart.d.ts.map +1 -0
  41. package/dist/commands/host/restart.js +42 -0
  42. package/dist/commands/host/restart.js.map +1 -0
  43. package/dist/commands/host/start.d.ts +20 -0
  44. package/dist/commands/host/start.d.ts.map +1 -0
  45. package/dist/commands/host/start.js +100 -0
  46. package/dist/commands/host/start.js.map +1 -0
  47. package/dist/commands/host/status.d.ts +17 -0
  48. package/dist/commands/host/status.d.ts.map +1 -0
  49. package/dist/commands/host/status.js +86 -0
  50. package/dist/commands/host/status.js.map +1 -0
  51. package/dist/commands/host/stop.d.ts +18 -0
  52. package/dist/commands/host/stop.d.ts.map +1 -0
  53. package/dist/commands/host/stop.js +62 -0
  54. package/dist/commands/host/stop.js.map +1 -0
  55. package/dist/commands/mcp/start.d.ts +14 -0
  56. package/dist/commands/mcp/start.d.ts.map +1 -0
  57. package/dist/commands/mcp/start.js +42 -0
  58. package/dist/commands/mcp/start.js.map +1 -0
  59. package/dist/commands/plugins/index.d.ts +18 -0
  60. package/dist/commands/plugins/index.d.ts.map +1 -0
  61. package/dist/commands/plugins/index.js +55 -0
  62. package/dist/commands/plugins/index.js.map +1 -0
  63. package/dist/commands/plugins/inspect.d.ts +23 -0
  64. package/dist/commands/plugins/inspect.d.ts.map +1 -0
  65. package/dist/commands/plugins/inspect.js +113 -0
  66. package/dist/commands/plugins/inspect.js.map +1 -0
  67. package/dist/commands/plugins/install.d.ts +23 -0
  68. package/dist/commands/plugins/install.d.ts.map +1 -0
  69. package/dist/commands/plugins/install.js +135 -0
  70. package/dist/commands/plugins/install.js.map +1 -0
  71. package/dist/commands/plugins/link.d.ts +22 -0
  72. package/dist/commands/plugins/link.d.ts.map +1 -0
  73. package/dist/commands/plugins/link.js +90 -0
  74. package/dist/commands/plugins/link.js.map +1 -0
  75. package/dist/commands/plugins/reset.d.ts +20 -0
  76. package/dist/commands/plugins/reset.d.ts.map +1 -0
  77. package/dist/commands/plugins/reset.js +112 -0
  78. package/dist/commands/plugins/reset.js.map +1 -0
  79. package/dist/commands/plugins/uninstall.d.ts +27 -0
  80. package/dist/commands/plugins/uninstall.d.ts.map +1 -0
  81. package/dist/commands/plugins/uninstall.js +89 -0
  82. package/dist/commands/plugins/uninstall.js.map +1 -0
  83. package/dist/commands/plugins/update.d.ts +18 -0
  84. package/dist/commands/plugins/update.d.ts.map +1 -0
  85. package/dist/commands/plugins/update.js +75 -0
  86. package/dist/commands/plugins/update.js.map +1 -0
  87. package/dist/commands/retrieve.d.ts +26 -0
  88. package/dist/commands/retrieve.d.ts.map +1 -0
  89. package/dist/commands/retrieve.js +97 -0
  90. package/dist/commands/retrieve.js.map +1 -0
  91. package/dist/hooks/init.d.ts +9 -0
  92. package/dist/hooks/init.d.ts.map +1 -0
  93. package/dist/hooks/init.js +12 -0
  94. package/dist/hooks/init.js.map +1 -0
  95. package/dist/hooks/plugins-changed.d.ts +26 -0
  96. package/dist/hooks/plugins-changed.d.ts.map +1 -0
  97. package/dist/hooks/plugins-changed.js +106 -0
  98. package/dist/hooks/plugins-changed.js.map +1 -0
  99. package/dist/index.d.ts +9 -0
  100. package/dist/index.d.ts.map +1 -0
  101. package/dist/index.js +8 -0
  102. package/dist/index.js.map +1 -0
  103. package/dist/lib/control-client.d.ts +20 -0
  104. package/dist/lib/control-client.d.ts.map +1 -0
  105. package/dist/lib/control-client.js +49 -0
  106. package/dist/lib/control-client.js.map +1 -0
  107. package/dist/lib/exit.d.ts +12 -0
  108. package/dist/lib/exit.d.ts.map +1 -0
  109. package/dist/lib/exit.js +27 -0
  110. package/dist/lib/exit.js.map +1 -0
  111. package/dist/lib/help-quality.d.ts +17 -0
  112. package/dist/lib/help-quality.d.ts.map +1 -0
  113. package/dist/lib/help-quality.js +53 -0
  114. package/dist/lib/help-quality.js.map +1 -0
  115. package/dist/lib/home.d.ts +39 -0
  116. package/dist/lib/home.d.ts.map +1 -0
  117. package/dist/lib/home.js +98 -0
  118. package/dist/lib/home.js.map +1 -0
  119. package/dist/lib/host-discovery.d.ts +78 -0
  120. package/dist/lib/host-discovery.d.ts.map +1 -0
  121. package/dist/lib/host-discovery.js +315 -0
  122. package/dist/lib/host-discovery.js.map +1 -0
  123. package/dist/lib/host-unavailable.d.ts +16 -0
  124. package/dist/lib/host-unavailable.d.ts.map +1 -0
  125. package/dist/lib/host-unavailable.js +23 -0
  126. package/dist/lib/host-unavailable.js.map +1 -0
  127. package/dist/lib/input.d.ts +35 -0
  128. package/dist/lib/input.d.ts.map +1 -0
  129. package/dist/lib/input.js +80 -0
  130. package/dist/lib/input.js.map +1 -0
  131. package/dist/lib/output.d.ts +69 -0
  132. package/dist/lib/output.d.ts.map +1 -0
  133. package/dist/lib/output.js +295 -0
  134. package/dist/lib/output.js.map +1 -0
  135. package/dist/lib/plugin-mgmt.d.ts +194 -0
  136. package/dist/lib/plugin-mgmt.d.ts.map +1 -0
  137. package/dist/lib/plugin-mgmt.js +278 -0
  138. package/dist/lib/plugin-mgmt.js.map +1 -0
  139. package/dist/lib/secrets.d.ts +7 -0
  140. package/dist/lib/secrets.d.ts.map +1 -0
  141. package/dist/lib/secrets.js +31 -0
  142. package/dist/lib/secrets.js.map +1 -0
  143. package/dist/version.d.ts +6 -0
  144. package/dist/version.d.ts.map +1 -0
  145. package/dist/version.js +7 -0
  146. package/dist/version.js.map +1 -0
  147. package/oclif.manifest.json +1109 -0
  148. package/package.json +46 -39
  149. package/dist/commands.d.ts +0 -7
  150. package/dist/commands.d.ts.map +0 -1
  151. package/dist/commands.js +0 -9
  152. package/dist/commands.js.map +0 -1
  153. package/dist/hooks/command-not-found.d.ts +0 -8
  154. package/dist/hooks/command-not-found.d.ts.map +0 -1
  155. package/dist/hooks/command-not-found.js +0 -72
  156. package/dist/hooks/command-not-found.js.map +0 -1
  157. package/dist/hooks/init-host.d.ts +0 -8
  158. package/dist/hooks/init-host.d.ts.map +0 -1
  159. package/dist/hooks/init-host.js +0 -45
  160. package/dist/hooks/init-host.js.map +0 -1
  161. package/dist/hooks/jit-install.d.ts +0 -8
  162. package/dist/hooks/jit-install.d.ts.map +0 -1
  163. package/dist/hooks/jit-install.js +0 -32
  164. package/dist/hooks/jit-install.js.map +0 -1
  165. package/dist/hooks/postinstall-add-to-env.d.ts +0 -18
  166. package/dist/hooks/postinstall-add-to-env.d.ts.map +0 -1
  167. package/dist/hooks/postinstall-add-to-env.js +0 -21
  168. package/dist/hooks/postinstall-add-to-env.js.map +0 -1
  169. package/dist/hooks/trust.d.ts +0 -9
  170. package/dist/hooks/trust.d.ts.map +0 -1
  171. package/dist/hooks/trust.js +0 -32
  172. package/dist/hooks/trust.js.map +0 -1
  173. package/dist/lib/add-to-env.d.ts +0 -38
  174. package/dist/lib/add-to-env.d.ts.map +0 -1
  175. package/dist/lib/add-to-env.js +0 -81
  176. package/dist/lib/add-to-env.js.map +0 -1
  177. package/dist/lib/argv.d.ts +0 -11
  178. package/dist/lib/argv.d.ts.map +0 -1
  179. package/dist/lib/argv.js +0 -30
  180. package/dist/lib/argv.js.map +0 -1
  181. package/dist/lib/command-helpers.d.ts +0 -14
  182. package/dist/lib/command-helpers.d.ts.map +0 -1
  183. package/dist/lib/command-helpers.js +0 -37
  184. package/dist/lib/command-helpers.js.map +0 -1
  185. package/dist/lib/config-file.d.ts +0 -57
  186. package/dist/lib/config-file.d.ts.map +0 -1
  187. package/dist/lib/config-file.js +0 -136
  188. package/dist/lib/config-file.js.map +0 -1
  189. package/dist/lib/confirm.d.ts +0 -16
  190. package/dist/lib/confirm.d.ts.map +0 -1
  191. package/dist/lib/confirm.js +0 -49
  192. package/dist/lib/confirm.js.map +0 -1
  193. package/dist/lib/ecp-home.d.ts +0 -20
  194. package/dist/lib/ecp-home.d.ts.map +0 -1
  195. package/dist/lib/ecp-home.js +0 -35
  196. package/dist/lib/ecp-home.js.map +0 -1
  197. package/dist/lib/editor.d.ts +0 -24
  198. package/dist/lib/editor.d.ts.map +0 -1
  199. package/dist/lib/editor.js +0 -55
  200. package/dist/lib/editor.js.map +0 -1
  201. package/dist/lib/ensure-plugins.d.ts +0 -17
  202. package/dist/lib/ensure-plugins.d.ts.map +0 -1
  203. package/dist/lib/ensure-plugins.js +0 -47
  204. package/dist/lib/ensure-plugins.js.map +0 -1
  205. package/dist/lib/evaluate-trust.d.ts +0 -26
  206. package/dist/lib/evaluate-trust.d.ts.map +0 -1
  207. package/dist/lib/evaluate-trust.js +0 -87
  208. package/dist/lib/evaluate-trust.js.map +0 -1
  209. package/dist/lib/export-environment.d.ts +0 -27
  210. package/dist/lib/export-environment.d.ts.map +0 -1
  211. package/dist/lib/export-environment.js +0 -54
  212. package/dist/lib/export-environment.js.map +0 -1
  213. package/dist/lib/format-output.d.ts +0 -17
  214. package/dist/lib/format-output.d.ts.map +0 -1
  215. package/dist/lib/format-output.js +0 -63
  216. package/dist/lib/format-output.js.map +0 -1
  217. package/dist/lib/init/collect-env-packages.d.ts +0 -14
  218. package/dist/lib/init/collect-env-packages.d.ts.map +0 -1
  219. package/dist/lib/init/collect-env-packages.js +0 -36
  220. package/dist/lib/init/collect-env-packages.js.map +0 -1
  221. package/dist/lib/init/merge-package-json.d.ts +0 -29
  222. package/dist/lib/init/merge-package-json.d.ts.map +0 -1
  223. package/dist/lib/init/merge-package-json.js +0 -56
  224. package/dist/lib/init/merge-package-json.js.map +0 -1
  225. package/dist/lib/installed-plugins.d.ts +0 -25
  226. package/dist/lib/installed-plugins.d.ts.map +0 -1
  227. package/dist/lib/installed-plugins.js +0 -22
  228. package/dist/lib/installed-plugins.js.map +0 -1
  229. package/dist/lib/jit-plugins.d.ts +0 -13
  230. package/dist/lib/jit-plugins.d.ts.map +0 -1
  231. package/dist/lib/jit-plugins.js +0 -25
  232. package/dist/lib/jit-plugins.js.map +0 -1
  233. package/dist/lib/layer-environment.d.ts +0 -51
  234. package/dist/lib/layer-environment.d.ts.map +0 -1
  235. package/dist/lib/layer-environment.js +0 -150
  236. package/dist/lib/layer-environment.js.map +0 -1
  237. package/dist/lib/load-ecp.d.ts +0 -23
  238. package/dist/lib/load-ecp.d.ts.map +0 -1
  239. package/dist/lib/load-ecp.js +0 -50
  240. package/dist/lib/load-ecp.js.map +0 -1
  241. package/dist/lib/missing-plugins.d.ts +0 -24
  242. package/dist/lib/missing-plugins.d.ts.map +0 -1
  243. package/dist/lib/missing-plugins.js +0 -53
  244. package/dist/lib/missing-plugins.js.map +0 -1
  245. package/dist/lib/npm-registry.d.ts +0 -40
  246. package/dist/lib/npm-registry.d.ts.map +0 -1
  247. package/dist/lib/npm-registry.js +0 -68
  248. package/dist/lib/npm-registry.js.map +0 -1
  249. package/dist/lib/plugin-bindings.d.ts +0 -13
  250. package/dist/lib/plugin-bindings.d.ts.map +0 -1
  251. package/dist/lib/plugin-bindings.js +0 -49
  252. package/dist/lib/plugin-bindings.js.map +0 -1
  253. package/dist/lib/plugin-source.d.ts +0 -11
  254. package/dist/lib/plugin-source.d.ts.map +0 -1
  255. package/dist/lib/plugin-source.js +0 -32
  256. package/dist/lib/plugin-source.js.map +0 -1
  257. package/dist/lib/prepare-workflow.d.ts +0 -27
  258. package/dist/lib/prepare-workflow.d.ts.map +0 -1
  259. package/dist/lib/prepare-workflow.js +0 -82
  260. package/dist/lib/prepare-workflow.js.map +0 -1
  261. package/dist/lib/runs-io.d.ts +0 -30
  262. package/dist/lib/runs-io.d.ts.map +0 -1
  263. package/dist/lib/runs-io.js +0 -154
  264. package/dist/lib/runs-io.js.map +0 -1
  265. package/dist/lib/secrets/store.d.ts +0 -4
  266. package/dist/lib/secrets/store.d.ts.map +0 -1
  267. package/dist/lib/secrets/store.js +0 -6
  268. package/dist/lib/secrets/store.js.map +0 -1
  269. package/dist/lib/trust-store.d.ts +0 -12
  270. package/dist/lib/trust-store.d.ts.map +0 -1
  271. package/dist/lib/trust-store.js +0 -33
  272. package/dist/lib/trust-store.js.map +0 -1
  273. package/dist/operations/catalog.d.ts +0 -7
  274. package/dist/operations/catalog.d.ts.map +0 -1
  275. package/dist/operations/catalog.js +0 -138
  276. package/dist/operations/catalog.js.map +0 -1
  277. package/dist/operations/config.d.ts +0 -7
  278. package/dist/operations/config.d.ts.map +0 -1
  279. package/dist/operations/config.js +0 -84
  280. package/dist/operations/config.js.map +0 -1
  281. package/dist/operations/discover.d.ts +0 -3
  282. package/dist/operations/discover.d.ts.map +0 -1
  283. package/dist/operations/discover.js +0 -61
  284. package/dist/operations/discover.js.map +0 -1
  285. package/dist/operations/environments.d.ts +0 -5
  286. package/dist/operations/environments.d.ts.map +0 -1
  287. package/dist/operations/environments.js +0 -73
  288. package/dist/operations/environments.js.map +0 -1
  289. package/dist/operations/index.d.ts +0 -4
  290. package/dist/operations/index.d.ts.map +0 -1
  291. package/dist/operations/index.js +0 -42
  292. package/dist/operations/index.js.map +0 -1
  293. package/dist/operations/init.d.ts +0 -3
  294. package/dist/operations/init.d.ts.map +0 -1
  295. package/dist/operations/init.js +0 -46
  296. package/dist/operations/init.js.map +0 -1
  297. package/dist/operations/install.d.ts +0 -3
  298. package/dist/operations/install.d.ts.map +0 -1
  299. package/dist/operations/install.js +0 -35
  300. package/dist/operations/install.js.map +0 -1
  301. package/dist/operations/plugins.d.ts +0 -7
  302. package/dist/operations/plugins.d.ts.map +0 -1
  303. package/dist/operations/plugins.js +0 -64
  304. package/dist/operations/plugins.js.map +0 -1
  305. package/dist/operations/runs.d.ts +0 -11
  306. package/dist/operations/runs.d.ts.map +0 -1
  307. package/dist/operations/runs.js +0 -206
  308. package/dist/operations/runs.js.map +0 -1
  309. package/dist/operations/secrets.d.ts +0 -11
  310. package/dist/operations/secrets.d.ts.map +0 -1
  311. package/dist/operations/secrets.js +0 -134
  312. package/dist/operations/secrets.js.map +0 -1
  313. package/dist/operations/workflow.d.ts +0 -9
  314. package/dist/operations/workflow.d.ts.map +0 -1
  315. package/dist/operations/workflow.js +0 -167
  316. package/dist/operations/workflow.js.map +0 -1
@@ -1,61 +0,0 @@
1
- import { z } from "zod";
2
- import { defineOperation, EcpCliError, EXIT_FAILED } from "@executioncontrolprotocol/plugin-sdk";
3
- import { confirm } from "../lib/confirm.js";
4
- import { installedPluginNames } from "../lib/installed-plugins.js";
5
- import { isFirstPartyPackage, searchEcpPlugins } from "../lib/npm-registry.js";
6
- function sortHits(hits, field, order) {
7
- const dir = order === "desc" ? -1 : 1;
8
- const key = field === "date" ? "date" : "name";
9
- return [...hits].sort((a, b) => {
10
- const left = key === "date" ? a.date ?? "" : a.name;
11
- const right = key === "date" ? b.date ?? "" : b.name;
12
- return left.localeCompare(right) * dir;
13
- });
14
- }
15
- /** `ecp plugins discover`. @category CLI */
16
- export const discoverOperation = defineOperation("plugins:discover")
17
- .withInput(z.object({
18
- query: z.string().optional(),
19
- all: z.boolean().optional(),
20
- install: z.boolean().optional(),
21
- "sort-field": z.enum(["date", "name"]).optional(),
22
- "sort-order": z.enum(["asc", "desc"]).optional(),
23
- }))
24
- .withMetadata({
25
- summary: "Discover ECP plugins on npm",
26
- description: "Search the npm registry for packages tagged ecosystem:ecp-plugin. First-party packages are marked; installed plugins are hidden unless --all.",
27
- useCases: ["Find a plugin to install", "List first-party plugins"],
28
- examples: ["ecp plugins discover jsonata --json", "ecp plugins discover --sort-field name"],
29
- cli: { args: ["query"] },
30
- })
31
- .withHandler(async (input, ctx) => {
32
- let hits;
33
- try {
34
- hits = await searchEcpPlugins(input.query ? String(input.query) : "");
35
- }
36
- catch (err) {
37
- throw new EcpCliError("ECP_DISCOVER_FAILED", err instanceof Error ? err.message : String(err), { exitCode: EXIT_FAILED });
38
- }
39
- const installed = installedPluginNames(ctx.config);
40
- const visible = input.all ? hits : hits.filter((hit) => !installed.has(hit.name));
41
- const sorted = sortHits(visible, input["sort-field"] ? String(input["sort-field"]) : "name", String(input["sort-order"] ?? "asc"));
42
- const rows = sorted.map((hit) => ({
43
- name: hit.name,
44
- version: hit.version,
45
- description: hit.description,
46
- firstParty: isFirstPartyPackage(hit.name),
47
- installed: installed.has(hit.name),
48
- }));
49
- if (input.install && rows.length > 0) {
50
- const names = rows.map((row) => row.name);
51
- const ok = await confirm(`Install ${names.length} plugin(s)?`, ctx.argv);
52
- if (ok) {
53
- for (const name of names) {
54
- await ctx.config.runCommand("plugins:install", [name]);
55
- }
56
- }
57
- }
58
- return { plugins: rows };
59
- })
60
- .build();
61
- //# sourceMappingURL=discover.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"discover.js","sourceRoot":"","sources":["../../src/operations/discover.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAA;AAChG,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAqB,MAAM,wBAAwB,CAAA;AAEjG,SAAS,QAAQ,CACf,IAAoB,EACpB,KAAyB,EACzB,KAAyB;IAEzB,MAAM,GAAG,GAAG,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACrC,MAAM,GAAG,GAAG,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAA;IAC9C,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAC7B,MAAM,IAAI,GAAG,GAAG,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;QACnD,MAAM,KAAK,GAAG,GAAG,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;QACpD,OAAO,IAAI,CAAC,aAAa,CAAC,KAAK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AAI,EAAE,EAAE,CAAC;YACP,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;gBACzB,MAAM,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAC,IAAI,CAAC,CAAC,CAAA;YACxD,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;AAC1B,CAAC,CAAC;KACD,KAAK,EAAE,CAAA"}
@@ -1,5 +0,0 @@
1
- /** `ecp environments` topic help. @category CLI */
2
- export declare const environmentsTopicOperation: import("@executioncontrolprotocol/plugin-sdk").OperationDefinition;
3
- /** `ecp environments export`. @category CLI */
4
- export declare const environmentsExportOperation: import("@executioncontrolprotocol/plugin-sdk").OperationDefinition;
5
- //# sourceMappingURL=environments.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"environments.d.ts","sourceRoot":"","sources":["../../src/operations/environments.ts"],"names":[],"mappings":"AA6BA,mDAAmD;AACnD,eAAO,MAAM,0BAA0B,oEAoB7B,CAAA;AAEV,+CAA+C;AAC/C,eAAO,MAAM,2BAA2B,oEAkC9B,CAAA"}
@@ -1,73 +0,0 @@
1
- import { z } from "zod";
2
- import { loadWorkflowFile } from "@executioncontrolprotocol/node";
3
- import { defineOperation, EcpCliError, ECP_WORKFLOW_LOAD, EXIT_USAGE, } from "@executioncontrolprotocol/plugin-sdk";
4
- import { EcpError } from "@executioncontrolprotocol/core/types";
5
- import { CONFIG_FLAG_HELP } from "../lib/config-file.js";
6
- import { packageJsonFromRequirements, packagesFromEnvironmentFile, writePackageJsonArtifact, } from "../lib/export-environment.js";
7
- function asLoadError(err) {
8
- if (err instanceof EcpCliError)
9
- throw err;
10
- if (err instanceof EcpError) {
11
- throw new EcpCliError(err.code, err.message, {
12
- path: err.path,
13
- suggestions: err.suggestions,
14
- exitCode: err.code === ECP_WORKFLOW_LOAD ? EXIT_USAGE : 1,
15
- details: err.details,
16
- });
17
- }
18
- throw err;
19
- }
20
- /** `ecp environments` topic help. @category CLI */
21
- export const environmentsTopicOperation = defineOperation("environments")
22
- .withInput(z.object({}))
23
- .withMetadata({
24
- summary: "Inspect the process environment",
25
- description: "Subcommands: describe, search, invoke, export. The environment is the Node host plus installed plugins. Use --config for machine settings.",
26
- useCases: ["Describe installed capabilities"],
27
- })
28
- .withHandler(async () => [
29
- "Usage: ecp environments <subcommand>",
30
- "",
31
- " describe [id] Catalog of extensions, capabilities, and policies",
32
- " search QUERY Rank installed capabilities for an intent",
33
- " invoke CAPABILITY Call one capability without a workflow",
34
- " export Project the environment to package.json",
35
- "",
36
- "Run ecp environments <cmd> --help for flags.",
37
- ].join("\n"))
38
- .build();
39
- /** `ecp environments export`. @category CLI */
40
- export const environmentsExportOperation = defineOperation("environments:export")
41
- .withInput(z.object({
42
- "workflow-path": z.string().optional(),
43
- config: z.string().optional().describe(CONFIG_FLAG_HELP),
44
- format: z.enum(["package-json"]),
45
- output: z.string().optional(),
46
- }))
47
- .withMetadata({
48
- summary: "Export an environment to a foreign-runtime manifest",
49
- description: "Project the Node host, an optional --config file, and requirements inferred from a workflow into package.json. Never copies secret values.",
50
- useCases: ["Generate package.json dependencies from a workflow and environment"],
51
- examples: [
52
- "ecp environments export --format package-json",
53
- "ecp environments export brief.ecp.ts --format package-json --output package.json",
54
- ],
55
- cli: { args: ["workflow-path"] },
56
- })
57
- .withHandler(async (input) => {
58
- let requirements;
59
- if (input["workflow-path"]) {
60
- try {
61
- const loaded = await loadWorkflowFile(String(input["workflow-path"]));
62
- requirements = loaded.requirements.requirements;
63
- }
64
- catch (err) {
65
- asLoadError(err);
66
- }
67
- }
68
- const extra = input.config ? await packagesFromEnvironmentFile(String(input.config)) : [];
69
- const document = packageJsonFromRequirements(requirements, extra);
70
- return writePackageJsonArtifact(document, input.output ? String(input.output) : undefined);
71
- })
72
- .build();
73
- //# sourceMappingURL=environments.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"environments.js","sourceRoot":"","sources":["../../src/operations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,MAAM,2BAA2B,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IACzF,MAAM,QAAQ,GAAG,2BAA2B,CAAC,YAAY,EAAE,KAAK,CAAC,CAAA;IACjE,OAAO,wBAAwB,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;AAC5F,CAAC,CAAC;KACD,KAAK,EAAE,CAAA"}
@@ -1,4 +0,0 @@
1
- import type { OperationDefinition } from "@executioncontrolprotocol/plugin-sdk";
2
- /** Host operations compiled into the CLI `COMMANDS` map. @category CLI */
3
- export declare const operations: OperationDefinition[];
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/operations/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAA;AAoC/E,0EAA0E;AAC1E,eAAO,MAAM,UAAU,EAAE,mBAAmB,EA6B3C,CAAA"}
@@ -1,42 +0,0 @@
1
- import { describeOperation, invokeOperation, searchOperation } from "./catalog.js";
2
- import { configEditOperation, configInitOperation, configTopicOperation } from "./config.js";
3
- import { discoverOperation } from "./discover.js";
4
- import { environmentsExportOperation, environmentsTopicOperation, } from "./environments.js";
5
- import { initOperation } from "./init.js";
6
- import { pluginsBuildOperation, pluginsCheckOperation, pluginsNewOperation, } from "./plugins.js";
7
- import { configSecretsAddOperation, configSecretsGetOperation, configSecretsListOperation, configSecretsOperation, configSecretsRemoveOperation, } from "./secrets.js";
8
- import { runsListOperation, runsRerunOperation, runsResumeOperation, runsShowOperation, runsTopicOperation, } from "./runs.js";
9
- import { installOperation } from "./install.js";
10
- import { compileOperation, runOperation, validateOperation, workflowsTopicOperation, } from "./workflow.js";
11
- /** Host operations compiled into the CLI `COMMANDS` map. @category CLI */
12
- export const operations = [
13
- workflowsTopicOperation,
14
- runOperation,
15
- initOperation,
16
- validateOperation,
17
- compileOperation,
18
- installOperation,
19
- environmentsTopicOperation,
20
- describeOperation,
21
- searchOperation,
22
- invokeOperation,
23
- environmentsExportOperation,
24
- runsTopicOperation,
25
- runsListOperation,
26
- runsShowOperation,
27
- runsResumeOperation,
28
- runsRerunOperation,
29
- configTopicOperation,
30
- configInitOperation,
31
- configEditOperation,
32
- configSecretsOperation,
33
- configSecretsAddOperation,
34
- configSecretsGetOperation,
35
- configSecretsListOperation,
36
- configSecretsRemoveOperation,
37
- pluginsNewOperation,
38
- pluginsBuildOperation,
39
- pluginsCheckOperation,
40
- discoverOperation,
41
- ];
42
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/operations/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAClF,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAC5F,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,GAC3B,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,0BAA0B,EAC1B,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,eAAe,CAAA;AAEtB,0EAA0E;AAC1E,MAAM,CAAC,MAAM,UAAU,GAA0B;IAC/C,uBAAuB;IACvB,YAAY;IACZ,aAAa;IACb,iBAAiB;IACjB,gBAAgB;IAChB,gBAAgB;IAChB,0BAA0B;IAC1B,iBAAiB;IACjB,eAAe;IACf,eAAe;IACf,2BAA2B;IAC3B,kBAAkB;IAClB,iBAAiB;IACjB,iBAAiB;IACjB,mBAAmB;IACnB,kBAAkB;IAClB,oBAAoB;IACpB,mBAAmB;IACnB,mBAAmB;IACnB,sBAAsB;IACtB,yBAAyB;IACzB,yBAAyB;IACzB,0BAA0B;IAC1B,4BAA4B;IAC5B,mBAAmB;IACnB,qBAAqB;IACrB,qBAAqB;IACrB,iBAAiB;CAClB,CAAA"}
@@ -1,3 +0,0 @@
1
- /** `ecp workflows init`. @category CLI */
2
- export declare const initOperation: import("@executioncontrolprotocol/plugin-sdk").OperationDefinition;
3
- //# sourceMappingURL=init.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/operations/init.ts"],"names":[],"mappings":"AA2BA,0CAA0C;AAC1C,eAAO,MAAM,aAAa,oEAqBhB,CAAA"}
@@ -1,46 +0,0 @@
1
- import { z } from "zod";
2
- import { writeFile } from "node:fs/promises";
3
- import { resolve } from "node:path";
4
- import { defineOperation } from "@executioncontrolprotocol/plugin-sdk";
5
- function scaffold(name) {
6
- const label = name.replace(/\.ecp\.ts$/i, "").replace(/[-_]/g, " ");
7
- return `import { workflow, step, extension } from "@executioncontrolprotocol/core"
8
-
9
- /**
10
- * Generated by \`ecp workflows init\`.
11
- * Search for capabilities with \`ecp environments search <query>\`, then replace the step below.
12
- */
13
- export default workflow("${label}")
14
- .with([
15
- // Bind plugins this file needs, for example:
16
- // extension("@executioncontrolprotocol/jsonata"),
17
- ])
18
- .run([
19
- step("@executioncontrolprotocol/jsonata.transform", "Transform").with({
20
- expression: "$",
21
- data: { hello: "ecp" },
22
- }).as("out"),
23
- ])
24
- `;
25
- }
26
- /** `ecp workflows init`. @category CLI */
27
- export const initOperation = defineOperation("workflows:init")
28
- .withInput(z.object({
29
- name: z.string().optional(),
30
- }))
31
- .withMetadata({
32
- summary: "Create a workflow file",
33
- description: "Write <name>.ecp.ts with a jsonata.transform step. Use ecp environments search to find capabilities.",
34
- useCases: ["Start a new workflow file"],
35
- examples: ["ecp workflows init", "ecp workflows init brief"],
36
- cli: { args: ["name"] },
37
- })
38
- .withHandler(async (input) => {
39
- const raw = input.name ? String(input.name) : "workflow";
40
- const fileName = raw.endsWith(".ecp.ts") ? raw : `${raw.replace(/\.ts$/i, "")}.ecp.ts`;
41
- const path = resolve(fileName);
42
- await writeFile(path, scaffold(fileName), "utf8");
43
- return { path };
44
- })
45
- .build();
46
- //# sourceMappingURL=init.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/operations/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAA;AAEtE,SAAS,QAAQ,CAAC,IAAY;IAC5B,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;IACnE,OAAO;;;;;;2BAMkB,KAAK;;;;;;;;;;;CAW/B,CAAA;AACD,CAAC;AAED,0CAA0C;AAC1C,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAC,gBAAgB,CAAC;KAC3D,SAAS,CACR,CAAC,CAAC,MAAM,CAAC;IACP,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC5B,CAAC,CACH;KACA,YAAY,CAAC;IACZ,OAAO,EAAE,wBAAwB;IACjC,WAAW,EACT,sGAAsG;IACxG,QAAQ,EAAE,CAAC,2BAA2B,CAAC;IACvC,QAAQ,EAAE,CAAC,oBAAoB,EAAE,0BAA0B,CAAC;IAC5D,GAAG,EAAE,EAAE,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE;CACxB,CAAC;KACD,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;IAC3B,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU,CAAA;IACxD,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,SAAS,CAAA;IACtF,MAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;IAC9B,MAAM,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAA;IACjD,OAAO,EAAE,IAAI,EAAE,CAAA;AACjB,CAAC,CAAC;KACD,KAAK,EAAE,CAAA"}
@@ -1,3 +0,0 @@
1
- /** `ecp workflows install`. @category CLI */
2
- export declare const installOperation: import("@executioncontrolprotocol/plugin-sdk").OperationDefinition;
3
- //# sourceMappingURL=install.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../src/operations/install.ts"],"names":[],"mappings":"AAMA,6CAA6C;AAC7C,eAAO,MAAM,gBAAgB,oEA8BnB,CAAA"}
@@ -1,35 +0,0 @@
1
- import { z } from "zod";
2
- import { defineOperation } from "@executioncontrolprotocol/plugin-sdk";
3
- import { CONFIG_FLAG_HELP } from "../lib/config-file.js";
4
- import { prepareWorkflowRun } from "../lib/prepare-workflow.js";
5
- import { terminateIfNeeded } from "../lib/load-ecp.js";
6
- /** `ecp workflows install`. @category CLI */
7
- export const installOperation = defineOperation("workflows:install")
8
- .withInput(z.object({
9
- "workflow-path": z.string(),
10
- config: z.string().optional().describe(CONFIG_FLAG_HELP),
11
- }))
12
- .withMetadata({
13
- summary: "Install plugins a workflow file requires",
14
- description: "Infer required plugins from the workflow file and install them without running the workflow.",
15
- useCases: ["Prepare a machine to run a workflow file"],
16
- examples: ["ecp workflows install brief.ecp.ts", "ecp workflows install brief.ecp.ts --yes"],
17
- cli: { args: ["workflow-path"] },
18
- })
19
- .withHandler(async (input, ctx) => {
20
- const { loaded, ecp, terminate } = await prepareWorkflowRun({
21
- workflowPath: String(input["workflow-path"]),
22
- configFlag: input.config ? String(input.config) : undefined,
23
- config: ctx.config,
24
- argv: ctx.argv,
25
- json: ctx.json,
26
- host: ctx.host,
27
- install: true,
28
- });
29
- await terminateIfNeeded(ecp, terminate);
30
- return {
31
- requirements: loaded.requirements.requirements,
32
- };
33
- })
34
- .build();
35
- //# sourceMappingURL=install.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"install.js","sourceRoot":"","sources":["../../src/operations/install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAA;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAEtD,6CAA6C;AAC7C,MAAM,CAAC,MAAM,gBAAgB,GAAG,eAAe,CAAC,mBAAmB,CAAC;KACjE,SAAS,CACR,CAAC,CAAC,MAAM,CAAC;IACP,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE;IAC3B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;CACzD,CAAC,CACH;KACA,YAAY,CAAC;IACZ,OAAO,EAAE,0CAA0C;IACnD,WAAW,EACT,8FAA8F;IAChG,QAAQ,EAAE,CAAC,0CAA0C,CAAC;IACtD,QAAQ,EAAE,CAAC,oCAAoC,EAAE,0CAA0C,CAAC;IAC5F,GAAG,EAAE,EAAE,IAAI,EAAE,CAAC,eAAe,CAAC,EAAE;CACjC,CAAC;KACD,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;IAChC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,MAAM,kBAAkB,CAAC;QAC1D,YAAY,EAAE,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;QAC5C,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS;QAC3D,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,OAAO,EAAE,IAAI;KACd,CAAC,CAAA;IACF,MAAM,iBAAiB,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;IACvC,OAAO;QACL,YAAY,EAAE,MAAM,CAAC,YAAY,CAAC,YAAY;KAC/C,CAAA;AACH,CAAC,CAAC;KACD,KAAK,EAAE,CAAA"}
@@ -1,7 +0,0 @@
1
- /** `ecp plugins new`. @category CLI */
2
- export declare const pluginsNewOperation: import("@executioncontrolprotocol/plugin-sdk").OperationDefinition;
3
- /** `ecp plugins build`. @category CLI */
4
- export declare const pluginsBuildOperation: import("@executioncontrolprotocol/plugin-sdk").OperationDefinition;
5
- /** `ecp plugins check`. @category CLI */
6
- export declare const pluginsCheckOperation: import("@executioncontrolprotocol/plugin-sdk").OperationDefinition;
7
- //# sourceMappingURL=plugins.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../src/operations/plugins.ts"],"names":[],"mappings":"AAiBA,uCAAuC;AACvC,eAAO,MAAM,mBAAmB,oEAetB,CAAA;AAEV,yCAAyC;AACzC,eAAO,MAAM,qBAAqB,oEAsBxB,CAAA;AAEV,yCAAyC;AACzC,eAAO,MAAM,qBAAqB,oEAqBxB,CAAA"}
@@ -1,64 +0,0 @@
1
- import { z } from "zod";
2
- import { resolve } from "node:path";
3
- import { buildPlugin, checkPlugin, defineOperation, EcpCliError, EXIT_FAILED, EXIT_USAGE, scaffoldPlugin, } from "@executioncontrolprotocol/plugin-sdk";
4
- function pluginDir(name) {
5
- const slug = name.replace(/^@[^/]+\//, "").replace(/^plugin-/, "");
6
- return resolve(process.cwd(), `plugin-${slug}`);
7
- }
8
- /** `ecp plugins new`. @category CLI */
9
- export const pluginsNewOperation = defineOperation("plugins:new")
10
- .withInput(z.object({ name: z.string() }))
11
- .withMetadata({
12
- summary: "Scaffold an ECP plugin",
13
- description: "Write src/index.ts and a minimal package.json. Then run ecp plugins build.",
14
- useCases: ["Start a new first-party or third-party plugin"],
15
- examples: ["ecp plugins new jsonata"],
16
- cli: { args: ["name"] },
17
- })
18
- .withHandler(async (input) => {
19
- const name = String(input.name);
20
- const dir = pluginDir(name);
21
- await scaffoldPlugin(dir, name);
22
- return { dir, name };
23
- })
24
- .build();
25
- /** `ecp plugins build`. @category CLI */
26
- export const pluginsBuildOperation = defineOperation("plugins:build")
27
- .withInput(z.object({ dir: z.string().optional() }))
28
- .withMetadata({
29
- summary: "Generate oclif files for a plugin",
30
- description: "Write generated package.json fields, dist/oclif.js, and oclif.manifest.json from the compiled definition.",
31
- useCases: ["Refresh generated CLI files after changing a definition"],
32
- examples: ["ecp plugins build", "ecp plugins build plugins/plugin-jsonata"],
33
- cli: { args: ["dir"] },
34
- })
35
- .withHandler(async (input) => {
36
- const dir = resolve(input.dir ? String(input.dir) : process.cwd());
37
- try {
38
- return await buildPlugin(dir);
39
- }
40
- catch (err) {
41
- throw new EcpCliError("ECP_PLUGIN_BUILD", err instanceof Error ? err.message : String(err), { exitCode: EXIT_FAILED });
42
- }
43
- })
44
- .build();
45
- /** `ecp plugins check`. @category CLI */
46
- export const pluginsCheckOperation = defineOperation("plugins:check")
47
- .withInput(z.object({ dir: z.string().optional() }))
48
- .withMetadata({
49
- summary: "Fail if generated plugin files are stale",
50
- description: "Compare package.json, dist/oclif.js, and oclif.manifest.json to the compiled definition.",
51
- useCases: ["CI gate for plugin packages"],
52
- examples: ["ecp plugins check plugins/plugin-jsonata"],
53
- cli: { args: ["dir"] },
54
- })
55
- .withHandler(async (input) => {
56
- const dir = resolve(input.dir ? String(input.dir) : process.cwd());
57
- const report = await checkPlugin(dir);
58
- if (!report.ok) {
59
- throw new EcpCliError("ECP_PLUGIN_STALE", report.issues.map((issue) => `${issue.path}: ${issue.message}`).join("\n"), { exitCode: EXIT_USAGE, suggestions: ["Run ecp plugins build"] });
60
- }
61
- return report;
62
- })
63
- .build();
64
- //# sourceMappingURL=plugins.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../src/operations/plugins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EACL,WAAW,EACX,WAAW,EACX,eAAe,EACf,WAAW,EACX,WAAW,EACX,UAAU,EACV,cAAc,GACf,MAAM,sCAAsC,CAAA;AAE7C,SAAS,SAAS,CAAC,IAAY;IAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAA;IAClE,OAAO,OAAO,CAAC,OAAO,C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C,CAAA;IACrC,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,MAAM,IAAI,WAAW,CACnB,kBAAkB,EAClB,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAC1E,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC,uBAAuB,CAAC,EAAE,CACjE,CAAA;IACH,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC,CAAC;KACD,KAAK,EAAE,CAAA"}
@@ -1,11 +0,0 @@
1
- /** `ecp runs` topic help. @category CLI */
2
- export declare const runsTopicOperation: import("@executioncontrolprotocol/plugin-sdk").OperationDefinition;
3
- /** `ecp runs list`. @category CLI */
4
- export declare const runsListOperation: import("@executioncontrolprotocol/plugin-sdk").OperationDefinition;
5
- /** `ecp runs show`. @category CLI */
6
- export declare const runsShowOperation: import("@executioncontrolprotocol/plugin-sdk").OperationDefinition;
7
- /** `ecp runs resume`. @category CLI */
8
- export declare const runsResumeOperation: import("@executioncontrolprotocol/plugin-sdk").OperationDefinition;
9
- /** `ecp runs rerun`. @category CLI */
10
- export declare const runsRerunOperation: import("@executioncontrolprotocol/plugin-sdk").OperationDefinition;
11
- //# sourceMappingURL=runs.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../../src/operations/runs.ts"],"names":[],"mappings":"AAiCA,2CAA2C;AAC3C,eAAO,MAAM,kBAAkB,oEAmBrB,CAAA;AAEV,qCAAqC;AACrC,eAAO,MAAM,iBAAiB,oEAuBpB,CAAA;AAEV,qCAAqC;AACrC,eAAO,MAAM,iBAAiB,oEAmBpB,CAAA;AAEV,uCAAuC;AACvC,eAAO,MAAM,mBAAmB,oEA4DtB,CAAA;AAEV,sCAAsC;AACtC,eAAO,MAAM,kBAAkB,oEA2DrB,CAAA"}
@@ -1,206 +0,0 @@
1
- import { z } from "zod";
2
- import { readFile } from "node:fs/promises";
3
- import { NODE_ENVIRONMENT_ID } from "@executioncontrolprotocol/node";
4
- import { defineOperation, EcpCliError, ECP_RERUN_INCOMPATIBLE, EXIT_USAGE, } from "@executioncontrolprotocol/plugin-sdk";
5
- import { EcpError } from "@executioncontrolprotocol/core/types";
6
- import { CONFIG_FLAG_HELP } from "../lib/config-file.js";
7
- import { prepareWorkflowRun, throwIfRunFailed } from "../lib/prepare-workflow.js";
8
- import { terminateIfNeeded } from "../lib/load-ecp.js";
9
- import { hashWorkflowSource, listRunJournals, loadParentRun, pluginVersions, readStepJournal, runOptionsFromJournal, } from "../lib/runs-io.js";
10
- function asCli(err) {
11
- if (err instanceof EcpCliError)
12
- throw err;
13
- if (err instanceof EcpError) {
14
- throw new EcpCliError(err.code, err.message, {
15
- suggestions: err.suggestions,
16
- exitCode: err.code === ECP_RERUN_INCOMPATIBLE ? EXIT_USAGE : 1,
17
- });
18
- }
19
- throw err;
20
- }
21
- /** `ecp runs` topic help. @category CLI */
22
- export const runsTopicOperation = defineOperation("runs")
23
- .withInput(z.object({}))
24
- .withMetadata({
25
- summary: "Inspect and continue workflow runs",
26
- description: "Subcommands: list, show, resume, rerun.",
27
- useCases: ["Resume a stopped or paused run"],
28
- })
29
- .withHandler(async () => [
30
- "Usage: ecp runs <subcommand>",
31
- "",
32
- " list Newest journals first",
33
- " show RUN-ID One journal (--step for a step file)",
34
- " resume RUN-ID Continue a stopped or paused run",
35
- " rerun RUN-ID Re-run from a step using the current file",
36
- "",
37
- "Run ecp runs <cmd> --help for flags.",
38
- ].join("\n"))
39
- .build();
40
- /** `ecp runs list`. @category CLI */
41
- export const runsListOperation = defineOperation("runs:list")
42
- .withInput(z.object({
43
- status: z.string().optional(),
44
- workflow: z.string().optional(),
45
- }))
46
- .withMetadata({
47
- summary: "List run journals",
48
- description: "Newest first. Filter with --status and --workflow.",
49
- useCases: ["Find a run id to resume"],
50
- examples: ["ecp runs list", "ecp runs list --status stopped"],
51
- })
52
- .withHandler(async (input) => {
53
- const status = input.status ? String(input.status) : undefined;
54
- const workflow = input.workflow ? String(input.workflow) : undefined;
55
- const docs = await listRunJournals();
56
- return docs.filter((doc) => {
57
- if (status && doc.status !== status)
58
- return false;
59
- if (workflow && doc.workflowPath !== workflow)
60
- return false;
61
- return true;
62
- });
63
- })
64
- .build();
65
- /** `ecp runs show`. @category CLI */
66
- export const runsShowOperation = defineOperation("runs:show")
67
- .withInput(z.object({
68
- "run-id": z.string(),
69
- step: z.string().optional(),
70
- }))
71
- .withMetadata({
72
- summary: "Show a run journal",
73
- description: "Print run.json, or one step with --step.",
74
- useCases: ["Inspect cursor, status, and per-step records"],
75
- examples: ["ecp runs show <id>", "ecp runs show <id> --step echo"],
76
- cli: { args: ["run-id"] },
77
- })
78
- .withHandler(async (input) => {
79
- const runId = String(input["run-id"]);
80
- if (input.step)
81
- return readStepJournal(runId, String(input.step));
82
- return loadParentRun(runId);
83
- })
84
- .build();
85
- /** `ecp runs resume`. @category CLI */
86
- export const runsResumeOperation = defineOperation("runs:resume")
87
- .withInput(z.object({
88
- "run-id": z.string(),
89
- config: z.string().optional().describe(CONFIG_FLAG_HELP),
90
- to: z.string().optional(),
91
- approve: z.boolean().optional(),
92
- }))
93
- .withMetadata({
94
- summary: "Resume a stopped or paused run",
95
- description: "Starts a new run from the journal cursor. --approve records an approval for the paused step.",
96
- useCases: ["Continue after ecp run --to", "Continue after a policy pause"],
97
- examples: ["ecp runs resume <id>", "ecp runs resume <id> --approve"],
98
- cli: { args: ["run-id"] },
99
- })
100
- .withHandler(async (input, ctx) => {
101
- const parent = await loadParentRun(String(input["run-id"]));
102
- if (!parent.workflowPath) {
103
- throw new EcpCliError("ECP_INPUT_INVALID", "Journal has no workflow path", {
104
- exitCode: EXIT_USAGE,
105
- });
106
- }
107
- const { loaded, ecp, terminate } = await prepareWorkflowRun({
108
- workflowPath: parent.workflowPath,
109
- configFlag: input.config ? String(input.config) : undefined,
110
- config: ctx.config,
111
- argv: ctx.argv,
112
- json: ctx.json,
113
- host: ctx.host,
114
- install: true,
115
- });
116
- try {
117
- const extras = await runOptionsFromJournal({
118
- parent,
119
- workflow: loaded.manifest,
120
- toStepId: input.to ? String(input.to) : undefined,
121
- approve: Boolean(input.approve),
122
- mode: "resume",
123
- });
124
- const source = await readFile(parent.workflowPath, "utf8");
125
- const result = await ecp.run(loaded.manifest, {
126
- ...extras,
127
- journal: {
128
- workflowPath: parent.workflowPath,
129
- workflowHash: hashWorkflowSource(source),
130
- pluginVersions: pluginVersions(ctx.config),
131
- environmentId: NODE_ENVIRONMENT_ID,
132
- parentRunId: parent.runId,
133
- resumedFrom: parent.runId,
134
- },
135
- });
136
- return throwIfRunFailed(result);
137
- }
138
- catch (err) {
139
- asCli(err);
140
- }
141
- finally {
142
- await terminateIfNeeded(ecp, terminate);
143
- }
144
- })
145
- .build();
146
- /** `ecp runs rerun`. @category CLI */
147
- export const runsRerunOperation = defineOperation("runs:rerun")
148
- .withInput(z.object({
149
- "run-id": z.string(),
150
- config: z.string().optional().describe(CONFIG_FLAG_HELP),
151
- from: z.string().optional(),
152
- to: z.string().optional(),
153
- }))
154
- .withMetadata({
155
- summary: "Rerun from a step using the current workflow file",
156
- description: "Restores steps before --from from the journal. Default --from is the first failed step. Default --to is the end.",
157
- useCases: ["Fix a step and rerun from there"],
158
- examples: ["ecp runs rerun <id> --from web", "ecp runs rerun <id> --from a --to a"],
159
- cli: { args: ["run-id"] },
160
- })
161
- .withHandler(async (input, ctx) => {
162
- const parent = await loadParentRun(String(input["run-id"]));
163
- if (!parent.workflowPath) {
164
- throw new EcpCliError("ECP_INPUT_INVALID", "Journal has no workflow path", {
165
- exitCode: EXIT_USAGE,
166
- });
167
- }
168
- const { loaded, ecp, terminate } = await prepareWorkflowRun({
169
- workflowPath: parent.workflowPath,
170
- configFlag: input.config ? String(input.config) : undefined,
171
- config: ctx.config,
172
- argv: ctx.argv,
173
- json: ctx.json,
174
- host: ctx.host,
175
- install: true,
176
- });
177
- try {
178
- const extras = await runOptionsFromJournal({
179
- parent,
180
- workflow: loaded.manifest,
181
- fromStepId: input.from ? String(input.from) : undefined,
182
- toStepId: input.to ? String(input.to) : undefined,
183
- mode: "rerun",
184
- });
185
- const source = await readFile(parent.workflowPath, "utf8");
186
- const result = await ecp.run(loaded.manifest, {
187
- ...extras,
188
- journal: {
189
- workflowPath: parent.workflowPath,
190
- workflowHash: hashWorkflowSource(source),
191
- pluginVersions: pluginVersions(ctx.config),
192
- environmentId: NODE_ENVIRONMENT_ID,
193
- parentRunId: parent.runId,
194
- },
195
- });
196
- return throwIfRunFailed(result);
197
- }
198
- catch (err) {
199
- asCli(err);
200
- }
201
- finally {
202
- await terminateIfNeeded(ecp, terminate);
203
- }
204
- })
205
- .build();
206
- //# sourceMappingURL=runs.js.map