@evref-bl/pharo-agent 0.5.1 → 0.5.2

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pharo-agent",
3
3
  "displayName": "Pharo Agent",
4
- "version": "0.5.1",
4
+ "version": "0.5.2",
5
5
  "description": "Terminal-first Pharo image setup for coding agents.",
6
6
  "author": {
7
7
  "name": "Evref-BL",
@@ -1,7 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import { main } from "../src/cli.js";
3
3
 
4
- main(process.argv.slice(2)).catch((error) => {
5
- console.error(error instanceof Error ? error.message : String(error));
6
- process.exitCode = 1;
7
- });
4
+ main(process.argv.slice(2))
5
+ .then((exitCode) => {
6
+ if (exitCode) process.exitCode = exitCode;
7
+ })
8
+ .catch((error) => {
9
+ console.error(error instanceof Error ? error.message : String(error));
10
+ process.exitCode = 1;
11
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evref-bl/pharo-agent",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "private": false,
5
5
  "description": "Terminal-first Pharo integration for coding agents.",
6
6
  "license": "Apache-2.0",
@@ -32,8 +32,8 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@evref-bl/pharo-mcp": "2.1.0",
35
- "@evref-bl/plexus": "0.5.3",
36
- "@evref-bl/plexus-gateway": "0.5.3",
35
+ "@evref-bl/plexus": "0.5.4",
36
+ "@evref-bl/plexus-gateway": "0.5.4",
37
37
  "@modelcontextprotocol/sdk": "1.32.1"
38
38
  }
39
39
  }
package/plugin.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
3
3
  "name": "pharo-agent",
4
- "version": "0.5.1",
4
+ "version": "0.5.2",
5
5
  "description": "Terminal-first Pharo image setup for coding agents.",
6
6
  "author": {
7
7
  "name": "Evref-BL",
@@ -8,7 +8,7 @@ Run this only when the user asks to enable Pharo tooling in this project.
8
8
  From the project root, run the released CLI that matches this plugin:
9
9
 
10
10
  ```sh
11
- npx --yes @evref-bl/pharo-agent@0.5.1 init --host claude
11
+ npx --yes @evref-bl/pharo-agent@0.5.2 init --host claude
12
12
  ```
13
13
 
14
14
  Name the host this chat runs in: `--host claude` in Claude Code,
package/src/cli.js CHANGED
@@ -110,6 +110,14 @@ function parseToolArguments(value) {
110
110
  return parsed;
111
111
  }
112
112
 
113
+ // A tool the image answered with an error is still an answer: the MCP result
114
+ // carries the Pharo exception, and a caller wants to read it. Print it as
115
+ // always, and report the failure in the exit status too, so `set -e` and
116
+ // subprocess.run(check=True) do not read a failed load as a success.
117
+ export function exitCodeForToolResult(result) {
118
+ return result?.isError === true ? 1 : 0;
119
+ }
120
+
113
121
  export async function main(args) {
114
122
  const [command, ...rest] = args;
115
123
  if (command === "init") {
@@ -194,13 +202,14 @@ export async function main(args) {
194
202
  if (!toolName || extra.length > 0) {
195
203
  throw new Error("pharo requires one tool name and an optional JSON object");
196
204
  }
197
- console.log(JSON.stringify(await callImageTool(
205
+ const result = await callImageTool(
198
206
  projectRoot,
199
207
  readOpenImage(projectRoot, image),
200
208
  toolName,
201
209
  parseToolArguments(argumentsJson),
202
- ), null, 2));
203
- return;
210
+ );
211
+ console.log(JSON.stringify(result, null, 2));
212
+ return exitCodeForToolResult(result);
204
213
  }
205
214
  throw new Error(`Unsupported command: ${command}\n${usage()}`);
206
215
  }