terminal-pilot 0.0.40 → 0.0.41
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/README.md +13 -1
- package/dist/cli.js +20 -3
- package/dist/cli.js.map +2 -2
- package/dist/commands/close-session.js +9 -1
- package/dist/commands/close-session.js.map +2 -2
- package/dist/commands/create-session.js +9 -1
- package/dist/commands/create-session.js.map +2 -2
- package/dist/commands/daemon-runtime.js +9 -1
- package/dist/commands/daemon-runtime.js.map +2 -2
- package/dist/commands/fill.js +9 -1
- package/dist/commands/fill.js.map +2 -2
- package/dist/commands/get-session.js +9 -1
- package/dist/commands/get-session.js.map +2 -2
- package/dist/commands/index.d.ts +4 -0
- package/dist/commands/index.js +19 -2
- package/dist/commands/index.js.map +2 -2
- package/dist/commands/list-sessions.js +9 -1
- package/dist/commands/list-sessions.js.map +2 -2
- package/dist/commands/press-key.js +9 -1
- package/dist/commands/press-key.js.map +2 -2
- package/dist/commands/read-history.js +9 -1
- package/dist/commands/read-history.js.map +2 -2
- package/dist/commands/read-screen.js +9 -1
- package/dist/commands/read-screen.js.map +2 -2
- package/dist/commands/resize.js +9 -1
- package/dist/commands/resize.js.map +2 -2
- package/dist/commands/runtime.js +9 -1
- package/dist/commands/runtime.js.map +2 -2
- package/dist/commands/screenshot.js +9 -1
- package/dist/commands/screenshot.js.map +2 -2
- package/dist/commands/send-signal.js +9 -1
- package/dist/commands/send-signal.js.map +2 -2
- package/dist/commands/type.js +9 -1
- package/dist/commands/type.js.map +2 -2
- package/dist/commands/wait-for-exit.js +9 -1
- package/dist/commands/wait-for-exit.js.map +2 -2
- package/dist/commands/wait-for.d.ts +2 -0
- package/dist/commands/wait-for.js +19 -2
- package/dist/commands/wait-for.js.map +2 -2
- package/dist/index.js +9 -1
- package/dist/index.js.map +2 -2
- package/dist/terminal-pilot.js +9 -1
- package/dist/terminal-pilot.js.map +2 -2
- package/dist/terminal-session.d.ts +1 -0
- package/dist/terminal-session.js +9 -1
- package/dist/terminal-session.js.map +2 -2
- package/dist/testing/cli-repl.js +20 -3
- package/dist/testing/cli-repl.js.map +2 -2
- package/dist/testing/qa-cli.js +20 -3
- package/dist/testing/qa-cli.js.map +2 -2
- package/node_modules/toolcraft-design/dist/index.d.ts +2 -2
- package/node_modules/toolcraft-design/dist/index.js +1 -1
- package/node_modules/toolcraft-design/dist/render-markdown-plaintext.d.ts +2 -0
- package/node_modules/toolcraft-design/dist/render-markdown-plaintext.js +1 -0
- package/node_modules/toolcraft-design/dist/terminal-markdown/index.d.ts +2 -0
- package/node_modules/toolcraft-design/dist/terminal-markdown/index.js +1 -0
- package/node_modules/toolcraft-design/dist/terminal-markdown/parser/inline.js +38 -2
- package/node_modules/toolcraft-design/dist/terminal-markdown/plaintext-renderer.d.ts +11 -0
- package/node_modules/toolcraft-design/dist/terminal-markdown/plaintext-renderer.js +228 -0
- package/node_modules/toolcraft-design/package.json +4 -0
- package/package.json +1 -1
package/dist/testing/qa-cli.js
CHANGED
|
@@ -19005,10 +19005,13 @@ var TerminalSession = class {
|
|
|
19005
19005
|
}
|
|
19006
19006
|
async waitFor(pattern, opts) {
|
|
19007
19007
|
const timeout = opts?.timeout ?? DEFAULT_TIMEOUT_MS;
|
|
19008
|
+
const scope = opts?.scope ?? "history";
|
|
19008
19009
|
assertTimeout(timeout);
|
|
19010
|
+
assertWaitScope(scope);
|
|
19009
19011
|
const startedAt = Date.now();
|
|
19010
19012
|
while (Date.now() - startedAt <= timeout) {
|
|
19011
|
-
const
|
|
19013
|
+
const source = scope === "screen" ? (await this.screen()).text : this.rawBuffer;
|
|
19014
|
+
const matched = matchPattern(source, pattern);
|
|
19012
19015
|
if (matched !== null) {
|
|
19013
19016
|
return matched;
|
|
19014
19017
|
}
|
|
@@ -19129,6 +19132,11 @@ function assertTimeout(timeout) {
|
|
|
19129
19132
|
throw new Error("Timeout must be a finite non-negative number.");
|
|
19130
19133
|
}
|
|
19131
19134
|
}
|
|
19135
|
+
function assertWaitScope(scope) {
|
|
19136
|
+
if (scope !== "history" && scope !== "screen") {
|
|
19137
|
+
throw new Error('Wait scope must be either "history" or "screen".');
|
|
19138
|
+
}
|
|
19139
|
+
}
|
|
19132
19140
|
function assertQuietPeriod(duration) {
|
|
19133
19141
|
if (!Number.isFinite(duration) || duration < 0) {
|
|
19134
19142
|
throw new Error("Quiet period must be a finite non-negative number.");
|
|
@@ -22829,6 +22837,11 @@ var params15 = S.Object({
|
|
|
22829
22837
|
timeout: S.Optional(
|
|
22830
22838
|
S.Number({ short: "t", description: "Maximum wait time in milliseconds", minimum: 0 })
|
|
22831
22839
|
),
|
|
22840
|
+
scope: S.Optional(
|
|
22841
|
+
S.Enum(["history", "screen"], {
|
|
22842
|
+
description: "Search all captured output or only the current visible screen"
|
|
22843
|
+
})
|
|
22844
|
+
),
|
|
22832
22845
|
literal: S.Optional(
|
|
22833
22846
|
S.Boolean({
|
|
22834
22847
|
short: "l",
|
|
@@ -22852,7 +22865,11 @@ var waitFor = defineCommand({
|
|
|
22852
22865
|
env
|
|
22853
22866
|
);
|
|
22854
22867
|
const pattern = params17.literal === true ? params17.pattern : new RegExp(params17.pattern);
|
|
22855
|
-
const
|
|
22868
|
+
const options = params17.timeout === void 0 && params17.scope === void 0 ? void 0 : {
|
|
22869
|
+
...params17.timeout === void 0 ? {} : { timeout: params17.timeout },
|
|
22870
|
+
...params17.scope === void 0 ? {} : { scope: params17.scope }
|
|
22871
|
+
};
|
|
22872
|
+
const line = await namedSession.session.waitFor(pattern, options);
|
|
22856
22873
|
return { matched: true, line };
|
|
22857
22874
|
}
|
|
22858
22875
|
});
|
|
@@ -23318,7 +23335,7 @@ function sleep2(ms) {
|
|
|
23318
23335
|
// src/cli.ts
|
|
23319
23336
|
configureTheme({ brand: "green", label: "Terminal Pilot" });
|
|
23320
23337
|
function getBundledPackageVersion() {
|
|
23321
|
-
return true ? "0.0.
|
|
23338
|
+
return true ? "0.0.41" : void 0;
|
|
23322
23339
|
}
|
|
23323
23340
|
function normalizeArgv(argv) {
|
|
23324
23341
|
if (argv.includes("--json") && !argv.some((argument) => argument === "--output" || argument.startsWith("--output="))) {
|