@wrongstack/core 0.148.0 → 0.155.0

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.
Files changed (50) hide show
  1. package/dist/{agent-bridge-r9y6gdn4.d.ts → agent-bridge-BbZU5TPN.d.ts} +1 -1
  2. package/dist/{agent-subagent-runner-1GeQE_L0.d.ts → agent-subagent-runner-Bsueu0J2.d.ts} +2 -2
  3. package/dist/{brain-Cp_3GIS2.d.ts → brain-CS_B0vIE.d.ts} +2 -0
  4. package/dist/coordination/index.d.ts +7 -7
  5. package/dist/coordination/index.js +143 -6
  6. package/dist/coordination/index.js.map +1 -1
  7. package/dist/defaults/index.d.ts +13 -13
  8. package/dist/defaults/index.js +223 -65
  9. package/dist/defaults/index.js.map +1 -1
  10. package/dist/execution/index.d.ts +6 -6
  11. package/dist/execution/index.js +143 -6
  12. package/dist/execution/index.js.map +1 -1
  13. package/dist/extension/index.d.ts +2 -2
  14. package/dist/{goal-preamble-CYJLg0wk.d.ts → goal-preamble-CbV8pXLD.d.ts} +3 -3
  15. package/dist/{index-CPweVoFM.d.ts → index-B5wz-GXm.d.ts} +1 -1
  16. package/dist/{index-BZdezm3g.d.ts → index-CI1hRfPt.d.ts} +2 -2
  17. package/dist/index.d.ts +22 -22
  18. package/dist/index.js +233 -70
  19. package/dist/index.js.map +1 -1
  20. package/dist/infrastructure/index.d.ts +3 -3
  21. package/dist/infrastructure/index.js +11 -2
  22. package/dist/infrastructure/index.js.map +1 -1
  23. package/dist/kernel/index.d.ts +3 -3
  24. package/dist/kernel/index.js.map +1 -1
  25. package/dist/{mcp-servers-Bl5LTvQg.d.ts → mcp-servers-CPERR2De.d.ts} +8 -1
  26. package/dist/{multi-agent-coordinator-QWEzJDlm.d.ts → multi-agent-coordinator-BSKSFNhv.d.ts} +1 -1
  27. package/dist/{null-fleet-bus-BUyfqh23.d.ts → null-fleet-bus-CGOez8Le.d.ts} +4 -4
  28. package/dist/observability/index.d.ts +1 -1
  29. package/dist/{parallel-eternal-engine-C75QuhAI.d.ts → parallel-eternal-engine-CYoTKjsz.d.ts} +4 -4
  30. package/dist/{path-resolver-DRjQBkoO.d.ts → path-resolver-DuhlmPil.d.ts} +1 -1
  31. package/dist/{plan-templates-CkKNPU3I.d.ts → plan-templates-DbH7lg-t.d.ts} +2 -2
  32. package/dist/{provider-runner-BNpuIyOL.d.ts → provider-runner-Cocq0O9E.d.ts} +1 -1
  33. package/dist/sdd/index.d.ts +3 -3
  34. package/dist/sdd/index.js +143 -6
  35. package/dist/sdd/index.js.map +1 -1
  36. package/dist/{secret-vault-DoISxaKO.d.ts → secret-vault-BJDY28ev.d.ts} +7 -1
  37. package/dist/{secret-vault-BTcC_T5v.d.ts → secret-vault-w8MbUe2Q.d.ts} +1 -1
  38. package/dist/security/index.d.ts +2 -2
  39. package/dist/security/index.js +59 -22
  40. package/dist/security/index.js.map +1 -1
  41. package/dist/storage/index.d.ts +5 -5
  42. package/dist/storage/index.js +76 -42
  43. package/dist/storage/index.js.map +1 -1
  44. package/dist/types/index.d.ts +11 -11
  45. package/dist/types/index.js +59 -22
  46. package/dist/types/index.js.map +1 -1
  47. package/dist/utils/index.d.ts +65 -1
  48. package/dist/utils/index.js +61 -2
  49. package/dist/utils/index.js.map +1 -1
  50. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { B as BridgeTransport, a as BridgeMessage, A as AgentBridge, b as AgentBridgeConfig } from './agent-subagent-runner-1GeQE_L0.js';
