Lines 264-304javascript
264`,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yi ...
265`,this.pos);if(i!==-1){for(;i!==-1;){let s=this.continueScalar(i+1);if(s===-1)break;i=r.indexOf(`
266`,s)}i!==-1&&(n=i-(r[i-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.
267`:t=s,n=0;break;case"\r":{let a=this.buffer[s+1];if(!a&&!this.atEnd)return this.setNext("block-scalar"
268`)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?
269`,s)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let i=t+1
270`;)r=this.buffer[++i];t=i-1}else if(!this.blockScalarKeep)do{let s=t-1,a=this.buffer[s];a==="\r"&&
271`&&s>=this.pos&&s+1+n>o)t=s;else break}while(!0);return yield Pr.SCALAR,yield*this.pushToIndex(t
273`,s=this.buffer[r+1]):n=r),s==="#"||t&&hs.has(s))break;if(i===`
274`){let a=this.continueScalar(r+1);if(a===-1)break;r=Math.max(r,a-2)}}else{if(t&&hs.has(i))break;n
275`?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
276`?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||t&&r===" ");let i=n-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=n),i}*pushUntil(t){let n=this.pos,r=this.buffer[n];for(;!t(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};rp.Lexer=cc});var dc=A(ip=>{"use strict";var uc=class{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,r=this.lineStarts.length;for(;n<r;){let s=n+r>>1;this.lineStarts[s]<t?n=s+1:r=s}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0) ...
277`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
278`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){let n=t.items[t.items.length-1];
279`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
280`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start ...
284- Initial AstraWorks Agent definition.
285`),r}var it,hc,Lk,gp,Ik,Rr=k(()=>{it=Hn($n(),1);Y();pe();F();hc=["agents","docs","environments","evals","harness-profiles","hooks"
287... [truncated ${n.length-t} chars] ...
289${n.slice(-r)}`}async function G(e,t,n={}){let{cwd:r=process.cwd(),input:i="",timeoutMs:s=3e5,maxChars:a=8e4,env:o={},signal:c}=n;return new Promise(l=>{let u=Nk(e,t),f=xk(u.command,u.args,Oe({cwd:r,stdio:"pipe",env:{...process.env,...o}})),d="",p="",h=new Sp("utf8"),m=new Sp("utf8"),g=!1,v=null,y=null,S=()=>{f.kill("SIGTERM"),y=setTimeout(()=>f.kill("SIGKILL"),5e3)};c?.aborted?S():c?.addEventListener("abort",S,{once:!0}),s>0&&(v=setTimeout(()=>{g=!0,f.kill("SIGTERM"),setTimeout(()=>f.kill("SIGKILL"),5e3)},s)),f.stdout.on("data",_=>{d+=h.write(_),d.length>a*2&&(d=Ve(d,a*2))}),f.stderr.on("data ...
290${e}`,y=qr(t.loopType)||(/closed loop|目标完成后.*结束|完成后自动结束|达成.*停止/i.test(v)?"closed":"open");return{purpose:vc(c,260),outcome:vc(g,260),loopType:y==="closed"?"closed":"open"
291`).map(t=>/^\s*[-*+]\s+(.+)$/.exec(t)?.[1]).filter(Boolean).map(zt)}function bc(e){return String
292`).map(t=>/^\s*\d+[.)]\s+(.+)$/.exec(t)?.[1]).filter(Boolean).map(zt)}function Ep(e){return
293`)})}async function Xk(e,t=_c[e],n={}){if(!t)return null;let r=n.platform||process.platform,i={...process.env,...n.env||{}},s=n.pathModule||(r==="win32"?Fr.win32:Fr),a=s.delimiter,o=s.join(Ac,"node_modules",".bin"),c={...i,PATH:[o,i.PATH].filter(Boolean).join(a)},l=process.env[`ASTRAWORKS_ACP_${String(e||"").toUpperCase()}_BIN`],u=l&&await nA(l)?l:await Pn(tA(e,t.command,{platform:r,env:i,pathModule:s}),{platform:r,env:c,pathModule:s,pathDelimiter:a});return u?{command:u,args:Pp(t.args)}:null}function Pp(e){return Array.isArray(e)?e.map(String):[]}async function Zk(e,t){let n=await O(ks,{});n[ ...
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 · L284 HighCommand Output Exfiltration
Source combines command execution, command-output handling, and outbound requests; review data flow before blocking.
dist/install/runtime.mjsView on unpkg · L284 294${n.stderr||""}`;return n.code===0&&/(?:-p,\s*--print|--print\b)/.test(r)}async function aA(e,t=[["--version"],["-v"]]){for(let n of t){let
295`),i=null;for(let s of r){let a=/^(\w[\w-]*)\s*:\s*(.*)$/.exec(s);if(a&&!s.startsWith(" ")&&!s.startsWith(" ")){i=a[1];let o=a[2].trim().replace(/^["']|["']$/g,"");o&&(t[i]=o)}else if(i&&/^\s+(\w[\w-]*)\s*:\s*(.*)$/.test(s)){let o=/^\s+(\w[\w-]*)\s*:\s*(.*)$/.exec(s);if(o){(!t[i]||typeof t[i]=="string")&&(t[i]={});let c=o[2].trim().replace(/^["']|["']$/g,"");c&&(t[i][o[1]]=c)}}}return t}function cA(e){if(e===!0||e==="true")return!0;if(e===!1||e==="false")return!1}async function lA(e,t={}){let n=B(t.projectRoot),r=vs(n),i=await P(r.contentReadme(e));if(!i)throw new Error(`Loop
302`),await At(T.join(r,"policies","governance.yaml"),`schema_version: 1
303engine_findings_create_todos: false
Long lines were clipped for display.