@executioncontrolprotocol/cli 0.50.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 (292) hide show
  1. package/README.md +6 -156
  2. package/bin/dev.js +7 -3
  3. package/bin/ecp.js +6 -3
  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 -40
  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/trust.d.ts +0 -9
  166. package/dist/hooks/trust.d.ts.map +0 -1
  167. package/dist/hooks/trust.js +0 -32
  168. package/dist/hooks/trust.js.map +0 -1
  169. package/dist/lib/argv.d.ts +0 -11
  170. package/dist/lib/argv.d.ts.map +0 -1
  171. package/dist/lib/argv.js +0 -30
  172. package/dist/lib/argv.js.map +0 -1
  173. package/dist/lib/command-helpers.d.ts +0 -14
  174. package/dist/lib/command-helpers.d.ts.map +0 -1
  175. package/dist/lib/command-helpers.js +0 -37
  176. package/dist/lib/command-helpers.js.map +0 -1
  177. package/dist/lib/confirm.d.ts +0 -16
  178. package/dist/lib/confirm.d.ts.map +0 -1
  179. package/dist/lib/confirm.js +0 -49
  180. package/dist/lib/confirm.js.map +0 -1
  181. package/dist/lib/ensure-plugins.d.ts +0 -17
  182. package/dist/lib/ensure-plugins.d.ts.map +0 -1
  183. package/dist/lib/ensure-plugins.js +0 -38
  184. package/dist/lib/ensure-plugins.js.map +0 -1
  185. package/dist/lib/evaluate-trust.d.ts +0 -26
  186. package/dist/lib/evaluate-trust.d.ts.map +0 -1
  187. package/dist/lib/evaluate-trust.js +0 -87
  188. package/dist/lib/evaluate-trust.js.map +0 -1
  189. package/dist/lib/format-output.d.ts +0 -17
  190. package/dist/lib/format-output.d.ts.map +0 -1
  191. package/dist/lib/format-output.js +0 -63
  192. package/dist/lib/format-output.js.map +0 -1
  193. package/dist/lib/init/collect-env-packages.d.ts +0 -14
  194. package/dist/lib/init/collect-env-packages.d.ts.map +0 -1
  195. package/dist/lib/init/collect-env-packages.js +0 -36
  196. package/dist/lib/init/collect-env-packages.js.map +0 -1
  197. package/dist/lib/init/merge-package-json.d.ts +0 -29
  198. package/dist/lib/init/merge-package-json.d.ts.map +0 -1
  199. package/dist/lib/init/merge-package-json.js +0 -56
  200. package/dist/lib/init/merge-package-json.js.map +0 -1
  201. package/dist/lib/installed-plugins.d.ts +0 -25
  202. package/dist/lib/installed-plugins.d.ts.map +0 -1
  203. package/dist/lib/installed-plugins.js +0 -22
  204. package/dist/lib/installed-plugins.js.map +0 -1
  205. package/dist/lib/jit-plugins.d.ts +0 -13
  206. package/dist/lib/jit-plugins.d.ts.map +0 -1
  207. package/dist/lib/jit-plugins.js +0 -25
  208. package/dist/lib/jit-plugins.js.map +0 -1
  209. package/dist/lib/layer-environment.d.ts +0 -29
  210. package/dist/lib/layer-environment.d.ts.map +0 -1
  211. package/dist/lib/layer-environment.js +0 -96
  212. package/dist/lib/layer-environment.js.map +0 -1
  213. package/dist/lib/load-ecp.d.ts +0 -17
  214. package/dist/lib/load-ecp.d.ts.map +0 -1
  215. package/dist/lib/load-ecp.js +0 -39
  216. package/dist/lib/load-ecp.js.map +0 -1
  217. package/dist/lib/missing-plugins.d.ts +0 -24
  218. package/dist/lib/missing-plugins.d.ts.map +0 -1
  219. package/dist/lib/missing-plugins.js +0 -53
  220. package/dist/lib/missing-plugins.js.map +0 -1
  221. package/dist/lib/npm-registry.d.ts +0 -40
  222. package/dist/lib/npm-registry.d.ts.map +0 -1
  223. package/dist/lib/npm-registry.js +0 -68
  224. package/dist/lib/npm-registry.js.map +0 -1
  225. package/dist/lib/plugin-bindings.d.ts +0 -13
  226. package/dist/lib/plugin-bindings.d.ts.map +0 -1
  227. package/dist/lib/plugin-bindings.js +0 -49
  228. package/dist/lib/plugin-bindings.js.map +0 -1
  229. package/dist/lib/plugin-source.d.ts +0 -11
  230. package/dist/lib/plugin-source.d.ts.map +0 -1
  231. package/dist/lib/plugin-source.js +0 -32
  232. package/dist/lib/plugin-source.js.map +0 -1
  233. package/dist/lib/prepare-workflow.d.ts +0 -27
  234. package/dist/lib/prepare-workflow.d.ts.map +0 -1
  235. package/dist/lib/prepare-workflow.js +0 -76
  236. package/dist/lib/prepare-workflow.js.map +0 -1
  237. package/dist/lib/runs-io.d.ts +0 -30
  238. package/dist/lib/runs-io.d.ts.map +0 -1
  239. package/dist/lib/runs-io.js +0 -154
  240. package/dist/lib/runs-io.js.map +0 -1
  241. package/dist/lib/secrets/store.d.ts +0 -4
  242. package/dist/lib/secrets/store.d.ts.map +0 -1
  243. package/dist/lib/secrets/store.js +0 -6
  244. package/dist/lib/secrets/store.js.map +0 -1
  245. package/dist/lib/trust-store.d.ts +0 -12
  246. package/dist/lib/trust-store.d.ts.map +0 -1
  247. package/dist/lib/trust-store.js +0 -33
  248. package/dist/lib/trust-store.js.map +0 -1
  249. package/dist/operations/catalog.d.ts +0 -7
  250. package/dist/operations/catalog.d.ts.map +0 -1
  251. package/dist/operations/catalog.js +0 -108
  252. package/dist/operations/catalog.js.map +0 -1
  253. package/dist/operations/discover.d.ts +0 -3
  254. package/dist/operations/discover.d.ts.map +0 -1
  255. package/dist/operations/discover.js +0 -61
  256. package/dist/operations/discover.js.map +0 -1
  257. package/dist/operations/index.d.ts +0 -4
  258. package/dist/operations/index.d.ts.map +0 -1
  259. package/dist/operations/index.js +0 -38
  260. package/dist/operations/index.js.map +0 -1
  261. package/dist/operations/init.d.ts +0 -3
  262. package/dist/operations/init.d.ts.map +0 -1
  263. package/dist/operations/init.js +0 -46
  264. package/dist/operations/init.js.map +0 -1
  265. package/dist/operations/install.d.ts +0 -3
  266. package/dist/operations/install.d.ts.map +0 -1
  267. package/dist/operations/install.js +0 -34
  268. package/dist/operations/install.js.map +0 -1
  269. package/dist/operations/plugins.d.ts +0 -7
  270. package/dist/operations/plugins.d.ts.map +0 -1
  271. package/dist/operations/plugins.js +0 -64
  272. package/dist/operations/plugins.js.map +0 -1
  273. package/dist/operations/rollback.d.ts +0 -3
  274. package/dist/operations/rollback.d.ts.map +0 -1
  275. package/dist/operations/rollback.js +0 -25
  276. package/dist/operations/rollback.js.map +0 -1
  277. package/dist/operations/runs.d.ts +0 -11
  278. package/dist/operations/runs.d.ts.map +0 -1
  279. package/dist/operations/runs.js +0 -205
  280. package/dist/operations/runs.js.map +0 -1
  281. package/dist/operations/secrets.d.ts +0 -11
  282. package/dist/operations/secrets.d.ts.map +0 -1
  283. package/dist/operations/secrets.js +0 -134
  284. package/dist/operations/secrets.js.map +0 -1
  285. package/dist/operations/update.d.ts +0 -3
  286. package/dist/operations/update.d.ts.map +0 -1
  287. package/dist/operations/update.js +0 -64
  288. package/dist/operations/update.js.map +0 -1
  289. package/dist/operations/workflow.d.ts +0 -7
  290. package/dist/operations/workflow.d.ts.map +0 -1
  291. package/dist/operations/workflow.js +0 -144
  292. package/dist/operations/workflow.js.map +0 -1
