@alan-ai-hq/agent-manager-linux-arm64 0.1.165 → 0.1.167

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
@@ -20656,6 +20656,16 @@ var init_activity_lease = __esm({
20656
20656
  }
20657
20657
  });
20658
20658
 
20659
+ // ../shared/dist/constants/cloud-repositories.js
20660
+ var MAX_CLOUD_REPOSITORIES, CLOUD_REPOSITORY_LIMIT_MESSAGE;
20661
+ var init_cloud_repositories = __esm({
20662
+ "../shared/dist/constants/cloud-repositories.js"() {
20663
+ "use strict";
20664
+ MAX_CLOUD_REPOSITORIES = 64;
20665
+ CLOUD_REPOSITORY_LIMIT_MESSAGE = `Select at most ${MAX_CLOUD_REPOSITORIES} repositories per cloud session or environment`;
20666
+ }
20667
+ });
20668
+
20659
20669
  // ../shared/dist/runtime-v2/workspace.js
20660
20670
  var UNSAFE_LINE, CONTROL_CHARACTERS, machinePathSchema, gitShaSchema, gitBranchSchema, gitRemoteNameSchema, gitRemoteUrlSchema, statusFingerprintSchema, singleLineSchema, operationIdSchema, repoTargetShape, trustedRepoTargetShape, workspaceStatusRequestSchema, gitStatusRequestSchema, gitCheckpointRequestSchema, gitPushRequestSchema, gitPrepareCheckoutRequestSchema, gitVerifyHeadRequestSchema, workspaceQueryRequestSchema, WORKSPACE_QUERY_METHODS, workspaceQueryMethodSchema, workspaceStatusValueSchema, gitStatusValueSchema, gitCheckpointValueSchema, gitPushValueSchema, gitPrepareCheckoutValueSchema, gitVerifyHeadValueSchema, WORKSPACE_QUERY_ERROR_CODES, workspaceQueryErrorCodeSchema, publishedGitReceiptSchema, workspaceQueryErrorSchema, resultEnvelopeSchema;
