@atlasharness/atlascode 0.1.14 → 0.1.16
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/dist/cli.js +137 -60
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -863,20 +863,24 @@ async function executeToolUse(tu, assistantMsg, deps) {
|
|
|
863
863
|
const callInput = verdict.updatedInput ?? effectiveInput;
|
|
864
864
|
let block;
|
|
865
865
|
let isError = false;
|
|
866
|
+
let toolUseResult;
|
|
866
867
|
try {
|
|
867
868
|
const res = await tool.call(callInput, toolCallContext, undefined, assistantMsg);
|
|
868
869
|
block = tool.mapToolResultToToolResultBlockParam(res.data, tu.id);
|
|
870
|
+
toolUseResult = res.data;
|
|
869
871
|
} catch (error) {
|
|
872
|
+
const errorText = `tool error [${classifyToolError(error)}]: ${String(error?.message ?? error)}`;
|
|
870
873
|
block = {
|
|
871
874
|
type: "tool_result",
|
|
872
875
|
tool_use_id: tu.id,
|
|
873
|
-
content: `<tool_use_error
|
|
876
|
+
content: `<tool_use_error>${errorText}</tool_use_error>`,
|
|
874
877
|
is_error: true
|
|
875
878
|
};
|
|
876
879
|
isError = true;
|
|
880
|
+
toolUseResult = errorText;
|
|
877
881
|
}
|
|
878
882
|
const postOutcome = await deps.hooks?.postToolUse?.(tool, callInput, block, tu.id);
|
|
879
|
-
return { block, isError };
|
|
883
|
+
return { block, isError, toolUseResult };
|
|
880
884
|
}
|
|
881
885
|
var init_toolExecution = () => {};
|
|
882
886
|
|
|
@@ -903,7 +907,13 @@ async function runToolBatch(toolUses, assistantMsg, deps) {
|
|
|
903
907
|
for (const batch of partitionToolCalls(toolUses, deps.tools)) {
|
|
904
908
|
for (const tu of batch.blocks) {
|
|
905
909
|
const r = await executeToolUse(tu, assistantMsg, deps);
|
|
906
|
-
outcomes.push({
|
|
910
|
+
outcomes.push({
|
|
911
|
+
toolUseId: tu.id,
|
|
912
|
+
name: tu.name,
|
|
913
|
+
block: r.block,
|
|
914
|
+
isError: r.isError,
|
|
915
|
+
toolUseResult: r.toolUseResult
|
|
916
|
+
});
|
|
907
917
|
}
|
|
908
918
|
}
|
|
909
919
|
return outcomes;
|
|
@@ -20042,6 +20052,17 @@ var init_openai = __esm(() => {
|
|
|
20042
20052
|
init_bedrock2();
|
|
20043
20053
|
});
|
|
20044
20054
|
|
|
20055
|
+
// src/modelprovider/constants.ts
|
|
20056
|
+
var API_IMAGE_MAX_BASE64_SIZE, IMAGE_TARGET_RAW_SIZE, PDF_TARGET_RAW_SIZE, API_PDF_MAX_PAGES = 100, LLM_TIMEOUT_DEFAULT_MS = 600000, LLM_TIMEOUT_CAP_MS = 1800000, SUMMARIZE_CONNECTOR_TEXT_BETA_HEADER, AFK_MODE_BETA_HEADER;
|
|
20057
|
+
var init_constants2 = __esm(() => {
|
|
20058
|
+
init_shared();
|
|
20059
|
+
API_IMAGE_MAX_BASE64_SIZE = 5 * 1024 * 1024;
|
|
20060
|
+
IMAGE_TARGET_RAW_SIZE = API_IMAGE_MAX_BASE64_SIZE * 3 / 4;
|
|
20061
|
+
PDF_TARGET_RAW_SIZE = 20 * 1024 * 1024;
|
|
20062
|
+
SUMMARIZE_CONNECTOR_TEXT_BETA_HEADER = feature("CONNECTOR_TEXT") ? "summarize-connector-text-2026-03-13" : "";
|
|
20063
|
+
AFK_MODE_BETA_HEADER = feature("TRANSCRIPT_CLASSIFIER") ? "afk-mode-2026-01-31" : "";
|
|
20064
|
+
});
|
|
20065
|
+
|
|
20045
20066
|
// src/modelprovider/clients.ts
|
|
20046
20067
|
function clientCacheKey(provider, baseURL, apiKey) {
|
|
20047
20068
|
return provider + "|" + (baseURL || "") + "|" + (apiKey || "");
|
|
@@ -20056,7 +20077,7 @@ function getClientForEntry(entry) {
|
|
|
20056
20077
|
baseURL: entry.baseURL,
|
|
20057
20078
|
apiKey: entry.apiKey,
|
|
20058
20079
|
maxRetries: 0,
|
|
20059
|
-
timeout:
|
|
20080
|
+
timeout: LLM_TIMEOUT_DEFAULT_MS
|
|
20060
20081
|
});
|
|
20061
20082
|
clientCache.set(key, client);
|
|
20062
20083
|
return client;
|
|
@@ -20064,6 +20085,7 @@ function getClientForEntry(entry) {
|
|
|
20064
20085
|
var clientCache;
|
|
20065
20086
|
var init_clients = __esm(() => {
|
|
20066
20087
|
init_openai();
|
|
20088
|
+
init_constants2();
|
|
20067
20089
|
clientCache = new Map;
|
|
20068
20090
|
});
|
|
20069
20091
|
|
|
@@ -26997,6 +27019,27 @@ var init_params = __esm(() => {
|
|
|
26997
27019
|
init_effort();
|
|
26998
27020
|
});
|
|
26999
27021
|
|
|
27022
|
+
// src/modelprovider/types.ts
|
|
27023
|
+
var APIError2, APIConnectionError2, APIConnectionTimeoutError2;
|
|
27024
|
+
var init_types2 = __esm(() => {
|
|
27025
|
+
APIError2 = class APIError2 extends Error {
|
|
27026
|
+
status;
|
|
27027
|
+
error;
|
|
27028
|
+
constructor(message, status, error) {
|
|
27029
|
+
super(message);
|
|
27030
|
+
this.name = "APIError";
|
|
27031
|
+
if (status !== undefined)
|
|
27032
|
+
this.status = status;
|
|
27033
|
+
if (error !== undefined)
|
|
27034
|
+
this.error = error;
|
|
27035
|
+
}
|
|
27036
|
+
};
|
|
27037
|
+
APIConnectionError2 = class APIConnectionError2 extends APIError2 {
|
|
27038
|
+
};
|
|
27039
|
+
APIConnectionTimeoutError2 = class APIConnectionTimeoutError2 extends APIConnectionError2 {
|
|
27040
|
+
};
|
|
27041
|
+
});
|
|
27042
|
+
|
|
27000
27043
|
// src/modelprovider/modelprovider.ts
|
|
27001
27044
|
import { randomUUID } from "crypto";
|
|
27002
27045
|
function mapOpenAIUsage(u) {
|
|
@@ -27015,6 +27058,29 @@ function isRetryableError(err) {
|
|
|
27015
27058
|
const msg = String(err?.message || err?.code || "");
|
|
27016
27059
|
return /timeout|ECONN|EPIPE|fetch failed|socket|aborted/i.test(msg);
|
|
27017
27060
|
}
|
|
27061
|
+
function isClientRequestTimeout(err) {
|
|
27062
|
+
if (!err || typeof err !== "object")
|
|
27063
|
+
return false;
|
|
27064
|
+
const e = err;
|
|
27065
|
+
if (err instanceof APIConnectionTimeoutError2)
|
|
27066
|
+
return true;
|
|
27067
|
+
if (e.name === "APIConnectionTimeoutError" || e.name === "APITimeoutError")
|
|
27068
|
+
return true;
|
|
27069
|
+
return false;
|
|
27070
|
+
}
|
|
27071
|
+
function shouldRetryModelError(err, signal) {
|
|
27072
|
+
if (signal?.aborted)
|
|
27073
|
+
return false;
|
|
27074
|
+
if (isClientRequestTimeout(err))
|
|
27075
|
+
return false;
|
|
27076
|
+
return isRetryableError(err);
|
|
27077
|
+
}
|
|
27078
|
+
function llmTimeoutRemediationHint(error, currentTimeoutMs) {
|
|
27079
|
+
if (!isClientRequestTimeout(error))
|
|
27080
|
+
return null;
|
|
27081
|
+
const head = typeof currentTimeoutMs === "number" && currentTimeoutMs > 0 ? `当前超时 ${Math.round(currentTimeoutMs / 1000)}s` : "慢模型长生成可能超过缺省超时";
|
|
27082
|
+
return `LLM 请求超时(${head})。可调大:env ATLAS_LLM_TIMEOUT=<毫秒> 或 settings.json llmTimeoutMs 键(上限 ${Math.round(LLM_TIMEOUT_CAP_MS / 60000)}min)。`;
|
|
27083
|
+
}
|
|
27018
27084
|
function startLlmWaitHeartbeat(modelId, attempt, totalRetries) {
|
|
27019
27085
|
const startedAt = Date.now();
|
|
27020
27086
|
const id = setInterval(() => {
|
|
@@ -27028,10 +27094,13 @@ function startLlmWaitHeartbeat(modelId, attempt, totalRetries) {
|
|
|
27028
27094
|
class OpenAIProvider {
|
|
27029
27095
|
maxRetriesPerModel;
|
|
27030
27096
|
timeoutMs;
|
|
27031
|
-
constructor(maxRetriesPerModel = 3, timeoutMs =
|
|
27097
|
+
constructor(maxRetriesPerModel = 3, timeoutMs = LLM_TIMEOUT_DEFAULT_MS) {
|
|
27032
27098
|
this.maxRetriesPerModel = maxRetriesPerModel;
|
|
27033
27099
|
this.timeoutMs = timeoutMs;
|
|
27034
27100
|
}
|
|
27101
|
+
getTimeoutMs() {
|
|
27102
|
+
return this.timeoutMs;
|
|
27103
|
+
}
|
|
27035
27104
|
async chat(args) {
|
|
27036
27105
|
const refs = getRoleModels(args.role, args.sessionModel, args.fallbackModel);
|
|
27037
27106
|
if (refs.length === 0) {
|
|
@@ -27118,7 +27187,7 @@ class OpenAIProvider {
|
|
|
27118
27187
|
};
|
|
27119
27188
|
} catch (err) {
|
|
27120
27189
|
lastErr = err;
|
|
27121
|
-
if (!
|
|
27190
|
+
if (!shouldRetryModelError(err, args.signal))
|
|
27122
27191
|
break;
|
|
27123
27192
|
}
|
|
27124
27193
|
}
|
|
@@ -27168,7 +27237,7 @@ class OpenAIProvider {
|
|
|
27168
27237
|
break;
|
|
27169
27238
|
} catch (err) {
|
|
27170
27239
|
lastErr = err;
|
|
27171
|
-
if (!
|
|
27240
|
+
if (!shouldRetryModelError(err, args.signal))
|
|
27172
27241
|
break;
|
|
27173
27242
|
}
|
|
27174
27243
|
}
|
|
@@ -27178,7 +27247,7 @@ class OpenAIProvider {
|
|
|
27178
27247
|
if (lastErr) {
|
|
27179
27248
|
const message = lastErr instanceof Error ? lastErr.message || lastErr.name : String(lastErr);
|
|
27180
27249
|
const code = lastErr?.name === "TimeoutError" ? "TIMEOUT" : "API_ERROR";
|
|
27181
|
-
yield { type: "error", code, message, retryable:
|
|
27250
|
+
yield { type: "error", code, message, retryable: shouldRetryModelError(lastErr, args.signal) };
|
|
27182
27251
|
return;
|
|
27183
27252
|
}
|
|
27184
27253
|
throw new Error(`No models configured for role '${args.role}'.`);
|
|
@@ -27424,15 +27493,15 @@ class OpenAIProvider {
|
|
|
27424
27493
|
var init_modelprovider = __esm(() => {
|
|
27425
27494
|
init_openai();
|
|
27426
27495
|
init_clients();
|
|
27496
|
+
init_constants2();
|
|
27427
27497
|
init_roles7();
|
|
27428
27498
|
init_shared();
|
|
27429
27499
|
init_shared();
|
|
27430
27500
|
init_params();
|
|
27501
|
+
init_types2();
|
|
27502
|
+
init_constants2();
|
|
27431
27503
|
});
|
|
27432
27504
|
|
|
27433
|
-
// src/modelprovider/types.ts
|
|
27434
|
-
var init_types2 = () => {};
|
|
27435
|
-
|
|
27436
27505
|
// src/modelprovider/errorUtils.ts
|
|
27437
27506
|
function extractConnectionErrorDetails(error) {
|
|
27438
27507
|
if (!error || typeof error !== "object") {
|
|
@@ -27571,17 +27640,6 @@ var init_errorUtils = __esm(() => {
|
|
|
27571
27640
|
]);
|
|
27572
27641
|
});
|
|
27573
27642
|
|
|
27574
|
-
// src/modelprovider/constants.ts
|
|
27575
|
-
var API_IMAGE_MAX_BASE64_SIZE, IMAGE_TARGET_RAW_SIZE, PDF_TARGET_RAW_SIZE, API_PDF_MAX_PAGES = 100, SUMMARIZE_CONNECTOR_TEXT_BETA_HEADER, AFK_MODE_BETA_HEADER;
|
|
27576
|
-
var init_constants2 = __esm(() => {
|
|
27577
|
-
init_shared();
|
|
27578
|
-
API_IMAGE_MAX_BASE64_SIZE = 5 * 1024 * 1024;
|
|
27579
|
-
IMAGE_TARGET_RAW_SIZE = API_IMAGE_MAX_BASE64_SIZE * 3 / 4;
|
|
27580
|
-
PDF_TARGET_RAW_SIZE = 20 * 1024 * 1024;
|
|
27581
|
-
SUMMARIZE_CONNECTOR_TEXT_BETA_HEADER = feature("CONNECTOR_TEXT") ? "summarize-connector-text-2026-03-13" : "";
|
|
27582
|
-
AFK_MODE_BETA_HEADER = feature("TRANSCRIPT_CLASSIFIER") ? "afk-mode-2026-01-31" : "";
|
|
27583
|
-
});
|
|
27584
|
-
|
|
27585
27643
|
// src/modelprovider/errorMessaging.ts
|
|
27586
27644
|
function registerErrorMessagingPorts(p) {
|
|
27587
27645
|
ports = p;
|
|
@@ -27721,10 +27779,22 @@ var init_queryWithRoleFallback = __esm(() => {
|
|
|
27721
27779
|
|
|
27722
27780
|
// src/modelprovider/index.ts
|
|
27723
27781
|
function getModelProvider() {
|
|
27724
|
-
return _provider ??= new OpenAIProvider(3, resolveLlmTimeoutMs());
|
|
27782
|
+
return _provider ??= new OpenAIProvider(3, resolveLlmTimeoutMs(process.env.ATLAS_LLM_TIMEOUT, llmTimeoutSettingsSource?.()));
|
|
27783
|
+
}
|
|
27784
|
+
function setLlmTimeoutSettingsSource(next) {
|
|
27785
|
+
llmTimeoutSettingsSource = next;
|
|
27786
|
+
}
|
|
27787
|
+
function getCurrentLlmTimeoutMs() {
|
|
27788
|
+
return resolveLlmTimeoutMs(process.env.ATLAS_LLM_TIMEOUT, llmTimeoutSettingsSource?.());
|
|
27725
27789
|
}
|
|
27726
|
-
function resolveLlmTimeoutMs() {
|
|
27727
|
-
|
|
27790
|
+
function resolveLlmTimeoutMs(envRaw = process.env.ATLAS_LLM_TIMEOUT, settingsMs) {
|
|
27791
|
+
const fromSettings = () => typeof settingsMs === "number" && Number.isInteger(settingsMs) && settingsMs >= 1 ? Math.min(settingsMs, LLM_TIMEOUT_CAP_MS) : LLM_TIMEOUT_DEFAULT_MS;
|
|
27792
|
+
if (envRaw === undefined || envRaw === "")
|
|
27793
|
+
return fromSettings();
|
|
27794
|
+
const env = parseBoundedIntEnv("ATLAS_LLM_TIMEOUT", envRaw, LLM_TIMEOUT_DEFAULT_MS, LLM_TIMEOUT_CAP_MS, 1);
|
|
27795
|
+
if (env.status !== "invalid")
|
|
27796
|
+
return env.effective;
|
|
27797
|
+
return fromSettings();
|
|
27728
27798
|
}
|
|
27729
27799
|
function lazyProxy(resolve) {
|
|
27730
27800
|
return new Proxy({}, {
|
|
@@ -27735,13 +27805,16 @@ function lazyProxy(resolve) {
|
|
|
27735
27805
|
}
|
|
27736
27806
|
});
|
|
27737
27807
|
}
|
|
27738
|
-
var _provider, modelProvider;
|
|
27808
|
+
var _provider, llmTimeoutSettingsSource = null, modelProvider;
|
|
27739
27809
|
var init_modelprovider2 = __esm(() => {
|
|
27740
27810
|
init_modelprovider();
|
|
27811
|
+
init_constants2();
|
|
27741
27812
|
init_shared();
|
|
27813
|
+
init_constants2();
|
|
27742
27814
|
init_modelprovider();
|
|
27743
27815
|
init_types2();
|
|
27744
27816
|
init_modelErrors();
|
|
27817
|
+
init_modelprovider();
|
|
27745
27818
|
init_params();
|
|
27746
27819
|
init_roles7();
|
|
27747
27820
|
init_errorUtils();
|
|
@@ -75853,7 +75926,7 @@ var init_loadSkillsDir = __esm(() => {
|
|
|
75853
75926
|
logForDebugging(`Loading skills from: managed=${managedSkillsDir}, user=${userSkillsDir}, project=[${projectSkillsDirs.join(", ")}]`);
|
|
75854
75927
|
const additionalDirs = [];
|
|
75855
75928
|
const skillsLocked = false;
|
|
75856
|
-
const
|
|
75929
|
+
const projectSkillsEnabled = !skillsLocked && !isEnvTruthy(process.env.ATLAS_DISABLE_PROJECT_SKILLS);
|
|
75857
75930
|
const [
|
|
75858
75931
|
managedSkills,
|
|
75859
75932
|
userSkills,
|
|
@@ -75863,8 +75936,8 @@ var init_loadSkillsDir = __esm(() => {
|
|
|
75863
75936
|
] = await Promise.all([
|
|
75864
75937
|
isEnvTruthy(process.env.ATLAS_DISABLE_POLICY_SKILLS) ? Promise.resolve([]) : loadSkillsFromSkillsDir(managedSkillsDir, "policySettings"),
|
|
75865
75938
|
isSettingSourceEnabled("userSettings") && !skillsLocked ? loadSkillsFromSkillsDir(userSkillsDir, "userSettings") : Promise.resolve([]),
|
|
75866
|
-
|
|
75867
|
-
|
|
75939
|
+
projectSkillsEnabled ? Promise.all(projectSkillsDirs.map((dir) => loadSkillsFromSkillsDir(dir, "projectSettings"))) : Promise.resolve([]),
|
|
75940
|
+
projectSkillsEnabled ? Promise.all(additionalDirs.map((dir) => loadSkillsFromSkillsDir(join31(dir, ".atlas", "skills"), "projectSettings"))) : Promise.resolve([]),
|
|
75868
75941
|
skillsLocked ? Promise.resolve([]) : loadSkillsFromCommandsDir(cwd)
|
|
75869
75942
|
]);
|
|
75870
75943
|
const allSkillsWithPaths = [
|
|
@@ -76307,7 +76380,7 @@ Important:
|
|
|
76307
76380
|
// src/engine/tools/skill/skillTool.ts
|
|
76308
76381
|
import { randomUUID as randomUUID14 } from "crypto";
|
|
76309
76382
|
async function getAllCommands() {
|
|
76310
|
-
return getCommands(
|
|
76383
|
+
return getCommands(process.cwd());
|
|
76311
76384
|
}
|
|
76312
76385
|
function getToolUseIDFromParentMessage(parentMessage, toolName) {
|
|
76313
76386
|
if (!parentMessage)
|
|
@@ -76378,7 +76451,6 @@ function skillHasOnlySafeProperties(command) {
|
|
|
76378
76451
|
}
|
|
76379
76452
|
var SKILL_TOOL_INPUT_SCHEMA, SAFE_SKILL_PROPERTIES, SkillTool;
|
|
76380
76453
|
var init_skillTool = __esm(() => {
|
|
76381
|
-
init_bootstrap();
|
|
76382
76454
|
init_shared();
|
|
76383
76455
|
init_permissions3();
|
|
76384
76456
|
init_modelprovider2();
|
|
@@ -76445,7 +76517,7 @@ var init_skillTool = __esm(() => {
|
|
|
76445
76517
|
return skill ?? "";
|
|
76446
76518
|
},
|
|
76447
76519
|
async description() {
|
|
76448
|
-
return getSkillPrompt(
|
|
76520
|
+
return getSkillPrompt(process.cwd());
|
|
76449
76521
|
},
|
|
76450
76522
|
async checkPermissions(input, context) {
|
|
76451
76523
|
const { skill, args } = input;
|
|
@@ -80590,7 +80662,8 @@ async function queryOneRound(deps, tools, messages) {
|
|
|
80590
80662
|
role: "user",
|
|
80591
80663
|
uuid: randomUUID18(),
|
|
80592
80664
|
timestamp: now,
|
|
80593
|
-
message: { role: "user", content: [o.block] }
|
|
80665
|
+
message: { role: "user", content: [o.block] },
|
|
80666
|
+
toolUseResult: o.toolUseResult
|
|
80594
80667
|
}));
|
|
80595
80668
|
if (deps.transcript) {
|
|
80596
80669
|
deps.transcript.record([...messages, assistantMsg, ...resultMessages]);
|
|
@@ -121602,6 +121675,7 @@ var isMcpServerCommandEntry = () => ({}), isMcpServerNameEntry = () => ({}), isM
|
|
|
121602
121675
|
object({ kind: literal("window"), tokens: number2().int().min(1000) }),
|
|
121603
121676
|
object({ kind: literal("pct"), pct: number2().min(1).max(100) })
|
|
121604
121677
|
]).optional(),
|
|
121678
|
+
llmTimeoutMs: number2().int().positive().optional(),
|
|
121605
121679
|
prefersReducedMotion: boolean2().optional(),
|
|
121606
121680
|
syntaxHighlightingDisabled: boolean2().optional(),
|
|
121607
121681
|
spinnerTipsEnabled: boolean2().optional(),
|
|
@@ -148266,28 +148340,28 @@ function getEventPriority(eventType) {
|
|
|
148266
148340
|
case "focus":
|
|
148267
148341
|
case "blur":
|
|
148268
148342
|
case "paste":
|
|
148269
|
-
return
|
|
148343
|
+
return import_constants53.DiscreteEventPriority;
|
|
148270
148344
|
case "resize":
|
|
148271
148345
|
case "scroll":
|
|
148272
148346
|
case "mousemove":
|
|
148273
|
-
return
|
|
148347
|
+
return import_constants53.ContinuousEventPriority;
|
|
148274
148348
|
default:
|
|
148275
|
-
return
|
|
148349
|
+
return import_constants53.DefaultEventPriority;
|
|
148276
148350
|
}
|
|
148277
148351
|
}
|
|
148278
148352
|
|
|
148279
148353
|
class Dispatcher {
|
|
148280
148354
|
currentEvent = null;
|
|
148281
|
-
currentUpdatePriority =
|
|
148355
|
+
currentUpdatePriority = import_constants53.DefaultEventPriority;
|
|
148282
148356
|
discreteUpdates = null;
|
|
148283
148357
|
resolveEventPriority() {
|
|
148284
|
-
if (this.currentUpdatePriority !==
|
|
148358
|
+
if (this.currentUpdatePriority !== import_constants53.NoEventPriority) {
|
|
148285
148359
|
return this.currentUpdatePriority;
|
|
148286
148360
|
}
|
|
148287
148361
|
if (this.currentEvent) {
|
|
148288
148362
|
return getEventPriority(this.currentEvent.type);
|
|
148289
148363
|
}
|
|
148290
|
-
return
|
|
148364
|
+
return import_constants53.DefaultEventPriority;
|
|
148291
148365
|
}
|
|
148292
148366
|
dispatch(target, event) {
|
|
148293
148367
|
const previousEvent = this.currentEvent;
|
|
@@ -148312,18 +148386,18 @@ class Dispatcher {
|
|
|
148312
148386
|
dispatchContinuous(target, event) {
|
|
148313
148387
|
const previousPriority = this.currentUpdatePriority;
|
|
148314
148388
|
try {
|
|
148315
|
-
this.currentUpdatePriority =
|
|
148389
|
+
this.currentUpdatePriority = import_constants53.ContinuousEventPriority;
|
|
148316
148390
|
return this.dispatch(target, event);
|
|
148317
148391
|
} finally {
|
|
148318
148392
|
this.currentUpdatePriority = previousPriority;
|
|
148319
148393
|
}
|
|
148320
148394
|
}
|
|
148321
148395
|
}
|
|
148322
|
-
var
|
|
148396
|
+
var import_constants53;
|
|
148323
148397
|
var init_dispatcher = __esm(() => {
|
|
148324
148398
|
init_log5();
|
|
148325
148399
|
init_event_handlers();
|
|
148326
|
-
|
|
148400
|
+
import_constants53 = __toESM(require_constants2(), 1);
|
|
148327
148401
|
});
|
|
148328
148402
|
|
|
148329
148403
|
// src/tui/ink/events/terminal-event.ts
|
|
@@ -157130,7 +157204,7 @@ function applyPositionedHighlight(screen, stylePool, positions, rowOffset, curre
|
|
|
157130
157204
|
}
|
|
157131
157205
|
return true;
|
|
157132
157206
|
}
|
|
157133
|
-
var
|
|
157207
|
+
var import_constants55, timing;
|
|
157134
157208
|
var init_render_to_screen = __esm(() => {
|
|
157135
157209
|
init_debug();
|
|
157136
157210
|
init_dom();
|
|
@@ -157139,7 +157213,7 @@ var init_render_to_screen = __esm(() => {
|
|
|
157139
157213
|
init_reconciler();
|
|
157140
157214
|
init_render_node_to_output();
|
|
157141
157215
|
init_screen();
|
|
157142
|
-
|
|
157216
|
+
import_constants55 = __toESM(require_constants2(), 1);
|
|
157143
157217
|
timing = { reconcile: 0, yoga: 0, paint: 0, scan: 0, calls: 0 };
|
|
157144
157218
|
});
|
|
157145
157219
|
|
|
@@ -157445,7 +157519,7 @@ class Ink {
|
|
|
157445
157519
|
};
|
|
157446
157520
|
}
|
|
157447
157521
|
};
|
|
157448
|
-
this.container = reconciler_default.createContainer(this.rootNode,
|
|
157522
|
+
this.container = reconciler_default.createContainer(this.rootNode, import_constants56.ConcurrentRoot, null, false, null, "id", noop_default, noop_default, noop_default, noop_default);
|
|
157449
157523
|
if (false) {}
|
|
157450
157524
|
}
|
|
157451
157525
|
handleResume = () => {
|
|
@@ -158258,7 +158332,7 @@ function drainStdin(stdin = process.stdin) {
|
|
|
158258
158332
|
}
|
|
158259
158333
|
}
|
|
158260
158334
|
}
|
|
158261
|
-
var
|
|
158335
|
+
var import_constants56, jsx_dev_runtime8, ALT_SCREEN_ANCHOR_CURSOR, CURSOR_HOME_PATCH, ERASE_THEN_HOME_PATCH, CONSOLE_STDOUT_METHODS, CONSOLE_STDERR_METHODS;
|
|
158262
158336
|
var init_ink = __esm(() => {
|
|
158263
158337
|
init_noop();
|
|
158264
158338
|
init_throttle2();
|
|
@@ -158291,7 +158365,7 @@ var init_ink = __esm(() => {
|
|
|
158291
158365
|
init_dec();
|
|
158292
158366
|
init_osc();
|
|
158293
158367
|
init_useTerminalNotification();
|
|
158294
|
-
|
|
158368
|
+
import_constants56 = __toESM(require_constants2(), 1);
|
|
158295
158369
|
jsx_dev_runtime8 = __toESM(require_jsx_dev_runtime(), 1);
|
|
158296
158370
|
ALT_SCREEN_ANCHOR_CURSOR = Object.freeze({
|
|
158297
158371
|
x: 0,
|
|
@@ -271649,7 +271723,7 @@ async function* runAgent2({
|
|
|
271649
271723
|
}
|
|
271650
271724
|
const skillsToPreload = agentDefinition.skills ?? [];
|
|
271651
271725
|
if (skillsToPreload.length > 0) {
|
|
271652
|
-
const allSkills = await getSkillToolCommands2(
|
|
271726
|
+
const allSkills = await getSkillToolCommands2(process.cwd());
|
|
271653
271727
|
const validSkills = [];
|
|
271654
271728
|
for (const skillName of skillsToPreload) {
|
|
271655
271729
|
const resolvedName = resolveSkillName(skillName, allSkills, agentDefinition);
|
|
@@ -274515,8 +274589,8 @@ var init_UI10 = __esm(() => {
|
|
|
274515
274589
|
async function getAllCommands2(context) {
|
|
274516
274590
|
const mcpSkills = context.getAppState().mcp.commands.filter((cmd) => cmd.type === "prompt" && cmd.loadedFrom === "mcp");
|
|
274517
274591
|
if (mcpSkills.length === 0)
|
|
274518
|
-
return getCommands2(
|
|
274519
|
-
const localCommands = await getCommands2(
|
|
274592
|
+
return getCommands2(process.cwd());
|
|
274593
|
+
const localCommands = await getCommands2(process.cwd());
|
|
274520
274594
|
return uniqBy_default([...localCommands, ...mcpSkills], "name");
|
|
274521
274595
|
}
|
|
274522
274596
|
async function executeForkedSkill2(command, commandName, args, context, canUseTool, parentMessage, onProgress) {
|
|
@@ -274612,7 +274686,6 @@ function isOfficialMarketplaceSkill(command) {
|
|
|
274612
274686
|
var inputSchema14, outputSchema12, SkillTool2, SAFE_SKILL_PROPERTIES2;
|
|
274613
274687
|
var init_SkillTool = __esm(() => {
|
|
274614
274688
|
init_uniqBy();
|
|
274615
|
-
init_bootstrap();
|
|
274616
274689
|
init_commands5();
|
|
274617
274690
|
init_Tool();
|
|
274618
274691
|
init_debug();
|
|
@@ -274662,7 +274735,7 @@ var init_SkillTool = __esm(() => {
|
|
|
274662
274735
|
return outputSchema12();
|
|
274663
274736
|
},
|
|
274664
274737
|
description: async ({ skill }) => `Execute skill: ${skill}`,
|
|
274665
|
-
prompt: async () => getPrompt20(
|
|
274738
|
+
prompt: async () => getPrompt20(process.cwd()),
|
|
274666
274739
|
toAutoClassifierInput: ({ skill }) => skill ?? "",
|
|
274667
274740
|
async validateInput({ skill }, context) {
|
|
274668
274741
|
const trimmed = skill.trim();
|
|
@@ -322785,8 +322858,8 @@ async function discoverSkillDirsForPaths2(filePaths, cwd) {
|
|
|
322785
322858
|
return newDirs.sort((a, b) => b.split(pathSep2).length - a.split(pathSep2).length);
|
|
322786
322859
|
}
|
|
322787
322860
|
async function addSkillDirectories2(dirs) {
|
|
322788
|
-
if (
|
|
322789
|
-
logForDebugging3("[skills] Dynamic skill discovery skipped:
|
|
322861
|
+
if (isEnvTruthy2(process.env.ATLAS_DISABLE_PROJECT_SKILLS) || isRestrictedToPluginOnly("skills")) {
|
|
322862
|
+
logForDebugging3("[skills] Dynamic skill discovery skipped: ATLAS_DISABLE_PROJECT_SKILLS kill switch or plugin-only policy");
|
|
322790
322863
|
return;
|
|
322791
322864
|
}
|
|
322792
322865
|
if (dirs.length === 0) {
|
|
@@ -322879,10 +322952,10 @@ var init_loadSkillsDir2 = __esm(() => {
|
|
|
322879
322952
|
logForDebugging3(`Loading skills from: managed=${managedSkillsDir}, user=${userSkillsDir}, project=[${projectSkillsDirs.join(", ")}]`);
|
|
322880
322953
|
const additionalDirs = getAdditionalDirectoriesForClaudeMd();
|
|
322881
322954
|
const skillsLocked = isRestrictedToPluginOnly("skills");
|
|
322882
|
-
const
|
|
322955
|
+
const projectSkillsEnabled = !skillsLocked && !isEnvTruthy2(process.env.ATLAS_DISABLE_PROJECT_SKILLS);
|
|
322883
322956
|
if (isBareMode()) {
|
|
322884
|
-
if (additionalDirs.length === 0 || !
|
|
322885
|
-
logForDebugging3(`[bare] Skipping skill dir discovery (${additionalDirs.length === 0 ? "no --add-dir" : "
|
|
322957
|
+
if (additionalDirs.length === 0 || !projectSkillsEnabled) {
|
|
322958
|
+
logForDebugging3(`[bare] Skipping skill dir discovery (${additionalDirs.length === 0 ? "no --add-dir" : "project skills disabled (kill switch) or skillsLocked"})`);
|
|
322886
322959
|
return [];
|
|
322887
322960
|
}
|
|
322888
322961
|
const additionalSkillsNested = await Promise.all(additionalDirs.map((dir) => loadSkillsFromSkillsDir2(join107(dir, getConfigDirName2(), "skills"), "projectSettings")));
|
|
@@ -322897,8 +322970,8 @@ var init_loadSkillsDir2 = __esm(() => {
|
|
|
322897
322970
|
] = await Promise.all([
|
|
322898
322971
|
isEnvTruthy2(process.env.ATLAS_DISABLE_POLICY_SKILLS) ? Promise.resolve([]) : loadSkillsFromSkillsDir2(managedSkillsDir, "policySettings"),
|
|
322899
322972
|
isSettingSourceEnabled2("userSettings") && !skillsLocked ? loadSkillsFromSkillsDir2(userSkillsDir, "userSettings") : Promise.resolve([]),
|
|
322900
|
-
|
|
322901
|
-
|
|
322973
|
+
projectSkillsEnabled ? Promise.all(projectSkillsDirs.map((dir) => loadSkillsFromSkillsDir2(dir, "projectSettings"))) : Promise.resolve([]),
|
|
322974
|
+
projectSkillsEnabled ? Promise.all(additionalDirs.map((dir) => loadSkillsFromSkillsDir2(join107(dir, getConfigDirName2(), "skills"), "projectSettings"))) : Promise.resolve([]),
|
|
322902
322975
|
skillsLocked ? Promise.resolve([]) : loadSkillsFromCommandsDir2(cwd)
|
|
322903
322976
|
]);
|
|
322904
322977
|
const allSkillsWithPaths = [
|
|
@@ -430252,6 +430325,7 @@ function wireContextHostPorts() {
|
|
|
430252
430325
|
});
|
|
430253
430326
|
setAutoCompactSettingsSource(() => getGlobalConfig().autoCompactEnabled);
|
|
430254
430327
|
setAutoCompactWindowSettingsSource(() => getInitialSettings2().autoCompactWindow);
|
|
430328
|
+
setLlmTimeoutSettingsSource(() => getInitialSettings2().llmTimeoutMs);
|
|
430255
430329
|
setTimeBasedMCConfigSource(() => getFeatureValue_CACHED_MAY_BE_STALE("atlas_slate_heron", TIME_BASED_MC_CONFIG_DEFAULTS));
|
|
430256
430330
|
clearPostCompactResetsForTesting();
|
|
430257
430331
|
if (feature("CONTEXT_COLLAPSE")) {
|
|
@@ -430280,6 +430354,7 @@ function wireContextHostPorts() {
|
|
|
430280
430354
|
}
|
|
430281
430355
|
var init_contextHostWiring = __esm(() => {
|
|
430282
430356
|
init_shared();
|
|
430357
|
+
init_modelprovider2();
|
|
430283
430358
|
init_engine();
|
|
430284
430359
|
init_config6();
|
|
430285
430360
|
init_settings3();
|
|
@@ -475911,7 +475986,8 @@ Error: sandbox required but unavailable: ${reason}
|
|
|
475911
475986
|
await onQueryImpl(latestMessages, newMessages, abortController, shouldQuery, additionalAllowedTools, mainLoopModelParam, effort);
|
|
475912
475987
|
} catch (error) {
|
|
475913
475988
|
logError3(error);
|
|
475914
|
-
|
|
475989
|
+
const llmTimeoutHint = llmTimeoutRemediationHint(error, getCurrentLlmTimeoutMs());
|
|
475990
|
+
setMessages((prev) => [...prev, createSystemMessage(`本轮执行出错:${errorMessage2(error)}。${llmTimeoutHint ? `${llmTimeoutHint} ` : ""}请重试。`, "error")]);
|
|
475915
475991
|
} finally {
|
|
475916
475992
|
if (queryGuard.end(thisGeneration)) {
|
|
475917
475993
|
setLastQueryCompletionTime(Date.now());
|
|
@@ -477590,6 +477666,7 @@ Note: ctrl + z now suspends AtlasHarness, ctrl + _ undoes input.
|
|
|
477590
477666
|
var import_compiler_runtime323, React137, import_react280, jsx_dev_runtime427, UltraplanChoiceDialog = () => null, UltraplanLaunchDialog = () => null, launchUltraplan2 = null, useVoiceIntegration2, VoiceKeybindingHandler2, useAntOrgWarningNotification = () => {}, getCoordinatorUserContext3, SUGGEST_BG_PR_NOOP = (_p, _n) => false, useScheduledTasks2, EMPTY_MCP_CLIENTS2, RECENT_SCROLL_REPIN_WINDOW_MS = 3000, TITLE_ANIMATION_FRAMES, TITLE_STATIC_PREFIX = "✳", TITLE_ANIMATION_INTERVAL_MS = 960;
|
|
477591
477667
|
var init_REPL = __esm(() => {
|
|
477592
477668
|
init_shared();
|
|
477669
|
+
init_modelprovider2();
|
|
477593
477670
|
init_bootstrap();
|
|
477594
477671
|
init_bootstrapState();
|
|
477595
477672
|
init_tokenBudget();
|
package/package.json
CHANGED