@linxiraos/pi-tui 1.4.13 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/CHANGELOG.md +17 -34
  2. package/dist/types/chat/messages.d.ts +2 -0
  3. package/dist/types/chat/spotlight.d.ts +8 -3
  4. package/dist/types/chat/transcript-render-helpers.d.ts +5 -0
  5. package/dist/types/components/editor.d.ts +4 -1
  6. package/dist/types/html-form/data.d.ts +56 -0
  7. package/dist/types/html-form/dialog.d.ts +51 -0
  8. package/dist/types/html-form/media.d.ts +28 -0
  9. package/dist/types/html-form/paginate.d.ts +43 -0
  10. package/dist/types/html-form/parse.d.ts +99 -0
  11. package/dist/types/overlays/ask-dialog.d.ts +11 -6
  12. package/dist/types/overlays/copy-targets.d.ts +8 -6
  13. package/dist/types/overlays/hook-editor.d.ts +3 -1
  14. package/dist/types/overlays/hub-frame.d.ts +2 -0
  15. package/dist/types/overlays/model-hub.d.ts +2 -0
  16. package/dist/types/overlays/team-hub.d.ts +150 -0
  17. package/dist/types/render/row-moves.d.ts +41 -0
  18. package/dist/types/status-line/component.d.ts +5 -0
  19. package/dist/types/status-line/host.d.ts +2 -2
  20. package/dist/types/status-line/schema.d.ts +1 -1
  21. package/dist/types/status-line/types.d.ts +8 -0
  22. package/dist/types/tools/ask.d.ts +11 -49
  23. package/dist/types/tools/autoresearch.d.ts +2 -2
  24. package/dist/types/tools/eval.d.ts +4 -0
  25. package/dist/types/tools/grouped-file-output.d.ts +2 -0
  26. package/dist/types/tools/shell-viz.d.ts +6 -2
  27. package/dist/types/tools/xd-url.d.ts +6 -0
  28. package/dist/types/windows-input-mode.d.ts +8 -0
  29. package/package.json +9 -9
  30. package/src/charts/table-data.ts +18 -5
  31. package/src/chat/chat-transcript-builder.ts +27 -10
  32. package/src/chat/image-loading.ts +55 -0
  33. package/src/chat/messages.d.ts +2 -0
  34. package/src/chat/messages.ts +3 -0
  35. package/src/chat/spotlight.d.ts +8 -3
  36. package/src/chat/spotlight.ts +23 -11
  37. package/src/chat/tool-execution.ts +5 -0
  38. package/src/chat/transcript-render-helpers.d.ts +5 -0
  39. package/src/chat/transcript-render-helpers.ts +13 -0
  40. package/src/chrome/transcript-container.ts +1 -1
  41. package/src/components/editor.d.ts +4 -1
  42. package/src/components/editor.ts +3 -2
  43. package/src/components/markdown.ts +70 -12
  44. package/src/html-form/data.d.ts +56 -0
  45. package/src/html-form/data.ts +177 -0
  46. package/src/html-form/dialog.ts +1450 -0
  47. package/src/html-form/media.ts +105 -0
  48. package/src/html-form/paginate.ts +99 -0
  49. package/src/html-form/parse.d.ts +99 -0
  50. package/src/html-form/parse.ts +568 -0
  51. package/src/lang-from-path.ts +1 -0
  52. package/src/latex-block.ts +3 -3
  53. package/src/latex-to-unicode.ts +18 -5
  54. package/src/overlays/ask-dialog.ts +69 -52
  55. package/src/overlays/copy-targets.d.ts +8 -6
  56. package/src/overlays/copy-targets.ts +25 -46
  57. package/src/overlays/hook-editor.ts +16 -15
  58. package/src/overlays/hub-frame.ts +8 -1
  59. package/src/overlays/model-hub.ts +12 -2
  60. package/src/overlays/spotlight-sheet.ts +18 -18
  61. package/src/overlays/team-hub.ts +901 -0
  62. package/src/render/row-moves.d.ts +41 -0
  63. package/src/render/row-moves.ts +109 -0
  64. package/src/setup/wizard-overlay.ts +7 -3
  65. package/src/status-line/component.ts +19 -0
  66. package/src/status-line/footer.ts +2 -2
  67. package/src/status-line/host.ts +2 -2
  68. package/src/status-line/presets.ts +6 -6
  69. package/src/status-line/schema.ts +2 -1
  70. package/src/status-line/segments.ts +31 -4
  71. package/src/status-line/startup.ts +1 -1
  72. package/src/status-line/types.ts +8 -0
  73. package/src/stdin-buffer.ts +15 -1
  74. package/src/terminal-capabilities.ts +12 -3
  75. package/src/terminal.ts +41 -3
  76. package/src/tools/ask.d.ts +11 -49
  77. package/src/tools/ask.ts +201 -606
  78. package/src/tools/autoresearch.ts +2 -2
  79. package/src/tools/debug.ts +31 -38
  80. package/src/tools/eval.d.ts +4 -0
  81. package/src/tools/eval.ts +4 -0
  82. package/src/tools/grep.ts +38 -16
  83. package/src/tools/grouped-file-output.d.ts +2 -0
  84. package/src/tools/grouped-file-output.ts +5 -0
  85. package/src/tools/shell-viz-render.ts +37 -6
  86. package/src/tools/shell-viz.d.ts +6 -2
  87. package/src/tools/shell-viz.ts +19 -6
  88. package/src/tools/xd-url.d.ts +6 -0
  89. package/src/tools/xd-url.ts +19 -1
  90. package/src/tui.ts +129 -1
  91. package/src/windows-input-mode.d.ts +8 -0
  92. package/src/windows-input-mode.ts +13 -0
