Lines 1-21javascript
1var Wn=Object.defineProperty;var E=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var qn=(t,e)=>{for(var r in e)Wn(t,r,{get:e[r],enumerable:!0})};import I from"node:fs/promises";import B from"node:path";async function pt(t){try{return await I.access(t),!0}catch{return!1}}async function D(t,e=""){try{return await I.readFile(t,"utf8")}catch(r){if(r?.code==="ENOENT")return e;throw r}}async function k(t,e){let r=await D(t,"");return r.trim()?JSON.parse(r):e}async function v(t,e){let r=`${t}.${process.pid}.tmp`;await I.writeFile(r,e,"utf8"),await I.rename(r,t)}asy ...
2`)}async function m(t){await I.mkdir(t,{recursive:!0})}async function dt(t,e,r={}){let n=await I.readdir(t,{withFileTypes:!0});for(let o of n){let a=B.join(t,o.name),s=B.join(e,o.name);if(o.isDirectory()){await m(s),await dt(a,s,r);continue}let c=B.relative(t,a).split(B.sep).join("/"),i=await pt(s);if(!(i&&r.preserveExisting?.includes(c))&&!(i&&!r.overwrite)&&!(i&&await zn(a,s))){if(i&&r.backupRoot){let l=B.join(r.relativeRoot||"",c),u=B.join(r.backupRoot,l);await m(B.dirname(u)),await I.copyFile(s,u)}await m(B.dirname(s)),await I.copyFile(a,s)}}}async function _r(t){try{return await I.readdir ...
4... [truncated ${r.length-e} chars] ...
6${r.slice(-n)}`}async function P(t,e,r={}){let{cwd:n=process.cwd(),input:o="",timeoutMs
7${t}`,T=Ft(e.loopType)||(/closed loop|目标完成后.*结束|完成后自动结束|达成.*停止/i.test(R)?"closed":"open");return{purpose:$e(i,260),outcome:$e(g,260),loopType:T==="closed"?"closed":"open",owner:Ft(e.owner)||"project-owner",inputs:u.slice(0,8),outputs:p.slice(0,8),steps:b,safety:y,currentUnderstanding:$e(Ce(n),300),maturity:Ft(e.maturity)||(b.length>=3?"sop":"exploration")}}function Br(t,e){let n=new RegExp(`^##\\s+${Hr(e)}\\s*$`,"mi").exec(t);if(!n)return"";let o=n.index+n[0].length,a=t.slice(o),s=a.search(/^##\s+/m);return(s>=0?a.slice(0,s):a).trim()}function ne(t,e){for(let r of e){let o=new RegExp(`^###\\s+ ...
8`).map(e=>/^\s*[-*+]\s+(.+)$/.exec(e)?.[1]).filter(Boolean).map(at)}function De(t){return String(t||"").split(`
9`).map(e=>/^\s*\d+[.)]\s+(.+)$/.exec(e)?.[1]).filter(Boolean).map(at)}function Vr(t){return/扫描|读取|收集|写入|写回|更新|同步|归档|执行命令|生成/.test(t)?"script":/(?:由|交给|等待)(?:用户|人工).*(?:审批|拍板|确认|决策|选择|补充)|(?:用户|人工).*(?:审批|拍板|确认|决策|选择|补充)|人工介入/.test(t)?"human":/验证|测试|校验|检查|证明|复核/.test(t)?"verify":"agent"}function Jr(t){if(t&&typeof t=="object"&&!Array.isArray(t)){let r=at(t.label||t.name||"");if(!r)return null;let n=["script","agent","human","verify"].includes(t.role)?t.role:Vr(r);return{label:r,role:n}}let e=at(t);return e?{label:e,role:Vr(e)}:null}function at(t){return String(t||"").replace(/`([^`]+)`/g,"$1"). ...
10`)})}async function Qo(t,e=We[t],r={}){if(!e)return null;let n=r.platform||process.platform,o={...process.env,...r.env||{}},a=r.pathModule||(n==="win32"?Wt.win32:Wt),s=a.delimiter,c=a.join(Me,"node_modules",".bin"),i={...o,PATH:[c,o.PATH].filter(Boolean).join(s)},l=process.env[`ASTRAWORKS_ACP_${String(t||"").toUpperCase()}_BIN`],u=l&&await ta(l)?l:await kt(Zo(t,e.command,{platform:n,env:o,pathModule:a}),{platform:n,env:i,pathModule:a,pathDelimiter:s});return u?{command:u,args:an(e.args)}:null}function an(t){return Array.isArray(t)?t.map(String):[]}async function Yo(t,e){let r=await k(ae,{});r[ ...
HighSame File Env Network Execution
A single source file combines environment access, network access, and code or shell execution; review context before blocking.
dist/install/runtime.mjsView on unpkg · L1 HighCommand Output Exfiltration
Source combines command execution, command-output handling, and outbound requests; review data flow before blocking.
dist/install/runtime.mjsView on unpkg · L1 HighSandbox Evasion Gated Capability
11${r.stderr||""}`;return r.code===0&&/(?:-p,\s*--print|--print\b)/.test(n)}async function oa(t,e=[["--version"],["-v"]]){for(let r of e){let n=await
12`),o=null;for(let a of n){let s=/^(\w[\w-]*)\s*:\s*(.*)$/.exec(a);if(s&&!a.startsWith(" ")&&!a.startsWith(" ")){o=s[1];let c=s[2].trim().replace(/^["']|["']$/g,"");c&&(e[o]=c)}else if(o&&/^\s+(\w[\w-]*)\s*:\s*(.*)$/.test(a)){let c=/^\s+(\w[\w-]*)\s*:\s*(.*)$/.exec(a);if(c){(!e[o]||typeof e[o]=="string")&&(e[o]={});let i=c[2].trim().replace(/^["']|["']$/g,"");i&&(e[o][c[1]]=i)}}}return e}function sa(t){if(t===!0||t==="true")return!0;if(t===!1||t==="false")return!1}async function ia(t,e={}){let r=F(e.projectRoot),n=re(r),o=await D(n.contentReadme(t));if(!o)throw new Error(`Loop
13`);return`${Rr}
CriticalAi Agent Control Hijack
Source creates an unconsented AI-agent control surface through install-time mutation or a default unauthenticated remote skill channel.
dist/install/runtime.mjsView on unpkg · L1 14## AstraWorks \u5DE5\u4F5C\u5F15\u64CE
16\u5F53\u524D\u76EE\u5F55\u662F\u4E00\u4E2A\u7531 AstraWorks \u7BA1\u7406\u7684\u4E1A\u52A1\u95ED\u73AF\u3002\u5728\u672C\u9879\u76EE\u5185\u5904\u7406\u4EFB\u4F55\u8BF7\u6C42\u65F6\uFF0C\u5FC5\u987B\u5148\u8FDB\u5165 AstraWorks \u9879\u76EE\u4E0A\u4E0B\u6587\uFF0C\u5E76\u9075\u5FAA\u672C\u8282\u5DE5\u4F5C\u534F\u8BAE\uFF1B\u4E0D\u80FD\u628A\u5DE5\u4F5C\u5F15\u64CE\u5F53\u4F5C\u53EF\u9009\u7684\u8BB0\u5F55\u5DE5\u5177\u3002
18### \u6BCF\u6B21\u5F00\u59CB\u5DE5\u4F5C
201. \u5B9A\u4F4D\u5305\u542B \`.astraworks/project.yaml\` \u7684\u9879\u76EE\u6839\u76EE\u5F55\uFF1B\u540E\u7EED Engine \u547D\u4EE4\u59CB\u7EC8\u663E\u5F0F\u4F20\u5165 \`--project <root>\`\u3002
212. \u8BFB\u53D6 \`.astraworks/project.yaml\` \u548C \`.astraworks/capabilities.json\`\uFF0C\u786E\u8BA4\u9879\u76EE\u8EAB\u4EFD\u3001\u5DF2\u542F\u7528 Agent\u3001Skill\u3001Loop \u4E0E\u80FD\u529B\u8FB9\u754C\u3002
Long lines were clipped for display.