terminal-pilot 0.0.39 → 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 +24 -4
- 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 +13 -2
- 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 +24 -4
- package/dist/testing/cli-repl.js.map +2 -2
- package/dist/testing/qa-cli.js +24 -4
- 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/commands/type.js
CHANGED
|
@@ -1986,10 +1986,13 @@ var TerminalSession = class {
|
|
|
1986
1986
|
}
|
|
1987
1987
|
async waitFor(pattern, opts) {
|
|
1988
1988
|
const timeout = opts?.timeout ?? DEFAULT_TIMEOUT_MS;
|
|
1989
|
+
const scope = opts?.scope ?? "history";
|
|
1989
1990
|
assertTimeout(timeout);
|
|
1991
|
+
assertWaitScope(scope);
|
|
1990
1992
|
const startedAt = Date.now();
|
|
1991
1993
|
while (Date.now() - startedAt <= timeout) {
|
|
1992
|
-
const
|
|
1994
|
+
const source = scope === "screen" ? (await this.screen()).text : this.rawBuffer;
|
|
1995
|
+
const matched = matchPattern(source, pattern);
|
|
1993
1996
|
if (matched !== null) {
|
|
1994
1997
|
return matched;
|
|
1995
1998
|
}
|
|
@@ -2110,6 +2113,11 @@ function assertTimeout(timeout) {
|
|
|
2110
2113
|
throw new Error("Timeout must be a finite non-negative number.");
|
|
2111
2114
|
}
|
|
2112
2115
|
}
|
|
2116
|
+
function assertWaitScope(scope) {
|
|
2117
|
+
if (scope !== "history" && scope !== "screen") {
|
|
2118
|
+
throw new Error('Wait scope must be either "history" or "screen".');
|
|
2119
|
+
}
|
|
2120
|
+
}
|
|
2113
2121
|
function assertQuietPeriod(duration) {
|
|
2114
2122
|
if (!Number.isFinite(duration) || duration < 0) {
|
|
2115
2123
|
throw new Error("Quiet period must be a finite non-negative number.");
|