@pushary/agent-hooks 1.9.7 → 1.9.9
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 +18 -0
- package/README.md +3 -3
- package/data/cursor-plugin/README.md +3 -7
- package/data/vscode-plugin/README.md +1 -1
- package/dist/bin/pushary-bell-hook.js +22 -24
- package/dist/bin/pushary-bell.js +13 -13
- package/dist/bin/pushary-claude.js +28 -30
- package/dist/bin/pushary-clean.js +113 -94
- package/dist/bin/pushary-codex-bridge.js +20 -20
- package/dist/bin/pushary-codex-hook.js +36 -38
- package/dist/bin/pushary-codex.js +13 -13
- package/dist/bin/pushary-connect.js +48 -22
- package/dist/bin/pushary-cowork.js +5 -5
- package/dist/bin/pushary-daemon.js +50 -40
- package/dist/bin/pushary-disconnect.js +188 -56
- package/dist/bin/pushary-doctor.js +105 -85
- package/dist/bin/pushary-elicitation-hook.js +25 -27
- package/dist/bin/pushary-gemini-bridge.js +13 -13
- package/dist/bin/pushary-gemini-hook.js +31 -33
- package/dist/bin/pushary-hook.js +36 -39
- package/dist/bin/pushary-login.js +12 -12
- package/dist/bin/pushary-logout.js +105 -42
- package/dist/bin/pushary-mcp.js +9 -9
- package/dist/bin/pushary-mode.js +28 -31
- package/dist/bin/pushary-notification-hook.js +29 -32
- package/dist/bin/pushary-opencode-hook.js +30 -32
- package/dist/bin/pushary-permission-denied-hook.js +30 -33
- package/dist/bin/pushary-permission-hook.js +33 -36
- package/dist/bin/pushary-post-hook.js +30 -33
- package/dist/bin/pushary-prompt-hook.js +29 -32
- package/dist/bin/pushary-session-end-hook.js +29 -32
- package/dist/bin/pushary-session-start-hook.js +33 -36
- package/dist/bin/pushary-setup.js +168 -160
- package/dist/bin/pushary-stats.js +5 -5
- package/dist/bin/pushary-status.js +65 -19
- package/dist/bin/pushary-stop-hook.js +29 -32
- package/dist/bin/pushary-stopfailure-hook.js +29 -32
- package/dist/bin/pushary-suggestions.js +19 -21
- package/dist/bin/pushary-transcript-register.js +18 -20
- package/dist/bin/pushary-transcripts.js +7 -7
- package/dist/bin/pushary-upgrade.js +50 -26
- package/dist/bin/pushary-wait.js +23 -19
- package/dist/bin/pushary.js +15 -14
- package/dist/{chunk-4FK6RZVJ.js → chunk-462EQA6K.js} +1 -1
- package/dist/{chunk-STQRUH3S.js → chunk-5DCDQ5VW.js} +59 -15
- package/dist/{chunk-JXISQ7DT.js → chunk-5N5L6DNN.js} +3 -3
- package/dist/{chunk-QR6VE5ME.js → chunk-5RGA636G.js} +79 -17
- package/dist/{chunk-L76HTPU6.js → chunk-6AYSKVLL.js} +3 -3
- package/dist/{chunk-NIBFSARF.js → chunk-6EBGOHDJ.js} +33 -13
- package/dist/{chunk-QQ4HBXZC.js → chunk-6W5M3MSE.js} +84 -673
- package/dist/{chunk-R3YW55MY.js → chunk-AI7RMFVV.js} +29 -26
- package/dist/{chunk-AUUXS44H.js → chunk-APP43AW7.js} +1 -1
- package/dist/{chunk-RQGODFQN.js → chunk-AZOKPWVI.js} +1 -1
- package/dist/{chunk-3GNUXXDZ.js → chunk-B5NMSP3V.js} +2 -2
- package/dist/{chunk-4D2AYNSE.js → chunk-BNSKVIAW.js} +2 -2
- package/dist/chunk-BYLKCZ2G.js +367 -0
- package/dist/{chunk-X5NXPCIC.js → chunk-BZLHTMT6.js} +89 -7
- package/dist/{chunk-BTQGAXZ3.js → chunk-COQ64C4F.js} +10 -10
- package/dist/{chunk-N4EUSDKX.js → chunk-DCCSULXK.js} +14 -14
- package/dist/{chunk-JWKBDSPF.js → chunk-DP3WX7FW.js} +2 -2
- package/dist/chunk-E5HOHIUV.js +52 -0
- package/dist/{chunk-GU3EJCVV.js → chunk-EA5NWDK7.js} +4 -0
- package/dist/chunk-EIAEUG7G.js +46 -0
- package/dist/{chunk-EB4XGVBG.js → chunk-EUW7JL2K.js} +0 -32
- package/dist/{chunk-T7Y5EADL.js → chunk-F7R3SZ4Q.js} +2 -2
- package/dist/{chunk-H37L7TT3.js → chunk-G7RIDXAT.js} +2 -2
- package/dist/{chunk-W2KI5KPD.js → chunk-H5T27W7M.js} +2 -2
- package/dist/chunk-HBWYMRR5.js +94 -0
- package/dist/{chunk-CBQACHKY.js → chunk-IIVZZMSO.js} +1 -1
- package/dist/{chunk-Z6HPS67T.js → chunk-IRHABAQT.js} +1 -1
- package/dist/{chunk-QTO6HEZD.js → chunk-K545B734.js} +2 -2
- package/dist/{chunk-KYO45G5L.js → chunk-KOWFRUIT.js} +1 -1
- package/dist/{chunk-QFEM7R6T.js → chunk-KQFTBQ66.js} +11 -11
- package/dist/chunk-LENBKYRB.js +50 -0
- package/dist/{chunk-JCWZ23MJ.js → chunk-M3STIAGU.js} +3 -3
- package/dist/{chunk-6DJTDHBI.js → chunk-MD4SVNT6.js} +1 -1
- package/dist/{chunk-7264S5HZ.js → chunk-MLGIVVSG.js} +1 -1
- package/dist/{chunk-H7MMU64M.js → chunk-NGKUXZID.js} +2 -2
- package/dist/{chunk-JWQZSYCK.js → chunk-NUVGDBZC.js} +1 -1
- package/dist/{chunk-AQ55ZSSS.js → chunk-OAYWO5NP.js} +1 -1
- package/dist/chunk-Q6C6ILUS.js +49 -0
- package/dist/{chunk-MBK7N46B.js → chunk-QIOIO7VN.js} +6 -6
- package/dist/{chunk-KFKL3FHS.js → chunk-QRXPWW3M.js} +4 -3
- package/dist/{chunk-7OIWWZAD.js → chunk-QTIUJZRX.js} +3 -3
- package/dist/{chunk-XWAYAO3V.js → chunk-R5RIVOPL.js} +2 -2
- package/dist/{chunk-ADSQDYYG.js → chunk-REU2VQPH.js} +54 -5
- package/dist/{chunk-GKI6LFAV.js → chunk-RQ32ADJP.js} +2 -2
- package/dist/{chunk-VXRXFU6Q.js → chunk-SZ4Q6ZVS.js} +14 -7
- package/dist/{chunk-KT5E2RLS.js → chunk-T6ZN4TEF.js} +1 -1
- package/dist/{chunk-UFVGSEWH.js → chunk-TO3PS646.js} +2 -2
- package/dist/chunk-UAP5DS6P.js +599 -0
- package/dist/{chunk-MZPXVH4A.js → chunk-UF6RBP5V.js} +204 -28
- package/dist/{chunk-AVNKVF7N.js → chunk-UPIZSCYD.js} +4 -4
- package/dist/{chunk-3PVDOCFI.js → chunk-VHPFNLRS.js} +5 -5
- package/dist/{chunk-HPRZJKRO.js → chunk-VIIHC42X.js} +1 -1
- package/dist/{chunk-D6S5EKXA.js → chunk-WRPYCIV2.js} +8 -12
- package/dist/{chunk-ZUTU43FT.js → chunk-Z23ZBYDW.js} +6 -4
- package/dist/{chunk-SBLPHUEB.js → chunk-ZGADIZDS.js} +8 -6
- package/dist/{global-upgrade-E2HUEB4B.js → global-upgrade-H272QOGD.js} +6 -6
- package/dist/{paths-QVTEGNZV.js → paths-HMVOTFUN.js} +2 -2
- package/dist/reapply-Q5NHDTVU.js +55 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +19 -20
- package/dist/{upgrade-lock-JCIDZMHF.js → upgrade-lock-L3GHFIRW.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-4YO4T5FV.js +0 -149
- package/dist/chunk-ANEAA37E.js +0 -197
- package/dist/chunk-MNWRUGMH.js +0 -86
- package/dist/chunk-RQSOEB4S.js +0 -44
- package/dist/chunk-SD3272LS.js +0 -143
- package/dist/reapply-5QVKM6LA.js +0 -38
|
@@ -14,36 +14,36 @@ import {
|
|
|
14
14
|
IDLE_PROMPT_NOTIFICATION,
|
|
15
15
|
NOTIFICATION_PUSH_TYPES,
|
|
16
16
|
POSTTOOLUSE_MIRROR_ONLY_TOOLS
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-MD4SVNT6.js";
|
|
18
18
|
import {
|
|
19
19
|
cancelQuestion,
|
|
20
20
|
isPolicyConfig,
|
|
21
21
|
sendNotification,
|
|
22
22
|
waitForAnswer
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-WRPYCIV2.js";
|
|
24
|
+
import {
|
|
25
|
+
withRetry
|
|
26
|
+
} from "./chunk-6AYSKVLL.js";
|
|
24
27
|
import {
|
|
25
28
|
clientErrorKindOf,
|
|
26
29
|
reportClientError
|
|
27
|
-
} from "./chunk-
|
|
28
|
-
import {
|
|
29
|
-
withRetry
|
|
30
|
-
} from "./chunk-L76HTPU6.js";
|
|
30
|
+
} from "./chunk-UPIZSCYD.js";
|
|
31
31
|
import {
|
|
32
32
|
getMachineId
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-KOWFRUIT.js";
|
|
34
34
|
import {
|
|
35
35
|
reportedInstallSource
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-BNSKVIAW.js";
|
|
37
37
|
import {
|
|
38
38
|
canonicalJson
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-Z23ZBYDW.js";
|
|
40
40
|
import {
|
|
41
41
|
writeFileAtomic
|
|
42
42
|
} from "./chunk-T7E75EKA.js";
|
|
43
43
|
import {
|
|
44
44
|
getApiKey,
|
|
45
45
|
getBaseUrl
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-IRHABAQT.js";
|
|
47
47
|
import {
|
|
48
48
|
ACTION_BODY_MAX,
|
|
49
49
|
AGENT_LABELS_BY_TYPE,
|
|
@@ -70,7 +70,7 @@ import {
|
|
|
70
70
|
resolvePolicy,
|
|
71
71
|
toToolLookup,
|
|
72
72
|
truncateLine
|
|
73
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-5RGA636G.js";
|
|
74
74
|
|
|
75
75
|
// src/policy.ts
|
|
76
76
|
import { createHash } from "crypto";
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import {
|
|
2
|
+
pusharyHookExecutable
|
|
3
|
+
} from "./chunk-BYLKCZ2G.js";
|
|
4
|
+
import {
|
|
5
|
+
isProtectedByScope,
|
|
6
|
+
registerHookEntry
|
|
7
|
+
} from "./chunk-Z23ZBYDW.js";
|
|
8
|
+
|
|
9
|
+
// src/cursor-config.ts
|
|
10
|
+
var hookCommandOf = (entry) => {
|
|
11
|
+
const command = entry && typeof entry === "object" && !Array.isArray(entry) ? entry.command : void 0;
|
|
12
|
+
return typeof command === "string" ? command : "";
|
|
13
|
+
};
|
|
14
|
+
var isPusharyCursorEntry = (entry) => pusharyHookExecutable(hookCommandOf(entry)) !== null;
|
|
15
|
+
var registerCursorGate = (existing, entry) => registerHookEntry(existing, isPusharyCursorEntry, entry);
|
|
16
|
+
var withoutPusharyCursorHooks = (hooks, scope) => {
|
|
17
|
+
let removed = 0;
|
|
18
|
+
const kept = {};
|
|
19
|
+
for (const [event, entries] of Object.entries(hooks)) {
|
|
20
|
+
if (!Array.isArray(entries)) {
|
|
21
|
+
kept[event] = entries;
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
const others = entries.filter((entry) => !isPusharyCursorEntry(entry) || isProtectedByScope(hookCommandOf(entry), scope));
|
|
25
|
+
removed += entries.length - others.length;
|
|
26
|
+
if (others.length > 0 || entries.length === 0) kept[event] = others;
|
|
27
|
+
}
|
|
28
|
+
return { hooks: kept, removed };
|
|
29
|
+
};
|
|
30
|
+
var CURSOR_PLUGIN_NAME = "pushary";
|
|
31
|
+
var CURSOR_PLUGIN_STAGING_PREFIX = ".pushary-staging-";
|
|
32
|
+
var CURSOR_PLUGIN_BACKUP_INFIX = ".pushary-backup-";
|
|
33
|
+
var isCursorPluginLeftover = (name) => name.startsWith(`${CURSOR_PLUGIN_NAME}${CURSOR_PLUGIN_BACKUP_INFIX}`) || name.startsWith(CURSOR_PLUGIN_STAGING_PREFIX);
|
|
34
|
+
var isPusharyCursorPluginManifest = (contents) => {
|
|
35
|
+
try {
|
|
36
|
+
const manifest = JSON.parse(contents);
|
|
37
|
+
return typeof manifest === "object" && manifest !== null && !Array.isArray(manifest) && manifest.name === CURSOR_PLUGIN_NAME;
|
|
38
|
+
} catch {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export {
|
|
44
|
+
registerCursorGate,
|
|
45
|
+
withoutPusharyCursorHooks,
|
|
46
|
+
CURSOR_PLUGIN_STAGING_PREFIX,
|
|
47
|
+
CURSOR_PLUGIN_BACKUP_INFIX,
|
|
48
|
+
isCursorPluginLeftover,
|
|
49
|
+
isPusharyCursorPluginManifest
|
|
50
|
+
};
|
|
@@ -5,16 +5,16 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
NOTIFICATION_MATCHED_TYPES,
|
|
7
7
|
POSTTOOLUSE_MIRRORED_TOOLS
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-MD4SVNT6.js";
|
|
9
9
|
import {
|
|
10
10
|
isProtectedByScope,
|
|
11
11
|
registerHookEntry
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-Z23ZBYDW.js";
|
|
13
13
|
import {
|
|
14
14
|
CLAUDE_PRETOOLUSE_MATCHER,
|
|
15
15
|
HOOK_BUDGETS,
|
|
16
16
|
HOOK_LOCATOR_BINARY
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-5RGA636G.js";
|
|
18
18
|
|
|
19
19
|
// src/gemini-config.ts
|
|
20
20
|
var GEMINI_HOOK_BINARY = "pushary-gemini-hook";
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
codexHooksJsonIn,
|
|
9
9
|
isPusharyCodexCommand,
|
|
10
10
|
resolvePathBinary
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-Z23ZBYDW.js";
|
|
12
12
|
import {
|
|
13
13
|
getPackageVersion
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-5RGA636G.js";
|
|
15
15
|
|
|
16
16
|
// src/codex-app-server.ts
|
|
17
17
|
import { existsSync, realpathSync } from "fs";
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import {
|
|
2
|
+
findExportedKeyLine,
|
|
3
|
+
keyPrefix,
|
|
4
|
+
readConfigFileKey,
|
|
5
|
+
readMacAppKeyPrefix
|
|
6
|
+
} from "./chunk-REU2VQPH.js";
|
|
7
|
+
import {
|
|
8
|
+
NPX_LATEST_COMMAND
|
|
9
|
+
} from "./chunk-5DCDQ5VW.js";
|
|
10
|
+
|
|
11
|
+
// src/key-signed-out.ts
|
|
12
|
+
var VERDICT_BY_CHECK = {
|
|
13
|
+
ok: "accepted",
|
|
14
|
+
locked: "accepted",
|
|
15
|
+
rejected: "rejected",
|
|
16
|
+
malformed: "unchecked",
|
|
17
|
+
unreachable: "unchecked"
|
|
18
|
+
};
|
|
19
|
+
var activeKeyVerdictOf = (check) => check === null ? "unchecked" : VERDICT_BY_CHECK[check.kind];
|
|
20
|
+
var NOT_SIGNED_OUT = { kind: "none" };
|
|
21
|
+
var isMacAppKey = (key, macAppKeyPrefix) => keyPrefix(key) === macAppKeyPrefix;
|
|
22
|
+
var diagnoseSignedOutKey = (evidence) => {
|
|
23
|
+
const adopted = evidence.macAppKeyPrefix;
|
|
24
|
+
if (evidence.configKey !== null || adopted === null) return NOT_SIGNED_OUT;
|
|
25
|
+
if (evidence.activeKey !== null) {
|
|
26
|
+
if (!isMacAppKey(evidence.activeKey, adopted) || evidence.activeKeyVerdict === "accepted") return NOT_SIGNED_OUT;
|
|
27
|
+
}
|
|
28
|
+
const exported = evidence.exportedKey;
|
|
29
|
+
return { kind: "signed_out_on_mac", deadExport: exported && isMacAppKey(exported.key, adopted) ? exported : null };
|
|
30
|
+
};
|
|
31
|
+
var SIGNED_OUT_ON_MAC_MESSAGE = "This computer used the key the Pushary Mac app signed in with, and it was signed out on this Mac, so it no longer works here.";
|
|
32
|
+
var describeSignedOutKey = (diagnosis) => [
|
|
33
|
+
`Run pushary login, or re-run ${NPX_LATEST_COMMAND} setup, to connect this computer again.`,
|
|
34
|
+
...diagnosis.deadExport ? [`${diagnosis.deadExport.path} line ${diagnosis.deadExport.line} still exports the old key (${keyPrefix(diagnosis.deadExport.key)}). Delete that line, or let login replace it, then open a new terminal.`] : []
|
|
35
|
+
];
|
|
36
|
+
var readSignedOutDiagnosis = (activeKey, activeKeyVerdict) => diagnoseSignedOutKey({
|
|
37
|
+
configKey: readConfigFileKey(),
|
|
38
|
+
macAppKeyPrefix: readMacAppKeyPrefix(),
|
|
39
|
+
activeKey,
|
|
40
|
+
activeKeyVerdict,
|
|
41
|
+
exportedKey: findExportedKeyLine()
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export {
|
|
45
|
+
activeKeyVerdictOf,
|
|
46
|
+
SIGNED_OUT_ON_MAC_MESSAGE,
|
|
47
|
+
describeSignedOutKey,
|
|
48
|
+
readSignedOutDiagnosis
|
|
49
|
+
};
|
|
@@ -3,27 +3,27 @@ import {
|
|
|
3
3
|
expectedLaunchCapabilities,
|
|
4
4
|
hasSpawnProvider,
|
|
5
5
|
resolveControlPolicy
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-F7R3SZ4Q.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-SZ4Q6ZVS.js";
|
|
14
14
|
import {
|
|
15
15
|
readControlMode,
|
|
16
16
|
readKeySource
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-REU2VQPH.js";
|
|
18
18
|
import {
|
|
19
19
|
getMachineId
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-KOWFRUIT.js";
|
|
21
21
|
import {
|
|
22
22
|
getBaseUrl
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-IRHABAQT.js";
|
|
24
24
|
import {
|
|
25
25
|
getPackageVersion
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-5RGA636G.js";
|
|
27
27
|
|
|
28
28
|
// src/machines.ts
|
|
29
29
|
import { hostname } from "os";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pusharyFetch
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5N5L6DNN.js";
|
|
4
4
|
import {
|
|
5
5
|
NetworkError
|
|
6
6
|
} from "./chunk-7QLSKOSU.js";
|
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
} from "./chunk-KZERVKTD.js";
|
|
10
10
|
import {
|
|
11
11
|
getBaseUrl
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-IRHABAQT.js";
|
|
13
13
|
import {
|
|
14
14
|
isValidApiKey,
|
|
15
15
|
normalizeKeyScope
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-5RGA636G.js";
|
|
17
17
|
|
|
18
18
|
// src/session.ts
|
|
19
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;
|
|
@@ -167,6 +167,7 @@ var describeKeyCheck = (check, baseUrl = getBaseUrl()) => {
|
|
|
167
167
|
|
|
168
168
|
export {
|
|
169
169
|
samePusharyAccount,
|
|
170
|
+
absoluteUrl,
|
|
170
171
|
checkApiKey,
|
|
171
172
|
keyCheckFromResponse,
|
|
172
173
|
describeKeyCheck
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SETUP_FLAGS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZGADIZDS.js";
|
|
4
4
|
import {
|
|
5
5
|
parseFlags
|
|
6
6
|
} from "./chunk-GMXKITVA.js";
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-7QLSKOSU.js";
|
|
10
10
|
import {
|
|
11
11
|
NPX_LATEST_COMMAND
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-5DCDQ5VW.js";
|
|
13
13
|
import {
|
|
14
14
|
CLAUDE_CONNECTOR_GUIDE,
|
|
15
15
|
CLAUDE_CONNECTOR_STEPS,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
CLAUDE_CONNECTOR_URL,
|
|
18
18
|
COWORK_CONNECTOR_LIMIT,
|
|
19
19
|
COWORK_STANDING_INSTRUCTIONS
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-5RGA636G.js";
|
|
21
21
|
|
|
22
22
|
// src/cli/cowork.ts
|
|
23
23
|
import { readFileSync } from "fs";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
registerTranscript
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-COQ64C4F.js";
|
|
4
4
|
import {
|
|
5
5
|
writeDegraded
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-UPIZSCYD.js";
|
|
7
7
|
|
|
8
8
|
// src/tool-hook-input.ts
|
|
9
9
|
var OPTIONAL_TEXT_FIELDS = ["hook_event_name", "session_id", "cwd", "transcript_path", "tool_use_id", "permission_mode"];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveInstallSourceFor
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BNSKVIAW.js";
|
|
4
4
|
import {
|
|
5
5
|
backupFile,
|
|
6
6
|
readJsonSafe,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-T7E75EKA.js";
|
|
10
10
|
import {
|
|
11
11
|
configFilePath
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-IRHABAQT.js";
|
|
13
13
|
|
|
14
14
|
// src/shell-alias.ts
|
|
15
15
|
import { homedir } from "os";
|
|
@@ -110,6 +110,20 @@ var isDisabledExport = (line) => {
|
|
|
110
110
|
return OUR_EXPORT.test(trimmed.slice(1, -LOGOUT_MARK.length).trim());
|
|
111
111
|
};
|
|
112
112
|
var keyPrefix = (key) => key.split(".")[0] ?? key;
|
|
113
|
+
var MAC_APP_KEY_PREFIX_FIELD = "macAppKeyPrefix";
|
|
114
|
+
var KEY_PREFIX_SHAPE = /^pk_[a-f0-9]+$/;
|
|
115
|
+
var findKeyExport = (contents) => {
|
|
116
|
+
const lines = contents.split("\n");
|
|
117
|
+
for (const [index, line] of lines.entries()) {
|
|
118
|
+
const key = line.match(OUR_EXPORT)?.[2];
|
|
119
|
+
if (key) return { line: index + 1, key };
|
|
120
|
+
}
|
|
121
|
+
return null;
|
|
122
|
+
};
|
|
123
|
+
var keepMacAppKeyPrefix = (current, apiKey) => {
|
|
124
|
+
const { [MAC_APP_KEY_PREFIX_FIELD]: recorded, ...rest } = current;
|
|
125
|
+
return recorded === keyPrefix(apiKey) ? { ...rest, [MAC_APP_KEY_PREFIX_FIELD]: recorded } : rest;
|
|
126
|
+
};
|
|
113
127
|
var manualKeyStepFor = (kind, platform) => kind === "no-rc" || platform === "win32" ? "config-only" : "paste-export";
|
|
114
128
|
var rcResult = (kind, over = {}) => ({
|
|
115
129
|
kind,
|
|
@@ -208,7 +222,7 @@ var writeKey = (apiKey, options = {}) => {
|
|
|
208
222
|
writeJsonAtomic(
|
|
209
223
|
configPath,
|
|
210
224
|
{
|
|
211
|
-
...current,
|
|
225
|
+
...keepMacAppKeyPrefix(current, apiKey),
|
|
212
226
|
apiKey,
|
|
213
227
|
installSource: resolveInstallSourceFor(current),
|
|
214
228
|
...options.controlMode ? { controlMode: options.controlMode } : {},
|
|
@@ -227,7 +241,7 @@ var clearKey = (options = {}) => {
|
|
|
227
241
|
const existing = readJsonSafe(configPath);
|
|
228
242
|
let removedFromConfig = false;
|
|
229
243
|
if (existing.kind === "ok" && typeof existing.value.apiKey === "string") {
|
|
230
|
-
const { apiKey: _dropped, ...rest } = existing.value;
|
|
244
|
+
const { apiKey: _dropped, [MAC_APP_KEY_PREFIX_FIELD]: _adopted, ...rest } = existing.value;
|
|
231
245
|
writeJsonAtomic(configPath, rest, KEY_FILE_MODE);
|
|
232
246
|
restrictFile(configPath);
|
|
233
247
|
removedFromConfig = true;
|
|
@@ -289,6 +303,38 @@ var readKeySource = () => {
|
|
|
289
303
|
if (fileKey) return { kind: "config", key: fileKey, origin: configPath, drift: null };
|
|
290
304
|
return { kind: "none", key: null, origin: null, drift: null };
|
|
291
305
|
};
|
|
306
|
+
var readMacAppKeyPrefix = (configPath = configFilePath()) => {
|
|
307
|
+
const result = readJsonSafe(configPath);
|
|
308
|
+
if (result.kind !== "ok") return null;
|
|
309
|
+
const recorded = result.value[MAC_APP_KEY_PREFIX_FIELD];
|
|
310
|
+
return typeof recorded === "string" && KEY_PREFIX_SHAPE.test(recorded) ? recorded : null;
|
|
311
|
+
};
|
|
312
|
+
var recordMacAppKeyPrefix = (apiKey, configPath = configFilePath()) => {
|
|
313
|
+
const result = readJsonSafe(configPath);
|
|
314
|
+
if (result.kind !== "ok" || result.value.apiKey !== apiKey) return false;
|
|
315
|
+
if (result.value[MAC_APP_KEY_PREFIX_FIELD] === keyPrefix(apiKey)) return false;
|
|
316
|
+
writeJsonAtomic(configPath, { ...result.value, [MAC_APP_KEY_PREFIX_FIELD]: keyPrefix(apiKey) }, KEY_FILE_MODE);
|
|
317
|
+
restrictFile(configPath);
|
|
318
|
+
return true;
|
|
319
|
+
};
|
|
320
|
+
var shellProfileCandidates = () => {
|
|
321
|
+
const resolved = resolveShellRc();
|
|
322
|
+
const fallbacks = FALLBACK_RCS.map((name) => join2(homedir2(), name));
|
|
323
|
+
return resolved ? [resolved.path, ...fallbacks.filter((path) => path !== resolved.path)] : fallbacks;
|
|
324
|
+
};
|
|
325
|
+
var findExportedKeyLine = (profiles = shellProfileCandidates()) => {
|
|
326
|
+
for (const path of profiles) {
|
|
327
|
+
let contents;
|
|
328
|
+
try {
|
|
329
|
+
contents = readFileSync2(path, "utf8");
|
|
330
|
+
} catch {
|
|
331
|
+
continue;
|
|
332
|
+
}
|
|
333
|
+
const found = findKeyExport(contents);
|
|
334
|
+
if (found) return { path, ...found };
|
|
335
|
+
}
|
|
336
|
+
return null;
|
|
337
|
+
};
|
|
292
338
|
|
|
293
339
|
export {
|
|
294
340
|
CANDIDATE_RCS,
|
|
@@ -305,5 +351,8 @@ export {
|
|
|
305
351
|
readConfigFileKey,
|
|
306
352
|
readControlMode,
|
|
307
353
|
readTranscriptPreference,
|
|
308
|
-
readKeySource
|
|
354
|
+
readKeySource,
|
|
355
|
+
readMacAppKeyPrefix,
|
|
356
|
+
recordMacAppKeyPrefix,
|
|
357
|
+
findExportedKeyLine
|
|
309
358
|
};
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
decodePublicKey,
|
|
4
4
|
generateSessionKey,
|
|
5
5
|
wrapSessionKey
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-APP43AW7.js";
|
|
7
7
|
import {
|
|
8
8
|
fetchTranscriptRecipients,
|
|
9
9
|
uploadTranscriptRecords
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-462EQA6K.js";
|
|
11
11
|
|
|
12
12
|
// src/live-session.ts
|
|
13
13
|
var MAX_TRANSCRIPT_QUEUE = 100;
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
} from "./chunk-XHKBHWLX.js";
|
|
5
5
|
import {
|
|
6
6
|
readControlMode
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-REU2VQPH.js";
|
|
8
8
|
import {
|
|
9
9
|
getMachineId
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-KOWFRUIT.js";
|
|
11
11
|
import {
|
|
12
12
|
pusharyDir,
|
|
13
13
|
resolveGlobalBinary
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-Z23ZBYDW.js";
|
|
15
15
|
import {
|
|
16
16
|
readJsonSafe,
|
|
17
17
|
writeFileAtomic,
|
|
@@ -20,14 +20,14 @@ import {
|
|
|
20
20
|
} from "./chunk-T7E75EKA.js";
|
|
21
21
|
import {
|
|
22
22
|
getApiKey
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-IRHABAQT.js";
|
|
24
24
|
import {
|
|
25
25
|
CLI_PACKAGE_NAMES,
|
|
26
26
|
cmdShimTarget,
|
|
27
27
|
getPackageVersion,
|
|
28
28
|
globalPackageFolder,
|
|
29
29
|
globalRootFor
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-5RGA636G.js";
|
|
31
31
|
|
|
32
32
|
// src/daemon-lifecycle.ts
|
|
33
33
|
import { dirname, join, win32 as win32Path } from "path";
|
|
@@ -720,8 +720,9 @@ var stopDaemonRunning = async (options = {}) => {
|
|
|
720
720
|
safeUnlink(lockPath(dir));
|
|
721
721
|
return { kind: "stopped" };
|
|
722
722
|
};
|
|
723
|
+
var DAEMON_LOGIN_REASONS = ["key_rejected", "plan_inactive", "key_missing", "mac_signed_out"];
|
|
723
724
|
var needsLoginPath = (dir) => join(dir, "daemon-needs-login.json");
|
|
724
|
-
var isLoginReason = (value) => value
|
|
725
|
+
var isLoginReason = (value) => DAEMON_LOGIN_REASONS.includes(value);
|
|
725
726
|
var parseDaemonNeedsLogin = (value) => {
|
|
726
727
|
if (typeof value !== "object" || value === null) return null;
|
|
727
728
|
const record = value;
|
|
@@ -751,7 +752,13 @@ var clearDaemonNeedsLogin = (options = {}) => {
|
|
|
751
752
|
safeUnlink(path);
|
|
752
753
|
return true;
|
|
753
754
|
};
|
|
754
|
-
var
|
|
755
|
+
var DAEMON_LOGIN_BLOCK_DESCRIPTIONS = {
|
|
756
|
+
key_rejected: (at) => `this machine's key was rejected at ${at}; run \`pushary login\` to sign in again`,
|
|
757
|
+
plan_inactive: (at) => `this workspace had no active plan at ${at}; pick one at pushary.com/dashboard/settings?tab=billing, then run \`pushary login\``,
|
|
758
|
+
key_missing: (at) => `this machine had no key at ${at}; run \`pushary login\` to sign in again`,
|
|
759
|
+
mac_signed_out: (at) => `the key this machine shared with the Pushary Mac app was signed out on this Mac at ${at}; run \`pushary login\` to sign in again`
|
|
760
|
+
};
|
|
761
|
+
var describeDaemonLoginBlock = (record) => DAEMON_LOGIN_BLOCK_DESCRIPTIONS[record.reason](record.at);
|
|
755
762
|
var recoverDaemonAfterLogin = (options = {}) => {
|
|
756
763
|
const cleared = clearDaemonNeedsLogin(options);
|
|
757
764
|
if (!cleared || readControlMode(join(options.dir ?? pusharyDir(), "config.json")) === "off" || !hasDaemonServiceDefinition(options)) {
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-KZERVKTD.js";
|
|
4
4
|
import {
|
|
5
5
|
renderCommandHelp
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5DCDQ5VW.js";
|
|
7
7
|
import {
|
|
8
8
|
getPackageVersion
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-5RGA636G.js";
|
|
10
10
|
|
|
11
11
|
// src/cli/usage.ts
|
|
12
12
|
var exitOnHelpFlag = (command) => {
|