@alan-ai-hq/agent-manager-linux-arm64 0.1.174 → 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.
package/alan-holder.cjs CHANGED
@@ -20644,6 +20644,11 @@ var init_activity_lease = __esm({
20644
20644
  mainThreadLagMs: external_exports.number().int().nonnegative(),
20645
20645
  runs: external_exports.array(leasedRunSchema),
20646
20646
  holders: external_exports.array(leasedHolderSchema),
20647
+ /**
20648
+ * Desired runs not started because their conversation is still running an earlier turn.
20649
+ * Absent from older runtimes.
20650
+ */
20651
+ busyRunIds: external_exports.array(runIdSchema).max(200).optional(),
20647
20652
  vm: leasedVmPressureSchema.nullable()
20648
20653
  });
20649
20654
  activityLeaseAckSchema = external_exports.object({
@@ -21533,6 +21538,104 @@ var init_contracts = __esm({
21533
21538
  }
21534
21539
  });
21535
21540
 
21541
+ // ../shared/src/constants/branding.ts
21542
+ var ALAN_GIT_BOT_EMAIL;
21543
+ var init_branding = __esm({
21544
+ "../shared/src/constants/branding.ts"() {
21545
+ "use strict";
21546
+ ALAN_GIT_BOT_EMAIL = "agent@tryalan.ai";
21547
+ }
21548
+ });
21549
+
21550
+ // ../shared/src/runtime-v2/commit-attribution.ts
21551
+ function coAuthorTrailer(coAuthor) {
21552
+ return `Co-Authored-By: ${coAuthor.name} <${coAuthor.email}>`;
21553
+ }
21554
+ function commitAttributionScript() {
21555
+ const pattern = FOREIGN_ATTRIBUTION_PATTERN.replaceAll("[ ]", "[[:blank:]]");
21556
+ return `#!/bin/sh
21557
+ # Managed by Alan; rewritten whenever the runtime starts.
21558
+ name=$(basename "$0")
21559
+ dir=$(cd "$(dirname "$0")" && pwd -P)
21560
+ [ "$name" = ${COMMIT_ATTRIBUTION_SCRIPT} ] || dir=$(dirname "$dir")
21561
+ pattern='${pattern}'
21562
+ coauthor=$(cat "$dir/${COMMIT_ATTRIBUTION_COAUTHOR_FILE}" 2>/dev/null)
21563
+ author_email=$(git var GIT_AUTHOR_IDENT 2>/dev/null | sed -n 's/.*<\\(.*\\)>.*/\\1/p')
21564
+
21565
+ normalize() {
21566
+ if [ -n "$coauthor" ] && [ "$author_email" != '${ALAN_GIT_BOT_EMAIL}' ] &&
21567
+ ! printf '%s' "$coauthor" | grep -qiF "<$author_email>"; then
21568
+ grep -viE "$pattern" | git interpret-trailers --trailer "Co-Authored-By: $coauthor"
21569
+ else
21570
+ grep -viE "$pattern"
21571
+ fi
21572
+ }
21573
+
21574
+ if [ "$name" = ${COMMIT_ATTRIBUTION_SCRIPT} ]; then
21575
+ normalize
21576
+ exit 0
21577
+ fi
21578
+
21579
+ if [ "$name" = prepare-commit-msg ] && [ -f "$1" ]; then
21580
+ case "$2" in
21581
+ merge|squash) ;;
21582
+ *) normalize < "$1" > "$1.alan" && mv "$1.alan" "$1" || rm -f "$1.alan" ;;
21583
+ esac
21584
+ fi
21585
+
21586
+ own=$(git config --local --get core.hooksPath || git config --global --get core.hooksPath || git config --system --get core.hooksPath)
21587
+ if [ -z "$own" ]; then
21588
+ own="$(git rev-parse --git-common-dir)/hooks"
21589
+ else
21590
+ case "$own" in
21591
+ "~/"*) own="$HOME/\${own#\\~/}" ;;
21592
+ /*) ;;
21593
+ *) own="$(git rev-parse --show-toplevel)/$own" ;;
21594
+ esac
21595
+ fi
21596
+ # Skips this script and the per-repo hook older sandboxes installed; both carry the marker.
21597
+ [ -x "$own/$name" ] && ! grep -qs '^# Managed by Alan' "$own/$name" && exec "$own/$name" "$@"
21598
+ exit 0
21599
+ `;
21600
+ }
21601
+ var TRAILER_VALUE, gitCoAuthorSchema, FOREIGN_ATTRIBUTION_PATTERN, FOREIGN_ATTRIBUTION, COMMIT_ATTRIBUTION_HOOKS, COMMIT_ATTRIBUTION_SCRIPT, COMMIT_ATTRIBUTION_COAUTHOR_FILE;
21602
+ var init_commit_attribution = __esm({
21603
+ "../shared/src/runtime-v2/commit-attribution.ts"() {
21604
+ "use strict";
21605
+ init_zod();
21606
+ init_branding();
21607
+ TRAILER_VALUE = /^[^\r\n<>]+$/;
21608
+ gitCoAuthorSchema = external_exports.object({
21609
+ name: external_exports.string().min(1).max(256).regex(TRAILER_VALUE),
21610
+ email: external_exports.string().min(3).max(320).regex(/^[^\s<>]+@[^\s<>]+$/)
21611
+ });
21612
+ FOREIGN_ATTRIBUTION_PATTERN = "^[ ]*((co-authored-by|assisted-by|generated-by|made-with):|(\u{1F916}[ ]*)?generated (with|by) )";
21613
+ FOREIGN_ATTRIBUTION = new RegExp(FOREIGN_ATTRIBUTION_PATTERN, "iu");
21614
+ COMMIT_ATTRIBUTION_HOOKS = [
21615
+ "applypatch-msg",
21616
+ "pre-applypatch",
21617
+ "post-applypatch",
21618
+ "pre-commit",
21619
+ "pre-merge-commit",
21620
+ "prepare-commit-msg",
21621
+ "commit-msg",
21622
+ "post-commit",
21623
+ "pre-rebase",
21624
+ "post-checkout",
21625
+ "post-merge",
21626
+ "pre-push",
21627
+ "pre-auto-gc",
21628
+ "post-rewrite",
21629
+ "post-index-change",
21630
+ "reference-transaction",
21631
+ "push-to-checkout",
21632
+ "sendemail-validate"
21633
+ ];
21634
+ COMMIT_ATTRIBUTION_SCRIPT = "alan-trailers";
21635
+ COMMIT_ATTRIBUTION_COAUTHOR_FILE = "coauthor";
21636
+ }
21637
+ });
21638
+
21536
21639
  // ../shared/src/runtime-v2/run-context.ts
21537
21640
  function wire() {
21538
21641
  return (schema) => schema;
@@ -21694,6 +21797,7 @@ var init_desired_state = __esm({
21694
21797
  init_cloud_repositories();
21695
21798
  init_contracts();
21696
21799
  init_agent_context();
21800
+ init_commit_attribution();
21697
21801
  init_ids();
21698
21802
  init_run_context();
21699
21803
  init_workspace();
@@ -21748,7 +21852,9 @@ var init_desired_state = __esm({
21748
21852
  contextGraphEnabled: external_exports.boolean().optional(),
21749
21853
  cloudEnvironmentId: external_exports.guid().optional(),
21750
21854
  sandboxId: external_exports.string().min(1).optional(),
21751
- localRepoUrls: external_exports.array(external_exports.string().min(1)).optional()
21855
+ localRepoUrls: external_exports.array(external_exports.string().min(1)).optional(),
21856
+ /** The deployed GitHub App's bot, credited on every commit the turn makes; absent from older servers. */
21857
+ gitCoAuthor: gitCoAuthorSchema.optional()
21752
21858
  // Never here: the provider API key. The holder fetches it per run (RUN_PROVIDER_CREDENTIAL_PATH).
21753
21859
  });
21754
21860
  desiredRunSchema = external_exports.object({
@@ -22840,6 +22946,7 @@ var init_runtime_v2 = __esm({
22840
22946
  init_activity_lease();
22841
22947
  init_agent_context();
22842
22948
  init_capabilities();
22949
+ init_commit_attribution();
22843
22950
  init_desired_state();
22844
22951
  init_files();
22845
22952
  init_git_capability();
@@ -25811,13 +25918,6 @@ var init_agent_package = __esm({
25811
25918
  }
25812
25919
  });
25813
25920
 
25814
- // ../shared/src/constants/branding.ts
25815
- var init_branding = __esm({
25816
- "../shared/src/constants/branding.ts"() {
25817
- "use strict";
25818
- }
25819
- });
25820
-
25821
25921
  // ../shared/src/constants/colors.ts
25822
25922
  var CATEGORICAL_COLORS, CATEGORICAL_COLOR_VALUES, CATEGORICAL_COLOR_VALUE_SET;
25823
25923
  var init_colors = __esm({
@@ -25917,7 +26017,11 @@ var init_models = __esm({
25917
26017
  sortOrder: 10,
25918
26018
  upstreamModelId: "deepseek/deepseek-v4.1-flash-1017",
25919
26019
  contextWindow: 1048576,
25920
- 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"] }
25921
26025
  },
25922
26026
  {
25923
26027
  id: "deepseek/deepseek-v4-pro",
@@ -25928,7 +26032,10 @@ var init_models = __esm({
25928
26032
  sortOrder: 20,
25929
26033
  upstreamModelId: "deepseek/deepseek-v4-pro",
25930
26034
  contextWindow: 1048576,
25931
- maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS
26035
+ maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS,
26036
+ inputPriceMicroUsdPerMtok: 816234,
26037
+ outputPriceMicroUsdPerMtok: 1632468,
26038
+ cacheReadPriceMicroUsdPerMtok: 68020
25932
26039
  },
25933
26040
  {
25934
26041
  id: "particle-ai/particle-1",
@@ -25939,7 +26046,10 @@ var init_models = __esm({
25939
26046
  sortOrder: 25,
25940
26047
  upstreamModelId: "particle-ai/particle-1",
25941
26048
  contextWindow: 1048576,
25942
- maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS
26049
+ maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS,
26050
+ inputPriceMicroUsdPerMtok: 25e4,
26051
+ outputPriceMicroUsdPerMtok: 1e6,
26052
+ cacheReadPriceMicroUsdPerMtok: 3e3
25943
26053
  },
25944
26054
  {
25945
26055
  id: "z-ai/glm-5.3",
@@ -25950,7 +26060,15 @@ var init_models = __esm({
25950
26060
  sortOrder: 30,
25951
26061
  upstreamModelId: "z-ai/glm-5.3",
25952
26062
  contextWindow: 1048576,
25953
- 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
+ }
25954
26072
  },
25955
26073
  {
25956
26074
  id: "z-ai/glm-5.3-flash",
@@ -25961,7 +26079,39 @@ var init_models = __esm({
25961
26079
  sortOrder: 40,
25962
26080
  upstreamModelId: "z-ai/glm-5.3-flash",
25963
26081
  contextWindow: 1048576,
25964
- 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
25965
26115
  },
25966
26116
  {
25967
26117
  id: "qwen/qwen3.8-27b",
@@ -25969,10 +26119,27 @@ var init_models = __esm({
25969
26119
  description: "Qwen3.8 open-weight coding and agentic work",
25970
26120
  enabled: true,
25971
26121
  isDefault: false,
25972
- sortOrder: 50,
26122
+ sortOrder: 70,
25973
26123
  upstreamModelId: "qwen/qwen3.8-27b",
25974
26124
  contextWindow: 1e6,
25975
- 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
25976
26143
  },
25977
26144
  {
25978
26145
  id: "moonshotai/kimi-k3",
@@ -25980,10 +26147,85 @@ var init_models = __esm({
25980
26147
  description: "Moonshot's 2.8T open-weight flagship",
25981
26148
  enabled: true,
25982
26149
  isDefault: false,
25983
- sortOrder: 60,
26150
+ sortOrder: 90,
25984
26151
  upstreamModelId: "moonshotai/kimi-k3",
25985
26152
  contextWindow: 1048576,
25986
- 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
25987
26229
  },
25988
26230
  {
25989
26231
  id: "nvidia/nemotron-3-nano-30b-a3b",
@@ -25991,10 +26233,13 @@ var init_models = __esm({
25991
26233
  description: "Fast Nemotron via Alan",
25992
26234
  enabled: true,
25993
26235
  isDefault: false,
25994
- sortOrder: 70,
26236
+ sortOrder: 150,
25995
26237
  upstreamModelId: "nvidia/nemotron-3-nano-30b-a3b",
25996
26238
  contextWindow: 262144,
25997
- maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS
26239
+ maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS,
26240
+ inputPriceMicroUsdPerMtok: 6e4,
26241
+ outputPriceMicroUsdPerMtok: 24e4,
26242
+ cacheReadPriceMicroUsdPerMtok: 12e3
25998
26243
  },
25999
26244
  {
26000
26245
  id: "nvidia/nemotron-3-super-120b-a12b",
@@ -26002,10 +26247,13 @@ var init_models = __esm({
26002
26247
  description: "Mid-tier Nemotron via Alan",
26003
26248
  enabled: true,
26004
26249
  isDefault: false,
26005
- sortOrder: 80,
26250
+ sortOrder: 160,
26006
26251
  upstreamModelId: "nvidia/nemotron-3-super-120b-a12b",
26007
- contextWindow: 262144,
26008
- maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS
26252
+ contextWindow: 1048576,
26253
+ maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS,
26254
+ inputPriceMicroUsdPerMtok: 3e5,
26255
+ outputPriceMicroUsdPerMtok: 24e5,
26256
+ cacheReadPriceMicroUsdPerMtok: 15e4
26009
26257
  },
26010
26258
  {
26011
26259
  id: "nvidia/nemotron-3-ultra-550b-a55b",
@@ -26013,21 +26261,13 @@ var init_models = __esm({
26013
26261
  description: "Largest Nemotron via Alan",
26014
26262
  enabled: true,
26015
26263
  isDefault: false,
26016
- sortOrder: 90,
26264
+ sortOrder: 170,
26017
26265
  upstreamModelId: "nvidia/nemotron-3-ultra-550b-a55b",
26018
26266
  contextWindow: 262144,
26019
- maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS
26020
- },
26021
- {
26022
- id: "nvidia/nemotron-3.5-lightning",
26023
- name: "Nemotron 3.5 Lightning",
26024
- description: "Small, fast Nemotron for high-volume work",
26025
- enabled: true,
26026
- isDefault: false,
26027
- sortOrder: 100,
26028
- upstreamModelId: "nvidia/nemotron-3.5-lightning",
26029
- contextWindow: 262144,
26030
- maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS
26267
+ maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS,
26268
+ inputPriceMicroUsdPerMtok: 6e5,
26269
+ outputPriceMicroUsdPerMtok: 24e5,
26270
+ cacheReadPriceMicroUsdPerMtok: 12e4
26031
26271
  },
26032
26272
  {
26033
26273
  id: "meta/muse-spark-1.3-contributor",
@@ -26035,10 +26275,13 @@ var init_models = __esm({
26035
26275
  description: "Cost-efficient Muse Spark (contributor tier)",
26036
26276
  enabled: true,
26037
26277
  isDefault: false,
26038
- sortOrder: 110,
26278
+ sortOrder: 180,
26039
26279
  upstreamModelId: "meta/muse-spark-1.3-contributor",
26040
26280
  contextWindow: 1048576,
26041
- maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS
26281
+ maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS,
26282
+ inputPriceMicroUsdPerMtok: 1e5,
26283
+ outputPriceMicroUsdPerMtok: 2e5,
26284
+ cacheReadPriceMicroUsdPerMtok: 2e3
26042
26285
  },
26043
26286
  {
26044
26287
  id: "meta/muse-spark-1.3",
@@ -26046,10 +26289,41 @@ var init_models = __esm({
26046
26289
  description: "Meta Muse Spark multimodal agentic coding",
26047
26290
  enabled: true,
26048
26291
  isDefault: false,
26049
- sortOrder: 120,
26292
+ sortOrder: 190,
26050
26293
  upstreamModelId: "meta/muse-spark-1.3",
26051
26294
  contextWindow: 1048576,
26052
- 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
26053
26327
  },
26054
26328
  {
26055
26329
  id: "meta/muse-spark-1.2-contributor",
@@ -26057,32 +26331,41 @@ var init_models = __esm({
26057
26331
  description: "Prior Muse Spark contributor tier",
26058
26332
  enabled: true,
26059
26333
  isDefault: false,
26060
- sortOrder: 130,
26334
+ sortOrder: 220,
26061
26335
  upstreamModelId: "meta/muse-spark-1.2-contributor",
26062
26336
  contextWindow: 1048576,
26063
- maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS
26337
+ maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS,
26338
+ inputPriceMicroUsdPerMtok: 1e5,
26339
+ outputPriceMicroUsdPerMtok: 2e5,
26340
+ cacheReadPriceMicroUsdPerMtok: 2e3
26064
26341
  },
26065
26342
  {
26066
- id: "minimax/minimax-m3.1-flash",
26067
- name: "MiniMax M3.1 Flash",
26068
- 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",
26069
26346
  enabled: true,
26070
26347
  isDefault: false,
26071
- sortOrder: 140,
26072
- upstreamModelId: "minimax/minimax-m3.1-flash",
26073
- contextWindow: 1048576,
26074
- 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
26075
26355
  },
26076
26356
  {
26077
- id: "minimax/minimax-m3",
26078
- name: "MiniMax M3",
26079
- 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",
26080
26360
  enabled: true,
26081
26361
  isDefault: false,
26082
- sortOrder: 150,
26083
- upstreamModelId: "minimax/minimax-m3",
26362
+ sortOrder: 240,
26363
+ upstreamModelId: "google/gemini-4-argon",
26084
26364
  contextWindow: 1048576,
26085
- maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS
26365
+ maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS,
26366
+ inputPriceMicroUsdPerMtok: 2e6,
26367
+ outputPriceMicroUsdPerMtok: 1e7,
26368
+ cacheReadPriceMicroUsdPerMtok: 1e5
26086
26369
  }
26087
26370
  ];
26088
26371
  DEFAULT_HARNESS_MODEL_ID = HARNESS_MODEL_SEEDS.find((model) => model.isDefault)?.id ?? HARNESS_MODEL_SEEDS[0].id;
@@ -31861,7 +32144,7 @@ function readText(incoming, maxBytes) {
31861
32144
  incoming.on("error", reject);
31862
32145
  });
31863
32146
  }
31864
- 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;
31865
32148
  var init_client = __esm({
31866
32149
  "../agent-core/src/providers/opencode/client.ts"() {
31867
32150
  "use strict";
@@ -31879,6 +32162,12 @@ var init_client = __esm({
31879
32162
  this.body = body;
31880
32163
  }
31881
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
+ };
31882
32171
  BASE62 = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
31883
32172
  messageIdClock = { at: 0, counter: 0 };
31884
32173
  OpenCodeClient = class {
@@ -31906,6 +32195,7 @@ var init_client = __esm({
31906
32195
  }
31907
32196
  #open(call) {
31908
32197
  return new Promise((resolve10, reject) => {
32198
+ const deadline = AbortSignal.timeout(this.#limits.requestTimeoutMs);
31909
32199
  const outgoing = (0, import_node_http3.request)(
31910
32200
  `${this.baseUrl}${call.path}`,
31911
32201
  {
@@ -31913,20 +32203,26 @@ var init_client = __esm({
31913
32203
  headers: call.headers,
31914
32204
  agent: this.#agent,
31915
32205
  timeout: call.stream ? this.#limits.streamIdleMs : this.#limits.requestTimeoutMs,
31916
- signal: call.stream ? this.#lifetime.signal : AbortSignal.any([
31917
- this.#lifetime.signal,
31918
- AbortSignal.timeout(this.#limits.requestTimeoutMs)
31919
- ])
32206
+ signal: call.stream ? this.#lifetime.signal : AbortSignal.any([this.#lifetime.signal, deadline])
31920
32207
  },
31921
32208
  resolve10
31922
32209
  );
31923
- outgoing.on("timeout", () => outgoing.destroy(new Error("OpenCode request timed out")));
31924
- 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
+ });
31925
32215
  outgoing.end(call.body);
31926
32216
  });
31927
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
+ }
31928
32223
  async #call(what, method, path, body) {
31929
32224
  const response = await this.#open({
32225
+ what,
31930
32226
  method,
31931
32227
  path,
31932
32228
  headers: {
@@ -32065,6 +32361,7 @@ var init_client = __esm({
32065
32361
  /** Subscribes to the server-wide bus. */
32066
32362
  async events(handlers) {
32067
32363
  const response = await this.#open({
32364
+ what: "event stream",
32068
32365
  method: "GET",
32069
32366
  path: "/event",
32070
32367
  stream: true,
@@ -33826,6 +34123,7 @@ async function openSession(client, session, spec, log) {
33826
34123
  return { id, resumed: false };
33827
34124
  }
33828
34125
  function isOpenTimeout(error62) {
34126
+ if (error62 instanceof OpenCodeTimeoutError) return true;
33829
34127
  return error62 instanceof CoreFault && error62.code === "protocol_violation";
33830
34128
  }
33831
34129
  async function openOnce(spec, password, options) {
@@ -33841,7 +34139,9 @@ async function openOnce(spec, password, options) {
33841
34139
  throw error62;
33842
34140
  });
33843
34141
  try {
33844
- const client = new OpenCodeClient(url2, password, options.engine.label);
34142
+ const client = new OpenCodeClient(url2, password, options.engine.label, {
34143
+ requestTimeoutMs: options.requestTimeoutMs
34144
+ });
33845
34145
  const alive = (work) => whileAlive(session, options, work);
33846
34146
  await withDeadline2(
33847
34147
  alive(checkHealth(client, options.log)),
@@ -33890,24 +34190,33 @@ async function openWithRetries(spec, password, options) {
33890
34190
  }
33891
34191
  }
33892
34192
  }
33893
- function createOpenCodeDriver(options = {}) {
33894
- 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 {
33895
34205
  clock: options.clock ?? systemClock2,
33896
34206
  log: options.log ?? silentLog,
33897
34207
  interruptGraceMs: options.interruptGraceMs ?? DEFAULTS2.interruptGraceMs,
33898
34208
  terminateGraceMs: options.terminateGraceMs ?? DEFAULTS2.terminateGraceMs,
33899
34209
  stdoutDrainMs: options.stdoutDrainMs ?? DEFAULTS2.stdoutDrainMs,
33900
34210
  descendantScanMs: options.descendantScanMs ?? DEFAULTS2.descendantScanMs,
33901
- openTimeoutMs: options.openTimeoutMs ?? DEFAULTS2.openTimeoutMs,
33902
- bootstrapTimeoutMs: options.bootstrapTimeoutMs ?? DEFAULTS2.bootstrapTimeoutMs,
33903
- slowBootstrapMs: options.slowBootstrapMs ?? DEFAULTS2.slowBootstrapMs,
33904
- openAttempts: options.openAttempts ?? DEFAULTS2.openAttempts,
33905
- startAttempts: options.startAttempts ?? DEFAULTS2.startAttempts,
33906
34211
  reconnectAttempts: options.reconnectAttempts ?? DEFAULTS2.reconnectAttempts,
33907
34212
  reconnectDelayMs: options.reconnectDelayMs ?? DEFAULTS2.reconnectDelayMs,
33908
34213
  engine: options.engine ?? OPENCODE_ENGINE,
33909
- stopTaskTimeoutMs: options.stopTaskTimeoutMs ?? DEFAULTS2.stopTaskTimeoutMs
34214
+ stopTaskTimeoutMs: options.stopTaskTimeoutMs ?? DEFAULTS2.stopTaskTimeoutMs,
34215
+ ...resolveOpenLimits(options)
33910
34216
  };
34217
+ }
34218
+ function createOpenCodeDriver(options = {}) {
34219
+ const resolved = resolveOptions(options);
33911
34220
  return {
33912
34221
  name: "opencode_serve",
33913
34222
  open: async (planned) => {
@@ -33960,6 +34269,7 @@ var init_driver3 = __esm({
33960
34269
  stdoutDrainMs: 2e3,
33961
34270
  descendantScanMs: 5e3,
33962
34271
  openTimeoutMs: 6e4,
34272
+ requestTimeoutMs: 3e4,
33963
34273
  bootstrapTimeoutMs: 6e5,
33964
34274
  slowBootstrapMs: 5e3,
33965
34275
  openAttempts: 2,
@@ -34288,13 +34598,20 @@ function modelArgs(input2) {
34288
34598
  effort: option("--effort", effort)
34289
34599
  };
34290
34600
  }
34291
- function skillListingArgs(input2) {
34292
- const chars = input2.skillListingMaxDescChars;
34601
+ function settingsArgs(input2) {
34293
34602
  const ownSettings = (input2.extraArgs ?? []).some(
34294
34603
  (arg) => arg === "--settings" || arg.startsWith("--settings=")
34295
34604
  );
34296
- if (chars === void 0 || !input2.capabilities.supportsPluginDir || ownSettings) return [];
34297
- return ["--settings", JSON.stringify({ skillListingMaxDescChars: chars })];
34605
+ if (!input2.capabilities.supportsPluginDir || ownSettings) return [];
34606
+ const chars = input2.skillListingMaxDescChars;
34607
+ return [
34608
+ "--settings",
34609
+ JSON.stringify({
34610
+ attribution: { commit: "", pr: "" },
34611
+ includeCoAuthoredBy: false,
34612
+ ...chars === void 0 ? {} : { skillListingMaxDescChars: chars }
34613
+ })
34614
+ ];
34298
34615
  }
34299
34616
  function buildClaudeArgs(input2) {
34300
34617
  const { capabilities } = input2;
@@ -34320,7 +34637,7 @@ function buildClaudeArgs(input2) {
34320
34637
  // Without it the whole answer lands in one frame at turn end.
34321
34638
  ...capabilities.supportsPartialMessages ? ["--include-partial-messages"] : [],
34322
34639
  ...capabilities.supportsPluginDir ? (input2.pluginDirs ?? []).flatMap((dir) => ["--plugin-dir", dir]) : [],
34323
- ...skillListingArgs(input2),
34640
+ ...settingsArgs(input2),
34324
34641
  ...option("--resume", input2.resumeId),
34325
34642
  "--chrome",
34326
34643
  ...input2.extraArgs ?? []
@@ -51413,8 +51730,11 @@ async function readCheckoutFreshness(dir, path) {
51413
51730
  }
51414
51731
  }
51415
51732
 
51416
- // src/capabilities/providers/alan-code.ts
51417
- init_alan_code();
51733
+ // src/capabilities/git/commit-attribution.ts
51734
+ var import_node_crypto29 = require("crypto");
51735
+ var import_promises26 = require("fs/promises");
51736
+ var import_node_path30 = require("path");
51737
+ init_runtime_v2();
51418
51738
 
51419
51739
  // src/capabilities/providers/commands.ts
51420
51740
  var import_node_fs17 = require("fs");
@@ -51484,7 +51804,58 @@ async function resolveCommandOnPath(command, env, platform) {
51484
51804
  return null;
51485
51805
  }
51486
51806
 
51807
+ // src/capabilities/git/commit-attribution.ts
51808
+ function shellQuote(value) {
51809
+ return `'${value.replace(/'/g, "'\\''")}'`;
51810
+ }
51811
+ async function replaceFile(path, content, mode) {
51812
+ const temp = `${path}.${(0, import_node_crypto29.randomUUID)()}.tmp`;
51813
+ await (0, import_promises26.writeFile)(temp, content, { mode });
51814
+ await (0, import_promises26.rename)(temp, path);
51815
+ }
51816
+ async function replaceSymlink(path, target) {
51817
+ const temp = `${path}.${(0, import_node_crypto29.randomUUID)()}.tmp`;
51818
+ await (0, import_promises26.symlink)(target, temp);
51819
+ await (0, import_promises26.rename)(temp, path);
51820
+ }
51821
+ async function installCommitAttribution(input2) {
51822
+ if (input2.platform === "win32") return null;
51823
+ const binDir = (0, import_node_path30.join)(input2.dir, "bin");
51824
+ const hooksDir = (0, import_node_path30.join)(input2.dir, "hooks");
51825
+ const delimiter2 = pathDelimiter(input2.platform);
51826
+ const path = envValue(input2.env, "PATH").split(delimiter2).filter((entry) => entry.length > 0 && entry !== binDir).join(delimiter2);
51827
+ const realGit = await resolveCommandOnPath("git", { ...input2.env, PATH: path }, input2.platform);
51828
+ if (realGit === null) return null;
51829
+ await (0, import_promises26.mkdir)(binDir, { recursive: true, mode: 493 });
51830
+ await (0, import_promises26.mkdir)(hooksDir, { recursive: true, mode: 493 });
51831
+ await replaceFile((0, import_node_path30.join)(input2.dir, COMMIT_ATTRIBUTION_SCRIPT), commitAttributionScript(), 493);
51832
+ for (const hook of COMMIT_ATTRIBUTION_HOOKS) {
51833
+ await replaceSymlink((0, import_node_path30.join)(hooksDir, hook), (0, import_node_path30.join)("..", COMMIT_ATTRIBUTION_SCRIPT));
51834
+ }
51835
+ await replaceFile(
51836
+ (0, import_node_path30.join)(binDir, "git"),
51837
+ `#!/bin/sh
51838
+ exec ${shellQuote(realGit)} -c core.hooksPath=${shellQuote(hooksDir)} "$@"
51839
+ `,
51840
+ 493
51841
+ );
51842
+ const coAuthorPath = (0, import_node_path30.join)(input2.dir, COMMIT_ATTRIBUTION_COAUTHOR_FILE);
51843
+ return {
51844
+ env: { ...input2.env, PATH: path === "" ? binDir : `${binDir}${delimiter2}${path}` },
51845
+ setCoAuthor: async (coAuthor) => {
51846
+ if (coAuthor === void 0) {
51847
+ await (0, import_promises26.rm)(coAuthorPath, { force: true });
51848
+ return;
51849
+ }
51850
+ const value = coAuthorTrailer(coAuthor).replace(/^Co-Authored-By: /, "");
51851
+ await replaceFile(coAuthorPath, `${value}
51852
+ `, 420);
51853
+ }
51854
+ };
51855
+ }
51856
+
51487
51857
  // src/capabilities/providers/alan-code.ts
51858
+ init_alan_code();
51488
51859
  var ALAN_CODE_BACKEND = "alan_code";
51489
51860
  function withPackagedAlanCodeEngine(env, bundle, platform) {
51490
51861
  if (bundle === void 0) return { ...env };
@@ -51511,16 +51882,16 @@ function resolveProviderExecutable(provider4, env, platform) {
51511
51882
  }
51512
51883
 
51513
51884
  // src/capabilities/providers/managed.ts
51514
- var import_node_crypto29 = require("crypto");
51515
- var import_promises26 = require("fs/promises");
51516
- var import_node_path30 = require("path");
51885
+ var import_node_crypto30 = require("crypto");
51886
+ var import_promises27 = require("fs/promises");
51887
+ var import_node_path31 = require("path");
51517
51888
  init_process();
51518
51889
  init_zod();
51519
51890
  var VERSION = /^[0-9]+\.[0-9]+\.[0-9]+(?:[-+][0-9A-Za-z.-]+)?$/;
51520
51891
  var selectedSchema = external_exports.record(external_exports.string(), external_exports.string());
51521
51892
  async function readManagedProviderVersion(file2, backendKind) {
51522
51893
  try {
51523
- const selected = selectedSchema.parse(JSON.parse(await (0, import_promises26.readFile)(file2, "utf8")));
51894
+ const selected = selectedSchema.parse(JSON.parse(await (0, import_promises27.readFile)(file2, "utf8")));
51524
51895
  const version2 = selected[backendKind];
51525
51896
  return version2 !== void 0 && VERSION.test(version2) ? version2 : null;
51526
51897
  } catch {
@@ -51530,9 +51901,9 @@ async function readManagedProviderVersion(file2, backendKind) {
51530
51901
 
51531
51902
  // ../shared/src/node/skill-package.ts
51532
51903
  var import_node_buffer = require("buffer");
51533
- var import_node_crypto30 = require("crypto");
51534
- var import_promises27 = require("fs/promises");
51535
- var import_node_path31 = require("path");
51904
+ var import_node_crypto31 = require("crypto");
51905
+ var import_promises28 = require("fs/promises");
51906
+ var import_node_path32 = require("path");
51536
51907
  var import_yaml = __toESM(require_dist(), 1);
51537
51908
  init_contracts();
51538
51909
  init_domain();
@@ -51609,7 +51980,7 @@ async function inspectSkillPackage(packageRoot, options = {}) {
51609
51980
  inspectedFiles.sort(comparePackageFiles);
51610
51981
  const parsedMetadata = parseSkillMetadata(
51611
51982
  inspectedFiles.find((file2) => file2.manifest.path === "SKILL.md")?.bytes,
51612
- options.expectedName === void 0 ? (0, import_node_path31.basename)(root) : options.expectedName
51983
+ options.expectedName === void 0 ? (0, import_node_path32.basename)(root) : options.expectedName
51613
51984
  );
51614
51985
  const manifestFiles = inspectedFiles.map((file2) => file2.manifest);
51615
51986
  const diagnostics = [
@@ -51632,11 +52003,11 @@ async function inspectSkillPackage(packageRoot, options = {}) {
51632
52003
  };
51633
52004
  }
51634
52005
  async function requirePackageRoot(packageRoot) {
51635
- const root = await (0, import_promises27.realpath)((0, import_node_path31.resolve)(packageRoot)).catch(() => null);
52006
+ const root = await (0, import_promises28.realpath)((0, import_node_path32.resolve)(packageRoot)).catch(() => null);
51636
52007
  if (!root) {
51637
52008
  throw new SkillPackageError("INVALID_PACKAGE_ROOT", "Skill package directory does not exist");
51638
52009
  }
51639
- const rootStat = await (0, import_promises27.lstat)(root);
52010
+ const rootStat = await (0, import_promises28.lstat)(root);
51640
52011
  if (!rootStat.isDirectory()) {
51641
52012
  throw new SkillPackageError("INVALID_PACKAGE_ROOT", "Skill package root must be a directory");
51642
52013
  }
@@ -51662,12 +52033,12 @@ async function walkPackage(root, ignoredPaths) {
51662
52033
  }
51663
52034
  return files;
51664
52035
  async function walkDirectory(directory) {
51665
- const entries = await (0, import_promises27.readdir)(directory, { withFileTypes: true });
52036
+ const entries = await (0, import_promises28.readdir)(directory, { withFileTypes: true });
51666
52037
  for (const entry of entries) {
51667
- const absolutePath = (0, import_node_path31.resolve)(directory, entry.name);
52038
+ const absolutePath = (0, import_node_path32.resolve)(directory, entry.name);
51668
52039
  const normalizedPath = normalizeRelativePath(root, absolutePath);
51669
52040
  if (isIgnored(normalizedPath, entry.name, entry.isDirectory(), ignored2)) continue;
51670
- const entryStat = await (0, import_promises27.lstat)(absolutePath);
52041
+ const entryStat = await (0, import_promises28.lstat)(absolutePath);
51671
52042
  if (entryStat.isSymbolicLink()) {
51672
52043
  throw new SkillPackageError(
51673
52044
  "SYMLINK_BLOCKED",
@@ -51736,12 +52107,12 @@ function globToRegExp(pattern) {
51736
52107
  return new RegExp(`${source}(?:/.*)?$`);
51737
52108
  }
51738
52109
  function normalizeRelativePath(root, absolutePath) {
51739
- const nativeRelativePath = (0, import_node_path31.relative)(root, absolutePath);
51740
- if (!nativeRelativePath || nativeRelativePath.startsWith(`..${import_node_path31.sep}`) || nativeRelativePath === "..") {
52110
+ const nativeRelativePath = (0, import_node_path32.relative)(root, absolutePath);
52111
+ if (!nativeRelativePath || nativeRelativePath.startsWith(`..${import_node_path32.sep}`) || nativeRelativePath === "..") {
51741
52112
  throw new SkillPackageError("INVALID_PATH", "Skill package path escapes its root");
51742
52113
  }
51743
- const normalized2 = nativeRelativePath.split(import_node_path31.sep).join("/").normalize("NFC");
51744
- if (normalized2.includes("\0") || normalized2.includes("\uFFFD") || import_node_path31.posix.isAbsolute(normalized2)) {
52114
+ const normalized2 = nativeRelativePath.split(import_node_path32.sep).join("/").normalize("NFC");
52115
+ if (normalized2.includes("\0") || normalized2.includes("\uFFFD") || import_node_path32.posix.isAbsolute(normalized2)) {
51745
52116
  throw new SkillPackageError("INVALID_PATH", `Invalid Skill package path: ${normalized2}`);
51746
52117
  }
51747
52118
  return normalized2;
@@ -51788,12 +52159,12 @@ function requireSafeFile(path, size, normalizedPaths) {
51788
52159
  }
51789
52160
  }
51790
52161
  function isSecretPath(path) {
51791
- const name = import_node_path31.posix.basename(path).toLowerCase();
52162
+ const name = import_node_path32.posix.basename(path).toLowerCase();
51792
52163
  if (SECRET_BASENAMES.has(name) || name.startsWith(".env.")) return true;
51793
52164
  return name.endsWith(".private-key.pem") || name.endsWith(".private-key.key");
51794
52165
  }
51795
52166
  async function readPackageFile(file2) {
51796
- const bytes = await (0, import_promises27.readFile)(file2.absolutePath);
52167
+ const bytes = await (0, import_promises28.readFile)(file2.absolutePath);
51797
52168
  return {
51798
52169
  bytes,
51799
52170
  manifest: {
@@ -51811,11 +52182,11 @@ function classifyFileKind(path) {
51811
52182
  if (path.startsWith("scripts/")) return "script";
51812
52183
  if (path.startsWith("references/")) return "reference";
51813
52184
  if (path.startsWith("assets/")) return "asset";
51814
- if (/^(?:licen[cs]e|copying|notice)(?:\.|$)/i.test(import_node_path31.posix.basename(path))) return "license";
52185
+ if (/^(?:licen[cs]e|copying|notice)(?:\.|$)/i.test(import_node_path32.posix.basename(path))) return "license";
51815
52186
  return "other";
51816
52187
  }
51817
52188
  function classifyPreview(path, bytes) {
51818
- const extension = import_node_path31.posix.extname(path).toLowerCase();
52189
+ const extension = import_node_path32.posix.extname(path).toLowerCase();
51819
52190
  if (IMAGE_EXTENSIONS2.has(extension)) return "image";
51820
52191
  if (bytes.includes(0)) return "binary";
51821
52192
  if (MARKDOWN_EXTENSIONS.has(extension)) return "markdown";
@@ -51936,7 +52307,7 @@ function normalizePackageReference(value) {
51936
52307
  }
51937
52308
  const withoutSuffix = trimmed4.split(/[?#]/, 1)[0];
51938
52309
  if (!withoutSuffix) return null;
51939
- const normalized2 = import_node_path31.posix.normalize(withoutSuffix).replace(/^\.\//, "").normalize("NFC");
52310
+ const normalized2 = import_node_path32.posix.normalize(withoutSuffix).replace(/^\.\//, "").normalize("NFC");
51940
52311
  if (normalized2 === ".." || normalized2.startsWith("../")) return null;
51941
52312
  return normalized2;
51942
52313
  }
@@ -51950,7 +52321,7 @@ function comparePackageFiles(left, right) {
51950
52321
  );
51951
52322
  }
51952
52323
  function hashPackageTree(files) {
51953
- const hash2 = (0, import_node_crypto30.createHash)("sha256");
52324
+ const hash2 = (0, import_node_crypto31.createHash)("sha256");
51954
52325
  hash2.update(TREE_HASH_PREFIX);
51955
52326
  for (const file2 of files) {
51956
52327
  const path = import_node_buffer.Buffer.from(file2.path, "utf8");
@@ -51963,7 +52334,7 @@ function hashPackageTree(files) {
51963
52334
  return `sha256:${hash2.digest("hex")}`;
51964
52335
  }
51965
52336
  function sha2562(bytes) {
51966
- return `sha256:${(0, import_node_crypto30.createHash)("sha256").update(bytes).digest("hex")}`;
52337
+ return `sha256:${(0, import_node_crypto31.createHash)("sha256").update(bytes).digest("hex")}`;
51967
52338
  }
51968
52339
  function uint322(value) {
51969
52340
  const buffer = import_node_buffer.Buffer.allocUnsafe(4);
@@ -51977,14 +52348,14 @@ function uint642(value) {
51977
52348
  }
51978
52349
 
51979
52350
  // src/capabilities/skills/store.ts
51980
- var import_promises28 = require("fs/promises");
51981
- var import_node_path32 = require("path");
52351
+ var import_promises29 = require("fs/promises");
52352
+ var import_node_path33 = require("path");
51982
52353
 
51983
52354
  // ../shared/src/node/alan-skill-identity.ts
51984
- var import_node_crypto31 = require("crypto");
52355
+ var import_node_crypto32 = require("crypto");
51985
52356
  var ALAN_SKILL_NAMESPACE = "ec71d99b-d207-4ca2-a9eb-3a7bed4a73fd";
51986
52357
  function uuidV5(name, namespace) {
51987
- const bytes = (0, import_node_crypto31.createHash)("sha1").update(Buffer.from(namespace.replaceAll("-", ""), "hex")).update(name, "utf8").digest().subarray(0, 16);
52358
+ const bytes = (0, import_node_crypto32.createHash)("sha1").update(Buffer.from(namespace.replaceAll("-", ""), "hex")).update(name, "utf8").digest().subarray(0, 16);
51988
52359
  bytes[6] = bytes[6] & 15 | 80;
51989
52360
  bytes[8] = bytes[8] & 63 | 128;
51990
52361
  const hex3 = bytes.toString("hex");
@@ -52001,21 +52372,21 @@ function alanSkillVersionId(slug, contentHash) {
52001
52372
  init_runtime_v2();
52002
52373
  init_zod();
52003
52374
  function skillsLayout(stateDir, home) {
52004
- const root = (0, import_node_path32.join)(stateDir, "skills");
52375
+ const root = (0, import_node_path33.join)(stateDir, "skills");
52005
52376
  return {
52006
52377
  root,
52007
- installedFile: (0, import_node_path32.join)(root, "installed.json"),
52008
- retiredFile: (0, import_node_path32.join)(root, "retired.json"),
52009
- localFile: (0, import_node_path32.join)(root, "local.json"),
52010
- versionsDir: (0, import_node_path32.join)(root, "versions"),
52011
- tmpDir: (0, import_node_path32.join)(root, "tmp"),
52012
- pluginDir: (0, import_node_path32.join)(root, "alan-plugin"),
52013
- pluginSkillsDir: (0, import_node_path32.join)(root, "alan-plugin", "skills"),
52014
- nativeDir: home === void 0 || home === "" ? null : (0, import_node_path32.join)(home, ".agents", "skills")
52378
+ installedFile: (0, import_node_path33.join)(root, "installed.json"),
52379
+ retiredFile: (0, import_node_path33.join)(root, "retired.json"),
52380
+ localFile: (0, import_node_path33.join)(root, "local.json"),
52381
+ versionsDir: (0, import_node_path33.join)(root, "versions"),
52382
+ tmpDir: (0, import_node_path33.join)(root, "tmp"),
52383
+ pluginDir: (0, import_node_path33.join)(root, "alan-plugin"),
52384
+ pluginSkillsDir: (0, import_node_path33.join)(root, "alan-plugin", "skills"),
52385
+ nativeDir: home === void 0 || home === "" ? null : (0, import_node_path33.join)(home, ".agents", "skills")
52015
52386
  };
52016
52387
  }
52017
52388
  function packageDirectory(layout, versionId) {
52018
- return (0, import_node_path32.join)(layout.versionsDir, versionId);
52389
+ return (0, import_node_path33.join)(layout.versionsDir, versionId);
52019
52390
  }
52020
52391
  var installedFileSchema = external_exports.object({ skills: external_exports.array(desiredMachineSkillSchema) });
52021
52392
  async function readInstalledSkills(layout) {
@@ -52042,7 +52413,7 @@ async function readLocalSkills(layout) {
52042
52413
  async function isLocalSkillCurrent(entry, contentHash, ignoredPaths) {
52043
52414
  if (entry.contentHash !== contentHash) return false;
52044
52415
  try {
52045
- if (await (0, import_promises28.realpath)(entry.path) !== entry.path) return false;
52416
+ if (await (0, import_promises29.realpath)(entry.path) !== entry.path) return false;
52046
52417
  const inspected = await inspectSkillPackage(entry.path, { expectedName: null, ignoredPaths });
52047
52418
  return inspected.contentHash === contentHash;
52048
52419
  } catch {
@@ -52057,7 +52428,7 @@ async function resolveLocalSkill(local, invocation) {
52057
52428
  }
52058
52429
  async function hasSkillFile(directory) {
52059
52430
  try {
52060
- return (await (0, import_promises28.stat)((0, import_node_path32.join)(directory, "SKILL.md"))).isFile();
52431
+ return (await (0, import_promises29.stat)((0, import_node_path33.join)(directory, "SKILL.md"))).isFile();
52061
52432
  } catch {
52062
52433
  return false;
52063
52434
  }
@@ -52075,7 +52446,7 @@ async function isIntact(layout, skill) {
52075
52446
  async function resolveNativeBuiltIn(layout, invocation, baked) {
52076
52447
  const slug = invocation.displayName;
52077
52448
  if (layout.nativeDir === null || invocation.skillId !== alanSkillId(slug)) return null;
52078
- const directory = (0, import_node_path32.join)(layout.nativeDir, slug);
52449
+ const directory = (0, import_node_path33.join)(layout.nativeDir, slug);
52079
52450
  try {
52080
52451
  const inspected = await inspectSkillPackage(directory, { expectedName: slug });
52081
52452
  if (baked === "exact" && alanSkillVersionId(slug, inspected.contentHash) !== invocation.versionId)
@@ -52114,8 +52485,8 @@ async function resolveSkillInvocations(layout, invocations, baked = "any") {
52114
52485
  async function nativeCandidates(layout) {
52115
52486
  const nativeDir = layout.nativeDir;
52116
52487
  if (nativeDir === null) return [];
52117
- const entries = await (0, import_promises28.readdir)(nativeDir, { withFileTypes: true }).catch(() => []);
52118
- return entries.filter((entry) => entry.isDirectory() || entry.isSymbolicLink()).map((entry) => ({ directory: (0, import_node_path32.join)(nativeDir, entry.name) }));
52488
+ const entries = await (0, import_promises29.readdir)(nativeDir, { withFileTypes: true }).catch(() => []);
52489
+ return entries.filter((entry) => entry.isDirectory() || entry.isSymbolicLink()).map((entry) => ({ directory: (0, import_node_path33.join)(nativeDir, entry.name) }));
52119
52490
  }
52120
52491
  async function availableSkillIndex(layout, sources = { synced: true, native: true }) {
52121
52492
  const found = /* @__PURE__ */ new Map();
@@ -52152,10 +52523,10 @@ async function inspectIndexedSkill(directory, contentHash) {
52152
52523
  }
52153
52524
 
52154
52525
  // src/capabilities/skills/native-index.ts
52155
- var import_node_crypto32 = require("crypto");
52526
+ var import_node_crypto33 = require("crypto");
52156
52527
  var import_node_fs18 = require("fs");
52157
- var import_promises29 = require("fs/promises");
52158
- var import_node_path33 = require("path");
52528
+ var import_promises30 = require("fs/promises");
52529
+ var import_node_path34 = require("path");
52159
52530
  var ALAN_SKILLS_PLUGIN_NAME = "alan";
52160
52531
  var PLUGIN_MANIFEST = `${JSON.stringify(
52161
52532
  {
@@ -52167,18 +52538,18 @@ var PLUGIN_MANIFEST = `${JSON.stringify(
52167
52538
  )}
52168
52539
  `;
52169
52540
  function installedSkillFolders(layout) {
52170
- return (0, import_node_fs18.existsSync)((0, import_node_path33.join)(layout.pluginDir, ".claude-plugin", "plugin.json")) ? { pluginDir: layout.pluginDir, skillsDir: layout.pluginSkillsDir } : null;
52541
+ return (0, import_node_fs18.existsSync)((0, import_node_path34.join)(layout.pluginDir, ".claude-plugin", "plugin.json")) ? { pluginDir: layout.pluginDir, skillsDir: layout.pluginSkillsDir } : null;
52171
52542
  }
52172
52543
 
52173
52544
  // src/capabilities/workspace/index.ts
52174
- var import_node_path36 = require("path");
52545
+ var import_node_path37 = require("path");
52175
52546
 
52176
52547
  // src/capabilities/workspace/approved-paths.ts
52177
- var import_promises30 = require("fs/promises");
52548
+ var import_promises31 = require("fs/promises");
52178
52549
  init_zod();
52179
52550
 
52180
52551
  // src/capabilities/workspace/paths.ts
52181
- var import_node_path34 = require("path");
52552
+ var import_node_path35 = require("path");
52182
52553
  function stripWin32Namespace(path) {
52183
52554
  if (/^\\\\\?\\UNC\\/i.test(path)) return `\\\\${path.slice(8)}`;
52184
52555
  if (path.startsWith("\\\\?\\")) return path.slice(4);
@@ -52186,15 +52557,15 @@ function stripWin32Namespace(path) {
52186
52557
  }
52187
52558
  function comparablePath(path, platform) {
52188
52559
  if (platform === "win32") {
52189
- const normalized3 = import_node_path34.win32.normalize(stripWin32Namespace(path).replaceAll("/", "\\"));
52560
+ const normalized3 = import_node_path35.win32.normalize(stripWin32Namespace(path).replaceAll("/", "\\"));
52190
52561
  const trimmed4 = normalized3.length > 3 || !/^[a-z]:\\$/i.test(normalized3) ? normalized3.replace(/\\+$/, "") : normalized3;
52191
52562
  return trimmed4.toLowerCase();
52192
52563
  }
52193
- const normalized2 = import_node_path34.posix.normalize(path);
52564
+ const normalized2 = import_node_path35.posix.normalize(path);
52194
52565
  return normalized2.length > 1 ? normalized2.replace(/\/+$/, "") : normalized2;
52195
52566
  }
52196
52567
  function isAbsoluteFor(path, platform) {
52197
- return platform === "win32" ? import_node_path34.win32.isAbsolute(path) : import_node_path34.posix.isAbsolute(path);
52568
+ return platform === "win32" ? import_node_path35.win32.isAbsolute(path) : import_node_path35.posix.isAbsolute(path);
52198
52569
  }
52199
52570
  function isWithin(root, candidate, platform) {
52200
52571
  const separator = platform === "win32" ? "\\" : "/";
@@ -52212,7 +52583,7 @@ var storeSchema = external_exports.object({
52212
52583
  });
52213
52584
  async function realpathOrNull(path) {
52214
52585
  try {
52215
- return await (0, import_promises30.realpath)(path);
52586
+ return await (0, import_promises31.realpath)(path);
52216
52587
  } catch (error62) {
52217
52588
  const code = errnoCode(error62);
52218
52589
  if (code === "ENOENT" || code === "ENOTDIR" || code === "EACCES" || code === "EPERM") {
@@ -52271,9 +52642,9 @@ async function openApprovedPaths(options) {
52271
52642
  }
52272
52643
 
52273
52644
  // src/capabilities/workspace/locks.ts
52274
- var import_node_crypto33 = require("crypto");
52275
- var import_promises31 = require("fs/promises");
52276
- var import_node_path35 = require("path");
52645
+ var import_node_crypto34 = require("crypto");
52646
+ var import_promises32 = require("fs/promises");
52647
+ var import_node_path36 = require("path");
52277
52648
  init_zod();
52278
52649
  var LOCK_FORMAT = 1;
52279
52650
  var EXCLUSIVE_FILE = "exclusive.json";
@@ -52288,12 +52659,12 @@ var ownerSchema = external_exports.object({
52288
52659
  since: external_exports.number().int().nonnegative()
52289
52660
  });
52290
52661
  function repositoryLockKey(commonDir, platform) {
52291
- return (0, import_node_crypto33.createHash)("sha256").update(comparablePath(commonDir, platform)).digest("hex").slice(0, 32);
52662
+ return (0, import_node_crypto34.createHash)("sha256").update(comparablePath(commonDir, platform)).digest("hex").slice(0, 32);
52292
52663
  }
52293
52664
  async function readOwner(path) {
52294
52665
  let text2;
52295
52666
  try {
52296
- text2 = await (0, import_promises31.readFile)(path, "utf8");
52667
+ text2 = await (0, import_promises32.readFile)(path, "utf8");
52297
52668
  } catch (error62) {
52298
52669
  if (errnoCode(error62) === "ENOENT") return { kind: "missing" };
52299
52670
  return { kind: "unreadable" };
@@ -52314,7 +52685,7 @@ async function removeIfSame(path, expected) {
52314
52685
  if (current.kind !== "owner" || current.owner.since !== expected.since) return;
52315
52686
  if (current.owner.pid !== expected.pid || current.owner.holder !== expected.holder) return;
52316
52687
  }
52317
- await (0, import_promises31.unlink)(path).catch((error62) => {
52688
+ await (0, import_promises32.unlink)(path).catch((error62) => {
52318
52689
  if (errnoCode(error62) !== "ENOENT") throw error62;
52319
52690
  });
52320
52691
  }
@@ -52339,7 +52710,7 @@ function openRepositoryLocks(options) {
52339
52710
  await removeIfSame(path, read.owner);
52340
52711
  return null;
52341
52712
  }
52342
- const age = await (0, import_promises31.stat)(path).then(
52713
+ const age = await (0, import_promises32.stat)(path).then(
52343
52714
  (info) => clock.now() - info.mtimeMs,
52344
52715
  () => 0
52345
52716
  );
@@ -52353,13 +52724,13 @@ function openRepositoryLocks(options) {
52353
52724
  });
52354
52725
  const folder = async (commonDir) => {
52355
52726
  const key = repositoryLockKey(commonDir, platform);
52356
- const dir = (0, import_node_path35.join)(options.dir, key);
52357
- await (0, import_promises31.mkdir)(dir, { recursive: true, mode: 448 });
52727
+ const dir = (0, import_node_path36.join)(options.dir, key);
52728
+ await (0, import_promises32.mkdir)(dir, { recursive: true, mode: 448 });
52358
52729
  return { key, dir };
52359
52730
  };
52360
52731
  const createExclusive = async (path, owner) => {
52361
52732
  try {
52362
- const handle = await (0, import_promises31.open)(path, "wx", 384);
52733
+ const handle = await (0, import_promises32.open)(path, "wx", 384);
52363
52734
  try {
52364
52735
  await handle.writeFile(JSON.stringify(owner));
52365
52736
  } finally {
@@ -52372,10 +52743,10 @@ function openRepositoryLocks(options) {
52372
52743
  }
52373
52744
  };
52374
52745
  const liveRun = async (dir) => {
52375
- const entries = await (0, import_promises31.readdir)(dir);
52746
+ const entries = await (0, import_promises32.readdir)(dir);
52376
52747
  for (const entry of entries) {
52377
52748
  if (!entry.startsWith(RUN_FILE_PREFIX)) continue;
52378
- const holder = await heldBy((0, import_node_path35.join)(dir, entry));
52749
+ const holder = await heldBy((0, import_node_path36.join)(dir, entry));
52379
52750
  if (holder !== null) return holder;
52380
52751
  }
52381
52752
  return null;
@@ -52383,7 +52754,7 @@ function openRepositoryLocks(options) {
52383
52754
  return {
52384
52755
  tryExclusive: async (commonDir, operationId) => {
52385
52756
  const { key, dir } = await folder(commonDir);
52386
- const path = (0, import_node_path35.join)(dir, EXCLUSIVE_FILE);
52757
+ const path = (0, import_node_path36.join)(dir, EXCLUSIVE_FILE);
52387
52758
  const owner = await self(operationId);
52388
52759
  if (!await createExclusive(path, owner)) {
52389
52760
  const holder = await heldBy(path);
@@ -52401,11 +52772,11 @@ function openRepositoryLocks(options) {
52401
52772
  },
52402
52773
  tryShared: async (commonDir, runId) => {
52403
52774
  const { key, dir } = await folder(commonDir);
52404
- const file2 = `${RUN_FILE_PREFIX}${(0, import_node_crypto33.createHash)("sha256").update(runId).digest("hex").slice(0, 32)}.json`;
52405
- const path = (0, import_node_path35.join)(dir, file2);
52775
+ const file2 = `${RUN_FILE_PREFIX}${(0, import_node_crypto34.createHash)("sha256").update(runId).digest("hex").slice(0, 32)}.json`;
52776
+ const path = (0, import_node_path36.join)(dir, file2);
52406
52777
  const owner = await self(runId);
52407
52778
  await writeJsonFileAtomic(path, owner);
52408
- const operation = await heldBy((0, import_node_path35.join)(dir, EXCLUSIVE_FILE));
52779
+ const operation = await heldBy((0, import_node_path36.join)(dir, EXCLUSIVE_FILE));
52409
52780
  if (operation !== null) {
52410
52781
  await removeIfSame(path, owner);
52411
52782
  return { kind: "busy", holder: operation };
@@ -52564,7 +52935,7 @@ function createProviderDrivers(options) {
52564
52935
  }
52565
52936
 
52566
52937
  // src/holder/engine-records.ts
52567
- var import_node_path37 = require("path");
52938
+ var import_node_path38 = require("path");
52568
52939
  init_process();
52569
52940
  init_zod();
52570
52941
  var ENGINES_FILE = "engines.json";
@@ -52575,7 +52946,7 @@ var engineRecordSchema = external_exports.object({
52575
52946
  });
52576
52947
  var engineRecordsSchema = external_exports.object({ engines: external_exports.array(engineRecordSchema) });
52577
52948
  function engineRecordsPath(sessionDir) {
52578
- return (0, import_node_path37.join)(sessionDir, ENGINES_FILE);
52949
+ return (0, import_node_path38.join)(sessionDir, ENGINES_FILE);
52579
52950
  }
52580
52951
  function recordSpawnedEngines(path, clock, log) {
52581
52952
  const live = /* @__PURE__ */ new Map();
@@ -52630,17 +53001,17 @@ function createConversationMcpAuthorization(options) {
52630
53001
  }
52631
53002
 
52632
53003
  // src/holder/mcp-helper-access.ts
52633
- var import_promises32 = require("fs/promises");
53004
+ var import_promises33 = require("fs/promises");
52634
53005
  function createHelperMcpAccess(options) {
52635
53006
  return {
52636
53007
  [Symbol.asyncDispose]: async () => {
52637
- await (0, import_promises32.rm)(options.credentialPath, { force: true });
53008
+ await (0, import_promises33.rm)(options.credentialPath, { force: true });
52638
53009
  },
52639
53010
  url: options.managedMcp.url,
52640
53011
  authorization: async (signal) => {
52641
53012
  const authorization = await options.managedMcp.authorization(signal);
52642
53013
  if (authorization === void 0 || signal.aborted) {
52643
- await (0, import_promises32.rm)(options.credentialPath, { force: true });
53014
+ await (0, import_promises33.rm)(options.credentialPath, { force: true });
52644
53015
  return void 0;
52645
53016
  }
52646
53017
  const credential = {
@@ -52655,8 +53026,8 @@ function createHelperMcpAccess(options) {
52655
53026
  }
52656
53027
 
52657
53028
  // src/holder/run-inputs.ts
52658
- var import_promises33 = require("fs/promises");
52659
- var import_node_path38 = require("path");
53029
+ var import_promises34 = require("fs/promises");
53030
+ var import_node_path39 = require("path");
52660
53031
  init_src();
52661
53032
  var NO_RUN_INPUTS = {
52662
53033
  attachments: [],
@@ -52670,17 +53041,17 @@ function safeFilename(filename) {
52670
53041
  return safe || "attachment";
52671
53042
  }
52672
53043
  function persistentAttachmentDir(workspaceRoot2) {
52673
- return (0, import_node_path38.join)(workspaceRoot2, ".alan", "attachments");
53044
+ return (0, import_node_path39.join)(workspaceRoot2, ".alan", "attachments");
52674
53045
  }
52675
53046
  function attachmentPath(spec, attachment, index, runDir) {
52676
53047
  const workspaceRoot2 = spec.approvedWorkspacePaths?.[0];
52677
53048
  if (attachment.persist && workspaceRoot2) {
52678
- return (0, import_node_path38.join)(
53049
+ return (0, import_node_path39.join)(
52679
53050
  persistentAttachmentDir(workspaceRoot2),
52680
53051
  `${attachment.id.slice(0, 8)}-${safeFilename(attachment.filename)}`
52681
53052
  );
52682
53053
  }
52683
- return (0, import_node_path38.join)(runDir, `${index}-${safeFilename(attachment.filename)}`);
53054
+ return (0, import_node_path39.join)(runDir, `${index}-${safeFilename(attachment.filename)}`);
52684
53055
  }
52685
53056
  function runMediaUploader(source, runId) {
52686
53057
  const upload = source.uploadMedia?.bind(source);
@@ -52689,10 +53060,11 @@ function runMediaUploader(source, runId) {
52689
53060
  upload: ({ data, ...media }, signal) => upload(runId, { ...media, bytes: data.byteLength }, data, signal)
52690
53061
  };
52691
53062
  }
52692
- async function prepareRunInputs(spec, { source, tmpDir, signal, skills = [] }) {
52693
- const dir = (0, import_node_path38.join)(tmpDir, "runs", spec.runId);
53063
+ async function prepareRunInputs(spec, { source, tmpDir, signal, skills = [], commitAttribution }) {
53064
+ await commitAttribution?.setCoAuthor(spec.gitCoAuthor);
53065
+ const dir = (0, import_node_path39.join)(tmpDir, "runs", spec.runId);
52694
53066
  const cleanup = async () => {
52695
- await (0, import_promises33.rm)(dir, { recursive: true, force: true });
53067
+ await (0, import_promises34.rm)(dir, { recursive: true, force: true });
52696
53068
  };
52697
53069
  try {
52698
53070
  const credential = await source.fetchProviderCredential(spec.runId, signal);
@@ -52700,8 +53072,8 @@ async function prepareRunInputs(spec, { source, tmpDir, signal, skills = [] }) {
52700
53072
  for (const [index, attachment] of (spec.attachments ?? []).entries()) {
52701
53073
  const bytes = await source.downloadAttachment(spec.runId, attachment.id, signal);
52702
53074
  const path = attachmentPath(spec, attachment, index, dir);
52703
- await (0, import_promises33.mkdir)((0, import_node_path38.dirname)(path), { recursive: true, mode: 448 });
52704
- await (0, import_promises33.writeFile)(path, bytes, { mode: 384 });
53075
+ await (0, import_promises34.mkdir)((0, import_node_path39.dirname)(path), { recursive: true, mode: 448 });
53076
+ await (0, import_promises34.writeFile)(path, bytes, { mode: 384 });
52705
53077
  const imageMimeType = attachment.kind === "image" ? detectImageMimeType(Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength)) : null;
52706
53078
  attachments.push({
52707
53079
  id: attachment.id,
@@ -52731,33 +53103,33 @@ async function prepareRunInputs(spec, { source, tmpDir, signal, skills = [] }) {
52731
53103
  }
52732
53104
 
52733
53105
  // src/holder/serve.ts
52734
- var import_node_crypto35 = require("crypto");
53106
+ var import_node_crypto36 = require("crypto");
52735
53107
  var import_node_fs22 = require("fs");
52736
53108
  var import_node_net2 = require("net");
52737
- var import_node_path48 = require("path");
53109
+ var import_node_path49 = require("path");
52738
53110
  init_runtime_v2();
52739
53111
 
52740
53112
  // src/holder/admission.ts
52741
53113
  var import_node_fs20 = require("fs");
52742
- var import_promises37 = require("fs/promises");
53114
+ var import_promises38 = require("fs/promises");
52743
53115
  var import_node_os7 = require("os");
52744
- var import_node_path44 = require("path");
53116
+ var import_node_path45 = require("path");
52745
53117
  init_constants();
52746
53118
 
52747
53119
  // ../shared/src/node/local-workspace.ts
52748
53120
  var import_node_fs19 = require("fs");
52749
53121
  var import_node_os6 = require("os");
52750
- var import_node_path39 = require("path");
53122
+ var import_node_path40 = require("path");
52751
53123
  function resolveAlanDefaultWorkspacePath(homeDirectory = (0, import_node_os6.homedir)()) {
52752
- return (0, import_node_path39.join)(homeDirectory, ".alan", "workspace");
53124
+ return (0, import_node_path40.join)(homeDirectory, ".alan", "workspace");
52753
53125
  }
52754
53126
 
52755
53127
  // src/holder/agent-context.ts
52756
- var import_promises34 = require("fs/promises");
52757
- var import_node_path40 = require("path");
53128
+ var import_promises35 = require("fs/promises");
53129
+ var import_node_path41 = require("path");
52758
53130
  init_prompt();
52759
53131
  async function readText2(path) {
52760
- return (0, import_promises34.readFile)(path, "utf8").then(
53132
+ return (0, import_promises35.readFile)(path, "utf8").then(
52761
53133
  (text2) => text2.trim(),
52762
53134
  () => null
52763
53135
  );
@@ -52772,10 +53144,10 @@ async function startCommandState(statusPath) {
52772
53144
  return code === 0 ? { state: "exited_ok" } : { state: "failed", exitCode: code };
52773
53145
  }
52774
53146
  function createAgentContext(deps) {
52775
- const statusPath = (0, import_node_path40.join)(deps.homeDir, ".alan", "start-commands.status");
52776
- const logPath = (0, import_node_path40.join)(deps.homeDir, ".alan", "start-commands.log");
53147
+ const statusPath = (0, import_node_path41.join)(deps.homeDir, ".alan", "start-commands.status");
53148
+ const logPath = (0, import_node_path41.join)(deps.homeDir, ".alan", "start-commands.log");
52777
53149
  return async (spec, problems) => {
52778
- const file2 = (0, import_node_path40.join)(deps.dir, `${spec.conversationId}.json`);
53150
+ const file2 = (0, import_node_path41.join)(deps.dir, `${spec.conversationId}.json`);
52779
53151
  const saved = await readJsonFile(file2, agentContextSnapshotSchema);
52780
53152
  const known = saved.kind === "ok" ? saved.value : void 0;
52781
53153
  const hasEnvironment = (spec.agentContext ?? known)?.environment !== void 0;
@@ -52799,28 +53171,28 @@ function createAgentContext(deps) {
52799
53171
  }
52800
53172
 
52801
53173
  // src/holder/checkout-refresh.ts
52802
- var import_node_path43 = require("path");
53174
+ var import_node_path44 = require("path");
52803
53175
 
52804
53176
  // src/holder/claim-once.ts
52805
- var import_node_crypto34 = require("crypto");
52806
- var import_promises35 = require("fs/promises");
52807
- var import_node_path41 = require("path");
53177
+ var import_node_crypto35 = require("crypto");
53178
+ var import_promises36 = require("fs/promises");
53179
+ var import_node_path42 = require("path");
52808
53180
  async function claimOnce(dir, name) {
52809
53181
  try {
52810
- await (0, import_promises35.mkdir)(dir, { recursive: true, mode: 448 });
52811
- await (await (0, import_promises35.open)((0, import_node_path41.join)(dir, name), "wx")).close();
53182
+ await (0, import_promises36.mkdir)(dir, { recursive: true, mode: 448 });
53183
+ await (await (0, import_promises36.open)((0, import_node_path42.join)(dir, name), "wx")).close();
52812
53184
  return true;
52813
53185
  } catch {
52814
53186
  return false;
52815
53187
  }
52816
53188
  }
52817
53189
  function claimFirstLease(freshnessDir, path) {
52818
- return claimOnce((0, import_node_path41.join)(freshnessDir, "leased"), (0, import_node_crypto34.createHash)("sha256").update(path).digest("hex"));
53190
+ return claimOnce((0, import_node_path42.join)(freshnessDir, "leased"), (0, import_node_crypto35.createHash)("sha256").update(path).digest("hex"));
52819
53191
  }
52820
53192
 
52821
53193
  // src/holder/requested-checkout.ts
52822
- var import_promises36 = require("fs/promises");
52823
- var import_node_path42 = require("path");
53194
+ var import_promises37 = require("fs/promises");
53195
+ var import_node_path43 = require("path");
52824
53196
  var REMOTE2 = "origin";
52825
53197
  var REASON_MAX_CHARS = 200;
52826
53198
  function firstLine2(text2) {
@@ -52841,8 +53213,8 @@ function notSwitched(checkout, current, reason) {
52841
53213
  );
52842
53214
  }
52843
53215
  async function clone2(checkout, deps, signal) {
52844
- const parent = (0, import_node_path42.dirname)(checkout.path);
52845
- await (0, import_promises36.mkdir)(parent, { recursive: true });
53216
+ const parent = (0, import_node_path43.dirname)(checkout.path);
53217
+ await (0, import_promises37.mkdir)(parent, { recursive: true });
52846
53218
  await assertValidBranch(deps.git, parent, checkout.branch, signal);
52847
53219
  const output2 = await deps.git.run(
52848
53220
  {
@@ -53077,7 +53449,7 @@ async function applyRequestedCheckouts(spec, deps, signal) {
53077
53449
  ms: Date.now() - startedAt
53078
53450
  });
53079
53451
  if (outcome2.kind === "on_branch") continue;
53080
- settled2.add((0, import_node_path43.resolve)(checkout.path));
53452
+ settled2.add((0, import_node_path44.resolve)(checkout.path));
53081
53453
  if (outcome2.kind === "noted") {
53082
53454
  problems.push({ path: checkout.path, problem: outcome2.problem, action: outcome2.action });
53083
53455
  }
@@ -53087,7 +53459,7 @@ async function applyRequestedCheckouts(spec, deps, signal) {
53087
53459
  async function refreshSnapshotCheckouts(spec, targets, settled2, deps, signal) {
53088
53460
  const problems = [];
53089
53461
  for (const target of targets) {
53090
- if (settled2.has((0, import_node_path43.resolve)(target))) continue;
53462
+ if (settled2.has((0, import_node_path44.resolve)(target))) continue;
53091
53463
  const freshness = await readCheckoutFreshness(deps.dir, target);
53092
53464
  if (freshness === null) continue;
53093
53465
  const startedAt = Date.now();
@@ -53108,7 +53480,7 @@ async function refreshSnapshotCheckouts(spec, targets, settled2, deps, signal) {
53108
53480
  function createCheckoutRefresh(deps) {
53109
53481
  return async (spec, signal) => {
53110
53482
  if (spec.providerSessionId !== void 0) return [];
53111
- if (!await claimOnce((0, import_node_path43.join)(deps.dir, "conversations"), spec.conversationId)) return [];
53483
+ if (!await claimOnce((0, import_node_path44.join)(deps.dir, "conversations"), spec.conversationId)) return [];
53112
53484
  const requested = await applyRequestedCheckouts(spec, deps, signal);
53113
53485
  const targets = await checkoutsOf(spec);
53114
53486
  return [
@@ -53150,7 +53522,7 @@ function volumeRoot(path) {
53150
53522
  }
53151
53523
  async function exists(path) {
53152
53524
  try {
53153
- await (0, import_promises37.stat)(path);
53525
+ await (0, import_promises38.stat)(path);
53154
53526
  return true;
53155
53527
  } catch {
53156
53528
  return false;
@@ -53158,10 +53530,10 @@ async function exists(path) {
53158
53530
  }
53159
53531
  async function inspectReadiness(path) {
53160
53532
  try {
53161
- if (!(await (0, import_promises37.stat)(path)).isDirectory()) {
53533
+ if (!(await (0, import_promises38.stat)(path)).isDirectory()) {
53162
53534
  return { ready: false, missing: true, message: MESSAGES.missing };
53163
53535
  }
53164
- await (0, import_promises37.access)(path, import_node_fs20.constants.R_OK | import_node_fs20.constants.W_OK | import_node_fs20.constants.X_OK);
53536
+ await (0, import_promises38.access)(path, import_node_fs20.constants.R_OK | import_node_fs20.constants.W_OK | import_node_fs20.constants.X_OK);
53165
53537
  return { ready: true };
53166
53538
  } catch (error62) {
53167
53539
  const code = errnoCode(error62) ?? "";
@@ -53205,8 +53577,8 @@ async function admitDefaultWorkspace(spec, context, skills) {
53205
53577
  const { env } = context;
53206
53578
  const path = resolveAlanDefaultWorkspacePath(env.HOME || env.USERPROFILE || (0, import_node_os7.homedir)());
53207
53579
  try {
53208
- await (0, import_promises37.mkdir)(path, { recursive: true, mode: 448 });
53209
- await (0, import_promises37.access)(path, import_node_fs20.constants.R_OK | import_node_fs20.constants.W_OK | import_node_fs20.constants.X_OK);
53580
+ await (0, import_promises38.mkdir)(path, { recursive: true, mode: 448 });
53581
+ await (0, import_promises38.access)(path, import_node_fs20.constants.R_OK | import_node_fs20.constants.W_OK | import_node_fs20.constants.X_OK);
53210
53582
  return { kind: "admitted", spec: { ...spec, projectPath: path }, skills };
53211
53583
  } catch (error62) {
53212
53584
  const code = errnoCode(error62);
@@ -53295,7 +53667,7 @@ function createHolderWorkspace(machine, clock, log) {
53295
53667
  ),
53296
53668
  approvedRoots: async () => {
53297
53669
  const approved = await openApprovedPaths({
53298
- file: (0, import_node_path44.join)(machine.stateDir, "workspaces.json"),
53670
+ file: (0, import_node_path45.join)(machine.stateDir, "workspaces.json"),
53299
53671
  log,
53300
53672
  platform
53301
53673
  });
@@ -53311,12 +53683,12 @@ function createHolderWorkspace(machine, clock, log) {
53311
53683
  localTimeoutMs: CHECKOUT_LOCAL_TIMEOUT_MS,
53312
53684
  networkTimeoutMs: CHECKOUT_NETWORK_TIMEOUT_MS
53313
53685
  }),
53314
- locks: openRepositoryLocks({ dir: (0, import_node_path44.join)(machine.stateDir, "locks"), clock, platform }),
53686
+ locks: openRepositoryLocks({ dir: (0, import_node_path45.join)(machine.stateDir, "locks"), clock, platform }),
53315
53687
  log,
53316
- dir: (0, import_node_path44.join)(machine.stateDir, "checkout-freshness")
53688
+ dir: (0, import_node_path45.join)(machine.stateDir, "checkout-freshness")
53317
53689
  }),
53318
53690
  prepareAgentContext: createAgentContext({
53319
- dir: (0, import_node_path44.join)(machine.stateDir, "agent-context"),
53691
+ dir: (0, import_node_path45.join)(machine.stateDir, "agent-context"),
53320
53692
  homeDir: machine.env.HOME || (0, import_node_os7.homedir)()
53321
53693
  })
53322
53694
  } : {}
@@ -53334,7 +53706,7 @@ async function respondToTurn(runningRunId, driver, request2) {
53334
53706
  }
53335
53707
 
53336
53708
  // src/holder/session-facts.ts
53337
- var import_promises38 = require("fs/promises");
53709
+ var import_promises39 = require("fs/promises");
53338
53710
  var CLI_RSS_CACHE_MS = 1e4;
53339
53711
  var LOGIN_PROBLEM_PREFIX = "cli.auth.";
53340
53712
  function isLoginFailure(result) {
@@ -53360,8 +53732,8 @@ function createSessionFacts(options) {
53360
53732
  const path = await resolveCommandOnPath(command, env, platform);
53361
53733
  if (path === null) return null;
53362
53734
  try {
53363
- const real = await (0, import_promises38.realpath)(path);
53364
- const info = await (0, import_promises38.stat)(real);
53735
+ const real = await (0, import_promises39.realpath)(path);
53736
+ const info = await (0, import_promises39.stat)(real);
53365
53737
  return { command, key: `${real}:${info.ino}:${info.size}:${info.mtimeMs}` };
53366
53738
  } catch {
53367
53739
  return null;
@@ -53455,8 +53827,8 @@ async function steerTurn(runningRunId, driver, request2) {
53455
53827
  init_acp2();
53456
53828
 
53457
53829
  // src/run-log/directory.ts
53458
- var import_promises39 = require("fs/promises");
53459
- var import_node_path45 = require("path");
53830
+ var import_promises40 = require("fs/promises");
53831
+ var import_node_path46 = require("path");
53460
53832
  init_runtime_v2();
53461
53833
  init_zod();
53462
53834
  var runMetaSchema = external_exports.object({
@@ -53478,17 +53850,17 @@ var runMetaSchema = external_exports.object({
53478
53850
  }).optional()
53479
53851
  });
53480
53852
  function runDirectory(runsDir, runId) {
53481
- const dir = (0, import_node_path45.join)(runsDir, runId);
53853
+ const dir = (0, import_node_path46.join)(runsDir, runId);
53482
53854
  return {
53483
53855
  dir,
53484
- log: (0, import_node_path45.join)(dir, "log.jsonl"),
53485
- upload: (0, import_node_path45.join)(dir, "upload.json"),
53486
- meta: (0, import_node_path45.join)(dir, "run.json")
53856
+ log: (0, import_node_path46.join)(dir, "log.jsonl"),
53857
+ upload: (0, import_node_path46.join)(dir, "upload.json"),
53858
+ meta: (0, import_node_path46.join)(dir, "run.json")
53487
53859
  };
53488
53860
  }
53489
53861
  async function isRunClaimed(runsDir, runId) {
53490
53862
  try {
53491
- return (await (0, import_promises39.stat)(runDirectory(runsDir, runId).log)).size > 0;
53863
+ return (await (0, import_promises40.stat)(runDirectory(runsDir, runId).log)).size > 0;
53492
53864
  } catch (error62) {
53493
53865
  if (errnoCode(error62) === "ENOENT") return false;
53494
53866
  throw error62;
@@ -53496,8 +53868,8 @@ async function isRunClaimed(runsDir, runId) {
53496
53868
  }
53497
53869
 
53498
53870
  // src/run-log/conversation-index.ts
53499
- var import_promises40 = require("fs/promises");
53500
- var import_node_path46 = require("path");
53871
+ var import_promises41 = require("fs/promises");
53872
+ var import_node_path47 = require("path");
53501
53873
  init_runtime_v2();
53502
53874
  init_zod();
53503
53875
  var ORDINALS_PER_SHARD = 1e3;
@@ -53513,13 +53885,13 @@ var coverageSchema = external_exports.object({
53513
53885
  nextExpectedOrdinal: external_exports.number().int().positive()
53514
53886
  });
53515
53887
  function conversationsDirectory(runsDir) {
53516
- return (0, import_node_path46.join)((0, import_node_path46.dirname)(runsDir), "conversations");
53888
+ return (0, import_node_path47.join)((0, import_node_path47.dirname)(runsDir), "conversations");
53517
53889
  }
53518
53890
  function indexDirectory(runsDir, conversationId) {
53519
- return (0, import_node_path46.join)(conversationsDirectory(runsDir), conversationId, "turn-index");
53891
+ return (0, import_node_path47.join)(conversationsDirectory(runsDir), conversationId, "turn-index");
53520
53892
  }
53521
53893
  function shardPath(runsDir, conversationId, ordinal) {
53522
- return (0, import_node_path46.join)(
53894
+ return (0, import_node_path47.join)(
53523
53895
  indexDirectory(runsDir, conversationId),
53524
53896
  `${Math.floor(ordinal / ORDINALS_PER_SHARD)}.jsonl`
53525
53897
  );
@@ -53528,10 +53900,10 @@ async function indexConversationRun(runsDir, conversationId, ordinal, assistantO
53528
53900
  const nextOrdinal = assistantOrdinal + 1;
53529
53901
  if (nextOrdinal <= ordinal) throw new Error("Assistant order must follow the prompt");
53530
53902
  const path = shardPath(runsDir, conversationId, ordinal);
53531
- await (0, import_promises40.mkdir)((0, import_node_path46.dirname)(path), { recursive: true, mode: 448 });
53532
- await (0, import_promises40.appendFile)(path, `${JSON.stringify({ ordinal, nextOrdinal, runId })}
53903
+ await (0, import_promises41.mkdir)((0, import_node_path47.dirname)(path), { recursive: true, mode: 448 });
53904
+ await (0, import_promises41.appendFile)(path, `${JSON.stringify({ ordinal, nextOrdinal, runId })}
53533
53905
  `, { mode: 384 });
53534
- const coveragePath = (0, import_node_path46.join)((0, import_node_path46.dirname)((0, import_node_path46.dirname)(path)), "coverage.json");
53906
+ const coveragePath = (0, import_node_path47.join)((0, import_node_path47.dirname)((0, import_node_path47.dirname)(path)), "coverage.json");
53535
53907
  const coverage = await readJsonFile(coveragePath, coverageSchema);
53536
53908
  const current = coverage.kind === "ok" ? coverage.value : null;
53537
53909
  const next = nextCoverage(current, ordinal, nextOrdinal);
@@ -53590,7 +53962,7 @@ var decoder = new TextDecoder();
53590
53962
 
53591
53963
  // src/run-log/writer.ts
53592
53964
  var import_node_fs21 = require("fs");
53593
- var import_node_path47 = require("path");
53965
+ var import_node_path48 = require("path");
53594
53966
  init_runtime_v2();
53595
53967
  function readTail(fd, size) {
53596
53968
  for (const length of tailWindows(size)) {
@@ -53609,7 +53981,7 @@ function writeAt(fd, bytes, position) {
53609
53981
  }
53610
53982
  }
53611
53983
  function openRunLog(path, clock) {
53612
- (0, import_node_fs21.mkdirSync)((0, import_node_path47.dirname)(path), { recursive: true, mode: 448 });
53984
+ (0, import_node_fs21.mkdirSync)((0, import_node_path48.dirname)(path), { recursive: true, mode: 448 });
53613
53985
  const fd = (0, import_node_fs21.openSync)(path, import_node_fs21.constants.O_RDWR | import_node_fs21.constants.O_CREAT, 384);
53614
53986
  const fileSize = (0, import_node_fs21.fstatSync)(fd).size;
53615
53987
  const tail = readTail(fd, fileSize);
@@ -53619,6 +53991,7 @@ function openRunLog(path, clock) {
53619
53991
  (0, import_node_fs21.ftruncateSync)(fd, size);
53620
53992
  (0, import_node_fs21.fsyncSync)(fd);
53621
53993
  }
53994
+ const droppedTailBytes = fileSize - size;
53622
53995
  let dirty = false;
53623
53996
  const sync = () => {
53624
53997
  (0, import_node_fs21.fsyncSync)(fd);
@@ -53647,6 +54020,7 @@ function openRunLog(path, clock) {
53647
54020
  return toByteOffset(size);
53648
54021
  },
53649
54022
  size: () => toByteOffset(size),
54023
+ droppedTailBytes,
53650
54024
  syncIfDirty: () => {
53651
54025
  if (dirty) sync();
53652
54026
  },
@@ -53890,12 +54264,12 @@ var TASK_UNSUPPORTED = {
53890
54264
  message: "This agent cannot stop one background task."
53891
54265
  };
53892
54266
  function sha2563(value) {
53893
- return (0, import_node_crypto35.createHash)("sha256").update(value).digest("hex");
54267
+ return (0, import_node_crypto36.createHash)("sha256").update(value).digest("hex");
53894
54268
  }
53895
54269
  function tokenMatches(expected, presented) {
53896
54270
  const a = Buffer.from(sha2563(expected), "hex");
53897
54271
  const b = Buffer.from(sha2563(presented), "hex");
53898
- return (0, import_node_crypto35.timingSafeEqual)(a, b);
54272
+ return (0, import_node_crypto36.timingSafeEqual)(a, b);
53899
54273
  }
53900
54274
  async function runHolder({
53901
54275
  launch,
@@ -53909,7 +54283,7 @@ async function runHolder({
53909
54283
  try {
53910
54284
  const identity = await readProcessIdentity(process.pid);
53911
54285
  if (identity === null) throw new RuntimeFault("internal", "Cannot read own process identity");
53912
- const _engines = __using(_stack, recordSpawnedEngines(engineRecordsPath((0, import_node_path48.dirname)(launch.statusPath)), clock, log));
54286
+ const _engines = __using(_stack, recordSpawnedEngines(engineRecordsPath((0, import_node_path49.dirname)(launch.statusPath)), clock, log));
53913
54287
  const holder = {
53914
54288
  state: "idle",
53915
54289
  runId: null,
@@ -53917,7 +54291,7 @@ async function runHolder({
53917
54291
  clients: /* @__PURE__ */ new Set()
53918
54292
  };
53919
54293
  const activity = __using(_stack, startActivityFile({
53920
- path: sessionActivityPath((0, import_node_path48.dirname)(launch.statusPath)),
54294
+ path: sessionActivityPath((0, import_node_path49.dirname)(launch.statusPath)),
53921
54295
  read: () => ({
53922
54296
  runId: holder.runId,
53923
54297
  ...driver.activity?.() ?? IDLE_DRIVER_ACTIVITY
@@ -54161,29 +54535,29 @@ async function runHolder({
54161
54535
 
54162
54536
  // src/cli/config.ts
54163
54537
  var import_node_os8 = require("os");
54164
- var import_node_path51 = require("path");
54538
+ var import_node_path52 = require("path");
54165
54539
  init_zod();
54166
54540
 
54167
54541
  // src/client/locate.ts
54168
- var import_node_path49 = require("path");
54542
+ var import_node_path50 = require("path");
54169
54543
  var RUNTIME_PROFILES = ["production", "staging", "development", "local"];
54170
54544
  function defaultStateDir({ profile, platform, home, env }) {
54171
54545
  if (platform === "win32") {
54172
- return (0, import_node_path49.join)(env.LOCALAPPDATA ?? (0, import_node_path49.join)(home, "AppData", "Local"), "Alan", profile);
54546
+ return (0, import_node_path50.join)(env.LOCALAPPDATA ?? (0, import_node_path50.join)(home, "AppData", "Local"), "Alan", profile);
54173
54547
  }
54174
- return (0, import_node_path49.join)(env.XDG_STATE_HOME ?? (0, import_node_path49.join)(home, ".local", "state"), "alan", profile);
54548
+ return (0, import_node_path50.join)(env.XDG_STATE_HOME ?? (0, import_node_path50.join)(home, ".local", "state"), "alan", profile);
54175
54549
  }
54176
54550
  function defaultInstallDir({ platform, home, env }) {
54177
54551
  if (platform === "win32") {
54178
- return (0, import_node_path49.join)(env.LOCALAPPDATA ?? (0, import_node_path49.join)(home, "AppData", "Local"), "Alan", "runtime");
54552
+ return (0, import_node_path50.join)(env.LOCALAPPDATA ?? (0, import_node_path50.join)(home, "AppData", "Local"), "Alan", "runtime");
54179
54553
  }
54180
- return (0, import_node_path49.join)(env.XDG_DATA_HOME ?? (0, import_node_path49.join)(home, ".local", "share"), "alan", "runtime");
54554
+ return (0, import_node_path50.join)(env.XDG_DATA_HOME ?? (0, import_node_path50.join)(home, ".local", "share"), "alan", "runtime");
54181
54555
  }
54182
54556
 
54183
54557
  // src/sessions/index.ts
54184
- var import_node_crypto36 = require("crypto");
54185
- var import_promises41 = require("fs/promises");
54186
- var import_node_path50 = require("path");
54558
+ var import_node_crypto37 = require("crypto");
54559
+ var import_promises42 = require("fs/promises");
54560
+ var import_node_path51 = require("path");
54187
54561
 
54188
54562
  // src/sessions/suspend-policy.ts
54189
54563
  var DEFAULT_SUSPEND_POLICY = { idleMs: 30 * 6e4 };
@@ -54240,7 +54614,7 @@ var SECRET_VARIABLES = /* @__PURE__ */ new Set([
54240
54614
  ]);
54241
54615
  var ALAN_CODE_ENGINE_VARIABLE = "ALAN_CODE_ENGINE_PATH";
54242
54616
  function codexSkillsDir(config2) {
54243
- return config2.gitGatewayUrl === null ? null : (0, import_node_path51.join)(config2.codexHome, "skills");
54617
+ return config2.gitGatewayUrl === null ? null : (0, import_node_path52.join)(config2.codexHome, "skills");
54244
54618
  }
54245
54619
  function loadRuntimeConfig(env = process.env) {
54246
54620
  const parsed = envSchema.safeParse(env);
@@ -54301,7 +54675,7 @@ function loadRuntimeConfig(env = process.env) {
54301
54675
  providerProbes: ALAN_RUNTIME_PROVIDER_PROBES === "on",
54302
54676
  providerToolchain: ALAN_RUNTIME_PROVIDER_NODE !== void 0 && ALAN_RUNTIME_PROVIDER_NPM_CLI !== void 0 ? { node: ALAN_RUNTIME_PROVIDER_NODE, npmCli: ALAN_RUNTIME_PROVIDER_NPM_CLI } : null,
54303
54677
  home,
54304
- configHome: XDG_CONFIG_HOME ?? (0, import_node_path51.join)(home, ".config"),
54678
+ configHome: XDG_CONFIG_HOME ?? (0, import_node_path52.join)(home, ".config"),
54305
54679
  codexHome: resolveCodexHome(CODEX_HOME, home),
54306
54680
  ...githubProxyConfig({ ALAN_RUNTIME_GITHUB_PROXY, XDG_CONFIG_HOME, GH_CONFIG_DIR }, home),
54307
54681
  gitGatewayUrl: ALAN_RUNTIME_GIT_GATEWAY_URL ?? null,
@@ -54312,13 +54686,13 @@ function loadRuntimeConfig(env = process.env) {
54312
54686
  };
54313
54687
  }
54314
54688
  function resolveCodexHome(configuredHome, home) {
54315
- return configuredHome ?? (0, import_node_path51.join)(home, ".codex");
54689
+ return configuredHome ?? (0, import_node_path52.join)(home, ".codex");
54316
54690
  }
54317
54691
  function githubProxyConfig(env, home) {
54318
- const configHome = env.XDG_CONFIG_HOME ?? (0, import_node_path51.join)(home, ".config");
54692
+ const configHome = env.XDG_CONFIG_HOME ?? (0, import_node_path52.join)(home, ".config");
54319
54693
  return {
54320
54694
  githubProxy: env.ALAN_RUNTIME_GITHUB_PROXY === "on",
54321
- ghConfigDir: env.GH_CONFIG_DIR ?? (0, import_node_path51.join)(configHome, "gh")
54695
+ ghConfigDir: env.GH_CONFIG_DIR ?? (0, import_node_path52.join)(configHome, "gh")
54322
54696
  };
54323
54697
  }
54324
54698
  function serviceEnvironment(env, profile) {
@@ -54417,18 +54791,18 @@ async function loadStoredAccess(paths, access4 = { exec: systemExec }) {
54417
54791
  }
54418
54792
 
54419
54793
  // src/cli/commands/hold.ts
54420
- var import_node_path53 = require("path");
54794
+ var import_node_path54 = require("path");
54421
54795
  init_agent2();
54422
54796
  init_runtime_v2();
54423
54797
 
54424
54798
  // src/cli/commands/cli-flag-probes.ts
54425
- var import_node_path52 = require("path");
54799
+ var import_node_path53 = require("path");
54426
54800
  init_process();
54427
54801
  init_claude();
54428
54802
  var CLI_FLAG_PROBES_FILE = "cli-flag-probes.json";
54429
54803
  function openCliFlagProbe(stateDir) {
54430
54804
  return createFlagProbe({
54431
- store: createFileFlagProbeStore((0, import_node_path52.join)(stateDir, CLI_FLAG_PROBES_FILE))
54805
+ store: createFileFlagProbeStore((0, import_node_path53.join)(stateDir, CLI_FLAG_PROBES_FILE))
54432
54806
  });
54433
54807
  }
54434
54808
 
@@ -54489,7 +54863,7 @@ async function runHold(argv) {
54489
54863
  const config2 = loadRuntimeConfig();
54490
54864
  const paths = runtimePaths(config2.stateDir);
54491
54865
  const log = __using(_stack, openFileLog(
54492
- (0, import_node_path53.join)(paths.logs, `holder-${launch.value.conversationId}.jsonl`),
54866
+ (0, import_node_path54.join)(paths.logs, `holder-${launch.value.conversationId}.jsonl`),
54493
54867
  config2.logLevel,
54494
54868
  systemClock
54495
54869
  ));
@@ -54498,16 +54872,25 @@ async function runHold(argv) {
54498
54872
  process.argv[1],
54499
54873
  process.platform
54500
54874
  );
54875
+ const commitAttribution = await installCommitAttribution({
54876
+ dir: (0, import_node_path54.join)(paths.stateDir, "git-attribution"),
54877
+ env: cliEnvironment,
54878
+ platform: process.platform
54879
+ }).catch((error62) => {
54880
+ log.warn("holder.commit_attribution_unavailable", { error: error62 });
54881
+ return null;
54882
+ });
54883
+ const agentEnvironment = commitAttribution?.env ?? cliEnvironment;
54501
54884
  const transport = __using(_stack, createHttpTransport());
54502
54885
  const access4 = await machineAccess(paths, log, launch.value.conversationId, transport);
54503
- const credentialPath = (0, import_node_path53.join)(paths.tmp, "mcp", `${launch.value.conversationId}.json`);
54886
+ const credentialPath = (0, import_node_path54.join)(paths.tmp, "mcp", `${launch.value.conversationId}.json`);
54504
54887
  const managedMcp = __using(_stack, access4.managedMcp === void 0 ? void 0 : createHelperMcpAccess({
54505
54888
  managedMcp: access4.managedMcp,
54506
54889
  conversationId: launch.value.conversationId,
54507
54890
  credentialPath
54508
54891
  }), true);
54509
- const providerEnvironment2 = access4.managedMcp === void 0 ? cliEnvironment : {
54510
- ...cliEnvironment,
54892
+ const providerEnvironment2 = access4.managedMcp === void 0 ? agentEnvironment : {
54893
+ ...agentEnvironment,
54511
54894
  [ALAN_MCP_URL_ENV]: access4.managedMcp.url,
54512
54895
  [ALAN_MCP_CREDENTIAL_FILE_ENV]: credentialPath
54513
54896
  };
@@ -54526,7 +54909,11 @@ async function runHold(argv) {
54526
54909
  }),
54527
54910
  clock: systemClock,
54528
54911
  log,
54529
- inputs: { source: access4.source, tmpDir: paths.tmp },
54912
+ inputs: {
54913
+ source: access4.source,
54914
+ tmpDir: paths.tmp,
54915
+ ...commitAttribution === null ? {} : { commitAttribution }
54916
+ },
54530
54917
  machine: {
54531
54918
  env: cliEnvironment,
54532
54919
  stateDir: paths.stateDir,