terminal-pilot 0.0.40 → 0.0.42
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/LICENSE +21 -0
- package/README.md +13 -1
- package/dist/cli.js +751 -9684
- package/dist/cli.js.map +4 -4
- 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/install.js.map +1 -1
- package/dist/commands/installer.js.map +1 -1
- 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/uninstall.js.map +1 -1
- 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 +757 -9690
- package/dist/testing/cli-repl.js.map +4 -4
- package/dist/testing/qa-cli.js +766 -9699
- package/dist/testing/qa-cli.js.map +4 -4
- 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 +2 -1
|
@@ -1100,10 +1100,13 @@ var TerminalSession = class {
|
|
|
1100
1100
|
}
|
|
1101
1101
|
async waitFor(pattern, opts) {
|
|
1102
1102
|
const timeout = opts?.timeout ?? DEFAULT_TIMEOUT_MS;
|
|
1103
|
+
const scope = opts?.scope ?? "history";
|
|
1103
1104
|
assertTimeout(timeout);
|
|
1105
|
+
assertWaitScope(scope);
|
|
1104
1106
|
const startedAt = Date.now();
|
|
1105
1107
|
while (Date.now() - startedAt <= timeout) {
|
|
1106
|
-
const
|
|
1108
|
+
const source = scope === "screen" ? (await this.screen()).text : this.rawBuffer;
|
|
1109
|
+
const matched = matchPattern(source, pattern);
|
|
1107
1110
|
if (matched !== null) {
|
|
1108
1111
|
return matched;
|
|
1109
1112
|
}
|
|
@@ -1224,6 +1227,11 @@ function assertTimeout(timeout) {
|
|
|
1224
1227
|
throw new Error("Timeout must be a finite non-negative number.");
|
|
1225
1228
|
}
|
|
1226
1229
|
}
|
|
1230
|
+
function assertWaitScope(scope) {
|
|
1231
|
+
if (scope !== "history" && scope !== "screen") {
|
|
1232
|
+
throw new Error('Wait scope must be either "history" or "screen".');
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1227
1235
|
function assertQuietPeriod(duration) {
|
|
1228
1236
|
if (!Number.isFinite(duration) || duration < 0) {
|
|
1229
1237
|
throw new Error("Quiet period must be a finite non-negative number.");
|