@@ -1,34 +0,0 @@
1
- import { z } from "zod";
2
- import { defineOperation } from "@executioncontrolprotocol/plugin-sdk";
3
- import { prepareWorkflowRun } from "../lib/prepare-workflow.js";
4
- import { terminateIfNeeded } from "../lib/load-ecp.js";
5
- /** `ecp install`. @category CLI */
6
- export const installOperation = defineOperation("install")
7
- .withInput(z.object({
8
- "workflow-path": z.string(),
9
- env: z.string().optional(),
10
- }))
11
- .withMetadata({
12
- summary: "Install plugins a workflow file requires",
13
- description: "Infer required plugins from the workflow file and install them without running the workflow.",
14
- useCases: ["Prepare a machine to run a workflow file"],
15
- examples: ["ecp install brief.ecp.ts", "ecp install brief.ecp.ts --yes"],
16
- cli: { args: ["workflow-path"] },
17
- })
18
- .withHandler(async (input, ctx) => {
19
- const { loaded, ecp, terminate } = await prepareWorkflowRun({
20
- workflowPath: String(input["workflow-path"]),
21
- envFlag: input.env ? String(input.env) : undefined,
22
- config: ctx.config,
23
- argv: ctx.argv,
24
- json: ctx.json,
25
- host: ctx.host,
26
- install: true,
27
- });
28
- await terminateIfNeeded(ecp, terminate);
29
- return {
30
- requirements: loaded.requirements.requirements,
31
- };
32
- })
33
- .build();
34
- //# sourceMappingURL=install.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"install.js","sourceRoot":"","sources":["../../src/operations/install.ts"],"names":[],"mappings":"AAA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ACvC,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;AAC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C,CAAC;IACtD,GAAG,EAAE,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE;CACvB,CAAC;KACD,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;IAC3B,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;IAClE,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,GAAG,CAAC,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,3 +0,0 @@
1
- /** `ecp rollback`. @category CLI */
2
- export declare const rollbackOperation: import("@executioncontrolprotocol/plugin-sdk").OperationDefinition;
3
- //# sourceMappingURL=rollback.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rollback.d.ts","sourceRoot":"","sources":["../../src/operations/rollback.ts"],"names":[],"mappings":"AAIA,oCAAoC;AACpC,eAAO,MAAM,iBAAiB,oEAwBpB,CAAA"}
@@ -1,25 +0,0 @@
1
- import { z } from "zod";
2
- import { defineOperation } from "@executioncontrolprotocol/plugin-sdk";
3
- import { listInstalledPlugins } from "../lib/installed-plugins.js";
4
- /** `ecp rollback`. @category CLI */
5
- export const rollbackOperation = defineOperation("rollback")
6
- .withInput(z.object({}))
7
- .withMetadata({
8
- summary: "Remove user overrides of bundled plugins",
9
- description: "Uninstall user-installed plugins that shadow a bundled (core) plugin so the CLI copy is used again.",
10
- useCases: ["Undo a local override of a bundled plugin"],
11
- examples: ["ecp rollback"],
12
- })
13
- .withHandler(async (_input, ctx) => {
14
- const plugins = listInstalledPlugins(ctx.config);
15
- const coreNames = new Set(plugins.filter((plugin) => plugin.type === "core").map((plugin) => plugin.name));
16
- const overrides = plugins.filter((plugin) => (plugin.type === "user" || plugin.type === "link") && coreNames.has(plugin.name));
17
- const removed = [];
18
- for (const plugin of overrides) {
19
- await ctx.config.runCommand("plugins:uninstall", [plugin.name]);
20
- removed.push(plugin.name);
21
- }
22
- return { removed };
23
- })
24
- .build();
25
- //# sourceMappingURL=rollback.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rollback.js","sourceRoot":"","sources":["../../src/operations/rollback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAA;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AAElE,oCAAoC;AACpC,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC,UAAU,CAAC;KACzD,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;KACvB,YAAY,CAAC;IACZ,OAAO,EAAE,0CAA0C;IACnD,WAAW,EACT,qGAAqG;IACvG,QAAQ,EAAE,CAAC,2CAA2C,CAAC;IACvD,QAAQ,EAAE,CAAC,cAAc,CAAC;CAC3B,CAAC;KACD,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE;IACjC,MAAM,OAAO,GAAG,oBAAoB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;IAChD,MAAM,SAAS,GAAG,IAAI,GAAG,CACvB,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAChF,CAAA;IACD,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,CAC9B,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,KAAK,MAAM,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAC7F,CAAA;IACD,MAAM,OAAO,GAAa,EAAE,CAAA;IAC5B,KAAK,MAAM,MAAM,IAAI,SAAS,EAAE,CAAC;QAC/B,MAAM,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,mBAAmB,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAA;QAC/D,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IAC3B,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,CAAA;AACpB,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":"AAgCA,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,205 +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 { prepareWorkflowRun, throwIfRunFailed } from "../lib/prepare-workflow.js";
7
- import { terminateIfNeeded } from "../lib/load-ecp.js";
8
- import { hashWorkflowSource, listRunJournals, loadParentRun, pluginVersions, readStepJournal, runOptionsFromJournal, } from "../lib/runs-io.js";
9
- function asCli(err) {
10
- if (err instanceof EcpCliError)
11
- throw err;
12
- if (err instanceof EcpError) {
13
- throw new EcpCliError(err.code, err.message, {
14
- suggestions: err.suggestions,
15
- exitCode: err.code === ECP_RERUN_INCOMPATIBLE ? EXIT_USAGE : 1,
16
- });
17
- }
18
- throw err;
19
- }
20
- /** `ecp runs` topic help. @category CLI */
21
- export const runsTopicOperation = defineOperation("runs")
22
- .withInput(z.object({}))
23
- .withMetadata({
24
- summary: "Inspect and continue workflow runs",
25
- description: "Subcommands: list, show, resume, rerun.",
26
- useCases: ["Resume a stopped or paused run"],
27
- })
28
- .withHandler(async () => [
29
- "Usage: ecp runs <subcommand>",
30
- "",
31
- " list Newest journals first",
32
- " show RUN-ID One journal (--step for a step file)",
33
- " resume RUN-ID Continue a stopped or paused run",
34
- " rerun RUN-ID Re-run from a step using the current file",
35
- "",
36
- "Run ecp runs <cmd> --help for flags.",
37
- ].join("\n"))
38
- .build();
39
- /** `ecp runs list`. @category CLI */
40
- export const runsListOperation = defineOperation("runs:list")
41
- .withInput(z.object({
42
- status: z.string().optional(),
43
- workflow: z.string().optional(),
44
- }))
45
- .withMetadata({
46
- summary: "List run journals",
47
- description: "Newest first. Filter with --status and --workflow.",
48
- useCases: ["Find a run id to resume"],
49
- examples: ["ecp runs list", "ecp runs list --status stopped"],
50
- })
51
- .withHandler(async (input) => {
52
- const status = input.status ? String(input.status) : undefined;
53
- const workflow = input.workflow ? String(input.workflow) : undefined;
54
- const docs = await listRunJournals();
55
- return docs.filter((doc) => {
56
- if (status && doc.status !== status)
57
- return false;
58
- if (workflow && doc.workflowPath !== workflow)
59
- return false;
60
- return true;
61
- });
62
- })
63
- .build();
64
- /** `ecp runs show`. @category CLI */
65
- export const runsShowOperation = defineOperation("runs:show")
66
- .withInput(z.object({
67
- "run-id": z.string(),
68
- step: z.string().optional(),
69
- }))
70
- .withMetadata({
71
- summary: "Show a run journal",
72
- description: "Print run.json, or one step with --step.",
73
- useCases: ["Inspect cursor, status, and per-step records"],
74
- examples: ["ecp runs show <id>", "ecp runs show <id> --step echo"],
75
- cli: { args: ["run-id"] },
76
- })
77
- .withHandler(async (input) => {
78
- const runId = String(input["run-id"]);
79
- if (input.step)
80
- return readStepJournal(runId, String(input.step));
81
- return loadParentRun(runId);
82
- })
83
- .build();
84
- /** `ecp runs resume`. @category CLI */
85
- export const runsResumeOperation = defineOperation("runs:resume")
86
- .withInput(z.object({
87
- "run-id": z.string(),
88
- env: z.string().optional(),
89
- to: z.string().optional(),
90
- approve: z.boolean().optional(),
91
- }))
92
- .withMetadata({
93
- summary: "Resume a stopped or paused run",
94
- description: "Starts a new run from the journal cursor. --approve records an approval for the paused step.",
95
- useCases: ["Continue after ecp run --to", "Continue after a policy pause"],
96
- examples: ["ecp runs resume <id>", "ecp runs resume <id> --approve"],
97
- cli: { args: ["run-id"] },
98
- })
99
- .withHandler(async (input, ctx) => {
100
- const parent = await loadParentRun(String(input["run-id"]));
101
- if (!parent.workflowPath) {
102
- throw new EcpCliError("ECP_INPUT_INVALID", "Journal has no workflow path", {
103
- exitCode: EXIT_USAGE,
104
- });
105
- }
106
- const { loaded, ecp, terminate } = await prepareWorkflowRun({
107
- workflowPath: parent.workflowPath,
108
- envFlag: input.env ? String(input.env) : undefined,
109
- config: ctx.config,
110
- argv: ctx.argv,
111
- json: ctx.json,
112
- host: ctx.host,
113
- install: true,
114
- });
115
- try {
116
- const extras = await runOptionsFromJournal({
117
- parent,
118
- workflow: loaded.manifest,
119
- toStepId: input.to ? String(input.to) : undefined,
120
- approve: Boolean(input.approve),
121
- mode: "resume",
122
- });
123
- const source = await readFile(parent.workflowPath, "utf8");
124
- const result = await ecp.run(loaded.manifest, {
125
- ...extras,
126
- journal: {
127
- workflowPath: parent.workflowPath,
128
- workflowHash: hashWorkflowSource(source),
129
- pluginVersions: pluginVersions(ctx.config),
130
- environmentId: NODE_ENVIRONMENT_ID,
131
- parentRunId: parent.runId,
132
- resumedFrom: parent.runId,
133
- },
134
- });
135
- return throwIfRunFailed(result);
136
- }
137
- catch (err) {
138
- asCli(err);
139
- }
140
- finally {
141
- await terminateIfNeeded(ecp, terminate);
142
- }
143
- })
144
- .build();
145
- /** `ecp runs rerun`. @category CLI */
146
- export const runsRerunOperation = defineOperation("runs:rerun")
147
- .withInput(z.object({
148
- "run-id": z.string(),
149
- env: z.string().optional(),
150
- from: z.string().optional(),
151
- to: z.string().optional(),
152
- }))
153
- .withMetadata({
154
- summary: "Rerun from a step using the current workflow file",
155
- description: "Restores steps before --from from the journal. Default --from is the first failed step. Default --to is the end.",
156
- useCases: ["Fix a step and rerun from there"],
157
- examples: ["ecp runs rerun <id> --from web", "ecp runs rerun <id> --from a --to a"],
158
- cli: { args: ["run-id"] },
159
- })
160
- .withHandler(async (input, ctx) => {
161
- const parent = await loadParentRun(String(input["run-id"]));
162
- if (!parent.workflowPath) {
163
- throw new EcpCliError("ECP_INPUT_INVALID", "Journal has no workflow path", {
164
- exitCode: EXIT_USAGE,
165
- });
166
- }
167
- const { loaded, ecp, terminate } = await prepareWorkflowRun({
168
- workflowPath: parent.workflowPath,
169
- envFlag: input.env ? String(input.env) : undefined,
170
- config: ctx.config,
171
- argv: ctx.argv,
172
- json: ctx.json,
173
- host: ctx.host,
174
- install: true,
175
- });
176
- try {
177
- const extras = await runOptionsFromJournal({
178
- parent,
179
- workflow: loaded.manifest,
180
- fromStepId: input.from ? String(input.from) : undefined,
181
- toStepId: input.to ? String(input.to) : undefined,
182
- mode: "rerun",
183
- });
184
- const source = await readFile(parent.workflowPath, "utf8");
185
- const result = await ecp.run(loaded.manifest, {
186
- ...extras,
187
- journal: {
188
- workflowPath: parent.workflowPath,
189
- workflowHash: hashWorkflowSource(source),
190
- pluginVersions: pluginVersions(ctx.config),
191
- environmentId: NODE_ENVIRONMENT_ID,
192
- parentRunId: parent.runId,
193
- },
194
- });
195
- return throwIfRunFailed(result);
196
- }
197
- catch (err) {
198
- asCli(err);
199
- }
200
- finally {
201
- await terminateIfNeeded(ecp, terminate);
202
- }
203
- })
204
- .build();
205
- //# sourceMappingURL=runs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runs.js","sourceRoot":"","sources":["../../src/operations/runs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,EACL,eAAe,EACf,WAAW,EACX,sBAAsB,EACtB,UAAU,GACX,MAAM,sCAAsC,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAA;AAC/D,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,C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E,MAAM,CAAC,KAAK;aAC1B;SACF,CAAC,CAAA;QACF,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAAA;IACjC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,KAAK,CAAC,GAAG,CAAC,CAAA;IACZ,CAAC;YAAS,CAAC;QACT,MAAM,iBAAiB,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;IACzC,CAAC;AACH,CAAC,CAAC;KACD,KAAK,EAAE,CAAA"}
@@ -1,11 +0,0 @@
1
- /** `ecp config secrets` topic help. @category CLI */
2
- export declare const configSecretsOperation: import("@executioncontrolprotocol/plugin-sdk").OperationDefinition;
3
- /** `ecp config secrets add`. @category CLI */
4
- export declare const configSecretsAddOperation: import("@executioncontrolprotocol/plugin-sdk").OperationDefinition;
5
- /** `ecp config secrets get`. @category CLI */
6
- export declare const configSecretsGetOperation: import("@executioncontrolprotocol/plugin-sdk").OperationDefinition;
7
- /** `ecp config secrets list`. @category CLI */
8
- export declare const configSecretsListOperation: import("@executioncontrolprotocol/plugin-sdk").OperationDefinition;
9
- /** `ecp config secrets remove`. @category CLI */
10
- export declare const configSecretsRemoveOperation: import("@executioncontrolprotocol/plugin-sdk").OperationDefinition;
11
- //# sourceMappingURL=secrets.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"secrets.d.ts","sourceRoot":"","sources":["../../src/operations/secrets.ts"],"names":[],"mappings":"AAsBA,qDAAqD;AACrD,eAAO,MAAM,sBAAsB,oEA2BzB,CAAA;AAEV,8CAA8C;AAC9C,eAAO,MAAM,yBAAyB,oEAiC5B,CAAA;AAEV,8CAA8C;AAC9C,eAAO,MAAM,yBAAyB,oEAmB5B,CAAA;AAEV,+CAA+C;AAC/C,eAAO,MAAM,0BAA0B,oEAc7B,CAAA;AAEV,iDAAiD;AACjD,eAAO,MAAM,4BAA4B,oEAe/B,CAAA"}
@@ -1,134 +0,0 @@
1
- import { z } from "zod";
2
- import { createInterface } from "node:readline/promises";
3
- import { stdin, stdout } from "node:process";
4
- import { canonicalSecretKey, ECP_SECRET_REF_PROTOCOL_PREFIX, redactSecret, secretRefIdFromLogicalKey, } from "@executioncontrolprotocol/node";
5
- import { defineOperation, EcpCliError, EXIT_FAILED } from "@executioncontrolprotocol/plugin-sdk";
6
- import { getCliSecretsStore } from "../lib/secrets/store.js";
7
- async function requireStore() {
8
- const store = getCliSecretsStore();
9
- if (!(await store.isAvailable())) {
10
- throw new EcpCliError("ECP_SECRETS_UNAVAILABLE", "OS keychain is not available on this system.", {
11
- exitCode: EXIT_FAILED,
12
- });
13
- }
14
- return store;
15
- }
16
- /** `ecp config secrets` topic help. @category CLI */
17
- export const configSecretsOperation = defineOperation("config:secrets")
18
- .withInput(z.object({}))
19
- .withMetadata({
20
- summary: "Manage OS keychain secrets",
21
- description: `Store and inspect secret values in the OS keychain (outside config files).
22
-
23
- Subcommands: add, get, remove, list. Ref ids use ${ECP_SECRET_REF_PROTOCOL_PREFIX}<key>.`,
24
- useCases: ["Keep API keys out of workflow files"],
25
- examples: [
26
- "ecp config secrets add server/fetch.token",
27
- "ecp config secrets get server/fetch.token",
28
- "ecp config secrets list",
29
- ],
30
- })
31
- .withHandler(async () => [
32
- "Usage: ecp config secrets <subcommand>",
33
- "",
34
- " add KEY Add or replace a secret (interactive paste; use --value for inline)",
35
- " get KEY Read a secret (default: redacted preview; use --reveal for full value)",
36
- " remove KEY Remove a stored secret",
37
- " list List keys",
38
- "",
39
- `Ref ids use the form ${ECP_SECRET_REF_PROTOCOL_PREFIX}<key>.`,
40
- "Run ecp config secrets <cmd> --help for flags.",
41
- ].join("\n"))
42
- .build();
43
- /** `ecp config secrets add`. @category CLI */
44
- export const configSecretsAddOperation = defineOperation("config:secrets:add")
45
- .withInput(z.object({ key: z.string(), value: z.string().optional() }))
46
- .withMetadata({
47
- summary: "Add or replace a secret in the OS keychain",
48
- description: "Prompts interactively for the secret value by default. Use --value for non-interactive inline input.",
49
- useCases: ["Store a provider token for workflow secrets() refs"],
50
- examples: ["ecp config secrets add server/fetch.token", "ecp config secrets add GITHUB_API_KEY --value ghp_xxx"],
51
- cli: { args: ["key"] },
52
- })
53
- .withHandler(async (input) => {
54
- const store = await requireStore();
55
- let value = input.value ? String(input.value) : undefined;
56
- if (value === undefined) {
57
- if (!process.stdin.isTTY) {
58
- throw new EcpCliError("ECP_INPUT_INVALID", "Secret value cannot be empty. Pass --value.", {
59
- exitCode: 2,
60
- });
61
- }
62
- const rl = createInterface({ input: stdin, output: stdout });
63
- try {
64
- value = (await rl.question("Paste secret value: ")).trim();
65
- }
66
- finally {
67
- rl.close();
68
- }
69
- if (!value) {
70
- throw new EcpCliError("ECP_INPUT_INVALID", "Secret value cannot be empty.", { exitCode: 2 });
71
- }
72
- }
73
- const key = canonicalSecretKey(String(input.key));
74
- await store.set(key, value);
75
- return `Stored secret "${key}" (${secretRefIdFromLogicalKey(key)}).`;
76
- })
77
- .build();
78
- /** `ecp config secrets get`. @category CLI */
79
- export const configSecretsGetOperation = defineOperation("config:secrets:get")
80
- .withInput(z.object({ key: z.string(), reveal: z.boolean().optional() }))
81
- .withMetadata({
82
- summary: "Read a secret (redacted by default)",
83
- description: "Print a redacted preview, or the full value with --reveal.",
84
- useCases: ["Confirm a secret is stored"],
85
- examples: ["ecp config secrets get server/fetch.token"],
86
- cli: { args: ["key"] },
87
- })
88
- .withHandler(async (input) => {
89
- const store = await requireStore();
90
- const key = canonicalSecretKey(String(input.key));
91
- const value = await store.get(key);
92
- if (value == null) {
93
- throw new EcpCliError("ECP_SECRETS_MISSING", `No secret for key "${key}".`, { exitCode: EXIT_FAILED });
94
- }
95
- if (input.reveal)
96
- return value;
97
- return redactSecret(value);
98
- })
99
- .build();
100
- /** `ecp config secrets list`. @category CLI */
101
- export const configSecretsListOperation = defineOperation("config:secrets:list")
102
- .withInput(z.object({}))
103
- .withMetadata({
104
- summary: "List secret keys in the OS keychain",
105
- description: "Print stored secret keys (not values).",
106
- useCases: ["See which secrets the CLI can resolve"],
107
- examples: ["ecp config secrets list"],
108
- })
109
- .withHandler(async () => {
110
- const store = await requireStore();
111
- const keys = await store.list();
112
- if (keys.length === 0)
113
- return "(no entries)";
114
- return keys.map((key) => ` ${key}`).join("\n");
115
- })
116
- .build();
117
- /** `ecp config secrets remove`. @category CLI */
118
- export const configSecretsRemoveOperation = defineOperation("config:secrets:remove")
119
- .withInput(z.object({ key: z.string() }))
120
- .withMetadata({
121
- summary: "Remove a stored secret from the OS keychain",
122
- description: "Delete a secret by lookup key.",
123
- useCases: ["Rotate or drop a stored token"],
124
- examples: ["ecp config secrets remove server/fetch.token"],
125
- cli: { args: ["key"] },
126
- })
127
- .withHandler(async (input) => {
128
- const store = await requireStore();
129
- const key = canonicalSecretKey(String(input.key));
130
- await store.delete(key);
131
- return `Removed secret for key "${key}".`;
132
- })
133
- .build();
134
- //# sourceMappingURL=secrets.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"secrets.js","sourceRoot":"","sources":["../../src/operations/secrets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,EACL,kBAAkB,EAClB,8BAA8B,EAC9B,YAAY,EACZ,yBAAyB,GAC1B,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAA;AAChG,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAE5D,KAAK,UAAU,YAAY;IACzB,MAAM,KAAK,GAAG,kBAAkB,EAAE,CAAA;IAClC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC;QACjC,MAAM,IAAI,WAAW,CAAC,yBAAyB,EAAE,8CAA8C,EAAE;YAC/F,QAAQ,EAAE,WAAW;S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AY,EAAE,CAAA;IAClC,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,IAAI,EAAE,CAAA;IAC/B,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,cAAc,CAAA;IAC5C,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACjD,CAAC,CAAC;KACD,KAAK,EAAE,CAAA;AAEV,iDAAiD;AACjD,MAAM,CAAC,MAAM,4BAA4B,GAAG,eAAe,CAAC,uBAAuB,CAAC;KACjF,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;KACxC,YAAY,CAAC;IACZ,OAAO,EAAE,6CAA6C;IACtD,WAAW,EAAE,gCAAgC;IAC7C,QAAQ,EAAE,CAAC,+BAA+B,CAAC;IAC3C,QAAQ,EAAE,CAAC,8CAA8C,CAAC;IAC1D,GAAG,EAAE,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE;CACvB,CAAC;KACD,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;IAC3B,MAAM,KAAK,GAAG,MAAM,YAAY,EAAE,CAAA;IAClC,MAAM,GAAG,GAAG,kBAAkB,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAA;IACjD,MAAM,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IACvB,OAAO,2BAA2B,GAAG,IAAI,CAAA;AAC3C,CAAC,CAAC;KACD,KAAK,EAAE,CAAA"}
@@ -1,3 +0,0 @@
1
- /** `ecp update`. @category CLI */
2
- export declare const updateOperation: import("@executioncontrolprotocol/plugin-sdk").OperationDefinition;
3
- //# sourceMappingURL=update.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/operations/update.ts"],"names":[],"mappings":"AAUA,kCAAkC;AAClC,eAAO,MAAM,eAAe,oEAgElB,CAAA"}
@@ -1,64 +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 { listInstalledPlugins } from "../lib/installed-plugins.js";
5
- import { npmLatestVersion } from "../lib/npm-registry.js";
6
- function isNewer(latest, current) {
7
- return latest !== current && latest.localeCompare(current, undefined, { numeric: true }) > 0;
8
- }
9
- /** `ecp update`. @category CLI */
10
- export const updateOperation = defineOperation("update")
11
- .withInput(z.object({
12
- list: z.boolean().optional(),
13
- interactive: z.boolean().optional(),
14
- "no-confirm": z.boolean().optional(),
15
- }))
16
- .withMetadata({
17
- summary: "Update user-installed ECP plugins",
18
- description: "List user plugins with newer versions on npm and install them. Core (bundled) plugins are not updatable this way; reinstall the CLI instead.",
19
- useCases: ["Bring user plugins up to date"],
20
- examples: ["ecp update --list", "ecp update --no-confirm"],
21
- })
22
- .withHandler(async (input, ctx) => {
23
- const plugins = listInstalledPlugins(ctx.config);
24
- const user = plugins.filter((plugin) => plugin.type === "user" || plugin.type === "link");
25
- const coreNames = new Set(plugins.filter((plugin) => plugin.type === "core").map((plugin) => plugin.name));
26
- const available = [];
27
- try {
28
- for (const plugin of user) {
29
- const latest = await npmLatestVersion(plugin.name);
30
- if (!latest || !plugin.version)
31
- continue;
32
- if (!isNewer(latest, plugin.version))
33
- continue;
34
- available.push({
35
- name: plugin.name,
36
- current: plugin.version,
37
- latest,
38
- shadowsBundled: coreNames.has(plugin.name),
39
- });
40
- }
41
- }
42
- catch (err) {
43
- throw new EcpCliError("ECP_UPDATE_FAILED", err instanceof Error ? err.message : String(err), { exitCode: EXIT_FAILED });
44
- }
45
- const warnings = available
46
- .filter((row) => row.shadowsBundled)
47
- .map((row) => `${row.name} shadows a bundled plugin; latest on npm is ${row.latest}`);
48
- if (input.list || available.length === 0) {
49
- return { plugins: available, warnings };
50
- }
51
- const skipConfirm = Boolean(input["no-confirm"]);
52
- const ok = skipConfirm ||
53
- (input.interactive ? await confirm(`Update ${available.length} plugin(s)?`, ctx.argv) : true);
54
- if (!ok)
55
- return { plugins: available, warnings, updated: [] };
56
- const updated = [];
57
- for (const row of available) {
58
- await ctx.config.runCommand("plugins:install", [`${row.name}@${row.latest}`]);
59
- updated.push(row.name);
60
- }
61
- return { plugins: available, warnings, updated };
62
- })
63
- .build();
64
- //# sourceMappingURL=update.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update.js","sourceRoot":"","sources":["../../src/operations/update.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,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAEzD,SAAS,OAAO,CAAC,MAAc,EAAE,OAAe;IAC9C,OAAO,MAAM,KAAK,OAAO,IAAI,MAAM,CAAC,aAAa,CAAC,OAAO,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,CAAA;AAC9F,CAAC;AAED,kCAAkC;AAClC,MAAM,CAAC,MAAM,eAAe,GAAG,eAAe,CAAC,QAAQ,CAAC;KACrD,SAAS,CACR,CAAC,CAAC,MAAM,CAAC;IACP,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC5B,WAAW,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACnC,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACrC,CAAC,CACH;KACA,YAAY,CAAC;IACZ,OAAO,EAAE,mCA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