@qawolf/cli 1.42.0 → 1.43.1
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/dist/cli.js +98 -5
- package/dist/investigation-parser.js +2 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -8402,11 +8402,15 @@ var sessionGivenTwice = (argument, flag) => `Two different sessions were named:
|
|
|
8402
8402
|
var agentMessages = {
|
|
8403
8403
|
answerCancelled: "No answer sent, so QA Wolf is still waiting on one. The session keeps its place: answer it whenever you like.",
|
|
8404
8404
|
answerPrompt: "Your answer",
|
|
8405
|
+
conflictingSessionList: "Pass --sessions alone, without --session or a session argument.",
|
|
8406
|
+
emptySessionList: "Pass at least one session id with --sessions.",
|
|
8407
|
+
sessionListNeedsFollow: "Pass --follow when using --sessions.",
|
|
8405
8408
|
answerSendFailed: (reason) => `The answer could not be sent: ${reason}. The session is still waiting, so try again.`,
|
|
8406
8409
|
blocked: (sessionId) => `QA Wolf asked a question and cannot continue until it is answered. Answer it with qawolf agent send "<your answer>" --session ${sessionId}.`,
|
|
8407
8410
|
detachHint: "Press Ctrl-C to stop following. The session keeps running in the background.",
|
|
8408
8411
|
detached: (sessionId) => `Stopped following. The session is still running — pick it back up with ${followAgain(sessionId)}.`,
|
|
8409
8412
|
followTimedOut: (sessionId, seconds) => `Stopped following after ${formatSeconds(seconds * 1000)}. The session may still be going: pick it back up with ${followAgain(sessionId)}, or pass --timeout to wait longer.`,
|
|
8413
|
+
followSessionsTimedOut: (options) => `Stopped following ${options.sessionIds.length} sessions after ${formatSeconds(options.seconds * 1000)}. No session completed or asked a question. Continue with qawolf agent get --sessions ${options.sessionIds.join(" ")} --follow, or pass --timeout to wait longer.`,
|
|
8410
8414
|
noSession: "No session named. Pass --session, set QAWOLF_SESSION_ID, or start one with qawolf agent send.",
|
|
8411
8415
|
sessionNotRemembered: (sessionId) => `The session id could not be saved to .qawolf/agent.json, so pass --session ${sessionId} to pick it up later.`,
|
|
8412
8416
|
sessionCancelled: (url) => `The session was cancelled before it finished. Read how far it got at ${url}.`,
|
|
@@ -23534,7 +23538,7 @@ function startUpdateCheck(deps) {
|
|
|
23534
23538
|
// package.json
|
|
23535
23539
|
var package_default = {
|
|
23536
23540
|
name: "@qawolf/cli",
|
|
23537
|
-
version: "1.
|
|
23541
|
+
version: "1.43.1",
|
|
23538
23542
|
description: "Run and manage QA Wolf flows from the terminal, CI, or an AI agent",
|
|
23539
23543
|
keywords: [
|
|
23540
23544
|
"automation",
|
|
@@ -23952,6 +23956,70 @@ async function followSession(ctx, options, deps) {
|
|
|
23952
23956
|
}
|
|
23953
23957
|
}
|
|
23954
23958
|
|
|
23959
|
+
// src/domains/agent/followSessions.ts
|
|
23960
|
+
async function followSessions(options) {
|
|
23961
|
+
const { ctx, deps, sessionIds, timeoutSeconds } = options;
|
|
23962
|
+
const deadline = deps.now() + timeoutSeconds * 1000;
|
|
23963
|
+
const timedOut = () => ({
|
|
23964
|
+
error: agentMessages.followSessionsTimedOut({
|
|
23965
|
+
seconds: timeoutSeconds,
|
|
23966
|
+
sessionIds
|
|
23967
|
+
}),
|
|
23968
|
+
exitCode: exitCodes.timeout
|
|
23969
|
+
});
|
|
23970
|
+
const waiting = ctx.ui.wait(agentMessages.waiting);
|
|
23971
|
+
const detach = ctx.signals.register(() => waiting.stop());
|
|
23972
|
+
try {
|
|
23973
|
+
for (;; ) {
|
|
23974
|
+
for (const sessionId of sessionIds) {
|
|
23975
|
+
const remainingMs = deadline - deps.now();
|
|
23976
|
+
if (remainingMs <= 0)
|
|
23977
|
+
return timedOut();
|
|
23978
|
+
const read = await ctx.platformClient.callPublicApi(publicContractsV1.agent.get, { sessionId, waitSeconds: 0 }, { timeoutMs: Math.min(15000, remainingMs) });
|
|
23979
|
+
if (!read.ok) {
|
|
23980
|
+
if (deps.now() >= deadline)
|
|
23981
|
+
return timedOut();
|
|
23982
|
+
return { exitCode: exitCodes.network, ...failureFields(read) };
|
|
23983
|
+
}
|
|
23984
|
+
const session = read.value;
|
|
23985
|
+
const question = pendingQuestion(session.status, session.replies);
|
|
23986
|
+
if (!isSettled(session.status) && question === undefined)
|
|
23987
|
+
continue;
|
|
23988
|
+
waiting.stop();
|
|
23989
|
+
ctx.ui.info(agentMessages.sessionAt(session.url));
|
|
23990
|
+
if (ctx.ui.mode !== "json") {
|
|
23991
|
+
for (const reply of session.replies) {
|
|
23992
|
+
ctx.ui.transcript({
|
|
23993
|
+
...replyParts(reply, { listChoices: true }),
|
|
23994
|
+
data: reply
|
|
23995
|
+
});
|
|
23996
|
+
}
|
|
23997
|
+
}
|
|
23998
|
+
if (isSettled(session.status))
|
|
23999
|
+
return reportSettlement(ctx, session);
|
|
24000
|
+
if (question !== undefined) {
|
|
24001
|
+
const result = await handleQuestion(ctx, {
|
|
24002
|
+
canPrompt: false,
|
|
24003
|
+
question,
|
|
24004
|
+
session,
|
|
24005
|
+
sessionId,
|
|
24006
|
+
workspaceId: undefined
|
|
24007
|
+
});
|
|
24008
|
+
if (result.type === "ended")
|
|
24009
|
+
return result.result;
|
|
24010
|
+
}
|
|
24011
|
+
}
|
|
24012
|
+
const remainingMs = deadline - deps.now();
|
|
24013
|
+
if (remainingMs <= 0)
|
|
24014
|
+
return timedOut();
|
|
24015
|
+
await deps.sleep(Math.min(5000, remainingMs));
|
|
24016
|
+
}
|
|
24017
|
+
} finally {
|
|
24018
|
+
waiting.stop();
|
|
24019
|
+
detach();
|
|
24020
|
+
}
|
|
24021
|
+
}
|
|
24022
|
+
|
|
23955
24023
|
// src/core/resolveId.ts
|
|
23956
24024
|
async function resolveIdFrom(options) {
|
|
23957
24025
|
if (options.given !== undefined) {
|
|
@@ -23998,6 +24066,29 @@ async function handleAgentGet(ctx, options, deps) {
|
|
|
23998
24066
|
if (!timeout.ok) {
|
|
23999
24067
|
return { error: timeout.error, exitCode: exitCodes.invalidArgs };
|
|
24000
24068
|
}
|
|
24069
|
+
if (options.sessions !== undefined) {
|
|
24070
|
+
if (options.session !== undefined || options.sessionArgument !== undefined)
|
|
24071
|
+
return {
|
|
24072
|
+
error: agentMessages.conflictingSessionList,
|
|
24073
|
+
exitCode: exitCodes.invalidArgs
|
|
24074
|
+
};
|
|
24075
|
+
if (!options.follow)
|
|
24076
|
+
return {
|
|
24077
|
+
error: agentMessages.sessionListNeedsFollow,
|
|
24078
|
+
exitCode: exitCodes.invalidArgs
|
|
24079
|
+
};
|
|
24080
|
+
if (options.sessions.length === 0)
|
|
24081
|
+
return {
|
|
24082
|
+
error: agentMessages.emptySessionList,
|
|
24083
|
+
exitCode: exitCodes.invalidArgs
|
|
24084
|
+
};
|
|
24085
|
+
return followSessions({
|
|
24086
|
+
ctx,
|
|
24087
|
+
deps,
|
|
24088
|
+
sessionIds: [...new Set(options.sessions)],
|
|
24089
|
+
timeoutSeconds: timeout.seconds
|
|
24090
|
+
});
|
|
24091
|
+
}
|
|
24001
24092
|
const given = chooseGivenSessionId({
|
|
24002
24093
|
argument: options.sessionArgument,
|
|
24003
24094
|
flag: options.session
|
|
@@ -24107,12 +24198,14 @@ Examples:
|
|
|
24107
24198
|
$ qawolf agent get
|
|
24108
24199
|
$ qawolf agent get --follow
|
|
24109
24200
|
$ qawolf agent get <sessionId> --follow
|
|
24110
|
-
$ qawolf agent get --session <sessionId
|
|
24201
|
+
$ qawolf agent get --session <sessionId>
|
|
24202
|
+
$ qawolf --json agent get --sessions <id1> <id2> --follow --timeout 120`;
|
|
24111
24203
|
function registerAgentGetCommand(agent, signals) {
|
|
24112
|
-
declareCommandKind(agent.command("get [session]"), "read").description("Read what the QA Wolf AI has said and whether it is still working").option("--follow", "Stay and report what QA Wolf says until the session settles, answering its questions as they come", false).option("--session <id>", sessionFlagDescription).option("--workspace-id <id>", "The workspace an answer given during --follow is sent to. Required when authenticating with an organization or user API key").option("--timeout <seconds>", timeoutFlagDescription, String(defaultAgentFollowTimeoutSeconds)).addHelpText("after", getExamples).action((session, opts, command) => withAuthContext(signals, (ctx) => handleAgentGet(ctx, {
|
|
24204
|
+
declareCommandKind(agent.command("get [session]"), "read").description("Read what the QA Wolf AI has said and whether it is still working").option("--follow", "Stay and report what QA Wolf says until the session settles, answering its questions as they come", false).option("--session <id>", sessionFlagDescription).option("--sessions <ids...>", "Follow these sessions in one process and return the first completion, failure, cancellation or question. Requires --follow").option("--workspace-id <id>", "The workspace an answer given during --follow is sent to. Required when authenticating with an organization or user API key").option("--timeout <seconds>", timeoutFlagDescription, String(defaultAgentFollowTimeoutSeconds)).addHelpText("after", getExamples).action((session, opts, command) => withAuthContext(signals, (ctx) => handleAgentGet(ctx, {
|
|
24113
24205
|
follow: opts.follow,
|
|
24114
24206
|
session: opts.session,
|
|
24115
24207
|
sessionArgument: session,
|
|
24208
|
+
sessions: opts.sessions,
|
|
24116
24209
|
timeout: opts.timeout,
|
|
24117
24210
|
workspaceId: opts.workspaceId
|
|
24118
24211
|
}, agentDeps(ctx)))(opts, command));
|
|
@@ -36698,7 +36791,7 @@ Examples:
|
|
|
36698
36791
|
import { basename as basename8 } from "node:path";
|
|
36699
36792
|
|
|
36700
36793
|
// src/domains/investigation/download.ts
|
|
36701
|
-
var traceLimit =
|
|
36794
|
+
var traceLimit = 75 * 1024 * 1024;
|
|
36702
36795
|
var logTailLimit = 5 * 1024 * 1024;
|
|
36703
36796
|
var logTransferLimit = 50 * 1024 * 1024;
|
|
36704
36797
|
var downloadTimeoutMs = 120000;
|
|
@@ -40676,4 +40769,4 @@ createProgram({ signals }).parseAsync().catch(() => {
|
|
|
40676
40769
|
process.exitCode = 1;
|
|
40677
40770
|
}).finally(() => exitWhenIdle(typeof process.exitCode === "number" ? process.exitCode : 0));
|
|
40678
40771
|
|
|
40679
|
-
//# debugId=
|
|
40772
|
+
//# debugId=C44573E11BF850C064756E2164756E21
|
|
@@ -9524,7 +9524,7 @@ function summarizeExecutionLogs(input) {
|
|
|
9524
9524
|
|
|
9525
9525
|
// src/domains/investigation/parser/trace/playwrightTraceTypes.ts
|
|
9526
9526
|
var traceLimits = {
|
|
9527
|
-
maxArchiveBytes:
|
|
9527
|
+
maxArchiveBytes: 75 * 1024 * 1024,
|
|
9528
9528
|
maxBodyBytes: 256 * 1024,
|
|
9529
9529
|
maxEntryBytes: 16 * 1024 * 1024,
|
|
9530
9530
|
maxEvents: 1e5,
|
|
@@ -11420,4 +11420,4 @@ export {
|
|
|
11420
11420
|
investigate
|
|
11421
11421
|
};
|
|
11422
11422
|
|
|
11423
|
-
//# debugId=
|
|
11423
|
+
//# debugId=30384783C6AA2E7664756E2164756E21
|