@alan-ai-hq/agent-manager-linux-arm64 0.1.166 → 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-agent.cjs +883 -664
- package/alan-holder.cjs +230 -140
- package/package.json +1 -1
package/alan-holder.cjs
CHANGED
|
@@ -22957,7 +22957,7 @@ You are a product UI designer and frontend interaction specialist. When identify
|
|
|
22957
22957
|
|
|
22958
22958
|
## Taste Skill (premium frontends)
|
|
22959
22959
|
|
|
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
|
|
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\`.
|
|
22961
22961
|
|
|
22962
22962
|
## How to approach the work
|
|
22963
22963
|
|
|
@@ -24801,7 +24801,7 @@ var init_chunk_AF3IPGDT = __esm({
|
|
|
24801
24801
|
}
|
|
24802
24802
|
});
|
|
24803
24803
|
|
|
24804
|
-
// ../agent-core/dist/chunk-
|
|
24804
|
+
// ../agent-core/dist/chunk-WYNUYKKN.js
|
|
24805
24805
|
function readCapReset(text2) {
|
|
24806
24806
|
const epoch = EPOCH_RESET.exec(text2);
|
|
24807
24807
|
if (epoch) return { resetsAt: new Date(Number(epoch[1]) * 1e3).toISOString() };
|
|
@@ -24842,7 +24842,8 @@ function prefixStatus(text2) {
|
|
|
24842
24842
|
return match ? Number(match[1]) : void 0;
|
|
24843
24843
|
}
|
|
24844
24844
|
function errorType(outer, inner) {
|
|
24845
|
-
const
|
|
24845
|
+
const flatCode = asString(outer.error);
|
|
24846
|
+
const type = asString(inner.type) || asString(outer.type) || (ERROR_CODE_SHAPE.test(flatCode) ? flatCode : "");
|
|
24846
24847
|
return type && type !== "error" ? type : void 0;
|
|
24847
24848
|
}
|
|
24848
24849
|
function readProviderErrorDetail(text2) {
|
|
@@ -24927,7 +24928,8 @@ function statusKind(status) {
|
|
|
24927
24928
|
}
|
|
24928
24929
|
function mapProviderApiError(errorCode, apiStatus) {
|
|
24929
24930
|
if (apiStatus === 403) return "access_denied";
|
|
24930
|
-
if (apiStatus === 402)
|
|
24931
|
+
if (apiStatus === 402)
|
|
24932
|
+
return GATEWAY_402_KINDS.get(errorCode?.trim().toLowerCase() ?? "") ?? "payment_required";
|
|
24931
24933
|
if (apiStatus === 401) return "auth_invalid";
|
|
24932
24934
|
const code = errorCode?.trim().toLowerCase();
|
|
24933
24935
|
const byCode = code ? CODE_RULES.find((rule) => rule.pattern.test(code))?.kind : void 0;
|
|
@@ -24941,8 +24943,8 @@ function classifyProviderApiError(input2) {
|
|
|
24941
24943
|
if (fromText && TEXT_REFINES[structured]?.has(fromText.errorKind)) return fromText;
|
|
24942
24944
|
return specForErrorKind(structured);
|
|
24943
24945
|
}
|
|
24944
|
-
function withPaymentRemedy(classified, message) {
|
|
24945
|
-
if (classified.errorKind !== "payment_required") return classified;
|
|
24946
|
+
function withPaymentRemedy(classified, message, status) {
|
|
24947
|
+
if (classified.errorKind !== "payment_required" && status !== 402) return classified;
|
|
24946
24948
|
const remedy = message.replace(STATUS_LEAD, "").trim();
|
|
24947
24949
|
return remedy ? { ...classified, message: remedy.slice(0, 300) } : classified;
|
|
24948
24950
|
}
|
|
@@ -24955,7 +24957,7 @@ function classifyProviderError(text2, hints = {}) {
|
|
|
24955
24957
|
...status === void 0 ? {} : { status },
|
|
24956
24958
|
text: detail.message
|
|
24957
24959
|
}) ?? classifyProviderTerminalText(text2);
|
|
24958
|
-
if (classified) return withPaymentRemedy(classified, detail.message);
|
|
24960
|
+
if (classified) return withPaymentRemedy(classified, detail.message, status);
|
|
24959
24961
|
const message = detail.message.slice(0, 200);
|
|
24960
24962
|
return message ? { message, errorKind: "unknown_cli_error", recoveryClass: "unknown" } : specForErrorKind("unknown_cli_error");
|
|
24961
24963
|
}
|
|
@@ -25007,9 +25009,9 @@ function createCliProblem(observed, options) {
|
|
|
25007
25009
|
...classified.resetsAt ? { resetsAt: classified.resetsAt } : {}
|
|
25008
25010
|
});
|
|
25009
25011
|
}
|
|
25010
|
-
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;
|
|
25011
|
-
var
|
|
25012
|
-
"../agent-core/dist/chunk-
|
|
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"() {
|
|
25013
25015
|
"use strict";
|
|
25014
25016
|
init_chunk_YXWJW7I5();
|
|
25015
25017
|
import_crypto = require("crypto");
|
|
@@ -25050,6 +25052,10 @@ var init_chunk_ZCTKXKYY = __esm({
|
|
|
25050
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.",
|
|
25051
25053
|
recoveryClass: "user_fixable"
|
|
25052
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
|
+
},
|
|
25053
25059
|
quota_exceeded: {
|
|
25054
25060
|
message: "API quota exceeded. Wait for it to reset or check your billing, then retry.",
|
|
25055
25061
|
recoveryClass: "user_fixable"
|
|
@@ -25136,6 +25142,7 @@ var init_chunk_ZCTKXKYY = __esm({
|
|
|
25136
25142
|
["command_code_cli", { name: "Command Code" }]
|
|
25137
25143
|
]);
|
|
25138
25144
|
STATUS_PREFIX = /\b(?:api error|status|http)[:\s]+(\d{3})\b/i;
|
|
25145
|
+
ERROR_CODE_SHAPE = /^[a-z][a-z0-9_]*$/;
|
|
25139
25146
|
TEXT_RULES = [
|
|
25140
25147
|
{ kind: "auth_expired", pattern: /\bcodex cli connection expired\b|\breconnect openai codex\b/ },
|
|
25141
25148
|
{ kind: "provider_timeout", pattern: /\bcodex connection to openai timed out\b/ },
|
|
@@ -25163,6 +25170,7 @@ var init_chunk_ZCTKXKYY = __esm({
|
|
|
25163
25170
|
kind: "quota_exceeded",
|
|
25164
25171
|
pattern: /\bcredit balance is too low\b|\binsufficient_quota\b/
|
|
25165
25172
|
},
|
|
25173
|
+
{ kind: "managed_models_paused", pattern: /\balan-managed models are paused\b/ },
|
|
25166
25174
|
{ kind: "subscription_required", pattern: /creditserror|\bno payment method\b/ },
|
|
25167
25175
|
{ kind: "model_mismatch", pattern: /datapolicyerror|\brequires explicit opt in\b/ },
|
|
25168
25176
|
// A cancelled turn can leave history the provider refuses on every later request: empty
|
|
@@ -25233,11 +25241,16 @@ var init_chunk_ZCTKXKYY = __esm({
|
|
|
25233
25241
|
kind: "context_length"
|
|
25234
25242
|
}
|
|
25235
25243
|
];
|
|
25244
|
+
GATEWAY_402_KINDS = /* @__PURE__ */ new Map([
|
|
25245
|
+
["quota_exceeded", "quota_exceeded"],
|
|
25246
|
+
["managed_models_paused", "managed_models_paused"]
|
|
25247
|
+
]);
|
|
25236
25248
|
TEXT_REFINES = {
|
|
25237
25249
|
rate_limited: /* @__PURE__ */ new Set(["usage_limit", "quota_exceeded"]),
|
|
25250
|
+
payment_required: /* @__PURE__ */ new Set(["usage_limit", "managed_models_paused"]),
|
|
25238
25251
|
auth_invalid: /* @__PURE__ */ new Set(["auth_expired", "not_logged_in", "not_authenticated"])
|
|
25239
25252
|
};
|
|
25240
|
-
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;
|
|
25241
25254
|
CLI_PROBLEM_CODE_BY_ERROR_KIND = {
|
|
25242
25255
|
model_mismatch: "cli.model.unavailable",
|
|
25243
25256
|
auth_invalid: "cli.auth.invalid",
|
|
@@ -25247,6 +25260,7 @@ var init_chunk_ZCTKXKYY = __esm({
|
|
|
25247
25260
|
auth_expired: "cli.auth.expired",
|
|
25248
25261
|
subscription_required: "cli.entitlement.required",
|
|
25249
25262
|
payment_required: "cli.entitlement.required",
|
|
25263
|
+
managed_models_paused: "cli.model.unavailable",
|
|
25250
25264
|
quota_exceeded: "cli.quota_exceeded",
|
|
25251
25265
|
usage_limit: "cli.quota_exceeded",
|
|
25252
25266
|
context_length: "cli.context_exhausted",
|
|
@@ -26096,7 +26110,7 @@ var init_chunk_KVTSAS2T = __esm({
|
|
|
26096
26110
|
}
|
|
26097
26111
|
});
|
|
26098
26112
|
|
|
26099
|
-
// ../agent-core/dist/chunk-
|
|
26113
|
+
// ../agent-core/dist/chunk-U4RQE7JS.js
|
|
26100
26114
|
function detectImageMimeType(buffer) {
|
|
26101
26115
|
if (buffer.length >= 8 && buffer.subarray(0, 8).equals(PNG_SIGNATURE)) return "image/png";
|
|
26102
26116
|
if (buffer.length >= 3 && buffer[0] === 255 && buffer[1] === 216 && buffer[2] === 255) {
|
|
@@ -26537,11 +26551,11 @@ function silentStartError(name, timeoutMs) {
|
|
|
26537
26551
|
};
|
|
26538
26552
|
}
|
|
26539
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;
|
|
26540
|
-
var
|
|
26541
|
-
"../agent-core/dist/chunk-
|
|
26554
|
+
var init_chunk_U4RQE7JS = __esm({
|
|
26555
|
+
"../agent-core/dist/chunk-U4RQE7JS.js"() {
|
|
26542
26556
|
"use strict";
|
|
26543
26557
|
init_chunk_AF3IPGDT();
|
|
26544
|
-
|
|
26558
|
+
init_chunk_WYNUYKKN();
|
|
26545
26559
|
init_chunk_KVTSAS2T();
|
|
26546
26560
|
init_chunk_YXWJW7I5();
|
|
26547
26561
|
import_crypto4 = require("crypto");
|
|
@@ -26923,15 +26937,15 @@ var init_chunk_4LDW3FJB = __esm({
|
|
|
26923
26937
|
var init_dist = __esm({
|
|
26924
26938
|
"../agent-core/dist/index.js"() {
|
|
26925
26939
|
"use strict";
|
|
26926
|
-
|
|
26940
|
+
init_chunk_U4RQE7JS();
|
|
26927
26941
|
init_chunk_AF3IPGDT();
|
|
26928
|
-
|
|
26942
|
+
init_chunk_WYNUYKKN();
|
|
26929
26943
|
init_chunk_KVTSAS2T();
|
|
26930
26944
|
init_chunk_YXWJW7I5();
|
|
26931
26945
|
}
|
|
26932
26946
|
});
|
|
26933
26947
|
|
|
26934
|
-
// ../agent-core/dist/chunk-
|
|
26948
|
+
// ../agent-core/dist/chunk-7FJ7QKFN.js
|
|
26935
26949
|
function repositories(input2, context) {
|
|
26936
26950
|
const problems = new Map(input2.problems.map((problem) => [problem.path, problem]));
|
|
26937
26951
|
const listed = context?.repositories ?? [];
|
|
@@ -27538,24 +27552,51 @@ function cloudExecutionSection(spec) {
|
|
|
27538
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."
|
|
27539
27553
|
);
|
|
27540
27554
|
}
|
|
27541
|
-
const skills = spec.promptContext?.availableSkills ?? [];
|
|
27542
27555
|
lines.push(
|
|
27543
27556
|
"## Installed skills",
|
|
27544
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."
|
|
27545
27558
|
);
|
|
27546
|
-
|
|
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) {
|
|
27547
27565
|
lines.push(
|
|
27548
|
-
|
|
27566
|
+
"No other installed skills were found. Do not assume a named skill is available unless your skill index lists it."
|
|
27549
27567
|
);
|
|
27550
27568
|
} else {
|
|
27551
|
-
|
|
27552
|
-
lines.push(
|
|
27553
|
-
`- ${JSON.stringify(skill.name)}: ${JSON.stringify(skill.description)} \u2014 ${JSON.stringify(`${skill.packageDirectory}/SKILL.md`)}`
|
|
27554
|
-
);
|
|
27555
|
-
}
|
|
27569
|
+
lines.push(...installedSkillLines(skills));
|
|
27556
27570
|
}
|
|
27557
27571
|
return lines.join("\n");
|
|
27558
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
|
+
}
|
|
27559
27600
|
function promptParts(input2) {
|
|
27560
27601
|
const { spec } = input2;
|
|
27561
27602
|
const overlay = teamOverlay(spec);
|
|
@@ -27633,12 +27674,13 @@ function buildTurnText(input2) {
|
|
|
27633
27674
|
${body}` : body;
|
|
27634
27675
|
return spec.mode === "plan" ? planModePrefix(prefixed) : prefixed;
|
|
27635
27676
|
}
|
|
27636
|
-
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;
|
|
27637
|
-
var
|
|
27638
|
-
"../agent-core/dist/chunk-
|
|
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"() {
|
|
27639
27680
|
"use strict";
|
|
27640
27681
|
init_runtime_v2();
|
|
27641
27682
|
init_zod();
|
|
27683
|
+
import_path5 = require("path");
|
|
27642
27684
|
init_agent2();
|
|
27643
27685
|
startCommandStateSchema = external_exports.discriminatedUnion("state", [
|
|
27644
27686
|
external_exports.object({ state: external_exports.literal("not_configured") }),
|
|
@@ -27738,6 +27780,8 @@ var init_chunk_DLVRNIY5 = __esm({
|
|
|
27738
27780
|
"ask",
|
|
27739
27781
|
"review"
|
|
27740
27782
|
]);
|
|
27783
|
+
INSTALLED_SKILLS_MAX_CHARS = 8e3;
|
|
27784
|
+
INSTALLED_SKILL_DESCRIPTION_MAX_CHARS = 200;
|
|
27741
27785
|
}
|
|
27742
27786
|
});
|
|
27743
27787
|
|
|
@@ -27831,8 +27875,8 @@ function canonicalizeManagedMcpToolName(toolName) {
|
|
|
27831
27875
|
return flattened ? `mcp__${MANAGED_MCP_SERVER_NAME}__${flattened[1]}` : toolName;
|
|
27832
27876
|
}
|
|
27833
27877
|
async function writeSecretFile(name, contents) {
|
|
27834
|
-
const dir = await (0, import_promises13.mkdtemp)((0,
|
|
27835
|
-
const path = (0,
|
|
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);
|
|
27836
27880
|
const remove = async () => {
|
|
27837
27881
|
await (0, import_promises13.rm)(dir, { recursive: true, force: true });
|
|
27838
27882
|
};
|
|
@@ -27844,7 +27888,7 @@ async function writeSecretFile(name, contents) {
|
|
|
27844
27888
|
}
|
|
27845
27889
|
return { path, remove, [Symbol.asyncDispose]: remove };
|
|
27846
27890
|
}
|
|
27847
|
-
var import_crypto5, import_crypto6, import_promises13, import_os2,
|
|
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;
|
|
27848
27892
|
var init_chunk_OSECDZA5 = __esm({
|
|
27849
27893
|
"../agent-core/dist/chunk-OSECDZA5.js"() {
|
|
27850
27894
|
"use strict";
|
|
@@ -27855,7 +27899,7 @@ var init_chunk_OSECDZA5 = __esm({
|
|
|
27855
27899
|
init_runtime_v2();
|
|
27856
27900
|
import_promises13 = require("fs/promises");
|
|
27857
27901
|
import_os2 = require("os");
|
|
27858
|
-
|
|
27902
|
+
import_path6 = require("path");
|
|
27859
27903
|
OPENCODE_CODE_MODE_ENV = "OPENCODE_EXPERIMENTAL_CODE_MODE";
|
|
27860
27904
|
OPENCODE_CODE_MODE_TOOL = "execute";
|
|
27861
27905
|
CODE_MODE_CALLS_META = "alanToolCalls";
|
|
@@ -28101,16 +28145,16 @@ function classifyAcpError(error62) {
|
|
|
28101
28145
|
return classifyAcpText(acpErrorText(error62));
|
|
28102
28146
|
}
|
|
28103
28147
|
function within(root, path) {
|
|
28104
|
-
const rel = (0,
|
|
28105
|
-
return rel === "" || !rel.startsWith(`..${
|
|
28148
|
+
const rel = (0, import_path7.relative)(root, path);
|
|
28149
|
+
return rel === "" || !rel.startsWith(`..${import_path7.sep}`) && rel !== ".." && !(0, import_path7.isAbsolute)(rel);
|
|
28106
28150
|
}
|
|
28107
28151
|
async function resolveReal(path) {
|
|
28108
28152
|
try {
|
|
28109
28153
|
return await (0, import_promises14.realpath)(path);
|
|
28110
28154
|
} catch {
|
|
28111
|
-
const parent = (0,
|
|
28155
|
+
const parent = (0, import_path7.dirname)(path);
|
|
28112
28156
|
if (parent === path) return path;
|
|
28113
|
-
return (0,
|
|
28157
|
+
return (0, import_path7.join)(await resolveReal(parent), (0, import_path7.basename)(path));
|
|
28114
28158
|
}
|
|
28115
28159
|
}
|
|
28116
28160
|
function sliceLines(text2, params) {
|
|
@@ -28125,7 +28169,7 @@ function createWorkspaceFs(roots, writable) {
|
|
|
28125
28169
|
const realRoots = Promise.all(roots.map((root) => resolveReal(root)));
|
|
28126
28170
|
const confined = async (params) => {
|
|
28127
28171
|
const path = asString(params.path);
|
|
28128
|
-
if (!(0,
|
|
28172
|
+
if (!(0, import_path7.isAbsolute)(path)) throw new FsDenied(`fs path must be absolute: ${path || "(empty)"}`);
|
|
28129
28173
|
const real = await resolveReal(path);
|
|
28130
28174
|
if (!(await realRoots).some((root) => within(root, real))) {
|
|
28131
28175
|
throw new FsDenied(`${path} is outside the session's workspace`);
|
|
@@ -28754,19 +28798,19 @@ async function acpTurnInput(run, context) {
|
|
|
28754
28798
|
...encoded.length ? { images: encoded, imagePaths: images.map((image) => image.path) } : {}
|
|
28755
28799
|
};
|
|
28756
28800
|
}
|
|
28757
|
-
var import_promises14,
|
|
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;
|
|
28758
28802
|
var init_acp2 = __esm({
|
|
28759
28803
|
"../agent-core/dist/providers/acp.js"() {
|
|
28760
28804
|
"use strict";
|
|
28761
|
-
|
|
28805
|
+
init_chunk_U4RQE7JS();
|
|
28762
28806
|
init_chunk_AF3IPGDT();
|
|
28763
|
-
|
|
28807
|
+
init_chunk_WYNUYKKN();
|
|
28764
28808
|
init_chunk_KVTSAS2T();
|
|
28765
|
-
|
|
28809
|
+
init_chunk_7FJ7QKFN();
|
|
28766
28810
|
init_chunk_OSECDZA5();
|
|
28767
28811
|
init_chunk_YXWJW7I5();
|
|
28768
28812
|
import_promises14 = require("fs/promises");
|
|
28769
|
-
|
|
28813
|
+
import_path7 = require("path");
|
|
28770
28814
|
init_effort();
|
|
28771
28815
|
init_acp();
|
|
28772
28816
|
import_crypto7 = require("crypto");
|
|
@@ -29637,7 +29681,7 @@ var init_acp3 = __esm({
|
|
|
29637
29681
|
var init_classify = __esm({
|
|
29638
29682
|
"../agent-core/dist/classify.js"() {
|
|
29639
29683
|
"use strict";
|
|
29640
|
-
|
|
29684
|
+
init_chunk_WYNUYKKN();
|
|
29641
29685
|
init_chunk_YXWJW7I5();
|
|
29642
29686
|
}
|
|
29643
29687
|
});
|
|
@@ -30352,7 +30396,7 @@ function alanCodeEngineBinary(platform) {
|
|
|
30352
30396
|
return platform === "win32" ? "opencode.exe" : "opencode";
|
|
30353
30397
|
}
|
|
30354
30398
|
function packagedAlanCodeEnginePath(bundle, platform) {
|
|
30355
|
-
return (0,
|
|
30399
|
+
return (0, import_path8.join)((0, import_path8.dirname)(bundle), "..", "engine", alanCodeEngineBinary(platform));
|
|
30356
30400
|
}
|
|
30357
30401
|
function isRunnableFile(path, platform) {
|
|
30358
30402
|
try {
|
|
@@ -30554,13 +30598,13 @@ export const AlanEnginePlugin = async () => ({
|
|
|
30554
30598
|
`;
|
|
30555
30599
|
}
|
|
30556
30600
|
function alanCodeEngineRoot(home) {
|
|
30557
|
-
return (0,
|
|
30601
|
+
return (0, import_path9.join)(home, ".alan", "alan-code", "engine");
|
|
30558
30602
|
}
|
|
30559
30603
|
function alanCodeEngineDirectories(root) {
|
|
30560
30604
|
return {
|
|
30561
|
-
XDG_DATA_HOME: (0,
|
|
30562
|
-
XDG_STATE_HOME: (0,
|
|
30563
|
-
XDG_CACHE_HOME: (0,
|
|
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")
|
|
30564
30608
|
};
|
|
30565
30609
|
}
|
|
30566
30610
|
function bearerToken(authorization) {
|
|
@@ -30576,8 +30620,8 @@ function alanCodeEngineEnv(input2) {
|
|
|
30576
30620
|
};
|
|
30577
30621
|
}
|
|
30578
30622
|
function openCodeGlobalConfigDirectory(env, home) {
|
|
30579
|
-
const configHome = env.XDG_CONFIG_HOME?.trim() || (0,
|
|
30580
|
-
return (0,
|
|
30623
|
+
const configHome = env.XDG_CONFIG_HOME?.trim() || (0, import_path9.join)(home, ".config");
|
|
30624
|
+
return (0, import_path9.join)(configHome, "opencode");
|
|
30581
30625
|
}
|
|
30582
30626
|
function stripJsonc(text2) {
|
|
30583
30627
|
let out = "";
|
|
@@ -30636,7 +30680,7 @@ function parseJsonc(text2) {
|
|
|
30636
30680
|
async function inheritedMcpServerNames(configDirectory) {
|
|
30637
30681
|
const names = /* @__PURE__ */ new Set();
|
|
30638
30682
|
for (const file2 of ["config.json", "opencode.json", "opencode.jsonc"]) {
|
|
30639
|
-
const text2 = await (0, import_promises16.readFile)((0,
|
|
30683
|
+
const text2 = await (0, import_promises16.readFile)((0, import_path9.join)(configDirectory, file2), "utf8").catch(() => null);
|
|
30640
30684
|
if (text2 === null) continue;
|
|
30641
30685
|
const parsed = parseJsonc(text2);
|
|
30642
30686
|
const mcp = parsed !== null && typeof parsed === "object" ? parsed.mcp : void 0;
|
|
@@ -30648,7 +30692,7 @@ async function inheritedMcpServerNames(configDirectory) {
|
|
|
30648
30692
|
}
|
|
30649
30693
|
async function writePlugin(directory, apiOrigin) {
|
|
30650
30694
|
const origin = (0, import_crypto8.createHash)("sha256").update(apiOrigin).digest("hex").slice(0, 12);
|
|
30651
|
-
const target = (0,
|
|
30695
|
+
const target = (0, import_path9.join)(directory, `engine-plugin-v${ALAN_CODE_ENGINE_PLUGIN_VERSION}-${origin}.mjs`);
|
|
30652
30696
|
const temporary = `${target}.${(0, import_crypto8.randomUUID)()}.tmp`;
|
|
30653
30697
|
await (0, import_promises16.mkdir)(directory, { recursive: true, mode: 448 });
|
|
30654
30698
|
await (0, import_promises16.writeFile)(temporary, alanCodeEnginePluginSource(apiOrigin), { mode: 384 });
|
|
@@ -30661,7 +30705,7 @@ async function prepareAlanCodeProfile(input2) {
|
|
|
30661
30705
|
directories.map((directory) => (0, import_promises16.mkdir)(directory, { recursive: true, mode: 448 }))
|
|
30662
30706
|
);
|
|
30663
30707
|
const [pluginUrl, models, inheritedMcpServers] = await Promise.all([
|
|
30664
|
-
writePlugin((0,
|
|
30708
|
+
writePlugin((0, import_path9.join)(input2.engineRoot, "plugin"), input2.access.apiOrigin),
|
|
30665
30709
|
(input2.loadModels ?? fetchAlanCodeModels)(input2.access),
|
|
30666
30710
|
input2.globalConfigDirectory === void 0 ? Promise.resolve([]) : inheritedMcpServerNames(input2.globalConfigDirectory)
|
|
30667
30711
|
]);
|
|
@@ -30683,7 +30727,7 @@ function alanCodeSystemPrompt(alanSystemPrompt) {
|
|
|
30683
30727
|
|
|
30684
30728
|
${instructions}` : ALAN_CODE_TOOL_NAMING_PROMPT;
|
|
30685
30729
|
}
|
|
30686
|
-
var import_http3, import_https, import_fs6,
|
|
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;
|
|
30687
30731
|
var init_alan_code = __esm({
|
|
30688
30732
|
"../agent-core/dist/providers/alan-code.js"() {
|
|
30689
30733
|
"use strict";
|
|
@@ -30695,11 +30739,11 @@ var init_alan_code = __esm({
|
|
|
30695
30739
|
init_runtime_v2();
|
|
30696
30740
|
init_models();
|
|
30697
30741
|
import_fs6 = require("fs");
|
|
30698
|
-
|
|
30742
|
+
import_path8 = require("path");
|
|
30699
30743
|
init_runtime_v2();
|
|
30700
30744
|
import_crypto8 = require("crypto");
|
|
30701
30745
|
import_promises16 = require("fs/promises");
|
|
30702
|
-
|
|
30746
|
+
import_path9 = require("path");
|
|
30703
30747
|
import_url = require("url");
|
|
30704
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";
|
|
30705
30749
|
ALAN_CODE_ENGINE_PROVIDER_ID = "alan";
|
|
@@ -31071,7 +31115,7 @@ function notice(kind, message) {
|
|
|
31071
31115
|
function promptParts2(input2) {
|
|
31072
31116
|
const files = (input2.imagePaths ?? []).map((path, index) => ({
|
|
31073
31117
|
type: "file",
|
|
31074
|
-
mime: input2.images?.[index]?.mimeType ?? IMAGE_TYPES[(0,
|
|
31118
|
+
mime: input2.images?.[index]?.mimeType ?? IMAGE_TYPES[(0, import_path11.extname)(path).toLowerCase()] ?? "application/octet-stream",
|
|
31075
31119
|
filename: path.split(/[\\/]/).at(-1) ?? path,
|
|
31076
31120
|
url: (0, import_url2.pathToFileURL)(path).href
|
|
31077
31121
|
}));
|
|
@@ -31194,7 +31238,7 @@ async function canonicalDirectory(directory) {
|
|
|
31194
31238
|
try {
|
|
31195
31239
|
return await (0, import_promises17.realpath)(directory);
|
|
31196
31240
|
} catch {
|
|
31197
|
-
return (0,
|
|
31241
|
+
return (0, import_path10.resolve)(directory);
|
|
31198
31242
|
}
|
|
31199
31243
|
}
|
|
31200
31244
|
async function openSession(session, client, spec, log) {
|
|
@@ -31294,9 +31338,9 @@ function createOpenCodeDriver(options = {}) {
|
|
|
31294
31338
|
const spec = { ...planned, env: launchEnv(planned, authorization) };
|
|
31295
31339
|
const password = options.password?.() ?? (0, import_crypto10.randomBytes)(24).toString("base64url");
|
|
31296
31340
|
try {
|
|
31297
|
-
const data = spec.env.XDG_DATA_HOME ?? (0,
|
|
31341
|
+
const data = spec.env.XDG_DATA_HOME ?? (0, import_path10.join)(spec.env.HOME ?? spec.env.USERPROFILE ?? spec.cwd, ".local", "share");
|
|
31298
31342
|
const session = await withStartupLock(
|
|
31299
|
-
(0,
|
|
31343
|
+
(0, import_path10.join)(data, "opencode", ".alan-startup.lock"),
|
|
31300
31344
|
resolved.clock,
|
|
31301
31345
|
() => openWithRetries(spec, password, resolved)
|
|
31302
31346
|
);
|
|
@@ -31394,15 +31438,15 @@ function openCodeTurnInput(run, context) {
|
|
|
31394
31438
|
...context.attachments.length ? { readableFiles: context.attachments.map((attachment) => attachment.path) } : {}
|
|
31395
31439
|
};
|
|
31396
31440
|
}
|
|
31397
|
-
var import_crypto9, import_http4, import_crypto10, import_promises17,
|
|
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;
|
|
31398
31442
|
var init_opencode = __esm({
|
|
31399
31443
|
"../agent-core/dist/providers/opencode.js"() {
|
|
31400
31444
|
"use strict";
|
|
31401
|
-
|
|
31445
|
+
init_chunk_U4RQE7JS();
|
|
31402
31446
|
init_chunk_AF3IPGDT();
|
|
31403
|
-
|
|
31447
|
+
init_chunk_WYNUYKKN();
|
|
31404
31448
|
init_chunk_KVTSAS2T();
|
|
31405
|
-
|
|
31449
|
+
init_chunk_7FJ7QKFN();
|
|
31406
31450
|
init_chunk_OSECDZA5();
|
|
31407
31451
|
init_chunk_YXWJW7I5();
|
|
31408
31452
|
import_crypto9 = require("crypto");
|
|
@@ -31410,12 +31454,12 @@ var init_opencode = __esm({
|
|
|
31410
31454
|
init_runtime_v2();
|
|
31411
31455
|
import_crypto10 = require("crypto");
|
|
31412
31456
|
import_promises17 = require("fs/promises");
|
|
31413
|
-
import_path9 = require("path");
|
|
31414
|
-
init_agent2();
|
|
31415
31457
|
import_path10 = require("path");
|
|
31458
|
+
init_agent2();
|
|
31459
|
+
import_path11 = require("path");
|
|
31416
31460
|
import_url2 = require("url");
|
|
31417
31461
|
init_acp();
|
|
31418
|
-
|
|
31462
|
+
import_path12 = require("path");
|
|
31419
31463
|
init_acp();
|
|
31420
31464
|
init_constants();
|
|
31421
31465
|
import_crypto11 = require("crypto");
|
|
@@ -32053,7 +32097,7 @@ var init_opencode = __esm({
|
|
|
32053
32097
|
this.#readOnly = readOnly;
|
|
32054
32098
|
this.#memory = memory;
|
|
32055
32099
|
this.#engine = engine;
|
|
32056
|
-
this.#readableFiles = new Set(readableFiles.map((path) => (0,
|
|
32100
|
+
this.#readableFiles = new Set(readableFiles.map((path) => (0, import_path12.normalize)(path)));
|
|
32057
32101
|
}
|
|
32058
32102
|
get childSessionIds() {
|
|
32059
32103
|
return [...this.#children.keys()];
|
|
@@ -32293,7 +32337,7 @@ var init_opencode = __esm({
|
|
|
32293
32337
|
#opensAttachment(kind, properties) {
|
|
32294
32338
|
if (kind !== "external_directory") return false;
|
|
32295
32339
|
const filepath = asString(asRecord(properties.metadata)?.filepath);
|
|
32296
|
-
return (0,
|
|
32340
|
+
return (0, import_path12.isAbsolute)(filepath) && this.#readableFiles.has((0, import_path12.normalize)(filepath));
|
|
32297
32341
|
}
|
|
32298
32342
|
#question(properties) {
|
|
32299
32343
|
const requestId = asString(properties.id).trim();
|
|
@@ -33066,6 +33110,14 @@ function modelArgs(input2) {
|
|
|
33066
33110
|
effort: option("--effort", effort)
|
|
33067
33111
|
};
|
|
33068
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
|
+
}
|
|
33069
33121
|
function buildClaudeArgs(input2) {
|
|
33070
33122
|
const { capabilities } = input2;
|
|
33071
33123
|
const disallowed = input2.disallowedTools?.length ? input2.disallowedTools.join(",") : void 0;
|
|
@@ -33090,6 +33142,7 @@ function buildClaudeArgs(input2) {
|
|
|
33090
33142
|
// Without it the whole answer lands in one frame at turn end.
|
|
33091
33143
|
...capabilities.supportsPartialMessages ? ["--include-partial-messages"] : [],
|
|
33092
33144
|
...capabilities.supportsPluginDir ? (input2.pluginDirs ?? []).flatMap((dir) => ["--plugin-dir", dir]) : [],
|
|
33145
|
+
...skillListingArgs(input2),
|
|
33093
33146
|
...option("--resume", input2.resumeId),
|
|
33094
33147
|
"--chrome",
|
|
33095
33148
|
...input2.extraArgs ?? []
|
|
@@ -33977,7 +34030,7 @@ function createClaudeDriver(options = {}) {
|
|
|
33977
34030
|
};
|
|
33978
34031
|
}
|
|
33979
34032
|
function claudeHomeFor(env, homeDir) {
|
|
33980
|
-
return env.CLAUDE_CONFIG_DIR || (0,
|
|
34033
|
+
return env.CLAUDE_CONFIG_DIR || (0, import_path13.join)(env.HOME || homeDir, ".claude");
|
|
33981
34034
|
}
|
|
33982
34035
|
function encodeProjectDir(cwd) {
|
|
33983
34036
|
return cwd.replace(/[^a-zA-Z0-9]/g, "-");
|
|
@@ -33998,14 +34051,14 @@ function projectDirs(projectsRoot) {
|
|
|
33998
34051
|
}
|
|
33999
34052
|
function claudeSessionLogExists(query) {
|
|
34000
34053
|
if (!query.sessionId || !query.cwd) return false;
|
|
34001
|
-
const projectsRoot = (0,
|
|
34054
|
+
const projectsRoot = (0, import_path13.join)(query.claudeHome, "projects");
|
|
34002
34055
|
const fileName = `${query.sessionId}.jsonl`;
|
|
34003
34056
|
const here = new Set([query.cwd, realCwd(query.cwd)].map(encodeProjectDir));
|
|
34004
34057
|
for (const dir of here) {
|
|
34005
|
-
if ((0, import_fs8.existsSync)((0,
|
|
34058
|
+
if ((0, import_fs8.existsSync)((0, import_path13.join)(projectsRoot, dir, fileName))) return true;
|
|
34006
34059
|
}
|
|
34007
34060
|
return projectDirs(projectsRoot).some(
|
|
34008
|
-
(dir) => !here.has(dir) && (0, import_fs8.existsSync)((0,
|
|
34061
|
+
(dir) => !here.has(dir) && (0, import_fs8.existsSync)((0, import_path13.join)(projectsRoot, dir, fileName))
|
|
34009
34062
|
);
|
|
34010
34063
|
}
|
|
34011
34064
|
function envDigest3(env) {
|
|
@@ -34034,6 +34087,7 @@ function planClaudeSession(run, context) {
|
|
|
34034
34087
|
...prompts.systemPrompt === void 0 ? {} : { systemPrompt: prompts.systemPrompt },
|
|
34035
34088
|
...prompts.systemPromptAppend === void 0 ? {} : { appendSystemPrompt: prompts.systemPromptAppend },
|
|
34036
34089
|
...context.pluginDirs?.length ? { pluginDirs: context.pluginDirs } : {},
|
|
34090
|
+
...run.sandboxId || run.cloudEnvironmentId ? { skillListingMaxDescChars: CLOUD_SKILL_LISTING_MAX_DESCRIPTION_CHARS } : {},
|
|
34037
34091
|
...context.managedMcp === void 0 ? {} : {
|
|
34038
34092
|
mcp: {
|
|
34039
34093
|
alanMcpUrl: context.managedMcp.url,
|
|
@@ -34078,16 +34132,16 @@ async function claudeTurnInput(run, context) {
|
|
|
34078
34132
|
);
|
|
34079
34133
|
return { turnId: run.runId, text: text2, ...encoded.length ? { images: encoded } : {} };
|
|
34080
34134
|
}
|
|
34081
|
-
var import_crypto12, import_fs8,
|
|
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;
|
|
34082
34136
|
var init_claude = __esm({
|
|
34083
34137
|
"../agent-core/dist/providers/claude.js"() {
|
|
34084
34138
|
"use strict";
|
|
34085
34139
|
init_chunk_VUWLTOVK();
|
|
34086
|
-
|
|
34140
|
+
init_chunk_U4RQE7JS();
|
|
34087
34141
|
init_chunk_AF3IPGDT();
|
|
34088
|
-
|
|
34142
|
+
init_chunk_WYNUYKKN();
|
|
34089
34143
|
init_chunk_KVTSAS2T();
|
|
34090
|
-
|
|
34144
|
+
init_chunk_7FJ7QKFN();
|
|
34091
34145
|
init_chunk_OSECDZA5();
|
|
34092
34146
|
init_chunk_YXWJW7I5();
|
|
34093
34147
|
init_effort();
|
|
@@ -34099,7 +34153,7 @@ var init_claude = __esm({
|
|
|
34099
34153
|
init_constants();
|
|
34100
34154
|
init_agent2();
|
|
34101
34155
|
import_fs8 = require("fs");
|
|
34102
|
-
|
|
34156
|
+
import_path13 = require("path");
|
|
34103
34157
|
import_crypto13 = require("crypto");
|
|
34104
34158
|
import_promises18 = require("fs/promises");
|
|
34105
34159
|
init_agent2();
|
|
@@ -35067,6 +35121,7 @@ var init_claude = __esm({
|
|
|
35067
35121
|
"NotebookEdit"
|
|
35068
35122
|
];
|
|
35069
35123
|
DEFAULT_MCP_TIMEOUT_MS = 5e3;
|
|
35124
|
+
CLOUD_SKILL_LISTING_MAX_DESCRIPTION_CHARS = 250;
|
|
35070
35125
|
}
|
|
35071
35126
|
});
|
|
35072
35127
|
|
|
@@ -35224,7 +35279,7 @@ function codexExecArgs(input2) {
|
|
|
35224
35279
|
];
|
|
35225
35280
|
}
|
|
35226
35281
|
function codexHomeOf(env) {
|
|
35227
|
-
return env.CODEX_HOME || (0,
|
|
35282
|
+
return env.CODEX_HOME || (0, import_path14.join)(env.HOME ?? "", ".codex");
|
|
35228
35283
|
}
|
|
35229
35284
|
function namesNewestFirst(dir, isDir) {
|
|
35230
35285
|
try {
|
|
@@ -35240,15 +35295,15 @@ function findCodexRollout(codexHome, sessionId) {
|
|
|
35240
35295
|
const name = namesNewestFirst(dir, false).find(
|
|
35241
35296
|
(file2) => file2.startsWith("rollout-") && file2.endsWith(suffix)
|
|
35242
35297
|
);
|
|
35243
|
-
return name ? (0,
|
|
35298
|
+
return name ? (0, import_path14.join)(dir, name) : void 0;
|
|
35244
35299
|
}
|
|
35245
35300
|
for (const child of namesNewestFirst(dir, true)) {
|
|
35246
|
-
const found = walk((0,
|
|
35301
|
+
const found = walk((0, import_path14.join)(dir, child), depth - 1);
|
|
35247
35302
|
if (found) return found;
|
|
35248
35303
|
}
|
|
35249
35304
|
return void 0;
|
|
35250
35305
|
};
|
|
35251
|
-
return sessionId ? walk((0,
|
|
35306
|
+
return sessionId ? walk((0, import_path14.join)(codexHome, "sessions"), 3) : void 0;
|
|
35252
35307
|
}
|
|
35253
35308
|
function codexRolloutExists(codexHome, sessionId) {
|
|
35254
35309
|
return Promise.resolve(findCodexRollout(codexHome, sessionId) !== void 0);
|
|
@@ -36426,20 +36481,20 @@ function codexTurnInput(run, context) {
|
|
|
36426
36481
|
...images.length ? { imagePaths: images.map((image) => image.path) } : {}
|
|
36427
36482
|
};
|
|
36428
36483
|
}
|
|
36429
|
-
var import_fs9,
|
|
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;
|
|
36430
36485
|
var init_codex = __esm({
|
|
36431
36486
|
"../agent-core/dist/providers/codex.js"() {
|
|
36432
36487
|
"use strict";
|
|
36433
36488
|
init_chunk_VUWLTOVK();
|
|
36434
|
-
|
|
36489
|
+
init_chunk_U4RQE7JS();
|
|
36435
36490
|
init_chunk_AF3IPGDT();
|
|
36436
|
-
|
|
36491
|
+
init_chunk_WYNUYKKN();
|
|
36437
36492
|
init_chunk_KVTSAS2T();
|
|
36438
|
-
|
|
36493
|
+
init_chunk_7FJ7QKFN();
|
|
36439
36494
|
init_chunk_OSECDZA5();
|
|
36440
36495
|
init_chunk_YXWJW7I5();
|
|
36441
36496
|
import_fs9 = require("fs");
|
|
36442
|
-
|
|
36497
|
+
import_path14 = require("path");
|
|
36443
36498
|
init_effort();
|
|
36444
36499
|
import_crypto14 = require("crypto");
|
|
36445
36500
|
import_crypto15 = require("crypto");
|
|
@@ -38122,11 +38177,11 @@ var import_crypto18, import_promises19, FACTORY_API_VERSION, FACTORY_PROTOCOL_VE
|
|
|
38122
38177
|
var init_droid = __esm({
|
|
38123
38178
|
"../agent-core/dist/providers/droid.js"() {
|
|
38124
38179
|
"use strict";
|
|
38125
|
-
|
|
38180
|
+
init_chunk_U4RQE7JS();
|
|
38126
38181
|
init_chunk_AF3IPGDT();
|
|
38127
|
-
|
|
38182
|
+
init_chunk_WYNUYKKN();
|
|
38128
38183
|
init_chunk_KVTSAS2T();
|
|
38129
|
-
|
|
38184
|
+
init_chunk_7FJ7QKFN();
|
|
38130
38185
|
init_chunk_OSECDZA5();
|
|
38131
38186
|
init_chunk_YXWJW7I5();
|
|
38132
38187
|
init_runtime_v2();
|
|
@@ -38613,7 +38668,7 @@ var init_opencode2 = __esm({
|
|
|
38613
38668
|
// ../agent-core/dist/providers/antigravity.js
|
|
38614
38669
|
function settingsPath(env) {
|
|
38615
38670
|
const home = env.HOME?.trim() || env.USERPROFILE?.trim();
|
|
38616
|
-
return home ? (0,
|
|
38671
|
+
return home ? (0, import_path15.resolve)(home, ".gemini", "antigravity-cli", "settings.json") : void 0;
|
|
38617
38672
|
}
|
|
38618
38673
|
async function readSettings(path) {
|
|
38619
38674
|
let raw;
|
|
@@ -38636,7 +38691,7 @@ async function selectAntigravityApiKeyMode(env) {
|
|
|
38636
38691
|
const settings2 = await readSettings(path);
|
|
38637
38692
|
if (settings2 === "malformed") return "malformed";
|
|
38638
38693
|
if (settings2.modelProvider === "gemini") return "already_selected";
|
|
38639
|
-
await (0, import_promises20.mkdir)((0,
|
|
38694
|
+
await (0, import_promises20.mkdir)((0, import_path15.dirname)(path), { recursive: true });
|
|
38640
38695
|
await (0, import_promises20.writeFile)(path, JSON.stringify({ ...settings2, modelProvider: "gemini" }), { mode: 384 });
|
|
38641
38696
|
return "selected";
|
|
38642
38697
|
}
|
|
@@ -38680,21 +38735,21 @@ function antigravityArgs(input2, capabilities, prompt) {
|
|
|
38680
38735
|
];
|
|
38681
38736
|
}
|
|
38682
38737
|
function workspaceRoot(cwd) {
|
|
38683
|
-
for (let current = (0,
|
|
38684
|
-
if ((0, import_fs10.existsSync)((0,
|
|
38685
|
-
if ((0,
|
|
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);
|
|
38686
38741
|
}
|
|
38687
38742
|
}
|
|
38688
38743
|
function instructionPaths(cwd) {
|
|
38689
38744
|
const root = workspaceRoot(cwd);
|
|
38690
38745
|
const paths = [];
|
|
38691
|
-
for (let current = (0,
|
|
38692
|
-
const path = (0,
|
|
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);
|
|
38693
38748
|
try {
|
|
38694
38749
|
if ((0, import_fs10.existsSync)(path) && (0, import_fs10.statSync)(path).isFile()) paths.unshift(path);
|
|
38695
38750
|
} catch {
|
|
38696
38751
|
}
|
|
38697
|
-
if (current === root || (0,
|
|
38752
|
+
if (current === root || (0, import_path16.dirname)(current) === current) return paths;
|
|
38698
38753
|
}
|
|
38699
38754
|
}
|
|
38700
38755
|
function antigravityWorkspaceInstructions(cwd, maxChars = MAX_INSTRUCTION_CHARS) {
|
|
@@ -38948,7 +39003,7 @@ function normalizeAntigravityFrame(event) {
|
|
|
38948
39003
|
}
|
|
38949
39004
|
function antigravityBrainRoot(env) {
|
|
38950
39005
|
const home = env.HOME?.trim() || env.USERPROFILE?.trim();
|
|
38951
|
-
return home ? (0,
|
|
39006
|
+
return home ? (0, import_path17.resolve)(home, ".gemini", "antigravity-cli", "brain") : void 0;
|
|
38952
39007
|
}
|
|
38953
39008
|
function parseEntry(text2) {
|
|
38954
39009
|
try {
|
|
@@ -38986,14 +39041,14 @@ function childTranscriptPath(root, frame) {
|
|
|
38986
39041
|
try {
|
|
38987
39042
|
const url2 = new URL(logUri);
|
|
38988
39043
|
if (url2.protocol !== "file:") return void 0;
|
|
38989
|
-
path = (0,
|
|
39044
|
+
path = (0, import_path17.resolve)((0, import_url3.fileURLToPath)(url2));
|
|
38990
39045
|
} catch {
|
|
38991
39046
|
return void 0;
|
|
38992
39047
|
}
|
|
38993
|
-
const fromRoot = (0,
|
|
38994
|
-
if (!fromRoot || (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;
|
|
38995
39050
|
const expected = [conversationId, ...LOG_DIRS, TRANSCRIPT_FILE];
|
|
38996
|
-
const segments = fromRoot.split(
|
|
39051
|
+
const segments = fromRoot.split(import_path17.sep);
|
|
38997
39052
|
const matches = segments.length === expected.length && segments.every((segment, index) => segment === expected[index]);
|
|
38998
39053
|
return matches ? path : void 0;
|
|
38999
39054
|
}
|
|
@@ -39255,24 +39310,24 @@ function antigravityTurnInput(run, context) {
|
|
|
39255
39310
|
});
|
|
39256
39311
|
return { turnId: run.runId, text: appendImagePathReferences(text2, images) };
|
|
39257
39312
|
}
|
|
39258
|
-
var import_promises20,
|
|
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;
|
|
39259
39314
|
var init_antigravity = __esm({
|
|
39260
39315
|
"../agent-core/dist/providers/antigravity.js"() {
|
|
39261
39316
|
"use strict";
|
|
39262
39317
|
init_chunk_VUWLTOVK();
|
|
39263
|
-
|
|
39318
|
+
init_chunk_U4RQE7JS();
|
|
39264
39319
|
init_chunk_AF3IPGDT();
|
|
39265
|
-
|
|
39320
|
+
init_chunk_WYNUYKKN();
|
|
39266
39321
|
init_chunk_KVTSAS2T();
|
|
39267
|
-
|
|
39322
|
+
init_chunk_7FJ7QKFN();
|
|
39268
39323
|
init_chunk_YXWJW7I5();
|
|
39269
39324
|
import_promises20 = require("fs/promises");
|
|
39270
|
-
|
|
39325
|
+
import_path15 = require("path");
|
|
39271
39326
|
init_type_guards();
|
|
39272
39327
|
import_fs10 = require("fs");
|
|
39273
|
-
import_path15 = require("path");
|
|
39274
|
-
init_effort();
|
|
39275
39328
|
import_path16 = require("path");
|
|
39329
|
+
init_effort();
|
|
39330
|
+
import_path17 = require("path");
|
|
39276
39331
|
import_url3 = require("url");
|
|
39277
39332
|
import_crypto19 = require("crypto");
|
|
39278
39333
|
init_agent2();
|
|
@@ -39312,7 +39367,7 @@ var init_antigravity = __esm({
|
|
|
39312
39367
|
#full;
|
|
39313
39368
|
constructor(path) {
|
|
39314
39369
|
this.#cursor = new TranscriptCursor(path);
|
|
39315
|
-
this.#fullPath = (0,
|
|
39370
|
+
this.#fullPath = (0, import_path17.resolve)((0, import_path17.dirname)(path), FULL_TRANSCRIPT_FILE);
|
|
39316
39371
|
}
|
|
39317
39372
|
skipExisting() {
|
|
39318
39373
|
this.#cursor.read();
|
|
@@ -39360,7 +39415,7 @@ var init_antigravity = __esm({
|
|
|
39360
39415
|
/** A conversation this turn did not resume was created by it, so it is read whole. */
|
|
39361
39416
|
trackParent(conversationId) {
|
|
39362
39417
|
if (this.#parent?.conversationId === conversationId) return;
|
|
39363
|
-
const path = (0,
|
|
39418
|
+
const path = (0, import_path17.resolve)(this.#root, conversationId, ...LOG_DIRS, TRANSCRIPT_FILE);
|
|
39364
39419
|
this.#parent = { conversationId, transcript: new BrainTranscript(path) };
|
|
39365
39420
|
}
|
|
39366
39421
|
/** A launcher keeps the first valid transcript it names; later frames change nothing. */
|
|
@@ -39791,7 +39846,7 @@ function parseConfig(raw) {
|
|
|
39791
39846
|
}
|
|
39792
39847
|
}
|
|
39793
39848
|
async function writeCommandCodeProjectMcp(cwd, mcp) {
|
|
39794
|
-
const path = (0,
|
|
39849
|
+
const path = (0, import_path18.join)(cwd, ".mcp.json");
|
|
39795
39850
|
const original = await (0, import_promises21.readFile)(path, "utf8").catch(() => null);
|
|
39796
39851
|
const config2 = parseConfig(original);
|
|
39797
39852
|
const next = {
|
|
@@ -39986,19 +40041,19 @@ function commandCodeTurnInput(run, context) {
|
|
|
39986
40041
|
});
|
|
39987
40042
|
return { turnId: run.runId, text: appendImagePathReferences(text2, images) };
|
|
39988
40043
|
}
|
|
39989
|
-
var import_promises21,
|
|
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;
|
|
39990
40045
|
var init_command_code = __esm({
|
|
39991
40046
|
"../agent-core/dist/providers/command-code.js"() {
|
|
39992
40047
|
"use strict";
|
|
39993
|
-
|
|
40048
|
+
init_chunk_U4RQE7JS();
|
|
39994
40049
|
init_chunk_AF3IPGDT();
|
|
39995
|
-
|
|
40050
|
+
init_chunk_WYNUYKKN();
|
|
39996
40051
|
init_chunk_KVTSAS2T();
|
|
39997
|
-
|
|
40052
|
+
init_chunk_7FJ7QKFN();
|
|
39998
40053
|
init_chunk_OSECDZA5();
|
|
39999
40054
|
init_chunk_YXWJW7I5();
|
|
40000
40055
|
import_promises21 = require("fs/promises");
|
|
40001
|
-
|
|
40056
|
+
import_path18 = require("path");
|
|
40002
40057
|
init_agent2();
|
|
40003
40058
|
init_runtime_v2();
|
|
40004
40059
|
init_acp();
|
|
@@ -49798,13 +49853,14 @@ function decodeUtf8(bytes, path) {
|
|
|
49798
49853
|
throw new SkillPackageError("INVALID_FRONTMATTER", `${path} must be valid UTF-8`, path);
|
|
49799
49854
|
}
|
|
49800
49855
|
}
|
|
49856
|
+
var MARKDOWN_LINK_TARGET = /\]\(<?([^\s)>\]]+)>?(?=[\s)])/g;
|
|
49801
49857
|
function collectDiagnostics(skillMarkdown, license, packagePaths) {
|
|
49802
49858
|
if (!skillMarkdown)
|
|
49803
49859
|
return [];
|
|
49804
49860
|
const diagnostics = [];
|
|
49805
49861
|
const markdown = decodeUtf8(skillMarkdown, "SKILL.md");
|
|
49806
49862
|
const references = /* @__PURE__ */ new Set();
|
|
49807
|
-
for (const match of markdown.matchAll(
|
|
49863
|
+
for (const match of markdown.matchAll(MARKDOWN_LINK_TARGET)) {
|
|
49808
49864
|
const reference = normalizePackageReference(match[1]);
|
|
49809
49865
|
if (reference && looksLikeFileReference(reference))
|
|
49810
49866
|
references.add(reference);
|
|
@@ -50005,22 +50061,21 @@ async function resolveSkillInvocations(layout, invocations, baked = "any") {
|
|
|
50005
50061
|
}
|
|
50006
50062
|
return missing.length === 0 ? { kind: "resolved", skills: resolved } : { kind: "missing", names: missing };
|
|
50007
50063
|
}
|
|
50008
|
-
async function
|
|
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 }) {
|
|
50009
50071
|
const found = /* @__PURE__ */ new Map();
|
|
50010
|
-
const
|
|
50011
|
-
|
|
50012
|
-
|
|
50013
|
-
|
|
50014
|
-
|
|
50015
|
-
|
|
50016
|
-
|
|
50017
|
-
if (layout.nativeDir !== null) {
|
|
50018
|
-
const entries = await (0, import_promises27.readdir)(layout.nativeDir, { withFileTypes: true }).catch(() => []);
|
|
50019
|
-
for (const entry of entries) {
|
|
50020
|
-
if (entry.isDirectory() || entry.isSymbolicLink())
|
|
50021
|
-
candidates2.push({ directory: (0, import_node_path13.join)(layout.nativeDir, entry.name) });
|
|
50022
|
-
}
|
|
50023
|
-
}
|
|
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) : []];
|
|
50024
50079
|
const bounded = candidates2.slice(0, 2e3);
|
|
50025
50080
|
for (let start = 0; start < bounded.length; start += INDEX_CONCURRENCY) {
|
|
50026
50081
|
const batch = bounded.slice(start, start + INDEX_CONCURRENCY);
|
|
@@ -50028,7 +50083,8 @@ async function availableSkillIndex(layout) {
|
|
|
50028
50083
|
batch.map((candidate) => inspectIndexedSkill(candidate.directory, candidate.contentHash))
|
|
50029
50084
|
);
|
|
50030
50085
|
for (const skill of inspected) {
|
|
50031
|
-
if (skill !== null && !found.has(skill.name)
|
|
50086
|
+
if (skill !== null && !found.has(skill.name) && !shadowed.has(skill.name))
|
|
50087
|
+
found.set(skill.name, skill);
|
|
50032
50088
|
}
|
|
50033
50089
|
}
|
|
50034
50090
|
return [...found.values()].sort((a, b) => a.name.localeCompare(b.name));
|
|
@@ -50650,7 +50706,7 @@ var import_promises33 = require("fs/promises");
|
|
|
50650
50706
|
var import_node_path21 = require("path");
|
|
50651
50707
|
|
|
50652
50708
|
// ../agent-core/dist/prompt.js
|
|
50653
|
-
|
|
50709
|
+
init_chunk_7FJ7QKFN();
|
|
50654
50710
|
|
|
50655
50711
|
// src/holder/agent-context.ts
|
|
50656
50712
|
async function readText2(path) {
|
|
@@ -51113,13 +51169,38 @@ async function admitDefaultWorkspace(spec, context, skills) {
|
|
|
51113
51169
|
);
|
|
51114
51170
|
}
|
|
51115
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
|
+
}
|
|
51116
51192
|
async function withInstalledCloudSkills(spec, context) {
|
|
51117
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;
|
|
51118
51196
|
return {
|
|
51119
51197
|
...spec,
|
|
51120
51198
|
promptContext: {
|
|
51121
51199
|
...spec.promptContext,
|
|
51122
|
-
availableSkills: await availableSkillIndex(context.skills
|
|
51200
|
+
availableSkills: await availableSkillIndex(context.skills, {
|
|
51201
|
+
synced: !listed.synced,
|
|
51202
|
+
native: !listed.native
|
|
51203
|
+
})
|
|
51123
51204
|
}
|
|
51124
51205
|
};
|
|
51125
51206
|
}
|
|
@@ -51172,7 +51253,8 @@ function createHolderWorkspace(machine, clock, log) {
|
|
|
51172
51253
|
platform
|
|
51173
51254
|
});
|
|
51174
51255
|
return approved.roots();
|
|
51175
|
-
}
|
|
51256
|
+
},
|
|
51257
|
+
...machine.skillDiscovery === void 0 ? {} : { discovery: machine.skillDiscovery }
|
|
51176
51258
|
},
|
|
51177
51259
|
...machine.refreshesFirstCheckout === true ? {
|
|
51178
51260
|
refreshFirstCheckout: createCheckoutRefresh({
|
|
@@ -52036,6 +52118,9 @@ var SECRET_VARIABLES = /* @__PURE__ */ new Set([
|
|
|
52036
52118
|
ENROLLMENT_CODE_VARIABLE
|
|
52037
52119
|
]);
|
|
52038
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
|
+
}
|
|
52039
52124
|
function loadRuntimeConfig(env = process.env) {
|
|
52040
52125
|
const parsed = envSchema.safeParse(env);
|
|
52041
52126
|
if (!parsed.success) {
|
|
@@ -52292,6 +52377,7 @@ async function runHold(argv) {
|
|
|
52292
52377
|
[ALAN_MCP_URL_ENV]: access3.managedMcp.url,
|
|
52293
52378
|
[ALAN_MCP_CREDENTIAL_FILE_ENV]: credentialPath
|
|
52294
52379
|
};
|
|
52380
|
+
const flags = createFlagProbe();
|
|
52295
52381
|
await runHolder({
|
|
52296
52382
|
launch: launch.value,
|
|
52297
52383
|
driver: createProviderDrivers({
|
|
@@ -52310,7 +52396,11 @@ async function runHold(argv) {
|
|
|
52310
52396
|
env: cliEnvironment,
|
|
52311
52397
|
stateDir: paths.stateDir,
|
|
52312
52398
|
// Only a cloud sandbox's runtime has a git gateway.
|
|
52313
|
-
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
|
+
}
|
|
52314
52404
|
}
|
|
52315
52405
|
});
|
|
52316
52406
|
} catch (_) {
|