alineo-mcp 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.mjs +33 -13
  2. package/package.json +4 -3
package/dist/index.mjs CHANGED
@@ -2,6 +2,7 @@
2
2
  import { serveStdio } from "@modelcontextprotocol/server/stdio";
3
3
  import { McpServer } from "@modelcontextprotocol/server";
4
4
  import { z } from "zod";
5
+ import { isErrorCode } from "@alineo-labs/errors";
5
6
  import { join } from "path";
6
7
  import { homedir } from "os";
7
8
  import { existsSync, readdirSync } from "fs";
@@ -12,7 +13,7 @@ import { dirname, join as join$1, resolve } from "node:path";
12
13
  import { ProjectConfigSchema } from "@alineo-labs/schema";
13
14
  import { validateAgentSpec } from "alineo";
14
15
  //#region package.json
15
- var version = "0.3.0";
16
+ var version = "0.3.1";
16
17
  //#endregion
17
18
  //#region src/alineod-client.ts
18
19
  /**
@@ -35,9 +36,13 @@ var version = "0.3.0";
35
36
  */
36
37
  var AlineodError = class extends Error {
37
38
  status;
38
- constructor(status, message) {
39
+ code;
40
+ hint;
41
+ constructor(status, message, code, hint) {
39
42
  super(message);
40
43
  this.status = status;
44
+ this.code = code;
45
+ this.hint = hint;
41
46
  this.name = "AlineodError";
42
47
  }
43
48
  };
@@ -64,8 +69,9 @@ var AlineodClient = class {
64
69
  const text = await res.text();
65
70
  const data = text.length > 0 ? JSON.parse(text) : void 0;
66
71
  if (!res.ok) {
67
- const message = data?.error ?? res.statusText;
68
- throw new AlineodError(res.status, message);
72
+ const body = data;
73
+ const message = body?.error ?? res.statusText;
74
+ throw new AlineodError(res.status, message, isErrorCode(body?.code) ? body.code : void 0, typeof body?.hint === "string" ? body.hint : void 0);
69
75
  }
70
76
  return data;
71
77
  }
@@ -388,6 +394,7 @@ function parseBoolean(raw, name) {
388
394
  */
389
395
  function projectConfigFromEnv(env) {
390
396
  const out = {};
397
+ if (env.ALINEO_PROVIDER !== void 0) out.provider = env.ALINEO_PROVIDER;
391
398
  if (env.ALINEO_SERVER_URL !== void 0) out.serverUrl = env.ALINEO_SERVER_URL;
392
399
  if (env.ALINEO_API_KEY !== void 0) out.apiKey = env.ALINEO_API_KEY;
393
400
  if (env.ALINEO_USE_SERVER_PROXY !== void 0) out.useServerProxy = parseBoolean(env.ALINEO_USE_SERVER_PROXY, "ALINEO_USE_SERVER_PROXY");
@@ -592,13 +599,25 @@ function serverDataDir() {
592
599
  return join(serverConfigDir(), "opensandbox-data");
593
600
  }
594
601
  /**
595
- * v1.0.19 (the previous pin) predates cached bwrap-archive support, so every sandbox logged
596
- * "bwrap archive not cached for linux/amd64 -- isolation will be unavailable" and isolation
597
- * sessions (and anything that depends on them, e.g. pause()/resume()) hung indefinitely
598
- * instead of failing cleanly. OpenSandbox's own docs: >=v1.0.20 has base isolation-session
599
- * support, >=v1.0.21 is recommended for full functionality -- the "v1.1.0+" the warning
600
- * message itself suggests does not exist as a published tag. v1.0.22 is the latest.
602
+ * The execd image the generated server config pins.
603
+ *
604
+ * `release-1.1.1`, not `v1.0.22`. Two reasons, both measured:
605
+ *
606
+ * - **Newlines.** `v1.0.22` emits one stdout event per line with the newline stripped, so
607
+ * `ExecResult.stdout` of `echo one; echo two` was `"onetwo"`. From `release-1.1.1` the event
608
+ * text keeps its newline (`"one\n"`), which is what `ExecHandle` assumes when it joins events.
609
+ * `tests/contract` fails three exec cases on `v1.0.22` and passes all twenty on `release-1.1.1`.
610
+ * - **Post-completion delay.** `/command` holds the stream open for 1.00 s after
611
+ * `execution_complete` on `v1.0.22` and 0.20 s from 1.1.1 (opensandbox-group/OpenSandbox#1277).
612
+ *
613
+ * History: v1.0.19 predates cached bwrap-archive support, so every sandbox logged "bwrap archive
614
+ * not cached for linux/amd64 -- isolation will be unavailable" and isolation sessions (and
615
+ * anything that depends on them, e.g. pause()/resume()) hung instead of failing cleanly.
616
+ *
617
+ * Tags are `v1.0.x` up to v1.0.22 and `release-1.x.y` from 1.1.1. Re-run `tests/contract`
618
+ * against a server on the new tag before changing this.
601
619
  */
620
+ const EXECD_IMAGE = "opensandbox/execd:release-1.1.1";
602
621
  /**
603
622
  * Where the OpenSandbox server, running in its own container, reaches the ports it publishes on
604
623
  * the host (`[docker].host_ip`). Without it the server falls back to `127.0.0.1` — its own
@@ -637,7 +656,7 @@ eip = "${eip}"
637
656
 
638
657
  [runtime]
639
658
  type = "docker"
640
- execd_image = "opensandbox/execd:v1.0.22"
659
+ execd_image = "${EXECD_IMAGE}"
641
660
 
642
661
  [docker]
643
662
  network_mode = "bridge"
@@ -945,6 +964,7 @@ async function ensureServerDataDir() {
945
964
  async function ensureProjectConfig(log) {
946
965
  if (!existsSync(configPath())) {
947
966
  await writeConfig({
967
+ provider: "opensandbox",
948
968
  serverUrl: SERVER_URL,
949
969
  useServerProxy: true,
950
970
  apiKey: "",
@@ -1032,7 +1052,7 @@ async function listSpecs() {
1032
1052
  const spec = await Bun.file(join(dir, file)).json();
1033
1053
  specs.push({
1034
1054
  name: spec.name ?? file.replace(/\.json$/, ""),
1035
- harness: spec.harness ?? "?",
1055
+ harness: (typeof spec.harness === "object" ? spec.harness.id : spec.harness) ?? "?",
1036
1056
  description: spec.description ?? spec.title ?? ""
1037
1057
  });
1038
1058
  } catch {
@@ -1068,7 +1088,7 @@ function fail(err) {
1068
1088
  return {
1069
1089
  content: [{
1070
1090
  type: "text",
1071
- text: err instanceof AlineodError ? `alineod error (${err.status || "network"}): ${err.message}` : err instanceof Error ? err.message : String(err)
1091
+ text: err instanceof AlineodError ? `alineod error (${err.status || "network"}${err.code ? `, ${err.code}` : ""}): ${err.message}` + (err.hint ? `\nHint: ${err.hint}` : "") : err instanceof Error ? err.message : String(err)
1072
1092
  }],
1073
1093
  isError: true
1074
1094
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alineo-mcp",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "MCP server exposing alineod's swarm-control API (and local agent-spec management) as tools for MCP clients (Claude Code, Claude Desktop, Cursor, …).",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -31,9 +31,10 @@
31
31
  "typecheck": "tsc --noEmit"
32
32
  },
33
33
  "dependencies": {
34
- "@alineo-labs/schema": "0.2.0",
34
+ "@alineo-labs/errors": "0.1.0",
35
+ "@alineo-labs/schema": "0.3.0",
35
36
  "@modelcontextprotocol/server": "^2.0.0",
36
- "alineo": "0.7.0",
37
+ "alineo": "0.8.0",
37
38
  "zod": "^4"
38
39
  },
39
40
  "devDependencies": {