From 760cb2a9045e0c1cde276a6378841217e655fde3 Mon Sep 17 00:00:00 2001 From: t Date: Sat, 5 Dec 2026 11:13:09 -0700 Subject: 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. --- tests/fake-agy.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/fake-agy.lua') 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 -- cgit v1.3