lua-cli 3.49.0 → 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.
@@ -867,6 +867,8 @@ export declare interface WorkflowGoalEnvelope {
867
867
  maxRuns: number;
868
868
  budget?: LuaWorkflowConfig['budget'];
869
869
  maxTotalCredits?: number;
870
+ /** The organisation's budget unit, as reported by the server (read-only; never sent on create). */
871
+ budgetUnit?: 'actions' | 'credits';
870
872
  initialState?: Record<string, unknown>;
871
873
  }
872
874
 
@@ -1184,10 +1184,66 @@ 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}$/;
1222
+ var DECISION_SANDBOX_TOOL_SEPARATOR = "#";
1223
+ function formatDecisionSandboxPrimitive(name, tool) {
1224
+ return tool ? `${name}${DECISION_SANDBOX_TOOL_SEPARATOR}${tool}` : name;
1225
+ }
1226
+ __name(formatDecisionSandboxPrimitive, "formatDecisionSandboxPrimitive");
1227
+ __name4(formatDecisionSandboxPrimitive, "formatDecisionSandboxPrimitive");
1228
+ function parseDecisionSandboxPrimitive(value3) {
1229
+ const at = value3.indexOf(DECISION_SANDBOX_TOOL_SEPARATOR);
1230
+ const name = at < 0 ? value3 : value3.slice(0, at);
1231
+ const tool = at < 0 ? "" : value3.slice(at + DECISION_SANDBOX_TOOL_SEPARATOR.length);
1232
+ if (name.length === 0) return void 0;
1233
+ return tool.length > 0 ? {
1234
+ name,
1235
+ tool
1236
+ } : {
1237
+ name
1238
+ };
1239
+ }
1240
+ __name(parseDecisionSandboxPrimitive, "parseDecisionSandboxPrimitive");
1241
+ __name4(parseDecisionSandboxPrimitive, "parseDecisionSandboxPrimitive");
1242
+ function decisionPublishStampKey(agentId2) {
1243
+ return `decisions:stamp:${agentId2}`;
1244
+ }
1245
+ __name(decisionPublishStampKey, "decisionPublishStampKey");
1246
+ __name4(decisionPublishStampKey, "decisionPublishStampKey");
1191
1247
  var DECISION_LIMITS = {
1192
1248
  maxQuestions: 64,
1193
1249
  minOptions: 2,
@@ -1245,7 +1301,7 @@ var DecisionOptionsSchema = z.object({
1245
1301
  ]).optional(),
1246
1302
  model: z.string().min(1).optional(),
1247
1303
  fallback: z.union([
1248
- z.enum(DECISION_PROVIDERS),
1304
+ z.enum(DECISION_FALLBACK_PROVIDERS),
1249
1305
  z.literal("none")
1250
1306
  ]).optional(),
1251
1307
  region: z.literal("eu").optional(),
@@ -1274,6 +1330,16 @@ var DecisionDefinitionSchema = DecisionOptionsSchema.extend({
1274
1330
  description: z.string().max(DECISION_LIMITS.maxInstructionChars).optional(),
1275
1331
  questions: DecisionQuestionsSchema
1276
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
+ });
1277
1343
  var INTEGRATION_PASSTHROUGH_READ_METHODS = [
1278
1344
  "GET",
1279
1345
  "HEAD"
@@ -7483,7 +7549,11 @@ var BROWSER_SESSION_CLOSE_REASONS = [
7483
7549
  "max-steps",
7484
7550
  "cost-cap",
7485
7551
  "error",
7486
- "reaped"
7552
+ "reaped",
7553
+ "cancelled",
7554
+ "confirmation",
7555
+ "blocked",
7556
+ "stopped"
7487
7557
  ];
7488
7558
  var BROWSER_LOG_CONTEXT_KEYS = [
7489
7559
  "runId",
@@ -7511,7 +7581,8 @@ var EVENT_SHAPES = {
7511
7581
  optional: {
7512
7582
  limits: isLimits,
7513
7583
  region: isString,
7514
- liveUrl: isString
7584
+ liveUrl: isString,
7585
+ browser: isString
7515
7586
  }
7516
7587
  },
7517
7588
  command: {
@@ -7681,6 +7752,10 @@ function browserLogContextOfWorkerContext(context) {
7681
7752
  if (context?.primitiveId) out.primitiveId = context.primitiveId;
7682
7753
  if (context?.primitiveName) out.primitiveName = context.primitiveName;
7683
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;
7684
7759
  return out;
7685
7760
  }
7686
7761
  __name(browserLogContextOfWorkerContext, "browserLogContextOfWorkerContext");