1
+ import { B as BridgeTransport, a as BridgeMessage, A as AgentBridge, b as AgentBridgeConfig } from './agent-subagent-runner-Bsueu0J2.js';
2
2
 
3
3
  /**
4
4
  * In-memory pub/sub transport for agent-to-agent messaging.
@@ -1,6 +1,6 @@
1
- import { c as ToolCallPipelinePayload, d as ToolWrapper, E as ExtensionRegistry, S as SystemPromptContributor, e as ToolRegistry, P as ProviderRegistry, A as AgentPipelines, f as ToolExecutorLike, g as AgentInit, h as AgentInput, R as RunResult } from './index-CPweVoFM.js';
1
+ import { c as ToolCallPipelinePayload, d as ToolWrapper, E as ExtensionRegistry, S as SystemPromptContributor, e as ToolRegistry, P as ProviderRegistry, A as AgentPipelines, f as ToolExecutorLike, g as AgentInit, h as AgentInput, R as RunResult } from './index-B5wz-GXm.js';
2
2
  import { C as Container, R as ReadonlyPipeline, a as Renderer } from './pipeline-BG7UgbDc.js';
3
- import { E as EventBus, c as EventName, L as Listener } from './brain-Cp_3GIS2.js';
3
+ import { E as EventBus, c as EventName, L as Listener } from './brain-CS_B0vIE.js';
4
4
  import { R as RetryPolicy, E as ErrorHandler } from './retry-policy-rutAfVeR.js';
5
5
  import { L as Logger } from './logger-B63L5bTg.js';
6
6
  import { T as Tracer } from './observability-D-HZN_mF.js';
@@ -551,6 +551,8 @@ interface EventMap {
551
551
  stack?: string | undefined;
552
552
  } | undefined;
553
553
  } | undefined;
554
+ /** Final assistant text from the subagent's last turn. */
555
+ finalText?: string | undefined;
554
556
  };
