@lazyingart/agintiflow 0.12.3 → 0.12.4
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/README.md +1 -1
- package/package.json +1 -1
- package/scripts/smoke-cli-chat.js +4 -1
- package/src/interactive-cli.js +38 -6
package/README.md
CHANGED
|
@@ -67,7 +67,7 @@ aginti
|
|
|
67
67
|
aginti chat
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
-
Inside chat, type normal requests such as `write a small Python CLI app with tests`. The default is Docker workspace mode with approved package installs, so coding, plotting, and LaTeX tasks can set up project-local tools without touching the host. Use `/help` for commands, `/login` or `/auth` to paste a provider key, `/instructions` to inspect `AGINTI.md`, `/latex on` for PDF work, `/docker off` only when you intentionally want host mode, `/sessions` to list project runs, and `/resume latest` or `/resume <session-id>` to continue work. Type `/` then Tab for command completion. `Ctrl+J` inserts a new line in the colored input panel, Enter sends, arrow keys move through wrapped multiline input, and `Ctrl+A`/`Ctrl+E` jump to the current line start/end. Assistant responses render common Markdown, including headings, inline code, bold text, lists, quotes, code fences, and tables. Esc or Ctrl+C stops the active run cleanly and prints the resume command.
|
|
70
|
+
Inside chat, type normal requests such as `write a small Python CLI app with tests`. The default is Docker workspace mode with approved package installs, so coding, plotting, and LaTeX tasks can set up project-local tools without touching the host. Use `/help` for commands, `/login` or `/auth` to paste a provider key, `/instructions` to inspect `AGINTI.md`, `/latex on` for PDF work, `/docker off` only when you intentionally want host mode, `/sessions` to list project runs, and `/resume latest` or `/resume <session-id>` to continue work. Type `/` then Tab for command completion. `Ctrl+J` inserts a new line in the colored input panel, Enter sends, arrow keys move through wrapped multiline input, and `Ctrl+A`/`Ctrl+E` jump to the current line start/end. Assistant responses start on a fresh line after the `aginti>` header and render common Markdown, including headings, inline code, bold text, lists, quotes, code fences, and tables. Esc or Ctrl+C stops the active run cleanly and prints the resume command.
|
|
71
71
|
|
|
72
72
|
`aginti init` creates `AGINTI.md` at the project root. This is the editable project-instruction file for both CLI and web runs, similar to `AGENTS.md` or project memory in other agents. Keep durable preferences, commands, and constraints there, but never secrets. You can edit it manually or ask in chat, for example: `update AGINTI.md to remember that this project uses pytest and npm run check`.
|
|
73
73
|
|
package/package.json
CHANGED
|
@@ -111,6 +111,9 @@ try {
|
|
|
111
111
|
if (!result.stdout.includes("status=running workingOn=") || !result.stdout.includes("status=idle session=")) {
|
|
112
112
|
throw new Error("interactive chat did not print simple run status updates");
|
|
113
113
|
}
|
|
114
|
+
if (!/aginti>\s+\|\r?\nMock run complete\./.test(result.stdout)) {
|
|
115
|
+
throw new Error("assistant response did not start on a fresh line after the aginti header");
|
|
116
|
+
}
|
|
114
117
|
|
|
115
118
|
const latest = await runCli(["resume"], "/exit\n");
|
|
116
119
|
if (!latest.stdout.includes("session=") || !latest.stdout.includes("Interactive agent chat")) {
|
|
@@ -122,7 +125,7 @@ try {
|
|
|
122
125
|
{
|
|
123
126
|
ok: true,
|
|
124
127
|
projectRoot: tempRoot,
|
|
125
|
-
checks: ["markdown-render", "prompt-layout", "aginti-md", "instructions-command", "instructions-chat-edit", "interactive-chat", "mock-file-write", "run-status", "resume-latest"],
|
|
128
|
+
checks: ["markdown-render", "prompt-layout", "agent-response-newline", "aginti-md", "instructions-command", "instructions-chat-edit", "interactive-chat", "mock-file-write", "run-status", "resume-latest"],
|
|
126
129
|
},
|
|
127
130
|
null,
|
|
128
131
|
2
|
package/src/interactive-cli.js
CHANGED
|
@@ -272,7 +272,10 @@ function printWrapped(prefix, text, { stripCode = "" } = {}) {
|
|
|
272
272
|
}
|
|
273
273
|
|
|
274
274
|
function printAgentMessage(text) {
|
|
275
|
-
|
|
275
|
+
console.log(rolePrefix("aginti>", ansi.agentBg).trimEnd());
|
|
276
|
+
const rendered = stripMarkdown(text);
|
|
277
|
+
const lines = rendered.split("\n");
|
|
278
|
+
for (const line of lines) console.log(line);
|
|
276
279
|
}
|
|
277
280
|
|
|
278
281
|
function printSystemLine(text) {
|
|
@@ -546,18 +549,47 @@ function clearRenderedPrompt(previous) {
|
|
|
546
549
|
}
|
|
547
550
|
}
|
|
548
551
|
|
|
549
|
-
function
|
|
550
|
-
|
|
551
|
-
|
|
552
|
+
function moveFromPromptCursorToTop(previous) {
|
|
553
|
+
if (!previous.lineCount) return;
|
|
554
|
+
const below = previous.lineCount - 1 - previous.cursorRow;
|
|
555
|
+
if (below > 0) output.write(`\x1b[${below}B`);
|
|
556
|
+
const up = previous.lineCount - 1;
|
|
557
|
+
if (up > 0) output.write(`\x1b[${up}A`);
|
|
558
|
+
output.write("\r");
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
function renderPromptBuffer(buffer, cursor, previous = { lineCount: 0, cursorRow: 0, renderedRows: [] }) {
|
|
552
562
|
const layout = buildPromptLayout(buffer, cursor);
|
|
553
|
-
|
|
563
|
+
const sameShape = previous.lineCount === layout.renderedRows.length && previous.renderedRows?.length === layout.renderedRows.length;
|
|
564
|
+
const changedRows = sameShape
|
|
565
|
+
? layout.renderedRows
|
|
566
|
+
.map((row, index) => (row === previous.renderedRows[index] ? -1 : index))
|
|
567
|
+
.filter((index) => index >= 0)
|
|
568
|
+
: layout.renderedRows.map((_row, index) => index);
|
|
569
|
+
|
|
570
|
+
if (!sameShape) {
|
|
571
|
+
output.write(ansi.cursorHide);
|
|
572
|
+
clearRenderedPrompt(previous);
|
|
573
|
+
output.write(layout.renderedRows.join("\n"));
|
|
574
|
+
} else if (changedRows.length > 0) {
|
|
575
|
+
output.write(ansi.cursorHide);
|
|
576
|
+
moveFromPromptCursorToTop(previous);
|
|
577
|
+
for (let index = 0; index < layout.renderedRows.length; index += 1) {
|
|
578
|
+
if (changedRows.includes(index)) output.write(`\r${layout.renderedRows[index]}`);
|
|
579
|
+
if (index < layout.renderedRows.length - 1) output.write("\x1b[1B\r");
|
|
580
|
+
}
|
|
581
|
+
} else {
|
|
582
|
+
moveFromPromptCursorToTop(previous);
|
|
583
|
+
}
|
|
584
|
+
|
|
554
585
|
const below = layout.renderedRows.length - 1 - layout.cursorRow;
|
|
555
586
|
if (below > 0) output.write(`\x1b[${below}A`);
|
|
556
587
|
output.write(`\r\x1b[${layout.cursorColumn + 1}G`);
|
|
557
|
-
output.write(ansi.cursorShow);
|
|
588
|
+
if (!sameShape || changedRows.length > 0) output.write(ansi.cursorShow);
|
|
558
589
|
return {
|
|
559
590
|
lineCount: layout.renderedRows.length,
|
|
560
591
|
cursorRow: layout.cursorRow,
|
|
592
|
+
renderedRows: layout.renderedRows,
|
|
561
593
|
};
|
|
562
594
|
}
|
|
563
595
|
|