@autonoma-ai/planner 0.1.17 → 0.1.18

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/index.js CHANGED
@@ -396,7 +396,7 @@ var init_errors = __esm({
396
396
  phase;
397
397
  cause;
398
398
  };
399
- FATAL_STATUS_CODES = /* @__PURE__ */ new Set([400, 401, 403, 404, 422]);
399
+ FATAL_STATUS_CODES = /* @__PURE__ */ new Set([400, 401, 402, 403, 404, 422]);
400
400
  RETRYABLE_PROVIDER_QUIRKS = ["corrupted thought signature"];
401
401
  TRANSIENT_MESSAGE_PATTERNS = [
402
402
  "econnreset",
@@ -432,13 +432,14 @@ function getProvider() {
432
432
  function getModel(modelId) {
433
433
  return getProvider().languageModel(modelId ?? readEnv().OPENROUTER_MODEL ?? DEFAULT_MODEL);
434
434
  }
435
- var DEFAULT_MODEL, DEFAULT_API_URL, provider;
435
+ var DEFAULT_MODEL, AI_MAX_RETRIES, DEFAULT_API_URL, provider;
436
436
  var init_model = __esm({
437
437
  "src/core/model.ts"() {
438
438
  "use strict";
439
439
  init_esm_shims();
440
440
  init_env();
441
441
  DEFAULT_MODEL = "google/gemini-3-flash-preview";
442
+ AI_MAX_RETRIES = 10;
442
443
  DEFAULT_API_URL = "https://autonoma.app";
443
444
  }
444
445
  });
@@ -681,6 +682,7 @@ async function runAgent(config, prompt, extractResult) {
681
682
  const tools = typeof config.tools === "function" ? await config.tools(heartbeat) : config.tools;
682
683
  const agent = new ToolLoopAgent({
683
684
  model,
685
+ maxRetries: AI_MAX_RETRIES,
684
686
  instructions: config.systemPrompt,
685
687
  tools,
686
688
  temperature: config.temperature,
@@ -738,6 +740,7 @@ var init_agent = __esm({
738
740
  init_analytics();
739
741
  init_display();
740
742
  init_errors();
743
+ init_model();
741
744
  MAX_RETRIES = 3;
742
745
  STEP_TIMEOUT_MS = 12e4;
743
746
  MAX_NUDGES = 2;
@@ -1241,6 +1244,7 @@ function buildSubagentTool(model, workingDirectory, onHeartbeat, onFileRead) {
1241
1244
  let result;
1242
1245
  const subagent = new ToolLoopAgent2({
1243
1246
  model,
1247
+ maxRetries: AI_MAX_RETRIES,
1244
1248
  instructions: SYSTEM_PROMPT,
1245
1249
  tools: {
1246
1250
  ...buildSubagentTools(workingDirectory, onFileRead),
@@ -1274,6 +1278,7 @@ var init_subagent = __esm({
1274
1278
  "src/tools/subagent.ts"() {
1275
1279
  "use strict";
1276
1280
  init_esm_shims();
1281
+ init_model();
1277
1282
  init_pick_string();
1278
1283
  init_bash();
1279
1284
  init_glob();
@@ -3226,7 +3231,8 @@ async function callRanker(model, prompt) {
3226
3231
  const result = await generateText({
3227
3232
  model,
3228
3233
  prompt,
3229
- output: Output.object({ schema: rankedSchema })
3234
+ output: Output.object({ schema: rankedSchema }),
3235
+ maxRetries: AI_MAX_RETRIES
3230
3236
  });
3231
3237
  return result.output.ranked;
3232
3238
  }
@@ -3307,6 +3313,7 @@ var init_entity_relevance = __esm({
3307
3313
  "use strict";
3308
3314
  init_esm_shims();
3309
3315
  init_errors();
3316
+ init_model();
3310
3317
  rankedSchema = z15.object({
3311
3318
  ranked: z15.array(z15.string()).describe("Every entity name, ordered most-important first.")
3312
3319
  });
@@ -3825,7 +3832,8 @@ async function classifyFailure(model, args) {
3825
3832
  const result = await generateText2({
3826
3833
  model,
3827
3834
  prompt: buildClassifierPrompt(args),
3828
- output: Output2.object({ schema: classificationSchema })
3835
+ output: Output2.object({ schema: classificationSchema }),
3836
+ maxRetries: AI_MAX_RETRIES
3829
3837
  });
3830
3838
  return result.output;
3831
3839
  } catch (err) {
@@ -3838,6 +3846,7 @@ var init_failure_classifier = __esm({
3838
3846
  "use strict";
3839
3847
  init_esm_shims();
3840
3848
  init_errors();
3849
+ init_model();
3841
3850
  classificationSchema = z16.object({
3842
3851
  side: z16.enum(["recipe", "implementation", "unclear"]).describe(
3843
3852
  "recipe = the test data we sent is wrong and regenerating it could fix the failure; implementation = the developer's handler/factory code is wrong and only a code change fixes it; unclear = cannot confidently attribute the failure to either side."
@@ -6267,6 +6276,7 @@ function buildSpawnResearcherTool(model, workingDirectory, onHeartbeat) {
6267
6276
  let result;
6268
6277
  const subagent = new ToolLoopAgent3({
6269
6278
  model,
6279
+ maxRetries: AI_MAX_RETRIES,
6270
6280
  instructions: "You are a code researcher. Read the files specified in your instruction, analyze them, and call finish with a summary of what you found. Focus on: UI elements, forms, buttons, navigation, API calls, state management.",
6271
6281
  tools: {
6272
6282
  bash: buildBashTool(workingDirectory),
@@ -6311,6 +6321,7 @@ var init_tools2 = __esm({
6311
6321
  "src/agents/05-test-generator/tools.ts"() {
6312
6322
  "use strict";
6313
6323
  init_esm_shims();
6324
+ init_model();
6314
6325
  init_tools();
6315
6326
  init_graph();
6316
6327
  init_validation();