20661
20671
  var init_workspace = __esm({
@@ -20856,6 +20866,7 @@ var init_agent_context = __esm({
20856
20866
  "../shared/dist/runtime-v2/agent-context.js"() {
20857
20867
  "use strict";
20858
20868
  init_zod();
20869
+ init_cloud_repositories();
20859
20870
  init_workspace();
20860
20871
  AGENT_CONTEXT_VERSION = 1;
20861
20872
  AGENT_TEAM_INSTRUCTIONS_MAX_CHARS = 2e3;
@@ -20953,7 +20964,7 @@ var init_agent_context = __esm({
20953
20964
  status: external_exports.literal("unresolved"),
20954
20965
  /** A `repo=` value that names no repository in this environment. */
20955
20966
  requested: external_exports.string().min(1).max(200).optional(),
20956
- hints: external_exports.array(agentRepoHintSchema).max(64)
20967
+ hints: external_exports.array(agentRepoHintSchema).max(MAX_CLOUD_REPOSITORIES)
20957
20968
  }),
20958
20969
  external_exports.object({ status: external_exports.literal("none") })
20959
20970
  ]);
@@ -20980,7 +20991,7 @@ var init_agent_context = __esm({
20980
20991
  teamInstructions: external_exports.string().min(1).max(AGENT_TEAM_INSTRUCTIONS_MAX_CHARS).optional(),
20981
20992
  taskWorkingBranch: gitBranchSchema.optional(),
20982
20993
  pullRequest: agentContextPullRequestSchema.optional(),
20983
- repositories: external_exports.array(agentContextRepositorySchema).max(64),
20994
+ repositories: external_exports.array(agentContextRepositorySchema).max(MAX_CLOUD_REPOSITORIES),
20984
20995
  environment: agentContextEnvironmentSchema.optional(),
20985
20996
  surface: agentContextSurfaceSchema.optional()
20986
20997
  });
@@ -21406,7 +21417,8 @@ var init_run_context = __esm({
21406
21417
  content: external_exports.string(),
21407
21418
  turnOrdinal: external_exports.number().int().nullable(),
21408
21419
  createdAt: external_exports.string().min(1),
21409
- clientMessageId: external_exports.string().min(1).optional()
21420
+ clientMessageId: external_exports.string().min(1).optional(),
21421
+ attachmentIds: external_exports.array(external_exports.string().min(1)).optional()
21410
21422
  }));
21411
21423
  canonicalAssistantMessageSchema = wire()(external_exports.object({
21412
21424
  id: external_exports.string().min(1),
@@ -21525,6 +21537,7 @@ var init_desired_state = __esm({
21525
21537
  "../shared/dist/runtime-v2/desired-state.js"() {
21526
21538
  "use strict";
21527
21539
  init_zod();
21540
+ init_cloud_repositories();
21528
21541
  init_contracts();
21529
21542
  init_agent_context();
21530
21543
  init_ids();
@@ -21560,7 +21573,7 @@ var init_desired_state = __esm({
21560
21573
  approvedWorkspacePaths: external_exports.array(external_exports.string().min(1)).optional(),
21561
21574
  repoLocalPaths: external_exports.array(repoLocalPathSchema).optional(),
21562
21575
  /** Applied once, at the conversation's first turn on a cloud sandbox; never moves local work. */
21563
- requestedCheckouts: external_exports.array(requestedCheckoutSchema).max(64).optional(),
21576
+ requestedCheckouts: external_exports.array(requestedCheckoutSchema).max(MAX_CLOUD_REPOSITORIES).optional(),
21564
21577
  agentContext: agentContextSchema.optional(),
21565
21578
  workflowId: external_exports.guid().optional(),
21566
21579
  workflowExecutionId: external_exports.guid().optional(),
@@ -22944,7 +22957,7 @@ You are a product UI designer and frontend interaction specialist. When identify
22944
22957
 
22945
22958
  ## Taste Skill (premium frontends)
22946
22959
 
22947
- For any UI or design work, read and follow the \`uiux\` skill in \`.agents/skills/\` before writing UI. Its internal procedures retain the mandatory design graph, design-system audit, reuse, skeleton-loading, and surface-rework gates; its bundled references cover visual redesigns and premium frontends. Sync bundled upstream material with \`scripts/sync-taste-skills.sh\`.
22960
+ For any UI or design work, read and follow the \`uiux\` skill in \`.agents/skills/\` before writing UI. Its internal procedures retain the mandatory design-system audit, reuse, skeleton-loading, and surface-rework gates; its bundled references cover visual redesigns and premium frontends. Sync bundled upstream material with \`scripts/sync-taste-skills.sh\`.
22948
22961
 
22949
22962
  ## How to approach the work
22950
22963
 
@@ -23739,6 +23752,13 @@ var init_colors = __esm({
23739
23752
  }
23740
23753
  });
23741
23754
 
23755
+ // ../shared/dist/constants/comment-reactions.js
23756
+ var init_comment_reactions = __esm({
23757
+ "../shared/dist/constants/comment-reactions.js"() {
23758
+ "use strict";
23759
+ }
23760
+ });
23761
+
23742
23762
  // ../shared/dist/constants/conversations.js
23743
23763
  var init_conversations = __esm({
23744
23764
  "../shared/dist/constants/conversations.js"() {
@@ -23915,7 +23935,7 @@ var init_models = __esm({
23915
23935
  sortOrder: 140,
23916
23936
  upstreamModelId: "minimax/minimax-m3.1-flash",
23917
23937
  contextWindow: 1048576,
23918
- maxOutputTokens: 8192
23938
+ maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS
23919
23939
  },
23920
23940
  {
23921
23941
  id: "minimax/minimax-m3",
@@ -23926,7 +23946,7 @@ var init_models = __esm({
23926
23946
  sortOrder: 150,
23927
23947
  upstreamModelId: "minimax/minimax-m3",
23928
23948
  contextWindow: 1048576,
23929
- maxOutputTokens: 16384
23949
+ maxOutputTokens: HARNESS_MAX_OUTPUT_TOKENS
23930
23950
  }
23931
23951
  ];
23932
23952
  DEFAULT_HARNESS_MODEL_ID = HARNESS_MODEL_SEEDS.find((model) => model.isDefault)?.id ?? HARNESS_MODEL_SEEDS[0].id;
@@ -24216,7 +24236,9 @@ var init_constants = __esm({
24216
24236
  init_agent();
24217
24237
  init_agent_package();
24218
24238
  init_branding();
24239
+ init_cloud_repositories();
24219
24240
  init_colors();
24241
+ init_comment_reactions();
24220
24242
  init_conversations();
24221
24243
  init_create_and_start();
24222
24244
  init_labels();
@@ -24779,7 +24801,7 @@ var init_chunk_AF3IPGDT = __esm({
24779
24801
  }
24780
24802
  });
24781
24803
 
24782
- // ../agent-core/dist/chunk-ZCTKXKYY.js
24804
+ // ../agent-core/dist/chunk-WYNUYKKN.js
24783
24805
  function readCapReset(text2) {
24784
24806
  const epoch = EPOCH_RESET.exec(text2);
24785
24807
  if (epoch) return { resetsAt: new Date(Number(epoch[1]) * 1e3).toISOString() };
@@ -24820,7 +24842,8 @@ function prefixStatus(text2) {
24820
24842
  return match ? Number(match[1]) : void 0;
24821
24843
  }
24822
24844
  function errorType(outer, inner) {
24823
- const type = asString(inner.type) || asString(outer.type);
24845
+ const flatCode = asString(outer.error);
24846
+ const type = asString(inner.type) || asString(outer.type) || (ERROR_CODE_SHAPE.test(flatCode) ? flatCode : "");
24824
24847
  return type && type !== "error" ? type : void 0;
24825
24848
  }
24826
24849
  function readProviderErrorDetail(text2) {
@@ -24905,7 +24928,8 @@ function statusKind(status) {
24905
24928
  }
24906
24929
  function mapProviderApiError(errorCode, apiStatus) {
24907
24930
  if (apiStatus === 403) return "access_denied";
24908
- if (apiStatus === 402) return "payment_required";
24931
+ if (apiStatus === 402)
24932
+ return GATEWAY_402_KINDS.get(errorCode?.trim().toLowerCase() ?? "") ?? "payment_required";
24909
24933
  if (apiStatus === 401) return "auth_invalid";
24910
24934
  const code = errorCode?.trim().toLowerCase();
24911
24935
  const byCode = code ? CODE_RULES.find((rule) => rule.pattern.test(code))?.kind : void 0;
@@ -24919,8 +24943,8 @@ function classifyProviderApiError(input2) {
24919
24943
  if (fromText && TEXT_REFINES[structured]?.has(fromText.errorKind)) return fromText;
24920
24944
  return specForErrorKind(structured);
24921
24945
  }
24922
- function withPaymentRemedy(classified, message) {
24923
- if (classified.errorKind !== "payment_required") return classified;
24946
+ function withPaymentRemedy(classified, message, status) {
24947
+ if (classified.errorKind !== "payment_required" && status !== 402) return classified;
24924
24948
  const remedy = message.replace(STATUS_LEAD, "").trim();
24925
24949
  return remedy ? { ...classified, message: remedy.slice(0, 300) } : classified;
24926
24950
  }
@@ -24933,7 +24957,7 @@ function classifyProviderError(text2, hints = {}) {
24933
24957
  ...status === void 0 ? {} : { status },
24934
24958
  text: detail.message
24935
24959
  }) ?? classifyProviderTerminalText(text2);
24936
- if (classified) return withPaymentRemedy(classified, detail.message);
24960
+ if (classified) return withPaymentRemedy(classified, detail.message, status);
24937
24961
  const message = detail.message.slice(0, 200);
24938
24962
  return message ? { message, errorKind: "unknown_cli_error", recoveryClass: "unknown" } : specForErrorKind("unknown_cli_error");
24939
24963
  }
@@ -24985,9 +25009,9 @@ function createCliProblem(observed, options) {
24985
25009
  ...classified.resetsAt ? { resetsAt: classified.resetsAt } : {}
24986
25010
  });
24987
25011
  }
24988
- var import_crypto, EPOCH_RESET, WORDED_RESET, CODEX_RESET, ERROR_SPECS, AGENT_ERROR_KINDS, AGENT_SIGN_IN_BY_HARNESS, STATUS_PREFIX, TEXT_RULES, CODEX_TIMEOUT_MESSAGE, CODEX_EXPIRED_MESSAGE, COMMAND_NOT_FOUND, CODE_RULES, TEXT_REFINES, STATUS_LEAD, CLI_PROBLEM_CODE_BY_ERROR_KIND, KEY_REJECTION_KINDS;
24989
- var init_chunk_ZCTKXKYY = __esm({
24990
- "../agent-core/dist/chunk-ZCTKXKYY.js"() {
25012
+ var import_crypto, EPOCH_RESET, WORDED_RESET, CODEX_RESET, ERROR_SPECS, AGENT_ERROR_KINDS, AGENT_SIGN_IN_BY_HARNESS, STATUS_PREFIX, ERROR_CODE_SHAPE, TEXT_RULES, CODEX_TIMEOUT_MESSAGE, CODEX_EXPIRED_MESSAGE, COMMAND_NOT_FOUND, CODE_RULES, GATEWAY_402_KINDS, TEXT_REFINES, STATUS_LEAD, CLI_PROBLEM_CODE_BY_ERROR_KIND, KEY_REJECTION_KINDS;
25013
+ var init_chunk_WYNUYKKN = __esm({
25014
+ "../agent-core/dist/chunk-WYNUYKKN.js"() {
24991
25015
  "use strict";
24992
25016
  init_chunk_YXWJW7I5();
24993
25017
  import_crypto = require("crypto");
@@ -25028,6 +25052,10 @@ var init_chunk_ZCTKXKYY = __esm({
25028
25052
  message: "The account behind this model has no active plan or credits. Ask an admin to check billing, or switch to a model from your own provider, then retry.",
25029
25053
  recoveryClass: "user_fixable"
25030
25054
  },
25055
+ managed_models_paused: {
25056
+ message: "Alan-managed models are paused by Alan. Switch to a model from your own provider to keep working.",
25057
+ recoveryClass: "user_fixable"
25058
+ },
25031
25059
  quota_exceeded: {
25032
25060
  message: "API quota exceeded. Wait for it to reset or check your billing, then retry.",
25033
25061
  recoveryClass: "user_fixable"
@@ -25114,6 +25142,7 @@ var init_chunk_ZCTKXKYY = __esm({
25114
25142
  ["command_code_cli", { name: "Command Code" }]
25115
25143
  ]);
25116
25144
  STATUS_PREFIX = /\b(?:api error|status|http)[:\s]+(\d{3})\b/i;
25145
+ ERROR_CODE_SHAPE = /^[a-z][a-z0-9_]*$/;
25117
25146
  TEXT_RULES = [
25118
25147
  { kind: "auth_expired", pattern: /\bcodex cli connection expired\b|\breconnect openai codex\b/ },
25119
25148
  { kind: "provider_timeout", pattern: /\bcodex connection to openai timed out\b/ },
@@ -25141,6 +25170,7 @@ var init_chunk_ZCTKXKYY = __esm({
25141
25170
  kind: "quota_exceeded",
25142
25171
  pattern: /\bcredit balance is too low\b|\binsufficient_quota\b/
25143
25172
  },
25173
+ { kind: "managed_models_paused", pattern: /\balan-managed models are paused\b/ },
25144
25174
  { kind: "subscription_required", pattern: /creditserror|\bno payment method\b/ },
25145
25175
  { kind: "model_mismatch", pattern: /datapolicyerror|\brequires explicit opt in\b/ },
25146
25176
  // A cancelled turn can leave history the provider refuses on every later request: empty
@@ -25211,11 +25241,16 @@ var init_chunk_ZCTKXKYY = __esm({
25211
25241
  kind: "context_length"
25212
25242
  }
25213
25243
  ];
25244
+ GATEWAY_402_KINDS = /* @__PURE__ */ new Map([
25245
+ ["quota_exceeded", "quota_exceeded"],
25246
+ ["managed_models_paused", "managed_models_paused"]
25247
+ ]);
25214
25248
  TEXT_REFINES = {
25215
25249
  rate_limited: /* @__PURE__ */ new Set(["usage_limit", "quota_exceeded"]),
25250
+ payment_required: /* @__PURE__ */ new Set(["usage_limit", "managed_models_paused"]),
25216
25251
  auth_invalid: /* @__PURE__ */ new Set(["auth_expired", "not_logged_in", "not_authenticated"])
25217
25252
  };
25218
- STATUS_LEAD = /^(?:api error|status|http)[:\s]+\d{3}\b[:\s]*/i;
25253
+ STATUS_LEAD = /^(?:(?:api error|status|http)[:\s]+\d{3}\b|payment required:)[:\s]*/i;
25219
25254
  CLI_PROBLEM_CODE_BY_ERROR_KIND = {
25220
25255
  model_mismatch: "cli.model.unavailable",
25221
25256
  auth_invalid: "cli.auth.invalid",
@@ -25225,6 +25260,7 @@ var init_chunk_ZCTKXKYY = __esm({
25225
25260
  auth_expired: "cli.auth.expired",
25226
25261
  subscription_required: "cli.entitlement.required",
25227
25262
  payment_required: "cli.entitlement.required",
25263
+ managed_models_paused: "cli.model.unavailable",
25228
25264
  quota_exceeded: "cli.quota_exceeded",
25229
25265
  usage_limit: "cli.quota_exceeded",
25230
25266
  context_length: "cli.context_exhausted",
@@ -26074,7 +26110,7 @@ var init_chunk_KVTSAS2T = __esm({
26074
26110
  }
26075
26111
  });
26076
26112
 
26077
- // ../agent-core/dist/chunk-4LDW3FJB.js
26113
+ // ../agent-core/dist/chunk-U4RQE7JS.js
26078
26114
  function detectImageMimeType(buffer) {
26079
26115
  if (buffer.length >= 8 && buffer.subarray(0, 8).equals(PNG_SIGNATURE)) return "image/png";
26080
26116
  if (buffer.length >= 3 && buffer[0] === 255 && buffer[1] === 216 && buffer[2] === 255) {
@@ -26515,11 +26551,11 @@ function silentStartError(name, timeoutMs) {
26515
26551
  };
26516
26552
  }
26517
26553
  var import_crypto4, import_fs5, import_path4, PNG_SIGNATURE, IMAGE_MIME_BY_EXT, VIDEO_MIME_BY_EXT, IMAGE_EXTENSIONS, VIDEO_EXTENSIONS, MAX_IMAGE_BYTES, MAX_VIDEO_BYTES, MAX_TURN_MEDIA_DATA_CHARS, MTIME_SLACK_MS, AGENT_BROWSER_MENTION, AGENT_BROWSER_CAPTURE_COMMAND, LocalMediaReader, SessionOpenRefusal, JsonRpcError, ACP_PROTOCOL_VERSION, ACP_ERROR, STDERR_TAIL_LINES, RESULT_EXIT_GRACE_MS, PerTurnSession;
26518
- var init_chunk_4LDW3FJB = __esm({
26519
- "../agent-core/dist/chunk-4LDW3FJB.js"() {
26554
+ var init_chunk_U4RQE7JS = __esm({
26555
+ "../agent-core/dist/chunk-U4RQE7JS.js"() {
26520
26556
  "use strict";
26521
26557
  init_chunk_AF3IPGDT();
26522
- init_chunk_ZCTKXKYY();
26558
+ init_chunk_WYNUYKKN();
26523
26559
  init_chunk_KVTSAS2T();
26524
26560
  init_chunk_YXWJW7I5();
26525
26561
  import_crypto4 = require("crypto");
@@ -26901,15 +26937,15 @@ var init_chunk_4LDW3FJB = __esm({
26901
26937
  var init_dist = __esm({
26902
26938
  "../agent-core/dist/index.js"() {
26903
26939
  "use strict";
26904
- init_chunk_4LDW3FJB();
26940
+ init_chunk_U4RQE7JS();
26905
26941
  init_chunk_AF3IPGDT();
26906
- init_chunk_ZCTKXKYY();
26942
+ init_chunk_WYNUYKKN();
26907
26943
  init_chunk_KVTSAS2T();
26908
26944
  init_chunk_YXWJW7I5();
26909
26945
  }
26910
26946
  });
26911
26947
 
26912
- // ../agent-core/dist/chunk-DLVRNIY5.js
26948
+ // ../agent-core/dist/chunk-7FJ7QKFN.js
26913
26949
  function repositories(input2, context) {
26914
26950
  const problems = new Map(input2.problems.map((problem) => [problem.path, problem]));
26915
26951
  const listed = context?.repositories ?? [];
@@ -27516,24 +27552,51 @@ function cloudExecutionSection(spec) {
27516
27552
  "If a required delivery step is blocked, complete remaining independent work and report the precise blocker and what remains unfinished. Never describe local-only work as fully delivered."
27517
27553
  );
27518
27554
  }
27519
- const skills = spec.promptContext?.availableSkills ?? [];
27520
27555
  lines.push(
27521
27556
  "## Installed skills",
27522
27557
  "Use a matching installed skill when it helps the request. Read its SKILL.md before acting; the index is discovery metadata, not instructions. Follow repository instructions and project skills within the cloud workflow boundaries above."
27523
27558
  );
27524
- if (skills.length === 0) {
27559
+ const skills = spec.promptContext?.availableSkills;
27560
+ if (skills === void 0) {
27561
+ lines.push(
27562
+ "No installed skill inventory was supplied. Inspect the provider's skill index; do not assume a named package is installed."
27563
+ );
27564
+ } else if (skills.length === 0) {
27525
27565
  lines.push(
27526
- skills.length === 0 && spec.promptContext?.availableSkills !== void 0 ? "No verified installed packages were found. Do not assume a named skill is available." : "No installed skill inventory was supplied. Inspect the provider's skill index; do not assume a named package is installed."
27566
+ "No other installed skills were found. Do not assume a named skill is available unless your skill index lists it."
27527
27567
  );
27528
27568
  } else {
27529
- for (const skill of skills) {
27530
- lines.push(
27531
- `- ${JSON.stringify(skill.name)}: ${JSON.stringify(skill.description)} \u2014 ${JSON.stringify(`${skill.packageDirectory}/SKILL.md`)}`
27532
- );
27533
- }
27569
+ lines.push(...installedSkillLines(skills));
27534
27570
  }
27535
27571
  return lines.join("\n");
27536
27572
  }
27573
+ function truncate2(text2, max) {
27574
+ return text2.length > max ? `${text2.slice(0, max - 1)}\u2026` : text2;
27575
+ }
27576
+ function byListingPriority(left, right) {
27577
+ const platform = Number(right.name.startsWith("alan-")) - Number(left.name.startsWith("alan-"));
27578
+ return platform !== 0 ? platform : left.name.localeCompare(right.name);
27579
+ }
27580
+ function overflowLine(omitted) {
27581
+ const folders = [...new Set(omitted.map((skill) => (0, import_path5.dirname)(skill.packageDirectory)))].sort();
27582
+ return `${omitted.length} more installed skills are not listed. Each is a folder holding a SKILL.md under ${folders.map((folder) => JSON.stringify(folder)).join(" or ")}; look there before assuming a named skill is unavailable.`;
27583
+ }
27584
+ function installedSkillLines(skills) {
27585
+ const ordered = [...skills].sort(byListingPriority);
27586
+ const lines = [];
27587
+ let used = 0;
27588
+ for (const [index, skill] of ordered.entries()) {
27589
+ const description = truncate2(skill.description, INSTALLED_SKILL_DESCRIPTION_MAX_CHARS);
27590
+ const line = `- ${JSON.stringify(skill.name)}: ${JSON.stringify(description)} \u2014 ${JSON.stringify(`${skill.packageDirectory}/SKILL.md`)}`;
27591
+ if (used + line.length + 1 > INSTALLED_SKILLS_MAX_CHARS) {
27592
+ lines.push(overflowLine(ordered.slice(index)));
27593
+ break;
27594
+ }
27595
+ lines.push(line);
27596
+ used += line.length + 1;
27597
+ }
27598
+ return lines;
27599
+ }
27537
27600
  function promptParts(input2) {
27538
27601
  const { spec } = input2;
27539
27602
  const overlay = teamOverlay(spec);
@@ -27611,12 +27674,13 @@ function buildTurnText(input2) {
27611
27674
  ${body}` : body;
27612
27675
  return spec.mode === "plan" ? planModePrefix(prefixed) : prefixed;
27613
27676
  }
27614
- var startCommandStateSchema, repositorySnapshotSchema, environmentSnapshotSchema, agentContextSnapshotSchema, BRANCH_REASONS, SLACK_SURFACE_INSTRUCTIONS, PLAIN_SCALAR, COMMAND_PREVIEW_CHARS, MAX_PARSED_ATTACHMENTS, MAX_PARSED_ATTACHMENT_CHARS, MAX_METADATA_CHARS, UNAVAILABLE, READ_ONLY_MODES, AGENT_MODES;
27615
- var init_chunk_DLVRNIY5 = __esm({
27616
- "../agent-core/dist/chunk-DLVRNIY5.js"() {
27677
+ var import_path5, startCommandStateSchema, repositorySnapshotSchema, environmentSnapshotSchema, agentContextSnapshotSchema, BRANCH_REASONS, SLACK_SURFACE_INSTRUCTIONS, PLAIN_SCALAR, COMMAND_PREVIEW_CHARS, MAX_PARSED_ATTACHMENTS, MAX_PARSED_ATTACHMENT_CHARS, MAX_METADATA_CHARS, UNAVAILABLE, READ_ONLY_MODES, AGENT_MODES, INSTALLED_SKILLS_MAX_CHARS, INSTALLED_SKILL_DESCRIPTION_MAX_CHARS;
27678
+ var init_chunk_7FJ7QKFN = __esm({
27679
+ "../agent-core/dist/chunk-7FJ7QKFN.js"() {
27617
27680
  "use strict";
27618
27681
  init_runtime_v2();
27619
27682
  init_zod();
27683
+ import_path5 = require("path");
27620
27684
  init_agent2();
27621
27685
  startCommandStateSchema = external_exports.discriminatedUnion("state", [
27622
27686
  external_exports.object({ state: external_exports.literal("not_configured") }),
@@ -27716,6 +27780,8 @@ var init_chunk_DLVRNIY5 = __esm({
27716
27780
  "ask",
27717
27781
  "review"
27718
27782
  ]);
27783
+ INSTALLED_SKILLS_MAX_CHARS = 8e3;
27784
+ INSTALLED_SKILL_DESCRIPTION_MAX_CHARS = 200;
27719
27785
  }
27720
27786
  });
27721
27787
 
@@ -27809,8 +27875,8 @@ function canonicalizeManagedMcpToolName(toolName) {
27809
27875
  return flattened ? `mcp__${MANAGED_MCP_SERVER_NAME}__${flattened[1]}` : toolName;
27810
27876
  }
27811
27877
  async function writeSecretFile(name, contents) {
27812
- const dir = await (0, import_promises13.mkdtemp)((0, import_path5.join)((0, import_os2.tmpdir)(), "alan-mcp-"));
27813
- const path = (0, import_path5.join)(dir, name);
27878
+ const dir = await (0, import_promises13.mkdtemp)((0, import_path6.join)((0, import_os2.tmpdir)(), "alan-mcp-"));
27879
+ const path = (0, import_path6.join)(dir, name);
27814
27880
  const remove = async () => {
27815
27881
  await (0, import_promises13.rm)(dir, { recursive: true, force: true });
27816
27882
  };
@@ -27822,7 +27888,7 @@ async function writeSecretFile(name, contents) {
27822
27888
  }
27823
27889
  return { path, remove, [Symbol.asyncDispose]: remove };
27824
27890
  }
27825
- var import_crypto5, import_crypto6, import_promises13, import_os2, import_path5, OPENCODE_CODE_MODE_ENV, OPENCODE_CODE_MODE_TOOL, CODE_MODE_CALLS_META, MANAGED_MCP_SERVER_NAME, RUN_SCOPED_SERVER, NAMESPACED_RUN_TOOL, FLATTENED_RUN_TOOL;
27891
+ var import_crypto5, import_crypto6, import_promises13, import_os2, import_path6, OPENCODE_CODE_MODE_ENV, OPENCODE_CODE_MODE_TOOL, CODE_MODE_CALLS_META, MANAGED_MCP_SERVER_NAME, RUN_SCOPED_SERVER, NAMESPACED_RUN_TOOL, FLATTENED_RUN_TOOL;
27826
27892
  var init_chunk_OSECDZA5 = __esm({
27827
27893
  "../agent-core/dist/chunk-OSECDZA5.js"() {
27828
27894
  "use strict";
@@ -27833,7 +27899,7 @@ var init_chunk_OSECDZA5 = __esm({
27833
27899
  init_runtime_v2();
27834
27900
  import_promises13 = require("fs/promises");
27835
27901
  import_os2 = require("os");
27836
- import_path5 = require("path");
27902
+ import_path6 = require("path");
27837
27903
  OPENCODE_CODE_MODE_ENV = "OPENCODE_EXPERIMENTAL_CODE_MODE";
27838
27904
  OPENCODE_CODE_MODE_TOOL = "execute";
27839
27905
  CODE_MODE_CALLS_META = "alanToolCalls";
@@ -28079,16 +28145,16 @@ function classifyAcpError(error62) {
28079
28145
  return classifyAcpText(acpErrorText(error62));
28080
28146
  }
28081
28147
  function within(root, path) {
28082
- const rel = (0, import_path6.relative)(root, path);
28083
- return rel === "" || !rel.startsWith(`..${import_path6.sep}`) && rel !== ".." && !(0, import_path6.isAbsolute)(rel);
28148
+ const rel = (0, import_path7.relative)(root, path);
28149
+ return rel === "" || !rel.startsWith(`..${import_path7.sep}`) && rel !== ".." && !(0, import_path7.isAbsolute)(rel);
28084
28150
  }
28085
28151
  async function resolveReal(path) {
28086
28152
  try {
28087
28153
  return await (0, import_promises14.realpath)(path);
28088
28154
  } catch {
28089
- const parent = (0, import_path6.dirname)(path);
28155
+ const parent = (0, import_path7.dirname)(path);
28090
28156
  if (parent === path) return path;
28091
- return (0, import_path6.join)(await resolveReal(parent), (0, import_path6.basename)(path));
28157
+ return (0, import_path7.join)(await resolveReal(parent), (0, import_path7.basename)(path));
28092
28158
  }
28093
28159
  }
28094
28160
  function sliceLines(text2, params) {
@@ -28103,7 +28169,7 @@ function createWorkspaceFs(roots, writable) {
28103
28169
  const realRoots = Promise.all(roots.map((root) => resolveReal(root)));
28104
28170
  const confined = async (params) => {
28105
28171
  const path = asString(params.path);
28106
- if (!(0, import_path6.isAbsolute)(path)) throw new FsDenied(`fs path must be absolute: ${path || "(empty)"}`);
28172
+ if (!(0, import_path7.isAbsolute)(path)) throw new FsDenied(`fs path must be absolute: ${path || "(empty)"}`);
28107
28173
  const real = await resolveReal(path);
28108
28174
  if (!(await realRoots).some((root) => within(root, real))) {
28109
28175
  throw new FsDenied(`${path} is outside the session's workspace`);
@@ -28732,19 +28798,19 @@ async function acpTurnInput(run, context) {
28732
28798
  ...encoded.length ? { images: encoded, imagePaths: images.map((image) => image.path) } : {}
28733
28799
  };
28734
28800
  }
28735
- var import_promises14, import_path6, import_crypto7, import_promises15, CURSOR_ASK_QUESTION, copilotAcpProfile, cursorAcpProfile, MODEL_REJECTED, MAX_READ_BYTES, FsDenied, ENV_REFERENCE, AcpBackgroundTasks, CURSOR_CREATE_PLAN, STATUSES, READ_KINDS, ALLOW_KINDS, REJECT_KINDS, CANCELLED_PERMISSION, STOP_REASONS, CHUNKS, ECHOES, AcpTurn, STDERR_TAIL_LINES2, MAX_BETWEEN_UPDATES, AcpSession, DEFAULTS, CLIENT_INFO, TASK_BACKGROUNDED, TASK_COMPLETED, SESSION_NOTIFICATION, KILLED_STATUSES, SUCCESS_STATUSES, SUBAGENT_ID, grokTaskDialect, grokAcpProfile, kimiAcpProfile, ACP_PROFILES, ACP_MODES;
28801
+ var import_promises14, import_path7, import_crypto7, import_promises15, CURSOR_ASK_QUESTION, copilotAcpProfile, cursorAcpProfile, MODEL_REJECTED, MAX_READ_BYTES, FsDenied, ENV_REFERENCE, AcpBackgroundTasks, CURSOR_CREATE_PLAN, STATUSES, READ_KINDS, ALLOW_KINDS, REJECT_KINDS, CANCELLED_PERMISSION, STOP_REASONS, CHUNKS, ECHOES, AcpTurn, STDERR_TAIL_LINES2, MAX_BETWEEN_UPDATES, AcpSession, DEFAULTS, CLIENT_INFO, TASK_BACKGROUNDED, TASK_COMPLETED, SESSION_NOTIFICATION, KILLED_STATUSES, SUCCESS_STATUSES, SUBAGENT_ID, grokTaskDialect, grokAcpProfile, kimiAcpProfile, ACP_PROFILES, ACP_MODES;
28736
28802
  var init_acp2 = __esm({
28737
28803
  "../agent-core/dist/providers/acp.js"() {
28738
28804
  "use strict";
28739
- init_chunk_4LDW3FJB();
28805
+ init_chunk_U4RQE7JS();
28740
28806
  init_chunk_AF3IPGDT();
28741
- init_chunk_ZCTKXKYY();
28807
+ init_chunk_WYNUYKKN();
28742
28808
  init_chunk_KVTSAS2T();
28743
- init_chunk_DLVRNIY5();
28809
+ init_chunk_7FJ7QKFN();
28744
28810
  init_chunk_OSECDZA5();
28745
28811
  init_chunk_YXWJW7I5();
28746
28812
  import_promises14 = require("fs/promises");
28747
- import_path6 = require("path");
28813
+ import_path7 = require("path");
28748
28814
  init_effort();
28749
28815
  init_acp();
28750
28816
  import_crypto7 = require("crypto");
@@ -29615,7 +29681,7 @@ var init_acp3 = __esm({
29615
29681
  var init_classify = __esm({
29616
29682
  "../agent-core/dist/classify.js"() {
29617
29683
  "use strict";
29618
- init_chunk_ZCTKXKYY();
29684
+ init_chunk_WYNUYKKN();
29619
29685
  init_chunk_YXWJW7I5();
29620
29686
  }
29621
29687
  });
@@ -30330,7 +30396,7 @@ function alanCodeEngineBinary(platform) {
30330
30396
  return platform === "win32" ? "opencode.exe" : "opencode";
30331
30397
  }
30332
30398
  function packagedAlanCodeEnginePath(bundle, platform) {
30333
- return (0, import_path7.join)((0, import_path7.dirname)(bundle), "..", "engine", alanCodeEngineBinary(platform));
30399
+ return (0, import_path8.join)((0, import_path8.dirname)(bundle), "..", "engine", alanCodeEngineBinary(platform));
30334
30400
  }
30335
30401
  function isRunnableFile(path, platform) {
30336
30402
  try {
@@ -30532,13 +30598,13 @@ export const AlanEnginePlugin = async () => ({
30532
30598
  `;
30533
30599
  }
30534
30600
  function alanCodeEngineRoot(home) {
30535
- return (0, import_path8.join)(home, ".alan", "alan-code", "engine");
30601
+ return (0, import_path9.join)(home, ".alan", "alan-code", "engine");
30536
30602
  }
30537
30603
  function alanCodeEngineDirectories(root) {
30538
30604
  return {
30539
- XDG_DATA_HOME: (0, import_path8.join)(root, "share"),
30540
- XDG_STATE_HOME: (0, import_path8.join)(root, "state"),
30541
- XDG_CACHE_HOME: (0, import_path8.join)(root, "cache")
30605
+ XDG_DATA_HOME: (0, import_path9.join)(root, "share"),
30606
+ XDG_STATE_HOME: (0, import_path9.join)(root, "state"),
30607
+ XDG_CACHE_HOME: (0, import_path9.join)(root, "cache")
30542
30608
  };
30543
30609
  }
30544
30610
  function bearerToken(authorization) {
@@ -30554,8 +30620,8 @@ function alanCodeEngineEnv(input2) {
30554
30620
  };
30555
30621
  }
30556
30622
  function openCodeGlobalConfigDirectory(env, home) {
30557
- const configHome = env.XDG_CONFIG_HOME?.trim() || (0, import_path8.join)(home, ".config");
30558
- return (0, import_path8.join)(configHome, "opencode");
30623
+ const configHome = env.XDG_CONFIG_HOME?.trim() || (0, import_path9.join)(home, ".config");
30624
+ return (0, import_path9.join)(configHome, "opencode");
30559
30625
  }
30560
30626
  function stripJsonc(text2) {
30561
30627
  let out = "";
@@ -30614,7 +30680,7 @@ function parseJsonc(text2) {
30614
30680
  async function inheritedMcpServerNames(configDirectory) {
30615
30681
  const names = /* @__PURE__ */ new Set();
30616
30682
  for (const file2 of ["config.json", "opencode.json", "opencode.jsonc"]) {
30617
- const text2 = await (0, import_promises16.readFile)((0, import_path8.join)(configDirectory, file2), "utf8").catch(() => null);
30683
+ const text2 = await (0, import_promises16.readFile)((0, import_path9.join)(configDirectory, file2), "utf8").catch(() => null);
30618
30684
  if (text2 === null) continue;
30619
30685
  const parsed = parseJsonc(text2);
30620
30686
  const mcp = parsed !== null && typeof parsed === "object" ? parsed.mcp : void 0;
@@ -30626,7 +30692,7 @@ async function inheritedMcpServerNames(configDirectory) {
30626
30692
  }
30627
30693
  async function writePlugin(directory, apiOrigin) {
30628
30694
  const origin = (0, import_crypto8.createHash)("sha256").update(apiOrigin).digest("hex").slice(0, 12);
30629
- const target = (0, import_path8.join)(directory, `engine-plugin-v${ALAN_CODE_ENGINE_PLUGIN_VERSION}-${origin}.mjs`);
30695
+ const target = (0, import_path9.join)(directory, `engine-plugin-v${ALAN_CODE_ENGINE_PLUGIN_VERSION}-${origin}.mjs`);
30630
30696
  const temporary = `${target}.${(0, import_crypto8.randomUUID)()}.tmp`;
30631
30697
  await (0, import_promises16.mkdir)(directory, { recursive: true, mode: 448 });
30632
30698
  await (0, import_promises16.writeFile)(temporary, alanCodeEnginePluginSource(apiOrigin), { mode: 384 });
@@ -30639,7 +30705,7 @@ async function prepareAlanCodeProfile(input2) {
30639
30705
  directories.map((directory) => (0, import_promises16.mkdir)(directory, { recursive: true, mode: 448 }))
30640
30706
  );
30641
30707
  const [pluginUrl, models, inheritedMcpServers] = await Promise.all([
30642
- writePlugin((0, import_path8.join)(input2.engineRoot, "plugin"), input2.access.apiOrigin),
30708
+ writePlugin((0, import_path9.join)(input2.engineRoot, "plugin"), input2.access.apiOrigin),
30643
30709
  (input2.loadModels ?? fetchAlanCodeModels)(input2.access),
30644
30710
  input2.globalConfigDirectory === void 0 ? Promise.resolve([]) : inheritedMcpServerNames(input2.globalConfigDirectory)
30645
30711
  ]);
@@ -30661,7 +30727,7 @@ function alanCodeSystemPrompt(alanSystemPrompt) {
30661
30727
 
30662
30728
  ${instructions}` : ALAN_CODE_TOOL_NAMING_PROMPT;
30663
30729
  }
30664
- var import_http3, import_https, import_fs6, import_path7, import_crypto8, import_promises16, import_path8, import_url, ALAN_CODE_BASELINE_PROMPT, ALAN_CODE_ENGINE_PROVIDER_ID, DEFAULT_CONTEXT_WINDOW, DEFAULT_MAX_OUTPUT_TOKENS, ALAN_CODE_API_KEY_ENV, ALAN_CODE_CONVERSATION_ID_ENV, ALAN_CODE_PROXY_PATH, ALAN_CODE_WEBSEARCH_PATH, ALAN_CODE_CATALOG_PATH, ALAN_CODE_CHUNK_TIMEOUT_MS, CATALOG_TIMEOUT_MS, MAX_CATALOG_BYTES, ACTIVATION_WAIT_MS, ACTIVATION_POLL_MS, CatalogResponseError, ALAN_CODE_ENGINE_PATH_ENV, ALAN_CODE_ENGINE_COMMAND, ALAN_CODE_ENGINE_NAME, WINDOWS_RUNNABLE_EXTENSION, ALAN_CODE_ENGINE_PLUGIN_VERSION, ALAN_CODE_TOOL_NAMING_PROMPT;
30730
+ var import_http3, import_https, import_fs6, import_path8, import_crypto8, import_promises16, import_path9, import_url, ALAN_CODE_BASELINE_PROMPT, ALAN_CODE_ENGINE_PROVIDER_ID, DEFAULT_CONTEXT_WINDOW, DEFAULT_MAX_OUTPUT_TOKENS, ALAN_CODE_API_KEY_ENV, ALAN_CODE_CONVERSATION_ID_ENV, ALAN_CODE_PROXY_PATH, ALAN_CODE_WEBSEARCH_PATH, ALAN_CODE_CATALOG_PATH, ALAN_CODE_CHUNK_TIMEOUT_MS, CATALOG_TIMEOUT_MS, MAX_CATALOG_BYTES, ACTIVATION_WAIT_MS, ACTIVATION_POLL_MS, CatalogResponseError, ALAN_CODE_ENGINE_PATH_ENV, ALAN_CODE_ENGINE_COMMAND, ALAN_CODE_ENGINE_NAME, WINDOWS_RUNNABLE_EXTENSION, ALAN_CODE_ENGINE_PLUGIN_VERSION, ALAN_CODE_TOOL_NAMING_PROMPT;
30665
30731
  var init_alan_code = __esm({
30666
30732
  "../agent-core/dist/providers/alan-code.js"() {
30667
30733
  "use strict";
@@ -30673,11 +30739,11 @@ var init_alan_code = __esm({
30673
30739
  init_runtime_v2();
30674
30740
  init_models();
30675
30741
  import_fs6 = require("fs");
30676
- import_path7 = require("path");
30742
+ import_path8 = require("path");
30677
30743
  init_runtime_v2();
30678
30744
  import_crypto8 = require("crypto");
30679
30745
  import_promises16 = require("fs/promises");
30680
- import_path8 = require("path");
30746
+ import_path9 = require("path");
30681
30747
  import_url = require("url");
30682
30748
  ALAN_CODE_BASELINE_PROMPT = "You are alan-code, an interactive CLI coding agent that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.\n\nDo not invent URLs. Use verified URLs or ones supplied by the user or project.\n\nIf the user asks for help or wants to give feedback, inform them of the following:\n- `--harness-help` / harness help: learn how to run alan-code\n- For product feedback or bugs, report through the Alan / Supatest issue channels used by this repository\n\nWhen the user directly asks about alan-code capabilities (for example \"can alan-code\u2026\", \"does the harness have\u2026\") or asks in second person about your abilities, answer from the tools and instructions available in this session. If a docs/fetch tool is available and project docs URLs are known, use them; otherwise inspect local README / AGENTS.md rather than inventing product claims.\n\n# Personality\n\nYour default personality and tone is concise, direct, and friendly. You communicate efficiently, always keeping the user clearly informed about ongoing actions without unnecessary detail. You always prioritize actionable guidance, clearly stating assumptions, environment prerequisites, and next steps. Unless explicitly asked, you avoid excessively verbose explanations about your work.\n\n# Tone and style\n\nYou should be concise, direct, and to the point. When you run a non-trivial bash command, you should explain what the command does and why you are running it, so the user understands what you are doing (especially important for commands that change their system).\nRemember that your output will be displayed on a command line interface. Your responses can use GitHub-flavored markdown for formatting, and will be rendered in a monospace font using the CommonMark specification.\nOutput text to communicate with the user; all text you output outside of tool use is displayed to the user. Only use tools to complete tasks. Never use tools like Bash or code comments as means to communicate with the user during the session.\nIf you cannot or will not help the user with something, do not lecture about why. Offer helpful alternatives if possible; otherwise keep the response to 1-2 sentences.\nOnly use emojis if the user explicitly requests it. Avoid emojis in all communication unless asked.\nIMPORTANT: Minimize output tokens while staying helpful, correct, and accurate. Only address the specific query or task. Avoid tangential information unless it is critical to completing the request. If you can answer in 1-3 sentences or a short paragraph, do that.\nAnswer the user's question directly. One-word answers are best when they suffice. Avoid text before/after your response such as \"The answer is <answer>.\", \"Here is the content of the file\u2026\", \"Based on the information provided\u2026\", or \"Here is what I will do next\u2026\". Examples of appropriate verbosity:\n<example>\nuser: what is 2+2?\nassistant: 4\n</example>\n\n<example>\nuser: is 11 a prime number?\nassistant: Yes\n</example>\n\n<example>\nuser: what command should I run to list files in the current directory?\nassistant: ls\n</example>\n\n<example>\nuser: what command should I run to watch files in the current directory?\nassistant: [use tools to inspect the project, then answer]\nnpm run dev\n</example>\n\n<example>\nuser: what files are in the directory src/?\nassistant: [lists files and sees foo.c, bar.c, baz.c]\nuser: which file contains the implementation of foo?\nassistant: src/foo.c\n</example>\n\n<example>\nuser: write tests for new feature\nassistant: [searches for similar tests, reads relevant files concurrently, edits/writes tests]\n</example>\n\n# Responsiveness\n\n## Preamble messages\n\nBefore making tool calls, send a brief preamble to the user explaining what you're about to do. When sending preamble messages, follow these principles and examples:\n\n- **Logically group related actions**: if you're about to run several related commands, describe them together in one preamble rather than sending a separate note for each.\n- **Keep it concise**: be no more than 1-2 sentences, focused on immediate, tangible next steps. (8\u201312 words for quick updates).\n- **Build on prior context**: if this is not your first tool call, use the preamble message to connect the dots with what's been done so far and create a sense of momentum and clarity for the user to understand your next actions.\n- **Keep your tone light, friendly and curious**: add small touches of personality in preambles feel collaborative and engaging.\n- **Exception**: Avoid adding a preamble for every trivial read (e.g., `cat` a single file) unless it's part of a larger grouped action.\n\nExamples:\n\n- \"I've explored the repo; now checking the API route definitions.\"\n- \"Next, I'll patch the config and update the related tests.\"\n- \"I'm about to scaffold the CLI commands and helper functions.\"\n- \"Ok cool, so I've wrapped my head around the repo. Now digging into the API routes.\"\n- \"Config's looking tidy. Next up is patching helpers to keep things in sync.\"\n- \"Finished poking at the DB gateway. I will now chase down error handling.\"\n- \"Alright, build pipeline order is interesting. Checking how it reports failures.\"\n- \"Spotted a clever caching util; now hunting where it gets used.\"\n\n# Planning\n\nIf a planning tool is available, use it when it helps track complex work. Keep the plan brief and update it as work progresses.\n\nNote that plans are not for padding out simple work with filler steps or stating the obvious. The content of your plan should not involve doing anything that you aren't capable of doing (i.e. don't try to test things that you can't test). Do not use plans for simple or single-step queries that you can just do or answer immediately.\n\nWhen a planning tool displays the plan, summarize only what changed or what comes next.\n\nKeep any active plan aligned with the work completed and remaining.\n\nUse a plan when:\n\n- The task is non-trivial and will require multiple actions over a long time horizon.\n- There are logical phases or dependencies where sequencing matters.\n- The work has ambiguity that benefits from outlining high-level goals.\n- You want intermediate checkpoints for feedback and validation.\n- When the user asked you to do more than one thing in a single prompt\n- The user has asked you to use the plan tool (aka \"TODOs\")\n- You generate additional steps while working, and plan to do them before yielding to the user\n\n## Examples\n\n**High-quality plans**\n\nExample 1:\n\n1. Add CLI entry with file args\n2. Parse Markdown via CommonMark library\n3. Apply semantic HTML template\n4. Handle code blocks, images, links\n5. Add error handling for invalid files\n\nExample 2:\n\n1. Define CSS variables for colors\n2. Add toggle with localStorage state\n3. Refactor components to use variables\n4. Verify all views for readability\n5. Add smooth theme-change transition\n\nExample 3:\n\n1. Set up Node.js + WebSocket server\n2. Add join/leave broadcast events\n3. Implement messaging with timestamps\n4. Add usernames + mention highlighting\n5. Persist messages in lightweight DB\n6. Add typing indicators + unread count\n\n**Low-quality plans**\n\nExample 1:\n\n1. Create CLI tool\n2. Add Markdown parser\n3. Convert to HTML\n\nExample 2:\n\n1. Add dark mode toggle\n2. Save preference\n3. Make styles look good\n\nExample 3:\n\n1. Create single-file HTML game\n2. Run quick sanity check\n3. Summarize usage instructions\n\nIf you need to write a plan, only write high quality plans, not low quality ones.\n\n## Plan mode and clarification (harness specifics)\n\n- When the session is in plan mode, inspect without making changes and produce a concrete plan. Outside plan mode, proceed with authorized work and ask for approval only when the action requires it.\n- Prefer the durable plan file path over relying on chat memory after compaction.\n- When requirements are ambiguous, ask a targeted question using an available user-input tool instead of guessing.\n- An execution checklist is not a substitute for a durable plan when the task requires one.\n\n# Task execution\n\nYou are a coding agent. Please keep going until the query is completely resolved, before ending your turn and yielding back to the user. Only terminate your turn when you are sure that the problem is solved. Autonomously resolve the query to the best of your ability, using the tools available to you, before coming back to the user. Do NOT guess or make up an answer.\n\nYou MUST adhere to the following criteria when solving queries:\n\n- Working on the repo(s) in the current environment is allowed, even if they are proprietary.\n- Analyzing code for vulnerabilities is allowed.\n- Showing user code and tool call details is allowed.\n- Use the editing tools available in the current host to modify files. Do not assume a particular tool name.\n\nIf completing the user's task requires writing or modifying files, your code and final answer should follow these coding guidelines, though user instructions (i.e. AGENTS.md) may override these guidelines:\n\n- Fix the problem at the root cause rather than applying surface-level patches, when possible.\n- Avoid unneeded complexity in your solution.\n- Do not attempt to fix unrelated bugs or broken tests. It is not your responsibility to fix them. (You may mention them to the user in your final message though.)\n- Update documentation as necessary.\n- Keep changes consistent with the style of the existing codebase. Changes should be minimal and focused on the task.\n- Use `git log` and `git blame` to search the history of the codebase if additional context is required.\n- NEVER add copyright or license headers unless specifically requested.\n- Do not waste tokens by re-reading files after editing them. The tool call will fail if it didn't work. The same goes for making folders, deleting folders, etc.\n- Do not `git commit` your changes or create new git branches unless explicitly requested.\n- Add comments when they explain a non-obvious invariant or reason for a decision.\n- Do not use one-letter variable names unless explicitly requested.\n- NEVER output inline citations like \"\u3010F:README.md\u2020L5-L14\u3011\" in your outputs. The CLI is not able to render these so they will just be broken in the UI. Instead, if you output valid filepaths, users will be able to click on them to open the files in their editor.\n\n# Validating your work\n\nIf the codebase has tests or the ability to build or run, consider using them to verify that your work is complete.\n\nWhen testing, your philosophy should be to start as specific as possible to the code you changed so that you can catch issues efficiently, then make your way to broader tests as you build confidence. If there's no test for the code you changed, and if the adjacent patterns in the codebases show that there's a logical place for you to add a test, you may do so. However, do not add tests to codebases with no tests.\n\nSimilarly, once you're confident in correctness, you can suggest or use formatting commands to ensure that your code is well formatted. If there are issues you can iterate up to 3 times to get formatting right, but if you still can't manage it's better to save the user time and present them a correct solution where you call out the formatting in your final message. If the codebase does not have a formatter configured, do not add one.\n\nFor all of testing, running, building, and formatting, do not attempt to fix unrelated bugs. It is not your responsibility to fix them. (You may mention them to the user in your final message though.)\n\nBe mindful of whether to run validation commands proactively. In the absence of behavioral guidance:\n\n- When running in a non-interactive mode where edits are auto-approved (print/headless, or the `allow edits` permission mode), proactively run tests, lint and do whatever you need to ensure you've completed the task.\n- In plan mode, stay read-only. Otherwise, run focused checks after changes when the host permits them.\n- When working on test-related tasks, such as adding tests, fixing tests, or reproducing a bug to verify behavior, you may proactively run tests regardless of permission mode. Use your judgement to decide whether this is a test-related task.\n\n# Ambition vs. precision\n\nFor tasks that have no prior context (i.e. the user is starting something brand new), you should feel free to be ambitious and demonstrate creativity with your implementation.\n\nIf you're operating in an existing codebase, you should make sure you do exactly what the user asks with surgical precision. Treat the surrounding codebase with respect, and don't overstep (i.e. changing filenames or variables unnecessarily). You should balance being sufficiently ambitious and proactive when completing tasks of this nature.\n\nYou should use judicious initiative to decide on the right level of detail and complexity to deliver based on the user's needs. This means showing good judgment that you're capable of doing the right extras without gold-plating. This might be demonstrated by high-value, creative touches when scope of the task is vague; while being surgical and targeted when scope is tightly specified.\n\n# Sharing progress updates\n\nFor especially longer tasks that you work on (i.e. requiring many tool calls, or a plan with multiple steps), you should provide progress updates back to the user at reasonable intervals. These updates should be structured as a concise sentence or two (no more than 8-10 words long) recapping progress so far in plain language: this update demonstrates your understanding of what needs to be done, progress so far (i.e. files explores, subtasks complete), and where you're going next.\n\nBefore doing large chunks of work that may incur latency as experienced by the user (i.e. writing a new file), you should send a concise message to the user with an update indicating what you're about to do to ensure they know what you're spending time on. Don't start editing or writing large files before informing the user what you are doing and why.\n\nThe messages you send before tool calls should describe what is immediately about to be done next in very concise language. If there was previous work done, this preamble message should also include a note about the work done so far to bring the user along.\n\n# Presenting your work and final message\n\nYour final message should read naturally, like an update from a concise teammate. For casual conversation, brainstorming tasks, or quick questions from the user, respond in a friendly, conversational tone. You should ask questions, suggest ideas, and adapt to the user's style. If you've finished a large amount of work, when describing what you've done to the user, you should follow the final answer formatting guidelines to communicate substantive changes. You don't need to add structured formatting for one-word answers, greetings, or purely conversational exchanges.\n\nYou can skip heavy formatting for single, simple actions or confirmations. In these cases, respond in plain sentences with any relevant next step or quick option. Reserve multi-section structured responses for results that need grouping or explanation.\n\nThe user is working on the same computer as you, and has access to your work. As such there's no need to show the full contents of large files you have already written unless the user explicitly asks for them. Similarly, if you've created or modified files, there's no need to tell users to \"save the file\" or \"copy the code into a file\"\u2014just reference the file path.\n\nComplete authorized next steps, including relevant tests. Ask before a consequential action that needs approval, and briefly report anything you could not verify.\n\nBrevity is very important as a default. You should be very concise (i.e. no more than 10 lines), but can relax this requirement for tasks where additional detail and comprehensiveness is important for the user's understanding.\n\n## Final answer structure and style guidelines\n\nYou are producing plain text that will later be styled by the CLI. Follow these rules exactly. Formatting should make results easy to scan, but not feel mechanical. Use judgment to decide how much structure adds value.\n\n**Section Headers**\n\n- Use only when they improve clarity \u2014 they are not mandatory for every answer.\n- Choose descriptive names that fit the content\n- Keep headers short (1\u20133 words) and in `**Title Case**`. Always start headers with `**` and end with `**`\n- Use the blank lines required by the renderer for headings and lists.\n- Section headers should only be used where they genuinely improve scanability; avoid fragmenting the answer.\n\n**Bullets**\n\n- Use `-` followed by a space for every bullet.\n- Merge related points when possible; avoid a bullet for every trivial detail.\n- Keep bullets to one line unless breaking for clarity is unavoidable.\n- Group into short lists (4\u20136 bullets) ordered by importance.\n- Use consistent keyword phrasing and formatting across sections.\n\n**Monospace**\n\n- Wrap all commands, file paths, env vars, and code identifiers in backticks (`` `...` ``).\n- Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command.\n- Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`) or inline code/path (`` ` ``).\n\n**File References**\n\nWhen referencing files in your response, make sure to include the relevant start line and always follow the below rules:\n\n- Use inline code to make file paths clickable.\n- Each reference should have a stand alone path. Even if it's the same file.\n- Accepted: absolute, workspace\u2011relative, a/ or b/ diff prefixes, or bare filename/suffix.\n- Line/column (1\u2011based, optional): :line[:column] or #Lline[Ccolumn] (column defaults to 1).\n- Do not use URIs like file://, vscode://, or https://.\n- Do not provide range of lines\n- Examples: src/app.ts, src/app.ts:42, b/server/index.js#L10, C:\\repo\\project\\main.rs:12:5\n\n**Structure**\n\n- Place related bullets together; don't mix unrelated concepts in the same section.\n- Order sections from general \u2192 specific \u2192 supporting info.\n- For subsections (e.g., \"Binaries\" under \"Rust Workspace\"), introduce with a bolded keyword bullet, then list items under it.\n- Match structure to complexity:\n - Multi-part or detailed results \u2192 use clear headers and grouped bullets.\n - Simple results \u2192 minimal headers, possibly just a short list or paragraph.\n\n**Tone**\n\n- Keep the voice collaborative and natural, like a coding partner handing off work.\n- Be concise and factual \u2014 no filler or conversational commentary and avoid unnecessary repetition\n- Use present tense and active voice (e.g., \"Runs tests\" not \"This will run tests\").\n- Keep descriptions self-contained; don't refer to \"above\" or \"below\".\n- Use parallel structure in lists for consistency.\n\n**Don't**\n\n- Don't use literal words \"bold\" or \"monospace\" in the content.\n- Don't nest bullets or create deep hierarchies.\n- Don't output ANSI escape codes directly \u2014 the CLI renderer applies them.\n- Don't cram unrelated keywords into a single bullet; split for clarity.\n- Don't let keyword lists run long \u2014 wrap or reformat for scanability.\n\nGenerally, ensure your final answers adapt their shape and depth to the request. For example, answers to code explanations should have a precise, structured explanation with code references that answer the question directly. For tasks with a simple implementation, lead with the outcome and supplement only with what's needed for clarity. Larger changes can be presented as a logical walkthrough of your approach, grouping related steps, explaining rationale where it adds value, and highlighting next actions to accelerate the user. Your answers should provide the right level of detail while being easily scannable.\n\nFor casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting.\n\n# Professional objectivity\n\nPrioritize technical accuracy and truthfulness over validating the user's beliefs. Focus on facts and problem-solving. Be direct and objective without unnecessary praise or emotional validation. Disagree when needed. When uncertain, investigate before confirming the user's assumptions.\n\n# Proactiveness\n\nProactively complete work that follows from the user's request. Avoid unrelated actions that would surprise the user. Strike a balance between:\n\n1. Doing the right thing when asked, including follow-up actions\n2. Not surprising the user with unrequested actions\n For example, if the user asks how to approach something, answer first; do not immediately jump into edits.\n\n# Following conventions\n\nWhen changing files, first understand the file's conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\n\n- NEVER assume a library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses it (neighboring files, package.json, cargo.toml, go.mod, etc.).\n- When creating a new component, first look at existing components for framework choice, naming, typing, and other conventions.\n- When editing code, first look at surrounding context (especially imports) to understand chosen frameworks/libraries, then make the change idiomatically.\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\n\n# Doing tasks\n\nThe user will primarily request software engineering tasks: bugs, features, refactors, explanations, and more. Recommended steps:\n\n- Use available search/read tools extensively to understand the codebase and the query (in parallel when independent).\n- Implement the solution with the tools available to you.\n- Prefer editing existing files. Create documentation when the task or project instructions require it.\n- Verify when possible with tests. NEVER assume a specific test framework or script \u2014 check README / AGENTS.md or search the repo.\n- Run lint and typecheck commands (for example npm run lint, npm run typecheck, ruff, pnpm lint) if they were provided to you \u2014 see Validating your work for when to run them proactively vs. when to hold off. If you cannot find the correct command, ask the user, and if they supply it, proactively suggest writing it to AGENTS.md so you know next time.\n\n- Tool results and user messages may include <system-reminder> tags. Those tags contain useful reminders. They are NOT part of the user's provided input or the tool result.\n\n# Tool usage policy\n\n- Prefer specialized file tools over shell for reading, editing, writing, listing, and searching when those tools are available. Use the `grep`, `glob`, and `list` tools instead of bash for search and listing \u2014 they are ripgrep-backed and return structured, length-capped results. Use shell for real system commands (git, package managers, builds, tests, process control).\n- When doing broad codebase exploration, use the available search tools and delegate only when the task benefits from independent work.\n- You can call multiple tools in one response. When multiple independent pieces of information are needed, batch tool calls for performance. When making multiple bash tool calls, send a single message with multiple tool calls so they can run in parallel (for example git status and git diff together).\n- Match edit old-text exactly, including whitespace.\n- If a tool call is denied by policy, adapt: use an allowed approach or ask the user. Do not retry the same blocked call in a loop.\n\n## Shell commands\n\nWhen using the shell, you must adhere to the following guidelines:\n\n- When searching for text or files, prefer using `rg` or `rg --files` respectively because `rg` is much faster than alternatives like `grep` and `find`. (If the `rg` command is not found, then use alternatives.) Reach for the shell only when the `grep`/`glob` tools cannot express the query \u2014 for example counting matches, or piping results into another command.\n- Search narrow first: use `rg -l` or `rg -c` to find which files match, then read only those files. Do not dump full match bodies across a repo into context.\n- Never pipe a large file into your context. Do not `cat` a big file; use the `read` tool with an offset/limit, or `sed -n 'START,ENDp'` for a specific range.\n- Do not use python scripts to attempt to output larger chunks of a file.\n\nIMPORTANT: Before you begin work, think about what the code you're editing is supposed to do based on the filenames and directory structure.\n\n# AGENTS.md spec\n\n- Repos often contain AGENTS.md files. These files can appear anywhere within the repository.\n- These files are a way for humans to give you (the agent) instructions or tips for working within the container.\n- Some examples might be: coding conventions, info about how code is organized, or instructions for how to run or test code.\n- Instructions in AGENTS.md files:\n - The scope of an AGENTS.md file is the entire directory tree rooted at the folder that contains it.\n - For every file you touch in the final change, you must obey instructions in any AGENTS.md file whose scope includes that file.\n - Instructions about code style, structure, naming, etc. apply only to code within the AGENTS.md file's scope, unless the file states otherwise.\n - More-deeply-nested AGENTS.md files take precedence in the case of conflicting instructions.\n - Direct system/developer/user instructions (as part of a prompt) take precedence over AGENTS.md instructions.\n- The contents of the AGENTS.md file at the root of the repo and the project directory are loaded into your context automatically and don't need to be re-read. AGENTS.md files in subdirectories are NOT loaded automatically: when working in a subdirectory, or a directory outside the CWD, check for any AGENTS.md files that may be applicable.\n\n# Permissions and safety\n\n- Never commit secrets or keys.\n- Never create a git commit unless the user explicitly asks.\n- Do not run destructive commands (mass delete, force-push, hard reset) unless the user clearly requested them.\n";
30683
30749
  ALAN_CODE_ENGINE_PROVIDER_ID = "alan";
@@ -31049,7 +31115,7 @@ function notice(kind, message) {
31049
31115
  function promptParts2(input2) {
31050
31116
  const files = (input2.imagePaths ?? []).map((path, index) => ({
31051
31117
  type: "file",
31052
- mime: input2.images?.[index]?.mimeType ?? IMAGE_TYPES[(0, import_path10.extname)(path).toLowerCase()] ?? "application/octet-stream",
31118
+ mime: input2.images?.[index]?.mimeType ?? IMAGE_TYPES[(0, import_path11.extname)(path).toLowerCase()] ?? "application/octet-stream",
31053
31119
  filename: path.split(/[\\/]/).at(-1) ?? path,
31054
31120
  url: (0, import_url2.pathToFileURL)(path).href
31055
31121
  }));
@@ -31172,7 +31238,7 @@ async function canonicalDirectory(directory) {
31172
31238
  try {
31173
31239
  return await (0, import_promises17.realpath)(directory);
31174
31240
  } catch {
31175
- return (0, import_path9.resolve)(directory);
31241
+ return (0, import_path10.resolve)(directory);
31176
31242
  }
31177
31243
  }
31178
31244
  async function openSession(session, client, spec, log) {
@@ -31272,9 +31338,9 @@ function createOpenCodeDriver(options = {}) {
31272
31338
  const spec = { ...planned, env: launchEnv(planned, authorization) };
31273
31339
  const password = options.password?.() ?? (0, import_crypto10.randomBytes)(24).toString("base64url");
31274
31340
  try {
31275
- const data = spec.env.XDG_DATA_HOME ?? (0, import_path9.join)(spec.env.HOME ?? spec.env.USERPROFILE ?? spec.cwd, ".local", "share");
31341
+ const data = spec.env.XDG_DATA_HOME ?? (0, import_path10.join)(spec.env.HOME ?? spec.env.USERPROFILE ?? spec.cwd, ".local", "share");
31276
31342
  const session = await withStartupLock(
31277
- (0, import_path9.join)(data, "opencode", ".alan-startup.lock"),
31343
+ (0, import_path10.join)(data, "opencode", ".alan-startup.lock"),
31278
31344
  resolved.clock,
31279
31345
  () => openWithRetries(spec, password, resolved)
31280
31346
  );
@@ -31372,15 +31438,15 @@ function openCodeTurnInput(run, context) {
31372
31438
  ...context.attachments.length ? { readableFiles: context.attachments.map((attachment) => attachment.path) } : {}
31373
31439
  };
31374
31440
  }
31375
- var import_crypto9, import_http4, import_crypto10, import_promises17, import_path9, import_path10, import_url2, import_path11, import_crypto11, IDLE_SOCKET_MS2, OpenCodeHttpError, BASE62, messageIdClock, OpenCodeClient, OPENCODE_CONFIG_ENV, OPENCODE_ENGINE, TEXT_PARTS, STEP_PARTS, STOPPED_BY_USER, OpenCodeSubagents, NAMED_KINDS, OPENCODE_ABORTED_ERROR, PROVIDER_EVENT_META, TASK_TOOL_NAME, TASK_RESULT_TAG, TASK_ERROR_TAG, PERMISSION_DENIED, FILE_OPERATIONS, NO_USAGE, PartReader, NOTHING, NON_INTERACTIVE_PERMISSIONS, CONTENT_FILTER_FINISHES, TRUNCATED_FINISHES, OUTPUT_PARTS, OpenCodeTurn, LISTENING, OUTPUT_TAIL_LINES, IMAGE_TYPES, OpenCodeSession, OPENCODE_MIN_VERSION, OPENCODE_REQUIREMENT, OPENCODE_TESTED_LINE, OPENCODE_SUPPORTED_MAJOR, DEFAULTS2, STORE_LOCKED, NON_INTERACTIVE_RULES, TITLE_LENGTH, MAX_VARIANT_LENGTH;
31441
+ var import_crypto9, import_http4, import_crypto10, import_promises17, import_path10, import_path11, import_url2, import_path12, import_crypto11, IDLE_SOCKET_MS2, OpenCodeHttpError, BASE62, messageIdClock, OpenCodeClient, OPENCODE_CONFIG_ENV, OPENCODE_ENGINE, TEXT_PARTS, STEP_PARTS, STOPPED_BY_USER, OpenCodeSubagents, NAMED_KINDS, OPENCODE_ABORTED_ERROR, PROVIDER_EVENT_META, TASK_TOOL_NAME, TASK_RESULT_TAG, TASK_ERROR_TAG, PERMISSION_DENIED, FILE_OPERATIONS, NO_USAGE, PartReader, NOTHING, NON_INTERACTIVE_PERMISSIONS, CONTENT_FILTER_FINISHES, TRUNCATED_FINISHES, OUTPUT_PARTS, OpenCodeTurn, LISTENING, OUTPUT_TAIL_LINES, IMAGE_TYPES, OpenCodeSession, OPENCODE_MIN_VERSION, OPENCODE_REQUIREMENT, OPENCODE_TESTED_LINE, OPENCODE_SUPPORTED_MAJOR, DEFAULTS2, STORE_LOCKED, NON_INTERACTIVE_RULES, TITLE_LENGTH, MAX_VARIANT_LENGTH;
31376
31442
  var init_opencode = __esm({
31377
31443
  "../agent-core/dist/providers/opencode.js"() {
31378
31444
  "use strict";
31379
- init_chunk_4LDW3FJB();
31445
+ init_chunk_U4RQE7JS();
31380
31446
  init_chunk_AF3IPGDT();
31381
- init_chunk_ZCTKXKYY();
31447
+ init_chunk_WYNUYKKN();
31382
31448
  init_chunk_KVTSAS2T();
31383
- init_chunk_DLVRNIY5();
31449
+ init_chunk_7FJ7QKFN();
31384
31450
  init_chunk_OSECDZA5();
31385
31451
  init_chunk_YXWJW7I5();
31386
31452
  import_crypto9 = require("crypto");
@@ -31388,12 +31454,12 @@ var init_opencode = __esm({
31388
31454
  init_runtime_v2();
31389
31455
  import_crypto10 = require("crypto");
31390
31456
  import_promises17 = require("fs/promises");
31391
- import_path9 = require("path");
31392
- init_agent2();
31393
31457
  import_path10 = require("path");
31458
+ init_agent2();
31459
+ import_path11 = require("path");
31394
31460
  import_url2 = require("url");
31395
31461
  init_acp();
31396
- import_path11 = require("path");
31462
+ import_path12 = require("path");
31397
31463
  init_acp();
31398
31464
  init_constants();
31399
31465
  import_crypto11 = require("crypto");
@@ -32031,7 +32097,7 @@ var init_opencode = __esm({
32031
32097
  this.#readOnly = readOnly;
32032
32098
  this.#memory = memory;
32033
32099
  this.#engine = engine;
32034
- this.#readableFiles = new Set(readableFiles.map((path) => (0, import_path11.normalize)(path)));
32100
+ this.#readableFiles = new Set(readableFiles.map((path) => (0, import_path12.normalize)(path)));
32035
32101
  }
32036
32102
  get childSessionIds() {
32037
32103
  return [...this.#children.keys()];
@@ -32271,7 +32337,7 @@ var init_opencode = __esm({
32271
32337
  #opensAttachment(kind, properties) {
32272
32338
  if (kind !== "external_directory") return false;
32273
32339
  const filepath = asString(asRecord(properties.metadata)?.filepath);
32274
- return (0, import_path11.isAbsolute)(filepath) && this.#readableFiles.has((0, import_path11.normalize)(filepath));
32340
+ return (0, import_path12.isAbsolute)(filepath) && this.#readableFiles.has((0, import_path12.normalize)(filepath));
32275
32341
  }
32276
32342
  #question(properties) {
32277
32343
  const requestId = asString(properties.id).trim();
@@ -33044,6 +33110,14 @@ function modelArgs(input2) {
33044
33110
  effort: option("--effort", effort)
33045
33111
  };
33046
33112
  }
33113
+ function skillListingArgs(input2) {
33114
+ const chars = input2.skillListingMaxDescChars;
33115
+ const ownSettings = (input2.extraArgs ?? []).some(
33116
+ (arg) => arg === "--settings" || arg.startsWith("--settings=")
33117
+ );
33118
+ if (chars === void 0 || !input2.capabilities.supportsPluginDir || ownSettings) return [];
33119
+ return ["--settings", JSON.stringify({ skillListingMaxDescChars: chars })];
33120
+ }
33047
33121
  function buildClaudeArgs(input2) {
33048
33122
  const { capabilities } = input2;
33049
33123
  const disallowed = input2.disallowedTools?.length ? input2.disallowedTools.join(",") : void 0;
@@ -33068,6 +33142,7 @@ function buildClaudeArgs(input2) {
33068
33142
  // Without it the whole answer lands in one frame at turn end.
33069
33143
  ...capabilities.supportsPartialMessages ? ["--include-partial-messages"] : [],
33070
33144
  ...capabilities.supportsPluginDir ? (input2.pluginDirs ?? []).flatMap((dir) => ["--plugin-dir", dir]) : [],
33145
+ ...skillListingArgs(input2),
33071
33146
  ...option("--resume", input2.resumeId),
33072
33147
  "--chrome",
33073
33148
  ...input2.extraArgs ?? []
@@ -33955,7 +34030,7 @@ function createClaudeDriver(options = {}) {
33955
34030
  };
33956
34031
  }
33957
34032
  function claudeHomeFor(env, homeDir) {
33958
- return env.CLAUDE_CONFIG_DIR || (0, import_path12.join)(env.HOME || homeDir, ".claude");
34033
+ return env.CLAUDE_CONFIG_DIR || (0, import_path13.join)(env.HOME || homeDir, ".claude");
33959
34034
  }
33960
34035
  function encodeProjectDir(cwd) {
33961
34036
  return cwd.replace(/[^a-zA-Z0-9]/g, "-");
@@ -33976,14 +34051,14 @@ function projectDirs(projectsRoot) {
33976
34051
  }
33977
34052
  function claudeSessionLogExists(query) {
33978
34053
  if (!query.sessionId || !query.cwd) return false;
33979
- const projectsRoot = (0, import_path12.join)(query.claudeHome, "projects");
34054
+ const projectsRoot = (0, import_path13.join)(query.claudeHome, "projects");
33980
34055
  const fileName = `${query.sessionId}.jsonl`;
33981
34056
  const here = new Set([query.cwd, realCwd(query.cwd)].map(encodeProjectDir));
33982
34057
  for (const dir of here) {
33983
- if ((0, import_fs8.existsSync)((0, import_path12.join)(projectsRoot, dir, fileName))) return true;
34058
+ if ((0, import_fs8.existsSync)((0, import_path13.join)(projectsRoot, dir, fileName))) return true;
33984
34059
  }
33985
34060
  return projectDirs(projectsRoot).some(
33986
- (dir) => !here.has(dir) && (0, import_fs8.existsSync)((0, import_path12.join)(projectsRoot, dir, fileName))
34061
+ (dir) => !here.has(dir) && (0, import_fs8.existsSync)((0, import_path13.join)(projectsRoot, dir, fileName))
33987
34062
  );
33988
34063
  }
33989
34064
  function envDigest3(env) {
@@ -34012,6 +34087,7 @@ function planClaudeSession(run, context) {
34012
34087
  ...prompts.systemPrompt === void 0 ? {} : { systemPrompt: prompts.systemPrompt },
34013
34088
  ...prompts.systemPromptAppend === void 0 ? {} : { appendSystemPrompt: prompts.systemPromptAppend },
34014
34089
  ...context.pluginDirs?.length ? { pluginDirs: context.pluginDirs } : {},
34090
+ ...run.sandboxId || run.cloudEnvironmentId ? { skillListingMaxDescChars: CLOUD_SKILL_LISTING_MAX_DESCRIPTION_CHARS } : {},
34015
34091
  ...context.managedMcp === void 0 ? {} : {
34016
34092
  mcp: {
34017
34093
  alanMcpUrl: context.managedMcp.url,
@@ -34056,16 +34132,16 @@ async function claudeTurnInput(run, context) {
34056
34132
  );
34057
34133
  return { turnId: run.runId, text: text2, ...encoded.length ? { images: encoded } : {} };
34058
34134
  }
34059
- var import_crypto12, import_fs8, import_path12, import_crypto13, import_promises18, EDIT_TOOLS, ThoughtBlocks, UNDERSTOOD_SYSTEM_SUBTYPES, CLAUDE_MCP_STATUS, RATE_LIMIT_WARN_AT, CLAUDE_GRAMMAR_NAME, SUBAGENT_TOOL_NAMES, controlResponseSchema, STOPPED_STATUSES, TaskRecords, TERMINAL_BACKGROUND_STATUSES, NON_TERMINAL_BACKGROUND_STATUSES, ASYNC_LAUNCH_ACK, BackgroundTasks, FAILED_STATUSES, STOPPED_BY_USER_TEXT, ClaudeTurn, STDERR_TAIL_LINES3, MAX_EARLY_LINES, UNSUPPORTED_STOP, OUTPUT_CLOSED_REASON, ClaudeSession, DEFAULTS3, READ_ONLY_DISALLOWED_TOOLS, DEFAULT_MCP_TIMEOUT_MS;
34135
+ var import_crypto12, import_fs8, import_path13, import_crypto13, import_promises18, EDIT_TOOLS, ThoughtBlocks, UNDERSTOOD_SYSTEM_SUBTYPES, CLAUDE_MCP_STATUS, RATE_LIMIT_WARN_AT, CLAUDE_GRAMMAR_NAME, SUBAGENT_TOOL_NAMES, controlResponseSchema, STOPPED_STATUSES, TaskRecords, TERMINAL_BACKGROUND_STATUSES, NON_TERMINAL_BACKGROUND_STATUSES, ASYNC_LAUNCH_ACK, BackgroundTasks, FAILED_STATUSES, STOPPED_BY_USER_TEXT, ClaudeTurn, STDERR_TAIL_LINES3, MAX_EARLY_LINES, UNSUPPORTED_STOP, OUTPUT_CLOSED_REASON, ClaudeSession, DEFAULTS3, READ_ONLY_DISALLOWED_TOOLS, DEFAULT_MCP_TIMEOUT_MS, CLOUD_SKILL_LISTING_MAX_DESCRIPTION_CHARS;
34060
34136
  var init_claude = __esm({
34061
34137
  "../agent-core/dist/providers/claude.js"() {
34062
34138
  "use strict";
34063
34139
  init_chunk_VUWLTOVK();
34064
- init_chunk_4LDW3FJB();
34140
+ init_chunk_U4RQE7JS();
34065
34141
  init_chunk_AF3IPGDT();
34066
- init_chunk_ZCTKXKYY();
34142
+ init_chunk_WYNUYKKN();
34067
34143
  init_chunk_KVTSAS2T();
34068
- init_chunk_DLVRNIY5();
34144
+ init_chunk_7FJ7QKFN();
34069
34145
  init_chunk_OSECDZA5();
34070
34146
  init_chunk_YXWJW7I5();
34071
34147
  init_effort();
@@ -34077,7 +34153,7 @@ var init_claude = __esm({
34077
34153
  init_constants();
34078
34154
  init_agent2();
34079
34155
  import_fs8 = require("fs");
34080
- import_path12 = require("path");
34156
+ import_path13 = require("path");
34081
34157
  import_crypto13 = require("crypto");
34082
34158
  import_promises18 = require("fs/promises");
34083
34159
  init_agent2();
@@ -35045,6 +35121,7 @@ var init_claude = __esm({
35045
35121
  "NotebookEdit"
35046
35122
  ];
35047
35123
  DEFAULT_MCP_TIMEOUT_MS = 5e3;
35124
+ CLOUD_SKILL_LISTING_MAX_DESCRIPTION_CHARS = 250;
35048
35125
  }
35049
35126
  });
35050
35127
 
@@ -35202,7 +35279,7 @@ function codexExecArgs(input2) {
35202
35279
  ];
35203
35280
  }
35204
35281
  function codexHomeOf(env) {
35205
- return env.CODEX_HOME || (0, import_path13.join)(env.HOME ?? "", ".codex");
35282
+ return env.CODEX_HOME || (0, import_path14.join)(env.HOME ?? "", ".codex");
35206
35283
  }
35207
35284
  function namesNewestFirst(dir, isDir) {
35208
35285
  try {
@@ -35218,15 +35295,15 @@ function findCodexRollout(codexHome, sessionId) {
35218
35295
  const name = namesNewestFirst(dir, false).find(
35219
35296
  (file2) => file2.startsWith("rollout-") && file2.endsWith(suffix)
35220
35297
  );
35221
- return name ? (0, import_path13.join)(dir, name) : void 0;
35298
+ return name ? (0, import_path14.join)(dir, name) : void 0;
35222
35299
  }
35223
35300
  for (const child of namesNewestFirst(dir, true)) {
35224
- const found = walk((0, import_path13.join)(dir, child), depth - 1);
35301
+ const found = walk((0, import_path14.join)(dir, child), depth - 1);
35225
35302
  if (found) return found;
35226
35303
  }
35227
35304
  return void 0;
35228
35305
  };
35229
- return sessionId ? walk((0, import_path13.join)(codexHome, "sessions"), 3) : void 0;
35306
+ return sessionId ? walk((0, import_path14.join)(codexHome, "sessions"), 3) : void 0;
35230
35307
  }
35231
35308
  function codexRolloutExists(codexHome, sessionId) {
35232
35309
  return Promise.resolve(findCodexRollout(codexHome, sessionId) !== void 0);
@@ -36404,20 +36481,20 @@ function codexTurnInput(run, context) {
36404
36481
  ...images.length ? { imagePaths: images.map((image) => image.path) } : {}
36405
36482
  };
36406
36483
  }
36407
- var import_fs9, import_path13, import_crypto14, import_crypto15, import_crypto16, import_crypto17, TokenRefresher, MCP_STARTUP_TIMEOUT_SEC, FIELD_TYPES, YES_NO, ACCEPT_DECLINE, MAX_INLINE_GENERATED_IMAGE_BYTES, PNG_SIGNATURE2, JPEG_NON_FRAME_MARKERS, IMAGE_GEN_CALL, PROMPT_LITERAL, RELOCATE_EVERY_MS, CodexImageGenerationFold, CodexRolloutImages, CodexRateLimits, USER_INPUT_METHOD, PERMISSIONS_METHOD, ELICITATION_METHOD, COMMAND_OR_FILE, LEGACY, DECISIONS, COORDINATION_TOOLS, SETTLED_AGENT, STATUS, CHANGE_OPERATIONS, SILENT_ON_START, IGNORED_ITEMS, PLAN_STATUS, CodexTurnTokens, CODEX_MCP_STATUS, WORKER_LIFECYCLE, INFO_KINDS, SILENT, CodexTurn, STDERR_TAIL_LINES4, MAX_BETWEEN_UPDATES2, UNSUPPORTED_REQUEST, DECLINED_ELICITATION, IMAGE_CATCH_UP_MS, IMAGE_POLL_MS, CodexSession, CODEX_MIN_VERSION, CODEX_REQUIREMENT, CODEX_TESTED_LINE, DEFAULTS4, CLIENT_INFO2, STATUS2, EXITED_WITHOUT_RESPONSE, CodexExecTurn, DEFAULTS22, CodexExecSession;
36484
+ var import_fs9, import_path14, import_crypto14, import_crypto15, import_crypto16, import_crypto17, TokenRefresher, MCP_STARTUP_TIMEOUT_SEC, FIELD_TYPES, YES_NO, ACCEPT_DECLINE, MAX_INLINE_GENERATED_IMAGE_BYTES, PNG_SIGNATURE2, JPEG_NON_FRAME_MARKERS, IMAGE_GEN_CALL, PROMPT_LITERAL, RELOCATE_EVERY_MS, CodexImageGenerationFold, CodexRolloutImages, CodexRateLimits, USER_INPUT_METHOD, PERMISSIONS_METHOD, ELICITATION_METHOD, COMMAND_OR_FILE, LEGACY, DECISIONS, COORDINATION_TOOLS, SETTLED_AGENT, STATUS, CHANGE_OPERATIONS, SILENT_ON_START, IGNORED_ITEMS, PLAN_STATUS, CodexTurnTokens, CODEX_MCP_STATUS, WORKER_LIFECYCLE, INFO_KINDS, SILENT, CodexTurn, STDERR_TAIL_LINES4, MAX_BETWEEN_UPDATES2, UNSUPPORTED_REQUEST, DECLINED_ELICITATION, IMAGE_CATCH_UP_MS, IMAGE_POLL_MS, CodexSession, CODEX_MIN_VERSION, CODEX_REQUIREMENT, CODEX_TESTED_LINE, DEFAULTS4, CLIENT_INFO2, STATUS2, EXITED_WITHOUT_RESPONSE, CodexExecTurn, DEFAULTS22, CodexExecSession;
36408
36485
  var init_codex = __esm({
36409
36486
  "../agent-core/dist/providers/codex.js"() {
36410
36487
  "use strict";
36411
36488
  init_chunk_VUWLTOVK();
36412
- init_chunk_4LDW3FJB();
36489
+ init_chunk_U4RQE7JS();
36413
36490
  init_chunk_AF3IPGDT();
36414
- init_chunk_ZCTKXKYY();
36491
+ init_chunk_WYNUYKKN();
36415
36492
  init_chunk_KVTSAS2T();
36416
- init_chunk_DLVRNIY5();
36493
+ init_chunk_7FJ7QKFN();
36417
36494
  init_chunk_OSECDZA5();
36418
36495
  init_chunk_YXWJW7I5();
36419
36496
  import_fs9 = require("fs");
36420
- import_path13 = require("path");
36497
+ import_path14 = require("path");
36421
36498
  init_effort();
36422
36499
  import_crypto14 = require("crypto");
36423
36500
  import_crypto15 = require("crypto");
@@ -38100,11 +38177,11 @@ var import_crypto18, import_promises19, FACTORY_API_VERSION, FACTORY_PROTOCOL_VE
38100
38177
  var init_droid = __esm({
38101
38178
  "../agent-core/dist/providers/droid.js"() {
38102
38179
  "use strict";
38103
- init_chunk_4LDW3FJB();
38180
+ init_chunk_U4RQE7JS();
38104
38181
  init_chunk_AF3IPGDT();
38105
- init_chunk_ZCTKXKYY();
38182
+ init_chunk_WYNUYKKN();
38106
38183
  init_chunk_KVTSAS2T();
38107
- init_chunk_DLVRNIY5();
38184
+ init_chunk_7FJ7QKFN();
38108
38185
  init_chunk_OSECDZA5();
38109
38186
  init_chunk_YXWJW7I5();
38110
38187
  init_runtime_v2();
@@ -38591,7 +38668,7 @@ var init_opencode2 = __esm({
38591
38668
  // ../agent-core/dist/providers/antigravity.js
38592
38669
  function settingsPath(env) {
38593
38670
  const home = env.HOME?.trim() || env.USERPROFILE?.trim();
38594
- return home ? (0, import_path14.resolve)(home, ".gemini", "antigravity-cli", "settings.json") : void 0;
38671
+ return home ? (0, import_path15.resolve)(home, ".gemini", "antigravity-cli", "settings.json") : void 0;
38595
38672
  }
38596
38673
  async function readSettings(path) {
38597
38674
  let raw;
@@ -38614,7 +38691,7 @@ async function selectAntigravityApiKeyMode(env) {
38614
38691
  const settings2 = await readSettings(path);
38615
38692
  if (settings2 === "malformed") return "malformed";
38616
38693
  if (settings2.modelProvider === "gemini") return "already_selected";
38617
- await (0, import_promises20.mkdir)((0, import_path14.dirname)(path), { recursive: true });
38694
+ await (0, import_promises20.mkdir)((0, import_path15.dirname)(path), { recursive: true });
38618
38695
  await (0, import_promises20.writeFile)(path, JSON.stringify({ ...settings2, modelProvider: "gemini" }), { mode: 384 });
38619
38696
  return "selected";
38620
38697
  }
@@ -38658,21 +38735,21 @@ function antigravityArgs(input2, capabilities, prompt) {
38658
38735
  ];
38659
38736
  }
38660
38737
  function workspaceRoot(cwd) {
38661
- for (let current = (0, import_path15.resolve)(cwd); ; current = (0, import_path15.dirname)(current)) {
38662
- if ((0, import_fs10.existsSync)((0, import_path15.join)(current, ".git"))) return current;
38663
- if ((0, import_path15.dirname)(current) === current) return (0, import_path15.resolve)(cwd);
38738
+ for (let current = (0, import_path16.resolve)(cwd); ; current = (0, import_path16.dirname)(current)) {
38739
+ if ((0, import_fs10.existsSync)((0, import_path16.join)(current, ".git"))) return current;
38740
+ if ((0, import_path16.dirname)(current) === current) return (0, import_path16.resolve)(cwd);
38664
38741
  }
38665
38742
  }
38666
38743
  function instructionPaths(cwd) {
38667
38744
  const root = workspaceRoot(cwd);
38668
38745
  const paths = [];
38669
- for (let current = (0, import_path15.resolve)(cwd); ; current = (0, import_path15.dirname)(current)) {
38670
- const path = (0, import_path15.join)(current, INSTRUCTIONS_FILE);
38746
+ for (let current = (0, import_path16.resolve)(cwd); ; current = (0, import_path16.dirname)(current)) {
38747
+ const path = (0, import_path16.join)(current, INSTRUCTIONS_FILE);
38671
38748
  try {
38672
38749
  if ((0, import_fs10.existsSync)(path) && (0, import_fs10.statSync)(path).isFile()) paths.unshift(path);
38673
38750
  } catch {
38674
38751
  }
38675
- if (current === root || (0, import_path15.dirname)(current) === current) return paths;
38752
+ if (current === root || (0, import_path16.dirname)(current) === current) return paths;
38676
38753
  }
38677
38754
  }
38678
38755
  function antigravityWorkspaceInstructions(cwd, maxChars = MAX_INSTRUCTION_CHARS) {
@@ -38926,7 +39003,7 @@ function normalizeAntigravityFrame(event) {
38926
39003
  }
38927
39004
  function antigravityBrainRoot(env) {
38928
39005
  const home = env.HOME?.trim() || env.USERPROFILE?.trim();
38929
- return home ? (0, import_path16.resolve)(home, ".gemini", "antigravity-cli", "brain") : void 0;
39006
+ return home ? (0, import_path17.resolve)(home, ".gemini", "antigravity-cli", "brain") : void 0;
38930
39007
  }
38931
39008
  function parseEntry(text2) {
38932
39009
  try {
@@ -38964,14 +39041,14 @@ function childTranscriptPath(root, frame) {
38964
39041
  try {
38965
39042
  const url2 = new URL(logUri);
38966
39043
  if (url2.protocol !== "file:") return void 0;
38967
- path = (0, import_path16.resolve)((0, import_url3.fileURLToPath)(url2));
39044
+ path = (0, import_path17.resolve)((0, import_url3.fileURLToPath)(url2));
38968
39045
  } catch {
38969
39046
  return void 0;
38970
39047
  }
38971
- const fromRoot = (0, import_path16.relative)(root, path);
38972
- if (!fromRoot || (0, import_path16.isAbsolute)(fromRoot) || fromRoot.split(import_path16.sep).includes("..")) return void 0;
39048
+ const fromRoot = (0, import_path17.relative)(root, path);
39049
+ if (!fromRoot || (0, import_path17.isAbsolute)(fromRoot) || fromRoot.split(import_path17.sep).includes("..")) return void 0;
38973
39050
  const expected = [conversationId, ...LOG_DIRS, TRANSCRIPT_FILE];
38974
- const segments = fromRoot.split(import_path16.sep);
39051
+ const segments = fromRoot.split(import_path17.sep);
38975
39052
  const matches = segments.length === expected.length && segments.every((segment, index) => segment === expected[index]);
38976
39053
  return matches ? path : void 0;
38977
39054
  }
@@ -39233,24 +39310,24 @@ function antigravityTurnInput(run, context) {
39233
39310
  });
39234
39311
  return { turnId: run.runId, text: appendImagePathReferences(text2, images) };
39235
39312
  }
39236
- var import_promises20, import_path14, import_fs10, import_path15, import_path16, import_url3, import_crypto19, NO_ANTIGRAVITY_CAPABILITIES, INSTRUCTIONS_FILE, MAX_INSTRUCTION_CHARS, SHORTENED_NOTE, DIFF_BLOCK_START, DIFF_BLOCK_END, HUNK_HEADER, TRANSCRIPT_FILE, FULL_TRANSCRIPT_FILE, LOG_DIRS, TOOL_RESULT_TYPES, BrainTranscript, AntigravityTranscripts, ANTIGRAVITY_GRAMMAR_NAME, AntigravityGrammar, ignored, HANDLERS, SUCCESSFUL_STATUSES, SESSION_START_TYPES, RESULT_TYPES, SUBAGENT_START_TYPES, RESUME_FORKED, EXITED_WITHOUT_RESULT, AntigravityTurn, DEFAULTS6, AntigravitySession, WINDOWS_LINE_MARGIN;
39313
+ var import_promises20, import_path15, import_fs10, import_path16, import_path17, import_url3, import_crypto19, NO_ANTIGRAVITY_CAPABILITIES, INSTRUCTIONS_FILE, MAX_INSTRUCTION_CHARS, SHORTENED_NOTE, DIFF_BLOCK_START, DIFF_BLOCK_END, HUNK_HEADER, TRANSCRIPT_FILE, FULL_TRANSCRIPT_FILE, LOG_DIRS, TOOL_RESULT_TYPES, BrainTranscript, AntigravityTranscripts, ANTIGRAVITY_GRAMMAR_NAME, AntigravityGrammar, ignored, HANDLERS, SUCCESSFUL_STATUSES, SESSION_START_TYPES, RESULT_TYPES, SUBAGENT_START_TYPES, RESUME_FORKED, EXITED_WITHOUT_RESULT, AntigravityTurn, DEFAULTS6, AntigravitySession, WINDOWS_LINE_MARGIN;
39237
39314
  var init_antigravity = __esm({
39238
39315
  "../agent-core/dist/providers/antigravity.js"() {
39239
39316
  "use strict";
39240
39317
  init_chunk_VUWLTOVK();
39241
- init_chunk_4LDW3FJB();
39318
+ init_chunk_U4RQE7JS();
39242
39319
  init_chunk_AF3IPGDT();
39243
- init_chunk_ZCTKXKYY();
39320
+ init_chunk_WYNUYKKN();
39244
39321
  init_chunk_KVTSAS2T();
39245
- init_chunk_DLVRNIY5();
39322
+ init_chunk_7FJ7QKFN();
39246
39323
  init_chunk_YXWJW7I5();
39247
39324
  import_promises20 = require("fs/promises");
39248
- import_path14 = require("path");
39325
+ import_path15 = require("path");
39249
39326
  init_type_guards();
39250
39327
  import_fs10 = require("fs");
39251
- import_path15 = require("path");
39252
- init_effort();
39253
39328
  import_path16 = require("path");
39329
+ init_effort();
39330
+ import_path17 = require("path");
39254
39331
  import_url3 = require("url");
39255
39332
  import_crypto19 = require("crypto");
39256
39333
  init_agent2();
@@ -39290,7 +39367,7 @@ var init_antigravity = __esm({
39290
39367
  #full;
39291
39368
  constructor(path) {
39292
39369
  this.#cursor = new TranscriptCursor(path);
39293
- this.#fullPath = (0, import_path16.resolve)((0, import_path16.dirname)(path), FULL_TRANSCRIPT_FILE);
39370
+ this.#fullPath = (0, import_path17.resolve)((0, import_path17.dirname)(path), FULL_TRANSCRIPT_FILE);
39294
39371
  }
39295
39372
  skipExisting() {
39296
39373
  this.#cursor.read();
@@ -39338,7 +39415,7 @@ var init_antigravity = __esm({
39338
39415
  /** A conversation this turn did not resume was created by it, so it is read whole. */
39339
39416
  trackParent(conversationId) {
39340
39417
  if (this.#parent?.conversationId === conversationId) return;
39341
- const path = (0, import_path16.resolve)(this.#root, conversationId, ...LOG_DIRS, TRANSCRIPT_FILE);
39418
+ const path = (0, import_path17.resolve)(this.#root, conversationId, ...LOG_DIRS, TRANSCRIPT_FILE);
39342
39419
  this.#parent = { conversationId, transcript: new BrainTranscript(path) };
39343
39420
  }
39344
39421
  /** A launcher keeps the first valid transcript it names; later frames change nothing. */
@@ -39769,7 +39846,7 @@ function parseConfig(raw) {
39769
39846
  }
39770
39847
  }
39771
39848
  async function writeCommandCodeProjectMcp(cwd, mcp) {
39772
- const path = (0, import_path17.join)(cwd, ".mcp.json");
39849
+ const path = (0, import_path18.join)(cwd, ".mcp.json");
39773
39850
  const original = await (0, import_promises21.readFile)(path, "utf8").catch(() => null);
39774
39851
  const config2 = parseConfig(original);
39775
39852
  const next = {
@@ -39964,19 +40041,19 @@ function commandCodeTurnInput(run, context) {
39964
40041
  });
39965
40042
  return { turnId: run.runId, text: appendImagePathReferences(text2, images) };
39966
40043
  }
39967
- var import_promises21, import_path17, import_crypto20, COMMAND_CODE_GRAMMAR_NAME, SILENT3, CommandCodeGrammar, SHELL_TOOL, STOP_TOOLS, REPORTED_STATUS, SHELL_STATUS, SWEEP_INTERVAL_MS, CommandCodeBackgroundTasks, EXITED_WITHOUT_RESULT2, CommandCodeTurn, COMMAND_CODE_MAX_TURNS, DEFAULTS7, CommandCodeSession;
40044
+ var import_promises21, import_path18, import_crypto20, COMMAND_CODE_GRAMMAR_NAME, SILENT3, CommandCodeGrammar, SHELL_TOOL, STOP_TOOLS, REPORTED_STATUS, SHELL_STATUS, SWEEP_INTERVAL_MS, CommandCodeBackgroundTasks, EXITED_WITHOUT_RESULT2, CommandCodeTurn, COMMAND_CODE_MAX_TURNS, DEFAULTS7, CommandCodeSession;
39968
40045
  var init_command_code = __esm({
39969
40046
  "../agent-core/dist/providers/command-code.js"() {
39970
40047
  "use strict";
39971
- init_chunk_4LDW3FJB();
40048
+ init_chunk_U4RQE7JS();
39972
40049
  init_chunk_AF3IPGDT();
39973
- init_chunk_ZCTKXKYY();
40050
+ init_chunk_WYNUYKKN();
39974
40051
  init_chunk_KVTSAS2T();
39975
- init_chunk_DLVRNIY5();
40052
+ init_chunk_7FJ7QKFN();
39976
40053
  init_chunk_OSECDZA5();
39977
40054
  init_chunk_YXWJW7I5();
39978
40055
  import_promises21 = require("fs/promises");
39979
- import_path17 = require("path");
40056
+ import_path18 = require("path");
39980
40057
  init_agent2();
39981
40058
  init_runtime_v2();
39982
40059
  init_acp();
@@ -49776,13 +49853,14 @@ function decodeUtf8(bytes, path) {
49776
49853
  throw new SkillPackageError("INVALID_FRONTMATTER", `${path} must be valid UTF-8`, path);
49777
49854
  }
49778
49855
  }
49856
+ var MARKDOWN_LINK_TARGET = /\]\(<?([^\s)>\]]+)>?(?=[\s)])/g;
49779
49857
  function collectDiagnostics(skillMarkdown, license, packagePaths) {
49780
49858
  if (!skillMarkdown)
49781
49859
  return [];
49782
49860
  const diagnostics = [];
49783
49861
  const markdown = decodeUtf8(skillMarkdown, "SKILL.md");
49784
49862
  const references = /* @__PURE__ */ new Set();
49785
- for (const match of markdown.matchAll(/\]\(<?([^\s)>]+)>?(?:\s+[^)]*)?\)/g)) {
49863
+ for (const match of markdown.matchAll(MARKDOWN_LINK_TARGET)) {
49786
49864
  const reference = normalizePackageReference(match[1]);
49787
49865
  if (reference && looksLikeFileReference(reference))
49788
49866
  references.add(reference);
@@ -49983,22 +50061,21 @@ async function resolveSkillInvocations(layout, invocations, baked = "any") {
49983
50061
  }
49984
50062
  return missing.length === 0 ? { kind: "resolved", skills: resolved } : { kind: "missing", names: missing };
49985
50063
  }
49986
- async function availableSkillIndex(layout) {
50064
+ async function nativeCandidates(layout) {
50065
+ const nativeDir = layout.nativeDir;
50066
+ if (nativeDir === null) return [];
50067
+ const entries = await (0, import_promises27.readdir)(nativeDir, { withFileTypes: true }).catch(() => []);
50068
+ return entries.filter((entry) => entry.isDirectory() || entry.isSymbolicLink()).map((entry) => ({ directory: (0, import_node_path13.join)(nativeDir, entry.name) }));
50069
+ }
50070
+ async function availableSkillIndex(layout, sources = { synced: true, native: true }) {
49987
50071
  const found = /* @__PURE__ */ new Map();
49988
- const candidates2 = [];
49989
- for (const skill of await readInstalledSkills(layout)) {
49990
- candidates2.push({
49991
- directory: packageDirectory(layout, skill.versionId),
49992
- contentHash: skill.contentHash
49993
- });
49994
- }
49995
- if (layout.nativeDir !== null) {
49996
- const entries = await (0, import_promises27.readdir)(layout.nativeDir, { withFileTypes: true }).catch(() => []);
49997
- for (const entry of entries) {
49998
- if (entry.isDirectory() || entry.isSymbolicLink())
49999
- candidates2.push({ directory: (0, import_node_path13.join)(layout.nativeDir, entry.name) });
50000
- }
50001
- }
50072
+ const installed = await readInstalledSkills(layout);
50073
+ const synced = sources.synced ? installed.map((skill) => ({
50074
+ directory: packageDirectory(layout, skill.versionId),
50075
+ contentHash: skill.contentHash
50076
+ })) : [];
50077
+ const shadowed = new Set(sources.synced ? [] : installed.map((skill) => skill.slug));
50078
+ const candidates2 = [...synced, ...sources.native ? await nativeCandidates(layout) : []];
50002
50079
  const bounded = candidates2.slice(0, 2e3);
50003
50080
  for (let start = 0; start < bounded.length; start += INDEX_CONCURRENCY) {
50004
50081
  const batch = bounded.slice(start, start + INDEX_CONCURRENCY);
@@ -50006,7 +50083,8 @@ async function availableSkillIndex(layout) {
50006
50083
  batch.map((candidate) => inspectIndexedSkill(candidate.directory, candidate.contentHash))
50007
50084
  );
50008
50085
  for (const skill of inspected) {
50009
- if (skill !== null && !found.has(skill.name)) found.set(skill.name, skill);
50086
+ if (skill !== null && !found.has(skill.name) && !shadowed.has(skill.name))
50087
+ found.set(skill.name, skill);
50010
50088
  }
50011
50089
  }
50012
50090
  return [...found.values()].sort((a, b) => a.name.localeCompare(b.name));
@@ -50628,7 +50706,7 @@ var import_promises33 = require("fs/promises");
50628
50706
  var import_node_path21 = require("path");
50629
50707
 
50630
50708
  // ../agent-core/dist/prompt.js
50631
- init_chunk_DLVRNIY5();
50709
+ init_chunk_7FJ7QKFN();
50632
50710
 
50633
50711
  // src/holder/agent-context.ts
50634
50712
  async function readText2(path) {
@@ -51091,13 +51169,38 @@ async function admitDefaultWorkspace(spec, context, skills) {
51091
51169
  );
51092
51170
  }
51093
51171
  }
51172
+ async function selfListedSkills(spec, context) {
51173
+ const pointed = context.skills !== void 0 && installedSkillFolders(context.skills) !== null;
51174
+ switch (spec.backendKind) {
51175
+ case "claude_cli":
51176
+ return {
51177
+ synced: pointed && await (context.discovery?.claudeLoadsPlugins() ?? false),
51178
+ native: false
51179
+ };
51180
+ case "codex_app_server":
51181
+ return {
51182
+ synced: pointed && context.discovery?.codexLinksSyncedSkills === true,
51183
+ native: true
51184
+ };
51185
+ case ALAN_CODE_BACKEND:
51186
+ case "opencode_serve":
51187
+ return { synced: pointed, native: true };
51188
+ default:
51189
+ return { synced: false, native: false };
51190
+ }
51191
+ }
51094
51192
  async function withInstalledCloudSkills(spec, context) {
51095
51193
  if (!spec.sandboxId && !spec.cloudEnvironmentId || context.skills === void 0) return spec;
51194
+ const listed = await selfListedSkills(spec, context);
51195
+ if (listed.synced && listed.native) return spec;
51096
51196
  return {
51097
51197
  ...spec,
51098
51198
  promptContext: {
51099
51199
  ...spec.promptContext,
51100
- availableSkills: await availableSkillIndex(context.skills)
51200
+ availableSkills: await availableSkillIndex(context.skills, {
51201
+ synced: !listed.synced,
51202
+ native: !listed.native
51203
+ })
51101
51204
  }
51102
51205
  };
51103
51206
  }
@@ -51150,7 +51253,8 @@ function createHolderWorkspace(machine, clock, log) {
51150
51253
  platform
51151
51254
  });
51152
51255
  return approved.roots();
51153
- }
51256
+ },
51257
+ ...machine.skillDiscovery === void 0 ? {} : { discovery: machine.skillDiscovery }
51154
51258
  },
51155
51259
  ...machine.refreshesFirstCheckout === true ? {
51156
51260
  refreshFirstCheckout: createCheckoutRefresh({
@@ -52014,6 +52118,9 @@ var SECRET_VARIABLES = /* @__PURE__ */ new Set([
52014
52118
  ENROLLMENT_CODE_VARIABLE
52015
52119
  ]);
52016
52120
  var ALAN_CODE_ENGINE_VARIABLE = "ALAN_CODE_ENGINE_PATH";
52121
+ function codexSkillsDir(config2) {
52122
+ return config2.gitGatewayUrl === null ? null : (0, import_node_path32.join)(config2.codexHome, "skills");
52123
+ }
52017
52124
  function loadRuntimeConfig(env = process.env) {
52018
52125
  const parsed = envSchema.safeParse(env);
52019
52126
  if (!parsed.success) {
@@ -52270,6 +52377,7 @@ async function runHold(argv) {
52270
52377
  [ALAN_MCP_URL_ENV]: access3.managedMcp.url,
52271
52378
  [ALAN_MCP_CREDENTIAL_FILE_ENV]: credentialPath
52272
52379
  };
52380
+ const flags = createFlagProbe();
52273
52381
  await runHolder({
52274
52382
  launch: launch.value,
52275
52383
  driver: createProviderDrivers({
@@ -52288,7 +52396,11 @@ async function runHold(argv) {
52288
52396
  env: cliEnvironment,
52289
52397
  stateDir: paths.stateDir,
52290
52398
  // Only a cloud sandbox's runtime has a git gateway.
52291
- refreshesFirstCheckout: config2.gitGatewayUrl !== null
52399
+ refreshesFirstCheckout: config2.gitGatewayUrl !== null,
52400
+ skillDiscovery: {
52401
+ codexLinksSyncedSkills: codexSkillsDir(config2) !== null,
52402
+ claudeLoadsPlugins: () => flags.supportsFlag("claude", "--plugin-dir", cliEnvironment)
52403
+ }
52292
52404
  }
52293
52405
  });
52294
52406
  } catch (_) {