@wrongstack/core 0.141.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 (51) 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 +147 -10
  6. package/dist/coordination/index.js.map +1 -1
  7. package/dist/defaults/index.d.ts +13 -13
  8. package/dist/defaults/index.js +360 -78
  9. package/dist/defaults/index.js.map +1 -1
  10. package/dist/execution/index.d.ts +6 -6
  11. package/dist/execution/index.js +277 -16
  12. package/dist/execution/index.js.map +1 -1
  13. package/dist/extension/index.d.ts +2 -2
  14. package/dist/{goal-preamble-iuIUTQwk.d.ts → goal-preamble-CbV8pXLD.d.ts} +11 -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 +23 -23
  18. package/dist/index.js +396 -86
  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-Dj2SYzha.d.ts → parallel-eternal-engine-CYoTKjsz.d.ts} +13 -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 +60 -23
  40. package/dist/security/index.js.map +1 -1
  41. package/dist/storage/index.d.ts +5 -5
  42. package/dist/storage/index.js +78 -44
  43. package/dist/storage/index.js.map +1 -1
  44. package/dist/types/index.d.ts +11 -11
  45. package/dist/types/index.js +186 -26
  46. package/dist/types/index.js.map +1 -1
  47. package/dist/utils/index.d.ts +65 -1
  48. package/dist/utils/index.js +64 -5
  49. package/dist/utils/index.js.map +1 -1
  50. package/package.json +1 -1
  51. package/skills/tech-stack/SKILL.md +253 -97
package/dist/index.js CHANGED
@@ -1186,9 +1186,75 @@ var DEFAULT_SESSION_PRUNE_DAYS = 30;
1186
1186
 
1187
1187
  // src/types/secret-vault.ts
1188
1188
  var ENCRYPTED_PREFIX = "enc:v1:";
1189
+ var noOpVault = {
1190
+ encrypt: (v) => v,
1191
+ decrypt: (v) => v,
1192
+ isEncrypted: () => false
1193
+ };
1189
1194
 
1190
1195
  // src/security/secret-vault.ts
1191
1196
  init_atomic_write();
1197
+
1198
+ // src/utils/deep-merge.ts
1199
+ var FORBIDDEN_PROTO_KEYS = /* @__PURE__ */ new Set([
1200
+ "__proto__",
1201
+ "constructor",
1202
+ "prototype",
1203
+ "__defineGetter__",
1204
+ "__defineSetter__",
1205
+ "__lookupGetter__",
1206
+ "__lookupSetter__"
1207
+ ]);
1208
+ function isPrimitiveArray(a) {
1209
+ return a.every((v) => v === null || typeof v !== "object" && typeof v !== "function");
1210
+ }
1211
+ function deepMerge(base, patch, options = {}) {
1212
+ const {
1213
+ conflictResolution = "prefer-patch",
1214
+ arrayMode = "replace",
1215
+ protectProto = true,
1216
+ onNonPrimitiveArrayReplace
1217
+ } = options;
1218
+ if (typeof base !== "object" || base === null) {
1219
+ return conflictResolution === "prefer-patch" ? patch : base;
1220
+ }
1221
+ if (typeof patch !== "object" || patch === null) {
1222
+ return conflictResolution === "prefer-patch" ? patch : base;
1223
+ }
1224
+ if (Array.isArray(base) && Array.isArray(patch)) {
1225
+ if (arrayMode === "concat-primitives" && isPrimitiveArray(base) && isPrimitiveArray(patch)) {
1226
+ return [.../* @__PURE__ */ new Set([...base, ...patch])];
1227
+ }
1228
+ return conflictResolution === "prefer-patch" ? patch : base;
1229
+ }
1230
+ if (Array.isArray(base) || Array.isArray(patch)) {
1231
+ return conflictResolution === "prefer-patch" ? patch : base;
1232
+ }
1233
+ const baseObj = base;
1234
+ const patchObj = patch;
1235
+ const out = { ...baseObj };
1236
+ for (const [k, v] of Object.entries(patchObj)) {
1237
+ if (protectProto && FORBIDDEN_PROTO_KEYS.has(k)) continue;
1238
+ const existing = out[k];
1239
+ if (v !== null && typeof v === "object" && !Array.isArray(v) && existing !== null && typeof existing === "object" && !Array.isArray(existing)) {
1240
+ out[k] = deepMerge(existing, v, options);
1241
+ } else if (Array.isArray(v) && Array.isArray(existing)) {
1242
+ if (onNonPrimitiveArrayReplace && !isPrimitiveArray(v)) {
1243
+ onNonPrimitiveArrayReplace(k, existing.length, v.length);
1244
+ }
1245
+ out[k] = deepMerge(existing, v, options);
1246
+ } else if (v !== void 0) {
1247
+ if (onNonPrimitiveArrayReplace && Array.isArray(v) && !isPrimitiveArray(v)) {
1248
+ const existingLen = Array.isArray(existing) ? existing.length : 0;
1249
+ onNonPrimitiveArrayReplace(k, existingLen, v.length);
1250
+ }
1251
+ out[k] = v;
1252
+ }
1253
+ }
1254
+ return out;
1255
+ }
1256
+
1257
+ // src/security/secret-vault.ts
1192
1258
  var KEY_BYTES = 32;
1193
1259
  var IV_BYTES = 12;
1194
1260
  var TAG_BYTES = 16;
@@ -1390,28 +1456,6 @@ function walkCount(node, vault, counter) {
1390
1456
  }
1391
1457
  return out;
1392
1458
  }
1393
- var FORBIDDEN_PROTO_KEYS = /* @__PURE__ */ new Set([
1394
- "__proto__",
1395
- "constructor",
1396
- "prototype",
1397
- "__defineGetter__",
1398
- "__defineSetter__",
1399
- "__lookupGetter__",
1400
- "__lookupSetter__"
1401
- ]);
1402
- function deepMerge(a, b) {
1403
- const out = { ...a };
1404
- for (const [k, v] of Object.entries(b)) {
1405
- if (FORBIDDEN_PROTO_KEYS.has(k)) continue;
1406
- const existing = out[k];
1407
- if (v !== null && typeof v === "object" && !Array.isArray(v) && existing !== null && typeof existing === "object" && !Array.isArray(existing)) {
1408
- out[k] = deepMerge(existing, v);
1409
- } else {
1410
- out[k] = v;
1411
- }
1412
- }
1413
- return out;
1414
- }
1415
1459
 
1416
1460
  // src/utils/term.ts
1417
1461
  var hasStdout = () => typeof process !== "undefined" && !!process.stdout;
