@evref-bl/plexus 0.15.1 → 0.16.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 (255) hide show
  1. package/README.md +8 -12
  2. package/dist/cli.js +8 -183
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commandLine.d.ts +13 -0
  5. package/dist/commandLine.d.ts.map +1 -0
  6. package/dist/commandLine.js +247 -0
  7. package/dist/commandLine.js.map +1 -0
  8. package/dist/config/pharoMcpVersion.d.ts +6 -7
  9. package/dist/config/pharoMcpVersion.d.ts.map +1 -1
  10. package/dist/config/pharoMcpVersion.js +6 -7
  11. package/dist/config/pharoMcpVersion.js.map +1 -1
  12. package/dist/errors.d.ts +11 -0
  13. package/dist/errors.d.ts.map +1 -0
  14. package/dist/errors.js +17 -0
  15. package/dist/errors.js.map +1 -0
  16. package/dist/forward/endpointHandoffFormat.d.ts +23 -0
  17. package/dist/forward/endpointHandoffFormat.d.ts.map +1 -0
  18. package/dist/forward/endpointHandoffFormat.js.map +1 -0
  19. package/dist/forward/index.d.ts +20 -0
  20. package/dist/forward/index.d.ts.map +1 -0
  21. package/dist/forward/index.js +77 -0
  22. package/dist/forward/index.js.map +1 -0
  23. package/dist/forward/jsonRpc.d.ts +20 -0
  24. package/dist/forward/jsonRpc.d.ts.map +1 -0
  25. package/dist/forward/jsonRpc.js +141 -0
  26. package/dist/forward/jsonRpc.js.map +1 -0
  27. package/dist/home.d.ts +15 -0
  28. package/dist/home.d.ts.map +1 -0
  29. package/dist/home.js +30 -0
  30. package/dist/home.js.map +1 -0
  31. package/dist/images/bases.d.ts +40 -0
  32. package/dist/images/bases.d.ts.map +1 -0
  33. package/dist/images/bases.js +190 -0
  34. package/dist/images/bases.js.map +1 -0
  35. package/dist/images/claims.d.ts +34 -0
  36. package/dist/images/claims.d.ts.map +1 -0
  37. package/dist/images/claims.js +119 -0
  38. package/dist/images/claims.js.map +1 -0
  39. package/dist/images/context.d.ts +22 -0
  40. package/dist/images/context.d.ts.map +1 -0
  41. package/dist/images/context.js +26 -0
  42. package/dist/images/context.js.map +1 -0
  43. package/dist/images/create.d.ts +19 -0
  44. package/dist/images/create.d.ts.map +1 -0
  45. package/dist/images/create.js +121 -0
  46. package/dist/images/create.js.map +1 -0
  47. package/dist/images/delete.d.ts +10 -0
  48. package/dist/images/delete.d.ts.map +1 -0
  49. package/dist/images/delete.js +31 -0
  50. package/dist/images/delete.js.map +1 -0
  51. package/dist/images/endpoint.d.ts +17 -0
  52. package/dist/images/endpoint.d.ts.map +1 -0
  53. package/dist/images/endpoint.js +58 -0
  54. package/dist/images/endpoint.js.map +1 -0
  55. package/dist/images/index.d.ts +28 -0
  56. package/dist/images/index.d.ts.map +1 -0
  57. package/dist/images/index.js +51 -0
  58. package/dist/images/index.js.map +1 -0
  59. package/dist/images/leftovers.d.ts +9 -0
  60. package/dist/images/leftovers.d.ts.map +1 -0
  61. package/dist/images/leftovers.js +38 -0
  62. package/dist/images/leftovers.js.map +1 -0
  63. package/dist/images/list.d.ts +12 -0
  64. package/dist/images/list.d.ts.map +1 -0
  65. package/dist/images/list.js +74 -0
  66. package/dist/images/list.js.map +1 -0
  67. package/dist/images/names.d.ts +15 -0
  68. package/dist/images/names.d.ts.map +1 -0
  69. package/dist/images/names.js +53 -0
  70. package/dist/images/names.js.map +1 -0
  71. package/dist/images/prepare.d.ts +18 -0
  72. package/dist/images/prepare.d.ts.map +1 -0
  73. package/dist/images/prepare.js +58 -0
  74. package/dist/images/prepare.js.map +1 -0
  75. package/dist/images/processes.d.ts +21 -0
  76. package/dist/images/processes.d.ts.map +1 -0
  77. package/dist/images/processes.js +83 -0
  78. package/dist/images/processes.js.map +1 -0
  79. package/dist/images/scripts.d.ts +39 -0
  80. package/dist/images/scripts.d.ts.map +1 -0
  81. package/dist/images/scripts.js +127 -0
  82. package/dist/images/scripts.js.map +1 -0
  83. package/dist/images/start.d.ts +23 -0
  84. package/dist/images/start.d.ts.map +1 -0
  85. package/dist/images/start.js +173 -0
  86. package/dist/images/start.js.map +1 -0
  87. package/dist/images/stop.d.ts +11 -0
  88. package/dist/images/stop.d.ts.map +1 -0
  89. package/dist/images/stop.js +42 -0
  90. package/dist/images/stop.js.map +1 -0
  91. package/dist/images/store.d.ts +62 -0
  92. package/dist/images/store.d.ts.map +1 -0
  93. package/dist/images/store.js +180 -0
  94. package/dist/images/store.js.map +1 -0
  95. package/dist/images/templates.d.ts +14 -0
  96. package/dist/images/templates.d.ts.map +1 -0
  97. package/dist/images/templates.js +84 -0
  98. package/dist/images/templates.js.map +1 -0
  99. package/dist/index.d.ts +12 -22
  100. package/dist/index.d.ts.map +1 -1
  101. package/dist/index.js +8 -22
  102. package/dist/index.js.map +1 -1
  103. package/dist/launcher/pharoLauncherMcpClient.d.ts +22 -59
  104. package/dist/launcher/pharoLauncherMcpClient.d.ts.map +1 -1
  105. package/dist/launcher/pharoLauncherMcpClient.js +128 -87
  106. package/dist/launcher/pharoLauncherMcpClient.js.map +1 -1
  107. package/dist/launcher/pharoLauncherProfile.d.ts +7 -29
  108. package/dist/launcher/pharoLauncherProfile.d.ts.map +1 -1
  109. package/dist/launcher/pharoLauncherProfile.js +19 -111
  110. package/dist/launcher/pharoLauncherProfile.js.map +1 -1
  111. package/dist/launcher/vmRenewal.d.ts +30 -0
  112. package/dist/launcher/vmRenewal.d.ts.map +1 -0
  113. package/dist/launcher/vmRenewal.js +58 -0
  114. package/dist/launcher/vmRenewal.js.map +1 -0
  115. package/dist/mcp/server.d.ts +18 -0
  116. package/dist/mcp/server.d.ts.map +1 -0
  117. package/dist/mcp/server.js +206 -0
  118. package/dist/mcp/server.js.map +1 -0
  119. package/dist/types.d.ts +68 -0
  120. package/dist/types.d.ts.map +1 -0
  121. package/dist/types.js +2 -0
  122. package/dist/types.js.map +1 -0
  123. package/dist/version.d.ts +2 -0
  124. package/dist/version.d.ts.map +1 -0
  125. package/dist/version.js +5 -0
  126. package/dist/version.js.map +1 -0
  127. package/package.json +3 -12
  128. package/dist/config/config.d.ts +0 -15
  129. package/dist/config/config.d.ts.map +0 -1
  130. package/dist/config/config.js +0 -74
  131. package/dist/config/config.js.map +0 -1
  132. package/dist/config/plexusHome.d.ts +0 -17
  133. package/dist/config/plexusHome.d.ts.map +0 -1
  134. package/dist/config/plexusHome.js +0 -30
  135. package/dist/config/plexusHome.js.map +0 -1
  136. package/dist/config/projectConfig.d.ts +0 -141
  137. package/dist/config/projectConfig.d.ts.map +0 -1
  138. package/dist/config/projectConfig.js +0 -722
  139. package/dist/config/projectConfig.js.map +0 -1
  140. package/dist/config/projectConfigAuthoring.d.ts +0 -53
  141. package/dist/config/projectConfigAuthoring.d.ts.map +0 -1
  142. package/dist/config/projectConfigAuthoring.js +0 -159
  143. package/dist/config/projectConfigAuthoring.js.map +0 -1
  144. package/dist/gateway/projectImageMcpEndpoint.d.ts +0 -23
  145. package/dist/gateway/projectImageMcpEndpoint.d.ts.map +0 -1
  146. package/dist/gateway/projectImageMcpEndpoint.js +0 -40
  147. package/dist/gateway/projectImageMcpEndpoint.js.map +0 -1
  148. package/dist/gateway/server/index.d.ts +0 -8
  149. package/dist/gateway/server/index.d.ts.map +0 -1
  150. package/dist/gateway/server/index.js +0 -34
  151. package/dist/gateway/server/index.js.map +0 -1
  152. package/dist/gateway/server/mcp/server.d.ts +0 -66
  153. package/dist/gateway/server/mcp/server.d.ts.map +0 -1
  154. package/dist/gateway/server/mcp/server.js +0 -458
  155. package/dist/gateway/server/mcp/server.js.map +0 -1
  156. package/dist/gateway/server/routing/endpointHandoffFormat.d.ts +0 -26
  157. package/dist/gateway/server/routing/endpointHandoffFormat.d.ts.map +0 -1
  158. package/dist/gateway/server/routing/endpointHandoffFormat.js.map +0 -1
  159. package/dist/gateway/server/routing/gateway.d.ts +0 -167
  160. package/dist/gateway/server/routing/gateway.d.ts.map +0 -1
  161. package/dist/gateway/server/routing/gateway.js +0 -863
  162. package/dist/gateway/server/routing/gateway.js.map +0 -1
  163. package/dist/gateway/server/routing/imageMcpRouter.d.ts +0 -59
  164. package/dist/gateway/server/routing/imageMcpRouter.d.ts.map +0 -1
  165. package/dist/gateway/server/routing/imageMcpRouter.js +0 -253
  166. package/dist/gateway/server/routing/imageMcpRouter.js.map +0 -1
  167. package/dist/gateway/server/routing/pharoFacade.d.ts +0 -12
  168. package/dist/gateway/server/routing/pharoFacade.d.ts.map +0 -1
  169. package/dist/gateway/server/routing/pharoFacade.js +0 -67
  170. package/dist/gateway/server/routing/pharoFacade.js.map +0 -1
  171. package/dist/gateway/server/routing/routeDiscovery.d.ts +0 -26
  172. package/dist/gateway/server/routing/routeDiscovery.d.ts.map +0 -1
  173. package/dist/gateway/server/routing/routeDiscovery.js +0 -46
  174. package/dist/gateway/server/routing/routeDiscovery.js.map +0 -1
  175. package/dist/gateway/server/routing/routingTable.d.ts +0 -120
  176. package/dist/gateway/server/routing/routingTable.d.ts.map +0 -1
  177. package/dist/gateway/server/routing/routingTable.js +0 -215
  178. package/dist/gateway/server/routing/routingTable.js.map +0 -1
  179. package/dist/gateway/server/support/processLiveness.d.ts +0 -10
  180. package/dist/gateway/server/support/processLiveness.d.ts.map +0 -1
  181. package/dist/gateway/server/support/processLiveness.js +0 -25
  182. package/dist/gateway/server/support/processLiveness.js.map +0 -1
  183. package/dist/gateway/server/support/sourceBuildPreflight.d.ts +0 -15
  184. package/dist/gateway/server/support/sourceBuildPreflight.d.ts.map +0 -1
  185. package/dist/gateway/server/support/sourceBuildPreflight.js +0 -88
  186. package/dist/gateway/server/support/sourceBuildPreflight.js.map +0 -1
  187. package/dist/gateway/server/support/toolResultFormatting.d.ts +0 -8
  188. package/dist/gateway/server/support/toolResultFormatting.d.ts.map +0 -1
  189. package/dist/gateway/server/support/toolResultFormatting.js +0 -74
  190. package/dist/gateway/server/support/toolResultFormatting.js.map +0 -1
  191. package/dist/images/homeImageCache.d.ts +0 -302
  192. package/dist/images/homeImageCache.d.ts.map +0 -1
  193. package/dist/images/homeImageCache.js +0 -1024
  194. package/dist/images/homeImageCache.js.map +0 -1
  195. package/dist/images/imageRescue.d.ts +0 -151
  196. package/dist/images/imageRescue.d.ts.map +0 -1
  197. package/dist/images/imageRescue.js +0 -748
  198. package/dist/images/imageRescue.js.map +0 -1
  199. package/dist/images/imageRuntime.d.ts +0 -60
  200. package/dist/images/imageRuntime.d.ts.map +0 -1
  201. package/dist/images/imageRuntime.js +0 -90
  202. package/dist/images/imageRuntime.js.map +0 -1
  203. package/dist/images/preparedImageCache.d.ts +0 -86
  204. package/dist/images/preparedImageCache.d.ts.map +0 -1
  205. package/dist/images/preparedImageCache.js +0 -229
  206. package/dist/images/preparedImageCache.js.map +0 -1
  207. package/dist/images/scopedTemplateCatalog.d.ts +0 -33
  208. package/dist/images/scopedTemplateCatalog.d.ts.map +0 -1
  209. package/dist/images/scopedTemplateCatalog.js +0 -363
  210. package/dist/images/scopedTemplateCatalog.js.map +0 -1
  211. package/dist/internal.d.ts +0 -20
  212. package/dist/internal.d.ts.map +0 -1
  213. package/dist/internal.js +0 -20
  214. package/dist/internal.js.map +0 -1
  215. package/dist/launcher/scopedPharoLauncherServer.d.ts +0 -349
  216. package/dist/launcher/scopedPharoLauncherServer.d.ts.map +0 -1
  217. package/dist/launcher/scopedPharoLauncherServer.js +0 -1307
  218. package/dist/launcher/scopedPharoLauncherServer.js.map +0 -1
  219. package/dist/lifecycle/startProjectImage.d.ts +0 -94
  220. package/dist/lifecycle/startProjectImage.d.ts.map +0 -1
  221. package/dist/lifecycle/startProjectImage.js +0 -1008
  222. package/dist/lifecycle/startProjectImage.js.map +0 -1
  223. package/dist/lifecycle/stopProjectImage.d.ts +0 -31
  224. package/dist/lifecycle/stopProjectImage.d.ts.map +0 -1
  225. package/dist/lifecycle/stopProjectImage.js +0 -201
  226. package/dist/lifecycle/stopProjectImage.js.map +0 -1
  227. package/dist/mcp/agentServer.d.ts +0 -15
  228. package/dist/mcp/agentServer.d.ts.map +0 -1
  229. package/dist/mcp/agentServer.js +0 -67
  230. package/dist/mcp/agentServer.js.map +0 -1
  231. package/dist/mcp/imageOperations.d.ts +0 -54
  232. package/dist/mcp/imageOperations.d.ts.map +0 -1
  233. package/dist/mcp/imageOperations.js +0 -223
  234. package/dist/mcp/imageOperations.js.map +0 -1
  235. package/dist/mcp/pharoMcpHealth.d.ts +0 -26
  236. package/dist/mcp/pharoMcpHealth.d.ts.map +0 -1
  237. package/dist/mcp/pharoMcpHealth.js +0 -97
  238. package/dist/mcp/pharoMcpHealth.js.map +0 -1
  239. package/dist/support/pathStyle.d.ts +0 -11
  240. package/dist/support/pathStyle.d.ts.map +0 -1
  241. package/dist/support/pathStyle.js +0 -61
  242. package/dist/support/pathStyle.js.map +0 -1
  243. package/dist/support/toolResultFormatting.d.ts +0 -8
  244. package/dist/support/toolResultFormatting.d.ts.map +0 -1
  245. package/dist/support/toolResultFormatting.js +0 -74
  246. package/dist/support/toolResultFormatting.js.map +0 -1
  247. package/dist/workspace/projectStartupScript.d.ts +0 -73
  248. package/dist/workspace/projectStartupScript.d.ts.map +0 -1
  249. package/dist/workspace/projectStartupScript.js +0 -607
  250. package/dist/workspace/projectStartupScript.js.map +0 -1
  251. package/dist/workspace/projectState.d.ts +0 -216
  252. package/dist/workspace/projectState.d.ts.map +0 -1
  253. package/dist/workspace/projectState.js +0 -172
  254. package/dist/workspace/projectState.js.map +0 -1
  255. /package/dist/{gateway/server/routing → forward}/endpointHandoffFormat.js +0 -0
