terminal-pilot 0.0.13 → 0.0.14
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 +20 -125
- package/dist/cli.js.map +4 -4
- package/dist/commands/close-session.d.ts +4 -4
- package/dist/commands/close-session.js +6 -6
- package/dist/commands/close-session.js.map +3 -3
- package/dist/commands/create-session.d.ts +16 -16
- package/dist/commands/create-session.js +6 -6
- package/dist/commands/create-session.js.map +3 -3
- package/dist/commands/fill.d.ts +6 -6
- package/dist/commands/fill.js +6 -6
- package/dist/commands/fill.js.map +3 -3
- package/dist/commands/get-session.d.ts +4 -4
- package/dist/commands/get-session.js +6 -6
- package/dist/commands/get-session.js.map +3 -3
- package/dist/commands/index.d.ts +107 -107
- package/dist/commands/index.js +7 -7
- package/dist/commands/index.js.map +3 -3
- package/dist/commands/install.d.ts +8 -8
- package/dist/commands/install.js +6 -6
- package/dist/commands/install.js.map +3 -3
- package/dist/commands/installer.js +1 -1
- package/dist/commands/installer.js.map +2 -2
- package/dist/commands/list-sessions.d.ts +2 -2
- package/dist/commands/list-sessions.js +6 -6
- package/dist/commands/list-sessions.js.map +3 -3
- package/dist/commands/press-key.d.ts +6 -6
- package/dist/commands/press-key.js +6 -6
- package/dist/commands/press-key.js.map +3 -3
- package/dist/commands/read-history.d.ts +6 -6
- package/dist/commands/read-history.js +6 -6
- package/dist/commands/read-history.js.map +3 -3
- package/dist/commands/read-screen.d.ts +4 -4
- package/dist/commands/read-screen.js +6 -6
- package/dist/commands/read-screen.js.map +3 -3
- package/dist/commands/resize.d.ts +8 -8
- package/dist/commands/resize.js +6 -6
- package/dist/commands/resize.js.map +3 -3
- package/dist/commands/runtime.d.ts +1 -1
- package/dist/commands/runtime.js +1 -1
- package/dist/commands/runtime.js.map +2 -2
- package/dist/commands/screenshot.d.ts +10 -10
- package/dist/commands/screenshot.js +6 -6
- package/dist/commands/screenshot.js.map +3 -3
- package/dist/commands/send-signal.d.ts +6 -6
- package/dist/commands/send-signal.js +6 -6
- package/dist/commands/send-signal.js.map +3 -3
- package/dist/commands/type.d.ts +6 -6
- package/dist/commands/type.js +6 -6
- package/dist/commands/type.js.map +3 -3
- package/dist/commands/uninstall.d.ts +4 -4
- package/dist/commands/uninstall.js +6 -6
- package/dist/commands/uninstall.js.map +3 -3
- package/dist/commands/wait-for-exit.d.ts +6 -6
- package/dist/commands/wait-for-exit.js +6 -6
- package/dist/commands/wait-for-exit.js.map +3 -3
- package/dist/commands/wait-for.d.ts +10 -10
- package/dist/commands/wait-for.js +6 -6
- package/dist/commands/wait-for.js.map +3 -3
- package/dist/testing/cli-repl.js +20 -126
- package/dist/testing/cli-repl.js.map +4 -4
- package/dist/testing/qa-cli.js +20 -126
- package/dist/testing/qa-cli.js.map +4 -4
- package/package.json +3 -3
package/dist/testing/qa-cli.js
CHANGED
|
@@ -1,85 +1,3 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
8
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
19
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
20
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
21
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
22
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
23
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
24
|
-
mod
|
|
25
|
-
));
|
|
26
|
-
|
|
27
|
-
// ../../node_modules/sisteransi/src/index.js
|
|
28
|
-
var require_src = __commonJS({
|
|
29
|
-
"../../node_modules/sisteransi/src/index.js"(exports, module) {
|
|
30
|
-
"use strict";
|
|
31
|
-
var ESC3 = "\x1B";
|
|
32
|
-
var CSI2 = `${ESC3}[`;
|
|
33
|
-
var beep = "\x07";
|
|
34
|
-
var cursor = {
|
|
35
|
-
to(x, y) {
|
|
36
|
-
if (!y) return `${CSI2}${x + 1}G`;
|
|
37
|
-
return `${CSI2}${y + 1};${x + 1}H`;
|
|
38
|
-
},
|
|
39
|
-
move(x, y) {
|
|
40
|
-
let ret = "";
|
|
41
|
-
if (x < 0) ret += `${CSI2}${-x}D`;
|
|
42
|
-
else if (x > 0) ret += `${CSI2}${x}C`;
|
|
43
|
-
if (y < 0) ret += `${CSI2}${-y}A`;
|
|
44
|
-
else if (y > 0) ret += `${CSI2}${y}B`;
|
|
45
|
-
return ret;
|
|
46
|
-
},
|
|
47
|
-
up: (count = 1) => `${CSI2}${count}A`,
|
|
48
|
-
down: (count = 1) => `${CSI2}${count}B`,
|
|
49
|
-
forward: (count = 1) => `${CSI2}${count}C`,
|
|
50
|
-
backward: (count = 1) => `${CSI2}${count}D`,
|
|
51
|
-
nextLine: (count = 1) => `${CSI2}E`.repeat(count),
|
|
52
|
-
prevLine: (count = 1) => `${CSI2}F`.repeat(count),
|
|
53
|
-
left: `${CSI2}G`,
|
|
54
|
-
hide: `${CSI2}?25l`,
|
|
55
|
-
show: `${CSI2}?25h`,
|
|
56
|
-
save: `${ESC3}7`,
|
|
57
|
-
restore: `${ESC3}8`
|
|
58
|
-
};
|
|
59
|
-
var scroll = {
|
|
60
|
-
up: (count = 1) => `${CSI2}S`.repeat(count),
|
|
61
|
-
down: (count = 1) => `${CSI2}T`.repeat(count)
|
|
62
|
-
};
|
|
63
|
-
var erase = {
|
|
64
|
-
screen: `${CSI2}2J`,
|
|
65
|
-
up: (count = 1) => `${CSI2}1J`.repeat(count),
|
|
66
|
-
down: (count = 1) => `${CSI2}J`.repeat(count),
|
|
67
|
-
line: `${CSI2}2K`,
|
|
68
|
-
lineEnd: `${CSI2}K`,
|
|
69
|
-
lineStart: `${CSI2}1K`,
|
|
70
|
-
lines(count) {
|
|
71
|
-
let clear = "";
|
|
72
|
-
for (let i = 0; i < count; i++)
|
|
73
|
-
clear += this.line + (i < count - 1 ? cursor.up() : "");
|
|
74
|
-
if (count)
|
|
75
|
-
clear += cursor.left;
|
|
76
|
-
return clear;
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
module.exports = { cursor, scroll, erase, beep };
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
|
|
83
1
|
// src/testing/qa-cli.ts
|
|
84
2
|
import assert from "node:assert/strict";
|
|
85
3
|
import { rm } from "node:fs/promises";
|
|
@@ -165,7 +83,7 @@ import { realpath } from "node:fs/promises";
|
|
|
165
83
|
import path6 from "node:path";
|
|
166
84
|
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
167
85
|
|
|
168
|
-
// ../
|
|
86
|
+
// ../toolcraft/src/cli.ts
|
|
169
87
|
import { access, readFile, writeFile } from "node:fs/promises";
|
|
170
88
|
import path from "node:path";
|
|
171
89
|
import { Command as CommanderCommand, CommanderError, InvalidArgumentError, Option } from "commander";
|
|
@@ -739,31 +657,7 @@ import * as clack from "@clack/prompts";
|
|
|
739
657
|
|
|
740
658
|
// ../design-system/src/prompts/primitives/cancel.ts
|
|
741
659
|
import chalk9 from "chalk";
|
|
742
|
-
|
|
743
|
-
// ../../node_modules/@clack/core/dist/index.mjs
|
|
744
|
-
var import_sisteransi = __toESM(require_src(), 1);
|
|
745
|
-
import { stdout as R, stdin as q } from "node:process";
|
|
746
|
-
import * as k from "node:readline";
|
|
747
|
-
import ot from "node:readline";
|
|
748
|
-
import { ReadStream as J } from "node:tty";
|
|
749
|
-
var P = new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*", "yu");
|
|
750
|
-
var ct = new RegExp("\\p{M}+", "gu");
|
|
751
|
-
var pt = { limit: 1 / 0, ellipsis: "" };
|
|
752
|
-
var ft = { limit: 1 / 0, ellipsis: "", ellipsisWidth: 0 };
|
|
753
|
-
var j = "\x07";
|
|
754
|
-
var Q = "[";
|
|
755
|
-
var dt = "]";
|
|
756
|
-
var U = `${dt}8;;`;
|
|
757
|
-
var et = new RegExp(`(?:\\${Q}(?<code>\\d+)m|\\${U}(?<uri>.*)${j})`, "y");
|
|
758
|
-
var At = ["up", "down", "left", "right", "space", "enter", "cancel"];
|
|
759
|
-
var _ = { actions: new Set(At), aliases: /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["", "cancel"], ["escape", "cancel"]]), messages: { cancel: "Canceled", error: "Something went wrong" }, withGuide: true };
|
|
760
|
-
var bt = globalThis.process.platform.startsWith("win");
|
|
761
|
-
var z = /* @__PURE__ */ Symbol("clack:cancel");
|
|
762
|
-
function Ct(t) {
|
|
763
|
-
return t === z;
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
// ../design-system/src/prompts/primitives/cancel.ts
|
|
660
|
+
import { isCancel } from "@clack/prompts";
|
|
767
661
|
function cancel(msg = "") {
|
|
768
662
|
if (resolveOutputFormat() !== "terminal") {
|
|
769
663
|
return;
|
|
@@ -849,10 +743,10 @@ async function confirm2(opts) {
|
|
|
849
743
|
// ../design-system/src/static/menu.ts
|
|
850
744
|
import chalk16 from "chalk";
|
|
851
745
|
|
|
852
|
-
// ../
|
|
746
|
+
// ../toolcraft/src/index.ts
|
|
853
747
|
import { fileURLToPath } from "node:url";
|
|
854
748
|
|
|
855
|
-
// ../
|
|
749
|
+
// ../toolcraft-schema/src/index.ts
|
|
856
750
|
function assertValidEnumValues(values) {
|
|
857
751
|
if (values.length === 0) {
|
|
858
752
|
throw new Error("Enum schema requires at least one value");
|
|
@@ -911,10 +805,10 @@ var S = {
|
|
|
911
805
|
}
|
|
912
806
|
};
|
|
913
807
|
|
|
914
|
-
// ../
|
|
915
|
-
var commandConfigSymbol = /* @__PURE__ */ Symbol("
|
|
916
|
-
var groupConfigSymbol = /* @__PURE__ */ Symbol("
|
|
917
|
-
var commandSourcePathSymbol = /* @__PURE__ */ Symbol("
|
|
808
|
+
// ../toolcraft/src/index.ts
|
|
809
|
+
var commandConfigSymbol = /* @__PURE__ */ Symbol("toolcraft.command.config");
|
|
810
|
+
var groupConfigSymbol = /* @__PURE__ */ Symbol("toolcraft.group.config");
|
|
811
|
+
var commandSourcePathSymbol = /* @__PURE__ */ Symbol("toolcraft.command.sourcePath");
|
|
918
812
|
var UserError = class extends Error {
|
|
919
813
|
constructor(message2) {
|
|
920
814
|
super(message2);
|
|
@@ -992,7 +886,7 @@ function inferCommandSourcePath() {
|
|
|
992
886
|
if (candidate === void 0) {
|
|
993
887
|
continue;
|
|
994
888
|
}
|
|
995
|
-
if (candidate.includes("/packages/
|
|
889
|
+
if (candidate.includes("/packages/toolcraft/src/index.ts") || candidate.includes("/packages/toolcraft/dist/index.js") || candidate.includes("/node_modules/toolcraft/dist/index.js")) {
|
|
996
890
|
continue;
|
|
997
891
|
}
|
|
998
892
|
return candidate;
|
|
@@ -1284,7 +1178,7 @@ function getCommandSourcePath(command) {
|
|
|
1284
1178
|
return command[commandSourcePathSymbol];
|
|
1285
1179
|
}
|
|
1286
1180
|
|
|
1287
|
-
// ../
|
|
1181
|
+
// ../toolcraft/src/number-schema.ts
|
|
1288
1182
|
function isValidNumberSchemaValue(value, schema) {
|
|
1289
1183
|
return typeof value === "number" && Number.isFinite(value) && (schema.jsonType !== "integer" || Number.isInteger(value));
|
|
1290
1184
|
}
|
|
@@ -1292,7 +1186,7 @@ function getExpectedNumberDescription(schema) {
|
|
|
1292
1186
|
return schema.jsonType === "integer" ? "an integer" : "a number";
|
|
1293
1187
|
}
|
|
1294
1188
|
|
|
1295
|
-
// ../
|
|
1189
|
+
// ../toolcraft/src/renderer.ts
|
|
1296
1190
|
function isObject(value) {
|
|
1297
1191
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
1298
1192
|
}
|
|
@@ -1453,15 +1347,15 @@ function renderResult(command, result, output, primitives, write2 = (chunk) => {
|
|
|
1453
1347
|
}
|
|
1454
1348
|
}
|
|
1455
1349
|
|
|
1456
|
-
// ../
|
|
1350
|
+
// ../toolcraft/src/cli.ts
|
|
1457
1351
|
var RESERVED_SERVICE_NAMES = /* @__PURE__ */ new Set(["params", "secrets", "fetch", "fs", "env", "progress"]);
|
|
1458
1352
|
function inferProgramName(argv) {
|
|
1459
1353
|
const entrypoint = argv[1];
|
|
1460
1354
|
if (typeof entrypoint !== "string" || entrypoint.length === 0) {
|
|
1461
|
-
return "
|
|
1355
|
+
return "toolcraft";
|
|
1462
1356
|
}
|
|
1463
1357
|
const parsed = path.parse(entrypoint);
|
|
1464
|
-
return parsed.name.length > 0 ? parsed.name : "
|
|
1358
|
+
return parsed.name.length > 0 ? parsed.name : "toolcraft";
|
|
1465
1359
|
}
|
|
1466
1360
|
function normalizeRoots(roots, argv) {
|
|
1467
1361
|
if (!Array.isArray(roots)) {
|
|
@@ -2068,7 +1962,7 @@ async function promptForField(field) {
|
|
|
2068
1962
|
options,
|
|
2069
1963
|
initialValue: field.hasDefault ? field.defaultValue : void 0
|
|
2070
1964
|
});
|
|
2071
|
-
if (
|
|
1965
|
+
if (isCancel(selected)) {
|
|
2072
1966
|
cancel("Operation cancelled.");
|
|
2073
1967
|
throw new UserError("Operation cancelled.");
|
|
2074
1968
|
}
|
|
@@ -2079,7 +1973,7 @@ async function promptForField(field) {
|
|
|
2079
1973
|
message: field.displayPath,
|
|
2080
1974
|
initialValue: field.hasDefault ? Boolean(field.defaultValue) : void 0
|
|
2081
1975
|
});
|
|
2082
|
-
if (
|
|
1976
|
+
if (isCancel(selected)) {
|
|
2083
1977
|
cancel("Operation cancelled.");
|
|
2084
1978
|
throw new UserError("Operation cancelled.");
|
|
2085
1979
|
}
|
|
@@ -2089,7 +1983,7 @@ async function promptForField(field) {
|
|
|
2089
1983
|
message: field.displayPath,
|
|
2090
1984
|
initialValue: field.hasDefault && field.defaultValue !== void 0 ? formatResolvedValue(field.defaultValue) : void 0
|
|
2091
1985
|
});
|
|
2092
|
-
if (
|
|
1986
|
+
if (isCancel(entered)) {
|
|
2093
1987
|
cancel("Operation cancelled.");
|
|
2094
1988
|
throw new UserError("Operation cancelled.");
|
|
2095
1989
|
}
|
|
@@ -2515,7 +2409,7 @@ function createFixtureEnvValues(command) {
|
|
|
2515
2409
|
return values;
|
|
2516
2410
|
}
|
|
2517
2411
|
async function resolveFixtureRuntime(command, services, requirementOptions) {
|
|
2518
|
-
const selector = process.env.
|
|
2412
|
+
const selector = process.env.TOOLCRAFT_FIXTURE;
|
|
2519
2413
|
if (selector === void 0 || selector.length === 0) {
|
|
2520
2414
|
return {
|
|
2521
2415
|
env: createEnv(),
|
|
@@ -2662,7 +2556,7 @@ async function executeCommand(state, services, requirementOptions) {
|
|
|
2662
2556
|
message: "Proceed?",
|
|
2663
2557
|
initialValue: true
|
|
2664
2558
|
});
|
|
2665
|
-
if (
|
|
2559
|
+
if (isCancel(proceed)) {
|
|
2666
2560
|
cancel("Operation cancelled.");
|
|
2667
2561
|
throw new UserError("Operation cancelled.");
|
|
2668
2562
|
}
|
|
@@ -3320,7 +3214,7 @@ var NAMED_KEY_SEQUENCES = {
|
|
|
3320
3214
|
Space: " "
|
|
3321
3215
|
};
|
|
3322
3216
|
var NAMED_KEY_LOWER = new Map(
|
|
3323
|
-
Object.entries(NAMED_KEY_SEQUENCES).map(([
|
|
3217
|
+
Object.entries(NAMED_KEY_SEQUENCES).map(([k, v]) => [k.toLowerCase(), v])
|
|
3324
3218
|
);
|
|
3325
3219
|
var VALID_KEYS_HINT = `Valid keys: ${Object.keys(NAMED_KEY_SEQUENCES).join(", ")}, Control+<letter>, Alt+<key>`;
|
|
3326
3220
|
function unknownKeyError(key) {
|