@@ -2025,8 +2069,8 @@ function findPreserveStart(messages, preserveK) {
2025
2069
  for (let i = preserveStart; i < messages.length; i++) {
2026
2070
  const m = messages[i];
2027
2071
  if (!m || typeof m.content === "string" || !Array.isArray(m.content)) continue;
2028
- const hasToolUse2 = m.content.some((b) => b.type === "tool_use");
2029
- if (hasToolUse2 && i + 1 < messages.length) {
2072
+ const hasToolUse3 = m.content.some((b) => b.type === "tool_use");
2073
+ if (hasToolUse3 && i + 1 < messages.length) {
2030
2074
  const next = messages[i + 1];
2031
2075
  if (next && next.role === "user" && typeof next.content !== "string" && Array.isArray(next.content) && next.content.some((b) => b.type === "tool_result")) {
2032
2076
  preserveStart = i + 1;
@@ -2090,6 +2134,127 @@ function buildLosslessDigest(messages) {
2090
2134
  }
2091
2135
  return lines.join("\n");
2092
2136
  }
2137
+ function extractText(m) {
2138
+ if (typeof m.content === "string") return m.content;
2139
+ return m.content.filter(isTextBlock).map((b) => b.text).join(" ");
2140
+ }
2141
+ function hasToolUse2(m) {
2142
+ if (typeof m.content === "string") return false;
2143
+ return m.content.some((b) => b.type === "tool_use");
2144
+ }
2145
+ function hasLargeToolResult(m, threshold = 3e3) {
2146
+ if (typeof m.content === "string") return false;
2147
+ return m.content.some(
2148
+ (b) => b.type === "tool_result" && b.content && (typeof b.content === "string" ? b.content.length : JSON.stringify(b.content).length) > threshold
2149
+ );
2150
+ }
2151
+ function scoreMessage(m, context) {
2152
+ const text = extractText(m).toLowerCase();
2153
+ if (text.trim().length === 0 && (hasToolUse2(m) || typeof m.content !== "string")) {
2154
+ const hasResult = typeof m.content !== "string" && m.content.some((b) => b.type === "tool_result");
2155
+ if (hasToolUse2(m) || hasResult) return 0;
2156
+ }
2157
+ if (context?.failureCounts && m.role === "user" && hasToolUse2(m) === false) {
2158
+ const isFailure = /error|fail|exception|timeout|enonet|eacces|eperm|enoent|abort/i.test(text);
2159
+ if (isFailure) {
2160
+ const errKey = /(error|fail|exception|timeout|enonet|eacces|eperm|enoent|abort)/i.exec(text)?.[0]?.toLowerCase() ?? "error";
2161
+ const count = (context.failureCounts.get(errKey) ?? 0) + 1;
2162
+ context.failureCounts.set(errKey, count);
2163
+ if (count >= 5) return 0;
2164
+ if (count >= 3) return 1;
2165
+ }
2166
+ }
2167
+ if (m.role === "user") {
2168
+ if (/\b(wrong|no\b|stop\b|don'?t\b|actually|fix that|undo|revert|forget|ignore|skip)\b/i.test(
2169
+ text
2170
+ )) {
2171
+ return 5;
2172
+ }
2173
+ }
2174
+ if (/\b(error|exception|fatal|critical|crash|panic|abort|segfault|core dump|undefined is not|null pointer|typeerror|referenceerror|syntaxerror)\b/i.test(
2175
+ text
2176
+ )) {
2177
+ return 5;
2178
+ }
2179
+ if (/\b(security|vulnerability|injection|xss|csrf|secret|apikey|api.key|hardcoded|leak|exploit|cve)\b/i.test(
2180
+ text
2181
+ )) {
2182
+ return 5;
2183
+ }
2184
+ if (m.role === "assistant" && /\b(architecture|design|approach|strategy|pattern|refactor|migrate|restructure|decision|trade.?off)\b/i.test(
2185
+ text
2186
+ )) {
2187
+ return 5;
2188
+ }
2189
+ if (hasLargeToolResult(m)) return 1;
2190
+ if (m.role === "user" && !hasToolUse2(m) && /\b(files_with_matches|count|found \d+ match|directory tree|\.\.\. and \d+ more)\b/i.test(text)) {
2191
+ return 1;
2192
+ }
2193
+ return 3;
2194
+ }
2195
+ function buildSmartDigest(messages) {
2196
+ const lines = [];
2197
+ const failureCounts = /* @__PURE__ */ new Map();
2198
+ let noiseCount = 0;
2199
+ for (const m of messages) {
2200
+ const score = scoreMessage(m, { failureCounts });
2201
+ const text = extractText(m);
2202
+ const toolCount = countToolBlocks(m);
2203
+ if (score === 0) {
2204
+ noiseCount++;
2205
+ continue;
2206
+ }
2207
+ const marker = toolCount > 0 ? ` [${toolCount} tool call(s)]` : "";
2208
+ let display;
2209
+ switch (score) {
2210
+ case 5:
2211
+ display = text.trim();
2212
+ break;
2213
+ case 3:
2214
+ display = firstSentence(text);
2215
+ break;
2216
+ case 1:
2217
+ display = oneLineSummary(m, text);
2218
+ break;
2219
+ default:
2220
+ display = firstSentence(text);
2221
+ }
2222
+ if (display.length === 0 && toolCount === 0) continue;
2223
+ lines.push(`[${m.role}]: ${display}${marker}`);
2224
+ }
2225
+ if (noiseCount > 0) {
2226
+ lines.push(`[system]: ${noiseCount} low-importance turn(s) collapsed (repeated failures / pure tool I/O)`);
2227
+ }
2228
+ return lines.join("\n");
2229
+ }
2230
+ function countToolBlocks(m) {
2231
+ if (typeof m.content === "string") return 0;
2232
+ return m.content.filter(
2233
+ (b) => b.type === "tool_use" || b.type === "tool_result"
2234
+ ).length;
2235
+ }
2236
+ function firstSentence(text) {
2237
+ const trimmed = text.trim();
2238
+ if (trimmed.length === 0) return "";
2239
+ const dot = trimmed.indexOf(". ");
2240
+ if (dot === -1) return trimmed.length > 150 ? `${trimmed.slice(0, 147)}\u2026` : trimmed;
2241
+ const sentence = trimmed.slice(0, dot + 1);
2242
+ return sentence.length > 150 ? `${sentence.slice(0, 147)}\u2026` : sentence;
2243
+ }
2244
+ function oneLineSummary(m, text) {
2245
+ const trimmed = text.trim();
2246
+ if (trimmed.length === 0) {
2247
+ if (typeof m.content !== "string") {
2248
+ const results = m.content.filter((b) => b.type === "tool_result");
2249
+ if (results.length > 0) {
2250
+ return `[${results.length} tool result(s) \u2014 see session log]`;
2251
+ }
2252
+ }
2253
+ return "[no text content]";
2254
+ }
2255
+ const firstLine = trimmed.split("\n")[0] ?? "";
2256
+ return firstLine.length > 100 ? `${firstLine.slice(0, 97)}\u2026` : firstLine;
2257
+ }
2093
2258
  function findSafeBoundary(messages, from, to) {
2094
2259
  for (let i = to; i >= from; i--) {
2095
2260
  const m = messages[i];
@@ -2105,8 +2270,8 @@ function findExchangeStart(messages, userIndex) {
2105
2270
  const m = messages[i];
2106
2271
  if (!m) continue;
2107
2272
  if (m.role === "assistant") {
2108
- const hasToolUse2 = Array.isArray(m.content) ? m.content.some((b) => b.type === "tool_use") : false;
2109
- if (!hasToolUse2) return i + 1;
2273
+ const hasToolUse3 = Array.isArray(m.content) ? m.content.some((b) => b.type === "tool_use") : false;
2274
+ if (!hasToolUse3) return i + 1;
2110
2275
  } else if (m.role === "user") {
2111
2276
  return i;
2112
2277
  }
@@ -2118,9 +2283,11 @@ function findExchangeStart(messages, userIndex) {
2118
2283
  var HybridCompactor = class {
2119
2284
  preserveK;
2120
2285
  eliseThreshold;
2286
+ smart;
2121
2287
  constructor(opts = {}) {
2122
2288
  this.preserveK = opts.preserveK ?? 5;
2123
2289
  this.eliseThreshold = opts.eliseThreshold ?? 2e3;
2290
+ this.smart = opts.smart ?? false;
2124
2291
  }
2125
2292
  async compact(ctx, opts = {}) {
2126
2293
  const beforeTokens = estimateMessages(ctx.messages);
@@ -2192,7 +2359,7 @@ var HybridCompactor = class {
2192
2359
  if (boundary <= 0) return { saved: 0 };
2193
2360
  const removed = messages.slice(0, boundary);
2194
2361
  const removedTokens = estimateMessages(removed);
2195
- const digest = buildLosslessDigest(removed) || `${removed.length} earlier turns (no textual content; tool I/O omitted \u2014 see session log)`;
2362
+ const digest = this.smart ? buildSmartDigest(removed) || `${removed.length} earlier turns (no textual content; tool I/O omitted \u2014 see session log)` : buildLosslessDigest(removed) || `${removed.length} earlier turns (no textual content; tool I/O omitted \u2014 see session log)`;
2196
2363
  const summaryMsg = {
2197
2364
  role: "system",
2198
2365
  content: `[prior_turns_digest: ${digest}]`
@@ -4028,7 +4195,7 @@ ${excerpt}`;
4028
4195
  subjectFor(toolName, input, subjectKey) {
4029
4196
  if (!input || typeof input !== "object") return void 0;
4030
4197
  const obj = input;
4031
- const globChars = /[*?\[\]]/g;
4198
+ const globChars = /[*?[\]]/g;
4032
4199
  const escapeGlob = (s) => s.replace(globChars, (c) => `\\${c}`);
4033
4200
  const normalizePath = (s) => escapeGlob(s.replace(/\\/g, "/"));
4034
4201
  if (subjectKey) {
@@ -4990,12 +5157,12 @@ function looksSecret(name) {
4990
5157
  }
4991
5158
  function buildChildEnv(optsOrSessionId) {
4992
5159
  const opts = typeof optsOrSessionId === "string" ? { sessionId: optsOrSessionId } : optsOrSessionId ?? {};
4993
- const hasOwn = Object.prototype.hasOwnProperty.call(process.env, "WRONGSTACK_CHILD_ENV_PASSTHROUGH");
4994
- const legacyHasOwn = Object.prototype.hasOwnProperty.call(process.env, "WRONGSTACK_BASH_ENV_PASSTHROUGH");
5160
+ const hasOwn = Object.hasOwn(process.env, "WRONGSTACK_CHILD_ENV_PASSTHROUGH");
5161
+ const legacyHasOwn = Object.hasOwn(process.env, "WRONGSTACK_BASH_ENV_PASSTHROUGH");
4995
5162
  const passthrough = hasOwn && process.env["WRONGSTACK_CHILD_ENV_PASSTHROUGH"] === "1" || legacyHasOwn && process.env["WRONGSTACK_BASH_ENV_PASSTHROUGH"] === "1";
4996
5163
  if (passthrough && !process.env["CI"]) {
4997
5164
  console.warn(
4998
- "[WrongStack] WARNING: WRONGSTACK_*_ENV_PASSTHROUGH=1 is active \u2014\n all parent env vars (including API keys) forwarded to child processes.\n Do not use on shared or multi-tenant systems."
5165
+ "[agent] WARNING: WRONGSTACK_*_ENV_PASSTHROUGH=1 is active \u2014\n all parent env vars (including API keys) forwarded to child processes.\n Do not use on shared or multi-tenant systems."
4999
5166
  );
5000
5167
  }
5001
5168
  const out = {};
@@ -5102,7 +5269,7 @@ async function expandGlob(pattern) {
5102
5269
  } catch {
5103
5270
  return;
5104
5271
  }
5105
- const firstGlob = pat.search(/[*?[\[]/);
5272
+ const firstGlob = pat.search(/[*?[[]/);
5106
5273
  if (firstGlob < 0) {
5107
5274
  const re = globToRegex(pat);
5108
5275
  for (const e of entries) {
@@ -5621,7 +5788,7 @@ var DefaultSessionStore = class _DefaultSessionStore {
5621
5788
  let toolErrorCount = 0;
5622
5789
  let fileChangeCount = 0;
5623
5790
  const toolBreakdown = {};
5624
- let outcome = void 0;
5791
+ let outcome;
5625
5792
  const lastEvent = data.events[data.events.length - 1];
5626
5793
  for (const e of data.events) {
5627
5794
  if (e.type === "in_flight_start") iterationCount++;
@@ -6354,7 +6521,7 @@ var FileMemoryBackend = class {
6354
6521
  const line = `
6355
6522
  - [${entry.ts}] ${id}${meta} ${entry.text.replace(/\n/g, " ")}
6356
6523
  `;
6357
- const next = existing.trim() ? existing.replace(/\n+$/, "") + line : `# WrongStack Memory
6524
+ const next = existing.trim() ? existing.replace(/\n+$/, "") + line : `# Agent Memory
6358
6525
  ${line}`;
6359
6526
  await atomicWrite(file, next);
6360
6527
  }
@@ -6921,43 +7088,16 @@ var defaultIndexing = {
6921
7088
  watchExternal: true,
6922
7089
  debounceMs: 400
6923
7090
  };
6924
- function isPrimitiveArray(a) {
6925
- return a.every((v) => v === null || typeof v !== "object");
6926
- }
6927
- var FORBIDDEN_PROTO_KEYS2 = /* @__PURE__ */ new Set([
6928
- "__proto__",
6929
- "constructor",
6930
- "prototype",
6931
- "__defineGetter__",
6932
- "__defineSetter__",
6933
- "__lookupGetter__",
6934
- "__lookupSetter__"
6935
- ]);
6936
7091
  function deepMerge2(base, patch) {
6937
- if (typeof base !== "object" || base === null) return patch ?? base;
6938
- if (typeof patch !== "object" || patch === null) return base;
6939
- const out = { ...base };
6940
- for (const [k, v] of Object.entries(patch)) {
6941
- if (FORBIDDEN_PROTO_KEYS2.has(k)) continue;
6942
- const existing = out[k];
6943
- if (Array.isArray(v)) {
6944
- if (Array.isArray(existing) && isPrimitiveArray(v) && isPrimitiveArray(existing)) {
6945
- out[k] = [.../* @__PURE__ */ new Set([...existing, ...v])];
6946
- } else {
6947
- out[k] = v;
6948
- if (envBoolOptional(process.env.WRONGSTACK_DEBUG_CONFIG)) {
6949
- console.warn(
6950
- `[config] Non-primitive array for "${k}" replaced (global + local config merge). Global entries: ${existing?.length ?? 0}, local entries: ${v.length}.`
6951
- );
6952
- }
6953
- }
6954
- } else if (typeof v === "object" && v !== null && typeof existing === "object" && existing !== null) {
6955
- out[k] = deepMerge2(existing, v);
6956
- } else if (v !== void 0) {
6957
- out[k] = v;
6958
- }
7092
+ const opts = { arrayMode: "concat-primitives" };
7093
+ if (envBoolOptional(process.env.WRONGSTACK_DEBUG_CONFIG)) {
7094
+ opts.onNonPrimitiveArrayReplace = (key, existingLen, patchLen) => {
7095
+ console.warn(
7096
+ `[config] Non-primitive array for "${key}" replaced (global + local config merge). Global entries: ${existingLen}, local entries: ${patchLen}.`
7097
+ );
7098
+ };
6959
7099
  }
6960
- return out;
7100
+ return deepMerge(base, patch, opts);
6961
7101
  }
6962
7102
  var DefaultConfigLoader = class {
6963
7103
  paths;
@@ -8305,7 +8445,7 @@ var DefaultPermissionPolicy = class {
8305
8445
  subjectFor(toolName, input, subjectKey) {
8306
8446
  if (!input || typeof input !== "object") return void 0;
8307
8447
  const obj = input;
8308
- const globChars = /[*?\[\]]/g;
8448
+ const globChars = /[*?[\]]/g;
8309
8449
  const escapeGlob = (s) => s.replace(globChars, (c) => `\\${c}`);
8310
8450
  const normalizePath = (s) => escapeGlob(s.replace(/\\/g, "/"));
8311
8451
  if (subjectKey) {
@@ -9315,7 +9455,8 @@ function createStrategyCompactor(opts = {}) {
9315
9455
  }
9316
9456
  return new HybridCompactor({
9317
9457
  preserveK: opts.preserveK,
9318
- eliseThreshold: opts.eliseThreshold
9458
+ eliseThreshold: opts.eliseThreshold,
9459
+ smart: opts.smart
9319
9460
  });
9320
9461
  }
9321
9462
  var ProviderBackedCompactor = class {
@@ -9861,7 +10002,7 @@ function formatGoal(goal, journalLimit = 10) {
9861
10002
  return lines.join("\n");
9862
10003
  }
9863
10004
  function parseProgressFromText(text) {
9864
- const re = /\[progress:\s*(\d{1,3})%\]\s*(?:[—\-]\s*(.+))?/i;
10005
+ const re = /\[progress:\s*(\d{1,3})%\]\s*(?:[—-]\s*(.+))?/i;
9865
10006
  const m = text.match(re);
9866
10007
  if (!m) return null;
9867
10008
  const progress = Math.min(100, Math.max(0, Number.parseInt(m[1] ?? "0", 10)));
@@ -10908,6 +11049,7 @@ var SubagentBudget = class _SubagentBudget {
10908
11049
  function makeAgentSubagentRunner(opts) {
10909
11050
  const format = opts.formatTaskInput ?? defaultFormatTaskInput;
10910
11051
  return async (task, ctx) => {
11052
+ const taskStartedAt = Date.now();
10911
11053
  const factoryResult = await opts.factory(ctx.config);
10912
11054
  const { agent, events } = factoryResult;
10913
11055
  const detachFleet = opts.fleetBus?.attach(ctx.subagentId, events, task.id);
@@ -11004,7 +11146,7 @@ function makeAgentSubagentRunner(opts) {
11004
11146
  }),
11005
11147
  events.on("provider.text_delta", (e) => {
11006
11148
  ctx.budget.markActivity();
11007
- streamingTextAcc = (streamingTextAcc + e.text).slice(-200);
11149
+ streamingTextAcc = (streamingTextAcc + e.text).slice(-2e3);
11008
11150
  })
11009
11151
  );
11010
11152
  const onParentAbort = () => aborter.abort();
@@ -11012,6 +11154,15 @@ function makeAgentSubagentRunner(opts) {
11012
11154
  let result;
11013
11155
  try {
11014
11156
  result = await agent.run(format(task, ctx.config), { signal: aborter.signal });
11157
+ events.emit("subagent.task_completed", {
11158
+ subagentId: ctx.subagentId,
11159
+ taskId: task.id,
11160
+ status: result.status === "done" ? "success" : "failed",
11161
+ iterations: result.iterations,
11162
+ toolCalls: ctx.budget.usage().toolCalls,
11163
+ durationMs: Date.now() - taskStartedAt,
11164
+ finalText: result.finalText?.trim() || void 0
11165
+ });
11015
11166
  } finally {
11016
11167
  detachFleet?.();
11017
11168
  ctx.signal.removeEventListener("abort", onParentAbort);
@@ -11921,15 +12072,44 @@ Working rules:
11921
12072
  id: "e2e",
11922
12073
  name: "E2E",
11923
12074
  role: "e2e",
11924
- tools: [...TOOLS.build, "fetch"],
12075
+ tools: [
12076
+ ...TOOLS.build,
12077
+ "fetch",
12078
+ "playwright_navigate",
12079
+ "playwright_screenshot",
12080
+ "playwright_click",
12081
+ "playwright_type",
12082
+ "playwright_evaluate",
12083
+ "playwright_select_option",
12084
+ "playwright_hover",
12085
+ "playwright_fill_form",
12086
+ "playwright_wait_for",
12087
+ "playwright_press_key",
12088
+ "playwright_drag"
12089
+ ],
11925
12090
  prompt: `You are the E2E agent. Your job is end-to-end testing: drive the whole
11926
12091
  system the way a user would and verify the full flow works across boundaries.
11927
12092
 
11928
12093
  Scope:
11929
12094
  - Author end-to-end scenarios that exercise real user journeys
11930
12095
  - Drive UI/CLI/API across process and network boundaries
12096
+ - Use Playwright browser tools (navigate, click, type, screenshot, evaluate)
12097
+ to automate web UI flows \u2014 open pages, interact with forms, capture evidence
11931
12098
  - Set up and tear down realistic test state
11932
- - Capture failures with enough detail to reproduce (screenshots, logs)
12099
+ - Capture failures with enough detail to reproduce (screenshots, logs, page HTML)
12100
+
12101
+ Playwright tools available (require the "playwright" MCP server to be enabled):
12102
+ playwright_navigate(url) \u2014 open a page at the given URL
12103
+ playwright_screenshot() \u2014 capture a full-page or viewport screenshot
12104
+ playwright_click(selector) \u2014 click on an element matching a CSS selector
12105
+ playwright_type(selector, text) \u2014 type text into a focused input element
12106
+ playwright_evaluate(script) \u2014 run arbitrary JavaScript in the page context
12107
+ playwright_select_option(selector, value) \u2014 pick a <select> dropdown option
12108
+ playwright_hover(selector) \u2014 hover the mouse over an element
12109
+ playwright_fill_form(fields) \u2014 fill multiple form fields in one call
12110
+ playwright_wait_for(selector) \u2014 block until an element appears on the page
12111
+ playwright_press_key(key) \u2014 press a keyboard key (Enter, Tab, Escape, \u2026)
12112
+ playwright_drag(from, to) \u2014 drag an element from one selector to another
11933
12113
 
11934
12114
  Input format you accept:
11935
12115
  { "task": "scenario | smoke | journey", "flow": "<user journey>", "surface": "ui | cli | api" }
@@ -11943,8 +12123,10 @@ Output: Markdown e2e report:
11943
12123
  Working rules:
11944
12124
  - Test the real flow end to end; don't stub the thing under test
11945
12125
  - Make scenarios deterministic \u2014 control time, randomness, and external state
11946
- - On failure, capture artifacts (logs/screenshots) for reproduction
11947
- - Keep scenarios independent so one failure doesn't cascade`
12126
+ - On failure, capture artifacts (screenshots, page HTML, logs) for reproduction
12127
+ - Keep scenarios independent so one failure doesn't cascade
12128
+ - For browser tests: playwright_navigate first, then interact, then playwright_screenshot as evidence
12129
+ - If playwright tools are unavailable, report it and fall back to API/CLI testing`
11948
12130
  },
11949
12131
  budget: HEAVY_BUDGET,
11950
12132
  capability: {
@@ -11957,10 +12139,106 @@ Working rules:
11957
12139
  "user journey",
11958
12140
  "smoke test",
11959
12141
  "playwright",
12142
+ "browser",
12143
+ "screenshot",
12144
+ "web ui",
12145
+ "headless",
11960
12146
  "cypress",
11961
12147
  "full flow",
11962
12148
  "browser test",
11963
- "acceptance test"
12149
+ "acceptance test",
12150
+ "navigate",
12151
+ "click",
12152
+ "form fill",
12153
+ "dom",
12154
+ "page load"
12155
+ ]
12156
+ }
12157
+ },
12158
+ {
12159
+ config: {
12160
+ id: "browser",
12161
+ name: "Browser",
12162
+ role: "browser",
12163
+ tools: [
12164
+ ...TOOLS.read,
12165
+ "fetch",
12166
+ "playwright_navigate",
12167
+ "playwright_screenshot",
12168
+ "playwright_click",
12169
+ "playwright_type",
12170
+ "playwright_evaluate",
12171
+ "playwright_select_option",
12172
+ "playwright_hover",
12173
+ "playwright_fill_form",
12174
+ "playwright_wait_for",
12175
+ "playwright_press_key",
12176
+ "playwright_drag"
12177
+ ],
12178
+ prompt: `You are the Browser agent. Your job is browser automation: open web pages,
12179
+ interact with them, extract data, capture screenshots, and return structured
12180
+ results. You are a read-focused agent \u2014 you drive the browser, not the filesystem.
12181
+
12182
+ Scope:
12183
+ - Navigate to URLs and wait for pages to load
12184
+ - Take full-page or element screenshots as evidence
12185
+ - Click buttons, fill forms, select options, type text \u2014 full user simulation
12186
+ - Extract page content: text, HTML, element attributes, data tables
12187
+ - Evaluate JavaScript in the page context to extract structured data
12188
+ - Verify visual state (element visibility, text content, attribute values)
12189
+
12190
+ Playwright tools available (require the "playwright" MCP server to be enabled):
12191
+ playwright_navigate(url) \u2014 open a page at the given URL
12192
+ playwright_screenshot() \u2014 capture a full-page or viewport screenshot
12193
+ playwright_click(selector) \u2014 click on an element matching a CSS selector
12194
+ playwright_type(selector, text) \u2014 type text into a focused input element
12195
+ playwright_evaluate(script) \u2014 run arbitrary JavaScript in the page context
12196
+ playwright_select_option(selector, value) \u2014 pick a <select> dropdown option
12197
+ playwright_hover(selector) \u2014 hover the mouse over an element
12198
+ playwright_fill_form(fields) \u2014 fill multiple form fields in one call
12199
+ playwright_wait_for(selector) \u2014 block until an element appears on the page
12200
+ playwright_press_key(key) \u2014 press a keyboard key (Enter, Tab, Escape, \u2026)
12201
+ playwright_drag(from, to) \u2014 drag an element from one selector to another
12202
+
12203
+ Input format you accept:
12204
+ { "task": "navigate | screenshot | extract | interact | verify", "url": "<url>", "steps": ["step1", "step2"] }
12205
+
12206
+ Output: Structured markdown report:
12207
+ - ## Page (URL, title, load status)
12208
+ - ## Actions Taken (step-by-step with timestamps)
12209
+ - ## Results (extracted data, element states, verification results)
12210
+ - ## Screenshots (list attached screenshot references)
12211
+ - ## Errors (any failures with stack traces)
12212
+
12213
+ Working rules:
12214
+ - Always playwright_navigate first before any interaction
12215
+ - Always playwright_wait_for after navigation to ensure the page is ready
12216
+ - playwright_screenshot is your primary evidence \u2014 use it before and after interactions
12217
+ - Use playwright_evaluate for structured data extraction (JSON, text content)
12218
+ - If a selector fails, try alternative selectors before giving up
12219
+ - Report exact CSS selectors used \u2014 they're part of the evidence
12220
+ - If playwright tools are unavailable, report the error immediately \u2014 do not guess`
12221
+ },
12222
+ budget: MEDIUM_BUDGET,
12223
+ capability: {
12224
+ phase: "verify",
12225
+ summary: "Browser automation: opens pages, clicks, types, screenshots, extracts data via Playwright headless Chromium.",
12226
+ keywords: [
12227
+ "browser",
12228
+ "screenshot",
12229
+ "navigate",
12230
+ "web page",
12231
+ "scrape",
12232
+ "crawl",
12233
+ "headless",
12234
+ "chrome",
12235
+ "open url",
12236
+ "capture",
12237
+ "page title",
12238
+ "extract data",
12239
+ "fill form",
12240
+ "click button",
12241
+ "take screenshot"
11964
12242
  ]
11965
12243
  }
11966
12244
  },
@@ -15399,7 +15677,7 @@ var CollabSession = class extends EventEmitter {
15399
15677
  bugs = /* @__PURE__ */ new Map();
15400
15678
  plans = /* @__PURE__ */ new Map();
15401
15679
  evaluations = /* @__PURE__ */ new Map();
15402
- disposers = new Array();
15680
+ disposers = [];
15403
15681
  settled = false;
15404
15682
  timeoutMs;
15405
15683
  cancelled = false;
@@ -16607,7 +16885,7 @@ var FleetUsageAggregator = class {
16607
16885
  metaLookup;
16608
16886
  perSubagent = /* @__PURE__ */ new Map();
16609
16887
  total = { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, cost: 0 };
16610
- unsub = new Array();
16888
+ unsub = [];
16611
16889
  /**
16612
16890
  * Remove a terminated subagent's data from the aggregator and subtract its
16613
16891
  * contribution from the running totals. Call this when a subagent is removed
@@ -22257,6 +22535,14 @@ var zaiVisionServer = () => ({
22257
22535
  ],
22258
22536
  permission: "auto"
22259
22537
  });
22538
+ var playwrightServer = () => ({
22539
+ name: "playwright",
22540
+ description: "Browser automation \u2014 navigate, screenshot, click, type, evaluate JS (headless Chromium)",
22541
+ transport: "stdio",
22542
+ command: "npx",
22543
+ args: ["-y", "@modelcontextprotocol/server-playwright"],
22544
+ permission: "confirm"
22545
+ });
22260
22546
  var miniMaxVisionServer = () => ({
22261
22547
  name: "minimax-vision",
22262
22548
  description: "MiniMax MCP \u2014 image understanding via understand_image",
@@ -22283,7 +22569,8 @@ var allServers = () => ({
22283
22569
  "google-maps": { ...googleMapsServer(), enabled: false },
22284
22570
  sentinel: { ...sentinelServer(), enabled: false },
22285
22571
  "zai-vision": { ...zaiVisionServer(), enabled: false },
22286
- "minimax-vision": { ...miniMaxVisionServer(), enabled: false }
22572
+ "minimax-vision": { ...miniMaxVisionServer(), enabled: false },
22573
+ playwright: { ...playwrightServer(), enabled: false }
22287
22574
  });
22288
22575
  function parseSkillRef(input) {
22289
22576
  const trimmed = input.trim().replace(/^https?:\/\/github\.com\//, "").replace(/\.git$/, "");
@@ -25338,7 +25625,7 @@ var ReportGenerator = class {
25338
25625
  lines.push("");
25339
25626
  }
25340
25627
  lines.push("---");
25341
- lines.push(`*Report generated by WrongStack Security Scanner*`);
25628
+ lines.push(`*Report generated by security scanner*`);
25342
25629
  return lines.join("\n");
25343
25630
  }
25344
25631
  formatFinding(finding) {
@@ -28563,7 +28850,30 @@ Never silently skip a failure \u2014 always report it, even when you choose not
28563
28850
  - **Move on from mistakes.** When something fails, report what happened and what you'll do next. No apologies, no hand-wringing.
28564
28851
  - **Respect denied tools.** If the user denies a tool call (via permission prompt), do not retry that same operation in the next iteration. The user's "no" means "find another way or ask". Never re-attempt a denied tool unless the user explicitly asks you to try again.
28565
28852
  - **When denied, ask.** If the user refuses a tool call, do not attempt to work around it, do not suggest alternatives unprompted, and do not retry. Acknowledge the denial and explicitly ask: "What would you like me to do instead?"
28566
- - **Stay in your lane.** Don't lecture about software engineering principles unless explicitly asked \u2014 the user is the expert on their codebase.`;
28853
+ - **Stay in your lane.** Don't lecture about software engineering principles unless explicitly asked \u2014 the user is the expert on their codebase.
28854
+
28855
+ ## After-task suggestions
28856
+
28857
+ After completing a significant task, end your response with 2\u20134 suggested next
28858
+ actions under a \`\u{1F4A1} Next steps\` heading. Use this format so the user can
28859
+ select them with \`/next 1\`, \`/next 2\`, or \`/next 1 2 3\`:
28860
+
28861
+ \`\`\`
28862
+ \u{1F4A1} Next steps
28863
+ 1. First suggestion \u2014 imperative, specific, actionable
28864
+ 2. Second suggestion
28865
+ 3. Third suggestion
28866
+ \`\`\`
28867
+
28868
+ Rules:
28869
+ - Each line is a single imperative sentence the user can act on immediately.
28870
+ - Be specific: mention file names, tool names, or commands.
28871
+ - Order by priority. Keep each suggestion to one line.
28872
+ - Skip during multi-step operations \u2014 only show after completion.
28873
+ - If nothing is pending, say "No pending actions."
28874
+
28875
+ The user can execute via \`/next 1\`, view via \`/next list\`, or generate
28876
+ fresh suggestions via \`/suggest\`.`;
28567
28877
 
28568
28878
  // src/core/system-prompt-builder.ts
28569
28879
  var LAYER_1_IDENTITY = PROMPT;
@@ -31645,9 +31955,9 @@ ${check.stderr}`);
31645
31955
  if (name && email) return [];
31646
31956
  return [
31647
31957
  "-c",
31648
- `user.name=${name || "WrongStack AutoPhase"}`,
31958
+ `user.name=${name || "AutoPhase"}`,
31649
31959
  "-c",
31650
- `user.email=${email || "autophase@wrongstack.local"}`
31960
+ `user.email=${email || "autophase@agent.local"}`
31651
31961
  ];
31652
31962
  }
31653
31963
  async unmergedFiles() {
@@ -33150,6 +33460,6 @@ ${formatPlan(updated)}`
33150
33460
  };
33151
33461
  }
33152
33462
 
33153
- export { ACP_AGENTS, AGENTS_BY_PHASE, AGENT_CATALOG, AISpecBuilder, ALL_AGENT_DEFINITIONS, ALL_FLEET_AGENTS, ALL_SYNC_CATEGORIES, AUDIT_LOG_AGENT, Agent, AgentError, AnnotationsStore, AutoApprovePermissionPolicy, AutoCompactionMiddleware, AutoExecutor, AutoPhasePlanner, AutoPhaseRunner, AutonomousRunner, BUG_HUNTER_AGENT, BrainDecisionQueue, BudgetExceededError, CONTEXT_WINDOW_MODES, CORE_RECONSTRUCT_EVENTS, CheckpointManager, CloudSync, CollaborationBus, ConfigError, ConfigMigrationError, Container, Context, ConversationState, DEFAULT_AUTONOMY_CONFIG, DEFAULT_CONFIG_MIGRATIONS, DEFAULT_CONTEXT_CONFIG, DEFAULT_CONTEXT_WINDOW_MODE_ID, DEFAULT_DIRECTOR_PREAMBLE, DEFAULT_DISPATCH_ROLE, DEFAULT_MAX_ITERATIONS, DEFAULT_MODES, DEFAULT_RECOVERY_STRATEGIES, DEFAULT_SESSION_LOGGING_CONFIG, DEFAULT_SESSION_PRUNE_DAYS, DEFAULT_SPEC_TEMPLATE, DEFAULT_SUBAGENT_BASELINE, DEFAULT_TOOLS_CONFIG, DefaultAttachmentStore, DefaultBrainArbiter, DefaultConfigLoader, DefaultConfigStore, DefaultErrorHandler, DefaultHealthRegistry, DefaultLogger, DefaultMemoryStore, DefaultModeStore, DefaultModelsRegistry, DefaultMultiAgentCoordinator, DefaultPathResolver, DefaultPermissionPolicy, DefaultPluginAPI, DefaultPromptStore, DefaultProviderRunner, DefaultRetryPolicy, DefaultSecretScrubber, DefaultSecretVault, DefaultSessionReader, DefaultSessionRewinder, DefaultSessionStore, DefaultSkillLoader, DefaultSystemPromptBuilder, DefaultTaskStore, DefaultTokenCounter, Director, DirectorStateCheckpoint, DoneConditionChecker, ENHANCER_SYSTEM_PROMPT, ERROR_CODES, EternalAutonomyEngine, EventBus, ExtensionRegistry, FLEET_ROSTER, FLEET_ROSTER_BUDGETS, FLEET_ROSTER_WITHACP, FileMemoryBackend, FleetBus, FleetCostCapError, FleetManager, FleetSpawnBudgetError, FleetUsageAggregator, FsError, GitignoreUpdater, GraphMemoryBackend, HookRegistry, HookRunner, HumanEscalatingBrainArbiter, HybridCompactor, InMemoryAgentBridge, InMemoryBridgeTransport, InMemoryMetricsSink, InputBuilder, IntelligentCompactor, KERNEL_API_VERSION, LAYER_1_IDENTITY, LLMSelector, MATRIX_PHASE_KEYS, MAX_JOURNAL_ENTRIES, MAX_PROGRESS_HISTORY, MEMORY_TYPE_LABELS, NULL_FLEET_BUS, NoopMetricsSink, NoopTracer, OTelTracer, ObservableBrainArbiter, PROMETHEUS_CONTENT_TYPE, ParallelEternalEngine, PhaseGraphBuilder, PhaseOrchestrator, PhaseStore, Pipeline, PluginError, ProviderError, ProviderRegistry, QueueStore, REFACTOR_PLANNER_AGENT, RecoveryLock, ReplayLogStore, ReplayProviderRunner, ReportGenerator, RunController, SECURITY_SCANNER_AGENT, SPEC_TEMPLATES, STANDARD_AUDIT_EVENTS, ScopedEventBus, SddParallelRun, SddTaskDecomposer, SecurityScanner, SecurityScannerOrchestrator, SelectiveCompactor, SessionAnalyzer, SessionError, SessionMemoryConsolidator, SessionRecovery, SkillGenerator, SkillInstaller, SkillManifestStore, SlashCommandRegistry, SpecDrivenDev, SpecParser, SpecStore, SpecVersioning, StreamHangError, SubagentBudget, TOKENS, TaskFlow, TaskGenerator, TaskGraphStore, TaskTracker, TechStackDetector, ToolAuditLog, ToolError, ToolExecutor, ToolRegistry, WorktreeManager, WrongStackError, addPlanItem, allServers, analyzeCriticalPath, appendJournal, applyRosterBudget, asBlocks, asText, assertNever, assertSafePath, atomicWrite, attachAutoExtend, attachPlanCheckpoint, attachTodosCheckpoint, awsServer, blockServer, bootConfig, braveSearchServer, buildBtwBlock, buildChildEnv, buildGoalPreamble, buildOtlpMetricsRequest, buildOtlpTracesRequest, buildRecoveryStrategies, classifyFamily, clearPlan, collabInjectMiddleware, collabPauseMiddleware, color, compileGlob, compileUserRegex, completePartialObject, composeDirectorPrompt, composeSubagentPrompt, computeTaskItemProgress, computeTaskProgress, consumeBtwNotes, context7Server, contextManagerTool, createAutoExecutor, createAutoPhaseFromTaskGraph, createContextManagerTool, createDefaultPipelines, createDelegateTool, createGitPlugin, createMcpControlTool, createMessage, createObservabilityPlugin, createPlanPlugin, createPromptsPlugin, createSecurityPlugin, createSecuritySlashCommand, createSessionEventBridge, createSkillsPlugin, createStrategyCompactor, createSyncPlugin, createToolOutputSerializer, decryptConfigSecrets, defaultGitignoreUpdater, defaultOrchestrator, defaultReportGenerator, defaultSecurityScanner, defaultSkillGenerator, defaultTechStackDetector, deriveTodosFromPlanItem, detectNewlineStyle, dispatchAgent, downloadGitHubTarball, emptyGoal, emptyPlan, emptyTaskFile, encryptConfigSecrets, enhanceUserPrompt, ensureDir, estimateMessageTokens, estimateRequestTokens, estimateRequestTokensCalibrated, estimateTextTokens, estimateToolDefTokens, estimateToolInputTokens, estimateToolResultTokens, everArtServer, expandGlob, expectDefined, extractRunEnv, filesystemServer, findCriticalPath, flagsToConfigPatch, formatContextWindowModeList, formatGoal, formatHumanPrompt, formatPlan, formatPlanTemplates, formatTaskList, formatTaskProgress, formatTodosList, getAgentDefinition, getCalibrationState, getContextWindowMode, getPlanTemplate, getTemplate, getTermSize, githubServer, goalFilePath, googleMapsServer, hashRequest, hookMatcherMatches, isAgentError, isConfigError, isContextWindowModeId, isFsError, isImageBlock, isInteractive, isPluginError, isSecretField, isSessionError, isStdinTTY, isStdoutTTY, isTextBlock, isThinkingBlock, isToolError, isToolResultBlock, isToolUseBlock, isValidMatrixKey, isWrongStackError, listContextWindowModes, listPlanTemplates, listTemplates, loadDirectorState, loadGoal, loadPlan, loadPlugins, loadProjectModes, loadTasks, loadTodosCheckpoint, loadUserModes, makeAgentSubagentRunner, makeAskTool, makeAssignTool, makeAutonomyPromptContributor, makeAwaitTasksTool, makeCollabDebugTool, makeContinueToNextIterationTool, makeDirectorSessionFactory, makeFleetEmitTool, makeFleetHealthTool, makeFleetSessionTool, makeFleetStatusTool, makeFleetUsageTool, makeLLMClassifier, makeRollUpTool, makeSpawnTool, makeTerminateTool, matchAny, matchGlob, matrixKeyKind, mergeCustomModelDefs, mergeModelsPayload, migratePlaintextSecrets, miniMaxVisionServer, normalizeToLf, normalizedEqual, onResize, parseContinueDirective, parseEntries, parseProgressFromText, parseSkillRef, pendingBtwCount, phaseForRole, projectHash, projectSlug, recentTextTurns, recordActualUsage, recordProgress, removePlanItem, renderProgress, renderPrometheus, renderSpecAnalysis, renderTaskGraph, renderTaskList, repairToolUseAdjacency, resetCalibration, resolveAuditLevel, resolveContextWindowPolicy, resolveModelMatrix, resolveSessionLoggingConfig, resolveWstackPaths, rewriteConfigEncrypted, rosterSummaryFromConfigs, runConfigMigrations, runProviderWithRetry, runShellHook, safeParse, safeStringify, sanitizeJsonString, saveGoal, savePlan, saveTasks, saveTodosCheckpoint, scoreAgents, securitySlashCommand, sentinelServer, setBtwNote, setOutputLineGuard, setPlanItemStatus, setProgress, setRawMode, shouldEnhance, slackServer, sleep, stableStringify, startMetricsServer, startOtlpMetricsExporter, startOtlpTraceExporter, stripAnsi, summarizeUsage, templateToMarkdown, toStyle, toWrongStackError, topologicalSort, unifiedDiff, unloadPlugins, validateAgainstSchema, wireMetricsToEvents, withFileLock, wrapAsState, writeErr, writeOut, zaiVisionServer };
33463
+ export { ACP_AGENTS, AGENTS_BY_PHASE, AGENT_CATALOG, AISpecBuilder, ALL_AGENT_DEFINITIONS, ALL_FLEET_AGENTS, ALL_SYNC_CATEGORIES, AUDIT_LOG_AGENT, Agent, AgentError, AnnotationsStore, AutoApprovePermissionPolicy, AutoCompactionMiddleware, AutoExecutor, AutoPhasePlanner, AutoPhaseRunner, AutonomousRunner, BUG_HUNTER_AGENT, BrainDecisionQueue, BudgetExceededError, CONTEXT_WINDOW_MODES, CORE_RECONSTRUCT_EVENTS, CheckpointManager, CloudSync, CollaborationBus, ConfigError, ConfigMigrationError, Container, Context, ConversationState, DEFAULT_AUTONOMY_CONFIG, DEFAULT_CONFIG_MIGRATIONS, DEFAULT_CONTEXT_CONFIG, DEFAULT_CONTEXT_WINDOW_MODE_ID, DEFAULT_DIRECTOR_PREAMBLE, DEFAULT_DISPATCH_ROLE, DEFAULT_MAX_ITERATIONS, DEFAULT_MODES, DEFAULT_RECOVERY_STRATEGIES, DEFAULT_SESSION_LOGGING_CONFIG, DEFAULT_SESSION_PRUNE_DAYS, DEFAULT_SPEC_TEMPLATE, DEFAULT_SUBAGENT_BASELINE, DEFAULT_TOOLS_CONFIG, DefaultAttachmentStore, DefaultBrainArbiter, DefaultConfigLoader, DefaultConfigStore, DefaultErrorHandler, DefaultHealthRegistry, DefaultLogger, DefaultMemoryStore, DefaultModeStore, DefaultModelsRegistry, DefaultMultiAgentCoordinator, DefaultPathResolver, DefaultPermissionPolicy, DefaultPluginAPI, DefaultPromptStore, DefaultProviderRunner, DefaultRetryPolicy, DefaultSecretScrubber, DefaultSecretVault, DefaultSessionReader, DefaultSessionRewinder, DefaultSessionStore, DefaultSkillLoader, DefaultSystemPromptBuilder, DefaultTaskStore, DefaultTokenCounter, Director, DirectorStateCheckpoint, DoneConditionChecker, ENHANCER_SYSTEM_PROMPT, ERROR_CODES, EternalAutonomyEngine, EventBus, ExtensionRegistry, FLEET_ROSTER, FLEET_ROSTER_BUDGETS, FLEET_ROSTER_WITHACP, FORBIDDEN_PROTO_KEYS, FileMemoryBackend, FleetBus, FleetCostCapError, FleetManager, FleetSpawnBudgetError, FleetUsageAggregator, FsError, GitignoreUpdater, GraphMemoryBackend, HookRegistry, HookRunner, HumanEscalatingBrainArbiter, HybridCompactor, InMemoryAgentBridge, InMemoryBridgeTransport, InMemoryMetricsSink, InputBuilder, IntelligentCompactor, KERNEL_API_VERSION, LAYER_1_IDENTITY, LLMSelector, MATRIX_PHASE_KEYS, MAX_JOURNAL_ENTRIES, MAX_PROGRESS_HISTORY, MEMORY_TYPE_LABELS, NULL_FLEET_BUS, NoopMetricsSink, NoopTracer, OTelTracer, ObservableBrainArbiter, PROMETHEUS_CONTENT_TYPE, ParallelEternalEngine, PhaseGraphBuilder, PhaseOrchestrator, PhaseStore, Pipeline, PluginError, ProviderError, ProviderRegistry, QueueStore, REFACTOR_PLANNER_AGENT, RecoveryLock, ReplayLogStore, ReplayProviderRunner, ReportGenerator, RunController, SECURITY_SCANNER_AGENT, SPEC_TEMPLATES, STANDARD_AUDIT_EVENTS, ScopedEventBus, SddParallelRun, SddTaskDecomposer, SecurityScanner, SecurityScannerOrchestrator, SelectiveCompactor, SessionAnalyzer, SessionError, SessionMemoryConsolidator, SessionRecovery, SkillGenerator, SkillInstaller, SkillManifestStore, SlashCommandRegistry, SpecDrivenDev, SpecParser, SpecStore, SpecVersioning, StreamHangError, SubagentBudget, TOKENS, TaskFlow, TaskGenerator, TaskGraphStore, TaskTracker, TechStackDetector, ToolAuditLog, ToolError, ToolExecutor, ToolRegistry, WorktreeManager, WrongStackError, addPlanItem, allServers, analyzeCriticalPath, appendJournal, applyRosterBudget, asBlocks, asText, assertNever, assertSafePath, atomicWrite, attachAutoExtend, attachPlanCheckpoint, attachTodosCheckpoint, awsServer, blockServer, bootConfig, braveSearchServer, buildBtwBlock, buildChildEnv, buildGoalPreamble, buildOtlpMetricsRequest, buildOtlpTracesRequest, buildRecoveryStrategies, classifyFamily, clearPlan, collabInjectMiddleware, collabPauseMiddleware, color, compileGlob, compileUserRegex, completePartialObject, composeDirectorPrompt, composeSubagentPrompt, computeTaskItemProgress, computeTaskProgress, consumeBtwNotes, context7Server, contextManagerTool, createAutoExecutor, createAutoPhaseFromTaskGraph, createContextManagerTool, createDefaultPipelines, createDelegateTool, createGitPlugin, createMcpControlTool, createMessage, createObservabilityPlugin, createPlanPlugin, createPromptsPlugin, createSecurityPlugin, createSecuritySlashCommand, createSessionEventBridge, createSkillsPlugin, createStrategyCompactor, createSyncPlugin, createToolOutputSerializer, decryptConfigSecrets, deepMerge, defaultGitignoreUpdater, defaultOrchestrator, defaultReportGenerator, defaultSecurityScanner, defaultSkillGenerator, defaultTechStackDetector, deriveTodosFromPlanItem, detectNewlineStyle, dispatchAgent, downloadGitHubTarball, emptyGoal, emptyPlan, emptyTaskFile, encryptConfigSecrets, enhanceUserPrompt, ensureDir, estimateMessageTokens, estimateRequestTokens, estimateRequestTokensCalibrated, estimateTextTokens, estimateToolDefTokens, estimateToolInputTokens, estimateToolResultTokens, everArtServer, expandGlob, expectDefined, extractRunEnv, filesystemServer, findCriticalPath, flagsToConfigPatch, formatContextWindowModeList, formatGoal, formatHumanPrompt, formatPlan, formatPlanTemplates, formatTaskList, formatTaskProgress, formatTodosList, getAgentDefinition, getCalibrationState, getContextWindowMode, getPlanTemplate, getTemplate, getTermSize, githubServer, goalFilePath, googleMapsServer, hashRequest, hookMatcherMatches, isAgentError, isConfigError, isContextWindowModeId, isFsError, isImageBlock, isInteractive, isPluginError, isPrimitiveArray, isSecretField, isSessionError, isStdinTTY, isStdoutTTY, isTextBlock, isThinkingBlock, isToolError, isToolResultBlock, isToolUseBlock, isValidMatrixKey, isWrongStackError, listContextWindowModes, listPlanTemplates, listTemplates, loadDirectorState, loadGoal, loadPlan, loadPlugins, loadProjectModes, loadTasks, loadTodosCheckpoint, loadUserModes, makeAgentSubagentRunner, makeAskTool, makeAssignTool, makeAutonomyPromptContributor, makeAwaitTasksTool, makeCollabDebugTool, makeContinueToNextIterationTool, makeDirectorSessionFactory, makeFleetEmitTool, makeFleetHealthTool, makeFleetSessionTool, makeFleetStatusTool, makeFleetUsageTool, makeLLMClassifier, makeRollUpTool, makeSpawnTool, makeTerminateTool, matchAny, matchGlob, matrixKeyKind, mergeCustomModelDefs, mergeModelsPayload, migratePlaintextSecrets, miniMaxVisionServer, noOpVault, normalizeToLf, normalizedEqual, onResize, parseContinueDirective, parseEntries, parseProgressFromText, parseSkillRef, pendingBtwCount, phaseForRole, projectHash, projectSlug, recentTextTurns, recordActualUsage, recordProgress, removePlanItem, renderProgress, renderPrometheus, renderSpecAnalysis, renderTaskGraph, renderTaskList, repairToolUseAdjacency, resetCalibration, resolveAuditLevel, resolveContextWindowPolicy, resolveModelMatrix, resolveSessionLoggingConfig, resolveWstackPaths, rewriteConfigEncrypted, rosterSummaryFromConfigs, runConfigMigrations, runProviderWithRetry, runShellHook, safeParse, safeStringify, sanitizeJsonString, saveGoal, savePlan, saveTasks, saveTodosCheckpoint, scoreAgents, securitySlashCommand, sentinelServer, setBtwNote, setOutputLineGuard, setPlanItemStatus, setProgress, setRawMode, shouldEnhance, slackServer, sleep, stableStringify, startMetricsServer, startOtlpMetricsExporter, startOtlpTraceExporter, stripAnsi, summarizeUsage, templateToMarkdown, toStyle, toWrongStackError, topologicalSort, unifiedDiff, unloadPlugins, validateAgainstSchema, wireMetricsToEvents, withFileLock, wrapAsState, writeErr, writeOut, zaiVisionServer };
33154
33464
  //# sourceMappingURL=index.js.map
33155
33465
  //# sourceMappingURL=index.js.map