package/dist/index.d.ts CHANGED
@@ -1,25 +1,15 @@
1
1
  /**
2
- * What PLexus promises.
3
- *
4
- * Everything reachable from here is API: a consumer may import it, and it
5
- * moves under semver. Everything else is behind `@evref-bl/plexus/internal`,
6
- * which promises nothing and may change in any release — it is there for this
7
- * repository's own scripts, and for a consumer that knowingly reaches past the
8
- * contract.
9
- *
10
- * The split is by module rather than by name, because a function is only
11
- * usable when the types in its signature can be named too. Narrowing further
12
- * means splitting those modules, not hiding names out of them.
13
- *
14
- * `packageExports.test.ts` holds the list. Adding a name to this surface is a
15
- * decision, so it fails until the list says so.
2
+ * What PLexus promises: everything reachable from here is API and moves under
3
+ * semver. `packageExports.test.ts` holds the list, so a name added here is a
4
+ * decision written down there.
16
5
  */
17
- export * from "./config/pharoMcpVersion.js";
18
- export * from "./config/projectConfigAuthoring.js";
19
- export * from "./config/plexusHome.js";
20
- export * from "./config/projectConfig.js";
21
- export * from "./launcher/scopedPharoLauncherServer.js";
22
- export * from "./lifecycle/stopProjectImage.js";
23
- export * from "./lifecycle/startProjectImage.js";
24
- export * from "./workspace/projectState.js";
6
+ export { defaultPharoMcpVersion } from "./config/pharoMcpVersion.js";
7
+ export { PlexusError, type PlexusErrorCode } from "./errors.js";
8
+ export { callTool, listTools } from "./forward/index.js";
9
+ export { plexusHome } from "./home.js";
10
+ export { Images } from "./images/index.js";
11
+ export type { CreateResult } from "./images/create.js";
12
+ export type { StartResult } from "./images/start.js";
13
+ export type { LauncherPort } from "./launcher/pharoLauncherMcpClient.js";
14
+ export type { CreateOptions, Display, Endpoint, ImageInfo, ImagesOptions, StartOptions, Template, } from "./types.js";
25
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yCAAyC,CAAC;AACxD,cAAc,iCAAiC,CAAC;AAChD,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,YAAY,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACzE,YAAY,EACV,aAAa,EACb,OAAO,EACP,QAAQ,EACR,SAAS,EACT,aAAa,EACb,YAAY,EACZ,QAAQ,GACT,MAAM,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -1,25 +1,11 @@
1
1
  /**
2
- * What PLexus promises.
3
- *
4
- * Everything reachable from here is API: a consumer may import it, and it
5
- * moves under semver. Everything else is behind `@evref-bl/plexus/internal`,
6
- * which promises nothing and may change in any release — it is there for this
7
- * repository's own scripts, and for a consumer that knowingly reaches past the
8
- * contract.
9
- *
10
- * The split is by module rather than by name, because a function is only
11
- * usable when the types in its signature can be named too. Narrowing further
12
- * means splitting those modules, not hiding names out of them.
13
- *
14
- * `packageExports.test.ts` holds the list. Adding a name to this surface is a
15
- * decision, so it fails until the list says so.
2
+ * What PLexus promises: everything reachable from here is API and moves under
3
+ * semver. `packageExports.test.ts` holds the list, so a name added here is a
4
+ * decision written down there.
16
5
  */