@@ -67,9 +67,9 @@ const LEGEND: readonly { cls: LineClass; tone: TspTone; label: string }[] = [
67
67
  { cls: "cut", tone: "muted", label: "cut" },
68
68
  ];
69
69
 
70
- /** One legend entry (role `omp.spotlight.key`): a swatch and a muted label. */
70
+ /** One legend entry (role `zeta.spotlight.key`): a swatch and a muted label. */
71
71
  function legendKey(swatch: NativeNode, label: string): NativeNode {
72
- return row([swatch, text([span(label, "muted")])], { gap: "xs", align: "center", role: "omp.spotlight.key" });
72
+ return row([swatch, text([span(label, "muted")])], { gap: "xs", align: "center", role: "zeta.spotlight.key" });
73
73
  }
74
74
 
75
75
  /** A count with thousands separators. */
@@ -104,7 +104,7 @@ function nonBlankParams(params: SpotlightRequestParams): Param[] {
104
104
  }
105
105
 
106
106
  /**
107
- * One parameter's row (role `omp.spotlight.param`): its name, then its non-blank values on one run of spaces and at
107
+ * One parameter's row (role `zeta.spotlight.param`): its name, then its non-blank values on one run of spaces and at
108
108
  * most `lines` lines, whole in the tooltip; `end` (the toggle) last.
109
109
  */
110
110
  function paramRow(param: Param, lines: number, end?: NativeNode): NativeNode {
@@ -115,11 +115,11 @@ function paramRow(param: Param, lines: number, end?: NativeNode): NativeNode {
115
115
  return i === 0 ? [part] : [span(" · ", param.style ? `dim ${param.style}` : "dim"), part];
116
116
  });
117
117
  const shown = text(spans, { lines, truncate: "end", title: whole.join("\n") });
118
- return row(compact([text(param.name), shown, end]), { gap: "md", align: "baseline", role: "omp.spotlight.param" });
118
+ return row(compact([text(param.name), shown, end]), { gap: "md", align: "baseline", role: "zeta.spotlight.param" });
119
119
  }
120
120
 
121
121
  /**
122
- * What the result's Spotlight requests sent besides its lines (role `omp.spotlight.params`): collapsed, the first
122
+ * What the result's Spotlight requests sent besides its lines (role `zeta.spotlight.params`): collapsed, the first
123
123
  * parameter (the intent) on one line and a toggle naming the rest; expanded, a row per parameter.
124
124
  */
125
125
  function requestParams(params: SpotlightRequestParams, expanded: boolean): NativeNode | undefined {
@@ -129,14 +129,14 @@ function requestParams(params: SpotlightRequestParams, expanded: boolean): Nativ
129
129
  const toggle =
130
130
  rest.length > 0
131
131
  ? text(expanded ? "fewer ▾" : `${rest.map(param => param.name).join(", ")} ▸`, {
132
- role: "omp.spotlight.more",
132
+ role: "zeta.spotlight.more",
133
133
  actions: { click: "params" },
134
134
  })
135
135
  : undefined;
136
136
  const rows = (expanded ? named : named.slice(0, 1)).map((param, i) =>
137
137
  paramRow(param, expanded ? 2 : 1, i === 0 ? toggle : undefined),
138
138
  );
139
- return col(rows, { gap: "xs", role: "omp.spotlight.params" });
139
+ return col(rows, { gap: "xs", role: "zeta.spotlight.params" });
140
140
  }
141
141
 
142
142
  /** The class the summary counts original line `i` (0-based) in; undefined without a reason. */
@@ -148,7 +148,7 @@ function lineClass(original: SpotlightOriginal, i: number): LineClass | undefine
148
148
  }
149
149
 
