terminal-pilot 0.0.21 → 0.0.23
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/dist/cli.js +614 -250
- package/dist/cli.js.map +4 -4
- package/dist/commands/close-session.js +6 -4
- package/dist/commands/close-session.js.map +3 -3
- package/dist/commands/create-session.js +6 -4
- package/dist/commands/create-session.js.map +3 -3
- package/dist/commands/fill.js +6 -4
- package/dist/commands/fill.js.map +3 -3
- package/dist/commands/get-session.js +6 -4
- package/dist/commands/get-session.js.map +3 -3
- package/dist/commands/index.d.ts +35 -35
- package/dist/commands/index.js +97 -36
- package/dist/commands/index.js.map +4 -4
- package/dist/commands/install.js +74 -20
- package/dist/commands/install.js.map +4 -4
- package/dist/commands/installer.js +36 -2
- package/dist/commands/installer.js.map +4 -4
- package/dist/commands/list-sessions.js +6 -4
- package/dist/commands/list-sessions.js.map +3 -3
- package/dist/commands/press-key.js +6 -4
- package/dist/commands/press-key.js.map +3 -3
- package/dist/commands/read-history.js +6 -4
- package/dist/commands/read-history.js.map +3 -3
- package/dist/commands/read-screen.js +6 -4
- package/dist/commands/read-screen.js.map +3 -3
- package/dist/commands/resize.js +6 -4
- package/dist/commands/resize.js.map +3 -3
- package/dist/commands/runtime.js +6 -4
- package/dist/commands/runtime.js.map +3 -3
- package/dist/commands/screenshot.js +22 -8
- package/dist/commands/screenshot.js.map +4 -4
- package/dist/commands/send-signal.js +6 -4
- package/dist/commands/send-signal.js.map +3 -3
- package/dist/commands/type.js +6 -4
- package/dist/commands/type.js.map +3 -3
- package/dist/commands/uninstall.js +39 -5
- package/dist/commands/uninstall.js.map +4 -4
- package/dist/commands/wait-for-exit.js +6 -4
- package/dist/commands/wait-for-exit.js.map +3 -3
- package/dist/commands/wait-for.js +6 -4
- package/dist/commands/wait-for.js.map +3 -3
- package/dist/errors.d.ts +1 -0
- package/dist/errors.js +8 -0
- package/dist/errors.js.map +7 -0
- package/dist/index.js +8 -4
- package/dist/index.js.map +3 -3
- package/dist/terminal-pilot.js +6 -4
- package/dist/terminal-pilot.js.map +3 -3
- package/dist/terminal-session.js +6 -4
- package/dist/terminal-session.js.map +3 -3
- package/dist/testing/cli-repl.js +614 -250
- package/dist/testing/cli-repl.js.map +4 -4
- package/dist/testing/qa-cli.js +614 -250
- package/dist/testing/qa-cli.js.map +4 -4
- package/node_modules/@poe-code/agent-skill-config/dist/apply.js +2 -1
- package/node_modules/@poe-code/agent-skill-config/dist/bridge-active-skills.js +8 -9
- package/node_modules/@poe-code/agent-skill-config/dist/error-codes.d.ts +1 -0
- package/node_modules/@poe-code/agent-skill-config/dist/error-codes.js +5 -0
- package/node_modules/@poe-code/agent-skill-config/dist/git-exclude.js +18 -12
- package/node_modules/@poe-code/agent-skill-config/dist/templates.js +2 -1
- package/package.json +1 -1
|
@@ -799,6 +799,11 @@ function parseAnsi(input) {
|
|
|
799
799
|
return buildRuns(lines, lineBreakStyles);
|
|
800
800
|
}
|
|
801
801
|
|
|
802
|
+
// ../terminal-png/src/error-codes.ts
|
|
803
|
+
function hasOwnErrorCode(error, code) {
|
|
804
|
+
return typeof error === "object" && error !== null && Object.prototype.hasOwnProperty.call(error, "code") && error.code === code;
|
|
805
|
+
}
|
|
806
|
+
|
|
802
807
|
// ../terminal-png/src/png-renderer.ts
|
|
803
808
|
import { Resvg } from "@resvg/resvg-js";
|
|
804
809
|
|
|
@@ -1353,20 +1358,27 @@ async function renderTerminalPng(ansiText, options = {}) {
|
|
|
1353
1358
|
const png = renderPng(svg);
|
|
1354
1359
|
if (options.output) {
|
|
1355
1360
|
const temporaryPath = `${options.output}.${randomUUID()}.tmp`;
|
|
1361
|
+
let temporaryCreated = false;
|
|
1356
1362
|
try {
|
|
1357
1363
|
await writeFile(temporaryPath, png, { flag: "wx" });
|
|
1364
|
+
temporaryCreated = true;
|
|
1358
1365
|
await rename(temporaryPath, options.output);
|
|
1359
1366
|
} catch (error) {
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1367
|
+
if (temporaryCreated || !isAlreadyExistsError(error)) {
|
|
1368
|
+
try {
|
|
1369
|
+
await rm(temporaryPath, { force: true });
|
|
1370
|
+
} catch (cleanupError) {
|
|
1371
|
+
void cleanupError;
|
|
1372
|
+
}
|
|
1364
1373
|
}
|
|
1365
1374
|
throw error;
|
|
1366
1375
|
}
|
|
1367
1376
|
}
|
|
1368
1377
|
return png;
|
|
1369
1378
|
}
|
|
1379
|
+
function isAlreadyExistsError(error) {
|
|
1380
|
+
return error instanceof Error && hasOwnErrorCode(error, "EEXIST");
|
|
1381
|
+
}
|
|
1370
1382
|
|
|
1371
1383
|
// src/terminal-pilot.ts
|
|
1372
1384
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
@@ -1451,6 +1463,11 @@ function consumeTerminatedString(input, index, allowBellTerminator) {
|
|
|
1451
1463
|
return input.length;
|
|
1452
1464
|
}
|
|
1453
1465
|
|
|
1466
|
+
// src/errors.ts
|
|
1467
|
+
function hasOwnErrorCode2(error, code) {
|
|
1468
|
+
return error instanceof Error && Object.prototype.hasOwnProperty.call(error, "code") && error.code === code;
|
|
1469
|
+
}
|
|
1470
|
+
|
|
1454
1471
|
// src/terminal-buffer.ts
|
|
1455
1472
|
var RESET_SGR = "\x1B[0m";
|
|
1456
1473
|
var DEC_SPECIAL_GRAPHICS = {
|
|
@@ -2550,10 +2567,7 @@ function ensureSpawnHelperExecutable() {
|
|
|
2550
2567
|
}
|
|
2551
2568
|
}
|
|
2552
2569
|
function isMissingFileError(error) {
|
|
2553
|
-
|
|
2554
|
-
return false;
|
|
2555
|
-
}
|
|
2556
|
-
return "code" in error && error.code === "ENOENT";
|
|
2570
|
+
return hasOwnErrorCode2(error, "ENOENT");
|
|
2557
2571
|
}
|
|
2558
2572
|
function matchPattern(buffer, pattern) {
|
|
2559
2573
|
const clean = normalizeHistoryBuffer(stripAnsi(buffer));
|