poe-code 3.0.216 → 3.0.217

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -35182,7 +35182,7 @@ var init_client = __esm({
35182
35182
  }
35183
35183
  });
35184
35184
 
35185
- // packages/braintrust/src/redact.ts
35185
+ // packages/acp-telemetry/src/redact.ts
35186
35186
  function redact(value) {
35187
35187
  const serialized = JSON.stringify(value);
35188
35188
  if (serialized !== void 0) {
@@ -35219,7 +35219,7 @@ function redactLeaf(value) {
35219
35219
  }
35220
35220
  var MAX_STRING_BYTES, MAX_JSON_BYTES, BINARY_SCAN_BYTES;
35221
35221
  var init_redact = __esm({
35222
- "packages/braintrust/src/redact.ts"() {
35222
+ "packages/acp-telemetry/src/redact.ts"() {
35223
35223
  "use strict";
35224
35224
  MAX_STRING_BYTES = 65536;
35225
35225
  MAX_JSON_BYTES = 262144;
@@ -35227,6 +35227,249 @@ var init_redact = __esm({
35227
35227
  }
35228
35228
  });
35229
35229
 
35230
+ // packages/acp-telemetry/src/trace.ts
35231
+ function acpToTrace(ctx) {
35232
+ const spawnCtx = ctx;
35233
+ return {
35234
+ root: {
35235
+ name: `agent:${ctx.agent}:${ctx.model ?? "?"}`,
35236
+ kind: "agent",
35237
+ input: redact({
35238
+ prompt: ctx.prompt,
35239
+ mode: ctx.mode,
35240
+ cwd: ctx.cwd
35241
+ }),
35242
+ output: redact(accumulateAgentOutput(ctx.events)),
35243
+ metadata: {
35244
+ sessionId: ctx.sessionId,
35245
+ threadId: ctx.threadId,
35246
+ ...spawnCtx.metadata
35247
+ },
35248
+ metrics: buildMetrics(ctx),
35249
+ children: logToolSpans(ctx.events)
35250
+ }
35251
+ };
35252
+ }
35253
+ function logToolSpans(events) {
35254
+ const spans = [];
35255
+ for (const [index, event] of events.entries()) {
35256
+ const toolCall = asToolCall(event);
35257
+ if (toolCall === void 0) {
35258
+ continue;
35259
+ }
35260
+ const metadata = collectToolMeta(events, index, readString7(toolCall.toolCallId));
35261
+ spans.push({
35262
+ name: `tool_call:${readString7(toolCall.kind) ?? "unknown"}`,
35263
+ kind: "tool",
35264
+ input: redact(readToolInput(toolCall)),
35265
+ output: redact(assembleToolOutput(events, index, readString7(toolCall.toolCallId))),
35266
+ ...metadata ? { metadata } : {},
35267
+ ...readSpanTimestamps(metadata),
35268
+ children: []
35269
+ });
35270
+ }
35271
+ return spans;
35272
+ }
35273
+ function collectToolMeta(events, toolCallIndex, toolCallId) {
35274
+ const merged = {};
35275
+ const startMeta = asRecord3(asRecord3(events[toolCallIndex])?._meta);
35276
+ if (startMeta) {
35277
+ for (const [key2, value] of Object.entries(startMeta)) {
35278
+ merged[key2 === "ts" ? "startTs" : key2] = value;
35279
+ }
35280
+ }
35281
+ for (const event of events.slice(toolCallIndex + 1)) {
35282
+ const update = asToolCallUpdate(event);
35283
+ if (update === void 0) continue;
35284
+ if (toolCallId !== void 0 && update.toolCallId !== toolCallId) continue;
35285
+ const updateMeta = asRecord3(update._meta);
35286
+ if (!updateMeta) continue;
35287
+ for (const [key2, value] of Object.entries(updateMeta)) {
35288
+ merged[key2 === "ts" ? "endTs" : key2] = value;
35289
+ }
35290
+ }
35291
+ return Object.keys(merged).length > 0 ? merged : void 0;
35292
+ }
35293
+ function accumulateAgentOutput(events) {
35294
+ let output = "";
35295
+ for (const event of events) {
35296
+ const record = asRecord3(event);
35297
+ if (record === void 0) {
35298
+ continue;
35299
+ }
35300
+ if (record.event === "agent_message") {
35301
+ output += readString7(record.text) ?? "";
35302
+ continue;
35303
+ }
35304
+ if (record.sessionUpdate === "agent_message_chunk") {
35305
+ output += readContentText(record.content);
35306
+ }
35307
+ }
35308
+ return output;
35309
+ }
35310
+ function assembleToolOutput(events, toolCallIndex, toolCallId) {
35311
+ const outputs = [];
35312
+ let text5 = "";
35313
+ for (const event of events.slice(toolCallIndex + 1)) {
35314
+ const update = asToolCallUpdate(event);
35315
+ if (update === void 0) {
35316
+ continue;
35317
+ }
35318
+ if (toolCallId !== void 0 && update.toolCallId !== toolCallId) {
35319
+ continue;
35320
+ }
35321
+ if (Object.hasOwn(update, "rawOutput")) {
35322
+ outputs.push(update.rawOutput);
35323
+ }
35324
+ const contentText = readContentText(update.content);
35325
+ if (contentText.length > 0) {
35326
+ text5 += contentText;
35327
+ }
35328
+ }
35329
+ if (outputs.length === 0) {
35330
+ return text5;
35331
+ }
35332
+ if (text5.length > 0) {
35333
+ outputs.push(text5);
35334
+ }
35335
+ return outputs.length === 1 ? outputs[0] : outputs;
35336
+ }
35337
+ function buildMetrics(ctx) {
35338
+ const usage = ctx.usage;
35339
+ const metrics = {};
35340
+ const promptTokens = readNumber2(usage.prompt_tokens) ?? readNumber2(usage.inputTokens);
35341
+ const completionTokens = readNumber2(usage.completion_tokens) ?? readNumber2(usage.outputTokens);
35342
+ addMetric(metrics, "prompt_tokens", promptTokens);
35343
+ addMetric(metrics, "completion_tokens", completionTokens);
35344
+ addMetric(
35345
+ metrics,
35346
+ "tokens",
35347
+ readNumber2(usage.tokens) ?? sumIfPresent(promptTokens, completionTokens)
35348
+ );
35349
+ addMetric(
35350
+ metrics,
35351
+ "prompt_cached_tokens",
35352
+ readNumber2(usage.prompt_cached_tokens) ?? readNumber2(usage.cachedTokens)
35353
+ );
35354
+ addMetric(
35355
+ metrics,
35356
+ "prompt_cache_creation_tokens",
35357
+ readNumber2(usage.prompt_cache_creation_tokens)
35358
+ );
35359
+ addMetric(metrics, "durationMs", readNumber2(usage.durationMs));
35360
+ return metrics;
35361
+ }
35362
+ function asToolCall(event) {
35363
+ const record = asRecord3(event);
35364
+ return record?.sessionUpdate === "tool_call" ? record : void 0;
35365
+ }
35366
+ function asToolCallUpdate(event) {
35367
+ const record = asRecord3(event);
35368
+ return record?.sessionUpdate === "tool_call_update" ? record : void 0;
35369
+ }
35370
+ function readToolInput(toolCall) {
35371
+ if (Object.hasOwn(toolCall, "input")) {
35372
+ return toolCall.input;
35373
+ }
35374
+ return toolCall.rawInput;
35375
+ }
35376
+ function readContentText(value) {
35377
+ if (Array.isArray(value)) {
35378
+ return value.map(readContentText).join("");
35379
+ }
35380
+ const record = asRecord3(value);
35381
+ if (record === void 0 || record.type !== "text") {
35382
+ return "";
35383
+ }
35384
+ return readString7(record.text) ?? "";
35385
+ }
35386
+ function readSpanTimestamps(metadata) {
35387
+ if (metadata === void 0) {
35388
+ return {};
35389
+ }
35390
+ const startTs = readNumber2(metadata.startTs);
35391
+ const endTs = readNumber2(metadata.endTs);
35392
+ return {
35393
+ ...startTs !== void 0 ? { startTs } : {},
35394
+ ...endTs !== void 0 ? { endTs } : {}
35395
+ };
35396
+ }
35397
+ function asRecord3(value) {
35398
+ return typeof value === "object" && value !== null ? value : void 0;
35399
+ }
35400
+ function readString7(value) {
35401
+ return typeof value === "string" ? value : void 0;
35402
+ }
35403
+ function readNumber2(value) {
35404
+ return typeof value === "number" && Number.isFinite(value) ? value : void 0;
35405
+ }
35406
+ function addMetric(metrics, key2, value) {
35407
+ if (value !== void 0) {
35408
+ metrics[key2] = value;
35409
+ }
35410
+ }
35411
+ function sumIfPresent(left, right) {
35412
+ return left !== void 0 && right !== void 0 ? left + right : void 0;
35413
+ }
35414
+ var init_trace = __esm({
35415
+ "packages/acp-telemetry/src/trace.ts"() {
35416
+ "use strict";
35417
+ init_redact();
35418
+ }
35419
+ });
35420
+
35421
+ // packages/acp-telemetry/src/emit-braintrust.ts
35422
+ function emitToBraintrust(trace, parent) {
35423
+ const root = parent.startSpan({ name: trace.root.name, type: "task" });
35424
+ try {
35425
+ emitSpan(root, trace.root);
35426
+ } finally {
35427
+ root.end();
35428
+ }
35429
+ }
35430
+ function emitSpan(span, traceSpan) {
35431
+ span.log(toBraintrustLogEvent(traceSpan));
35432
+ for (const child of traceSpan.children) {
35433
+ const childSpan = span.startSpan({ name: child.name, type: "tool" });
35434
+ try {
35435
+ emitSpan(childSpan, child);
35436
+ } finally {
35437
+ childSpan.end();
35438
+ }
35439
+ }
35440
+ }
35441
+ function toBraintrustLogEvent(span) {
35442
+ return {
35443
+ ...Object.hasOwn(span, "input") ? { input: span.input } : {},
35444
+ ...Object.hasOwn(span, "output") ? { output: span.output } : {},
35445
+ ...Object.hasOwn(span, "metadata") ? { metadata: span.metadata } : {},
35446
+ ...Object.hasOwn(span, "metrics") ? { metrics: span.metrics } : {}
35447
+ };
35448
+ }
35449
+ var init_emit_braintrust = __esm({
35450
+ "packages/acp-telemetry/src/emit-braintrust.ts"() {
35451
+ "use strict";
35452
+ }
35453
+ });
35454
+
35455
+ // packages/acp-telemetry/src/emit-otel.ts
35456
+ var init_emit_otel = __esm({
35457
+ "packages/acp-telemetry/src/emit-otel.ts"() {
35458
+ "use strict";
35459
+ }
35460
+ });
35461
+
35462
+ // packages/acp-telemetry/src/index.ts
35463
+ var init_src19 = __esm({
35464
+ "packages/acp-telemetry/src/index.ts"() {
35465
+ "use strict";
35466
+ init_redact();
35467
+ init_trace();
35468
+ init_emit_braintrust();
35469
+ init_emit_otel();
35470
+ }
35471
+ });
35472
+
35230
35473
  // packages/braintrust/src/row-builder.ts
35231
35474
  function makePipelineRowState(client) {
35232
35475
  const rows = /* @__PURE__ */ new Map();
@@ -35382,8 +35625,8 @@ async function openCurrentChildSpan(client, args, ctx) {
35382
35625
  }
35383
35626
  }
35384
35627
  function buildPipelineCompletionLog(started, completed) {
35385
- const startRecord = asRecord3(started) ?? {};
35386
- const completeRecord = asRecord3(completed) ?? {};
35628
+ const startRecord = asRecord4(started) ?? {};
35629
+ const completeRecord = asRecord4(completed) ?? {};
35387
35630
  return {
35388
35631
  input: redact({
35389
35632
  step_name: readPipelineStep(started),
@@ -35406,7 +35649,7 @@ function buildPipelineCompletionLog(started, completed) {
35406
35649
  };
35407
35650
  }
35408
35651
  function buildSuperintendentLog(role, result) {
35409
- const record = asRecord3(result);
35652
+ const record = asRecord4(result);
35410
35653
  const event = {
35411
35654
  input: redact(record?.input),
35412
35655
  output: redact(record?.output ?? result)
@@ -35420,7 +35663,7 @@ function buildSuperintendentLog(role, result) {
35420
35663
  return event;
35421
35664
  }
35422
35665
  function buildExperimentLog(row, entry) {
35423
- const entryRecord = asRecord3(entry) ?? {};
35666
+ const entryRecord = asRecord4(entry) ?? {};
35424
35667
  const scores = buildExperimentScores(row.baseline, entry.scores);
35425
35668
  const metrics = { ...row.metrics };
35426
35669
  if (Number.isFinite(entry.durationMs)) {
@@ -35449,12 +35692,12 @@ function buildPipelineMetrics(progress) {
35449
35692
  const metrics = {};
35450
35693
  const usage = progress.usage;
35451
35694
  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);
35695
+ addMetric2(metrics, "prompt_tokens", usage.inputTokens);
35696
+ addMetric2(metrics, "completion_tokens", usage.outputTokens);
35697
+ addMetric2(metrics, "tokens", usage.inputTokens + usage.outputTokens);
35698
+ addMetric2(metrics, "prompt_cached_tokens", usage.cachedTokens);
35456
35699
  }
35457
- addMetric(metrics, "durationMs", progress.durationMs);
35700
+ addMetric2(metrics, "durationMs", progress.durationMs);
35458
35701
  return metrics;
35459
35702
  }
35460
35703
  function buildExperimentScores(baseline, scores) {
@@ -35531,7 +35774,7 @@ function asSpanParent(value) {
35531
35774
  }
35532
35775
  return span;
35533
35776
  }
35534
- function asRecord3(value) {
35777
+ function asRecord4(value) {
35535
35778
  return typeof value === "object" && value !== null ? value : void 0;
35536
35779
  }
35537
35780
  function readFirstString(record, keys) {
@@ -35546,7 +35789,7 @@ function readFirstValue(record, keys) {
35546
35789
  }
35547
35790
  return void 0;
35548
35791
  }
35549
- function addMetric(metrics, key2, value) {
35792
+ function addMetric2(metrics, key2, value) {
35550
35793
  if (value !== void 0 && Number.isFinite(value)) {
35551
35794
  metrics[key2] = value;
35552
35795
  }
@@ -35554,7 +35797,7 @@ function addMetric(metrics, key2, value) {
35554
35797
  var init_row_builder = __esm({
35555
35798
  "packages/braintrust/src/row-builder.ts"() {
35556
35799
  "use strict";
35557
- init_redact();
35800
+ init_src19();
35558
35801
  }
35559
35802
  });
35560
35803
 
@@ -35616,203 +35859,6 @@ var init_pipeline = __esm({
35616
35859
  }
35617
35860
  });
35618
35861
 
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
35862
  // packages/braintrust/src/adapters/spawn.ts
35817
35863
  function createSpawnMiddleware(client) {
35818
35864
  return async (ctx, next) => {
@@ -35826,14 +35872,19 @@ function createSpawnMiddleware(client) {
35826
35872
  };
35827
35873
  throw err;
35828
35874
  } finally {
35829
- await logSpawnSession(client, ctx);
35875
+ try {
35876
+ const { currentSpan } = await import("braintrust");
35877
+ emitToBraintrust(acpToTrace(ctx), currentSpan());
35878
+ } catch (err) {
35879
+ client.recordError(err, "log spawn session");
35880
+ }
35830
35881
  }
35831
35882
  };
35832
35883
  }
35833
35884
  var init_spawn3 = __esm({
35834
35885
  "packages/braintrust/src/adapters/spawn.ts"() {
35835
35886
  "use strict";
35836
- init_span_builder();
35887
+ init_src19();
35837
35888
  }
35838
35889
  });
35839
35890
 
@@ -35863,7 +35914,7 @@ function createSuperintendentCallbacks(client) {
35863
35914
  async function logFailedRole(client, role, error2, name) {
35864
35915
  try {
35865
35916
  const { currentSpan } = await import("braintrust");
35866
- const span = asSpanParent3(currentSpan()).startSpan({
35917
+ const span = asSpanParent2(currentSpan()).startSpan({
35867
35918
  name: name === void 0 ? `role:${role}:failed` : `role:${role}:${name}:failed`,
35868
35919
  type: "task"
35869
35920
  });
@@ -35885,7 +35936,7 @@ async function logFailedRole(client, role, error2, name) {
35885
35936
  client.recordError(err, `superintendent ${role} failed`);
35886
35937
  }
35887
35938
  }
35888
- function asSpanParent3(value) {
35939
+ function asSpanParent2(value) {
35889
35940
  const span = value;
35890
35941
  if (span === void 0 || typeof span.startSpan !== "function") {
35891
35942
  throw new Error("Braintrust current span unavailable");
@@ -35972,7 +36023,7 @@ async function loadIntegrations(config) {
35972
36023
  var init_load_integrations = __esm({
35973
36024
  "packages/braintrust/src/load-integrations.ts"() {
35974
36025
  "use strict";
35975
- init_src19();
36026
+ init_src20();
35976
36027
  }
35977
36028
  });
35978
36029
 
@@ -36005,7 +36056,7 @@ function requiredString(value, field) {
36005
36056
  }
36006
36057
  throw new Error(`Braintrust integration is enabled but ${field} is missing`);
36007
36058
  }
36008
- var init_src19 = __esm({
36059
+ var init_src20 = __esm({
36009
36060
  "packages/braintrust/src/index.ts"() {
36010
36061
  "use strict";
36011
36062
  init_client();
@@ -36914,7 +36965,7 @@ var init_run = __esm({
36914
36965
  init_src17();
36915
36966
  init_src11();
36916
36967
  init_src6();
36917
- init_src19();
36968
+ init_src20();
36918
36969
  init_config_scope();
36919
36970
  init_parse2();
36920
36971
  init_loop();
@@ -37284,7 +37335,7 @@ var init_commands = __esm({
37284
37335
  });
37285
37336
 
37286
37337
  // packages/superintendent/src/index.ts
37287
- var init_src20 = __esm({
37338
+ var init_src21 = __esm({
37288
37339
  "packages/superintendent/src/index.ts"() {
37289
37340
  "use strict";
37290
37341
  init_parse2();
@@ -37487,7 +37538,7 @@ var init_config4 = __esm({
37487
37538
  init_src4();
37488
37539
  init_src6();
37489
37540
  init_src15();
37490
- init_src20();
37541
+ init_src21();
37491
37542
  coreConfigScope = defineScope("core", {
37492
37543
  apiKey: {
37493
37544
  type: "string",
@@ -38202,7 +38253,7 @@ var init_resolve3 = __esm({
38202
38253
  });
38203
38254
 
38204
38255
  // packages/workspace-resolver/src/index.ts
38205
- var init_src21 = __esm({
38256
+ var init_src22 = __esm({
38206
38257
  "packages/workspace-resolver/src/index.ts"() {
38207
38258
  "use strict";
38208
38259
  init_parse3();
@@ -38242,7 +38293,7 @@ async function resolveSpawnWorkspace(candidate, options) {
38242
38293
  var init_resolve_spawn_workspace = __esm({
38243
38294
  "src/workspace/resolve-spawn-workspace.ts"() {
38244
38295
  "use strict";
38245
- init_src21();
38296
+ init_src22();
38246
38297
  }
38247
38298
  });
38248
38299
 
@@ -38985,7 +39036,7 @@ var init_oauth_client = __esm({
38985
39036
  });
38986
39037
 
38987
39038
  // packages/poe-oauth/src/index.ts
38988
- var init_src22 = __esm({
39039
+ var init_src23 = __esm({
38989
39040
  "packages/poe-oauth/src/index.ts"() {
38990
39041
  "use strict";
38991
39042
  init_check_auth();
@@ -39743,7 +39794,7 @@ var init_anthropic = __esm({
39743
39794
  });
39744
39795
 
39745
39796
  // packages/providers/src/index.ts
39746
- var init_src23 = __esm({
39797
+ var init_src24 = __esm({
39747
39798
  "packages/providers/src/index.ts"() {
39748
39799
  "use strict";
39749
39800
  init_registry3();
@@ -40265,13 +40316,13 @@ var init_container = __esm({
40265
40316
  init_service_registry();
40266
40317
  init_context();
40267
40318
  init_prompts3();
40268
- init_src22();
40319
+ init_src23();
40269
40320
  init_options();
40270
40321
  init_logger2();
40271
40322
  init_error_logger();
40272
40323
  init_src13();
40273
40324
  await init_providers();
40274
- init_src23();
40325
+ init_src24();
40275
40326
  init_poe_code_command_runner();
40276
40327
  init_src();
40277
40328
  }
@@ -40536,7 +40587,7 @@ var init_spawn4 = __esm({
40536
40587
  await init_container();
40537
40588
  init_autonomous2();
40538
40589
  init_src13();
40539
- init_src19();
40590
+ init_src20();
40540
40591
  init_shared();
40541
40592
  init_resolve_spawn_workspace();
40542
40593
  spawn8.pretty = async function pretty(service, promptOrOptions, maybeOptions) {
@@ -42009,7 +42060,7 @@ var init_pipeline2 = __esm({
42009
42060
  });
42010
42061
 
42011
42062
  // packages/pipeline/src/index.ts
42012
- var init_src24 = __esm({
42063
+ var init_src25 = __esm({
42013
42064
  "packages/pipeline/src/index.ts"() {
42014
42065
  "use strict";
42015
42066
  init_loader();
@@ -42857,7 +42908,7 @@ var init_loop2 = __esm({
42857
42908
  });
42858
42909
 
42859
42910
  // packages/experiment-loop/src/index.ts
42860
- var init_src25 = __esm({
42911
+ var init_src26 = __esm({
42861
42912
  "packages/experiment-loop/src/index.ts"() {
42862
42913
  "use strict";
42863
42914
  init_types6();
@@ -43409,7 +43460,7 @@ var init_ralph = __esm({
43409
43460
  });
43410
43461
 
43411
43462
  // packages/ralph/src/index.ts
43412
- var init_src26 = __esm({
43463
+ var init_src27 = __esm({
43413
43464
  "packages/ralph/src/index.ts"() {
43414
43465
  "use strict";
43415
43466
  init_frontmatter3();
@@ -43676,9 +43727,9 @@ var FRONTMATTER_FENCE;
43676
43727
  var init_format = __esm({
43677
43728
  "packages/plan-browser/src/format.ts"() {
43678
43729
  "use strict";
43679
- init_src24();
43680
43730
  init_src25();
43681
43731
  init_src26();
43732
+ init_src27();
43682
43733
  FRONTMATTER_FENCE = "---";
43683
43734
  }
43684
43735
  });
@@ -43973,7 +44024,7 @@ var init_browser = __esm({
43973
44024
  });
43974
44025
 
43975
44026
  // packages/plan-browser/src/index.ts
43976
- var init_src27 = __esm({
44027
+ var init_src28 = __esm({
43977
44028
  "packages/plan-browser/src/index.ts"() {
43978
44029
  "use strict";
43979
44030
  init_discovery4();
@@ -45081,7 +45132,7 @@ var init_content = __esm({
45081
45132
  });
45082
45133
 
45083
45134
  // packages/tiny-stdio-mcp-server/src/index.ts
45084
- var init_src28 = __esm({
45135
+ var init_src29 = __esm({
45085
45136
  "packages/tiny-stdio-mcp-server/src/index.ts"() {
45086
45137
  "use strict";
45087
45138
  init_server();
@@ -45371,7 +45422,7 @@ var init_mock = __esm({
45371
45422
  });
45372
45423
 
45373
45424
  // packages/agent-human-in-loop/src/index.ts
45374
- var init_src29 = __esm({
45425
+ var init_src30 = __esm({
45375
45426
  "packages/agent-human-in-loop/src/index.ts"() {
45376
45427
  "use strict";
45377
45428
  init_request_approval();
@@ -45409,7 +45460,7 @@ var getDefaultProvider;
45409
45460
  var init_default_provider = __esm({
45410
45461
  "packages/toolcraft/src/human-in-loop/default-provider.ts"() {
45411
45462
  "use strict";
45412
- init_src29();
45463
+ init_src30();
45413
45464
  init_user_error();
45414
45465
  getDefaultProvider = createDefaultProviderFactory();
45415
45466
  }
@@ -47257,7 +47308,7 @@ var RESERVED_SERVICE_NAMES;
47257
47308
  var init_mcp2 = __esm({
47258
47309
  "packages/toolcraft/src/mcp.ts"() {
47259
47310
  "use strict";
47260
- init_src28();
47311
+ init_src29();
47261
47312
  init_src16();
47262
47313
  init_src17();
47263
47314
  init_approvals_commands();
@@ -47322,7 +47373,7 @@ var init_run2 = __esm({
47322
47373
  });
47323
47374
 
47324
47375
  // packages/markdown-reader/src/index.ts
47325
- var init_src30 = __esm({
47376
+ var init_src31 = __esm({
47326
47377
  "packages/markdown-reader/src/index.ts"() {
47327
47378
  "use strict";
47328
47379
  init_read_markdown();
@@ -47934,9 +47985,9 @@ var init_plan = __esm({
47934
47985
  async "src/cli/commands/plan.ts"() {
47935
47986
  "use strict";
47936
47987
  init_src11();
47937
- init_src27();
47988
+ init_src28();
47938
47989
  init_src18();
47939
- init_src30();
47990
+ init_src31();
47940
47991
  init_src2();
47941
47992
  init_src6();
47942
47993
  init_errors2();
@@ -48275,11 +48326,11 @@ var PIPELINE_ACTIVITY_TIMEOUT_RETRY_COUNT;
48275
48326
  var init_pipeline3 = __esm({
48276
48327
  async "src/sdk/pipeline.ts"() {
48277
48328
  "use strict";
48278
- init_src24();
48329
+ init_src25();
48279
48330
  await init_pipeline_init();
48280
48331
  init_SKILL_plan2();
48281
48332
  await init_spawn4();
48282
- init_src24();
48333
+ init_src25();
48283
48334
  PIPELINE_ACTIVITY_TIMEOUT_RETRY_COUNT = 3;
48284
48335
  }
48285
48336
  });
@@ -48377,7 +48428,7 @@ var WorkflowLoadError;
48377
48428
  var init_load = __esm({
48378
48429
  "packages/agent-maestro/src/config/load.ts"() {
48379
48430
  "use strict";
48380
- init_src30();
48431
+ init_src31();
48381
48432
  WorkflowLoadError = class extends Error {
48382
48433
  code;
48383
48434
  constructor(code, message2, options) {
@@ -48923,7 +48974,7 @@ var DEFAULT_TASK_PROMPT;
48923
48974
  var init_render2 = __esm({
48924
48975
  "packages/agent-maestro/src/prompt/render.ts"() {
48925
48976
  "use strict";
48926
- init_src24();
48977
+ init_src25();
48927
48978
  DEFAULT_TASK_PROMPT = "{{ task.qualifiedId }}: {{ task.name }}\n\n{{ task.description }}";
48928
48979
  }
48929
48980
  });
@@ -49683,11 +49734,11 @@ function errorMessage3(error2) {
49683
49734
  return error2 instanceof Error ? error2.message : String(error2);
49684
49735
  }
49685
49736
  var STOP_BUDGET_MS, logLevelPriority;
49686
- var init_src31 = __esm({
49737
+ var init_src32 = __esm({
49687
49738
  "packages/agent-maestro/src/index.ts"() {
49688
49739
  "use strict";
49689
49740
  init_src5();
49690
- init_src24();
49741
+ init_src25();
49691
49742
  init_src8();
49692
49743
  init_load();
49693
49744
  init_schema3();
@@ -50487,7 +50538,7 @@ var init_supervisor = __esm({
50487
50538
  "packages/process-launcher/src/supervisor/supervisor.ts"() {
50488
50539
  "use strict";
50489
50540
  init_src7();
50490
- init_src21();
50541
+ init_src22();
50491
50542
  init_health_check();
50492
50543
  init_log_writer();
50493
50544
  init_state_store();
@@ -50955,7 +51006,7 @@ var init_launcher = __esm({
50955
51006
  });
50956
51007
 
50957
51008
  // packages/process-launcher/src/index.ts
50958
- var init_src32 = __esm({
51009
+ var init_src33 = __esm({
50959
51010
  "packages/process-launcher/src/index.ts"() {
50960
51011
  "use strict";
50961
51012
  init_state_store();
@@ -51075,7 +51126,7 @@ async function ensurePoeApiKey() {
51075
51126
  var init_ralph2 = __esm({
51076
51127
  async "src/sdk/ralph.ts"() {
51077
51128
  "use strict";
51078
- init_src26();
51129
+ init_src27();
51079
51130
  init_src9();
51080
51131
  init_src13();
51081
51132
  await init_spawn4();
@@ -51155,7 +51206,7 @@ var init_experiment2 = __esm({
51155
51206
  async "src/sdk/experiment.ts"() {
51156
51207
  "use strict";
51157
51208
  init_src9();
51158
- init_src25();
51209
+ init_src26();
51159
51210
  await init_spawn4();
51160
51211
  }
51161
51212
  });
@@ -53034,7 +53085,7 @@ var init_commands2 = __esm({
53034
53085
  });
53035
53086
 
53036
53087
  // packages/github-workflows/src/index.ts
53037
- var init_src33 = __esm({
53088
+ var init_src34 = __esm({
53038
53089
  "packages/github-workflows/src/index.ts"() {
53039
53090
  "use strict";
53040
53091
  init_frontmatter4();
@@ -53349,8 +53400,8 @@ function resolveEngine(engine) {
53349
53400
  var init_launch = __esm({
53350
53401
  "src/sdk/launch.ts"() {
53351
53402
  "use strict";
53352
- init_src21();
53353
- init_src32();
53403
+ init_src22();
53404
+ init_src33();
53354
53405
  init_src7();
53355
53406
  init_execution_context();
53356
53407
  }
@@ -56687,7 +56738,7 @@ function openInBrowser(url) {
56687
56738
  var init_oauth_login = __esm({
56688
56739
  "src/cli/oauth-login.ts"() {
56689
56740
  "use strict";
56690
- init_src22();
56741
+ init_src23();
56691
56742
  init_src11();
56692
56743
  }
56693
56744
  });
@@ -56810,14 +56861,14 @@ var init_container2 = __esm({
56810
56861
  init_service_registry();
56811
56862
  init_context();
56812
56863
  init_prompts3();
56813
- init_src22();
56864
+ init_src23();
56814
56865
  init_options();
56815
56866
  init_logger2();
56816
56867
  init_error_logger();
56817
56868
  init_src13();
56818
56869
  init_src11();
56819
56870
  await init_providers();
56820
- init_src23();
56871
+ init_src24();
56821
56872
  init_poe_code_command_runner();
56822
56873
  init_errors2();
56823
56874
  init_oauth_login();
@@ -57841,7 +57892,7 @@ var init_spawn6 = __esm({
57841
57892
  init_src11();
57842
57893
  init_config4();
57843
57894
  init_shared();
57844
- init_src19();
57895
+ init_src20();
57845
57896
  init_spawn_core();
57846
57897
  await init_spawn4();
57847
57898
  init_autonomous2();
@@ -58127,7 +58178,7 @@ var init_login = __esm({
58127
58178
  "src/cli/commands/login.ts"() {
58128
58179
  "use strict";
58129
58180
  init_shared();
58130
- init_src23();
58181
+ init_src24();
58131
58182
  init_errors2();
58132
58183
  init_config4();
58133
58184
  init_mutation_events();
@@ -59721,7 +59772,7 @@ var generateTextSchema, generateImageSchema, generateVideoSchema, generateAudioS
59721
59772
  var init_mcp_server = __esm({
59722
59773
  "src/cli/mcp-server.ts"() {
59723
59774
  "use strict";
59724
- init_src28();
59775
+ init_src29();
59725
59776
  init_client_instance();
59726
59777
  init_constants();
59727
59778
  generateTextSchema = defineSchema({
@@ -60193,7 +60244,7 @@ var init_apply2 = __esm({
60193
60244
  });
60194
60245
 
60195
60246
  // packages/agent-mcp-config/src/index.ts
60196
- var init_src34 = __esm({
60247
+ var init_src35 = __esm({
60197
60248
  "packages/agent-mcp-config/src/index.ts"() {
60198
60249
  "use strict";
60199
60250
  init_configs3();
@@ -60377,7 +60428,7 @@ var init_mcp3 = __esm({
60377
60428
  init_shared();
60378
60429
  init_mcp_output_format();
60379
60430
  init_command_not_found();
60380
- init_src34();
60431
+ init_src35();
60381
60432
  init_execution_context();
60382
60433
  DEFAULT_MCP_AGENT = "claude-code";
60383
60434
  }
@@ -62399,7 +62450,7 @@ var init_pipeline4 = __esm({
62399
62450
  init_src9();
62400
62451
  init_src18();
62401
62452
  init_src6();
62402
- init_src19();
62453
+ init_src20();
62403
62454
  init_config4();
62404
62455
  init_errors2();
62405
62456
  await init_pipeline_init();
@@ -62407,7 +62458,7 @@ var init_pipeline4 = __esm({
62407
62458
  init_pipeline_loop_agent();
62408
62459
  await init_pipeline3();
62409
62460
  await init_spawn4();
62410
- init_src24();
62461
+ init_src25();
62411
62462
  init_dashboard_loop_shared();
62412
62463
  DEFAULT_PIPELINE_AGENT = "claude-code";
62413
62464
  DEFAULT_PIPELINE_SCOPE = "local";
@@ -62992,7 +63043,7 @@ var init_ralph3 = __esm({
62992
63043
  init_src11();
62993
63044
  init_src2();
62994
63045
  init_src9();
62995
- init_src26();
63046
+ init_src27();
62996
63047
  init_src6();
62997
63048
  init_config4();
62998
63049
  init_errors2();
@@ -63824,17 +63875,17 @@ var init_experiment3 = __esm({
63824
63875
  "use strict";
63825
63876
  init_src11();
63826
63877
  init_src2();
63827
- init_src24();
63878
+ init_src25();
63828
63879
  init_src9();
63829
63880
  init_src18();
63830
- init_src25();
63881
+ init_src26();
63831
63882
  init_errors2();
63832
63883
  init_shared();
63833
63884
  await init_experiment2();
63834
63885
  await init_spawn4();
63835
63886
  init_config4();
63836
63887
  init_src6();
63837
- init_src19();
63888
+ init_src20();
63838
63889
  init_dashboard_loop_shared();
63839
63890
  init_runtime_options();
63840
63891
  DEFAULT_EXPERIMENT_AGENT = "claude-code";
@@ -65842,7 +65893,7 @@ var init_ingest = __esm({
65842
65893
  var init_mcp4 = __esm({
65843
65894
  "packages/memory/src/mcp.ts"() {
65844
65895
  "use strict";
65845
- init_src28();
65896
+ init_src29();
65846
65897
  }
65847
65898
  });
65848
65899
 
@@ -65851,7 +65902,7 @@ var init_install3 = __esm({
65851
65902
  "packages/memory/src/install.ts"() {
65852
65903
  "use strict";
65853
65904
  init_src18();
65854
- init_src34();
65905
+ init_src35();
65855
65906
  }
65856
65907
  });
65857
65908
 
@@ -66122,7 +66173,7 @@ var init_handle = __esm({
66122
66173
  });
66123
66174
 
66124
66175
  // packages/memory/src/index.ts
66125
- var init_src35 = __esm({
66176
+ var init_src36 = __esm({
66126
66177
  "packages/memory/src/index.ts"() {
66127
66178
  "use strict";
66128
66179
  init_paths2();
@@ -66326,7 +66377,7 @@ var init_memory2 = __esm({
66326
66377
  "src/cli/commands/memory.ts"() {
66327
66378
  "use strict";
66328
66379
  init_src11();
66329
- init_src35();
66380
+ init_src36();
66330
66381
  init_command_not_found();
66331
66382
  init_errors2();
66332
66383
  init_shared();
@@ -82979,7 +83030,7 @@ var init_time = __esm({
82979
83030
  });
82980
83031
 
82981
83032
  // packages/agent-script/src/index.ts
82982
- var init_src36 = __esm({
83033
+ var init_src37 = __esm({
82983
83034
  "packages/agent-script/src/index.ts"() {
82984
83035
  "use strict";
82985
83036
  init_parse4();
@@ -83057,7 +83108,7 @@ var SCHEMA_EXTRACTION_BUDGET;
83057
83108
  var init_extract_schema = __esm({
83058
83109
  "packages/agent-harness/src/loader/extract-schema.ts"() {
83059
83110
  "use strict";
83060
- init_src36();
83111
+ init_src37();
83061
83112
  init_schema4();
83062
83113
  SCHEMA_EXTRACTION_BUDGET = {
83063
83114
  arrayLength: 1e3,
@@ -83509,7 +83560,7 @@ var init_run4 = __esm({
83509
83560
  "packages/agent-harness/src/loader/run.ts"() {
83510
83561
  "use strict";
83511
83562
  init_src9();
83512
- init_src36();
83563
+ init_src37();
83513
83564
  init_schema4();
83514
83565
  init_extract_schema();
83515
83566
  init_pair();
@@ -83549,7 +83600,7 @@ var init_templates5 = __esm({
83549
83600
  });
83550
83601
 
83551
83602
  // packages/agent-harness/src/index.ts
83552
- var init_src37 = __esm({
83603
+ var init_src38 = __esm({
83553
83604
  "packages/agent-harness/src/index.ts"() {
83554
83605
  "use strict";
83555
83606
  init_schema4();
@@ -83807,8 +83858,8 @@ function formatDisplayPath2(container, filePath) {
83807
83858
  var init_harness2 = __esm({
83808
83859
  async "src/cli/commands/harness.ts"() {
83809
83860
  "use strict";
83861
+ init_src38();
83810
83862
  init_src37();
83811
- init_src36();
83812
83863
  init_src11();
83813
83864
  init_errors2();
83814
83865
  init_shared();
@@ -83874,7 +83925,7 @@ function hasNonEmptyString(value) {
83874
83925
  var init_braintrust = __esm({
83875
83926
  "src/cli/commands/braintrust.ts"() {
83876
83927
  "use strict";
83877
- init_src19();
83928
+ init_src20();
83878
83929
  init_shared();
83879
83930
  }
83880
83931
  });
@@ -84004,7 +84055,7 @@ var DEFAULT_WORKFLOW_PATH, MAESTRO_TASK_STATE_MACHINE_STATES, TasksOptionsError;
84004
84055
  var init_tasks_options = __esm({
84005
84056
  "src/cli/commands/tasks-options.ts"() {
84006
84057
  "use strict";
84007
- init_src33();
84058
+ init_src34();
84008
84059
  DEFAULT_WORKFLOW_PATH = "./WORKFLOW.md";
84009
84060
  MAESTRO_TASK_STATE_MACHINE_STATES = [
84010
84061
  "queued",
@@ -84162,7 +84213,7 @@ var init_package2 = __esm({
84162
84213
  "package.json"() {
84163
84214
  package_default2 = {
84164
84215
  name: "poe-code",
84165
- version: "3.0.216",
84216
+ version: "3.0.217",
84166
84217
  description: "CLI tool to configure Poe API for developer workflows.",
84167
84218
  type: "module",
84168
84219
  main: "./dist/index.js",
@@ -84288,6 +84339,7 @@ var init_package2 = __esm({
84288
84339
  devDependencies: {
84289
84340
  "@eslint/js": "^9.0.0",
84290
84341
  "@modelcontextprotocol/sdk": "^1.26.0",
84342
+ "@poe-code/acp-telemetry": "*",
84291
84343
  "@poe-code/agent-child-process": "*",
84292
84344
  "@poe-code/agent-defs": "*",
84293
84345
  "@poe-code/agent-harness": "*",
@@ -84805,9 +84857,9 @@ var init_program = __esm({
84805
84857
  "use strict";
84806
84858
  init_src16();
84807
84859
  init_cli();
84808
- init_src33();
84809
- init_src20();
84810
- init_src31();
84860
+ init_src34();
84861
+ init_src21();
84862
+ init_src32();
84811
84863
  await init_container2();
84812
84864
  init_src11();
84813
84865
  init_configure();
@@ -85105,12 +85157,12 @@ var init_bootstrap = __esm({
85105
85157
  // src/index.ts
85106
85158
  await init_spawn4();
85107
85159
  await init_pipeline3();
85108
- init_src31();
85160
+ init_src32();
85109
85161
  import { realpathSync as realpathSync2 } from "node:fs";
85110
85162
  import { pathToFileURL as pathToFileURL3 } from "node:url";
85111
85163
 
85112
85164
  // src/sdk/process-launcher.ts
85113
- init_src32();
85165
+ init_src33();
85114
85166
 
85115
85167
  // src/index.ts
85116
85168
  await init_ralph2();
@@ -85234,7 +85286,7 @@ var planDocumentSchema = {
85234
85286
  };
85235
85287
 
85236
85288
  // src/index.ts
85237
- init_src33();
85289
+ init_src34();
85238
85290
  init_launch();
85239
85291
 
85240
85292
  // src/cli/poe-agent-main.ts