Lines 1-22javascript
2import { createRequire as __cr } from 'module'; const require = __cr(import.meta.url);
3import{spawn as fn,spawnSync as zr,execSync as Qr}from"node:child_process";import{fileURLToPath as dn}from"node:url";import{existsSync as mn}from"node:fs";import{resolve as Zr,dirname as eo,join as to}from"node:path";import{homedir as hn}from"node:os";import{join as te}from"node:path";import{randomBytes as wn}from"node:crypto";import{readFileSync as Sn,writeFileSync as Ge,mkdirSync as je,chmodSync as kn,existsSync as Fe}from"node:fs";var J=(process.env.SUPERCLAWD_BACKEND||"real").toLowerCase(),k=J==="mock",q=process.env.SUPERCLAWD_MCP_API_URL||"https://mcp-api.superclawd.com",ne=process.env.SU ...
4`,{mode:384});try{kn(ee,384)}catch{}}function Ye(){return b()?.preferences?.skipPermissions===!0}function En(){return b()?.preferences?.notifications===!0}function Be(){return b()?.preferences?.chooseWorkspaceAtStartup!==!1}function ke(e){let t=b()??{};G({...t,credentials:{...t.credentials,workspace:e}})}function oe(){let e=b();e?.credentials?.workspace&&G({...e,credentials:{...e.credentials,workspace:""}})}function He(){return b()?.preferences?.experimental===!0}function qe(){return b()?.preferences?.keepAwake===!0}function Je(){return b()?.preferences?.privateMemory!==!1}function Ve(){return ...
HighChild Process
Package source references child process execution.
dist/index.jsView on unpkg · L2 HighSame File Env Network Execution
A single source file combines environment access, network access, and code or shell execution; review context before blocking.
dist/index.jsView on unpkg · L2 5`)}catch{}}function ze(e,t,n=!1){Fe(Xe(e))||Cn(e,{notifications:n?!1:En(),...t?{workspace:t}:{}})}function Qe(){Fe(ee)||G({credentials:{keyId:"",secret:"",workspace:""},preferences:{notifications:!1
6`)};function Rn(){try{switch(process.platform){case"darwin":return ye("caffeinate",["-i","-w",String(process.pid)],{stdio:"ignore"});case"linux":return ye("systemd-inhibit",["--what=sleep:idle","--who=SuperClawd","--why=SuperClawd session running","--mode=block","cat"],{stdio:["pipe","ignore","ignore"]});case"win32":{let e=[`$p = Add-Type -MemberDefinition '[DllImport("kernel32.dll")] public static extern uint SetThreadExecutionState(uint e);' -Name P -Namespace W -PassThru;`,"$p::SetThreadExecutionState(0x80000000 -bor 0x00000001) | Out-Null;","[void][Console]::In.ReadToEnd();"].join(" ");ret ...
HighCommand Output Exfiltration
Source combines command execution, command-output handling, and outbound requests; review data flow before blocking.
dist/index.jsView on unpkg · L2 7`)}async function Re(e,t,n){let r=Pn.createInterface({input:process.stdin,output:process.stderr});try{process.stderr.write(`
HighSandbox Evasion Gated Capability
Source gates dangerous network, credential, or execution behavior behind CI, host, platform, time, or geo fingerprint checks.
dist/index.jsView on unpkg · L2 8${e} ${t} is outdated \u2014 ${n} is available.
9`);let o=(await r.question(" [U] Update now (default) [R] Run anyway > ")).trim().toLowerCase();return o==="r"||o==="run"?"run":"update"}finally{r.close()}}function Y(e,t){at(e,{notifiedAt:Date.now(),...t?{dismissed:t}:{}})}
10`);let s=rt("npm install -g superclawd@latest",{stdio:"inherit",shell:!0});if(s.status!==0)return process.stderr.write(`\u2717 Update failed (npm exited ${s.status??"?"}). Running ${e} for now.
11`),{};let i=rt("superclawd",t,{stdio:"inherit",env:{...process.env,SUPERCLAWD_UPDATED:"1"}});return i.error?(process.stderr.write(`\u2713 Updated to ${r}. Re-run your command.
12`),{exitCode:0}):{exitCode:i.status??0}}import{randomUUID as lt}from"node:crypto";function ut(e){let t={"content-type":"application/json","x-mcp-key-id":e.keyId,"x-mcp-secret":e.secret,"x-workspace-slug":e.workspace,"x-request-id":lt()};return process.env.SUPERCLAWD_EXPERIMENTAL==="true"&&(t["x-experimental"]="true"),t}async function se(e,t,n){let r=`${e.apiUrl}${t}`;if(n){let i=new URLSearchParams;for(let[l,c]of Object.entries(n))c!==void 0&&c!==""&&i.set(l,c);let a=i.toString();a&&(r+=(r.includes("?")?"&":"?")+a)}let o=await fetch(r,{headers:ut(e)}),s=await o.json().catch(()=>null);return{st ...
131. Tests pass and cover new behavior.
142. No secrets or debug logging left in.
153. Public APIs documented.
164. Changelog updated.`}],ht=[{name:"error-codes",description:"Canonical list of this platform's error codes.",content:`E1001 invalid_input
19E2001 upstream_unavailable`}];var wt=[{id:"workflow-deploy-001",name:"production-deploy",description:"deploying to production, cutting a release, or shipping to prod",itemCount:6,content:`Production deploy workflow:
201. Confirm CI is green on main.
212. Bump version + update changelog.
Long lines were clipped for display.