@pushary/agent-hooks 1.9.53 → 1.9.55
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 +13 -1
- package/dist/bin/pushary-clean.js +85 -253
- package/dist/bin/pushary-codex-session.js +3 -3
- package/dist/bin/pushary-connect.js +1 -1
- package/dist/bin/pushary-doctor.js +7 -2
- package/dist/bin/pushary-setup.js +47 -20
- package/dist/bin/pushary-status.js +1 -1
- package/dist/{chunk-36NGFHE4.js → chunk-E46NE7FB.js} +2 -0
- package/dist/{chunk-XZRLFBEA.js → chunk-LGTF7AZX.js} +47 -11
- package/dist/{chunk-ABGN5RN2.js → chunk-T5L5NWT3.js} +2 -2
- package/dist/{chunk-SUIB4O3S.js → chunk-ZWOWEXCV.js} +234 -20
- package/dist/{codex-app-cards-switch-RENOSSDD.js → codex-app-cards-switch-P4RVJNRV.js} +7 -3
- package/dist/{codex-desktop-launch-I2D6QATK.js → codex-desktop-launch-RIBIFXSF.js} +2 -2
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
everyProgramFileIsThere,
|
|
7
7
|
installedCodexApp,
|
|
8
8
|
shellQuoted
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-T5L5NWT3.js";
|
|
10
10
|
import {
|
|
11
11
|
writeHuman
|
|
12
12
|
} from "./chunk-QCGNGEGE.js";
|
|
@@ -14,17 +14,200 @@ import {
|
|
|
14
14
|
xml
|
|
15
15
|
} from "./chunk-BL3WAGIK.js";
|
|
16
16
|
import {
|
|
17
|
+
CODEX_APP_LAUNCH_AT_LOGIN_VERB,
|
|
17
18
|
CODEX_APP_LAUNCH_VARIABLE
|
|
18
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-E46NE7FB.js";
|
|
19
20
|
import {
|
|
20
21
|
writeFileAtomic
|
|
21
22
|
} from "./chunk-AQFEP65J.js";
|
|
22
23
|
|
|
23
24
|
// src/codex-app-cards-switch.ts
|
|
24
|
-
import { execFileSync } from "child_process";
|
|
25
|
-
import { existsSync, mkdirSync, readFileSync, rmSync } from "fs";
|
|
25
|
+
import { execFileSync as execFileSync2 } from "child_process";
|
|
26
|
+
import { existsSync as existsSync2, mkdirSync, readFileSync, rmSync } from "fs";
|
|
27
|
+
import { homedir as homedir2 } from "os";
|
|
28
|
+
import { join as join2 } from "path";
|
|
29
|
+
|
|
30
|
+
// src/cli/mac-leftovers.ts
|
|
31
|
+
import { execSync, execFileSync } from "child_process";
|
|
32
|
+
import { existsSync, readdirSync } from "fs";
|
|
26
33
|
import { homedir } from "os";
|
|
27
|
-
import { join } from "path";
|
|
34
|
+
import { isAbsolute, join } from "path";
|
|
35
|
+
var MAC_APP_BUNDLE = "/Applications/Pushary.app";
|
|
36
|
+
var MAC_APP_BUNDLE_ID = "com.pushary.app";
|
|
37
|
+
var installedPusharyBundles = (home = homedir()) => [MAC_APP_BUNDLE, join(home, "Applications", "Pushary.app")];
|
|
38
|
+
var LSREGISTER = "/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister";
|
|
39
|
+
var TEST_DEFAULTS_PREFIXES = [
|
|
40
|
+
"com.pushary.mac.tests.",
|
|
41
|
+
"com.pushary.tests.",
|
|
42
|
+
"pushary.tests.",
|
|
43
|
+
"pushary.quiet-mode-test.",
|
|
44
|
+
"pushary.drafts.test.",
|
|
45
|
+
"pushary-optin-",
|
|
46
|
+
"pushary-completion-test-",
|
|
47
|
+
"pushary-updates-only-"
|
|
48
|
+
];
|
|
49
|
+
var UUID = "[0-9A-Fa-f]{8}(?:-[0-9A-Fa-f]{4}){3}-[0-9A-Fa-f]{12}";
|
|
50
|
+
var UNPREFIXED_TEST_DEFAULTS_DOMAIN = new RegExp(`^(?:owner-mode|fx-model)-${UUID}$`);
|
|
51
|
+
var DEVELOPER_BUILD_DEFAULTS_DOMAIN = "PusharyMac";
|
|
52
|
+
var isDeveloperDefaultsDomain = (domain) => domain === DEVELOPER_BUILD_DEFAULTS_DOMAIN || UNPREFIXED_TEST_DEFAULTS_DOMAIN.test(domain) || TEST_DEFAULTS_PREFIXES.some((prefix) => domain.startsWith(prefix));
|
|
53
|
+
var PREFERENCES_FILE_EXTENSION = ".plist";
|
|
54
|
+
var preferencesDirectory = (home) => join(home, "Library", "Preferences");
|
|
55
|
+
var preferencesFile = (home, domain) => join(preferencesDirectory(home), `${domain}${PREFERENCES_FILE_EXTENSION}`);
|
|
56
|
+
var namesIn = (directory) => {
|
|
57
|
+
try {
|
|
58
|
+
return readdirSync(directory);
|
|
59
|
+
} catch {
|
|
60
|
+
return [];
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
var developerDefaults = (home = homedir()) => namesIn(preferencesDirectory(home)).filter((name) => name.endsWith(PREFERENCES_FILE_EXTENSION)).map((name) => name.slice(0, -PREFERENCES_FILE_EXTENSION.length)).filter(isDeveloperDefaultsDomain).map((domain) => ({ domain, file: preferencesFile(home, domain) }));
|
|
64
|
+
var BUNDLE_NAME = "Pushary.app";
|
|
65
|
+
var DUMP_RECORD_SEPARATOR = /^-{20,}$/m;
|
|
66
|
+
var DUMP_PATH_LINES = /^[ \t]*path:[ \t]+(.+?)(?: \(0x[0-9a-f]+\))?[ \t]*$/gm;
|
|
67
|
+
var DUMP_IDENTIFIER_LINES = /^[ \t]*identifier:[ \t]+(\S+)/gm;
|
|
68
|
+
var capturedIn = (text, lines) => [...text.matchAll(lines)].flatMap((match) => match[1] === void 0 ? [] : [match[1]]);
|
|
69
|
+
var appCopyNamedByRecord = (record) => {
|
|
70
|
+
const paths = capturedIn(record, DUMP_PATH_LINES);
|
|
71
|
+
const identifiers = capturedIn(record, DUMP_IDENTIFIER_LINES);
|
|
72
|
+
const namesOneAppCopy = paths.length === 1 && identifiers.length === 1 && identifiers[0] === MAC_APP_BUNDLE_ID;
|
|
73
|
+
return namesOneAppCopy ? paths : [];
|
|
74
|
+
};
|
|
75
|
+
var isAtOrInside = (path, bundle) => path === bundle || path.startsWith(`${bundle}/`);
|
|
76
|
+
var isUnderBundleNamedPushary = (path) => path.split("/").includes(BUNDLE_NAME);
|
|
77
|
+
var bundlesInLaunchServicesDump = (dump) => {
|
|
78
|
+
const appCopies = dump.split(DUMP_RECORD_SEPARATOR).flatMap(appCopyNamedByRecord);
|
|
79
|
+
const isOurs = (path) => isUnderBundleNamedPushary(path) || appCopies.some((copy) => isAtOrInside(path, copy));
|
|
80
|
+
return [...new Set(capturedIn(dump, DUMP_PATH_LINES).filter(isOurs))];
|
|
81
|
+
};
|
|
82
|
+
var outsideInstalledBundles = (registered, installed) => registered.filter((path) => !installed.some((bundle) => isAtOrInside(path, bundle)));
|
|
83
|
+
var registeredPusharyBundles = (installed = installedPusharyBundles()) => {
|
|
84
|
+
if (!existsSync(LSREGISTER)) return [];
|
|
85
|
+
try {
|
|
86
|
+
const dump = execSync(`${LSREGISTER} -dump`, {
|
|
87
|
+
encoding: "utf-8",
|
|
88
|
+
timeout: 6e4,
|
|
89
|
+
maxBuffer: 256 * 1024 * 1024
|
|
90
|
+
});
|
|
91
|
+
return outsideInstalledBundles(bundlesInLaunchServicesDump(dump), installed);
|
|
92
|
+
} catch {
|
|
93
|
+
return [];
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
var MAC_KEYCHAIN_SERVICE = "com.pushary.app.mac";
|
|
97
|
+
var MAC_KEYCHAIN_ACCOUNTS = [
|
|
98
|
+
"pushary.site-api-key",
|
|
99
|
+
"pushary.site-id",
|
|
100
|
+
"pushary.partner-enrollments",
|
|
101
|
+
"pushary.partner-device-key",
|
|
102
|
+
"clerk.device-token",
|
|
103
|
+
"clerk.session-id",
|
|
104
|
+
"clerkDeviceToken",
|
|
105
|
+
"cachedClient",
|
|
106
|
+
"cachedClientServerDate",
|
|
107
|
+
"cachedEnvironment"
|
|
108
|
+
];
|
|
109
|
+
var MAC_DEFAULTS_DOMAINS = ["com.pushary.app", "pushary-bridge", "pushary.render"];
|
|
110
|
+
var PRESENCE_PROBE_TIMEOUT_MS = 1e4;
|
|
111
|
+
var commandSucceeds = (file, args) => {
|
|
112
|
+
try {
|
|
113
|
+
execFileSync(file, args, { stdio: "ignore", timeout: PRESENCE_PROBE_TIMEOUT_MS });
|
|
114
|
+
return true;
|
|
115
|
+
} catch {
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
var KEYCHAIN_ITEM_NOT_FOUND = 44;
|
|
120
|
+
var keychainItemMayExist = (service, account) => {
|
|
121
|
+
try {
|
|
122
|
+
execFileSync("security", ["find-generic-password", "-s", service, "-a", account], { stdio: "ignore" });
|
|
123
|
+
return true;
|
|
124
|
+
} catch (error) {
|
|
125
|
+
return !(error instanceof Error && "status" in error && error.status === KEYCHAIN_ITEM_NOT_FOUND);
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
var liveMacStatePresence = {
|
|
129
|
+
keychainItem: keychainItemMayExist,
|
|
130
|
+
defaultsDomain: (domain) => commandSucceeds("defaults", ["read", domain])
|
|
131
|
+
};
|
|
132
|
+
var macLibraryState = (home = homedir()) => [
|
|
133
|
+
join(home, "Library", "Application Support", "Pushary"),
|
|
134
|
+
join(home, "Library", "Caches", "com.pushary.app"),
|
|
135
|
+
join(home, "Library", "Caches", "com.pushary.app.sparkle"),
|
|
136
|
+
join(home, "Library", "Saved Application State", "com.pushary.app.savedState"),
|
|
137
|
+
join(home, "Library", "Caches", "pushary-bridge"),
|
|
138
|
+
join(home, "Library", "HTTPStorages", "com.pushary.app"),
|
|
139
|
+
join(home, "Library", "HTTPStorages", "com.pushary.app.binarycookies"),
|
|
140
|
+
join(home, "Library", "HTTPStorages", "pushary-bridge"),
|
|
141
|
+
...MAC_DEFAULTS_DOMAINS.map((domain) => preferencesFile(home, domain))
|
|
142
|
+
];
|
|
143
|
+
var USER_CACHE_ENTRIES = [MAC_APP_BUNDLE_ID, "pushary-bridge", "PusharyBridge"];
|
|
144
|
+
var macUserCacheState = (reportedUserCacheDirectory) => {
|
|
145
|
+
const directory = reportedUserCacheDirectory.trim();
|
|
146
|
+
return isAbsolute(directory) ? USER_CACHE_ENTRIES.map((entry) => join(directory, entry)) : [];
|
|
147
|
+
};
|
|
148
|
+
var UNKNOWN_USER_CACHE_DIRECTORY = "";
|
|
149
|
+
var reportedDarwinUserCacheDirectory = () => {
|
|
150
|
+
try {
|
|
151
|
+
return execFileSync("getconf", ["DARWIN_USER_CACHE_DIR"], {
|
|
152
|
+
encoding: "utf-8",
|
|
153
|
+
timeout: PRESENCE_PROBE_TIMEOUT_MS,
|
|
154
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
155
|
+
});
|
|
156
|
+
} catch {
|
|
157
|
+
return UNKNOWN_USER_CACHE_DIRECTORY;
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
var CRASH_REPORTER_ENTRY = new RegExp(`^(?:Pushary|PusharyMac|pushary-bridge)_${UUID}\\.plist$`);
|
|
161
|
+
var crashReporterEntries = (home = homedir()) => {
|
|
162
|
+
const directory = join(home, "Library", "Application Support", "CrashReporter");
|
|
163
|
+
return namesIn(directory).filter((name) => CRASH_REPORTER_ENTRY.test(name)).map((name) => join(directory, name));
|
|
164
|
+
};
|
|
165
|
+
var storedMacAppState = (home = homedir()) => [
|
|
166
|
+
...macLibraryState(home),
|
|
167
|
+
...macUserCacheState(reportedDarwinUserCacheDirectory()),
|
|
168
|
+
...crashReporterEntries(home)
|
|
169
|
+
];
|
|
170
|
+
var DUMP_SERVICE_LINE = /^\s*"svce"<blob>="(.+)"\s*$/;
|
|
171
|
+
var pusharyKeychainServices = (dump) => {
|
|
172
|
+
const found = /* @__PURE__ */ new Set();
|
|
173
|
+
for (const line of dump.split("\n")) {
|
|
174
|
+
const service = DUMP_SERVICE_LINE.exec(line)?.[1];
|
|
175
|
+
if (service?.startsWith(MAC_KEYCHAIN_SERVICE)) found.add(service);
|
|
176
|
+
}
|
|
177
|
+
return [...found];
|
|
178
|
+
};
|
|
179
|
+
var storedPusharyKeychainServices = () => {
|
|
180
|
+
const dump = execFileSync("security", ["dump-keychain"], {
|
|
181
|
+
encoding: "utf-8",
|
|
182
|
+
timeout: 3e4,
|
|
183
|
+
maxBuffer: 64 * 1024 * 1024,
|
|
184
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
185
|
+
});
|
|
186
|
+
const stored = pusharyKeychainServices(dump);
|
|
187
|
+
return stored.includes(MAC_KEYCHAIN_SERVICE) ? stored : [MAC_KEYCHAIN_SERVICE, ...stored];
|
|
188
|
+
};
|
|
189
|
+
var runningMacAppPIDs = () => {
|
|
190
|
+
if (process.platform !== "darwin") return [];
|
|
191
|
+
try {
|
|
192
|
+
return execSync('pgrep -f "Pushary.app/Contents/MacOS/Pushary"', {
|
|
193
|
+
encoding: "utf-8",
|
|
194
|
+
timeout: 1e4,
|
|
195
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
196
|
+
}).split("\n").map((line) => Number(line.trim())).filter((pid) => Number.isInteger(pid) && pid > 0);
|
|
197
|
+
} catch {
|
|
198
|
+
return [];
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
var waitForMacAppExit = (attempts = 20, everyMs = 250) => {
|
|
202
|
+
const idle = new Int32Array(new SharedArrayBuffer(4));
|
|
203
|
+
for (let attempt = 0; attempt < attempts; attempt++) {
|
|
204
|
+
if (runningMacAppPIDs().length === 0) return true;
|
|
205
|
+
Atomics.wait(idle, 0, 0, everyMs);
|
|
206
|
+
}
|
|
207
|
+
return runningMacAppPIDs().length === 0;
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
// src/codex-app-cards-switch.ts
|
|
28
211
|
var CODEX_APP_CARDS_LOGIN_ITEM = "com.pushary.codex-app-cards";
|
|
29
212
|
var CODEX_APP_CARDS_DIRECTORY = "codex-app";
|
|
30
213
|
var LAUNCHCTL = "/bin/launchctl";
|
|
@@ -39,15 +222,15 @@ var LOGIN_ITEM_MODE = 420;
|
|
|
39
222
|
var MAC_APP_HELPER = "/Contents/Helpers/pushary-native-transcripts";
|
|
40
223
|
var TEMPORARY_NPX_FOLDER = "/_npx/";
|
|
41
224
|
var codexAppCardsPaths = (homeDir, uid) => {
|
|
42
|
-
const launcherDirectory =
|
|
43
|
-
const loginItemDirectory =
|
|
225
|
+
const launcherDirectory = join2(homeDir, ".pushary", CODEX_APP_CARDS_DIRECTORY);
|
|
226
|
+
const loginItemDirectory = join2(homeDir, "Library", "LaunchAgents");
|
|
44
227
|
return {
|
|
45
228
|
launcherDirectory,
|
|
46
|
-
launcherPath:
|
|
47
|
-
receiptPath:
|
|
48
|
-
turnedOffPath:
|
|
229
|
+
launcherPath: join2(launcherDirectory, LAUNCHER_NAME),
|
|
230
|
+
receiptPath: join2(launcherDirectory, RECEIPT_NAME),
|
|
231
|
+
turnedOffPath: join2(launcherDirectory, TURNED_OFF_NAME),
|
|
49
232
|
loginItemDirectory,
|
|
50
|
-
loginItemPath:
|
|
233
|
+
loginItemPath: join2(loginItemDirectory, `${CODEX_APP_CARDS_LOGIN_ITEM}.plist`),
|
|
51
234
|
loginItemTarget: `gui/${uid}/${CODEX_APP_CARDS_LOGIN_ITEM}`
|
|
52
235
|
};
|
|
53
236
|
};
|
|
@@ -56,17 +239,23 @@ var codexAppCardsLoginScript = (launcherPath, engine, entry) => [
|
|
|
56
239
|
`&& [ -z "$(${LAUNCHCTL} getenv ${CODEX_APP_LAUNCH_VARIABLE})" ];`,
|
|
57
240
|
`then ${LAUNCHCTL} setenv ${CODEX_APP_LAUNCH_VARIABLE} ${shellQuoted(launcherPath)}; fi`
|
|
58
241
|
].join(" ");
|
|
242
|
+
var isTheMacAppsHelper = (entry) => entry.length > 0 && entry[0].endsWith(MAC_APP_HELPER);
|
|
243
|
+
var loginItemProgram = (launcherPath, engine, entry) => isTheMacAppsHelper(entry) ? [entry[0], CODEX_APP_LAUNCH_AT_LOGIN_VERB] : ["/bin/sh", "-c", codexAppCardsLoginScript(launcherPath, engine, entry)];
|
|
244
|
+
var LISTED_UNDER_THE_MAC_APP = ` <key>AssociatedBundleIdentifiers</key>
|
|
245
|
+
<array>
|
|
246
|
+
<string>${MAC_APP_BUNDLE_ID}</string>
|
|
247
|
+
</array>
|
|
248
|
+
`;
|
|
249
|
+
var propertyListString = (value) => ` <string>${xml(value)}</string>`;
|
|
59
250
|
var codexAppCardsLoginItem = (launcherPath, engine, entry) => `<?xml version="1.0" encoding="UTF-8"?>
|
|
60
251
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
61
252
|
<plist version="1.0">
|
|
62
253
|
<dict>
|
|
63
254
|
<key>Label</key>
|
|
64
255
|
<string>${CODEX_APP_CARDS_LOGIN_ITEM}</string>
|
|
65
|
-
<key>ProgramArguments</key>
|
|
256
|
+
${isTheMacAppsHelper(entry) ? LISTED_UNDER_THE_MAC_APP : ""} <key>ProgramArguments</key>
|
|
66
257
|
<array>
|
|
67
|
-
|
|
68
|
-
<string>-c</string>
|
|
69
|
-
<string>${xml(codexAppCardsLoginScript(launcherPath, engine, entry))}</string>
|
|
258
|
+
${loginItemProgram(launcherPath, engine, entry).map(propertyListString).join("\n")}
|
|
70
259
|
</array>
|
|
71
260
|
<key>RunAtLoad</key>
|
|
72
261
|
<true/>
|
|
@@ -128,6 +317,13 @@ var turnCodexAppCardsOn = (installation, machine) => {
|
|
|
128
317
|
machine.setLaunchVariable(paths.launcherPath);
|
|
129
318
|
return { kind: "on" };
|
|
130
319
|
};
|
|
320
|
+
var setCodexAppLaunchAtLogin = (paths, machine) => {
|
|
321
|
+
const isTurnedOn = machine.exists(paths.launcherPath) && machine.exists(paths.loginItemPath);
|
|
322
|
+
const cannotRun = whatTheLauncherCannotRun(codexAppCardsReceiptFrom(machine.readFile(paths.receiptPath)), machine);
|
|
323
|
+
if (!isTurnedOn || cannotRun !== null || machine.launchVariable().length > 0) return "left_as_it_is";
|
|
324
|
+
machine.setLaunchVariable(paths.launcherPath);
|
|
325
|
+
return "set";
|
|
326
|
+
};
|
|
131
327
|
var leaveOnlyThePathToTheEngine = (paths, machine) => {
|
|
132
328
|
const receipt = codexAppCardsReceiptFrom(machine.readFile(paths.receiptPath));
|
|
133
329
|
const launcher = machine.readFile(paths.launcherPath);
|
|
@@ -152,7 +348,6 @@ var rememberCodexAppCardsWereTurnedOff = (paths, machine) => {
|
|
|
152
348
|
machine.makeDirectory(paths.launcherDirectory, PRIVATE_DIRECTORY_MODE);
|
|
153
349
|
machine.writeFile(paths.turnedOffPath, "", PRIVATE_FILE_MODE);
|
|
154
350
|
};
|
|
155
|
-
var isTheMacAppsHelper = (entry) => entry.length > 0 && entry[0].endsWith(MAC_APP_HELPER);
|
|
156
351
|
var turnedOnByTheMacApp = (receipt) => receipt !== null && isTheMacAppsHelper(receipt.entry);
|
|
157
352
|
var codexAppCardsReport = (paths, machine) => ({
|
|
158
353
|
status: codexAppCardsStatus(paths, machine),
|
|
@@ -181,7 +376,7 @@ var removeCodexAppCards = (request, machine) => {
|
|
|
181
376
|
if (keepsTheOff) rememberCodexAppCardsWereTurnedOff(paths, machine);
|
|
182
377
|
return "removed";
|
|
183
378
|
};
|
|
184
|
-
var launchctl = (args) =>
|
|
379
|
+
var launchctl = (args) => execFileSync2(LAUNCHCTL, [...args], { encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] });
|
|
185
380
|
var launchctlIgnoringFailure = (args) => {
|
|
186
381
|
try {
|
|
187
382
|
return launchctl(args);
|
|
@@ -208,7 +403,7 @@ var thisMacsCodexAppCardsMachine = () => ({
|
|
|
208
403
|
unloadLoginItem: (target) => {
|
|
209
404
|
launchctlIgnoringFailure(["bootout", target]);
|
|
210
405
|
},
|
|
211
|
-
exists:
|
|
406
|
+
exists: existsSync2,
|
|
212
407
|
readFile: fileContents,
|
|
213
408
|
makeDirectory: (path, mode) => {
|
|
214
409
|
mkdirSync(path, { recursive: true, mode });
|
|
@@ -222,6 +417,11 @@ var thisMacsCodexAppCardsMachine = () => ({
|
|
|
222
417
|
});
|
|
223
418
|
var removeCodexAppCardsFromThisMac = (request) => removeCodexAppCards(request, thisMacsCodexAppCardsMachine());
|
|
224
419
|
var codexAppCardsFolderStaysOnThisMac = (request) => codexAppCardsFolderStays(request, thisMacsCodexAppCardsMachine());
|
|
420
|
+
var setCodexAppLaunchAtLoginOnThisMac = () => {
|
|
421
|
+
const uid = process.getuid?.();
|
|
422
|
+
if (uid === void 0) return;
|
|
423
|
+
setCodexAppLaunchAtLogin(codexAppCardsPaths(homedir2(), uid), thisMacsCodexAppCardsMachine());
|
|
424
|
+
};
|
|
225
425
|
var USAGE = "Usage: pushary codex --app-cards on [path/to/Codex.app] | off | status [--json]";
|
|
226
426
|
var AS_JSON = "--json";
|
|
227
427
|
var TAKES_EFFECT_AFTER_REOPENING = "Quit Codex and open it again.";
|
|
@@ -250,7 +450,7 @@ var codexAppCardsCommand = async (args, entry, readAccount, machine, say) => {
|
|
|
250
450
|
const [action, chosenApp, ...rest] = args;
|
|
251
451
|
const uid = process.getuid?.();
|
|
252
452
|
if (uid === void 0) throw new Error("Codex app cards need macOS");
|
|
253
|
-
const paths = codexAppCardsPaths(
|
|
453
|
+
const paths = codexAppCardsPaths(homedir2(), uid);
|
|
254
454
|
if (action === "status" && chosenApp === AS_JSON && rest.length === 0) {
|
|
255
455
|
say(JSON.stringify(codexAppCardsReport(paths, machine)));
|
|
256
456
|
return 0;
|
|
@@ -270,7 +470,7 @@ var codexAppCardsCommand = async (args, entry, readAccount, machine, say) => {
|
|
|
270
470
|
if (!await readAccount()) throw new Error("Connect Pushary before turning Codex app cards on");
|
|
271
471
|
const app = installedCodexApp(chosenApp);
|
|
272
472
|
const engine = await desktopEngine(app);
|
|
273
|
-
const turnedOn = turnCodexAppCardsOn(codexAppCardsInstallation({ homeDir:
|
|
473
|
+
const turnedOn = turnCodexAppCardsOn(codexAppCardsInstallation({ homeDir: homedir2(), uid, entry, app, engine }), machine);
|
|
274
474
|
if (turnedOn.kind === "another_program_owns_the_launch") {
|
|
275
475
|
say(ownedByAnotherProgram(turnedOn.value));
|
|
276
476
|
return 1;
|
|
@@ -288,6 +488,18 @@ var sayToThePerson = (line) => {
|
|
|
288
488
|
var codexAppCardsCommandOnThisMac = (args, entry, readAccount) => codexAppCardsCommand(args, entry, readAccount, thisMacsCodexAppCardsMachine(), sayToThePerson);
|
|
289
489
|
|
|
290
490
|
export {
|
|
491
|
+
MAC_APP_BUNDLE_ID,
|
|
492
|
+
installedPusharyBundles,
|
|
493
|
+
LSREGISTER,
|
|
494
|
+
developerDefaults,
|
|
495
|
+
registeredPusharyBundles,
|
|
496
|
+
MAC_KEYCHAIN_ACCOUNTS,
|
|
497
|
+
MAC_DEFAULTS_DOMAINS,
|
|
498
|
+
liveMacStatePresence,
|
|
499
|
+
storedMacAppState,
|
|
500
|
+
storedPusharyKeychainServices,
|
|
501
|
+
runningMacAppPIDs,
|
|
502
|
+
waitForMacAppExit,
|
|
291
503
|
CODEX_APP_CARDS_LOGIN_ITEM,
|
|
292
504
|
CODEX_APP_CARDS_DIRECTORY,
|
|
293
505
|
codexAppCardsPaths,
|
|
@@ -297,6 +509,7 @@ export {
|
|
|
297
509
|
codexAppCardsInstallation,
|
|
298
510
|
codexAppCardsStatus,
|
|
299
511
|
turnCodexAppCardsOn,
|
|
512
|
+
setCodexAppLaunchAtLogin,
|
|
300
513
|
turnCodexAppCardsOff,
|
|
301
514
|
rememberCodexAppCardsWereTurnedOff,
|
|
302
515
|
codexAppCardsReport,
|
|
@@ -304,6 +517,7 @@ export {
|
|
|
304
517
|
removeCodexAppCards,
|
|
305
518
|
removeCodexAppCardsFromThisMac,
|
|
306
519
|
codexAppCardsFolderStaysOnThisMac,
|
|
520
|
+
setCodexAppLaunchAtLoginOnThisMac,
|
|
307
521
|
runsFromATemporaryFolder,
|
|
308
522
|
codexAppCardsStatusLine,
|
|
309
523
|
codexAppCardsCommand,
|
|
@@ -17,16 +17,18 @@ import {
|
|
|
17
17
|
removeCodexAppCards,
|
|
18
18
|
removeCodexAppCardsFromThisMac,
|
|
19
19
|
runsFromATemporaryFolder,
|
|
20
|
+
setCodexAppLaunchAtLogin,
|
|
21
|
+
setCodexAppLaunchAtLoginOnThisMac,
|
|
20
22
|
turnCodexAppCardsOff,
|
|
21
23
|
turnCodexAppCardsOn
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import "./chunk-
|
|
24
|
+
} from "./chunk-ZWOWEXCV.js";
|
|
25
|
+
import "./chunk-T5L5NWT3.js";
|
|
24
26
|
import "./chunk-XCEN33UP.js";
|
|
25
27
|
import "./chunk-QCGNGEGE.js";
|
|
26
28
|
import "./chunk-BL3WAGIK.js";
|
|
27
29
|
import "./chunk-XHKBHWLX.js";
|
|
28
30
|
import "./chunk-VYBH6D4X.js";
|
|
29
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-E46NE7FB.js";
|
|
30
32
|
import "./chunk-T6RIKJUO.js";
|
|
31
33
|
import "./chunk-4QQEUJL4.js";
|
|
32
34
|
import "./chunk-OML4YFBN.js";
|
|
@@ -55,6 +57,8 @@ export {
|
|
|
55
57
|
removeCodexAppCards,
|
|
56
58
|
removeCodexAppCardsFromThisMac,
|
|
57
59
|
runsFromATemporaryFolder,
|
|
60
|
+
setCodexAppLaunchAtLogin,
|
|
61
|
+
setCodexAppLaunchAtLoginOnThisMac,
|
|
58
62
|
turnCodexAppCardsOff,
|
|
59
63
|
turnCodexAppCardsOn
|
|
60
64
|
};
|
|
@@ -10,11 +10,11 @@ import {
|
|
|
10
10
|
installedCodexApp,
|
|
11
11
|
shellQuoted,
|
|
12
12
|
writeDesktopProxy
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-T5L5NWT3.js";
|
|
14
14
|
import "./chunk-XCEN33UP.js";
|
|
15
15
|
import {
|
|
16
16
|
CODEX_APP_LAUNCH_VARIABLE
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-E46NE7FB.js";
|
|
18
18
|
export {
|
|
19
19
|
CODEX_APP_LAUNCH_VARIABLE,
|
|
20
20
|
codexAppOnThisMac,
|