@lazyingart/agintiflow 0.15.0 → 0.15.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lazyingart/agintiflow",
3
- "version": "0.15.0",
3
+ "version": "0.15.1",
4
4
  "type": "module",
5
5
  "description": "AgInTiFlow is a resumable Playwright website-control agent with OpenAI-compatible tool calling.",
6
6
  "license": "Apache-2.0",
@@ -87,6 +87,12 @@ try {
87
87
  }
88
88
 
89
89
  const promptLayout = buildPromptLayout(`${"x".repeat(180)}\nsecond line`, 95, 80, 24);
90
+ const promptText = promptLayout.renderedRows
91
+ .map((line) => line.replace(/\x1b\[[0-9;?]*[ -/]*[@-~]/g, ""))
92
+ .join("\n");
93
+ if (!promptText.includes("user>")) {
94
+ throw new Error("terminal prompt layout did not render the user> label");
95
+ }
90
96
  const visibleLengths = promptLayout.renderedRows.map((line) =>
91
97
  line.replace(/\x1b\[[0-9;?]*[ -/]*[@-~]/g, "").length
92
98
  );
@@ -172,7 +178,7 @@ try {
172
178
  {
173
179
  ok: true,
174
180
  projectRoot: tempRoot,
175
- checks: ["markdown-render", "markdown-table-no-duplicate", "patch-diff-render", "prompt-layout", "escape-policy", "live-input-status-layout", "agent-response-gutter", "aginti-md", "instructions-command", "skills-command", "instructions-chat-edit", "interactive-chat", "mock-file-write", "run-status", "resume-latest", "resume-history-full"],
181
+ checks: ["markdown-render", "markdown-table-no-duplicate", "patch-diff-render", "prompt-layout", "user-prompt-label", "escape-policy", "live-input-status-layout", "agent-response-gutter", "aginti-md", "instructions-command", "skills-command", "instructions-chat-edit", "interactive-chat", "mock-file-write", "run-status", "resume-latest", "resume-history-full"],
176
182
  },
177
183
  null,
178
184
  2
@@ -542,7 +542,7 @@ export function buildPromptLayout(buffer = "", cursor = 0, width = terminalWidth
542
542
  const safeBuffer = String(buffer || "");
543
543
  const safeCursor = clamp(Number(cursor) || 0, 0, safeBuffer.length);
544
544
  const lineWidth = editorWidth(width);
545
- const firstPrefix = " user ";
545
+ const firstPrefix = " user> ";
546
546
  const nextPrefix = " ... ";
547
547
  const firstInnerWidth = Math.max(lineWidth - firstPrefix.length, 8);
548
548
  const nextInnerWidth = Math.max(lineWidth - nextPrefix.length, 8);
@@ -705,43 +705,16 @@ function clearRenderedPrompt(previous) {
705
705
  }
706
706
  }
707
707
 
708
- function moveFromPromptCursorToTop(previous) {
709
- if (!previous.lineCount) return;
710
- const below = previous.lineCount - 1 - previous.cursorRow;
711
- if (below > 0) output.write(`\x1b[${below}B`);
712
- const up = previous.lineCount - 1;
713
- if (up > 0) output.write(`\x1b[${up}A`);
714
- output.write("\r");
715
- }
716
-
717
708
  function renderPromptBuffer(buffer, cursor, previous = { lineCount: 0, cursorRow: 0, renderedRows: [] }, options = {}) {
718
709
  const layout = buildPromptLayout(buffer, cursor, terminalWidth(), terminalHeight(), options);
719
- const sameShape = previous.lineCount === layout.renderedRows.length && previous.renderedRows?.length === layout.renderedRows.length;
720
- const changedRows = sameShape
721
- ? layout.renderedRows
722
- .map((row, index) => (row === previous.renderedRows[index] ? -1 : index))
723
- .filter((index) => index >= 0)
724
- : layout.renderedRows.map((_row, index) => index);
725
-
726
- if (!sameShape) {
727
- output.write(ansi.cursorHide);
728
- clearRenderedPrompt(previous);
729
- output.write(layout.renderedRows.join("\n"));
730
- } else if (changedRows.length > 0) {
731
- output.write(ansi.cursorHide);
732
- moveFromPromptCursorToTop(previous);
733
- for (let index = 0; index < layout.renderedRows.length; index += 1) {
734
- if (changedRows.includes(index)) output.write(`\r${layout.renderedRows[index]}`);
735
- if (index < layout.renderedRows.length - 1) output.write("\x1b[1B\r");
736
- }
737
- } else {
738
- moveFromPromptCursorToTop(previous);
739
- }
710
+ output.write(ansi.cursorHide);
711
+ clearRenderedPrompt(previous);
712
+ output.write(layout.renderedRows.join("\n"));
740
713
 
741
714
  const below = layout.renderedRows.length - 1 - layout.cursorRow;
742
715
  if (below > 0) output.write(`\x1b[${below}A`);
743
716
  output.write(`\r\x1b[${layout.cursorColumn + 1}G`);
744
- if (!sameShape || changedRows.length > 0) output.write(ansi.cursorShow);
717
+ output.write(ansi.cursorShow);
745
718
  return {
746
719
  lineCount: layout.renderedRows.length,
747
720
  cursorRow: layout.cursorRow,