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
|
@@ -3086,10 +3086,13 @@ var TerminalSession = class {
|
|
|
3086
3086
|
}
|
|
3087
3087
|
async waitFor(pattern, opts) {
|
|
3088
3088
|
const timeout = opts?.timeout ?? DEFAULT_TIMEOUT_MS;
|
|
3089
|
+
const scope = opts?.scope ?? "history";
|
|
3089
3090
|
assertTimeout(timeout);
|
|
3091
|
+
assertWaitScope(scope);
|
|
3090
3092
|
const startedAt = Date.now();
|
|
3091
3093
|
while (Date.now() - startedAt <= timeout) {
|
|
3092
|
-
const
|
|
3094
|
+
const source = scope === "screen" ? (await this.screen()).text : this.rawBuffer;
|
|
3095
|
+
const matched = matchPattern(source, pattern);
|
|
3093
3096
|
if (matched !== null) {
|
|
3094
3097
|
return matched;
|
|
3095
3098
|
}
|
|
@@ -3210,6 +3213,11 @@ function assertTimeout(timeout) {
|
|
|
3210
3213
|
throw new Error("Timeout must be a finite non-negative number.");
|
|
3211
3214
|
}
|
|
3212
3215
|
}
|
|
3216
|
+
function assertWaitScope(scope) {
|
|
3217
|
+
if (scope !== "history" && scope !== "screen") {
|
|
3218
|
+
throw new Error('Wait scope must be either "history" or "screen".');
|
|
3219
|
+
}
|
|
3220
|
+
}
|
|
3213
3221
|
function assertQuietPeriod(duration) {
|
|
3214
3222
|
if (!Number.isFinite(duration) || duration < 0) {
|
|
3215
3223
|
throw new Error("Quiet period must be a finite non-negative number.");
|