150
150
  /**
151
- * The summary row (role `omp.spotlight.summary`): a legend swatch and count per class of the shown lines (with
151
+ * The summary row (role `zeta.spotlight.summary`): a legend swatch and count per class of the shown lines (with
152
152
  * reasons), then the ranking step's budget and cutoff and whether the view is cut; undefined when it has nothing.
153
153
  */
154
154
  function summary(original: SpotlightOriginal, shown: number, total: number): NativeNode | undefined {
@@ -161,7 +161,7 @@ function summary(original: SpotlightOriginal, shown: number, total: number): Nat
161
161
  }
162
162
  for (const { cls, tone, label } of LEGEND) {
163
163
  const n = counts.get(cls);
164
- if (n) items.push(legendKey(text("■", { role: "omp.spotlight.swatch", tone }), `${label} ${count(n)}`));
164
+ if (n) items.push(legendKey(text("■", { role: "zeta.spotlight.swatch", tone }), `${label} ${count(n)}`));
165
165
  }
166
166
  }
167
167
  const facts: string[] = [];
@@ -175,12 +175,12 @@ function summary(original: SpotlightOriginal, shown: number, total: number): Nat
175
175
  }
176
176
  if (shown < total) facts.push(`first ${count(shown)} of ${count(total)} lines`);
177
177
  if (items.length === 0 && facts.length === 0) return undefined;
178
- const budget = facts.length > 0 && text([span(facts.join(" · "), "muted")], { role: "omp.spotlight.budget" });
178
+ const budget = facts.length > 0 && text([span(facts.join(" · "), "muted")], { role: "zeta.spotlight.budget" });
179
179
  return row(compact([...items, node("spacer", { grow: 1 }), budget]), {
180
180
  gap: "md",
181
181
  align: "center",
182
182
  wrap: true,
183
- role: "omp.spotlight.summary",
183
+ role: "zeta.spotlight.summary",
184
184
  });
185
185
  }
186
186
 
@@ -280,7 +280,7 @@ function hotCard(sheet: SheetText, i: number): TspPropNode {
280
280
  ]),
281
281
  why !== undefined && text([span(why, "error")]),
282
282
  ]),
283
- { gap: "xs", role: "omp.spotlight.card" },
283
+ { gap: "xs", role: "zeta.spotlight.card" },
284
284
  ),
285
285
  );
286
286
  }
@@ -333,7 +333,7 @@ function folds(sheet: SheetText): TspCodeFold[] {
333
333
  const OVERVIEW_MIN_LINES = 60;
334
334
 
335
335
  /**
336
- * The original as one `code` element (role `omp.spotlight.code`): marks, folds, and the overview past
336
+ * The original as one `code` element (role `zeta.spotlight.code`): marks, folds, and the overview past
337
337
  * {@link OVERVIEW_MIN_LINES}. Command output (no file) wraps, a file keeps its lines.
338
338
  */
339
339
  function originalCode(sheet: SheetText): NativeNode {
@@ -341,7 +341,7 @@ function originalCode(sheet: SheetText): NativeNode {
341
341
  const marks = compact(sheet.lines.map((_, i) => lineMark(original, i)));
342
342
  const shut = folds(sheet);
343
343
  return code(sheet.lines.join("\n"), {
344
- role: "omp.spotlight.code",
344
+ role: "zeta.spotlight.code",
345
345
  path: sheet.path,
346
346
  start: original.start,
347
347
  numbers: true,
@@ -368,20 +368,20 @@ function shapingNotes(sheet: SheetText, heldOut: boolean): NativeNode | undefine
368
368
  const heading = heldOut ? "notes the model would have seen" : "notes the model saw";
369
369
  return col([text([span(heading, "muted")]), ...notes.map(note => text([span(note, "muted mono")]))], {
370
370
  gap: "xs",
371
- role: "omp.spotlight.notes",
371
+ role: "zeta.spotlight.notes",
372
372
  });
373
373
  }
374
374
 
375
375
  /**
376
- * The footer's key to the rows' wash (role `omp.spotlight.legend`): the heat ramp (role `omp.spotlight.ramp`, drawn
376
+ * The footer's key to the rows' wash (role `zeta.spotlight.legend`): the heat ramp (role `zeta.spotlight.ramp`, drawn
377
377
  * by the terminal) before the rank's parts in their order across a row.
378
378
  */
379
379
  function rankLegend(rank: SpotlightRank): NativeNode {
380
380
  const label =
381
381
  rank.parts.length > 1 ? `row tint, left to right: ${rank.parts.join(" → ")}` : `row tint: ${rank.parts[0]}`;
382
- return row([legendKey(text("", { role: "omp.spotlight.ramp" }), label)], {
382
+ return row([legendKey(text("", { role: "zeta.spotlight.ramp" }), label)], {
383
383
  align: "center",
384
- role: "omp.spotlight.legend",
384
+ role: "zeta.spotlight.legend",
385
385
  });
386
386
  }
387
387