terminal-pilot 0.0.21 → 0.0.22
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 +467 -193
- 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.js +79 -33
- package/dist/commands/index.js.map +4 -4
- package/dist/commands/install.js +64 -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 +17 -8
- package/dist/commands/screenshot.js.map +3 -3
- 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 +467 -193
- package/dist/testing/cli-repl.js.map +4 -4
- package/dist/testing/qa-cli.js +467 -193
- package/dist/testing/qa-cli.js.map +4 -4
- package/node_modules/@poe-code/agent-skill-config/dist/apply.js +4 -1
- package/node_modules/@poe-code/agent-skill-config/dist/bridge-active-skills.js +1 -1
- package/node_modules/@poe-code/agent-skill-config/dist/git-exclude.js +17 -9
- package/node_modules/@poe-code/agent-skill-config/dist/templates.js +4 -1
- package/package.json +1 -1
|
@@ -23,7 +23,10 @@ async function pathExists(fs, targetPath) {
|
|
|
23
23
|
return true;
|
|
24
24
|
}
|
|
25
25
|
catch (error) {
|
|
26
|
-
if (
|
|
26
|
+
if (typeof error === "object" &&
|
|
27
|
+
error !== null &&
|
|
28
|
+
Object.prototype.hasOwnProperty.call(error, "code") &&
|
|
29
|
+
error.code === "ENOENT") {
|
|
27
30
|
return false;
|
|
28
31
|
}
|
|
29
32
|
throw error;
|
|
@@ -8,7 +8,7 @@ const activeTargets = new Map();
|
|
|
8
8
|
const manifestStates = new WeakMap();
|
|
9
9
|
const ownershipFileName = ".poe-code-bridge-owner";
|
|
10
10
|
function isNodeError(error) {
|
|
11
|
-
return error instanceof Error && "code"
|
|
11
|
+
return error instanceof Error && Object.prototype.hasOwnProperty.call(error, "code");
|
|
12
12
|
}
|
|
13
13
|
function pathExists(targetPath) {
|
|
14
14
|
try {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { execFileSync } from "node:child_process";
|
|
2
|
+
import { randomUUID } from "node:crypto";
|
|
2
3
|
import * as fs from "node:fs";
|
|
3
4
|
import path from "node:path";
|
|
4
5
|
const defaultMarkerPrefix = "poe-code-spawn-skills";
|
|
@@ -15,7 +16,6 @@ function defaultGitDirRunner(cwd) {
|
|
|
15
16
|
}
|
|
16
17
|
}
|
|
17
18
|
let gitDirRunner = defaultGitDirRunner;
|
|
18
|
-
let tempFileCounter = 0;
|
|
19
19
|
export function setGitDirRunnerForTest(runner) {
|
|
20
20
|
const previous = gitDirRunner;
|
|
21
21
|
gitDirRunner = runner;
|
|
@@ -53,7 +53,10 @@ function readExcludeFile(excludePath) {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
function isNodeError(error) {
|
|
56
|
-
return error instanceof Error && "code"
|
|
56
|
+
return error instanceof Error && Object.prototype.hasOwnProperty.call(error, "code");
|
|
57
|
+
}
|
|
58
|
+
function isAlreadyExistsError(error) {
|
|
59
|
+
return isNodeError(error) && error.code === "EEXIST";
|
|
57
60
|
}
|
|
58
61
|
function assertNoSymbolicLink(targetPath) {
|
|
59
62
|
const parsed = path.parse(path.resolve(targetPath));
|
|
@@ -80,17 +83,22 @@ function writeExcludeFile(excludePath, content) {
|
|
|
80
83
|
assertNoSymbolicLink(excludePath);
|
|
81
84
|
fs.mkdirSync(path.dirname(excludePath), { recursive: true });
|
|
82
85
|
assertNoSymbolicLink(excludePath);
|
|
83
|
-
const tempPath = `${excludePath}.poe-code-${process.pid}-${
|
|
86
|
+
const tempPath = `${excludePath}.poe-code-${process.pid}-${randomUUID()}.tmp`;
|
|
87
|
+
let tempCreated = false;
|
|
84
88
|
try {
|
|
85
|
-
|
|
89
|
+
assertNoSymbolicLink(tempPath);
|
|
90
|
+
fs.writeFileSync(tempPath, content, { encoding: "utf8", flag: "wx" });
|
|
91
|
+
tempCreated = true;
|
|
86
92
|
fs.renameSync(tempPath, excludePath);
|
|
87
93
|
}
|
|
88
94
|
catch (error) {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
95
|
+
if (tempCreated || !isAlreadyExistsError(error)) {
|
|
96
|
+
try {
|
|
97
|
+
fs.rmSync(tempPath, { force: true });
|
|
98
|
+
}
|
|
99
|
+
catch (cleanupError) {
|
|
100
|
+
void cleanupError;
|
|
101
|
+
}
|
|
94
102
|
}
|
|
95
103
|
throw error;
|
|
96
104
|
}
|
|
@@ -9,7 +9,10 @@ async function pathExists(target) {
|
|
|
9
9
|
return true;
|
|
10
10
|
}
|
|
11
11
|
catch (error) {
|
|
12
|
-
if (error &&
|
|
12
|
+
if (error &&
|
|
13
|
+
typeof error === "object" &&
|
|
14
|
+
Object.prototype.hasOwnProperty.call(error, "code") &&
|
|
15
|
+
error.code === "ENOENT") {
|
|
13
16
|
return false;
|
|
14
17
|
}
|
|
15
18
|
throw error;
|