terminal-pilot 0.0.7 → 0.0.9
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 +66 -103
- package/dist/cli.js.map +4 -4
- package/dist/commands/close-session.js +33 -81
- package/dist/commands/close-session.js.map +3 -3
- package/dist/commands/create-session.js +33 -81
- package/dist/commands/create-session.js.map +3 -3
- package/dist/commands/fill.js +33 -81
- package/dist/commands/fill.js.map +3 -3
- package/dist/commands/get-session.js +33 -81
- package/dist/commands/get-session.js.map +3 -3
- package/dist/commands/index.js +41 -92
- package/dist/commands/index.js.map +4 -4
- package/dist/commands/install.js +2 -5
- package/dist/commands/install.js.map +4 -4
- package/dist/commands/installer.js +2 -5
- package/dist/commands/installer.js.map +4 -4
- package/dist/commands/list-sessions.js +33 -81
- package/dist/commands/list-sessions.js.map +3 -3
- package/dist/commands/press-key.js +33 -81
- package/dist/commands/press-key.js.map +3 -3
- package/dist/commands/read-history.js +33 -81
- package/dist/commands/read-history.js.map +3 -3
- package/dist/commands/read-screen.js +33 -81
- package/dist/commands/read-screen.js.map +3 -3
- package/dist/commands/resize.js +33 -81
- package/dist/commands/resize.js.map +3 -3
- package/dist/commands/runtime.js +33 -81
- package/dist/commands/runtime.js.map +3 -3
- package/dist/commands/screenshot.js +33 -81
- package/dist/commands/screenshot.js.map +3 -3
- package/dist/commands/send-signal.js +33 -81
- package/dist/commands/send-signal.js.map +3 -3
- package/dist/commands/type.js +33 -81
- package/dist/commands/type.js.map +3 -3
- package/dist/commands/uninstall.js +1 -4
- package/dist/commands/uninstall.js.map +4 -4
- package/dist/commands/wait-for-exit.js +33 -81
- package/dist/commands/wait-for-exit.js.map +3 -3
- package/dist/commands/wait-for.js +33 -81
- package/dist/commands/wait-for.js.map +3 -3
- package/dist/index.js +33 -81
- package/dist/index.js.map +3 -3
- package/dist/terminal-pilot.js +33 -81
- package/dist/terminal-pilot.js.map +3 -3
- package/dist/terminal-session.js +33 -81
- package/dist/terminal-session.js.map +3 -3
- package/dist/testing/cli-repl.js +66 -103
- package/dist/testing/cli-repl.js.map +4 -4
- package/dist/testing/qa-cli.js +66 -103
- package/dist/testing/qa-cli.js.map +4 -4
- package/package.json +1 -1
package/dist/commands/index.js
CHANGED
|
@@ -342,8 +342,10 @@ function defineGroup(config) {
|
|
|
342
342
|
import { randomUUID } from "node:crypto";
|
|
343
343
|
|
|
344
344
|
// src/terminal-session.ts
|
|
345
|
-
import { spawn as spawnChildProcess } from "node:child_process";
|
|
346
345
|
import { EventEmitter } from "node:events";
|
|
346
|
+
import { accessSync, chmodSync, constants } from "node:fs";
|
|
347
|
+
import { createRequire } from "node:module";
|
|
348
|
+
import { dirname, join } from "node:path";
|
|
347
349
|
import * as nodePty from "node-pty";
|
|
348
350
|
|
|
349
351
|
// src/ansi.ts
|
|
@@ -1254,93 +1256,43 @@ function createPtyProcess({
|
|
|
1254
1256
|
cols,
|
|
1255
1257
|
rows
|
|
1256
1258
|
}) {
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
cwd,
|
|
1260
|
-
env,
|
|
1261
|
-
cols,
|
|
1262
|
-
rows,
|
|
1263
|
-
encoding: "utf8"
|
|
1264
|
-
});
|
|
1265
|
-
} catch {
|
|
1266
|
-
return createChildProcessFallback({ command, args, cwd, env });
|
|
1267
|
-
}
|
|
1268
|
-
}
|
|
1269
|
-
function createChildProcessFallback({
|
|
1270
|
-
command,
|
|
1271
|
-
args,
|
|
1272
|
-
cwd,
|
|
1273
|
-
env
|
|
1274
|
-
}) {
|
|
1275
|
-
const child = spawnChildProcess(command, args, {
|
|
1259
|
+
ensureSpawnHelperExecutable();
|
|
1260
|
+
return nodePty.spawn(command, args, {
|
|
1276
1261
|
cwd,
|
|
1277
1262
|
env,
|
|
1278
|
-
|
|
1263
|
+
cols,
|
|
1264
|
+
rows,
|
|
1265
|
+
encoding: "utf8"
|
|
1279
1266
|
});
|
|
1280
|
-
return new ChildProcessFallback(child);
|
|
1281
1267
|
}
|
|
1282
|
-
var
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
}
|
|
1301
|
-
write(data) {
|
|
1302
|
-
this.child.stdin.write(data);
|
|
1303
|
-
}
|
|
1304
|
-
resize() {
|
|
1305
|
-
}
|
|
1306
|
-
kill(signal) {
|
|
1307
|
-
this.child.kill(signal);
|
|
1308
|
-
}
|
|
1309
|
-
onData(listener) {
|
|
1310
|
-
this.dataEmitter.on("data", listener);
|
|
1311
|
-
return {
|
|
1312
|
-
dispose: () => {
|
|
1313
|
-
this.dataEmitter.off("data", listener);
|
|
1314
|
-
}
|
|
1315
|
-
};
|
|
1316
|
-
}
|
|
1317
|
-
onExit(listener) {
|
|
1318
|
-
this.exitEmitter.on("exit", listener);
|
|
1319
|
-
return {
|
|
1320
|
-
dispose: () => {
|
|
1321
|
-
this.exitEmitter.off("exit", listener);
|
|
1268
|
+
var spawnHelperChecked = false;
|
|
1269
|
+
function ensureSpawnHelperExecutable() {
|
|
1270
|
+
if (spawnHelperChecked) return;
|
|
1271
|
+
spawnHelperChecked = true;
|
|
1272
|
+
const require3 = createRequire(import.meta.url);
|
|
1273
|
+
const nodePtyDir = dirname(require3.resolve("node-pty"));
|
|
1274
|
+
const helper = join(nodePtyDir, "..", "prebuilds", `${process.platform}-${process.arch}`, "spawn-helper");
|
|
1275
|
+
try {
|
|
1276
|
+
accessSync(helper, constants.X_OK);
|
|
1277
|
+
} catch (error) {
|
|
1278
|
+
if (isMissingFileError(error)) {
|
|
1279
|
+
return;
|
|
1280
|
+
}
|
|
1281
|
+
try {
|
|
1282
|
+
chmodSync(helper, 493);
|
|
1283
|
+
} catch (chmodError) {
|
|
1284
|
+
if (isMissingFileError(chmodError)) {
|
|
1285
|
+
return;
|
|
1322
1286
|
}
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
handleData = (chunk) => {
|
|
1326
|
-
this.dataEmitter.emit("data", String(chunk));
|
|
1327
|
-
};
|
|
1328
|
-
};
|
|
1329
|
-
function signalToExitCode(signal) {
|
|
1330
|
-
if (signal === null) {
|
|
1331
|
-
return 0;
|
|
1287
|
+
throw chmodError;
|
|
1288
|
+
}
|
|
1332
1289
|
}
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
SIGKILL: 9
|
|
1338
|
-
};
|
|
1339
|
-
const signalNumber = signalNumbers[signal];
|
|
1340
|
-
if (signalNumber === void 0) {
|
|
1341
|
-
return 1;
|
|
1290
|
+
}
|
|
1291
|
+
function isMissingFileError(error) {
|
|
1292
|
+
if (!(error instanceof Error)) {
|
|
1293
|
+
return false;
|
|
1342
1294
|
}
|
|
1343
|
-
return
|
|
1295
|
+
return "code" in error && error.code === "ENOENT";
|
|
1344
1296
|
}
|
|
1345
1297
|
function matchPattern(buffer, pattern) {
|
|
1346
1298
|
const clean = normalizeHistoryBuffer(stripAnsi(buffer));
|
|
@@ -2720,9 +2672,6 @@ async function executeMutation(mutation, context, options) {
|
|
|
2720
2672
|
import Mustache2 from "mustache";
|
|
2721
2673
|
var originalEscape = Mustache2.escape;
|
|
2722
2674
|
|
|
2723
|
-
// ../agent-skill-config/src/templates.ts
|
|
2724
|
-
import { readFile } from "node:fs/promises";
|
|
2725
|
-
|
|
2726
2675
|
// ../agent-skill-config/src/apply.ts
|
|
2727
2676
|
var UnsupportedAgentError = class extends Error {
|
|
2728
2677
|
constructor(agentId) {
|
|
@@ -2781,7 +2730,7 @@ async function installSkill(agentId, skill, options) {
|
|
|
2781
2730
|
import os2 from "node:os";
|
|
2782
2731
|
import path3 from "node:path";
|
|
2783
2732
|
import * as nodeFs from "node:fs/promises";
|
|
2784
|
-
import { readFile
|
|
2733
|
+
import { readFile } from "node:fs/promises";
|
|
2785
2734
|
var DEFAULT_INSTALL_AGENT = "claude-code";
|
|
2786
2735
|
var DEFAULT_INSTALL_SCOPE = "local";
|
|
2787
2736
|
var TERMINAL_PILOT_SKILL_NAME = "terminal-pilot";
|
|
@@ -2831,7 +2780,7 @@ async function loadTerminalPilotTemplate() {
|
|
|
2831
2780
|
];
|
|
2832
2781
|
for (const candidate of candidates) {
|
|
2833
2782
|
try {
|
|
2834
|
-
terminalPilotTemplateCache = await
|
|
2783
|
+
terminalPilotTemplateCache = await readFile(candidate, "utf8");
|
|
2835
2784
|
return terminalPilotTemplateCache;
|
|
2836
2785
|
} catch (error) {
|
|
2837
2786
|
if (!isNotFoundError(error)) {
|
|
@@ -3266,14 +3215,14 @@ import { Resvg } from "@resvg/resvg-js";
|
|
|
3266
3215
|
|
|
3267
3216
|
// ../terminal-png/src/font.ts
|
|
3268
3217
|
import { readFileSync } from "node:fs";
|
|
3269
|
-
import { createRequire } from "node:module";
|
|
3270
|
-
import { dirname, join } from "node:path";
|
|
3218
|
+
import { createRequire as createRequire2 } from "node:module";
|
|
3219
|
+
import { dirname as dirname2, join as join2 } from "node:path";
|
|
3271
3220
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
3272
|
-
var require2 =
|
|
3273
|
-
var fontPackageRoot =
|
|
3274
|
-
var webfontRoot =
|
|
3221
|
+
var require2 = createRequire2(import.meta.url);
|
|
3222
|
+
var fontPackageRoot = dirname2(require2.resolve("jetbrains-mono/package.json"));
|
|
3223
|
+
var webfontRoot = join2(fontPackageRoot, "fonts/webfonts");
|
|
3275
3224
|
function readWebfontBase64(filename) {
|
|
3276
|
-
return readFileSync(
|
|
3225
|
+
return readFileSync(join2(webfontRoot, filename)).toString("base64");
|
|
3277
3226
|
}
|
|
3278
3227
|
function resolveAssetPath(filename) {
|
|
3279
3228
|
return fileURLToPath2(new URL(`../assets/${filename}`, import.meta.url));
|