@alan-ai-hq/agent-manager-linux-arm64 0.1.148 → 0.1.149

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.
Files changed (3) hide show
  1. package/alan-agent.cjs +472 -121
  2. package/alan-holder.cjs +259 -51
  3. package/package.json +1 -1
package/alan-holder.cjs CHANGED
@@ -22119,6 +22119,7 @@ Team
22119
22119
  - Scan available context (task, subtasks, code, history) before asking questions you can answer yourself.
22120
22120
  - Challenge when off \u2014 never silently implement the wrong thing.
22121
22121
  - Act on the user's request and make reasonable implementation and tool choices within its scope. Do not ask again for permission already granted. Ask only when essential information is missing or an action requires additional authority.
22122
+ - When a user asks to create a Skill, default to a team-owned Alan platform Skill through \`alan-skill-authoring\`, whether this session runs locally or in a cloud sandbox. Use a repository or filesystem Skill only when the user explicitly requests that scope. Do not infer repository scope from the current checkout or from a procedure that mentions repository files. If repeated work suggests a reusable Skill, offer the platform Skill and its evidence; do not publish it without the approval required by the authoring workflow.
22122
22123
  - Own mistakes. Wrong ID, jumped too fast \u2014 say so and fix it.
22123
22124
  - Write for a human reader. Task, subtask and epic descriptions, documents, artifacts and comments are read by people in the app, not parsed by agents. Lead with the outcome in one sentence, then short sections with headings and bullet lists. Spell out internal shorthand, and keep commit hashes, IDs and migration numbers out of sentences \u2014 put them in a trailing "References" list when they matter.
22124
22125
  - Think visually, proactively \u2014 not only when asked. Mermaid over paragraphs for architecture, flows, state, and schema. The same applies to data: when you're about to present a comparison, trend, breakdown, or status across several items, reach for a \`\`\`chart fence instead of a paragraph of numbers or a markdown table, even if the user never said the word "chart."
@@ -22364,7 +22365,7 @@ var init_chunk_YXWJW7I5 = __esm({
22364
22365
  }
22365
22366
  });
22366
22367
 
22367
- // ../agent-core/dist/chunk-M6YHY2EZ.js
22368
+ // ../agent-core/dist/chunk-XE7BX6YP.js
22368
22369
  function windowsEnvValue(env, name) {
22369
22370
  const wanted = name.toLowerCase();
22370
22371
  for (const [key, value] of Object.entries(env).reverse()) {
@@ -22413,6 +22414,36 @@ function unwrapNativeShim(shim, args, files) {
22413
22414
  const file2 = import_path.win32.resolve(directory, target.replace(/^%dp0%\\/i, ""));
22414
22415
  return files.isFile(file2) ? { kind: "native", file: file2, args } : void 0;
22415
22416
  }
22417
+ function binTargets(manifest) {
22418
+ if (typeof manifest !== "object" || manifest === null || !("bin" in manifest)) return [];
22419
+ const { bin } = manifest;
22420
+ if (typeof bin === "string") return [bin];
22421
+ if (typeof bin !== "object" || bin === null) return [];
22422
+ return Object.values(bin).filter((target) => typeof target === "string");
22423
+ }
22424
+ function parseManifest(text2) {
22425
+ try {
22426
+ return JSON.parse(text2);
22427
+ } catch {
22428
+ return void 0;
22429
+ }
22430
+ }
22431
+ function isDeclaredPackageBin(script, files) {
22432
+ const wanted = script.toLowerCase();
22433
+ let dir = import_path.win32.dirname(script);
22434
+ while (import_path.win32.basename(dir).toLowerCase() !== "node_modules") {
22435
+ const text2 = files.readShim(import_path.win32.join(dir, "package.json"));
22436
+ if (text2 !== void 0) {
22437
+ return binTargets(parseManifest(text2)).some(
22438
+ (target) => import_path.win32.resolve(dir, target).toLowerCase() === wanted
22439
+ );
22440
+ }
22441
+ const parent = import_path.win32.dirname(dir);
22442
+ if (parent === dir) return false;
22443
+ dir = parent;
22444
+ }
22445
+ return false;
22446
+ }
22416
22447
  function isSimpleNodeShim(text2) {
22417
22448
  return text2.split(/\r?\n/).map((line) => line.trim()).filter((line) => line.length > 0).every((line) => /^@?echo off$/i.test(line) || NODE_SHIM_ENTRY.test(line));
22418
22449
  }
@@ -22429,6 +22460,7 @@ function unwrapNodeShim(shim, args, env, files) {
22429
22460
  const dir = import_path.win32.dirname(shim);
22430
22461
  const script = import_path.win32.resolve(dir, scriptTemplate.replace(/%dp0%|%~dp0/gi, `${dir}\\`));
22431
22462
  if (script.includes("%") || !files.isFile(script)) return void 0;
22463
+ if (!SCRIPT_EXTENSION.test(script) && !isDeclaredPackageBin(script, files)) return void 0;
22432
22464
  const local = import_path.win32.join(dir, "node.exe");
22433
22465
  const node2 = program.toLowerCase() === "%_prog%" ? files.isFile(local) ? local : resolveWindowsCommand("node", env, files) : program;
22434
22466
  if (node2 === void 0 || node2.includes("%")) return void 0;
@@ -22972,9 +23004,9 @@ function waitForSpawn(child, command) {
22972
23004
  child.once("error", onError);
22973
23005
  });
22974
23006
  }
22975
- var import_child_process, import_fs, import_path, import_child_process2, import_promises6, import_child_process3, import_child_process4, import_child_process5, import_child_process6, import_crypto, import_fs2, import_promises7, import_os, import_path2, SHIM_MAX_BYTES, CMD_MAX_COMMAND_LINE, MAX_COMMAND_LINE, DEFAULT_PATHEXT, LAUNCHABLE_EXTENSIONS, nodeWindowsFiles, NODE_SHIM_ENTRY, NATIVE_SHIM_LINES, NATIVE_SHIM_ENTRY, CMD_META, NEVER_STARTED, HIDDEN_FLAG_PROBE_VALUE, NEWLINE, CARRIAGE_RETURN, EMPTY, MAX_LINE_BYTES, LineSplitter, PS_LINE, POLL_MS, DEFAULT_GRACE_MS, DEFAULT_KILL_WAIT_MS, DEFAULT_TASKKILL_TIMEOUT_MS, statuses, START_TIMEOUT_MS, spawnListeners;
22976
- var init_chunk_M6YHY2EZ = __esm({
22977
- "../agent-core/dist/chunk-M6YHY2EZ.js"() {
23007
+ var import_child_process, import_fs, import_path, import_child_process2, import_promises6, import_child_process3, import_child_process4, import_child_process5, import_child_process6, import_crypto, import_fs2, import_promises7, import_os, import_path2, SHIM_MAX_BYTES, CMD_MAX_COMMAND_LINE, MAX_COMMAND_LINE, DEFAULT_PATHEXT, LAUNCHABLE_EXTENSIONS, nodeWindowsFiles, NODE_SHIM_ENTRY, SCRIPT_EXTENSION, NATIVE_SHIM_LINES, NATIVE_SHIM_ENTRY, CMD_META, NEVER_STARTED, HIDDEN_FLAG_PROBE_VALUE, NEWLINE, CARRIAGE_RETURN, EMPTY, MAX_LINE_BYTES, LineSplitter, PS_LINE, POLL_MS, DEFAULT_GRACE_MS, DEFAULT_KILL_WAIT_MS, DEFAULT_TASKKILL_TIMEOUT_MS, statuses, START_TIMEOUT_MS, spawnListeners;
23008
+ var init_chunk_XE7BX6YP = __esm({
23009
+ "../agent-core/dist/chunk-XE7BX6YP.js"() {
22978
23010
  "use strict";
22979
23011
  init_chunk_YXWJW7I5();
22980
23012
  import_child_process = require("child_process");
@@ -23013,7 +23045,8 @@ var init_chunk_M6YHY2EZ = __esm({
23013
23045
  }
23014
23046
  }
23015
23047
  };
23016
- NODE_SHIM_ENTRY = /"(%_prog%|[^"\r\n]*node(?:\.exe)?)"\s+"([^"\r\n]+\.(?:c?js|mjs))"\s+%\*/i;
23048
+ NODE_SHIM_ENTRY = /"(%_prog%|[^"\r\n]*node(?:\.exe)?)"\s+"([^"\r\n]+)"\s+%\*/i;
23049
+ SCRIPT_EXTENSION = /\.(?:c?js|mjs)$/i;
23017
23050
  NATIVE_SHIM_LINES = [
23018
23051
  /^@echo off$/i,
23019
23052
  /^goto start$/i,
@@ -24292,7 +24325,7 @@ var init_chunk_SBT5W7L4 = __esm({
24292
24325
  }
24293
24326
  });
24294
24327
 
24295
- // ../agent-core/dist/chunk-HBIPWAUI.js
24328
+ // ../agent-core/dist/chunk-ZCTKXKYY.js
24296
24329
  function readCapReset(text2) {
24297
24330
  const epoch = EPOCH_RESET.exec(text2);
24298
24331
  if (epoch) return { resetsAt: new Date(Number(epoch[1]) * 1e3).toISOString() };
@@ -24499,8 +24532,8 @@ function createCliProblem(observed, options) {
24499
24532
  });
24500
24533
  }
24501
24534
  var import_crypto2, EPOCH_RESET, WORDED_RESET, CODEX_RESET, ERROR_SPECS, AGENT_ERROR_KINDS, AGENT_SIGN_IN_BY_HARNESS, STATUS_PREFIX, TEXT_RULES, CODEX_TIMEOUT_MESSAGE, CODEX_EXPIRED_MESSAGE, COMMAND_NOT_FOUND, CODE_RULES, TEXT_REFINES, STATUS_LEAD, CLI_PROBLEM_CODE_BY_ERROR_KIND, KEY_REJECTION_KINDS;
24502
- var init_chunk_HBIPWAUI = __esm({
24503
- "../agent-core/dist/chunk-HBIPWAUI.js"() {
24535
+ var init_chunk_ZCTKXKYY = __esm({
24536
+ "../agent-core/dist/chunk-ZCTKXKYY.js"() {
24504
24537
  "use strict";
24505
24538
  init_chunk_YXWJW7I5();
24506
24539
  import_crypto2 = require("crypto");
@@ -24691,7 +24724,7 @@ var init_chunk_HBIPWAUI = __esm({
24691
24724
  },
24692
24725
  {
24693
24726
  kind: "overloaded",
24694
- pattern: /\boverloaded(?:_error)?\b|\bat capacity\b|\bserver_overloaded\b|\b(?:http|status|code|error)\s*:?\s*5\d\d\b|\[5\d\d\]|\bapi error:?\s*5\d\d\b|\b5\d\d (?:internal server error|bad gateway|service unavailable|gateway timeout)\b|\bservice unavailable\b|\bbad gateway\b|\bgateway timeout\b/
24727
+ pattern: /\boverloaded(?:_error)?\b|\bat capacity\b|\bserver_overloaded\b|\b(?:http|status|code|error)\s*:?\s*5\d\d\b|\[5\d\d\]|\bapi error:?\s*5\d\d\b|\b5\d\d (?:internal server error|bad gateway|service unavailable|gateway timeout)\b|\bservice unavailable\b|\bbad gateway\b|\bgateway timeout\b|\bapi server (?:encountered an error|returned an error|is unavailable)\b/
24695
24728
  },
24696
24729
  {
24697
24730
  kind: "context_length",
@@ -24699,7 +24732,7 @@ var init_chunk_HBIPWAUI = __esm({
24699
24732
  },
24700
24733
  {
24701
24734
  kind: "network",
24702
- pattern: /\b(?:econnrefused|econnreset|enotfound|etimedout|eai_again|ehostunreach|enetunreach)\b|\bfetch failed\b|\bnetwork (?:error|failure|is unreachable|connection (?:failed|lost))\b|\b(?:request|connection|socket) (?:timed out|timeout)\b|\bconnection reset by peer\b/
24735
+ pattern: /\b(?:econnrefused|econnreset|enotfound|etimedout|eai_again|ehostunreach|enetunreach)\b|\bfetch failed\b|\bnetwork (?:error|failure|is unreachable|connection (?:failed|lost))\b|\b(?:request|connection|socket) (?:timed out|timeout)\b|\bconnection reset by peer\b|\bunable to connect to the (?:api|server)\b|\bcould not connect to the (?:api|server)\b|\bplease check your network connection\b/
24703
24736
  },
24704
24737
  // launchd hands GUI daemons PATH=/usr/bin:/bin:/usr/sbin:/sbin, so `#!/usr/bin/env node`