17
- export * from "./config/pharoMcpVersion.js";
18
- export * from "./config/projectConfigAuthoring.js";
19
- export * from "./config/plexusHome.js";
20
- export * from "./config/projectConfig.js";
21
- export * from "./launcher/scopedPharoLauncherServer.js";
22
- export * from "./lifecycle/stopProjectImage.js";
23
- export * from "./lifecycle/startProjectImage.js";
24
- export * from "./workspace/projectState.js";
6
+ export { defaultPharoMcpVersion } from "./config/pharoMcpVersion.js";
7
+ export { PlexusError } from "./errors.js";
8
+ export { callTool, listTools } from "./forward/index.js";
9
+ export { plexusHome } from "./home.js";
10
+ export { Images } from "./images/index.js";
25
11
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yCAAyC,CAAC;AACxD,cAAc,iCAAiC,CAAC;AAChD,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,WAAW,EAAwB,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC"}
@@ -1,66 +1,29 @@
1
+ import { type PharoLauncher } from "@evref-bl/pharo-launcher-mcp/launcher";
2
+ export type { LauncherCommandResult, LauncherProcess, } from "@evref-bl/pharo-launcher-mcp/launcher";
3
+ /** What PLexus asks of the launcher. Tests give a fake one. */
4
+ export type LauncherPort = Pick<PharoLauncher, "createImage" | "startImage" | "listProcesses" | "killProcess" | "listTemplateCategories" | "listTemplates" | "updateTemplates">;
5
+ export declare const longCommandTimeoutMs: number;
6
+ export declare function openLauncherPort(home: string): LauncherPort;
1
7
  /**
2
- * How PLexus reaches the launcher.
3
- *
4
- * It used to spawn `pharo-launcher-mcp` and send tool names over stdio. The
5
- * package answers those names as functions now, so the call is a call: no
6
- * process, no handshake, and no object stringified into a text block for the
7
- * other side to parse back. Asking the host what it is running went from
8
- * 175ms to the 46ms the question itself costs.
9
- *
10
- * The names stay because PLexus uses them: an operation that needs approval is
11
- * described before it is performed, and what it names is a tool.
8
+ * What the launcher said went wrong, trimmed: a diagnostic built from
9
+ * launcher output can run to pages. A launch whose VM stopped with its own
10
+ * fatal-error report also says how to renew that VM.
12
11
  */
