@evref-bl/plexus 0.15.2 → 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.
- package/README.md +8 -12
- package/dist/cli.js +8 -183
- package/dist/cli.js.map +1 -1
- package/dist/commandLine.d.ts +13 -0
- package/dist/commandLine.d.ts.map +1 -0
- package/dist/commandLine.js +247 -0
- package/dist/commandLine.js.map +1 -0
- package/dist/config/pharoMcpVersion.d.ts +6 -7
- package/dist/config/pharoMcpVersion.d.ts.map +1 -1
- package/dist/config/pharoMcpVersion.js +6 -7
- package/dist/config/pharoMcpVersion.js.map +1 -1
- package/dist/errors.d.ts +11 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +17 -0
- package/dist/errors.js.map +1 -0
- package/dist/forward/endpointHandoffFormat.d.ts +23 -0
- package/dist/forward/endpointHandoffFormat.d.ts.map +1 -0
- package/dist/forward/endpointHandoffFormat.js.map +1 -0
- package/dist/forward/index.d.ts +20 -0
- package/dist/forward/index.d.ts.map +1 -0
- package/dist/forward/index.js +77 -0
- package/dist/forward/index.js.map +1 -0
- package/dist/forward/jsonRpc.d.ts +20 -0
- package/dist/forward/jsonRpc.d.ts.map +1 -0
- package/dist/forward/jsonRpc.js +141 -0
- package/dist/forward/jsonRpc.js.map +1 -0
- package/dist/home.d.ts +15 -0
- package/dist/home.d.ts.map +1 -0
- package/dist/home.js +30 -0
- package/dist/home.js.map +1 -0
- package/dist/images/bases.d.ts +40 -0
- package/dist/images/bases.d.ts.map +1 -0
- package/dist/images/bases.js +190 -0
- package/dist/images/bases.js.map +1 -0
- package/dist/images/claims.d.ts +34 -0
- package/dist/images/claims.d.ts.map +1 -0
- package/dist/images/claims.js +119 -0
- package/dist/images/claims.js.map +1 -0
- package/dist/images/context.d.ts +22 -0
- package/dist/images/context.d.ts.map +1 -0
- package/dist/images/context.js +26 -0
- package/dist/images/context.js.map +1 -0
- package/dist/images/create.d.ts +19 -0
- package/dist/images/create.d.ts.map +1 -0
- package/dist/images/create.js +121 -0
- package/dist/images/create.js.map +1 -0
- package/dist/images/delete.d.ts +10 -0
- package/dist/images/delete.d.ts.map +1 -0
- package/dist/images/delete.js +31 -0
- package/dist/images/delete.js.map +1 -0
- package/dist/images/endpoint.d.ts +17 -0
- package/dist/images/endpoint.d.ts.map +1 -0
- package/dist/images/endpoint.js +58 -0
- package/dist/images/endpoint.js.map +1 -0
- package/dist/images/index.d.ts +28 -0
- package/dist/images/index.d.ts.map +1 -0
- package/dist/images/index.js +51 -0
- package/dist/images/index.js.map +1 -0
- package/dist/images/leftovers.d.ts +9 -0
- package/dist/images/leftovers.d.ts.map +1 -0
- package/dist/images/leftovers.js +38 -0
- package/dist/images/leftovers.js.map +1 -0
- package/dist/images/list.d.ts +12 -0
- package/dist/images/list.d.ts.map +1 -0
- package/dist/images/list.js +74 -0
- package/dist/images/list.js.map +1 -0
- package/dist/images/names.d.ts +15 -0
- package/dist/images/names.d.ts.map +1 -0
- package/dist/images/names.js +53 -0
- package/dist/images/names.js.map +1 -0
- package/dist/images/prepare.d.ts +18 -0
- package/dist/images/prepare.d.ts.map +1 -0
- package/dist/images/prepare.js +58 -0
- package/dist/images/prepare.js.map +1 -0
- package/dist/images/processes.d.ts +21 -0
- package/dist/images/processes.d.ts.map +1 -0
- package/dist/images/processes.js +83 -0
- package/dist/images/processes.js.map +1 -0
- package/dist/images/scripts.d.ts +39 -0
- package/dist/images/scripts.d.ts.map +1 -0
- package/dist/images/scripts.js +127 -0
- package/dist/images/scripts.js.map +1 -0
- package/dist/images/start.d.ts +23 -0
- package/dist/images/start.d.ts.map +1 -0
- package/dist/images/start.js +173 -0
- package/dist/images/start.js.map +1 -0
- package/dist/images/stop.d.ts +11 -0
- package/dist/images/stop.d.ts.map +1 -0
- package/dist/images/stop.js +42 -0
- package/dist/images/stop.js.map +1 -0
- package/dist/images/store.d.ts +62 -0
- package/dist/images/store.d.ts.map +1 -0
- package/dist/images/store.js +180 -0
- package/dist/images/store.js.map +1 -0
- package/dist/images/templates.d.ts +14 -0
- package/dist/images/templates.d.ts.map +1 -0
- package/dist/images/templates.js +84 -0
- package/dist/images/templates.js.map +1 -0
- package/dist/index.d.ts +12 -22
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -22
- package/dist/index.js.map +1 -1
- package/dist/launcher/pharoLauncherMcpClient.d.ts +22 -59
- package/dist/launcher/pharoLauncherMcpClient.d.ts.map +1 -1
- package/dist/launcher/pharoLauncherMcpClient.js +121 -98
- package/dist/launcher/pharoLauncherMcpClient.js.map +1 -1
- package/dist/launcher/pharoLauncherProfile.d.ts +5 -32
- package/dist/launcher/pharoLauncherProfile.d.ts.map +1 -1
- package/dist/launcher/pharoLauncherProfile.js +17 -115
- package/dist/launcher/pharoLauncherProfile.js.map +1 -1
- package/dist/mcp/server.d.ts +18 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +206 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/types.d.ts +68 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +5 -0
- package/dist/version.js.map +1 -0
- package/package.json +3 -12
- package/dist/config/config.d.ts +0 -15
- package/dist/config/config.d.ts.map +0 -1
- package/dist/config/config.js +0 -74
- package/dist/config/config.js.map +0 -1
- package/dist/config/plexusHome.d.ts +0 -17
- package/dist/config/plexusHome.d.ts.map +0 -1
- package/dist/config/plexusHome.js +0 -30
- package/dist/config/plexusHome.js.map +0 -1
- package/dist/config/projectConfig.d.ts +0 -141
- package/dist/config/projectConfig.d.ts.map +0 -1
- package/dist/config/projectConfig.js +0 -722
- package/dist/config/projectConfig.js.map +0 -1
- package/dist/config/projectConfigAuthoring.d.ts +0 -53
- package/dist/config/projectConfigAuthoring.d.ts.map +0 -1
- package/dist/config/projectConfigAuthoring.js +0 -159
- package/dist/config/projectConfigAuthoring.js.map +0 -1
- package/dist/gateway/projectImageMcpEndpoint.d.ts +0 -23
- package/dist/gateway/projectImageMcpEndpoint.d.ts.map +0 -1
- package/dist/gateway/projectImageMcpEndpoint.js +0 -40
- package/dist/gateway/projectImageMcpEndpoint.js.map +0 -1
- package/dist/gateway/server/index.d.ts +0 -8
- package/dist/gateway/server/index.d.ts.map +0 -1
- package/dist/gateway/server/index.js +0 -34
- package/dist/gateway/server/index.js.map +0 -1
- package/dist/gateway/server/mcp/server.d.ts +0 -66
- package/dist/gateway/server/mcp/server.d.ts.map +0 -1
- package/dist/gateway/server/mcp/server.js +0 -458
- package/dist/gateway/server/mcp/server.js.map +0 -1
- package/dist/gateway/server/routing/endpointHandoffFormat.d.ts +0 -26
- package/dist/gateway/server/routing/endpointHandoffFormat.d.ts.map +0 -1
- package/dist/gateway/server/routing/endpointHandoffFormat.js.map +0 -1
- package/dist/gateway/server/routing/gateway.d.ts +0 -167
- package/dist/gateway/server/routing/gateway.d.ts.map +0 -1
- package/dist/gateway/server/routing/gateway.js +0 -863
- package/dist/gateway/server/routing/gateway.js.map +0 -1
- package/dist/gateway/server/routing/imageMcpRouter.d.ts +0 -59
- package/dist/gateway/server/routing/imageMcpRouter.d.ts.map +0 -1
- package/dist/gateway/server/routing/imageMcpRouter.js +0 -253
- package/dist/gateway/server/routing/imageMcpRouter.js.map +0 -1
- package/dist/gateway/server/routing/pharoFacade.d.ts +0 -12
- package/dist/gateway/server/routing/pharoFacade.d.ts.map +0 -1
- package/dist/gateway/server/routing/pharoFacade.js +0 -67
- package/dist/gateway/server/routing/pharoFacade.js.map +0 -1
- package/dist/gateway/server/routing/routeDiscovery.d.ts +0 -26
- package/dist/gateway/server/routing/routeDiscovery.d.ts.map +0 -1
- package/dist/gateway/server/routing/routeDiscovery.js +0 -46
- package/dist/gateway/server/routing/routeDiscovery.js.map +0 -1
- package/dist/gateway/server/routing/routingTable.d.ts +0 -120
- package/dist/gateway/server/routing/routingTable.d.ts.map +0 -1
- package/dist/gateway/server/routing/routingTable.js +0 -215
- package/dist/gateway/server/routing/routingTable.js.map +0 -1
- package/dist/gateway/server/support/processLiveness.d.ts +0 -10
- package/dist/gateway/server/support/processLiveness.d.ts.map +0 -1
- package/dist/gateway/server/support/processLiveness.js +0 -25
- package/dist/gateway/server/support/processLiveness.js.map +0 -1
- package/dist/gateway/server/support/sourceBuildPreflight.d.ts +0 -15
- package/dist/gateway/server/support/sourceBuildPreflight.d.ts.map +0 -1
- package/dist/gateway/server/support/sourceBuildPreflight.js +0 -88
- package/dist/gateway/server/support/sourceBuildPreflight.js.map +0 -1
- package/dist/gateway/server/support/toolResultFormatting.d.ts +0 -8
- package/dist/gateway/server/support/toolResultFormatting.d.ts.map +0 -1
- package/dist/gateway/server/support/toolResultFormatting.js +0 -74
- package/dist/gateway/server/support/toolResultFormatting.js.map +0 -1
- package/dist/images/homeImageCache.d.ts +0 -302
- package/dist/images/homeImageCache.d.ts.map +0 -1
- package/dist/images/homeImageCache.js +0 -1031
- package/dist/images/homeImageCache.js.map +0 -1
- package/dist/images/imageRescue.d.ts +0 -151
- package/dist/images/imageRescue.d.ts.map +0 -1
- package/dist/images/imageRescue.js +0 -748
- package/dist/images/imageRescue.js.map +0 -1
- package/dist/images/imageRuntime.d.ts +0 -60
- package/dist/images/imageRuntime.d.ts.map +0 -1
- package/dist/images/imageRuntime.js +0 -90
- package/dist/images/imageRuntime.js.map +0 -1
- package/dist/images/preparedImageCache.d.ts +0 -86
- package/dist/images/preparedImageCache.d.ts.map +0 -1
- package/dist/images/preparedImageCache.js +0 -229
- package/dist/images/preparedImageCache.js.map +0 -1
- package/dist/images/scopedTemplateCatalog.d.ts +0 -33
- package/dist/images/scopedTemplateCatalog.d.ts.map +0 -1
- package/dist/images/scopedTemplateCatalog.js +0 -363
- package/dist/images/scopedTemplateCatalog.js.map +0 -1
- package/dist/internal.d.ts +0 -20
- package/dist/internal.d.ts.map +0 -1
- package/dist/internal.js +0 -20
- package/dist/internal.js.map +0 -1
- package/dist/launcher/scopedPharoLauncherServer.d.ts +0 -349
- package/dist/launcher/scopedPharoLauncherServer.d.ts.map +0 -1
- package/dist/launcher/scopedPharoLauncherServer.js +0 -1307
- package/dist/launcher/scopedPharoLauncherServer.js.map +0 -1
- package/dist/lifecycle/startProjectImage.d.ts +0 -94
- package/dist/lifecycle/startProjectImage.d.ts.map +0 -1
- package/dist/lifecycle/startProjectImage.js +0 -1054
- package/dist/lifecycle/startProjectImage.js.map +0 -1
- package/dist/lifecycle/stopProjectImage.d.ts +0 -31
- package/dist/lifecycle/stopProjectImage.d.ts.map +0 -1
- package/dist/lifecycle/stopProjectImage.js +0 -201
- package/dist/lifecycle/stopProjectImage.js.map +0 -1
- package/dist/mcp/agentServer.d.ts +0 -15
- package/dist/mcp/agentServer.d.ts.map +0 -1
- package/dist/mcp/agentServer.js +0 -67
- package/dist/mcp/agentServer.js.map +0 -1
- package/dist/mcp/imageOperations.d.ts +0 -54
- package/dist/mcp/imageOperations.d.ts.map +0 -1
- package/dist/mcp/imageOperations.js +0 -223
- package/dist/mcp/imageOperations.js.map +0 -1
- package/dist/mcp/pharoMcpHealth.d.ts +0 -26
- package/dist/mcp/pharoMcpHealth.d.ts.map +0 -1
- package/dist/mcp/pharoMcpHealth.js +0 -97
- package/dist/mcp/pharoMcpHealth.js.map +0 -1
- package/dist/support/pathStyle.d.ts +0 -11
- package/dist/support/pathStyle.d.ts.map +0 -1
- package/dist/support/pathStyle.js +0 -61
- package/dist/support/pathStyle.js.map +0 -1
- package/dist/support/toolResultFormatting.d.ts +0 -8
- package/dist/support/toolResultFormatting.d.ts.map +0 -1
- package/dist/support/toolResultFormatting.js +0 -74
- package/dist/support/toolResultFormatting.js.map +0 -1
- package/dist/workspace/projectStartupScript.d.ts +0 -73
- package/dist/workspace/projectStartupScript.d.ts.map +0 -1
- package/dist/workspace/projectStartupScript.js +0 -607
- package/dist/workspace/projectStartupScript.js.map +0 -1
- package/dist/workspace/projectState.d.ts +0 -216
- package/dist/workspace/projectState.d.ts.map +0 -1
- package/dist/workspace/projectState.js +0 -172
- package/dist/workspace/projectState.js.map +0 -1
- /package/dist/{gateway/server/routing → forward}/endpointHandoffFormat.js +0 -0
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# PLexus
|
|
2
2
|
|
|
3
|
-
`@evref-bl/plexus`
|
|
4
|
-
|
|
3
|
+
`@evref-bl/plexus` makes, starts, stops and deletes Pharo images that answer
|
|
4
|
+
MCP, and forwards tool calls to a running one. An image is a directory, a
|
|
5
|
+
running image is a VM process on its image file, and every call looks at both
|
|
6
|
+
when it is made.
|
|
5
7
|
|
|
6
|
-
It is a command
|
|
7
|
-
functions, so a caller inside Node does not have to round-trip through MCP to
|
|
8
|
-
use it.
|
|
8
|
+
It is a command and a library:
|
|
9
9
|
|
|
10
10
|
```sh
|
|
11
11
|
npm install --global @evref-bl/plexus
|
|
@@ -13,12 +13,8 @@ plexus --help
|
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
```ts
|
|
16
|
-
import {
|
|
16
|
+
import { Images, callTool, listTools } from "@evref-bl/plexus";
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
Everything reachable from the package root is API.
|
|
20
|
-
|
|
21
|
-
the forwarding surface for a host that embeds the gateway.
|
|
22
|
-
|
|
23
|
-
Configuration and MCP usage are documented at
|
|
24
|
-
https://github.com/Evref-BL/PLexus.
|
|
19
|
+
Everything reachable from the package root is API. The model, the commands
|
|
20
|
+
and `plexus mcp` are documented at https://github.com/Evref-BL/PLexus.
|
package/dist/cli.js
CHANGED
|
@@ -1,188 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
async function runImageCommand(parsed, stateRoot, workspaceId) {
|
|
9
|
-
const projectRoot = parsed.projectPath ?? process.env.PLEXUS_PROJECT_ROOT ?? process.cwd();
|
|
10
|
-
const launcher = new ScopedPharoLauncher({
|
|
11
|
-
projectRoot,
|
|
12
|
-
...(workspaceId === undefined ? {} : { workspaceId }),
|
|
13
|
-
...(stateRoot === undefined ? {} : { stateRoot }),
|
|
14
|
-
imageLease: scopedImageLeaseOptionsFromEnvironment(process.env),
|
|
15
|
-
});
|
|
16
|
-
const needsImageId = () => {
|
|
17
|
-
if (!parsed.imageId) {
|
|
18
|
-
throw new Error(`plexus image ${parsed.command} requires an image id`);
|
|
19
|
-
}
|
|
20
|
-
return parsed.imageId;
|
|
21
|
-
};
|
|
22
|
-
try {
|
|
23
|
-
// One command is one operation, so it opens one launcher client however
|
|
24
|
-
// many steps it takes.
|
|
25
|
-
return await launcher.runOperation(async () => {
|
|
26
|
-
switch (parsed.command) {
|
|
27
|
-
case "list":
|
|
28
|
-
return print(await launcher.listImages());
|
|
29
|
-
case "create":
|
|
30
|
-
return print(await launcher.createImage(needsImageId()));
|
|
31
|
-
case "start":
|
|
32
|
-
return print(await launcher.startImage(needsImageId(), parsed.displayMode));
|
|
33
|
-
case "stop":
|
|
34
|
-
return print(await launcher.stopImage(needsImageId()));
|
|
35
|
-
case "delete":
|
|
36
|
-
return print(await launcher.deleteImage(needsImageId()));
|
|
37
|
-
default:
|
|
38
|
-
console.error(usage());
|
|
39
|
-
return 2;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
catch (error) {
|
|
44
|
-
console.error(JSON.stringify({ ok: false, error: error instanceof Error ? error.message : String(error) }, null, 2));
|
|
45
|
-
return 1;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
function print(value) {
|
|
49
|
-
console.log(JSON.stringify(value, null, 2));
|
|
50
|
-
return 0;
|
|
51
|
-
}
|
|
52
|
-
function usage() {
|
|
53
|
-
return [
|
|
54
|
-
"Usage:",
|
|
55
|
-
" plexus image list|create|start|stop|delete <imageId> [--project-path <path>] [--workspace-id <id>] [--state-root <path>] [--display-mode <headless|interactive>]",
|
|
56
|
-
" plexus mcp (agent front door: images and the running image's Pharo tools, over stdio)",
|
|
57
|
-
" plexus mcp pharo-launcher [--project-path <path>] [--workspace-id <id>] [--state-root <path>]",
|
|
58
|
-
"",
|
|
59
|
-
"Environment:",
|
|
60
|
-
" PLEXUS_PROJECT_ROOT Project root; defaults to the working directory.",
|
|
61
|
-
" PLEXUS_STATE_ROOT Optional runtime state root.",
|
|
62
|
-
" PLEXUS_WORKSPACE_ID Optional runtime workspace id.",
|
|
63
|
-
" PLEXUS_IMAGE_LEASE_OWNER_ID Optional scoped image lease owner id.",
|
|
64
|
-
" PLEXUS_IMAGE_LEASE_OWNER_KIND Optional lease owner kind.",
|
|
65
|
-
" PLEXUS_IMAGE_LEASE_PURPOSE Optional lease purpose.",
|
|
66
|
-
].join("\n");
|
|
67
|
-
}
|
|
68
|
-
function applyFlagOption(parsed, arg) {
|
|
69
|
-
switch (arg) {
|
|
70
|
-
case "--confirm":
|
|
71
|
-
parsed.confirm = true;
|
|
72
|
-
return true;
|
|
73
|
-
case "--delete-state":
|
|
74
|
-
parsed.deleteStateFile = true;
|
|
75
|
-
return true;
|
|
76
|
-
case "--keep-launcher-images":
|
|
77
|
-
parsed.deleteLauncherImages = false;
|
|
78
|
-
return true;
|
|
79
|
-
default:
|
|
80
|
-
return false;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
function requiredOptionValue(rest, index) {
|
|
84
|
-
const arg = rest[index];
|
|
85
|
-
const value = rest[index + 1];
|
|
86
|
-
if (!value) {
|
|
87
|
-
throw new Error(`${arg} requires a value`);
|
|
88
|
-
}
|
|
89
|
-
return value;
|
|
90
|
-
}
|
|
91
|
-
function parseDisplayMode(value) {
|
|
92
|
-
if (value !== "headless" && value !== "interactive") {
|
|
93
|
-
throw new Error("--display-mode must be headless or interactive");
|
|
94
|
-
}
|
|
95
|
-
return value;
|
|
96
|
-
}
|
|
97
|
-
function applyValueOption(parsed, arg, value) {
|
|
98
|
-
switch (arg) {
|
|
99
|
-
case "--project-path":
|
|
100
|
-
parsed.projectPath = value;
|
|
101
|
-
return;
|
|
102
|
-
case "--state-root":
|
|
103
|
-
parsed.stateRoot = value;
|
|
104
|
-
return;
|
|
105
|
-
case "--workspace-id":
|
|
106
|
-
parsed.workspaceId = value;
|
|
107
|
-
return;
|
|
108
|
-
case "--display-mode":
|
|
109
|
-
parsed.displayMode = parseDisplayMode(value);
|
|
110
|
-
return;
|
|
111
|
-
default:
|
|
112
|
-
throw new Error(`Unknown option: ${arg}`);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
function parseCommand(argv) {
|
|
116
|
-
const [scope, command] = argv;
|
|
117
|
-
const projectCommandHasPath = scope === "project";
|
|
118
|
-
const projectPath = projectCommandHasPath ? argv[2] : undefined;
|
|
119
|
-
// `image <verb> <imageId>`: the image is the subject, the project is context.
|
|
120
|
-
const imageId = scope === "image" && argv[2] && !argv[2].startsWith("--")
|
|
121
|
-
? argv[2]
|
|
122
|
-
: undefined;
|
|
123
|
-
const consumed = projectCommandHasPath || imageId ? 3 : 2;
|
|
124
|
-
const rest = argv.slice(consumed);
|
|
125
|
-
const parsed = { scope, command, projectPath, imageId };
|
|
126
|
-
for (let index = 0; index < rest.length; index += 1) {
|
|
127
|
-
const arg = rest[index];
|
|
128
|
-
if (applyFlagOption(parsed, arg)) {
|
|
129
|
-
continue;
|
|
130
|
-
}
|
|
131
|
-
applyValueOption(parsed, arg, requiredOptionValue(rest, index));
|
|
132
|
-
index += 1;
|
|
133
|
-
}
|
|
134
|
-
return parsed;
|
|
135
|
-
}
|
|
136
|
-
async function main(argv) {
|
|
137
|
-
if (argv.includes("--help") || argv.includes("-h")) {
|
|
138
|
-
console.log(usage());
|
|
139
|
-
return 0;
|
|
140
|
-
}
|
|
141
|
-
// `plexus mcp` with no sub-noun is the agent front door: one stdio server,
|
|
142
|
-
// started and owned by the agent host, project taken from the cwd.
|
|
143
|
-
if (argv[0] === "mcp" && argv[1] === undefined) {
|
|
144
|
-
await startPlexusAgentServer({
|
|
145
|
-
projectRoot: process.env.PLEXUS_PROJECT_ROOT ?? process.cwd(),
|
|
146
|
-
...(process.env.PLEXUS_WORKSPACE_ID === undefined
|
|
147
|
-
? {}
|
|
148
|
-
: { workspaceId: process.env.PLEXUS_WORKSPACE_ID }),
|
|
149
|
-
...(process.env.PLEXUS_STATE_ROOT === undefined
|
|
150
|
-
? {}
|
|
151
|
-
: { stateRoot: process.env.PLEXUS_STATE_ROOT }),
|
|
152
|
-
imageLease: scopedImageLeaseOptionsFromEnvironment(process.env),
|
|
153
|
-
});
|
|
154
|
-
return 0;
|
|
155
|
-
}
|
|
156
|
-
const parsed = parseCommand(argv);
|
|
157
|
-
const workspaceId = parsed.workspaceId ??
|
|
158
|
-
process.env.PLEXUS_WORKSPACE_ID;
|
|
159
|
-
const stateRoot = parsed.stateRoot ?? process.env.PLEXUS_STATE_ROOT;
|
|
160
|
-
if (parsed.scope === "image") {
|
|
161
|
-
return await runImageCommand(parsed, stateRoot, workspaceId);
|
|
162
|
-
}
|
|
163
|
-
if (parsed.scope === "mcp" && parsed.command === "pharo-launcher") {
|
|
164
|
-
const projectPath = parsed.projectPath ?? process.env.PLEXUS_PROJECT_ROOT;
|
|
165
|
-
if (!projectPath) {
|
|
166
|
-
console.error("plexus mcp pharo-launcher requires --project-path or PLEXUS_PROJECT_ROOT");
|
|
167
|
-
return 2;
|
|
168
|
-
}
|
|
169
|
-
await startScopedPharoLauncherServer({
|
|
170
|
-
projectRoot: projectPath,
|
|
171
|
-
stateRoot,
|
|
172
|
-
workspaceId,
|
|
173
|
-
imageLease: scopedImageLeaseOptionsFromEnvironment(process.env),
|
|
174
|
-
});
|
|
175
|
-
return 0;
|
|
176
|
-
}
|
|
177
|
-
console.error(usage());
|
|
178
|
-
return 2;
|
|
179
|
-
}
|
|
180
|
-
main(process.argv.slice(2))
|
|
181
|
-
.then((exitCode) => {
|
|
2
|
+
import { runCli } from "./commandLine.js";
|
|
3
|
+
runCli(process.argv.slice(2), {
|
|
4
|
+
stdout: (text) => process.stdout.write(text),
|
|
5
|
+
stderr: (text) => process.stderr.write(text),
|
|
6
|
+
env: process.env,
|
|
7
|
+
}).then((exitCode) => {
|
|
182
8
|
process.exitCode = exitCode;
|
|
183
|
-
})
|
|
184
|
-
.
|
|
185
|
-
console.error(error instanceof Error ? error.message : String(error));
|
|
9
|
+
}, (error) => {
|
|
10
|
+
process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);
|
|
186
11
|
process.exitCode = 1;
|
|
187
12
|
});
|
|
188
13
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;IAC5B,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC;IAC5C,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC;IAC5C,GAAG,EAAE,OAAO,CAAC,GAAG;CACjB,CAAC,CAAC,IAAI,CACL,CAAC,QAAQ,EAAE,EAAE;IACX,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC9B,CAAC,EACD,CAAC,KAAc,EAAE,EAAE;IACjB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACpF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ImagesApi } from "./mcp/server.js";
|
|
2
|
+
import type { ImagesOptions } from "./types.js";
|
|
3
|
+
export interface CliIo {
|
|
4
|
+
stdout(text: string): void;
|
|
5
|
+
stderr(text: string): void;
|
|
6
|
+
env: NodeJS.ProcessEnv;
|
|
7
|
+
}
|
|
8
|
+
export interface CliDependencies {
|
|
9
|
+
images(options: ImagesOptions): ImagesApi;
|
|
10
|
+
serveMcp(images: ImagesApi): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
export declare function runCli(argv: readonly string[], io: CliIo, dependencies?: CliDependencies): Promise<number>;
|
|
13
|
+
//# sourceMappingURL=commandLine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commandLine.d.ts","sourceRoot":"","sources":["../src/commandLine.ts"],"names":[],"mappings":"AAOA,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAgB,MAAM,YAAY,CAAC;AAE9D,MAAM,WAAW,KAAK;IACpB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC;CACxB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,SAAS,CAAC;IAC1C,QAAQ,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5C;AA0LD,wBAAsB,MAAM,CAC1B,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,EAAE,EAAE,KAAK,EACT,YAAY,GAAE,eAAqC,GAClD,OAAO,CAAC,MAAM,CAAC,CA0FjB"}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `plexus` command: the image verbs over the library, and `plexus mcp`.
|
|
3
|
+
* Every result is JSON on stdout; a refusal is `{"ok":false,...}` there too,
|
|
4
|
+
* with exit status 1, and a command line it cannot read exits with 2.
|
|
5
|
+
*/
|
|
6
|
+
import { PlexusError } from "./errors.js";
|
|
7
|
+
import { Images } from "./images/index.js";
|
|
8
|
+
import { runPlexusMcpServer } from "./mcp/server.js";
|
|
9
|
+
const defaultDependencies = {
|
|
10
|
+
images: (options) => new Images(options),
|
|
11
|
+
serveMcp: (images) => runPlexusMcpServer({ images }),
|
|
12
|
+
};
|
|
13
|
+
const globalUsage = "[--home <dir>] [--scope <prefix>]";
|
|
14
|
+
const imageCommands = {
|
|
15
|
+
templates: {
|
|
16
|
+
usage: "plexus image templates",
|
|
17
|
+
summary: "List the templates an image can be created from.",
|
|
18
|
+
values: [],
|
|
19
|
+
flags: [],
|
|
20
|
+
positionals: { min: 0, max: 0 },
|
|
21
|
+
},
|
|
22
|
+
create: {
|
|
23
|
+
usage: "plexus image create <name> --template <t> [--category <c>] [--script <file> [--every-start]]",
|
|
24
|
+
summary: "Create an image with MCP in it, not started. A script is filed in instead of loading the pinned MCP; --every-start files it in at every start too.",
|
|
25
|
+
values: ["template", "category", "script"],
|
|
26
|
+
flags: ["every-start"],
|
|
27
|
+
positionals: { min: 1, max: 1 },
|
|
28
|
+
},
|
|
29
|
+
start: {
|
|
30
|
+
usage: "plexus image start <name> [--display interactive] [--timeout <seconds>]",
|
|
31
|
+
summary: "Start an image and wait until its MCP server answers. Refused while it runs.",
|
|
32
|
+
values: ["display", "timeout"],
|
|
33
|
+
flags: [],
|
|
34
|
+
positionals: { min: 1, max: 1 },
|
|
35
|
+
},
|
|
36
|
+
stop: {
|
|
37
|
+
usage: "plexus image stop <name>",
|
|
38
|
+
summary: "Kill every VM running the image, without saving.",
|
|
39
|
+
values: [],
|
|
40
|
+
flags: [],
|
|
41
|
+
positionals: { min: 1, max: 1 },
|
|
42
|
+
},
|
|
43
|
+
delete: {
|
|
44
|
+
usage: "plexus image delete <name>",
|
|
45
|
+
summary: "Delete the image's directory. Refused while it runs.",
|
|
46
|
+
values: [],
|
|
47
|
+
flags: [],
|
|
48
|
+
positionals: { min: 1, max: 1 },
|
|
49
|
+
},
|
|
50
|
+
list: {
|
|
51
|
+
usage: "plexus image list [<name>]",
|
|
52
|
+
summary: "List the images and whether each runs, or only the one named.",
|
|
53
|
+
values: [],
|
|
54
|
+
flags: [],
|
|
55
|
+
positionals: { min: 0, max: 1 },
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
const mcpCommand = {
|
|
59
|
+
usage: "plexus mcp",
|
|
60
|
+
summary: "Serve the image tools and the running images' own tools over stdio, in the scope given at launch.",
|
|
61
|
+
values: [],
|
|
62
|
+
flags: [],
|
|
63
|
+
positionals: { min: 0, max: 0 },
|
|
64
|
+
};
|
|
65
|
+
class UsageError extends Error {
|
|
66
|
+
usage;
|
|
67
|
+
constructor(message, usage) {
|
|
68
|
+
super(message);
|
|
69
|
+
this.usage = usage;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
function parse(args, spec) {
|
|
73
|
+
const values = new Map();
|
|
74
|
+
const flags = new Set();
|
|
75
|
+
const positionals = [];
|
|
76
|
+
let help = false;
|
|
77
|
+
const allowedValues = new Set(["home", "scope", ...spec.values]);
|
|
78
|
+
const allowedFlags = new Set(spec.flags);
|
|
79
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
80
|
+
const arg = args[index];
|
|
81
|
+
if (arg === "--help" || arg === "-h") {
|
|
82
|
+
help = true;
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
if (!arg.startsWith("--")) {
|
|
86
|
+
positionals.push(arg);
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
const [option, inline] = splitOption(arg.slice(2));
|
|
90
|
+
if (allowedFlags.has(option)) {
|
|
91
|
+
if (inline !== undefined) {
|
|
92
|
+
throw new UsageError(`--${option} takes no value`, spec.usage);
|
|
93
|
+
}
|
|
94
|
+
flags.add(option);
|
|
95
|
+
}
|
|
96
|
+
else if (allowedValues.has(option)) {
|
|
97
|
+
const value = inline ?? args[++index];
|
|
98
|
+
if (value === undefined || (inline === undefined && value.startsWith("--"))) {
|
|
99
|
+
throw new UsageError(`--${option} needs a value`, spec.usage);
|
|
100
|
+
}
|
|
101
|
+
values.set(option, value);
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
throw new UsageError(`Unknown option --${option}`, spec.usage);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
if (!help) {
|
|
108
|
+
if (positionals.length < spec.positionals.min) {
|
|
109
|
+
throw new UsageError("Missing the image name", spec.usage);
|
|
110
|
+
}
|
|
111
|
+
if (positionals.length > spec.positionals.max) {
|
|
112
|
+
throw new UsageError(`Unexpected argument ${positionals[spec.positionals.max]}`, spec.usage);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return { positionals, values, flags, help };
|
|
116
|
+
}
|
|
117
|
+
function splitOption(option) {
|
|
118
|
+
const equals = option.indexOf("=");
|
|
119
|
+
return equals < 0 ? [option, undefined] : [option.slice(0, equals), option.slice(equals + 1)];
|
|
120
|
+
}
|
|
121
|
+
function imagesOptions(parsed, env) {
|
|
122
|
+
const home = parsed.values.get("home") ?? env.PLEXUS_HOME;
|
|
123
|
+
const scope = parsed.values.get("scope") ?? env.PLEXUS_SCOPE;
|
|
124
|
+
return {
|
|
125
|
+
...(home ? { home } : {}),
|
|
126
|
+
// An empty scope goes on to be refused: dropped, it would mean none, and
|
|
127
|
+
// none reaches every image in the store.
|
|
128
|
+
...(scope === undefined ? {} : { scope }),
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
function startOptions(parsed, usage) {
|
|
132
|
+
const display = parsed.values.get("display");
|
|
133
|
+
if (display !== undefined && display !== "headless" && display !== "interactive") {
|
|
134
|
+
throw new UsageError("--display is headless or interactive", usage);
|
|
135
|
+
}
|
|
136
|
+
const timeout = parsed.values.get("timeout");
|
|
137
|
+
const seconds = timeout === undefined ? undefined : Number(timeout);
|
|
138
|
+
if (seconds !== undefined && !(Number.isFinite(seconds) && seconds > 0)) {
|
|
139
|
+
throw new UsageError("--timeout is a number of seconds", usage);
|
|
140
|
+
}
|
|
141
|
+
return {
|
|
142
|
+
...(display === undefined ? {} : { display }),
|
|
143
|
+
...(seconds === undefined ? {} : { timeoutMs: Math.round(seconds * 1000) }),
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
function help() {
|
|
147
|
+
return [
|
|
148
|
+
"Usage:",
|
|
149
|
+
...Object.values(imageCommands).map((spec) => ` ${spec.usage}`),
|
|
150
|
+
` ${mcpCommand.usage}`,
|
|
151
|
+
"",
|
|
152
|
+
`Every command takes ${globalUsage}.`,
|
|
153
|
+
" --home where images, VMs and templates live (PLEXUS_HOME; ~/.plexus)",
|
|
154
|
+
" --scope a name prefix, without dashes: image dev is the directory <scope>-dev (PLEXUS_SCOPE)",
|
|
155
|
+
"",
|
|
156
|
+
"Results are JSON on stdout. A refusal is {\"ok\":false,\"code\":...,\"error\":...} and exits 1.",
|
|
157
|
+
].join("\n");
|
|
158
|
+
}
|
|
159
|
+
function commandHelp(spec) {
|
|
160
|
+
return [`Usage: ${spec.usage} ${globalUsage}`, "", spec.summary].join("\n");
|
|
161
|
+
}
|
|
162
|
+
export async function runCli(argv, io, dependencies = defaultDependencies) {
|
|
163
|
+
const print = (value) => io.stdout(`${JSON.stringify(value, null, 2)}\n`);
|
|
164
|
+
try {
|
|
165
|
+
const [noun, verb, ...rest] = argv;
|
|
166
|
+
if (noun === undefined || noun === "--help" || noun === "-h") {
|
|
167
|
+
(noun === undefined ? io.stderr : io.stdout)(`${help()}\n`);
|
|
168
|
+
return noun === undefined ? 2 : 0;
|
|
169
|
+
}
|
|
170
|
+
if (noun === "mcp") {
|
|
171
|
+
const parsed = parse(argv.slice(1), mcpCommand);
|
|
172
|
+
if (parsed.help) {
|
|
173
|
+
io.stdout(`${commandHelp(mcpCommand)}\n`);
|
|
174
|
+
return 0;
|
|
175
|
+
}
|
|
176
|
+
await dependencies.serveMcp(dependencies.images(imagesOptions(parsed, io.env)));
|
|
177
|
+
return 0;
|
|
178
|
+
}
|
|
179
|
+
if (noun !== "image") {
|
|
180
|
+
throw new UsageError(`Unknown command ${noun}`, help());
|
|
181
|
+
}
|
|
182
|
+
if (verb === undefined || verb === "--help" || verb === "-h") {
|
|
183
|
+
(verb === undefined ? io.stderr : io.stdout)(`${help()}\n`);
|
|
184
|
+
return verb === undefined ? 2 : 0;
|
|
185
|
+
}
|
|
186
|
+
if (!(verb in imageCommands)) {
|
|
187
|
+
throw new UsageError(`Unknown image command ${verb}`, help());
|
|
188
|
+
}
|
|
189
|
+
const spec = imageCommands[verb];
|
|
190
|
+
const parsed = parse(rest, spec);
|
|
191
|
+
if (parsed.help) {
|
|
192
|
+
io.stdout(`${commandHelp(spec)}\n`);
|
|
193
|
+
return 0;
|
|
194
|
+
}
|
|
195
|
+
const images = dependencies.images(imagesOptions(parsed, io.env));
|
|
196
|
+
const [name] = parsed.positionals;
|
|
197
|
+
switch (verb) {
|
|
198
|
+
case "templates":
|
|
199
|
+
print(await images.templates());
|
|
200
|
+
break;
|
|
201
|
+
case "create": {
|
|
202
|
+
const template = parsed.values.get("template");
|
|
203
|
+
if (template === undefined) {
|
|
204
|
+
throw new UsageError("create needs --template", spec.usage);
|
|
205
|
+
}
|
|
206
|
+
const category = parsed.values.get("category");
|
|
207
|
+
const script = parsed.values.get("script");
|
|
208
|
+
print(await images.create(name, {
|
|
209
|
+
template,
|
|
210
|
+
...(category === undefined ? {} : { category }),
|
|
211
|
+
...(script === undefined ? {} : { script }),
|
|
212
|
+
...(parsed.flags.has("every-start") ? { everyStart: true } : {}),
|
|
213
|
+
}));
|
|
214
|
+
break;
|
|
215
|
+
}
|
|
216
|
+
case "start":
|
|
217
|
+
print(await images.start(name, startOptions(parsed, spec.usage)));
|
|
218
|
+
break;
|
|
219
|
+
case "stop":
|
|
220
|
+
print(await images.stop(name));
|
|
221
|
+
break;
|
|
222
|
+
case "delete":
|
|
223
|
+
print(await images.delete(name));
|
|
224
|
+
break;
|
|
225
|
+
case "list":
|
|
226
|
+
print(await images.list(name));
|
|
227
|
+
break;
|
|
228
|
+
}
|
|
229
|
+
return 0;
|
|
230
|
+
}
|
|
231
|
+
catch (error) {
|
|
232
|
+
if (error instanceof UsageError) {
|
|
233
|
+
io.stderr(`plexus: ${error.message}\n\n${error.usage}\n`);
|
|
234
|
+
return 2;
|
|
235
|
+
}
|
|
236
|
+
print(error instanceof PlexusError
|
|
237
|
+
? {
|
|
238
|
+
ok: false,
|
|
239
|
+
code: error.code,
|
|
240
|
+
error: error.message,
|
|
241
|
+
...(error.details ? { details: error.details } : {}),
|
|
242
|
+
}
|
|
243
|
+
: { ok: false, error: error instanceof Error ? error.message : String(error) });
|
|
244
|
+
return 1;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
//# sourceMappingURL=commandLine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commandLine.js","sourceRoot":"","sources":["../src/commandLine.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAkB,MAAM,iBAAiB,CAAC;AAcrE,MAAM,mBAAmB,GAAoB;IAC3C,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC;IACxC,QAAQ,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;CACrD,CAAC;AAYF,MAAM,WAAW,GAAG,mCAAmC,CAAC;AAExD,MAAM,aAAa,GAA8B;IAC/C,SAAS,EAAE;QACT,KAAK,EAAE,wBAAwB;QAC/B,O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D,OAAO,CAAC,CAAC;IACX,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,UAAU,EAAE,CAAC;YAChC,EAAE,CAAC,MAAM,CAAC,WAAW,KAAK,CAAC,OAAO,OAAO,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC;YAC1D,OAAO,CAAC,CAAC;QACX,CAAC;QACD,KAAK,CACH,KAAK,YAAY,WAAW;YAC1B,CAAC,CAAC;gBACE,EAAE,EAAE,KAAK;gBACT,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,KAAK,EAAE,KAAK,CAAC,OAAO;gBACpB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aACrD;YACH,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CACjF,CAAC;QACF,OAAO,CAAC,CAAC;IACX,CAAC;AACH,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The
|
|
3
|
-
*
|
|
2
|
+
* The MCP release PLexus loads into an image that is created without a
|
|
3
|
+
* script.
|
|
4
4
|
*
|
|
5
|
-
* It
|
|
6
|
-
* checks across the package boundary
|
|
7
|
-
*
|
|
8
|
-
* internal, and nothing about publishing this should drag that along.
|
|
5
|
+
* It is a module of its own because `pharo-agent` pins the same version and
|
|
6
|
+
* checks across the package boundary that the two agree, and because the
|
|
7
|
+
* release workflows read and rewrite it here.
|
|
9
8
|
*/
|
|
10
|
-
export declare const defaultPharoMcpVersion = "3.
|
|
9
|
+
export declare const defaultPharoMcpVersion = "3.8.0";
|
|
11
10
|
//# sourceMappingURL=pharoMcpVersion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pharoMcpVersion.d.ts","sourceRoot":"","sources":["../../src/config/pharoMcpVersion.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"pharoMcpVersion.d.ts","sourceRoot":"","sources":["../../src/config/pharoMcpVersion.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,UAAU,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The
|
|
3
|
-
*
|
|
2
|
+
* The MCP release PLexus loads into an image that is created without a
|
|
3
|
+
* script.
|
|
4
4
|
*
|
|
5
|
-
* It
|
|
6
|
-
* checks across the package boundary
|
|
7
|
-
*
|
|
8
|
-
* internal, and nothing about publishing this should drag that along.
|
|
5
|
+
* It is a module of its own because `pharo-agent` pins the same version and
|
|
6
|
+
* checks across the package boundary that the two agree, and because the
|
|
7
|
+
* release workflows read and rewrite it here.
|
|
9
8
|
*/
|
|
10
|
-
export const defaultPharoMcpVersion = "3.
|
|
9
|
+
export const defaultPharoMcpVersion = "3.8.0";
|
|
11
10
|
//# sourceMappingURL=pharoMcpVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pharoMcpVersion.js","sourceRoot":"","sources":["../../src/config/pharoMcpVersion.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"pharoMcpVersion.js","sourceRoot":"","sources":["../../src/config/pharoMcpVersion.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,OAAO,CAAC"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type PlexusErrorCode = "invalid-name" | "no-such-image" | "image-exists" | "image-running" | "being-started" | "building" | "not-running" | "no-endpoint" | "unknown-template" | "ambiguous-template" | "script-not-found" | "create-failed" | "start-failed" | "stop-failed" | "launcher-failed";
|
|
2
|
+
/**
|
|
3
|
+
* Every refusal PLexus makes. The code is what a caller branches on; the
|
|
4
|
+
* message is what it shows, and says what to do where there is something.
|
|
5
|
+
*/
|
|
6
|
+
export declare class PlexusError extends Error {
|
|
7
|
+
readonly code: PlexusErrorCode;
|
|
8
|
+
readonly details?: Record<string, unknown>;
|
|
9
|
+
constructor(code: PlexusErrorCode, message: string, details?: Record<string, unknown>);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GACvB,cAAc,GACd,eAAe,GACf,cAAc,GACd,eAAe,GACf,eAAe,GACf,UAAU,GACV,aAAa,GACb,aAAa,GACb,kBAAkB,GAClB,oBAAoB,GACpB,kBAAkB,GAClB,eAAe,GACf,cAAc,GACd,aAAa,GACb,iBAAiB,CAAC;AAEtB;;;GAGG;AACH,qBAAa,WAAY,SAAQ,KAAK;IACpC,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAC/B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;gBAGzC,IAAI,EAAE,eAAe,EACrB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CASpC"}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every refusal PLexus makes. The code is what a caller branches on; the
|
|
3
|
+
* message is what it shows, and says what to do where there is something.
|
|
4
|
+
*/
|
|
5
|
+
export class PlexusError extends Error {
|
|
6
|
+
code;
|
|
7
|
+
details;
|
|
8
|
+
constructor(code, message, details) {
|
|
9
|
+
super(message);
|
|
10
|
+
this.name = "PlexusError";
|
|
11
|
+
this.code = code;
|
|
12
|
+
if (details !== undefined) {
|
|
13
|
+
this.details = details;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAiBA;;;GAGG;AACH,MAAM,OAAO,WAAY,SAAQ,KAAK;IAC3B,IAAI,CAAkB;IACtB,OAAO,CAA2B;IAE3C,YACE,IAAqB,EACrB,OAAe,EACf,OAAiC;QAEjC,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACzB,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The endpoint handoff format: `plexus/endpoint.properties`, written by an
|
|
3
|
+
* image's VM once its MCP server has bound a port.
|
|
4
|
+
*
|
|
5
|
+
* Strict on purpose: a port of `08080` or `8080abc` is refused rather than
|
|
6
|
+
* read as something, because forwarding to a guess sends tool calls to
|
|
7
|
+
* whatever else holds that port.
|
|
8
|
+
*/
|
|
9
|
+
export interface EndpointHandoff {
|
|
10
|
+
transport: "http";
|
|
11
|
+
host: string;
|
|
12
|
+
port: number;
|
|
13
|
+
path: string;
|
|
14
|
+
/**
|
|
15
|
+
* The process that bound the port, when the image could tell. A port
|
|
16
|
+
* outlives the process that bound it, so this is what separates an endpoint
|
|
17
|
+
* from the memory of one. Images that cannot tell their own pid write no
|
|
18
|
+
* pid line, and a reader without one has only the port to go on.
|
|
19
|
+
*/
|
|
20
|
+
pid?: number;
|
|
21
|
+
}
|
|
22
|
+
export declare function parseEndpointHandoff(source: string): EndpointHandoff;
|
|
23
|
+
//# sourceMappingURL=endpointHandoffFormat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpointHandoffFormat.d.ts","sourceRoot":"","sources":["../../src/forward/endpointHandoffFormat.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb;;;;;OAKG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,eAAe,CAEpE"}
|