@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/defaults/index.d.ts
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
export { D as DefaultLogger, a as DefaultLoggerOptions } from '../logger-bOzkF5LL.js';
|
|
2
|
-
export { A as AbandonedSession, a as AttachmentStoreOptions, C as ConfigLoaderOptions, b as ConfigMigration, c as ConfigMigrationError, d as ConfigSource, D as DEFAULT_CONFIG_MIGRATIONS, e as DefaultAttachmentStore, f as DefaultConfigLoader, g as DefaultConfigStore, h as DefaultMemoryStore, i as DefaultSessionStore, M as MemoryStoreOptions, j as MigrationContext, k as MigrationResult, P as PersistedQueueItem, l as PlanFile, m as PlanItem, n as PlanTemplate, Q as QueueStore, R as RecoveryLock, o as RecoveryLockOptions, S as SessionAnalyzer, p as SessionStoreOptions, T as TodosCheckpointFile, q as addPlanItem, r as attachPlanCheckpoint, s as attachTodosCheckpoint, t as clearPlan, u as deriveTodosFromPlanItem, v as emptyPlan, w as formatPlan, x as formatPlanTemplates, y as getPlanTemplate, z as listPlanTemplates, B as loadPlan, E as loadTodosCheckpoint, F as removePlanItem, G as runConfigMigrations, H as savePlan, I as saveTodosCheckpoint, J as setPlanItemStatus } from '../plan-templates-
|
|
2
|
+
export { A as AbandonedSession, a as AttachmentStoreOptions, C as ConfigLoaderOptions, b as ConfigMigration, c as ConfigMigrationError, d as ConfigSource, D as DEFAULT_CONFIG_MIGRATIONS, e as DefaultAttachmentStore, f as DefaultConfigLoader, g as DefaultConfigStore, h as DefaultMemoryStore, i as DefaultSessionStore, M as MemoryStoreOptions, j as MigrationContext, k as MigrationResult, P as PersistedQueueItem, l as PlanFile, m as PlanItem, n as PlanTemplate, Q as QueueStore, R as RecoveryLock, o as RecoveryLockOptions, S as SessionAnalyzer, p as SessionStoreOptions, T as TodosCheckpointFile, q as addPlanItem, r as attachPlanCheckpoint, s as attachTodosCheckpoint, t as clearPlan, u as deriveTodosFromPlanItem, v as emptyPlan, w as formatPlan, x as formatPlanTemplates, y as getPlanTemplate, z as listPlanTemplates, B as loadPlan, E as loadTodosCheckpoint, F as removePlanItem, G as runConfigMigrations, H as savePlan, I as saveTodosCheckpoint, J as setPlanItemStatus } from '../plan-templates-DBgrTGPu.js';
|
|
3
3
|
export { D as DefaultSessionReader } from '../session-reader-BIpwM60D.js';
|
|
4
4
|
export { A as AuditLevel, a as SessionEventBridge, b as SessionEventBridgeOptions, c as SessionSamplingOptions, T as ToolProgressSamplingOptions, d as createSessionEventBridge, r as resolveAuditLevel, e as resolveSessionLoggingConfig } from '../session-event-bridge-CDHxcmQU.js';
|
|
5
5
|
export { D as DirectorStateCheckpoint, a as DirectorStateSnapshot, b as DirectorSubagentState, c as DirectorTaskState, l as loadDirectorState } from '../director-state-BmYi3DGA.js';
|
|
6
6
|
export { D as DefaultSecretScrubber, a as DefaultSecretVault, S as SecretVaultOptions, d as decryptConfigSecrets, e as encryptConfigSecrets, m as migratePlaintextSecrets, r as rewriteConfigEncrypted } from '../secret-scrubber-7rSC_emZ.js';
|
|
7
|
-
export { A as AutoApprovePermissionPolicy, D as DefaultPermissionPolicy, P as PermissionPolicyOptions } from '../permission-policy-
|
|
8
|
-
export { C as CompactorOptions, a as DefaultErrorHandler, b as DefaultRetryPolicy, E as EternalAutonomyEngine, c as EternalAutonomyOptions, d as EternalEngineState, H as HybridCompactor, I as IterationStage, P as ParallelEngineState, e as ParallelEternalEngine, f as ParallelEternalOptions, g as ParallelIterationStage, T as ToolExecutor } from '../parallel-eternal-engine-
|
|
7
|
+
export { A as AutoApprovePermissionPolicy, D as DefaultPermissionPolicy, P as PermissionPolicyOptions } from '../permission-policy-CBVx-d-8.js';
|
|
8
|
+
export { C as CompactorOptions, a as DefaultErrorHandler, b as DefaultRetryPolicy, E as EternalAutonomyEngine, c as EternalAutonomyOptions, d as EternalEngineState, H as HybridCompactor, I as IterationStage, P as ParallelEngineState, e as ParallelEternalEngine, f as ParallelEternalOptions, g as ParallelIterationStage, T as ToolExecutor } from '../parallel-eternal-engine-CjAYGaCw.js';
|
|
9
9
|
export { AutoCompactionMiddleware, AutonomousRunner, AutonomousRunnerOptions, AutonomyPromptContributorOptions, DefaultSkillLoader, DoneCheckResult, DoneConditionChecker, IntelligentCompactor, IntelligentCompactorOptions, SelectiveCompactor, SelectiveCompactorOptions, SkillLoaderOptions, buildGoalPreamble, makeAutonomyPromptContributor } from '../execution/index.js';
|
|
10
|
-
import { P as ProviderRunner, R as RunProviderOptions } from '../provider-runner-
|
|
10
|
+
import { P as ProviderRunner, R as RunProviderOptions } from '../provider-runner-n3KkHT_w.js';
|
|
11
11
|
import { q as Response } from '../context-y87Jc5ei.js';
|
|
12
|
-
export { a as AGENTS_BY_PHASE, b as AGENT_CATALOG, c as ALL_AGENT_DEFINITIONS, d as ALL_FLEET_AGENTS, e as AUDIT_LOG_AGENT, f as AutoExtendCeiling, g as AutoExtendPolicy, B as BUG_HUNTER_AGENT, n as CreateDelegateToolOptions, D as DEFAULT_DIRECTOR_PREAMBLE, q as DEFAULT_SUBAGENT_BASELINE, r as DelegateHost, s as Director, w as DirectorPromptParts, x as DirectorSessionFactory, y as DirectorSessionFactoryOptions, F as FLEET_ROSTER, z as FLEET_ROSTER_BUDGETS, J as FleetRosterBudget, K as FleetSpawnBudgetError, L as ICoordinator, M as IFleetManager, O as NULL_FLEET_BUS, R as REFACTOR_PLANNER_AGENT, S as SECURITY_SCANNER_AGENT, V as SubagentPromptParts, W as applyRosterBudget, X as attachAutoExtend, Y as composeDirectorPrompt, Z as composeSubagentPrompt, _ as createDelegateTool, $ as getAgentDefinition, a1 as makeAskTool, a2 as makeAssignTool, a3 as makeAwaitTasksTool, a4 as makeCollabDebugTool, a5 as makeDirectorSessionFactory, a6 as makeFleetEmitTool, a7 as makeFleetHealthTool, a8 as makeFleetSessionTool, a9 as makeFleetStatusTool, aa as makeFleetUsageTool, ab as makeRollUpTool, ac as makeSpawnTool, ad as makeTerminateTool, af as rosterSummaryFromConfigs } from '../null-fleet-bus-
|
|
13
|
-
export { A as AgentBudgetTier, a as AgentCapability, b as AgentDefinition, c as AgentPhase, D as DEFAULT_DISPATCH_ROLE, d as DefaultMultiAgentCoordinator, e as DispatchCandidate, f as DispatchClassifier, g as DispatchMethod, h as DispatchOptions, i as DispatchResult, j as MultiAgentCoordinatorOptions, k as dispatchAgent, m as makeLLMClassifier, s as scoreAgents } from '../multi-agent-coordinator-
|
|
14
|
-
export { c as AgentFactory, d as AgentFactoryResult, e as AgentRunnerOptions, g as BudgetExceededError, h as BudgetKind, i as BudgetLimits, n as BudgetUsage, F as FleetBus, p as FleetEvent, q as FleetHandler, r as FleetUsage, s as FleetUsageAggregator, K as SubagentBudget, V as SubagentUsageSnapshot, _ as makeAgentSubagentRunner } from '../agent-subagent-runner-
|
|
15
|
-
export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from '../agent-bridge-
|
|
12
|
+
export { a as AGENTS_BY_PHASE, b as AGENT_CATALOG, c as ALL_AGENT_DEFINITIONS, d as ALL_FLEET_AGENTS, e as AUDIT_LOG_AGENT, f as AutoExtendCeiling, g as AutoExtendPolicy, B as BUG_HUNTER_AGENT, n as CreateDelegateToolOptions, D as DEFAULT_DIRECTOR_PREAMBLE, q as DEFAULT_SUBAGENT_BASELINE, r as DelegateHost, s as Director, w as DirectorPromptParts, x as DirectorSessionFactory, y as DirectorSessionFactoryOptions, F as FLEET_ROSTER, z as FLEET_ROSTER_BUDGETS, J as FleetRosterBudget, K as FleetSpawnBudgetError, L as ICoordinator, M as IFleetManager, O as NULL_FLEET_BUS, R as REFACTOR_PLANNER_AGENT, S as SECURITY_SCANNER_AGENT, V as SubagentPromptParts, W as applyRosterBudget, X as attachAutoExtend, Y as composeDirectorPrompt, Z as composeSubagentPrompt, _ as createDelegateTool, $ as getAgentDefinition, a1 as makeAskTool, a2 as makeAssignTool, a3 as makeAwaitTasksTool, a4 as makeCollabDebugTool, a5 as makeDirectorSessionFactory, a6 as makeFleetEmitTool, a7 as makeFleetHealthTool, a8 as makeFleetSessionTool, a9 as makeFleetStatusTool, aa as makeFleetUsageTool, ab as makeRollUpTool, ac as makeSpawnTool, ad as makeTerminateTool, af as rosterSummaryFromConfigs } from '../null-fleet-bus-BCIRT_nV.js';
|
|
13
|
+
export { A as AgentBudgetTier, a as AgentCapability, b as AgentDefinition, c as AgentPhase, D as DEFAULT_DISPATCH_ROLE, d as DefaultMultiAgentCoordinator, e as DispatchCandidate, f as DispatchClassifier, g as DispatchMethod, h as DispatchOptions, i as DispatchResult, j as MultiAgentCoordinatorOptions, k as dispatchAgent, m as makeLLMClassifier, s as scoreAgents } from '../multi-agent-coordinator-BSBbZt0e.js';
|
|
14
|
+
export { c as AgentFactory, d as AgentFactoryResult, e as AgentRunnerOptions, g as BudgetExceededError, h as BudgetKind, i as BudgetLimits, n as BudgetUsage, F as FleetBus, p as FleetEvent, q as FleetHandler, r as FleetUsage, s as FleetUsageAggregator, K as SubagentBudget, V as SubagentUsageSnapshot, _ as makeAgentSubagentRunner } from '../agent-subagent-runner-BmITbs1Q.js';
|
|
15
|
+
export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from '../agent-bridge-C0Ze7Ldm.js';
|
|
16
16
|
export { D as DefaultModelsRegistry, a as DefaultModelsRegistryOptions, c as classifyFamily } from '../models-registry-Cuq1C8V9.js';
|
|
17
17
|
export { DefaultModeStore, LLMSelector, LLMSelectorOptions, ModeLoaderOptions, loadProjectModes, loadUserModes } from '../models/index.js';
|
|
18
18
|
export { AISpecBuilder, AISpecBuilderOptions, AISpecPhase, AISpecSession, AutoExecutor, AutoExecutorOptions, BottleneckTask, CollectedAnswer, CriticalPathAnalysis, DefaultTaskStore, ExecutionSummary, GeneratedTask, RunResult, SPEC_TEMPLATES, SddParallelRun, SddParallelRunOptions, SddProgress, SddTaskDecomposer, SddTaskDecomposerOptions, SpecDiff, SpecDrivenDev, SpecDrivenDevOptions, SpecIndexEntry, SpecParser, SpecStore, SpecStoreOptions, SpecVersion, SpecVersioning, TaskBatch, TaskExecutionContext, TaskExecutionResult, TaskFlow, TaskFlowEventMap, TaskFlowEventName, TaskFlowExecutionContext, TaskFlowOptions, TaskFlowPhase, TaskGenerator, TaskGeneratorOptions, TaskGraphIndexEntry, TaskGraphStore, TaskGraphStoreOptions, TaskStore, TaskTracker, TaskTrackerOptions, TaskTransition, WaveResult, analyzeCriticalPath, createAutoExecutor, getTemplate, listTemplates, renderProgress, renderSpecAnalysis, renderTaskGraph, renderTaskList, templateToMarkdown } from '../sdd/index.js';
|
|
19
19
|
export { DefaultHealthRegistry, InMemoryMetricsSink, MetricsServerHandle, MetricsServerOptions, NoopMetricsSink, NoopTracer, OTelTracer, OtlpMetricsExporterHandle, OtlpMetricsExporterOptions, OtlpTraceExporterHandle, OtlpTraceExporterOptions, PROMETHEUS_CONTENT_TYPE, buildOtlpMetricsRequest, buildOtlpTracesRequest, renderPrometheus, startMetricsServer, startOtlpMetricsExporter, startOtlpTraceExporter, wireMetricsToEvents } from '../observability/index.js';
|
|
20
|
-
export { C as ContextManagerAction, a as ContextManagerInput, b as ContextManagerResult, c as ContextManagerToolOptions, d as allServers, e as awsServer, f as blockServer, g as braveSearchServer, h as context7Server, i as contextManagerTool, j as createContextManagerTool, k as everArtServer, l as filesystemServer, m as githubServer, n as googleMapsServer, o as miniMaxVisionServer, s as sentinelServer, p as slackServer, z as zaiVisionServer } from '../mcp-servers-
|
|
20
|
+
export { C as ContextManagerAction, a as ContextManagerInput, b as ContextManagerResult, c as ContextManagerToolOptions, d as allServers, e as awsServer, f as blockServer, g as braveSearchServer, h as context7Server, i as contextManagerTool, j as createContextManagerTool, k as everArtServer, l as filesystemServer, m as githubServer, n as googleMapsServer, o as miniMaxVisionServer, s as sentinelServer, p as slackServer, z as zaiVisionServer } from '../mcp-servers-T0O6UN_w.js';
|
|
21
21
|
export { D as DEFAULT_AUTONOMY_CONFIG, a as DEFAULT_CONTEXT_CONFIG, c as DEFAULT_TOOLS_CONFIG } from '../default-config-DEXI4jsl.js';
|
|
22
22
|
import '../logger-DDd5C--Z.js';
|
|
23
|
-
import '../events-
|
|
23
|
+
import '../events-BBAlxBuw.js';
|
|
24
24
|
import '../secret-scrubber-3MHDDAtm.js';
|
|
25
25
|
import '../memory-CEXuo7sz.js';
|
|
26
26
|
import '../wstack-paths-eMXnY1_X.js';
|
|
27
|
-
import '../config
|
|
27
|
+
import '../config-Dy0CK_o6.js';
|
|
28
28
|
import '../models-registry-BcYJDKLm.js';
|
|
29
29
|
import '../secret-vault-DoISxaKO.js';
|
|
30
30
|
import '../input-reader-E-ffP2ee.js';
|
|
31
|
-
import '../permission-
|
|
31
|
+
import '../permission-V5BLOrY6.js';
|
|
32
32
|
import '../compactor-D_ExJajC.js';
|
|
33
33
|
import '../retry-policy-CG3qvH_e.js';
|
|
34
|
-
import '../index-
|
|
35
|
-
import '../system-prompt-
|
|
34
|
+
import '../index-BN6i2Nfg.js';
|
|
35
|
+
import '../system-prompt-CA11g6Jo.js';
|
|
36
36
|
import '../observability-BhnVLBLS.js';
|
|
37
37
|
import '../goal-store-C7jcumEh.js';
|
|
38
38
|
import '../selector-RvBR_YRW.js';
|
|
39
39
|
import '../skill-CxuWrsKK.js';
|
|
40
40
|
import 'node:events';
|
|
41
|
-
import '../mode-
|
|
41
|
+
import '../mode-BO4SEUIv.js';
|
|
42
42
|
import '../task-graph-D1YQbpxF.js';
|
|
43
43
|
|
|
44
44
|
/**
|
package/dist/defaults/index.js
CHANGED
|
@@ -1479,8 +1479,17 @@ var BEHAVIOR_DEFAULTS = {
|
|
|
1479
1479
|
modelsRegistry: true,
|
|
1480
1480
|
skills: true
|
|
1481
1481
|
},
|
|
1482
|
+
indexing: {
|
|
1483
|
+
onSessionStart: true,
|
|
1484
|
+
onEdit: true,
|
|
1485
|
+
watchExternal: true,
|
|
1486
|
+
debounceMs: 400
|
|
1487
|
+
},
|
|
1482
1488
|
session: { ...DEFAULT_SESSION_LOGGING_CONFIG }
|
|
1483
1489
|
};
|
|
1490
|
+
function envBool(v) {
|
|
1491
|
+
return !/^(0|false|no|off)$/i.test(v.trim());
|
|
1492
|
+
}
|
|
1484
1493
|
var ENV_MAP = {
|
|
1485
1494
|
WRONGSTACK_PROVIDER: (c, v) => {
|
|
1486
1495
|
c.provider = v;
|
|
@@ -1505,8 +1514,23 @@ var ENV_MAP = {
|
|
|
1505
1514
|
WRONGSTACK_LOG_LEVEL: (c, v) => {
|
|
1506
1515
|
if (!c.log) c.log = { level: "info" };
|
|
1507
1516
|
c.log.level = v;
|
|
1517
|
+
},
|
|
1518
|
+
WRONGSTACK_INDEX_ON_START: (c, v) => {
|
|
1519
|
+
c.indexing = { ...defaultIndexing, ...c.indexing, onSessionStart: envBool(v) };
|
|
1520
|
+
},
|
|
1521
|
+
WRONGSTACK_INDEX_ON_EDIT: (c, v) => {
|
|
1522
|
+
c.indexing = { ...defaultIndexing, ...c.indexing, onEdit: envBool(v) };
|
|
1523
|
+
},
|
|
1524
|
+
WRONGSTACK_INDEX_WATCH: (c, v) => {
|
|
1525
|
+
c.indexing = { ...defaultIndexing, ...c.indexing, watchExternal: envBool(v) };
|
|
1508
1526
|
}
|
|
1509
1527
|
};
|
|
1528
|
+
var defaultIndexing = {
|
|
1529
|
+
onSessionStart: true,
|
|
1530
|
+
onEdit: true,
|
|
1531
|
+
watchExternal: true,
|
|
1532
|
+
debounceMs: 400
|
|
1533
|
+
};
|
|
1510
1534
|
function isPrimitiveArray(a) {
|
|
1511
1535
|
return a.every((v) => v === null || typeof v !== "object");
|
|
1512
1536
|
}
|
|
@@ -3481,14 +3505,6 @@ var DefaultPermissionPolicy = class {
|
|
|
3481
3505
|
getConfirmDestructive() {
|
|
3482
3506
|
return this.confirmDestructive;
|
|
3483
3507
|
}
|
|
3484
|
-
/** @deprecated Use `setYoloDestructive`. */
|
|
3485
|
-
setForceAllYolo(enabled) {
|
|
3486
|
-
this.setYoloDestructive(enabled);
|
|
3487
|
-
}
|
|
3488
|
-
/** @deprecated Use `getYoloDestructive`. */
|
|
3489
|
-
getForceAllYolo() {
|
|
3490
|
-
return this.getYoloDestructive();
|
|
3491
|
-
}
|
|
3492
3508
|
async reload() {
|
|
3493
3509
|
try {
|
|
3494
3510
|
const raw = await fsp.readFile(this.trustFile, "utf8");
|
|
@@ -5832,7 +5848,7 @@ ${errorDetails}`,
|
|
|
5832
5848
|
const decision = await this.opts.permissionPolicy.evaluate(tool, use.input, ctx);
|
|
5833
5849
|
let effectivePermission = decision.permission;
|
|
5834
5850
|
const policy = this.opts.permissionPolicy;
|
|
5835
|
-
const yolo = policy.getYolo?.() === true || policy.getYoloDestructive?.() === true
|
|
5851
|
+
const yolo = policy.getYolo?.() === true || policy.getYoloDestructive?.() === true;
|
|
5836
5852
|
if (toolDangerousCaps.length > 0 && effectivePermission === "auto" && !yolo) {
|
|
5837
5853
|
effectivePermission = "confirm";
|
|
5838
5854
|
}
|
|
@@ -9737,6 +9753,71 @@ Do not add prose, markdown, or code fences.`;
|
|
|
9737
9753
|
};
|
|
9738
9754
|
}
|
|
9739
9755
|
|
|
9756
|
+
// src/coordination/coordinator/error-classifier.ts
|
|
9757
|
+
function classifySubagentError(err, hints = {}) {
|
|
9758
|
+
const cause = err instanceof Error ? { name: err.name, message: err.message, stack: err.stack } : void 0;
|
|
9759
|
+
if (err instanceof ProviderError) {
|
|
9760
|
+
const baseMessage2 = err.describe();
|
|
9761
|
+
return providerErrorToSubagentError(err, baseMessage2, cause);
|
|
9762
|
+
}
|
|
9763
|
+
const baseMessage = err instanceof Error ? err.message : String(err);
|
|
9764
|
+
if (err instanceof BudgetExceededError) {
|
|
9765
|
+
const map = {
|
|
9766
|
+
iterations: "budget_iterations",
|
|
9767
|
+
tool_calls: "budget_tool_calls",
|
|
9768
|
+
tokens: "budget_tokens",
|
|
9769
|
+
cost: "budget_cost",
|
|
9770
|
+
timeout: "budget_timeout",
|
|
9771
|
+
idle_timeout: "budget_timeout"
|
|
9772
|
+
};
|
|
9773
|
+
return {
|
|
9774
|
+
kind: map[err.kind],
|
|
9775
|
+
message: baseMessage,
|
|
9776
|
+
retryable: false,
|
|
9777
|
+
cause
|
|
9778
|
+
};
|
|
9779
|
+
}
|
|
9780
|
+
if (hints.parentAborted) {
|
|
9781
|
+
return { kind: "aborted_by_parent", message: baseMessage, retryable: false, cause };
|
|
9782
|
+
}
|
|
9783
|
+
const lower = baseMessage.toLowerCase();
|
|
9784
|
+
if (/agent aborted$/i.test(baseMessage)) {
|
|
9785
|
+
return { kind: "aborted_by_parent", message: baseMessage, retryable: false, cause };
|
|
9786
|
+
}
|
|
9787
|
+
if (/agent exhausted iteration limit$/i.test(baseMessage)) {
|
|
9788
|
+
return { kind: "budget_iterations", message: baseMessage, retryable: false, cause };
|
|
9789
|
+
}
|
|
9790
|
+
if (/empty response$/i.test(baseMessage)) {
|
|
9791
|
+
return { kind: "empty_response", message: baseMessage, retryable: false, cause };
|
|
9792
|
+
}
|
|
9793
|
+
if (/^tool failed: /i.test(baseMessage)) {
|
|
9794
|
+
return { kind: "tool_failed", message: baseMessage, retryable: false, cause };
|
|
9795
|
+
}
|
|
9796
|
+
if (lower.includes("bridge transport") || /bridge.*(closed|disconnect)/i.test(baseMessage)) {
|
|
9797
|
+
return { kind: "bridge_failed", message: baseMessage, retryable: false, cause };
|
|
9798
|
+
}
|
|
9799
|
+
if (/context length|max.*tokens?.*exceeded|prompt is too long/i.test(baseMessage)) {
|
|
9800
|
+
return { kind: "context_overflow", message: baseMessage, retryable: false, cause };
|
|
9801
|
+
}
|
|
9802
|
+
return { kind: "unknown", message: baseMessage, retryable: false, cause };
|
|
9803
|
+
}
|
|
9804
|
+
function providerErrorToSubagentError(err, message, cause) {
|
|
9805
|
+
const status = err.status;
|
|
9806
|
+
if (status === 429 || err.body?.type === "rate_limit_error") {
|
|
9807
|
+
return { kind: "provider_rate_limit", message, retryable: true, backoffMs: 5e3, cause };
|
|
9808
|
+
}
|
|
9809
|
+
if (status === 401 || status === 403 || err.body?.type === "authentication_error") {
|
|
9810
|
+
return { kind: "provider_auth", message, retryable: false, cause };
|
|
9811
|
+
}
|
|
9812
|
+
if (status === 408 || status === 0) {
|
|
9813
|
+
return { kind: "provider_timeout", message, retryable: true, cause };
|
|
9814
|
+
}
|
|
9815
|
+
if (status >= 500 && status < 600) {
|
|
9816
|
+
return { kind: "provider_5xx", message, retryable: true, backoffMs: 3e3, cause };
|
|
9817
|
+
}
|
|
9818
|
+
return { kind: "unknown", message, retryable: err.retryable, cause };
|
|
9819
|
+
}
|
|
9820
|
+
|
|
9740
9821
|
// src/coordination/fleet.ts
|
|
9741
9822
|
var AUDIT_LOG_AGENT = {
|
|
9742
9823
|
id: "audit-log",
|
|
@@ -10247,7 +10328,7 @@ var DefaultMultiAgentCoordinator = class _DefaultMultiAgentCoordinator extends E
|
|
|
10247
10328
|
}
|
|
10248
10329
|
async spawn(subagent) {
|
|
10249
10330
|
const id = subagent.id || randomUUID();
|
|
10250
|
-
|
|
10331
|
+
const cfg = this.withNickname(subagent, id);
|
|
10251
10332
|
if (this.subagents.has(id)) {
|
|
10252
10333
|
throw new Error(`Subagent id "${id}" already exists \u2014 refusing to overwrite`);
|
|
10253
10334
|
}
|
|
@@ -10262,12 +10343,12 @@ var DefaultMultiAgentCoordinator = class _DefaultMultiAgentCoordinator extends E
|
|
|
10262
10343
|
maxConcurrent: this.config.maxConcurrent ?? 16
|
|
10263
10344
|
};
|
|
10264
10345
|
this.subagents.set(id, {
|
|
10265
|
-
config: { ...
|
|
10346
|
+
config: { ...cfg, id },
|
|
10266
10347
|
context,
|
|
10267
10348
|
status: "idle",
|
|
10268
10349
|
abortController: new AbortController()
|
|
10269
10350
|
});
|
|
10270
|
-
this.emit("subagent.started", { subagent: { ...
|
|
10351
|
+
this.emit("subagent.started", { subagent: { ...cfg, id } });
|
|
10271
10352
|
this.fleetBus?.emit({
|
|
10272
10353
|
subagentId: id,
|
|
10273
10354
|
ts: Date.now(),
|
|
@@ -10804,101 +10885,6 @@ var DefaultMultiAgentCoordinator = class _DefaultMultiAgentCoordinator extends E
|
|
|
10804
10885
|
return false;
|
|
10805
10886
|
}
|
|
10806
10887
|
};
|
|
10807
|
-
function classifySubagentError(err, hints = {}) {
|
|
10808
|
-
const cause = err instanceof Error ? { name: err.name, message: err.message, stack: err.stack } : void 0;
|
|
10809
|
-
if (err instanceof ProviderError) {
|
|
10810
|
-
const baseMessage2 = err.describe();
|
|
10811
|
-
return providerErrorToSubagentError(err, baseMessage2, cause);
|
|
10812
|
-
}
|
|
10813
|
-
const baseMessage = err instanceof Error ? err.message : String(err);
|
|
10814
|
-
if (err instanceof BudgetExceededError) {
|
|
10815
|
-
const map = {
|
|
10816
|
-
iterations: "budget_iterations",
|
|
10817
|
-
tool_calls: "budget_tool_calls",
|
|
10818
|
-
tokens: "budget_tokens",
|
|
10819
|
-
cost: "budget_cost",
|
|
10820
|
-
timeout: "budget_timeout",
|
|
10821
|
-
idle_timeout: "budget_timeout"
|
|
10822
|
-
};
|
|
10823
|
-
return {
|
|
10824
|
-
kind: map[err.kind],
|
|
10825
|
-
message: baseMessage,
|
|
10826
|
-
// Budgets are user-configured ceilings, not transient failures —
|
|
10827
|
-
// retrying with the same budget will hit the same ceiling. The
|
|
10828
|
-
// orchestrator must raise the budget or narrow the task first.
|
|
10829
|
-
retryable: false,
|
|
10830
|
-
cause
|
|
10831
|
-
};
|
|
10832
|
-
}
|
|
10833
|
-
if (hints.parentAborted) {
|
|
10834
|
-
return {
|
|
10835
|
-
kind: "aborted_by_parent",
|
|
10836
|
-
message: baseMessage,
|
|
10837
|
-
retryable: false,
|
|
10838
|
-
cause
|
|
10839
|
-
};
|
|
10840
|
-
}
|
|
10841
|
-
const lower = baseMessage.toLowerCase();
|
|
10842
|
-
if (/agent aborted$/i.test(baseMessage)) {
|
|
10843
|
-
return {
|
|
10844
|
-
kind: "aborted_by_parent",
|
|
10845
|
-
message: baseMessage,
|
|
10846
|
-
retryable: false,
|
|
10847
|
-
cause
|
|
10848
|
-
};
|
|
10849
|
-
}
|
|
10850
|
-
if (/agent exhausted iteration limit$/i.test(baseMessage)) {
|
|
10851
|
-
return { kind: "budget_iterations", message: baseMessage, retryable: false, cause };
|
|
10852
|
-
}
|
|
10853
|
-
if (/empty response$/i.test(baseMessage)) {
|
|
10854
|
-
return { kind: "empty_response", message: baseMessage, retryable: false, cause };
|
|
10855
|
-
}
|
|
10856
|
-
if (/^tool failed: /i.test(baseMessage)) {
|
|
10857
|
-
return { kind: "tool_failed", message: baseMessage, retryable: false, cause };
|
|
10858
|
-
}
|
|
10859
|
-
if (lower.includes("bridge transport") || /bridge.*(closed|disconnect)/i.test(baseMessage)) {
|
|
10860
|
-
return { kind: "bridge_failed", message: baseMessage, retryable: false, cause };
|
|
10861
|
-
}
|
|
10862
|
-
if (/context length|max.*tokens?.*exceeded|prompt is too long/i.test(baseMessage)) {
|
|
10863
|
-
return { kind: "context_overflow", message: baseMessage, retryable: false, cause };
|
|
10864
|
-
}
|
|
10865
|
-
return {
|
|
10866
|
-
kind: "unknown",
|
|
10867
|
-
message: baseMessage,
|
|
10868
|
-
retryable: false,
|
|
10869
|
-
cause
|
|
10870
|
-
};
|
|
10871
|
-
}
|
|
10872
|
-
function providerErrorToSubagentError(err, message, cause) {
|
|
10873
|
-
const status = err.status;
|
|
10874
|
-
if (status === 429 || err.body?.type === "rate_limit_error") {
|
|
10875
|
-
return {
|
|
10876
|
-
kind: "provider_rate_limit",
|
|
10877
|
-
message,
|
|
10878
|
-
retryable: true,
|
|
10879
|
-
// Conservative default: 5s. Provider-specific code can override
|
|
10880
|
-
// by emitting an error whose body carries an explicit hint.
|
|
10881
|
-
backoffMs: 5e3,
|
|
10882
|
-
cause
|
|
10883
|
-
};
|
|
10884
|
-
}
|
|
10885
|
-
if (status === 401 || status === 403 || err.body?.type === "authentication_error") {
|
|
10886
|
-
return { kind: "provider_auth", message, retryable: false, cause };
|
|
10887
|
-
}
|
|
10888
|
-
if (status === 408 || status === 0) {
|
|
10889
|
-
return { kind: "provider_timeout", message, retryable: true, cause };
|
|
10890
|
-
}
|
|
10891
|
-
if (status >= 500 && status < 600) {
|
|
10892
|
-
return {
|
|
10893
|
-
kind: "provider_5xx",
|
|
10894
|
-
message,
|
|
10895
|
-
retryable: true,
|
|
10896
|
-
backoffMs: 3e3,
|
|
10897
|
-
cause
|
|
10898
|
-
};
|
|
10899
|
-
}
|
|
10900
|
-
return { kind: "unknown", message, retryable: err.retryable, cause };
|
|
10901
|
-
}
|
|
10902
10888
|
|
|
10903
10889
|
// src/execution/parallel-eternal-engine.ts
|
|
10904
10890
|
function sleep2(ms) {
|
|
@@ -11592,7 +11578,8 @@ function isGlob(p) {
|
|
|
11592
11578
|
return false;
|
|
11593
11579
|
}
|
|
11594
11580
|
function globToRegex(pat) {
|
|
11595
|
-
let i = 0
|
|
11581
|
+
let i = 0;
|
|
11582
|
+
let re = "^";
|
|
11596
11583
|
while (i < pat.length) {
|
|
11597
11584
|
const c = pat[i];
|
|
11598
11585
|
if (c === "*") {
|
|
@@ -12311,6 +12298,10 @@ A scratchpad shared with the rest of the fleet is mounted at \`${parts.sharedScr
|
|
|
12311
12298
|
- Use stable filenames (one file per concern); overwrite instead of appending so the Director sees the latest state.`
|
|
12312
12299
|
);
|
|
12313
12300
|
}
|
|
12301
|
+
if (parts.skills && parts.skills.trim().length > 0) {
|
|
12302
|
+
sections.push(`Domain knowledge:
|
|
12303
|
+
${parts.skills.trim()}`);
|
|
12304
|
+
}
|
|
12314
12305
|
if (parts.override && parts.override.trim().length > 0) {
|
|
12315
12306
|
sections.push(parts.override.trim());
|
|
12316
12307
|
}
|
|
@@ -13033,7 +13024,7 @@ function resolveModelMatrix(matrix, role) {
|
|
|
13033
13024
|
return void 0;
|
|
13034
13025
|
}
|
|
13035
13026
|
|
|
13036
|
-
// src/coordination/director.ts
|
|
13027
|
+
// src/coordination/director/director-errors.ts
|
|
13037
13028
|
var FleetSpawnBudgetError = class extends Error {
|
|
13038
13029
|
kind;
|
|
13039
13030
|
limit;
|
|
@@ -13075,6 +13066,8 @@ var FleetContextOverflowError = class extends Error {
|
|
|
13075
13066
|
this.observed = observed;
|
|
13076
13067
|
}
|
|
13077
13068
|
};
|
|
13069
|
+
|
|
13070
|
+
// src/coordination/director.ts
|
|
13078
13071
|
var Director = class _Director {
|
|
13079
13072
|
/** Alias for the ICoordinator contract. `id` is retained for backward compatibility. */
|
|
13080
13073
|
get coordinatorId() {
|
|
@@ -14141,6 +14134,7 @@ var Director = class _Director {
|
|
|
14141
14134
|
role: config.prompt,
|
|
14142
14135
|
task: taskBrief,
|
|
14143
14136
|
sharedScratchpad: this.sharedScratchpadPath ?? void 0,
|
|
14137
|
+
skills: config.skillContent,
|
|
14144
14138
|
override: config.systemPromptOverride
|
|
14145
14139
|
});
|
|
14146
14140
|
}
|
|
@@ -15017,7 +15011,8 @@ When reviewing code:
|
|
|
15017
15011
|
- Verify test coverage for critical paths
|
|
15018
15012
|
- Ensure naming conventions are followed`,
|
|
15019
15013
|
tags: ["review", "quality", "security"],
|
|
15020
|
-
toolPreferences: ["read", "grep", "git", "diff", "test"]
|
|
15014
|
+
toolPreferences: ["read", "grep", "git", "diff", "test"],
|
|
15015
|
+
suggestedSkills: ["bug-hunter", "security-scanner", "typescript-strict", "testing"]
|
|
15021
15016
|
},
|
|
15022
15017
|
{
|
|
15023
15018
|
id: "code-auditor",
|
|
@@ -15034,7 +15029,8 @@ When auditing code for security:
|
|
|
15034
15029
|
- Assess input validation and output encoding
|
|
15035
15030
|
- Look for timing attacks and information leakage`,
|
|
15036
15031
|
tags: ["security", "audit", "compliance"],
|
|
15037
|
-
toolPreferences: ["grep", "read", "audit", "bash"]
|
|
15032
|
+
toolPreferences: ["grep", "read", "audit", "bash"],
|
|
15033
|
+
suggestedSkills: ["security-scanner", "bug-hunter", "audit-log"]
|
|
15038
15034
|
},
|
|
15039
15035
|
{
|
|
15040
15036
|
id: "architect",
|
|
@@ -15052,7 +15048,8 @@ When designing or reviewing architecture:
|
|
|
15052
15048
|
- Assess API design and contract stability
|
|
15053
15049
|
- Consider operational aspects (monitoring, logging, deployment)`,
|
|
15054
15050
|
tags: ["architecture", "design", "scalability"],
|
|
15055
|
-
toolPreferences: ["read", "glob", "tree", "diff"]
|
|
15051
|
+
toolPreferences: ["read", "glob", "tree", "diff"],
|
|
15052
|
+
suggestedSkills: ["api-design", "refactor-planner", "node-modern", "docker-deploy"]
|
|
15056
15053
|
},
|
|
15057
15054
|
{
|
|
15058
15055
|
id: "debugger",
|
|
@@ -15070,7 +15067,8 @@ When investigating bugs:
|
|
|
15070
15067
|
- Use binary search to isolate the root cause
|
|
15071
15068
|
- Verify fixes with tests before considering done`,
|
|
15072
15069
|
tags: ["debug", "investigation", "error-resolution"],
|
|
15073
|
-
toolPreferences: ["read", "grep", "bash", "logs", "test"]
|
|
15070
|
+
toolPreferences: ["read", "grep", "bash", "logs", "test"],
|
|
15071
|
+
suggestedSkills: ["bug-hunter", "audit-log", "observability"]
|
|
15074
15072
|
},
|
|
15075
15073
|
{
|
|
15076
15074
|
id: "tester",
|
|
@@ -15088,7 +15086,8 @@ When testing or writing tests:
|
|
|
15088
15086
|
- Check for integration test gaps
|
|
15089
15087
|
- Verify test isolation and cleanup`,
|
|
15090
15088
|
tags: ["testing", "qa", "quality"],
|
|
15091
|
-
toolPreferences: ["read", "grep", "test", "bash"]
|
|
15089
|
+
toolPreferences: ["read", "grep", "test", "bash"],
|
|
15090
|
+
suggestedSkills: ["testing", "bug-hunter", "typescript-strict"]
|
|
15092
15091
|
},
|
|
15093
15092
|
{
|
|
15094
15093
|
id: "devops",
|
|
@@ -15106,7 +15105,8 @@ When working on infrastructure:
|
|
|
15106
15105
|
- Assess secrets management
|
|
15107
15106
|
- Check for resource limits and quotas`,
|
|
15108
15107
|
tags: ["devops", "infrastructure", "operations"],
|
|
15109
|
-
toolPreferences: ["read", "bash", "grep", "logs", "git"]
|
|
15108
|
+
toolPreferences: ["read", "bash", "grep", "logs", "git"],
|
|
15109
|
+
suggestedSkills: ["docker-deploy", "observability", "security-scanner"]
|
|
15110
15110
|
},
|
|
15111
15111
|
{
|
|
15112
15112
|
id: "refactorer",
|
|
@@ -15124,7 +15124,8 @@ When refactoring code:
|
|
|
15124
15124
|
- Don't mix formatting changes with logic changes
|
|
15125
15125
|
- Keep performance in mind \u2014 don't regress`,
|
|
15126
15126
|
tags: ["refactor", "modernization", "improvement"],
|
|
15127
|
-
toolPreferences: ["read", "edit", "test", "git", "grep"]
|
|
15127
|
+
toolPreferences: ["read", "edit", "test", "git", "grep"],
|
|
15128
|
+
suggestedSkills: ["refactor-planner", "typescript-strict", "node-modern", "testing"]
|
|
15128
15129
|
},
|
|
15129
15130
|
{
|
|
15130
15131
|
id: "brief",
|
|
@@ -15154,7 +15155,8 @@ Get to the point \u2014 read files, run commands, make changes.
|
|
|
15154
15155
|
- One-liner sufficient? One liner.
|
|
15155
15156
|
- Max 3 sentences per paragraph.`,
|
|
15156
15157
|
tags: ["fast", "concise", "direct"],
|
|
15157
|
-
toolPreferences: ["read", "edit", "bash"]
|
|
15158
|
+
toolPreferences: ["read", "edit", "bash"],
|
|
15159
|
+
suggestedSkills: []
|
|
15158
15160
|
},
|
|
15159
15161
|
{
|
|
15160
15162
|
id: "teach",
|
|
@@ -15219,7 +15221,8 @@ You follow these principles, but always with explanation:
|
|
|
15219
15221
|
|
|
15220
15222
|
Remember: your job is to make the user a better developer, not just to complete tasks faster.`,
|
|
15221
15223
|
tags: ["teaching", "mentor", "learning"],
|
|
15222
|
-
toolPreferences: ["read", "edit", "explain"]
|
|
15224
|
+
toolPreferences: ["read", "edit", "explain"],
|
|
15225
|
+
suggestedSkills: ["prompt-engineering", "skill-creator", "node-modern", "typescript-strict"]
|
|
15223
15226
|
}
|
|
15224
15227
|
];
|
|
15225
15228
|
|