13
- import { type PharoLauncher } from "@evref-bl/pharo-launcher-mcp/launcher";
14
- export interface PharoLauncherMcpToolClient {
15
- callTool<K extends LauncherToolName>(name: K, argumentsValue?: LauncherToolInput<K>): Promise<LauncherToolResult<K>>;
16
- close?(): Promise<void>;
17
- }
18
- export declare class PharoLauncherMcpToolError extends Error {
19
- readonly toolName: string;
20
- readonly result: unknown;
21
- constructor(message: string, toolName: string, result: unknown);
22
- }
23
- export interface OpenPharoLauncherClientOptions {
24
- /** The profile this caller works in, as the launcher's own variables. */
25
- profileEnvironment?: Record<string, string> | undefined;
26
- }
27
- export declare function launcherToolFailureMessage(toolName: string, payload: unknown): string;
12
+ export declare function launcherFailureMessage(operation: keyof LauncherPort, payload: unknown): string;
13
+ /** The launcher's report of a launch: which VM, which pid, which logs. */
14
+ export declare function launchReport(result: unknown): string;
15
+ /** The VM a detached launch started, as the launcher reports its pid. */
16
+ export declare function launchedPid(result: unknown): number | undefined;
28
17
  /**
29
- * The tool names PLexus speaks, and what each one is.
30
- *
31
- * The launcher's own test keeps its thirteen tools and thirteen functions
32
- * level with each other. This table is the third list, and it is here rather
33
- * than there because the names are PLexus's vocabulary: they appear in the
34
- * plans it shows for approval and in what it reports when one fails.
18
+ * The end of what a waited launch's VM wrote, where it says why it stopped:
19
+ * its errors first, then its output, each trimmed like a diagnostic.
35
20
  */
