@autohq/cli 0.1.269 → 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 +18 -1
- package/dist/index.js +81 -5
- 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"
|
|
@@ -27418,6 +27418,18 @@ var RunArtifactRecordSchema = external_exports.object({
|
|
|
27418
27418
|
var RunArtifactsResponseSchema = external_exports.object({
|
|
27419
27419
|
artifacts: external_exports.array(RunArtifactRecordSchema)
|
|
27420
27420
|
});
|
|
27421
|
+
var RunBindingRecordSchema = external_exports.object({
|
|
27422
|
+
targetType: BindingTargetTypeSchema,
|
|
27423
|
+
externalId: external_exports.string(),
|
|
27424
|
+
source: SessionBindingSourceSchema,
|
|
27425
|
+
status: SessionBindingStatusSchema,
|
|
27426
|
+
payload: JsonValueSchema2.nullable(),
|
|
27427
|
+
createdAt: external_exports.string().datetime(),
|
|
27428
|
+
updatedAt: external_exports.string().datetime()
|
|
27429
|
+
});
|
|
27430
|
+
var RunBindingsResponseSchema = external_exports.object({
|
|
27431
|
+
bindings: external_exports.array(RunBindingRecordSchema)
|
|
27432
|
+
});
|
|
27421
27433
|
var RunTurnSchema = external_exports.object({
|
|
27422
27434
|
startSequence: external_exports.number().int().nonnegative(),
|
|
27423
27435
|
endSequence: external_exports.number().int().nonnegative(),
|
|
@@ -27493,6 +27505,11 @@ var RunSummarySchema = external_exports.object({
|
|
|
27493
27505
|
count: external_exports.number().int().nonnegative(),
|
|
27494
27506
|
types: external_exports.array(external_exports.string())
|
|
27495
27507
|
}),
|
|
27508
|
+
/** Active session bindings, counted with their distinct target types. */
|
|
27509
|
+
bindings: external_exports.object({
|
|
27510
|
+
count: external_exports.number().int().nonnegative(),
|
|
27511
|
+
targetTypes: external_exports.array(BindingTargetTypeSchema)
|
|
27512
|
+
}),
|
|
27496
27513
|
/** Derived per-user-message turns, capped to the most recent. */
|
|
27497
27514
|
turns: external_exports.array(RunTurnSchema),
|
|
27498
27515
|
commands: external_exports.object({
|
package/dist/index.js
CHANGED
|
@@ -19101,7 +19101,7 @@ var init_sessions = __esm({
|
|
|
19101
19101
|
});
|
|
19102
19102
|
|
|
19103
19103
|
// ../../packages/schemas/src/session-introspection.ts
|
|
19104
|
-
var TruncatedValueSchema, RunConversationSearchSnippetSchema, RunConversationSearchMatchSchema, RunConversationSearchResponseSchema, SessionToolExchangeSchema, SessionToolExchangesResponseSchema, SESSION_TRIGGER_DELIVERY_ACTIONS, SessionTriggerDeliveryActionSchema, SESSION_EVENT_ORIGIN_KINDS, SessionEventOriginKindSchema, SessionTriggerDeliveryRecordSchema, SessionTriggersResponseSchema, RunArtifactRecordSchema, RunArtifactsResponseSchema, RunTurnSchema, SessionToolStatSchema, RunSummarySchema;
|
|
19104
|
+
var TruncatedValueSchema, RunConversationSearchSnippetSchema, RunConversationSearchMatchSchema, RunConversationSearchResponseSchema, SessionToolExchangeSchema, SessionToolExchangesResponseSchema, SESSION_TRIGGER_DELIVERY_ACTIONS, SessionTriggerDeliveryActionSchema, SESSION_EVENT_ORIGIN_KINDS, SessionEventOriginKindSchema, SessionTriggerDeliveryRecordSchema, SessionTriggersResponseSchema, RunArtifactRecordSchema, RunArtifactsResponseSchema, RunBindingRecordSchema, RunBindingsResponseSchema, RunTurnSchema, SessionToolStatSchema, RunSummarySchema;
|
|
19105
19105
|
var init_session_introspection = __esm({
|
|
19106
19106
|
"../../packages/schemas/src/session-introspection.ts"() {
|
|
19107
19107
|
"use strict";
|
|
@@ -19110,6 +19110,7 @@ var init_session_introspection = __esm({
|
|
|
19110
19110
|
init_conversation();
|
|
19111
19111
|
init_ids();
|
|
19112
19112
|
init_primitives();
|
|
19113
|
+
init_session_bindings();
|
|
19113
19114
|
init_sessions();
|
|
19114
19115
|
TruncatedValueSchema = external_exports.object({
|
|
19115
19116
|
truncated: external_exports.literal(true),
|
|
@@ -19214,6 +19215,18 @@ var init_session_introspection = __esm({
|
|
|
19214
19215
|
RunArtifactsResponseSchema = external_exports.object({
|
|
19215
19216
|
artifacts: external_exports.array(RunArtifactRecordSchema)
|
|
19216
19217
|
});
|
|
19218
|
+
RunBindingRecordSchema = external_exports.object({
|
|
19219
|
+
targetType: BindingTargetTypeSchema,
|
|
19220
|
+
externalId: external_exports.string(),
|
|
19221
|
+
source: SessionBindingSourceSchema,
|
|
19222
|
+
status: SessionBindingStatusSchema,
|
|
19223
|
+
payload: JsonValueSchema.nullable(),
|
|
19224
|
+
createdAt: external_exports.string().datetime(),
|
|
19225
|
+
updatedAt: external_exports.string().datetime()
|
|
19226
|
+
});
|
|
19227
|
+
RunBindingsResponseSchema = external_exports.object({
|
|
19228
|
+
bindings: external_exports.array(RunBindingRecordSchema)
|
|
19229
|
+
});
|
|
19217
19230
|
RunTurnSchema = external_exports.object({
|
|
19218
19231
|
startSequence: external_exports.number().int().nonnegative(),
|
|
19219
19232
|
endSequence: external_exports.number().int().nonnegative(),
|
|
@@ -19289,6 +19302,11 @@ var init_session_introspection = __esm({
|
|
|
19289
19302
|
count: external_exports.number().int().nonnegative(),
|
|
19290
19303
|
types: external_exports.array(external_exports.string())
|
|
19291
19304
|
}),
|
|
19305
|
+
/** Active session bindings, counted with their distinct target types. */
|
|
19306
|
+
bindings: external_exports.object({
|
|
19307
|
+
count: external_exports.number().int().nonnegative(),
|
|
19308
|
+
targetTypes: external_exports.array(BindingTargetTypeSchema)
|
|
19309
|
+
}),
|
|
19292
19310
|
/** Derived per-user-message turns, capped to the most recent. */
|
|
19293
19311
|
turns: external_exports.array(RunTurnSchema),
|
|
19294
19312
|
commands: external_exports.object({
|
|
@@ -22192,6 +22210,10 @@ function createApiClient(input) {
|
|
|
22192
22210
|
return await response.json();
|
|
22193
22211
|
},
|
|
22194
22212
|
async stopSession(sessionId, options = {}) {
|
|
22213
|
+
const payload = {
|
|
22214
|
+
...options.reason ? { reason: options.reason } : {},
|
|
22215
|
+
...options.respawn ? { respawn: { reason: "refresh" } } : {}
|
|
22216
|
+
};
|
|
22195
22217
|
const response = await authenticatedFetch(
|
|
22196
22218
|
apiUrl(runApiPath(sessionId, "/commands"), options.apiBaseUrl),
|
|
22197
22219
|
{
|
|
@@ -22201,7 +22223,7 @@ function createApiClient(input) {
|
|
|
22201
22223
|
},
|
|
22202
22224
|
body: JSON.stringify({
|
|
22203
22225
|
kind: "stop",
|
|
22204
|
-
payload
|
|
22226
|
+
payload
|
|
22205
22227
|
})
|
|
22206
22228
|
},
|
|
22207
22229
|
options.apiBaseUrl
|
|
@@ -22306,6 +22328,14 @@ function createApiClient(input) {
|
|
|
22306
22328
|
}
|
|
22307
22329
|
);
|
|
22308
22330
|
},
|
|
22331
|
+
async listRunBindings(sessionId, options = {}) {
|
|
22332
|
+
return requestJson(
|
|
22333
|
+
runApiPath(sessionId, "/bindings"),
|
|
22334
|
+
{
|
|
22335
|
+
apiBaseUrl: options.apiBaseUrl
|
|
22336
|
+
}
|
|
22337
|
+
);
|
|
22338
|
+
},
|
|
22309
22339
|
async listSessionCommands(sessionId, options = {}) {
|
|
22310
22340
|
return requestJson(
|
|
22311
22341
|
runApiPath(sessionId, "/commands"),
|
|
@@ -22926,7 +22956,7 @@ var init_package = __esm({
|
|
|
22926
22956
|
"package.json"() {
|
|
22927
22957
|
package_default = {
|
|
22928
22958
|
name: "@autohq/cli",
|
|
22929
|
-
version: "0.1.
|
|
22959
|
+
version: "0.1.271",
|
|
22930
22960
|
license: "SEE LICENSE IN README.md",
|
|
22931
22961
|
publishConfig: {
|
|
22932
22962
|
access: "public"
|
|
@@ -39328,7 +39358,8 @@ async function stopSessionsAction(context, sessionIds, commandOptions) {
|
|
|
39328
39358
|
try {
|
|
39329
39359
|
const command = await client.stopSession(sessionId, {
|
|
39330
39360
|
apiBaseUrl,
|
|
39331
|
-
reason: commandOptions.reason
|
|
39361
|
+
reason: commandOptions.reason,
|
|
39362
|
+
respawn: commandOptions.respawn
|
|
39332
39363
|
});
|
|
39333
39364
|
context.writeOutput(
|
|
39334
39365
|
`${style.label("session_id")} ${style.id(sessionId)} ${style.label(
|
|
@@ -39345,11 +39376,19 @@ async function stopSessionsAction(context, sessionIds, commandOptions) {
|
|
|
39345
39376
|
}
|
|
39346
39377
|
}
|
|
39347
39378
|
if (failedSessionIds.length > 0) {
|
|
39379
|
+
const actionLabel = commandOptions.actionLabel ?? "stop";
|
|
39348
39380
|
throw new Error(
|
|
39349
|
-
`Failed to
|
|
39381
|
+
`Failed to ${actionLabel} ${failedSessionIds.length} of ${sessionIds.length} session(s): ${failedSessionIds.join(", ")}`
|
|
39350
39382
|
);
|
|
39351
39383
|
}
|
|
39352
39384
|
}
|
|
39385
|
+
async function reloadSessionsAction(context, sessionIds, commandOptions) {
|
|
39386
|
+
await stopSessionsAction(context, sessionIds, {
|
|
39387
|
+
...commandOptions,
|
|
39388
|
+
actionLabel: "reload",
|
|
39389
|
+
respawn: true
|
|
39390
|
+
});
|
|
39391
|
+
}
|
|
39353
39392
|
async function consoleRunAction(context, sessionId, commandOptions) {
|
|
39354
39393
|
await runConsole({
|
|
39355
39394
|
client: createSessionServiceClient(context),
|
|
@@ -39654,6 +39693,13 @@ function formatRunShowText(result, writeLine, style) {
|
|
|
39654
39693
|
)}`
|
|
39655
39694
|
);
|
|
39656
39695
|
}
|
|
39696
|
+
if (summary.bindings.count > 0) {
|
|
39697
|
+
writeLine(
|
|
39698
|
+
`${style.label("bindings:")} ${summary.bindings.count} ${style.dim(
|
|
39699
|
+
`(${summary.bindings.targetTypes.join(", ")})`
|
|
39700
|
+
)}`
|
|
39701
|
+
);
|
|
39702
|
+
}
|
|
39657
39703
|
writeLine(
|
|
39658
39704
|
`${style.label("commands:")} ${summary.commands.total} ${style.dim(
|
|
39659
39705
|
`failed=${summary.commands.failed}`
|
|
@@ -39854,6 +39900,26 @@ function formatArtifactsText(result, writeLine, style) {
|
|
|
39854
39900
|
);
|
|
39855
39901
|
}
|
|
39856
39902
|
}
|
|
39903
|
+
async function handleRunsBindings(context, sessionId, options = {}) {
|
|
39904
|
+
const client = createContextApiClient(context);
|
|
39905
|
+
const response = await client.listRunBindings(sessionId, {
|
|
39906
|
+
apiBaseUrl: apiUrlFromOptions(context, options)
|
|
39907
|
+
});
|
|
39908
|
+
context.io.writeResult({ sessionId, ...response }, formatBindingsText);
|
|
39909
|
+
}
|
|
39910
|
+
function formatBindingsText(result, writeLine, style) {
|
|
39911
|
+
if (result.bindings.length === 0) {
|
|
39912
|
+
writeLine(style.dim("No active bindings."));
|
|
39913
|
+
return;
|
|
39914
|
+
}
|
|
39915
|
+
for (const binding of result.bindings) {
|
|
39916
|
+
writeLine(
|
|
39917
|
+
`${style.label(binding.targetType)} ${style.id(binding.externalId)} ${style.dim(
|
|
39918
|
+
`source=${binding.source} created=${binding.createdAt}`
|
|
39919
|
+
)}`
|
|
39920
|
+
);
|
|
39921
|
+
}
|
|
39922
|
+
}
|
|
39857
39923
|
async function handleRunsCommands(context, sessionId, options = {}) {
|
|
39858
39924
|
const client = createContextApiClient(context);
|
|
39859
39925
|
const response = await client.listSessionCommands(sessionId, {
|
|
@@ -39991,6 +40057,9 @@ function registerSessionCommands(program, context) {
|
|
|
39991
40057
|
sessions.command("artifacts").description("List artifacts a session currently owns.").argument("<session-id>", "session id").option("--api-url <url>", "Auto API base URL").option("--api-base-url <url>", "Auto API base URL").action(async (sessionId, commandOptions) => {
|
|
39992
40058
|
await handleRunsArtifacts(context, sessionId, commandOptions);
|
|
39993
40059
|
});
|
|
40060
|
+
sessions.command("bindings").description("List the active bindings a session owns.").argument("<session-id>", "session id").option("--api-url <url>", "Auto API base URL").option("--api-base-url <url>", "Auto API base URL").action(async (sessionId, commandOptions) => {
|
|
40061
|
+
await handleRunsBindings(context, sessionId, commandOptions);
|
|
40062
|
+
});
|
|
39994
40063
|
sessions.command("commands").description("List a session's inbound command history.").argument("<session-id>", "session id").option("--api-url <url>", "Auto API base URL").option("--api-base-url <url>", "Auto API base URL").action(async (sessionId, commandOptions) => {
|
|
39995
40064
|
await handleRunsCommands(context, sessionId, commandOptions);
|
|
39996
40065
|
});
|
|
@@ -40023,6 +40092,13 @@ function registerSessionCommands(program, context) {
|
|
|
40023
40092
|
await stopSessionsAction(context, sessionIds, commandOptions);
|
|
40024
40093
|
}
|
|
40025
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
|
+
);
|
|
40026
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(
|
|
40027
40103
|
"--interactive",
|
|
40028
40104
|
"start without the default initial prompt unless --message is provided"
|