@autohq/cli 0.1.310 → 0.1.312
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 +203 -10
- package/dist/index.js +239 -26
- package/package.json +1 -1
package/dist/agent-bridge.js
CHANGED
|
@@ -19574,12 +19574,36 @@ var AgentBridgeHarnessBaseConfigSchema = external_exports.object({
|
|
|
19574
19574
|
// user message. Optional and strip-tolerant per the skew contract.
|
|
19575
19575
|
systemPromptAppend: external_exports.string().trim().min(1).optional()
|
|
19576
19576
|
});
|
|
19577
|
-
var
|
|
19577
|
+
var AgentBridgeModelSelectionSchema = external_exports.object({
|
|
19578
|
+
provider: external_exports.string().trim().min(1),
|
|
19579
|
+
id: external_exports.string().trim().min(1)
|
|
19580
|
+
});
|
|
19581
|
+
var AgentBridgeClaudeReasoningEffortSchema = external_exports.enum([
|
|
19582
|
+
"low",
|
|
19583
|
+
"medium",
|
|
19584
|
+
"high",
|
|
19585
|
+
"xhigh",
|
|
19586
|
+
"max"
|
|
19587
|
+
]);
|
|
19588
|
+
var AgentBridgeCodexReasoningEffortSchema = external_exports.enum([
|
|
19589
|
+
"minimal",
|
|
19590
|
+
"low",
|
|
19591
|
+
"medium",
|
|
19592
|
+
"high"
|
|
19593
|
+
]);
|
|
19594
|
+
var AgentBridgeClaudeConfigSchema = AgentBridgeHarnessBaseConfigSchema.extend({
|
|
19595
|
+
model: AgentBridgeModelSelectionSchema.optional(),
|
|
19596
|
+
reasoningEffort: AgentBridgeClaudeReasoningEffortSchema.optional()
|
|
19597
|
+
});
|
|
19598
|
+
var AgentBridgeCodexConfigSchema = AgentBridgeHarnessBaseConfigSchema.extend({
|
|
19599
|
+
model: AgentBridgeModelSelectionSchema.optional(),
|
|
19600
|
+
reasoningEffort: AgentBridgeCodexReasoningEffortSchema.optional()
|
|
19601
|
+
});
|
|
19578
19602
|
var AgentBridgeHarnessConfigSchema = external_exports.discriminatedUnion("kind", [
|
|
19579
|
-
|
|
19603
|
+
AgentBridgeClaudeConfigSchema.extend({
|
|
19580
19604
|
kind: external_exports.literal("claude-code")
|
|
19581
19605
|
}),
|
|
19582
|
-
|
|
19606
|
+
AgentBridgeCodexConfigSchema.extend({
|
|
19583
19607
|
kind: external_exports.literal("codex")
|
|
19584
19608
|
})
|
|
19585
19609
|
]);
|
|
@@ -23407,7 +23431,7 @@ Object.assign(lookup, {
|
|
|
23407
23431
|
// package.json
|
|
23408
23432
|
var package_default = {
|
|
23409
23433
|
name: "@autohq/cli",
|
|
23410
|
-
version: "0.1.
|
|
23434
|
+
version: "0.1.312",
|
|
23411
23435
|
license: "SEE LICENSE IN README.md",
|
|
23412
23436
|
publishConfig: {
|
|
23413
23437
|
access: "public"
|
|
@@ -25207,6 +25231,156 @@ function parseApprovalRequest(method, requestId, params) {
|
|
|
25207
25231
|
}
|
|
25208
25232
|
}
|
|
25209
25233
|
|
|
25234
|
+
// ../../packages/schemas/src/model-selection.ts
|
|
25235
|
+
var MODEL_API_TOKEN_PROVIDERS = [
|
|
25236
|
+
"anthropic",
|
|
25237
|
+
"openai",
|
|
25238
|
+
"openrouter"
|
|
25239
|
+
];
|
|
25240
|
+
var ModelApiTokenProviderSchema = external_exports.enum(MODEL_API_TOKEN_PROVIDERS);
|
|
25241
|
+
var CLAUDE_CODE_REASONING_EFFORTS = [
|
|
25242
|
+
"low",
|
|
25243
|
+
"medium",
|
|
25244
|
+
"high",
|
|
25245
|
+
"xhigh",
|
|
25246
|
+
"max"
|
|
25247
|
+
];
|
|
25248
|
+
var CODEX_REASONING_EFFORTS = [
|
|
25249
|
+
"minimal",
|
|
25250
|
+
"low",
|
|
25251
|
+
"medium",
|
|
25252
|
+
"high"
|
|
25253
|
+
];
|
|
25254
|
+
var ClaudeCodeReasoningEffortSchema = external_exports.enum(
|
|
25255
|
+
CLAUDE_CODE_REASONING_EFFORTS
|
|
25256
|
+
);
|
|
25257
|
+
var CodexReasoningEffortSchema = external_exports.enum(CODEX_REASONING_EFFORTS);
|
|
25258
|
+
var AgentReasoningEffortSchema = external_exports.enum([
|
|
25259
|
+
"minimal",
|
|
25260
|
+
"low",
|
|
25261
|
+
"medium",
|
|
25262
|
+
"high",
|
|
25263
|
+
"xhigh",
|
|
25264
|
+
"max"
|
|
25265
|
+
]);
|
|
25266
|
+
var OPENROUTER_MODEL_SLUG_PATTERN = /^[A-Za-z0-9][A-Za-z0-9_.-]*(?:\/[A-Za-z0-9][A-Za-z0-9_.:-]*)+$/;
|
|
25267
|
+
var AgentModelSelectionSchema = external_exports.object({
|
|
25268
|
+
provider: ModelApiTokenProviderSchema.optional(),
|
|
25269
|
+
id: external_exports.string().trim().min(1).max(256)
|
|
25270
|
+
}).strict();
|
|
25271
|
+
var ResolvedAgentModelSelectionSchema = AgentModelSelectionSchema.extend({
|
|
25272
|
+
provider: ModelApiTokenProviderSchema
|
|
25273
|
+
});
|
|
25274
|
+
var HARNESS_MODEL_RULES = {
|
|
25275
|
+
"claude-code": {
|
|
25276
|
+
defaultProvider: "anthropic",
|
|
25277
|
+
providers: ["anthropic"],
|
|
25278
|
+
defaultModel: "fable",
|
|
25279
|
+
curatedModels: {
|
|
25280
|
+
anthropic: [
|
|
25281
|
+
"fable",
|
|
25282
|
+
"claude-fable-5",
|
|
25283
|
+
"claude-opus-4-8",
|
|
25284
|
+
"claude-opus-4-7",
|
|
25285
|
+
"claude-opus-4-6",
|
|
25286
|
+
"claude-sonnet-4-6",
|
|
25287
|
+
"claude-haiku-4-5",
|
|
25288
|
+
"claude-haiku-4-5-20251001"
|
|
25289
|
+
]
|
|
25290
|
+
},
|
|
25291
|
+
openProviderPatterns: {},
|
|
25292
|
+
reasoningEfforts: CLAUDE_CODE_REASONING_EFFORTS
|
|
25293
|
+
},
|
|
25294
|
+
codex: {
|
|
25295
|
+
defaultProvider: "openai",
|
|
25296
|
+
providers: ["openai", "openrouter"],
|
|
25297
|
+
defaultModel: "gpt-5.3-codex",
|
|
25298
|
+
curatedModels: {
|
|
25299
|
+
openai: ["gpt-5.3-codex"]
|
|
25300
|
+
},
|
|
25301
|
+
openProviderPatterns: {
|
|
25302
|
+
openrouter: OPENROUTER_MODEL_SLUG_PATTERN
|
|
25303
|
+
},
|
|
25304
|
+
reasoningEfforts: CODEX_REASONING_EFFORTS
|
|
25305
|
+
}
|
|
25306
|
+
};
|
|
25307
|
+
function modelRulesForHarness(harness) {
|
|
25308
|
+
return HARNESS_MODEL_RULES[harness];
|
|
25309
|
+
}
|
|
25310
|
+
function resolveModelSelectionForHarness(harness, selection) {
|
|
25311
|
+
const rules = modelRulesForHarness(harness);
|
|
25312
|
+
const provider = selection?.provider ?? rules.defaultProvider;
|
|
25313
|
+
const id = selection?.id ?? rules.defaultModel;
|
|
25314
|
+
validateModelProviderForHarness(harness, provider);
|
|
25315
|
+
validateModelIdForProvider({ harness, provider, id });
|
|
25316
|
+
return { provider, id };
|
|
25317
|
+
}
|
|
25318
|
+
function validateReasoningEffortForHarness(input) {
|
|
25319
|
+
if (!input.reasoningEffort) {
|
|
25320
|
+
return;
|
|
25321
|
+
}
|
|
25322
|
+
const rules = modelRulesForHarness(input.harness);
|
|
25323
|
+
if (!rules.reasoningEfforts.includes(input.reasoningEffort)) {
|
|
25324
|
+
throw new Error(
|
|
25325
|
+
`${input.harness} does not support reasoning effort "${input.reasoningEffort}"`
|
|
25326
|
+
);
|
|
25327
|
+
}
|
|
25328
|
+
}
|
|
25329
|
+
function validateAgentModelFieldsForHarness(spec, context) {
|
|
25330
|
+
const harness = spec.harness;
|
|
25331
|
+
if (harness !== "claude-code" && harness !== "codex") {
|
|
25332
|
+
return;
|
|
25333
|
+
}
|
|
25334
|
+
if (spec.model) {
|
|
25335
|
+
try {
|
|
25336
|
+
resolveModelSelectionForHarness(harness, spec.model);
|
|
25337
|
+
} catch (error51) {
|
|
25338
|
+
context.addIssue({
|
|
25339
|
+
code: external_exports.ZodIssueCode.custom,
|
|
25340
|
+
path: ["model"],
|
|
25341
|
+
message: error51 instanceof Error ? error51.message : String(error51)
|
|
25342
|
+
});
|
|
25343
|
+
}
|
|
25344
|
+
}
|
|
25345
|
+
try {
|
|
25346
|
+
validateReasoningEffortForHarness({
|
|
25347
|
+
harness,
|
|
25348
|
+
reasoningEffort: spec.reasoningEffort
|
|
25349
|
+
});
|
|
25350
|
+
} catch (error51) {
|
|
25351
|
+
context.addIssue({
|
|
25352
|
+
code: external_exports.ZodIssueCode.custom,
|
|
25353
|
+
path: ["reasoningEffort"],
|
|
25354
|
+
message: error51 instanceof Error ? error51.message : String(error51)
|
|
25355
|
+
});
|
|
25356
|
+
}
|
|
25357
|
+
}
|
|
25358
|
+
function validateModelProviderForHarness(harness, provider) {
|
|
25359
|
+
const rules = modelRulesForHarness(harness);
|
|
25360
|
+
if (!rules.providers.includes(provider)) {
|
|
25361
|
+
throw new Error(`${harness} does not support ${provider} models`);
|
|
25362
|
+
}
|
|
25363
|
+
}
|
|
25364
|
+
function validateModelIdForProvider(input) {
|
|
25365
|
+
const rules = modelRulesForHarness(input.harness);
|
|
25366
|
+
const curated = rules.curatedModels[input.provider];
|
|
25367
|
+
if (curated?.includes(input.id)) {
|
|
25368
|
+
return;
|
|
25369
|
+
}
|
|
25370
|
+
const pattern = rules.openProviderPatterns[input.provider];
|
|
25371
|
+
if (pattern?.test(input.id)) {
|
|
25372
|
+
return;
|
|
25373
|
+
}
|
|
25374
|
+
if (curated) {
|
|
25375
|
+
throw new Error(
|
|
25376
|
+
`${input.provider} model "${input.id}" is not available for ${input.harness}`
|
|
25377
|
+
);
|
|
25378
|
+
}
|
|
25379
|
+
throw new Error(
|
|
25380
|
+
`${input.provider} model ids are not open for ${input.harness}`
|
|
25381
|
+
);
|
|
25382
|
+
}
|
|
25383
|
+
|
|
25210
25384
|
// ../../packages/schemas/src/resources.ts
|
|
25211
25385
|
var ResourceNameSchema = external_exports.string().trim().min(1).max(128).regex(/^[A-Za-z0-9_.-]+$/);
|
|
25212
25386
|
var StringMapSchema = external_exports.record(external_exports.string().min(1), external_exports.string());
|
|
@@ -25360,8 +25534,6 @@ var TelegramConnectionCreateResponseSchema = external_exports.discriminatedUnion
|
|
|
25360
25534
|
})
|
|
25361
25535
|
]
|
|
25362
25536
|
);
|
|
25363
|
-
var MODEL_API_TOKEN_PROVIDERS = ["anthropic", "openai"];
|
|
25364
|
-
var ModelApiTokenProviderSchema = external_exports.enum(MODEL_API_TOKEN_PROVIDERS);
|
|
25365
25537
|
var ModelProviderConnectionCreateRequestSchema = external_exports.object({
|
|
25366
25538
|
organizationId: OrganizationIdSchema.optional(),
|
|
25367
25539
|
provider: ModelApiTokenProviderSchema,
|
|
@@ -26421,6 +26593,8 @@ var AgentIdentitySchema = external_exports.object({
|
|
|
26421
26593
|
});
|
|
26422
26594
|
var AgentSpecFieldsSchema = external_exports.object({
|
|
26423
26595
|
harness: external_exports.enum(AGENT_HARNESSES).optional(),
|
|
26596
|
+
model: AgentModelSelectionSchema.optional(),
|
|
26597
|
+
reasoningEffort: AgentReasoningEffortSchema.optional(),
|
|
26424
26598
|
systemPrompt: external_exports.string().trim().min(1).max(1e5).optional(),
|
|
26425
26599
|
environment: ResourceNameSchema.optional(),
|
|
26426
26600
|
identity: external_exports.union([ResourceNameSchema, AgentIdentitySchema]).optional(),
|
|
@@ -26450,13 +26624,19 @@ function validateRunnableConfig(spec, context) {
|
|
|
26450
26624
|
}
|
|
26451
26625
|
}
|
|
26452
26626
|
var AgentSpecSchema = AgentSpecFieldsSchema.superRefine(
|
|
26453
|
-
|
|
26627
|
+
(spec, context) => {
|
|
26628
|
+
validateRunnableConfig(spec, context);
|
|
26629
|
+
validateAgentModelFieldsForHarness(spec, context);
|
|
26630
|
+
}
|
|
26454
26631
|
);
|
|
26455
26632
|
var AgentApplySpecSchema = AgentSpecFieldsSchema.extend({
|
|
26456
26633
|
initialPrompt: templateField("authoring"),
|
|
26457
26634
|
displayTitle: displayTitleField("authoring"),
|
|
26458
26635
|
triggers: ApplyTriggersSchema.default([])
|
|
26459
|
-
}).superRefine(
|
|
26636
|
+
}).superRefine((spec, context) => {
|
|
26637
|
+
validateRunnableConfig(spec, context);
|
|
26638
|
+
validateAgentModelFieldsForHarness(spec, context);
|
|
26639
|
+
});
|
|
26460
26640
|
var AgentStatusSchema = external_exports.object({
|
|
26461
26641
|
runCount: external_exports.number().int().nonnegative().default(0),
|
|
26462
26642
|
lastActivityAt: external_exports.string().datetime().nullable().default(null)
|
|
@@ -26919,6 +27099,8 @@ var RunMessageCommandPayloadSchema = external_exports.object({
|
|
|
26919
27099
|
// lives where the value is consumed rather than as a required field every
|
|
26920
27100
|
// call site must construct.
|
|
26921
27101
|
deliveryMode: MessageDeliveryModeSchema.optional(),
|
|
27102
|
+
model: AgentModelSelectionSchema.optional(),
|
|
27103
|
+
reasoningEffort: AgentReasoningEffortSchema.optional(),
|
|
26922
27104
|
metadata: JsonValueSchema2.optional()
|
|
26923
27105
|
}).strict();
|
|
26924
27106
|
var RunAnswerCommandPayloadSchema = external_exports.object({
|
|
@@ -26943,6 +27125,8 @@ var SessionCommandPayloadSchema = external_exports.union([
|
|
|
26943
27125
|
]);
|
|
26944
27126
|
var CreateRunMessageCommandRequestSchema = external_exports.object({
|
|
26945
27127
|
message: external_exports.string().trim().min(1),
|
|
27128
|
+
model: AgentModelSelectionSchema.optional(),
|
|
27129
|
+
reasoningEffort: AgentReasoningEffortSchema.optional(),
|
|
26946
27130
|
metadata: JsonValueSchema2.optional()
|
|
26947
27131
|
});
|
|
26948
27132
|
var CreateRunAnswerCommandRequestSchema = RunAnswerCommandPayloadSchema;
|
|
@@ -27015,7 +27199,9 @@ var RunStartCommandPayloadSchema = external_exports.object({
|
|
|
27015
27199
|
}).strict();
|
|
27016
27200
|
var RunStartWithMessageCommandPayloadSchema = external_exports.object({
|
|
27017
27201
|
kind: external_exports.literal("startWithMessage"),
|
|
27018
|
-
message: external_exports.string().trim().min(1)
|
|
27202
|
+
message: external_exports.string().trim().min(1),
|
|
27203
|
+
model: AgentModelSelectionSchema.optional(),
|
|
27204
|
+
reasoningEffort: AgentReasoningEffortSchema.optional()
|
|
27019
27205
|
}).strict();
|
|
27020
27206
|
var SessionPersistedCommandPayloadSchema = external_exports.union([
|
|
27021
27207
|
RunMessageCommandPayloadSchema,
|
|
@@ -27065,7 +27251,9 @@ var SessionCommandRecordSchema = external_exports.discriminatedUnion("kind", [
|
|
|
27065
27251
|
]);
|
|
27066
27252
|
var SessionDispatchMessageCommandPayloadSchema = external_exports.object({
|
|
27067
27253
|
kind: external_exports.literal("message"),
|
|
27068
|
-
message: external_exports.string().trim().min(1)
|
|
27254
|
+
message: external_exports.string().trim().min(1),
|
|
27255
|
+
model: AgentModelSelectionSchema.optional(),
|
|
27256
|
+
reasoningEffort: AgentReasoningEffortSchema.optional()
|
|
27069
27257
|
}).strict();
|
|
27070
27258
|
var SessionDispatchAnswerCommandPayloadSchema = external_exports.object({
|
|
27071
27259
|
kind: external_exports.literal("answer"),
|
|
@@ -27199,6 +27387,11 @@ var SessionRecordSchema = external_exports.object({
|
|
|
27199
27387
|
displayTitle: RunDisplayTitleSchema,
|
|
27200
27388
|
ambientStatus: AmbientStatusSchema.nullable(),
|
|
27201
27389
|
ambientStatusUpdatedAt: external_exports.string().datetime().nullable(),
|
|
27390
|
+
// Defaulted, not just nullable: session.upsert payloads persisted before
|
|
27391
|
+
// these fields shipped lack the keys, and replay-path parsing must keep
|
|
27392
|
+
// accepting them (additive, skew-tolerant rollout).
|
|
27393
|
+
model: ResolvedAgentModelSelectionSchema.nullable().default(null),
|
|
27394
|
+
reasoningEffort: external_exports.string().trim().min(1).nullable().default(null),
|
|
27202
27395
|
starterActor: AuthActorSchema.nullable(),
|
|
27203
27396
|
snapshot: AgentResourceSchema,
|
|
27204
27397
|
environmentSnapshot: EnvironmentResourceSchema,
|
package/dist/index.js
CHANGED
|
@@ -16676,6 +16676,163 @@ var init_conversation_reducer = __esm({
|
|
|
16676
16676
|
}
|
|
16677
16677
|
});
|
|
16678
16678
|
|
|
16679
|
+
// ../../packages/schemas/src/model-selection.ts
|
|
16680
|
+
function modelRulesForHarness(harness) {
|
|
16681
|
+
return HARNESS_MODEL_RULES[harness];
|
|
16682
|
+
}
|
|
16683
|
+
function resolveModelSelectionForHarness(harness, selection) {
|
|
16684
|
+
const rules = modelRulesForHarness(harness);
|
|
16685
|
+
const provider = selection?.provider ?? rules.defaultProvider;
|
|
16686
|
+
const id = selection?.id ?? rules.defaultModel;
|
|
16687
|
+
validateModelProviderForHarness(harness, provider);
|
|
16688
|
+
validateModelIdForProvider({ harness, provider, id });
|
|
16689
|
+
return { provider, id };
|
|
16690
|
+
}
|
|
16691
|
+
function validateReasoningEffortForHarness(input) {
|
|
16692
|
+
if (!input.reasoningEffort) {
|
|
16693
|
+
return;
|
|
16694
|
+
}
|
|
16695
|
+
const rules = modelRulesForHarness(input.harness);
|
|
16696
|
+
if (!rules.reasoningEfforts.includes(input.reasoningEffort)) {
|
|
16697
|
+
throw new Error(
|
|
16698
|
+
`${input.harness} does not support reasoning effort "${input.reasoningEffort}"`
|
|
16699
|
+
);
|
|
16700
|
+
}
|
|
16701
|
+
}
|
|
16702
|
+
function validateAgentModelFieldsForHarness(spec, context) {
|
|
16703
|
+
const harness = spec.harness;
|
|
16704
|
+
if (harness !== "claude-code" && harness !== "codex") {
|
|
16705
|
+
return;
|
|
16706
|
+
}
|
|
16707
|
+
if (spec.model) {
|
|
16708
|
+
try {
|
|
16709
|
+
resolveModelSelectionForHarness(harness, spec.model);
|
|
16710
|
+
} catch (error51) {
|
|
16711
|
+
context.addIssue({
|
|
16712
|
+
code: external_exports.ZodIssueCode.custom,
|
|
16713
|
+
path: ["model"],
|
|
16714
|
+
message: error51 instanceof Error ? error51.message : String(error51)
|
|
16715
|
+
});
|
|
16716
|
+
}
|
|
16717
|
+
}
|
|
16718
|
+
try {
|
|
16719
|
+
validateReasoningEffortForHarness({
|
|
16720
|
+
harness,
|
|
16721
|
+
reasoningEffort: spec.reasoningEffort
|
|
16722
|
+
});
|
|
16723
|
+
} catch (error51) {
|
|
16724
|
+
context.addIssue({
|
|
16725
|
+
code: external_exports.ZodIssueCode.custom,
|
|
16726
|
+
path: ["reasoningEffort"],
|
|
16727
|
+
message: error51 instanceof Error ? error51.message : String(error51)
|
|
16728
|
+
});
|
|
16729
|
+
}
|
|
16730
|
+
}
|
|
16731
|
+
function validateModelProviderForHarness(harness, provider) {
|
|
16732
|
+
const rules = modelRulesForHarness(harness);
|
|
16733
|
+
if (!rules.providers.includes(provider)) {
|
|
16734
|
+
throw new Error(`${harness} does not support ${provider} models`);
|
|
16735
|
+
}
|
|
16736
|
+
}
|
|
16737
|
+
function validateModelIdForProvider(input) {
|
|
16738
|
+
const rules = modelRulesForHarness(input.harness);
|
|
16739
|
+
const curated = rules.curatedModels[input.provider];
|
|
16740
|
+
if (curated?.includes(input.id)) {
|
|
16741
|
+
return;
|
|
16742
|
+
}
|
|
16743
|
+
const pattern = rules.openProviderPatterns[input.provider];
|
|
16744
|
+
if (pattern?.test(input.id)) {
|
|
16745
|
+
return;
|
|
16746
|
+
}
|
|
16747
|
+
if (curated) {
|
|
16748
|
+
throw new Error(
|
|
16749
|
+
`${input.provider} model "${input.id}" is not available for ${input.harness}`
|
|
16750
|
+
);
|
|
16751
|
+
}
|
|
16752
|
+
throw new Error(
|
|
16753
|
+
`${input.provider} model ids are not open for ${input.harness}`
|
|
16754
|
+
);
|
|
16755
|
+
}
|
|
16756
|
+
var MODEL_API_TOKEN_PROVIDERS, ModelApiTokenProviderSchema, CLAUDE_CODE_REASONING_EFFORTS, CODEX_REASONING_EFFORTS, ClaudeCodeReasoningEffortSchema, CodexReasoningEffortSchema, AgentReasoningEffortSchema, OPENROUTER_MODEL_SLUG_PATTERN, AgentModelSelectionSchema, ResolvedAgentModelSelectionSchema, HARNESS_MODEL_RULES;
|
|
16757
|
+
var init_model_selection = __esm({
|
|
16758
|
+
"../../packages/schemas/src/model-selection.ts"() {
|
|
16759
|
+
"use strict";
|
|
16760
|
+
init_zod();
|
|
16761
|
+
MODEL_API_TOKEN_PROVIDERS = [
|
|
16762
|
+
"anthropic",
|
|
16763
|
+
"openai",
|
|
16764
|
+
"openrouter"
|
|
16765
|
+
];
|
|
16766
|
+
ModelApiTokenProviderSchema = external_exports.enum(MODEL_API_TOKEN_PROVIDERS);
|
|
16767
|
+
CLAUDE_CODE_REASONING_EFFORTS = [
|
|
16768
|
+
"low",
|
|
16769
|
+
"medium",
|
|
16770
|
+
"high",
|
|
16771
|
+
"xhigh",
|
|
16772
|
+
"max"
|
|
16773
|
+
];
|
|
16774
|
+
CODEX_REASONING_EFFORTS = [
|
|
16775
|
+
"minimal",
|
|
16776
|
+
"low",
|
|
16777
|
+
"medium",
|
|
16778
|
+
"high"
|
|
16779
|
+
];
|
|
16780
|
+
ClaudeCodeReasoningEffortSchema = external_exports.enum(
|
|
16781
|
+
CLAUDE_CODE_REASONING_EFFORTS
|
|
16782
|
+
);
|
|
16783
|
+
CodexReasoningEffortSchema = external_exports.enum(CODEX_REASONING_EFFORTS);
|
|
16784
|
+
AgentReasoningEffortSchema = external_exports.enum([
|
|
16785
|
+
"minimal",
|
|
16786
|
+
"low",
|
|
16787
|
+
"medium",
|
|
16788
|
+
"high",
|
|
16789
|
+
"xhigh",
|
|
16790
|
+
"max"
|
|
16791
|
+
]);
|
|
16792
|
+
OPENROUTER_MODEL_SLUG_PATTERN = /^[A-Za-z0-9][A-Za-z0-9_.-]*(?:\/[A-Za-z0-9][A-Za-z0-9_.:-]*)+$/;
|
|
16793
|
+
AgentModelSelectionSchema = external_exports.object({
|
|
16794
|
+
provider: ModelApiTokenProviderSchema.optional(),
|
|
16795
|
+
id: external_exports.string().trim().min(1).max(256)
|
|
16796
|
+
}).strict();
|
|
16797
|
+
ResolvedAgentModelSelectionSchema = AgentModelSelectionSchema.extend({
|
|
16798
|
+
provider: ModelApiTokenProviderSchema
|
|
16799
|
+
});
|
|
16800
|
+
HARNESS_MODEL_RULES = {
|
|
16801
|
+
"claude-code": {
|
|
16802
|
+
defaultProvider: "anthropic",
|
|
16803
|
+
providers: ["anthropic"],
|
|
16804
|
+
defaultModel: "fable",
|
|
16805
|
+
curatedModels: {
|
|
16806
|
+
anthropic: [
|
|
16807
|
+
"fable",
|
|
16808
|
+
"claude-fable-5",
|
|
16809
|
+
"claude-opus-4-8",
|
|
16810
|
+
"claude-opus-4-7",
|
|
16811
|
+
"claude-opus-4-6",
|
|
16812
|
+
"claude-sonnet-4-6",
|
|
16813
|
+
"claude-haiku-4-5",
|
|
16814
|
+
"claude-haiku-4-5-20251001"
|
|
16815
|
+
]
|
|
16816
|
+
},
|
|
16817
|
+
openProviderPatterns: {},
|
|
16818
|
+
reasoningEfforts: CLAUDE_CODE_REASONING_EFFORTS
|
|
16819
|
+
},
|
|
16820
|
+
codex: {
|
|
16821
|
+
defaultProvider: "openai",
|
|
16822
|
+
providers: ["openai", "openrouter"],
|
|
16823
|
+
defaultModel: "gpt-5.3-codex",
|
|
16824
|
+
curatedModels: {
|
|
16825
|
+
openai: ["gpt-5.3-codex"]
|
|
16826
|
+
},
|
|
16827
|
+
openProviderPatterns: {
|
|
16828
|
+
openrouter: OPENROUTER_MODEL_SLUG_PATTERN
|
|
16829
|
+
},
|
|
16830
|
+
reasoningEfforts: CODEX_REASONING_EFFORTS
|
|
16831
|
+
}
|
|
16832
|
+
};
|
|
16833
|
+
}
|
|
16834
|
+
});
|
|
16835
|
+
|
|
16679
16836
|
// ../../packages/schemas/src/resources.ts
|
|
16680
16837
|
function resourceEnvelopeSchema(spec) {
|
|
16681
16838
|
return external_exports.object({
|
|
@@ -16718,12 +16875,13 @@ var init_resources = __esm({
|
|
|
16718
16875
|
});
|
|
16719
16876
|
|
|
16720
16877
|
// ../../packages/schemas/src/connections.ts
|
|
16721
|
-
var RESOURCE_KIND_CONNECTION, ConnectionNameSchema, ProviderConnectionReferenceSchema, ProjectConnectionAllocationSpecSchema, ProjectConnectionAllocationResourceSchema, GithubConnectionAccountSchema, GithubConnectionRepositorySchema, GITHUB_CONNECTION_EVENTS, GithubConnectionEventSchema, GithubConnectionSpecSchema, ConnectionSpecSchema, ConnectionResourceSchema, ConnectionApplyRequestSchema, ConnectionStartRequestSchema, ConnectionProviderDescriptorSchema, ConnectionProviderListResponseSchema, ConnectionStartResponseSchema, TelegramConnectionCreateRequestSchema, TelegramManagerBotSummarySchema, TelegramConnectionCreateResponseSchema,
|
|
16878
|
+
var RESOURCE_KIND_CONNECTION, ConnectionNameSchema, ProviderConnectionReferenceSchema, ProjectConnectionAllocationSpecSchema, ProjectConnectionAllocationResourceSchema, GithubConnectionAccountSchema, GithubConnectionRepositorySchema, GITHUB_CONNECTION_EVENTS, GithubConnectionEventSchema, GithubConnectionSpecSchema, ConnectionSpecSchema, ConnectionResourceSchema, ConnectionApplyRequestSchema, ConnectionStartRequestSchema, ConnectionProviderDescriptorSchema, ConnectionProviderListResponseSchema, ConnectionStartResponseSchema, TelegramConnectionCreateRequestSchema, TelegramManagerBotSummarySchema, TelegramConnectionCreateResponseSchema, ModelProviderConnectionCreateRequestSchema, ModelProviderConnectionCreateResponseSchema, ConnectionAllowRequestSchema, SlackConfigTokenRegisterRequestSchema, SlackConfigTokenRegisterResponseSchema, ConnectionAllowResponseSchema, ConnectionRemoveRequestSchema, ConnectionRemoveResponseSchema;
|
|
16722
16879
|
var init_connections = __esm({
|
|
16723
16880
|
"../../packages/schemas/src/connections.ts"() {
|
|
16724
16881
|
"use strict";
|
|
16725
16882
|
init_zod();
|
|
16726
16883
|
init_ids();
|
|
16884
|
+
init_model_selection();
|
|
16727
16885
|
init_provider_grants();
|
|
16728
16886
|
init_resources();
|
|
16729
16887
|
RESOURCE_KIND_CONNECTION = "connection";
|
|
@@ -16845,8 +17003,6 @@ var init_connections = __esm({
|
|
|
16845
17003
|
})
|
|
16846
17004
|
]
|
|
16847
17005
|
);
|
|
16848
|
-
MODEL_API_TOKEN_PROVIDERS = ["anthropic", "openai"];
|
|
16849
|
-
ModelApiTokenProviderSchema = external_exports.enum(MODEL_API_TOKEN_PROVIDERS);
|
|
16850
17006
|
ModelProviderConnectionCreateRequestSchema = external_exports.object({
|
|
16851
17007
|
organizationId: OrganizationIdSchema.optional(),
|
|
16852
17008
|
provider: ModelApiTokenProviderSchema,
|
|
@@ -18016,6 +18172,7 @@ var init_agents = __esm({
|
|
|
18016
18172
|
"use strict";
|
|
18017
18173
|
init_zod();
|
|
18018
18174
|
init_connections();
|
|
18175
|
+
init_model_selection();
|
|
18019
18176
|
init_mounts();
|
|
18020
18177
|
init_primitives();
|
|
18021
18178
|
init_resources();
|
|
@@ -18181,6 +18338,8 @@ var init_agents = __esm({
|
|
|
18181
18338
|
});
|
|
18182
18339
|
AgentSpecFieldsSchema = external_exports.object({
|
|
18183
18340
|
harness: external_exports.enum(AGENT_HARNESSES).optional(),
|
|
18341
|
+
model: AgentModelSelectionSchema.optional(),
|
|
18342
|
+
reasoningEffort: AgentReasoningEffortSchema.optional(),
|
|
18184
18343
|
systemPrompt: external_exports.string().trim().min(1).max(1e5).optional(),
|
|
18185
18344
|
environment: ResourceNameSchema.optional(),
|
|
18186
18345
|
identity: external_exports.union([ResourceNameSchema, AgentIdentitySchema]).optional(),
|
|
@@ -18194,13 +18353,19 @@ var init_agents = __esm({
|
|
|
18194
18353
|
tools: AgentToolsSchema.default({})
|
|
18195
18354
|
});
|
|
18196
18355
|
AgentSpecSchema = AgentSpecFieldsSchema.superRefine(
|
|
18197
|
-
|
|
18356
|
+
(spec, context) => {
|
|
18357
|
+
validateRunnableConfig(spec, context);
|
|
18358
|
+
validateAgentModelFieldsForHarness(spec, context);
|
|
18359
|
+
}
|
|
18198
18360
|
);
|
|
18199
18361
|
AgentApplySpecSchema = AgentSpecFieldsSchema.extend({
|
|
18200
18362
|
initialPrompt: templateField("authoring"),
|
|
18201
18363
|
displayTitle: displayTitleField("authoring"),
|
|
18202
18364
|
triggers: ApplyTriggersSchema.default([])
|
|
18203
|
-
}).superRefine(
|
|
18365
|
+
}).superRefine((spec, context) => {
|
|
18366
|
+
validateRunnableConfig(spec, context);
|
|
18367
|
+
validateAgentModelFieldsForHarness(spec, context);
|
|
18368
|
+
});
|
|
18204
18369
|
AgentStatusSchema = external_exports.object({
|
|
18205
18370
|
runCount: external_exports.number().int().nonnegative().default(0),
|
|
18206
18371
|
lastActivityAt: external_exports.string().datetime().nullable().default(null)
|
|
@@ -18478,6 +18643,7 @@ var init_session_commands = __esm({
|
|
|
18478
18643
|
init_zod();
|
|
18479
18644
|
init_auth();
|
|
18480
18645
|
init_ids();
|
|
18646
|
+
init_model_selection();
|
|
18481
18647
|
init_primitives();
|
|
18482
18648
|
init_singleton_refresh();
|
|
18483
18649
|
SESSION_COMMAND_KINDS = [
|
|
@@ -18575,6 +18741,8 @@ var init_session_commands = __esm({
|
|
|
18575
18741
|
// lives where the value is consumed rather than as a required field every
|
|
18576
18742
|
// call site must construct.
|
|
18577
18743
|
deliveryMode: MessageDeliveryModeSchema.optional(),
|
|
18744
|
+
model: AgentModelSelectionSchema.optional(),
|
|
18745
|
+
reasoningEffort: AgentReasoningEffortSchema.optional(),
|
|
18578
18746
|
metadata: JsonValueSchema.optional()
|
|
18579
18747
|
}).strict();
|
|
18580
18748
|
RunAnswerCommandPayloadSchema = external_exports.object({
|
|
@@ -18599,6 +18767,8 @@ var init_session_commands = __esm({
|
|
|
18599
18767
|
]);
|
|
18600
18768
|
CreateRunMessageCommandRequestSchema = external_exports.object({
|
|
18601
18769
|
message: external_exports.string().trim().min(1),
|
|
18770
|
+
model: AgentModelSelectionSchema.optional(),
|
|
18771
|
+
reasoningEffort: AgentReasoningEffortSchema.optional(),
|
|
18602
18772
|
metadata: JsonValueSchema.optional()
|
|
18603
18773
|
});
|
|
18604
18774
|
CreateRunAnswerCommandRequestSchema = RunAnswerCommandPayloadSchema;
|
|
@@ -18671,7 +18841,9 @@ var init_session_commands = __esm({
|
|
|
18671
18841
|
}).strict();
|
|
18672
18842
|
RunStartWithMessageCommandPayloadSchema = external_exports.object({
|
|
18673
18843
|
kind: external_exports.literal("startWithMessage"),
|
|
18674
|
-
message: external_exports.string().trim().min(1)
|
|
18844
|
+
message: external_exports.string().trim().min(1),
|
|
18845
|
+
model: AgentModelSelectionSchema.optional(),
|
|
18846
|
+
reasoningEffort: AgentReasoningEffortSchema.optional()
|
|
18675
18847
|
}).strict();
|
|
18676
18848
|
SessionPersistedCommandPayloadSchema = external_exports.union([
|
|
18677
18849
|
RunMessageCommandPayloadSchema,
|
|
@@ -18721,7 +18893,9 @@ var init_session_commands = __esm({
|
|
|
18721
18893
|
]);
|
|
18722
18894
|
SessionDispatchMessageCommandPayloadSchema = external_exports.object({
|
|
18723
18895
|
kind: external_exports.literal("message"),
|
|
18724
|
-
message: external_exports.string().trim().min(1)
|
|
18896
|
+
message: external_exports.string().trim().min(1),
|
|
18897
|
+
model: AgentModelSelectionSchema.optional(),
|
|
18898
|
+
reasoningEffort: AgentReasoningEffortSchema.optional()
|
|
18725
18899
|
}).strict();
|
|
18726
18900
|
SessionDispatchAnswerCommandPayloadSchema = external_exports.object({
|
|
18727
18901
|
kind: external_exports.literal("answer"),
|
|
@@ -18798,6 +18972,7 @@ var init_sessions = __esm({
|
|
|
18798
18972
|
init_auth();
|
|
18799
18973
|
init_environments();
|
|
18800
18974
|
init_ids();
|
|
18975
|
+
init_model_selection();
|
|
18801
18976
|
init_primitives();
|
|
18802
18977
|
init_session_commands();
|
|
18803
18978
|
init_tools();
|
|
@@ -18875,6 +19050,11 @@ var init_sessions = __esm({
|
|
|
18875
19050
|
displayTitle: RunDisplayTitleSchema,
|
|
18876
19051
|
ambientStatus: AmbientStatusSchema.nullable(),
|
|
18877
19052
|
ambientStatusUpdatedAt: external_exports.string().datetime().nullable(),
|
|
19053
|
+
// Defaulted, not just nullable: session.upsert payloads persisted before
|
|
19054
|
+
// these fields shipped lack the keys, and replay-path parsing must keep
|
|
19055
|
+
// accepting them (additive, skew-tolerant rollout).
|
|
19056
|
+
model: ResolvedAgentModelSelectionSchema.nullable().default(null),
|
|
19057
|
+
reasoningEffort: external_exports.string().trim().min(1).nullable().default(null),
|
|
18878
19058
|
starterActor: AuthActorSchema.nullable(),
|
|
18879
19059
|
snapshot: AgentResourceSchema,
|
|
18880
19060
|
environmentSnapshot: EnvironmentResourceSchema,
|
|
@@ -22851,6 +23031,7 @@ var init_src = __esm({
|
|
|
22851
23031
|
init_environments();
|
|
22852
23032
|
init_live_events();
|
|
22853
23033
|
init_mcp();
|
|
23034
|
+
init_model_selection();
|
|
22854
23035
|
init_mounts();
|
|
22855
23036
|
init_pricing();
|
|
22856
23037
|
init_provider_grants();
|
|
@@ -25610,7 +25791,7 @@ var init_package = __esm({
|
|
|
25610
25791
|
"package.json"() {
|
|
25611
25792
|
package_default = {
|
|
25612
25793
|
name: "@autohq/cli",
|
|
25613
|
-
version: "0.1.
|
|
25794
|
+
version: "0.1.312",
|
|
25614
25795
|
license: "SEE LICENSE IN README.md",
|
|
25615
25796
|
publishConfig: {
|
|
25616
25797
|
access: "public"
|
|
@@ -27723,15 +27904,15 @@ var init_template_staleness = __esm({
|
|
|
27723
27904
|
function readProjectApplyDirectorySource(input) {
|
|
27724
27905
|
const resourceRoot = normalizeSourcePath(input.resourceRoot ?? "");
|
|
27725
27906
|
const displayResourceRoot2 = input.displayResourceRoot ?? (resourceRoot || ".auto");
|
|
27726
|
-
const
|
|
27727
|
-
|
|
27728
|
-
|
|
27729
|
-
|
|
27730
|
-
|
|
27731
|
-
);
|
|
27732
|
-
assertNoStandaloneSourceFiles(
|
|
27733
|
-
assertValidFragmentSourceFiles(
|
|
27734
|
-
const agentFiles =
|
|
27907
|
+
const files = injectManagedTemplateFiles({
|
|
27908
|
+
files: input.files,
|
|
27909
|
+
registry: defaultTemplateRegistry
|
|
27910
|
+
});
|
|
27911
|
+
const fileIndex = sourceFileIndex(files);
|
|
27912
|
+
assertNoLegacySessionSourceFiles(files, resourceRoot, displayResourceRoot2);
|
|
27913
|
+
assertNoStandaloneSourceFiles(files, resourceRoot, displayResourceRoot2);
|
|
27914
|
+
assertValidFragmentSourceFiles(files, resourceRoot, fileIndex);
|
|
27915
|
+
const agentFiles = files.filter(
|
|
27735
27916
|
(file2) => isResourceFileUnderDirectory(
|
|
27736
27917
|
file2.path,
|
|
27737
27918
|
sourcePathJoin(resourceRoot, primaryApplyDirectory())
|
|
@@ -27747,7 +27928,7 @@ function readProjectApplyDirectorySource(input) {
|
|
|
27747
27928
|
}))
|
|
27748
27929
|
);
|
|
27749
27930
|
}
|
|
27750
|
-
const configResource = readProjectConfigResource(
|
|
27931
|
+
const configResource = readProjectConfigResource(files, resourceRoot);
|
|
27751
27932
|
const resources = [
|
|
27752
27933
|
...dedupeGeneratedResources(resourceRecords),
|
|
27753
27934
|
...configResource ? [configResource] : []
|
|
@@ -27765,7 +27946,12 @@ function readProjectApplyDirectorySource(input) {
|
|
|
27765
27946
|
}
|
|
27766
27947
|
function readProjectApplyFileSource(input) {
|
|
27767
27948
|
const request = readProjectApplyDocumentSourceFile(input.file, {
|
|
27768
|
-
fileIndex: sourceFileIndex(
|
|
27949
|
+
fileIndex: sourceFileIndex(
|
|
27950
|
+
injectManagedTemplateFiles({
|
|
27951
|
+
files: input.files ?? [input.file],
|
|
27952
|
+
registry: defaultTemplateRegistry
|
|
27953
|
+
})
|
|
27954
|
+
)
|
|
27769
27955
|
});
|
|
27770
27956
|
return ProjectApplyRequestSchema.parse({
|
|
27771
27957
|
...request,
|
|
@@ -35524,12 +35710,36 @@ var AgentBridgeHarnessBaseConfigSchema = external_exports.object({
|
|
|
35524
35710
|
// user message. Optional and strip-tolerant per the skew contract.
|
|
35525
35711
|
systemPromptAppend: external_exports.string().trim().min(1).optional()
|
|
35526
35712
|
});
|
|
35527
|
-
var
|
|
35713
|
+
var AgentBridgeModelSelectionSchema = external_exports.object({
|
|
35714
|
+
provider: external_exports.string().trim().min(1),
|
|
35715
|
+
id: external_exports.string().trim().min(1)
|
|
35716
|
+
});
|
|
35717
|
+
var AgentBridgeClaudeReasoningEffortSchema = external_exports.enum([
|
|
35718
|
+
"low",
|
|
35719
|
+
"medium",
|
|
35720
|
+
"high",
|
|
35721
|
+
"xhigh",
|
|
35722
|
+
"max"
|
|
35723
|
+
]);
|
|
35724
|
+
var AgentBridgeCodexReasoningEffortSchema = external_exports.enum([
|
|
35725
|
+
"minimal",
|
|
35726
|
+
"low",
|
|
35727
|
+
"medium",
|
|
35728
|
+
"high"
|
|
35729
|
+
]);
|
|
35730
|
+
var AgentBridgeClaudeConfigSchema = AgentBridgeHarnessBaseConfigSchema.extend({
|
|
35731
|
+
model: AgentBridgeModelSelectionSchema.optional(),
|
|
35732
|
+
reasoningEffort: AgentBridgeClaudeReasoningEffortSchema.optional()
|
|
35733
|
+
});
|
|
35734
|
+
var AgentBridgeCodexConfigSchema = AgentBridgeHarnessBaseConfigSchema.extend({
|
|
35735
|
+
model: AgentBridgeModelSelectionSchema.optional(),
|
|
35736
|
+
reasoningEffort: AgentBridgeCodexReasoningEffortSchema.optional()
|
|
35737
|
+
});
|
|
35528
35738
|
var AgentBridgeHarnessConfigSchema = external_exports.discriminatedUnion("kind", [
|
|
35529
|
-
|
|
35739
|
+
AgentBridgeClaudeConfigSchema.extend({
|
|
35530
35740
|
kind: external_exports.literal("claude-code")
|
|
35531
35741
|
}),
|
|
35532
|
-
|
|
35742
|
+
AgentBridgeCodexConfigSchema.extend({
|
|
35533
35743
|
kind: external_exports.literal("codex")
|
|
35534
35744
|
})
|
|
35535
35745
|
]);
|
|
@@ -41213,6 +41423,9 @@ function registerAuthCommands(program, context) {
|
|
|
41213
41423
|
);
|
|
41214
41424
|
}
|
|
41215
41425
|
|
|
41426
|
+
// src/commands/connections/actions.ts
|
|
41427
|
+
init_src();
|
|
41428
|
+
|
|
41216
41429
|
// src/lib/stdio/confirm.ts
|
|
41217
41430
|
async function confirmDestructiveAction(context, input) {
|
|
41218
41431
|
if (input.yes) {
|
|
@@ -41869,7 +42082,7 @@ function cliTelegramWizardPrompter(context) {
|
|
|
41869
42082
|
}
|
|
41870
42083
|
|
|
41871
42084
|
// src/commands/connections/actions.ts
|
|
41872
|
-
var
|
|
42085
|
+
var MODEL_API_TOKEN_PROVIDER_SET = new Set(MODEL_API_TOKEN_PROVIDERS);
|
|
41873
42086
|
async function listConnectionsAction(context, commandOptions) {
|
|
41874
42087
|
const apiBaseUrl = apiUrlFromOptions(context, commandOptions);
|
|
41875
42088
|
if (commandOptions.available) {
|
|
@@ -41898,9 +42111,9 @@ async function connectProviderAction(context, provider, commandOptions) {
|
|
|
41898
42111
|
"--config-refresh-token is only supported for the slack provider."
|
|
41899
42112
|
);
|
|
41900
42113
|
}
|
|
41901
|
-
if ((commandOptions.token || commandOptions.stdin) && provider !== "telegram" && !
|
|
42114
|
+
if ((commandOptions.token || commandOptions.stdin) && provider !== "telegram" && !MODEL_API_TOKEN_PROVIDER_SET.has(provider)) {
|
|
41902
42115
|
throw new Error(
|
|
41903
|
-
"--token/--stdin are only supported for telegram
|
|
42116
|
+
"--token/--stdin are only supported for telegram and model API providers."
|
|
41904
42117
|
);
|
|
41905
42118
|
}
|
|
41906
42119
|
const allowScope = await resolveConnectAllowProject(
|
|
@@ -41935,7 +42148,7 @@ async function connectProviderAction(context, provider, commandOptions) {
|
|
|
41935
42148
|
});
|
|
41936
42149
|
return;
|
|
41937
42150
|
}
|
|
41938
|
-
if (
|
|
42151
|
+
if (MODEL_API_TOKEN_PROVIDER_SET.has(provider)) {
|
|
41939
42152
|
if (commandOptions.token && commandOptions.stdin) {
|
|
41940
42153
|
throw new Error("Use only one of --token or --stdin.");
|
|
41941
42154
|
}
|