poe-code 3.0.216 → 3.0.218

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 (71) hide show
  1. package/dist/index.js +727 -372
  2. package/dist/index.js.map +4 -4
  3. package/dist/providers/claude-code.js +20 -11
  4. package/dist/providers/claude-code.js.map +4 -4
  5. package/dist/providers/codex.js +20 -11
  6. package/dist/providers/codex.js.map +4 -4
  7. package/dist/providers/goose.js +20 -11
  8. package/dist/providers/goose.js.map +4 -4
  9. package/dist/providers/kimi.js +20 -11
  10. package/dist/providers/kimi.js.map +4 -4
  11. package/dist/providers/opencode.js +20 -11
  12. package/dist/providers/opencode.js.map +4 -4
  13. package/dist/providers/poe-agent.js +569 -239
  14. package/dist/providers/poe-agent.js.map +4 -4
  15. package/package.json +3 -1
  16. package/packages/design-system/dist/dashboard/buffer.js +8 -1
  17. package/packages/design-system/dist/dashboard/keymap.d.ts +5 -0
  18. package/packages/design-system/dist/dashboard/keymap.js +146 -12
  19. package/packages/design-system/dist/dashboard/terminal.js +31 -0
  20. package/packages/design-system/dist/dashboard/types.d.ts +1 -0
  21. package/packages/design-system/dist/explorer/actions.d.ts +16 -0
  22. package/packages/design-system/dist/explorer/actions.js +39 -0
  23. package/packages/design-system/dist/explorer/demo.d.ts +13 -0
  24. package/packages/design-system/dist/explorer/demo.js +297 -0
  25. package/packages/design-system/dist/explorer/events.d.ts +61 -0
  26. package/packages/design-system/dist/explorer/events.js +1 -0
  27. package/packages/design-system/dist/explorer/filter.d.ts +10 -0
  28. package/packages/design-system/dist/explorer/filter.js +95 -0
  29. package/packages/design-system/dist/explorer/index.d.ts +8 -0
  30. package/packages/design-system/dist/explorer/index.js +8 -0
  31. package/packages/design-system/dist/explorer/jobs.d.ts +7 -0
  32. package/packages/design-system/dist/explorer/jobs.js +59 -0
  33. package/packages/design-system/dist/explorer/keymap.d.ts +21 -0
  34. package/packages/design-system/dist/explorer/keymap.js +363 -0
  35. package/packages/design-system/dist/explorer/layout.d.ts +20 -0
  36. package/packages/design-system/dist/explorer/layout.js +73 -0
  37. package/packages/design-system/dist/explorer/reducer.d.ts +9 -0
  38. package/packages/design-system/dist/explorer/reducer.js +704 -0
  39. package/packages/design-system/dist/explorer/render/detail.d.ts +4 -0
  40. package/packages/design-system/dist/explorer/render/detail.js +96 -0
  41. package/packages/design-system/dist/explorer/render/footer.d.ts +4 -0
  42. package/packages/design-system/dist/explorer/render/footer.js +49 -0
  43. package/packages/design-system/dist/explorer/render/header.d.ts +4 -0
  44. package/packages/design-system/dist/explorer/render/header.js +56 -0
  45. package/packages/design-system/dist/explorer/render/index.d.ts +8 -0
  46. package/packages/design-system/dist/explorer/render/index.js +61 -0
  47. package/packages/design-system/dist/explorer/render/list.d.ts +4 -0
  48. package/packages/design-system/dist/explorer/render/list.js +106 -0
  49. package/packages/design-system/dist/explorer/render/modal.d.ts +3 -0
  50. package/packages/design-system/dist/explorer/render/modal.js +91 -0
  51. package/packages/design-system/dist/explorer/render/test-fixtures.d.ts +8 -0
  52. package/packages/design-system/dist/explorer/render/test-fixtures.js +156 -0
  53. package/packages/design-system/dist/explorer/runtime.d.ts +2 -0
  54. package/packages/design-system/dist/explorer/runtime.js +282 -0
  55. package/packages/design-system/dist/explorer/runtime.test-helpers.d.ts +50 -0
  56. package/packages/design-system/dist/explorer/runtime.test-helpers.js +101 -0
  57. package/packages/design-system/dist/explorer/state.d.ts +130 -0
  58. package/packages/design-system/dist/explorer/state.js +87 -0
  59. package/packages/design-system/dist/explorer/theme.d.ts +27 -0
  60. package/packages/design-system/dist/explorer/theme.js +97 -0
  61. package/packages/design-system/dist/index.d.ts +3 -0
  62. package/packages/design-system/dist/index.js +3 -0
  63. package/packages/memory/dist/index.js +9 -0
  64. package/packages/memory/dist/index.js.map +3 -3
  65. package/packages/superintendent/dist/commands/builder-group.d.ts +16 -16
  66. package/packages/superintendent/dist/commands/complete.d.ts +6 -6
  67. package/packages/superintendent/dist/commands/inspector-group.d.ts +36 -36
  68. package/packages/superintendent/dist/commands/install.d.ts +6 -6
  69. package/packages/superintendent/dist/commands/plan-path.d.ts +2 -2
  70. package/packages/superintendent/dist/commands/run.d.ts +60 -60
  71. package/packages/superintendent/dist/commands/superintendent-group.d.ts +146 -146
