@evref-bl/pharo-launcher-mcp 0.1.2 → 0.1.4
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 +229 -199
- package/bin/pharo-launcher.cmd +46 -46
- package/bin/pharo-launcher.sh +0 -0
- package/dist/commandCatalog.d.ts.map +1 -1
- package/dist/commandCatalog.js +23 -6
- package/dist/commandCatalog.js.map +1 -1
- package/dist/config.d.ts +21 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +75 -6
- package/dist/config.js.map +1 -1
- package/dist/crossProfileCopy.d.ts +88 -0
- package/dist/crossProfileCopy.d.ts.map +1 -0
- package/dist/crossProfileCopy.js +511 -0
- package/dist/crossProfileCopy.js.map +1 -0
- package/dist/discovery.d.ts +165 -1
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +803 -3
- package/dist/discovery.js.map +1 -1
- package/dist/imageMetadata.d.ts +1 -0
- package/dist/imageMetadata.d.ts.map +1 -1
- package/dist/imageMetadata.js +35 -2
- package/dist/imageMetadata.js.map +1 -1
- package/dist/launcherCli.d.ts +2 -0
- package/dist/launcherCli.d.ts.map +1 -1
- package/dist/launcherCli.js +589 -62
- package/dist/launcherCli.js.map +1 -1
- package/dist/models.d.ts +3 -1
- package/dist/models.d.ts.map +1 -1
- package/dist/parser.d.ts.map +1 -1
- package/dist/parser.js +48 -13
- package/dist/parser.js.map +1 -1
- package/dist/platform.d.ts +2 -0
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +21 -0
- package/dist/platform.js.map +1 -1
- package/dist/processTools.d.ts.map +1 -1
- package/dist/processTools.js +13 -7
- package/dist/processTools.js.map +1 -1
- package/dist/resultNormalizer.d.ts +5 -1
- package/dist/resultNormalizer.d.ts.map +1 -1
- package/dist/resultNormalizer.js +79 -6
- package/dist/resultNormalizer.js.map +1 -1
- package/dist/server.d.ts +3 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +475 -83
- package/dist/server.js.map +1 -1
- package/dist/textTokens.d.ts +10 -0
- package/dist/textTokens.d.ts.map +1 -0
- package/dist/textTokens.js +68 -0
- package/dist/textTokens.js.map +1 -0
- package/docs/README.md +26 -0
- package/docs/cleanup-hook-boundary.md +94 -0
- package/docs/development.md +59 -23
- package/docs/reference/tools.md +179 -0
- package/docs/troubleshooting.md +135 -0
- package/docs/user/getting-started.md +172 -0
- package/docs/user/profile-mode.md +183 -0
- package/package.json +59 -52
package/README.md
CHANGED
|
@@ -1,199 +1,229 @@
|
|
|
1
|
-
# pharo-launcher-mcp
|
|
2
|
-
|
|
3
|
-
pharo-launcher-mcp is
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
1
|
+
# pharo-launcher-mcp
|
|
2
|
+
|
|
3
|
+
pharo-launcher-mcp is an MCP server for controlling Pharo Launcher from a host
|
|
4
|
+
process.
|
|
5
|
+
|
|
6
|
+
It exposes Pharo Launcher image, template, VM, and process operations as MCP
|
|
7
|
+
tools. An MCP client can ask it what Launcher installation it resolved, list
|
|
8
|
+
templates, create or copy images, launch images, package images, inspect running
|
|
9
|
+
Pharo processes, and delete caller-owned images or VMs when explicitly
|
|
10
|
+
confirmed.
|
|
11
|
+
|
|
12
|
+
The server works outside the target images. It does not install code into those
|
|
13
|
+
images, keep project state, or decide which images are safe to mutate. It is the
|
|
14
|
+
launcher boundary that higher-level tools can call when they need a concrete
|
|
15
|
+
image or process action.
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
Requirements:
|
|
20
|
+
|
|
21
|
+
- Node.js 22.12.0 or newer
|
|
22
|
+
- `npm` and `npx`
|
|
23
|
+
- Pharo Launcher installed on the host
|
|
24
|
+
|
|
25
|
+
Install from npm:
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
npm install @evref-bl/pharo-launcher-mcp
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Run the MCP server over stdio:
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
npx @evref-bl/pharo-launcher-mcp
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The package also provides the `pharo-launcher-mcp` executable when installed in
|
|
38
|
+
a project or globally.
|
|
39
|
+
|
|
40
|
+
## Terms
|
|
41
|
+
|
|
42
|
+
- A **Pharo Launcher installation** is the app or data directory, VM executable,
|
|
43
|
+
control image, and launcher wrapper used to run Launcher commands.
|
|
44
|
+
- A **launcher state scope** is the set of image, VM, template-source,
|
|
45
|
+
init-script, and log directories affected by Launcher commands.
|
|
46
|
+
- **No-profile mode** uses the user's normal Pharo Launcher installation and
|
|
47
|
+
state scope directly.
|
|
48
|
+
- A **pharo-launcher-mcp profile** is an explicit isolated state scope selected
|
|
49
|
+
through environment variables.
|
|
50
|
+
- A **launcher tool result** is the normalized JSON envelope returned by most
|
|
51
|
+
tools. It includes parsed data when available, raw stdout/stderr, parser
|
|
52
|
+
status, command duration, exit code, and timeout state.
|
|
53
|
+
|
|
54
|
+
## Quick Start
|
|
55
|
+
|
|
56
|
+
Check what installation the server will use without invoking Pharo Launcher:
|
|
57
|
+
|
|
58
|
+
```sh
|
|
59
|
+
npx @evref-bl/pharo-launcher-mcp --health
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
If the discovered paths are not right, set the installation paths explicitly:
|
|
63
|
+
|
|
64
|
+
```sh
|
|
65
|
+
PHARO_LAUNCHER_DIR="/path/to/Pharo Launcher"
|
|
66
|
+
PHARO_LAUNCHER_VM="/path/to/pharo"
|
|
67
|
+
PHARO_LAUNCHER_IMAGE="/path/to/PharoLauncher.image"
|
|
68
|
+
npx @evref-bl/pharo-launcher-mcp --health
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Configure an MCP client to start the stdio server. A generic MCP configuration
|
|
72
|
+
looks like this:
|
|
73
|
+
|
|
74
|
+
```json
|
|
75
|
+
{
|
|
76
|
+
"mcpServers": {
|
|
77
|
+
"pharo-launcher": {
|
|
78
|
+
"command": "npx",
|
|
79
|
+
"args": ["-y", "@evref-bl/pharo-launcher-mcp"]
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Once connected, start with these tools:
|
|
86
|
+
|
|
87
|
+
```text
|
|
88
|
+
pharo_launcher_health
|
|
89
|
+
pharo_launcher_config
|
|
90
|
+
pharo_launcher_validate_installation
|
|
91
|
+
pharo_launcher_inventory
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
`pharo_launcher_health` and `pharo_launcher_config` only inspect resolved
|
|
95
|
+
configuration. `pharo_launcher_validate_installation` invokes `--version`, so it
|
|
96
|
+
crosses the live Launcher boundary.
|
|
97
|
+
|
|
98
|
+
## Profile Quick Start
|
|
99
|
+
|
|
100
|
+
Use a profile when automation or tests need an isolated Launcher state scope:
|
|
101
|
+
|
|
102
|
+
```sh
|
|
103
|
+
PHARO_LAUNCHER_MCP_PROFILE=isolated
|
|
104
|
+
PHARO_LAUNCHER_MCP_STATE_ROOT=/path/to/launcher-profile
|
|
105
|
+
npx @evref-bl/pharo-launcher-mcp --health
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
In profile mode, pharo-launcher-mcp copies the Launcher control image into the
|
|
109
|
+
profile root when needed, creates profile directories, and writes a Launcher CLI
|
|
110
|
+
configuration that points images, VMs, templates, init scripts, and logs at that
|
|
111
|
+
profile. No-profile mode stays inactive unless one of the profile environment
|
|
112
|
+
variables is set.
|
|
113
|
+
|
|
114
|
+
Read [Profile mode](docs/user/profile-mode.md) before using profiles for live
|
|
115
|
+
image creation, launch, or cleanup.
|
|
116
|
+
|
|
117
|
+
## Common Workflows
|
|
118
|
+
|
|
119
|
+
List available templates:
|
|
120
|
+
|
|
121
|
+
```text
|
|
122
|
+
pharo_launcher_template_update
|
|
123
|
+
pharo_launcher_template_list
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Create an image from a template:
|
|
127
|
+
|
|
128
|
+
```json
|
|
129
|
+
{
|
|
130
|
+
"tool": "pharo_launcher_image_create",
|
|
131
|
+
"arguments": {
|
|
132
|
+
"templateName": "Pharo 13.0 - 64bit",
|
|
133
|
+
"newImageName": "sample-130",
|
|
134
|
+
"noLaunch": true
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Copy an image:
|
|
140
|
+
|
|
141
|
+
```json
|
|
142
|
+
{
|
|
143
|
+
"tool": "pharo_launcher_image_copy",
|
|
144
|
+
"arguments": {
|
|
145
|
+
"imageName": "sample-130",
|
|
146
|
+
"newImageName": "sample-130-copy"
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Launch an image:
|
|
152
|
+
|
|
153
|
+
```json
|
|
154
|
+
{
|
|
155
|
+
"tool": "pharo_launcher_image_launch",
|
|
156
|
+
"arguments": {
|
|
157
|
+
"imageName": "sample-130-copy",
|
|
158
|
+
"displayMode": "headless",
|
|
159
|
+
"detached": true
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Package an image:
|
|
165
|
+
|
|
166
|
+
```json
|
|
167
|
+
{
|
|
168
|
+
"tool": "pharo_launcher_image_package",
|
|
169
|
+
"arguments": {
|
|
170
|
+
"imageName": "sample-130-copy",
|
|
171
|
+
"location": "/path/to/packages",
|
|
172
|
+
"zip": true
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Safety Model
|
|
178
|
+
|
|
179
|
+
Mutating tools are explicit. The destructive ones require `confirm: true`:
|
|
180
|
+
|
|
181
|
+
```text
|
|
182
|
+
pharo_launcher_image_delete
|
|
183
|
+
pharo_launcher_image_recreate
|
|
184
|
+
pharo_launcher_vm_delete
|
|
185
|
+
pharo_launcher_process_kill
|
|
186
|
+
pharo_launcher_raw_command
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
`pharo_launcher_process_kill` requires exactly one target: `pid` or
|
|
190
|
+
`imageName`. Prefer a recorded PID when cleaning up a known launch.
|
|
191
|
+
|
|
192
|
+
`pharo_launcher_image_create` and `pharo_launcher_image_copy` verify the target
|
|
193
|
+
image after Launcher reports success. If the target image cannot be listed and
|
|
194
|
+
inspected, the MCP result is an error with the command output and verification
|
|
195
|
+
diagnostics.
|
|
196
|
+
|
|
197
|
+
Profile-scoped `pharo_launcher_image_create_from_build` is refused before
|
|
198
|
+
Launcher is invoked, because that Launcher path can launch and download VMs
|
|
199
|
+
outside the configured profile VM directory.
|
|
200
|
+
|
|
201
|
+
## Documentation
|
|
202
|
+
|
|
203
|
+
- [Getting started](docs/user/getting-started.md) covers installation,
|
|
204
|
+
environment discovery, MCP client setup, and the first health checks.
|
|
205
|
+
- [Profile mode](docs/user/profile-mode.md) explains no-profile mode, isolated
|
|
206
|
+
profiles, profile paths, generated configuration, and cross-profile image
|
|
207
|
+
copy.
|
|
208
|
+
- [Tool reference](docs/reference/tools.md) lists the MCP tools, arguments,
|
|
209
|
+
result envelope, and special behaviors.
|
|
210
|
+
- [Troubleshooting](docs/troubleshooting.md) maps common setup and live Launcher
|
|
211
|
+
failures to concrete checks.
|
|
212
|
+
- [Development](docs/development.md) covers source layout, tests, local probes,
|
|
213
|
+
and live test boundaries.
|
|
214
|
+
- [Cleanup hook boundary](docs/cleanup-hook-boundary.md) describes the status,
|
|
215
|
+
timeout, stop, and cleanup contract for caller-managed live checks.
|
|
216
|
+
|
|
217
|
+
## Source Development
|
|
218
|
+
|
|
219
|
+
```sh
|
|
220
|
+
npm install
|
|
221
|
+
npm run check
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
`npm run check` runs type checking, build, and unit tests. Live integration tests
|
|
225
|
+
are separate because they invoke a local Pharo Launcher installation:
|
|
226
|
+
|
|
227
|
+
```sh
|
|
228
|
+
npm run test:integration
|
|
229
|
+
```
|
package/bin/pharo-launcher.cmd
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
@echo off
|
|
2
|
-
setlocal
|
|
3
|
-
|
|
4
|
-
set "SCRIPT_DIR=%~dp0"
|
|
5
|
-
set "SCRIPT_DIR=%SCRIPT_DIR:~0,-1%"
|
|
6
|
-
for %%I in ("%SCRIPT_DIR%\..") do set "ROOT=%%~fI"
|
|
7
|
-
|
|
8
|
-
if "%PHARO_LAUNCHER_IMAGE%"=="" (
|
|
9
|
-
if exist "%ROOT%\shared\PharoLauncher.image" (
|
|
10
|
-
set "PHARO_LAUNCHER_IMAGE=%ROOT%\shared\PharoLauncher.image"
|
|
11
|
-
)
|
|
12
|
-
)
|
|
13
|
-
|
|
14
|
-
if "%PHARO_LAUNCHER_IMAGE%"=="" (
|
|
15
|
-
for %%I in ("%SCRIPT_DIR%\*.image" "%ROOT%\*.image") do (
|
|
16
|
-
if exist "%%~fI" (
|
|
17
|
-
set "PHARO_LAUNCHER_IMAGE=%%~fI"
|
|
18
|
-
goto :foundImage
|
|
19
|
-
)
|
|
20
|
-
)
|
|
21
|
-
)
|
|
22
|
-
:foundImage
|
|
23
|
-
|
|
24
|
-
if "%PHARO_LAUNCHER_VM%"=="" (
|
|
25
|
-
if exist "%ROOT%\pharo-vm\PharoConsole.exe" (
|
|
26
|
-
set "PHARO_LAUNCHER_VM=%ROOT%\pharo-vm\PharoConsole.exe"
|
|
27
|
-
)
|
|
28
|
-
)
|
|
29
|
-
|
|
30
|
-
if "%PHARO_LAUNCHER_VM%"=="" (
|
|
31
|
-
if exist "%ROOT%\vms\80-x64\PharoConsole.exe" (
|
|
32
|
-
set "PHARO_LAUNCHER_VM=%ROOT%\vms\80-x64\PharoConsole.exe"
|
|
33
|
-
)
|
|
34
|
-
)
|
|
35
|
-
|
|
36
|
-
if "%PHARO_LAUNCHER_IMAGE%"=="" (
|
|
37
|
-
echo PHARO_LAUNCHER_IMAGE is required or a packaged image must exist next to the launcher script 1>&2
|
|
38
|
-
exit /b 1
|
|
39
|
-
)
|
|
40
|
-
|
|
41
|
-
if "%PHARO_LAUNCHER_VM%"=="" (
|
|
42
|
-
echo PHARO_LAUNCHER_VM is required or a packaged VM must exist under pharo-vm or vms\80-x64 1>&2
|
|
43
|
-
exit /b 1
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
"%PHARO_LAUNCHER_VM%" --headless "%PHARO_LAUNCHER_IMAGE%" --no-default-preferences clap launcher %*
|
|
1
|
+
@echo off
|
|
2
|
+
setlocal
|
|
3
|
+
|
|
4
|
+
set "SCRIPT_DIR=%~dp0"
|
|
5
|
+
set "SCRIPT_DIR=%SCRIPT_DIR:~0,-1%"
|
|
6
|
+
for %%I in ("%SCRIPT_DIR%\..") do set "ROOT=%%~fI"
|
|
7
|
+
|
|
8
|
+
if "%PHARO_LAUNCHER_IMAGE%"=="" (
|
|
9
|
+
if exist "%ROOT%\shared\PharoLauncher.image" (
|
|
10
|
+
set "PHARO_LAUNCHER_IMAGE=%ROOT%\shared\PharoLauncher.image"
|
|
11
|
+
)
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
if "%PHARO_LAUNCHER_IMAGE%"=="" (
|
|
15
|
+
for %%I in ("%SCRIPT_DIR%\*.image" "%ROOT%\*.image") do (
|
|
16
|
+
if exist "%%~fI" (
|
|
17
|
+
set "PHARO_LAUNCHER_IMAGE=%%~fI"
|
|
18
|
+
goto :foundImage
|
|
19
|
+
)
|
|
20
|
+
)
|
|
21
|
+
)
|
|
22
|
+
:foundImage
|
|
23
|
+
|
|
24
|
+
if "%PHARO_LAUNCHER_VM%"=="" (
|
|
25
|
+
if exist "%ROOT%\pharo-vm\PharoConsole.exe" (
|
|
26
|
+
set "PHARO_LAUNCHER_VM=%ROOT%\pharo-vm\PharoConsole.exe"
|
|
27
|
+
)
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
if "%PHARO_LAUNCHER_VM%"=="" (
|
|
31
|
+
if exist "%ROOT%\vms\80-x64\PharoConsole.exe" (
|
|
32
|
+
set "PHARO_LAUNCHER_VM=%ROOT%\vms\80-x64\PharoConsole.exe"
|
|
33
|
+
)
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
if "%PHARO_LAUNCHER_IMAGE%"=="" (
|
|
37
|
+
echo PHARO_LAUNCHER_IMAGE is required or a packaged image must exist next to the launcher script 1>&2
|
|
38
|
+
exit /b 1
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
if "%PHARO_LAUNCHER_VM%"=="" (
|
|
42
|
+
echo PHARO_LAUNCHER_VM is required or a packaged VM must exist under pharo-vm or vms\80-x64 1>&2
|
|
43
|
+
exit /b 1
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
"%PHARO_LAUNCHER_VM%" --headless "%PHARO_LAUNCHER_IMAGE%" --no-default-preferences clap launcher %*
|
package/bin/pharo-launcher.sh
CHANGED
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commandCatalog.d.ts","sourceRoot":"","sources":["../src/commandCatalog.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,MAAM,EAAE,CAAC;CACzC;AAED,qBAAa,cAAe,SAAQ,KAAK;gBAC3B,OAAO,EAAE,MAAM;CAI5B;
|
|
1
|
+
{"version":3,"file":"commandCatalog.d.ts","sourceRoot":"","sources":["../src/commandCatalog.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,MAAM,EAAE,CAAC;CACzC;AAED,qBAAa,cAAe,SAAQ,KAAK;gBAC3B,OAAO,EAAE,MAAM;CAI5B;AAwXD,eAAO,MAAM,oBAAoB,EAAE,mBAAmB,EA2OrD,CAAC;AAEF,eAAO,MAAM,yBAAyB,kCAErC,CAAC;AAEF,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,GAAG,SAAS,CAE3F;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,CAoBvD;AAED,eAAO,MAAM,cAAc,EAAE,mBAgB5B,CAAC"}
|
package/dist/commandCatalog.js
CHANGED
|
@@ -4,13 +4,12 @@ export class ToolInputError extends Error {
|
|
|
4
4
|
this.name = "ToolInputError";
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
|
-
const emptyInputSchema = {
|
|
8
|
-
type: "object",
|
|
9
|
-
properties: {},
|
|
10
|
-
additionalProperties: false,
|
|
11
|
-
};
|
|
12
7
|
const stringSchema = { type: "string", minLength: 1 };
|
|
13
8
|
const booleanSchema = { type: "boolean" };
|
|
9
|
+
const includeRawSchema = {
|
|
10
|
+
type: "boolean",
|
|
11
|
+
description: "Include raw Pharo Launcher stdout and stderr in the tool result.",
|
|
12
|
+
};
|
|
14
13
|
const confirmationSchema = {
|
|
15
14
|
type: "boolean",
|
|
16
15
|
const: true,
|
|
@@ -21,14 +20,20 @@ const formatSchema = {
|
|
|
21
20
|
enum: ["ston", "text"],
|
|
22
21
|
default: "ston",
|
|
23
22
|
};
|
|
23
|
+
const displayModeSchema = {
|
|
24
|
+
type: "string",
|
|
25
|
+
enum: ["headless", "interactive"],
|
|
26
|
+
default: "headless",
|
|
27
|
+
};
|
|
24
28
|
function objectSchema(properties, required = []) {
|
|
25
29
|
return {
|
|
26
30
|
type: "object",
|
|
27
|
-
properties,
|
|
31
|
+
properties: { ...properties, includeRaw: includeRawSchema },
|
|
28
32
|
required,
|
|
29
33
|
additionalProperties: false,
|
|
30
34
|
};
|
|
31
35
|
}
|
|
36
|
+
const emptyInputSchema = objectSchema({});
|
|
32
37
|
const tableProperties = {
|
|
33
38
|
format: formatSchema,
|
|
34
39
|
brief: booleanSchema,
|
|
@@ -81,6 +86,16 @@ function optionalBoolean(input, key) {
|
|
|
81
86
|
}
|
|
82
87
|
return value;
|
|
83
88
|
}
|
|
89
|
+
function optionalDisplayMode(input) {
|
|
90
|
+
const value = input.displayMode;
|
|
91
|
+
if (value === undefined) {
|
|
92
|
+
return undefined;
|
|
93
|
+
}
|
|
94
|
+
if (value === "headless" || value === "interactive") {
|
|
95
|
+
return value;
|
|
96
|
+
}
|
|
97
|
+
throw new ToolInputError("displayMode must be headless or interactive");
|
|
98
|
+
}
|
|
84
99
|
function requireConfirmation(input, toolName) {
|
|
85
100
|
if (input.confirm !== true) {
|
|
86
101
|
throw new ToolInputError(`${toolName} requires confirm: true`);
|
|
@@ -193,6 +208,7 @@ function imageLaunch(input) {
|
|
|
193
208
|
const object = inputObject(input);
|
|
194
209
|
const args = ["image", "launch"];
|
|
195
210
|
addOption(args, "--script", optionalString(object, "script"));
|
|
211
|
+
addOption(args, "--displayMode", optionalDisplayMode(object));
|
|
196
212
|
addFlag(args, "--detached", optionalBoolean(object, "detached"));
|
|
197
213
|
args.push(requiredString(object, "imageName"));
|
|
198
214
|
return args;
|
|
@@ -394,6 +410,7 @@ export const launcherCommandTools = [
|
|
|
394
410
|
imageName: stringSchema,
|
|
395
411
|
script: stringSchema,
|
|
396
412
|
detached: booleanSchema,
|
|
413
|
+
displayMode: displayModeSchema,
|
|
397
414
|
}, ["imageName"]),
|
|
398
415
|
buildArgs: imageLaunch,
|
|
399
416
|
},
|