24705
24738
  // fails even though node is installed under nvm/fnm/volta.
@@ -24764,7 +24797,7 @@ var init_chunk_HBIPWAUI = __esm({
24764
24797
  }
24765
24798
  });
24766
24799
 
24767
- // ../agent-core/dist/chunk-4G77APXN.js
24800
+ // ../agent-core/dist/chunk-A2TG6ROT.js
24768
24801
  function detectImageMimeType(buffer) {
24769
24802
  if (buffer.length >= 8 && buffer.subarray(0, 8).equals(PNG_SIGNATURE)) return "image/png";
24770
24803
  if (buffer.length >= 3 && buffer[0] === 255 && buffer[1] === 216 && buffer[2] === 255) {
@@ -25082,10 +25115,26 @@ function createNdjsonWriter(stream) {
25082
25115
  }
25083
25116
  function hostProcess(child, tree, options, handlers) {
25084
25117
  const writer = createNdjsonWriter(child.stdin);
25085
- const flags = { closing: false, outputClosedEarly: false, lastScan: Number.NEGATIVE_INFINITY };
25118
+ const flags = {
25119
+ closing: false,
25120
+ outputClosedEarly: false,
25121
+ lastScan: Number.NEGATIVE_INFINITY,
25122
+ lastOutputAt: void 0
25123
+ };
25086
25124
  const terminate = () => tree.terminate({ graceMs: options.terminateGraceMs });
25087
- readNdjson(child.stdout, { onLine: (line) => handlers.onLine(line) });
25088
- const stderr = new LineSplitter((line) => handlers.onStderrLine(line));
25125
+ const heard = () => {
25126
+ flags.lastOutputAt = options.clock.monotonic();
25127
+ };
25128
+ readNdjson(child.stdout, {
25129
+ onLine: (line) => {
25130
+ heard();
25131
+ handlers.onLine(line);
25132
+ }
25133
+ });
25134
+ const stderr = new LineSplitter((line) => {
25135
+ heard();
25136
+ handlers.onStderrLine(line);
25137
+ });
25089
25138
  child.stderr.on("data", (chunk) => stderr.push(chunk));
25090
25139
  child.stderr.once("end", () => stderr.flush());
25091
25140
  const processExit = new Promise((resolve9) => {
@@ -25118,6 +25167,9 @@ function hostProcess(child, tree, options, handlers) {
25118
25167
  };
25119
25168
  return {
25120
25169
  pid: child.pid,
25170
+ get lastOutputAt() {
25171
+ return flags.lastOutputAt;
25172
+ },
25121
25173
  writer,
25122
25174
  exited: watch(),
25123
25175
  terminate,
@@ -25148,12 +25200,12 @@ function silentStartError(name, timeoutMs) {
25148
25200
  };
25149
25201
  }
25150
25202
  var import_crypto3, import_fs4, import_path3, PNG_SIGNATURE, IMAGE_MIME_BY_EXT, VIDEO_MIME_BY_EXT, IMAGE_EXTENSIONS, VIDEO_EXTENSIONS, MAX_IMAGE_BYTES, MAX_VIDEO_BYTES, AGENT_BROWSER_MENTION, LocalMediaReader, SessionOpenRefusal, JsonRpcError, ACP_PROTOCOL_VERSION, ACP_ERROR, STDERR_TAIL_LINES, RESULT_EXIT_GRACE_MS, PerTurnSession;
25151
- var init_chunk_4G77APXN = __esm({
25152
- "../agent-core/dist/chunk-4G77APXN.js"() {
25203
+ var init_chunk_A2TG6ROT = __esm({
25204
+ "../agent-core/dist/chunk-A2TG6ROT.js"() {
25153
25205
  "use strict";
25154
25206
  init_chunk_XC5676SG();
25155
- init_chunk_HBIPWAUI();
25156
- init_chunk_M6YHY2EZ();
25207
+ init_chunk_ZCTKXKYY();
25208
+ init_chunk_XE7BX6YP();
25157
25209
  init_chunk_YXWJW7I5();
25158
25210
  import_crypto3 = require("crypto");
25159
25211
  import_fs4 = require("fs");
@@ -25312,6 +25364,7 @@ var init_chunk_4G77APXN = __esm({
25312
25364
  #sessionId;
25313
25365
  #pid;
25314
25366
  #current;
25367
+ #host;
25315
25368
  constructor(provider4, options, resumeId) {
25316
25369
  this.#provider = provider4;
25317
25370
  this.#options = options;
@@ -25327,6 +25380,9 @@ var init_chunk_4G77APXN = __esm({
25327
25380
  get pid() {
25328
25381
  return this.#current ? this.#pid : void 0;
25329
25382
  }
25383
+ get lastOutputAt() {
25384
+ return this.#current ? this.#host?.lastOutputAt : void 0;
25385
+ }
25330
25386
  onEvent(listener) {
25331
25387
  return this.#listeners.add(listener);
25332
25388
  }
@@ -25466,6 +25522,7 @@ var init_chunk_4G77APXN = __esm({
25466
25522
  }
25467
25523
  }
25468
25524
  );
25525
+ this.#host = host;
25469
25526
  active.interrupt = () => tree.interrupt();
25470
25527
  active.terminate = () => host.terminate();
25471
25528
  try {
@@ -27372,11 +27429,11 @@ var init_claude = __esm({
27372
27429
  "../agent-core/dist/providers/claude.js"() {
27373
27430
  "use strict";
27374
27431
  init_chunk_SBT5W7L4();
27375
- init_chunk_4G77APXN();
27432
+ init_chunk_A2TG6ROT();
27376
27433
  init_chunk_XC5676SG();
27377
- init_chunk_HBIPWAUI();
27434
+ init_chunk_ZCTKXKYY();
27378
27435
  init_chunk_J2KTV5FP();
27379
- init_chunk_M6YHY2EZ();
27436
+ init_chunk_XE7BX6YP();
27380
27437
  init_chunk_GI3ZGXTY();
27381
27438
  init_chunk_YXWJW7I5();
27382
27439
  init_effort();
@@ -28026,6 +28083,9 @@ var init_claude = __esm({
28026
28083
  get pid() {
28027
28084
  return this.#host.pid;
28028
28085
  }
28086
+ get lastOutputAt() {
28087
+ return this.#host.lastOutputAt;
28088
+ }
28029
28089
  onEvent(listener) {
28030
28090
  return this.#listeners.add(listener);
28031
28091
  }
@@ -29587,11 +29647,11 @@ var init_codex = __esm({
29587
29647
  "../agent-core/dist/providers/codex.js"() {
29588
29648
  "use strict";
29589
29649
  init_chunk_SBT5W7L4();
29590
- init_chunk_4G77APXN();
29650
+ init_chunk_A2TG6ROT();
29591
29651
  init_chunk_XC5676SG();
29592
- init_chunk_HBIPWAUI();
29652
+ init_chunk_ZCTKXKYY();
29593
29653
  init_chunk_J2KTV5FP();
29594
- init_chunk_M6YHY2EZ();
29654
+ init_chunk_XE7BX6YP();
29595
29655
  init_chunk_GI3ZGXTY();
29596
29656
  init_chunk_YXWJW7I5();
29597
29657
  import_fs6 = require("fs");
@@ -30140,6 +30200,9 @@ var init_codex = __esm({
30140
30200
  get pid() {
30141
30201
  return this.#host.pid;
30142
30202
  }
30203
+ get lastOutputAt() {
30204
+ return this.#host.lastOutputAt;
30205
+ }
30143
30206
  get exited() {
30144
30207
  return this.#host.exited;
30145
30208
  }
@@ -30748,7 +30811,8 @@ function alanCodeConfigContent(existing, input2) {
30748
30811
  baseURL: input2.baseURL,
30749
30812
  apiKey: `{env:${ALAN_CODE_API_KEY_ENV}}`,
30750
30813
  headers: { [MANAGED_MCP_CONVERSATION_HEADER]: `{env:${ALAN_CODE_CONVERSATION_ID_ENV}}` },
30751
- setCacheKey: true
30814
+ setCacheKey: true,
30815
+ chunkTimeout: ALAN_CODE_CHUNK_TIMEOUT_MS
30752
30816
  },
30753
30817
  models: Object.fromEntries(input2.models.map((model) => [model.id, engineModel(model)]))
30754
30818
  }
@@ -31040,7 +31104,7 @@ function alanCodeSystemPrompt(alanSystemPrompt) {
31040
31104
 
31041
31105
  ${instructions}` : ALAN_CODE_TOOL_NAMING_PROMPT;
31042
31106
  }
31043
- var import_http3, import_https, import_fs7, import_path7, import_crypto12, import_promises16, import_path8, import_url, ALAN_CODE_BASELINE_PROMPT, ALAN_CODE_ENGINE_PROVIDER_ID, DEFAULT_CONTEXT_WINDOW, DEFAULT_MAX_OUTPUT_TOKENS, ALAN_CODE_API_KEY_ENV, ALAN_CODE_CONVERSATION_ID_ENV, ALAN_CODE_PROXY_PATH, ALAN_CODE_WEBSEARCH_PATH, ALAN_CODE_CATALOG_PATH, CATALOG_TIMEOUT_MS, MAX_CATALOG_BYTES, ACTIVATION_WAIT_MS, ACTIVATION_POLL_MS, CatalogResponseError, ALAN_CODE_ENGINE_PATH_ENV, ALAN_CODE_ENGINE_COMMAND, ALAN_CODE_ENGINE_NAME, WINDOWS_RUNNABLE_EXTENSION, ALAN_CODE_ENGINE_PLUGIN_VERSION, ALAN_CODE_TOOL_NAMING_PROMPT;
31107
+ var import_http3, import_https, import_fs7, import_path7, import_crypto12, import_promises16, import_path8, import_url, ALAN_CODE_BASELINE_PROMPT, ALAN_CODE_ENGINE_PROVIDER_ID, DEFAULT_CONTEXT_WINDOW, DEFAULT_MAX_OUTPUT_TOKENS, ALAN_CODE_API_KEY_ENV, ALAN_CODE_CONVERSATION_ID_ENV, ALAN_CODE_PROXY_PATH, ALAN_CODE_WEBSEARCH_PATH, ALAN_CODE_CATALOG_PATH, ALAN_CODE_CHUNK_TIMEOUT_MS, CATALOG_TIMEOUT_MS, MAX_CATALOG_BYTES, ACTIVATION_WAIT_MS, ACTIVATION_POLL_MS, CatalogResponseError, ALAN_CODE_ENGINE_PATH_ENV, ALAN_CODE_ENGINE_COMMAND, ALAN_CODE_ENGINE_NAME, WINDOWS_RUNNABLE_EXTENSION, ALAN_CODE_ENGINE_PLUGIN_VERSION, ALAN_CODE_TOOL_NAMING_PROMPT;
31044
31108
  var init_alan_code = __esm({
31045
31109
  "../agent-core/dist/providers/alan-code.js"() {
31046
31110
  "use strict";
@@ -31066,6 +31130,7 @@ var init_alan_code = __esm({
31066
31130
  ALAN_CODE_PROXY_PATH = "/public/harness/v1";
31067
31131
  ALAN_CODE_WEBSEARCH_PATH = "/public/harness/v1/websearch";
31068
31132
  ALAN_CODE_CATALOG_PATH = "/public/harness/models";
31133
+ ALAN_CODE_CHUNK_TIMEOUT_MS = 18e4;
31069
31134
  CATALOG_TIMEOUT_MS = 5e3;
31070
31135
  MAX_CATALOG_BYTES = 1024 * 1024;
31071
31136
  ACTIVATION_WAIT_MS = 1e4;
@@ -38423,10 +38488,10 @@ var require_dist = __commonJS({
38423
38488
  var init_dist = __esm({
38424
38489
  "../agent-core/dist/index.js"() {
38425
38490
  "use strict";
38426
- init_chunk_4G77APXN();
38491
+ init_chunk_A2TG6ROT();
38427
38492
  init_chunk_XC5676SG();
38428
- init_chunk_HBIPWAUI();
38429
- init_chunk_M6YHY2EZ();
38493
+ init_chunk_ZCTKXKYY();
38494
+ init_chunk_XE7BX6YP();
38430
38495
  init_chunk_YXWJW7I5();
38431
38496
  }
38432
38497
  });
@@ -39170,11 +39235,11 @@ var import_promises24, import_path9, import_crypto13, import_promises25, CURSOR_
39170
39235
  var init_acp3 = __esm({
39171
39236
  "../agent-core/dist/providers/acp.js"() {
39172
39237
  "use strict";
39173
- init_chunk_4G77APXN();
39238
+ init_chunk_A2TG6ROT();
39174
39239
  init_chunk_XC5676SG();
39175
- init_chunk_HBIPWAUI();
39240
+ init_chunk_ZCTKXKYY();
39176
39241
  init_chunk_J2KTV5FP();
39177
- init_chunk_M6YHY2EZ();
39242
+ init_chunk_XE7BX6YP();
39178
39243
  init_chunk_GI3ZGXTY();
39179
39244
  init_chunk_YXWJW7I5();
39180
39245
  import_promises24 = require("fs/promises");
@@ -39513,6 +39578,9 @@ var init_acp3 = __esm({
39513
39578
  get pid() {
39514
39579
  return this.#host.pid;
39515
39580
  }
39581
+ get lastOutputAt() {
39582
+ return this.#host.lastOutputAt;
39583
+ }
39516
39584
  get exited() {
39517
39585
  return this.#host.exited;
39518
39586
  }
@@ -39987,7 +40055,7 @@ var init_acp3 = __esm({
39987
40055
  var init_classify = __esm({
39988
40056
  "../agent-core/dist/classify.js"() {
39989
40057
  "use strict";
39990
- init_chunk_HBIPWAUI();
40058
+ init_chunk_ZCTKXKYY();
39991
40059
  init_chunk_YXWJW7I5();
39992
40060
  }
39993
40061
  });
@@ -40005,6 +40073,65 @@ var init_driver = __esm({
40005
40073
  function sessionContextFor(opened, inputs) {
40006
40074
  return opened.fresh ? inputs.agentContext?.full : inputs.agentContext?.update;
40007
40075
  }
40076
+ function autoRetryDelayMs(attempt) {
40077
+ return AUTO_RETRY_BASE_DELAY_MS * 2 ** (attempt - 1);
40078
+ }
40079
+ function isAutoRecoverable(error61) {
40080
+ return error61.recoveryClass === "auto_recovering";
40081
+ }
40082
+ function countsAsProviderWork(update) {
40083
+ return !NON_WORK_UPDATE_KINDS.has(update.sessionUpdate);
40084
+ }
40085
+ function silentTurnError(displayName, timeoutMs) {
40086
+ return {
40087
+ ...specForErrorKind("provider_timeout"),
40088
+ message: `${displayName} printed nothing for ${Math.round(timeoutMs / 1e3)}s after the message was sent and was stopped. Send your message again.`
40089
+ };
40090
+ }
40091
+ async function sendWithFirstOutputDeadline(deadline, send2) {
40092
+ const { session, clock, timeoutMs } = deadline;
40093
+ const startedAt = clock.monotonic();
40094
+ const stop = new AbortController();
40095
+ const state = { expired: false };
40096
+ const silent = () => !deadline.heard() && !deadline.signal.aborted && (session.lastOutputAt === void 0 || session.lastOutputAt <= startedAt);
40097
+ void clock.sleep(timeoutMs, stop.signal).then(() => {
40098
+ if (clock.monotonic() - startedAt < timeoutMs || !silent()) return;
40099
+ state.expired = true;
40100
+ deadline.onExpired();
40101
+ void session.cancel();
40102
+ }).catch(() => void 0);
40103
+ try {
40104
+ const result = await send2();
40105
+ if (!state.expired) return result;
40106
+ await session.suspend().catch(() => void 0);
40107
+ return {
40108
+ ...result,
40109
+ outcome: { status: "failed", error: silentTurnError(deadline.displayName, timeoutMs) }
40110
+ };
40111
+ } finally {
40112
+ stop.abort();
40113
+ }
40114
+ }
40115
+ async function sendTurnWithRetry(options) {
40116
+ let result = await options.send();
40117
+ for (let attempt = 1; ; attempt += 1) {
40118
+ const failure5 = result.outcome.status === "failed" ? result.outcome.error : void 0;
40119
+ if (failure5 === void 0 || !isAutoRecoverable(failure5) || options.sawWork() || options.signal.aborted || attempt > MAX_AUTO_RETRIES) {
40120
+ return result;
40121
+ }
40122
+ options.log.info("holder.turn_auto_retry", {
40123
+ harness: options.harness,
40124
+ runId: options.runId,
40125
+ attempt,
40126
+ errorKind: failure5.errorKind
40127
+ });
40128
+ options.reportRetry(attempt);
40129
+ options.beginRetry();
40130
+ await options.clock.sleep(autoRetryDelayMs(attempt), options.signal).catch(() => void 0);
40131
+ if (options.signal.aborted) return { ...result, outcome: { status: "cancelled" } };
40132
+ result = await options.send();
40133
+ }
40134
+ }
40008
40135
  function errorMessage(error61) {
40009
40136
  return error61 instanceof Error ? error61.message : String(error61);
40010
40137
  }
@@ -40105,7 +40232,16 @@ function createPersistentDriver(provider4, options) {
40105
40232
  try {
40106
40233
  const { session } = opened;
40107
40234
  const seq = { next: 1 };
40235
+ let sawWork = false;
40236
+ let heardFromProvider = false;
40237
+ let announcedSpawn = false;
40238
+ const announceSpawn = (pid) => {
40239
+ if (announcedSpawn) return;
40240
+ announcedSpawn = true;
40241
+ sink.onSpawned(pid);
40242
+ };
40108
40243
  const record2 = (update) => {
40244
+ if (countsAsProviderWork(update)) sawWork = true;
40109
40245
  sink.onEvent({
40110
40246
  seq: seq.next++,
40111
40247
  at: clock.now(),
@@ -40127,13 +40263,16 @@ function createPersistentDriver(provider4, options) {
40127
40263
  if (!("turnId" in event) || event.turnId !== spec.runId) return;
40128
40264
  switch (event.type) {
40129
40265
  case "spawned":
40130
- sink.onSpawned(event.pid);
40266
+ announceSpawn(event.pid);
40131
40267
  return;
40132
40268
  case "awaiting_input":
40269
+ heardFromProvider = true;
40270
+ sawWork = true;
40133
40271
  for (const toolCallId of event.toolCallIds) turn.waiting.add(toolCallId);
40134
40272
  record2(awaitingUpdate(turn.waiting));
40135
40273
  return;
40136
40274
  case "update":
40275
+ heardFromProvider = true;
40137
40276
  recordWithMedia(event.update);
40138
40277
  return;
40139
40278
  default:
@@ -40143,7 +40282,7 @@ function createPersistentDriver(provider4, options) {
40143
40282
  const _events = __using(_stack, session.onEvent(forward));
40144
40283
  live.turn = turn;
40145
40284
  record2({ sessionUpdate: "state_update", state: "running" });
40146
- if (session.pid !== void 0) sink.onSpawned(session.pid);
40285
+ if (session.pid !== void 0) announceSpawn(session.pid);
40147
40286
  const onAbort = () => {
40148
40287
  void session.cancel();
40149
40288
  };
@@ -40152,7 +40291,44 @@ function createPersistentDriver(provider4, options) {
40152
40291
  const contextPrefix = [sessionContextFor(opened, inputs), opened.contextPrefix].filter((part) => part !== void 0).join("\n\n");
40153
40292
  const input2 = await provider4.turnInput(spec, inputs, contextPrefix || void 0);
40154
40293
  if (signal.aborted) return { outcome: "aborted" };
40155
- const result = await session.sendTurn(input2);
40294
+ const timeoutMs = options.firstOutputTimeoutMs ?? FIRST_OUTPUT_TIMEOUT_MS;
40295
+ const deadline = {
40296
+ session,
40297
+ displayName: provider4.displayName,
40298
+ clock,
40299
+ signal,
40300
+ timeoutMs,
40301
+ heard: () => heardFromProvider,
40302
+ onExpired: () => log.warn("holder.first_output_timeout", {
40303
+ harness: provider4.harness,
40304
+ runId: spec.runId,
40305
+ pid: session.pid,
40306
+ timeoutMs
40307
+ })
40308
+ };
40309
+ const result = await sendWithFirstOutputDeadline(
40310
+ deadline,
40311
+ () => sendTurnWithRetry({
40312
+ harness: provider4.harness,
40313
+ runId: spec.runId,
40314
+ log,
40315
+ clock,
40316
+ signal,
40317
+ send: () => session.sendTurn(input2),
40318
+ sawWork: () => sawWork,
40319
+ beginRetry: () => {
40320
+ sawWork = false;
40321
+ turn.waiting.clear();
40322
+ },
40323
+ reportRetry: (attempt) => record2(
40324
+ noticeUpdate(
40325
+ "info",
40326
+ "provider_retry",
40327
+ `Provider error \u2014 retrying (attempt ${attempt + 1} of ${MAX_AUTO_RETRIES + 1}).`
40328
+ )
40329
+ )
40330
+ })
40331
+ );
40156
40332
  live.providerSessionId = result.providerSessionId ?? live.providerSessionId;
40157
40333
  if (result.outcome.status === "failed" && result.outcome.error.errorKind === "history_rejected") {
40158
40334
  await forgetRejectedSession(session);
@@ -40259,7 +40435,7 @@ function awaitingUpdate(waiting) {
40259
40435
  _meta: { [AWAITING_TOOL_CALLS_META]: [...waiting] }
40260
40436
  };
40261
40437
  }
40262
- var RESUME_UNAVAILABLE;
40438
+ var RESUME_UNAVAILABLE, MAX_AUTO_RETRIES, AUTO_RETRY_BASE_DELAY_MS, NON_WORK_UPDATE_KINDS, FIRST_OUTPUT_TIMEOUT_MS;
40263
40439
  var init_persistent = __esm({
40264
40440
  "src/holder/drivers/persistent.ts"() {
40265
40441
  "use strict";
@@ -40268,6 +40444,21 @@ var init_persistent = __esm({
40268
40444
  init_classify();
40269
40445
  init_driver();
40270
40446
  RESUME_UNAVAILABLE = "The previous session could not be resumed on this machine, so a fresh session was started.";
40447
+ MAX_AUTO_RETRIES = 2;
40448
+ AUTO_RETRY_BASE_DELAY_MS = 1e3;
40449
+ NON_WORK_UPDATE_KINDS = /* @__PURE__ */ new Set([
40450
+ "notice",
40451
+ "usage_update",
40452
+ "state_update",
40453
+ "session_info_update",
40454
+ "available_commands_update",
40455
+ "config_option_update",
40456
+ "user_message",
40457
+ "user_message_chunk",
40458
+ "_alan/log",
40459
+ "_alan/thinking_tokens"
40460
+ ]);
40461
+ FIRST_OUTPUT_TIMEOUT_MS = 3e5;
40271
40462
  }
40272
40463
  });
40273
40464
 
@@ -40906,15 +41097,15 @@ function openCodeTurnInput(run, context) {
40906
41097
  ...images.length ? { imagePaths: images.map((image) => image.path) } : {}
40907
41098
  };
40908
41099
  }
40909
- var import_http4, import_crypto14, import_promises26, import_path10, import_path11, import_url2, import_crypto15, IDLE_SOCKET_MS2, OpenCodeHttpError, OpenCodeClient, OPENCODE_CONFIG_ENV, OPENCODE_ENGINE, TEXT_PARTS, STEP_PARTS, STOPPED_BY_USER, OpenCodeSubagents, NAMED_KINDS, OPENCODE_ABORTED_ERROR, PROVIDER_EVENT_META, TASK_TOOL_NAME, TASK_RESULT_TAG, TASK_ERROR_TAG, PERMISSION_DENIED, FILE_OPERATIONS, PartReader, NOTHING, NON_INTERACTIVE_PERMISSIONS, CONTENT_FILTER_FINISHES, OUTPUT_PARTS, OpenCodeTurn, LISTENING, OUTPUT_TAIL_LINES, IMAGE_TYPES, OpenCodeSession, OPENCODE_MIN_VERSION, OPENCODE_REQUIREMENT, OPENCODE_TESTED_LINE, OPENCODE_SUPPORTED_MAJOR, DEFAULTS4, STORE_LOCKED, NON_INTERACTIVE_RULES, TITLE_LENGTH, MAX_VARIANT_LENGTH;
41100
+ var import_http4, import_crypto14, import_promises26, import_path10, import_path11, import_url2, import_crypto15, IDLE_SOCKET_MS2, OpenCodeHttpError, OpenCodeClient, OPENCODE_CONFIG_ENV, OPENCODE_ENGINE, TEXT_PARTS, STEP_PARTS, STOPPED_BY_USER, OpenCodeSubagents, NAMED_KINDS, OPENCODE_ABORTED_ERROR, PROVIDER_EVENT_META, TASK_TOOL_NAME, TASK_RESULT_TAG, TASK_ERROR_TAG, PERMISSION_DENIED, FILE_OPERATIONS, PartReader, NOTHING, NON_INTERACTIVE_PERMISSIONS, CONTENT_FILTER_FINISHES, TRUNCATED_FINISHES, OUTPUT_PARTS, OpenCodeTurn, LISTENING, OUTPUT_TAIL_LINES, IMAGE_TYPES, OpenCodeSession, OPENCODE_MIN_VERSION, OPENCODE_REQUIREMENT, OPENCODE_TESTED_LINE, OPENCODE_SUPPORTED_MAJOR, DEFAULTS4, STORE_LOCKED, NON_INTERACTIVE_RULES, TITLE_LENGTH, MAX_VARIANT_LENGTH;
40910
41101
  var init_opencode = __esm({
40911
41102
  "../agent-core/dist/providers/opencode.js"() {
40912
41103
  "use strict";
40913
- init_chunk_4G77APXN();
41104
+ init_chunk_A2TG6ROT();
40914
41105
  init_chunk_XC5676SG();
40915
- init_chunk_HBIPWAUI();
41106
+ init_chunk_ZCTKXKYY();
40916
41107
  init_chunk_J2KTV5FP();
40917
- init_chunk_M6YHY2EZ();
41108
+ init_chunk_XE7BX6YP();
40918
41109
  init_chunk_GI3ZGXTY();
40919
41110
  init_chunk_YXWJW7I5();
40920
41111
  import_http4 = require("http");
@@ -41392,6 +41583,7 @@ var init_opencode = __esm({
41392
41583
  "plan_exit"
41393
41584
  ]);
41394
41585
  CONTENT_FILTER_FINISHES = /* @__PURE__ */ new Set(["content-filter", "content_filter"]);
41586
+ TRUNCATED_FINISHES = /* @__PURE__ */ new Set(["unknown", "error"]);
41395
41587
  OUTPUT_PARTS = /* @__PURE__ */ new Set(["text", "reasoning", "thinking", "tool"]);
41396
41588
  OpenCodeTurn = class {
41397
41589
  #root;
@@ -41606,6 +41798,15 @@ var init_opencode = __esm({
41606
41798
  }
41607
41799
  };
41608
41800
  }
41801
+ if (this.#finish && TRUNCATED_FINISHES.has(this.#finish)) {
41802
+ return {
41803
+ status: "failed",
41804
+ error: {
41805
+ ...specForErrorKind("provider_error"),
41806
+ message: "The model's response stream ended before the turn finished. Send your message again to continue."
41807
+ }
41808
+ };
41809
+ }
41609
41810
  if (this.#finish && this.#outputParts.size === 0) {
41610
41811
  return {
41611
41812
  status: "failed",
@@ -41729,6 +41930,9 @@ var init_opencode = __esm({
41729
41930
  get pid() {
41730
41931
  return this.#host.pid;
41731
41932
  }
41933
+ get lastOutputAt() {
41934
+ return this.#host.lastOutputAt;
41935
+ }
41732
41936
  get exited() {
41733
41937
  return this.#host.exited;
41734
41938
  }
@@ -41945,6 +42149,7 @@ var init_opencode = __esm({
41945
42149
  const info = asRecord(last?.info);
41946
42150
  if (asString(info?.role) !== "assistant" || this.#current !== active) return;
41947
42151
  if (asFiniteNumber(asRecord(info?.time)?.completed) === void 0) return;
42152
+ if (asString(info?.finish) === "tool-calls") return;
41948
42153
  if (active.earlierUserMessages.has(asString(info?.parentID))) return;
41949
42154
  const parts22 = asArray(last?.parts).flatMap((part) => {
41950
42155
  const record2 = asRecord(part);
@@ -42730,11 +42935,11 @@ var import_crypto16, import_promises27, FACTORY_API_VERSION, FACTORY_PROTOCOL_VE
42730
42935
  var init_droid = __esm({
42731
42936
  "../agent-core/dist/providers/droid.js"() {
42732
42937
  "use strict";
42733
- init_chunk_4G77APXN();
42938
+ init_chunk_A2TG6ROT();
42734
42939
  init_chunk_XC5676SG();
42735
- init_chunk_HBIPWAUI();
42940
+ init_chunk_ZCTKXKYY();
42736
42941
  init_chunk_J2KTV5FP();
42737
- init_chunk_M6YHY2EZ();
42942
+ init_chunk_XE7BX6YP();
42738
42943
  init_chunk_GI3ZGXTY();
42739
42944
  init_chunk_YXWJW7I5();
42740
42945
  init_runtime_v2();
@@ -42921,6 +43126,9 @@ var init_droid = __esm({
42921
43126
  get pid() {
42922
43127
  return this.#host.pid;
42923
43128
  }
43129
+ get lastOutputAt() {
43130
+ return this.#host.lastOutputAt;
43131
+ }
42924
43132
  get exited() {
42925
43133
  return this.#host.exited;
42926
43134
  }
@@ -43837,10 +44045,10 @@ var init_antigravity = __esm({
43837
44045
  "../agent-core/dist/providers/antigravity.js"() {
43838
44046
  "use strict";
43839
44047
  init_chunk_SBT5W7L4();
43840
- init_chunk_4G77APXN();
44048
+ init_chunk_A2TG6ROT();
43841
44049
  init_chunk_XC5676SG();
43842
- init_chunk_HBIPWAUI();
43843
- init_chunk_M6YHY2EZ();
44050
+ init_chunk_ZCTKXKYY();
44051
+ init_chunk_XE7BX6YP();
43844
44052
  init_chunk_GI3ZGXTY();
43845
44053
  init_chunk_YXWJW7I5();
43846
44054
  import_promises28 = require("fs/promises");
@@ -44541,11 +44749,11 @@ var import_promises29, import_path15, import_crypto18, COMMAND_CODE_GRAMMAR_NAME
44541
44749
  var init_command_code = __esm({
44542
44750
  "../agent-core/dist/providers/command-code.js"() {
44543
44751
  "use strict";
44544
- init_chunk_4G77APXN();
44752
+ init_chunk_A2TG6ROT();
44545
44753
  init_chunk_XC5676SG();
44546
- init_chunk_HBIPWAUI();
44754
+ init_chunk_ZCTKXKYY();
44547
44755
  init_chunk_J2KTV5FP();
44548
- init_chunk_M6YHY2EZ();
44756
+ init_chunk_XE7BX6YP();
44549
44757
  init_chunk_GI3ZGXTY();
44550
44758
  init_chunk_YXWJW7I5();
44551
44759
  import_promises29 = require("fs/promises");
@@ -45664,7 +45872,7 @@ async function assertValidBranch(git, repoRoot, branch, signal) {
45664
45872
  var import_node_child_process = require("child_process");
45665
45873
 
45666
45874
  // ../agent-core/dist/process.js
45667
- init_chunk_M6YHY2EZ();
45875
+ init_chunk_XE7BX6YP();
45668
45876
  init_chunk_YXWJW7I5();
45669
45877
 
45670
45878
  // src/capabilities/git/run-git.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alan-ai-hq/agent-manager-linux-arm64",
3
- "version": "0.1.148",
3
+ "version": "0.1.149",
4
4
  "description": "Alan machine runtime (alan-agent) for one platform: the official Node.js binary, the runtime bundle and its launcher. Installed by @alan-ai-hq/agent-manager.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "homepage": "https://tryalan.ai",