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/cli-repl.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/ansi.ts
|
|
84
2
|
var ESC = 27;
|
|
85
3
|
var BEL = 7;
|
|
@@ -158,7 +76,7 @@ import { realpath } from "node:fs/promises";
|
|
|
158
76
|
import path6 from "node:path";
|
|
159
77
|
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
160
78
|
|
|
161
|
-
// ../
|
|
79
|
+
// ../toolcraft/src/cli.ts
|
|
162
80
|
import { access, readFile, writeFile } from "node:fs/promises";
|
|
163
81
|
import path from "node:path";
|
|
164
82
|
import { Command as CommanderCommand, CommanderError, InvalidArgumentError, Option } from "commander";
|
|
@@ -732,31 +650,7 @@ import * as clack from "@clack/prompts";
|
|
|
732
650
|
|
|
733
651
|
// ../design-system/src/prompts/primitives/cancel.ts
|
|
734
652
|
import chalk9 from "chalk";
|
|
735
|
-
|
|
736
|
-
// ../../node_modules/@clack/core/dist/index.mjs
|
|
737
|
-
var import_sisteransi = __toESM(require_src(), 1);
|
|
738
|
-
import { stdout as R, stdin as q } from "node:process";
|
|
739
|
-
import * as k from "node:readline";
|
|
740
|
-
import ot from "node:readline";
|
|
741
|
-
import { ReadStream as J } from "node:tty";
|
|
742
|
-
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");
|
|
743
|
-
var ct = new RegExp("\\p{M}+", "gu");
|
|
744
|
-
var pt = { limit: 1 / 0, ellipsis: "" };
|
|
745
|
-
var ft = { limit: 1 / 0, ellipsis: "", ellipsisWidth: 0 };
|
|
746
|
-
var j = "\x07";
|
|
747
|
-
var Q = "[";
|
|
748
|
-
var dt = "]";
|
|
749
|
-
var U = `${dt}8;;`;
|
|
750
|
-
var et = new RegExp(`(?:\\${Q}(?<code>\\d+)m|\\${U}(?<uri>.*)${j})`, "y");
|
|
751
|
-
var At = ["up", "down", "left", "right", "space", "enter", "cancel"];
|
|
752
|
-
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 };
|
|
753
|
-
var bt = globalThis.process.platform.startsWith("win");
|
|
754
|
-
var z = /* @__PURE__ */ Symbol("clack:cancel");
|
|
755
|
-
function Ct(t) {
|
|
756
|
-
return t === z;
|
|
757
|
-
}
|
|
758
|
-
|
|
759
|
-
// ../design-system/src/prompts/primitives/cancel.ts
|
|
653
|
+
import { isCancel } from "@clack/prompts";
|
|
760
654
|
function cancel(msg = "") {
|
|
761
655
|
if (resolveOutputFormat() !== "terminal") {
|
|
762
656
|
return;
|
|
@@ -842,10 +736,10 @@ async function confirm2(opts) {
|
|
|
842
736
|
// ../design-system/src/static/menu.ts
|
|
843
737
|
import chalk16 from "chalk";
|
|
844
738
|
|
|
845
|
-
// ../
|
|
739
|
+
// ../toolcraft/src/index.ts
|
|
846
740
|
import { fileURLToPath } from "node:url";
|
|
847
741
|
|
|
848
|
-
// ../
|
|
742
|
+
// ../toolcraft-schema/src/index.ts
|
|
849
743
|
function assertValidEnumValues(values) {
|
|
850
744
|
if (values.length === 0) {
|
|
851
745
|
throw new Error("Enum schema requires at least one value");
|
|
@@ -904,10 +798,10 @@ var S = {
|
|
|
904
798
|
}
|
|
905
799
|
};
|
|
906
800
|
|
|
907
|
-
// ../
|
|
908
|
-
var commandConfigSymbol = /* @__PURE__ */ Symbol("
|
|
909
|
-
var groupConfigSymbol = /* @__PURE__ */ Symbol("
|
|
910
|
-
var commandSourcePathSymbol = /* @__PURE__ */ Symbol("
|
|
801
|
+
// ../toolcraft/src/index.ts
|
|
802
|
+
var commandConfigSymbol = /* @__PURE__ */ Symbol("toolcraft.command.config");
|
|
803
|
+
var groupConfigSymbol = /* @__PURE__ */ Symbol("toolcraft.group.config");
|
|
804
|
+
var commandSourcePathSymbol = /* @__PURE__ */ Symbol("toolcraft.command.sourcePath");
|
|
911
805
|
var UserError = class extends Error {
|
|
912
806
|
constructor(message2) {
|
|
913
807
|
super(message2);
|
|
@@ -985,7 +879,7 @@ function inferCommandSourcePath() {
|
|
|
985
879
|
if (candidate === void 0) {
|
|
986
880
|
continue;
|
|
987
881
|
}
|
|
988
|
-
if (candidate.includes("/packages/
|
|
882
|
+
if (candidate.includes("/packages/toolcraft/src/index.ts") || candidate.includes("/packages/toolcraft/dist/index.js") || candidate.includes("/node_modules/toolcraft/dist/index.js")) {
|
|
989
883
|
continue;
|
|
990
884
|
}
|
|
991
885
|
return candidate;
|
|
@@ -1277,7 +1171,7 @@ function getCommandSourcePath(command) {
|
|
|
1277
1171
|
return command[commandSourcePathSymbol];
|
|
1278
1172
|
}
|
|
1279
1173
|
|
|
1280
|
-
// ../
|
|
1174
|
+
// ../toolcraft/src/number-schema.ts
|
|
1281
1175
|
function isValidNumberSchemaValue(value, schema) {
|
|
1282
1176
|
return typeof value === "number" && Number.isFinite(value) && (schema.jsonType !== "integer" || Number.isInteger(value));
|
|
1283
1177
|
}
|
|
@@ -1285,7 +1179,7 @@ function getExpectedNumberDescription(schema) {
|
|
|
1285
1179
|
return schema.jsonType === "integer" ? "an integer" : "a number";
|
|
1286
1180
|
}
|
|
1287
1181
|
|
|
1288
|
-
// ../
|
|
1182
|
+
// ../toolcraft/src/renderer.ts
|
|
1289
1183
|
function isObject(value) {
|
|
1290
1184
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
1291
1185
|
}
|
|
@@ -1446,15 +1340,15 @@ function renderResult(command, result, output, primitives, write2 = (chunk) => {
|
|
|
1446
1340
|
}
|
|
1447
1341
|
}
|
|
1448
1342
|
|
|
1449
|
-
// ../
|
|
1343
|
+
// ../toolcraft/src/cli.ts
|
|
1450
1344
|
var RESERVED_SERVICE_NAMES = /* @__PURE__ */ new Set(["params", "secrets", "fetch", "fs", "env", "progress"]);
|
|
1451
1345
|
function inferProgramName(argv) {
|
|
1452
1346
|
const entrypoint = argv[1];
|
|
1453
1347
|
if (typeof entrypoint !== "string" || entrypoint.length === 0) {
|
|
1454
|
-
return "
|
|
1348
|
+
return "toolcraft";
|
|
1455
1349
|
}
|
|
1456
1350
|
const parsed = path.parse(entrypoint);
|
|
1457
|
-
return parsed.name.length > 0 ? parsed.name : "
|
|
1351
|
+
return parsed.name.length > 0 ? parsed.name : "toolcraft";
|
|
1458
1352
|
}
|
|
1459
1353
|
function normalizeRoots(roots, argv) {
|
|
1460
1354
|
if (!Array.isArray(roots)) {
|
|
@@ -2061,7 +1955,7 @@ async function promptForField(field) {
|
|
|
2061
1955
|
options,
|
|
2062
1956
|
initialValue: field.hasDefault ? field.defaultValue : void 0
|
|
2063
1957
|
});
|
|
2064
|
-
if (
|
|
1958
|
+
if (isCancel(selected)) {
|
|
2065
1959
|
cancel("Operation cancelled.");
|
|
2066
1960
|
throw new UserError("Operation cancelled.");
|
|
2067
1961
|
}
|
|
@@ -2072,7 +1966,7 @@ async function promptForField(field) {
|
|
|
2072
1966
|
message: field.displayPath,
|
|
2073
1967
|
initialValue: field.hasDefault ? Boolean(field.defaultValue) : void 0
|
|
2074
1968
|
});
|
|
2075
|
-
if (
|
|
1969
|
+
if (isCancel(selected)) {
|
|
2076
1970
|
cancel("Operation cancelled.");
|
|
2077
1971
|
throw new UserError("Operation cancelled.");
|
|
2078
1972
|
}
|
|
@@ -2082,7 +1976,7 @@ async function promptForField(field) {
|
|
|
2082
1976
|
message: field.displayPath,
|
|
2083
1977
|
initialValue: field.hasDefault && field.defaultValue !== void 0 ? formatResolvedValue(field.defaultValue) : void 0
|
|
2084
1978
|
});
|
|
2085
|
-
if (
|
|
1979
|
+
if (isCancel(entered)) {
|
|
2086
1980
|
cancel("Operation cancelled.");
|
|
2087
1981
|
throw new UserError("Operation cancelled.");
|
|
2088
1982
|
}
|
|
@@ -2508,7 +2402,7 @@ function createFixtureEnvValues(command) {
|
|
|
2508
2402
|
return values;
|
|
2509
2403
|
}
|
|
2510
2404
|
async function resolveFixtureRuntime(command, services, requirementOptions) {
|
|
2511
|
-
const selector = process.env.
|
|
2405
|
+
const selector = process.env.TOOLCRAFT_FIXTURE;
|
|
2512
2406
|
if (selector === void 0 || selector.length === 0) {
|
|
2513
2407
|
return {
|
|
2514
2408
|
env: createEnv(),
|
|
@@ -2655,7 +2549,7 @@ async function executeCommand(state, services, requirementOptions) {
|
|
|
2655
2549
|
message: "Proceed?",
|
|
2656
2550
|
initialValue: true
|
|
2657
2551
|
});
|
|
2658
|
-
if (
|
|
2552
|
+
if (isCancel(proceed)) {
|
|
2659
2553
|
cancel("Operation cancelled.");
|
|
2660
2554
|
throw new UserError("Operation cancelled.");
|
|
2661
2555
|
}
|
|
@@ -3313,7 +3207,7 @@ var NAMED_KEY_SEQUENCES = {
|
|
|
3313
3207
|
Space: " "
|
|
3314
3208
|
};
|
|
3315
3209
|
var NAMED_KEY_LOWER = new Map(
|
|
3316
|
-
Object.entries(NAMED_KEY_SEQUENCES).map(([
|
|
3210
|
+
Object.entries(NAMED_KEY_SEQUENCES).map(([k, v]) => [k.toLowerCase(), v])
|
|
3317
3211
|
);
|
|
3318
3212
|
var VALID_KEYS_HINT = `Valid keys: ${Object.keys(NAMED_KEY_SEQUENCES).join(", ")}, Control+<letter>, Alt+<key>`;
|
|
3319
3213
|
function unknownKeyError(key) {
|