@alan-ai-hq/agent-manager-linux-arm64 0.1.175 → 0.1.176

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 +1067 -676
  2. package/alan-holder.cjs +274 -62
  3. package/package.json +1 -1
package/alan-holder.cjs CHANGED
@@ -26017,7 +26017,11 @@ var init_models = __esm({
26017
26017
  sortOrder: 10,
26018
26018
  upstreamModelId: "deepseek/deepseek-v4.1-flash-1017",
26019
26019
  contextWindow: 1048576,
26020
- maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS
26020
+ maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS,
26021
+ inputPriceMicroUsdPerMtok: 15e4,
26022
+ outputPriceMicroUsdPerMtok: 6e5,
26023
+ cacheReadPriceMicroUsdPerMtok: 3e3,
26024
+ routing: { tier: "workhorse", priority: 10, strengths: ["speed", "cost", "general"] }
26021
26025
  },
26022
26026
  {
26023
26027
  id: "deepseek/deepseek-v4-pro",
@@ -26028,7 +26032,10 @@ var init_models = __esm({
26028
26032
  sortOrder: 20,
26029
26033
  upstreamModelId: "deepseek/deepseek-v4-pro",
26030
26034
  contextWindow: 1048576,
26031
- maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS
26035
+ maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS,
26036
+ inputPriceMicroUsdPerMtok: 816234,
26037
+ outputPriceMicroUsdPerMtok: 1632468,
26038
+ cacheReadPriceMicroUsdPerMtok: 68020
26032
26039
  },
26033
26040
  {
26034
26041
  id: "particle-ai/particle-1",
@@ -26039,7 +26046,10 @@ var init_models = __esm({
26039
26046
  sortOrder: 25,
26040
26047
  upstreamModelId: "particle-ai/particle-1",
26041
26048
  contextWindow: 1048576,
26042
- maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS
26049
+ maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS,
26050
+ inputPriceMicroUsdPerMtok: 25e4,
26051
+ outputPriceMicroUsdPerMtok: 1e6,
26052
+ cacheReadPriceMicroUsdPerMtok: 3e3
26043
26053
  },
26044
26054
  {
26045
26055
  id: "z-ai/glm-5.3",
@@ -26050,7 +26060,15 @@ var init_models = __esm({
26050
26060
  sortOrder: 30,
26051
26061
  upstreamModelId: "z-ai/glm-5.3",
26052
26062
  contextWindow: 1048576,
26053
- maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS
26063
+ maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS,
26064
+ inputPriceMicroUsdPerMtok: 8e4,
26065
+ outputPriceMicroUsdPerMtok: 36e5,
26066
+ cacheReadPriceMicroUsdPerMtok: 76e3,
26067
+ routing: {
26068
+ tier: "strong",
26069
+ priority: 20,
26070
+ strengths: ["architecture", "refactoring", "debugging"]
26071
+ }
26054
26072
  },
26055
26073
  {
26056
26074
  id: "z-ai/glm-5.3-flash",
@@ -26061,7 +26079,39 @@ var init_models = __esm({
26061
26079
  sortOrder: 40,
26062
26080
  upstreamModelId: "z-ai/glm-5.3-flash",
26063
26081
  contextWindow: 1048576,
26064
- maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS
26082
+ maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS,
26083
+ inputPriceMicroUsdPerMtok: 15e4,
26084
+ outputPriceMicroUsdPerMtok: 5e5,
26085
+ cacheReadPriceMicroUsdPerMtok: 3e4,
26086
+ routing: { tier: "workhorse", priority: 20, strengths: ["ui_design", "speed"] }
26087
+ },
26088
+ {
26089
+ id: "z-ai/glm-5.3-flashx",
26090
+ name: "GLM 5.3 FlashX",
26091
+ description: "Mid-tier multimodal GLM between Flash and Prime",
26092
+ enabled: true,
26093
+ isDefault: false,
26094
+ sortOrder: 50,
26095
+ upstreamModelId: "z-ai/glm-5.3-flashx",
26096
+ contextWindow: 1048576,
26097
+ maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS,
26098
+ inputPriceMicroUsdPerMtok: 37e4,
26099
+ outputPriceMicroUsdPerMtok: 125e4,
26100
+ cacheReadPriceMicroUsdPerMtok: 9e4
26101
+ },
26102
+ {
26103
+ id: "z-ai/glm-5.3-prime",
26104
+ name: "GLM 5.3 Prime",
26105
+ description: "Z.ai's premium GLM tier for demanding work",
26106
+ enabled: true,
26107
+ isDefault: false,
26108
+ sortOrder: 60,
26109
+ upstreamModelId: "z-ai/glm-5.3-prime",
26110
+ contextWindow: 1e6,
26111
+ maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS,
26112
+ inputPriceMicroUsdPerMtok: 28e5,
26113
+ outputPriceMicroUsdPerMtok: 88e5,
26114
+ cacheReadPriceMicroUsdPerMtok: 56e4
26065
26115
  },
26066
26116
  {
26067
26117
  id: "qwen/qwen3.8-27b",
@@ -26069,10 +26119,27 @@ var init_models = __esm({
26069
26119
  description: "Qwen3.8 open-weight coding and agentic work",
26070
26120
  enabled: true,
26071
26121
  isDefault: false,
26072
- sortOrder: 50,
26122
+ sortOrder: 70,
26073
26123
  upstreamModelId: "qwen/qwen3.8-27b",
26074
26124
  contextWindow: 1e6,
26075
- maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS
26125
+ maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS,
26126
+ inputPriceMicroUsdPerMtok: 15e4,
26127
+ outputPriceMicroUsdPerMtok: 1875e3,
26128
+ cacheReadPriceMicroUsdPerMtok: 37500
26129
+ },
26130
+ {
26131
+ id: "qwen/qwen3.8-max-prime",
26132
+ name: "Qwen3.8 Max Prime",
26133
+ description: "Qwen's flagship tier for complex agentic work",
26134
+ enabled: true,
26135
+ isDefault: false,
26136
+ sortOrder: 80,
26137
+ upstreamModelId: "qwen/qwen3.8-max-prime",
26138
+ contextWindow: 1e6,
26139
+ maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS,
26140
+ inputPriceMicroUsdPerMtok: 4e6,
26141
+ outputPriceMicroUsdPerMtok: 12e6,
26142
+ cacheReadPriceMicroUsdPerMtok: 5e5
26076
26143
  },
26077
26144
  {
26078
26145
  id: "moonshotai/kimi-k3",
@@ -26080,10 +26147,85 @@ var init_models = __esm({
26080
26147
  description: "Moonshot's 2.8T open-weight flagship",
26081
26148
  enabled: true,
26082
26149
  isDefault: false,
26083
- sortOrder: 60,
26150
+ sortOrder: 90,
26084
26151
  upstreamModelId: "moonshotai/kimi-k3",
26085
26152
  contextWindow: 1048576,
26086
- maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS
26153
+ maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS,
26154
+ inputPriceMicroUsdPerMtok: 192e3,
26155
+ outputPriceMicroUsdPerMtok: 15e6,
26156
+ cacheReadPriceMicroUsdPerMtok: 182e3,
26157
+ routing: { tier: "strong", priority: 10, strengths: ["architecture", "long_context"] }
26158
+ },
26159
+ {
26160
+ id: "moonshotai/kimi-k3.1-pro",
26161
+ name: "Kimi K3.1 Pro",
26162
+ description: "Moonshot's updated K3 flagship",
26163
+ enabled: true,
26164
+ isDefault: false,
26165
+ sortOrder: 100,
26166
+ upstreamModelId: "moonshotai/kimi-k3.1-pro",
26167
+ contextWindow: 1048576,
26168
+ maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS,
26169
+ inputPriceMicroUsdPerMtok: 2e6,
26170
+ outputPriceMicroUsdPerMtok: 1e7,
26171
+ cacheReadPriceMicroUsdPerMtok: 2e5
26172
+ },
26173
+ {
26174
+ id: "minimax/minimax-m3.1-flash",
26175
+ name: "MiniMax M3.1 Flash",
26176
+ description: "Fast multimodal MiniMax for high-volume work",
26177
+ enabled: true,
26178
+ isDefault: false,
26179
+ sortOrder: 110,
26180
+ upstreamModelId: "minimax/minimax-m3.1-flash",
26181
+ contextWindow: 1048576,
26182
+ maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS,
26183
+ inputPriceMicroUsdPerMtok: 15e4,
26184
+ outputPriceMicroUsdPerMtok: 6e5,
26185
+ cacheReadPriceMicroUsdPerMtok: 15e3,
26186
+ routing: { tier: "workhorse", priority: 30, strengths: ["ui_design", "speed"] }
26187
+ },
26188
+ {
26189
+ id: "minimax/minimax-m3",
26190
+ name: "MiniMax M3",
26191
+ description: "MiniMax's full-size multimodal agentic model",
26192
+ enabled: true,
26193
+ isDefault: false,
26194
+ sortOrder: 120,
26195
+ upstreamModelId: "minimax/minimax-m3",
26196
+ contextWindow: 1048576,
26197
+ maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS,
26198
+ inputPriceMicroUsdPerMtok: 3e5,
26199
+ outputPriceMicroUsdPerMtok: 12e5,
26200
+ cacheReadPriceMicroUsdPerMtok: 6e4
26201
+ },
26202
+ {
26203
+ id: "nvidia/nemotron-3.5-lightning",
26204
+ name: "Nemotron 3.5 Lightning",
26205
+ description: "Small, fast Nemotron for high-volume work",
26206
+ enabled: true,
26207
+ isDefault: false,
26208
+ sortOrder: 130,
26209
+ upstreamModelId: "nvidia/nemotron-3.5-lightning",
26210
+ contextWindow: 262144,
26211
+ maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS,
26212
+ inputPriceMicroUsdPerMtok: 7e4,
26213
+ outputPriceMicroUsdPerMtok: 2e5,
26214
+ cacheReadPriceMicroUsdPerMtok: 4e4
26215
+ },
26216
+ {
26217
+ id: "nvidia/nemotron-3.5-super-vl",
26218
+ name: "Nemotron 3.5 Super VL",
26219
+ description: "Vision-language Nemotron with a 1M-token window",
26220
+ enabled: true,
26221
+ isDefault: false,
26222
+ sortOrder: 140,
26223
+ upstreamModelId: "nvidia/nemotron-3.5-super-vl",
26224
+ contextWindow: 1048576,
26225
+ maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS,
26226
+ inputPriceMicroUsdPerMtok: 15e4,
26227
+ outputPriceMicroUsdPerMtok: 5e5,
26228
+ cacheReadPriceMicroUsdPerMtok: 2e4
26087
26229
  },
26088
26230
  {
26089
26231
  id: "nvidia/nemotron-3-nano-30b-a3b",
@@ -26091,10 +26233,13 @@ var init_models = __esm({
26091
26233
  description: "Fast Nemotron via Alan",
26092
26234
  enabled: true,
26093
26235
  isDefault: false,
26094
- sortOrder: 70,
26236
+ sortOrder: 150,
26095
26237
  upstreamModelId: "nvidia/nemotron-3-nano-30b-a3b",
26096
26238
  contextWindow: 262144,
26097
- maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS
26239
+ maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS,
26240
+ inputPriceMicroUsdPerMtok: 6e4,
26241
+ outputPriceMicroUsdPerMtok: 24e4,
26242
+ cacheReadPriceMicroUsdPerMtok: 12e3
26098
26243
  },
26099
26244
  {
26100
26245
  id: "nvidia/nemotron-3-super-120b-a12b",
@@ -26102,10 +26247,13 @@ var init_models = __esm({
26102
26247
  description: "Mid-tier Nemotron via Alan",
26103
26248
  enabled: true,
26104
26249
  isDefault: false,
26105
- sortOrder: 80,
26250
+ sortOrder: 160,
26106
26251
  upstreamModelId: "nvidia/nemotron-3-super-120b-a12b",
26107
- contextWindow: 262144,
26108
- maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS
26252
+ contextWindow: 1048576,
26253
+ maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS,
26254
+ inputPriceMicroUsdPerMtok: 3e5,
26255
+ outputPriceMicroUsdPerMtok: 24e5,
26256
+ cacheReadPriceMicroUsdPerMtok: 15e4
26109
26257
  },
26110
26258
  {
26111
26259
  id: "nvidia/nemotron-3-ultra-550b-a55b",
@@ -26113,21 +26261,13 @@ var init_models = __esm({
26113
26261
  description: "Largest Nemotron via Alan",
26114
26262
  enabled: true,
26115
26263
  isDefault: false,
26116
- sortOrder: 90,
26264
+ sortOrder: 170,
26117
26265
  upstreamModelId: "nvidia/nemotron-3-ultra-550b-a55b",
26118
26266
  contextWindow: 262144,
26119
- maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS
26120
- },
26121
- {
26122
- id: "nvidia/nemotron-3.5-lightning",
26123
- name: "Nemotron 3.5 Lightning",
26124
- description: "Small, fast Nemotron for high-volume work",
26125
- enabled: true,
26126
- isDefault: false,
26127
- sortOrder: 100,
26128
- upstreamModelId: "nvidia/nemotron-3.5-lightning",
26129
- contextWindow: 262144,
26130
- maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS
26267
+ maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS,
26268
+ inputPriceMicroUsdPerMtok: 6e5,
26269
+ outputPriceMicroUsdPerMtok: 24e5,
26270
+ cacheReadPriceMicroUsdPerMtok: 12e4
26131
26271
  },
26132
26272
  {
26133
26273
  id: "meta/muse-spark-1.3-contributor",
@@ -26135,10 +26275,13 @@ var init_models = __esm({
26135
26275
  description: "Cost-efficient Muse Spark (contributor tier)",
26136
26276
  enabled: true,
26137
26277
  isDefault: false,
26138
- sortOrder: 110,
26278
+ sortOrder: 180,
26139
26279
  upstreamModelId: "meta/muse-spark-1.3-contributor",
26140
26280
  contextWindow: 1048576,
26141
- maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS
26281
+ maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS,
26282
+ inputPriceMicroUsdPerMtok: 1e5,
26283
+ outputPriceMicroUsdPerMtok: 2e5,
26284
+ cacheReadPriceMicroUsdPerMtok: 2e3
26142
26285
  },
26143
26286
  {
26144
26287
  id: "meta/muse-spark-1.3",
@@ -26146,10 +26289,41 @@ var init_models = __esm({
26146
26289
  description: "Meta Muse Spark multimodal agentic coding",
26147
26290
  enabled: true,
26148
26291
  isDefault: false,
26149
- sortOrder: 120,
26292
+ sortOrder: 190,
26150
26293
  upstreamModelId: "meta/muse-spark-1.3",
26151
26294
  contextWindow: 1048576,
26152
- maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS
26295
+ maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS,
26296
+ inputPriceMicroUsdPerMtok: 125e4,
26297
+ outputPriceMicroUsdPerMtok: 425e4,
26298
+ cacheReadPriceMicroUsdPerMtok: 15e4
26299
+ },
26300
+ {
26301
+ id: "meta/muse-spark-open",
26302
+ name: "Muse Spark Open",
26303
+ description: "Open-weight Muse Spark with audio and video input",
26304
+ enabled: true,
26305
+ isDefault: false,
26306
+ sortOrder: 200,
26307
+ upstreamModelId: "meta/muse-spark-open",
26308
+ contextWindow: 1048576,
26309
+ maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS,
26310
+ inputPriceMicroUsdPerMtok: 125e4,
26311
+ outputPriceMicroUsdPerMtok: 425e4,
26312
+ cacheReadPriceMicroUsdPerMtok: 15e4
26313
+ },
26314
+ {
26315
+ id: "meta/muse-wonder",
26316
+ name: "Muse Wonder",
26317
+ description: "Meta's premium Muse tier",
26318
+ enabled: true,
26319
+ isDefault: false,
26320
+ sortOrder: 210,
26321
+ upstreamModelId: "meta/muse-wonder",
26322
+ contextWindow: 1048576,
26323
+ maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS,
26324
+ inputPriceMicroUsdPerMtok: 4e6,
26325
+ outputPriceMicroUsdPerMtok: 2e7,
26326
+ cacheReadPriceMicroUsdPerMtok: 2e5
26153
26327
  },
26154
26328
  {
26155
26329
  id: "meta/muse-spark-1.2-contributor",
@@ -26157,32 +26331,41 @@ var init_models = __esm({
26157
26331
  description: "Prior Muse Spark contributor tier",
26158
26332
  enabled: true,
26159
26333
  isDefault: false,
26160
- sortOrder: 130,
26334
+ sortOrder: 220,
26161
26335
  upstreamModelId: "meta/muse-spark-1.2-contributor",
26162
26336
  contextWindow: 1048576,
26163
- maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS
26337
+ maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS,
26338
+ inputPriceMicroUsdPerMtok: 1e5,
26339
+ outputPriceMicroUsdPerMtok: 2e5,
26340
+ cacheReadPriceMicroUsdPerMtok: 2e3
26164
26341
  },
26165
26342
  {
26166
- id: "minimax/minimax-m3.1-flash",
26167
- name: "MiniMax M3.1 Flash",
26168
- description: "Fast multimodal MiniMax for high-volume work",
26343
+ id: "x-ai/grok-4.7",
26344
+ name: "Grok 4.7",
26345
+ description: "xAI's current Grok for agentic coding",
26169
26346
  enabled: true,
26170
26347
  isDefault: false,
26171
- sortOrder: 140,
26172
- upstreamModelId: "minimax/minimax-m3.1-flash",
26173
- contextWindow: 1048576,
26174
- maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS
26348
+ sortOrder: 230,
26349
+ upstreamModelId: "x-ai/grok-4.7",
26350
+ contextWindow: 5e5,
26351
+ maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS,
26352
+ inputPriceMicroUsdPerMtok: 2e6,
26353
+ outputPriceMicroUsdPerMtok: 6e6,
26354
+ cacheReadPriceMicroUsdPerMtok: 5e5
26175
26355
  },
26176
26356
  {
26177
- id: "minimax/minimax-m3",
26178
- name: "MiniMax M3",
26179
- description: "MiniMax's full-size multimodal agentic model",
26357
+ id: "google/gemini-4-argon",
26358
+ name: "Gemini 4 Argon",
26359
+ description: "Google's flagship reasoning model for complex software work",
26180
26360
  enabled: true,
26181
26361
  isDefault: false,
26182
- sortOrder: 150,
26183
- upstreamModelId: "minimax/minimax-m3",
26362
+ sortOrder: 240,
26363
+ upstreamModelId: "google/gemini-4-argon",
26184
26364
  contextWindow: 1048576,
26185
- maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS
26365
+ maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS,
26366
+ inputPriceMicroUsdPerMtok: 2e6,
26367
+ outputPriceMicroUsdPerMtok: 1e7,
26368
+ cacheReadPriceMicroUsdPerMtok: 1e5
26186
26369
  }
26187
26370
  ];
26188
26371
  DEFAULT_HARNESS_MODEL_ID = HARNESS_MODEL_SEEDS.find((model) => model.isDefault)?.id ?? HARNESS_MODEL_SEEDS[0].id;
@@ -31961,7 +32144,7 @@ function readText(incoming, maxBytes) {
31961
32144
  incoming.on("error", reject);
31962
32145
  });
31963
32146
  }
31964
- var import_node_crypto15, import_node_http3, IDLE_SOCKET_MS2, OpenCodeHttpError, BASE62, messageIdClock, OpenCodeClient;
32147
+ var import_node_crypto15, import_node_http3, IDLE_SOCKET_MS2, OpenCodeHttpError, OpenCodeTimeoutError, BASE62, messageIdClock, OpenCodeClient;
31965
32148
  var init_client = __esm({
31966
32149
  "../agent-core/src/providers/opencode/client.ts"() {
31967
32150
  "use strict";
@@ -31979,6 +32162,12 @@ var init_client = __esm({
31979
32162
  this.body = body;
31980
32163
  }
31981
32164
  };
32165
+ OpenCodeTimeoutError = class extends Error {
32166
+ constructor(what, ms, engine = "OpenCode") {
32167
+ super(`${engine} ${what} request timed out after ${ms} ms`);
32168
+ this.name = "OpenCodeTimeoutError";
32169
+ }
32170
+ };
31982
32171
  BASE62 = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
31983
32172
  messageIdClock = { at: 0, counter: 0 };
31984
32173
  OpenCodeClient = class {
@@ -32006,6 +32195,7 @@ var init_client = __esm({
32006
32195
  }
32007
32196
  #open(call) {
32008
32197
  return new Promise((resolve10, reject) => {
32198
+ const deadline = AbortSignal.timeout(this.#limits.requestTimeoutMs);
32009
32199
  const outgoing = (0, import_node_http3.request)(
32010
32200
  `${this.baseUrl}${call.path}`,
32011
32201
  {
@@ -32013,20 +32203,26 @@ var init_client = __esm({
32013
32203
  headers: call.headers,
32014
32204
  agent: this.#agent,
32015
32205
  timeout: call.stream ? this.#limits.streamIdleMs : this.#limits.requestTimeoutMs,
32016
- signal: call.stream ? this.#lifetime.signal : AbortSignal.any([
32017
- this.#lifetime.signal,
32018
- AbortSignal.timeout(this.#limits.requestTimeoutMs)
32019
- ])
32206
+ signal: call.stream ? this.#lifetime.signal : AbortSignal.any([this.#lifetime.signal, deadline])
32020
32207
  },
32021
32208
  resolve10
32022
32209
  );
32023
- outgoing.on("timeout", () => outgoing.destroy(new Error("OpenCode request timed out")));
32024
- outgoing.on("error", reject);
32210
+ outgoing.on("timeout", () => outgoing.destroy(this.#timedOut(call)));
32211
+ outgoing.on("error", (error62) => {
32212
+ const expired = !call.stream && deadline.aborted && !this.#lifetime.signal.aborted;
32213
+ reject(expired ? this.#timedOut(call) : error62);
32214
+ });
32025
32215
  outgoing.end(call.body);
32026
32216
  });
32027
32217
  }
32218
+ /** A quiet event stream stays a plain Error: a first start may still be installing, so it is not retried. */
32219
+ #timedOut(call) {
32220
+ if (call.stream) return new Error("OpenCode request timed out");
32221
+ return new OpenCodeTimeoutError(call.what, this.#limits.requestTimeoutMs, this.#engine);
32222
+ }
32028
32223
  async #call(what, method, path, body) {
32029
32224
  const response = await this.#open({
32225
+ what,
32030
32226
  method,
32031
32227
  path,
32032
32228
  headers: {
@@ -32165,6 +32361,7 @@ var init_client = __esm({
32165
32361
  /** Subscribes to the server-wide bus. */
32166
32362
  async events(handlers) {
32167
32363
  const response = await this.#open({
32364
+ what: "event stream",
32168
32365
  method: "GET",
32169
32366
  path: "/event",
32170
32367
  stream: true,
@@ -33926,6 +34123,7 @@ async function openSession(client, session, spec, log) {
33926
34123
  return { id, resumed: false };
33927
34124
  }
33928
34125
  function isOpenTimeout(error62) {
34126
+ if (error62 instanceof OpenCodeTimeoutError) return true;
33929
34127
  return error62 instanceof CoreFault && error62.code === "protocol_violation";
33930
34128
  }
33931
34129
  async function openOnce(spec, password, options) {
@@ -33941,7 +34139,9 @@ async function openOnce(spec, password, options) {
33941
34139
  throw error62;
33942
34140
  });
33943
34141
  try {
33944
- const client = new OpenCodeClient(url2, password, options.engine.label);
34142
+ const client = new OpenCodeClient(url2, password, options.engine.label, {
34143
+ requestTimeoutMs: options.requestTimeoutMs
34144
+ });
33945
34145
  const alive = (work) => whileAlive(session, options, work);
33946
34146
  await withDeadline2(
33947
34147
  alive(checkHealth(client, options.log)),
@@ -33990,24 +34190,33 @@ async function openWithRetries(spec, password, options) {
33990
34190
  }
33991
34191
  }
33992
34192
  }
33993
- function createOpenCodeDriver(options = {}) {
33994
- const resolved = {
34193
+ function resolveOpenLimits(options) {
34194
+ return {
34195
+ openTimeoutMs: options.openTimeoutMs ?? DEFAULTS2.openTimeoutMs,
34196
+ requestTimeoutMs: options.requestTimeoutMs ?? DEFAULTS2.requestTimeoutMs,
34197
+ bootstrapTimeoutMs: options.bootstrapTimeoutMs ?? DEFAULTS2.bootstrapTimeoutMs,
34198
+ slowBootstrapMs: options.slowBootstrapMs ?? DEFAULTS2.slowBootstrapMs,
34199
+ openAttempts: options.openAttempts ?? DEFAULTS2.openAttempts,
34200
+ startAttempts: options.startAttempts ?? DEFAULTS2.startAttempts
34201
+ };
34202
+ }
34203
+ function resolveOptions(options) {
34204
+ return {
33995
34205
  clock: options.clock ?? systemClock2,
33996
34206
  log: options.log ?? silentLog,
33997
34207
  interruptGraceMs: options.interruptGraceMs ?? DEFAULTS2.interruptGraceMs,
33998
34208
  terminateGraceMs: options.terminateGraceMs ?? DEFAULTS2.terminateGraceMs,
33999
34209
  stdoutDrainMs: options.stdoutDrainMs ?? DEFAULTS2.stdoutDrainMs,
34000
34210
  descendantScanMs: options.descendantScanMs ?? DEFAULTS2.descendantScanMs,
34001
- openTimeoutMs: options.openTimeoutMs ?? DEFAULTS2.openTimeoutMs,
34002
- bootstrapTimeoutMs: options.bootstrapTimeoutMs ?? DEFAULTS2.bootstrapTimeoutMs,
34003
- slowBootstrapMs: options.slowBootstrapMs ?? DEFAULTS2.slowBootstrapMs,
34004
- openAttempts: options.openAttempts ?? DEFAULTS2.openAttempts,
34005
- startAttempts: options.startAttempts ?? DEFAULTS2.startAttempts,
34006
34211
  reconnectAttempts: options.reconnectAttempts ?? DEFAULTS2.reconnectAttempts,
34007
34212
  reconnectDelayMs: options.reconnectDelayMs ?? DEFAULTS2.reconnectDelayMs,
34008
34213
  engine: options.engine ?? OPENCODE_ENGINE,
34009
- stopTaskTimeoutMs: options.stopTaskTimeoutMs ?? DEFAULTS2.stopTaskTimeoutMs
34214
+ stopTaskTimeoutMs: options.stopTaskTimeoutMs ?? DEFAULTS2.stopTaskTimeoutMs,
34215
+ ...resolveOpenLimits(options)
34010
34216
  };
34217
+ }
34218
+ function createOpenCodeDriver(options = {}) {
34219
+ const resolved = resolveOptions(options);
34011
34220
  return {
34012
34221
  name: "opencode_serve",
34013
34222
  open: async (planned) => {
@@ -34060,6 +34269,7 @@ var init_driver3 = __esm({
34060
34269
  stdoutDrainMs: 2e3,
34061
34270
  descendantScanMs: 5e3,
34062
34271
  openTimeoutMs: 6e4,
34272
+ requestTimeoutMs: 3e4,
34063
34273
  bootstrapTimeoutMs: 6e5,
34064
34274
  slowBootstrapMs: 5e3,
34065
34275
  openAttempts: 2,
@@ -53781,6 +53991,7 @@ function openRunLog(path, clock) {
53781
53991
  (0, import_node_fs21.ftruncateSync)(fd, size);
53782
53992
  (0, import_node_fs21.fsyncSync)(fd);
53783
53993
  }
53994
+ const droppedTailBytes = fileSize - size;
53784
53995
  let dirty = false;
53785
53996
  const sync = () => {
53786
53997
  (0, import_node_fs21.fsyncSync)(fd);
@@ -53809,6 +54020,7 @@ function openRunLog(path, clock) {
53809
54020
  return toByteOffset(size);
53810
54021
  },
53811
54022
  size: () => toByteOffset(size),
54023
+ droppedTailBytes,
53812
54024
  syncIfDirty: () => {
53813
54025
  if (dirty) sync();
53814
54026
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alan-ai-hq/agent-manager-linux-arm64",
3
- "version": "0.1.175",
3
+ "version": "0.1.176",
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",