@autohq/cli 0.1.270 → 0.1.271
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/agent-bridge.js +1 -1
- package/dist/index.js +24 -4
- package/package.json +1 -1
package/dist/agent-bridge.js
CHANGED
|
@@ -23353,7 +23353,7 @@ Object.assign(lookup, {
|
|
|
23353
23353
|
// package.json
|
|
23354
23354
|
var package_default = {
|
|
23355
23355
|
name: "@autohq/cli",
|
|
23356
|
-
version: "0.1.
|
|
23356
|
+
version: "0.1.271",
|
|
23357
23357
|
license: "SEE LICENSE IN README.md",
|
|
23358
23358
|
publishConfig: {
|
|
23359
23359
|
access: "public"
|
package/dist/index.js
CHANGED
|
@@ -22210,6 +22210,10 @@ function createApiClient(input) {
|
|
|
22210
22210
|
return await response.json();
|
|
22211
22211
|
},
|
|
22212
22212
|
async stopSession(sessionId, options = {}) {
|
|
22213
|
+
const payload = {
|
|
22214
|
+
...options.reason ? { reason: options.reason } : {},
|
|
22215
|
+
...options.respawn ? { respawn: { reason: "refresh" } } : {}
|
|
22216
|
+
};
|
|
22213
22217
|
const response = await authenticatedFetch(
|
|
22214
22218
|
apiUrl(runApiPath(sessionId, "/commands"), options.apiBaseUrl),
|
|
22215
22219
|
{
|
|
@@ -22219,7 +22223,7 @@ function createApiClient(input) {
|
|
|
22219
22223
|
},
|
|
22220
22224
|
body: JSON.stringify({
|
|
22221
22225
|
kind: "stop",
|
|
22222
|
-
payload
|
|
22226
|
+
payload
|
|
22223
22227
|
})
|
|
22224
22228
|
},
|
|
22225
22229
|
options.apiBaseUrl
|
|
@@ -22952,7 +22956,7 @@ var init_package = __esm({
|
|
|
22952
22956
|
"package.json"() {
|
|
22953
22957
|
package_default = {
|
|
22954
22958
|
name: "@autohq/cli",
|
|
22955
|
-
version: "0.1.
|
|
22959
|
+
version: "0.1.271",
|
|
22956
22960
|
license: "SEE LICENSE IN README.md",
|
|
22957
22961
|
publishConfig: {
|
|
22958
22962
|
access: "public"
|
|
@@ -39354,7 +39358,8 @@ async function stopSessionsAction(context, sessionIds, commandOptions) {
|
|
|
39354
39358
|
try {
|
|
39355
39359
|
const command = await client.stopSession(sessionId, {
|
|
39356
39360
|
apiBaseUrl,
|
|
39357
|
-
reason: commandOptions.reason
|
|
39361
|
+
reason: commandOptions.reason,
|
|
39362
|
+
respawn: commandOptions.respawn
|
|
39358
39363
|
});
|
|
39359
39364
|
context.writeOutput(
|
|
39360
39365
|
`${style.label("session_id")} ${style.id(sessionId)} ${style.label(
|
|
@@ -39371,11 +39376,19 @@ async function stopSessionsAction(context, sessionIds, commandOptions) {
|
|
|
39371
39376
|
}
|
|
39372
39377
|
}
|
|
39373
39378
|
if (failedSessionIds.length > 0) {
|
|
39379
|
+
const actionLabel = commandOptions.actionLabel ?? "stop";
|
|
39374
39380
|
throw new Error(
|
|
39375
|
-
`Failed to
|
|
39381
|
+
`Failed to ${actionLabel} ${failedSessionIds.length} of ${sessionIds.length} session(s): ${failedSessionIds.join(", ")}`
|
|
39376
39382
|
);
|
|
39377
39383
|
}
|
|
39378
39384
|
}
|
|
39385
|
+
async function reloadSessionsAction(context, sessionIds, commandOptions) {
|
|
39386
|
+
await stopSessionsAction(context, sessionIds, {
|
|
39387
|
+
...commandOptions,
|
|
39388
|
+
actionLabel: "reload",
|
|
39389
|
+
respawn: true
|
|
39390
|
+
});
|
|
39391
|
+
}
|
|
39379
39392
|
async function consoleRunAction(context, sessionId, commandOptions) {
|
|
39380
39393
|
await runConsole({
|
|
39381
39394
|
client: createSessionServiceClient(context),
|
|
@@ -40079,6 +40092,13 @@ function registerSessionCommands(program, context) {
|
|
|
40079
40092
|
await stopSessionsAction(context, sessionIds, commandOptions);
|
|
40080
40093
|
}
|
|
40081
40094
|
);
|
|
40095
|
+
sessions.command("reload").description(
|
|
40096
|
+
"Stop sessions and request server-side respawn for refresh-eligible singletons."
|
|
40097
|
+
).argument("<session-ids...>", "session id(s)").option("--reason <reason>", "reason recorded with the stop").option("--api-url <url>", "Auto API base URL").option("--api-base-url <url>", "Auto API base URL").action(
|
|
40098
|
+
async (sessionIds, commandOptions) => {
|
|
40099
|
+
await reloadSessionsAction(context, sessionIds, commandOptions);
|
|
40100
|
+
}
|
|
40101
|
+
);
|
|
40082
40102
|
sessions.command("benchmark-startup").description("Launch an agent session and measure time until awaiting.").requiredOption("--agent <name>", "agent name").option("-m, --message <message>", "initial message for the session").option(
|
|
40083
40103
|
"--interactive",
|
|
40084
40104
|
"start without the default initial prompt unless --message is provided"
|