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/runtime.js
CHANGED
|
@@ -1092,10 +1092,13 @@ var TerminalSession = class {
|
|
|
1092
1092
|
}
|
|
1093
1093
|
async waitFor(pattern, opts) {
|
|
1094
1094
|
const timeout = opts?.timeout ?? DEFAULT_TIMEOUT_MS;
|
|
1095
|
+
const scope = opts?.scope ?? "history";
|
|
1095
1096
|
assertTimeout(timeout);
|
|
1097
|
+
assertWaitScope(scope);
|
|
1096
1098
|
const startedAt = Date.now();
|
|
1097
1099
|
while (Date.now() - startedAt <= timeout) {
|
|
1098
|
-
const
|
|
1100
|
+
const source = scope === "screen" ? (await this.screen()).text : this.rawBuffer;
|
|
1101
|
+
const matched = matchPattern(source, pattern);
|
|
1099
1102
|
if (matched !== null) {
|
|
1100
1103
|
return matched;
|
|
1101
1104
|
}
|
|
@@ -1216,6 +1219,11 @@ function assertTimeout(timeout) {
|
|
|
1216
1219
|
throw new Error("Timeout must be a finite non-negative number.");
|
|
1217
1220
|
}
|
|
1218
1221
|
}
|
|
1222
|
+
function assertWaitScope(scope) {
|
|
1223
|
+
if (scope !== "history" && scope !== "screen") {
|
|
1224
|
+
throw new Error('Wait scope must be either "history" or "screen".');
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1219
1227
|
function assertQuietPeriod(duration) {
|
|
1220
1228
|
if (!Number.isFinite(duration) || duration < 0) {
|
|
1221
1229
|
throw new Error("Quiet period must be a finite non-negative number.");
|