lua-cli 3.49.1 → 3.49.2

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.
@@ -1184,9 +1184,40 @@ function aiGenerateInputFromSimplified(prompt, content) {
1184
1184
  __name(aiGenerateInputFromSimplified, "aiGenerateInputFromSimplified");
1185
1185
  __name4(aiGenerateInputFromSimplified, "aiGenerateInputFromSimplified");
1186
1186
  var DECISION_PROVIDERS = [
1187
+ "jev",
1188
+ "openai",
1189
+ "openrouter"
1190
+ ];
1191
+ var DECISION_FALLBACK_PROVIDERS = [
1187
1192
  "jev",
1188
1193
  "openai"
1189
1194
  ];
1195
+ var OPENROUTER_DIRECT_VENDORS = [
1196
+ {
1197
+ pattern: /^~?typesafe\//,
1198
+ provider: "jev"
1199
+ },
1200
+ {
1201
+ pattern: /^openai\//,
1202
+ provider: "openai"
1203
+ }
1204
+ ];
1205
+ function directProviderOfOpenRouterModel(model) {
1206
+ return OPENROUTER_DIRECT_VENDORS.find((vendor) => vendor.pattern.test(model))?.provider;
1207
+ }
1208
+ __name(directProviderOfOpenRouterModel, "directProviderOfOpenRouterModel");
1209
+ __name4(directProviderOfOpenRouterModel, "directProviderOfOpenRouterModel");
1210
+ var OPENROUTER_NEEDS_MODEL_MESSAGE = "provider openrouter needs a model id, such as liquid/d1";
1211
+ function openRouterModelIssue(options) {
1212
+ const model = typeof options.model === "string" && options.model ? options.model : void 0;
1213
+ if (options.provider === "openrouter" && !model) return OPENROUTER_NEEDS_MODEL_MESSAGE;
1214
+ if (!model || !model.includes("/")) return null;
1215
+ const direct = directProviderOfOpenRouterModel(model);
1216
+ if (!direct) return null;
1217
+ return `model ${model} runs on provider '${direct}': set provider '${direct}' instead of a vendor/model id`;
1218
+ }
1219
+ __name(openRouterModelIssue, "openRouterModelIssue");
1220
+ __name4(openRouterModelIssue, "openRouterModelIssue");
1190
1221
  var DECISION_NAME_PATTERN = /^[a-zA-Z0-9_-]{1,64}$/;
1191
1222
  var DECISION_SANDBOX_TOOL_SEPARATOR = "#";
1192
1223
  function formatDecisionSandboxPrimitive(name, tool) {
@@ -1270,7 +1301,7 @@ var DecisionOptionsSchema = z.object({
1270
1301
  ]).optional(),
1271
1302
  model: z.string().min(1).optional(),
1272
1303
  fallback: z.union([
1273
- z.enum(DECISION_PROVIDERS),
1304
+ z.enum(DECISION_FALLBACK_PROVIDERS),
1274
1305
  z.literal("none")
1275
1306
  ]).optional(),
1276
1307
  region: z.literal("eu").optional(),
@@ -1299,6 +1330,16 @@ var DecisionDefinitionSchema = DecisionOptionsSchema.extend({
1299
1330
  description: z.string().max(DECISION_LIMITS.maxInstructionChars).optional(),
1300
1331
  questions: DecisionQuestionsSchema
1301
1332
  }).strict();
1333
+ var DecisionDefinitionWriteSchema = DecisionDefinitionSchema.superRefine((definition, ctx) => {
1334
+ const issue = openRouterModelIssue(definition);
1335
+ if (issue) ctx.addIssue({
1336
+ code: z.ZodIssueCode.custom,
1337
+ path: [
1338
+ "model"
1339
+ ],
1340
+ message: issue
1341
+ });
1342
+ });
1302
1343
  var INTEGRATION_PASSTHROUGH_READ_METHODS = [
1303
1344
  "GET",
1304
1345
  "HEAD"
@@ -7508,7 +7549,11 @@ var BROWSER_SESSION_CLOSE_REASONS = [
7508
7549
  "max-steps",
7509
7550
  "cost-cap",
7510
7551
  "error",
7511
- "reaped"
7552
+ "reaped",
7553
+ "cancelled",
7554
+ "confirmation",
7555
+ "blocked",
7556
+ "stopped"
7512
7557
  ];
7513
7558
  var BROWSER_LOG_CONTEXT_KEYS = [
7514
7559
  "runId",
@@ -7536,7 +7581,8 @@ var EVENT_SHAPES = {
7536
7581
  optional: {
7537
7582
  limits: isLimits,
7538
7583
  region: isString,
7539
- liveUrl: isString
7584
+ liveUrl: isString,
7585
+ browser: isString
7540
7586
  }
7541
7587
  },
7542
7588
  command: {
@@ -7706,6 +7752,10 @@ function browserLogContextOfWorkerContext(context) {
7706
7752
  if (context?.primitiveId) out.primitiveId = context.primitiveId;
7707
7753
  if (context?.primitiveName) out.primitiveName = context.primitiveName;
7708
7754
  if (context?.channel) out.channel = context.channel;
7755
+ if (context?.environment && AGENT_LOG_ENVIRONMENTS.includes(context.environment)) {
7756
+ out.environment = context.environment;
7757
+ }
7758
+ if (context?.agentVersion) out.agentVersion = context.agentVersion;
7709
7759
  return out;
7710
7760
  }
7711
7761
  __name(browserLogContextOfWorkerContext, "browserLogContextOfWorkerContext");