36
- export declare const launcherMethodForTool: {
37
- readonly pharo_launcher_config: "describeConfig";
38
- readonly pharo_launcher_image_copy: "copyImage";
39
- readonly pharo_launcher_image_copy_between_profiles: "copyImageBetweenProfiles";
40
- readonly pharo_launcher_image_create: "createImage";
41
- readonly pharo_launcher_image_delete: "deleteImage";
42
- readonly pharo_launcher_image_info: "imageInfo";
43
- readonly pharo_launcher_image_list: "listImages";
44
- readonly pharo_launcher_image_start: "startImage";
45
- readonly pharo_launcher_process_kill: "killProcess";
46
- readonly pharo_launcher_process_list: "listProcesses";
47
- readonly pharo_launcher_template_category_list: "listTemplateCategories";
48
- readonly pharo_launcher_template_list: "listTemplates";
49
- readonly pharo_launcher_template_update: "updateTemplates";
50
- };
51
- export type LauncherToolName = keyof typeof launcherMethodForTool;
52
- type LauncherMethodFor<K extends LauncherToolName> = PharoLauncher[(typeof launcherMethodForTool)[K]];
53
- /** What that tool takes, read off the function it calls. */
54
- export type LauncherToolInput<K extends LauncherToolName> = Parameters<LauncherMethodFor<K>>[0];
55
- /** What that tool answers, read off the function it calls. */
56
- export type LauncherToolResult<K extends LauncherToolName> = Awaited<ReturnType<LauncherMethodFor<K>>>;
21
+ export declare function launchOutputTail(result: unknown): string[];
22
+ /** The log files a detached launch writes the VM's output to. */
23
+ export declare function launchLogPaths(result: unknown): string[];
57
24
  /**
58
- * The tools an operation plan may name: the ones that change something, and
59
- * are therefore written down and approved before they run. Every one of them
60
- * answers with an `ok`, which is what the caller checks afterwards.
25
+ * What a detached launch's logs say about a VM that stopped: the renewal hint
26
+ * when it stopped with its own fatal-error report, or nothing.
61
27
  */
