diff options
| author | t <t@tjp.lol> | 2026-12-05 11:13:09 -0700 |
|---|---|---|
| committer | t <t@tjp.lol> | 2026-12-05 11:13:44 -0700 |
| commit | 760cb2a9045e0c1cde276a6378841217e655fde3 (patch) | |
| tree | 7afc2e9874ad47122ed09850cb0ce108dc79faae | |
| parent | 0b5892bc31fb576099421ecddfbdc7a7b243d02d (diff) | |
Broaden platform support to Unix beyond macOS
Replace macOS-only underpinnings with portable Unix equivalents so the
provider runs on macOS, Linux, and FreeBSD:
- Replace /usr/bin/nc -U with an embedded panto lua + luv stdio-to-socket
relay everywhere.
- Conditionalize /usr/bin/codesign to macOS; validate binary ownership and
permissions on other Unix platforms.
- Forward D-Bus/XDG keyring session variables on non-macOS while keeping API
keys stripped.
- Use uv.os_tmpdir() (with /tmp fallback for Unix socket sun_path limits)
instead of hardcoded /tmp and /private/tmp.
- Drop --sandbox from agy invocations to match Panto's permissions model
and avoid container/Linuxulator sandbox breakage.
- Update check.lua for non-macOS runners (unshare / direct) and broaden
supported_platforms to unix.
| -rw-r--r-- | README.md | 6 | ||||
| -rw-r--r-- | TODOs.md | 12 | ||||
| -rw-r--r-- | _quota_selfcheck.lua | 2 | ||||
| -rw-r--r-- | acp.lua | 60 | ||||
| -rw-r--r-- | check.lua | 66 | ||||
| -rw-r--r-- | extensions/antigravity-acp.lua | 11 | ||||
| -rw-r--r-- | mise.toml | 2 | ||||
| -rw-r--r-- | panto-antigravity-0.1.0-1.rockspec | 2 | ||||
| -rw-r--r-- | quota.lua | 2 | ||||
| -rw-r--r-- | tests/fake-agy.lua | 8 |
10 files changed, 128 insertions, 43 deletions
@@ -1,5 +1,5 @@ # panto-antigravity -Use Gemini from Panto through Google's signed Antigravity CLI on macOS. The CLI handles sign-in; you don't need an API key or a separate Panto rig. +Use Gemini from Panto through Google's Antigravity CLI on macOS, Linux, and other Unix systems. The CLI handles sign-in; you don't need an API key or a separate Panto rig. ## Setup @@ -46,7 +46,7 @@ One shared row across aliases alongside Claude, Codex, Copilot and OpenCode Go. ## Login and diagnostics -`/antigravity-status` shows local connection state; `/antigravity-models` lists advertised families; for split ACP settings, levels are shown only for the selected model. Neither contacts Google. The isolated profile is `~/.local/share/panto-antigravity/google`. For native login once that directory exists: `agy acp --gemini-dir "$HOME/.local/share/panto-antigravity/google" --login`. Keep `HOME` unchanged so the CLI can find the macOS login Keychain. When upgrading from the prototype, update your extension path, protocol and model selection, then start a new thread. No credentials or old checkpoints are migrated automatically. +`/antigravity-status` shows local connection state; `/antigravity-models` lists advertised families; for split ACP settings, levels are shown only for the selected model. Neither contacts Google. The isolated profile is `~/.local/share/panto-antigravity/google`. For native login once that directory exists: `agy acp --gemini-dir "$HOME/.local/share/panto-antigravity/google" --login`. Keep `HOME` unchanged so the CLI can reach the OS keyring (macOS login Keychain, or Linux Secret Service over D-Bus via `DBUS_SESSION_BUS_ADDRESS` / `XDG_RUNTIME_DIR`). On macOS, `agy` is also verified with `/usr/bin/codesign` against Google's Apple Team ID; on other Unix platforms, the binary must be owned by you or root and not group/world writable. When upgrading from the prototype, update your extension path, protocol and model selection, then start a new thread. No credentials or old checkpoints are migrated automatically. ## Tool permissions @@ -69,7 +69,7 @@ Restart Panto after each config change and use a fresh thread in a disposable wo ### Approvals -Every ACP chat launch uses `--dangerously-skip-permissions` and `--sandbox`, even with `tools = []`. This skips agy's approvals for native tools as well as MCP tools. Use a trusted rig. The Panto tool allowlist still applies, and the separate read-only `/usage` query is unchanged. +Every ACP chat launch uses `--dangerously-skip-permissions` (without `--sandbox`), even with `tools = []`. This skips agy's approvals for native tools as well as MCP tools; Panto tools run with Panto's own permissions. Use a trusted rig. The Panto tool allowlist still applies, and the separate read-only `/usage` query is unchanged. ## Steering and thinking diff --git a/TODOs.md b/TODOs.md deleted file mode 100644 index ba98b6e..0000000 --- a/TODOs.md +++ /dev/null @@ -1,12 +0,0 @@ -# Project ideas - -## Broaden platform support beyond macOS - -- Today `panto-antigravity` hard-requires macOS: `acp.lua` asserts `uv.os_uname().sysname == 'Darwin'` in `executable()`, runs `/usr/bin/codesign` against Google's Apple developer signature in `verified()`, preserves `HOME` for the macOS login Keychain, and hardcodes `/usr/bin/nc -U` in `relay()`. `panto-antigravity-0.1.0-1.rockspec` sets `supported_platforms = { "macosx" }`, and `check.lua` runs inside `/usr/bin/sandbox-exec` using `/private/tmp`. -- Wanted: support Linux (and any other platforms `agy` officially ships on) without weakening the CLI verification or profile-isolation boundary. -- Open questions and work before expanding `supported_platforms`: - - Determine how `agy` is distributed and signed/verified on non-macOS platforms, and design the per-OS verification path in `acp.lua` (`verified()` / `executable()`). - - Replace the hardcoded `/usr/bin/nc -U` bridge in `relay()` with a portable Unix-socket stdio relay or detected platform command (`nc` paths and `-U` flags differ across Linux distros). - - Verify how `agy` stores and resolves credentials under `--gemini-dir` on Linux (keychain/keyring vs file-backed auth) and confirm `private_profile()` permission checks and `/tmp/panto-antigravity-*` lock/socket paths in `extensions/antigravity-acp.lua` work cleanly there. - - Add a non-macOS sandbox/runner path in `check.lua` (currently `/usr/bin/sandbox-exec`, `/private/tmp`, and `/usr/bin/codesign` stubbing) so `mise run check` can verify both platforms. - - Update `panto-antigravity-0.1.0-1.rockspec` (`supported_platforms`) and `README.md` (macOS-only setup and Keychain notes) once verified end to end. diff --git a/_quota_selfcheck.lua b/_quota_selfcheck.lua index 488f1d2..9e03f2a 100644 --- a/_quota_selfcheck.lua +++ b/_quota_selfcheck.lua @@ -40,7 +40,7 @@ local advance = 0 uv.hrtime = function() return hrtime() + advance end uv.spawn = function(bin, opts, callback) assert(bin == '/fake-agy' and opts.cwd == profile and opts.env == env and opts.detached) - assert(table.concat(opts.args, '|') == '--gemini_dir|/fake-profile|--sandbox|-p|/usage') + assert(table.concat(opts.args, '|') == '--gemini_dir|/fake-profile|-p|/usage') assert(opts.stdio[1] == nil and opts.stdio[2] and opts.stdio[3] == nil) spawns = spawns + 1 opts.cwd = '/' @@ -68,17 +68,33 @@ local function private_profile() local st=assert(uv.fs_lstat(dir)); assert(st.mode & 63==0 and uv.fs_access(dir,'W') and uv.fs_access(dir,'X'),'Google profile must be private and writable') return dir end +local is_macos = uv.os_uname().sysname == 'Darwin' +local panto = assert(uv.fs_realpath(uv.exepath())) local function executable() - assert(uv.os_uname().sysname=='Darwin','Google signature verification requires macOS') for dir in (os.getenv('PATH') or ''):gmatch('[^:]+') do - if dir:sub(1,1)=='/' and uv.fs_access(dir..'/agy','X') then return assert(uv.fs_realpath(dir..'/agy')) end + if dir:sub(1,1)=='/' and uv.fs_access(dir..'/agy','X') then + local bin = assert(uv.fs_realpath(dir..'/agy')) + if not is_macos then + local st = assert(uv.fs_stat(bin)) + local uid = uv.getuid() + assert(st.type=='file' and (st.uid==uid or st.uid==0) and st.mode & 18==0, + 'agy binary must be owned by you or root and not group/world writable') + end + return bin + end end error('agy is not on PATH') end +local env_keys = {'USER','PATH','TMPDIR','LANG'} +if not is_macos then + for _,k in ipairs({'DBUS_SESSION_BUS_ADDRESS','XDG_RUNTIME_DIR','GNOME_KEYRING_CONTROL','DISPLAY','WAYLAND_DISPLAY','XAUTHORITY'}) do + env_keys[#env_keys+1] = k + end +end -- The chat transport and the fixed read-only usage query share this trust boundary. -- Neither inherits API keys or a user's default CLI profile. local function verified(run, on_error) - local finished, checker, watchdog = false, nil, uv.new_timer() + local finished, checker, watchdog = false, nil, nil local function cancel() if finished then return end finished=true; close(watchdog) @@ -86,12 +102,18 @@ local function verified(run, on_error) end local ok,err=pcall(function() local bin,profile=executable(),private_profile() - -- Isolate CLI settings via --gemini-dir, not HOME: macOS needs the - -- user's home to find the default login Keychain. + -- Isolate CLI settings via --gemini-dir, not HOME: macOS needs HOME for + -- the login Keychain, and Unix keyrings also need D-Bus / XDG session vars. local env={'HOME='..assert(os.getenv('HOME'))} - for _,k in ipairs({'USER','PATH','TMPDIR','LANG'}) do + for _,k in ipairs(env_keys) do if os.getenv(k) then env[#env+1]=k..'='..os.getenv(k) end end + if not is_macos then + finished=true + local ran,why=pcall(run,bin,profile,env); if not ran then on_error(tostring(why)) end + return + end + watchdog=uv.new_timer() watchdog:start(15000,0,function() cancel(); on_error('Google CLI signature check timed out') end) checker=assert(uv.spawn('/usr/bin/codesign',{args={'--verify','--strict','-R=anchor apple generic and certificate leaf[subject.OU] = "EQHXZ8M8AV" and identifier "cli"',bin}},function(code,sig) close(checker); checker=nil; if finished then return end @@ -136,7 +158,29 @@ end -- agy discovers named agents under <gemini-dir>/config/agents. Declare the -- relay on the agent itself: session/new MCP servers need not be inherited by -- custom agents. Never edit the user's agents or global MCP configuration. -local function relay(s) return {name='pantograph',command='/usr/bin/nc',args={'-U',s.dir..'/mcp'},timeoutSeconds=1800} end +local relay_script = table.concat({ + "local uv=require('luv')", + "local function close(h) if h and not h:is_closing() then h:close() end end", + "local i,o,s=uv.new_pipe(false),uv.new_pipe(false),uv.new_pipe(false)", + "local n,eof=0,false", + "local function stop(c) close(i); close(s); close(o); if c then os.exit(c) end end", + "assert(i:open(0) and o:open(1))", + "s:connect(%q,function(err)", + "if err then stop(1); return end", + "i:read_start(function(e,d)", + "if e then stop(1) elseif not d then close(i); if not s:is_closing() then s:shutdown(function() end) end", + "elseif not s:is_closing() then s:write(d,function(w) if w then stop(1) end end) end", + "end)", + "s:read_start(function(e,d)", + "if e then stop(1) elseif not d then eof=true; close(i); close(s); if n==0 then close(o) end", + "elseif not o:is_closing() then n=n+1; o:write(d,function(w) n=n-1; if w then stop(1) elseif eof and n==0 then close(o) end end) end", + "end)", + "end)", + "uv.run()", +}, ' ') +local function relay(s) + return {name='pantograph',command=panto,args={'lua','-e',relay_script:format(s.dir..'/mcp')},timeoutSeconds=1800} +end local function install_agent(s, profile) local dir=profile for _,part in ipairs({'config','agents'}) do @@ -387,7 +431,7 @@ function M.launch(s, first, resume_id) cancel_check=verified(function(bin,profile,env) stdin,stdout=uv.new_pipe(false),uv.new_pipe(false) local agent=install_agent(s,profile) - local args={'acp','--agent',agent,'--include-default-customizations=false','--gemini-dir',profile,'--sandbox','--disable-telemetry','--dangerously-skip-permissions'} + local args={'acp','--agent',agent,'--include-default-customizations=false','--gemini-dir',profile,'--disable-telemetry','--dangerously-skip-permissions'} child,pid=uv.spawn(bin,{args=args,cwd=s.cwd,env=env,detached=true,stdio={stdin,stdout,nil}},function() close(child); child=nil; if closed then cleanup() else s.fail('Antigravity exited; not replaying') end end); if not child then local err=pid; pid=nil; error(tostring(err)) end; local buf='' @@ -1,7 +1,15 @@ --- macOS: run with `panto lua check.lua`. Use the same Panto binary for the TUI and fake agy. +-- Run with `panto lua check.lua`. Use the same Panto binary for the TUI and fake agy. local uv, json = require('luv'), require('panto').ext.json +local sysname = uv.os_uname().sysname +local is_macos = sysname == 'Darwin' local panto = assert(uv.fs_realpath(uv.exepath())) local root = assert(uv.fs_realpath(arg[0])):match('^(.*)/') +local function which(name) + for dir in (os.getenv('PATH') or '/usr/local/bin:/usr/bin:/bin'):gmatch('[^:]+') do + local p = dir .. '/' .. name + if dir:sub(1, 1) == '/' and uv.fs_access(p, 'X') then return assert(uv.fs_realpath(p)) end + end +end local function write(path, data) local f = assert(io.open(path, 'wb')); assert(f:write(data)); assert(f:close()) end @@ -19,7 +27,9 @@ local function run(bin, args, opts, timeout) end uv.run(); assert(not expired and signal == 0, bin .. ' timed out or was killed'); return code end -local home = assert(uv.fs_mkdtemp('/private/tmp/panto-agy-XXXXXX')) +local tmp = assert(uv.fs_realpath(uv.os_tmpdir() or '/tmp')):gsub('/+$', '') +if #tmp > 80 then tmp = assert(uv.fs_realpath('/tmp')):gsub('/+$', '') end +local home = assert(uv.fs_mkdtemp(tmp .. '/panto-agy-XXXXXX')) local function check() dofile(root..'/tests/lifecycle.lua') local acp_mod=dofile(root..'/acp.lua'); local usage=acp_mod.usage @@ -45,9 +55,34 @@ local function check() local by,one=catalog(req,{'not.offered','std.read'}); assert(#one==1 and one[1].name=='std__read' and by.std__read and not by.fixture__echo) local configure=dofile(root..'/extensions/antigravity-acp.lua').configure assert(not pcall(configure,{providers={antigravity={protocol='antigravity-acp',save_session=true}}})) + -- Exercise the non-macOS probe path (no codesign, binary mode check, keyring env forwarding). + local linux_home = assert(uv.fs_mkdtemp(home .. '/linux-XXXXXX')) + local linux_bin = linux_home .. '/agy'; write(linux_bin, '#!/bin/sh\n'); assert(uv.fs_chmod(linux_bin, 448)) + local real_uname, real_getenv = uv.os_uname, os.getenv + local fake_env = {HOME=linux_home, PATH=linux_home, DBUS_SESSION_BUS_ADDRESS='unix:path=/run/user/1/bus', + XDG_RUNTIME_DIR='/run/user/1', GEMINI_API_KEY='secret'} + uv.os_uname = function() return {sysname='Linux'} end + os.getenv = function(k) return fake_env[k] end + local ok_linux, err_linux = pcall(function() + local linux_acp = dofile(root..'/acp.lua') + local got_bin, got_env, got_err + linux_acp.probe(function(b, _, e) got_bin, got_env = b, e end, function(e) got_err = e end) + assert(not got_err and got_bin == linux_bin, got_err) + local joined = '\n' .. table.concat(got_env, '\n') .. '\n' + assert(joined:find('\nDBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1/bus\n', 1, true) + and joined:find('\nXDG_RUNTIME_DIR=/run/user/1\n', 1, true) + and not joined:find('GEMINI_API_KEY', 1, true), 'bad Linux probe env') + assert(uv.fs_chmod(linux_bin, 464)) -- 0720 group-writable must be rejected + got_bin, got_err = nil, nil + linux_acp.probe(function(b) got_bin = b end, function(e) got_err = e end) + assert(not got_bin and got_err and got_err:find('group/world writable', 1, true), 'writable binary allowed') + end) + uv.os_uname, os.getenv = real_uname, real_getenv + assert(ok_linux, err_linux) local cfg, data = home .. '/.panto', home .. '/.local/share/panto' assert(run('/bin/mkdir', {'-p', cfg .. '/extensions', data}) == 0) - assert(run('/bin/cp', {'-cR', assert(os.getenv('HOME')) .. '/.local/share/panto/rocks', data .. '/rocks'}) == 0) + local rocks = assert(os.getenv('HOME')) .. '/.local/share/panto/rocks' + if uv.fs_stat(rocks) then assert(run('/bin/cp', {'-R', rocks, data .. '/rocks'}) == 0) end local source = 'paths=[' .. json.encode(root .. '/extensions') .. ']' if os.getenv('PANTO_CHECK_ROCK') == '1' then assert(run('luarocks', {'--lua-version','5.4','--tree',data .. '/rocks/lua-5.4.7','make','--deps-mode=none'}, {cwd=root}) == 0) @@ -100,17 +135,28 @@ return {name='test.signature', activate=function() end} end} ]]) + local expect_bin = assert(which('expect'), 'expect is required for TUI check') local env = {'HOME=' .. home, 'QUOTA_LOG=' .. home .. '/screen', 'TMPDIR=' .. home, - 'TERM=xterm-256color', 'PATH=' .. home .. ':/usr/bin:/bin', 'PANTO=' .. panto} + 'TERM=xterm-256color', 'PATH=' .. home .. ':/usr/local/bin:/usr/bin:/bin', 'PANTO=' .. panto} local profile = [[(version 1)(allow default) (deny network-outbound (remote ip "*:*"))(deny network-bind (local ip "*:*")) (deny process-exec)(allow process-exec (literal (param "PANTO")) (literal (param "FAKE")) -(literal "/usr/bin/true") (literal "/usr/bin/false") (literal "/usr/bin/nc") -(literal "/usr/bin/expect") (literal "/bin/stty"))]] +(literal "/usr/bin/true") (literal "/usr/bin/false") +(literal (param "EXPECT")) (literal "/bin/stty"))]] + local unshare = sysname == 'Linux' and which('unshare') + if unshare and run(unshare, {'-c', '-n', '--', '/bin/true'}, {stdio={nil, nil, nil}}) ~= 0 then unshare = nil end local function sandbox(args, timeout, stdio) - local cmd = {'-D', 'PANTO=' .. panto, '-D', 'FAKE=' .. exe, '-p', profile} - for _, a in ipairs(args) do cmd[#cmd+1] = a end - return run('/usr/bin/sandbox-exec', cmd, {cwd=home, env=env, stdio=stdio}, timeout) + if is_macos then + local cmd = {'-D', 'PANTO=' .. panto, '-D', 'FAKE=' .. exe, '-D', 'EXPECT=' .. expect_bin, '-p', profile} + for _, a in ipairs(args) do cmd[#cmd+1] = a end + return run('/usr/bin/sandbox-exec', cmd, {cwd=home, env=env, stdio=stdio}, timeout) + elseif unshare then + local cmd = {'-c', '-n', '--'} + for _, a in ipairs(args) do cmd[#cmd+1] = a end + return run(unshare, cmd, {cwd=home, env=env, stdio=stdio}, timeout) + end + local cmd = {}; for i = 2, #args do cmd[#cmd+1] = args[i] end + return run(args[1], cmd, {cwd=home, env=env, stdio=stdio}, timeout) end local google = home .. '/.local/share/panto-antigravity/google' local function print_check(mode, args, input, diagnostic) @@ -137,7 +183,7 @@ end} assert(uv.fs_unlink(cfg..'/PROMPT.md')) print_check('diagnostic', {'--','diagnostic'}, '', true) assert(uv.fs_unlink(home..'/fixture-mode')) - local tui=sandbox({'/usr/bin/expect', root .. '/tests/tui.exp'}, 65000) + local tui=sandbox({expect_bin, root .. '/tests/tui.exp'}, 65000) if tui~=0 then error('TUI check failed: '..read(home..'/screen'):gsub('\27%[[0-9;?]*[A-Za-z]', ''):sub(-3500)) end assert(uv.fs_stat(home..'/thinking-rendered'),'ACP thought did not reach the native thinking component') local agents = assert(uv.fs_scandir(google .. '/config/agents')); assert(not uv.fs_scandir_next(agents), 'Generated agent left in private profile') diff --git a/extensions/antigravity-acp.lua b/extensions/antigravity-acp.lua index a8d2229..b728ad2 100644 --- a/extensions/antigravity-acp.lua +++ b/extensions/antigravity-acp.lua @@ -120,8 +120,15 @@ local function native_activity(s) s.card:invalidate() end end +local function tmpdir(max_len) + local base=(uv.os_tmpdir() or '/tmp'):gsub('/+$','') + if base=='' then base='/tmp' end + if max_len and #base>max_len then return '/tmp' end + return base +end local function start(pool,req,by,list,signature) - local dir=assert(uv.fs_mkdtemp('/tmp/panto-antigravity-XXXXXX')) + -- Unix domain socket paths are capped at 104 bytes on macOS/FreeBSD (108 on Linux). + local dir=assert(uv.fs_mkdtemp(tmpdir(70)..'/panto-antigravity-XXXXXX')) local s={pool=pool,sid=req.context,dir=dir,server=uv.new_pipe(false),by=by,list=list,seq=0,results={},notify=req.notify}; pool[s.sid]=s s.fail=function(msg) if pool[s.sid]~=s then return end @@ -136,7 +143,7 @@ local function start(pool,req,by,list,signature) local durable=pool==sessions and #s.sid<=64 and s.sid:match('^[%x-]+$') s.agent_key=durable and s.sid:lower() or dir:sub(-6):gsub('.',function(c) return ('%02x'):format(c:byte()) end) if durable then - local lock='/tmp/panto-antigravity-lock-'..uv.getuid()..'-'..s.agent_key + local lock=tmpdir()..'/panto-antigravity-lock-'..uv.getuid()..'-'..s.agent_key assert(uv.fs_mkdir(lock,448),'Saved thread locked: '..lock); s.lock=lock end assert(s.server:bind(dir..'/mcp')); assert(s.server:listen(1,function(err) @@ -1,5 +1,5 @@ [tasks.check] -description = "Offline Antigravity provider acceptance check (macOS, fake account and CLI)" +description = "Offline Antigravity provider acceptance check (fake account and CLI)" dir = "{{config_root}}" run = ''' set -eu diff --git a/panto-antigravity-0.1.0-1.rockspec b/panto-antigravity-0.1.0-1.rockspec index 57cbc4a..caf84a6 100644 --- a/panto-antigravity-0.1.0-1.rockspec +++ b/panto-antigravity-0.1.0-1.rockspec @@ -13,7 +13,7 @@ description = { license = "MIT", } -supported_platforms = { "macosx" } +supported_platforms = { "unix" } dependencies = { "lua >= 5.4, < 5.5" } build = { @@ -133,7 +133,7 @@ function M.activate(ext, footer, acp) -- Detached (no controlling tty) + closed input. The CLI's -- print-mode auth path returns without interactive login in this case. req.child, req.pid = uv.spawn(bin, { - args = {'--gemini_dir', profile, '--sandbox', '-p', '/usage'}, + args = {'--gemini_dir', profile, '-p', '/usage'}, cwd = profile, env = env, detached = true, stdio = {nil, req.stdout, nil}, }, function(code, sig) close(req.child); req.child, req.pid = nil, nil diff --git a/tests/fake-agy.lua b/tests/fake-agy.lua index e5e8e1f..339faad 100644 --- a/tests/fake-agy.lua +++ b/tests/fake-agy.lua @@ -8,7 +8,7 @@ end if arg[1] == '--version' then error('unexpected version check') end if arg[1] ~= 'acp' then assert(json.encode({table.unpack(arg)}) == json.encode({ - '--gemini_dir', profile, '--sandbox', '-p', '/usage', + '--gemini_dir', profile, '-p', '/usage', }), 'unrecognized fake CLI invocation') if uv.fs_stat(profile .. '/usage-failure') then os.exit(3) end assert(uv.cwd() == profile and uv.guess_handle(0) ~= 'tty') @@ -117,12 +117,12 @@ q = read() local setup, resumed = q.params, q.method == 'session/resume' assert(setup._meta.disableBuiltInTools == true) assert(arg[2]=='--agent' and arg[3]:match('^panto%-%x[%x-]+$') and arg[4]=='--include-default-customizations=false') -assert(arg[9]=='--dangerously-skip-permissions') -assert(arg[5]=='--gemini-dir' and arg[6]==profile) +assert(arg[5]=='--gemini-dir' and arg[6]==profile and arg[7]=='--disable-telemetry' and arg[8]=='--dangerously-skip-permissions' and #arg==8) local af=assert(io.open(profile..'/config/agents/'..arg[3]..'.md')); local agent=af:read('a'); af:close() for _,line in ipairs({'name: '..arg[3],'mainAgent: true','subagent: false','excludeDefaultComponents: true','inheritCustomizations: false','inheritMcp: false','tools: []'}) do assert(agent:find('\n'..line..'\n',1,true),line) end local servers=json.decode(assert(agent:match('\nmcpServers: ([^\n]+)'))) -if uv.fs_stat(profile..'/no-tools') then assert(#servers==0) else assert(#servers==1 and servers[1].name=='pantograph' and servers[1].command=='/usr/bin/nc') end +local panto=assert(uv.fs_realpath(uv.exepath())) +if uv.fs_stat(profile..'/no-tools') then assert(#servers==0) else assert(#servers==1 and servers[1].name=='pantograph' and servers[1].command==panto and servers[1].args[1]=='lua' and servers[1].args[2]=='-e') end assert(#setup.mcpServers==#servers) local server=setup.mcpServers[1] if server then |
