@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
@@ -0,0 +1,86 @@
1
+ import { Command, Flags } from "@oclif/core";
2
+ import { checkHealth, readHostJson } from "@executioncontrolprotocol/host/client";
3
+ import { ControlClient } from "../../lib/control-client.js";
4
+ import { ecpHome } from "../../lib/home.js";
5
+ import { writeEnvelope } from "../../lib/output.js";
6
+ /**
7
+ * `ecp host status`
8
+ * @category CLI
9
+ */
10
+ export default class HostStatus extends Command {
11
+ static description = "Report whether the background host is up, including idle shutdown scheduling when running.";
12
+ static examples = [
13
+ {
14
+ description: "Prints supervisor and API health; add --json for the envelope.",
15
+ command: "<%= config.bin %> host status",
16
+ },
17
+ ];
18
+ static flags = {
19
+ json: Flags.boolean({
20
+ description: "Print one JSON object on stdout: { ok: true, data } on success, { ok: false, error } on failure (exit code non-zero).",
21
+ default: false,
22
+ }),
23
+ };
24
+ async run() {
25
+ const { flags } = await this.parse(HostStatus);
26
+ const home = ecpHome();
27
+ const unavailable = {
28
+ ok: false,
29
+ error: { code: "ECP_HOST_UNAVAILABLE", message: "Host is not running." },
30
+ };
31
+ const file = readHostJson(home);
32
+ if (!file) {
33
+ writeEnvelope(unavailable, {
34
+ json: flags.json,
35
+ human: () => this.error("Host is not running.", { exit: 4 }),
36
+ exitCode: 4,
37
+ });
38
+ }
39
+ let supervisor;
40
+ try {
41
+ supervisor = await new ControlClient(file).status();
42
+ }
43
+ catch {
44
+ supervisor = null;
45
+ }
46
+ const health = await checkHealth(`http://127.0.0.1:${file.port}`);
47
+ if (!health && !supervisor) {
48
+ writeEnvelope(unavailable, {
49
+ json: flags.json,
50
+ human: () => this.error("Host is not running.", { exit: 4 }),
51
+ exitCode: 4,
52
+ });
53
+ }
54
+ const idleLabel = supervisor?.idleMinutes === 0
55
+ ? "never"
56
+ : supervisor?.idleMinutes !== undefined
57
+ ? `${supervisor.idleMinutes}m`
58
+ : "unknown";
59
+ const payload = {
60
+ supervisor,
61
+ health,
62
+ port: file.port,
63
+ home: file.home,
64
+ startedBy: supervisor?.startedBy ?? file.startedBy,
65
+ idleMinutes: supervisor?.idleMinutes ?? file.idleMinutes,
66
+ lastActivityAt: supervisor?.lastActivityAt ?? health?.lastActivityAt,
67
+ idleShutdownAt: supervisor?.idleShutdownAt,
68
+ idleBlockedBy: supervisor?.idleBlockedBy,
69
+ };
70
+ writeEnvelope({ ok: true, data: payload }, {
71
+ json: flags.json,
72
+ human: () => {
73
+ this.log(`port=${file.port} health=${health?.status ?? "unknown"}`);
74
+ if (supervisor) {
75
+ this.log(`supervisor hostStatus=${supervisor.hostStatus} restarts=${supervisor.restarts} startedBy=${supervisor.startedBy ?? "unknown"} idle=${idleLabel}`);
76
+ if (supervisor.idleShutdownAt)
77
+ this.log(`idleShutdownAt=${supervisor.idleShutdownAt}`);
78
+ if (supervisor.idleBlockedBy)
79
+ this.log(`idleBlockedBy=${supervisor.idleBlockedBy}`);
80
+ }
81
+ },
82
+ exitCode: 0,
83
+ });
84
+ }
85
+ }
86
+ //# sourceMappingURL=status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.js","sourceRoot":"","sources":["../../../src/commands/host/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAA;AACjF,OAAO,EAAE,aA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MAAM,EAAE,MAAM,IAAI,SAAS,EAAE,CAAC,CAAA;gBACnE,IAAI,UAAU,EAAE,CAAC;oBACf,IAAI,CAAC,GAAG,CACN,yBAAyB,UAAU,CAAC,UAAU,aAAa,UAAU,CAAC,QAAQ,cAAc,UAAU,CAAC,SAAS,IAAI,SAAS,SAAS,SAAS,EAAE,CAClJ,CAAA;oBACD,IAAI,UAAU,CAAC,cAAc;wBAAE,IAAI,CAAC,GAAG,CAAC,kBAAkB,UAAU,CAAC,cAAc,EAAE,CAAC,CAAA;oBACtF,IAAI,UAAU,CAAC,aAAa;wBAAE,IAAI,CAAC,GAAG,CAAC,iBAAiB,UAAU,CAAC,aAAa,EAAE,CAAC,CAAA;gBACrF,CAAC;YACH,CAAC;YACD,QAAQ,EAAE,CAAC;SACZ,CACF,CAAA;IACH,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { Command } from "@oclif/core";
2
+ /**
3
+ * `ecp host stop`
4
+ * @category CLI
5
+ */
6
+ export default class HostStop extends Command {
7
+ static description: string;
8
+ static examples: {
9
+ description: string;
10
+ command: string;
11
+ }[];
12
+ static flags: {
13
+ force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
15
+ };
16
+ run(): Promise<void>;
17
+ }
18
+ //# sourceMappingURL=stop.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stop.d.ts","sourceRoot":"","sources":["../../../src/commands/host/stop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAA;AAS5C;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,OAAO;IAC3C,OAAgB,WAAW,SAAyE;IAEpG,OAAgB,QAAQ;;;QAKvB;IAED,OAAgB,KAAK;;;MAUpB;IAEc,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAiCpC"}
@@ -0,0 +1,62 @@
1
+ import { Command, Flags } from "@oclif/core";
2
+ import { readHostJson } from "@executioncontrolprotocol/host/client";
3
+ import { setTimeout as delay } from "node:timers/promises";
4
+ import { existsSync, unlinkSync } from "node:fs";
5
+ import path from "node:path";
6
+ import { ControlClient } from "../../lib/control-client.js";
7
+ import { ecpHome } from "../../lib/home.js";
8
+ import { writeEnvelope } from "../../lib/output.js";
9
+ /**
10
+ * `ecp host stop`
11
+ * @category CLI
12
+ */
13
+ export default class HostStop extends Command {
14
+ static description = "Stop the supervisor and host; use host status to confirm it is down.";
15
+ static examples = [
16
+ {
17
+ description: "Stops a running host; add --json for { ok, data: { stopped: true } }.",
18
+ command: "<%= config.bin %> host stop",
19
+ },
20
+ ];
21
+ static flags = {
22
+ force: Flags.boolean({
23
+ description: "Force-stop immediately instead of draining runs first.",
24
+ default: false,
25
+ }),
26
+ json: Flags.boolean({
27
+ description: "Print one JSON object on stdout: { ok: true, data } on success, { ok: false, error } on failure (exit code non-zero).",
28
+ default: false,
29
+ }),
30
+ };
31
+ async run() {
32
+ const { flags } = await this.parse(HostStop);
33
+ const home = ecpHome();
34
+ const file = readHostJson(home);
35
+ if (!file) {
36
+ writeEnvelope({ ok: true, data: { stopped: true } }, { json: flags.json, human: () => this.log("host is not running"), exitCode: 0 });
37
+ }
38
+ const client = new ControlClient(file);
39
+ try {
40
+ await client.stop(flags.force);
41
+ }
42
+ catch {
43
+ // Supervisor may exit before responding.
44
+ }
45
+ const hostJson = path.join(home, "host.json");
46
+ for (let i = 0; i < 50; i++) {
47
+ if (!existsSync(hostJson))
48
+ break;
49
+ await delay(100);
50
+ }
51
+ if (existsSync(hostJson)) {
52
+ try {
53
+ unlinkSync(hostJson);
54
+ }
55
+ catch {
56
+ // ignore
57
+ }
58
+ }
59
+ writeEnvelope({ ok: true, data: { stopped: true } }, { json: flags.json, human: () => this.log("stopped"), exitCode: 0 });
60
+ }
61
+ }
62
+ //# sourceMappingURL=stop.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stop.js","sourceRoot":"","sources":["../../../src/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AAE,IAAI,EAAE,EAAE,EACrC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,qBAAqB,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,CAChF,CAAA;QACH,CAAC;QACD,MAAM,MAAM,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC,CAAA;QACtC,IAAI,CAAC;YACH,MAAM,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QAChC,CAAC;QAAC,MAAM,CAAC;YACP,yCAAyC;QAC3C,CAAC;QACD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAA;QAC7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;YAC5B,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;gBAAE,MAAK;YAChC,MAAM,KAAK,CAAC,GAAG,CAAC,CAAA;QAClB,CAAC;QACD,IAAI,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YACzB,IAAI,CAAC;gBACH,UAAU,CAAC,QAAQ,CAAC,CAAA;YACtB,CAAC;YAAC,MAAM,CAAC;gBACP,SAAS;YACX,CAAC;QACH,CAAC;QACD,aAAa,CACX,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EACrC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,CACpE,CAAA;IACH,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { Command } from "@oclif/core";
2
+ /**
3
+ * `ecp mcp start` — MCP stdio relay for retrieve / execute / commit.
4
+ * @category CLI
5
+ */
6
+ export default class McpStart extends Command {
7
+ static description: string;
8
+ static examples: {
9
+ description: string;
10
+ command: string;
11
+ }[];
12
+ run(): Promise<void>;
13
+ }
14
+ //# sourceMappingURL=start.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../src/commands/mcp/start.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAIrC;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,OAAO;IAC3C,OAAgB,WAAW,SACyE;IAEpG,OAAgB,QAAQ;;;QAKvB;IAEc,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAUpC"}
@@ -0,0 +1,42 @@
1
+ import { fileURLToPath } from "node:url";
2
+ import path from "node:path";
3
+ import { Command } from "@oclif/core";
4
+ import { startRelay } from "@executioncontrolprotocol/mcp-relay";
5
+ import { ecpHome } from "../../lib/home.js";
6
+ /**
7
+ * `ecp mcp start` — MCP stdio relay for retrieve / execute / commit.
8
+ * @category CLI
9
+ */
10
+ export default class McpStart extends Command {
11
+ static description = "Run the MCP relay on stdio (no --json); use when the agent connects over MCP instead of the CLI.";
12
+ static examples = [
13
+ {
14
+ description: "Starts the relay; stdout is reserved for MCP frames only.",
15
+ command: "<%= config.bin %> mcp start",
16
+ },
17
+ ];
18
+ async run() {
19
+ await this.parse(McpStart);
20
+ const home = ecpHome();
21
+ const ecpBin = resolveEcpBin();
22
+ await startRelay({
23
+ cwd: process.cwd(),
24
+ home,
25
+ ecpBin,
26
+ });
27
+ }
28
+ }
29
+ function resolveEcpBin() {
30
+ const argvBin = process.argv[1];
31
+ if (argvBin && (argvBin.endsWith("ecp.js") || argvBin.endsWith(`${path.sep}ecp`) || argvBin.endsWith("/ecp"))) {
32
+ return path.resolve(argvBin);
33
+ }
34
+ try {
35
+ return fileURLToPath(import.meta.resolve("@executioncontrolprotocol/cli/bin/ecp.js"));
36
+ }
37
+ catch {
38
+ const here = path.dirname(fileURLToPath(import.meta.url));
39
+ return path.resolve(here, "../../../bin/ecp.js");
40
+ }
41
+ }
42
+ //# sourceMappingURL=start.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"start.js","sourceRoot":"","sources":["../../../src/commands/mcp/start.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAA;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAE3C;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,OAAO;IAC3C,MAAM,CAAU,WAAW,GACzB,kGAAkG,CAAA;IAEpG,MAAM,CAAU,QAAQ,GAAG;QACzB;YACE,WAAW,EAAE,2DAA2D;YACxE,OAAO,EAAE,6BAA6B;SACvC;KACF,CAAA;IAEQ,KAAK,CAAC,GAAG;QAChB,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;QAC1B,MAAM,IAAI,GAAG,OAAO,EAAE,CAAA;QACtB,MAAM,MAAM,GAAG,aAAa,EAAE,CAAA;QAC9B,MAAM,UAAU,CAAC;YACf,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;YAClB,IAAI;YACJ,MAAM;SACP,CAAC,CAAA;IACJ,CAAC;;AAGH,SAAS,aAAa;IACpB,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IAC/B,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;QAC9G,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IAC9B,CAAC;IACD,IAAI,CAAC;QACH,OAAO,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,0CAA0C,CAAC,CAAC,CAAA;IACvF,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAA;IAClD,CAAC;AACH,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { Command } from "@oclif/core";
2
+ /**
3
+ * `ecp plugins` — list ECP plugins from the host (not oclif's getPluginsList).
4
+ * @category CLI
5
+ */
6
+ export default class PluginsList extends Command {
7
+ static description: string;
8
+ static examples: {
9
+ description: string;
10
+ command: string;
11
+ }[];
12
+ static flags: {
13
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
+ "no-start-host": import("@oclif/core/interfaces").BooleanFlag<boolean>;
15
+ };
16
+ run(): Promise<void>;
17
+ }
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/plugins/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAA;AAK5C;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,OAAO;IAC9C,OAAgB,WAAW,SAC2E;IAEtG,OAAgB,QAAQ;;;QAKvB;IAED,OAAgB,KAAK;;;MAUpB;IAEc,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAyBpC"}
@@ -0,0 +1,55 @@
1
+ import { Command, Flags } from "@oclif/core";
2
+ import { discoverOps } from "../../lib/host-discovery.js";
3
+ import { hostUnavailableEnvelope, isHostUnavailableError } from "../../lib/host-unavailable.js";
4
+ import { finishOperation, printPluginsHuman, writeEnvelope } from "../../lib/output.js";
5
+ /**
6
+ * `ecp plugins` — list ECP plugins from the host (not oclif's getPluginsList).
7
+ * @category CLI
8
+ */
9
+ export default class PluginsList extends Command {
10
+ static description = "List ECP plugins from the host with manifest status; use retrieve for capability metadata instead.";
11
+ static examples = [
12
+ {
13
+ description: "Prints installed plugins as a table; add --json for the operation envelope.",
14
+ command: "<%= config.bin %> plugins",
15
+ },
16
+ ];
17
+ static flags = {
18
+ json: Flags.boolean({
19
+ description: "Print one JSON object on stdout: { ok: true, data } on success, { ok: false, error } on failure (exit code non-zero).",
20
+ default: false,
21
+ }),
22
+ "no-start-host": Flags.boolean({
23
+ description: "Do not start a background host when one is not already running.",
24
+ default: false,
25
+ }),
26
+ };
27
+ async run() {
28
+ const { flags } = await this.parse(PluginsList);
29
+ let ops;
30
+ try {
31
+ ops = await discoverOps({ autoStart: !flags["no-start-host"] });
32
+ }
33
+ catch (error) {
34
+ if (isHostUnavailableError(error)) {
35
+ writeEnvelope(hostUnavailableEnvelope(error), {
36
+ json: flags.json,
37
+ human: () => this.error(error.message, { exit: 4 }),
38
+ exitCode: 4,
39
+ });
40
+ }
41
+ throw error;
42
+ }
43
+ try {
44
+ const envelope = await ops.retrieve({ type: "plugin" });
45
+ finishOperation(envelope, {
46
+ json: flags.json,
47
+ human: printPluginsHuman,
48
+ });
49
+ }
50
+ finally {
51
+ await ops.close();
52
+ }
53
+ }
54
+ }
55
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/plugins/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAA;AAC/F,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,aAAa,EAAE,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AE,CAAC,CAAA;YACvD,eAAe,CAAC,QAAQ,EAAE;gBACxB,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,KAAK,EAAE,iBAAiB;aACzB,CAAC,CAAA;QACJ,CAAC;gBAAS,CAAC;YACT,MAAM,GAAG,CAAC,KAAK,EAAE,CAAA;QACnB,CAAC;IACH,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { Command } from "@oclif/core";
2
+ /**
3
+ * `ecp plugins inspect` — resolve plugins from `$ECP_DATA_DIR/package.json` because
4
+ * the CLI runs with `userPlugins: false` (they are not in `config.plugins`).
5
+ * @category CLI
6
+ */
7
+ export default class PluginsInspect extends Command {
8
+ static description: string;
9
+ static strict: boolean;
10
+ static examples: {
11
+ description: string;
12
+ command: string;
13
+ }[];
14
+ static args: {
15
+ plugin: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
16
+ };
17
+ static flags: {
18
+ verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
19
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
20
+ };
21
+ run(): Promise<void>;
22
+ }
23
+ //# sourceMappingURL=inspect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../../src/commands/plugins/inspect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAiB,MAAM,aAAa,CAAA;AAO1D;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,OAAO;IACjD,OAAgB,WAAW,SAC8E;IAEzG,OAAgB,MAAM,UAAQ;IAE9B,OAAgB,QAAQ;;;QAKvB;IAED,OAAgB,IAAI;;MAKnB;IAED,OAAgB,KAAK;;;MAWpB;IAEc,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAsCpC"}
@@ -0,0 +1,113 @@
1
+ import { Args, Command, Config, Flags } from "@oclif/core";
2
+ import { existsSync, readFileSync } from "node:fs";
3
+ import path from "node:path";
4
+ import { ecpDataDir } from "../../lib/home.js";
5
+ import { expandFriendlyName, friendlyNameFromPackage } from "../../lib/plugin-mgmt.js";
6
+ import { writeEnvelope } from "../../lib/output.js";
7
+ /**
8
+ * `ecp plugins inspect` — resolve plugins from `$ECP_DATA_DIR/package.json` because
9
+ * the CLI runs with `userPlugins: false` (they are not in `config.plugins`).
10
+ * @category CLI
11
+ */
12
+ export default class PluginsInspect extends Command {
13
+ static description = "Show where a plugin is installed on disk; use the top-level plugins command for host manifest status.";
14
+ static strict = false;
15
+ static examples = [
16
+ {
17
+ description: "Prints where @executioncontrolprotocol/test is installed (friendly name: test).",
18
+ command: "<%= config.bin %> plugins inspect test",
19
+ },
20
+ ];
21
+ static args = {
22
+ plugin: Args.string({
23
+ description: "Plugin package or friendly name to inspect.",
24
+ required: true,
25
+ }),
26
+ };
27
+ static flags = {
28
+ verbose: Flags.boolean({
29
+ char: "v",
30
+ description: "Include dependency versions in the output.",
31
+ default: false,
32
+ }),
33
+ json: Flags.boolean({
34
+ description: "Print one JSON object on stdout: { ok: true, data } on success, { ok: false, error } on failure (exit code non-zero).",
35
+ default: false,
36
+ }),
37
+ };
38
+ async run() {
39
+ const { argv, flags } = await this.parse(PluginsInspect);
40
+ const names = (argv.length > 0 ? argv : ["."]).map(String);
41
+ const results = [];
42
+ for (const raw of names) {
43
+ const name = raw === "." ? readLocalPackageName() : expandFriendlyName(raw, this.config);
44
+ const entry = findDiskPlugin(this.config.dataDir || ecpDataDir(), name);
45
+ if (!entry) {
46
+ const loaded = this.config.getPluginsList().find((plugin) => plugin.name === name);
47
+ if (!loaded)
48
+ this.error(`${name} not installed`);
49
+ results.push(await describePlugin(loaded.root, loaded.name, "core", flags.verbose));
50
+ continue;
51
+ }
52
+ const root = entry.type === "link" && entry.root
53
+ ? entry.root
54
+ : path.join(this.config.dataDir || ecpDataDir(), "node_modules", entry.name);
55
+ results.push(await describePlugin(root, entry.name, entry.type ?? "user", flags.verbose));
56
+ }
57
+ writeEnvelope({ ok: true, data: { items: results } }, {
58
+ json: flags.json,
59
+ human: () => {
60
+ for (const result of results) {
61
+ this.log(`${result.name} ${result.version} (${result.type})`);
62
+ this.log(` location ${result.root}`);
63
+ if (flags.verbose && result.dependencies) {
64
+ for (const [dep, version] of Object.entries(result.dependencies)) {
65
+ this.log(` ${dep} ${version}`);
66
+ }
67
+ }
68
+ }
69
+ },
70
+ exitCode: 0,
71
+ });
72
+ }
73
+ }
74
+ async function describePlugin(root, name, type, verbose) {
75
+ const loaded = await Config.load({ root, devPlugins: false, userPlugins: false });
76
+ const dependencies = verbose && loaded.pjson.dependencies
77
+ ? Object.fromEntries(Object.entries(loaded.pjson.dependencies).map(([key, value]) => [key, String(value)]))
78
+ : undefined;
79
+ return {
80
+ name: loaded.name || name,
81
+ version: loaded.version,
82
+ root: loaded.root,
83
+ type,
84
+ dependencies,
85
+ };
86
+ }
87
+ function findDiskPlugin(dataDir, name) {
88
+ const pjsonPath = path.join(dataDir, "package.json");
89
+ if (!existsSync(pjsonPath))
90
+ return undefined;
91
+ let pjson;
92
+ try {
93
+ pjson = JSON.parse(readFileSync(pjsonPath, "utf8"));
94
+ }
95
+ catch {
96
+ return undefined;
97
+ }
98
+ const plugins = (pjson.oclif?.plugins ?? []).map((entry) => typeof entry === "string" ? { name: entry, type: "user", tag: "latest" } : entry);
99
+ const byName = plugins.find((plugin) => plugin.name === name) ??
100
+ plugins.find((plugin) => friendlyNameFromPackage(plugin.name) === name);
101
+ if (byName)
102
+ return byName;
103
+ if (pjson.dependencies?.[name])
104
+ return { name, type: "user" };
105
+ return undefined;
106
+ }
107
+ function readLocalPackageName() {
108
+ const pjson = JSON.parse(readFileSync("package.json", "utf8"));
109
+ if (!pjson.name)
110
+ throw new Error("package.json has no name");
111
+ return pjson.name;
112
+ }
113
+ //# sourceMappingURL=inspect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspect.js","sourceRoot":"","sources":["../../../src/commands/plugins/inspect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAA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;IACzB,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC,IAAI,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAA;IAC7D,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,SAAS,oBAAoB;IAC3B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,cAAc,EAAE,MAAM,CAAC,CAAsB,CAAA;IACnF,IAAI,CAAC,KAAK,CAAC,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;IAC5D,OAAO,KAAK,CAAC,IAAI,CAAA;AACnB,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { Command } from "@oclif/core";
2
+ /**
3
+ * `ecp plugins install` — add an ECP provider package under `$ECP_DATA_DIR`.
4
+ * @category CLI
5
+ */
6
+ export default class PluginsInstall extends Command {
7
+ static description: string;
8
+ static aliases: string[];
9
+ static args: {
10
+ package: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
11
+ };
12
+ static examples: {
13
+ description: string;
14
+ command: string;
15
+ }[];
16
+ static flags: {
17
+ force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
18
+ verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
19
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
20
+ };
21
+ run(): Promise<void>;
22
+ }
23
+ //# sourceMappingURL=install.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../src/commands/plugins/install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAS,MAAM,aAAa,CAAA;AAkBlD;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,OAAO;IACjD,OAAgB,WAAW,SAC0F;IAErH,OAAgB,OAAO,WAAkB;IAEzC,OAAgB,IAAI;;MAKnB;IAED,OAAgB,QAAQ;;;QAavB;IAED,OAAgB,KAAK;;;;MAepB;IAEc,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA+GpC"}
@@ -0,0 +1,135 @@
1
+ import { Args, Command, Flags } from "@oclif/core";
2
+ import { createOclifPlugins, expandFriendlyName, findPluginEntry, isPluginSpecInstalled, isMissingOclifKeyError, manifestInvalidError, manifestReportForRoot, missingOclifKeyError, npmLogLevel, resolvePackageSpecifier, touchPluginsChangedMarker, readPackageVersion, userPluginRoot, } from "../../lib/plugin-mgmt.js";
3
+ import { writeEnvelope } from "../../lib/output.js";
4
+ /**
5
+ * `ecp plugins install` — add an ECP provider package under `$ECP_DATA_DIR`.
6
+ * @category CLI
7
+ */
8
+ export default class PluginsInstall extends Command {
9
+ static description = "Install an ECP plugin from npm or a local tarball; use a short name like test for @executioncontrolprotocol/test.";
10
+ static aliases = ["plugins:add"];
11
+ static args = {
12
+ package: Args.string({
13
+ description: "npm package, friendly short name, or path to a .tgz file.",
14
+ required: true,
15
+ }),
16
+ };
17
+ static examples = [
18
+ {
19
+ description: "Installs the Anthropic provider from npm.",
20
+ command: "<%= config.bin %> plugins install @executioncontrolprotocol/anthropic",
21
+ },
22
+ {
23
+ description: "Installs @executioncontrolprotocol/test by its short name.",
24
+ command: "<%= config.bin %> plugins install test",
25
+ },
26
+ {
27
+ description: "Installs from a packed tarball (path or file: URL).",
28
+ command: "<%= config.bin %> plugins install ./dist/plugin.tgz",
29
+ },
30
+ ];
31
+ static flags = {
32
+ force: Flags.boolean({
33
+ description: "Reinstall even when the package is already present.",
34
+ default: false,
35
+ }),
36
+ verbose: Flags.boolean({
37
+ char: "v",
38
+ description: "Show npm install output on stderr.",
39
+ default: false,
40
+ }),
41
+ json: Flags.boolean({
42
+ description: "Print one JSON object on stdout: { ok: true, data } on success, { ok: false, error } on failure (exit code non-zero).",
43
+ default: false,
44
+ }),
45
+ };
46
+ async run() {
47
+ const { args, flags } = await this.parse(PluginsInstall);
48
+ const logLevel = npmLogLevel(flags);
49
+ const plugins = await createOclifPlugins(this.config, logLevel);
50
+ const { spec, displayName, tag } = resolvePackageSpecifier(args.package, this.config);
51
+ const unfriendly = expandFriendlyName(spec, this.config);
52
+ const installed = await isPluginSpecInstalled(plugins, spec, this.config);
53
+ if (installed && !flags.force) {
54
+ const entry = (typeof installed === "object" ? installed : await findPluginEntry(plugins, unfriendly));
55
+ const root = entry?.type === "link" && entry.root
56
+ ? entry.root
57
+ : userPluginRoot(this.config.dataDir, entry?.name ?? unfriendly);
58
+ const manifest = await manifestReportForRoot(root, entry?.type === "link" ? "link" : "user");
59
+ if (!manifest.ok) {
60
+ touchPluginsChangedMarker(this.config.dataDir);
61
+ writeEnvelope({ ok: false, error: manifestInvalidError(manifest.issues) }, {
62
+ json: flags.json,
63
+ human: () => this.error(manifestInvalidError(manifest.issues).message, { exit: 2 }),
64
+ exitCode: 2,
65
+ });
66
+ }
67
+ writeEnvelope({
68
+ ok: true,
69
+ data: {
70
+ action: "install",
71
+ package: entry?.name ?? unfriendly,
72
+ version: readPackageVersion(root),
73
+ type: (entry?.type === "link" ? "link" : "user"),
74
+ root,
75
+ alreadyInstalled: true,
76
+ manifest: { ok: true },
77
+ },
78
+ }, {
79
+ json: flags.json,
80
+ human: () => this.log(`${displayName} is already installed.`),
81
+ exitCode: 0,
82
+ });
83
+ }
84
+ let pluginConfig;
85
+ try {
86
+ pluginConfig = await plugins.install(spec, { force: flags.force, tag });
87
+ }
88
+ catch (error) {
89
+ if (isMissingOclifKeyError(error)) {
90
+ touchPluginsChangedMarker(this.config.dataDir);
91
+ writeEnvelope({ ok: false, error: missingOclifKeyError() }, {
92
+ json: flags.json,
93
+ human: () => this.error(missingOclifKeyError().message, { exit: 2 }),
94
+ exitCode: 2,
95
+ });
96
+ }
97
+ const message = error instanceof Error ? error.message : String(error);
98
+ writeEnvelope({ ok: false, error: { code: "ECP_INTERNAL", message, path: "" } }, {
99
+ json: flags.json,
100
+ human: () => this.error(message, { exit: 1 }),
101
+ exitCode: 1,
102
+ });
103
+ }
104
+ const entry = await findPluginEntry(plugins, pluginConfig.name);
105
+ const root = pluginConfig.root;
106
+ const manifest = await manifestReportForRoot(root, "user");
107
+ touchPluginsChangedMarker(this.config.dataDir);
108
+ if (!manifest.ok) {
109
+ writeEnvelope({
110
+ ok: false,
111
+ error: manifestInvalidError(manifest.issues),
112
+ }, {
113
+ json: flags.json,
114
+ human: () => this.error(manifestInvalidError(manifest.issues).message, { exit: 2 }),
115
+ exitCode: 2,
116
+ });
117
+ }
118
+ writeEnvelope({
119
+ ok: true,
120
+ data: {
121
+ action: "install",
122
+ package: pluginConfig.name,
123
+ version: pluginConfig.version,
124
+ type: (entry?.type === "link" ? "link" : "user"),
125
+ root,
126
+ manifest: { ok: true },
127
+ },
128
+ }, {
129
+ json: flags.json,
130
+ human: () => this.log(`installed ${pluginConfig.name}@${pluginConfig.version}`),
131
+ exitCode: 0,
132
+ });
133
+ }
134
+ }
135
+ //# sourceMappingURL=install.js.map