@quantiya/codevibe-claude-plugin 2.0.75 → 2.0.76
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/.claude-plugin/plugin.json +1 -1
- package/node_modules/@quantiya/codevibe-core/dist/index.js +1 -1
- package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/cli.js +5 -0
- package/node_modules/@quantiya/codevibe-core/dist/substrate/sandbox-exec.d.ts +7 -0
- package/node_modules/@quantiya/codevibe-core/package.json +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codevibe-claude",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.76",
|
|
4
4
|
"description": "Sync Claude Code sessions with iOS mobile app via AWS backend. Control Claude Code from your phone with real-time bidirectional synchronization.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodeVibe Team"
|
|
@@ -5618,7 +5618,7 @@ server.listen(port, '127.0.0.1', () => {
|
|
|
5618
5618
|
});
|
|
5619
5619
|
`,eS="/codevibe/relay.js",tS="/codevibe/broker",rS="broker.sock",BA=`${tS}/${rS}`,Sh=8787});function $A(t){return`codevibe-substrate-${t}`}function QJ(t){let e=["env","-i"];for(let r of Object.keys(t).sort())e.push(`${r}=${t[r]}`);return e}function Pde(t){let e=`node ${eS} ${Sh} ${BA} & exec sleep infinity`;return[...QJ(t),"sh","-c",e]}function _de(t){let e=["docker","run","-d","--name",$A(t.id),"--network","none","-v",`${t.workdir}:${iS}`];e.push("-v",`${t.relayScriptPath}:${eS}:ro`),e.push("-v",`${t.udsDir}:${tS}:rw`),t.agentBootstrap&&e.push("-v",`${t.agentBootstrap.hostDir}:${t.agentBootstrap.sandboxDir}:ro`),t.agentConfig&&e.push("-v",`${t.agentConfig.hostDir}:${t.agentConfig.sandboxDir}:rw`);for(let r of Object.keys(t.sanitizedEnv).sort())e.push("-e",`${r}=${t.sanitizedEnv[r]}`);return e.push("-w",iS),e.push(t.image),e.push(...Pde(t.sanitizedEnv)),e}function xde(t,e,r,n){let i=["docker","exec"];return r&&i.push("-i"),i.push("-w",iS),i.push($A(t)),[...i,...QJ(n),...e]}function XJ(t){return["docker","kill",$A(t)]}function ZJ(t){return["docker","rm","-f",$A(t)]}function Cde(){return Date.now().toString(36)+"-"+Math.random().toString(36).slice(2,10)}var vh,YJ,nS,Tde,iS,XM,kh,GA=D(()=>{"use strict";vh=require("node:fs"),YJ=F(require("node:os")),nS=F(require("node:path"));Xb();CA();QM();FA();OA();Rr();Tde="codevibe/substrate:rung1",iS="/workspace";XM=class{constructor(e,r,n,i,o,s){this.id=e;this.runner=r;this.forwarder=n;this.sessionDir=i;this.sanitizedEnv=o;this.workdirLease=s;this.egressFidelity="strict";this.tornDown=!1}async exec(e,r){if(this.tornDown)throw new Kn("docker","exec after teardown");let n=xde(this.id,e,r.stdinTty,this.sanitizedEnv);return this.runner.spawnLong(n,{stdinTty:r.stdinTty,signal:r.signal})}async teardown(){this.tornDown||(this.tornDown=!0,await this.runner.run(XJ(this.id)).catch(()=>{}),await this.runner.run(ZJ(this.id)).catch(()=>{}),await this.forwarder.stop().catch(()=>{}),await this.workdirLease?.release().catch(()=>{}),await vh.promises.rm(this.sessionDir,{recursive:!0,force:!0}).catch(()=>{}))}},kh=class{constructor(e={}){this.runner=e.runner??new da,this.forwarderFactory=e.forwarderFactory??MA,this.onEgressDenied=e.onEgressDenied??bh,this.image=e.image??Tde,this.sessionRoot=e.sessionRoot??YJ.tmpdir(),this.acquireWorkdirLease=e.acquireWorkdirLease??aK}async launch(e){await this.assertDockerAvailable();let r=Cde(),n=null;e.workdirAuthority&&(await Me(e.workdir,e.workdirAuthority,"docker substrate lease acquisition"),n=await this.acquireWorkdirLease(e.workdirAuthority));let i=n?.procfsPath??e.workdir,o=nS.join(this.sessionRoot,`codevibe-substrate-${r}`),s=nS.join(o,"uds");try{await vh.promises.mkdir(o,{recursive:!0,mode:448}),await vh.promises.mkdir(s,{recursive:!0,mode:448})}catch(p){throw await this.rollback(o,null,n),new Kn("docker",`failed to create per-session dir: ${p.message}`,p)}let a=nS.join(s,rS),c=nS.join(o,"relay.js");try{await vh.promises.writeFile(c,LA,{encoding:"utf8",mode:384})}catch(p){throw await this.rollback(o,null,n),new Kn("docker",`failed to write in-container relay script: ${p.message}`,p)}let l=this.forwarderFactory({taskId:e.taskId,hostBrokerAddr:e.hostBrokerAddr,udsPath:a,onEgressDenied:this.onEgressDenied});try{await l.start()}catch(p){throw await this.rollback(o,null,n),new Kn("docker",`egress UDS relay failed to bind: ${p.message}`,p)}let d=_de({id:r,image:this.image,workdir:i,relayScriptPath:c,udsDir:s,sanitizedEnv:e.sanitizedEnv,agentBootstrap:e.agentBootstrap,agentConfig:e.agentConfig}),u;try{u=await this.runner.run(d)}catch(p){throw await this.rollback(o,l,n),new Kn("docker",`container run failed to spawn: ${p.message}`,p)}if(u.exitCode!==0)throw await this.rollback(o,l,n),new Kn("docker",`container run failed (exit ${u.exitCode}): ${u.stderr.trim()}`);if(e.workdirAuthority)try{await Me(e.workdir,e.workdirAuthority,"docker substrate handoff")}catch(p){throw await this.runner.run(XJ(r)).catch(()=>{}),await this.runner.run(ZJ(r)).catch(()=>{}),await this.rollback(o,l,n),p}return new XM(r,this.runner,l,o,e.sanitizedEnv,n)}async rollback(e,r,n=null){r&&await r.stop().catch(()=>{}),await n?.release().catch(()=>{}),await vh.promises.rm(e,{recursive:!0,force:!0}).catch(()=>{})}async assertDockerAvailable(){let e;try{e=await this.runner.run(["docker","version"],{timeoutMs:1e4})}catch(r){throw new kc("docker",`docker CLI not runnable: ${r.message}`,r)}if(e.exitCode!==0)throw new kc("docker",`docker not usable (exit ${e.exitCode}): ${e.stderr.trim()}`)}}});function Nde(t){let e=[],r=Xi.dirname(t);for(;;){e.push(r);let n=Xi.dirname(r);if(n===r)break;r=n}return e.reverse()}function Mde(t){let e=new Set(eY);if(!eY.some(n=>t===n||t.startsWith(n+"/"))){let n=(0,ZM.dirname)(t),i=(0,ZM.dirname)(n);i!=="/"&&i!=="."&&e.add(i),n!=="/"&&n!=="."&&e.add(n)}return[...e]}function tL(t,e=process.execPath,r=[],n=Qu.homedir(),i=null,o=[],s="loopback"){let a=m=>m.replace(/"/g,'\\"'),c=a(t),l=["(version 1)","(deny default)","(allow process-exec*)","(allow process-fork)","(allow signal (target self))","(allow file-read-metadata)",`(allow sysctl-read
|
|
5620
5620
|
${Dde.join(`
|
|
5621
|
-
`)})`,'(deny sysctl-read (sysctl-name-prefix "kern.proc"))',"(allow mach-lookup)",'(deny mach-lookup (global-name "com.apple.SecurityServer"))','(deny mach-lookup (global-name "com.apple.securityd"))','(deny mach-lookup (global-name "com.apple.securityd.xpc"))','(allow file-read* (subpath "/bin"))','(allow file-read* (subpath "/sbin"))','(allow file-read* (subpath "/usr"))','(allow file-read* (subpath "/System"))','(allow file-read* (subpath "/Library"))','(allow file-read* (subpath "/private/var/db"))','(allow file-read* (subpath "/private/var/select"))','(allow file-read* (subpath "/dev"))','(allow file-write* (literal "/dev/null"))'];for(let m of Mde(e))l.push(`(allow file-read* (subpath "${a(m)}"))`);let d=[c];for(let m of r)d.push(m);for(let m of o)d.push(m);for(let m of d)l.push(`(allow file-read* (subpath "${a(m)}"))`);l.push(`(allow file-write* (subpath "${c}"))`);for(let m of o)l.push(`(allow file-write* (subpath "${a(m)}"))`);let u=new Set;for(let m of d)for(let f of Nde(m))u.add(f);for(let m of u)l.push(`(allow file-read* (literal "${a(m)}"))`);l.push(`(deny file-read* (subpath "${c}/.git"))`,`(deny file-write* (subpath "${c}/.git"))`);let p=a(Xi.join(n,Ode));if(l.push(`(deny file-read* (subpath "${p}"))`,`(deny file-write* (subpath "${p}"))`),i!==null){let m=a(i);l.push(`(deny file-read* (subpath "${m}"))`,`(deny file-write* (subpath "${m}"))`)}return s==="open"?l.push("(deny network*)","(allow network-outbound)",""):l.push("(deny network*)",'(allow network-outbound (remote ip "localhost:*"))',""),l.join(`
|
|
5621
|
+
`)})`,'(deny sysctl-read (sysctl-name-prefix "kern.proc"))',"(allow mach-lookup)",'(deny mach-lookup (global-name "com.apple.SecurityServer"))','(deny mach-lookup (global-name "com.apple.securityd"))','(deny mach-lookup (global-name "com.apple.securityd.xpc"))','(allow ipc-posix-shm-read-data (ipc-posix-name-prefix "apple.cfprefs."))','(allow file-read* (subpath "/bin"))','(allow file-read* (subpath "/sbin"))','(allow file-read* (subpath "/usr"))','(allow file-read* (subpath "/System"))','(allow file-read* (subpath "/Library"))','(allow file-read* (subpath "/private/var/db"))','(allow file-read* (subpath "/private/var/select"))','(allow file-read* (subpath "/dev"))','(allow file-write* (literal "/dev/null"))'];for(let m of Mde(e))l.push(`(allow file-read* (subpath "${a(m)}"))`);let d=[c];for(let m of r)d.push(m);for(let m of o)d.push(m);for(let m of d)l.push(`(allow file-read* (subpath "${a(m)}"))`);l.push(`(allow file-write* (subpath "${c}"))`);for(let m of o)l.push(`(allow file-write* (subpath "${a(m)}"))`);let u=new Set;for(let m of d)for(let f of Nde(m))u.add(f);for(let m of u)l.push(`(allow file-read* (literal "${a(m)}"))`);l.push(`(deny file-read* (subpath "${c}/.git"))`,`(deny file-write* (subpath "${c}/.git"))`);let p=a(Xi.join(n,Ode));if(l.push(`(deny file-read* (subpath "${p}"))`,`(deny file-write* (subpath "${p}"))`),i!==null){let m=a(i);l.push(`(deny file-read* (subpath "${m}"))`,`(deny file-write* (subpath "${m}"))`)}return s==="open"?l.push("(deny network*)","(allow network-outbound)",""):l.push("(deny network*)",'(allow network-outbound (remote ip "localhost:*"))',""),l.join(`
|
|
5622
5622
|
`)}async function Lde(t){if(t.includes("/"))return t;let e=process.env.PATH??"";for(let r of e.split(":")){if(!r)continue;let n=Xi.join(r,t);try{return await Qi.promises.access(n,Qi.constants.X_OK),n}catch{}}return null}function Bde(){return Date.now().toString(36)+"-"+Math.random().toString(36).slice(2,10)}var Qi,Qu,Xi,ZM,eY,Ode,Dde,eL,Eh,rL=D(()=>{"use strict";Qi=require("node:fs"),Qu=F(require("node:os")),Xi=F(require("node:path"));Xb();ZM=require("node:path");CA();Rr();eY=["/opt/homebrew","/usr/local","/opt/local"],Ode=".codevibe",Dde=['(sysctl-name-prefix "hw.")','(sysctl-name "kern.ostype")','(sysctl-name "kern.osrelease")','(sysctl-name "kern.osversion")','(sysctl-name "kern.osproductversion")','(sysctl-name "kern.version")','(sysctl-name "kern.hostname")','(sysctl-name "kern.boottime")','(sysctl-name "kern.osvariant_status")','(sysctl-name "kern.maxfilesperproc")','(sysctl-name "kern.tcsm_available")','(sysctl-name "kern.tcsm_enable")','(sysctl-name "machdep.cpu.brand_string")','(sysctl-name "machdep.cpu.core_count")','(sysctl-name "machdep.cpu.thread_count")'];eL=class{constructor(e,r,n,i,o,s,a,c=null){this.id=e;this.runner=r;this.profilePath=n;this.sanitizedEnv=i;this.workdir=o;this.workdirAuthority=s;this.scratchAuthority=a;this.auditDir=c;this.egressFidelity="coarse";this.tornDown=!1;this.proc=null}async exec(e,r){if(this.tornDown)throw new Kn("sandbox_exec","exec after teardown");let n=await Lde(e[0]);if(n===null)throw new Kn("sandbox_exec",`agent binary '${e[0]}' not found on the host PATH \u2014 cannot exec in the sandbox`);let i=await Qi.promises.realpath(n).catch(()=>n),o=[Xi.join(Qu.homedir(),".codevibe"),Xi.join(this.workdir,".git"),...this.auditDir!==null?[this.auditDir]:[]],s=p=>o.some(m=>p===m||p.startsWith(m+Xi.sep)||m.startsWith(p+Xi.sep)),a=new Set(["/","/Users","/home",Qu.homedir()]),c=new Set([Xi.dirname(n),Xi.dirname(i)]);for(let p of c)if(s(p)||a.has(p))throw new Kn("sandbox_exec",`agent binary dir (${p}) overlaps a security-denied tree or is too broad \u2014 refusing to widen the profile`);let l=[...c].map(p=>`(allow file-read* (subpath ${JSON.stringify(p)}))`).join(`
|
|
5623
5623
|
`);await Qi.promises.appendFile(this.profilePath,`
|
|
5624
5624
|
; exec-time agent-binary read allowance (argv0 resolution, 2026-07-03)
|
|
@@ -58918,6 +58918,11 @@ function buildSeatbeltProfile(workdir, execPath = process.execPath, extraReadDir
|
|
|
58918
58918
|
'(deny mach-lookup (global-name "com.apple.SecurityServer"))',
|
|
58919
58919
|
'(deny mach-lookup (global-name "com.apple.securityd"))',
|
|
58920
58920
|
'(deny mach-lookup (global-name "com.apple.securityd.xpc"))',
|
|
58921
|
+
// POSIX shared memory: grant read-data on CoreFoundation preferences shared
|
|
58922
|
+
// memory published by cfprefsd (apple.cfprefs.<uid>v1, apple.cfprefs.daemonv1).
|
|
58923
|
+
// Without this, CFPreferencesAppSynchronize fails with EPERM, breaking native
|
|
58924
|
+
// macOS agents like Codex CLI during configuration/preference synchronization.
|
|
58925
|
+
'(allow ipc-posix-shm-read-data (ipc-posix-name-prefix "apple.cfprefs."))',
|
|
58921
58926
|
// The ANCESTOR DIR ENTRIES of the workdir — each as a `(literal ...)` read,
|
|
58922
58927
|
// NOT a subpath (Stage-2 HIGH — the `/private/tmp` narrowing). When node runs
|
|
58923
58928
|
// `node <workdir>/script.js`, `Module._findPath` → `realpathSync` `lstat`s
|
|
@@ -48,6 +48,13 @@ export interface SandboxExecDeps {
|
|
|
48
48
|
* path — on macOS `/tmp`→`/private/tmp`, and a
|
|
49
49
|
* non-canonical write rule silently fails to
|
|
50
50
|
* match. The caller canonicalizes before launch.
|
|
51
|
+
* `(allow ipc-posix-shm-read-data (ipc-posix-name-prefix "apple.cfprefs."))`
|
|
52
|
+
* — read-data on CoreFoundation preferences POSIX
|
|
53
|
+
* shared memory buffers mapped by cfprefsd
|
|
54
|
+
* (`apple.cfprefs.<uid>v1`, `apple.cfprefs.daemonv1`).
|
|
55
|
+
* Required for native macOS agents (e.g. Codex CLI)
|
|
56
|
+
* during CFPreferencesAppSynchronize; denies write
|
|
57
|
+
* and arbitrary shared memory segments.
|
|
51
58
|
* `(deny network*)` — deny all network…
|
|
52
59
|
* `(allow network-outbound (remote ip "localhost:*"))` — …except loopback.
|
|
53
60
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quantiya/codevibe-claude-plugin",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.76",
|
|
4
4
|
"description": "Control Claude Code from your iPhone and Android — real-time sync, approve file edits, send prompts by voice. Part of CodeVibe.",
|
|
5
5
|
"main": "dist/server.js",
|
|
6
6
|
"codevibe": {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"node": ">=22.0.0"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@quantiya/codevibe-core": "^2.0.
|
|
51
|
+
"@quantiya/codevibe-core": "^2.0.71",
|
|
52
52
|
"@quantiya/quorum-core": "^1.0.1",
|
|
53
53
|
"dotenv": "^16.6.1",
|
|
54
54
|
"express": "^5.1.0",
|