package/dist/index.js CHANGED
@@ -16556,6 +16556,9 @@ function cellToAnsi(cell) {
16556
16556
  if (style.dim) {
16557
16557
  painter = painter.dim;
16558
16558
  }
16559
+ if (style.underline) {
16560
+ painter = painter.underline;
16561
+ }
16559
16562
  if (style.fg) {
16560
16563
  painter = applyForegroundColor(painter, style.fg);
16561
16564
  }
@@ -16588,13 +16591,16 @@ function normalizeStyle(style) {
16588
16591
  if (style?.dim !== void 0) {
16589
16592
  next.dim = style.dim;
16590
16593
  }
16594
+ if (style?.underline !== void 0) {
16595
+ next.underline = style.underline;
16596
+ }
16591
16597
  return next;
16592
16598
  }
16593
16599
  function normalizeSize(value) {
16594
16600
  return Math.max(0, Math.floor(value));
16595
16601
  }
16596
16602
  function cellsEqual(left, right) {
16597
- return left.ch === right.ch && left.style.fg === right.style.fg && left.style.bg === right.style.bg && left.style.bold === right.style.bold && left.style.dim === right.style.dim;
16603
+ return left.ch === right.ch && left.style.fg === right.style.fg && left.style.bg === right.style.bg && left.style.bold === right.style.bold && left.style.dim === right.style.dim && left.style.underline === right.style.underline;
16598
16604
  }
16599
16605
  function applyForegroundColor(instance, color) {
16600
16606
  if (color.startsWith("#")) {
@@ -17604,24 +17610,60 @@ var init_stats_pane = __esm({
17604
17610
  });
17605
17611
 
17606
17612
  // packages/design-system/src/dashboard/keymap.ts
17607
- function createKeymap(overrides) {
17613
+ function createKeymap(overrides, options) {
17614
+ const resolvedCommands = options?.commands ?? commands;
17615
+ const resolvedDefaults = options?.defaultBindings ?? defaultBindings;
17608
17616
  const bindings = /* @__PURE__ */ new Map();
17609
- for (const command of commands) {
17610
- const keys = overrides?.[command] ?? defaultBindings[command];
17611
- bindings.set(
17612
- command,
17613
- keys.map(parseBinding).filter((binding) => binding !== void 0)
17614
- );
17617
+ const sequences = /* @__PURE__ */ new Set();
17618
+ let pendingSequence = "";
17619
+ for (const command of resolvedCommands) {
17620
+ const keys = overrides?.[command] ?? resolvedDefaults[command];
17621
+ const commandBindings = keys.map(parseBinding).filter((binding) => binding !== void 0);
17622
+ for (const binding of commandBindings) {
17623
+ if (binding.sequence !== void 0) {
17624
+ sequences.add(binding.sequence);
17625
+ }
17626
+ }
17627
+ bindings.set(command, commandBindings);
17615
17628
  }
17616
17629
  return (event) => {
17617
- for (const command of commands) {
17630
+ for (const command of resolvedCommands) {
17618
17631
  const commandBindings = bindings.get(command);
17619
- if (commandBindings?.some((binding) => matches(binding, event))) {
17632
+ if (commandBindings?.some((binding) => matchesSingleKey(binding, event))) {
17633
+ pendingSequence = "";
17620
17634
  return command;
17621
17635
  }
17622
17636
  }
17637
+ const sequenceCommand = resolveSequence(event);
17638
+ if (sequenceCommand !== void 0) {
17639
+ return sequenceCommand;
17640
+ }
17623
17641
  return void 0;
17624
17642
  };
17643
+ function resolveSequence(event) {
17644
+ const token = eventToSequenceToken(event);
17645
+ if (token === void 0) {
17646
+ pendingSequence = "";
17647
+ return void 0;
17648
+ }
17649
+ pendingSequence = `${pendingSequence}${token}`;
17650
+ for (const command of resolvedCommands) {
17651
+ const commandBindings = bindings.get(command);
17652
+ if (commandBindings?.some((binding) => binding.sequence === pendingSequence)) {
17653
+ pendingSequence = "";
17654
+ return command;
17655
+ }
17656
+ }
17657
+ if (hasSequencePrefix(sequences, pendingSequence)) {
17658
+ return void 0;
17659
+ }
17660
+ pendingSequence = token;
17661
+ if (hasSequencePrefix(sequences, pendingSequence)) {
17662
+ return void 0;
17663
+ }
17664
+ pendingSequence = "";
17665
+ return void 0;
17666
+ }
17625
17667
  }
17626
17668
  function parseBinding(binding) {
17627
17669
  const value = binding.trim();
@@ -17654,25 +17696,37 @@ function parseBinding(binding) {
17654
17696
  continue;
17655
17697
  }
17656
17698
  }
17657
- if (parts.length === 1 && isShiftedCharacter(key2)) {
17699
+ const normalizedKey = normalizeKeyName(key2);
17700
+ if (parts.length === 1 && isShiftedCharacter(normalizedKey)) {
17658
17701
  shift = true;
17659
17702
  }
17660
- if (key2.length === 1) {
17703
+ if (normalizedKey.length === 1) {
17704
+ return {
17705
+ ch: normalizeBindingCharacter(normalizedKey, shift),
17706
+ ctrl,
17707
+ meta,
17708
+ shift
17709
+ };
17710
+ }
17711
+ if (!ctrl && !meta && !shift && !isNamedKey(normalizedKey) && isPrintableSequence(normalizedKey)) {
17661
17712
  return {
17662
- ch: normalizeBindingCharacter(key2, shift),
17713
+ sequence: normalizedKey,
17663
17714
  ctrl,
17664
17715
  meta,
17665
17716
  shift
17666
17717
  };
17667
17718
  }
17668
17719
  return {
17669
- name: key2.toLowerCase(),
17720
+ name: normalizedKey.toLowerCase(),
17670
17721
  ctrl,
17671
17722
  meta,
17672
17723
  shift
17673
17724
  };
17674
17725
  }
17675
- function matches(binding, event) {
17726
+ function matchesSingleKey(binding, event) {
17727
+ if (binding.sequence !== void 0) {
17728
+ return false;
17729
+ }
17676
17730
  if (binding.ctrl !== event.ctrl || binding.meta !== event.meta || binding.shift !== event.shift) {
17677
17731
  return false;
17678
17732
  }
@@ -17684,6 +17738,20 @@ function matches(binding, event) {
17684
17738
  }
17685
17739
  return false;
17686
17740
  }
17741
+ function eventToSequenceToken(event) {
17742
+ if (event.ctrl || event.meta || event.ch === void 0) {
17743
+ return void 0;
17744
+ }
17745
+ return event.ch;
17746
+ }
17747
+ function hasSequencePrefix(sequences, prefix) {
17748
+ for (const sequence of sequences) {
17749
+ if (sequence.startsWith(prefix)) {
17750
+ return true;
17751
+ }
17752
+ }
17753
+ return false;
17754
+ }
17687
17755
  function isShiftedCharacter(value) {
17688
17756
  return value.length === 1 && value.toLowerCase() !== value && value.toUpperCase() === value;
17689
17757
  }
@@ -17693,7 +17761,40 @@ function normalizeBindingCharacter(value, shift) {
17693
17761
  }
17694
17762
  return value.toUpperCase();
17695
17763
  }
17696
- var commands, defaultBindings;
17764
+ function normalizeKeyName(value) {
17765
+ if (value.toLowerCase() === "space") {
17766
+ return " ";
17767
+ }
17768
+ if (value === "\u2191") {
17769
+ return "up";
17770
+ }
17771
+ if (value === "\u2193") {
17772
+ return "down";
17773
+ }
17774
+ if (value === "\u2190") {
17775
+ return "left";
17776
+ }
17777
+ if (value === "\u2192") {
17778
+ return "right";
17779
+ }
17780
+ return value;
17781
+ }
17782
+ function isNamedKey(value) {
17783
+ return namedKeys.has(value.toLowerCase());
17784
+ }
17785
+ function isPrintableSequence(value) {
17786
+ if (Array.from(value).length <= 1) {
17787
+ return false;
17788
+ }
17789
+ for (const char of value) {
17790
+ const codePoint = char.codePointAt(0);
17791
+ if (codePoint === void 0 || codePoint < 32 || codePoint === 127) {
17792
+ return false;
17793
+ }
17794
+ }
17795
+ return true;
17796
+ }
17797
+ var commands, defaultBindings, namedKeys;
17697
17798
  var init_keymap = __esm({
17698
17799
  "packages/design-system/src/dashboard/keymap.ts"() {
17699
17800
  "use strict";
@@ -17706,6 +17807,22 @@ var init_keymap = __esm({
17706
17807
  retry: ["r"],
17707
17808
  "view-log": ["l"]
17708
17809
  };
17810
+ namedKeys = /* @__PURE__ */ new Set([
17811
+ "backspace",
17812
+ "delete",
17813
+ "down",
17814
+ "end",
17815
+ "enter",
17816
+ "escape",
17817
+ "home",
17818
+ "left",
17819
+ "pagedown",
17820
+ "pageup",
17821
+ "return",
17822
+ "right",
17823
+ "tab",
17824
+ "up"
17825
+ ]);
17709
17826
  }
17710
17827
  });
17711
17828
 
@@ -18027,6 +18144,10 @@ function createTerminalDriver(opts) {
18027
18144
  };
18028
18145
  }
18029
18146
  function toKeypressEvent(str2, key2) {
18147
+ const controlCharacter = controlCharacterToKeypress(key2?.sequence);
18148
+ if (controlCharacter !== void 0) {
18149
+ return controlCharacter;
18150
+ }
18030
18151
  const ctrl = key2?.ctrl ?? false;
18031
18152
  const meta = key2?.meta ?? false;
18032
18153
  const shift = key2?.shift ?? false;
@@ -18048,12 +18169,22 @@ function extractPrintableCharacter(str2, sequence) {
18048
18169
  if (isPrintableCharacter(str2)) {
18049
18170
  return str2;
18050
18171
  }
18172
+ if (isSinglePrintableSequence(sequence)) {
18173
+ return sequence;
18174
+ }
18051
18175
  if (sequence === void 0 || sequence.length <= 1 || sequence[0] !== "\x1B") {
18052
18176
  return void 0;
18053
18177
  }
18054
18178
  const candidate = sequence.slice(1);
18055
18179
  return isPrintableCharacter(candidate) ? candidate : void 0;
18056
18180
  }
18181
+ function isSinglePrintableSequence(value) {
18182
+ if (value === void 0 || Array.from(value).length !== 1) {
18183
+ return false;
18184
+ }
18185
+ const codePoint = value.codePointAt(0);
18186
+ return codePoint !== void 0 && codePoint >= 32 && codePoint !== 127;
18187
+ }
18057
18188
  function isPrintableCharacter(value) {
18058
18189
  if (value === void 0 || Array.from(value).length !== 1) {
18059
18190
  return false;
@@ -18061,6 +18192,23 @@ function isPrintableCharacter(value) {
18061
18192
  const codePoint = value.codePointAt(0);
18062
18193
  return codePoint !== void 0 && codePoint >= 32 && codePoint !== 127;
18063
18194
  }
18195
+ function controlCharacterToKeypress(sequence) {
18196
+ if (sequence === "") {
18197
+ return { ch: "/", ctrl: true, meta: false, shift: false };
18198
+ }
18199
+ if (sequence !== void 0 && sequence.length === 1) {
18200
+ const code = sequence.charCodeAt(0);
18201
+ if (code >= 1 && code <= 26 && code !== 9 && code !== 10 && code !== 13) {
18202
+ return {
18203
+ name: String.fromCharCode(code + 96),
18204
+ ctrl: true,
18205
+ meta: false,
18206
+ shift: false
18207
+ };
18208
+ }
18209
+ }
18210
+ return void 0;
18211
+ }
18064
18212
  function cursorPositionAnsi(x, y) {
18065
18213
  return `\x1B[${normalizeCoordinate(y) + 1};${normalizeCoordinate(x) + 1}H`;
18066
18214
  }
@@ -18291,6 +18439,158 @@ var init_dashboard2 = __esm({
18291
18439
  }
18292
18440
  });
18293
18441
 
18442
+ // packages/design-system/src/explorer/jobs.ts
18443
+ var init_jobs2 = __esm({
18444
+ "packages/design-system/src/explorer/jobs.ts"() {
18445
+ "use strict";
18446
+ }
18447
+ });
18448
+
18449
+ // packages/design-system/src/explorer/layout.ts
18450
+ var init_layout2 = __esm({
18451
+ "packages/design-system/src/explorer/layout.ts"() {
18452
+ "use strict";
18453
+ }
18454
+ });
18455
+
18456
+ // packages/design-system/src/explorer/keymap.ts
18457
+ var init_keymap2 = __esm({
18458
+ "packages/design-system/src/explorer/keymap.ts"() {
18459
+ "use strict";
18460
+ }
18461
+ });
18462
+
18463
+ // packages/design-system/src/explorer/state.ts
18464
+ var REGION_HEADER, REGION_LIST, REGION_DETAIL, REGION_FOOTER, REGION_MODAL, REGION_TOAST, REGION_ALL;
18465
+ var init_state3 = __esm({
18466
+ "packages/design-system/src/explorer/state.ts"() {
18467
+ "use strict";
18468
+ init_keymap2();
18469
+ REGION_HEADER = 1 << 0;
18470
+ REGION_LIST = 1 << 1;
18471
+ REGION_DETAIL = 1 << 2;
18472
+ REGION_FOOTER = 1 << 3;
18473
+ REGION_MODAL = 1 << 4;
18474
+ REGION_TOAST = 1 << 5;
18475
+ REGION_ALL = REGION_HEADER | REGION_LIST | REGION_DETAIL | REGION_FOOTER | REGION_MODAL | REGION_TOAST;
18476
+ }
18477
+ });
18478
+
18479
+ // packages/design-system/src/explorer/theme.ts
18480
+ var init_theme = __esm({
18481
+ "packages/design-system/src/explorer/theme.ts"() {
18482
+ "use strict";
18483
+ }
18484
+ });
18485
+
18486
+ // packages/design-system/src/explorer/render/detail.ts
18487
+ var init_detail = __esm({
18488
+ "packages/design-system/src/explorer/render/detail.ts"() {
18489
+ "use strict";
18490
+ init_theme();
18491
+ }
18492
+ });
18493
+
18494
+ // packages/design-system/src/explorer/render/footer.ts
18495
+ var init_footer2 = __esm({
18496
+ "packages/design-system/src/explorer/render/footer.ts"() {
18497
+ "use strict";
18498
+ init_theme();
18499
+ }
18500
+ });
18501
+
18502
+ // packages/design-system/src/explorer/render/header.ts
18503
+ var init_header = __esm({
18504
+ "packages/design-system/src/explorer/render/header.ts"() {
18505
+ "use strict";
18506
+ init_theme();
18507
+ }
18508
+ });
18509
+
18510
+ // packages/design-system/src/explorer/render/list.ts
18511
+ var init_list = __esm({
18512
+ "packages/design-system/src/explorer/render/list.ts"() {
18513
+ "use strict";
18514
+ init_theme();
18515
+ }
18516
+ });
18517
+
18518
+ // packages/design-system/src/explorer/render/modal.ts
18519
+ var init_modal = __esm({
18520
+ "packages/design-system/src/explorer/render/modal.ts"() {
18521
+ "use strict";
18522
+ init_theme();
18523
+ }
18524
+ });
18525
+
18526
+ // packages/design-system/src/explorer/render/index.ts
18527
+ var init_render2 = __esm({
18528
+ "packages/design-system/src/explorer/render/index.ts"() {
18529
+ "use strict";
18530
+ init_layout2();
18531
+ init_state3();
18532
+ init_theme();
18533
+ init_detail();
18534
+ init_footer2();
18535
+ init_header();
18536
+ init_list();
18537
+ init_modal();
18538
+ init_detail();
18539
+ init_footer2();
18540
+ init_header();
18541
+ init_list();
18542
+ init_modal();
18543
+ }
18544
+ });
18545
+
18546
+ // packages/design-system/src/explorer/actions.ts
18547
+ var init_actions = __esm({
18548
+ "packages/design-system/src/explorer/actions.ts"() {
18549
+ "use strict";
18550
+ }
18551
+ });
18552
+
18553
+ // packages/design-system/src/explorer/filter.ts
18554
+ var init_filter = __esm({
18555
+ "packages/design-system/src/explorer/filter.ts"() {
18556
+ "use strict";
18557
+ }
18558
+ });
18559
+
18560
+ // packages/design-system/src/explorer/reducer.ts
18561
+ var init_reducer = __esm({
18562
+ "packages/design-system/src/explorer/reducer.ts"() {
18563
+ "use strict";
18564
+ init_actions();
18565
+ init_filter();
18566
+ init_state3();
18567
+ }
18568
+ });
18569
+
18570
+ // packages/design-system/src/explorer/runtime.ts
18571
+ var init_runtime3 = __esm({
18572
+ "packages/design-system/src/explorer/runtime.ts"() {
18573
+ "use strict";
18574
+ init_buffer();
18575
+ init_terminal();
18576
+ init_jobs2();
18577
+ init_layout2();
18578
+ init_render2();
18579
+ init_reducer();
18580
+ init_state3();
18581
+ }
18582
+ });
18583
+
18584
+ // packages/design-system/src/explorer/index.ts
18585
+ var init_explorer = __esm({
18586
+ "packages/design-system/src/explorer/index.ts"() {
18587
+ "use strict";
18588
+ init_runtime3();
18589
+ init_state3();
18590
+ init_keymap2();
18591
+ }
18592
+ });
18593
+
18294
18594
  // packages/design-system/src/prompts/primitives/cancel.ts
18295
18595
  import chalk10 from "chalk";
18296
18596
  import { isCancel } from "@clack/prompts";
@@ -18649,7 +18949,7 @@ var init_prompts = __esm({
18649
18949
  });
18650
18950
 
18651
18951
  // packages/design-system/src/prompts/theme.ts
18652
- var init_theme = __esm({
18952
+ var init_theme2 = __esm({
18653
18953
  "packages/design-system/src/prompts/theme.ts"() {
18654
18954
  "use strict";
18655
18955
  init_colors();
@@ -18696,9 +18996,11 @@ var init_src11 = __esm({
18696
18996
  init_acp();
18697
18997
  init_dashboard2();
18698
18998
  init_dashboard2();
18999
+ init_explorer();
19000
+ init_explorer();
18699
19001
  init_prompts();
18700
19002
  init_prompts();
18701
- init_theme();
19003
+ init_theme2();
18702
19004
  init_static();
18703
19005
  init_static();
18704
19006
  init_terminal_markdown();
@@ -23420,9 +23722,9 @@ function getOptionalGrepOutputMode(args, key2) {
23420
23722
  function formatDisplayPath(cwd, filePath) {
23421
23723
  return path28.relative(cwd, filePath) || path28.basename(filePath);
23422
23724
  }
23423
- async function sortPathsByModifiedTime(matches2, fs20) {
23725
+ async function sortPathsByModifiedTime(matches, fs20) {
23424
23726
  const entries = await Promise.all(
23425
- matches2.map(async (match) => ({
23727
+ matches.map(async (match) => ({
23426
23728
  path: match,
23427
23729
  mtimeMs: (await fs20.stat(match)).mtimeMs
23428
23730
  }))
@@ -23807,12 +24109,12 @@ var init_poe_agent_plugin_files = __esm({
23807
24109
  allowedPaths,
23808
24110
  getOptionalString(args, "path") ?? "."
23809
24111
  );
23810
- const matches2 = await globFiles({
24112
+ const matches = await globFiles({
23811
24113
  pattern: getRequiredString(args, "pattern"),
23812
24114
  cwd: searchPath
23813
24115
  });
23814
24116
  const sortedMatches = await sortPathsByModifiedTime(
23815
- matches2.map((match) => resolveAllowedPath(cwd, allowedPaths, match)),
24117
+ matches.map((match) => resolveAllowedPath(cwd, allowedPaths, match)),
23816
24118
  fs20
23817
24119
  );
23818
24120
  if (sortedMatches.length === 0) {
@@ -33414,22 +33716,22 @@ function walkUnion(schema2, value, path111, state) {
33414
33716
  return walkObject(candidateBranches[0], value, path111, state);
33415
33717
  }
33416
33718
  }
33417
- const matches2 = [];
33719
+ const matches = [];
33418
33720
  for (const branch of schema2.branches) {
33419
33721
  const branchState = { issues: [] };
33420
33722
  const result = walkObject(branch, value, path111, branchState);
33421
33723
  if (branchState.issues.length === 0 && result.present) {
33422
- matches2.push(result.value);
33724
+ matches.push(result.value);
33423
33725
  }
33424
33726
  }
33425
- if (matches2.length === 1) {
33426
- return { present: true, value: matches2[0] };
33727
+ if (matches.length === 1) {
33728
+ return { present: true, value: matches[0] };
33427
33729
  }
33428
33730
  addIssue(
33429
33731
  state,
33430
33732
  path111,
33431
33733
  "exactly one union branch",
33432
- matches2.length === 0 ? "no matching branches" : `${matches2.length} matching branches`,
33734
+ matches.length === 0 ? "no matching branches" : `${matches.length} matching branches`,
33433
33735
  `Expected exactly one union branch at ${formatPath(path111)}`
33434
33736
  );
33435
33737
  return { present: true, value };
@@ -35182,7 +35484,7 @@ var init_client = __esm({
35182
35484
  }
35183
35485
  });
35184
35486
 
35185
- // packages/braintrust/src/redact.ts
35487
+ // packages/acp-telemetry/src/redact.ts
35186
35488
  function redact(value) {
35187
35489
  const serialized = JSON.stringify(value);
35188
35490
  if (serialized !== void 0) {
@@ -35219,7 +35521,7 @@ function redactLeaf(value) {
35219
35521
  }
35220
35522
  var MAX_STRING_BYTES, MAX_JSON_BYTES, BINARY_SCAN_BYTES;
35221
35523
  var init_redact = __esm({
35222
- "packages/braintrust/src/redact.ts"() {
35524
+ "packages/acp-telemetry/src/redact.ts"() {
35223
35525
  "use strict";
35224
35526
  MAX_STRING_BYTES = 65536;
35225
35527
  MAX_JSON_BYTES = 262144;
@@ -35227,6 +35529,249 @@ var init_redact = __esm({
35227
35529
  }
35228
35530
  });
35229
35531
 
35532
+ // packages/acp-telemetry/src/trace.ts
35533
+ function acpToTrace(ctx) {
35534
+ const spawnCtx = ctx;
35535
+ return {
35536
+ root: {
35537
+ name: `agent:${ctx.agent}:${ctx.model ?? "?"}`,
35538
+ kind: "agent",
35539
+ input: redact({
35540
+ prompt: ctx.prompt,
35541
+ mode: ctx.mode,
35542
+ cwd: ctx.cwd
35543
+ }),
35544
+ output: redact(accumulateAgentOutput(ctx.events)),
35545
+ metadata: {
35546
+ sessionId: ctx.sessionId,
35547
+ threadId: ctx.threadId,
35548
+ ...spawnCtx.metadata
35549
+ },
35550
+ metrics: buildMetrics(ctx),
35551
+ children: logToolSpans(ctx.events)
35552
+ }
35553
+ };
35554
+ }
35555
+ function logToolSpans(events) {
35556
+ const spans = [];
35557
+ for (const [index, event] of events.entries()) {
35558
+ const toolCall = asToolCall(event);
35559
+ if (toolCall === void 0) {
35560
+ continue;
35561
+ }
35562
+ const metadata = collectToolMeta(events, index, readString7(toolCall.toolCallId));
35563
+ spans.push({
35564
+ name: `tool_call:${readString7(toolCall.kind) ?? "unknown"}`,
35565
+ kind: "tool",
35566
+ input: redact(readToolInput(toolCall)),
35567
+ output: redact(assembleToolOutput(events, index, readString7(toolCall.toolCallId))),
35568
+ ...metadata ? { metadata } : {},
35569
+ ...readSpanTimestamps(metadata),
35570
+ children: []
35571
+ });
35572
+ }
35573
+ return spans;
35574
+ }
35575
+ function collectToolMeta(events, toolCallIndex, toolCallId) {
35576
+ const merged = {};
35577
+ const startMeta = asRecord3(asRecord3(events[toolCallIndex])?._meta);
35578
+ if (startMeta) {
35579
+ for (const [key2, value] of Object.entries(startMeta)) {
35580
+ merged[key2 === "ts" ? "startTs" : key2] = value;
35581
+ }
35582
+ }
35583
+ for (const event of events.slice(toolCallIndex + 1)) {
35584
+ const update = asToolCallUpdate(event);
35585
+ if (update === void 0) continue;
35586
+ if (toolCallId !== void 0 && update.toolCallId !== toolCallId) continue;
35587
+ const updateMeta = asRecord3(update._meta);
35588
+ if (!updateMeta) continue;
35589
+ for (const [key2, value] of Object.entries(updateMeta)) {
35590
+ merged[key2 === "ts" ? "endTs" : key2] = value;
35591
+ }
35592
+ }
35593
+ return Object.keys(merged).length > 0 ? merged : void 0;
35594
+ }
35595
+ function accumulateAgentOutput(events) {
35596
+ let output = "";
35597
+ for (const event of events) {
35598
+ const record = asRecord3(event);
35599
+ if (record === void 0) {
35600
+ continue;
35601
+ }
35602
+ if (record.event === "agent_message") {
35603
+ output += readString7(record.text) ?? "";
35604
+ continue;
35605
+ }
35606
+ if (record.sessionUpdate === "agent_message_chunk") {
35607
+ output += readContentText(record.content);
35608
+ }
35609
+ }
35610
+ return output;
35611
+ }
35612
+ function assembleToolOutput(events, toolCallIndex, toolCallId) {
35613
+ const outputs = [];
35614
+ let text5 = "";
35615
+ for (const event of events.slice(toolCallIndex + 1)) {
35616
+ const update = asToolCallUpdate(event);
35617
+ if (update === void 0) {
35618
+ continue;
35619
+ }
35620
+ if (toolCallId !== void 0 && update.toolCallId !== toolCallId) {
35621
+ continue;
35622
+ }
35623
+ if (Object.hasOwn(update, "rawOutput")) {
35624
+ outputs.push(update.rawOutput);
35625
+ }
35626
+ const contentText = readContentText(update.content);
35627
+ if (contentText.length > 0) {
35628
+ text5 += contentText;
35629
+ }
35630
+ }
35631
+ if (outputs.length === 0) {
35632
+ return text5;
35633
+ }
35634
+ if (text5.length > 0) {
35635
+ outputs.push(text5);
35636
+ }
35637
+ return outputs.length === 1 ? outputs[0] : outputs;
35638
+ }
35639
+ function buildMetrics(ctx) {
35640
+ const usage = ctx.usage;
35641
+ const metrics = {};
35642
+ const promptTokens = readNumber2(usage.prompt_tokens) ?? readNumber2(usage.inputTokens);
35643
+ const completionTokens = readNumber2(usage.completion_tokens) ?? readNumber2(usage.outputTokens);
35644
+ addMetric(metrics, "prompt_tokens", promptTokens);
35645
+ addMetric(metrics, "completion_tokens", completionTokens);
35646
+ addMetric(
35647
+ metrics,
35648
+ "tokens",
35649
+ readNumber2(usage.tokens) ?? sumIfPresent(promptTokens, completionTokens)
35650
+ );
35651
+ addMetric(
35652
+ metrics,
35653
+ "prompt_cached_tokens",
35654
+ readNumber2(usage.prompt_cached_tokens) ?? readNumber2(usage.cachedTokens)
35655
+ );
35656
+ addMetric(
35657
+ metrics,
35658
+ "prompt_cache_creation_tokens",
35659
+ readNumber2(usage.prompt_cache_creation_tokens)
35660
+ );
35661
+ addMetric(metrics, "durationMs", readNumber2(usage.durationMs));
35662
+ return metrics;
35663
+ }
35664
+ function asToolCall(event) {
35665
+ const record = asRecord3(event);
35666
+ return record?.sessionUpdate === "tool_call" ? record : void 0;
35667
+ }
35668
+ function asToolCallUpdate(event) {
35669
+ const record = asRecord3(event);
35670
+ return record?.sessionUpdate === "tool_call_update" ? record : void 0;
35671
+ }
35672
+ function readToolInput(toolCall) {
35673
+ if (Object.hasOwn(toolCall, "input")) {
35674
+ return toolCall.input;
35675
+ }
35676
+ return toolCall.rawInput;
35677
+ }
35678
+ function readContentText(value) {
35679
+ if (Array.isArray(value)) {
35680
+ return value.map(readContentText).join("");
35681
+ }
35682
+ const record = asRecord3(value);
35683
+ if (record === void 0 || record.type !== "text") {
35684
+ return "";
35685
+ }
35686
+ return readString7(record.text) ?? "";
35687
+ }
35688
+ function readSpanTimestamps(metadata) {
35689
+ if (metadata === void 0) {
35690
+ return {};
35691
+ }
35692
+ const startTs = readNumber2(metadata.startTs);
35693
+ const endTs = readNumber2(metadata.endTs);
35694
+ return {
35695
+ ...startTs !== void 0 ? { startTs } : {},
35696
+ ...endTs !== void 0 ? { endTs } : {}
35697
+ };
35698
+ }
35699
+ function asRecord3(value) {
35700
+ return typeof value === "object" && value !== null ? value : void 0;
35701
+ }
35702
+ function readString7(value) {
35703
+ return typeof value === "string" ? value : void 0;
35704
+ }
35705
+ function readNumber2(value) {
35706
+ return typeof value === "number" && Number.isFinite(value) ? value : void 0;
35707
+ }
35708
+ function addMetric(metrics, key2, value) {
35709
+ if (value !== void 0) {
35710
+ metrics[key2] = value;
35711
+ }
35712
+ }
35713
+ function sumIfPresent(left, right) {
35714
+ return left !== void 0 && right !== void 0 ? left + right : void 0;
35715
+ }
35716
+ var init_trace = __esm({
35717
+ "packages/acp-telemetry/src/trace.ts"() {
35718
+ "use strict";
35719
+ init_redact();
35720
+ }
35721
+ });
35722
+
35723
+ // packages/acp-telemetry/src/emit-braintrust.ts
35724
+ function emitToBraintrust(trace, parent) {
35725
+ const root = parent.startSpan({ name: trace.root.name, type: "task" });
35726
+ try {
35727
+ emitSpan(root, trace.root);
35728
+ } finally {
35729
+ root.end();
35730
+ }
35731
+ }
35732
+ function emitSpan(span, traceSpan) {
35733
+ span.log(toBraintrustLogEvent(traceSpan));
35734
+ for (const child of traceSpan.children) {
35735
+ const childSpan = span.startSpan({ name: child.name, type: "tool" });
35736
+ try {
35737
+ emitSpan(childSpan, child);
35738
+ } finally {
35739
+ childSpan.end();
35740
+ }
35741
+ }
35742
+ }
35743
+ function toBraintrustLogEvent(span) {
35744
+ return {
35745
+ ...Object.hasOwn(span, "input") ? { input: span.input } : {},
35746
+ ...Object.hasOwn(span, "output") ? { output: span.output } : {},
35747
+ ...Object.hasOwn(span, "metadata") ? { metadata: span.metadata } : {},
35748
+ ...Object.hasOwn(span, "metrics") ? { metrics: span.metrics } : {}
35749
+ };
35750
+ }
35751
+ var init_emit_braintrust = __esm({
35752
+ "packages/acp-telemetry/src/emit-braintrust.ts"() {
35753
+ "use strict";
35754
+ }
35755
+ });
35756
+
35757
+ // packages/acp-telemetry/src/emit-otel.ts
35758
+ var init_emit_otel = __esm({
35759
+ "packages/acp-telemetry/src/emit-otel.ts"() {
35760
+ "use strict";
35761
+ }
35762
+ });
35763
+
35764
+ // packages/acp-telemetry/src/index.ts
35765
+ var init_src19 = __esm({
35766
+ "packages/acp-telemetry/src/index.ts"() {
35767
+ "use strict";
35768
+ init_redact();
35769
+ init_trace();
35770
+ init_emit_braintrust();
35771
+ init_emit_otel();
35772
+ }
35773
+ });
35774
+
35230
35775
  // packages/braintrust/src/row-builder.ts
35231
35776
  function makePipelineRowState(client) {
35232
35777
  const rows = /* @__PURE__ */ new Map();
@@ -35382,8 +35927,8 @@ async function openCurrentChildSpan(client, args, ctx) {
35382
35927
  }
35383
35928
  }
35384
35929
  function buildPipelineCompletionLog(started, completed) {
35385
- const startRecord = asRecord3(started) ?? {};
35386
- const completeRecord = asRecord3(completed) ?? {};
35930
+ const startRecord = asRecord4(started) ?? {};
35931
+ const completeRecord = asRecord4(completed) ?? {};
35387
35932
  return {
35388
35933
  input: redact({
35389
35934
  step_name: readPipelineStep(started),
@@ -35406,7 +35951,7 @@ function buildPipelineCompletionLog(started, completed) {
35406
35951
  };
35407
35952
  }
35408
35953
  function buildSuperintendentLog(role, result) {
35409
- const record = asRecord3(result);
35954
+ const record = asRecord4(result);
35410
35955
  const event = {
35411
35956
  input: redact(record?.input),
35412
35957
  output: redact(record?.output ?? result)
@@ -35420,7 +35965,7 @@ function buildSuperintendentLog(role, result) {
35420
35965
  return event;
35421
35966
  }
35422
35967
  function buildExperimentLog(row, entry) {
35423
- const entryRecord = asRecord3(entry) ?? {};
35968
+ const entryRecord = asRecord4(entry) ?? {};
35424
35969
  const scores = buildExperimentScores(row.baseline, entry.scores);
35425
35970
  const metrics = { ...row.metrics };
35426
35971
  if (Number.isFinite(entry.durationMs)) {
@@ -35449,12 +35994,12 @@ function buildPipelineMetrics(progress) {
35449
35994
  const metrics = {};
35450
35995
  const usage = progress.usage;
35451
35996
  if (usage !== void 0) {
35452
- addMetric(metrics, "prompt_tokens", usage.inputTokens);
35453
- addMetric(metrics, "completion_tokens", usage.outputTokens);
35454
- addMetric(metrics, "tokens", usage.inputTokens + usage.outputTokens);
35455
- addMetric(metrics, "prompt_cached_tokens", usage.cachedTokens);
35997
+ addMetric2(metrics, "prompt_tokens", usage.inputTokens);
35998
+ addMetric2(metrics, "completion_tokens", usage.outputTokens);
35999
+ addMetric2(metrics, "tokens", usage.inputTokens + usage.outputTokens);
36000
+ addMetric2(metrics, "prompt_cached_tokens", usage.cachedTokens);
35456
36001
  }
35457
- addMetric(metrics, "durationMs", progress.durationMs);
36002
+ addMetric2(metrics, "durationMs", progress.durationMs);
35458
36003
  return metrics;
35459
36004
  }
35460
36005
  function buildExperimentScores(baseline, scores) {
@@ -35531,7 +36076,7 @@ function asSpanParent(value) {
35531
36076
  }
35532
36077
  return span;
35533
36078
  }
35534
- function asRecord3(value) {
36079
+ function asRecord4(value) {
35535
36080
  return typeof value === "object" && value !== null ? value : void 0;
35536
36081
  }
35537
36082
  function readFirstString(record, keys) {
@@ -35546,7 +36091,7 @@ function readFirstValue(record, keys) {
35546
36091
  }
35547
36092
  return void 0;
35548
36093
  }
35549
- function addMetric(metrics, key2, value) {
36094
+ function addMetric2(metrics, key2, value) {
35550
36095
  if (value !== void 0 && Number.isFinite(value)) {
35551
36096
  metrics[key2] = value;
35552
36097
  }
@@ -35554,7 +36099,7 @@ function addMetric(metrics, key2, value) {
35554
36099
  var init_row_builder = __esm({
35555
36100
  "packages/braintrust/src/row-builder.ts"() {
35556
36101
  "use strict";
35557
- init_redact();
36102
+ init_src19();
35558
36103
  }
35559
36104
  });
35560
36105
 
@@ -35616,203 +36161,6 @@ var init_pipeline = __esm({
35616
36161
  }
35617
36162
  });
35618
36163
 
35619
- // packages/braintrust/src/span-builder.ts
35620
- async function logSpawnSession(client, ctx) {
35621
- try {
35622
- const { currentSpan } = await import("braintrust");
35623
- const agentSpan = asSpanParent2(currentSpan()).startSpan({
35624
- name: `agent:${ctx.agent}:${ctx.model ?? "?"}`,
35625
- type: "task"
35626
- });
35627
- try {
35628
- logToolSpans(agentSpan, ctx.events);
35629
- agentSpan.log({
35630
- input: redact({
35631
- prompt: ctx.prompt,
35632
- mode: ctx.mode,
35633
- cwd: ctx.cwd
35634
- }),
35635
- output: redact(accumulateAgentOutput(ctx.events)),
35636
- metadata: {
35637
- sessionId: ctx.sessionId,
35638
- threadId: ctx.threadId,
35639
- ...ctx.metadata
35640
- },
35641
- metrics: buildMetrics(ctx)
35642
- });
35643
- } finally {
35644
- agentSpan.end();
35645
- }
35646
- } catch (err) {
35647
- client.recordError(err, "log spawn session");
35648
- }
35649
- }
35650
- function logToolSpans(agentSpan, events) {
35651
- for (const [index, event] of events.entries()) {
35652
- const toolCall = asToolCall(event);
35653
- if (toolCall === void 0) {
35654
- continue;
35655
- }
35656
- const toolSpan = agentSpan.startSpan({
35657
- name: `tool_call:${readString7(toolCall.kind) ?? "unknown"}`,
35658
- type: "tool"
35659
- });
35660
- try {
35661
- const metadata = collectToolMeta(events, index, readString7(toolCall.toolCallId));
35662
- toolSpan.log({
35663
- input: redact(readToolInput(toolCall)),
35664
- output: redact(assembleToolOutput(events, index, readString7(toolCall.toolCallId))),
35665
- ...metadata ? { metadata } : {}
35666
- });
35667
- } finally {
35668
- toolSpan.end();
35669
- }
35670
- }
35671
- }
35672
- function collectToolMeta(events, toolCallIndex, toolCallId) {
35673
- const merged = {};
35674
- const startMeta = asRecord4(asRecord4(events[toolCallIndex])?._meta);
35675
- if (startMeta) {
35676
- for (const [key2, value] of Object.entries(startMeta)) {
35677
- merged[key2 === "ts" ? "startTs" : key2] = value;
35678
- }
35679
- }
35680
- for (const event of events.slice(toolCallIndex + 1)) {
35681
- const update = asToolCallUpdate(event);
35682
- if (update === void 0) continue;
35683
- if (toolCallId !== void 0 && update.toolCallId !== toolCallId) continue;
35684
- const updateMeta = asRecord4(update._meta);
35685
- if (!updateMeta) continue;
35686
- for (const [key2, value] of Object.entries(updateMeta)) {
35687
- merged[key2 === "ts" ? "endTs" : key2] = value;
35688
- }
35689
- }
35690
- return Object.keys(merged).length > 0 ? merged : void 0;
35691
- }
35692
- function accumulateAgentOutput(events) {
35693
- let output = "";
35694
- for (const event of events) {
35695
- const record = asRecord4(event);
35696
- if (record === void 0) {
35697
- continue;
35698
- }
35699
- if (record.event === "agent_message") {
35700
- output += readString7(record.text) ?? "";
35701
- continue;
35702
- }
35703
- if (record.sessionUpdate === "agent_message_chunk") {
35704
- output += readContentText(record.content);
35705
- }
35706
- }
35707
- return output;
35708
- }
35709
- function assembleToolOutput(events, toolCallIndex, toolCallId) {
35710
- const outputs = [];
35711
- let text5 = "";
35712
- for (const event of events.slice(toolCallIndex + 1)) {
35713
- const update = asToolCallUpdate(event);
35714
- if (update === void 0) {
35715
- continue;
35716
- }
35717
- if (toolCallId !== void 0 && update.toolCallId !== toolCallId) {
35718
- continue;
35719
- }
35720
- if (Object.hasOwn(update, "rawOutput")) {
35721
- outputs.push(update.rawOutput);
35722
- }
35723
- const contentText = readContentText(update.content);
35724
- if (contentText.length > 0) {
35725
- text5 += contentText;
35726
- }
35727
- }
35728
- if (outputs.length === 0) {
35729
- return text5;
35730
- }
35731
- if (text5.length > 0) {
35732
- outputs.push(text5);
35733
- }
35734
- return outputs.length === 1 ? outputs[0] : outputs;
35735
- }
35736
- function buildMetrics(ctx) {
35737
- const usage = ctx.usage;
35738
- const metrics = {};
35739
- const promptTokens = readNumber2(usage.prompt_tokens) ?? readNumber2(usage.inputTokens);
35740
- const completionTokens = readNumber2(usage.completion_tokens) ?? readNumber2(usage.outputTokens);
35741
- addMetric2(metrics, "prompt_tokens", promptTokens);
35742
- addMetric2(metrics, "completion_tokens", completionTokens);
35743
- addMetric2(
35744
- metrics,
35745
- "tokens",
35746
- readNumber2(usage.tokens) ?? sumIfPresent(promptTokens, completionTokens)
35747
- );
35748
- addMetric2(
35749
- metrics,
35750
- "prompt_cached_tokens",
35751
- readNumber2(usage.prompt_cached_tokens) ?? readNumber2(usage.cachedTokens)
35752
- );
35753
- addMetric2(
35754
- metrics,
35755
- "prompt_cache_creation_tokens",
35756
- readNumber2(usage.prompt_cache_creation_tokens)
35757
- );
35758
- addMetric2(metrics, "durationMs", readNumber2(usage.durationMs));
35759
- return metrics;
35760
- }
35761
- function asSpanParent2(value) {
35762
- const span = value;
35763
- if (span === void 0 || typeof span.startSpan !== "function") {
35764
- throw new Error("Braintrust current span unavailable");
35765
- }
35766
- return span;
35767
- }
35768
- function asToolCall(event) {
35769
- const record = asRecord4(event);
35770
- return record?.sessionUpdate === "tool_call" ? record : void 0;
35771
- }
35772
- function asToolCallUpdate(event) {
35773
- const record = asRecord4(event);
35774
- return record?.sessionUpdate === "tool_call_update" ? record : void 0;
35775
- }
35776
- function readToolInput(toolCall) {
35777
- if (Object.hasOwn(toolCall, "input")) {
35778
- return toolCall.input;
35779
- }
35780
- return toolCall.rawInput;
35781
- }
35782
- function readContentText(value) {
35783
- if (Array.isArray(value)) {
35784
- return value.map(readContentText).join("");
35785
- }
35786
- const record = asRecord4(value);
35787
- if (record === void 0 || record.type !== "text") {
35788
- return "";
35789
- }
35790
- return readString7(record.text) ?? "";
35791
- }
35792
- function asRecord4(value) {
35793
- return typeof value === "object" && value !== null ? value : void 0;
35794
- }
35795
- function readString7(value) {
35796
- return typeof value === "string" ? value : void 0;
35797
- }
35798
- function readNumber2(value) {
35799
- return typeof value === "number" && Number.isFinite(value) ? value : void 0;
35800
- }
35801
- function addMetric2(metrics, key2, value) {
35802
- if (value !== void 0) {
35803
- metrics[key2] = value;
35804
- }
35805
- }
35806
- function sumIfPresent(left, right) {
35807
- return left !== void 0 && right !== void 0 ? left + right : void 0;
35808
- }
35809
- var init_span_builder = __esm({
35810
- "packages/braintrust/src/span-builder.ts"() {
35811
- "use strict";
35812
- init_redact();
35813
- }
35814
- });
35815
-
35816
36164
  // packages/braintrust/src/adapters/spawn.ts
35817
36165
  function createSpawnMiddleware(client) {
35818
36166
  return async (ctx, next) => {
@@ -35826,14 +36174,19 @@ function createSpawnMiddleware(client) {
35826
36174
  };
35827
36175
  throw err;
35828
36176
  } finally {
35829
- await logSpawnSession(client, ctx);
36177
+ try {
36178
+ const { currentSpan } = await import("braintrust");
36179
+ emitToBraintrust(acpToTrace(ctx), currentSpan());
36180
+ } catch (err) {
36181
+ client.recordError(err, "log spawn session");
36182
+ }
35830
36183
  }
35831
36184
  };
35832
36185
  }
35833
36186
  var init_spawn3 = __esm({
35834
36187
  "packages/braintrust/src/adapters/spawn.ts"() {
35835
36188
  "use strict";
35836
- init_span_builder();
36189
+ init_src19();
35837
36190
  }
35838
36191
  });
35839
36192
 
@@ -35863,7 +36216,7 @@ function createSuperintendentCallbacks(client) {
35863
36216
  async function logFailedRole(client, role, error2, name) {
35864
36217
  try {
35865
36218
  const { currentSpan } = await import("braintrust");
35866
- const span = asSpanParent3(currentSpan()).startSpan({
36219
+ const span = asSpanParent2(currentSpan()).startSpan({
35867
36220
  name: name === void 0 ? `role:${role}:failed` : `role:${role}:${name}:failed`,
35868
36221
  type: "task"
35869
36222
  });
@@ -35885,7 +36238,7 @@ async function logFailedRole(client, role, error2, name) {
35885
36238
  client.recordError(err, `superintendent ${role} failed`);
35886
36239
  }
35887
36240
  }
35888
- function asSpanParent3(value) {
36241
+ function asSpanParent2(value) {
35889
36242
  const span = value;
35890
36243
  if (span === void 0 || typeof span.startSpan !== "function") {
35891
36244
  throw new Error("Braintrust current span unavailable");
@@ -35972,7 +36325,7 @@ async function loadIntegrations(config) {
35972
36325
  var init_load_integrations = __esm({
35973
36326
  "packages/braintrust/src/load-integrations.ts"() {
35974
36327
  "use strict";
35975
- init_src19();
36328
+ init_src20();
35976
36329
  }
35977
36330
  });
35978
36331
 
@@ -36005,7 +36358,7 @@ function requiredString(value, field) {
36005
36358
  }
36006
36359
  throw new Error(`Braintrust integration is enabled but ${field} is missing`);
36007
36360
  }
36008
- var init_src19 = __esm({
36361
+ var init_src20 = __esm({
36009
36362
  "packages/braintrust/src/index.ts"() {
36010
36363
  "use strict";
36011
36364
  init_client();
@@ -36914,7 +37267,7 @@ var init_run = __esm({
36914
37267
  init_src17();
36915
37268
  init_src11();
36916
37269
  init_src6();
36917
- init_src19();
37270
+ init_src20();
36918
37271
  init_config_scope();
36919
37272
  init_parse2();
36920
37273
  init_loop();
@@ -37284,7 +37637,7 @@ var init_commands = __esm({
37284
37637
  });
37285
37638
 
37286
37639
  // packages/superintendent/src/index.ts
37287
- var init_src20 = __esm({
37640
+ var init_src21 = __esm({
37288
37641
  "packages/superintendent/src/index.ts"() {
37289
37642
  "use strict";
37290
37643
  init_parse2();
@@ -37487,7 +37840,7 @@ var init_config4 = __esm({
37487
37840
  init_src4();
37488
37841
  init_src6();
37489
37842
  init_src15();
37490
- init_src20();
37843
+ init_src21();
37491
37844
  coreConfigScope = defineScope("core", {
37492
37845
  apiKey: {
37493
37846
  type: "string",
@@ -38202,7 +38555,7 @@ var init_resolve3 = __esm({
38202
38555
  });
38203
38556
 
38204
38557
  // packages/workspace-resolver/src/index.ts
38205
- var init_src21 = __esm({
38558
+ var init_src22 = __esm({
38206
38559
  "packages/workspace-resolver/src/index.ts"() {
38207
38560
  "use strict";
38208
38561
  init_parse3();
@@ -38242,7 +38595,7 @@ async function resolveSpawnWorkspace(candidate, options) {
38242
38595
  var init_resolve_spawn_workspace = __esm({
38243
38596
  "src/workspace/resolve-spawn-workspace.ts"() {
38244
38597
  "use strict";
38245
- init_src21();
38598
+ init_src22();
38246
38599
  }
38247
38600
  });
38248
38601
 
@@ -38985,7 +39338,7 @@ var init_oauth_client = __esm({
38985
39338
  });
38986
39339
 
38987
39340
  // packages/poe-oauth/src/index.ts
38988
- var init_src22 = __esm({
39341
+ var init_src23 = __esm({
38989
39342
  "packages/poe-oauth/src/index.ts"() {
38990
39343
  "use strict";
38991
39344
  init_check_auth();
@@ -39324,7 +39677,7 @@ function createLoggerFactory(emitter, theme) {
39324
39677
  return;
39325
39678
  }
39326
39679
  const maxWidth = Math.min(process.stdout.columns || 80, 80) - 6;
39327
- const wrapped = steps.map((step) => wrapText3(step, maxWidth)).join("\n");
39680
+ const wrapped = steps.map((step2) => wrapText3(step2, maxWidth)).join("\n");
39328
39681
  note(wrapped, "Next steps.");
39329
39682
  },
39330
39683
  feedback(label, url) {
@@ -39743,7 +40096,7 @@ var init_anthropic = __esm({
39743
40096
  });
39744
40097
 
39745
40098
  // packages/providers/src/index.ts
39746
- var init_src23 = __esm({
40099
+ var init_src24 = __esm({
39747
40100
  "packages/providers/src/index.ts"() {
39748
40101
  "use strict";
39749
40102
  init_registry3();
@@ -40265,13 +40618,13 @@ var init_container = __esm({
40265
40618
  init_service_registry();
40266
40619
  init_context();
40267
40620
  init_prompts3();
40268
- init_src22();
40621
+ init_src23();
40269
40622
  init_options();
40270
40623
  init_logger2();
40271
40624
  init_error_logger();
40272
40625
  init_src13();
40273
40626
  await init_providers();
40274
- init_src23();
40627
+ init_src24();
40275
40628
  init_poe_code_command_runner();
40276
40629
  init_src();
40277
40630
  }
@@ -40536,7 +40889,7 @@ var init_spawn4 = __esm({
40536
40889
  await init_container();
40537
40890
  init_autonomous2();
40538
40891
  init_src13();
40539
- init_src19();
40892
+ init_src20();
40540
40893
  init_shared();
40541
40894
  init_resolve_spawn_workspace();
40542
40895
  spawn8.pretty = async function pretty(service, promptOrOptions, maybeOptions) {
@@ -41386,12 +41739,12 @@ function describeExecutionContext(selection) {
41386
41739
  return selection.stepName ? `task "${selection.task.id}" step "${selection.stepName}"` : `task "${selection.task.id}"`;
41387
41740
  }
41388
41741
  async function resolveFileIncludes(template2, cwd, readFile49) {
41389
- const matches2 = [...template2.matchAll(FILE_INCLUDE_PATTERN)];
41390
- if (matches2.length === 0) {
41742
+ const matches = [...template2.matchAll(FILE_INCLUDE_PATTERN)];
41743
+ if (matches.length === 0) {
41391
41744
  return template2;
41392
41745
  }
41393
41746
  let result = template2;
41394
- for (const match of matches2) {
41747
+ for (const match of matches) {
41395
41748
  const absolutePath = path54.resolve(cwd, match[1]);
41396
41749
  const content = await readFile49(absolutePath, "utf8");
41397
41750
  result = result.replace(match[0], content);
@@ -41408,12 +41761,12 @@ function buildExecutionPrompt(input) {
41408
41761
  if (!input.selection.stepName) {
41409
41762
  return resolvedTaskPrompt;
41410
41763
  }
41411
- const step = input.steps[input.selection.stepName];
41412
- if (!step) {
41764
+ const step2 = input.steps[input.selection.stepName];
41765
+ if (!step2) {
41413
41766
  throw new Error(`Missing step definition for "${input.selection.stepName}".`);
41414
41767
  }
41415
41768
  return interpolatePipelineVars(
41416
- step.prompt,
41769
+ step2.prompt,
41417
41770
  {
41418
41771
  ...input.vars ?? {},
41419
41772
  id: input.selection.task.id,
@@ -41598,11 +41951,11 @@ function resolveMode2(stepName, steps) {
41598
41951
  if (!stepName) {
41599
41952
  return "yolo";
41600
41953
  }
41601
- const step = steps[stepName];
41602
- if (!step) {
41954
+ const step2 = steps[stepName];
41955
+ if (!step2) {
41603
41956
  throw new Error(`Missing step definition for "${stepName}".`);
41604
41957
  }
41605
- return step.mode;
41958
+ return step2.mode;
41606
41959
  }
41607
41960
  function planIdFromArchivePath(absolutePlanPath) {
41608
41961
  const stem = path56.basename(absolutePlanPath, ".md");
@@ -42009,7 +42362,7 @@ var init_pipeline2 = __esm({
42009
42362
  });
42010
42363
 
42011
42364
  // packages/pipeline/src/index.ts
42012
- var init_src24 = __esm({
42365
+ var init_src25 = __esm({
42013
42366
  "packages/pipeline/src/index.ts"() {
42014
42367
  "use strict";
42015
42368
  init_loader();
@@ -42857,7 +43210,7 @@ var init_loop2 = __esm({
42857
43210
  });
42858
43211
 
42859
43212
  // packages/experiment-loop/src/index.ts
42860
- var init_src25 = __esm({
43213
+ var init_src26 = __esm({
42861
43214
  "packages/experiment-loop/src/index.ts"() {
42862
43215
  "use strict";
42863
43216
  init_types6();
@@ -43409,7 +43762,7 @@ var init_ralph = __esm({
43409
43762
  });
43410
43763
 
43411
43764
  // packages/ralph/src/index.ts
43412
- var init_src26 = __esm({
43765
+ var init_src27 = __esm({
43413
43766
  "packages/ralph/src/index.ts"() {
43414
43767
  "use strict";
43415
43768
  init_frontmatter3();
@@ -43676,9 +44029,9 @@ var FRONTMATTER_FENCE;
43676
44029
  var init_format = __esm({
43677
44030
  "packages/plan-browser/src/format.ts"() {
43678
44031
  "use strict";
43679
- init_src24();
43680
44032
  init_src25();
43681
44033
  init_src26();
44034
+ init_src27();
43682
44035
  FRONTMATTER_FENCE = "---";
43683
44036
  }
43684
44037
  });
@@ -43861,7 +44214,7 @@ async function archiveSelectedPlan(entry, fs20) {
43861
44214
  async function deletePlan(entry, fs20) {
43862
44215
  await fs20.unlink(entry.absolutePath);
43863
44216
  }
43864
- var init_actions = __esm({
44217
+ var init_actions2 = __esm({
43865
44218
  "packages/plan-browser/src/actions.ts"() {
43866
44219
  "use strict";
43867
44220
  }
@@ -43966,18 +44319,18 @@ var init_browser = __esm({
43966
44319
  "use strict";
43967
44320
  init_src11();
43968
44321
  init_src11();
43969
- init_actions();
44322
+ init_actions2();
43970
44323
  init_discovery4();
43971
44324
  init_format();
43972
44325
  }
43973
44326
  });
43974
44327
 
43975
44328
  // packages/plan-browser/src/index.ts
43976
- var init_src27 = __esm({
44329
+ var init_src28 = __esm({
43977
44330
  "packages/plan-browser/src/index.ts"() {
43978
44331
  "use strict";
43979
44332
  init_discovery4();
43980
- init_actions();
44333
+ init_actions2();
43981
44334
  init_format();
43982
44335
  init_browser();
43983
44336
  }
@@ -45081,7 +45434,7 @@ var init_content = __esm({
45081
45434
  });
45082
45435
 
45083
45436
  // packages/tiny-stdio-mcp-server/src/index.ts
45084
- var init_src28 = __esm({
45437
+ var init_src29 = __esm({
45085
45438
  "packages/tiny-stdio-mcp-server/src/index.ts"() {
45086
45439
  "use strict";
45087
45440
  init_server();
@@ -45371,7 +45724,7 @@ var init_mock = __esm({
45371
45724
  });
45372
45725
 
45373
45726
  // packages/agent-human-in-loop/src/index.ts
45374
- var init_src29 = __esm({
45727
+ var init_src30 = __esm({
45375
45728
  "packages/agent-human-in-loop/src/index.ts"() {
45376
45729
  "use strict";
45377
45730
  init_request_approval();
@@ -45409,7 +45762,7 @@ var getDefaultProvider;
45409
45762
  var init_default_provider = __esm({
45410
45763
  "packages/toolcraft/src/human-in-loop/default-provider.ts"() {
45411
45764
  "use strict";
45412
- init_src29();
45765
+ init_src30();
45413
45766
  init_user_error();
45414
45767
  getDefaultProvider = createDefaultProviderFactory();
45415
45768
  }
@@ -46166,21 +46519,21 @@ function findDiscriminator(branches, root) {
46166
46519
  const candidateKeys = Object.keys(firstBranch.properties ?? {});
46167
46520
  for (const candidate of candidateKeys) {
46168
46521
  const values = [];
46169
- let matches2 = true;
46522
+ let matches = true;
46170
46523
  for (const branch of branches) {
46171
46524
  const requiredKeys = new Set(branch.required ?? []);
46172
46525
  if (!requiredKeys.has(candidate)) {
46173
- matches2 = false;
46526
+ matches = false;
46174
46527
  break;
46175
46528
  }
46176
46529
  const literal = getDiscriminatorLiteral(branch, candidate, root);
46177
46530
  if (literal === void 0) {
46178
- matches2 = false;
46531
+ matches = false;
46179
46532
  break;
46180
46533
  }
46181
46534
  values.push(literal);
46182
46535
  }
46183
- if (matches2 && new Set(values).size === values.length) {
46536
+ if (matches && new Set(values).size === values.length) {
46184
46537
  return candidate;
46185
46538
  }
46186
46539
  }
@@ -47257,7 +47610,7 @@ var RESERVED_SERVICE_NAMES;
47257
47610
  var init_mcp2 = __esm({
47258
47611
  "packages/toolcraft/src/mcp.ts"() {
47259
47612
  "use strict";
47260
- init_src28();
47613
+ init_src29();
47261
47614
  init_src16();
47262
47615
  init_src17();
47263
47616
  init_approvals_commands();
@@ -47322,7 +47675,7 @@ var init_run2 = __esm({
47322
47675
  });
47323
47676
 
47324
47677
  // packages/markdown-reader/src/index.ts
47325
- var init_src30 = __esm({
47678
+ var init_src31 = __esm({
47326
47679
  "packages/markdown-reader/src/index.ts"() {
47327
47680
  "use strict";
47328
47681
  init_read_markdown();
@@ -47934,9 +48287,9 @@ var init_plan = __esm({
47934
48287
  async "src/cli/commands/plan.ts"() {
47935
48288
  "use strict";
47936
48289
  init_src11();
47937
- init_src27();
48290
+ init_src28();
47938
48291
  init_src18();
47939
- init_src30();
48292
+ init_src31();
47940
48293
  init_src2();
47941
48294
  init_src6();
47942
48295
  init_errors2();
@@ -48275,11 +48628,11 @@ var PIPELINE_ACTIVITY_TIMEOUT_RETRY_COUNT;
48275
48628
  var init_pipeline3 = __esm({
48276
48629
  async "src/sdk/pipeline.ts"() {
48277
48630
  "use strict";
48278
- init_src24();
48631
+ init_src25();
48279
48632
  await init_pipeline_init();
48280
48633
  init_SKILL_plan2();
48281
48634
  await init_spawn4();
48282
- init_src24();
48635
+ init_src25();
48283
48636
  PIPELINE_ACTIVITY_TIMEOUT_RETRY_COUNT = 3;
48284
48637
  }
48285
48638
  });
@@ -48377,7 +48730,7 @@ var WorkflowLoadError;
48377
48730
  var init_load = __esm({
48378
48731
  "packages/agent-maestro/src/config/load.ts"() {
48379
48732
  "use strict";
48380
- init_src30();
48733
+ init_src31();
48381
48734
  WorkflowLoadError = class extends Error {
48382
48735
  code;
48383
48736
  constructor(code, message2, options) {
@@ -48702,7 +49055,7 @@ function scheduleRetry(state, entry) {
48702
49055
  function cancelRetry(state, taskId) {
48703
49056
  state.retry_attempts.delete(taskId);
48704
49057
  }
48705
- var init_state3 = __esm({
49058
+ var init_state4 = __esm({
48706
49059
  "packages/agent-maestro/src/runtime/state.ts"() {
48707
49060
  "use strict";
48708
49061
  }
@@ -48892,7 +49245,7 @@ var init_reconcile = __esm({
48892
49245
  "packages/agent-maestro/src/runtime/reconcile.ts"() {
48893
49246
  "use strict";
48894
49247
  init_src8();
48895
- init_state3();
49248
+ init_state4();
48896
49249
  init_manager();
48897
49250
  }
48898
49251
  });
@@ -48901,8 +49254,8 @@ var init_reconcile = __esm({
48901
49254
  function renderTaskPrompt(template2, vars) {
48902
49255
  return interpolatePipelineVars(resolveTaskTemplate(template2), renderVars(vars));
48903
49256
  }
48904
- function renderStepPrompt(step, vars) {
48905
- return interpolatePipelineVars(step.prompt, renderVars(vars));
49257
+ function renderStepPrompt(step2, vars) {
49258
+ return interpolatePipelineVars(step2.prompt, renderVars(vars));
48906
49259
  }
48907
49260
  function resolveTaskTemplate(template2) {
48908
49261
  return template2.length === 0 ? DEFAULT_TASK_PROMPT : template2;
@@ -48920,10 +49273,10 @@ function renderVars(vars) {
48920
49273
  };
48921
49274
  }
48922
49275
  var DEFAULT_TASK_PROMPT;
48923
- var init_render2 = __esm({
49276
+ var init_render3 = __esm({
48924
49277
  "packages/agent-maestro/src/prompt/render.ts"() {
48925
49278
  "use strict";
48926
- init_src24();
49279
+ init_src25();
48927
49280
  DEFAULT_TASK_PROMPT = "{{ task.qualifiedId }}: {{ task.name }}\n\n{{ task.description }}";
48928
49281
  }
48929
49282
  });
@@ -48989,7 +49342,7 @@ var init_runner4 = __esm({
48989
49342
  "packages/agent-maestro/src/agent/runner.ts"() {
48990
49343
  "use strict";
48991
49344
  init_src13();
48992
- init_render2();
49345
+ init_render3();
48993
49346
  init_phases();
48994
49347
  AttemptRunner = class {
48995
49348
  constructor(args) {
@@ -49017,8 +49370,8 @@ var init_runner4 = __esm({
49017
49370
  return setupBoundary;
49018
49371
  }
49019
49372
  }
49020
- for (const [name, step] of Object.entries(this.args.steps.steps)) {
49021
- const stepFailure = await this.runNamedStep(name, step);
49373
+ for (const [name, step2] of Object.entries(this.args.steps.steps)) {
49374
+ const stepFailure = await this.runNamedStep(name, step2);
49022
49375
  if (stepFailure) {
49023
49376
  if (stepFailure.failure === "canceled") {
49024
49377
  return this.cancel();
@@ -49036,24 +49389,24 @@ var init_runner4 = __esm({
49036
49389
  return { reason: "normal" };
49037
49390
  }
49038
49391
  async runSetup() {
49039
- const step = this.args.steps.setup;
49040
- if (!step) {
49392
+ const step2 = this.args.steps.setup;
49393
+ if (!step2) {
49041
49394
  return void 0;
49042
49395
  }
49043
49396
  this.transition("running-setup", { step: "setup" });
49044
- return this.runStep("setup", step);
49397
+ return this.runStep("setup", step2);
49045
49398
  }
49046
- async runNamedStep(name, step) {
49399
+ async runNamedStep(name, step2) {
49047
49400
  this.transition("running-step", { step: name });
49048
- return this.runStep(name, step);
49401
+ return this.runStep(name, step2);
49049
49402
  }
49050
49403
  async runTeardownBestEffort() {
49051
- const step = this.args.steps.teardown;
49052
- if (!step || this.state.phase === "canceled") {
49404
+ const step2 = this.args.steps.teardown;
49405
+ if (!step2 || this.state.phase === "canceled") {
49053
49406
  return;
49054
49407
  }
49055
49408
  this.transition("running-teardown", { step: "teardown" });
49056
- const outcome = await this.runStep("teardown", step);
49409
+ const outcome = await this.runStep("teardown", step2);
49057
49410
  if (outcome) {
49058
49411
  this.args.deps.logger?.warn("teardown failed", {
49059
49412
  reason: outcome.reason,
@@ -49063,14 +49416,14 @@ var init_runner4 = __esm({
49063
49416
  });
49064
49417
  }
49065
49418
  }
49066
- async runStep(name, step) {
49419
+ async runStep(name, step2) {
49067
49420
  let prompt;
49068
49421
  try {
49069
49422
  const taskPrompt = renderTaskPrompt(this.args.deps.taskPromptTemplate ?? "", {
49070
49423
  task: this.args.task,
49071
49424
  attempt: this.args.attempt
49072
49425
  });
49073
- prompt = renderStepPrompt(step, {
49426
+ prompt = renderStepPrompt(step2, {
49074
49427
  prompt: taskPrompt,
49075
49428
  task: this.args.task,
49076
49429
  attempt: this.args.attempt
@@ -49080,10 +49433,10 @@ var init_runner4 = __esm({
49080
49433
  }
49081
49434
  try {
49082
49435
  const spawn11 = this.args.deps.spawn ?? spawn4;
49083
- const result = await spawn11(step.agent ?? this.args.cfg.agent.service, {
49436
+ const result = await spawn11(step2.agent ?? this.args.cfg.agent.service, {
49084
49437
  prompt,
49085
- model: step.model,
49086
- mode: step.mode,
49438
+ model: step2.model,
49439
+ mode: step2.mode,
49087
49440
  signal: this.args.abort
49088
49441
  });
49089
49442
  this.args.deps.onEvent?.({
@@ -49417,7 +49770,7 @@ var init_loop3 = __esm({
49417
49770
  init_manager();
49418
49771
  init_reconcile();
49419
49772
  init_retry();
49420
- init_state3();
49773
+ init_state4();
49421
49774
  }
49422
49775
  });
49423
49776
 
@@ -49683,30 +50036,30 @@ function errorMessage3(error2) {
49683
50036
  return error2 instanceof Error ? error2.message : String(error2);
49684
50037
  }
49685
50038
  var STOP_BUDGET_MS, logLevelPriority;
49686
- var init_src31 = __esm({
50039
+ var init_src32 = __esm({
49687
50040
  "packages/agent-maestro/src/index.ts"() {
49688
50041
  "use strict";
49689
50042
  init_src5();
49690
- init_src24();
50043
+ init_src25();
49691
50044
  init_src8();
49692
50045
  init_load();
49693
50046
  init_schema3();
49694
50047
  init_validate3();
49695
50048
  init_reconcile();
49696
- init_state3();
50049
+ init_state4();
49697
50050
  init_loop3();
49698
50051
  init_manager();
49699
50052
  init_phases();
49700
50053
  init_retry();
49701
50054
  init_sanitize();
49702
- init_state3();
50055
+ init_state4();
49703
50056
  init_reconcile();
49704
50057
  init_loop3();
49705
50058
  init_state_machine3();
49706
50059
  init_load();
49707
50060
  init_schema3();
49708
50061
  init_validate3();
49709
- init_render2();
50062
+ init_render3();
49710
50063
  init_runner4();
49711
50064
  init_manager();
49712
50065
  STOP_BUDGET_MS = 1e4;
@@ -50079,7 +50432,7 @@ function createSupervisor(options) {
50079
50432
  options.fs
50080
50433
  );
50081
50434
  const logSource = createLogSource(options.onLog);
50082
- let state = createInitialState(spec10, runner);
50435
+ let state = createInitialState2(spec10, runner);
50083
50436
  let handle = null;
50084
50437
  let runId = 0;
50085
50438
  let startPromise = null;
@@ -50302,7 +50655,7 @@ function resolveRunner(options) {
50302
50655
  }
50303
50656
  return createHostRunner();
50304
50657
  }
50305
- function createInitialState(spec10, runner) {
50658
+ function createInitialState2(spec10, runner) {
50306
50659
  return {
50307
50660
  id: spec10.id,
50308
50661
  pid: null,
@@ -50487,7 +50840,7 @@ var init_supervisor = __esm({
50487
50840
  "packages/process-launcher/src/supervisor/supervisor.ts"() {
50488
50841
  "use strict";
50489
50842
  init_src7();
50490
- init_src21();
50843
+ init_src22();
50491
50844
  init_health_check();
50492
50845
  init_log_writer();
50493
50846
  init_state_store();
@@ -50955,7 +51308,7 @@ var init_launcher = __esm({
50955
51308
  });
50956
51309
 
50957
51310
  // packages/process-launcher/src/index.ts
50958
- var init_src32 = __esm({
51311
+ var init_src33 = __esm({
50959
51312
  "packages/process-launcher/src/index.ts"() {
50960
51313
  "use strict";
50961
51314
  init_state_store();
@@ -51075,7 +51428,7 @@ async function ensurePoeApiKey() {
51075
51428
  var init_ralph2 = __esm({
51076
51429
  async "src/sdk/ralph.ts"() {
51077
51430
  "use strict";
51078
- init_src26();
51431
+ init_src27();
51079
51432
  init_src9();
51080
51433
  init_src13();
51081
51434
  await init_spawn4();
@@ -51155,7 +51508,7 @@ var init_experiment2 = __esm({
51155
51508
  async "src/sdk/experiment.ts"() {
51156
51509
  "use strict";
51157
51510
  init_src9();
51158
- init_src25();
51511
+ init_src26();
51159
51512
  await init_spawn4();
51160
51513
  }
51161
51514
  });
@@ -53034,7 +53387,7 @@ var init_commands2 = __esm({
53034
53387
  });
53035
53388
 
53036
53389
  // packages/github-workflows/src/index.ts
53037
- var init_src33 = __esm({
53390
+ var init_src34 = __esm({
53038
53391
  "packages/github-workflows/src/index.ts"() {
53039
53392
  "use strict";
53040
53393
  init_frontmatter4();
@@ -53349,8 +53702,8 @@ function resolveEngine(engine) {
53349
53702
  var init_launch = __esm({
53350
53703
  "src/sdk/launch.ts"() {
53351
53704
  "use strict";
53352
- init_src21();
53353
- init_src32();
53705
+ init_src22();
53706
+ init_src33();
53354
53707
  init_src7();
53355
53708
  init_execution_context();
53356
53709
  }
@@ -53379,8 +53732,8 @@ async function runServiceInstall(definition, context) {
53379
53732
  return true;
53380
53733
  }
53381
53734
  const platformSteps = filterStepsByPlatform(definition.steps, context.platform);
53382
- for (const step of platformSteps) {
53383
- await runInstallStep(step, context);
53735
+ for (const step2 of platformSteps) {
53736
+ await runInstallStep(step2, context);
53384
53737
  }
53385
53738
  await definition.check.run(checkContext);
53386
53739
  if (definition.postChecks) {
@@ -53393,8 +53746,8 @@ async function runServiceInstall(definition, context) {
53393
53746
  );
53394
53747
  return true;
53395
53748
  }
53396
- function describeInstallCommand(step) {
53397
- return `[${step.id}] ${formatCommand3(step.command, step.args)}`;
53749
+ function describeInstallCommand(step2) {
53750
+ return `[${step2.id}] ${formatCommand3(step2.command, step2.args)}`;
53398
53751
  }
53399
53752
  function formatCommand3(command, args) {
53400
53753
  return [command, ...args.map(quoteIfNeeded)].join(" ");
@@ -53410,24 +53763,24 @@ function quoteIfNeeded(value) {
53410
53763
  }
53411
53764
  function filterStepsByPlatform(steps, platform) {
53412
53765
  return steps.filter(
53413
- (step) => !step.platforms || step.platforms.includes(platform)
53766
+ (step2) => !step2.platforms || step2.platforms.includes(platform)
53414
53767
  );
53415
53768
  }
53416
53769
  function logInstallDryRun(definition, context) {
53417
53770
  context.logger(`Dry run: would install ${definition.summary}.`);
53418
53771
  const platformSteps = filterStepsByPlatform(definition.steps, context.platform);
53419
- for (const step of platformSteps) {
53420
- context.logger(`Dry run: ${describeInstallCommand(step)}`);
53772
+ for (const step2 of platformSteps) {
53773
+ context.logger(`Dry run: ${describeInstallCommand(step2)}`);
53421
53774
  }
53422
53775
  }
53423
- async function runInstallStep(step, context) {
53424
- context.logger(`Running ${describeInstallCommand(step)}`);
53425
- const result = await context.runCommand(step.command, step.args);
53776
+ async function runInstallStep(step2, context) {
53777
+ context.logger(`Running ${describeInstallCommand(step2)}`);
53778
+ const result = await context.runCommand(step2.command, step2.args);
53426
53779
  if (result.exitCode !== 0) {
53427
53780
  const stderr = result.stderr.trim();
53428
53781
  const suffix = stderr.length > 0 ? `: ${stderr}` : "";
53429
53782
  throw new Error(
53430
- `${describeInstallCommand(step)} failed with exit code ${result.exitCode}${suffix}`
53783
+ `${describeInstallCommand(step2)} failed with exit code ${result.exitCode}${suffix}`
53431
53784
  );
53432
53785
  }
53433
53786
  }
@@ -56687,7 +57040,7 @@ function openInBrowser(url) {
56687
57040
  var init_oauth_login = __esm({
56688
57041
  "src/cli/oauth-login.ts"() {
56689
57042
  "use strict";
56690
- init_src22();
57043
+ init_src23();
56691
57044
  init_src11();
56692
57045
  }
56693
57046
  });
@@ -56810,14 +57163,14 @@ var init_container2 = __esm({
56810
57163
  init_service_registry();
56811
57164
  init_context();
56812
57165
  init_prompts3();
56813
- init_src22();
57166
+ init_src23();
56814
57167
  init_options();
56815
57168
  init_logger2();
56816
57169
  init_error_logger();
56817
57170
  init_src13();
56818
57171
  init_src11();
56819
57172
  await init_providers();
56820
- init_src23();
57173
+ init_src24();
56821
57174
  init_poe_code_command_runner();
56822
57175
  init_errors2();
56823
57176
  init_oauth_login();
@@ -57841,7 +58194,7 @@ var init_spawn6 = __esm({
57841
58194
  init_src11();
57842
58195
  init_config4();
57843
58196
  init_shared();
57844
- init_src19();
58197
+ init_src20();
57845
58198
  init_spawn_core();
57846
58199
  await init_spawn4();
57847
58200
  init_autonomous2();
@@ -58127,7 +58480,7 @@ var init_login = __esm({
58127
58480
  "src/cli/commands/login.ts"() {
58128
58481
  "use strict";
58129
58482
  init_shared();
58130
- init_src23();
58483
+ init_src24();
58131
58484
  init_errors2();
58132
58485
  init_config4();
58133
58486
  init_mutation_events();
@@ -59721,7 +60074,7 @@ var generateTextSchema, generateImageSchema, generateVideoSchema, generateAudioS
59721
60074
  var init_mcp_server = __esm({
59722
60075
  "src/cli/mcp-server.ts"() {
59723
60076
  "use strict";
59724
- init_src28();
60077
+ init_src29();
59725
60078
  init_client_instance();
59726
60079
  init_constants();
59727
60080
  generateTextSchema = defineSchema({
@@ -60193,7 +60546,7 @@ var init_apply2 = __esm({
60193
60546
  });
60194
60547
 
60195
60548
  // packages/agent-mcp-config/src/index.ts
60196
- var init_src34 = __esm({
60549
+ var init_src35 = __esm({
60197
60550
  "packages/agent-mcp-config/src/index.ts"() {
60198
60551
  "use strict";
60199
60552
  init_configs3();
@@ -60377,7 +60730,7 @@ var init_mcp3 = __esm({
60377
60730
  init_shared();
60378
60731
  init_mcp_output_format();
60379
60732
  init_command_not_found();
60380
- init_src34();
60733
+ init_src35();
60381
60734
  init_execution_context();
60382
60735
  DEFAULT_MCP_AGENT = "claude-code";
60383
60736
  }
@@ -61481,9 +61834,9 @@ function formatTaskStartMessage(progress) {
61481
61834
  if (progress.phase) {
61482
61835
  return `${progress.taskTitle}...`;
61483
61836
  }
61484
- const step = progress.stepName ? ` (${progress.stepName})` : "";
61837
+ const step2 = progress.stepName ? ` (${progress.stepName})` : "";
61485
61838
  const stepCounter = progress.stepIndex !== void 0 && progress.totalSteps !== void 0 ? ` step ${progress.stepIndex}/${progress.totalSteps}` : "";
61486
- return `Task ${progress.taskIndex}/${progress.totalTasks}: ${progress.taskId}${step}${stepCounter}`;
61839
+ return `Task ${progress.taskIndex}/${progress.totalTasks}: ${progress.taskId}${step2}${stepCounter}`;
61487
61840
  }
61488
61841
  function formatTaskCompleteMessage(progress) {
61489
61842
  const duration = formatDashboardDuration(progress.durationMs);
@@ -62399,7 +62752,7 @@ var init_pipeline4 = __esm({
62399
62752
  init_src9();
62400
62753
  init_src18();
62401
62754
  init_src6();
62402
- init_src19();
62755
+ init_src20();
62403
62756
  init_config4();
62404
62757
  init_errors2();
62405
62758
  await init_pipeline_init();
@@ -62407,7 +62760,7 @@ var init_pipeline4 = __esm({
62407
62760
  init_pipeline_loop_agent();
62408
62761
  await init_pipeline3();
62409
62762
  await init_spawn4();
62410
- init_src24();
62763
+ init_src25();
62411
62764
  init_dashboard_loop_shared();
62412
62765
  DEFAULT_PIPELINE_AGENT = "claude-code";
62413
62766
  DEFAULT_PIPELINE_SCOPE = "local";
@@ -62992,7 +63345,7 @@ var init_ralph3 = __esm({
62992
63345
  init_src11();
62993
63346
  init_src2();
62994
63347
  init_src9();
62995
- init_src26();
63348
+ init_src27();
62996
63349
  init_src6();
62997
63350
  init_config4();
62998
63351
  init_errors2();
@@ -63824,17 +64177,17 @@ var init_experiment3 = __esm({
63824
64177
  "use strict";
63825
64178
  init_src11();
63826
64179
  init_src2();
63827
- init_src24();
64180
+ init_src25();
63828
64181
  init_src9();
63829
64182
  init_src18();
63830
- init_src25();
64183
+ init_src26();
63831
64184
  init_errors2();
63832
64185
  init_shared();
63833
64186
  await init_experiment2();
63834
64187
  await init_spawn4();
63835
64188
  init_config4();
63836
64189
  init_src6();
63837
- init_src19();
64190
+ init_src20();
63838
64191
  init_dashboard_loop_shared();
63839
64192
  init_runtime_options();
63840
64193
  DEFAULT_EXPERIMENT_AGENT = "claude-code";
@@ -65842,7 +66195,7 @@ var init_ingest = __esm({
65842
66195
  var init_mcp4 = __esm({
65843
66196
  "packages/memory/src/mcp.ts"() {
65844
66197
  "use strict";
65845
- init_src28();
66198
+ init_src29();
65846
66199
  }
65847
66200
  });
65848
66201
 
@@ -65851,7 +66204,7 @@ var init_install3 = __esm({
65851
66204
  "packages/memory/src/install.ts"() {
65852
66205
  "use strict";
65853
66206
  init_src18();
65854
- init_src34();
66207
+ init_src35();
65855
66208
  }
65856
66209
  });
65857
66210
 
@@ -66122,7 +66475,7 @@ var init_handle = __esm({
66122
66475
  });
66123
66476
 
66124
66477
  // packages/memory/src/index.ts
66125
- var init_src35 = __esm({
66478
+ var init_src36 = __esm({
66126
66479
  "packages/memory/src/index.ts"() {
66127
66480
  "use strict";
66128
66481
  init_paths2();
@@ -66326,7 +66679,7 @@ var init_memory2 = __esm({
66326
66679
  "src/cli/commands/memory.ts"() {
66327
66680
  "use strict";
66328
66681
  init_src11();
66329
- init_src35();
66682
+ init_src36();
66330
66683
  init_command_not_found();
66331
66684
  init_errors2();
66332
66685
  init_shared();
@@ -67021,7 +67374,7 @@ function registerRuntimeJobsCommand(runtime, root, container) {
67021
67374
  registerRuntimeJobsSyncCommand(jobs, root, container);
67022
67375
  registerRuntimeJobsSandboxCommand(jobs, root, container);
67023
67376
  }
67024
- var init_jobs2 = __esm({
67377
+ var init_jobs3 = __esm({
67025
67378
  "src/cli/commands/runtime/jobs/index.ts"() {
67026
67379
  "use strict";
67027
67380
  init_attach();
@@ -67180,12 +67533,12 @@ function registerRuntimeCommand(program, container) {
67180
67533
  registerRuntimeTemplatesCommand(runtime, program, container);
67181
67534
  registerRuntimeJobsCommand(runtime, program, container);
67182
67535
  }
67183
- var init_runtime3 = __esm({
67536
+ var init_runtime4 = __esm({
67184
67537
  "src/cli/commands/runtime/index.ts"() {
67185
67538
  "use strict";
67186
67539
  init_build();
67187
67540
  init_init2();
67188
- init_jobs2();
67541
+ init_jobs3();
67189
67542
  init_templates4();
67190
67543
  }
67191
67544
  });
@@ -82979,7 +83332,7 @@ var init_time = __esm({
82979
83332
  });
82980
83333
 
82981
83334
  // packages/agent-script/src/index.ts
82982
- var init_src36 = __esm({
83335
+ var init_src37 = __esm({
82983
83336
  "packages/agent-script/src/index.ts"() {
82984
83337
  "use strict";
82985
83338
  init_parse4();
@@ -83057,7 +83410,7 @@ var SCHEMA_EXTRACTION_BUDGET;
83057
83410
  var init_extract_schema = __esm({
83058
83411
  "packages/agent-harness/src/loader/extract-schema.ts"() {
83059
83412
  "use strict";
83060
- init_src36();
83413
+ init_src37();
83061
83414
  init_schema4();
83062
83415
  SCHEMA_EXTRACTION_BUDGET = {
83063
83416
  arrayLength: 1e3,
@@ -83509,7 +83862,7 @@ var init_run4 = __esm({
83509
83862
  "packages/agent-harness/src/loader/run.ts"() {
83510
83863
  "use strict";
83511
83864
  init_src9();
83512
- init_src36();
83865
+ init_src37();
83513
83866
  init_schema4();
83514
83867
  init_extract_schema();
83515
83868
  init_pair();
@@ -83549,7 +83902,7 @@ var init_templates5 = __esm({
83549
83902
  });
83550
83903
 
83551
83904
  // packages/agent-harness/src/index.ts
83552
- var init_src37 = __esm({
83905
+ var init_src38 = __esm({
83553
83906
  "packages/agent-harness/src/index.ts"() {
83554
83907
  "use strict";
83555
83908
  init_schema4();
@@ -83807,8 +84160,8 @@ function formatDisplayPath2(container, filePath) {
83807
84160
  var init_harness2 = __esm({
83808
84161
  async "src/cli/commands/harness.ts"() {
83809
84162
  "use strict";
84163
+ init_src38();
83810
84164
  init_src37();
83811
- init_src36();
83812
84165
  init_src11();
83813
84166
  init_errors2();
83814
84167
  init_shared();
@@ -83874,7 +84227,7 @@ function hasNonEmptyString(value) {
83874
84227
  var init_braintrust = __esm({
83875
84228
  "src/cli/commands/braintrust.ts"() {
83876
84229
  "use strict";
83877
- init_src19();
84230
+ init_src20();
83878
84231
  init_shared();
83879
84232
  }
83880
84233
  });
@@ -84004,7 +84357,7 @@ var DEFAULT_WORKFLOW_PATH, MAESTRO_TASK_STATE_MACHINE_STATES, TasksOptionsError;
84004
84357
  var init_tasks_options = __esm({
84005
84358
  "src/cli/commands/tasks-options.ts"() {
84006
84359
  "use strict";
84007
- init_src33();
84360
+ init_src34();
84008
84361
  DEFAULT_WORKFLOW_PATH = "./WORKFLOW.md";
84009
84362
  MAESTRO_TASK_STATE_MACHINE_STATES = [
84010
84363
  "queued",
@@ -84162,7 +84515,7 @@ var init_package2 = __esm({
84162
84515
  "package.json"() {
84163
84516
  package_default2 = {
84164
84517
  name: "poe-code",
84165
- version: "3.0.216",
84518
+ version: "3.0.218",
84166
84519
  description: "CLI tool to configure Poe API for developer workflows.",
84167
84520
  type: "module",
84168
84521
  main: "./dist/index.js",
@@ -84232,6 +84585,7 @@ var init_package2 = __esm({
84232
84585
  "metric:test_count": "node scripts/metric-test-count.mjs",
84233
84586
  "metric:test_duration": "node scripts/metric-test-duration.mjs",
84234
84587
  "demo:dashboard": "tsx packages/design-system/src/dashboard/demo.ts",
84588
+ "demo:explorer": "tsx packages/design-system/src/explorer/demo.ts",
84235
84589
  replay: "tsx packages/agent-spawn/src/acp/replay-cli.ts",
84236
84590
  "codegen:plan-schemas": "tsx scripts/generate-plan-schemas.ts",
84237
84591
  "codegen:harness-schemas": "tsx scripts/generate-harness-schemas.ts",
@@ -84288,6 +84642,7 @@ var init_package2 = __esm({
84288
84642
  devDependencies: {
84289
84643
  "@eslint/js": "^9.0.0",
84290
84644
  "@modelcontextprotocol/sdk": "^1.26.0",
84645
+ "@poe-code/acp-telemetry": "*",
84291
84646
  "@poe-code/agent-child-process": "*",
84292
84647
  "@poe-code/agent-defs": "*",
84293
84648
  "@poe-code/agent-harness": "*",
@@ -84805,9 +85160,9 @@ var init_program = __esm({
84805
85160
  "use strict";
84806
85161
  init_src16();
84807
85162
  init_cli();
84808
- init_src33();
84809
- init_src20();
84810
- init_src31();
85163
+ init_src34();
85164
+ init_src21();
85165
+ init_src32();
84811
85166
  await init_container2();
84812
85167
  init_src11();
84813
85168
  init_configure();
@@ -84835,7 +85190,7 @@ var init_program = __esm({
84835
85190
  init_launch2();
84836
85191
  init_memory2();
84837
85192
  init_provider();
84838
- init_runtime3();
85193
+ init_runtime4();
84839
85194
  await init_harness2();
84840
85195
  init_braintrust();
84841
85196
  init_tasks2();
@@ -85105,12 +85460,12 @@ var init_bootstrap = __esm({
85105
85460
  // src/index.ts
85106
85461
  await init_spawn4();
85107
85462
  await init_pipeline3();
85108
- init_src31();
85463
+ init_src32();
85109
85464
  import { realpathSync as realpathSync2 } from "node:fs";
85110
85465
  import { pathToFileURL as pathToFileURL3 } from "node:url";
85111
85466
 
85112
85467
  // src/sdk/process-launcher.ts
85113
- init_src32();
85468
+ init_src33();
85114
85469
 
85115
85470
  // src/index.ts
85116
85471
  await init_ralph2();
@@ -85234,7 +85589,7 @@ var planDocumentSchema = {
85234
85589
  };
85235
85590
 
85236
85591
  // src/index.ts
85237
- init_src33();
85592
+ init_src34();
85238
85593
  init_launch();
85239
85594
 
85240
85595
  // src/cli/poe-agent-main.ts