@evref-bl/pharo-launcher-mcp 0.4.0 → 0.5.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 +29 -20
- package/dist/answers.d.ts +43 -0
- package/dist/answers.d.ts.map +1 -0
- package/dist/answers.js +744 -0
- package/dist/answers.js.map +1 -0
- package/dist/commandCatalog.d.ts +13 -1
- package/dist/commandCatalog.d.ts.map +1 -1
- package/dist/commandCatalog.js +65 -89
- package/dist/commandCatalog.js.map +1 -1
- package/dist/config.d.ts +5 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +3 -1
- package/dist/config.js.map +1 -1
- package/dist/crossProfileCopy.d.ts +37 -0
- package/dist/crossProfileCopy.d.ts.map +1 -1
- package/dist/crossProfileCopy.js +77 -16
- package/dist/crossProfileCopy.js.map +1 -1
- package/dist/discovery.d.ts +8 -0
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +10 -0
- package/dist/discovery.js.map +1 -1
- package/dist/imageStore.d.ts +139 -0
- package/dist/imageStore.d.ts.map +1 -0
- package/dist/imageStore.js +385 -0
- package/dist/imageStore.js.map +1 -0
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/launcher.d.ts +64 -17
- package/dist/launcher.d.ts.map +1 -1
- package/dist/launcher.js +206 -167
- package/dist/launcher.js.map +1 -1
- package/dist/launcherCli.d.ts +13 -0
- package/dist/launcherCli.d.ts.map +1 -1
- package/dist/launcherCli.js +85 -91
- package/dist/launcherCli.js.map +1 -1
- package/dist/models.d.ts +117 -6
- package/dist/models.d.ts.map +1 -1
- package/dist/parser.d.ts +20 -7
- package/dist/parser.d.ts.map +1 -1
- package/dist/parser.js +48 -207
- package/dist/parser.js.map +1 -1
- package/dist/platform.d.ts +6 -0
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +14 -0
- package/dist/platform.js.map +1 -1
- package/dist/probe.d.ts +16 -0
- package/dist/probe.d.ts.map +1 -0
- package/dist/probe.js +31 -0
- package/dist/probe.js.map +1 -0
- package/dist/processTools.d.ts +22 -8
- package/dist/processTools.d.ts.map +1 -1
- package/dist/processTools.js +75 -58
- package/dist/processTools.js.map +1 -1
- package/dist/resultNormalizer.d.ts +9 -0
- package/dist/resultNormalizer.d.ts.map +1 -1
- package/dist/resultNormalizer.js +36 -79
- package/dist/resultNormalizer.js.map +1 -1
- package/dist/server.d.ts +10 -9
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +56 -55
- package/dist/server.js.map +1 -1
- package/dist/ston.d.ts +22 -0
- package/dist/ston.d.ts.map +1 -0
- package/dist/ston.js +127 -0
- package/dist/ston.js.map +1 -0
- package/docs/cleanup-hook-boundary.md +11 -9
- package/docs/development.md +51 -38
- package/docs/reference/tools.md +100 -40
- package/docs/troubleshooting.md +32 -23
- package/docs/user/getting-started.md +4 -4
- package/docs/user/profile-mode.md +30 -21
- package/package.json +1 -1
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE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iBAAiB,CAAC,qBAAqB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,CAChE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,IAAI,EAAE,CAAC,CAC9D,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;IAC9B,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,cAAc,eAAe,CAAC"}
|
package/dist/ston.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reading STON as Pharo Launcher writes it, compact (`#key:'value'`) or
|
|
3
|
+
* pretty-printed (`#key : 'value'`), with `''` for one quote. Only what a
|
|
4
|
+
* field needs is read, so a field this reader does not know never makes the
|
|
5
|
+
* source unreadable.
|
|
6
|
+
*/
|
|
7
|
+
/** The first `{` that opens an object, outside any string. */
|
|
8
|
+
export declare function firstObjectOpen(source: string): number;
|
|
9
|
+
/**
|
|
10
|
+
* Every object whose class name matches `className`, outside any string, in
|
|
11
|
+
* the order they are written, nested ones included: the index of its `{`.
|
|
12
|
+
*/
|
|
13
|
+
export declare function objectOpenings(source: string, className: RegExp): number[];
|
|
14
|
+
/** The fields of the object whose `{` is at `open`, as their source. */
|
|
15
|
+
export declare function stonFields(source: string, open: number): Map<string, string>;
|
|
16
|
+
/** The fields of a value that is an object, `Class { … }`. */
|
|
17
|
+
export declare function objectFields(value: string | undefined): Map<string, string> | undefined;
|
|
18
|
+
/** A string value, `'…'`, its doubled quotes read as one. */
|
|
19
|
+
export declare function stringValue(value: string | undefined): string | undefined;
|
|
20
|
+
/** A URL value, `URL [ '…' ]`, or a plain string. */
|
|
21
|
+
export declare function urlValue(value: string | undefined): string | undefined;
|
|
22
|
+
//# sourceMappingURL=ston.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ston.d.ts","sourceRoot":"","sources":["../src/ston.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA6CH,8DAA8D;AAC9D,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CActD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAoB1E;AAED,wEAAwE;AACxE,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAsB5E;AAED,8DAA8D;AAC9D,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAMvF;AAED,6DAA6D;AAC7D,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAGzE;AAED,qDAAqD;AACrD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAMtE"}
|
package/dist/ston.js
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reading STON as Pharo Launcher writes it, compact (`#key:'value'`) or
|
|
3
|
+
* pretty-printed (`#key : 'value'`), with `''` for one quote. Only what a
|
|
4
|
+
* field needs is read, so a field this reader does not know never makes the
|
|
5
|
+
* source unreadable.
|
|
6
|
+
*/
|
|
7
|
+
/** The index just past the string whose opening quote is at `index`. */
|
|
8
|
+
function skipString(source, index) {
|
|
9
|
+
let i = index + 1;
|
|
10
|
+
while (i < source.length) {
|
|
11
|
+
if (source[i] === "'") {
|
|
12
|
+
if (source[i + 1] === "'") {
|
|
13
|
+
i += 2;
|
|
14
|
+
continue;
|
|
15
|
+
}
|
|
16
|
+
return i + 1;
|
|
17
|
+
}
|
|
18
|
+
i += 1;
|
|
19
|
+
}
|
|
20
|
+
return i;
|
|
21
|
+
}
|
|
22
|
+
/** Where the value starting at `index` ends: a `,` or a closing bracket at its depth. */
|
|
23
|
+
function endOfValue(source, index) {
|
|
24
|
+
let depth = 0;
|
|
25
|
+
let i = index;
|
|
26
|
+
while (i < source.length) {
|
|
27
|
+
const char = source[i];
|
|
28
|
+
if (char === "'") {
|
|
29
|
+
i = skipString(source, i);
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
if (char === "{" || char === "[" || char === "(") {
|
|
33
|
+
depth += 1;
|
|
34
|
+
}
|
|
35
|
+
else if (char === "}" || char === "]" || char === ")") {
|
|
36
|
+
if (depth === 0) {
|
|
37
|
+
return i;
|
|
38
|
+
}
|
|
39
|
+
depth -= 1;
|
|
40
|
+
}
|
|
41
|
+
else if (char === "," && depth === 0) {
|
|
42
|
+
return i;
|
|
43
|
+
}
|
|
44
|
+
i += 1;
|
|
45
|
+
}
|
|
46
|
+
return i;
|
|
47
|
+
}
|
|
48
|
+
/** The first `{` that opens an object, outside any string. */
|
|
49
|
+
export function firstObjectOpen(source) {
|
|
50
|
+
let i = 0;
|
|
51
|
+
while (i < source.length) {
|
|
52
|
+
if (source[i] === "'") {
|
|
53
|
+
i = skipString(source, i);
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
if (source[i] === "{") {
|
|
57
|
+
return i;
|
|
58
|
+
}
|
|
59
|
+
i += 1;
|
|
60
|
+
}
|
|
61
|
+
return -1;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Every object whose class name matches `className`, outside any string, in
|
|
65
|
+
* the order they are written, nested ones included: the index of its `{`.
|
|
66
|
+
*/
|
|
67
|
+
export function objectOpenings(source, className) {
|
|
68
|
+
const opening = new RegExp(`(?<![\\w])(?:${className.source})\\s*\\{`, "y");
|
|
69
|
+
const openings = [];
|
|
70
|
+
let i = 0;
|
|
71
|
+
while (i < source.length) {
|
|
72
|
+
if (source[i] === "'") {
|
|
73
|
+
i = skipString(source, i);
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
opening.lastIndex = i;
|
|
77
|
+
const match = opening.exec(source);
|
|
78
|
+
if (match) {
|
|
79
|
+
i += match[0].length;
|
|
80
|
+
openings.push(i - 1);
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
i += 1;
|
|
84
|
+
}
|
|
85
|
+
return openings;
|
|
86
|
+
}
|
|
87
|
+
/** The fields of the object whose `{` is at `open`, as their source. */
|
|
88
|
+
export function stonFields(source, open) {
|
|
89
|
+
const fields = new Map();
|
|
90
|
+
const key = /\s*#([A-Za-z_][A-Za-z0-9_]*)\s*:/y;
|
|
91
|
+
let i = open + 1;
|
|
92
|
+
while (i < source.length) {
|
|
93
|
+
while (/[\s,]/.test(source[i] ?? "")) {
|
|
94
|
+
i += 1;
|
|
95
|
+
}
|
|
96
|
+
key.lastIndex = i;
|
|
97
|
+
const match = key.exec(source);
|
|
98
|
+
if (!match) {
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
const valueStart = key.lastIndex;
|
|
102
|
+
const valueEnd = endOfValue(source, valueStart);
|
|
103
|
+
fields.set(match[1], source.slice(valueStart, valueEnd).trim());
|
|
104
|
+
i = valueEnd;
|
|
105
|
+
}
|
|
106
|
+
return fields;
|
|
107
|
+
}
|
|
108
|
+
/** The fields of a value that is an object, `Class { … }`. */
|
|
109
|
+
export function objectFields(value) {
|
|
110
|
+
if (value === undefined || !/^[A-Za-z]\w*\s*\{/.test(value)) {
|
|
111
|
+
return undefined;
|
|
112
|
+
}
|
|
113
|
+
return stonFields(value, value.indexOf("{"));
|
|
114
|
+
}
|
|
115
|
+
/** A string value, `'…'`, its doubled quotes read as one. */
|
|
116
|
+
export function stringValue(value) {
|
|
117
|
+
const match = value === undefined ? null : /^'((?:''|[^'])*)'$/s.exec(value);
|
|
118
|
+
return match ? match[1].replaceAll("''", "'") : undefined;
|
|
119
|
+
}
|
|
120
|
+
/** A URL value, `URL [ '…' ]`, or a plain string. */
|
|
121
|
+
export function urlValue(value) {
|
|
122
|
+
const url = value === undefined
|
|
123
|
+
? null
|
|
124
|
+
: /^URL\s*\[\s*('(?:''|[^'])*')\s*\]$/s.exec(value);
|
|
125
|
+
return stringValue(url ? url[1] : value);
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=ston.js.map
|
package/dist/ston.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ston.js","sourceRoot":"","sources":["../src/ston.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,wEAAwE;AACxE,SAAS,UAAU,CAAC,MAAc,EAAE,KAAa;IAC/C,IAAI,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC;IAClB,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;QACzB,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;YACtB,IAAI,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;gBAC1B,CAAC,IAAI,CAAC,CAAC;gBACP,SAAS;YACX,CAAC;YACD,OAAO,CAAC,GAAG,CAAC,CAAC;QACf,CAAC;QACD,CAAC,IAAI,CAAC,CAAC;IACT,CAAC;IAED,OAAO,CAAC,CAAC;AACX,CAAC;AAED,yFAAyF;AACzF,SAAS,UAAU,CAAC,MAAc,EAAE,KAAa;IAC/C,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,CAAC,GAAG,KAAK,CAAC;IACd,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;QACzB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QACvB,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACjB,CAAC,GAAG,UAAU,CAAC,MAA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build`
|
|
13
13
|
- `git status --short --branch`
|
|
14
|
-
- source review of command schemas, parser behavior,
|
|
15
|
-
timeout handling
|
|
14
|
+
- source review of command schemas, parser behavior, the library's results,
|
|
15
|
+
and timeout handling
|
|
16
16
|
- `pharo-launcher-mcp --health`, because it reports resolved paths without
|
|
17
17
|
invoking Pharo Launcher
|
|
18
18
|
- `pharo_launcher_config`, because it reports resolved configuration without
|
|
@@ -22,22 +22,24 @@ These checks inspect live host state or invoke Pharo Launcher. Run them only
|
|
|
22
22
|
when the caller has chosen to cross that boundary:
|
|
23
23
|
|
|
24
24
|
- `pharo-launcher-mcp --version-check` and `--validate-installation`
|
|
25
|
-
- `pharo_launcher_image_list`
|
|
26
|
-
|
|
27
|
-
- `pharo_launcher_process_list
|
|
25
|
+
- `pharo_launcher_image_list` and `pharo_launcher_image_info`, which read the
|
|
26
|
+
images directory and the host's process list
|
|
27
|
+
- `pharo_launcher_process_list`, which reads the host's process list
|
|
28
28
|
|
|
29
29
|
They are non-mutating, but they still cross the live host boundary.
|
|
30
30
|
|
|
31
31
|
## Status Signals
|
|
32
32
|
|
|
33
|
-
The
|
|
33
|
+
The tools answer text, for a model. A program reads the library's launcher
|
|
34
|
+
results instead, which carry status data for callers:
|
|
34
35
|
|
|
35
36
|
- `ok`
|
|
36
37
|
- `parser.status`
|
|
37
38
|
- normalized `data` when parsing is supported
|
|
38
|
-
- raw `stdout` and `stderr`
|
|
39
|
+
- raw `stdout` and `stderr`, with `includeRaw`
|
|
39
40
|
- command `durationMs`
|
|
40
41
|
- command `exitCode`
|
|
42
|
+
- command `signal`, when one ended the command
|
|
41
43
|
- command `timedOut`
|
|
42
44
|
- optional `timeoutReason`
|
|
43
45
|
|
|
@@ -76,8 +78,8 @@ A future isolated live check must use a disposable profile rooted by
|
|
|
76
78
|
- `PHARO_LAUNCHER_MCP_INIT_SCRIPTS_DIR`
|
|
77
79
|
- `PHARO_LAUNCHER_MCP_LOGS_DIR`
|
|
78
80
|
|
|
79
|
-
Retain the launcher logs,
|
|
80
|
-
pids, and timeout reasons before deleting disposable directories.
|
|
81
|
+
Retain the launcher logs, the library's results, image names, image paths,
|
|
82
|
+
process pids, and timeout reasons before deleting disposable directories.
|
|
81
83
|
|
|
82
84
|
## Follow-Up Policy
|
|
83
85
|
|
package/docs/development.md
CHANGED
|
@@ -6,14 +6,22 @@ focused on installation and first use; user-facing detail lives under `docs/`.
|
|
|
6
6
|
## Source layout
|
|
7
7
|
|
|
8
8
|
- `src/server.ts`: MCP server surface and tool dispatch.
|
|
9
|
+
- `src/answers.ts`: what each tool answers, as text, and the checks made
|
|
10
|
+
before a call. Every text naming a `pharo_launcher_*` tool is here.
|
|
11
|
+
- `src/launcher.ts`: the library, `openPharoLauncher`, which the tools are made
|
|
12
|
+
from and PLexus imports.
|
|
9
13
|
- `src/commandCatalog.ts`: Pharo Launcher command definitions and input checks.
|
|
10
14
|
- `src/config.ts`: Pharo Launcher and profile path resolution.
|
|
11
15
|
- `src/platform.ts`: host-specific defaults and wrapper selection.
|
|
12
16
|
- `src/launcherScript.ts`: bundled wrapper discovery.
|
|
13
17
|
- `src/launcherCli.ts`: command execution boundary.
|
|
14
18
|
- `src/processTools.ts`: native process list and kill backends.
|
|
19
|
+
- `src/imageStore.ts`: the Launcher's images, read from its images directory,
|
|
20
|
+
and the VMs running them.
|
|
21
|
+
- `src/ston.ts`: reads fields of the STON Pharo Launcher writes.
|
|
15
22
|
- `src/parser.ts`: Pharo Launcher output parsing.
|
|
16
|
-
- `src/resultNormalizer.ts`:
|
|
23
|
+
- `src/resultNormalizer.ts`: the library's launcher results.
|
|
24
|
+
- `src/probe.ts`: `--probe-images`.
|
|
17
25
|
- `bin/pharo-launcher.cmd`: Windows wrapper.
|
|
18
26
|
- `bin/pharo-launcher.sh`: POSIX wrapper.
|
|
19
27
|
- `scripts/live-smoke.mjs`: local live checks against a real launcher.
|
|
@@ -70,45 +78,54 @@ variables is present.
|
|
|
70
78
|
|
|
71
79
|
## Process backend
|
|
72
80
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
`pharo_launcher_process_kill` when needed:
|
|
81
|
+
pharo-launcher-mcp lists and kills processes itself, never through Pharo
|
|
82
|
+
Launcher's `process` commands, whose table shortens a long path:
|
|
76
83
|
|
|
77
84
|
- Windows uses a PowerShell/CIM query.
|
|
78
85
|
- macOS and Linux use `ps -axo pid=,args=`.
|
|
79
|
-
-
|
|
86
|
+
- On any other platform the process tools fail: listing processes is not
|
|
87
|
+
supported there.
|
|
80
88
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
89
|
+
Of those processes, a VM runs image `D` when its command line names
|
|
90
|
+
`<images>/D/D.image`, bounded by whitespace, a quote or the line's ends. The
|
|
91
|
+
tools keep those in every mode; the library's `listProcesses` does in profile
|
|
92
|
+
mode, and lists every Pharo VM outside one.
|
|
85
93
|
|
|
86
|
-
|
|
87
|
-
commands.
|
|
88
|
-
- Plain text is parsed only for stable tables and process listings.
|
|
89
|
-
- Unsupported commands still return command metadata and raw output.
|
|
90
|
-
- Failed commands skip parsing so command failure is not confused with parser
|
|
91
|
-
failure.
|
|
94
|
+
## Parsing boundary
|
|
92
95
|
|
|
93
|
-
|
|
94
|
-
|
|
96
|
+
What the server knows of the Launcher's state comes from four places, each read
|
|
97
|
+
where it is stable:
|
|
98
|
+
|
|
99
|
+
- Images are read from the images directory (`src/imageStore.ts`), never from
|
|
100
|
+
the Launcher's output: its STON names no image file, and its table shifts
|
|
101
|
+
columns and shortens names. An image's metadata comes from its
|
|
102
|
+
`meta-inf.ston`, its `pharo.version` and its image header.
|
|
103
|
+
- Template categories come from `template categories --brief`, one row per
|
|
104
|
+
category with the default marked.
|
|
105
|
+
- Templates come from `template list --ston`, every `PhL…Template` it holds,
|
|
106
|
+
in its order.
|
|
107
|
+
- Processes come from the native process list.
|
|
108
|
+
|
|
109
|
+
`src/parser.ts` reads the Launcher's output. Unsupported commands still return
|
|
110
|
+
command metadata and raw output, and failed commands skip parsing so command
|
|
111
|
+
failure is not confused with parser failure. Typed launcher results include
|
|
112
|
+
`parser.status` so result handlers can distinguish normalized model data from
|
|
113
|
+
raw-only output.
|
|
95
114
|
|
|
96
115
|
Stable model names include:
|
|
97
116
|
|
|
98
117
|
```text
|
|
99
118
|
LauncherImage
|
|
119
|
+
NotAnImage
|
|
120
|
+
LauncherImageList
|
|
121
|
+
LauncherImageInfo
|
|
100
122
|
LauncherTemplate
|
|
101
|
-
LauncherVm
|
|
102
123
|
LauncherProcess
|
|
103
124
|
LauncherCommandResult
|
|
104
125
|
```
|
|
105
126
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
underlying Pharo version when possible, infer architecture from template names
|
|
109
|
-
or URLs, and attach source-file digest/mtime for installed `.ston` template
|
|
110
|
-
files. Image identities mirror the launcher metadata returned by image
|
|
111
|
-
list/info commands.
|
|
127
|
+
The MCP tools render these as text in `src/answers.ts`; the library never
|
|
128
|
+
answers text.
|
|
112
129
|
|
|
113
130
|
## Integration tests
|
|
114
131
|
|
|
@@ -119,25 +136,19 @@ npm run test:integration
|
|
|
119
136
|
```
|
|
120
137
|
|
|
121
138
|
The integration suite prepares an isolated temporary launcher profile by copying
|
|
122
|
-
the Pharo Launcher control image. It
|
|
139
|
+
the Pharo Launcher control image. It calls the tools as a model does and checks
|
|
140
|
+
their text, and checks the data through the library, `openPharoLauncher`:
|
|
123
141
|
|
|
124
|
-
- health
|
|
125
|
-
- version
|
|
126
|
-
- installation validation
|
|
127
142
|
- config
|
|
128
|
-
- template categories, list,
|
|
129
|
-
-
|
|
130
|
-
- image
|
|
131
|
-
- image create
|
|
143
|
+
- template categories, list, and update
|
|
144
|
+
- image list, and `--probe-images`
|
|
145
|
+
- image create, beside an image whose name holds the new one
|
|
132
146
|
- image copy
|
|
133
147
|
- image info
|
|
134
|
-
- image
|
|
135
|
-
- image
|
|
136
|
-
- image recreate
|
|
137
|
-
- image delete
|
|
148
|
+
- image start, detached
|
|
149
|
+
- image delete, refused while the image runs and accepted right after the kill
|
|
138
150
|
- process list
|
|
139
151
|
- process kill
|
|
140
|
-
- raw command
|
|
141
152
|
|
|
142
153
|
External-source image creation variants such as build, pull request,
|
|
143
154
|
repository, SHA, and VM mutation commands should use explicit fixtures because
|
|
@@ -182,7 +193,9 @@ distinguishes read-only planning checks from host inspection and mutation.
|
|
|
182
193
|
|
|
183
194
|
## Local probes
|
|
184
195
|
|
|
185
|
-
Probe the local Pharo Launcher image list without starting MCP stdio
|
|
196
|
+
Probe the local Pharo Launcher image list without starting MCP stdio. It asks
|
|
197
|
+
the Launcher to list its images, exits with that command's status, and prints
|
|
198
|
+
what `pharo_launcher_image_list` answers:
|
|
186
199
|
|
|
187
200
|
```powershell
|
|
188
201
|
npm run build
|
package/docs/reference/tools.md
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
# Tool Reference
|
|
2
2
|
|
|
3
|
-
pharo-launcher-mcp exposes MCP tools over stdio.
|
|
4
|
-
|
|
3
|
+
pharo-launcher-mcp exposes MCP tools over stdio. Each tool answers plain text,
|
|
4
|
+
for a model to read: a sentence saying what happened, then `Warning: …` lines,
|
|
5
|
+
`key: value` lines and indented lists. A failure has `isError` and says what to
|
|
6
|
+
do when the caller can do something. The library the tools are made from,
|
|
7
|
+
`openPharoLauncher`, answers typed objects instead (see
|
|
8
|
+
[Library results](#library-results)).
|
|
5
9
|
|
|
6
10
|
Every tool here has a caller. PharoLauncher's CLI covers the rest of its own
|
|
7
11
|
surface, and this server does not wrap a subcommand until something asks it to.
|
|
@@ -11,61 +15,96 @@ speaking MCP. The executable answers `--health`, `--version-check`,
|
|
|
11
15
|
`--validate-installation` and `--probe-images` and exits, which is what a
|
|
12
16
|
preflight needs.
|
|
13
17
|
|
|
18
|
+
A tool takes only the arguments its schema names. Any other argument is
|
|
19
|
+
ignored.
|
|
20
|
+
|
|
14
21
|
## Configuration
|
|
15
22
|
|
|
16
23
|
| Tool | Live Launcher invocation | Purpose |
|
|
17
24
|
| --- | --- | --- |
|
|
18
|
-
| `pharo_launcher_config` | No |
|
|
25
|
+
| `pharo_launcher_config` | No | Says which Pharo Launcher the server runs, its profile or settings file, and where its images are. |
|
|
26
|
+
|
|
27
|
+
## Images
|
|
28
|
+
|
|
29
|
+
An image of the Launcher is a directory `D` of its images directory holding
|
|
30
|
+
the files `D.image` and `D.changes`, Pharo Launcher's own rule. The image tools
|
|
31
|
+
read that directory; they do not ask the Launcher to list it. A name given to a
|
|
32
|
+
tool finds the image named exactly so, else the one whose name differs only in
|
|
33
|
+
case, as the Launcher does.
|
|
19
34
|
|
|
20
|
-
|
|
35
|
+
The images directory is, in profile mode, the profile's. Outside a profile it
|
|
36
|
+
is the `#imagesDirectory` of the configuration the Launcher's CLI reads: the
|
|
37
|
+
file `PHARO_LAUNCHER_MCP_LAUNCHER_CONFIGURATION` names, else
|
|
38
|
+
`launcherSettings.ston` in the Launcher's user files (`~/Documents/Pharo` on
|
|
39
|
+
macOS and Windows, `~/Pharo` on Linux), else `<user files>/images`, the
|
|
40
|
+
Launcher's default. `pharo_launcher_config` prints which.
|
|
21
41
|
|
|
22
42
|
| Tool | Arguments |
|
|
23
43
|
| --- | --- |
|
|
24
|
-
| `pharo_launcher_image_list` | `nameFilter
|
|
25
|
-
| `pharo_launcher_image_info` | `imageName
|
|
26
|
-
| `pharo_launcher_image_create` | `templateName`, `newImageName`, `templateCategory`, `dev
|
|
44
|
+
| `pharo_launcher_image_list` | `nameFilter` |
|
|
45
|
+
| `pharo_launcher_image_info` | `imageName` |
|
|
46
|
+
| `pharo_launcher_image_create` | `templateName`, `newImageName`, `templateCategory`, `dev` |
|
|
27
47
|
| `pharo_launcher_image_copy` | `imageName`, `newImageName` |
|
|
28
48
|
| `pharo_launcher_image_copy_between_profiles` | `sourceProfile`, `destinationProfile`, `sourceImageName`, `destinationImageName` |
|
|
29
49
|
| `pharo_launcher_image_start` | `imageName`, `script`, `detached`, `displayMode` |
|
|
30
|
-
| `pharo_launcher_image_delete` | `imageName
|
|
31
|
-
|
|
32
|
-
`
|
|
33
|
-
|
|
34
|
-
|
|
50
|
+
| `pharo_launcher_image_delete` | `imageName` |
|
|
51
|
+
|
|
52
|
+
`pharo_launcher_image_list` and `pharo_launcher_image_info` call no Launcher
|
|
53
|
+
command. Each image comes with its Pharo version, architecture and template,
|
|
54
|
+
read from its `meta-inf.ston`, its `pharo.version` and its image header, and
|
|
55
|
+
with the pids of the VMs running it. `nameFilter` keeps the names that contain
|
|
56
|
+
it, case-sensitive. A directory that is not an image is named in a warning,
|
|
57
|
+
with the file it lacks.
|
|
58
|
+
|
|
59
|
+
`pharo_launcher_image_create` never starts the image it makes:
|
|
60
|
+
`pharo_launcher_image_start` does.
|
|
61
|
+
|
|
62
|
+
`pharo_launcher_image_create` and `pharo_launcher_image_copy` check that the
|
|
63
|
+
Launcher can list the new image and open it, polling for up to 30 s after the
|
|
64
|
+
command, and also after a command that outlived the call's timeout, since the
|
|
65
|
+
Launcher goes on and makes the image. In profile mode, listed means the images
|
|
66
|
+
directory holds it under the exact new name; outside a profile only the
|
|
67
|
+
Launcher's `image info` is asked. A successful Launcher exit is not enough, and
|
|
68
|
+
a failed check is an error that says which check failed.
|
|
69
|
+
|
|
70
|
+
In profile mode, where the server wrote the images directory itself, a name it
|
|
71
|
+
does not find is refused before any Launcher call (`image_info`,
|
|
72
|
+
`image_start`, `image_delete`, and `image_copy`'s source), and so is a new name
|
|
73
|
+
an image already has, in any case. Outside a profile those names go to the
|
|
74
|
+
Launcher, whose answer is the answer.
|
|
35
75
|
|
|
36
76
|
`pharo_launcher_image_start` supports:
|
|
37
77
|
|
|
38
78
|
- `displayMode: "headless"` or `"interactive"`, in profile mode only.
|
|
39
79
|
PharoLauncher's own `image launch` has no display mode, so outside profile
|
|
40
80
|
mode the launch is refused rather than started with the mode dropped.
|
|
41
|
-
- `detached: true`
|
|
81
|
+
- `detached: true` to leave the image running: the answer names its pid and
|
|
82
|
+
its log files. Otherwise the call lasts until the image quits.
|
|
42
83
|
- `script` for a launch script passed to Launcher, or evaluated by the profile
|
|
43
|
-
VM launch path
|
|
84
|
+
VM launch path. A relative path is read from the server's working directory,
|
|
85
|
+
not from the image's or Launcher's. A headless image given no script has
|
|
86
|
+
nothing to run and quits.
|
|
44
87
|
|
|
45
88
|
In profile mode, image launch resolves the image and VM inside the active
|
|
46
89
|
profile roots instead of using Launcher defaults.
|
|
47
90
|
|
|
91
|
+
`pharo_launcher_image_delete` deletes without asking: calling it is the
|
|
92
|
+
confirmation. Launcher's own `image delete` asks on standard input, where a
|
|
93
|
+
call has nobody to answer. It refuses an image a VM runs, in every mode, and
|
|
94
|
+
refuses when it cannot tell: stop the image with
|
|
95
|
+
`pharo_launcher_process_kill` first.
|
|
96
|
+
|
|
48
97
|
## Template Tools
|
|
49
98
|
|
|
50
99
|
| Tool | Arguments |
|
|
51
100
|
| --- | --- |
|
|
52
|
-
| `pharo_launcher_template_category_list` |
|
|
53
|
-
| `pharo_launcher_template_list` | `templateCategory
|
|
101
|
+
| `pharo_launcher_template_category_list` | none |
|
|
102
|
+
| `pharo_launcher_template_list` | `templateCategory` |
|
|
54
103
|
| `pharo_launcher_template_update` | none |
|
|
55
104
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
{
|
|
60
|
-
"format": "ston",
|
|
61
|
-
"brief": true,
|
|
62
|
-
"rowMode": true,
|
|
63
|
-
"delimiter": "|"
|
|
64
|
-
}
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
`format` can be `ston` or `text`. The default is `ston` when a tool supports
|
|
68
|
-
table output.
|
|
105
|
+
The categories come in the Launcher's order, with the one it marks as its
|
|
106
|
+
default. A template list names templates only: a name is what
|
|
107
|
+
`pharo_launcher_image_create` takes.
|
|
69
108
|
|
|
70
109
|
In profile mode, `pharo_launcher_template_update` also verifies that the active
|
|
71
110
|
profile source list is usable and probes `template list`.
|
|
@@ -77,21 +116,29 @@ profile source list is usable and probes `template list`.
|
|
|
77
116
|
| `pharo_launcher_process_list` | none |
|
|
78
117
|
| `pharo_launcher_process_kill` | exactly one of `pid` or `imageName` |
|
|
79
118
|
|
|
119
|
+
The process tools see the VMs running an image of this Launcher's images
|
|
120
|
+
directory, in every mode, and no other process: a VM runs image `D` when its
|
|
121
|
+
command line names `<images>/D/D.image`. So `pharo_launcher_image_list`'s
|
|
122
|
+
running state and `pharo_launcher_process_list` agree, and a kill cannot reach
|
|
123
|
+
an image of another Launcher or profile.
|
|
124
|
+
|
|
80
125
|
On Windows, process tools use PowerShell/CIM. On macOS and Linux, they use
|
|
81
|
-
`ps -axo pid=,args=`.
|
|
82
|
-
|
|
126
|
+
`ps -axo pid=,args=`. On any other platform they fail, saying that listing
|
|
127
|
+
processes is not supported there.
|
|
83
128
|
|
|
84
|
-
A
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
once has more than one process, so an image-name kill can still stop several.
|
|
129
|
+
A pid stops that process alone. An image name stops every process running that
|
|
130
|
+
image: an image launched more than once has more than one. The answer comes
|
|
131
|
+
once every killed process is gone, or says which one still runs 10 s later.
|
|
88
132
|
|
|
89
133
|
Prefer the PID returned by a prior detached launch when cleaning up a launch
|
|
90
134
|
you own.
|
|
91
135
|
|
|
92
|
-
##
|
|
136
|
+
## Library results
|
|
93
137
|
|
|
94
|
-
|
|
138
|
+
The tools answer text. The library's functions answer objects, which a program
|
|
139
|
+
reads instead: `listImages` answers `{ imagesDir, images, notImages,
|
|
140
|
+
processListFailure? }` and `imageInfo` `{ found, imagesDir, image? }`. The
|
|
141
|
+
functions that run a Launcher command answer a `LauncherCommandResult`:
|
|
95
142
|
|
|
96
143
|
```ts
|
|
97
144
|
{
|
|
@@ -104,7 +151,7 @@ Launcher tools return JSON shaped like this:
|
|
|
104
151
|
format: "ston" | "text";
|
|
105
152
|
message?: string;
|
|
106
153
|
};
|
|
107
|
-
raw
|
|
154
|
+
raw?: {
|
|
108
155
|
stdout: string;
|
|
109
156
|
stderr: string;
|
|
110
157
|
format: "ston" | "text";
|
|
@@ -113,14 +160,27 @@ Launcher tools return JSON shaped like this:
|
|
|
113
160
|
args: string[];
|
|
114
161
|
durationMs: number;
|
|
115
162
|
exitCode: number | null;
|
|
163
|
+
signal?: NodeJS.Signals;
|
|
116
164
|
timedOut: boolean;
|
|
117
165
|
timeoutReason?: string;
|
|
118
166
|
};
|
|
167
|
+
launch?: LauncherLaunchReport;
|
|
119
168
|
}
|
|
120
169
|
```
|
|
121
170
|
|
|
122
|
-
Use `ok` and
|
|
123
|
-
`raw.stderr` as diagnostics.
|
|
171
|
+
Use `ok` and `data` for program flow. `raw` is there when the call passed
|
|
172
|
+
`includeRaw: true`; treat `raw.stdout` and `raw.stderr` as diagnostics. A
|
|
173
|
+
create or copy's `data` is `{ image?: LauncherImage }`, and its `failure` says
|
|
174
|
+
why a command that exited 0 made no image: never listed or never opened. A
|
|
175
|
+
start's `launch` says what it ran, including a run a signal ended, which has
|
|
176
|
+
`command.signal` and no exit code.
|
|
177
|
+
|
|
178
|
+
`listTemplates` leaves out the templates the Launcher keeps on disk unless
|
|
179
|
+
given `includeLocal: true`, as the tool is: the Launcher keeps a copy of every
|
|
180
|
+
template it downloads, under the same name, in a category of its own. The
|
|
181
|
+
templates the user made from an image are in that category too, of the same
|
|
182
|
+
class, so a library caller sees them only with `includeLocal: true`, whether
|
|
183
|
+
or not it names a category.
|
|
124
184
|
|
|
125
185
|
## Mutation Boundary
|
|
126
186
|
|