@lazyingart/agintiflow 0.20.124 → 0.20.125
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/src/interactive-cli.js +20 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lazyingart/agintiflow",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.125",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "AgInTiFlow is a project-aware agent workspace for hybrid wet-dry R&D, hardware-aware intelligence, software automation, and industrial workflows.",
|
|
6
6
|
"license": "Apache-2.0",
|
package/src/interactive-cli.js
CHANGED
|
@@ -294,7 +294,23 @@ function promptViewportRows(height = terminalHeight()) {
|
|
|
294
294
|
}
|
|
295
295
|
|
|
296
296
|
function stripAnsi(value) {
|
|
297
|
-
return String(value || "")
|
|
297
|
+
return String(value || "")
|
|
298
|
+
.replace(/\x1b\][\s\S]*?(?:\x07|\x1b\\)/g, "")
|
|
299
|
+
.replace(/\x1b\[[0-9;?]*[ -/]*[@-~]/g, "");
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
function terminalHyperlink(url = "", text = url) {
|
|
303
|
+
if (!useColor || process.env.AGINTIFLOW_NO_HYPERLINK === "1") return String(text || "");
|
|
304
|
+
const safeUrl = String(url || "").replace(/[\x00-\x1f\x7f]/g, "");
|
|
305
|
+
if (!safeUrl) return String(text || "");
|
|
306
|
+
return `\x1b]8;;${safeUrl}\x07${text}\x1b]8;;\x07`;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
function linkifyTerminalUrl(line = "", url = "") {
|
|
310
|
+
const visibleLine = String(line || "");
|
|
311
|
+
const visibleUrl = String(url || "");
|
|
312
|
+
if (!visibleLine || !visibleUrl || !visibleLine.includes(visibleUrl)) return visibleLine;
|
|
313
|
+
return visibleLine.replace(visibleUrl, terminalHyperlink(visibleUrl, visibleUrl));
|
|
298
314
|
}
|
|
299
315
|
|
|
300
316
|
function charCellWidth(char = "") {
|
|
@@ -806,7 +822,9 @@ export function buildLaunchHeaderLines({
|
|
|
806
822
|
row(centerLine(subtitle, contentWidth), ansi.dim),
|
|
807
823
|
row(centerLine(credit, contentWidth), ansi.dim),
|
|
808
824
|
tagline ? mid : "",
|
|
809
|
-
tagline
|
|
825
|
+
tagline
|
|
826
|
+
? row(centerLine(linkifyTerminalUrl(compactLine(tagline, contentWidth), webAppUrl), contentWidth), webAppUrl ? ansi.cyan : ansi.yellow)
|
|
827
|
+
: "",
|
|
810
828
|
bottom,
|
|
811
829
|
].filter(Boolean);
|
|
812
830
|
const indent = " ".repeat(Math.max(Math.floor((terminalColumns - Math.max(...boxLines.map((line) => visualLength(line)))) / 2), 0));
|