@machina.ai/cell-cli 1.51.0-rc2 → 1.54.4-rc2
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/dist/package.json +3 -3
- package/dist/src/acp/acpSession.js +6 -1
- package/dist/src/acp/acpSession.js.map +1 -1
- package/dist/src/acp/acpSession.test.js +22 -0
- package/dist/src/acp/acpSession.test.js.map +1 -1
- package/dist/src/config/config.js +9 -3
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/config.test.js +15 -2
- package/dist/src/config/config.test.js.map +1 -1
- package/dist/src/generated/git-commit.d.ts +2 -2
- package/dist/src/generated/git-commit.js +2 -2
- package/dist/src/nonInteractiveCli.js +27 -3
- package/dist/src/nonInteractiveCli.js.map +1 -1
- package/dist/src/nonInteractiveCli.test.js +48 -8
- package/dist/src/nonInteractiveCli.test.js.map +1 -1
- package/dist/src/nonInteractiveCliAgentSession.js +48 -5
- package/dist/src/nonInteractiveCliAgentSession.js.map +1 -1
- package/dist/src/nonInteractiveCliAgentSession.test.js +93 -1
- package/dist/src/nonInteractiveCliAgentSession.test.js.map +1 -1
- package/dist/src/ui/components/AsciiArt.d.ts +6 -6
- package/dist/src/ui/components/AsciiArt.js +6 -6
- package/dist/src/ui/components/ModelDialog.js +52 -11
- package/dist/src/ui/components/ModelDialog.js.map +1 -1
- package/dist/src/ui/components/ModelDialog.test.js +122 -66
- package/dist/src/ui/components/ModelDialog.test.js.map +1 -1
- package/dist/src/ui/contexts/SessionContext.js +12 -0
- package/dist/src/ui/contexts/SessionContext.js.map +1 -1
- package/dist/src/ui/hooks/useGeminiStream.js +81 -17
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
- package/dist/src/ui/hooks/useGeminiStream.test.js +218 -3
- package/dist/src/ui/hooks/useGeminiStream.test.js.map +1 -1
- package/dist/src/ui/hooks/usePrivacySettings.d.ts +7 -0
- package/dist/src/ui/hooks/usePrivacySettings.js +46 -3
- package/dist/src/ui/hooks/usePrivacySettings.js.map +1 -1
- package/dist/src/ui/hooks/usePrivacySettings.test.js +49 -4
- package/dist/src/ui/hooks/usePrivacySettings.test.js.map +1 -1
- package/dist/src/ui/hooks/useQuotaAndFallback.test.js +1 -1
- package/dist/src/ui/hooks/useQuotaAndFallback.test.js.map +1 -1
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.js +6 -1
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.js.map +1 -1
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.test.js +10 -0
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.test.js.map +1 -1
- package/dist/src/utils/handleAutoUpdate.test.js +2 -2
- package/dist/src/utils/sandbox-macos-permissive-open.sb +113 -4
- package/dist/src/utils/sandbox-macos-permissive-proxied.sb +111 -9
- package/dist/src/utils/sandbox-macos-profiles.test.d.ts +6 -0
- package/dist/src/utils/sandbox-macos-profiles.test.js +65 -0
- package/dist/src/utils/sandbox-macos-profiles.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
|
@@ -1,10 +1,76 @@
|
|
|
1
1
|
(version 1)
|
|
2
2
|
|
|
3
|
-
;;
|
|
4
|
-
|
|
3
|
+
;; permissive-proxied: uses (deny default) and explicitly allows the operations
|
|
4
|
+
;; the CLI needs, matching the restrictive-* / strict-* profiles. Keep the
|
|
5
|
+
;; allow-list minimal and reviewed; do not switch to (allow default).
|
|
6
|
+
;;
|
|
7
|
+
;; Keep the non-network rules in sync with sandbox-macos-permissive-open.sb:
|
|
8
|
+
;; the two profiles are intentionally identical except for their network rules
|
|
9
|
+
;; ("open" allows broad outbound; "proxied" routes outbound through the proxy).
|
|
10
|
+
(deny default)
|
|
5
11
|
|
|
6
|
-
;;
|
|
7
|
-
(
|
|
12
|
+
;; allow reading files from anywhere on host
|
|
13
|
+
(allow file-read*)
|
|
14
|
+
|
|
15
|
+
;; allow exec/fork (children inherit this policy, so they stay sandboxed)
|
|
16
|
+
(allow process-exec)
|
|
17
|
+
(allow process-fork)
|
|
18
|
+
|
|
19
|
+
;; allow signals to self, e.g. SIGPIPE on write to closed pipe
|
|
20
|
+
(allow signal (target self))
|
|
21
|
+
|
|
22
|
+
;; allow read access to specific information about system
|
|
23
|
+
;; from https://source.chromium.org/chromium/chromium/src/+/main:sandbox/policy/mac/common.sb;l=273-319;drc=7b3962fe2e5fc9e2ee58000dc8fbf3429d84d3bd
|
|
24
|
+
(allow sysctl-read
|
|
25
|
+
(sysctl-name "hw.activecpu")
|
|
26
|
+
(sysctl-name "hw.busfrequency_compat")
|
|
27
|
+
(sysctl-name "hw.byteorder")
|
|
28
|
+
(sysctl-name "hw.cacheconfig")
|
|
29
|
+
(sysctl-name "hw.cachelinesize_compat")
|
|
30
|
+
(sysctl-name "hw.cpufamily")
|
|
31
|
+
(sysctl-name "hw.cpufrequency_compat")
|
|
32
|
+
(sysctl-name "hw.cputype")
|
|
33
|
+
(sysctl-name "hw.l1dcachesize_compat")
|
|
34
|
+
(sysctl-name "hw.l1icachesize_compat")
|
|
35
|
+
(sysctl-name "hw.l2cachesize_compat")
|
|
36
|
+
(sysctl-name "hw.l3cachesize_compat")
|
|
37
|
+
(sysctl-name "hw.logicalcpu_max")
|
|
38
|
+
(sysctl-name "hw.machine")
|
|
39
|
+
(sysctl-name "hw.ncpu")
|
|
40
|
+
(sysctl-name "hw.nperflevels")
|
|
41
|
+
(sysctl-name "hw.optional.arm.FEAT_BF16")
|
|
42
|
+
(sysctl-name "hw.optional.arm.FEAT_DotProd")
|
|
43
|
+
(sysctl-name "hw.optional.arm.FEAT_FCMA")
|
|
44
|
+
(sysctl-name "hw.optional.arm.FEAT_FHM")
|
|
45
|
+
(sysctl-name "hw.optional.arm.FEAT_FP16")
|
|
46
|
+
(sysctl-name "hw.optional.arm.FEAT_I8MM")
|
|
47
|
+
(sysctl-name "hw.optional.arm.FEAT_JSCVT")
|
|
48
|
+
(sysctl-name "hw.optional.arm.FEAT_LSE")
|
|
49
|
+
(sysctl-name "hw.optional.arm.FEAT_RDM")
|
|
50
|
+
(sysctl-name "hw.optional.arm.FEAT_SHA512")
|
|
51
|
+
(sysctl-name "hw.optional.armv8_2_sha512")
|
|
52
|
+
(sysctl-name "hw.packages")
|
|
53
|
+
(sysctl-name "hw.pagesize_compat")
|
|
54
|
+
(sysctl-name "hw.physicalcpu_max")
|
|
55
|
+
(sysctl-name "hw.tbfrequency_compat")
|
|
56
|
+
(sysctl-name "hw.vectorunit")
|
|
57
|
+
(sysctl-name "kern.hostname")
|
|
58
|
+
(sysctl-name "kern.maxfilesperproc")
|
|
59
|
+
(sysctl-name "kern.osproductversion")
|
|
60
|
+
(sysctl-name "kern.osrelease")
|
|
61
|
+
(sysctl-name "kern.ostype")
|
|
62
|
+
(sysctl-name "kern.osvariant_status")
|
|
63
|
+
(sysctl-name "kern.osversion")
|
|
64
|
+
(sysctl-name "kern.secure_kernel")
|
|
65
|
+
(sysctl-name "kern.usrstack64")
|
|
66
|
+
(sysctl-name "kern.version")
|
|
67
|
+
(sysctl-name "sysctl.proc_cputype")
|
|
68
|
+
(sysctl-name-prefix "hw.perflevel")
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
;; allow writes only to specific paths (deny default already blocks the rest).
|
|
72
|
+
;; Mirrors permissive-open, including /dev/ptmx and the /dev/ttys regex needed
|
|
73
|
+
;; for PTY support under deny default.
|
|
8
74
|
(allow file-write*
|
|
9
75
|
(subpath (param "TARGET_DIR"))
|
|
10
76
|
(subpath (param "TMP_DIR"))
|
|
@@ -21,16 +87,52 @@
|
|
|
21
87
|
(literal "/dev/stdout")
|
|
22
88
|
(literal "/dev/stderr")
|
|
23
89
|
(literal "/dev/null")
|
|
90
|
+
(literal "/dev/ptmx")
|
|
91
|
+
(regex #"^/dev/ttys[0-9]*$")
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
;; allow the mach services normal workflows need under deny-default: sysmond for
|
|
95
|
+
;; process listing (pgrep), plus DNS resolution (mDNSResponder), directory
|
|
96
|
+
;; services (opendirectoryd), and certificate validation (trustd/ocspd).
|
|
97
|
+
;; This set mirrors the deny-default profile in
|
|
98
|
+
;; packages/core/src/sandbox/macos/baseProfile.ts (its NETWORK_SEATBELT_PROFILE),
|
|
99
|
+
;; which restrictive-proxied reaches only implicitly via (allow network-outbound).
|
|
100
|
+
;; Keep this allow-list minimal and reviewed.
|
|
101
|
+
(allow mach-lookup
|
|
102
|
+
(global-name "com.apple.sysmond")
|
|
103
|
+
(global-name "com.apple.system.opendirectoryd.libinfo")
|
|
104
|
+
(global-name "com.apple.system.opendirectoryd.membership")
|
|
105
|
+
(global-name "com.apple.bsd.dirhelper")
|
|
106
|
+
(global-name "com.apple.SecurityServer")
|
|
107
|
+
(global-name "com.apple.networkd")
|
|
108
|
+
(global-name "com.apple.ocspd")
|
|
109
|
+
(global-name "com.apple.trustd")
|
|
110
|
+
(global-name "com.apple.trustd.agent")
|
|
111
|
+
(global-name "com.apple.mDNSResponder")
|
|
112
|
+
(global-name "com.apple.mDNSResponderHelper")
|
|
113
|
+
(global-name "com.apple.SystemConfiguration.DNSConfiguration")
|
|
114
|
+
(global-name "com.apple.SystemConfiguration.configd")
|
|
24
115
|
)
|
|
25
116
|
|
|
26
|
-
;;
|
|
27
|
-
(
|
|
117
|
+
;; AF_SYSTEM socket used by the network stack (from baseProfile.ts)
|
|
118
|
+
(allow system-socket
|
|
119
|
+
(require-all
|
|
120
|
+
(socket-domain AF_SYSTEM)
|
|
121
|
+
(socket-protocol 2)
|
|
122
|
+
)
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
;; enable terminal access required by ink
|
|
126
|
+
;; fixes setRawMode EPERM failure (at node:tty:81:24)
|
|
127
|
+
(allow file-ioctl (regex #"^/dev/tty.*"))
|
|
128
|
+
|
|
129
|
+
;; allow inbound network traffic on debugger port
|
|
28
130
|
(allow network-inbound (local ip "localhost:9229"))
|
|
29
131
|
|
|
132
|
+
;; allow binding local ports (dev/test servers, OAuth localhost listeners)
|
|
133
|
+
(allow network-bind (local ip "*:*"))
|
|
134
|
+
|
|
30
135
|
;; deny all outbound network traffic EXCEPT through proxy on localhost:8877
|
|
31
136
|
;; set `CELL_SANDBOX_PROXY_COMMAND=<command>` to run proxy alongside sandbox
|
|
32
137
|
;; proxy must listen on :::8877 (see docs/examples/proxy-script.md)
|
|
33
|
-
(deny network-outbound)
|
|
34
138
|
(allow network-outbound (remote tcp "localhost:8877"))
|
|
35
|
-
|
|
36
|
-
(allow network-bind (local ip "*:*"))
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { describe, it, expect } from 'vitest';
|
|
7
|
+
import { readFileSync } from 'node:fs';
|
|
8
|
+
import { fileURLToPath } from 'node:url';
|
|
9
|
+
import path from 'node:path';
|
|
10
|
+
const utilsDir = path.dirname(fileURLToPath(import.meta.url));
|
|
11
|
+
/**
|
|
12
|
+
* Strip SBPL comments (`; ...` to end of line) so assertions run against the
|
|
13
|
+
* actual sandbox rules rather than any keywords that happen to appear in the
|
|
14
|
+
* explanatory comments.
|
|
15
|
+
*/
|
|
16
|
+
function readRules(profile) {
|
|
17
|
+
return readFileSync(path.join(utilsDir, profile), 'utf8')
|
|
18
|
+
.split('\n')
|
|
19
|
+
.map((line) => {
|
|
20
|
+
const commentStart = line.indexOf(';');
|
|
21
|
+
return commentStart === -1 ? line : line.slice(0, commentStart);
|
|
22
|
+
})
|
|
23
|
+
.join('\n');
|
|
24
|
+
}
|
|
25
|
+
const PERMISSIVE_PROFILES = [
|
|
26
|
+
'sandbox-macos-permissive-open.sb',
|
|
27
|
+
'sandbox-macos-permissive-proxied.sb',
|
|
28
|
+
];
|
|
29
|
+
// These two profiles are the default macOS Seatbelt profiles, so the invariants
|
|
30
|
+
// below must never silently regress. Keep them deny-default and confirm the
|
|
31
|
+
// reviewed allow-list stays in place.
|
|
32
|
+
describe('macOS permissive Seatbelt profiles', () => {
|
|
33
|
+
describe.each(PERMISSIVE_PROFILES)('%s', (profile) => {
|
|
34
|
+
const rules = readRules(profile);
|
|
35
|
+
it('uses a deny-default foundation', () => {
|
|
36
|
+
expect(rules).toContain('(deny default)');
|
|
37
|
+
});
|
|
38
|
+
it('does not use an allow-default foundation', () => {
|
|
39
|
+
expect(rules).not.toContain('(allow default)');
|
|
40
|
+
});
|
|
41
|
+
it('does not permit filesystem (un)mounts', () => {
|
|
42
|
+
expect(rules).not.toMatch(/file-mount/);
|
|
43
|
+
expect(rules).not.toMatch(/file-unmount/);
|
|
44
|
+
});
|
|
45
|
+
it('does not grant broad service lookups', () => {
|
|
46
|
+
expect(rules).not.toMatch(/launchd/);
|
|
47
|
+
expect(rules).not.toMatch(/launchservices/i);
|
|
48
|
+
});
|
|
49
|
+
it('allows binding local ports for dev/test servers', () => {
|
|
50
|
+
expect(rules).toContain('(allow network-bind (local ip "*:*"))');
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
it('permissive-open keeps broad inbound and outbound network', () => {
|
|
54
|
+
const rules = readRules('sandbox-macos-permissive-open.sb');
|
|
55
|
+
expect(rules).toContain('(allow network-inbound (local ip "*:*"))');
|
|
56
|
+
expect(rules).toMatch(/\(allow network-outbound\)/);
|
|
57
|
+
});
|
|
58
|
+
it('permissive-proxied confines outbound to the proxy', () => {
|
|
59
|
+
const rules = readRules('sandbox-macos-permissive-proxied.sb');
|
|
60
|
+
expect(rules).toContain('(allow network-outbound (remote tcp "localhost:8877"))');
|
|
61
|
+
// Proxied mode must never grant unrestricted outbound network.
|
|
62
|
+
expect(rules).not.toMatch(/\(allow network-outbound\)/);
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
//# sourceMappingURL=sandbox-macos-profiles.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandbox-macos-profiles.test.js","sourceRoot":"","sources":["../../../src/utils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