pushary 1.9.32 → 1.9.35
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 +15 -0
- package/data/SKILL.md +6 -7
- package/data/cowork/SKILL.md +2 -2
- package/data/cursor-plugin/rules/pushary.mdc +1 -1
- package/data/cursor-plugin/skills/pushary/SKILL.md +6 -7
- package/data/vscode-plugin/skills/pushary/SKILL.md +6 -7
- package/dist/bin/pushary-bell-hook.js +25 -25
- package/dist/bin/pushary-bell.js +9 -9
- package/dist/bin/pushary-claude.js +24 -24
- package/dist/bin/pushary-clean.js +29 -29
- package/dist/bin/pushary-codex-bridge.js +17 -17
- package/dist/bin/pushary-codex-hook.js +30 -30
- package/dist/bin/pushary-codex.js +12 -12
- package/dist/bin/pushary-connect.js +24 -24
- package/dist/bin/pushary-cowork.js +5 -5
- package/dist/bin/pushary-daemon.js +32 -32
- package/dist/bin/pushary-disconnect.js +24 -24
- package/dist/bin/pushary-doctor.js +33 -33
- package/dist/bin/pushary-elicitation-hook.js +25 -25
- package/dist/bin/pushary-gemini-bridge.js +13 -13
- package/dist/bin/pushary-gemini-hook.js +27 -27
- package/dist/bin/pushary-hook.js +29 -29
- package/dist/bin/pushary-login.js +12 -12
- package/dist/bin/pushary-logout.js +24 -24
- package/dist/bin/pushary-mcp.js +9 -9
- package/dist/bin/pushary-mode.js +12 -12
- package/dist/bin/pushary-notification-hook.js +24 -24
- package/dist/bin/pushary-opencode-hook.js +26 -26
- package/dist/bin/pushary-permission-denied-hook.js +29 -29
- package/dist/bin/pushary-permission-hook.js +28 -28
- package/dist/bin/pushary-post-hook.js +24 -24
- package/dist/bin/pushary-prompt-hook.js +24 -24
- package/dist/bin/pushary-session-end-hook.js +24 -24
- package/dist/bin/pushary-session-start-hook.js +28 -28
- package/dist/bin/pushary-setup.js +60 -38
- package/dist/bin/pushary-stats.js +5 -5
- package/dist/bin/pushary-status.js +26 -26
- package/dist/bin/pushary-stop-hook.js +24 -24
- package/dist/bin/pushary-stopfailure-hook.js +24 -24
- package/dist/bin/pushary-suggestions.js +12 -12
- package/dist/bin/pushary-transcript-register.js +17 -17
- package/dist/bin/pushary-transcripts.js +7 -7
- package/dist/bin/pushary-upgrade.js +30 -30
- package/dist/bin/pushary-wait.js +12 -12
- package/dist/bin/pushary.js +6 -6
- package/dist/{chunk-ALJEKG2D.js → chunk-22YSHBTI.js} +3 -3
- package/dist/{chunk-I6D5BGFF.js → chunk-36ZCFJUI.js} +1 -1
- package/dist/{chunk-Z73AKQYU.js → chunk-3LS3GFJW.js} +1 -1
- package/dist/{chunk-EUUB3NI5.js → chunk-43H2FUNN.js} +80 -5
- package/dist/{chunk-7OMOUQSU.js → chunk-45OXG3VR.js} +1 -1
- package/dist/{chunk-BZ3GN2YK.js → chunk-4PIAOJAW.js} +1 -1
- package/dist/{chunk-NRM4QJKG.js → chunk-4TFD3WAA.js} +2 -2
- package/dist/{chunk-Y53KKEMZ.js → chunk-57FFQR46.js} +1 -1
- package/dist/{chunk-I3N5LPFB.js → chunk-6OGDGQTT.js} +5 -5
- package/dist/{chunk-JD6HIO7N.js → chunk-7FQL5NWJ.js} +4 -3
- package/dist/{chunk-7ENPTXR4.js → chunk-7IVV4LLF.js} +3 -3
- package/dist/{chunk-ZLHBY5BV.js → chunk-7S7H7V5V.js} +4 -4
- package/dist/{chunk-L5WCPMWZ.js → chunk-7UGGCTTW.js} +2 -2
- package/dist/{chunk-SUXSVHCP.js → chunk-A455TSHF.js} +2 -2
- package/dist/{chunk-6R7RZMN5.js → chunk-A5FFSXZE.js} +2 -2
- package/dist/{chunk-6C57SBLO.js → chunk-B5RLJ6QD.js} +4 -4
- package/dist/{chunk-HFRRSYTG.js → chunk-CK3W7Q5S.js} +1 -1
- package/dist/{chunk-5SMAW6N7.js → chunk-CPYOJRDN.js} +85 -48
- package/dist/{chunk-H7F2IN22.js → chunk-DCBSD22V.js} +3 -3
- package/dist/{chunk-Y25UXZQT.js → chunk-DQKEGNTI.js} +1 -1
- package/dist/{chunk-XJEIN2FJ.js → chunk-E2OZZZKP.js} +2 -2
- package/dist/{chunk-IW6MFF5I.js → chunk-EGTRIM74.js} +4 -4
- package/dist/{chunk-IPJRYHDC.js → chunk-EJWSE7S7.js} +5 -5
- package/dist/{chunk-JH2TTKC4.js → chunk-FDNMQEU6.js} +2 -2
- package/dist/{chunk-OT6QTOOR.js → chunk-FPYBX36E.js} +5 -5
- package/dist/{chunk-K7NUD23S.js → chunk-FQQSW7MD.js} +1 -1
- package/dist/{chunk-LBD7QQ2V.js → chunk-FYQG2UTK.js} +2 -2
- package/dist/{chunk-2GYTGLML.js → chunk-GC3SUMYD.js} +4 -4
- package/dist/{chunk-UOVREWK3.js → chunk-H52HBSOD.js} +3 -3
- package/dist/{chunk-5LXIM5LF.js → chunk-HJNCVY5F.js} +7 -7
- package/dist/{chunk-6ILLZXCS.js → chunk-HQKYWUBF.js} +2 -2
- package/dist/{chunk-ZZ4C47Z2.js → chunk-HVUBWLER.js} +11 -11
- package/dist/{chunk-S5J2ZFQK.js → chunk-IRU7DKJW.js} +3 -3
- package/dist/{chunk-NFABDPWT.js → chunk-LOYSI2CZ.js} +5 -5
- package/dist/{chunk-ZVPADGCH.js → chunk-NKAMF2YJ.js} +1 -1
- package/dist/{chunk-KTFZKXRE.js → chunk-NMQLY4PE.js} +2 -2
- package/dist/{chunk-LA6Q2BJF.js → chunk-OZMGO4WF.js} +6 -7
- package/dist/{chunk-FAINF4IK.js → chunk-PEEJP4HN.js} +4 -4
- package/dist/{chunk-CBRLV3W7.js → chunk-QJ3ENGBT.js} +3 -3
- package/dist/{chunk-BQQQ4NP5.js → chunk-SMRMWDFE.js} +8 -8
- package/dist/{chunk-WAR24VWD.js → chunk-SMSX4TCC.js} +1 -1
- package/dist/{chunk-QRDTNXP2.js → chunk-U7CN5HG2.js} +5 -5
- package/dist/{chunk-GF45OS6U.js → chunk-UDECNZYI.js} +2 -2
- package/dist/{chunk-YTVNKMOA.js → chunk-ULJFIF5N.js} +1 -1
- package/dist/{chunk-MKYICE44.js → chunk-UPRNSD2T.js} +4 -4
- package/dist/{chunk-F3TI7CYV.js → chunk-V4ZIG66K.js} +1 -1
- package/dist/{chunk-BWPR75C3.js → chunk-VTAC5FBZ.js} +1 -1
- package/dist/{chunk-DXFMP37X.js → chunk-WFPXKCN4.js} +5 -5
- package/dist/{chunk-FZ2EGAEA.js → chunk-WMB3OCI4.js} +2 -2
- package/dist/{chunk-PQ3QV523.js → chunk-WPSI4246.js} +1 -1
- package/dist/{chunk-AGMKXRLQ.js → chunk-XLXG6MA5.js} +3 -3
- package/dist/{chunk-J2OVVMBU.js → chunk-YABMIGR3.js} +1 -1
- package/dist/{chunk-7HIODNBA.js → chunk-YRDNKY77.js} +6 -6
- package/dist/{chunk-EFQPXGND.js → chunk-Z6HDYK2A.js} +2 -2
- package/dist/{global-upgrade-B6E7DWGC.js → global-upgrade-IZCB4WIE.js} +6 -6
- package/dist/{paths-H4Q6OES7.js → paths-4WAA57P5.js} +2 -2
- package/dist/{reapply-HXIKYN5E.js → reapply-GJ73ZHDD.js} +20 -20
- package/dist/src/index.js +19 -19
- package/dist/{upgrade-lock-MLXS6NH2.js → upgrade-lock-J5PIKSYV.js} +3 -3
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pusharyFetch
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-22YSHBTI.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-3LS3GFJW.js";
|
|
13
13
|
import {
|
|
14
14
|
isValidApiKey,
|
|
15
15
|
normalizeKeyScope
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-7FQL5NWJ.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;
|
|
@@ -3,18 +3,18 @@ import {
|
|
|
3
3
|
addGeminiMcpServer,
|
|
4
4
|
removeGeminiMcpServer,
|
|
5
5
|
supportedClaudeEvents
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-QJ3ENGBT.js";
|
|
7
7
|
import {
|
|
8
8
|
CLAUDE_CODE_AGENT,
|
|
9
9
|
parseApplyPatchFiles
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-SMRMWDFE.js";
|
|
11
11
|
import {
|
|
12
12
|
guardBinary,
|
|
13
13
|
guardBinaryRefusing,
|
|
14
14
|
holdBudgetOf,
|
|
15
15
|
isProtectedByScope,
|
|
16
16
|
registerHookEntry
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-UPRNSD2T.js";
|
|
18
18
|
import {
|
|
19
19
|
HOOK_LOCATOR_BINARY,
|
|
20
20
|
PHONE_ANSWERED_TOOLS,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
refusalOutput,
|
|
25
25
|
toToolLookup,
|
|
26
26
|
withHookHoldBudget
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-7FQL5NWJ.js";
|
|
28
28
|
|
|
29
29
|
// src/claude-config.ts
|
|
30
30
|
import { join } from "path";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-POFBE6ZY.js";
|
|
4
4
|
import {
|
|
5
5
|
autoUpdateState
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-UPRNSD2T.js";
|
|
7
7
|
import {
|
|
8
8
|
readJsonSafe,
|
|
9
9
|
writeJsonAtomic
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
globalUpgradeEntry,
|
|
16
16
|
isAutoUpdateResult,
|
|
17
17
|
ownPackageRoot
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-7FQL5NWJ.js";
|
|
19
19
|
|
|
20
20
|
// src/auto-update.ts
|
|
21
21
|
import { spawn } from "child_process";
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
codexHooksJsonIn,
|
|
9
9
|
isPusharyCodexCommand,
|
|
10
10
|
resolvePathBinary
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-UPRNSD2T.js";
|
|
12
12
|
import {
|
|
13
13
|
getPackageVersion
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-7FQL5NWJ.js";
|
|
15
15
|
|
|
16
16
|
// src/codex-app-server.ts
|
|
17
17
|
import { existsSync, realpathSync } from "fs";
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-KZERVKTD.js";
|
|
4
4
|
import {
|
|
5
5
|
renderCommandHelp
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-45OXG3VR.js";
|
|
7
7
|
import {
|
|
8
8
|
getPackageVersion
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-7FQL5NWJ.js";
|
|
10
10
|
|
|
11
11
|
// src/cli/usage.ts
|
|
12
12
|
var exitOnHelpFlag = (command) => {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
registerTranscript
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CPYOJRDN.js";
|
|
4
4
|
import {
|
|
5
5
|
namedEvent
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7S7H7V5V.js";
|
|
7
7
|
import {
|
|
8
8
|
writeDegraded
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-OZMGO4WF.js";
|
|
10
10
|
import {
|
|
11
11
|
claudeShapedHookInput,
|
|
12
12
|
hookCompatibleProfileBySource
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-7FQL5NWJ.js";
|
|
14
14
|
|
|
15
15
|
// src/tool-hook-input.ts
|
|
16
16
|
var OPTIONAL_TEXT_FIELDS = ["hook_event_name", "session_id", "cwd", "transcript_path", "tool_use_id", "permission_mode"];
|
|
@@ -6,38 +6,38 @@ import {
|
|
|
6
6
|
} from "./chunk-DWQYCOPI.js";
|
|
7
7
|
import {
|
|
8
8
|
ensureDaemonRunning
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-FPYBX36E.js";
|
|
10
10
|
import {
|
|
11
11
|
buildTranscriptRecords,
|
|
12
12
|
decodePublicKey,
|
|
13
13
|
generateSessionKey,
|
|
14
14
|
wrapSessionKey
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-CK3W7Q5S.js";
|
|
16
16
|
import {
|
|
17
17
|
fetchTranscriptRecipients,
|
|
18
18
|
uploadTranscriptRecords
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-4PIAOJAW.js";
|
|
20
20
|
import {
|
|
21
21
|
transcriptEnvironmentPreference,
|
|
22
22
|
transcriptsEnabled
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-SMSX4TCC.js";
|
|
24
24
|
import {
|
|
25
25
|
hookOwnerOf
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-6OGDGQTT.js";
|
|
27
27
|
import {
|
|
28
28
|
readTranscriptPreference
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-DCBSD22V.js";
|
|
30
30
|
import {
|
|
31
31
|
codexHome,
|
|
32
32
|
pusharyDir
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-UPRNSD2T.js";
|
|
34
34
|
import {
|
|
35
35
|
writeJsonAtomic
|
|
36
36
|
} from "./chunk-AQFEP65J.js";
|
|
37
37
|
import {
|
|
38
38
|
getApiKey,
|
|
39
39
|
getBaseUrl
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-3LS3GFJW.js";
|
|
41
41
|
|
|
42
42
|
// src/transcript-registration.ts
|
|
43
43
|
import { createHash } from "crypto";
|
|
@@ -176,27 +176,30 @@ var createSyncState = () => ({
|
|
|
176
176
|
seen: /* @__PURE__ */ new Set(),
|
|
177
177
|
keyUploaded: false,
|
|
178
178
|
keyRejected: false,
|
|
179
|
-
keyUnavailable: false
|
|
179
|
+
keyUnavailable: false,
|
|
180
|
+
unsettled: 0
|
|
180
181
|
});
|
|
182
|
+
var withSessionKey = async (state, uploader) => {
|
|
183
|
+
if (state.sessionKey || state.keyRejected) return state;
|
|
184
|
+
const recipients = await uploader.fetchTranscriptRecipients();
|
|
185
|
+
if (!recipients) return state;
|
|
186
|
+
const sessionKey = generateSessionKey();
|
|
187
|
+
return {
|
|
188
|
+
...state,
|
|
189
|
+
sessionKey,
|
|
190
|
+
wrappedKey: wrapSessionKey(sessionKey, decodePublicKey(recipients.phonePublicKey)),
|
|
191
|
+
providerWrappedKey: recipients.provider ? wrapSessionKey(sessionKey, decodePublicKey(recipients.provider.publicKey)) : state.providerWrappedKey,
|
|
192
|
+
providerKeyId: recipients.provider ? recipients.provider.keyId : state.providerKeyId
|
|
193
|
+
};
|
|
194
|
+
};
|
|
181
195
|
var syncTick = async (lines, state, uploader, sessionId, machineId) => {
|
|
182
196
|
if (state.keyRejected) return state;
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
let providerKeyId = state.providerKeyId;
|
|
187
|
-
if (!sessionKey) {
|
|
188
|
-
const recipients = await uploader.fetchTranscriptRecipients();
|
|
189
|
-
if (!recipients) return state;
|
|
190
|
-
sessionKey = generateSessionKey();
|
|
191
|
-
wrappedKey = wrapSessionKey(sessionKey, decodePublicKey(recipients.phonePublicKey));
|
|
192
|
-
if (recipients.provider) {
|
|
193
|
-
providerWrappedKey = wrapSessionKey(sessionKey, decodePublicKey(recipients.provider.publicKey));
|
|
194
|
-
providerKeyId = recipients.provider.keyId;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
+
const keyed = await withSessionKey(state, uploader);
|
|
198
|
+
const { sessionKey, wrappedKey, providerWrappedKey, providerKeyId } = keyed;
|
|
199
|
+
if (!sessionKey) return state;
|
|
197
200
|
const built = buildTranscriptRecords(lines, sessionKey, state.seen);
|
|
198
201
|
if (built.records.length === 0) {
|
|
199
|
-
return { ...state, sessionKey, wrappedKey, providerWrappedKey, providerKeyId, seen: built.seen };
|
|
202
|
+
return { ...state, sessionKey, wrappedKey, providerWrappedKey, providerKeyId, seen: built.seen, unsettled: 0 };
|
|
200
203
|
}
|
|
201
204
|
const seen = new Set(state.seen);
|
|
202
205
|
let keyUploaded = state.keyUploaded;
|
|
@@ -237,7 +240,8 @@ var syncTick = async (lines, state, uploader, sessionId, machineId) => {
|
|
|
237
240
|
seen,
|
|
238
241
|
keyUploaded,
|
|
239
242
|
keyRejected,
|
|
240
|
-
keyUnavailable
|
|
243
|
+
keyUnavailable,
|
|
244
|
+
unsettled: built.records.filter((record) => !seen.has(record.localId)).length
|
|
241
245
|
};
|
|
242
246
|
};
|
|
243
247
|
var MAX_RECORDS_PER_BATCH = 200;
|
|
@@ -299,7 +303,19 @@ var statOrNull = (path) => {
|
|
|
299
303
|
};
|
|
300
304
|
var sightTranscript = (epoch, path, seenAtMs) => recordSighting(epoch, path, sightingOf(statOrNull(path), seenAtMs));
|
|
301
305
|
var LINE_FEED = 10;
|
|
302
|
-
var
|
|
306
|
+
var MAXIMUM_TRANSCRIPT_READ_BYTES = 4 * 1024 * 1024;
|
|
307
|
+
var CATCH_UP_DELAY_MS = 50;
|
|
308
|
+
var STALLED_BACKOFF_FACTOR = 4;
|
|
309
|
+
var nothingUnread = (cutoff) => ({ lines: [], cutoff, completeThroughOffset: cutoff.offset, reachedEnd: true });
|
|
310
|
+
var readThroughALineEnd = (descriptor, offset, unread) => {
|
|
311
|
+
let window = Math.min(unread, MAXIMUM_TRANSCRIPT_READ_BYTES);
|
|
312
|
+
for (; ; ) {
|
|
313
|
+
const buffer = Buffer.alloc(window);
|
|
314
|
+
const received = buffer.subarray(0, readSync(descriptor, buffer, 0, window, offset));
|
|
315
|
+
if (window >= unread || received.length < window || received.includes(LINE_FEED)) return received;
|
|
316
|
+
window = Math.min(unread, window * 2);
|
|
317
|
+
}
|
|
318
|
+
};
|
|
303
319
|
var readLinesSinceCutoff = (epoch, path, seenAtMs) => {
|
|
304
320
|
let descriptor;
|
|
305
321
|
try {
|
|
@@ -312,12 +328,14 @@ var readLinesSinceCutoff = (epoch, path, seenAtMs) => {
|
|
|
312
328
|
const cutoff = recordSighting(epoch, path, sightingOf(info, seenAtMs));
|
|
313
329
|
const unread = info.size - cutoff.offset;
|
|
314
330
|
if (unread <= 0) return nothingUnread(cutoff);
|
|
315
|
-
const
|
|
316
|
-
const
|
|
331
|
+
const received = readThroughALineEnd(descriptor, cutoff.offset, unread);
|
|
332
|
+
const completeBytes = received.lastIndexOf(LINE_FEED) + 1;
|
|
333
|
+
const reachedEnd = received.length >= unread;
|
|
317
334
|
return {
|
|
318
|
-
lines: received.toString("utf8").split("\n"),
|
|
335
|
+
lines: (reachedEnd ? received : received.subarray(0, completeBytes)).toString("utf8").split("\n"),
|
|
319
336
|
cutoff,
|
|
320
|
-
completeThroughOffset: cutoff.offset +
|
|
337
|
+
completeThroughOffset: cutoff.offset + completeBytes,
|
|
338
|
+
reachedEnd
|
|
321
339
|
};
|
|
322
340
|
} finally {
|
|
323
341
|
closeSync(descriptor);
|
|
@@ -327,7 +345,8 @@ var linesSeenDuringEpoch = (epoch, path, source, seenAtMs) => {
|
|
|
327
345
|
const read2 = readLinesSinceCutoff(epoch, path, seenAtMs);
|
|
328
346
|
return { ...read2, lines: transcriptLinesSeenLive(normalizeTranscriptLines(read2.lines, source), epoch.startedAtMs, read2.cutoff.startedBeforeEpoch) };
|
|
329
347
|
};
|
|
330
|
-
var nothingLeftToUpload = (state
|
|
348
|
+
var nothingLeftToUpload = (state) => state.sessionKey !== null && !state.keyRejected && state.unsettled === 0;
|
|
349
|
+
var uploadStalled = (before, after) => after.sessionKey !== null && !after.keyRejected && after.unsettled > 0 && after.seen.size === before.seen.size;
|
|
331
350
|
var nextInterval = (previousMs, idle, baseMs, maxMs) => idle ? Math.min(previousMs * 2, maxMs) : baseMs;
|
|
332
351
|
var startTranscriptSync = (opts) => {
|
|
333
352
|
let warnedAboutRecipients = false;
|
|
@@ -354,32 +373,50 @@ var startTranscriptSync = (opts) => {
|
|
|
354
373
|
const persisted = loadSessionKey(opts.sessionId, opts.storage?.sessionKeyDirectory);
|
|
355
374
|
let state = persisted ? { ...createSyncState(), ...persisted } : createSyncState();
|
|
356
375
|
sweepStaleSessionKeys(Date.now(), opts.storage?.sessionKeyDirectory);
|
|
376
|
+
let persistedKey = persisted?.sessionKey ?? null;
|
|
357
377
|
let persistedUploaded = persisted?.keyUploaded ?? false;
|
|
378
|
+
const persistSessionKey = () => {
|
|
379
|
+
if (!state.sessionKey || state.sessionKey === persistedKey && state.keyUploaded === persistedUploaded) return;
|
|
380
|
+
persistedKey = state.sessionKey;
|
|
381
|
+
persistedUploaded = state.keyUploaded;
|
|
382
|
+
saveSessionKey(opts.sessionId, {
|
|
383
|
+
sessionKey: state.sessionKey,
|
|
384
|
+
wrappedKey: state.wrappedKey,
|
|
385
|
+
providerWrappedKey: state.providerWrappedKey,
|
|
386
|
+
providerKeyId: state.providerKeyId,
|
|
387
|
+
keyUploaded: state.keyUploaded
|
|
388
|
+
}, opts.storage?.sessionKeyDirectory);
|
|
389
|
+
};
|
|
358
390
|
let running = true;
|
|
359
391
|
let inFlight = false;
|
|
392
|
+
let stalled = false;
|
|
393
|
+
let catchingUp = false;
|
|
360
394
|
const tick = async () => {
|
|
395
|
+
catchingUp = false;
|
|
361
396
|
if (!running || inFlight || !(opts.enabled ? opts.enabled() : transcriptsEnabled())) return;
|
|
362
397
|
inFlight = true;
|
|
363
398
|
try {
|
|
364
|
-
const before = state.sessionKey;
|
|
365
399
|
const ending = opts.ending?.() === true;
|
|
400
|
+
if (state.keyRejected) {
|
|
401
|
+
if (ending) opts.onDrained?.();
|
|
402
|
+
return;
|
|
403
|
+
}
|
|
404
|
+
state = await withSessionKey(state, uploader);
|
|
405
|
+
if (!state.sessionKey) return;
|
|
406
|
+
persistSessionKey();
|
|
407
|
+
const previous = state;
|
|
366
408
|
const modified = existsSync2(path) ? statSync2(path).mtimeMs : null;
|
|
367
409
|
const source = opts.source ?? "claude";
|
|
368
410
|
const read2 = opts.epoch ? linesSeenDuringEpoch(opts.epoch, path, source, Date.now()) : null;
|
|
369
411
|
const lines = read2?.lines ?? normalizeTranscriptLines(readLines(path), source);
|
|
370
412
|
state = await syncTick(lines, state, uploader, opts.sessionId, opts.machineId);
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
keyUploaded: state.keyUploaded
|
|
379
|
-
}, opts.storage?.sessionKeyDirectory);
|
|
380
|
-
}
|
|
381
|
-
if (opts.epoch && read2 && nothingLeftToUpload(state, lines)) recordSettledPosition(opts.epoch, path, read2.cutoff, read2.completeThroughOffset);
|
|
382
|
-
if (ending && opts.ending?.() && existsSync2(path) && statSync2(path).mtimeMs === modified && state.keyUploaded && nothingLeftToUpload(state, lines)) opts.onDrained?.();
|
|
413
|
+
stalled = uploadStalled(previous, state);
|
|
414
|
+
persistSessionKey();
|
|
415
|
+
const settled = nothingLeftToUpload(state);
|
|
416
|
+
if (opts.epoch && read2 && settled) recordSettledPosition(opts.epoch, path, read2.cutoff, read2.completeThroughOffset);
|
|
417
|
+
catchingUp = settled && read2 !== null && !read2.reachedEnd && read2.completeThroughOffset > read2.cutoff.offset;
|
|
418
|
+
const readEverything = read2?.reachedEnd ?? true;
|
|
419
|
+
if (ending && opts.ending?.() && existsSync2(path) && statSync2(path).mtimeMs === modified && settled && readEverything) opts.onDrained?.();
|
|
383
420
|
} catch {
|
|
384
421
|
} finally {
|
|
385
422
|
inFlight = false;
|
|
@@ -394,14 +431,14 @@ var startTranscriptSync = (opts) => {
|
|
|
394
431
|
void (async () => {
|
|
395
432
|
const before = state.sessionKey;
|
|
396
433
|
await tick();
|
|
397
|
-
const
|
|
398
|
-
|
|
434
|
+
const waiting = state.sessionKey === null && before === null || state.keyUnavailable || state.keyRejected;
|
|
435
|
+
const ceilingMs = waiting ? maxIntervalMs : Math.min(maxIntervalMs, baseIntervalMs * STALLED_BACKOFF_FACTOR);
|
|
436
|
+
schedule(catchingUp ? CATCH_UP_DELAY_MS : nextInterval(Math.max(delayMs, baseIntervalMs), waiting || stalled, baseIntervalMs, ceilingMs));
|
|
399
437
|
})();
|
|
400
438
|
}, delayMs);
|
|
401
439
|
if (typeof timer.unref === "function") timer.unref();
|
|
402
440
|
};
|
|
403
|
-
|
|
404
|
-
schedule(baseIntervalMs);
|
|
441
|
+
schedule(0);
|
|
405
442
|
return () => {
|
|
406
443
|
running = false;
|
|
407
444
|
if (timer) clearTimeout(timer);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveInstallSourceFor
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NMQLY4PE.js";
|
|
4
4
|
import {
|
|
5
5
|
backupFile,
|
|
6
6
|
readJsonSafe,
|
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
} from "./chunk-AQFEP65J.js";
|
|
10
10
|
import {
|
|
11
11
|
configFilePath
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-3LS3GFJW.js";
|
|
13
13
|
import {
|
|
14
14
|
API_KEY_PREFIX_PATTERN,
|
|
15
15
|
isRecord
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-7FQL5NWJ.js";
|
|
17
17
|
|
|
18
18
|
// src/shell-alias.ts
|
|
19
19
|
import { homedir } from "os";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pusharyDir
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UPRNSD2T.js";
|
|
4
4
|
import {
|
|
5
5
|
readJsonSafe
|
|
6
6
|
} from "./chunk-AQFEP65J.js";
|
|
7
7
|
import {
|
|
8
8
|
isRecord
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-7FQL5NWJ.js";
|
|
10
10
|
|
|
11
11
|
// src/process-ownership.ts
|
|
12
12
|
import { createHash, randomUUID } from "crypto";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
macAppBridgeAvailable
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WFPXKCN4.js";
|
|
4
4
|
import {
|
|
5
5
|
keyPrefix
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-DCBSD22V.js";
|
|
7
7
|
import {
|
|
8
8
|
bridgeAgentKey
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-UPRNSD2T.js";
|
|
10
10
|
import {
|
|
11
11
|
readJsonSafe
|
|
12
12
|
} from "./chunk-AQFEP65J.js";
|
|
13
13
|
import {
|
|
14
14
|
isValidApiKey
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-7FQL5NWJ.js";
|
|
16
16
|
|
|
17
17
|
// src/shared-mcp-key.ts
|
|
18
18
|
var asRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MCP_BRIDGE_BINARY
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UDECNZYI.js";
|
|
4
4
|
import {
|
|
5
5
|
KEY_FILE_MODE
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-DCBSD22V.js";
|
|
7
7
|
import {
|
|
8
8
|
NpmMissingError,
|
|
9
9
|
NpmPermissionError
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-UPRNSD2T.js";
|
|
11
11
|
import {
|
|
12
12
|
readJsonSafe,
|
|
13
13
|
writeFileAtomic,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from "./chunk-AQFEP65J.js";
|
|
16
16
|
import {
|
|
17
17
|
NPX_LATEST_COMMAND
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-45OXG3VR.js";
|
|
19
19
|
|
|
20
20
|
// src/instruction-file.ts
|
|
21
21
|
import { existsSync, readFileSync, writeFileSync, mkdirSync, rmSync } from "fs";
|
|
@@ -37,7 +37,7 @@ You have Pushary MCP tools that reach the user on their phone. Use them proactiv
|
|
|
37
37
|
- Use \`cancel_question\` to retract a pending question once it is no longer needed.
|
|
38
38
|
- Respect the user's Pushary delivery mode: it decides where an approval is surfaced (phone, terminal, or awareness only), not whether it is required. In Terminal mode do not expect a phone answer; the approval waits in the terminal. If the Pushary hook already gated an action, a single approval is enough, do not ask again.
|
|
39
39
|
|
|
40
|
-
Pass \`agentName\` as "${label} - <project folder name>" so the user knows which session is asking. If a question times out, follow \`handoffAction\` when present, otherwise \`nextAction\`:
|
|
40
|
+
Pass \`agentName\` as "${label} - <project folder name>" so the user knows which session is asking. If a question times out, follow \`handoffAction\` when present, otherwise \`nextAction\`: keep waiting with the same correlationId while pending. A poll ending is not question expiry. Cancel only for an explicit handoff or when the answer is no longer needed. If cancellation returns \`handoffAction: "stop"\`, stop. Otherwise, if cancellation returns false, poll once for 1 second and honor the answer that won the race.`;
|
|
41
41
|
var SHARED_AGENTS_MD_LABEL = "<your agent's name, such as Codex or Hermes>";
|
|
42
42
|
var renderAgentInstructions = (label) => instructionBody(label);
|
|
43
43
|
var KEYLESS_FALLBACK_LINE = "This repo uses Pushary phone approvals. Your teammates get agent questions on their lock screens; you do not have a key yet, so questions will fall back to the terminal. Get your own key (3-day trial): https://pushary.com/sign-up?utm_source=agents-md&utm_medium=teammate";
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
keyPrefix,
|
|
5
5
|
readConfigFileKey,
|
|
6
6
|
readMacAppKeyPrefix
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-DCBSD22V.js";
|
|
8
8
|
import {
|
|
9
9
|
NPX_LATEST_COMMAND
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-45OXG3VR.js";
|
|
11
11
|
|
|
12
12
|
// src/key-signed-out.ts
|
|
13
13
|
var VERDICT_BY_CHECK = {
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
} from "./chunk-XHKBHWLX.js";
|
|
5
5
|
import {
|
|
6
6
|
readControlMode
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-DCBSD22V.js";
|
|
8
8
|
import {
|
|
9
9
|
getMachineId
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ULJFIF5N.js";
|
|
11
11
|
import {
|
|
12
12
|
pusharyDir,
|
|
13
13
|
resolveGlobalBinary
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-UPRNSD2T.js";
|
|
15
15
|
import {
|
|
16
16
|
readJsonSafe,
|
|
17
17
|
writeFileAtomic,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
} from "./chunk-AQFEP65J.js";
|
|
21
21
|
import {
|
|
22
22
|
getApiKey
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-3LS3GFJW.js";
|
|
24
24
|
import {
|
|
25
25
|
CLI_PACKAGE_NAMES,
|
|
26
26
|
cmdShimTarget,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
globalPackageFolder,
|
|
29
29
|
globalRootFor,
|
|
30
30
|
isRecord
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-7FQL5NWJ.js";
|
|
32
32
|
|
|
33
33
|
// src/daemon-lifecycle.ts
|
|
34
34
|
import { dirname, join, win32 as win32Path } from "path";
|
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
permissionDeniedAction,
|
|
7
7
|
releaseThrottle,
|
|
8
8
|
reportEvent
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-SMRMWDFE.js";
|
|
10
10
|
import {
|
|
11
11
|
machineDecisionFor,
|
|
12
12
|
shouldDeferToNativeMode,
|
|
13
13
|
wireVerdictFor
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-7FQL5NWJ.js";
|
|
15
15
|
|
|
16
16
|
// src/machine-decision-audit.ts
|
|
17
17
|
import { basename } from "path";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
compatibleConfigFile,
|
|
3
3
|
hasCompatibleHooks
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7S7H7V5V.js";
|
|
5
5
|
import {
|
|
6
6
|
pusharyHookExecutable
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-6OGDGQTT.js";
|
|
8
8
|
import {
|
|
9
9
|
isProtectedByScope,
|
|
10
10
|
registerHookEntry
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-UPRNSD2T.js";
|
|
12
12
|
import {
|
|
13
13
|
isRecord
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-7FQL5NWJ.js";
|
|
15
15
|
|
|
16
16
|
// src/cursor-config.ts
|
|
17
17
|
var hookCommandOf = (entry) => {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
keyCheckFromResponse
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7IVV4LLF.js";
|
|
4
4
|
import {
|
|
5
5
|
installNetworkDefaults
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-22YSHBTI.js";
|
|
7
7
|
import {
|
|
8
8
|
getBaseUrl
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-3LS3GFJW.js";
|
|
10
10
|
|
|
11
11
|
// src/retry.ts
|
|
12
12
|
var isRetryable = (err) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ensureCodexTrustsPusharyHooks
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-A455TSHF.js";
|
|
4
4
|
import {
|
|
5
5
|
detectClaudeVersion
|
|
6
6
|
} from "./chunk-RIVNNBEK.js";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
openCodeHookArgv,
|
|
13
13
|
openCodePluginDir,
|
|
14
14
|
openCodeWired
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-WFPXKCN4.js";
|
|
16
16
|
import {
|
|
17
17
|
addClaudeMcpServer,
|
|
18
18
|
addCompatibleHooks,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
addPusharyToolPermissions,
|
|
21
21
|
compatibleConfigFile,
|
|
22
22
|
hasCompatibleHooks
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-7S7H7V5V.js";
|
|
24
24
|
import {
|
|
25
25
|
claudeUnprovenHolds,
|
|
26
26
|
claudeWired,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
codexWired,
|
|
29
29
|
geminiWired,
|
|
30
30
|
planHooks
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-6OGDGQTT.js";
|
|
32
32
|
import {
|
|
33
33
|
CLAUDE_HOOK_BINARY,
|
|
34
34
|
CLAUDE_HOOK_EVENTS,
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
needsReregistration,
|
|
40
40
|
registrationSignatures,
|
|
41
41
|
supportedClaudeEvents
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-QJ3ENGBT.js";
|
|
43
43
|
import {
|
|
44
44
|
formatVersion
|
|
45
45
|
} from "./chunk-6ICPEJY5.js";
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
resolveGlobalBinDir,
|
|
64
64
|
resolveGlobalBinary,
|
|
65
65
|
vscodePluginMcp
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-UPRNSD2T.js";
|
|
67
67
|
import {
|
|
68
68
|
readJsonSafe,
|
|
69
69
|
writeFileAtomic,
|
|
@@ -73,7 +73,7 @@ import {
|
|
|
73
73
|
HOOK_COMPATIBLE_PROFILES,
|
|
74
74
|
isCompatibleAgentType,
|
|
75
75
|
isRecord
|
|
76
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-7FQL5NWJ.js";
|
|
77
77
|
|
|
78
78
|
// src/reapply.ts
|
|
79
79
|
import { dirname, join } from "path";
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
decodePublicKey,
|
|
4
4
|
generateSessionKey,
|
|
5
5
|
wrapSessionKey
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-CK3W7Q5S.js";
|
|
7
7
|
import {
|
|
8
8
|
fetchTranscriptRecipients,
|
|
9
9
|
uploadTranscriptRecords
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-4PIAOJAW.js";
|
|
11
11
|
|
|
12
12
|
// src/live-session.ts
|
|
13
13
|
var MAX_TRANSCRIPT_QUEUE = 100;
|