troxy-cli 1.29.8 → 1.29.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/launchd.js +16 -6
- package/src/tests/launchd.test.js +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "troxy-cli",
|
|
3
|
-
"version": "1.29.
|
|
3
|
+
"version": "1.29.9",
|
|
4
4
|
"description": "A secure control layer for AI agents: policies across payments, messages, logins, destructive actions, model usage, and secrets, all enforceable from the CLI",
|
|
5
5
|
"homepage": "https://troxy.io",
|
|
6
6
|
"bugs": {
|
package/src/launchd.js
CHANGED
|
@@ -22,11 +22,21 @@
|
|
|
22
22
|
// bootstrap into their own domain the same way. Works correctly either
|
|
23
23
|
// way, unlike load/unload.
|
|
24
24
|
//
|
|
25
|
-
//
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
-
//
|
|
25
|
+
// gui/<uid>, NOT user/<uid> - corrected 2026-09-12 after shipping user/<uid>
|
|
26
|
+
// first and getting this wrong in practice: a real, normal (non-sudo)
|
|
27
|
+
// `troxy update` run then failed with "Bootstrap failed: 5: Input/output
|
|
28
|
+
// error" bootstrapping into user/501. `man launchctl` confirms why - gui
|
|
29
|
+
// and user are DISCRETE domains with their own separate sets of services
|
|
30
|
+
// (not two names for the same thing), and Apple's own canonical example in
|
|
31
|
+
// that same man page loads a per-user service into gui/<uid>, not
|
|
32
|
+
// user/<uid>. The original reasoning for user/<uid> (a server/VM might
|
|
33
|
+
// have no GUI login) doesn't actually apply here: this whole branch is
|
|
34
|
+
// darwin-only, and a Mac running Troxy for Claude Desktop already requires
|
|
35
|
+
// an active GUI session for Claude Desktop itself to run at all - the
|
|
36
|
+
// "headless Mac" case this was trying to additionally support isn't a
|
|
37
|
+
// real configuration for this specific daemon. Lesson: this got shipped
|
|
38
|
+
// on man-page reading plus reasoning about what SHOULD work, not on
|
|
39
|
+
// checking a real bootstrap call - the second attempt fixed that.
|
|
30
40
|
|
|
31
41
|
/**
|
|
32
42
|
* The launchd domain-target to bootstrap/bootout ai.troxy.mcp.plist into -
|
|
@@ -40,5 +50,5 @@
|
|
|
40
50
|
*/
|
|
41
51
|
export function launchdUserDomain(env = process.env, getuid = () => process.getuid?.()) {
|
|
42
52
|
const uid = env.SUDO_UID || String(getuid() ?? '');
|
|
43
|
-
return `
|
|
53
|
+
return `gui/${uid}`;
|
|
44
54
|
}
|
|
@@ -23,17 +23,17 @@ const uninstallSrc = readFileSync(join(__dirname, '..', 'uninstall.js'), 'utf8')
|
|
|
23
23
|
describe('launchdUserDomain', () => {
|
|
24
24
|
it('uses SUDO_UID when running under sudo, ignoring the elevated (root) uid', () => {
|
|
25
25
|
const domain = launchdUserDomain({ SUDO_UID: '501' }, () => 0);
|
|
26
|
-
assert.equal(domain, '
|
|
26
|
+
assert.equal(domain, 'gui/501');
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
it('falls back to the caller\'s own uid when not running under sudo', () => {
|
|
30
30
|
const domain = launchdUserDomain({}, () => 501);
|
|
31
|
-
assert.equal(domain, '
|
|
31
|
+
assert.equal(domain, 'gui/501');
|
|
32
32
|
});
|
|
33
33
|
|
|
34
34
|
it('prefers SUDO_UID even if somehow both are present', () => {
|
|
35
35
|
const domain = launchdUserDomain({ SUDO_UID: '501' }, () => 0);
|
|
36
|
-
assert.notEqual(domain, '
|
|
36
|
+
assert.notEqual(domain, 'gui/0');
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
it('never throws when getuid is unavailable (e.g. non-POSIX platform)', () => {
|