@pushary/agent-hooks 1.9.144 → 1.9.147
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 +24 -0
- package/README.md +5 -4
- package/data/SKILL.md +3 -3
- package/data/cursor-plugin/scripts/redaction.mjs +2 -1
- package/data/cursor-plugin/skills/pushary/SKILL.md +2 -2
- package/data/openclaw-plugin/LICENSE +21 -0
- package/data/openclaw-plugin/README.md +113 -0
- package/data/openclaw-plugin/dist/api-key-shape.js +5 -0
- package/data/openclaw-plugin/dist/approval-hook.js +88 -0
- package/data/openclaw-plugin/dist/approval-question.js +66 -0
- package/data/openclaw-plugin/dist/connection.js +101 -0
- package/data/openclaw-plugin/dist/decision-reply.js +6 -0
- package/data/openclaw-plugin/dist/gate-result.js +58 -0
- package/data/openclaw-plugin/dist/gate.js +173 -0
- package/data/openclaw-plugin/dist/hook-budget.js +19 -0
- package/data/openclaw-plugin/dist/host-api.js +1 -0
- package/data/openclaw-plugin/dist/host-version.js +25 -0
- package/data/openclaw-plugin/dist/index.js +32 -0
- package/data/openclaw-plugin/dist/openclaw-paths.js +43 -0
- package/data/openclaw-plugin/dist/openclaw-write-guard.js +93 -0
- package/data/openclaw-plugin/dist/protected-writes.js +217 -0
- package/data/openclaw-plugin/dist/pushary-client.js +103 -0
- package/data/openclaw-plugin/dist/pushary-hosts.js +3 -0
- package/data/openclaw-plugin/dist/redaction.js +53 -0
- package/data/openclaw-plugin/dist/replies.js +65 -0
- package/data/openclaw-plugin/dist/settings.js +103 -0
- package/data/openclaw-plugin/openclaw.plugin.json +32 -0
- package/data/openclaw-plugin/package.json +70 -0
- package/data/vscode-plugin/scripts/redaction.mjs +2 -1
- package/data/vscode-plugin/skills/pushary/SKILL.md +2 -2
- package/dist/{api-ZV7TT25P.js → api-2KDVLXHT.js} +11 -11
- package/dist/bin/pushary-audit.js +3 -3
- package/dist/bin/pushary-bell-hook.js +28 -28
- package/dist/bin/pushary-bell.js +11 -11
- package/dist/bin/pushary-claude.js +27 -27
- package/dist/bin/pushary-clean.js +76 -39
- package/dist/bin/pushary-codex-bridge.js +23 -23
- package/dist/bin/pushary-codex-hook.js +35 -35
- package/dist/bin/pushary-codex-session.js +8 -8
- package/dist/bin/pushary-codex.js +16 -16
- package/dist/bin/pushary-connect.js +78 -36
- package/dist/bin/pushary-cowork.js +5 -5
- package/dist/bin/pushary-daemon.js +44 -43
- package/dist/bin/pushary-disconnect.js +28 -28
- package/dist/bin/pushary-display-hook.js +103 -44
- package/dist/bin/pushary-doctor.js +139 -55
- package/dist/bin/pushary-elicitation-hook.js +28 -28
- package/dist/bin/pushary-gemini-bridge.js +17 -17
- package/dist/bin/pushary-gemini-hook.js +32 -32
- package/dist/bin/pushary-hook.js +35 -35
- package/dist/bin/pushary-login.js +22 -22
- package/dist/bin/pushary-logout.js +33 -31
- package/dist/bin/pushary-mcp.js +12 -12
- package/dist/bin/pushary-mode.js +16 -16
- package/dist/bin/pushary-notification-hook.js +27 -27
- package/dist/bin/pushary-opencode-hook.js +31 -31
- package/dist/bin/pushary-permission-denied-hook.js +35 -35
- package/dist/bin/pushary-permission-hook.js +35 -35
- package/dist/bin/pushary-post-hook.js +28 -28
- package/dist/bin/pushary-prompt-hook.js +27 -27
- package/dist/bin/pushary-session-end-hook.js +27 -27
- package/dist/bin/pushary-session-start-hook.js +37 -36
- package/dist/bin/pushary-setup.js +209 -89
- package/dist/bin/pushary-stats.js +5 -5
- package/dist/bin/pushary-status.js +38 -36
- package/dist/bin/pushary-stop-hook.js +27 -27
- package/dist/bin/pushary-stopfailure-hook.js +27 -27
- package/dist/bin/pushary-suggestions.js +16 -16
- package/dist/bin/pushary-transcript-register.js +17 -17
- package/dist/bin/pushary-transcripts.js +25 -25
- package/dist/bin/pushary-upgrade.js +42 -41
- package/dist/bin/pushary-wait.js +16 -16
- package/dist/bin/pushary.js +7 -7
- package/dist/{chunk-LUVSHGLH.js → chunk-2EETRVCZ.js} +1 -1
- package/dist/{chunk-YESBU4VQ.js → chunk-2G54YLN3.js} +3 -3
- package/dist/{chunk-WGOTBZ23.js → chunk-2I6A34GJ.js} +15 -5
- package/dist/{chunk-WGT5LCIB.js → chunk-2QY2BD4T.js} +5 -5
- package/dist/{chunk-HGIW56MU.js → chunk-2RAIG6NF.js} +2 -2
- package/dist/{chunk-QLGLUUOP.js → chunk-2YNAQ5TX.js} +1 -1
- package/dist/{chunk-44WPMZGQ.js → chunk-37ZBJB2Q.js} +5 -5
- package/dist/{chunk-4EBJ4PTZ.js → chunk-3NMX4725.js} +1 -1
- package/dist/{chunk-E32SRYTE.js → chunk-3TTXOU6G.js} +3 -3
- package/dist/{chunk-GV3FDGQH.js → chunk-4P3ML7HP.js} +200 -59
- package/dist/{chunk-22CXL7YI.js → chunk-526XSNMS.js} +3 -3
- package/dist/{chunk-B4VIT5N3.js → chunk-57GVGSOQ.js} +1 -1
- package/dist/{chunk-6LALK6GI.js → chunk-5II3USXS.js} +2 -2
- package/dist/{chunk-WWCM6UL7.js → chunk-5K65H6OO.js} +1 -1
- package/dist/{chunk-56HFENZK.js → chunk-6C5QRJIH.js} +5 -5
- package/dist/{chunk-EOKUIOMT.js → chunk-6EPTMB7L.js} +4 -4
- package/dist/{chunk-C5LIS3XM.js → chunk-6JBX55K4.js} +38 -8
- package/dist/{chunk-23CGCD5L.js → chunk-6YVGY2ZX.js} +7 -7
- package/dist/{chunk-WC25Z4XS.js → chunk-72S6PF2I.js} +2 -2
- package/dist/{chunk-YY5YVMBA.js → chunk-7P32YU2M.js} +10 -74
- package/dist/{chunk-WTBFPSTR.js → chunk-7TVSWGAV.js} +8 -6
- package/dist/{chunk-S7WVJ6AR.js → chunk-7WDEJTNX.js} +4 -4
- package/dist/{chunk-AJQ4TTPJ.js → chunk-7XIJD7NL.js} +3 -3
- package/dist/{chunk-PYT4WXXR.js → chunk-A5MSVNFS.js} +10 -10
- package/dist/{chunk-FC2ENROR.js → chunk-ANLR5G2W.js} +4 -4
- package/dist/{chunk-7VMVMC4H.js → chunk-BEDAQAEN.js} +1 -1
- package/dist/{chunk-4JTZZXB3.js → chunk-BHGSNYG5.js} +3 -3
- package/dist/{chunk-5I3UQEAX.js → chunk-BU2J4P7P.js} +3 -3
- package/dist/{chunk-EMODTMHE.js → chunk-BYVLAPCF.js} +1 -1
- package/dist/{chunk-5BTAIFVV.js → chunk-CSNG5NQR.js} +1 -1
- package/dist/{chunk-7QWH257P.js → chunk-D7ZWJYXB.js} +1 -1
- package/dist/{chunk-AGUL2JDK.js → chunk-ELRZO6A7.js} +3 -3
- package/dist/{chunk-Z2WQD2W6.js → chunk-EV54ZQ5J.js} +4 -4
- package/dist/{chunk-5TZYAMGW.js → chunk-FHBJJOMF.js} +1 -1
- package/dist/{chunk-74QCFZKV.js → chunk-FKGWP4MF.js} +8 -7
- package/dist/{chunk-MCI6KYN7.js → chunk-FMAIUTVU.js} +3 -3
- package/dist/{chunk-WTULK73V.js → chunk-FWCECQTY.js} +2 -2
- package/dist/{chunk-ZVJIJPQY.js → chunk-GGCUXNZN.js} +1 -1
- package/dist/{chunk-VP4T5352.js → chunk-GIWI5IHB.js} +6 -6
- package/dist/{chunk-RPXSGCRG.js → chunk-GJV5RVUU.js} +98 -47
- package/dist/chunk-GPAMD5JG.js +157 -0
- package/dist/{chunk-ZGYGKKXF.js → chunk-I72UU75H.js} +16 -16
- package/dist/{chunk-CV4EIXPV.js → chunk-ISM6XF3V.js} +494 -15
- package/dist/{chunk-HNFYZPNJ.js → chunk-ISOP4ENY.js} +17 -5
- package/dist/{chunk-R7FSMUHG.js → chunk-JDIKCM2N.js} +6 -5
- package/dist/{chunk-BHNX7XNO.js → chunk-KDJIDRJS.js} +3 -3
- package/dist/{chunk-DDJHPMBJ.js → chunk-KFL7OWLI.js} +1 -1
- package/dist/{chunk-5AXDNDUJ.js → chunk-KH27X5CW.js} +2 -2
- package/dist/{chunk-BHKODM4L.js → chunk-KXMIDDUN.js} +2 -2
- package/dist/{chunk-3KRGT5AZ.js → chunk-L2M6D2N4.js} +67 -4
- package/dist/{chunk-KEBI7NYU.js → chunk-L6BTSIKF.js} +4 -4
- package/dist/{chunk-YFK3MJGZ.js → chunk-LO52V6WG.js} +2 -2
- package/dist/{chunk-LVOHE66T.js → chunk-MI7GHNTO.js} +5 -5
- package/dist/{chunk-4524ZR2U.js → chunk-MYJJNLT2.js} +2 -2
- package/dist/{chunk-CZOMD2IW.js → chunk-NAGF5ZJ2.js} +8 -8
- package/dist/{chunk-53KLGXFL.js → chunk-NMUEUDTT.js} +4 -3
- package/dist/{chunk-C6SKS6IU.js → chunk-OSYULPJO.js} +23 -12
- package/dist/{chunk-F37YD4YE.js → chunk-OXDKZYBO.js} +1 -1
- package/dist/chunk-OYIN77HO.js +72 -0
- package/dist/{chunk-XLMJEEW3.js → chunk-P6W2V2AP.js} +2 -2
- package/dist/{chunk-ZKKZEVNI.js → chunk-Q3JW44JV.js} +2 -2
- package/dist/{chunk-EY5CVFDL.js → chunk-Q6POCQOV.js} +12 -12
- package/dist/{chunk-P5QXH5QI.js → chunk-Q767Y4LY.js} +1 -1
- package/dist/{chunk-UK5DKLZY.js → chunk-QGKFDSEO.js} +8 -8
- package/dist/{chunk-YD376BLV.js → chunk-RZGR4G5G.js} +5 -5
- package/dist/{chunk-OZG6CGYW.js → chunk-RZJHCHEA.js} +6 -6
- package/dist/{chunk-H33CFJOF.js → chunk-T274HRSR.js} +4 -4
- package/dist/chunk-T2CR5REM.js +176 -0
- package/dist/{chunk-QESEICW4.js → chunk-T3TVMMXJ.js} +1 -1
- package/dist/{chunk-44BLJJPH.js → chunk-TZ7CBPCD.js} +2 -2
- package/dist/{chunk-YCU7Y77H.js → chunk-UGPNLU4O.js} +1 -1
- package/dist/{chunk-BE5LO5VW.js → chunk-UR55VBLY.js} +2 -2
- package/dist/{chunk-EC7VHNHE.js → chunk-WLKW2TF7.js} +19 -12
- package/dist/{chunk-CWWO3JTD.js → chunk-WNV3X2VU.js} +3 -3
- package/dist/{chunk-HIIXYZYV.js → chunk-XQOBM3E6.js} +3 -3
- package/dist/{chunk-JK7DTAQH.js → chunk-YICO6HEW.js} +5 -5
- package/dist/{chunk-FO3MDD26.js → chunk-YM2T76UM.js} +27 -0
- package/dist/chunk-YOVJOHM5.js +36 -0
- package/dist/{chunk-LS6BU5RM.js → chunk-ZKAQWXGO.js} +1 -1
- package/dist/{codex-app-cards-switch-5PWB62W3.js → codex-app-cards-switch-GN65VEKM.js} +11 -11
- package/dist/{codex-card-routing-I6YOJBTT.js → codex-card-routing-JTS75442.js} +2 -2
- package/dist/{codex-desktop-launch-BCPUKOCV.js → codex-desktop-launch-AQ2HSOQJ.js} +1 -1
- package/dist/{codex-session-launch-4ZUBROFZ.js → codex-session-launch-QYZZGVSQ.js} +20 -20
- package/dist/{config-2CHOLFNB.js → config-5ATI6KPI.js} +3 -3
- package/dist/{global-upgrade-4IKWJHLE.js → global-upgrade-K4HWVUMI.js} +9 -9
- package/dist/{identity-I2VWLZAQ.js → identity-V2GZCPJV.js} +4 -4
- package/dist/{live-capabilities-4CLCROSP.js → live-capabilities-PD62FO4K.js} +4 -4
- package/dist/{paths-YMHQKLFX.js → paths-WPJEIHUE.js} +7 -3
- package/dist/{reapply-FBQ7VR6L.js → reapply-ZEWMGDXT.js} +30 -29
- package/dist/src/index.js +34 -34
- package/dist/{upgrade-lock-7ONNXM6V.js → upgrade-lock-7OR6V323.js} +4 -4
- package/dist/{usage-GWUTCS5A.js → usage-GWZ3UGZG.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-I6HXZIER.js +0 -31
|
@@ -27,11 +27,11 @@ import {
|
|
|
27
27
|
toolResultErrorText,
|
|
28
28
|
transcriptTokensIn,
|
|
29
29
|
transcriptUsageRequest
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-D7ZWJYXB.js";
|
|
31
31
|
import {
|
|
32
32
|
branchFor,
|
|
33
33
|
repoKeyFor
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-BYVLAPCF.js";
|
|
35
35
|
import {
|
|
36
36
|
cancelQuestion,
|
|
37
37
|
clientErrorKindOf,
|
|
@@ -39,39 +39,39 @@ import {
|
|
|
39
39
|
reportClientError,
|
|
40
40
|
sendNotification,
|
|
41
41
|
waitForAnswer
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-FKGWP4MF.js";
|
|
43
43
|
import {
|
|
44
44
|
isRetryable,
|
|
45
45
|
withRetry
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-2QY2BD4T.js";
|
|
47
47
|
import {
|
|
48
48
|
RETRY_ACK,
|
|
49
49
|
readCommandAck,
|
|
50
50
|
refusedReceiptMessage
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-GGCUXNZN.js";
|
|
52
52
|
import {
|
|
53
53
|
fetchAsCredential
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-UGPNLU4O.js";
|
|
55
55
|
import {
|
|
56
56
|
getMachineId
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-CSNG5NQR.js";
|
|
58
58
|
import {
|
|
59
59
|
reportedInstallSource
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-KXMIDDUN.js";
|
|
61
61
|
import {
|
|
62
62
|
IDLE_PROMPT_NOTIFICATION,
|
|
63
63
|
NOTIFICATION_PUSH_TYPES,
|
|
64
64
|
POSTTOOLUSE_MIRROR_ONLY_TOOLS,
|
|
65
65
|
claudeConfigDir
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-GJV5RVUU.js";
|
|
67
67
|
import {
|
|
68
68
|
compareVersion,
|
|
69
69
|
parseVersion
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-BU2J4P7P.js";
|
|
71
71
|
import {
|
|
72
72
|
getApiKey,
|
|
73
73
|
getBaseUrl
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-3NMX4725.js";
|
|
75
75
|
import {
|
|
76
76
|
writeFileAtomic,
|
|
77
77
|
writeJsonAtomicDurable
|
|
@@ -100,7 +100,7 @@ import {
|
|
|
100
100
|
resolveAutoResolveOrigin,
|
|
101
101
|
resolvePolicy,
|
|
102
102
|
unansweredRefusalReason
|
|
103
|
-
} from "./chunk-
|
|
103
|
+
} from "./chunk-6JBX55K4.js";
|
|
104
104
|
|
|
105
105
|
// src/pending.ts
|
|
106
106
|
import { join } from "path";
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MANAGED_CLAUDE_SETTINGS_BY_PLATFORM
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TZ7CBPCD.js";
|
|
4
4
|
import {
|
|
5
5
|
declinedAgentsFile,
|
|
6
6
|
readDeclinedAgents
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-P6W2V2AP.js";
|
|
8
8
|
import {
|
|
9
9
|
OPENCODE_HOOK_BINARY,
|
|
10
10
|
openCodeConfigDir,
|
|
11
11
|
openCodePluginArgv,
|
|
12
12
|
openCodePluginFile
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-MI7GHNTO.js";
|
|
14
14
|
import {
|
|
15
15
|
liveCursorGateCoverage
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-7WDEJTNX.js";
|
|
17
17
|
import {
|
|
18
18
|
compatibleConfigFile,
|
|
19
19
|
compatibleHookEvents,
|
|
20
20
|
grokHome,
|
|
21
21
|
parseConfigDocument
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-2I6A34GJ.js";
|
|
23
23
|
import {
|
|
24
24
|
DEFAULT_HOOKS_KEY_PATH,
|
|
25
25
|
GEMINI_HOOK_BINARY,
|
|
26
26
|
GEMINI_HOOK_EVENTS,
|
|
27
27
|
hooksAt
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-L6BTSIKF.js";
|
|
29
29
|
import {
|
|
30
30
|
CODEX_EARLIER_APPROVAL_MATCHERS,
|
|
31
31
|
CODEX_HOOK_BINARY,
|
|
@@ -53,7 +53,7 @@ import {
|
|
|
53
53
|
parseHookArgv,
|
|
54
54
|
parseHookCommand,
|
|
55
55
|
supportedClaudeEvents
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-GJV5RVUU.js";
|
|
57
57
|
import {
|
|
58
58
|
readRegularJsonFile,
|
|
59
59
|
readRegularTextFile
|
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
OPENCODE_APPROVAL_EVENT,
|
|
68
68
|
isRecord,
|
|
69
69
|
matcherMatchesEveryCall
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-6JBX55K4.js";
|
|
71
71
|
|
|
72
72
|
// src/hook-wiring.ts
|
|
73
73
|
import { createHash } from "crypto";
|
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
configFailureKind,
|
|
5
5
|
retryAgentCommand,
|
|
6
6
|
writeSetupConfigFile
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-FMAIUTVU.js";
|
|
8
8
|
import {
|
|
9
9
|
MCP_BRIDGE_BINARY
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-KDJIDRJS.js";
|
|
11
11
|
import {
|
|
12
12
|
KEY_FILE_MODE
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-XQOBM3E6.js";
|
|
14
14
|
import {
|
|
15
15
|
CLINE_SERVER_NAME_TAKEN,
|
|
16
16
|
CLINE_SETTINGS_REFUSALS,
|
|
@@ -32,10 +32,10 @@ import {
|
|
|
32
32
|
withClinePusharyServer,
|
|
33
33
|
withRefreshedClineKey,
|
|
34
34
|
withoutClinePusharyServer
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-GJV5RVUU.js";
|
|
36
36
|
import {
|
|
37
37
|
resolveGlobalBinary
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-BU2J4P7P.js";
|
|
39
39
|
import {
|
|
40
40
|
readJsonSafe,
|
|
41
41
|
writeFileAtomic,
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
forkFinishWithUpgradeLock,
|
|
4
4
|
installWithUpgradeLock,
|
|
5
5
|
releaseAutoUpdateLock
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-FWCECQTY.js";
|
|
7
7
|
import {
|
|
8
8
|
phoneStartIsRequired
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ELRZO6A7.js";
|
|
10
10
|
import {
|
|
11
11
|
describeAutoUpdateCheck,
|
|
12
12
|
globalInstallLocation,
|
|
@@ -18,25 +18,25 @@ import {
|
|
|
18
18
|
readAutoUpdateState,
|
|
19
19
|
updateAutoUpdateState,
|
|
20
20
|
upgradeEntryFor
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-MYJJNLT2.js";
|
|
22
22
|
import {
|
|
23
23
|
autoUpdateLock,
|
|
24
24
|
autoUpdateLog,
|
|
25
25
|
autoUpdateState
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-GJV5RVUU.js";
|
|
27
27
|
import {
|
|
28
28
|
execNpm,
|
|
29
29
|
fetchLatestPublishedVersion,
|
|
30
30
|
npmErrorMessage,
|
|
31
31
|
readGlobalCliInstallAt,
|
|
32
32
|
readGlobalPrefix
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-BU2J4P7P.js";
|
|
34
34
|
import {
|
|
35
35
|
EXIT
|
|
36
36
|
} from "./chunk-BG4HHB7E.js";
|
|
37
37
|
import {
|
|
38
38
|
NPX_LATEST_COMMAND
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-JDIKCM2N.js";
|
|
40
40
|
import {
|
|
41
41
|
commandsPackage,
|
|
42
42
|
globalUpgradeEntry,
|
|
@@ -13,16 +13,16 @@ import {
|
|
|
13
13
|
} from "./chunk-G66WIAST.js";
|
|
14
14
|
import {
|
|
15
15
|
keyPrefix
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-XQOBM3E6.js";
|
|
17
17
|
import {
|
|
18
18
|
getBaseUrl
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-3NMX4725.js";
|
|
20
20
|
import {
|
|
21
21
|
NPX_LATEST_COMMAND
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-JDIKCM2N.js";
|
|
23
23
|
import {
|
|
24
24
|
isValidApiKey
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-6JBX55K4.js";
|
|
26
26
|
|
|
27
27
|
// src/cli/login-ui.ts
|
|
28
28
|
import { hostname } from "os";
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import {
|
|
2
|
+
needsShell
|
|
3
|
+
} from "./chunk-H6CL3T2S.js";
|
|
4
|
+
import {
|
|
5
|
+
OPENCLAW_ENVIRONMENT_KEYS,
|
|
6
|
+
openClawEnvironmentOf,
|
|
7
|
+
openClawPathsFrom
|
|
8
|
+
} from "./chunk-GJV5RVUU.js";
|
|
9
|
+
import {
|
|
10
|
+
resolvePathBinary
|
|
11
|
+
} from "./chunk-BU2J4P7P.js";
|
|
12
|
+
import {
|
|
13
|
+
isRecord
|
|
14
|
+
} from "./chunk-6JBX55K4.js";
|
|
15
|
+
|
|
16
|
+
// src/openclaw/wiring-state.ts
|
|
17
|
+
var OPENCLAW_PLUGIN_ID = "pushary";
|
|
18
|
+
var OPENCLAW_PLUGIN_PACKAGE = "@pushary/openclaw";
|
|
19
|
+
var OPENCLAW_GATE_HOOK = "before_tool_call";
|
|
20
|
+
var OPENCLAW_NOT_FOUND_MARKER = "Plugin not found";
|
|
21
|
+
var OPENCLAW_MIN_VERSION = "2026.11.3";
|
|
22
|
+
var OPENCLAW_ENTRY_UNSET_MARKER = "Config path is valid but unset";
|
|
23
|
+
var LOADED_STATUS = "loaded";
|
|
24
|
+
var ERROR_STATUS = "error";
|
|
25
|
+
var stringOrNull = (value) => typeof value === "string" && value.length > 0 ? value : null;
|
|
26
|
+
var parsedJson = (text) => {
|
|
27
|
+
try {
|
|
28
|
+
return JSON.parse(text);
|
|
29
|
+
} catch {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
var jsonObjectIn = (output) => {
|
|
34
|
+
const start = output.indexOf("{");
|
|
35
|
+
return start === -1 ? null : parsedJson(output.slice(start));
|
|
36
|
+
};
|
|
37
|
+
var typedHookNames = (value) => Array.isArray(value) ? value.flatMap((hook) => isRecord(hook) && typeof hook.name === "string" ? [hook.name] : []) : null;
|
|
38
|
+
var registersGateFrom = (document) => {
|
|
39
|
+
const names = typedHookNames(document.typedHooks);
|
|
40
|
+
return names === null ? null : names.includes(OPENCLAW_GATE_HOOK);
|
|
41
|
+
};
|
|
42
|
+
var openClawPluginFactsFrom = (reading) => {
|
|
43
|
+
if (reading.kind === "failed") {
|
|
44
|
+
return reading.output.includes(OPENCLAW_NOT_FOUND_MARKER) ? { kind: "not_installed" } : { kind: "unreadable" };
|
|
45
|
+
}
|
|
46
|
+
const document = jsonObjectIn(reading.stdout);
|
|
47
|
+
if (!isRecord(document) || !isRecord(document.plugin)) return { kind: "unreadable" };
|
|
48
|
+
const plugin = document.plugin;
|
|
49
|
+
if (typeof plugin.enabled !== "boolean") return { kind: "unreadable" };
|
|
50
|
+
return {
|
|
51
|
+
kind: "installed",
|
|
52
|
+
packageName: stringOrNull(plugin.packageName),
|
|
53
|
+
version: stringOrNull(plugin.version),
|
|
54
|
+
enabled: plugin.enabled,
|
|
55
|
+
status: stringOrNull(plugin.status),
|
|
56
|
+
registersGate: registersGateFrom(document)
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
var openClawEntryFrom = (reading) => {
|
|
60
|
+
if (reading.kind === "failed") {
|
|
61
|
+
return reading.output.includes(OPENCLAW_ENTRY_UNSET_MARKER) ? { kind: "absent" } : { kind: "unreadable" };
|
|
62
|
+
}
|
|
63
|
+
const text = reading.stdout.trim();
|
|
64
|
+
if (text.length === 0) return { kind: "unreadable" };
|
|
65
|
+
const value = parsedJson(text);
|
|
66
|
+
return value === null ? { kind: "unreadable" } : { kind: "present", value };
|
|
67
|
+
};
|
|
68
|
+
var openClawWiringState = (facts) => {
|
|
69
|
+
if (facts.kind !== "installed") return facts;
|
|
70
|
+
if (facts.packageName !== OPENCLAW_PLUGIN_PACKAGE) return { kind: "not_ours", packageName: facts.packageName };
|
|
71
|
+
if (!facts.enabled) return { kind: "disabled", version: facts.version };
|
|
72
|
+
if (facts.status === ERROR_STATUS || facts.registersGate === false) return { kind: "failed_to_load", version: facts.version };
|
|
73
|
+
return { kind: "wired", version: facts.version, gateVerified: facts.registersGate === true && facts.status === LOADED_STATUS };
|
|
74
|
+
};
|
|
75
|
+
var isOpenClawWired = (state) => state.kind === "wired";
|
|
76
|
+
var isOursToRemove = (facts) => facts.kind === "installed" && facts.packageName === OPENCLAW_PLUGIN_PACKAGE;
|
|
77
|
+
|
|
78
|
+
// src/openclaw/runtime.ts
|
|
79
|
+
import { execFile } from "child_process";
|
|
80
|
+
import { accessSync, constants, statSync } from "fs";
|
|
81
|
+
import { homedir } from "os";
|
|
82
|
+
import { join } from "path";
|
|
83
|
+
import { promisify } from "util";
|
|
84
|
+
var OPENCLAW_LAUNCHER_NAME = "openclaw";
|
|
85
|
+
var OPENCLAW_ENTRY_PATH = `plugins.entries.${OPENCLAW_PLUGIN_ID}`;
|
|
86
|
+
var OPENCLAW_PATH_NOT_FOUND = "Config path not found";
|
|
87
|
+
var OPENCLAW_INSPECT_TIMEOUT_MS = 6e4;
|
|
88
|
+
var OPENCLAW_CONFIG_TIMEOUT_MS = 6e4;
|
|
89
|
+
var OPENCLAW_ENABLE_TIMEOUT_MS = 12e4;
|
|
90
|
+
var OPENCLAW_INSTALL_TIMEOUT_MS = 6e5;
|
|
91
|
+
var OPENCLAW_OUTPUT_LIMIT_BYTES = 4 * 1024 * 1024;
|
|
92
|
+
var isExecutableFile = (path) => {
|
|
93
|
+
try {
|
|
94
|
+
accessSync(path, constants.X_OK);
|
|
95
|
+
return statSync(path).isFile();
|
|
96
|
+
} catch {
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
var currentOpenClawEnvironment = () => openClawEnvironmentOf(process.env);
|
|
101
|
+
var openClawPathsNow = (environment = currentOpenClawEnvironment()) => openClawPathsFrom(environment, homedir());
|
|
102
|
+
var openClawLauncherCandidates = (paths, userHome) => [
|
|
103
|
+
join(paths.home, ".openclaw", "bin", OPENCLAW_LAUNCHER_NAME),
|
|
104
|
+
join(userHome, ".local", "bin", OPENCLAW_LAUNCHER_NAME)
|
|
105
|
+
];
|
|
106
|
+
var findOpenClawLauncher = () => {
|
|
107
|
+
const onPath = resolvePathBinary(OPENCLAW_LAUNCHER_NAME);
|
|
108
|
+
if (onPath) return { path: onPath };
|
|
109
|
+
if (process.platform === "win32") return null;
|
|
110
|
+
const installed = openClawLauncherCandidates(openClawPathsNow(), homedir()).find(isExecutableFile);
|
|
111
|
+
return installed ? { path: installed } : null;
|
|
112
|
+
};
|
|
113
|
+
var quotedForWindowsShell = (argument) => `"${argument.replace(/"/g, '\\"')}"`;
|
|
114
|
+
var commandOutput = (error) => {
|
|
115
|
+
if (!isRecord(error)) return String(error);
|
|
116
|
+
return [error.stdout, error.stderr].map((part) => part === void 0 || part === null ? "" : String(part)).join("\n");
|
|
117
|
+
};
|
|
118
|
+
var stoppedAtTimeout = (error) => isRecord(error) && error.killed === true;
|
|
119
|
+
var runFileAsync = promisify(execFile);
|
|
120
|
+
var childEnvironment = (environment) => {
|
|
121
|
+
const inherited = { ...process.env };
|
|
122
|
+
for (const key of OPENCLAW_ENVIRONMENT_KEYS) delete inherited[key];
|
|
123
|
+
return { ...inherited, ...environment };
|
|
124
|
+
};
|
|
125
|
+
var runOpenClawCommand = async (session, args, timeoutMs) => {
|
|
126
|
+
const shell = needsShell(session.launcher.path);
|
|
127
|
+
try {
|
|
128
|
+
const running = runFileAsync(
|
|
129
|
+
shell ? quotedForWindowsShell(session.launcher.path) : session.launcher.path,
|
|
130
|
+
shell ? args.map(quotedForWindowsShell) : [...args],
|
|
131
|
+
{ encoding: "utf-8", timeout: timeoutMs, maxBuffer: OPENCLAW_OUTPUT_LIMIT_BYTES, shell, env: childEnvironment(session.environment) }
|
|
132
|
+
);
|
|
133
|
+
running.child.stdin?.end();
|
|
134
|
+
const { stdout } = await running;
|
|
135
|
+
return { kind: "ok", stdout };
|
|
136
|
+
} catch (error) {
|
|
137
|
+
return { kind: "failed", output: commandOutput(error), timedOut: stoppedAtTimeout(error) };
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
var inspectOpenClawPlugin = async (session, options) => {
|
|
141
|
+
const args = ["plugins", "inspect", OPENCLAW_PLUGIN_ID, ...options.runtime ? ["--runtime"] : [], "--json"];
|
|
142
|
+
const result = await runOpenClawCommand(session, args, OPENCLAW_INSPECT_TIMEOUT_MS);
|
|
143
|
+
return openClawPluginFactsFrom(result.kind === "ok" ? result : { kind: "failed", output: result.output });
|
|
144
|
+
};
|
|
145
|
+
var readOpenClawEntry = async (session) => {
|
|
146
|
+
const result = await runOpenClawCommand(session, ["config", "get", OPENCLAW_ENTRY_PATH, "--json"], OPENCLAW_CONFIG_TIMEOUT_MS);
|
|
147
|
+
return openClawEntryFrom(result.kind === "ok" ? result : { kind: "failed", output: result.output });
|
|
148
|
+
};
|
|
149
|
+
var writeOpenClawEntry = async (session, value) => (await runOpenClawCommand(session, ["config", "set", OPENCLAW_ENTRY_PATH, JSON.stringify(value), "--strict-json"], OPENCLAW_CONFIG_TIMEOUT_MS)).kind === "ok";
|
|
150
|
+
var unsetOpenClawEntry = async (session) => {
|
|
151
|
+
const result = await runOpenClawCommand(session, ["config", "unset", OPENCLAW_ENTRY_PATH], OPENCLAW_CONFIG_TIMEOUT_MS);
|
|
152
|
+
return result.kind === "ok" || result.output.includes(OPENCLAW_PATH_NOT_FOUND);
|
|
153
|
+
};
|
|
154
|
+
var installOpenClawPluginFrom = (session, folder) => runOpenClawCommand(session, ["plugins", "install", folder, "--force", "--accept-capabilities"], OPENCLAW_INSTALL_TIMEOUT_MS);
|
|
155
|
+
var enableOpenClawPlugin = (session) => runOpenClawCommand(session, ["plugins", "enable", OPENCLAW_PLUGIN_ID, "--accept-capabilities"], OPENCLAW_ENABLE_TIMEOUT_MS);
|
|
156
|
+
var uninstallOpenClawPlugin = (session, dryRun) => runOpenClawCommand(session, ["plugins", "uninstall", OPENCLAW_PLUGIN_ID, dryRun ? "--dry-run" : "--force"], OPENCLAW_ENABLE_TIMEOUT_MS);
|
|
157
|
+
|
|
158
|
+
export {
|
|
159
|
+
OPENCLAW_PLUGIN_ID,
|
|
160
|
+
OPENCLAW_PLUGIN_PACKAGE,
|
|
161
|
+
OPENCLAW_MIN_VERSION,
|
|
162
|
+
openClawWiringState,
|
|
163
|
+
isOpenClawWired,
|
|
164
|
+
isOursToRemove,
|
|
165
|
+
currentOpenClawEnvironment,
|
|
166
|
+
openClawPathsNow,
|
|
167
|
+
openClawLauncherCandidates,
|
|
168
|
+
findOpenClawLauncher,
|
|
169
|
+
inspectOpenClawPlugin,
|
|
170
|
+
readOpenClawEntry,
|
|
171
|
+
writeOpenClawEntry,
|
|
172
|
+
unsetOpenClawEntry,
|
|
173
|
+
installOpenClawPluginFrom,
|
|
174
|
+
enableOpenClawPlugin,
|
|
175
|
+
uninstallOpenClawPlugin
|
|
176
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
claudeConfigDir
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GJV5RVUU.js";
|
|
4
4
|
import {
|
|
5
5
|
claudePermissionRulesFromSettings
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-6JBX55K4.js";
|
|
7
7
|
|
|
8
8
|
// src/claude-permission-rules.ts
|
|
9
9
|
import { readFileSync, statSync } from "fs";
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-CYTPQDQY.js";
|
|
4
4
|
import {
|
|
5
5
|
parseVersion
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-BU2J4P7P.js";
|
|
7
7
|
import {
|
|
8
8
|
isRecord
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-6JBX55K4.js";
|
|
10
10
|
|
|
11
11
|
// src/setup/agent-probe.ts
|
|
12
12
|
import { execSync } from "child_process";
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
APPROVAL_RULES_PATH,
|
|
3
3
|
canChangeApprovalSettings
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-LO52V6WG.js";
|
|
5
5
|
import {
|
|
6
6
|
callMcpTool
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-2QY2BD4T.js";
|
|
8
8
|
import {
|
|
9
9
|
absoluteUrl
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-3TTXOU6G.js";
|
|
11
11
|
import {
|
|
12
12
|
getBaseUrl
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-3NMX4725.js";
|
|
14
14
|
import {
|
|
15
15
|
NPX_LATEST_COMMAND
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-JDIKCM2N.js";
|
|
17
17
|
import {
|
|
18
18
|
AGENT_STOP_DEFAULT_SECONDS,
|
|
19
19
|
APPROVAL_MODE_META,
|
|
@@ -21,9 +21,12 @@ import {
|
|
|
21
21
|
classifyConfirmResponse,
|
|
22
22
|
isAnswerSource,
|
|
23
23
|
roundTripAsk
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-6JBX55K4.js";
|
|
25
25
|
|
|
26
26
|
// src/reach.ts
|
|
27
|
+
var PUSHARY_APP_DOWNLOAD_URL = "https://pushary.com/download";
|
|
28
|
+
var SIGN_IN_ON_THE_APP_STEP = "Sign in with the same account you use here and allow notifications, so your phone registers for approvals.";
|
|
29
|
+
var GET_THE_APP_STEP = `Get the Pushary app at ${PUSHARY_APP_DOWNLOAD_URL}. ${SIGN_IN_ON_THE_APP_STEP}`;
|
|
27
30
|
var reachVerdict = (channels) => {
|
|
28
31
|
const { yours, site } = channels;
|
|
29
32
|
if (yours === null || site === null) {
|
|
@@ -68,7 +71,7 @@ var describeAppRepair = (verdict) => {
|
|
|
68
71
|
case "nobody":
|
|
69
72
|
return [
|
|
70
73
|
"Open the Pushary app, sign in, and allow notifications.",
|
|
71
|
-
`If this terminal was never paired with your phone, run: ${NPX_LATEST_COMMAND}
|
|
74
|
+
`If this terminal was never paired with your phone, run: ${NPX_LATEST_COMMAND} pair`
|
|
72
75
|
];
|
|
73
76
|
case "others":
|
|
74
77
|
return [
|
|
@@ -148,7 +151,7 @@ var describeVerifyOutcome = (outcome) => {
|
|
|
148
151
|
ok: false,
|
|
149
152
|
message: "Nothing to deliver to. Agents are configured; approvals will fall back to the terminal.",
|
|
150
153
|
next: [
|
|
151
|
-
|
|
154
|
+
GET_THE_APP_STEP,
|
|
152
155
|
"Then pushary doctor --roundtrip to test a synthetic question and answer."
|
|
153
156
|
]
|
|
154
157
|
};
|
|
@@ -158,7 +161,7 @@ var describeVerifyOutcome = (outcome) => {
|
|
|
158
161
|
message: `Delivered to ${plural2(outcome.recipients, "device")} on this site, none of them yours.`,
|
|
159
162
|
next: [
|
|
160
163
|
`Approvals for your agent would wake one of your ${plural2(outcome.otherMembers, "teammate")}.`,
|
|
161
|
-
|
|
164
|
+
GET_THE_APP_STEP
|
|
162
165
|
]
|
|
163
166
|
};
|
|
164
167
|
case "unattributable":
|
|
@@ -167,7 +170,8 @@ var describeVerifyOutcome = (outcome) => {
|
|
|
167
170
|
message: `Delivered to ${plural2(outcome.recipients, "device")} on this site, and no way to tell whose.`,
|
|
168
171
|
next: [
|
|
169
172
|
"Browser subscriptions carry no owner, and this site has other members.",
|
|
170
|
-
|
|
173
|
+
GET_THE_APP_STEP,
|
|
174
|
+
"Or run pushary doctor --roundtrip to prove it reaches you."
|
|
171
175
|
]
|
|
172
176
|
};
|
|
173
177
|
case "error":
|
|
@@ -362,8 +366,8 @@ var describeRoundTripOutcome = (outcome, { appPlatforms = [], baseUrl = getBaseU
|
|
|
362
366
|
ok: false,
|
|
363
367
|
message: "Nothing to ask. No phone or browser is connected to this site.",
|
|
364
368
|
next: [
|
|
365
|
-
|
|
366
|
-
"
|
|
369
|
+
GET_THE_APP_STEP,
|
|
370
|
+
"Then run pushary doctor --roundtrip again."
|
|
367
371
|
]
|
|
368
372
|
};
|
|
369
373
|
case "stopped":
|
|
@@ -410,6 +414,9 @@ var roundTripEvidence = (outcome) => ({
|
|
|
410
414
|
});
|
|
411
415
|
|
|
412
416
|
export {
|
|
417
|
+
PUSHARY_APP_DOWNLOAD_URL,
|
|
418
|
+
SIGN_IN_ON_THE_APP_STEP,
|
|
419
|
+
GET_THE_APP_STEP,
|
|
413
420
|
reachVerdict,
|
|
414
421
|
reachesYou,
|
|
415
422
|
describeReach,
|
|
@@ -4,15 +4,15 @@ import {
|
|
|
4
4
|
claimThrottle,
|
|
5
5
|
releaseThrottle,
|
|
6
6
|
reportEvent
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-Q6POCQOV.js";
|
|
8
8
|
import {
|
|
9
9
|
deriveToolTarget,
|
|
10
10
|
permissionDeniedAction
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-D7ZWJYXB.js";
|
|
12
12
|
import {
|
|
13
13
|
machineDecisionFor,
|
|
14
14
|
wireVerdictFor
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-6JBX55K4.js";
|
|
16
16
|
|
|
17
17
|
// src/machine-decision-audit.ts
|
|
18
18
|
import { basename } from "path";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveInstallSourceFor
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KXMIDDUN.js";
|
|
4
4
|
import {
|
|
5
5
|
configFilePath
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-3NMX4725.js";
|
|
7
7
|
import {
|
|
8
8
|
backupFile,
|
|
9
9
|
readJsonSafe,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
API_KEY_PREFIX_PATTERN,
|
|
15
15
|
isRecord,
|
|
16
16
|
isValidApiKey
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-6JBX55K4.js";
|
|
18
18
|
|
|
19
19
|
// src/shell-alias.ts
|
|
20
20
|
import { homedir } from "os";
|
|
@@ -3,24 +3,24 @@ import {
|
|
|
3
3
|
expectedLaunchCapabilities,
|
|
4
4
|
hasSpawnProvider,
|
|
5
5
|
resolveControlPolicy
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ELRZO6A7.js";
|
|
7
7
|
import {
|
|
8
8
|
daemonHasRemoteProof,
|
|
9
9
|
daemonServiceManagerAvailable,
|
|
10
10
|
hasDaemonServiceDefinition,
|
|
11
11
|
readDaemonNeedsLogin,
|
|
12
12
|
readDaemonStatus
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-GIWI5IHB.js";
|
|
14
14
|
import {
|
|
15
15
|
getMachineId
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-CSNG5NQR.js";
|
|
17
17
|
import {
|
|
18
18
|
readControlMode,
|
|
19
19
|
readKeySource
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-XQOBM3E6.js";
|
|
21
21
|
import {
|
|
22
22
|
getBaseUrl
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-3NMX4725.js";
|
|
24
24
|
import {
|
|
25
25
|
getPackageVersion
|
|
26
26
|
} from "./chunk-WIIMW5YO.js";
|
|
@@ -41,6 +41,30 @@ var useColor = (context = {}, stream = process.stdout) => {
|
|
|
41
41
|
if (context.json) return false;
|
|
42
42
|
return stream.isTTY === true;
|
|
43
43
|
};
|
|
44
|
+
var RUNNER_MARKERS = [
|
|
45
|
+
"CI",
|
|
46
|
+
"GITHUB_ACTIONS",
|
|
47
|
+
"GITLAB_CI",
|
|
48
|
+
"CIRCLECI",
|
|
49
|
+
"TRAVIS",
|
|
50
|
+
"TF_BUILD",
|
|
51
|
+
"BUILDKITE_BUILD_ID",
|
|
52
|
+
"CODEBUILD_BUILD_ID",
|
|
53
|
+
"CODEBUILD_BUILD_ARN",
|
|
54
|
+
"TEAMCITY_BUILD_PROPERTIES_FILE"
|
|
55
|
+
];
|
|
56
|
+
var CI_ENVIRONMENT_VARIABLES = [...RUNNER_MARKERS, "BUILD_TAG", "JENKINS_HOME", "EXECUTOR_NUMBER"];
|
|
57
|
+
var JENKINS_BUILD_TAG_PREFIX = "jenkins-";
|
|
58
|
+
var turnedOn = (value) => value !== void 0 && value !== "" && value !== "false" && value !== "0";
|
|
59
|
+
var present = (value) => value !== void 0 && value !== "";
|
|
60
|
+
var jenkinsMarkerIn = (env) => {
|
|
61
|
+
if (env.BUILD_TAG?.startsWith(JENKINS_BUILD_TAG_PREFIX)) return "BUILD_TAG";
|
|
62
|
+
return present(env.JENKINS_HOME) && present(env.EXECUTOR_NUMBER) ? "JENKINS_HOME" : null;
|
|
63
|
+
};
|
|
64
|
+
var ciMarkerIn = (env) => RUNNER_MARKERS.find((name) => turnedOn(env[name])) ?? jenkinsMarkerIn(env);
|
|
65
|
+
var ciMarker = () => ciMarkerIn(process.env);
|
|
66
|
+
var isCI = () => ciMarker() !== null;
|
|
67
|
+
var describeCiReason = (marker) => marker === null ? "" : ` (${marker} is set)`;
|
|
44
68
|
var SPINNER_FRAMES = [" ", ". ", ".. ", "..."];
|
|
45
69
|
var SPINNER_FRAME_WIDTH = SPINNER_FRAMES[0].length + 1;
|
|
46
70
|
var SPINNER_INTERVAL_MS = 200;
|
|
@@ -107,5 +131,8 @@ export {
|
|
|
107
131
|
terminalColumns,
|
|
108
132
|
ansiPainter,
|
|
109
133
|
useColor,
|
|
134
|
+
ciMarker,
|
|
135
|
+
isCI,
|
|
136
|
+
describeCiReason,
|
|
110
137
|
createIo
|
|
111
138
|
};
|