poe-code 3.0.429-beta.1 → 3.0.429

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
@@ -10251,8 +10251,8 @@ var init_keymap2 = __esm({
10251
10251
  cursorDown: ["down", "j"],
10252
10252
  top: ["home", "gg"],
10253
10253
  bottom: ["end", "G"],
10254
- pageUp: ["Ctrl+u"],
10255
- pageDown: ["Ctrl+d"],
10254
+ pageUp: ["pageup", "Ctrl+u"],
10255
+ pageDown: ["pagedown", "Ctrl+d"],
10256
10256
  focusNext: ["tab"],
10257
10257
  escape: ["escape"],
10258
10258
  confirm: ["return", "enter"],
@@ -11026,7 +11026,12 @@ function renderModal(state, screen) {
11026
11026
  drawBox(screen, x, y, width, height, title(state), styles.borderFocused);
11027
11027
  const lines = modalLines(state);
11028
11028
  for (let row = 0; row < Math.min(lines.length, height - 2); row += 1) {
11029
- screen.put(x + 2, y + 1 + row, fitToWidth(lines[row], width - 4, x + 2), row === 1 ? styles.accent : {});
11029
+ screen.put(
11030
+ x + 2,
11031
+ y + 1 + row,
11032
+ fitToWidth(stripAnsi(lines[row]), width - 4, x + 2),
11033
+ row === 1 ? styles.accent : {}
11034
+ );
11030
11035
  }
11031
11036
  }
11032
11037
  function modalLines(state) {
@@ -11114,6 +11119,7 @@ function labelFor(action) {
11114
11119
  var init_modal = __esm({
11115
11120
  "packages/toolcraft-design/src/explorer/render/modal.ts"() {
11116
11121
  "use strict";
11122
+ init_strip_ansi();
11117
11123
  init_theme();
11118
11124
  init_text2();
11119
11125
  }
@@ -104423,7 +104429,7 @@ var init_breakdown = __esm({
104423
104429
  matches: () => true
104424
104430
  }
104425
104431
  ];
104426
- TURNS_PER_YIELD = 256;
104432
+ TURNS_PER_YIELD = 64;
104427
104433
  ESTIMATOR_SAMPLE_TARGET_CHARS = 16384;
104428
104434
  ESTIMATOR_SAMPLE_CHARS_PER_TURN = 1024;
104429
104435
  ESTIMATOR_DEFAULT_CHARS_PER_TOKEN = 4;
@@ -104685,6 +104691,7 @@ function scheduleExactBreakdown(trace, filePath, identity, cacheDir, options) {
104685
104691
  return;
104686
104692
  }
104687
104693
  const task = (async () => {
104694
+ await new Promise((resolve14) => setTimeout(resolve14, EXACT_BREAKDOWN_START_DELAY_MS));
104688
104695
  const breakdown = await computeContextBreakdown(trace);
104689
104696
  await writeCachedBreakdown(options.fs, cacheDir, filePath, identity, breakdown);
104690
104697
  options.onExactBreakdown?.(breakdown);
@@ -104749,7 +104756,7 @@ function dateValue(date) {
104749
104756
  function isRecord39(value) {
104750
104757
  return typeof value === "object" && value !== null && !Array.isArray(value);
104751
104758
  }
104752
- var exactBreakdownsInFlight;
104759
+ var exactBreakdownsInFlight, EXACT_BREAKDOWN_START_DELAY_MS;
104753
104760
  var init_loader3 = __esm({
104754
104761
  "packages/agent-trace-viewer/src/loader.ts"() {
104755
104762
  "use strict";
@@ -104758,6 +104765,7 @@ var init_loader3 = __esm({
104758
104765
  init_context3();
104759
104766
  init_token_cache();
104760
104767
  exactBreakdownsInFlight = /* @__PURE__ */ new Map();
104768
+ EXACT_BREAKDOWN_START_DELAY_MS = 1e3;
104761
104769
  }
104762
104770
  });
104763
104771
 
@@ -104992,15 +105000,20 @@ function renderTurn(turn, theme) {
104992
105000
  const shouldCollapse = turn.role === "tool" || turn.role === "system";
104993
105001
  let sourceText = turn.text;
104994
105002
  let collapsedLines = 0;
105003
+ let truncatedWithinLine = false;
104995
105004
  if (shouldCollapse) {
104996
105005
  const cut = lineEndIndex(sourceText, COLLAPSED_TURN_LINES);
104997
105006
  if (cut !== -1) {
104998
105007
  collapsedLines = countNewlines(sourceText, cut);
104999
105008
  sourceText = sourceText.slice(0, cut);
105000
105009
  }
105010
+ if (sourceText.length > COLLAPSED_TURN_MAX_CHARS) {
105011
+ sourceText = sourceText.slice(0, COLLAPSED_TURN_MAX_CHARS);
105012
+ truncatedWithinLine = true;
105013
+ }
105001
105014
  }
105002
105015
  const sanitizedText = sanitizeTraceText(sourceText);
105003
- const text5 = turn.role === "assistant" ? stripAnsi(renderMarkdown(sanitizedText)).trimEnd() : sanitizedText.trimEnd();
105016
+ const text5 = turn.role === "assistant" && sanitizedText.length <= MAX_MARKDOWN_TURN_CHARS ? stripAnsi(renderMarkdown(sanitizedText)).trimEnd() : sanitizedText.trimEnd();
105004
105017
  const rawLines = text5.length === 0 ? [""] : text5.split("\n");
105005
105018
  const visibleLines = shouldCollapse ? rawLines.slice(0, COLLAPSED_TURN_LINES) : rawLines;
105006
105019
  const remaining = collapsedLines + rawLines.length - visibleLines.length;
@@ -105015,8 +105028,14 @@ function renderTurn(turn, theme) {
105015
105028
  lines.push(`${linePrefix}${wrappedLine}`);
105016
105029
  });
105017
105030
  });
105031
+ if (shouldCollapse && lines.length > COLLAPSED_TURN_LINES) {
105032
+ lines.length = COLLAPSED_TURN_LINES;
105033
+ truncatedWithinLine = true;
105034
+ }
105018
105035
  if (remaining > 0) {
105019
105036
  lines[lines.length - 1] = `${lines[lines.length - 1]} ${theme.muted(`\u2026 +${remaining} lines`)}`;
105037
+ } else if (truncatedWithinLine) {
105038
+ lines[lines.length - 1] = `${lines[lines.length - 1]} ${theme.muted("\u2026")}`;
105020
105039
  }
105021
105040
  return lines;
105022
105041
  }
@@ -105208,7 +105227,7 @@ function splitLongWord(value, width) {
105208
105227
  }
105209
105228
  return chunks;
105210
105229
  }
105211
- var DEFAULT_GAUGE_WIDTH, COMPACT_GAUGE_WIDTH, MAX_RENDER_WIDTH, MAX_TRACE_LABEL_WIDTH, MAX_TRACE_META_CWD_WIDTH, MAX_SUBAGENT_AGENT_WIDTH, MAX_SUBAGENT_DESCRIPTION_WIDTH, COLLAPSED_TURN_LINES, TURNS_PER_RENDER_YIELD, CATEGORY_ORDER, CATEGORY_COLORS, SOURCE_COLORS, ROLE_RENDERING, UNKNOWN_CATEGORY_COLOR;
105230
+ var DEFAULT_GAUGE_WIDTH, COMPACT_GAUGE_WIDTH, MAX_RENDER_WIDTH, MAX_TRACE_LABEL_WIDTH, MAX_TRACE_META_CWD_WIDTH, MAX_SUBAGENT_AGENT_WIDTH, MAX_SUBAGENT_DESCRIPTION_WIDTH, COLLAPSED_TURN_LINES, COLLAPSED_TURN_MAX_CHARS, MAX_MARKDOWN_TURN_CHARS, TURNS_PER_RENDER_YIELD, CATEGORY_ORDER, CATEGORY_COLORS, SOURCE_COLORS, ROLE_RENDERING, UNKNOWN_CATEGORY_COLOR;
105212
105231
  var init_render4 = __esm({
105213
105232
  "packages/agent-trace-viewer/src/render.ts"() {
105214
105233
  "use strict";
@@ -105221,6 +105240,8 @@ var init_render4 = __esm({
105221
105240
  MAX_SUBAGENT_AGENT_WIDTH = 13;
105222
105241
  MAX_SUBAGENT_DESCRIPTION_WIDTH = 26;
105223
105242
  COLLAPSED_TURN_LINES = 3;
105243
+ COLLAPSED_TURN_MAX_CHARS = (MAX_RENDER_WIDTH + 1) * COLLAPSED_TURN_LINES;
105244
+ MAX_MARKDOWN_TURN_CHARS = 65536;
105224
105245
  TURNS_PER_RENDER_YIELD = 256;
105225
105246
  CATEGORY_ORDER = [
105226
105247
  "system-prompt",
@@ -145316,7 +145337,7 @@ var init_package2 = __esm({
145316
145337
  "package.json"() {
145317
145338
  package_default2 = {
145318
145339
  name: "poe-code",
145319
- version: "3.0.429-beta.1",
145340
+ version: "3.0.429",
145320
145341
  description: "CLI tool to configure Poe API for developer workflows.",
145321
145342
  license: "MIT",
145322
145343
  type: "module",