@pushary/agent-hooks 0.93.0 → 0.94.0
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 +10 -0
- package/dist/bin/pushary-bell-hook.js +4 -4
- package/dist/bin/pushary-bell.js +5 -5
- package/dist/bin/pushary-claude.js +12 -12
- package/dist/bin/pushary-clean.js +11 -11
- package/dist/bin/pushary-codex-bridge.js +9 -9
- package/dist/bin/pushary-codex-hook.js +9 -9
- package/dist/bin/pushary-codex.js +7 -7
- package/dist/bin/pushary-connect.js +6 -6
- package/dist/bin/pushary-daemon.js +13 -13
- package/dist/bin/pushary-disconnect.js +5 -5
- package/dist/bin/pushary-doctor.js +16 -16
- package/dist/bin/pushary-elicitation-hook.js +3 -3
- package/dist/bin/pushary-gemini-bridge.js +9 -9
- package/dist/bin/pushary-gemini-hook.js +8 -8
- package/dist/bin/pushary-hook.js +10 -10
- package/dist/bin/pushary-login.js +7 -7
- package/dist/bin/pushary-logout.js +4 -4
- package/dist/bin/pushary-mode.js +3 -3
- package/dist/bin/pushary-notification-hook.js +7 -7
- package/dist/bin/pushary-opencode-hook.js +8 -8
- package/dist/bin/pushary-permission-denied-hook.js +10 -10
- package/dist/bin/pushary-permission-hook.js +10 -10
- package/dist/bin/pushary-post-hook.js +7 -7
- package/dist/bin/pushary-prompt-hook.js +7 -7
- package/dist/bin/pushary-session-end-hook.js +7 -7
- package/dist/bin/pushary-session-start-hook.js +11 -11
- package/dist/bin/pushary-setup.js +19 -19
- package/dist/bin/pushary-stats.js +2 -2
- package/dist/bin/pushary-status.js +8 -8
- package/dist/bin/pushary-stop-hook.js +7 -7
- package/dist/bin/pushary-stopfailure-hook.js +7 -7
- package/dist/bin/pushary-transcripts.js +4 -4
- package/dist/bin/pushary-upgrade.js +12 -12
- package/dist/bin/pushary-wait.js +3 -3
- package/dist/bin/pushary.js +10 -0
- package/dist/{chunk-VHWCVD42.js → chunk-2ORRI66J.js} +1 -1
- package/dist/{chunk-TFN7ZCTI.js → chunk-36LR2LOT.js} +5 -5
- package/dist/{chunk-7FE2KABY.js → chunk-46P3VES5.js} +1 -1
- package/dist/{chunk-UAFQC35P.js → chunk-4PE2SQVM.js} +1 -1
- package/dist/{chunk-G5L3WVFV.js → chunk-5HGLZGI4.js} +24 -9
- package/dist/{chunk-OSALSIUF.js → chunk-6BIMJIRG.js} +1 -1
- package/dist/{chunk-UZNKVRLE.js → chunk-6WYL3XIP.js} +1 -1
- package/dist/{chunk-CELX75MW.js → chunk-BSEAOCCQ.js} +1 -1
- package/dist/{chunk-NZQTIDXN.js → chunk-FYOIW5RV.js} +3 -3
- package/dist/{chunk-6Y4IKMQT.js → chunk-HSAVPZ46.js} +3 -3
- package/dist/{chunk-72FWXLW2.js → chunk-NVPYRDCT.js} +1 -1
- package/dist/{chunk-KHTFHUL3.js → chunk-OB4RF2TF.js} +1 -1
- package/dist/{chunk-JW4KO5AF.js → chunk-ODL52O5V.js} +1 -1
- package/dist/{chunk-I463AEG3.js → chunk-OYNPLEXP.js} +1 -1
- package/dist/{chunk-T2PKGGDM.js → chunk-QGA2ZB4I.js} +1 -1
- package/dist/{chunk-HCLSTQ3N.js → chunk-QKNLW7H6.js} +7 -7
- package/dist/{chunk-5NAZ7SFS.js → chunk-RH3TM7TO.js} +1 -1
- package/dist/{chunk-UPCPR7QW.js → chunk-ROHFVGXM.js} +1 -1
- package/dist/{chunk-YUZYMAL7.js → chunk-RX75MRGC.js} +3 -3
- package/dist/{chunk-GKMQMSTB.js → chunk-TDUTNYAQ.js} +1 -1
- package/dist/{chunk-BXTJVM7O.js → chunk-UZFVNEEU.js} +6 -6
- package/dist/{chunk-Z6RFZKY4.js → chunk-WY4ALDYN.js} +1 -1
- package/dist/{chunk-QQSQWLFR.js → chunk-Y3UGCQQC.js} +1 -1
- package/dist/{chunk-N3TF3RQ2.js → chunk-Y6XXFXVB.js} +1 -1
- package/dist/{chunk-NXZYC3B3.js → chunk-YANV5TGK.js} +3 -3
- package/dist/{chunk-VNMKIJZB.js → chunk-Z6CP5ZZD.js} +3 -0
- package/dist/{chunk-WEDYCMHU.js → chunk-ZO2XG3CX.js} +1 -1
- package/dist/{chunk-TWVZHZM3.js → chunk-ZTJF6ANY.js} +2 -2
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +10 -10
- package/package.json +2 -2
|
@@ -11,8 +11,9 @@ import {
|
|
|
11
11
|
getBaseUrl
|
|
12
12
|
} from "./chunk-2UMNXADU.js";
|
|
13
13
|
import {
|
|
14
|
-
isValidApiKey
|
|
15
|
-
|
|
14
|
+
isValidApiKey,
|
|
15
|
+
normalizeKeyScope
|
|
16
|
+
} from "./chunk-Z6CP5ZZD.js";
|
|
16
17
|
|
|
17
18
|
// src/session.ts
|
|
18
19
|
var samePusharyAccount = (left, right) => left.kind === "ok" && right.kind === "ok" && left.identity.workspaceId !== "" && left.identity.workspaceId === right.identity.workspaceId && left.identity.siteId === right.identity.siteId;
|
|
@@ -20,7 +21,6 @@ var IDENTITY_PATH = "/api/v1/server/identity";
|
|
|
20
21
|
var DEFAULT_TIMEOUT_MS = 1e4;
|
|
21
22
|
var SUBSCRIPTION_REQUIRED_CODE = "subscription_required";
|
|
22
23
|
var DEFAULT_UPGRADE_PATH = "/dashboard/settings?tab=billing";
|
|
23
|
-
var KEY_SCOPES = ["full_access", "connector", "bound"];
|
|
24
24
|
var SUBSCRIPTION_STATUSES = [
|
|
25
25
|
"active",
|
|
26
26
|
"past_due",
|
|
@@ -31,7 +31,6 @@ var SUBSCRIPTION_STATUSES = [
|
|
|
31
31
|
"none"
|
|
32
32
|
];
|
|
33
33
|
var asString = (value) => typeof value === "string" && value ? value : null;
|
|
34
|
-
var asScope = (value) => KEY_SCOPES.includes(value) ? value : "full_access";
|
|
35
34
|
var asStatus = (value) => SUBSCRIPTION_STATUSES.includes(value) ? value : "none";
|
|
36
35
|
var asCount = (value) => typeof value === "number" && Number.isFinite(value) ? Math.max(0, Math.trunc(value)) : 0;
|
|
37
36
|
var absoluteUrl = (baseUrl, pathOrUrl) => {
|
|
@@ -43,12 +42,13 @@ var toIdentity = (body) => {
|
|
|
43
42
|
const raw = body;
|
|
44
43
|
const keyId = asString(raw.keyId);
|
|
45
44
|
const siteId = asString(raw.siteId);
|
|
46
|
-
|
|
45
|
+
const keyScope = normalizeKeyScope(raw.keyScope);
|
|
46
|
+
if (!keyId || !siteId || !keyScope) return null;
|
|
47
47
|
return {
|
|
48
48
|
keyId,
|
|
49
49
|
keyPrefix: asString(raw.keyPrefix) ?? "",
|
|
50
50
|
keyName: asString(raw.keyName) ?? "",
|
|
51
|
-
keyScope
|
|
51
|
+
keyScope,
|
|
52
52
|
siteId,
|
|
53
53
|
siteSlug: asString(raw.siteSlug) ?? "",
|
|
54
54
|
siteName: asString(raw.siteName) ?? "",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
openCodeConfigDirFrom
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BSEAOCCQ.js";
|
|
4
4
|
import {
|
|
5
5
|
codexHomeFrom
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-Y6XXFXVB.js";
|
|
7
7
|
import {
|
|
8
8
|
HOOK_LOCATOR_BINARY
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-Z6CP5ZZD.js";
|
|
10
10
|
|
|
11
11
|
// src/vscode-config.ts
|
|
12
12
|
import { homedir } from "os";
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
// ../contracts/src/index.ts
|
|
2
|
+
var KEY_SCOPES = ["full_access", "agent", "connector", "bound"];
|
|
3
|
+
var normalizeKeyScope = (value) => typeof value === "string" && KEY_SCOPES.includes(value) ? value : null;
|
|
2
4
|
var APPROVAL_MODES = ["push_only", "terminal_only", "push_first", "notify_only"];
|
|
3
5
|
var isApprovalMode = (value) => typeof value === "string" && APPROVAL_MODES.includes(value);
|
|
4
6
|
var MAX_AGENT_QUESTIONS = 4;
|
|
@@ -1347,6 +1349,7 @@ var elicitationContentFromAnswers = (ask, answers) => {
|
|
|
1347
1349
|
};
|
|
1348
1350
|
|
|
1349
1351
|
export {
|
|
1352
|
+
normalizeKeyScope,
|
|
1350
1353
|
parseAgentQuestions,
|
|
1351
1354
|
parseAgentQuestionAnswers,
|
|
1352
1355
|
normalizeInstallSource,
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
} from "./chunk-L4ZCFMWW.js";
|
|
8
8
|
import {
|
|
9
9
|
getMachineId
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-NVPYRDCT.js";
|
|
11
11
|
import {
|
|
12
12
|
pusharyDir
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-Y6XXFXVB.js";
|
|
14
14
|
import {
|
|
15
15
|
getPackageVersion
|
|
16
16
|
} from "./chunk-DINDL2CF.js";
|
package/dist/src/index.d.ts
CHANGED
|
@@ -20,6 +20,8 @@ declare const fetchModeState: (apiKey: string, sessionId?: string, reuseWithinMs
|
|
|
20
20
|
declare const fetchModeOverride: (apiKey: string) => Promise<ApprovalMode | null>;
|
|
21
21
|
|
|
22
22
|
interface UsageReport {
|
|
23
|
+
readonly eventId: string;
|
|
24
|
+
readonly reportedAt: number;
|
|
23
25
|
readonly tokensIn: number;
|
|
24
26
|
readonly tokensOut: number;
|
|
25
27
|
readonly costUsd: number;
|
package/dist/src/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
handlePreToolUse
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-QKNLW7H6.js";
|
|
4
4
|
import {
|
|
5
5
|
fetchAccountPublicKey
|
|
6
6
|
} from "../chunk-EQRS3SGM.js";
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-OYNPLEXP.js";
|
|
8
|
+
import "../chunk-2ORRI66J.js";
|
|
9
9
|
import "../chunk-YHG74UFF.js";
|
|
10
10
|
import {
|
|
11
11
|
fetchModeOverride,
|
|
@@ -15,21 +15,21 @@ import {
|
|
|
15
15
|
handlePostToolUse,
|
|
16
16
|
handleStop,
|
|
17
17
|
reportEvent
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-5HGLZGI4.js";
|
|
19
19
|
import {
|
|
20
20
|
askUser,
|
|
21
21
|
cancelQuestion,
|
|
22
22
|
waitForAnswer
|
|
23
23
|
} from "../chunk-RER3FRTD.js";
|
|
24
|
-
import "../chunk-
|
|
25
|
-
import "../chunk-
|
|
26
|
-
import "../chunk-
|
|
27
|
-
import "../chunk-
|
|
24
|
+
import "../chunk-4PE2SQVM.js";
|
|
25
|
+
import "../chunk-Y3UGCQQC.js";
|
|
26
|
+
import "../chunk-NVPYRDCT.js";
|
|
27
|
+
import "../chunk-Y6XXFXVB.js";
|
|
28
28
|
import "../chunk-EYRGBYZG.js";
|
|
29
29
|
import "../chunk-SAF6HGAA.js";
|
|
30
30
|
import "../chunk-7QLSKOSU.js";
|
|
31
31
|
import "../chunk-KZERVKTD.js";
|
|
32
|
-
import "../chunk-
|
|
32
|
+
import "../chunk-ODL52O5V.js";
|
|
33
33
|
import "../chunk-4LL6LG5X.js";
|
|
34
34
|
import {
|
|
35
35
|
getApiKey,
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
} from "../chunk-2UMNXADU.js";
|
|
38
38
|
import {
|
|
39
39
|
resolvePolicy
|
|
40
|
-
} from "../chunk-
|
|
40
|
+
} from "../chunk-Z6CP5ZZD.js";
|
|
41
41
|
export {
|
|
42
42
|
askUser,
|
|
43
43
|
cancelQuestion,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pushary/agent-hooks",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.94.0",
|
|
4
4
|
"description": "Permission hooks for AI coding agents: route tool approvals through Pushary push notifications",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pushary",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"license": "MIT",
|
|
32
32
|
"type": "module",
|
|
33
33
|
"engines": {
|
|
34
|
-
"node": "
|
|
34
|
+
"node": "^20.17.0 || ^22.13.0 || >=23.5.0"
|
|
35
35
|
},
|
|
36
36
|
"main": "./dist/src/index.js",
|
|
37
37
|
"types": "./dist/src/index.d.ts",
|