pushary 1.9.94 → 1.9.96
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/CHANGELOG.md +9 -0
- package/dist/{api-QBIRIMGU.js → api-FPEL3PLH.js} +10 -10
- package/dist/bin/pushary-bell-hook.js +26 -26
- package/dist/bin/pushary-bell.js +10 -10
- package/dist/bin/pushary-claude.js +27 -27
- package/dist/bin/pushary-clean.js +34 -34
- package/dist/bin/pushary-codex-bridge.js +21 -21
- package/dist/bin/pushary-codex-hook.js +31 -31
- package/dist/bin/pushary-codex-session.js +8 -8
- package/dist/bin/pushary-codex.js +14 -14
- package/dist/bin/pushary-connect.js +27 -27
- package/dist/bin/pushary-cowork.js +5 -5
- package/dist/bin/pushary-daemon.js +39 -39
- package/dist/bin/pushary-disconnect.js +26 -26
- package/dist/bin/pushary-display-hook.js +17 -17
- package/dist/bin/pushary-doctor.js +42 -42
- package/dist/bin/pushary-elicitation-hook.js +26 -26
- package/dist/bin/pushary-gemini-bridge.js +15 -15
- package/dist/bin/pushary-gemini-hook.js +28 -28
- package/dist/bin/pushary-hook.js +30 -30
- package/dist/bin/pushary-login.js +20 -20
- package/dist/bin/pushary-logout.js +25 -25
- package/dist/bin/pushary-mcp.js +11 -11
- package/dist/bin/pushary-mode.js +15 -15
- package/dist/bin/pushary-notification-hook.js +25 -25
- package/dist/bin/pushary-opencode-hook.js +27 -27
- package/dist/bin/pushary-permission-denied-hook.js +30 -30
- package/dist/bin/pushary-permission-hook.js +30 -30
- package/dist/bin/pushary-post-hook.js +25 -25
- package/dist/bin/pushary-prompt-hook.js +25 -25
- package/dist/bin/pushary-session-end-hook.js +27 -27
- package/dist/bin/pushary-session-start-hook.js +35 -35
- package/dist/bin/pushary-setup.js +48 -48
- package/dist/bin/pushary-stats.js +5 -5
- package/dist/bin/pushary-status.js +32 -32
- package/dist/bin/pushary-stop-hook.js +25 -25
- package/dist/bin/pushary-stopfailure-hook.js +25 -25
- package/dist/bin/pushary-suggestions.js +15 -15
- package/dist/bin/pushary-transcript-register.js +18 -18
- package/dist/bin/pushary-transcripts.js +26 -26
- package/dist/bin/pushary-upgrade.js +40 -40
- package/dist/bin/pushary-wait.js +15 -15
- package/dist/bin/pushary.js +7 -7
- package/dist/{chunk-XASOD3XX.js → chunk-2DF4TBGX.js} +1 -1
- package/dist/{chunk-AEKTC2DX.js → chunk-2QFD5XGU.js} +3 -3
- package/dist/{chunk-5ZBYW7IO.js → chunk-3GPXHHBM.js} +1 -1
- package/dist/{chunk-OSDL6OND.js → chunk-3QS2RCCZ.js} +6 -6
- package/dist/{chunk-MC7I3SZW.js → chunk-3QT3DMNX.js} +1 -1
- package/dist/{chunk-UC6IZRXP.js → chunk-3X3ALGMP.js} +4 -4
- package/dist/{chunk-BE4KMA7N.js → chunk-4BLNOWGZ.js} +19 -18
- package/dist/{chunk-E2WYLZIL.js → chunk-6JZNZTGZ.js} +3 -3
- package/dist/{chunk-FQZSKWWL.js → chunk-6YG5PZZS.js} +1 -1
- package/dist/{chunk-GPGLRSGY.js → chunk-77HBRZJI.js} +3 -3
- package/dist/{chunk-X7GKDLW7.js → chunk-7CW3K3B5.js} +5 -5
- package/dist/{chunk-ANZECRZO.js → chunk-AEOYYLXF.js} +3 -3
- package/dist/{chunk-RGMS5EDS.js → chunk-ARDQBF25.js} +1 -1
- package/dist/{chunk-QU2G6MM7.js → chunk-B4G4Q2AF.js} +1 -1
- package/dist/{chunk-YQCRX4T6.js → chunk-B75SIY5C.js} +3 -3
- package/dist/{chunk-K3E3NFTT.js → chunk-BDCFB4NV.js} +6 -6
- package/dist/{chunk-4YSFD4RY.js → chunk-BKN5E4L5.js} +1 -1
- package/dist/{chunk-QR7RXGNF.js → chunk-C4IKRLT4.js} +2 -2
- package/dist/{chunk-FSMR6GJT.js → chunk-CLN5W5QP.js} +5 -5
- package/dist/{chunk-Z5QJONDX.js → chunk-CQ3YV6QI.js} +2 -2
- package/dist/{chunk-SKYDYDGX.js → chunk-CRJDKGEF.js} +5 -5
- package/dist/{chunk-RCDCFFG4.js → chunk-CTKJVVDL.js} +3 -3
- package/dist/{chunk-PGCDYBKG.js → chunk-DN3QW2TT.js} +3 -3
- package/dist/{chunk-HZQIC3DG.js → chunk-EMVK57K7.js} +2 -2
- package/dist/{chunk-5QSPRDUO.js → chunk-EPFI6W2K.js} +1 -1
- package/dist/{chunk-HHE7ONVT.js → chunk-GAZPL742.js} +4 -4
- package/dist/{chunk-HHKBWPXA.js → chunk-HOYWYQNC.js} +5 -5
- package/dist/{chunk-KH3QOWTE.js → chunk-HY7G3PWJ.js} +3 -3
- package/dist/{chunk-3GZCHFYV.js → chunk-IVYKPYMH.js} +3 -3
- package/dist/{chunk-QVCDU4NT.js → chunk-J3W32P43.js} +1 -1
- package/dist/{chunk-3DASOC3M.js → chunk-JCYXG6LQ.js} +3 -3
- package/dist/{chunk-X5DCL36E.js → chunk-JU3JYEUG.js} +4 -4
- package/dist/{chunk-Z4JULPCS.js → chunk-KG7GT7UW.js} +1 -1
- package/dist/{chunk-SSXMA23D.js → chunk-KHGW7THQ.js} +4 -4
- package/dist/{chunk-6YX4VASU.js → chunk-LGJPT33C.js} +2 -2
- package/dist/{chunk-CS2C7S5L.js → chunk-M52UDSMQ.js} +5 -5
- package/dist/{chunk-ERQD5UVH.js → chunk-M7ZV5IPA.js} +7 -7
- package/dist/{chunk-TYHOBIDF.js → chunk-MSPHJNUL.js} +1 -1
- package/dist/{chunk-IMNXYNBJ.js → chunk-N2KK2NSY.js} +2 -2
- package/dist/{chunk-EFCHGKAD.js → chunk-NGSJHUQN.js} +1 -1
- package/dist/{chunk-VDBRLNW7.js → chunk-OP2WJEPY.js} +1 -1
- package/dist/{chunk-ZZ5QZ24I.js → chunk-OQY4G7FS.js} +1 -1
- package/dist/{chunk-XERTD7VZ.js → chunk-OS32P4RZ.js} +81 -37
- package/dist/{chunk-4N6MND55.js → chunk-PD2DWO4X.js} +2 -2
- package/dist/{chunk-CDIVGMBR.js → chunk-PDRPVVZX.js} +2 -2
- package/dist/{chunk-6SN6L5YT.js → chunk-QDS55ODM.js} +11 -11
- package/dist/{chunk-4GNFBBE6.js → chunk-R2RCFCFW.js} +6 -6
- package/dist/{chunk-JLWI2HZF.js → chunk-SARU6WNW.js} +1 -1
- package/dist/{chunk-UFT4R4V7.js → chunk-SI2CJ2BB.js} +3 -3
- package/dist/{chunk-K56A3LSA.js → chunk-SISYAMDC.js} +4 -4
- package/dist/{chunk-4YPTEVZD.js → chunk-T2Z5ITWJ.js} +3 -3
- package/dist/{chunk-AMPF5FAS.js → chunk-T7X5MQ3H.js} +1 -1
- package/dist/{chunk-2TA5UKNE.js → chunk-TAMHTWQZ.js} +10 -10
- package/dist/{chunk-7Y3AQNHV.js → chunk-TQKVKV76.js} +5 -5
- package/dist/{chunk-HRFOVTCQ.js → chunk-TTK2DLUS.js} +10 -10
- package/dist/{chunk-REV2QMUD.js → chunk-TVGOSEWS.js} +4 -4
- package/dist/{chunk-IB5MLSE3.js → chunk-TXDFQD2I.js} +1 -1
- package/dist/{chunk-CA2V7TKX.js → chunk-TZWK2BVY.js} +6 -6
- package/dist/{chunk-AUIRBCYE.js → chunk-UFWRBHTV.js} +3 -3
- package/dist/{chunk-OWCWJBGW.js → chunk-V7EWOHNV.js} +4 -4
- package/dist/{chunk-QYP4EEDA.js → chunk-VTFXPV4U.js} +2 -2
- package/dist/{chunk-JCZ7WE5G.js → chunk-VX27HJF6.js} +7 -7
- package/dist/{chunk-SV6WE5QB.js → chunk-WUYB3J3Q.js} +2 -2
- package/dist/{chunk-JJ2AA3N6.js → chunk-WVDPP7OQ.js} +5 -5
- package/dist/{chunk-KXCSF2IK.js → chunk-WZADX5VO.js} +6 -6
- package/dist/{chunk-QNFDU72D.js → chunk-XLM2JZBE.js} +1 -1
- package/dist/{chunk-5M6ASRLB.js → chunk-XLRPJHXN.js} +1 -1
- package/dist/{chunk-BOHUB5VP.js → chunk-XZHJVGR3.js} +2 -2
- package/dist/{chunk-LFIFIIMK.js → chunk-YCYFREHD.js} +2 -2
- package/dist/{chunk-F74RBPJY.js → chunk-YGMSDYOH.js} +6 -6
- package/dist/{codex-app-cards-switch-QEMMPNK3.js → codex-app-cards-switch-7YTDIMCX.js} +11 -11
- package/dist/{codex-desktop-launch-LNIZPXSJ.js → codex-desktop-launch-CICLFWQX.js} +1 -1
- package/dist/{codex-session-launch-IZ4IQDS7.js → codex-session-launch-KW7VUPAH.js} +18 -18
- package/dist/{config-3J5OOY3O.js → config-632JSNBM.js} +3 -3
- package/dist/{global-upgrade-LQM7IFAP.js → global-upgrade-BMCLOI2P.js} +10 -10
- package/dist/{identity-IQ3JVAIM.js → identity-UCVTGQHM.js} +4 -4
- package/dist/{live-capabilities-3AWVBJSK.js → live-capabilities-5VPEAE37.js} +5 -5
- package/dist/{paths-TAAVCO2D.js → paths-NCKEVGEI.js} +3 -3
- package/dist/{reapply-37FCVQCJ.js → reapply-UPZ2L4ID.js} +28 -28
- package/dist/src/index.js +29 -29
- package/dist/{upgrade-lock-GWB57A36.js → upgrade-lock-J36URBLG.js} +4 -4
- package/dist/{usage-QJYVQ3GS.js → usage-BL3KXNWQ.js} +3 -3
- package/package.json +1 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
notificationAnswerStep
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3QS2RCCZ.js";
|
|
4
4
|
import {
|
|
5
5
|
canChangeApprovalSettings
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-EMVK57K7.js";
|
|
7
7
|
import {
|
|
8
8
|
matchMacAccountStep,
|
|
9
9
|
retryAgentCommand
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-IVYKPYMH.js";
|
|
11
11
|
import {
|
|
12
12
|
EXIT
|
|
13
13
|
} from "./chunk-KZERVKTD.js";
|
|
14
14
|
import {
|
|
15
15
|
NPX_LATEST_COMMAND
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-6YG5PZZS.js";
|
|
17
17
|
|
|
18
18
|
// src/setup/closing.ts
|
|
19
19
|
var ACTIVITY_URL = "pushary.com/dashboard/agent/activity";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
realpath
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UFWRBHTV.js";
|
|
4
4
|
import {
|
|
5
5
|
findNativeClaudeInstall
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-J3W32P43.js";
|
|
7
7
|
import {
|
|
8
8
|
readGlobalPrefixAsync,
|
|
9
9
|
resolveGlobalBinary,
|
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
resolvePackageVersionFromBinary,
|
|
14
14
|
resolvePathBinary,
|
|
15
15
|
resolvePathBinaryAsync
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-77HBRZJI.js";
|
|
17
17
|
import {
|
|
18
18
|
MANAGED_PROVIDERS
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-OS32P4RZ.js";
|
|
20
20
|
|
|
21
21
|
// src/live-capabilities.ts
|
|
22
22
|
import { homedir } from "os";
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
codexHome,
|
|
8
8
|
codexHooksJsonIn,
|
|
9
9
|
isPusharyCodexCommand
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-YCYFREHD.js";
|
|
11
11
|
import {
|
|
12
12
|
resolvePathBinary
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-77HBRZJI.js";
|
|
14
14
|
import {
|
|
15
15
|
getPackageVersion
|
|
16
16
|
} from "./chunk-ZVU6WMMU.js";
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
macAppBridgeAvailable
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BDCFB4NV.js";
|
|
4
4
|
import {
|
|
5
5
|
keyPrefix
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-TVGOSEWS.js";
|
|
7
7
|
import {
|
|
8
8
|
bridgeAgentKey
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-YCYFREHD.js";
|
|
10
10
|
import {
|
|
11
11
|
readJsonSafe
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-77HBRZJI.js";
|
|
13
13
|
import {
|
|
14
14
|
isRecord,
|
|
15
15
|
isValidApiKey
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-OS32P4RZ.js";
|
|
17
17
|
|
|
18
18
|
// src/shared-mcp-key.ts
|
|
19
19
|
var asRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
registerTranscript
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QDS55ODM.js";
|
|
4
4
|
import {
|
|
5
5
|
namedEvent
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7CW3K3B5.js";
|
|
7
7
|
import {
|
|
8
8
|
isBridgeLocator,
|
|
9
9
|
liveBridgeProbe,
|
|
10
10
|
pusharyHookExecutable,
|
|
11
11
|
resolveBridgeStub
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-SISYAMDC.js";
|
|
13
13
|
import {
|
|
14
14
|
writeDegraded
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-CRJDKGEF.js";
|
|
16
16
|
import {
|
|
17
17
|
cursorUserHooks
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-YCYFREHD.js";
|
|
19
19
|
import {
|
|
20
20
|
atLeast,
|
|
21
21
|
parseVersion
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-77HBRZJI.js";
|
|
23
23
|
import {
|
|
24
24
|
CURSOR_GATE_COVERAGE,
|
|
25
25
|
CURSOR_GATE_SCRIPT,
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
isGrokSessionEndStop,
|
|
34
34
|
isRecord,
|
|
35
35
|
toolsCoveredByGateEntry
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-OS32P4RZ.js";
|
|
37
37
|
|
|
38
38
|
// src/tool-hook-input.ts
|
|
39
39
|
var OPTIONAL_TEXT_FIELDS = ["hook_event_name", "session_id", "cwd", "transcript_path", "tool_use_id", "permission_mode", "cursor_version"];
|
|
@@ -4538,12 +4538,14 @@ var sqlClientChangesData = (invocation) => {
|
|
|
4538
4538
|
var PULL_REQUEST_CLIS = /* @__PURE__ */ new Set(["gh", "glab"]);
|
|
4539
4539
|
var PULL_REQUEST_NOUNS = /* @__PURE__ */ new Set(["pr", "mr"]);
|
|
4540
4540
|
var MERGE_SUBCOMMAND = "merge";
|
|
4541
|
-
var PULL_REQUEST_MERGE_PATH = /(?:^|\/)pulls
|
|
4541
|
+
var PULL_REQUEST_MERGE_PATH = /(?:^|\/)pulls\/\d+\/merge$/;
|
|
4542
|
+
var PULL_REQUEST_MERGE_PATH_SPELLED_ANY_WAY = /(?:^|\/)pulls\/[^/\s]+\/merge(?:[?#]|$)/;
|
|
4542
4543
|
var mergesAPullRequest = ({ program, args }) => {
|
|
4543
4544
|
if (program === void 0 || !PULL_REQUEST_CLIS.has(basenameOf(program.text))) return false;
|
|
4544
4545
|
const words = args.filter((arg) => !arg.text.startsWith("-"));
|
|
4545
4546
|
return words.some((word, index) => PULL_REQUEST_NOUNS.has(word.text) && words[index + 1]?.text === MERGE_SUBCOMMAND) || args.some((arg) => PULL_REQUEST_MERGE_PATH.test(arg.text));
|
|
4546
4547
|
};
|
|
4548
|
+
var mergesAPullRequestByAnyPath = ({ program, args }) => program !== void 0 && PULL_REQUEST_CLIS.has(basenameOf(program.text)) && args.some((arg) => PULL_REQUEST_MERGE_PATH_SPELLED_ANY_WAY.test(arg.text));
|
|
4547
4549
|
var DEPLOY_AND_SCHEMA_COMMAND_PATTERNS = [
|
|
4548
4550
|
"Bash(kubectl apply:*)",
|
|
4549
4551
|
"Bash(kubectl replace:*)",
|
|
@@ -4659,8 +4661,11 @@ var pathNeedsAPersonToChange = (path) => {
|
|
|
4659
4661
|
};
|
|
4660
4662
|
var REDIRECTS_INTO_A_SECRET_FILE = />>?\s*(?:[^\s;|&<>]*\/)?\.env(?:\.[\w-]+)?(?=$|[\s;|&)])/;
|
|
4661
4663
|
var COPIES_ONTO_ITS_LAST_OPERAND = /* @__PURE__ */ new Set(["cp", "install", "ln", "rsync", "scp"]);
|
|
4662
|
-
var WRITES_EVERY_OPERAND = /* @__PURE__ */ new Set(["mv", "tee", "rm", "unlink", "shred", "truncate"
|
|
4663
|
-
var EDITS_IN_PLACE = /* @__PURE__ */ new Set(["sed", "gsed", "perl"
|
|
4664
|
+
var WRITES_EVERY_OPERAND = /* @__PURE__ */ new Set(["mv", "tee", "rm", "unlink", "shred", "truncate"]);
|
|
4665
|
+
var EDITS_IN_PLACE = /* @__PURE__ */ new Set(["sed", "gsed", "perl"]);
|
|
4666
|
+
var IN_PLACE_FLAG = /^(?:-[A-Za-z]*i|--in-place(?:=.*)?)$/;
|
|
4667
|
+
var PERMISSIONS_OFF_WRITES_EVERY_OPERAND = /* @__PURE__ */ new Set([...WRITES_EVERY_OPERAND, "sponge"]);
|
|
4668
|
+
var PERMISSIONS_OFF_EDITS_IN_PLACE = /* @__PURE__ */ new Set([...EDITS_IN_PLACE, "yq"]);
|
|
4664
4669
|
var IN_PLACE_LONG_FLAG = /^--in-?place(?:=|$)/;
|
|
4665
4670
|
var IN_PLACE_LETTER = "i";
|
|
4666
4671
|
var SED_FLAGS_THAT_TAKE_THE_REST = /* @__PURE__ */ new Set(["e", "f", "l"]);
|
|
@@ -4698,6 +4703,7 @@ var spellingsOfAWord = (word) => {
|
|
|
4698
4703
|
}
|
|
4699
4704
|
return spellings.map((text3) => ({ ...word, text: text3 }));
|
|
4700
4705
|
};
|
|
4706
|
+
var namesASecretFile = (word) => word !== void 0 && SECRET_FILE_NAME.test(basenameOf(word.text));
|
|
4701
4707
|
var namesAFileThatNeedsAPerson = (word) => word !== void 0 && pathNeedsAPersonToChange(word.text);
|
|
4702
4708
|
var RECURSIVE_COPY_FLAG = /^(?:-[A-Za-z]*[rRa][A-Za-z]*|--recursive|--archive)$/;
|
|
4703
4709
|
var FOLDER_THAT_NEEDS_A_PERSON = new RegExp(String.raw`(?:^|/)(?:${[
|
|
@@ -4732,6 +4738,17 @@ var NETWORK_SENDERS = /* @__PURE__ */ new Set([
|
|
|
4732
4738
|
"rclone"
|
|
4733
4739
|
]);
|
|
4734
4740
|
var FILE_REFERENCE_PREFIX = /^(?:[\w.-]+=)?@|^[\w.-]+:/;
|
|
4741
|
+
var namesASecretFileReference = (word) => SECRET_FILE_NAME.test(basenameOf(word.text.replace(FILE_REFERENCE_PREFIX, "")));
|
|
4742
|
+
var sendsASecretFile = ({ program, args }) => program !== void 0 && NETWORK_SENDERS.has(basenameOf(program.text)) && args.some(namesASecretFileReference);
|
|
4743
|
+
var writesASecretFile = ({ program, args }) => {
|
|
4744
|
+
if (program === void 0) return false;
|
|
4745
|
+
if (sendsASecretFile({ program, args })) return true;
|
|
4746
|
+
const name = basenameOf(program.text);
|
|
4747
|
+
const operands = args.filter((arg) => !FLAG.test(arg.text));
|
|
4748
|
+
if (COPIES_ONTO_ITS_LAST_OPERAND.has(name)) return namesASecretFile(operands.at(-1));
|
|
4749
|
+
if (WRITES_EVERY_OPERAND.has(name)) return operands.some(namesASecretFile);
|
|
4750
|
+
return EDITS_IN_PLACE.has(name) && args.some((arg) => IN_PLACE_FLAG.test(arg.text)) && operands.some(namesASecretFile);
|
|
4751
|
+
};
|
|
4735
4752
|
var referencesAFileThatNeedsAPerson = (word) => pathNeedsAPersonToChange(word.text.replace(FILE_REFERENCE_PREFIX, ""));
|
|
4736
4753
|
var sendsAFileThatNeedsAPerson = ({ program, args }) => program !== void 0 && NETWORK_SENDERS.has(basenameOf(program.text)) && args.some(referencesAFileThatNeedsAPerson);
|
|
4737
4754
|
var targetDirectoryOf = (args) => {
|
|
@@ -4762,13 +4779,13 @@ var writesAFileThatNeedsAPerson = ({ program, args }) => {
|
|
|
4762
4779
|
if (program === void 0) return false;
|
|
4763
4780
|
if (sendsAFileThatNeedsAPerson({ program, args })) return true;
|
|
4764
4781
|
const name = basenameOf(program.text);
|
|
4765
|
-
const editsInPlace =
|
|
4766
|
-
if (!COPIES_ONTO_ITS_LAST_OPERAND.has(name) && !
|
|
4782
|
+
const editsInPlace = PERMISSIONS_OFF_EDITS_IN_PLACE.has(name) && args.some((arg) => flagEditsInPlace(name, arg.text));
|
|
4783
|
+
if (!COPIES_ONTO_ITS_LAST_OPERAND.has(name) && !PERMISSIONS_OFF_WRITES_EVERY_OPERAND.has(name) && !editsInPlace) return false;
|
|
4767
4784
|
const spelled = args.filter((arg) => !FLAG.test(arg.text)).map(spellingsOfAWord);
|
|
4768
4785
|
if (spelled.includes(null)) return true;
|
|
4769
4786
|
const operands = spelled.flatMap((words) => words ?? []);
|
|
4770
4787
|
if (COPIES_ONTO_ITS_LAST_OPERAND.has(name)) return copiesOntoAFileThatNeedsAPerson(args, operands);
|
|
4771
|
-
if (
|
|
4788
|
+
if (PERMISSIONS_OFF_WRITES_EVERY_OPERAND.has(name)) {
|
|
4772
4789
|
return operands.some((operand) => namesAFileThatNeedsAPerson(operand) || folderNeedsAPersonToChange(operand.text)) || name === MOVE && copiesOntoAFileThatNeedsAPerson(args, operands);
|
|
4773
4790
|
}
|
|
4774
4791
|
return operands.some(namesAFileThatNeedsAPerson);
|
|
@@ -4877,7 +4894,8 @@ var AWS_OPTIONS_WITH_VALUES = /* @__PURE__ */ new Set([
|
|
|
4877
4894
|
"--cli-binary-format"
|
|
4878
4895
|
]);
|
|
4879
4896
|
var AWS_LOCAL_COMMANDS = /* @__PURE__ */ new Set(["configure", "help", "history", "sso", "login", "logout"]);
|
|
4880
|
-
var AWS_READ_OPERATION = /^(?:describe|list|get|head|batch-get|lookup|search|filter|scan|query|select|wait|validate|estimate|simulate|tail|ls|presign|help
|
|
4897
|
+
var AWS_READ_OPERATION = /^(?:describe|list|get|head|batch-get|lookup|search|filter|scan|query|select|wait|validate|estimate|simulate|tail|ls|presign|help)(?:-|$)/;
|
|
4898
|
+
var AWS_SIGN_IN_OR_QUERY_OPERATION = /^(?:login|update-kubeconfig|start-query|stop-query|assume-role)(?:-|$)/;
|
|
4881
4899
|
var AWS_S3_SERVICE = "s3";
|
|
4882
4900
|
var AWS_S3_COPIES = /* @__PURE__ */ new Set(["cp", "sync"]);
|
|
4883
4901
|
var S3_URL_PREFIX = "s3://";
|
|
@@ -4976,10 +4994,15 @@ var twilioCliWrites = (args) => {
|
|
|
4976
4994
|
return !TWILIO_READ_ACTIONS.has(topic.text.split(TWILIO_TOPIC_SEPARATOR).at(-1) ?? "");
|
|
4977
4995
|
};
|
|
4978
4996
|
var GITHUB_CLI = "gh";
|
|
4997
|
+
var AWS_CLI = "aws";
|
|
4998
|
+
var awsOnlySignsInOrQueries = (args) => {
|
|
4999
|
+
const [service, operation] = positionalWordsOf(args, AWS_OPTIONS_WITH_VALUES);
|
|
5000
|
+
return service !== void 0 && service.text !== AWS_S3_SERVICE && operation !== void 0 && AWS_SIGN_IN_OR_QUERY_OPERATION.test(operation.text);
|
|
5001
|
+
};
|
|
4979
5002
|
var REMOTE_API_CLI_WRITES = /* @__PURE__ */ new Map([
|
|
4980
5003
|
[GITHUB_CLI, githubCliWrites],
|
|
4981
5004
|
["stripe", stripeCliWrites],
|
|
4982
|
-
[
|
|
5005
|
+
[AWS_CLI, awsCliWrites],
|
|
4983
5006
|
["twilio", twilioCliWrites]
|
|
4984
5007
|
]);
|
|
4985
5008
|
var invocationWritesThroughARemoteApi = ({ program, args }) => {
|
|
@@ -5062,6 +5085,7 @@ var writesThroughAServiceApi = (invocation) => {
|
|
|
5062
5085
|
const name = basenameOf(innermost.program?.text ?? "");
|
|
5063
5086
|
if (name === GITHUB_CLI) return false;
|
|
5064
5087
|
if (name === STRIPE_CLI && !stripeMayUseLiveData(wordsOfInvocation(invocation))) return false;
|
|
5088
|
+
if (name === AWS_CLI && awsOnlySignsInOrQueries(innermost.args)) return false;
|
|
5065
5089
|
return invocationWritesThroughARemoteApi(innermost);
|
|
5066
5090
|
};
|
|
5067
5091
|
var NO_SHORT_OPTIONS = /* @__PURE__ */ new Set();
|
|
@@ -5188,7 +5212,6 @@ var commandNeedsAPerson = (toolName, command) => {
|
|
|
5188
5212
|
const segments = readableCommandSegments(command);
|
|
5189
5213
|
return segments === null || classifyDecisionRisk(readingTool, command) !== "standard" || segments.some((segment) => segmentNeedsAPerson(readingTool, segment)) || pipesIntoASqlClient(command) || shellDialectOf(toolName) === "powershell" && powerShellCommandHasAVisibleConsequence(command, posixShellJudgeFor(toolName));
|
|
5190
5214
|
};
|
|
5191
|
-
var sessionGrantMustAskAbout = (toolName, command) => commandNeedsAPerson(toolName, command) || SHELL_DIALECT_BY_TOOL.has(toolName) && commandHasAVisibleConsequence(toolName, command);
|
|
5192
5215
|
var VISIBLE_DATA_LOSS_PATTERNS = [
|
|
5193
5216
|
"Bash(git branch -D:*)",
|
|
5194
5217
|
"Bash(git branch --delete:*)",
|
|
@@ -5300,12 +5323,12 @@ var FIND_RUNNERS = /* @__PURE__ */ new Set(["-exec", "-execdir", "-ok", "-okdir"
|
|
|
5300
5323
|
var FIND_RUNNER_END = /* @__PURE__ */ new Set([";", "+"]);
|
|
5301
5324
|
var FIND = "find";
|
|
5302
5325
|
var commandsRunByFind = ({ program, args }) => program === void 0 || basenameOf(program.text) !== FIND ? [] : args.flatMap((arg, index) => FIND_RUNNERS.has(arg.text) ? [{ program: args[index + 1], args: args.slice(index + 2, findRunnerEnd(args, index + 2)) }] : []);
|
|
5303
|
-
var losesDataVisibly = (toolName, invocation, normalized, depth) => {
|
|
5326
|
+
var losesDataVisibly = (toolName, invocation, normalized, depth, line) => {
|
|
5304
5327
|
const { program, args } = invocation;
|
|
5305
5328
|
if (program === void 0) return false;
|
|
5306
5329
|
const name = basenameOf(program.text);
|
|
5307
5330
|
if (name === FIND) {
|
|
5308
|
-
return args.some((arg) => arg.text === FIND_DELETE) || commandsRunByFind(invocation).some((run) => invocationHasAVisibleConsequence(toolName, run, depth + 1));
|
|
5331
|
+
return args.some((arg) => arg.text === FIND_DELETE) || commandsRunByFind(invocation).some((run) => invocationHasAVisibleConsequence(toolName, run, depth + 1, line));
|
|
5309
5332
|
}
|
|
5310
5333
|
const destructiveArguments = destructiveArgumentsOf(name, args);
|
|
5311
5334
|
return destructiveArguments !== void 0 && args.some((arg) => namesDestructiveArgument(arg.text, destructiveArguments)) || namesDestructiveWordInAnyCase(name, args.map((arg) => arg.text)) || gitDiscardsWork(invocation) || changesAService(invocation) || replacesTheCrontab(invocation) || isCoveredByPolicy(VISIBLE_DATA_LOSS_PATTERNS, toolName, normalized);
|
|
@@ -5471,13 +5494,14 @@ var honoursPreviewFlags = ({ program, args }) => {
|
|
|
5471
5494
|
var onlyPreviews = (invocation) => invocation.program !== void 0 && honoursPreviewFlags(invocation) && invocation.args.some((arg) => !arg.expands && PREVIEW_FLAG.test(arg.text));
|
|
5472
5495
|
var changesWhatIsDeployed = (toolName, invocation, normalized) => !onlyPreviews(invocation) && (changesProduction(invocation) || mergesAPullRequest(invocation) || isCoveredByPolicy(DEPLOY_AND_SCHEMA_COMMAND_PATTERNS, toolName, normalized));
|
|
5473
5496
|
var releasesOrChangesACluster = (toolName, invocation, normalized) => !onlyPreviews(invocation) && (pushesATag(invocation) || publishesAnAppBuild(invocation) || RELEASE_AND_CLUSTER_PROGRAMS.has(basenameOf(invocation.program?.text ?? "")) && isCoveredByPolicy(RELEASE_AND_CLUSTER_COMMAND_PATTERNS, toolName, normalized));
|
|
5474
|
-
var
|
|
5497
|
+
var invocationHasAConsequenceOnlyPermissionsOffAsksAbout = (toolName, invocation, normalized) => releasesOrChangesACluster(toolName, invocation, normalized) || mergesAPullRequestByAnyPath(invocation) || writesAFileThatNeedsAPerson(invocation) || changesWhereGitLooksForHooks(invocation) || changesSomethingHostedElsewhere(invocation);
|
|
5498
|
+
var invocationHasAVisibleConsequence = (toolName, invocation, depth, line) => {
|
|
5475
5499
|
if (depth > MAX_CONSEQUENCE_DEPTH) return true;
|
|
5476
5500
|
if (invocation.program === void 0) return false;
|
|
5477
5501
|
const normalized = quotedInvocation(invocation);
|
|
5478
5502
|
const innermost = innermostInvocation(invocation);
|
|
5479
5503
|
const script = shellScriptOf(invocation);
|
|
5480
|
-
return classifyDecisionRisk(toolName, normalized) === "destructive" || changesWhatIsDeployed(toolName, invocation, normalized) ||
|
|
5504
|
+
return classifyDecisionRisk(toolName, normalized) === "destructive" || changesWhatIsDeployed(toolName, invocation, normalized) || writesASecretFile(invocation) || line === "permissions_off" && invocationHasAConsequenceOnlyPermissionsOffAsksAbout(toolName, invocation, normalized) || losesDataVisibly(toolName, invocation, normalized, depth, line) || subcommandDestroysVisibly(invocation) || sqlClientChangesData(invocation) || innermost !== invocation && invocationHasAVisibleConsequence(toolName, innermost, depth, line) || script === null && passesAnInlineScript(invocation) || script !== null && commandHasAVisibleConsequenceAt(toolName, script, depth + 1, line) || readingsPastGlobalFlags(invocation).some((reading) => invocationHasAVisibleConsequence(toolName, reading, depth + 1, line));
|
|
5481
5505
|
};
|
|
5482
5506
|
var RUNS_FETCHED_CODE = /(?:\$\(|`|<\()\s*(?:curl|wget)\b/;
|
|
5483
5507
|
var RUNS_DECODED_CODE = /(?:^|[;&|(\s])(?:bash|sh|zsh|source|\.|python3?|node|ruby|perl)\s+(?:-[A-Za-z]+\s+)*["']?(?:<\(|\$\()[^)]*\b(?:base64|xxd|openssl)\b/;
|
|
@@ -5511,7 +5535,7 @@ var decodes = (invocation) => {
|
|
|
5511
5535
|
return decodingFlags !== void 0 && args.some((arg) => decodingFlags.test(arg.text));
|
|
5512
5536
|
};
|
|
5513
5537
|
var producesCodeTheCommandDoesNotShow = (invocation) => fetches(invocation) || decodes(invocation);
|
|
5514
|
-
var
|
|
5538
|
+
var pipesCodeIntoAnInterpreter = (command, invocations, producesCode) => invocations.some(producesCode) && pipedSegmentsOf(command).some(runsWhatItReads);
|
|
5515
5539
|
var CODE_THAT_DELETES_RECURSIVELY = /\b(?:rmtree|rimraf|rm_rf|rm_r|removedirs)\b|\b(?:rm|rmSync|remove|rmdir|rmdirSync)\s*\([^)]*recursive/;
|
|
5516
5540
|
var CODE_THAT_DECODES = /\b(?:b64decode|atob|base64)\b/;
|
|
5517
5541
|
var CODE_THAT_RUNS_CODE_IT_BUILDS = /(?<![.\w])(?:eval|exec)\s*\(/;
|
|
@@ -5571,7 +5595,7 @@ var interpreterCodeIn = (command, invocations) => {
|
|
|
5571
5595
|
const heredocs = interpreters.some(runsWhatItReads) ? withHeredocBodiesSetAside(command).bodies : [];
|
|
5572
5596
|
return [...interpreters.flatMap(inlineCodeOf), ...heredocs];
|
|
5573
5597
|
};
|
|
5574
|
-
var codeNeedsAPerson = (code, depth) => CODE_THAT_DELETES_RECURSIVELY.test(code) || CODE_THAT_RUNS_CODE_IT_BUILDS.test(code) && CODE_THAT_DECODES.test(code) || CODE_THAT_WRITES_A_FILE.test(code) && pathsSpelledIn(code).some(pathNeedsAPersonToChange) || CODE_THAT_RUNS_COMMANDS.test(code) && commandsSpelledIn(code).some((command) => commandHasAVisibleConsequenceAt(SHELL_TOOL, command, depth + 1));
|
|
5598
|
+
var codeNeedsAPerson = (code, depth) => CODE_THAT_DELETES_RECURSIVELY.test(code) || CODE_THAT_RUNS_CODE_IT_BUILDS.test(code) && CODE_THAT_DECODES.test(code) || CODE_THAT_WRITES_A_FILE.test(code) && pathsSpelledIn(code).some(pathNeedsAPersonToChange) || CODE_THAT_RUNS_COMMANDS.test(code) && commandsSpelledIn(code).some((command) => commandHasAVisibleConsequenceAt(SHELL_TOOL, command, depth + 1, "permissions_off"));
|
|
5575
5599
|
var runsInterpreterCodeThatNeedsAPerson = (command, invocations, depth) => interpreterCodeIn(command, invocations).some((code) => codeNeedsAPerson(code, depth));
|
|
5576
5600
|
var WORDS_THAT_OPEN_A_COMMAND = String.raw`if|then|elif|else|do|while|until|!`;
|
|
5577
5601
|
var SHELL_GROUPING_PREFIX = new RegExp(String.raw`^\s*(?:(?:${WORDS_THAT_OPEN_A_COMMAND})\s+|[({]\s*)+`);
|
|
@@ -5717,26 +5741,29 @@ var evalRunsOneEnvironmentSetup = (pieces, index) => {
|
|
|
5717
5741
|
const next = pieces[index + 3];
|
|
5718
5742
|
return opening !== void 0 && EVAL_BEFORE_ITS_ARGUMENT.test(opening.text) && substitution !== void 0 && SUBSTITUTION_OPENERS.has(substitution.before) && SETS_UP_THE_ENVIRONMENT.test(substitution.text) && closing !== void 0 && SUBSTITUTION_CLOSERS.has(closing.before) && EVAL_AFTER_ITS_ARGUMENT.test(closing.text) && (next === void 0 || WHAT_MAY_FOLLOW_AN_EVAL.has(next.before));
|
|
5719
5743
|
};
|
|
5720
|
-
var
|
|
5744
|
+
var evalRunsHiddenCode = (segment, innermost) => segment.substitution !== null && basenameOf(innermost.program?.text ?? "") === EVAL && !segment.evalRunsOneEnvironmentSetup;
|
|
5745
|
+
var roughSegmentHasAVisibleConsequence = (toolName, segment, producesHiddenCode, depth, line) => {
|
|
5721
5746
|
const innermost = innermostInvocation(segment.invocation);
|
|
5722
5747
|
const runsAHeredocScript = innermost.program !== void 0 && POSIX_SHELL_PROGRAMS.has(basenameOf(innermost.program.text));
|
|
5723
|
-
return invocationHasAVisibleConsequence(toolName, segment.invocation, depth) || sqlClientSyntaxOf(innermost) !== void 0 && (segment.readsInput || segment.feedsASubstitution) ||
|
|
5748
|
+
return invocationHasAVisibleConsequence(toolName, segment.invocation, depth, line) || sqlClientSyntaxOf(innermost) !== void 0 && (segment.readsInput || segment.feedsASubstitution) || line === "permissions_off" && evalRunsHiddenCode(segment, innermost) || segment.readsAPipe && producesHiddenCode && runsWhatItReads(innermost) || runsAHeredocScript && segment.heredocs.some((body) => commandHasAVisibleConsequenceAt(toolName, body, depth + 1, line));
|
|
5724
5749
|
};
|
|
5725
|
-
var
|
|
5750
|
+
var producesCodeTheLineCannotSee = (line) => line === "permissions_off" ? producesCodeTheCommandDoesNotShow : fetches;
|
|
5751
|
+
var roughReadingHasAVisibleConsequence = (toolName, command, depth, line) => {
|
|
5726
5752
|
const segments = roughSegmentsOf(command);
|
|
5727
5753
|
const invocations = segments.map((segment) => segment.invocation);
|
|
5728
|
-
const producesHiddenCode = invocations.some(
|
|
5729
|
-
return segments.some((segment) => roughSegmentHasAVisibleConsequence(toolName, segment, producesHiddenCode, depth)) || runsADownloadedScript(invocations) || runsInterpreterCodeThatNeedsAPerson(command, invocations, depth);
|
|
5754
|
+
const producesHiddenCode = invocations.some(producesCodeTheLineCannotSee(line));
|
|
5755
|
+
return segments.some((segment) => roughSegmentHasAVisibleConsequence(toolName, segment, producesHiddenCode, depth, line)) || runsADownloadedScript(invocations) || line === "permissions_off" && runsInterpreterCodeThatNeedsAPerson(command, invocations, depth);
|
|
5730
5756
|
};
|
|
5731
|
-
var
|
|
5757
|
+
var commandHidesWhatItWritesOrRuns = (command, readable) => RUNS_DECODED_CODE.test(readable) || redirectsIntoAFileThatNeedsAPerson(command);
|
|
5758
|
+
var commandHasAVisibleConsequenceAt = (toolName, command, depth, line) => {
|
|
5732
5759
|
if (toolName === "Bash" && isSafeReadOnlyCommand(command)) return false;
|
|
5733
5760
|
const readable = withHeredocSubstitutionsAsQuotedText(command);
|
|
5734
5761
|
if (classifyDecisionRisk(toolName, readable) === "destructive" || RUNS_FETCHED_CODE.test(readable) || REDIRECTS_INTO_A_SECRET_FILE.test(readable)) return true;
|
|
5735
|
-
if (
|
|
5762
|
+
if (line === "permissions_off" && commandHidesWhatItWritesOrRuns(command, readable)) return true;
|
|
5736
5763
|
const segments = readableCommandSegments(command);
|
|
5737
|
-
if (segments === null) return roughReadingHasAVisibleConsequence(toolName, command, depth);
|
|
5764
|
+
if (segments === null) return roughReadingHasAVisibleConsequence(toolName, command, depth, line);
|
|
5738
5765
|
const invocations = segments.map((segment) => invocationOf(withoutShellGrouping(segment)));
|
|
5739
|
-
return invocations.some((invocation) => invocationHasAVisibleConsequence(toolName, invocation, depth)) || pipesIntoASqlClient(command) ||
|
|
5766
|
+
return invocations.some((invocation) => invocationHasAVisibleConsequence(toolName, invocation, depth, line)) || pipesIntoASqlClient(command) || pipesCodeIntoAnInterpreter(command, invocations, producesCodeTheLineCannotSee(line)) || runsADownloadedScript(invocations) || line === "permissions_off" && runsInterpreterCodeThatNeedsAPerson(command, invocations, depth);
|
|
5740
5767
|
};
|
|
5741
5768
|
var REDIRECTION_OPERATOR_CHARACTER = /[<>]/;
|
|
5742
5769
|
var redirectsIntoAFileThatNeedsAPerson = (command) => {
|
|
@@ -5749,18 +5776,21 @@ var redirectsIntoAFileThatNeedsAPerson = (command) => {
|
|
|
5749
5776
|
});
|
|
5750
5777
|
};
|
|
5751
5778
|
var posixCommandOf = (words) => words.map(asOneShellWord).join(" ");
|
|
5752
|
-
var
|
|
5779
|
+
var namesASecretPowerShellPath = (path) => SECRET_FILE_NAME.test(fileNameOf(path));
|
|
5780
|
+
var posixShellJudgeFor = (toolName, line = "standing_allow") => ({
|
|
5753
5781
|
namesADestructiveAction: (text3) => classifyDecisionRisk(toolName, text3) === "destructive",
|
|
5754
|
-
invocationShowsAConsequence: (invocation) => invocationHasAVisibleConsequence(SHELL_TOOL, invocation, 0),
|
|
5755
|
-
commandShowsAConsequence: (words) => commandHasAVisibleConsequenceAt(SHELL_TOOL, posixCommandOf(words), 1),
|
|
5782
|
+
invocationShowsAConsequence: (invocation) => invocationHasAVisibleConsequence(SHELL_TOOL, invocation, 0, line),
|
|
5783
|
+
commandShowsAConsequence: (words) => commandHasAVisibleConsequenceAt(SHELL_TOOL, posixCommandOf(words), 1, line),
|
|
5756
5784
|
onlyReads: (words) => isSafeReadOnlyCommand(posixCommandOf(words)),
|
|
5757
5785
|
fetches,
|
|
5758
5786
|
runsWhatItReads,
|
|
5759
5787
|
runsScripts,
|
|
5760
|
-
namesAFileThatNeedsAPerson: pathNeedsAPersonToChange
|
|
5788
|
+
namesAFileThatNeedsAPerson: line === "permissions_off" ? pathNeedsAPersonToChange : namesASecretPowerShellPath
|
|
5761
5789
|
});
|
|
5762
5790
|
var commandIsDestructive = (toolName, command) => shellDialectOf(toolName) === "powershell" ? powerShellCommandIsDestructive(command, posixShellJudgeFor(toolName)) : readingsThatCanAct(command).some((reading) => classifyDecisionRisk(toolNameForAPosixReading(toolName), reading) === "destructive");
|
|
5763
|
-
var
|
|
5791
|
+
var commandHasAConsequenceOnTheLine = (toolName, command, line) => shellDialectOf(toolName) === "powershell" ? powerShellCommandHasAVisibleConsequence(command, posixShellJudgeFor(toolName, line)) : commandHasAVisibleConsequenceAt(toolNameForAPosixReading(toolName), command, 0, line);
|
|
5792
|
+
var commandHasAVisibleConsequence = (toolName, command) => commandHasAConsequenceOnTheLine(toolName, command, "standing_allow");
|
|
5793
|
+
var commandHasAConsequenceWithPermissionsOff = (toolName, command) => commandHasAConsequenceOnTheLine(toolName, command, "permissions_off");
|
|
5764
5794
|
var MAX_SPELLING_DEPTH = 3;
|
|
5765
5795
|
var GIT_GLOBAL_OPTIONS_WITH_A_VALUE = /* @__PURE__ */ new Set([
|
|
5766
5796
|
"-C",
|
|
@@ -6961,7 +6991,7 @@ var unmatchedPolicyOf = (config, toolName) => ({
|
|
|
6961
6991
|
mode: config.defaultMode ?? "push_first",
|
|
6962
6992
|
pushFirstSeconds: config.defaultPushFirstSeconds ?? 20
|
|
6963
6993
|
});
|
|
6964
|
-
var sessionToolGrantCannotCover = (toolName, arg, toolInput) => typeof arg === "string" &&
|
|
6994
|
+
var sessionToolGrantCannotCover = (toolName, arg, toolInput) => typeof arg === "string" && commandNeedsAPerson(toolName, arg) || parseMcpToolName(toolName) !== void 0 && (toolInput === void 0 || !mcpToolInputOnlyReads(toolName, toolInput));
|
|
6965
6995
|
var stricterOfTheReadings = (asWritten, asSpelled, unmatched) => comparePolicyStrictness(asWritten?.policy ?? unmatched, asSpelled?.policy ?? unmatched) > 0 ? asWritten : asSpelled;
|
|
6966
6996
|
var resolvePolicy = (config, toolName, modeOverride, toolInput, cwd, repoKey, sessionId) => {
|
|
6967
6997
|
const args = toolInput ? policyArgForms(toolName, toolInput, cwd) : [];
|
|
@@ -7038,6 +7068,10 @@ var strictestScopeVerdict = (scope, paths) => {
|
|
|
7038
7068
|
var survivesDegraded = (config, toolName, toolInputs, cwd, repoKey, sessionId) => toolInputs.length === 1 && resolveAutoResolveOrigin(config, toolName, toolInputs[0], cwd, repoKey, sessionId) === "safe_readonly";
|
|
7039
7069
|
var FULL_DEFER_MODES = /* @__PURE__ */ new Set(["plan", "auto", "dontAsk"]);
|
|
7040
7070
|
var BYPASS_PERMISSION_MODE = "bypassPermissions";
|
|
7071
|
+
var BYPASS_STOPS = ["consequences", "nothing"];
|
|
7072
|
+
var DEFAULT_BYPASS_STOPS = "consequences";
|
|
7073
|
+
var isBypassStops = (value) => typeof value === "string" && BYPASS_STOPS.includes(value);
|
|
7074
|
+
var bypassStopsOf = (config) => isBypassStops(config.bypassStops) ? config.bypassStops : DEFAULT_BYPASS_STOPS;
|
|
7041
7075
|
var isBypassPermissionMode = (permissionMode) => permissionMode === BYPASS_PERMISSION_MODE;
|
|
7042
7076
|
var FILE_EDIT_TOOLS = /* @__PURE__ */ new Set([
|
|
7043
7077
|
"Write",
|
|
@@ -7134,13 +7168,18 @@ var LINE_BREAK = /[\r\n]/;
|
|
|
7134
7168
|
var bypassModeCovers = (toolName, toolInput) => {
|
|
7135
7169
|
const arg = extractPolicyArg(toolName, toolInput);
|
|
7136
7170
|
if (SHELL_DIALECT_BY_TOOL.has(toolName)) {
|
|
7137
|
-
return arg !== void 0 && !commandIsDestructive(toolName, arg) && !
|
|
7171
|
+
return arg !== void 0 && !commandIsDestructive(toolName, arg) && !commandHasAConsequenceWithPermissionsOff(toolName, arg);
|
|
7138
7172
|
}
|
|
7139
|
-
if (FILE_EDIT_TOOLS.has(toolName)) return arg !== void 0 && !LINE_BREAK.test(arg) && !
|
|
7173
|
+
if (FILE_EDIT_TOOLS.has(toolName)) return arg !== void 0 && !LINE_BREAK.test(arg) && !fileEditNeedsAPersonWithPermissionsOff(toolName, arg);
|
|
7140
7174
|
return mcpToolOnlyReads(toolName) && mcpToolInputOnlyReads(toolName, toolInput);
|
|
7141
7175
|
};
|
|
7142
|
-
var aChosenRuleGovernsInEitherRepository = (input) => aChosenRuleGoverns(input) || input.sharedRepoKey !== void 0 && input.sharedRepoKey !== input.repoKey && aChosenRuleGoverns({ ...input, repoKey: input.sharedRepoKey });
|
|
7143
|
-
var
|
|
7176
|
+
var aChosenRuleGovernsInEitherRepository = (input, counts = everyRule) => aChosenRuleGoverns(input, counts) || input.sharedRepoKey !== void 0 && input.sharedRepoKey !== input.repoKey && aChosenRuleGoverns({ ...input, repoKey: input.sharedRepoKey }, counts);
|
|
7177
|
+
var ruleAsksOrRefuses = (rule) => !isAutoApprove(rule);
|
|
7178
|
+
var bypassModeCoversEveryInput = (input) => input.deletesFiles !== true && input.toolInputs.every((toolInput) => bypassModeCovers(input.toolName, toolInput)) && !aChosenRuleGovernsInEitherRepository(input);
|
|
7179
|
+
var bypassModeApplies = (input) => isBypassPermissionMode(input.permissionMode) && !isModeStateDegraded(input.modeState) && noModeOverrideIsActive(input) && input.toolInputs.length > 0;
|
|
7180
|
+
var bypassModeAllows = (input) => bypassModeApplies(input) && (bypassStopsOf(input.config) === "nothing" ? !aChosenRuleGovernsInEitherRepository(input, ruleAsksOrRefuses) : bypassModeCoversEveryInput(input));
|
|
7181
|
+
var PERMISSIONS_OFF_ASK_REASON = "Permissions are off in your agent, so Pushary only stops for risky steps like this one. You can change this in Settings on pushary.com.";
|
|
7182
|
+
var permissionsOffAskReason = (input, verdict) => verdict.kind === "gate" && !verdict.scopeReason && !isAskedInEveryMode(input.toolName) && bypassModeApplies(input) && bypassStopsOf(input.config) === "consequences" && !aChosenRuleGovernsInEitherRepository(input) ? PERMISSIONS_OFF_ASK_REASON : void 0;
|
|
7144
7183
|
var resolveGate = (input) => {
|
|
7145
7184
|
const { modeState, config, toolName, toolInputs, cwd, sessionId } = input;
|
|
7146
7185
|
const repoKey = input.sharedRepoKey ?? input.repoKey;
|
|
@@ -7225,7 +7264,9 @@ var runsACommandThatNeedsAPerson = ({ toolName, toolInputs }) => SHELL_DIALECT_B
|
|
|
7225
7264
|
const command = extractPolicyArg(toolName, toolInput);
|
|
7226
7265
|
return command !== void 0 && (commandNeedsAPerson(toolName, command) || commandWritesThroughARemoteApi(command));
|
|
7227
7266
|
});
|
|
7228
|
-
var
|
|
7267
|
+
var namesASecretOrWorkflowFile = (path) => SECRET_FILE_NAME.test(basenameOf(path)) || CI_WORKFLOW_FILE.test(normalizeSeparators(path));
|
|
7268
|
+
var fileEditNeedsAPerson = (toolName, path) => FILE_EDIT_TOOLS.has(toolName) && namesASecretOrWorkflowFile(path);
|
|
7269
|
+
var fileEditNeedsAPersonWithPermissionsOff = (toolName, path) => FILE_EDIT_TOOLS.has(toolName) && pathNeedsAPersonToChange(path);
|
|
7229
7270
|
var editsAFileThatNeedsAPerson = ({ toolName, toolInputs }) => toolInputs.some((toolInput) => {
|
|
7230
7271
|
const path = extractPolicyArg(toolName, toolInput);
|
|
7231
7272
|
return path !== void 0 && fileEditNeedsAPerson(toolName, path);
|
|
@@ -7294,14 +7335,16 @@ var approvalRoutesOf = (config) => {
|
|
|
7294
7335
|
const routes = config.approvalRoutes ?? [];
|
|
7295
7336
|
return Array.isArray(routes) && routes.every(isApprovalRoutePattern) ? routes : null;
|
|
7296
7337
|
};
|
|
7297
|
-
var
|
|
7338
|
+
var everyRule = () => true;
|
|
7339
|
+
var aChosenRuleGoverns = (input, counts = everyRule) => {
|
|
7298
7340
|
const chosen = input.config.policies.filter((policy) => !isDefaultRule(policy));
|
|
7299
7341
|
const routes = approvalRoutesOf(input.config);
|
|
7300
7342
|
if (routes === null) return true;
|
|
7301
7343
|
return input.toolInputs.some((toolInput) => {
|
|
7302
7344
|
const args = policyArgForms(input.toolName, toolInput, input.cwd);
|
|
7303
7345
|
const reading = policyReadingOf(chosen, input.toolName, args);
|
|
7304
|
-
|
|
7346
|
+
const governing = governingRuleForReading(chosen, input.toolName, args, reading, input.repoKey, input.sessionId);
|
|
7347
|
+
return governing !== void 0 && counts(governing.policy) || findBestRoute(routes, input.toolName, args, input.repoKey) !== void 0;
|
|
7305
7348
|
});
|
|
7306
7349
|
};
|
|
7307
7350
|
var claudeAllowlistOwnsCall = (input, verdict, permissionMode, rules) => rules !== null && verdict.kind === "gate" && !verdict.scopeReason && !aChosenRuleGoverns(input) && !isAskedInEveryMode(input.toolName) && claudeConsultsItsAllowlist(permissionMode) && agentRulesAllowEveryInput(rules, input.toolName, input.toolInputs, input.cwd);
|
|
@@ -7840,6 +7883,7 @@ export {
|
|
|
7840
7883
|
PRETOOLUSE_HANDLED_TOOLS,
|
|
7841
7884
|
isPermissionRequestOwnedByPreToolUse,
|
|
7842
7885
|
CLAUDE_PRETOOLUSE_MATCHER,
|
|
7886
|
+
permissionsOffAskReason,
|
|
7843
7887
|
resolveGate,
|
|
7844
7888
|
editGoesToTheAgentsPrompt,
|
|
7845
7889
|
SCOPE_BATCH_REASON,
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
} from "./chunk-XMSDA5WA.js";
|
|
4
4
|
import {
|
|
5
5
|
getBaseUrl
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-TXDFQD2I.js";
|
|
7
7
|
import {
|
|
8
8
|
compressTranscriptRecord,
|
|
9
9
|
redactSecretsFromContent,
|
|
10
10
|
transcriptRecordPlaintext
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-OS32P4RZ.js";
|
|
12
12
|
|
|
13
13
|
// src/transcript-api.ts
|
|
14
14
|
var providerRecipientSchema = external_exports.object({
|
|
@@ -2,13 +2,13 @@ import {
|
|
|
2
2
|
SESSION_HISTORY_RETENTION_DAYS,
|
|
3
3
|
readOwnerOnlyJson,
|
|
4
4
|
savedTranscriptReadPositions
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-OP2WJEPY.js";
|
|
6
6
|
import {
|
|
7
7
|
ensureDaemonRunning
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-TZWK2BVY.js";
|
|
9
9
|
import {
|
|
10
10
|
hookOwnerOf
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-SISYAMDC.js";
|
|
12
12
|
import {
|
|
13
13
|
buildTranscriptRecords,
|
|
14
14
|
decodePublicKey,
|
|
@@ -19,33 +19,33 @@ import {
|
|
|
19
19
|
recordSealerFor,
|
|
20
20
|
uploadTranscriptRecords,
|
|
21
21
|
wrapSessionKey
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-PDRPVVZX.js";
|
|
23
23
|
import {
|
|
24
24
|
external_exports
|
|
25
25
|
} from "./chunk-XMSDA5WA.js";
|
|
26
26
|
import {
|
|
27
27
|
transcriptEnvironmentPreference,
|
|
28
28
|
transcriptsEnabled
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-SARU6WNW.js";
|
|
30
30
|
import {
|
|
31
31
|
readTranscriptPreference
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-TVGOSEWS.js";
|
|
33
33
|
import {
|
|
34
34
|
hookMeaning
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-XLM2JZBE.js";
|
|
36
36
|
import {
|
|
37
37
|
claudeConfigDir,
|
|
38
38
|
codexHome,
|
|
39
39
|
pusharyDir
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-YCYFREHD.js";
|
|
41
41
|
import {
|
|
42
42
|
writeJsonAtomic,
|
|
43
43
|
writeJsonAtomicDurable
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-77HBRZJI.js";
|
|
45
45
|
import {
|
|
46
46
|
getApiKey,
|
|
47
47
|
getBaseUrl
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-TXDFQD2I.js";
|
|
49
49
|
import {
|
|
50
50
|
PENDING_COMMAND_PREFIX,
|
|
51
51
|
SESSION_HISTORY_BACKFILL_LIMIT_BYTES,
|
|
@@ -53,7 +53,7 @@ import {
|
|
|
53
53
|
isHookSource,
|
|
54
54
|
isRecord,
|
|
55
55
|
redactSecretsFromContent
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-OS32P4RZ.js";
|
|
57
57
|
|
|
58
58
|
// src/transcript-recipient-pin.ts
|
|
59
59
|
import { createHash } from "crypto";
|