@lazyingart/agintiflow 0.20.16 → 0.20.18
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 +1 -1
- package/public/index.html +16 -16
- package/public/styles.css +13 -0
- package/scripts/smoke-cli-chat.js +8 -0
- package/src/interactive-cli.js +33 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lazyingart/agintiflow",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.18",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "AgInTiFlow is a web-first coding agent and CLI with DeepSeek routing, sandboxed tools, model providers, canvas artifacts, and optional wrappers.",
|
|
6
6
|
"license": "Apache-2.0",
|
package/public/index.html
CHANGED
|
@@ -85,6 +85,22 @@
|
|
|
85
85
|
</section>
|
|
86
86
|
|
|
87
87
|
<form id="run-form">
|
|
88
|
+
<label>
|
|
89
|
+
<span data-i18n="goalLabel">Goal</span>
|
|
90
|
+
<textarea
|
|
91
|
+
id="goal"
|
|
92
|
+
name="goal"
|
|
93
|
+
rows="5"
|
|
94
|
+
data-i18n-placeholder="goalPlaceholder"
|
|
95
|
+
placeholder="Open a site and summarize it, or use run_command for simple terminal inspection."
|
|
96
|
+
></textarea>
|
|
97
|
+
</label>
|
|
98
|
+
|
|
99
|
+
<div class="actions run-start-actions">
|
|
100
|
+
<button type="submit" data-i18n="startRunButton">Start run</button>
|
|
101
|
+
<span id="key-status" class="subtle"></span>
|
|
102
|
+
</div>
|
|
103
|
+
|
|
88
104
|
<label>
|
|
89
105
|
<span data-i18n="routingModeLabel">Routing policy</span>
|
|
90
106
|
<select id="routingMode" name="routingMode">
|
|
@@ -126,17 +142,6 @@
|
|
|
126
142
|
</select>
|
|
127
143
|
</label>
|
|
128
144
|
|
|
129
|
-
<label>
|
|
130
|
-
<span data-i18n="goalLabel">Goal</span>
|
|
131
|
-
<textarea
|
|
132
|
-
id="goal"
|
|
133
|
-
name="goal"
|
|
134
|
-
rows="5"
|
|
135
|
-
data-i18n-placeholder="goalPlaceholder"
|
|
136
|
-
placeholder="Open a site and summarize it, or use run_command for simple terminal inspection."
|
|
137
|
-
></textarea>
|
|
138
|
-
</label>
|
|
139
|
-
|
|
140
145
|
<div class="grid">
|
|
141
146
|
<label>
|
|
142
147
|
<span data-i18n="commandCwdLabel">Working directory</span>
|
|
@@ -187,11 +192,6 @@
|
|
|
187
192
|
</div>
|
|
188
193
|
|
|
189
194
|
<button id="open-settings" type="button" class="secondary settings-button">Advanced settings</button>
|
|
190
|
-
|
|
191
|
-
<div class="actions">
|
|
192
|
-
<button type="submit" data-i18n="startRunButton">Start run</button>
|
|
193
|
-
<span id="key-status" class="subtle"></span>
|
|
194
|
-
</div>
|
|
195
195
|
</form>
|
|
196
196
|
</section>
|
|
197
197
|
|
package/public/styles.css
CHANGED
|
@@ -596,6 +596,19 @@ button.danger {
|
|
|
596
596
|
justify-content: space-between;
|
|
597
597
|
}
|
|
598
598
|
|
|
599
|
+
.run-start-actions {
|
|
600
|
+
display: grid;
|
|
601
|
+
gap: 8px;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
.run-start-actions button {
|
|
605
|
+
width: 100%;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
.run-start-actions #key-status {
|
|
609
|
+
min-height: 1.2em;
|
|
610
|
+
}
|
|
611
|
+
|
|
599
612
|
.run-header-actions {
|
|
600
613
|
display: flex;
|
|
601
614
|
min-width: 0;
|
|
@@ -6,6 +6,7 @@ import path from "node:path";
|
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
7
7
|
import {
|
|
8
8
|
buildLaunchHeaderLines,
|
|
9
|
+
formatCommittedUserPromptLines,
|
|
9
10
|
buildPromptLayout,
|
|
10
11
|
buildPromptRenderSequence,
|
|
11
12
|
canonicalSlashPromptBuffer,
|
|
@@ -173,6 +174,12 @@ try {
|
|
|
173
174
|
) {
|
|
174
175
|
throw new Error("terminal prompt layout did not render visual-only input padding safely");
|
|
175
176
|
}
|
|
177
|
+
const committedUserText = formatCommittedUserPromptLines("list files", 90)
|
|
178
|
+
.map((line) => line.replace(/\x1b\[[0-9;?]*[ -/]*[@-~]/g, ""))
|
|
179
|
+
.join("\n");
|
|
180
|
+
if (!committedUserText.includes("user> list files") || committedUserText.includes("cwd")) {
|
|
181
|
+
throw new Error("committed user history should not include the live cwd footer");
|
|
182
|
+
}
|
|
176
183
|
const zhPromptLayout = buildPromptLayout("", 0, 90, 24, { language: "zh-Hans", commandCwd: "/tmp/aginti-project" });
|
|
177
184
|
const zhPromptText = zhPromptLayout.renderedRows.map((line) => line.replace(/\x1b\[[0-9;?]*[ -/]*[@-~]/g, "")).join("\n");
|
|
178
185
|
if (!zhPromptText.includes("输入任务")) {
|
|
@@ -317,6 +324,7 @@ try {
|
|
|
317
324
|
"large-launch-header",
|
|
318
325
|
"prompt-layout",
|
|
319
326
|
"prompt-redraw-fast-path",
|
|
327
|
+
"committed-user-no-cwd-footer",
|
|
320
328
|
"cli-i18n",
|
|
321
329
|
"user-prompt-label",
|
|
322
330
|
"escape-policy",
|
package/src/interactive-cli.js
CHANGED
|
@@ -910,10 +910,30 @@ function renderPromptBuffer(buffer, cursor, previous = { lineCount: 0, cursorRow
|
|
|
910
910
|
};
|
|
911
911
|
}
|
|
912
912
|
|
|
913
|
-
function
|
|
914
|
-
const
|
|
915
|
-
|
|
916
|
-
|
|
913
|
+
export function formatCommittedUserPromptLines(text = "", width = terminalWidth()) {
|
|
914
|
+
const safeText = String(text || "");
|
|
915
|
+
const lineWidth = editorWidth(width);
|
|
916
|
+
const firstPrefix = labelText("user>", { prompt: true });
|
|
917
|
+
const nextPrefix = labelText("...", { prompt: true });
|
|
918
|
+
const rows = [];
|
|
919
|
+
const sourceLines = safeText.split(/\r?\n/);
|
|
920
|
+
|
|
921
|
+
for (const [lineIndex, sourceLine] of sourceLines.entries()) {
|
|
922
|
+
const prefix = lineIndex === 0 ? firstPrefix : nextPrefix;
|
|
923
|
+
const innerWidth = Math.max(lineWidth - prefix.length, 8);
|
|
924
|
+
const wrapped = wrapTextLine(sourceLine, innerWidth);
|
|
925
|
+
const chunks = wrapped.length > 0 ? wrapped : [""];
|
|
926
|
+
for (const [chunkIndex, chunk] of chunks.entries()) {
|
|
927
|
+
const rowPrefix = lineIndex === 0 && chunkIndex === 0 ? firstPrefix : nextPrefix;
|
|
928
|
+
rows.push(panelLine(`${rowPrefix}${chunk}`, ansi.userBg, lineWidth));
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
return rows.length > 0 ? rows : [panelLine(firstPrefix, ansi.userBg, lineWidth)];
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
function printCommittedUserInput(text = "") {
|
|
936
|
+
for (const line of formatCommittedUserPromptLines(text)) outputLine(line);
|
|
917
937
|
}
|
|
918
938
|
|
|
919
939
|
function lineBounds(buffer, cursor) {
|
|
@@ -973,6 +993,12 @@ function readTtyPrompt(options = {}) {
|
|
|
973
993
|
let suggestionAnchor = "";
|
|
974
994
|
let suggestionIndex = 0;
|
|
975
995
|
|
|
996
|
+
const clearPromptPanel = () => {
|
|
997
|
+
if (!rendered.lineCount) return;
|
|
998
|
+
clearRenderedPrompt(rendered);
|
|
999
|
+
rendered = { lineCount: 0, cursorRow: 0, renderedRows: [] };
|
|
1000
|
+
};
|
|
1001
|
+
|
|
976
1002
|
const cleanup = () => {
|
|
977
1003
|
if (redrawHandle) {
|
|
978
1004
|
clearImmediate(redrawHandle);
|
|
@@ -1012,10 +1038,9 @@ function readTtyPrompt(options = {}) {
|
|
|
1012
1038
|
buffer = canonical;
|
|
1013
1039
|
cursor = buffer.length;
|
|
1014
1040
|
}
|
|
1015
|
-
|
|
1016
|
-
moveToPromptBottom(rendered);
|
|
1041
|
+
clearPromptPanel();
|
|
1017
1042
|
cleanup();
|
|
1018
|
-
|
|
1043
|
+
printCommittedUserInput(buffer);
|
|
1019
1044
|
const saved = buffer.trim();
|
|
1020
1045
|
if (saved && promptHistory[promptHistory.length - 1] !== buffer) promptHistory.push(buffer);
|
|
1021
1046
|
resolve(buffer);
|
|
@@ -1078,10 +1103,8 @@ function readTtyPrompt(options = {}) {
|
|
|
1078
1103
|
|
|
1079
1104
|
const handler = (str = "", key = {}) => {
|
|
1080
1105
|
if (key.ctrl && key.name === "c") {
|
|
1081
|
-
|
|
1082
|
-
moveToPromptBottom(rendered);
|
|
1106
|
+
clearPromptPanel();
|
|
1083
1107
|
cleanup();
|
|
1084
|
-
output.write("\n");
|
|
1085
1108
|
reject(createAbortError());
|
|
1086
1109
|
return;
|
|
1087
1110
|
}
|