@ycodium-ai/agent-opencode 0.2.2126 → 0.2.2143
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/dist/index.js +20 -3
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1133,6 +1133,11 @@ function makeOpenCodeEnvironment(homePath, baseEnv) {
|
|
|
1133
1133
|
XDG_CONFIG_HOME: xdgPaths.configHome
|
|
1134
1134
|
};
|
|
1135
1135
|
}
|
|
1136
|
+
function makeOpenCodeContinuationGroupKey(input) {
|
|
1137
|
+
const serverUrl = input.serverUrl.trim();
|
|
1138
|
+
if (serverUrl.length > 0) return `opencode:server:${serverUrl}`;
|
|
1139
|
+
return `opencode:home:${resolveOpenCodeHomePath(input.homePath)}`;
|
|
1140
|
+
}
|
|
1136
1141
|
async function isSameOpenCodeDirectory(left, right) {
|
|
1137
1142
|
const lexicalLeft = NodePath3.resolve(left);
|
|
1138
1143
|
const lexicalRight = NodePath3.resolve(right);
|
|
@@ -1521,6 +1526,11 @@ function mapPermissionDecision(reply) {
|
|
|
1521
1526
|
}
|
|
1522
1527
|
}
|
|
1523
1528
|
|
|
1529
|
+
// src/probe.ts
|
|
1530
|
+
import {
|
|
1531
|
+
ExecutorSpawnRefusedError as ExecutorSpawnRefusedError2
|
|
1532
|
+
} from "@ycodium-ai/plugin-api/executor";
|
|
1533
|
+
|
|
1524
1534
|
// src/server.ts
|
|
1525
1535
|
import * as NodeNet from "node:net";
|
|
1526
1536
|
import * as NodeOS3 from "node:os";
|
|
@@ -6930,6 +6940,7 @@ var import_cross_spawn = __toESM(require_cross_spawn(), 1);
|
|
|
6930
6940
|
|
|
6931
6941
|
// src/server.ts
|
|
6932
6942
|
import {
|
|
6943
|
+
ExecutorSpawnRefusedError,
|
|
6933
6944
|
mergeLaunchEnv,
|
|
6934
6945
|
brainSlotEnvKeys
|
|
6935
6946
|
} from "@ycodium-ai/plugin-api/executor";
|
|
@@ -7255,7 +7266,8 @@ async function runOpenCodeCommand(input) {
|
|
|
7255
7266
|
async function withOneSecondRetry(run) {
|
|
7256
7267
|
try {
|
|
7257
7268
|
return await run();
|
|
7258
|
-
} catch {
|
|
7269
|
+
} catch (error) {
|
|
7270
|
+
if (error instanceof ExecutorSpawnRefusedError) throw error;
|
|
7259
7271
|
await new Promise((resolve2) => setTimeout(resolve2, 1e3));
|
|
7260
7272
|
return await run();
|
|
7261
7273
|
}
|
|
@@ -7306,7 +7318,8 @@ async function loadInventoryFromCli(input) {
|
|
|
7306
7318
|
return command;
|
|
7307
7319
|
});
|
|
7308
7320
|
return parseAgentListCliOutput(result.stdout);
|
|
7309
|
-
} catch {
|
|
7321
|
+
} catch (error) {
|
|
7322
|
+
if (error instanceof ExecutorSpawnRefusedError) throw error;
|
|
7310
7323
|
return [];
|
|
7311
7324
|
}
|
|
7312
7325
|
};
|
|
@@ -7320,7 +7333,8 @@ async function loadInventoryFromCli(input) {
|
|
|
7320
7333
|
return command;
|
|
7321
7334
|
});
|
|
7322
7335
|
return parseSkillsCliOutput(result.stdout);
|
|
7323
|
-
} catch {
|
|
7336
|
+
} catch (error) {
|
|
7337
|
+
if (error instanceof ExecutorSpawnRefusedError) throw error;
|
|
7324
7338
|
return [];
|
|
7325
7339
|
}
|
|
7326
7340
|
};
|
|
@@ -7419,6 +7433,7 @@ ${result.stderr}`);
|
|
|
7419
7433
|
};
|
|
7420
7434
|
}
|
|
7421
7435
|
} catch (cause) {
|
|
7436
|
+
if (cause instanceof ExecutorSpawnRefusedError2) throw cause;
|
|
7422
7437
|
return formatOpenCodeProbeError({ cause, isExternalServer: false, version });
|
|
7423
7438
|
}
|
|
7424
7439
|
}
|
|
@@ -7484,6 +7499,7 @@ ${result.stderr}`);
|
|
|
7484
7499
|
...OPENCODE_NATIVE_MODE_REPORT
|
|
7485
7500
|
};
|
|
7486
7501
|
} catch (cause) {
|
|
7502
|
+
if (cause instanceof ExecutorSpawnRefusedError2) throw cause;
|
|
7487
7503
|
const mapped = formatOpenCodeProbeError({ cause, isExternalServer: isExternal, version });
|
|
7488
7504
|
if (mapped.detail) {
|
|
7489
7505
|
const hidden = hideGenericEffectText(mapped.detail);
|
|
@@ -9143,6 +9159,7 @@ function createOpenCodeInstance(config, host, attachments) {
|
|
|
9143
9159
|
return { threadId, turns };
|
|
9144
9160
|
},
|
|
9145
9161
|
events,
|
|
9162
|
+
continuationKey: makeOpenCodeContinuationGroupKey(recipe),
|
|
9146
9163
|
dispose: async () => {
|
|
9147
9164
|
if (disposed) return;
|
|
9148
9165
|
disposed = true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ycodium-ai/agent-opencode",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2143",
|
|
4
4
|
"description": "OpenCode executor: OpenCode CLI via @opencode-ai/sdk/v2.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ycodium",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@types/node": "24.12.4",
|
|
24
24
|
"esbuild": "0.28.1",
|
|
25
25
|
"vite-plus": "0.2.2",
|
|
26
|
-
"@ycodium-ai/plugin-api": "0.2.
|
|
26
|
+
"@ycodium-ai/plugin-api": "0.2.2143"
|
|
27
27
|
},
|
|
28
28
|
"ycodium": {
|
|
29
29
|
"plugin": "./dist/index.js",
|