62
- export type LauncherMutationToolName = "pharo_launcher_image_copy" | "pharo_launcher_image_copy_between_profiles" | "pharo_launcher_image_create" | "pharo_launcher_image_delete" | "pharo_launcher_image_start" | "pharo_launcher_template_update";
63
- export declare const launcherToolNames: LauncherToolName[];
64
- export declare function openPharoLauncherClient(options?: OpenPharoLauncherClientOptions): PharoLauncherMcpToolClient;
65
- export {};
28
+ export declare function exitedLaunchHint(result: unknown, logPaths: readonly string[]): string | undefined;
66
29
  //# sourceMappingURL=pharoLauncherMcpClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pharoLauncherMcpClient.d.ts","sourceRoot":"","sources":["../../src/launcher/pharoLauncherMcpClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAEL,KA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C,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAGjG"}
@@ -1,107 +1,148 @@
1
1
  /**
2
- * How PLexus reaches the launcher.
3
- *
4
- * It used to spawn `pharo-launcher-mcp` and send tool names over stdio. The
5
- * package answers those names as functions now, so the call is a call: no
6
- * process, no handshake, and no object stringified into a text block for the
7
- * other side to parse back. Asking the host what it is running went from
8
- * 175ms to the 46ms the question itself costs.
9
- *
10
- * The names stay because PLexus uses them: an operation that needs approval is
11
- * described before it is performed, and what it names is a tool.
2
+ * How PLexus reaches the launcher: pharo-launcher-mcp's functions, called in
3
+ * this process on PLexus's one profile.
12
4
  */
5
+ import fs from "node:fs";
13
6
  import { openPharoLauncher, } from "@evref-bl/pharo-launcher-mcp/launcher";
