@atlasharness/atlascode 0.1.25 → 0.1.27
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 +94 -13
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -46479,11 +46479,15 @@ function validateCommandPaths(command, args, cwd, toolPermissionContext, compoun
|
|
|
46479
46479
|
decisionReason
|
|
46480
46480
|
};
|
|
46481
46481
|
}
|
|
46482
|
+
const effectiveDecisionReason = decisionReason ?? {
|
|
46483
|
+
type: "other",
|
|
46484
|
+
reason: `${command} target '${resolvedPath}' requires manual approval`
|
|
46485
|
+
};
|
|
46482
46486
|
return {
|
|
46483
46487
|
behavior: "ask",
|
|
46484
46488
|
message,
|
|
46485
46489
|
blockedPath: resolvedPath,
|
|
46486
|
-
decisionReason
|
|
46490
|
+
decisionReason: effectiveDecisionReason
|
|
46487
46491
|
};
|
|
46488
46492
|
}
|
|
46489
46493
|
}
|
|
@@ -46619,11 +46623,15 @@ function validateOutputRedirections(redirections, cwd, toolPermissionContext, co
|
|
|
46619
46623
|
decisionReason
|
|
46620
46624
|
};
|
|
46621
46625
|
}
|
|
46626
|
+
const effectiveDecisionReason = decisionReason ?? {
|
|
46627
|
+
type: "other",
|
|
46628
|
+
reason: `Output redirection target '${resolvedPath}' requires manual approval`
|
|
46629
|
+
};
|
|
46622
46630
|
return {
|
|
46623
46631
|
behavior: "ask",
|
|
46624
46632
|
message,
|
|
46625
46633
|
blockedPath: resolvedPath,
|
|
46626
|
-
decisionReason,
|
|
46634
|
+
decisionReason: effectiveDecisionReason,
|
|
46627
46635
|
suggestions: [
|
|
46628
46636
|
{
|
|
46629
46637
|
type: "addDirectories",
|
|
@@ -51973,7 +51981,11 @@ function createPermissionGate(context, opts = {}) {
|
|
|
51973
51981
|
return async (tool, input) => {
|
|
51974
51982
|
const decision = await hasPermissionsToUseTool(tool, input ?? {}, { getToolPermissionContext: () => context, getAppState: opts.getAppState });
|
|
51975
51983
|
if (decision.behavior === "allow") {
|
|
51976
|
-
return {
|
|
51984
|
+
return {
|
|
51985
|
+
allowed: true,
|
|
51986
|
+
updatedInput: decision.updatedInput,
|
|
51987
|
+
decisionReason: decision.decisionReason
|
|
51988
|
+
};
|
|
51977
51989
|
}
|
|
51978
51990
|
if (decision.behavior === "deny") {
|
|
51979
51991
|
return { allowed: false, reason: decision.message };
|
|
@@ -123440,7 +123452,7 @@ var _spSectionCache, _agentColorMap, addInvokedSkill = () => ({}), addSlowOperat
|
|
|
123440
123452
|
_spSectionCache.clear();
|
|
123441
123453
|
}, getSystemPromptSectionCache = () => _spSectionCache, setSystemPromptSectionCacheEntry = (name, value) => {
|
|
123442
123454
|
_spSectionCache.set(name, value);
|
|
123443
|
-
}, setCachedClaudeMdContent = () => ({}), getLastApiCompletionTimestamp = () => ({}), getPromptCache1hAllowlist = () =>
|
|
123455
|
+
}, setCachedClaudeMdContent = () => ({}), getLastApiCompletionTimestamp = () => ({}), getPromptCache1hAllowlist = () => null, getPromptCache1hEligible = () => null, setPromptCache1hAllowlist = () => ({}), setPromptCache1hEligible = () => ({}), setLastApiCompletionTimestamp = () => ({}), hasExitedPlanModeInSession = () => ({}), getLastEmittedDate = () => ({}), preferThirdPartyAuthentication = () => ({}), getApiKeyFromFd = () => ({}), getOauthTokenFromFd = () => ({}), setApiKeyFromFd = () => ({}), setOauthTokenFromFd = () => ({}), onSessionSwitch = () => ({}), getSessionCronTasks = () => ({}), removeSessionCronTasks = () => ({}), addSessionCronTask = () => ({}), getCachedClaudeMdContent = () => ({}), setLastClassifierRequests = () => ({}), clearRegisteredPluginHooks = () => ({}), getSessionIngressToken = () => ({}), setSessionIngressToken = () => ({}), getSessionProjectDir = () => null, getLastMainRequestId = () => ({}), getStatsStore = () => null, getFlagSettingsPath = () => "/tmp/.claude-flags.json", needsPlanModeExitAttachment = () => ({}), needsAutoModeExitAttachment = () => ({}), getScheduledTasksEnabled = () => ({}), _turnHookDurationMs = 0, _turnHookCount = 0, _turnToolDurationMs = 0, _turnToolCount = 0, _turnClassifierDurationMs = 0, _turnClassifierCount = 0, addToTurnHookDuration = (durationMs) => {
|
|
123444
123456
|
_turnHookDurationMs += durationMs;
|
|
123445
123457
|
_turnHookCount++;
|
|
123446
123458
|
}, handleAutoModeTransition = () => ({}), addToTurnClassifierDuration = (durationMs) => {
|
|
@@ -269655,8 +269667,12 @@ function successCardRenderMode(renderedMessage, userApproved) {
|
|
|
269655
269667
|
return "full";
|
|
269656
269668
|
return userApproved ? "marker" : "skip";
|
|
269657
269669
|
}
|
|
269670
|
+
function hasSuccessCardMarker(allowVerdictLine, yoloReason, classifierRule) {
|
|
269671
|
+
return allowVerdictLine !== null || feature("TRANSCRIPT_CLASSIFIER") && yoloReason !== undefined || feature("BASH_CLASSIFIER") && classifierRule !== undefined;
|
|
269672
|
+
}
|
|
269658
269673
|
var VERDICT_PREFIX = "Verdict";
|
|
269659
269674
|
var init_permissionVerdict = __esm(() => {
|
|
269675
|
+
init_shared();
|
|
269660
269676
|
init_constants5();
|
|
269661
269677
|
init_permissionRuleParser2();
|
|
269662
269678
|
init_PermissionMode();
|
|
@@ -269677,6 +269693,21 @@ var init_userApprovals = __esm(() => {
|
|
|
269677
269693
|
USER_APPROVALS = new Map;
|
|
269678
269694
|
});
|
|
269679
269695
|
|
|
269696
|
+
// src/tui/utils/allowVerdicts.ts
|
|
269697
|
+
function setAllowVerdict(toolUseID, verdict) {
|
|
269698
|
+
ALLOW_VERDICTS.set(toolUseID, verdict);
|
|
269699
|
+
}
|
|
269700
|
+
function getAllowVerdict(toolUseID) {
|
|
269701
|
+
return ALLOW_VERDICTS.get(toolUseID);
|
|
269702
|
+
}
|
|
269703
|
+
function deleteAllowVerdict(toolUseID) {
|
|
269704
|
+
ALLOW_VERDICTS.delete(toolUseID);
|
|
269705
|
+
}
|
|
269706
|
+
var ALLOW_VERDICTS;
|
|
269707
|
+
var init_allowVerdicts = __esm(() => {
|
|
269708
|
+
ALLOW_VERDICTS = new Map;
|
|
269709
|
+
});
|
|
269710
|
+
|
|
269680
269711
|
// src/tui/components/messages/UserToolResultMessage/UserToolSuccessMessage.tsx
|
|
269681
269712
|
function UserToolSuccessMessage({
|
|
269682
269713
|
message,
|
|
@@ -269694,9 +269725,11 @@ function UserToolSuccessMessage({
|
|
|
269694
269725
|
const [classifierRule] = React32.useState(() => getClassifierApproval2(toolUseID));
|
|
269695
269726
|
const [yoloReason] = React32.useState(() => getYoloClassifierApproval2(toolUseID));
|
|
269696
269727
|
const [userApproved] = React32.useState(() => getUserApproval(toolUseID));
|
|
269728
|
+
const [allowVerdict] = React32.useState(() => getAllowVerdict(toolUseID));
|
|
269697
269729
|
React32.useEffect(() => {
|
|
269698
269730
|
deleteClassifierApproval2(toolUseID);
|
|
269699
269731
|
deleteUserApproval(toolUseID);
|
|
269732
|
+
deleteAllowVerdict(toolUseID);
|
|
269700
269733
|
}, [toolUseID]);
|
|
269701
269734
|
if (!message.toolUseResult || !tool) {
|
|
269702
269735
|
return null;
|
|
@@ -269714,8 +269747,19 @@ function UserToolSuccessMessage({
|
|
|
269714
269747
|
isTranscriptMode,
|
|
269715
269748
|
input: lookups.toolUseByToolUseID.get(toolUseID)?.input
|
|
269716
269749
|
}) ?? null;
|
|
269750
|
+
let allowVerdictLine = null;
|
|
269751
|
+
if (allowVerdict) {
|
|
269752
|
+
const vReason = allowVerdict.reason;
|
|
269753
|
+
const vMode = allowVerdict.mode;
|
|
269754
|
+
if (vMode === "bypassPermissions") {
|
|
269755
|
+
allowVerdictLine = verdictLine({ type: "other", reason: "" }, "bypassPermissions", tool.name);
|
|
269756
|
+
} else if (vReason?.type === "rule" && vReason.rule.ruleBehavior === "allow") {
|
|
269757
|
+
allowVerdictLine = verdictLine(vReason, vMode, tool.name);
|
|
269758
|
+
}
|
|
269759
|
+
}
|
|
269760
|
+
const hasMarkerLine = hasSuccessCardMarker(allowVerdictLine, yoloReason, classifierRule);
|
|
269717
269761
|
const renderMode = successCardRenderMode(renderedMessage, userApproved);
|
|
269718
|
-
if (renderMode === "skip") {
|
|
269762
|
+
if (renderMode === "skip" && !hasMarkerLine) {
|
|
269719
269763
|
return null;
|
|
269720
269764
|
}
|
|
269721
269765
|
const rendersAsAssistantText = tool.userFacingName(undefined) === "";
|
|
@@ -269746,8 +269790,9 @@ function UserToolSuccessMessage({
|
|
|
269746
269790
|
children: /* @__PURE__ */ jsx_dev_runtime103.jsxDEV(ThemedText, {
|
|
269747
269791
|
dimColor: true,
|
|
269748
269792
|
children: [
|
|
269749
|
-
"
|
|
269750
|
-
yoloReason
|
|
269793
|
+
"Auto-approved by classifier: ",
|
|
269794
|
+
yoloReason,
|
|
269795
|
+
"."
|
|
269751
269796
|
]
|
|
269752
269797
|
}, undefined, true, undefined, this)
|
|
269753
269798
|
}, undefined, false, undefined, this) : null,
|
|
@@ -269763,6 +269808,13 @@ function UserToolSuccessMessage({
|
|
|
269763
269808
|
" Allowed · your decision"
|
|
269764
269809
|
]
|
|
269765
269810
|
}, undefined, true, undefined, this)
|
|
269811
|
+
}, undefined, false, undefined, this),
|
|
269812
|
+
allowVerdictLine && /* @__PURE__ */ jsx_dev_runtime103.jsxDEV(MessageResponse, {
|
|
269813
|
+
height: 1,
|
|
269814
|
+
children: /* @__PURE__ */ jsx_dev_runtime103.jsxDEV(ThemedText, {
|
|
269815
|
+
dimColor: true,
|
|
269816
|
+
children: allowVerdictLine
|
|
269817
|
+
}, undefined, false, undefined, this)
|
|
269766
269818
|
}, undefined, false, undefined, this)
|
|
269767
269819
|
]
|
|
269768
269820
|
}, undefined, true, undefined, this),
|
|
@@ -269788,6 +269840,7 @@ var init_UserToolSuccessMessage = __esm(() => {
|
|
|
269788
269840
|
init_classifierApprovals();
|
|
269789
269841
|
init_permissionVerdict();
|
|
269790
269842
|
init_userApprovals();
|
|
269843
|
+
init_allowVerdicts();
|
|
269791
269844
|
init_MessageResponse();
|
|
269792
269845
|
init_HookProgressMessage();
|
|
269793
269846
|
React32 = __toESM(require_react(), 1);
|
|
@@ -272394,14 +272447,14 @@ function getCacheControl({
|
|
|
272394
272447
|
}
|
|
272395
272448
|
function should1hCacheTTL(querySource) {
|
|
272396
272449
|
let userEligible = getPromptCache1hEligible();
|
|
272397
|
-
if (userEligible
|
|
272450
|
+
if (typeof userEligible !== "boolean") {
|
|
272398
272451
|
userEligible = false;
|
|
272399
272452
|
setPromptCache1hEligible(userEligible);
|
|
272400
272453
|
}
|
|
272401
272454
|
if (!userEligible)
|
|
272402
272455
|
return false;
|
|
272403
272456
|
let allowlist = getPromptCache1hAllowlist();
|
|
272404
|
-
if (allowlist
|
|
272457
|
+
if (!Array.isArray(allowlist)) {
|
|
272405
272458
|
const config = getFeatureValue_CACHED_MAY_BE_STALE("atlas_prompt_cache_1h_config", {});
|
|
272406
272459
|
allowlist = config.allowlist ?? [];
|
|
272407
272460
|
setPromptCache1hAllowlist(allowlist);
|
|
@@ -319340,8 +319393,19 @@ function buildInteractiveGate(params) {
|
|
|
319340
319393
|
});
|
|
319341
319394
|
return async (tool, input, callContext) => {
|
|
319342
319395
|
const verdict = await engineGate(tool, input);
|
|
319343
|
-
if (!verdict.ask)
|
|
319396
|
+
if (!verdict.ask) {
|
|
319397
|
+
if (verdict.allowed && verdict.decisionReason) {
|
|
319398
|
+
const tpc = (params.getAppState?.() ?? {
|
|
319399
|
+
toolPermissionContext: params.toolPermissionContext
|
|
319400
|
+
}).toolPermissionContext;
|
|
319401
|
+
const tpcMode = tpc?.mode ?? "default";
|
|
319402
|
+
setAllowVerdict(callContext?.toolUseId ?? "", {
|
|
319403
|
+
reason: verdict.decisionReason,
|
|
319404
|
+
mode: tpcMode
|
|
319405
|
+
});
|
|
319406
|
+
}
|
|
319344
319407
|
return verdict;
|
|
319408
|
+
}
|
|
319345
319409
|
const decision = await params.canUseTool(tool, input ?? {}, params.toolUseContext, callContext?.assistantMessage, callContext?.toolUseId ?? "");
|
|
319346
319410
|
if (decision.behavior === "allow") {
|
|
319347
319411
|
return { allowed: true, updatedInput: decision.updatedInput };
|
|
@@ -319351,6 +319415,7 @@ function buildInteractiveGate(params) {
|
|
|
319351
319415
|
}
|
|
319352
319416
|
var init_loopPermissionBridge = __esm(() => {
|
|
319353
319417
|
init_engine();
|
|
319418
|
+
init_allowVerdicts();
|
|
319354
319419
|
});
|
|
319355
319420
|
|
|
319356
319421
|
// src/tui/agentLoopDeps.ts
|
|
@@ -337638,14 +337703,24 @@ var classifierDecisionModule, autoModeStateModule3, CLASSIFIER_FAIL_CLOSED_REFRE
|
|
|
337638
337703
|
if (denialLimitResult) {
|
|
337639
337704
|
return denialLimitResult;
|
|
337640
337705
|
}
|
|
337706
|
+
if (appState.toolPermissionContext.shouldAvoidPermissionPrompts) {
|
|
337707
|
+
return {
|
|
337708
|
+
behavior: "deny",
|
|
337709
|
+
decisionReason: {
|
|
337710
|
+
type: "classifier",
|
|
337711
|
+
classifier: "auto-mode",
|
|
337712
|
+
reason: classifierResult.reason
|
|
337713
|
+
},
|
|
337714
|
+
message: buildYoloRejectionMessage(classifierResult.reason)
|
|
337715
|
+
};
|
|
337716
|
+
}
|
|
337641
337717
|
return {
|
|
337642
|
-
|
|
337718
|
+
...result,
|
|
337643
337719
|
decisionReason: {
|
|
337644
337720
|
type: "classifier",
|
|
337645
337721
|
classifier: "auto-mode",
|
|
337646
337722
|
reason: classifierResult.reason
|
|
337647
|
-
}
|
|
337648
|
-
message: buildYoloRejectionMessage(classifierResult.reason)
|
|
337723
|
+
}
|
|
337649
337724
|
};
|
|
337650
337725
|
}
|
|
337651
337726
|
const newDenialState = recordSuccess(denialState);
|
|
@@ -465857,6 +465932,11 @@ function useCanUseTool(setToolUseConfirmQueue, setToolPermissionContext) {
|
|
|
465857
465932
|
if (feature("TRANSCRIPT_CLASSIFIER") && result.decisionReason?.type === "classifier" && result.decisionReason.classifier === "auto-mode") {
|
|
465858
465933
|
setYoloClassifierApproval2(toolUseID, result.decisionReason.reason);
|
|
465859
465934
|
}
|
|
465935
|
+
const allowAppState = toolUseContext.getAppState();
|
|
465936
|
+
setAllowVerdict(toolUseID, {
|
|
465937
|
+
reason: result.decisionReason,
|
|
465938
|
+
mode: allowAppState.toolPermissionContext?.mode ?? "default"
|
|
465939
|
+
});
|
|
465860
465940
|
ctx.logDecision({
|
|
465861
465941
|
decision: "accept",
|
|
465862
465942
|
source: "config"
|
|
@@ -466040,6 +466120,7 @@ var init_useCanUseTool = __esm(() => {
|
|
|
466040
466120
|
init_PermissionContext();
|
|
466041
466121
|
init_permissionLogging();
|
|
466042
466122
|
init_decisionLog();
|
|
466123
|
+
init_allowVerdicts();
|
|
466043
466124
|
import_compiler_runtime303 = __toESM(require_compiler_runtime(), 1);
|
|
466044
466125
|
jsx_dev_runtime404 = __toESM(require_jsx_dev_runtime(), 1);
|
|
466045
466126
|
useCanUseTool_default = useCanUseTool;
|
package/package.json
CHANGED