@autohq/cli 0.1.82 → 0.1.83
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 +23 -3
- package/dist/index.js +55 -6
- package/package.json +1 -1
package/dist/agent-bridge.js
CHANGED
|
@@ -21767,7 +21767,8 @@ var SESSION_RUN_DISPATCH_COMMAND_KINDS = [
|
|
|
21767
21767
|
"start",
|
|
21768
21768
|
"startWithMessage",
|
|
21769
21769
|
"message",
|
|
21770
|
-
"answer"
|
|
21770
|
+
"answer",
|
|
21771
|
+
"stop"
|
|
21771
21772
|
];
|
|
21772
21773
|
var SESSION_RUN_PERSISTED_COMMAND_KINDS = [
|
|
21773
21774
|
...SESSION_RUN_COMMAND_KINDS,
|
|
@@ -21972,13 +21973,18 @@ var SessionRunDispatchAnswerCommandPayloadSchema = external_exports.object({
|
|
|
21972
21973
|
answers: external_exports.record(external_exports.string(), external_exports.string()),
|
|
21973
21974
|
response: external_exports.string().trim().min(1).optional()
|
|
21974
21975
|
}).strict();
|
|
21976
|
+
var SessionRunDispatchStopCommandPayloadSchema = external_exports.object({
|
|
21977
|
+
kind: external_exports.literal("stop"),
|
|
21978
|
+
reason: external_exports.string().trim().min(1).optional()
|
|
21979
|
+
}).strict();
|
|
21975
21980
|
var SessionRunDispatchCommandPayloadSchema = external_exports.discriminatedUnion(
|
|
21976
21981
|
"kind",
|
|
21977
21982
|
[
|
|
21978
21983
|
SessionRunStartCommandPayloadSchema,
|
|
21979
21984
|
SessionRunStartWithMessageCommandPayloadSchema,
|
|
21980
21985
|
SessionRunDispatchMessageCommandPayloadSchema,
|
|
21981
|
-
SessionRunDispatchAnswerCommandPayloadSchema
|
|
21986
|
+
SessionRunDispatchAnswerCommandPayloadSchema,
|
|
21987
|
+
SessionRunDispatchStopCommandPayloadSchema
|
|
21982
21988
|
]
|
|
21983
21989
|
);
|
|
21984
21990
|
var SessionRunDispatchCommandRecordBaseSchema = external_exports.object({
|
|
@@ -22014,6 +22020,10 @@ var SessionRunDispatchCommandRecordSchema = external_exports.discriminatedUnion(
|
|
|
22014
22020
|
SessionRunDispatchCommandRecordBaseSchema.extend({
|
|
22015
22021
|
kind: external_exports.literal("answer"),
|
|
22016
22022
|
payload: SessionRunDispatchAnswerCommandPayloadSchema
|
|
22023
|
+
}),
|
|
22024
|
+
SessionRunDispatchCommandRecordBaseSchema.extend({
|
|
22025
|
+
kind: external_exports.literal("stop"),
|
|
22026
|
+
payload: SessionRunDispatchStopCommandPayloadSchema
|
|
22017
22027
|
})
|
|
22018
22028
|
]
|
|
22019
22029
|
);
|
|
@@ -22040,7 +22050,8 @@ var SESSION_RUN_STATUSES = [
|
|
|
22040
22050
|
"queued",
|
|
22041
22051
|
"running",
|
|
22042
22052
|
"awaiting",
|
|
22043
|
-
"failed"
|
|
22053
|
+
"failed",
|
|
22054
|
+
"stopped"
|
|
22044
22055
|
];
|
|
22045
22056
|
var SESSION_RUN_DISPLAY_TITLE_MAX_LENGTH = 64;
|
|
22046
22057
|
var SessionRunStatusSchema = external_exports.enum(SESSION_RUN_STATUSES);
|
|
@@ -46385,6 +46396,15 @@ var ClaudeCodeCommandHandler = class {
|
|
|
46385
46396
|
if (delivery.kind === "answer") {
|
|
46386
46397
|
return this.handleAnswerCommand(delivery, activeContext, socketId);
|
|
46387
46398
|
}
|
|
46399
|
+
if (delivery.kind === "stop") {
|
|
46400
|
+
this.injectedCommands.add(delivery.commandId);
|
|
46401
|
+
this.shutdown();
|
|
46402
|
+
return commandAck({
|
|
46403
|
+
delivery,
|
|
46404
|
+
socketId,
|
|
46405
|
+
status: "injected"
|
|
46406
|
+
});
|
|
46407
|
+
}
|
|
46388
46408
|
if (delivery.kind !== "message") {
|
|
46389
46409
|
return commandAck({
|
|
46390
46410
|
delivery,
|
package/dist/index.js
CHANGED
|
@@ -17622,7 +17622,7 @@ var init_run_diagnostics = __esm({
|
|
|
17622
17622
|
});
|
|
17623
17623
|
|
|
17624
17624
|
// ../../packages/schemas/src/session-run-commands.ts
|
|
17625
|
-
var SESSION_RUN_COMMAND_KINDS, SESSION_RUN_DISPATCH_COMMAND_KINDS, SESSION_RUN_PERSISTED_COMMAND_KINDS, SESSION_RUN_LIFECYCLE_COMMAND_KINDS, SESSION_RUN_COMMAND_STATUSES, SESSION_RUN_DISPATCH_COMMAND_STATUSES, SessionRunCommandKindSchema2, SessionRunPersistedCommandKindSchema, SessionRunDispatchCommandKindSchema, SessionRunLifecycleCommandKindSchema, SessionRunCommandStatusSchema, SessionRunDispatchCommandStatusSchema, SessionRunCommandSenderSchema, SessionRunMessageCommandPayloadSchema, SessionRunAnswerCommandPayloadSchema, SessionRunLifecycleCommandPayloadSchema, SessionRunCommandPayloadSchema, CreateSessionRunMessageCommandRequestSchema, CreateSessionRunAnswerCommandRequestSchema, CreateSessionRunLifecycleCommandRequestSchema, CreateSessionRunCommandRequestSchema, SessionRunResolutionPolicySchema, SessionAddressedCommandTargetSchema, SessionRunCommandRecordBaseSchema, SessionRunStartCommandPayloadSchema, SessionRunStartWithMessageCommandPayloadSchema, SessionRunPersistedCommandPayloadSchema, SessionRunCommandRecordSchema, SessionRunDispatchMessageCommandPayloadSchema, SessionRunDispatchAnswerCommandPayloadSchema, SessionRunDispatchCommandPayloadSchema, SessionRunDispatchCommandRecordBaseSchema, SessionRunDispatchCommandRecordSchema;
|
|
17625
|
+
var SESSION_RUN_COMMAND_KINDS, SESSION_RUN_DISPATCH_COMMAND_KINDS, SESSION_RUN_PERSISTED_COMMAND_KINDS, SESSION_RUN_LIFECYCLE_COMMAND_KINDS, SESSION_RUN_COMMAND_STATUSES, SESSION_RUN_DISPATCH_COMMAND_STATUSES, SessionRunCommandKindSchema2, SessionRunPersistedCommandKindSchema, SessionRunDispatchCommandKindSchema, SessionRunLifecycleCommandKindSchema, SessionRunCommandStatusSchema, SessionRunDispatchCommandStatusSchema, SessionRunCommandSenderSchema, SessionRunMessageCommandPayloadSchema, SessionRunAnswerCommandPayloadSchema, SessionRunLifecycleCommandPayloadSchema, SessionRunCommandPayloadSchema, CreateSessionRunMessageCommandRequestSchema, CreateSessionRunAnswerCommandRequestSchema, CreateSessionRunLifecycleCommandRequestSchema, CreateSessionRunCommandRequestSchema, SessionRunResolutionPolicySchema, SessionAddressedCommandTargetSchema, SessionRunCommandRecordBaseSchema, SessionRunStartCommandPayloadSchema, SessionRunStartWithMessageCommandPayloadSchema, SessionRunPersistedCommandPayloadSchema, SessionRunCommandRecordSchema, SessionRunDispatchMessageCommandPayloadSchema, SessionRunDispatchAnswerCommandPayloadSchema, SessionRunDispatchStopCommandPayloadSchema, SessionRunDispatchCommandPayloadSchema, SessionRunDispatchCommandRecordBaseSchema, SessionRunDispatchCommandRecordSchema;
|
|
17626
17626
|
var init_session_run_commands = __esm({
|
|
17627
17627
|
"../../packages/schemas/src/session-run-commands.ts"() {
|
|
17628
17628
|
"use strict";
|
|
@@ -17643,7 +17643,8 @@ var init_session_run_commands = __esm({
|
|
|
17643
17643
|
"start",
|
|
17644
17644
|
"startWithMessage",
|
|
17645
17645
|
"message",
|
|
17646
|
-
"answer"
|
|
17646
|
+
"answer",
|
|
17647
|
+
"stop"
|
|
17647
17648
|
];
|
|
17648
17649
|
SESSION_RUN_PERSISTED_COMMAND_KINDS = [
|
|
17649
17650
|
...SESSION_RUN_COMMAND_KINDS,
|
|
@@ -17848,13 +17849,18 @@ var init_session_run_commands = __esm({
|
|
|
17848
17849
|
answers: external_exports.record(external_exports.string(), external_exports.string()),
|
|
17849
17850
|
response: external_exports.string().trim().min(1).optional()
|
|
17850
17851
|
}).strict();
|
|
17852
|
+
SessionRunDispatchStopCommandPayloadSchema = external_exports.object({
|
|
17853
|
+
kind: external_exports.literal("stop"),
|
|
17854
|
+
reason: external_exports.string().trim().min(1).optional()
|
|
17855
|
+
}).strict();
|
|
17851
17856
|
SessionRunDispatchCommandPayloadSchema = external_exports.discriminatedUnion(
|
|
17852
17857
|
"kind",
|
|
17853
17858
|
[
|
|
17854
17859
|
SessionRunStartCommandPayloadSchema,
|
|
17855
17860
|
SessionRunStartWithMessageCommandPayloadSchema,
|
|
17856
17861
|
SessionRunDispatchMessageCommandPayloadSchema,
|
|
17857
|
-
SessionRunDispatchAnswerCommandPayloadSchema
|
|
17862
|
+
SessionRunDispatchAnswerCommandPayloadSchema,
|
|
17863
|
+
SessionRunDispatchStopCommandPayloadSchema
|
|
17858
17864
|
]
|
|
17859
17865
|
);
|
|
17860
17866
|
SessionRunDispatchCommandRecordBaseSchema = external_exports.object({
|
|
@@ -17890,6 +17896,10 @@ var init_session_run_commands = __esm({
|
|
|
17890
17896
|
SessionRunDispatchCommandRecordBaseSchema.extend({
|
|
17891
17897
|
kind: external_exports.literal("answer"),
|
|
17892
17898
|
payload: SessionRunDispatchAnswerCommandPayloadSchema
|
|
17899
|
+
}),
|
|
17900
|
+
SessionRunDispatchCommandRecordBaseSchema.extend({
|
|
17901
|
+
kind: external_exports.literal("stop"),
|
|
17902
|
+
payload: SessionRunDispatchStopCommandPayloadSchema
|
|
17893
17903
|
})
|
|
17894
17904
|
]
|
|
17895
17905
|
);
|
|
@@ -17938,7 +17948,8 @@ var init_session_runs = __esm({
|
|
|
17938
17948
|
"queued",
|
|
17939
17949
|
"running",
|
|
17940
17950
|
"awaiting",
|
|
17941
|
-
"failed"
|
|
17951
|
+
"failed",
|
|
17952
|
+
"stopped"
|
|
17942
17953
|
];
|
|
17943
17954
|
SESSION_RUN_DISPLAY_TITLE_MAX_LENGTH = 64;
|
|
17944
17955
|
SessionRunStatusSchema = external_exports.enum(SESSION_RUN_STATUSES);
|
|
@@ -19632,7 +19643,7 @@ function createApiClient(input) {
|
|
|
19632
19643
|
},
|
|
19633
19644
|
body: JSON.stringify({
|
|
19634
19645
|
kind: "stop",
|
|
19635
|
-
payload: {}
|
|
19646
|
+
payload: options.reason ? { reason: options.reason } : {}
|
|
19636
19647
|
})
|
|
19637
19648
|
},
|
|
19638
19649
|
options.apiBaseUrl
|
|
@@ -21103,7 +21114,7 @@ var init_package = __esm({
|
|
|
21103
21114
|
"package.json"() {
|
|
21104
21115
|
package_default = {
|
|
21105
21116
|
name: "@autohq/cli",
|
|
21106
|
-
version: "0.1.
|
|
21117
|
+
version: "0.1.83",
|
|
21107
21118
|
license: "SEE LICENSE IN README.md",
|
|
21108
21119
|
publishConfig: {
|
|
21109
21120
|
access: "public"
|
|
@@ -27581,6 +27592,15 @@ var ClaudeCodeCommandHandler = class {
|
|
|
27581
27592
|
if (delivery.kind === "answer") {
|
|
27582
27593
|
return this.handleAnswerCommand(delivery, activeContext, socketId);
|
|
27583
27594
|
}
|
|
27595
|
+
if (delivery.kind === "stop") {
|
|
27596
|
+
this.injectedCommands.add(delivery.commandId);
|
|
27597
|
+
this.shutdown();
|
|
27598
|
+
return commandAck({
|
|
27599
|
+
delivery,
|
|
27600
|
+
socketId,
|
|
27601
|
+
status: "injected"
|
|
27602
|
+
});
|
|
27603
|
+
}
|
|
27584
27604
|
if (delivery.kind !== "message") {
|
|
27585
27605
|
return commandAck({
|
|
27586
27606
|
delivery,
|
|
@@ -29899,6 +29919,32 @@ async function unarchiveRunsAction(context, runIds, commandOptions) {
|
|
|
29899
29919
|
context.writeOutput(`run_id ${run.id} archived ${Boolean(run.archivedAt)}`);
|
|
29900
29920
|
}
|
|
29901
29921
|
}
|
|
29922
|
+
async function stopRunsAction(context, runIds, commandOptions) {
|
|
29923
|
+
const client = createRunServiceClient(context);
|
|
29924
|
+
const apiBaseUrl = apiUrlFromOptions(context, commandOptions);
|
|
29925
|
+
const failedRunIds = [];
|
|
29926
|
+
for (const runId of runIds) {
|
|
29927
|
+
try {
|
|
29928
|
+
const command = await client.stopRun(runId, {
|
|
29929
|
+
apiBaseUrl,
|
|
29930
|
+
reason: commandOptions.reason
|
|
29931
|
+
});
|
|
29932
|
+
context.writeOutput(
|
|
29933
|
+
`run_id ${runId} command_id ${command.command_id} status ${command.status}`
|
|
29934
|
+
);
|
|
29935
|
+
} catch (error51) {
|
|
29936
|
+
failedRunIds.push(runId);
|
|
29937
|
+
context.writeOutput(
|
|
29938
|
+
`run_id ${runId} error ${error51 instanceof Error ? error51.message : String(error51)}`
|
|
29939
|
+
);
|
|
29940
|
+
}
|
|
29941
|
+
}
|
|
29942
|
+
if (failedRunIds.length > 0) {
|
|
29943
|
+
throw new Error(
|
|
29944
|
+
`Failed to stop ${failedRunIds.length} of ${runIds.length} run(s): ${failedRunIds.join(", ")}`
|
|
29945
|
+
);
|
|
29946
|
+
}
|
|
29947
|
+
}
|
|
29902
29948
|
async function consoleRunAction(context, runId, commandOptions) {
|
|
29903
29949
|
await runConsole({
|
|
29904
29950
|
client: createRunServiceClient(context),
|
|
@@ -30197,6 +30243,9 @@ function registerRunCommands(program, context) {
|
|
|
30197
30243
|
}
|
|
30198
30244
|
await unarchiveRunsAction(context, runIds, commandOptions);
|
|
30199
30245
|
});
|
|
30246
|
+
runs.command("stop").description("Stop live runs and shut down their agent sessions.").argument("<run-ids...>", "run 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(async (runIds, commandOptions) => {
|
|
30247
|
+
await stopRunsAction(context, runIds, commandOptions);
|
|
30248
|
+
});
|
|
30200
30249
|
runs.command("benchmark-startup").description("Launch a session run and measure time until awaiting.").requiredOption("--session <name>", "session name").option("-m, --message <message>", "initial message for the run").option(
|
|
30201
30250
|
"--interactive",
|
|
30202
30251
|
"start without the default initial prompt unless --message is provided"
|