14
- export class PharoLauncherMcpToolError extends Error {
15
- toolName;
16
- result;
17
- constructor(message, toolName, result) {
18
- super(message);
19
- this.toolName = toolName;
20
- this.result = result;
21
- this.name = "PharoLauncherMcpToolError";
22
- }
7
+ import { homeProfileEnvironment } from "./pharoLauncherProfile.js";
8
+ import { vmRenewalHint } from "./vmRenewal.js";
9
+ // The launcher gives a command 30 s. Downloading a template, or a launch that
10
+ // waits while an image loads MCP and saves, takes minutes.
11
+ export const longCommandTimeoutMs = 60 * 60_000;
12
+ export function openLauncherPort(home) {
13
+ const env = homeProfileEnvironment(home);
14
+ let quick;
15
+ let long;
16
+ const quickLauncher = () => (quick ??= openPharoLauncher({ env }));
17
+ const longLauncher = () => (long ??= openPharoLauncher({ env, timeoutMs: longCommandTimeoutMs }));
18
+ return {
19
+ createImage: (input) => longLauncher().createImage(input),
20
+ startImage: (input) => (input.detached ? quickLauncher() : longLauncher()).startImage(input),
21
+ listProcesses: (input) => quickLauncher().listProcesses(input),
22
+ killProcess: (input) => quickLauncher().killProcess(input),
23
+ listTemplateCategories: (input) => quickLauncher().listTemplateCategories(input),
24
+ listTemplates: (input) => quickLauncher().listTemplates(input),
25
+ updateTemplates: (input) => quickLauncher().updateTemplates(input),
26
+ };
23
27
  }
24
- const launcherFailureDetailLength = 500;
25
- function failureDetailField(payload, key) {
26
- if (!payload || typeof payload !== "object") {
28
+ const failureDetailLength = 500;
29
+ function detailField(payload, key) {
30
+ if (!isRecord(payload)) {
27
31
  return undefined;
28
32
  }
29
33
  const value = payload[key];
30
- if (typeof value !== "string") {
34
+ if (typeof value !== "string" || !value.trim()) {
31
35
  return undefined;
32
36
  }
33
37
  const detail = value.trim();
34
- if (!detail) {
35
- return undefined;
36
- }
37
- return detail.length > launcherFailureDetailLength
38
- ? `${detail.slice(0, launcherFailureDetailLength)}…`
38
+ return detail.length > failureDetailLength
39
+ ? `${detail.slice(0, failureDetailLength)}…`
39
40
  : detail;
40
41
  }
41
- // The launcher says what went wrong and what to do about it. A message naming
42
- // only the tool throws that away, and the caller above us has nothing left to
43
- // report. Carry the explanation, trimmed: a diagnostic built from launcher
44
- // output can run to pages.
45
- export function launcherToolFailureMessage(toolName, payload) {
46
- const detail = failureDetailField(payload, "message") ??
47
- [
48
- failureDetailField(payload, "diagnostic"),
49
- failureDetailField(payload, "action"),
50
- ]
42
+ /**
43
+ * What the launcher said went wrong, trimmed: a diagnostic built from
44
+ * launcher output can run to pages. A launch whose VM stopped with its own
45
+ * fatal-error report also says how to renew that VM.
46
+ */
47
+ export function launcherFailureMessage(operation, payload) {
48
+ const detail = detailField(payload, "message") ??
49
+ [detailField(payload, "diagnostic"), detailField(payload, "action")]
51
50
  .filter(Boolean)
52
51
  .join(" ");
53
- return detail
54
- ? `pharo-launcher-mcp tool failed: ${toolName}: ${detail}`
55
- : `pharo-launcher-mcp tool failed: ${toolName}`;
52
+ const message = detail
53
+ ? `Pharo Launcher ${operation} failed: ${detail}`
54
+ : `Pharo Launcher ${operation} failed`;
55
+ const renewal = operation === "startImage" ? waitedLaunchRenewalHint(payload) : undefined;
56
+ return renewal ? `${message}\n${renewal}` : message;
57
+ }
58
+ // A launch that waited for its VM has the VM's output in the raw result,
59
+ // after the launcher's own report of which VM it ran.
60
+ function waitedLaunchRenewalHint(payload) {
61
+ if (!isRecord(payload) || !isRecord(payload.raw)) {
62
+ return undefined;
63
+ }
64
+ const { stdout, stderr } = payload.raw;
65
+ const report = typeof stdout === "string" ? stdout : "";
66
+ return vmRenewalHint(`${report}\n${typeof stderr === "string" ? stderr : ""}`, report);
67
+ }
68
+ /** The launcher's report of a launch: which VM, which pid, which logs. */
69
+ export function launchReport(result) {
70
+ if (!isRecord(result)) {
71
+ return "";
72
+ }
73
+ if (isRecord(result.raw) && typeof result.raw.stdout === "string") {
74
+ return result.raw.stdout;
75
+ }
76
+ return isRecord(result.data) && typeof result.data.message === "string"
77
+ ? result.data.message
78
+ : "";
79
+ }
80
+ /** The VM a detached launch started, as the launcher reports its pid. */
81
+ export function launchedPid(result) {
82
+ const pid = /^Detached profile-scoped Pharo image pid (\d+)\./m.exec(launchReport(result))?.[1];
83
+ return pid === undefined ? undefined : Number(pid);
56
84
  }
57
85
  /**
58
- * The tool names PLexus speaks, and what each one is.
59
- *
60
- * The launcher's own test keeps its thirteen tools and thirteen functions
61
- * level with each other. This table is the third list, and it is here rather
62
- * than there because the names are PLexus's vocabulary: they appear in the
63
- * plans it shows for approval and in what it reports when one fails.
86
+ * The end of what a waited launch's VM wrote, where it says why it stopped:
87
+ * its errors first, then its output, each trimmed like a diagnostic.
64
88
  */
65
- export const launcherMethodForTool = {
66
- pharo_launcher_config: "describeConfig",
67
- pharo_launcher_image_copy: "copyImage",
68
- pharo_launcher_image_copy_between_profiles: "copyImageBetweenProfiles",
69
- pharo_launcher_image_create: "createImage",
70
- pharo_launcher_image_delete: "deleteImage",
71
- pharo_launcher_image_info: "imageInfo",
72
- pharo_launcher_image_list: "listImages",
73
- pharo_launcher_image_start: "startImage",
74
- pharo_launcher_process_kill: "killProcess",
75
- pharo_launcher_process_list: "listProcesses",
76
- pharo_launcher_template_category_list: "listTemplateCategories",
77
- pharo_launcher_template_list: "listTemplates",
78
- pharo_launcher_template_update: "updateTemplates",
79
- };
80
- export const launcherToolNames = Object.keys(launcherMethodForTool);
81
- function failed(result) {
82
- return (Boolean(result) &&
83
- typeof result === "object" &&
84
- result.ok === false);
89
+ export function launchOutputTail(result) {
90
+ if (!isRecord(result) || !isRecord(result.raw)) {
91
+ return [];
92
+ }
93
+ const streams = [
94
+ ["Its error output ends with:", result.raw.stderr],
95
+ ["Its output ends with:", result.raw.stdout],
96
+ ];
97
+ return streams.flatMap(([label, text]) => {
98
+ const trimmed = typeof text === "string" ? text.trim() : "";
99
+ if (!trimmed) {
100
+ return [];
101
+ }
102
+ const tail = trimmed.length > failureDetailLength
103
+ ? `…${trimmed.slice(-failureDetailLength)}`
104
+ : trimmed;
105
+ return [`${label}\n${tail}`];
106
+ });
85
107
  }
86
- export function openPharoLauncherClient(options = {}) {
87
- const launcher = openPharoLauncher(options.profileEnvironment === undefined
88
- ? {}
89
- : { env: options.profileEnvironment });
90
- return {
91
- async callTool(name, argumentsValue) {
92
- const method = launcherMethodForTool[name];
93
- if (!method) {
94
- throw new PharoLauncherMcpToolError(`pharo-launcher-mcp has no tool named ${name}`, name, undefined);
95
- }
96
- // The one cast left: every method takes its own input, and the table
97
- // above is what ties a name to the right one.
98
- const call = launcher[method];
99
- const result = (await call.call(launcher, argumentsValue ?? {}));
100
- if (failed(result)) {
101
- throw new PharoLauncherMcpToolError(launcherToolFailureMessage(name, result), name, result);
102
- }
103
- return result;
104
- },
105
- };
108
+ /** The log files a detached launch writes the VM's output to. */
109
+ export function launchLogPaths(result) {
110
+ const paths = launchReport(result)
111
+ .split(/\r?\n/)
112
+ .map((line) => /^(?:stdout|stderr):\s*(\S.*)$/.exec(line.trim())?.[1])
113
+ .filter((value) => value !== undefined);
114
+ return [...new Set(paths)];
115
+ }
116
+ /**
117
+ * What a detached launch's logs say about a VM that stopped: the renewal hint
118
+ * when it stopped with its own fatal-error report, or nothing.
119
+ */
120
+ export function exitedLaunchHint(result, logPaths) {
121
+ const report = launchReport(result);
122
+ return report ? vmRenewalHint(logPaths.map(logTail).join("\n"), report) : undefined;
123
+ }
124
+ // The end of a log, where a VM that stopped wrote why. A log that is gone says
125
+ // nothing.
126
+ function logTail(logPath) {
127
+ const tailLength = 64 * 1024;
128
+ try {
129
+ const size = fs.statSync(logPath).size;
130
+ const descriptor = fs.openSync(logPath, "r");
131
+ try {
132
+ const length = Math.min(size, tailLength);
133
+ const buffer = Buffer.alloc(length);
134
+ fs.readSync(descriptor, buffer, 0, length, size - length);
135
+ return buffer.toString("utf8");
136
+ }
137
+ finally {
138
+ fs.closeSync(descriptor);
139
+ }
140
+ }
141
+ catch {
142
+ return "";
143
+ }
144
+ }
145
+ function isRecord(value) {
146
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
106
147
  }
107
148
  //# sourceMappingURL=pharoLauncherMcpClient.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pharoLauncherMcpClient.js","sourceRoot":"","sources":["../../src/launcher/pharoLauncherMcpClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EACL,iBAAiB,GAElB,MAAM,uCAAuC,CAAC;AAU/C,MAAM,OAAO,yBAA0B,SAAQ,KAAK;IAGhC;IACA;IAHlB,YACE,OAAe,EACC,QAAgB,EAChB,MAAe;QAE/B,KAAK,CAAC,OAAO,CAAC,CAAC;QAHC,aAAQ,GAAR,QAAQ,CAAQ;QAChB,WAAM,GAAN,MAAM,CAAS;QAG/B,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAC;IAC1C,CAAC;CACF;AAOD,MAAM,2BAA2B,GAAG,GAAG,CAAC;AAExC,SAAS,kBAAkB,CAAC,OAAgB,EAAE,GAAW;IACvD,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAC5C,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,KAAK,GAAI,OAAmC,CAAC,GAAG,CAAC,CAAC;IACxD,IAAI,OAAO,KAA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AAG,MAAM,CAAC,CAAC;YAC1D,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QACjC,CAAC;gBAAS,CAAC;YACT,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC"}
@@ -1,30 +1,8 @@
1
- import { type ProjectConfig } from "../config/projectConfig.js";
2
- export type PharoLauncherMcpProfileOwnership = "plexus-owned" | "external" | "unknown";
3
- export interface PharoLauncherMcpProfilePaths {
4
- profileName?: string;
5
- stateRoot?: string;
6
- launcherImage?: string;
7
- imagesDir?: string;
8
- vmsDir?: string;
9
- templateSourcesDir?: string;
10
- initScriptsDir?: string;
11
- logsDir?: string;
12
- launcherConfiguration?: string;
13
- }
14
- export interface PharoLauncherMcpProfileDiagnostic extends PharoLauncherMcpProfilePaths {
15
- ownership: PharoLauncherMcpProfileOwnership;
16
- mode: "project-owned" | "external";
17
- profileScope: "project" | "explicit-override" | "external" | "unknown";
18
- environmentKeys: string[];
19
- reason: string;
20
- }
21
- export interface ResolvePharoLauncherMcpProfileOptions {
22
- projectRoot: string;
23
- config: ProjectConfig;
24
- workspaceId: string;
25
- stateRoot?: string;
26
- env?: NodeJS.ProcessEnv;
27
- }
28
- export declare function pharoLauncherMcpProfileEnvironment(options: ResolvePharoLauncherMcpProfileOptions): Record<string, string> | undefined;
29
- export declare function describePharoLauncherMcpProfile(options: ResolvePharoLauncherMcpProfileOptions): PharoLauncherMcpProfileDiagnostic;
1
+ /**
2
+ * PLexus's one launcher profile, as the launcher's own variables.
3
+ *
4
+ * One profile, so the launcher image, the VMs and the templates, which are
5
+ * large and the same for every image, exist once per home.
6
+ */
7
+ export declare function homeProfileEnvironment(home: string): Record<string, string>;
30
8
  //# sourceMappingURL=pharoLauncherProfile.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pharoLauncherProfile.d.ts","sourceRoot":"","sources":["../../src/launcher/pharoLauncherProfile.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,4BAA4B,CAAC;AAKpC,MAAM,MAAM,gCAAgC,GACxC,cAAc,GACd,UAAU,GACV,SAAS,CAAC;AAEd,MAAM,WAAW,4BAA4B;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,iCACf,SAAQ,4BAA4B;IACpC,SAAS,EAAE,gCAAgC,CAAC;IAC5C,IAAI,EAAE,eAAe,GAAG,UAAU,CAAC;IACnC,YAAY,EAAE,SAAS,GAAG,mBAAmB,GAAG,UAAU,GAAG,SAAS,CAAC;IACvE,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,qCAAqC;IACpD,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,aAAa,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CACzB;AAyFD,wBAAgB,kCAAkC,CAChD,OAAO,EAAE,qCAAqC,GAC7C,MAAM,C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