555
557
  /**
556
558
  * Fired by the delegate tool when a subagent finishes. The agent's run
@@ -1,14 +1,14 @@
1
- export { b as BrainArbiter, B as BrainDecision, d as BrainDecisionOption, e as BrainDecisionQueue, a as BrainDecisionRequest, f as BrainDecisionSource, g as BrainFallback, h as BrainRisk, D as DefaultBrainArbiter, i as DefaultBrainArbiterOptions, H as HumanEscalatingBrainArbiter, O as ObservableBrainArbiter, j as formatHumanPrompt } from '../brain-Cp_3GIS2.js';
2
- export { A as ACP_AGENTS, 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, h as BugFinding, C as CollabBudgetConfig, i as CollabBudgetOverrides, j as CollabBudgetWarningPayload, k as CollabDebugReport, l as CollabSession, m as CollabSessionOptions, n as CreateDelegateToolOptions, o as CriticConcern, p as CriticEvaluation, D as DEFAULT_DIRECTOR_PREAMBLE, q as DEFAULT_SUBAGENT_BASELINE, r as DelegateHost, s as Director, t as DirectorAlert, u as DirectorAlertLevel, v as DirectorCancelCollabPayload, w as DirectorPromptParts, x as DirectorSessionFactory, y as DirectorSessionFactoryOptions, F as FLEET_ROSTER, z as FLEET_ROSTER_BUDGETS, E as FLEET_ROSTER_WITHACP, G as FleetCostCapError, H as FleetManager, I as FleetManagerOptions, J as FleetRosterBudget, K as FleetSpawnBudgetError, L as ICoordinator, M as IFleetManager, N as LargeAnswerStore, O as NULL_FLEET_BUS, R as REFACTOR_PLANNER_AGENT, P as RefactorPhase, Q as RefactorPlan, S as SECURITY_SCANNER_AGENT, T as SharedFileEntry, U as SharedFileSnapshot, V as SubagentPromptParts, W as applyRosterBudget, X as attachAutoExtend, Y as composeDirectorPrompt, Z as composeSubagentPrompt, _ as createDelegateTool, $ as getAgentDefinition, a0 as makeAskResultTool, 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, ae as makeWorkCompleteTool, af as rosterSummaryFromConfigs } from '../null-fleet-bus-BUyfqh23.js';
3
- import { A as AgentDefinition } from '../multi-agent-coordinator-QWEzJDlm.js';
4
- export { T as AGENT_TOOL_PRESETS, b as AgentBudgetTier, c as AgentCapability, d as AgentPhase, e as DEFAULT_DISPATCH_ROLE, a as DefaultMultiAgentCoordinator, f as DispatchCandidate, D as DispatchClassifier, g as DispatchMethod, h as DispatchOptions, i as DispatchResult, H as HEAVY_BUDGET, L as LIGHT_BUDGET, M as MEDIUM_BUDGET, j as MultiAgentCoordinatorOptions, k as dispatchAgent, m as makeLLMClassifier, s as scoreAgents } from '../multi-agent-coordinator-QWEzJDlm.js';
5
- export { h as AgentFactory, i as AgentFactoryResult, j as AgentRunnerOptions, k as BudgetExceededError, l as BudgetKind, m as BudgetLimits, n as BudgetNegotiationMode, o as BudgetThresholdDecision, p as BudgetThresholdHandler, q as BudgetThresholdSignal, r as BudgetUsage, F as FleetBus, s as FleetEvent, t as FleetHandler, u as FleetUsage, v as FleetUsageAggregator, w as SubagentBudget, x as SubagentUsageSnapshot, y as makeAgentSubagentRunner } from '../agent-subagent-runner-1GeQE_L0.js';
6
- export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from '../agent-bridge-r9y6gdn4.js';
1
+ export { b as BrainArbiter, B as BrainDecision, d as BrainDecisionOption, e as BrainDecisionQueue, a as BrainDecisionRequest, f as BrainDecisionSource, g as BrainFallback, h as BrainRisk, D as DefaultBrainArbiter, i as DefaultBrainArbiterOptions, H as HumanEscalatingBrainArbiter, O as ObservableBrainArbiter, j as formatHumanPrompt } from '../brain-CS_B0vIE.js';
2
+ export { A as ACP_AGENTS, 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, h as BugFinding, C as CollabBudgetConfig, i as CollabBudgetOverrides, j as CollabBudgetWarningPayload, k as CollabDebugReport, l as CollabSession, m as CollabSessionOptions, n as CreateDelegateToolOptions, o as CriticConcern, p as CriticEvaluation, D as DEFAULT_DIRECTOR_PREAMBLE, q as DEFAULT_SUBAGENT_BASELINE, r as DelegateHost, s as Director, t as DirectorAlert, u as DirectorAlertLevel, v as DirectorCancelCollabPayload, w as DirectorPromptParts, x as DirectorSessionFactory, y as DirectorSessionFactoryOptions, F as FLEET_ROSTER, z as FLEET_ROSTER_BUDGETS, E as FLEET_ROSTER_WITHACP, G as FleetCostCapError, H as FleetManager, I as FleetManagerOptions, J as FleetRosterBudget, K as FleetSpawnBudgetError, L as ICoordinator, M as IFleetManager, N as LargeAnswerStore, O as NULL_FLEET_BUS, R as REFACTOR_PLANNER_AGENT, P as RefactorPhase, Q as RefactorPlan, S as SECURITY_SCANNER_AGENT, T as SharedFileEntry, U as SharedFileSnapshot, V as SubagentPromptParts, W as applyRosterBudget, X as attachAutoExtend, Y as composeDirectorPrompt, Z as composeSubagentPrompt, _ as createDelegateTool, $ as getAgentDefinition, a0 as makeAskResultTool, 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, ae as makeWorkCompleteTool, af as rosterSummaryFromConfigs } from '../null-fleet-bus-CGOez8Le.js';
3
+ import { A as AgentDefinition } from '../multi-agent-coordinator-BSKSFNhv.js';
4
+ export { T as AGENT_TOOL_PRESETS, b as AgentBudgetTier, c as AgentCapability, d as AgentPhase, e as DEFAULT_DISPATCH_ROLE, a as DefaultMultiAgentCoordinator, f as DispatchCandidate, D as DispatchClassifier, g as DispatchMethod, h as DispatchOptions, i as DispatchResult, H as HEAVY_BUDGET, L as LIGHT_BUDGET, M as MEDIUM_BUDGET, j as MultiAgentCoordinatorOptions, k as dispatchAgent, m as makeLLMClassifier, s as scoreAgents } from '../multi-agent-coordinator-BSKSFNhv.js';
5
+ export { h as AgentFactory, i as AgentFactoryResult, j as AgentRunnerOptions, k as BudgetExceededError, l as BudgetKind, m as BudgetLimits, n as BudgetNegotiationMode, o as BudgetThresholdDecision, p as BudgetThresholdHandler, q as BudgetThresholdSignal, r as BudgetUsage, F as FleetBus, s as FleetEvent, t as FleetHandler, u as FleetUsage, v as FleetUsageAggregator, w as SubagentBudget, x as SubagentUsageSnapshot, y as makeAgentSubagentRunner } from '../agent-subagent-runner-Bsueu0J2.js';
6
+ export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from '../agent-bridge-BbZU5TPN.js';
7
7
  import '../context-C7G_MtLV.js';
8
8
  import 'node:events';
9
9
  import '../director-state-BfeCUbmk.js';
10
10
  import '../config-BaVThgnT.js';
11
- import '../index-CPweVoFM.js';
11
+ import '../index-B5wz-GXm.js';
12
12
  import '../logger-B63L5bTg.js';
13
13
  import '../pipeline-BG7UgbDc.js';
14
14
  import '../observability-D-HZN_mF.js';
@@ -2208,15 +2208,44 @@ Working rules:
2208
2208
  id: "e2e",
2209
2209
  name: "E2E",
2210
2210
  role: "e2e",
2211
- tools: [...TOOLS.build, "fetch"],
2211
+ tools: [
2212
+ ...TOOLS.build,
2213
+ "fetch",
2214
+ "playwright_navigate",
2215
+ "playwright_screenshot",
2216
+ "playwright_click",
2217
+ "playwright_type",
2218
+ "playwright_evaluate",
2219
+ "playwright_select_option",
2220
+ "playwright_hover",
2221
+ "playwright_fill_form",
2222
+ "playwright_wait_for",
2223
+ "playwright_press_key",
2224
+ "playwright_drag"
2225
+ ],
2212
2226
  prompt: `You are the E2E agent. Your job is end-to-end testing: drive the whole
2213
2227
  system the way a user would and verify the full flow works across boundaries.
2214
2228
 
2215
2229
  Scope:
2216
2230
  - Author end-to-end scenarios that exercise real user journeys
2217
2231
  - Drive UI/CLI/API across process and network boundaries
2232
+ - Use Playwright browser tools (navigate, click, type, screenshot, evaluate)
2233
+ to automate web UI flows \u2014 open pages, interact with forms, capture evidence
2218
2234
  - Set up and tear down realistic test state
2219
- - Capture failures with enough detail to reproduce (screenshots, logs)
2235
+ - Capture failures with enough detail to reproduce (screenshots, logs, page HTML)
2236
+
2237
+ Playwright tools available (require the "playwright" MCP server to be enabled):
2238
+ playwright_navigate(url) \u2014 open a page at the given URL
2239
+ playwright_screenshot() \u2014 capture a full-page or viewport screenshot
2240
+ playwright_click(selector) \u2014 click on an element matching a CSS selector
2241
+ playwright_type(selector, text) \u2014 type text into a focused input element
2242
+ playwright_evaluate(script) \u2014 run arbitrary JavaScript in the page context
2243
+ playwright_select_option(selector, value) \u2014 pick a <select> dropdown option
2244
+ playwright_hover(selector) \u2014 hover the mouse over an element
2245
+ playwright_fill_form(fields) \u2014 fill multiple form fields in one call
2246
+ playwright_wait_for(selector) \u2014 block until an element appears on the page
2247
+ playwright_press_key(key) \u2014 press a keyboard key (Enter, Tab, Escape, \u2026)
2248
+ playwright_drag(from, to) \u2014 drag an element from one selector to another
2220
2249
 
2221
2250
  Input format you accept:
2222
2251
  { "task": "scenario | smoke | journey", "flow": "<user journey>", "surface": "ui | cli | api" }
@@ -2230,8 +2259,10 @@ Output: Markdown e2e report:
2230
2259
  Working rules:
2231
2260
  - Test the real flow end to end; don't stub the thing under test
2232
2261
  - Make scenarios deterministic \u2014 control time, randomness, and external state
2233
- - On failure, capture artifacts (logs/screenshots) for reproduction
2234
- - Keep scenarios independent so one failure doesn't cascade`
2262
+ - On failure, capture artifacts (screenshots, page HTML, logs) for reproduction
2263
+ - Keep scenarios independent so one failure doesn't cascade
2264
+ - For browser tests: playwright_navigate first, then interact, then playwright_screenshot as evidence
2265
+ - If playwright tools are unavailable, report it and fall back to API/CLI testing`
2235
2266
  },
2236
2267
  budget: HEAVY_BUDGET,
2237
2268
  capability: {
@@ -2244,10 +2275,106 @@ Working rules:
2244
2275
  "user journey",
2245
2276
  "smoke test",
2246
2277
  "playwright",
2278
+ "browser",
2279
+ "screenshot",
2280
+ "web ui",
2281
+ "headless",
2247
2282
  "cypress",
2248
2283
  "full flow",
2249
2284
  "browser test",
2250
- "acceptance test"
2285
+ "acceptance test",
2286
+ "navigate",
2287
+ "click",
2288
+ "form fill",
2289
+ "dom",
2290
+ "page load"
2291
+ ]
2292
+ }
2293
+ },
2294
+ {
2295
+ config: {
2296
+ id: "browser",
2297
+ name: "Browser",
2298
+ role: "browser",
2299
+ tools: [
2300
+ ...TOOLS.read,
2301
+ "fetch",
2302
+ "playwright_navigate",
2303
+ "playwright_screenshot",
2304
+ "playwright_click",
2305
+ "playwright_type",
2306
+ "playwright_evaluate",
2307
+ "playwright_select_option",
2308
+ "playwright_hover",
2309
+ "playwright_fill_form",
2310
+ "playwright_wait_for",
2311
+ "playwright_press_key",
2312
+ "playwright_drag"
2313
+ ],
2314
+ prompt: `You are the Browser agent. Your job is browser automation: open web pages,
2315
+ interact with them, extract data, capture screenshots, and return structured
2316
+ results. You are a read-focused agent \u2014 you drive the browser, not the filesystem.
2317
+
2318
+ Scope:
2319
+ - Navigate to URLs and wait for pages to load
2320
+ - Take full-page or element screenshots as evidence
2321
+ - Click buttons, fill forms, select options, type text \u2014 full user simulation
2322
+ - Extract page content: text, HTML, element attributes, data tables
2323
+ - Evaluate JavaScript in the page context to extract structured data
2324
+ - Verify visual state (element visibility, text content, attribute values)
2325
+
2326
+ Playwright tools available (require the "playwright" MCP server to be enabled):
2327
+ playwright_navigate(url) \u2014 open a page at the given URL
2328
+ playwright_screenshot() \u2014 capture a full-page or viewport screenshot
2329
+ playwright_click(selector) \u2014 click on an element matching a CSS selector
2330
+ playwright_type(selector, text) \u2014 type text into a focused input element
2331
+ playwright_evaluate(script) \u2014 run arbitrary JavaScript in the page context
2332
+ playwright_select_option(selector, value) \u2014 pick a <select> dropdown option
2333
+ playwright_hover(selector) \u2014 hover the mouse over an element
2334
+ playwright_fill_form(fields) \u2014 fill multiple form fields in one call
2335
+ playwright_wait_for(selector) \u2014 block until an element appears on the page
2336
+ playwright_press_key(key) \u2014 press a keyboard key (Enter, Tab, Escape, \u2026)
2337
+ playwright_drag(from, to) \u2014 drag an element from one selector to another
2338
+
2339
+ Input format you accept:
2340
+ { "task": "navigate | screenshot | extract | interact | verify", "url": "<url>", "steps": ["step1", "step2"] }
2341
+
2342
+ Output: Structured markdown report:
2343
+ - ## Page (URL, title, load status)
2344
+ - ## Actions Taken (step-by-step with timestamps)
2345
+ - ## Results (extracted data, element states, verification results)
2346
+ - ## Screenshots (list attached screenshot references)
2347
+ - ## Errors (any failures with stack traces)
2348
+
2349
+ Working rules:
2350
+ - Always playwright_navigate first before any interaction
2351
+ - Always playwright_wait_for after navigation to ensure the page is ready
2352
+ - playwright_screenshot is your primary evidence \u2014 use it before and after interactions
2353
+ - Use playwright_evaluate for structured data extraction (JSON, text content)
2354
+ - If a selector fails, try alternative selectors before giving up
2355
+ - Report exact CSS selectors used \u2014 they're part of the evidence
2356
+ - If playwright tools are unavailable, report the error immediately \u2014 do not guess`
2357
+ },
2358
+ budget: MEDIUM_BUDGET,
2359
+ capability: {
2360
+ phase: "verify",
2361
+ summary: "Browser automation: opens pages, clicks, types, screenshots, extracts data via Playwright headless Chromium.",
2362
+ keywords: [
2363
+ "browser",
2364
+ "screenshot",
2365
+ "navigate",
2366
+ "web page",
2367
+ "scrape",
2368
+ "crawl",
2369
+ "headless",
2370
+ "chrome",
2371
+ "open url",
2372
+ "capture",
2373
+ "page title",
2374
+ "extract data",
2375
+ "fill form",
2376
+ "click button",
2377
+ "take screenshot"
2251
2378
  ]
2252
2379
  }
2253
2380
  },
@@ -7906,6 +8033,7 @@ async function readSubagentPartial(opts, subagentId) {
7906
8033
  function makeAgentSubagentRunner(opts) {
7907
8034
  const format = opts.formatTaskInput ?? defaultFormatTaskInput;
7908
8035
  return async (task, ctx) => {
8036
+ const taskStartedAt = Date.now();
7909
8037
  const factoryResult = await opts.factory(ctx.config);
7910
8038
  const { agent, events } = factoryResult;
7911
8039
  const detachFleet = opts.fleetBus?.attach(ctx.subagentId, events, task.id);
@@ -8002,7 +8130,7 @@ function makeAgentSubagentRunner(opts) {
8002
8130
  }),
8003
8131
  events.on("provider.text_delta", (e) => {
8004
8132
  ctx.budget.markActivity();
8005
- streamingTextAcc = (streamingTextAcc + e.text).slice(-200);
8133
+ streamingTextAcc = (streamingTextAcc + e.text).slice(-2e3);
8006
8134
  })
8007
8135
  );
8008
8136
  const onParentAbort = () => aborter.abort();
@@ -8010,6 +8138,15 @@ function makeAgentSubagentRunner(opts) {
8010
8138
  let result;
8011
8139
  try {
8012
8140
  result = await agent.run(format(task, ctx.config), { signal: aborter.signal });
8141
+ events.emit("subagent.task_completed", {
8142
+ subagentId: ctx.subagentId,
8143
+ taskId: task.id,
8144
+ status: result.status === "done" ? "success" : "failed",
8145
+ iterations: result.iterations,
8146
+ toolCalls: ctx.budget.usage().toolCalls,
8147
+ durationMs: Date.now() - taskStartedAt,
8148
+ finalText: result.finalText?.trim() || void 0
8149
+ });
8013
8150
  } finally {
8014
8151
  detachFleet?.();
8015
8152
  ctx.signal.removeEventListener("abort", onParentAbort);