@aiden-ade/sandbox-agent 0.1.4 → 0.1.5
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.cjs +38 -12
- package/package.json +6 -7
package/dist/index.cjs
CHANGED
|
@@ -4898,6 +4898,14 @@ function classifyCliError(stderr, exitCode) {
|
|
|
4898
4898
|
return "Rate limited by API. Try again shortly.";
|
|
4899
4899
|
if (isLikelyProviderAuthError(stderr))
|
|
4900
4900
|
return "API key invalid or expired. Check your provider settings.";
|
|
4901
|
+
if (lower.includes("not logged in") || lower.includes("login required") || lower.includes("please sign in") || lower.includes("please log in") || lower.includes("sign in to") || lower.includes("log in to"))
|
|
4902
|
+
return "Not logged in. Please authenticate with this provider first.";
|
|
4903
|
+
if (lower.includes("model not supported") || lower.includes("unsupported model") || lower.includes("model not found") || lower.includes("model not available") || lower.includes("model is not available") || lower.includes("invalid model") || lower.includes("unknown model") || lower.includes("no such model"))
|
|
4904
|
+
return "Model not supported by this provider. Check your provider's model list.";
|
|
4905
|
+
if (lower.includes("subscription") || lower.includes("paid plan") || lower.includes("plan required") || lower.includes("upgrade your plan") || lower.includes("only supports free") || lower.includes("not available on your") || lower.includes("requires a paid"))
|
|
4906
|
+
return "This model requires a paid subscription. Switch to a supported model or upgrade your plan.";
|
|
4907
|
+
if (lower.includes("quota exceeded") || lower.includes("quota limit") || lower.includes("daily limit") || lower.includes("monthly limit") || lower.includes("usage limit"))
|
|
4908
|
+
return "API quota exceeded. Wait for it to reset or check your billing.";
|
|
4901
4909
|
if (lower.includes("overloaded") || lower.includes("503") || lower.includes("service unavailable"))
|
|
4902
4910
|
return "API is overloaded. Will retry automatically.";
|
|
4903
4911
|
if (lower.includes("context_length") || lower.includes("too long") || lower.includes("max tokens") || lower.includes("context window"))
|
|
@@ -4908,11 +4916,12 @@ function classifyCliError(stderr, exitCode) {
|
|
|
4908
4916
|
return "Permission denied. Check file or command permissions.";
|
|
4909
4917
|
if (lower.includes("out of memory") || lower.includes("enomem"))
|
|
4910
4918
|
return "Out of memory. Close other applications and try again.";
|
|
4911
|
-
|
|
4919
|
+
const raw = stderr.trim().slice(0, 200);
|
|
4920
|
+
return raw || `Process exited with code ${exitCode}`;
|
|
4912
4921
|
}
|
|
4913
4922
|
function isTransientError(errorMessage) {
|
|
4914
4923
|
const lower = errorMessage.toLowerCase();
|
|
4915
|
-
return lower.includes("rate limit") || lower.includes("overloaded") || lower.includes("503") || lower.includes("429") || lower.includes("service unavailable") || lower.includes("etimedout") || lower.includes("econnreset") || lower.includes("econnrefused");
|
|
4924
|
+
return lower.includes("rate limit") || lower.includes("overloaded") || lower.includes("503") || lower.includes("429") || lower.includes("service unavailable") || lower.includes("etimedout") || lower.includes("econnreset") || lower.includes("econnrefused") || lower.includes("epipe");
|
|
4916
4925
|
}
|
|
4917
4926
|
function buildPromptWithSystem(config, promptText) {
|
|
4918
4927
|
const parts2 = [
|
|
@@ -5051,6 +5060,7 @@ function createGenericCliBackend(options) {
|
|
|
5051
5060
|
};
|
|
5052
5061
|
state.startHeartbeat = () => {
|
|
5053
5062
|
state.stopHeartbeat?.();
|
|
5063
|
+
void presenter.onActivity?.("background_work");
|
|
5054
5064
|
heartbeatInterval = setInterval(() => {
|
|
5055
5065
|
void presenter.onActivity?.("background_work");
|
|
5056
5066
|
}, 3e4);
|
|
@@ -5299,11 +5309,11 @@ function parseClaudeStructuredLine(line, context, state) {
|
|
|
5299
5309
|
if (state.allowContinuation) {
|
|
5300
5310
|
const continuationResult = {
|
|
5301
5311
|
success: !state.error,
|
|
5302
|
-
summary: state.summary || "",
|
|
5312
|
+
summary: state.summary || state.error || "",
|
|
5303
5313
|
filesModified: [],
|
|
5304
5314
|
planFilesCreated: [],
|
|
5305
5315
|
iterations: Math.max(state.iterations, 1),
|
|
5306
|
-
error: state.error,
|
|
5316
|
+
error: state.error ? classifyCliError(state.error, 0) : void 0,
|
|
5307
5317
|
providerSessionId: state.runtimeSessionId,
|
|
5308
5318
|
runtimeSessionId: state.runtimeSessionId,
|
|
5309
5319
|
backendKind: context.config.backendKind,
|
|
@@ -5490,13 +5500,19 @@ function parseCodexStructuredLine(line, context, state) {
|
|
|
5490
5500
|
}
|
|
5491
5501
|
case "error": {
|
|
5492
5502
|
const message = extractCodexErrorMessage(parsed.message) || extractCodexErrorMessage(parsed.error) || typeof parsed.detail === "string" && parsed.detail.trim() || "";
|
|
5493
|
-
if (message)
|
|
5503
|
+
if (message) {
|
|
5504
|
+
void presenter.onError(message);
|
|
5505
|
+
state.error = message;
|
|
5506
|
+
}
|
|
5494
5507
|
break;
|
|
5495
5508
|
}
|
|
5496
5509
|
case "turn.failed": {
|
|
5497
5510
|
const error = typeof parsed.error === "object" && parsed.error !== null ? parsed.error : {};
|
|
5498
5511
|
const message = extractCodexErrorMessage(error.message) || extractCodexErrorMessage(error.detail) || typeof parsed.message === "string" && parsed.message.trim() || "";
|
|
5499
|
-
if (message)
|
|
5512
|
+
if (message) {
|
|
5513
|
+
void presenter.onError(message);
|
|
5514
|
+
state.error = message;
|
|
5515
|
+
}
|
|
5500
5516
|
break;
|
|
5501
5517
|
}
|
|
5502
5518
|
default:
|
|
@@ -5611,6 +5627,7 @@ function parseCursorStructuredLine(line, context, state) {
|
|
|
5611
5627
|
if (resultText.trim().length > 0) state.summary = resultText;
|
|
5612
5628
|
if ((parsed.is_error === true || subtype === "error") && !state.error) {
|
|
5613
5629
|
state.error = resultText.trim() || "Cursor Agent run failed";
|
|
5630
|
+
void presenter.onError(state.error);
|
|
5614
5631
|
}
|
|
5615
5632
|
break;
|
|
5616
5633
|
}
|
|
@@ -5675,8 +5692,12 @@ function parseGeminiStructuredLine(line, context, state) {
|
|
|
5675
5692
|
const message = typeof parsed.message === "string" && parsed.message.trim() || errObj && typeof errObj.message === "string" && errObj.message.trim() || typeof parsed.error === "string" && parsed.error.trim() || typeof parsed.error_message === "string" && parsed.error_message.trim() || "";
|
|
5676
5693
|
const severity = typeof parsed.severity === "string" ? parsed.severity : "error";
|
|
5677
5694
|
if (message) {
|
|
5678
|
-
|
|
5679
|
-
|
|
5695
|
+
if (severity === "error") {
|
|
5696
|
+
void presenter.onError(message);
|
|
5697
|
+
state.error = message;
|
|
5698
|
+
} else {
|
|
5699
|
+
void presenter.onLog(`[gemini_cli/${severity}] ${message}`);
|
|
5700
|
+
}
|
|
5680
5701
|
}
|
|
5681
5702
|
break;
|
|
5682
5703
|
}
|
|
@@ -6060,9 +6081,14 @@ function parseOpencodeStructuredLine(line, context, state) {
|
|
|
6060
6081
|
case "session.error":
|
|
6061
6082
|
case "error": {
|
|
6062
6083
|
const errObj = typeof parsed.error === "object" && parsed.error !== null ? parsed.error : null;
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6084
|
+
if (!state.error) {
|
|
6085
|
+
console.error("[opencode] error event (raw):", JSON.stringify(parsed).slice(0, 500));
|
|
6086
|
+
}
|
|
6087
|
+
const rawMessage = typeof parsed.message === "string" && parsed.message.trim() || part && typeof part.message === "string" && part.message.trim() || typeof parsed.error === "string" && parsed.error.trim() || errObj && typeof errObj.message === "string" && errObj.message.trim() || part && typeof part.error === "string" && part.error.trim() || // Also try data.message — some opencode versions nest the message here
|
|
6088
|
+
(typeof parsed.data?.message === "string" ? parsed.data.message.trim() : "") || "";
|
|
6089
|
+
const message = rawMessage || "OpenCode encountered an error. Check your provider and model settings.";
|
|
6090
|
+
if (!state.error) {
|
|
6091
|
+
void presenter.onError(message);
|
|
6066
6092
|
state.error = message;
|
|
6067
6093
|
}
|
|
6068
6094
|
const pid = state.process?.pid;
|
|
@@ -10226,7 +10252,7 @@ var WSClient = class {
|
|
|
10226
10252
|
};
|
|
10227
10253
|
|
|
10228
10254
|
// src/version.ts
|
|
10229
|
-
var AGENT_VERSION = "0.1.
|
|
10255
|
+
var AGENT_VERSION = "0.1.5";
|
|
10230
10256
|
|
|
10231
10257
|
// src/sandbox.ts
|
|
10232
10258
|
async function runSandbox(config) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiden-ade/sandbox-agent",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"aiden-agent": "./dist/index.cjs"
|
|
@@ -11,16 +11,15 @@
|
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"access": "public"
|
|
13
13
|
},
|
|
14
|
-
"dependencies": {
|
|
15
|
-
"socket.io-client": "^4.8.0",
|
|
16
|
-
"@aiden/agent-core": "0.1.0",
|
|
17
|
-
"@aiden/shared": "0.1.0"
|
|
18
|
-
},
|
|
14
|
+
"dependencies": {},
|
|
19
15
|
"devDependencies": {
|
|
16
|
+
"socket.io-client": "^4.8.0",
|
|
20
17
|
"@types/node": "^22.0.0",
|
|
21
18
|
"tsup": "^8.5.1",
|
|
22
19
|
"tsx": "^4.19.0",
|
|
23
|
-
"typescript": "~5.9.3"
|
|
20
|
+
"typescript": "~5.9.3",
|
|
21
|
+
"@aiden/agent-core": "0.1.0",
|
|
22
|
+
"@aiden/shared": "0.1.0"
|
|
24
23
|
},
|
|
25
24
|
"scripts": {
|
|
26
25
|
"build": "tsup",
|