@wrongstack/core 0.283.1 → 0.284.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/{compactor-BxddyCFu.d.ts → compactor-DQLL4HTo.d.ts} +1 -1
- package/dist/{config-DkCbA3Bw.d.ts → config-MRqn1V-u.d.ts} +130 -22
- package/dist/coordination/index.d.ts +43 -20
- package/dist/coordination/index.js +1744 -912
- package/dist/coordination/index.js.map +1 -1
- package/dist/{default-config-Buho8yge.d.ts → default-config-B79_gJYv.d.ts} +7 -0
- package/dist/defaults/index.d.ts +25 -29
- package/dist/defaults/index.js +2546 -7396
- package/dist/defaults/index.js.map +1 -1
- package/dist/{director-state-B_GPa78Q.d.ts → director-state-CMS_bMs4.d.ts} +2 -0
- package/dist/{events-KmxSmvho.d.ts → events-Bgnh43r9.d.ts} +27 -10
- package/dist/execution/index.d.ts +15 -16
- package/dist/execution/index.js +534 -140
- package/dist/execution/index.js.map +1 -1
- package/dist/execution/prompt-enhancer.d.ts +1 -1
- package/dist/extension/index.d.ts +6 -6
- package/dist/{global-mailbox-rWVt8YlO.d.ts → global-mailbox-sZwyI6CS.d.ts} +13 -2
- package/dist/{goal-store-8owBXJT2.d.ts → goal-store-Datpp-ar.d.ts} +1 -1
- package/dist/hq/index.d.ts +6 -6
- package/dist/hq/index.js +58 -7
- package/dist/hq/index.js.map +1 -1
- package/dist/{index-BhCteHAF.d.ts → index--Gm41aBJ.d.ts} +26 -11
- package/dist/{index-BEFWNZYs.d.ts → index-CbyuOE5y.d.ts} +5 -1
- package/dist/index.d.ts +50 -1015
- package/dist/index.js +21028 -27775
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/index.d.ts +9 -7
- package/dist/infrastructure/index.js +7 -2
- package/dist/infrastructure/index.js.map +1 -1
- package/dist/kernel/index.d.ts +11 -11
- package/dist/kernel/index.js.map +1 -1
- package/dist/{mcp-servers-BUx9A_AQ.d.ts → mcp-servers-DEV4s6Ks.d.ts} +3 -3
- package/dist/models/index.d.ts +4 -4
- package/dist/models/index.js +18 -3
- package/dist/models/index.js.map +1 -1
- package/dist/{agent-subagent-runner-BsuWhB28.d.ts → multi-agent-coordinator-4RCRZKjN.d.ts} +417 -9
- package/dist/{null-fleet-bus-D4e9R7Qc.d.ts → null-fleet-bus-CFoNVQEK.d.ts} +53 -12
- package/dist/observability/index.d.ts +3 -3
- package/dist/{parallel-eternal-engine-iY2uxocj.d.ts → parallel-eternal-engine-HUrtePLd.d.ts} +4 -5
- package/dist/{permission-B6YAtNFz.d.ts → permission-ByDKXEcG.d.ts} +1 -1
- package/dist/{pipeline-ixSFe5jg.d.ts → pipeline-DGDyIohT.d.ts} +28 -7
- package/dist/{provider-model-resolve-DIxKL_T-.d.ts → provider-model-resolve-o2hHLs79.d.ts} +3 -3
- package/dist/{provider-runner-oQhDaZmH.d.ts → provider-runner-ChL-kVg6.d.ts} +3 -3
- package/dist/{retry-policy-V67lBOJz.d.ts → retry-policy-CQ7KwXJa.d.ts} +2 -2
- package/dist/{secret-vault-D7jeyXUQ.d.ts → secret-vault-DxohkUBc.d.ts} +3 -2
- package/dist/security/index.d.ts +4 -4
- package/dist/security/index.js +232 -2
- package/dist/security/index.js.map +1 -1
- package/dist/{selector-Bx2HgUkU.d.ts → selector-D8O6B_Rm.d.ts} +1 -1
- package/dist/{session-event-bridge-Bkp7ORfc.d.ts → session-event-bridge-D_z_mBwk.d.ts} +3 -3
- package/dist/{session-reader-B-Fi9L6I.d.ts → session-reader-7Esxrkpw.d.ts} +1 -1
- package/dist/storage/index.d.ts +77 -39
- package/dist/storage/index.js +1223 -288
- package/dist/storage/index.js.map +1 -1
- package/dist/tasking/index.d.ts +124 -0
- package/dist/tasking/index.js +492 -0
- package/dist/tasking/index.js.map +1 -0
- package/dist/{todos-checkpoint-BwCrj4Cb.d.ts → todos-checkpoint-FY7PjmMx.d.ts} +13 -4
- package/dist/{tool-LVSLiE1s.d.ts → tool-BNlnIJvo.d.ts} +216 -17
- package/dist/{tool-executor-kElSEgO0.d.ts → tool-executor-CckSCM5E.d.ts} +12 -15
- package/dist/tools/index.d.ts +2 -2
- package/dist/tools/index.js.map +1 -1
- package/dist/types/index.d.ts +94 -19
- package/dist/types/index.js +76 -12
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +44 -10
- package/dist/utils/index.js +106 -17
- package/dist/utils/index.js.map +1 -1
- package/dist/{worktree-manager-BjyAW30D.d.ts → worktree-manager-DzwxKE35.d.ts} +1 -1
- package/instructions/coordination/subagent-baseline.md +5 -0
- package/instructions/llm/autonomy-brain.md +3 -2
- package/instructions/system.md +4 -0
- package/package.json +10 -3
- package/dist/multi-agent-coordinator-CrjeTB9i.d.ts +0 -357
- package/dist/sdd/index.d.ts +0 -1993
- package/dist/sdd/index.js +0 -9500
- package/dist/sdd/index.js.map +0 -1
- package/dist/spec-TBi3Jr6T.d.ts +0 -78
package/dist/types/index.js
CHANGED
|
@@ -385,15 +385,58 @@ function isSddError(err) {
|
|
|
385
385
|
}
|
|
386
386
|
|
|
387
387
|
// src/types/provider.ts
|
|
388
|
+
function effectiveInputTokens(usage) {
|
|
389
|
+
return usage.input + (usage.cacheRead ?? 0) + (usage.cacheWrite ?? 0);
|
|
390
|
+
}
|
|
391
|
+
var CONTEXT_OVERFLOW_RE = /context.length|context.window|max.*tokens?.*exceeded|prompt is too long|too long|exceeds the context|\btokens\b.*exceed|context_length_exceeded/i;
|
|
392
|
+
var CONTENT_FILTER_RE = /content.(filter|policy|moderation)|safety (system|filter)/i;
|
|
393
|
+
function classifyProviderError(status, body, message) {
|
|
394
|
+
const type = body?.type;
|
|
395
|
+
if (status === 0) return "network";
|
|
396
|
+
if (status === 408) return "timeout";
|
|
397
|
+
if (status === 599) return "stream_hang";
|
|
398
|
+
if (type === "rate_limit_error" || status === 429) return "rate_limit";
|
|
399
|
+
if (type === "overloaded_error" || status === 529) return "overloaded";
|
|
400
|
+
if (status >= 500) return "server";
|
|
401
|
+
if (type === "authentication_error" || type === "permission_error" || status === 401 || status === 403) {
|
|
402
|
+
return "auth";
|
|
403
|
+
}
|
|
404
|
+
const text = [message, body?.message, type, body?.raw].filter(Boolean).join("\n");
|
|
405
|
+
if (type === "content_filter" || CONTENT_FILTER_RE.test(text)) return "content_filter";
|
|
406
|
+
if (status === 413 || status >= 400 && CONTEXT_OVERFLOW_RE.test(text)) {
|
|
407
|
+
return "context_overflow";
|
|
408
|
+
}
|
|
409
|
+
if (status >= 400) return "invalid_request";
|
|
410
|
+
return "unknown";
|
|
411
|
+
}
|
|
412
|
+
function isRetryableKind(kind) {
|
|
413
|
+
return RETRYABLE_BY_KIND[kind];
|
|
414
|
+
}
|
|
415
|
+
var RETRYABLE_BY_KIND = {
|
|
416
|
+
rate_limit: true,
|
|
417
|
+
overloaded: true,
|
|
418
|
+
server: true,
|
|
419
|
+
timeout: true,
|
|
420
|
+
network: true,
|
|
421
|
+
stream_hang: true,
|
|
422
|
+
auth: false,
|
|
423
|
+
context_overflow: false,
|
|
424
|
+
content_filter: false,
|
|
425
|
+
invalid_request: false,
|
|
426
|
+
unknown: false
|
|
427
|
+
};
|
|
388
428
|
var ProviderError = class extends WrongStackError {
|
|
389
429
|
status;
|
|
390
430
|
retryable;
|
|
391
431
|
providerId;
|
|
432
|
+
/** Canonical failure classification — see {@link ProviderErrorKind}. */
|
|
433
|
+
kind;
|
|
392
434
|
body;
|
|
393
435
|
constructor(message, status, retryable, providerId, opts = {}) {
|
|
436
|
+
const kind = opts.kind ?? classifyProviderError(status, opts.body, message);
|
|
394
437
|
super({
|
|
395
438
|
message,
|
|
396
|
-
code:
|
|
439
|
+
code: kindToCode(kind),
|
|
397
440
|
subsystem: "provider",
|
|
398
441
|
severity: status >= 500 ? "error" : "warning",
|
|
399
442
|
recoverable: retryable,
|
|
@@ -404,6 +447,7 @@ var ProviderError = class extends WrongStackError {
|
|
|
404
447
|
this.status = status;
|
|
405
448
|
this.retryable = retryable;
|
|
406
449
|
this.providerId = providerId;
|
|
450
|
+
this.kind = kind;
|
|
407
451
|
this.body = opts.body;
|
|
408
452
|
}
|
|
409
453
|
/**
|
|
@@ -431,11 +475,13 @@ var ProviderError = class extends WrongStackError {
|
|
|
431
475
|
};
|
|
432
476
|
function describeStatus(status, type) {
|
|
433
477
|
if (status === 0) return "network error";
|
|
478
|
+
if (status === 599) return `stream hang (${status})`;
|
|
434
479
|
if (type === "overloaded_error" || status === 529) return `overloaded (${status})`;
|
|
435
480
|
if (type === "rate_limit_error" || status === 429) return `rate limited (${status})`;
|
|
436
481
|
if (type === "authentication_error" || status === 401) return `auth failed (${status})`;
|
|
437
482
|
if (type === "permission_error" || status === 403) return `forbidden (${status})`;
|
|
438
483
|
if (type === "not_found_error" || status === 404) return `not found (${status})`;
|
|
484
|
+
if (type === "content_filter") return `content filtered (${status})`;
|
|
439
485
|
if (type === "invalid_request_error" || status === 400) return `invalid request (${status})`;
|
|
440
486
|
if (status === 408) return `timeout (${status})`;
|
|
441
487
|
if (status >= 500 && status < 600) return `HTTP ${status} (server error)`;
|
|
@@ -475,15 +521,21 @@ var StreamHangError = class extends ProviderError {
|
|
|
475
521
|
this.elapsedMs = opts.elapsedMs;
|
|
476
522
|
}
|
|
477
523
|
};
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
524
|
+
var KIND_TO_CODE = {
|
|
525
|
+
network: ERROR_CODES.PROVIDER_NETWORK_ERROR,
|
|
526
|
+
timeout: ERROR_CODES.PROVIDER_NETWORK_ERROR,
|
|
527
|
+
rate_limit: ERROR_CODES.PROVIDER_RATE_LIMITED,
|
|
528
|
+
auth: ERROR_CODES.PROVIDER_AUTH_FAILED,
|
|
529
|
+
overloaded: ERROR_CODES.PROVIDER_OVERLOADED,
|
|
530
|
+
context_overflow: ERROR_CODES.PROVIDER_CONTEXT_OVERFLOW,
|
|
531
|
+
server: ERROR_CODES.PROVIDER_SERVER_ERROR,
|
|
532
|
+
stream_hang: ERROR_CODES.PROVIDER_SERVER_ERROR,
|
|
533
|
+
content_filter: ERROR_CODES.PROVIDER_INVALID_REQUEST,
|
|
534
|
+
invalid_request: ERROR_CODES.PROVIDER_INVALID_REQUEST,
|
|
535
|
+
unknown: ERROR_CODES.PROVIDER_INVALID_REQUEST
|
|
536
|
+
};
|
|
537
|
+
function kindToCode(kind) {
|
|
538
|
+
return KIND_TO_CODE[kind];
|
|
487
539
|
}
|
|
488
540
|
|
|
489
541
|
// src/types/config.ts
|
|
@@ -516,7 +568,14 @@ var DEFAULT_TOOLS_CONFIG = Object.freeze({
|
|
|
516
568
|
descriptionMode: Object.freeze({}),
|
|
517
569
|
disabledTools: Object.freeze([]),
|
|
518
570
|
autoExtendLimit: true,
|
|
519
|
-
restrictToProjectRoot: false
|
|
571
|
+
restrictToProjectRoot: false,
|
|
572
|
+
loopDetection: Object.freeze({
|
|
573
|
+
mode: "steer-then-cut",
|
|
574
|
+
steerThreshold: 3,
|
|
575
|
+
cutThreshold: 5,
|
|
576
|
+
windowSize: 12,
|
|
577
|
+
callRepeatThreshold: 4
|
|
578
|
+
})
|
|
520
579
|
});
|
|
521
580
|
var DEFAULT_CONTEXT_CONFIG = Object.freeze({
|
|
522
581
|
preserveK: 10,
|
|
@@ -674,6 +733,11 @@ var DESIGN_STACKS = ["web", "react-native", "flutter", "swiftui", "compose"];
|
|
|
674
733
|
function isDesignStack(v) {
|
|
675
734
|
return DESIGN_STACKS.includes(v);
|
|
676
735
|
}
|
|
736
|
+
|
|
737
|
+
// src/types/system-prompt.ts
|
|
738
|
+
function flattenSystemPromptRegions(regions) {
|
|
739
|
+
return [...regions.core, ...regions.session, ...regions.volatile];
|
|
740
|
+
}
|
|
677
741
|
function modePrompt(id) {
|
|
678
742
|
for (const dir of modePromptDirCandidates()) {
|
|
679
743
|
try {
|
|
@@ -1450,6 +1514,6 @@ function renderPlainText(meta, events) {
|
|
|
1450
1514
|
return lines.join("\n");
|
|
1451
1515
|
}
|
|
1452
1516
|
|
|
1453
|
-
export { AgentError, BUILTIN_PROMPT_CATEGORIES, CONTEXT_WINDOW_MODES, ConfigError, DEFAULT_AUTONOMY_CONFIG, DEFAULT_CIRCUIT_BREAKER_CONFIG, DEFAULT_CONTEXT_CONFIG, DEFAULT_CONTEXT_WINDOW_MODE_ID, DEFAULT_MODES, DEFAULT_SESSION_LOGGING_CONFIG, DEFAULT_SESSION_PRUNE_DAYS, DEFAULT_SPEC_TEMPLATE, DEFAULT_TOOLS_CONFIG, DEFAULT_TUI_THINKING_WORD, DESIGN_STACKS, DefaultSessionReader, ERROR_CODES, FetchError, FsError, MALFORMED_ARG_MARKERS, MAX_TUI_THINKING_WORD_LENGTH, MEMORY_TYPE_LABELS, PROMPT_CATEGORY_LABELS, ParseError, PluginError, ProviderError, SddError, SessionError, StreamHangError, ToolError, ToolErrorCategory, ToolValidationError, WrongStackError, computeTaskProgress, deserializeTaskGraph, diffRegistry, findCriticalPath, formatContextWindowModeList, getContextWindowMode, isAgentError, isBuiltinCategory, isConfigError, isContextWindowModeId, isDesignStack, isFetchError, isFsError, isImageBlock, isParseError, isPluginError, isSddError, isSessionError, isTextBlock, isToolError, isToolResultBlock, isToolUseBlock, isToolValidationError, isWrongStackError, listContextWindowModes, normalizeTokenSavingTier, normalizeTuiThinkingWord, resolveContextWindowPolicy, serializeTaskGraph, toWrongStackError, topologicalSort, validateRegistryManifest };
|
|
1517
|
+
export { AgentError, BUILTIN_PROMPT_CATEGORIES, CONTEXT_WINDOW_MODES, ConfigError, DEFAULT_AUTONOMY_CONFIG, DEFAULT_CIRCUIT_BREAKER_CONFIG, DEFAULT_CONTEXT_CONFIG, DEFAULT_CONTEXT_WINDOW_MODE_ID, DEFAULT_MODES, DEFAULT_SESSION_LOGGING_CONFIG, DEFAULT_SESSION_PRUNE_DAYS, DEFAULT_SPEC_TEMPLATE, DEFAULT_TOOLS_CONFIG, DEFAULT_TUI_THINKING_WORD, DESIGN_STACKS, DefaultSessionReader, ERROR_CODES, FetchError, FsError, MALFORMED_ARG_MARKERS, MAX_TUI_THINKING_WORD_LENGTH, MEMORY_TYPE_LABELS, PROMPT_CATEGORY_LABELS, ParseError, PluginError, ProviderError, SddError, SessionError, StreamHangError, ToolError, ToolErrorCategory, ToolValidationError, WrongStackError, classifyProviderError, computeTaskProgress, deserializeTaskGraph, diffRegistry, effectiveInputTokens, findCriticalPath, flattenSystemPromptRegions, formatContextWindowModeList, getContextWindowMode, isAgentError, isBuiltinCategory, isConfigError, isContextWindowModeId, isDesignStack, isFetchError, isFsError, isImageBlock, isParseError, isPluginError, isRetryableKind, isSddError, isSessionError, isTextBlock, isToolError, isToolResultBlock, isToolUseBlock, isToolValidationError, isWrongStackError, listContextWindowModes, normalizeTokenSavingTier, normalizeTuiThinkingWord, resolveContextWindowPolicy, serializeTaskGraph, toWrongStackError, topologicalSort, validateRegistryManifest };
|
|
1454
1518
|
//# sourceMappingURL=index.js.map
|
|
1455
1519
|
//# sourceMappingURL=index.js.map
|