pushary 1.9.132 → 1.9.134
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/bin/pushary-bell-hook.js +3 -3
- package/dist/bin/pushary-claude.js +2 -2
- package/dist/bin/pushary-clean.js +3 -3
- package/dist/bin/pushary-codex-hook.js +3 -3
- package/dist/bin/pushary-codex-session.js +2 -2
- package/dist/bin/pushary-daemon.js +10 -3
- package/dist/bin/pushary-display-hook.js +4 -4
- package/dist/bin/pushary-doctor.js +9 -2
- package/dist/bin/pushary-elicitation-hook.js +3 -3
- package/dist/bin/pushary-gemini-hook.js +3 -3
- package/dist/bin/pushary-hook.js +4 -4
- package/dist/bin/pushary-login.js +1 -1
- package/dist/bin/pushary-notification-hook.js +3 -3
- package/dist/bin/pushary-opencode-hook.js +3 -3
- package/dist/bin/pushary-permission-denied-hook.js +4 -4
- package/dist/bin/pushary-permission-hook.js +4 -4
- package/dist/bin/pushary-post-hook.js +3 -3
- package/dist/bin/pushary-prompt-hook.js +3 -3
- package/dist/bin/pushary-session-end-hook.js +3 -3
- package/dist/bin/pushary-session-start-hook.js +3 -3
- package/dist/bin/pushary-setup.js +17 -3
- package/dist/bin/pushary-status.js +2 -2
- package/dist/bin/pushary-stop-hook.js +3 -3
- package/dist/bin/pushary-stopfailure-hook.js +3 -3
- package/dist/bin/pushary-transcript-register.js +2 -2
- package/dist/bin/pushary-transcripts.js +2 -2
- package/dist/bin/pushary-upgrade.js +8 -2
- package/dist/{chunk-KBOANW7J.js → chunk-3DCCMO23.js} +38 -6
- package/dist/chunk-AIZYJJGD.js +95 -0
- package/dist/{chunk-NJH6EGZN.js → chunk-FJST6ZXC.js} +1 -1
- package/dist/{chunk-U5AZKJ5O.js → chunk-I6MI4NWX.js} +1 -1
- package/dist/{chunk-J6WO5ZR5.js → chunk-PHKCTMAV.js} +2 -2
- package/dist/{chunk-4EGRD5RS.js → chunk-QVIDOVT6.js} +1 -1
- package/dist/{chunk-BTDEBPPR.js → chunk-UDAXXR43.js} +1 -1
- package/dist/{chunk-FP4WRSWE.js → chunk-VME5NXCM.js} +1 -1
- package/dist/{codex-app-cards-switch-WDQBUF7K.js → codex-app-cards-switch-D2SODMQN.js} +3 -3
- package/dist/{codex-desktop-launch-EQ4VH6QV.js → codex-desktop-launch-CFKIJZVB.js} +1 -1
- package/dist/src/index.js +4 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.9.134
|
|
4
|
+
|
|
5
|
+
- Linux: on a machine you reach over SSH, phone-start keeps running after you log out, and starts again after a reboot. Setup, `pushary upgrade` and `pushary daemon install` now turn on systemd lingering for your user unless you are signed in to a desktop session there, and say so. Where the system refuses, they print the `sudo loginctl enable-linger` command instead. Before, systemd stopped the daemon when your last SSH session closed, while setup still reported phone-start as working. `pushary doctor` has a new row, "Remote-control service survives logout".
|
|
6
|
+
|
|
7
|
+
## 1.9.133
|
|
8
|
+
|
|
9
|
+
- The background daemon starts again by itself after its lock file was left empty or cut off, for example when the disk filled up or the computer lost power while it was starting, and, on macOS and Linux, after a power cut or forced restart left a lock that names a process number another program now uses. Before, it exited at once and was restarted again and again, writing an error each time, and even `pushary daemon restart` could not clear the second case.
|
|
10
|
+
- Linux: setup, `pushary upgrade` and `pushary daemon install` can replace a daemon that systemd keeps restarting after a crash. Before, they stopped with "Could not inspect whether the native service is running: activating" and left the crash loop in place.
|
|
11
|
+
|
|
3
12
|
## 1.9.132
|
|
4
13
|
|
|
5
14
|
- Windows: your phone shows Claude's reply as it streams, as it does on macOS and Linux. Before, a file check that only fits macOS and Linux refused the live preview on Windows, so the phone showed only the finished reply.
|
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
} from "../chunk-GQPXW6BL.js";
|
|
5
5
|
import {
|
|
6
6
|
readHookInput
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-UDAXXR43.js";
|
|
8
8
|
import "../chunk-EPPH5RMJ.js";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-I6MI4NWX.js";
|
|
10
10
|
import "../chunk-VAE5JBR5.js";
|
|
11
11
|
import "../chunk-G66WIAST.js";
|
|
12
12
|
import "../chunk-RZBV5KTF.js";
|
|
13
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-3DCCMO23.js";
|
|
14
14
|
import "../chunk-237FYIVC.js";
|
|
15
15
|
import "../chunk-MRHGK3Q3.js";
|
|
16
16
|
import "../chunk-JYCAAQUW.js";
|
|
@@ -24,12 +24,12 @@ import {
|
|
|
24
24
|
registerTranscript,
|
|
25
25
|
registeredTranscriptEnabled,
|
|
26
26
|
startDraftPublisher
|
|
27
|
-
} from "../chunk-
|
|
27
|
+
} from "../chunk-I6MI4NWX.js";
|
|
28
28
|
import "../chunk-VAE5JBR5.js";
|
|
29
29
|
import "../chunk-G66WIAST.js";
|
|
30
30
|
import {
|
|
31
31
|
ensureDaemonRunning
|
|
32
|
-
} from "../chunk-
|
|
32
|
+
} from "../chunk-3DCCMO23.js";
|
|
33
33
|
import "../chunk-237FYIVC.js";
|
|
34
34
|
import {
|
|
35
35
|
DEFAULT_SESSION,
|
|
@@ -15,13 +15,13 @@ import {
|
|
|
15
15
|
storedMacAppState,
|
|
16
16
|
storedPusharyKeychainServices,
|
|
17
17
|
waitForMacAppExit
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-PHKCTMAV.js";
|
|
19
19
|
import {
|
|
20
20
|
PUSHARY_SKILL_NAME,
|
|
21
21
|
PUSHARY_SKILL_SOURCE,
|
|
22
22
|
createGuards
|
|
23
23
|
} from "../chunk-J42EAEX3.js";
|
|
24
|
-
import "../chunk-
|
|
24
|
+
import "../chunk-VME5NXCM.js";
|
|
25
25
|
import "../chunk-XCEN33UP.js";
|
|
26
26
|
import {
|
|
27
27
|
describeCliKeyRevocation,
|
|
@@ -98,7 +98,7 @@ import {
|
|
|
98
98
|
} from "../chunk-RZBV5KTF.js";
|
|
99
99
|
import {
|
|
100
100
|
disableDaemonService
|
|
101
|
-
} from "../chunk-
|
|
101
|
+
} from "../chunk-3DCCMO23.js";
|
|
102
102
|
import {
|
|
103
103
|
hookOwnerOf,
|
|
104
104
|
isHookTakeoverReceipt,
|
|
@@ -23,17 +23,17 @@ import {
|
|
|
23
23
|
} from "../chunk-UZUDMZES.js";
|
|
24
24
|
import {
|
|
25
25
|
readHookInput
|
|
26
|
-
} from "../chunk-
|
|
26
|
+
} from "../chunk-UDAXXR43.js";
|
|
27
27
|
import "../chunk-EPPH5RMJ.js";
|
|
28
28
|
import {
|
|
29
29
|
announceSubscriptionRequired,
|
|
30
30
|
isDeferAnswer
|
|
31
31
|
} from "../chunk-EA5EASYT.js";
|
|
32
|
-
import "../chunk-
|
|
32
|
+
import "../chunk-I6MI4NWX.js";
|
|
33
33
|
import "../chunk-VAE5JBR5.js";
|
|
34
34
|
import "../chunk-G66WIAST.js";
|
|
35
35
|
import "../chunk-RZBV5KTF.js";
|
|
36
|
-
import "../chunk-
|
|
36
|
+
import "../chunk-3DCCMO23.js";
|
|
37
37
|
import "../chunk-237FYIVC.js";
|
|
38
38
|
import {
|
|
39
39
|
CODEX_AGENT,
|
|
@@ -19,7 +19,7 @@ var desktopAccount = async () => {
|
|
|
19
19
|
return null;
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
|
-
var desktopLaunch = await import("../codex-desktop-launch-
|
|
22
|
+
var desktopLaunch = await import("../codex-desktop-launch-CFKIJZVB.js").catch(() => null);
|
|
23
23
|
if (desktopLaunch === null && appBehindTheProxy !== void 0) {
|
|
24
24
|
process.exitCode = await letCodexRunWithoutPushary(appBehindTheProxy, args.slice(3));
|
|
25
25
|
} else {
|
|
@@ -27,7 +27,7 @@ if (desktopLaunch === null && appBehindTheProxy !== void 0) {
|
|
|
27
27
|
const stop = () => abort.abort();
|
|
28
28
|
if (!args[0]?.startsWith("--desktop")) for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"]) process.on(signal, stop);
|
|
29
29
|
try {
|
|
30
|
-
const { codexDesktopCommand } = desktopLaunch ?? await import("../codex-desktop-launch-
|
|
30
|
+
const { codexDesktopCommand } = desktopLaunch ?? await import("../codex-desktop-launch-CFKIJZVB.js");
|
|
31
31
|
const desktop = await codexDesktopCommand(args, [process.execPath, ...process.execArgv, process.argv[1], "codex"], desktopAccount);
|
|
32
32
|
if (desktop !== null) process.exitCode = desktop;
|
|
33
33
|
else {
|
|
@@ -8,10 +8,14 @@ import {
|
|
|
8
8
|
} from "../chunk-6JY44IZI.js";
|
|
9
9
|
import "../chunk-FT5MTCKU.js";
|
|
10
10
|
import "../chunk-PG23ENSN.js";
|
|
11
|
+
import {
|
|
12
|
+
keepLinuxDaemonAfterLogout,
|
|
13
|
+
lingerReportOf
|
|
14
|
+
} from "../chunk-AIZYJJGD.js";
|
|
11
15
|
import {
|
|
12
16
|
HEARTBEAT_INTERVAL_MS,
|
|
13
17
|
sendHeartbeat
|
|
14
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-FJST6ZXC.js";
|
|
15
19
|
import "../chunk-RLQDVWZ4.js";
|
|
16
20
|
import {
|
|
17
21
|
readSignedOutDiagnosis
|
|
@@ -56,7 +60,7 @@ import {
|
|
|
56
60
|
import "../chunk-EPPH5RMJ.js";
|
|
57
61
|
import {
|
|
58
62
|
startRegisteredTranscripts
|
|
59
|
-
} from "../chunk-
|
|
63
|
+
} from "../chunk-I6MI4NWX.js";
|
|
60
64
|
import "../chunk-VAE5JBR5.js";
|
|
61
65
|
import "../chunk-G66WIAST.js";
|
|
62
66
|
import "../chunk-RZBV5KTF.js";
|
|
@@ -77,7 +81,7 @@ import {
|
|
|
77
81
|
requestDaemonHandoff,
|
|
78
82
|
stopDaemonRunning,
|
|
79
83
|
writeDaemonNeedsLogin
|
|
80
|
-
} from "../chunk-
|
|
84
|
+
} from "../chunk-3DCCMO23.js";
|
|
81
85
|
import {
|
|
82
86
|
hookOwnerOf
|
|
83
87
|
} from "../chunk-237FYIVC.js";
|
|
@@ -2305,6 +2309,9 @@ var main = async () => {
|
|
|
2305
2309
|
return EXIT.UNREACHABLE;
|
|
2306
2310
|
}
|
|
2307
2311
|
process.stdout.write("[pushary] daemon service installed and online\n");
|
|
2312
|
+
const linger = lingerReportOf(keepLinuxDaemonAfterLogout());
|
|
2313
|
+
if (linger) (linger.tone === "warning" ? process.stderr : process.stdout).write(`[pushary] ${linger.text}
|
|
2314
|
+
`);
|
|
2308
2315
|
return EXIT.OK;
|
|
2309
2316
|
}
|
|
2310
2317
|
if (action === "start") {
|
|
@@ -2884,7 +2884,7 @@ import { join as join3 } from "path";
|
|
|
2884
2884
|
init_fsx();
|
|
2885
2885
|
init_paths();
|
|
2886
2886
|
import { createHash as createHash10 } from "crypto";
|
|
2887
|
-
import { lstatSync as lstatSync5, readFileSync as readFileSync18, readdirSync as readdirSync2, realpathSync as realpathSync4, statSync as
|
|
2887
|
+
import { lstatSync as lstatSync5, readFileSync as readFileSync18, readdirSync as readdirSync2, realpathSync as realpathSync4, statSync as statSync5, unlinkSync as unlinkSync5 } from "fs";
|
|
2888
2888
|
import { basename as basename2, dirname as dirname8, isAbsolute, join as join19, relative, resolve as resolve3, sep } from "path";
|
|
2889
2889
|
|
|
2890
2890
|
// src/transcript-phone-trust.ts
|
|
@@ -7597,9 +7597,9 @@ var hookOwnerOfCommands = (commands, appAvailable = true) => {
|
|
|
7597
7597
|
// src/daemon-lifecycle.ts
|
|
7598
7598
|
init_src();
|
|
7599
7599
|
import { dirname as dirname7, join as join18, win32 as win32Path } from "path";
|
|
7600
|
-
import { existsSync as existsSync6, mkdirSync as mkdirSync6, readFileSync as readFileSync17, realpathSync as realpathSync3, renameSync as renameSync3, unlinkSync as unlinkSync4, writeFileSync as writeFileSync5 } from "fs";
|
|
7600
|
+
import { existsSync as existsSync6, mkdirSync as mkdirSync6, readFileSync as readFileSync17, realpathSync as realpathSync3, renameSync as renameSync3, statSync as statSync4, unlinkSync as unlinkSync4, writeFileSync as writeFileSync5 } from "fs";
|
|
7601
7601
|
import { createHash as createHash9, randomUUID as randomUUID3 } from "crypto";
|
|
7602
|
-
import { homedir as homedir8, userInfo } from "os";
|
|
7602
|
+
import { homedir as homedir8, uptime, userInfo } from "os";
|
|
7603
7603
|
|
|
7604
7604
|
// src/identity.ts
|
|
7605
7605
|
init_fsx();
|
|
@@ -7802,7 +7802,7 @@ var cliRegistry = (apiKey = getApiKey()) => ({ apiKey, baseUrl: getBaseUrl(), di
|
|
|
7802
7802
|
var accountFor = (registry) => createHash10("sha256").update(`${registry.baseUrl}\0${registry.apiKey}`).digest("hex");
|
|
7803
7803
|
var TTL = 48 * 60 * 60 * 1e3;
|
|
7804
7804
|
var read = (path) => {
|
|
7805
|
-
if (
|
|
7805
|
+
if (statSync5(path).size > 16384) throw new Error("History registration exceeds its size limit");
|
|
7806
7806
|
return storedRegistrationSchema.parse(JSON.parse(readFileSync18(path, "utf8")));
|
|
7807
7807
|
};
|
|
7808
7808
|
var consent = (record) => record.consentOverride ?? readTranscriptPreference() ?? true;
|
|
@@ -32,10 +32,15 @@ import {
|
|
|
32
32
|
roundTripEvidence,
|
|
33
33
|
verifyRoundTrip
|
|
34
34
|
} from "../chunk-L5RSLIBQ.js";
|
|
35
|
+
import {
|
|
36
|
+
daemonStopsAtLogout,
|
|
37
|
+
lingerDoctorDetail,
|
|
38
|
+
readLinuxLinger
|
|
39
|
+
} from "../chunk-AIZYJJGD.js";
|
|
35
40
|
import {
|
|
36
41
|
readMachineReadiness,
|
|
37
42
|
readManagedControlEvidence
|
|
38
|
-
} from "../chunk-
|
|
43
|
+
} from "../chunk-FJST6ZXC.js";
|
|
39
44
|
import {
|
|
40
45
|
assessCodexHookTrust,
|
|
41
46
|
readCodexTrustForPusharyHooks
|
|
@@ -143,7 +148,7 @@ import {
|
|
|
143
148
|
readDaemonNeedsLogin,
|
|
144
149
|
readDaemonStatus,
|
|
145
150
|
readInstalledDaemonService
|
|
146
|
-
} from "../chunk-
|
|
151
|
+
} from "../chunk-3DCCMO23.js";
|
|
147
152
|
import {
|
|
148
153
|
GEMINI_HOOK_BINARY,
|
|
149
154
|
claudeOtherHolders,
|
|
@@ -1198,6 +1203,8 @@ var main = async () => {
|
|
|
1198
1203
|
} else if (serviceFile) {
|
|
1199
1204
|
console.log(` ${warn} Remote-control service runtime ${dim(`(could not read the node path out of ${serviceFile.path})`)}`);
|
|
1200
1205
|
}
|
|
1206
|
+
const linger = serviceFile && controlPolicy === "enabled" ? readLinuxLinger() : null;
|
|
1207
|
+
if (linger) check(!daemonStopsAtLogout(linger), "Remote-control service survives logout", lingerDoctorDetail(linger));
|
|
1201
1208
|
let serverProof = null;
|
|
1202
1209
|
if (controlPolicy === "enabled" && apiKey && daemon.machineId) {
|
|
1203
1210
|
serverProof = await readMachineReadiness(apiKey, expectedLaunchCapabilities(configuredManagedProviders), {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
readHookInput
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-UDAXXR43.js";
|
|
5
5
|
import "../chunk-EPPH5RMJ.js";
|
|
6
6
|
import {
|
|
7
7
|
announceSubscriptionRequired,
|
|
8
8
|
isDeferAnswer
|
|
9
9
|
} from "../chunk-EA5EASYT.js";
|
|
10
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-I6MI4NWX.js";
|
|
11
11
|
import "../chunk-VAE5JBR5.js";
|
|
12
12
|
import "../chunk-G66WIAST.js";
|
|
13
13
|
import "../chunk-RZBV5KTF.js";
|
|
14
|
-
import "../chunk-
|
|
14
|
+
import "../chunk-3DCCMO23.js";
|
|
15
15
|
import "../chunk-237FYIVC.js";
|
|
16
16
|
import "../chunk-MRHGK3Q3.js";
|
|
17
17
|
import "../chunk-JYCAAQUW.js";
|
|
@@ -16,17 +16,17 @@ import {
|
|
|
16
16
|
} from "../chunk-UZUDMZES.js";
|
|
17
17
|
import {
|
|
18
18
|
readHookInput
|
|
19
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-UDAXXR43.js";
|
|
20
20
|
import "../chunk-EPPH5RMJ.js";
|
|
21
21
|
import {
|
|
22
22
|
announceSubscriptionRequired,
|
|
23
23
|
isDeferAnswer
|
|
24
24
|
} from "../chunk-EA5EASYT.js";
|
|
25
|
-
import "../chunk-
|
|
25
|
+
import "../chunk-I6MI4NWX.js";
|
|
26
26
|
import "../chunk-VAE5JBR5.js";
|
|
27
27
|
import "../chunk-G66WIAST.js";
|
|
28
28
|
import "../chunk-RZBV5KTF.js";
|
|
29
|
-
import "../chunk-
|
|
29
|
+
import "../chunk-3DCCMO23.js";
|
|
30
30
|
import "../chunk-237FYIVC.js";
|
|
31
31
|
import {
|
|
32
32
|
DEFAULT_SESSION,
|
package/dist/bin/pushary-hook.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
handlePreToolUse
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-QVIDOVT6.js";
|
|
5
5
|
import "../chunk-FT5MTCKU.js";
|
|
6
6
|
import {
|
|
7
7
|
exitOnHelpFlag
|
|
@@ -11,10 +11,10 @@ import "../chunk-HW63OEVM.js";
|
|
|
11
11
|
import "../chunk-2U4MCUVZ.js";
|
|
12
12
|
import {
|
|
13
13
|
readToolHookCall
|
|
14
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-UDAXXR43.js";
|
|
15
15
|
import "../chunk-EPPH5RMJ.js";
|
|
16
16
|
import "../chunk-EA5EASYT.js";
|
|
17
|
-
import "../chunk-
|
|
17
|
+
import "../chunk-I6MI4NWX.js";
|
|
18
18
|
import "../chunk-VAE5JBR5.js";
|
|
19
19
|
import "../chunk-G66WIAST.js";
|
|
20
20
|
import {
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
normalizeToolCall,
|
|
23
23
|
profileFromArgv
|
|
24
24
|
} from "../chunk-RZBV5KTF.js";
|
|
25
|
-
import "../chunk-
|
|
25
|
+
import "../chunk-3DCCMO23.js";
|
|
26
26
|
import "../chunk-237FYIVC.js";
|
|
27
27
|
import "../chunk-MRHGK3Q3.js";
|
|
28
28
|
import {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
readHookInput
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-UDAXXR43.js";
|
|
5
5
|
import "../chunk-EPPH5RMJ.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-I6MI4NWX.js";
|
|
7
7
|
import "../chunk-VAE5JBR5.js";
|
|
8
8
|
import "../chunk-G66WIAST.js";
|
|
9
9
|
import {
|
|
10
10
|
activeHookSource,
|
|
11
11
|
activeIdentity
|
|
12
12
|
} from "../chunk-RZBV5KTF.js";
|
|
13
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-3DCCMO23.js";
|
|
14
14
|
import "../chunk-237FYIVC.js";
|
|
15
15
|
import {
|
|
16
16
|
handleNotification
|
|
@@ -13,17 +13,17 @@ import {
|
|
|
13
13
|
} from "../chunk-2U4MCUVZ.js";
|
|
14
14
|
import {
|
|
15
15
|
readHookInput
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-UDAXXR43.js";
|
|
17
17
|
import "../chunk-EPPH5RMJ.js";
|
|
18
18
|
import {
|
|
19
19
|
announceSubscriptionRequired,
|
|
20
20
|
isDeferAnswer
|
|
21
21
|
} from "../chunk-EA5EASYT.js";
|
|
22
|
-
import "../chunk-
|
|
22
|
+
import "../chunk-I6MI4NWX.js";
|
|
23
23
|
import "../chunk-VAE5JBR5.js";
|
|
24
24
|
import "../chunk-G66WIAST.js";
|
|
25
25
|
import "../chunk-RZBV5KTF.js";
|
|
26
|
-
import "../chunk-
|
|
26
|
+
import "../chunk-3DCCMO23.js";
|
|
27
27
|
import "../chunk-237FYIVC.js";
|
|
28
28
|
import {
|
|
29
29
|
DEFAULT_SESSION,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
handlePermissionDenied
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-QVIDOVT6.js";
|
|
5
5
|
import "../chunk-FT5MTCKU.js";
|
|
6
6
|
import {
|
|
7
7
|
takeHookHoldBudget
|
|
@@ -11,14 +11,14 @@ import "../chunk-HW63OEVM.js";
|
|
|
11
11
|
import "../chunk-2U4MCUVZ.js";
|
|
12
12
|
import {
|
|
13
13
|
readHookInput
|
|
14
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-UDAXXR43.js";
|
|
15
15
|
import "../chunk-EPPH5RMJ.js";
|
|
16
16
|
import "../chunk-EA5EASYT.js";
|
|
17
|
-
import "../chunk-
|
|
17
|
+
import "../chunk-I6MI4NWX.js";
|
|
18
18
|
import "../chunk-VAE5JBR5.js";
|
|
19
19
|
import "../chunk-G66WIAST.js";
|
|
20
20
|
import "../chunk-RZBV5KTF.js";
|
|
21
|
-
import "../chunk-
|
|
21
|
+
import "../chunk-3DCCMO23.js";
|
|
22
22
|
import "../chunk-237FYIVC.js";
|
|
23
23
|
import "../chunk-MRHGK3Q3.js";
|
|
24
24
|
import "../chunk-JYCAAQUW.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
handlePermissionRequest
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-QVIDOVT6.js";
|
|
5
5
|
import "../chunk-FT5MTCKU.js";
|
|
6
6
|
import {
|
|
7
7
|
takeHookHoldBudget
|
|
@@ -11,10 +11,10 @@ import "../chunk-HW63OEVM.js";
|
|
|
11
11
|
import "../chunk-2U4MCUVZ.js";
|
|
12
12
|
import {
|
|
13
13
|
readToolHookInput
|
|
14
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-UDAXXR43.js";
|
|
15
15
|
import "../chunk-EPPH5RMJ.js";
|
|
16
16
|
import "../chunk-EA5EASYT.js";
|
|
17
|
-
import "../chunk-
|
|
17
|
+
import "../chunk-I6MI4NWX.js";
|
|
18
18
|
import "../chunk-VAE5JBR5.js";
|
|
19
19
|
import "../chunk-G66WIAST.js";
|
|
20
20
|
import {
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
normalizeToolCall,
|
|
23
23
|
profileFromArgv
|
|
24
24
|
} from "../chunk-RZBV5KTF.js";
|
|
25
|
-
import "../chunk-
|
|
25
|
+
import "../chunk-3DCCMO23.js";
|
|
26
26
|
import "../chunk-237FYIVC.js";
|
|
27
27
|
import "../chunk-MRHGK3Q3.js";
|
|
28
28
|
import {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
readHookInput
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-UDAXXR43.js";
|
|
5
5
|
import "../chunk-EPPH5RMJ.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-I6MI4NWX.js";
|
|
7
7
|
import "../chunk-VAE5JBR5.js";
|
|
8
8
|
import "../chunk-G66WIAST.js";
|
|
9
9
|
import {
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
normalizeToolCall,
|
|
13
13
|
profileFromArgv
|
|
14
14
|
} from "../chunk-RZBV5KTF.js";
|
|
15
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-3DCCMO23.js";
|
|
16
16
|
import "../chunk-237FYIVC.js";
|
|
17
17
|
import {
|
|
18
18
|
emitHookOutput,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
readHookInput
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-UDAXXR43.js";
|
|
5
5
|
import "../chunk-EPPH5RMJ.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-I6MI4NWX.js";
|
|
7
7
|
import "../chunk-VAE5JBR5.js";
|
|
8
8
|
import "../chunk-G66WIAST.js";
|
|
9
9
|
import {
|
|
10
10
|
activeHookSource,
|
|
11
11
|
activeIdentity
|
|
12
12
|
} from "../chunk-RZBV5KTF.js";
|
|
13
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-3DCCMO23.js";
|
|
14
14
|
import "../chunk-237FYIVC.js";
|
|
15
15
|
import {
|
|
16
16
|
emitHookOutput,
|
|
@@ -5,16 +5,16 @@ import {
|
|
|
5
5
|
import "../chunk-CYTPQDQY.js";
|
|
6
6
|
import {
|
|
7
7
|
readHookInput
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-UDAXXR43.js";
|
|
9
9
|
import "../chunk-EPPH5RMJ.js";
|
|
10
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-I6MI4NWX.js";
|
|
11
11
|
import "../chunk-VAE5JBR5.js";
|
|
12
12
|
import "../chunk-G66WIAST.js";
|
|
13
13
|
import {
|
|
14
14
|
activeHookSource,
|
|
15
15
|
activeIdentity
|
|
16
16
|
} from "../chunk-RZBV5KTF.js";
|
|
17
|
-
import "../chunk-
|
|
17
|
+
import "../chunk-3DCCMO23.js";
|
|
18
18
|
import "../chunk-237FYIVC.js";
|
|
19
19
|
import {
|
|
20
20
|
handleSessionEnd
|
|
@@ -15,16 +15,16 @@ import {
|
|
|
15
15
|
} from "../chunk-UZUDMZES.js";
|
|
16
16
|
import {
|
|
17
17
|
readHookInput
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-UDAXXR43.js";
|
|
19
19
|
import "../chunk-EPPH5RMJ.js";
|
|
20
|
-
import "../chunk-
|
|
20
|
+
import "../chunk-I6MI4NWX.js";
|
|
21
21
|
import "../chunk-VAE5JBR5.js";
|
|
22
22
|
import "../chunk-G66WIAST.js";
|
|
23
23
|
import {
|
|
24
24
|
activeHookSource,
|
|
25
25
|
activeIdentity
|
|
26
26
|
} from "../chunk-RZBV5KTF.js";
|
|
27
|
-
import "../chunk-
|
|
27
|
+
import "../chunk-3DCCMO23.js";
|
|
28
28
|
import "../chunk-237FYIVC.js";
|
|
29
29
|
import {
|
|
30
30
|
CLAUDE_CODE_AGENT,
|
|
@@ -91,10 +91,14 @@ import {
|
|
|
91
91
|
roundTripWasAnswered,
|
|
92
92
|
verifyRoundTrip
|
|
93
93
|
} from "../chunk-L5RSLIBQ.js";
|
|
94
|
+
import {
|
|
95
|
+
keepLinuxDaemonAfterLogout,
|
|
96
|
+
lingerReportOf
|
|
97
|
+
} from "../chunk-AIZYJJGD.js";
|
|
94
98
|
import {
|
|
95
99
|
readManagedControlEvidence,
|
|
96
100
|
waitForMachineReadiness
|
|
97
|
-
} from "../chunk-
|
|
101
|
+
} from "../chunk-FJST6ZXC.js";
|
|
98
102
|
import {
|
|
99
103
|
ensureCodexTrustsPusharyHooks
|
|
100
104
|
} from "../chunk-RLQDVWZ4.js";
|
|
@@ -105,7 +109,7 @@ import {
|
|
|
105
109
|
} from "../chunk-J42EAEX3.js";
|
|
106
110
|
import {
|
|
107
111
|
codexEngineBehindLauncher
|
|
108
|
-
} from "../chunk-
|
|
112
|
+
} from "../chunk-VME5NXCM.js";
|
|
109
113
|
import "../chunk-XCEN33UP.js";
|
|
110
114
|
import {
|
|
111
115
|
CURSOR_PLUGIN_BACKUP_INFIX,
|
|
@@ -254,7 +258,7 @@ import {
|
|
|
254
258
|
serviceNodeFor,
|
|
255
259
|
stopDaemonService,
|
|
256
260
|
waitForDaemonRemoteProof
|
|
257
|
-
} from "../chunk-
|
|
261
|
+
} from "../chunk-3DCCMO23.js";
|
|
258
262
|
import {
|
|
259
263
|
GEMINI_HOOK_BINARY,
|
|
260
264
|
GEMINI_HOOK_EVENTS,
|
|
@@ -894,6 +898,15 @@ var warnVersionManagerPin = (execPath) => {
|
|
|
894
898
|
const manager = versionManagerOf(execPath);
|
|
895
899
|
if (manager) console.log(` ${yellow("!")} ${describeVersionManagerPin(execPath, manager)}`);
|
|
896
900
|
};
|
|
901
|
+
var reportLinger = (report) => {
|
|
902
|
+
if (!report) return;
|
|
903
|
+
if (report.tone === "note") {
|
|
904
|
+
console.log(` ${dim(report.text)}`);
|
|
905
|
+
return;
|
|
906
|
+
}
|
|
907
|
+
console.log(` ${yellow("!")} ${report.text}`);
|
|
908
|
+
noteManual(report.text);
|
|
909
|
+
};
|
|
897
910
|
var installGlobally2 = async () => {
|
|
898
911
|
if (globalInstallReady) return;
|
|
899
912
|
const version = getPackageVersion();
|
|
@@ -2810,6 +2823,7 @@ var main = async () => {
|
|
|
2810
2823
|
const service = await replaceDaemonService();
|
|
2811
2824
|
if (service.kind === "ok") {
|
|
2812
2825
|
warnVersionManagerPin(serviceNodeFor(process.execPath, existsSync));
|
|
2826
|
+
reportLinger(lingerReportOf(keepLinuxDaemonAfterLogout()));
|
|
2813
2827
|
controlFailureStage = "daemon-start";
|
|
2814
2828
|
daemon = await ensureDaemonRunning({ spawnDaemon: () => {
|
|
2815
2829
|
}, waitTimeoutMs: DAEMON_COLD_START_TIMEOUT_MS });
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
describeLastSeen,
|
|
15
15
|
listMachines
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-FJST6ZXC.js";
|
|
17
17
|
import {
|
|
18
18
|
SIGNED_OUT_ON_MAC_MESSAGE,
|
|
19
19
|
activeKeyVerdictOf,
|
|
@@ -38,7 +38,7 @@ import "../chunk-X23GSBOH.js";
|
|
|
38
38
|
import "../chunk-UJZ5YHSR.js";
|
|
39
39
|
import "../chunk-CYTPQDQY.js";
|
|
40
40
|
import "../chunk-RZBV5KTF.js";
|
|
41
|
-
import "../chunk-
|
|
41
|
+
import "../chunk-3DCCMO23.js";
|
|
42
42
|
import "../chunk-237FYIVC.js";
|
|
43
43
|
import "../chunk-MRHGK3Q3.js";
|
|
44
44
|
import "../chunk-JYCAAQUW.js";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
readHookInput
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-UDAXXR43.js";
|
|
5
5
|
import "../chunk-EPPH5RMJ.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-I6MI4NWX.js";
|
|
7
7
|
import "../chunk-VAE5JBR5.js";
|
|
8
8
|
import "../chunk-G66WIAST.js";
|
|
9
9
|
import {
|
|
10
10
|
activeHookSource,
|
|
11
11
|
activeIdentity
|
|
12
12
|
} from "../chunk-RZBV5KTF.js";
|
|
13
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-3DCCMO23.js";
|
|
14
14
|
import "../chunk-237FYIVC.js";
|
|
15
15
|
import {
|
|
16
16
|
emitHookOutput,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
readHookInput
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-UDAXXR43.js";
|
|
5
5
|
import "../chunk-EPPH5RMJ.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-I6MI4NWX.js";
|
|
7
7
|
import "../chunk-VAE5JBR5.js";
|
|
8
8
|
import "../chunk-G66WIAST.js";
|
|
9
9
|
import {
|
|
10
10
|
activeHookSource,
|
|
11
11
|
activeIdentity
|
|
12
12
|
} from "../chunk-RZBV5KTF.js";
|
|
13
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-3DCCMO23.js";
|
|
14
14
|
import "../chunk-237FYIVC.js";
|
|
15
15
|
import {
|
|
16
16
|
handleStopFailure
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
} from "../chunk-S4HS6VTI.js";
|
|
6
6
|
import {
|
|
7
7
|
registerTranscript
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-I6MI4NWX.js";
|
|
9
9
|
import "../chunk-VAE5JBR5.js";
|
|
10
10
|
import "../chunk-G66WIAST.js";
|
|
11
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-3DCCMO23.js";
|
|
12
12
|
import "../chunk-237FYIVC.js";
|
|
13
13
|
import "../chunk-JYCAAQUW.js";
|
|
14
14
|
import "../chunk-XHC3UNOK.js";
|
|
@@ -21,10 +21,10 @@ import {
|
|
|
21
21
|
snapshotRecipientPinFile,
|
|
22
22
|
trustPhoneRecipient,
|
|
23
23
|
verifyTrustedRecipients
|
|
24
|
-
} from "../chunk-
|
|
24
|
+
} from "../chunk-I6MI4NWX.js";
|
|
25
25
|
import "../chunk-VAE5JBR5.js";
|
|
26
26
|
import "../chunk-G66WIAST.js";
|
|
27
|
-
import "../chunk-
|
|
27
|
+
import "../chunk-3DCCMO23.js";
|
|
28
28
|
import "../chunk-237FYIVC.js";
|
|
29
29
|
import "../chunk-JYCAAQUW.js";
|
|
30
30
|
import "../chunk-XHC3UNOK.js";
|
|
@@ -34,9 +34,13 @@ import {
|
|
|
34
34
|
describeCodexTrustConfirmation
|
|
35
35
|
} from "../chunk-RVGYXUOC.js";
|
|
36
36
|
import "../chunk-L5RSLIBQ.js";
|
|
37
|
+
import {
|
|
38
|
+
keepLinuxDaemonAfterLogout,
|
|
39
|
+
lingerReportOf
|
|
40
|
+
} from "../chunk-AIZYJJGD.js";
|
|
37
41
|
import {
|
|
38
42
|
waitForMachineReadiness
|
|
39
|
-
} from "../chunk-
|
|
43
|
+
} from "../chunk-FJST6ZXC.js";
|
|
40
44
|
import "../chunk-RLQDVWZ4.js";
|
|
41
45
|
import {
|
|
42
46
|
readMacAppAgentKey
|
|
@@ -90,7 +94,7 @@ import {
|
|
|
90
94
|
replaceDaemonService,
|
|
91
95
|
stopDaemonService,
|
|
92
96
|
waitForDaemonRemoteProof
|
|
93
|
-
} from "../chunk-
|
|
97
|
+
} from "../chunk-3DCCMO23.js";
|
|
94
98
|
import "../chunk-237FYIVC.js";
|
|
95
99
|
import "../chunk-MRHGK3Q3.js";
|
|
96
100
|
import "../chunk-JYCAAQUW.js";
|
|
@@ -347,6 +351,8 @@ var finishUpgrade = async () => {
|
|
|
347
351
|
var startBackgroundService = async (apiKey, providers) => {
|
|
348
352
|
const service = await replaceDaemonService();
|
|
349
353
|
if (service.kind !== "ok") return "did_not_start";
|
|
354
|
+
const linger = lingerReportOf(keepLinuxDaemonAfterLogout());
|
|
355
|
+
if (linger) console.log(linger.tone === "warning" ? `! ${linger.text}` : linger.text);
|
|
350
356
|
const daemon = await ensureDaemonRunning({ spawnDaemon: () => {
|
|
351
357
|
}, waitTimeoutMs: DAEMON_COLD_START_TIMEOUT_MS });
|
|
352
358
|
if (daemon.kind !== "running" && daemon.kind !== "started") return "did_not_start";
|
|
@@ -36,9 +36,9 @@ import {
|
|
|
36
36
|
|
|
37
37
|
// src/daemon-lifecycle.ts
|
|
38
38
|
import { dirname, join, win32 as win32Path } from "path";
|
|
39
|
-
import { existsSync, mkdirSync, readFileSync, realpathSync, renameSync, unlinkSync, writeFileSync } from "fs";
|
|
39
|
+
import { existsSync, mkdirSync, readFileSync, realpathSync, renameSync, statSync, unlinkSync, writeFileSync } from "fs";
|
|
40
40
|
import { createHash, randomUUID } from "crypto";
|
|
41
|
-
import { homedir, userInfo } from "os";
|
|
41
|
+
import { homedir, uptime, userInfo } from "os";
|
|
42
42
|
import { execFileSync } from "child_process";
|
|
43
43
|
var daemonIsServing = (status) => status.kind === "running" || status.kind === "version-mismatch" || status.kind === "configuration-mismatch";
|
|
44
44
|
var isAliveWithStaleLease = (status) => status.kind === "unresponsive" && status.processAlive === true;
|
|
@@ -214,7 +214,7 @@ WantedBy=default.target
|
|
|
214
214
|
runningProbe: {
|
|
215
215
|
command: "systemctl",
|
|
216
216
|
args: ["--user", "is-active", unit],
|
|
217
|
-
negativeOutputPattern: /^(?:inactive|failed|unknown)\s*$/m
|
|
217
|
+
negativeOutputPattern: /^(?:inactive|failed|unknown|activating|deactivating)\s*$/m
|
|
218
218
|
},
|
|
219
219
|
reloadAfterUninstall: { command: "systemctl", args: ["--user", "daemon-reload"] }
|
|
220
220
|
};
|
|
@@ -450,6 +450,24 @@ var spawnDetachedDaemon = (plan, options = {}) => {
|
|
|
450
450
|
child.unref();
|
|
451
451
|
return typeof child.pid === "number" ? child.pid : null;
|
|
452
452
|
};
|
|
453
|
+
var BOOT_CLOCK_SLACK_MS = 6e4;
|
|
454
|
+
var uptimeIncludingSleepMs = () => {
|
|
455
|
+
if (process.platform !== "darwin" && process.platform !== "linux") return null;
|
|
456
|
+
try {
|
|
457
|
+
return uptime() * 1e3;
|
|
458
|
+
} catch {
|
|
459
|
+
return null;
|
|
460
|
+
}
|
|
461
|
+
};
|
|
462
|
+
var uptimeOnTheSameClock = (options) => {
|
|
463
|
+
if (options.uptimeMs) return options.uptimeMs();
|
|
464
|
+
return options.now ? null : uptimeIncludingSleepMs();
|
|
465
|
+
};
|
|
466
|
+
var writtenBeforeThisBoot = (writtenAtMs, options) => {
|
|
467
|
+
const uptimeMs = uptimeOnTheSameClock(options);
|
|
468
|
+
if (uptimeMs === null || !Number.isFinite(writtenAtMs)) return false;
|
|
469
|
+
return writtenAtMs < (options.now ?? Date.now)() - uptimeMs - BOOT_CLOCK_SLACK_MS;
|
|
470
|
+
};
|
|
453
471
|
var processIsAlive = (pid) => {
|
|
454
472
|
try {
|
|
455
473
|
process.kill(pid, 0);
|
|
@@ -516,7 +534,7 @@ var readDaemonStatus = (options = {}) => {
|
|
|
516
534
|
}
|
|
517
535
|
const value = state.kind === "ok" ? parseDaemonState(state.value) : null;
|
|
518
536
|
if (value) {
|
|
519
|
-
const alive = (options.isProcessAlive ?? processIsAlive)(value.pid);
|
|
537
|
+
const alive = !writtenBeforeThisBoot(Date.parse(value.updatedAt), options) && (options.isProcessAlive ?? processIsAlive)(value.pid);
|
|
520
538
|
const fresh = (options.now ?? Date.now)() - Date.parse(value.updatedAt) <= LOCAL_LEASE_TIMEOUT_MS;
|
|
521
539
|
const expectedConfigurationId2 = options.configurationId === void 0 ? currentConfigurationId() : options.configurationId;
|
|
522
540
|
return {
|
|
@@ -554,6 +572,15 @@ var safeUnlink = (path) => {
|
|
|
554
572
|
if (err.code !== "ENOENT") throw err;
|
|
555
573
|
}
|
|
556
574
|
};
|
|
575
|
+
var OWNERLESS_LOCK_WRITE_GRACE_MS = 5e3;
|
|
576
|
+
var lockWrittenAtMs = (path) => {
|
|
577
|
+
try {
|
|
578
|
+
return statSync(path).mtimeMs;
|
|
579
|
+
} catch {
|
|
580
|
+
return null;
|
|
581
|
+
}
|
|
582
|
+
};
|
|
583
|
+
var ownerlessLockIsAbandoned = (writtenAtMs, nowMs) => writtenAtMs !== null && Math.abs(nowMs - writtenAtMs) >= OWNERLESS_LOCK_WRITE_GRACE_MS;
|
|
557
584
|
var requestDaemonVersion = (version, options = {}) => {
|
|
558
585
|
const dir = options.dir ?? pusharyDir();
|
|
559
586
|
const now = options.now ?? Date.now;
|
|
@@ -583,8 +610,13 @@ var acquireDaemonLease = (options = {}) => {
|
|
|
583
610
|
}
|
|
584
611
|
const lock = readJsonSafe(lockPath(dir));
|
|
585
612
|
const owner = lock.kind === "ok" ? parseLockOwner(lock.value) : null;
|
|
586
|
-
|
|
587
|
-
|
|
613
|
+
const writtenAtMs = lockWrittenAtMs(lockPath(dir));
|
|
614
|
+
const lockIsReadable = lock.kind === "ok" || lock.kind === "unparseable";
|
|
615
|
+
if (!owner && !(lockIsReadable && ownerlessLockIsAbandoned(writtenAtMs, now()))) {
|
|
616
|
+
return { kind: "unavailable", detail: "daemon lock is invalid" };
|
|
617
|
+
}
|
|
618
|
+
const ownerIsFromThisBoot = writtenAtMs === null || !writtenBeforeThisBoot(writtenAtMs, options);
|
|
619
|
+
if (owner && ownerIsFromThisBoot && (options.isProcessAlive ?? processIsAlive)(owner.pid)) {
|
|
588
620
|
return { kind: "unavailable", detail: "daemon owner is still running or starting" };
|
|
589
621
|
}
|
|
590
622
|
const stale = join(dir, `daemon.lock.${instanceId}.stale`);
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// src/linux-linger.ts
|
|
2
|
+
import { execFileSync } from "child_process";
|
|
3
|
+
import { userInfo } from "os";
|
|
4
|
+
var LOGINCTL_TIMEOUT_MS = 5e3;
|
|
5
|
+
var DESKTOP_SESSION_TYPES = /* @__PURE__ */ new Set(["x11", "wayland", "mir"]);
|
|
6
|
+
var STOPS_AT_LOGOUT = "stops when your last SSH session closes, and does not start after a reboot until you log in";
|
|
7
|
+
var NOT_NEEDED = { kind: "not-needed" };
|
|
8
|
+
var runLoginctl = (args) => execFileSync("loginctl", [...args], {
|
|
9
|
+
encoding: "utf8",
|
|
10
|
+
timeout: LOGINCTL_TIMEOUT_MS,
|
|
11
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
12
|
+
});
|
|
13
|
+
var propertyOf = (line) => {
|
|
14
|
+
const separator = line.indexOf("=");
|
|
15
|
+
return separator < 0 ? [line.trim(), ""] : [line.slice(0, separator).trim(), line.slice(separator + 1).trim()];
|
|
16
|
+
};
|
|
17
|
+
var propertiesOf = (output) => new Map(output.split("\n").map(propertyOf));
|
|
18
|
+
var lingerMayMatter = (platform, env) => platform === "linux" && !env.WSL_DISTRO_NAME;
|
|
19
|
+
var CLOSING_SESSION_STATE = "closing";
|
|
20
|
+
var sessionIsDesktop = (session, run) => {
|
|
21
|
+
if (session === "") return false;
|
|
22
|
+
try {
|
|
23
|
+
const properties = propertiesOf(run(["show-session", session, "--property=Type", "--property=State"]));
|
|
24
|
+
return DESKTOP_SESSION_TYPES.has(properties.get("Type") ?? "") && properties.get("State") !== CLOSING_SESSION_STATE;
|
|
25
|
+
} catch {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
var daemonStopsAtLogout = (facts) => !facts.linger && !facts.desktopSession;
|
|
30
|
+
var readLingerFacts = (user, run) => {
|
|
31
|
+
try {
|
|
32
|
+
const properties = propertiesOf(run(["show-user", user, "--property=Linger", "--property=Display"]));
|
|
33
|
+
const linger = properties.get("Linger");
|
|
34
|
+
if (linger !== "yes" && linger !== "no") return null;
|
|
35
|
+
return { linger: linger === "yes", desktopSession: sessionIsDesktop(properties.get("Display") ?? "", run) };
|
|
36
|
+
} catch {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
var userOf = (options) => {
|
|
41
|
+
try {
|
|
42
|
+
return options.user ?? userInfo().username;
|
|
43
|
+
} catch {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
var readLinuxLinger = (options = {}) => {
|
|
48
|
+
if (!lingerMayMatter(options.platform ?? process.platform, options.env ?? process.env)) return null;
|
|
49
|
+
const user = userOf(options);
|
|
50
|
+
return user === null ? null : readLingerFacts(user, options.run ?? runLoginctl);
|
|
51
|
+
};
|
|
52
|
+
var keepLinuxDaemonAfterLogout = (options = {}) => {
|
|
53
|
+
if (!lingerMayMatter(options.platform ?? process.platform, options.env ?? process.env)) return NOT_NEEDED;
|
|
54
|
+
const user = userOf(options);
|
|
55
|
+
if (user === null) return NOT_NEEDED;
|
|
56
|
+
const run = options.run ?? runLoginctl;
|
|
57
|
+
const facts = readLingerFacts(user, run);
|
|
58
|
+
if (!facts || !daemonStopsAtLogout(facts)) return NOT_NEEDED;
|
|
59
|
+
try {
|
|
60
|
+
run(["--no-ask-password", "enable-linger", user]);
|
|
61
|
+
} catch {
|
|
62
|
+
return { kind: "needs-admin", user };
|
|
63
|
+
}
|
|
64
|
+
return readLingerFacts(user, run)?.linger === true ? { kind: "enabled", user } : { kind: "needs-admin", user };
|
|
65
|
+
};
|
|
66
|
+
var lingerReportOf = (outcome) => {
|
|
67
|
+
if (outcome.kind === "enabled") {
|
|
68
|
+
return {
|
|
69
|
+
tone: "note",
|
|
70
|
+
text: `Phone-start keeps running after you log out of this machine: turned on systemd lingering for ${outcome.user}. Undo with \`loginctl disable-linger\`.`
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
if (outcome.kind === "needs-admin") {
|
|
74
|
+
return {
|
|
75
|
+
tone: "warning",
|
|
76
|
+
text: `Phone-start ${STOPS_AT_LOGOUT}. To keep it running: \`sudo loginctl enable-linger ${outcome.user}\``
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
return null;
|
|
80
|
+
};
|
|
81
|
+
var lingerDoctorDetail = (facts) => {
|
|
82
|
+
if (daemonStopsAtLogout(facts)) {
|
|
83
|
+
return `no: it ${STOPS_AT_LOGOUT}; run \`pushary daemon install\`, or \`sudo loginctl enable-linger $USER\``;
|
|
84
|
+
}
|
|
85
|
+
if (facts.linger) return "systemd lingering is on";
|
|
86
|
+
return "while you are signed in to the desktop";
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export {
|
|
90
|
+
daemonStopsAtLogout,
|
|
91
|
+
readLinuxLinger,
|
|
92
|
+
keepLinuxDaemonAfterLogout,
|
|
93
|
+
lingerReportOf,
|
|
94
|
+
lingerDoctorDetail
|
|
95
|
+
};
|
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
installedCodexApp,
|
|
10
10
|
readCodexAppRuntime,
|
|
11
11
|
shellQuoted
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-VME5NXCM.js";
|
|
13
13
|
import {
|
|
14
14
|
writeHuman
|
|
15
15
|
} from "./chunk-QCGNGEGE.js";
|
|
16
16
|
import {
|
|
17
17
|
xml
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-3DCCMO23.js";
|
|
19
19
|
import {
|
|
20
20
|
writeFileAtomic
|
|
21
21
|
} from "./chunk-TODDEIYG.js";
|
|
@@ -1085,7 +1085,7 @@ var codexDesktopCommand = async (args, entry, readAccount) => {
|
|
|
1085
1085
|
return runCodexDesktopProxy(engine2, args.slice(3), readAccount, { watchesForCards: layoutIsKnown });
|
|
1086
1086
|
}
|
|
1087
1087
|
if (args[0] === APP_CARDS_FLAG) {
|
|
1088
|
-
const { codexAppCardsCommandOnThisMac } = await import("./codex-app-cards-switch-
|
|
1088
|
+
const { codexAppCardsCommandOnThisMac } = await import("./codex-app-cards-switch-D2SODMQN.js");
|
|
1089
1089
|
return codexAppCardsCommandOnThisMac(args.slice(1), entry, readAccount);
|
|
1090
1090
|
}
|
|
1091
1091
|
if (args.length > 2) throw new Error("Usage: pushary codex --desktop [path/to/Codex.app]");
|
|
@@ -22,11 +22,11 @@ import {
|
|
|
22
22
|
turnCodexAppCardsOff,
|
|
23
23
|
turnCodexAppCardsOn,
|
|
24
24
|
whyLaunchctlFailed
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
25
|
+
} from "./chunk-PHKCTMAV.js";
|
|
26
|
+
import "./chunk-VME5NXCM.js";
|
|
27
27
|
import "./chunk-XCEN33UP.js";
|
|
28
28
|
import "./chunk-QCGNGEGE.js";
|
|
29
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-3DCCMO23.js";
|
|
30
30
|
import "./chunk-H6CL3T2S.js";
|
|
31
31
|
import "./chunk-DS7XMYUB.js";
|
|
32
32
|
import "./chunk-CVBSETPW.js";
|
package/dist/src/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
handlePreToolUse
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-QVIDOVT6.js";
|
|
4
4
|
import "../chunk-FT5MTCKU.js";
|
|
5
5
|
import "../chunk-XWUPOTJV.js";
|
|
6
6
|
import "../chunk-HW63OEVM.js";
|
|
7
7
|
import "../chunk-2U4MCUVZ.js";
|
|
8
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-UDAXXR43.js";
|
|
9
9
|
import "../chunk-EPPH5RMJ.js";
|
|
10
10
|
import "../chunk-EA5EASYT.js";
|
|
11
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-I6MI4NWX.js";
|
|
12
12
|
import "../chunk-VAE5JBR5.js";
|
|
13
13
|
import "../chunk-G66WIAST.js";
|
|
14
14
|
import "../chunk-RZBV5KTF.js";
|
|
15
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-3DCCMO23.js";
|
|
16
16
|
import "../chunk-237FYIVC.js";
|
|
17
17
|
import {
|
|
18
18
|
fetchModeOverride,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pushary",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.134",
|
|
4
4
|
"description": "Human-in-the-loop (HITL) for AI agents: ask a person for approvals or answers by push notification. One command connects Claude Code, Codex, Cursor, Gemini CLI and more.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pushary",
|