@wrongstack/core 0.66.13 → 0.73.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.
- package/dist/{agent-bridge-D-j6OOBT.d.ts → agent-bridge-C0Ze7Ldm.d.ts} +1 -1
- package/dist/{agent-subagent-runner-DRZ9-NnR.d.ts → agent-subagent-runner-BmITbs1Q.d.ts} +13 -5
- package/dist/{config--86aHSln.d.ts → config-Dy0CK_o6.d.ts} +44 -1
- package/dist/coordination/index.d.ts +10 -10
- package/dist/coordination/index.js +188 -210
- package/dist/coordination/index.js.map +1 -1
- package/dist/defaults/index.d.ts +15 -15
- package/dist/defaults/index.js +121 -118
- package/dist/defaults/index.js.map +1 -1
- package/dist/{events-CIplI98R.d.ts → events-BBAlxBuw.d.ts} +8 -0
- package/dist/execution/index.d.ts +8 -8
- package/dist/execution/index.js +69 -99
- package/dist/execution/index.js.map +1 -1
- package/dist/extension/index.d.ts +5 -5
- package/dist/{index-DKUvyTvV.d.ts → index-BN6i2Nfg.d.ts} +4 -4
- package/dist/{index-b5uhfTSl.d.ts → index-yQbZ2NQx.d.ts} +6 -6
- package/dist/index.d.ts +29 -27
- package/dist/index.js +222 -129
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/index.d.ts +4 -4
- package/dist/kernel/index.d.ts +7 -7
- package/dist/kernel/index.js.map +1 -1
- package/dist/{mcp-servers-DwoNBf6r.d.ts → mcp-servers-T0O6UN_w.d.ts} +1 -1
- package/dist/{mode-CV077NjV.d.ts → mode-BO4SEUIv.d.ts} +7 -0
- package/dist/models/index.d.ts +1 -1
- package/dist/models/index.js +18 -9
- package/dist/models/index.js.map +1 -1
- package/dist/{multi-agent-coordinator-CWnH-CiX.d.ts → multi-agent-coordinator-BSBbZt0e.d.ts} +1 -1
- package/dist/{null-fleet-bus-VApKRxcp.d.ts → null-fleet-bus-BCIRT_nV.d.ts} +37 -33
- package/dist/observability/index.d.ts +1 -1
- package/dist/{parallel-eternal-engine-0UwotoSx.d.ts → parallel-eternal-engine-CjAYGaCw.d.ts} +3 -3
- package/dist/{path-resolver-DVkEcIw8.d.ts → path-resolver-BnqXa9Ze.d.ts} +1 -1
- package/dist/{permission-C1A5whY5.d.ts → permission-V5BLOrY6.d.ts} +0 -4
- package/dist/{permission-policy-B2dK-T5N.d.ts → permission-policy-CBVx-d-8.d.ts} +1 -5
- package/dist/{plan-templates-Bprrzhbu.d.ts → plan-templates-DBgrTGPu.d.ts} +2 -2
- package/dist/{provider-runner-mXvXGSIw.d.ts → provider-runner-n3KkHT_w.d.ts} +1 -1
- package/dist/sdd/index.d.ts +6 -6
- package/dist/sdd/index.js +68 -98
- package/dist/sdd/index.js.map +1 -1
- package/dist/security/index.d.ts +2 -2
- package/dist/security/index.js +0 -8
- package/dist/security/index.js.map +1 -1
- package/dist/skills/index.js +1 -0
- package/dist/skills/index.js.map +1 -1
- package/dist/storage/index.d.ts +3 -3
- package/dist/storage/index.js +26 -2
- package/dist/storage/index.js.map +1 -1
- package/dist/{system-prompt-b61lOd49.d.ts → system-prompt-CA11g6Jo.d.ts} +1 -1
- package/dist/types/index.d.ts +13 -13
- package/dist/types/index.js +19 -10
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +2 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
package/dist/sdd/index.js
CHANGED
|
@@ -3197,6 +3197,71 @@ function providerStatusToCode(status, type) {
|
|
|
3197
3197
|
return ERROR_CODES.PROVIDER_INVALID_REQUEST;
|
|
3198
3198
|
}
|
|
3199
3199
|
|
|
3200
|
+
// src/coordination/coordinator/error-classifier.ts
|
|
3201
|
+
function classifySubagentError(err, hints = {}) {
|
|
3202
|
+
const cause = err instanceof Error ? { name: err.name, message: err.message, stack: err.stack } : void 0;
|
|
3203
|
+
if (err instanceof ProviderError) {
|
|
3204
|
+
const baseMessage2 = err.describe();
|
|
3205
|
+
return providerErrorToSubagentError(err, baseMessage2, cause);
|
|
3206
|
+
}
|
|
3207
|
+
const baseMessage = err instanceof Error ? err.message : String(err);
|
|
3208
|
+
if (err instanceof BudgetExceededError) {
|
|
3209
|
+
const map = {
|
|
3210
|
+
iterations: "budget_iterations",
|
|
3211
|
+
tool_calls: "budget_tool_calls",
|
|
3212
|
+
tokens: "budget_tokens",
|
|
3213
|
+
cost: "budget_cost",
|
|
3214
|
+
timeout: "budget_timeout",
|
|
3215
|
+
idle_timeout: "budget_timeout"
|
|
3216
|
+
};
|
|
3217
|
+
return {
|
|
3218
|
+
kind: map[err.kind],
|
|
3219
|
+
message: baseMessage,
|
|
3220
|
+
retryable: false,
|
|
3221
|
+
cause
|
|
3222
|
+
};
|
|
3223
|
+
}
|
|
3224
|
+
if (hints.parentAborted) {
|
|
3225
|
+
return { kind: "aborted_by_parent", message: baseMessage, retryable: false, cause };
|
|
3226
|
+
}
|
|
3227
|
+
const lower = baseMessage.toLowerCase();
|
|
3228
|
+
if (/agent aborted$/i.test(baseMessage)) {
|
|
3229
|
+
return { kind: "aborted_by_parent", message: baseMessage, retryable: false, cause };
|
|
3230
|
+
}
|
|
3231
|
+
if (/agent exhausted iteration limit$/i.test(baseMessage)) {
|
|
3232
|
+
return { kind: "budget_iterations", message: baseMessage, retryable: false, cause };
|
|
3233
|
+
}
|
|
3234
|
+
if (/empty response$/i.test(baseMessage)) {
|
|
3235
|
+
return { kind: "empty_response", message: baseMessage, retryable: false, cause };
|
|
3236
|
+
}
|
|
3237
|
+
if (/^tool failed: /i.test(baseMessage)) {
|
|
3238
|
+
return { kind: "tool_failed", message: baseMessage, retryable: false, cause };
|
|
3239
|
+
}
|
|
3240
|
+
if (lower.includes("bridge transport") || /bridge.*(closed|disconnect)/i.test(baseMessage)) {
|
|
3241
|
+
return { kind: "bridge_failed", message: baseMessage, retryable: false, cause };
|
|
3242
|
+
}
|
|
3243
|
+
if (/context length|max.*tokens?.*exceeded|prompt is too long/i.test(baseMessage)) {
|
|
3244
|
+
return { kind: "context_overflow", message: baseMessage, retryable: false, cause };
|
|
3245
|
+
}
|
|
3246
|
+
return { kind: "unknown", message: baseMessage, retryable: false, cause };
|
|
3247
|
+
}
|
|
3248
|
+
function providerErrorToSubagentError(err, message, cause) {
|
|
3249
|
+
const status = err.status;
|
|
3250
|
+
if (status === 429 || err.body?.type === "rate_limit_error") {
|
|
3251
|
+
return { kind: "provider_rate_limit", message, retryable: true, backoffMs: 5e3, cause };
|
|
3252
|
+
}
|
|
3253
|
+
if (status === 401 || status === 403 || err.body?.type === "authentication_error") {
|
|
3254
|
+
return { kind: "provider_auth", message, retryable: false, cause };
|
|
3255
|
+
}
|
|
3256
|
+
if (status === 408 || status === 0) {
|
|
3257
|
+
return { kind: "provider_timeout", message, retryable: true, cause };
|
|
3258
|
+
}
|
|
3259
|
+
if (status >= 500 && status < 600) {
|
|
3260
|
+
return { kind: "provider_5xx", message, retryable: true, backoffMs: 3e3, cause };
|
|
3261
|
+
}
|
|
3262
|
+
return { kind: "unknown", message, retryable: err.retryable, cause };
|
|
3263
|
+
}
|
|
3264
|
+
|
|
3200
3265
|
// src/coordination/agents/types.ts
|
|
3201
3266
|
var HOUR = 60 * 60 * 1e3;
|
|
3202
3267
|
var LIGHT_BUDGET = {
|
|
@@ -5653,7 +5718,7 @@ var DefaultMultiAgentCoordinator = class _DefaultMultiAgentCoordinator extends E
|
|
|
5653
5718
|
}
|
|
5654
5719
|
async spawn(subagent) {
|
|
5655
5720
|
const id = subagent.id || randomUUID();
|
|
5656
|
-
|
|
5721
|
+
const cfg = this.withNickname(subagent, id);
|
|
5657
5722
|
if (this.subagents.has(id)) {
|
|
5658
5723
|
throw new Error(`Subagent id "${id}" already exists \u2014 refusing to overwrite`);
|
|
5659
5724
|
}
|
|
@@ -5668,12 +5733,12 @@ var DefaultMultiAgentCoordinator = class _DefaultMultiAgentCoordinator extends E
|
|
|
5668
5733
|
maxConcurrent: this.config.maxConcurrent ?? 16
|
|
5669
5734
|
};
|
|
5670
5735
|
this.subagents.set(id, {
|
|
5671
|
-
config: { ...
|
|
5736
|
+
config: { ...cfg, id },
|
|
5672
5737
|
context,
|
|
5673
5738
|
status: "idle",
|
|
5674
5739
|
abortController: new AbortController()
|
|
5675
5740
|
});
|
|
5676
|
-
this.emit("subagent.started", { subagent: { ...
|
|
5741
|
+
this.emit("subagent.started", { subagent: { ...cfg, id } });
|
|
5677
5742
|
this.fleetBus?.emit({
|
|
5678
5743
|
subagentId: id,
|
|
5679
5744
|
ts: Date.now(),
|
|
@@ -6210,101 +6275,6 @@ var DefaultMultiAgentCoordinator = class _DefaultMultiAgentCoordinator extends E
|
|
|
6210
6275
|
return false;
|
|
6211
6276
|
}
|
|
6212
6277
|
};
|
|
6213
|
-
function classifySubagentError(err, hints = {}) {
|
|
6214
|
-
const cause = err instanceof Error ? { name: err.name, message: err.message, stack: err.stack } : void 0;
|
|
6215
|
-
if (err instanceof ProviderError) {
|
|
6216
|
-
const baseMessage2 = err.describe();
|
|
6217
|
-
return providerErrorToSubagentError(err, baseMessage2, cause);
|
|
6218
|
-
}
|
|
6219
|
-
const baseMessage = err instanceof Error ? err.message : String(err);
|
|
6220
|
-
if (err instanceof BudgetExceededError) {
|
|
6221
|
-
const map = {
|
|
6222
|
-
iterations: "budget_iterations",
|
|
6223
|
-
tool_calls: "budget_tool_calls",
|
|
6224
|
-
tokens: "budget_tokens",
|
|
6225
|
-
cost: "budget_cost",
|
|
6226
|
-
timeout: "budget_timeout",
|
|
6227
|
-
idle_timeout: "budget_timeout"
|
|
6228
|
-
};
|
|
6229
|
-
return {
|
|
6230
|
-
kind: map[err.kind],
|
|
6231
|
-
message: baseMessage,
|
|
6232
|
-
// Budgets are user-configured ceilings, not transient failures —
|
|
6233
|
-
// retrying with the same budget will hit the same ceiling. The
|
|
6234
|
-
// orchestrator must raise the budget or narrow the task first.
|
|
6235
|
-
retryable: false,
|
|
6236
|
-
cause
|
|
6237
|
-
};
|
|
6238
|
-
}
|
|
6239
|
-
if (hints.parentAborted) {
|
|
6240
|
-
return {
|
|
6241
|
-
kind: "aborted_by_parent",
|
|
6242
|
-
message: baseMessage,
|
|
6243
|
-
retryable: false,
|
|
6244
|
-
cause
|
|
6245
|
-
};
|
|
6246
|
-
}
|
|
6247
|
-
const lower = baseMessage.toLowerCase();
|
|
6248
|
-
if (/agent aborted$/i.test(baseMessage)) {
|
|
6249
|
-
return {
|
|
6250
|
-
kind: "aborted_by_parent",
|
|
6251
|
-
message: baseMessage,
|
|
6252
|
-
retryable: false,
|
|
6253
|
-
cause
|
|
6254
|
-
};
|
|
6255
|
-
}
|
|
6256
|
-
if (/agent exhausted iteration limit$/i.test(baseMessage)) {
|
|
6257
|
-
return { kind: "budget_iterations", message: baseMessage, retryable: false, cause };
|
|
6258
|
-
}
|
|
6259
|
-
if (/empty response$/i.test(baseMessage)) {
|
|
6260
|
-
return { kind: "empty_response", message: baseMessage, retryable: false, cause };
|
|
6261
|
-
}
|
|
6262
|
-
if (/^tool failed: /i.test(baseMessage)) {
|
|
6263
|
-
return { kind: "tool_failed", message: baseMessage, retryable: false, cause };
|
|
6264
|
-
}
|
|
6265
|
-
if (lower.includes("bridge transport") || /bridge.*(closed|disconnect)/i.test(baseMessage)) {
|
|
6266
|
-
return { kind: "bridge_failed", message: baseMessage, retryable: false, cause };
|
|
6267
|
-
}
|
|
6268
|
-
if (/context length|max.*tokens?.*exceeded|prompt is too long/i.test(baseMessage)) {
|
|
6269
|
-
return { kind: "context_overflow", message: baseMessage, retryable: false, cause };
|
|
6270
|
-
}
|
|
6271
|
-
return {
|
|
6272
|
-
kind: "unknown",
|
|
6273
|
-
message: baseMessage,
|
|
6274
|
-
retryable: false,
|
|
6275
|
-
cause
|
|
6276
|
-
};
|
|
6277
|
-
}
|
|
6278
|
-
function providerErrorToSubagentError(err, message, cause) {
|
|
6279
|
-
const status = err.status;
|
|
6280
|
-
if (status === 429 || err.body?.type === "rate_limit_error") {
|
|
6281
|
-
return {
|
|
6282
|
-
kind: "provider_rate_limit",
|
|
6283
|
-
message,
|
|
6284
|
-
retryable: true,
|
|
6285
|
-
// Conservative default: 5s. Provider-specific code can override
|
|
6286
|
-
// by emitting an error whose body carries an explicit hint.
|
|
6287
|
-
backoffMs: 5e3,
|
|
6288
|
-
cause
|
|
6289
|
-
};
|
|
6290
|
-
}
|
|
6291
|
-
if (status === 401 || status === 403 || err.body?.type === "authentication_error") {
|
|
6292
|
-
return { kind: "provider_auth", message, retryable: false, cause };
|
|
6293
|
-
}
|
|
6294
|
-
if (status === 408 || status === 0) {
|
|
6295
|
-
return { kind: "provider_timeout", message, retryable: true, cause };
|
|
6296
|
-
}
|
|
6297
|
-
if (status >= 500 && status < 600) {
|
|
6298
|
-
return {
|
|
6299
|
-
kind: "provider_5xx",
|
|
6300
|
-
message,
|
|
6301
|
-
retryable: true,
|
|
6302
|
-
backoffMs: 3e3,
|
|
6303
|
-
cause
|
|
6304
|
-
};
|
|
6305
|
-
}
|
|
6306
|
-
return { kind: "unknown", message, retryable: err.retryable, cause };
|
|
6307
|
-
}
|
|
6308
6278
|
|
|
6309
6279
|
// src/sdd/sdd-parallel-run.ts
|
|
6310
6280
|
var SddParallelRun = class {
|