@atlasharness/atlascode 0.1.18 → 0.1.19
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 +109 -6
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -269513,6 +269513,67 @@ var init_UserToolRejectMessage = __esm(() => {
|
|
|
269513
269513
|
jsx_dev_runtime102 = __toESM(require_jsx_dev_runtime(), 1);
|
|
269514
269514
|
});
|
|
269515
269515
|
|
|
269516
|
+
// src/tui/components/permissions/permissionVerdict.ts
|
|
269517
|
+
function verdictLine(reason, mode) {
|
|
269518
|
+
const modeLabel = permissionModeTitle2(mode);
|
|
269519
|
+
switch (reason?.type) {
|
|
269520
|
+
case "rule": {
|
|
269521
|
+
const behavior = reason.rule.ruleBehavior;
|
|
269522
|
+
return `${VERDICT_PREFIX}: hit ${behavior} rule "${permissionRuleValueToString2(reason.rule.ruleValue)}" from ${getSettingSourceDisplayNameLowercase(reason.rule.source)}`;
|
|
269523
|
+
}
|
|
269524
|
+
case "classifier":
|
|
269525
|
+
return `${VERDICT_PREFIX}: ${reason.classifier} classifier says: ${reason.reason}`;
|
|
269526
|
+
case "mode":
|
|
269527
|
+
return `${VERDICT_PREFIX}: no rule matched — ${modeLabel} mode asks you`;
|
|
269528
|
+
case "other":
|
|
269529
|
+
return `${VERDICT_PREFIX}: no rule matched — ${modeLabel} mode asks you`;
|
|
269530
|
+
case "hook":
|
|
269531
|
+
return `${VERDICT_PREFIX}: hook "${reason.hookName}"${reason.hookSource ? ` (${reason.hookSource})` : ""}${reason.reason ? ` says: ${reason.reason}` : ""}`;
|
|
269532
|
+
case "safetyCheck":
|
|
269533
|
+
return `${VERDICT_PREFIX}: safety check — ${reason.reason}`;
|
|
269534
|
+
case "workingDir":
|
|
269535
|
+
return `${VERDICT_PREFIX}: ${reason.reason}`;
|
|
269536
|
+
case "subcommandResults": {
|
|
269537
|
+
const n = reason.reasons.size;
|
|
269538
|
+
return `${VERDICT_PREFIX}: ${n} sub-command${n === 1 ? "" : "s"} checked, ${modeLabel} mode asks you`;
|
|
269539
|
+
}
|
|
269540
|
+
case "permissionPromptTool":
|
|
269541
|
+
return `${VERDICT_PREFIX}: ${reason.permissionPromptToolName} handled this request`;
|
|
269542
|
+
case "asyncAgent":
|
|
269543
|
+
return `${VERDICT_PREFIX}: ${reason.reason}`;
|
|
269544
|
+
case "sandboxOverride":
|
|
269545
|
+
return `${VERDICT_PREFIX}: sandbox override (${reason.reason})`;
|
|
269546
|
+
default:
|
|
269547
|
+
return null;
|
|
269548
|
+
}
|
|
269549
|
+
}
|
|
269550
|
+
function successCardRenderMode(renderedMessage, userApproved) {
|
|
269551
|
+
if (renderedMessage !== null)
|
|
269552
|
+
return "full";
|
|
269553
|
+
return userApproved ? "marker" : "skip";
|
|
269554
|
+
}
|
|
269555
|
+
var VERDICT_PREFIX = "Verdict";
|
|
269556
|
+
var init_permissionVerdict = __esm(() => {
|
|
269557
|
+
init_constants5();
|
|
269558
|
+
init_permissionRuleParser2();
|
|
269559
|
+
init_PermissionMode();
|
|
269560
|
+
});
|
|
269561
|
+
|
|
269562
|
+
// src/tui/utils/userApprovals.ts
|
|
269563
|
+
function setUserApproval(toolUseID) {
|
|
269564
|
+
USER_APPROVALS.set(toolUseID, true);
|
|
269565
|
+
}
|
|
269566
|
+
function getUserApproval(toolUseID) {
|
|
269567
|
+
return USER_APPROVALS.has(toolUseID);
|
|
269568
|
+
}
|
|
269569
|
+
function deleteUserApproval(toolUseID) {
|
|
269570
|
+
USER_APPROVALS.delete(toolUseID);
|
|
269571
|
+
}
|
|
269572
|
+
var USER_APPROVALS;
|
|
269573
|
+
var init_userApprovals = __esm(() => {
|
|
269574
|
+
USER_APPROVALS = new Map;
|
|
269575
|
+
});
|
|
269576
|
+
|
|
269516
269577
|
// src/tui/components/messages/UserToolResultMessage/UserToolSuccessMessage.tsx
|
|
269517
269578
|
function UserToolSuccessMessage({
|
|
269518
269579
|
message,
|
|
@@ -269529,8 +269590,10 @@ function UserToolSuccessMessage({
|
|
|
269529
269590
|
const [theme] = useTheme();
|
|
269530
269591
|
const [classifierRule] = React32.useState(() => getClassifierApproval2(toolUseID));
|
|
269531
269592
|
const [yoloReason] = React32.useState(() => getYoloClassifierApproval2(toolUseID));
|
|
269593
|
+
const [userApproved] = React32.useState(() => getUserApproval(toolUseID));
|
|
269532
269594
|
React32.useEffect(() => {
|
|
269533
269595
|
deleteClassifierApproval2(toolUseID);
|
|
269596
|
+
deleteUserApproval(toolUseID);
|
|
269534
269597
|
}, [toolUseID]);
|
|
269535
269598
|
if (!message.toolUseResult || !tool) {
|
|
269536
269599
|
return null;
|
|
@@ -269548,7 +269611,8 @@ function UserToolSuccessMessage({
|
|
|
269548
269611
|
isTranscriptMode,
|
|
269549
269612
|
input: lookups.toolUseByToolUseID.get(toolUseID)?.input
|
|
269550
269613
|
}) ?? null;
|
|
269551
|
-
|
|
269614
|
+
const renderMode = successCardRenderMode(renderedMessage, userApproved);
|
|
269615
|
+
if (renderMode === "skip") {
|
|
269552
269616
|
return null;
|
|
269553
269617
|
}
|
|
269554
269618
|
const rendersAsAssistantText = tool.userFacingName(undefined) === "";
|
|
@@ -269578,12 +269642,28 @@ function UserToolSuccessMessage({
|
|
|
269578
269642
|
height: 1,
|
|
269579
269643
|
children: /* @__PURE__ */ jsx_dev_runtime103.jsxDEV(ThemedText, {
|
|
269580
269644
|
dimColor: true,
|
|
269581
|
-
children:
|
|
269582
|
-
|
|
269583
|
-
|
|
269645
|
+
children: [
|
|
269646
|
+
"Allowed by auto mode classifier: ",
|
|
269647
|
+
yoloReason
|
|
269648
|
+
]
|
|
269649
|
+
}, undefined, true, undefined, this)
|
|
269650
|
+
}, undefined, false, undefined, this) : null,
|
|
269651
|
+
userApproved && /* @__PURE__ */ jsx_dev_runtime103.jsxDEV(MessageResponse, {
|
|
269652
|
+
height: 1,
|
|
269653
|
+
children: /* @__PURE__ */ jsx_dev_runtime103.jsxDEV(ThemedText, {
|
|
269654
|
+
dimColor: true,
|
|
269655
|
+
children: [
|
|
269656
|
+
/* @__PURE__ */ jsx_dev_runtime103.jsxDEV(ThemedText, {
|
|
269657
|
+
color: "success",
|
|
269658
|
+
children: figures_default.tick
|
|
269659
|
+
}, undefined, false, undefined, this),
|
|
269660
|
+
" Allowed · your decision"
|
|
269661
|
+
]
|
|
269662
|
+
}, undefined, true, undefined, this)
|
|
269663
|
+
}, undefined, false, undefined, this)
|
|
269584
269664
|
]
|
|
269585
269665
|
}, undefined, true, undefined, this),
|
|
269586
|
-
/* @__PURE__ */ jsx_dev_runtime103.jsxDEV(SentryErrorBoundary, {
|
|
269666
|
+
renderMode === "full" ? /* @__PURE__ */ jsx_dev_runtime103.jsxDEV(SentryErrorBoundary, {
|
|
269587
269667
|
children: /* @__PURE__ */ jsx_dev_runtime103.jsxDEV(HookProgressMessage, {
|
|
269588
269668
|
hookEvent: "PostToolUse",
|
|
269589
269669
|
lookups,
|
|
@@ -269591,7 +269671,7 @@ function UserToolSuccessMessage({
|
|
|
269591
269671
|
verbose,
|
|
269592
269672
|
isTranscriptMode
|
|
269593
269673
|
}, undefined, false, undefined, this)
|
|
269594
|
-
}, undefined, false, undefined, this)
|
|
269674
|
+
}, undefined, false, undefined, this) : null
|
|
269595
269675
|
]
|
|
269596
269676
|
}, undefined, true, undefined, this);
|
|
269597
269677
|
}
|
|
@@ -269603,6 +269683,8 @@ var init_UserToolSuccessMessage = __esm(() => {
|
|
|
269603
269683
|
init_ink2();
|
|
269604
269684
|
init_Tool();
|
|
269605
269685
|
init_classifierApprovals();
|
|
269686
|
+
init_permissionVerdict();
|
|
269687
|
+
init_userApprovals();
|
|
269606
269688
|
init_MessageResponse();
|
|
269607
269689
|
init_HookProgressMessage();
|
|
269608
269690
|
React32 = __toESM(require_react(), 1);
|
|
@@ -441570,6 +441652,7 @@ function BashPermissionRequestInner({
|
|
|
441570
441652
|
if (value_0 === "yes-prefix-edited") {
|
|
441571
441653
|
const trimmedPrefix = (editablePrefix ?? "").trim();
|
|
441572
441654
|
logUnaryPermissionEvent("tool_use_single", toolUseConfirm, "accept");
|
|
441655
|
+
setUserApproval(toolUseConfirm.toolUseID);
|
|
441573
441656
|
if (!trimmedPrefix) {
|
|
441574
441657
|
toolUseConfirm.onAllow(toolUseConfirm.input, []);
|
|
441575
441658
|
} else {
|
|
@@ -441590,6 +441673,7 @@ function BashPermissionRequestInner({
|
|
|
441590
441673
|
if (feature("BASH_CLASSIFIER") && value_0 === "yes-classifier-reviewed") {
|
|
441591
441674
|
const trimmedDescription = classifierDescription.trim();
|
|
441592
441675
|
logUnaryPermissionEvent("tool_use_single", toolUseConfirm, "accept");
|
|
441676
|
+
setUserApproval(toolUseConfirm.toolUseID);
|
|
441593
441677
|
if (!trimmedDescription) {
|
|
441594
441678
|
toolUseConfirm.onAllow(toolUseConfirm.input, []);
|
|
441595
441679
|
} else {
|
|
@@ -441615,12 +441699,14 @@ function BashPermissionRequestInner({
|
|
|
441615
441699
|
case "yes": {
|
|
441616
441700
|
const trimmedFeedback_0 = acceptFeedback.trim();
|
|
441617
441701
|
logUnaryPermissionEvent("tool_use_single", toolUseConfirm, "accept");
|
|
441702
|
+
setUserApproval(toolUseConfirm.toolUseID);
|
|
441618
441703
|
toolUseConfirm.onAllow(toolUseConfirm.input, [], trimmedFeedback_0 || undefined);
|
|
441619
441704
|
onDone();
|
|
441620
441705
|
break;
|
|
441621
441706
|
}
|
|
441622
441707
|
case "yes-apply-suggestions": {
|
|
441623
441708
|
logUnaryPermissionEvent("tool_use_single", toolUseConfirm, "accept");
|
|
441709
|
+
setUserApproval(toolUseConfirm.toolUseID);
|
|
441624
441710
|
const permissionUpdates_0 = "suggestions" in toolUseConfirm.permissionResult ? toolUseConfirm.permissionResult.suggestions || [] : [];
|
|
441625
441711
|
toolUseConfirm.onAllow(toolUseConfirm.input, permissionUpdates_0);
|
|
441626
441712
|
onDone();
|
|
@@ -441633,6 +441719,7 @@ function BashPermissionRequestInner({
|
|
|
441633
441719
|
}
|
|
441634
441720
|
}
|
|
441635
441721
|
}
|
|
441722
|
+
const verdictLineText = verdictLine(toolUseConfirm.permissionResult.decisionReason, toolPermissionContext.mode);
|
|
441636
441723
|
const classifierSubtitle = feature("BASH_CLASSIFIER") ? toolUseConfirm.classifierAutoApproved ? /* @__PURE__ */ jsx_dev_runtime338.jsxDEV(ThemedText, {
|
|
441637
441724
|
children: [
|
|
441638
441725
|
/* @__PURE__ */ jsx_dev_runtime338.jsxDEV(ThemedText, {
|
|
@@ -441705,6 +441792,10 @@ function BashPermissionRequestInner({
|
|
|
441705
441792
|
/* @__PURE__ */ jsx_dev_runtime338.jsxDEV(ThemedBox_default, {
|
|
441706
441793
|
flexDirection: "column",
|
|
441707
441794
|
children: [
|
|
441795
|
+
verdictLineText !== null && /* @__PURE__ */ jsx_dev_runtime338.jsxDEV(ThemedText, {
|
|
441796
|
+
dimColor: true,
|
|
441797
|
+
children: verdictLineText
|
|
441798
|
+
}, undefined, false, undefined, this),
|
|
441708
441799
|
/* @__PURE__ */ jsx_dev_runtime338.jsxDEV(PermissionRuleExplanation, {
|
|
441709
441800
|
permissionResult: toolUseConfirm.permissionResult,
|
|
441710
441801
|
toolType: "command"
|
|
@@ -441783,6 +441874,8 @@ var init_BashPermissionRequest = __esm(() => {
|
|
|
441783
441874
|
init_PermissionDialog();
|
|
441784
441875
|
init_PermissionExplanation();
|
|
441785
441876
|
init_PermissionRuleExplanation();
|
|
441877
|
+
init_permissionVerdict();
|
|
441878
|
+
init_userApprovals();
|
|
441786
441879
|
init_SedEditPermissionRequest();
|
|
441787
441880
|
init_useShellPermissionFeedback();
|
|
441788
441881
|
init_utils13();
|
|
@@ -444925,6 +445018,7 @@ function PowerShellPermissionRequest(props) {
|
|
|
444925
445018
|
if (value === "yes-prefix-edited") {
|
|
444926
445019
|
const trimmedPrefix = (editablePrefix ?? "").trim();
|
|
444927
445020
|
logUnaryPermissionEvent("tool_use_single", toolUseConfirm, "accept");
|
|
445021
|
+
setUserApproval(toolUseConfirm.toolUseID);
|
|
444928
445022
|
if (!trimmedPrefix) {
|
|
444929
445023
|
toolUseConfirm.onAllow(toolUseConfirm.input, []);
|
|
444930
445024
|
} else {
|
|
@@ -444950,12 +445044,14 @@ function PowerShellPermissionRequest(props) {
|
|
|
444950
445044
|
case "yes": {
|
|
444951
445045
|
const trimmedFeedback = acceptFeedback.trim();
|
|
444952
445046
|
logUnaryPermissionEvent("tool_use_single", toolUseConfirm, "accept");
|
|
445047
|
+
setUserApproval(toolUseConfirm.toolUseID);
|
|
444953
445048
|
toolUseConfirm.onAllow(toolUseConfirm.input, [], trimmedFeedback || undefined);
|
|
444954
445049
|
onDone();
|
|
444955
445050
|
break;
|
|
444956
445051
|
}
|
|
444957
445052
|
case "yes-apply-suggestions": {
|
|
444958
445053
|
logUnaryPermissionEvent("tool_use_single", toolUseConfirm, "accept");
|
|
445054
|
+
setUserApproval(toolUseConfirm.toolUseID);
|
|
444959
445055
|
const permissionUpdates = "suggestions" in toolUseConfirm.permissionResult ? toolUseConfirm.permissionResult.suggestions || [] : [];
|
|
444960
445056
|
toolUseConfirm.onAllow(toolUseConfirm.input, permissionUpdates);
|
|
444961
445057
|
onDone();
|
|
@@ -444968,6 +445064,7 @@ function PowerShellPermissionRequest(props) {
|
|
|
444968
445064
|
}
|
|
444969
445065
|
}
|
|
444970
445066
|
}
|
|
445067
|
+
const verdictLineText = verdictLine(toolUseConfirm.permissionResult.decisionReason, toolPermissionContext.mode);
|
|
444971
445068
|
return /* @__PURE__ */ jsx_dev_runtime349.jsxDEV(PermissionDialog, {
|
|
444972
445069
|
workerBadge,
|
|
444973
445070
|
title: "PowerShell command",
|
|
@@ -445017,6 +445114,10 @@ function PowerShellPermissionRequest(props) {
|
|
|
445017
445114
|
/* @__PURE__ */ jsx_dev_runtime349.jsxDEV(ThemedBox_default, {
|
|
445018
445115
|
flexDirection: "column",
|
|
445019
445116
|
children: [
|
|
445117
|
+
verdictLineText !== null && /* @__PURE__ */ jsx_dev_runtime349.jsxDEV(ThemedText, {
|
|
445118
|
+
dimColor: true,
|
|
445119
|
+
children: verdictLineText
|
|
445120
|
+
}, undefined, false, undefined, this),
|
|
445020
445121
|
/* @__PURE__ */ jsx_dev_runtime349.jsxDEV(PermissionRuleExplanation, {
|
|
445021
445122
|
permissionResult: toolUseConfirm.permissionResult,
|
|
445022
445123
|
toolType: "command"
|
|
@@ -445081,6 +445182,8 @@ var init_PowerShellPermissionRequest = __esm(() => {
|
|
|
445081
445182
|
init_PermissionDialog();
|
|
445082
445183
|
init_PermissionExplanation();
|
|
445083
445184
|
init_PermissionRuleExplanation();
|
|
445185
|
+
init_permissionVerdict();
|
|
445186
|
+
init_userApprovals();
|
|
445084
445187
|
init_useShellPermissionFeedback();
|
|
445085
445188
|
init_utils13();
|
|
445086
445189
|
init_powershellToolUseOptions();
|
package/package.json
CHANGED