Lines 271-311javascript
271`,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 ...
272`,this.pos);if(i!==-1){for(;i!==-1;){let s=this.continueScalar(i+1);if(s===-1)break;i=r.indexOf(`
273`,s)}i!==-1&&(n=i-(r[i-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.
274`:t=s,n=0;break;case"\r":{let a=this.buffer[s+1];if(!a&&!this.atEnd)return this.setNext("block-scalar"
275`)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?
276`,s)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let i=t+1
277`;)r=this.buffer[++i];t=i-1}else if(!this.blockScalarKeep)do{let s=t-1,a=this.buffer[s];a==="\r"&&
278`&&s>=this.pos&&s+1+n>o)t=s;else break}while(!0);return yield Rr.SCALAR,yield*this.pushToIndex(t
280`,s=this.buffer[r+1]):n=r),s==="#"||t&&ks.has(s))break;if(i===`
281`){let a=this.continueScalar(r+1);if(a===-1)break;r=Math.max(r,a-2)}}else{if(t&&ks.has(i))break;n
282`?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
283`?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)}};Lp.Lexer=jc});var Cc=k(Ip=>{"use strict";var $c=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) ...
284`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
285`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){let n=t.items[t.items.length-1];
286`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
287`,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 ...
291- Initial AstraWorks Agent definition.
292`),r}var Qe,vA,SA,Kp,kA,Is=S(()=>{Qe=Xn(xn(),1);Q();ue();D();Br();vA=["agents","docs","environments","evals",
294... [truncated ${n.length-t} chars] ...
296${n.slice(-r)}`}async function K(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=EA(e,t),f=_A(u.command,u.args,De({cwd:r,stdio:"pipe",env:{...process.env,...o}})),d="",p="",h=new Yp("utf8"),m=new Yp("utf8"),g=!1,b=null,w=null,A=()=>{f.kill("SIGTERM"),w=setTimeout(()=>f.kill("SIGKILL"),5e3)};c?.aborted?A():c?.addEventListener("abort",A,{once:!0}),s>0&&(b=setTimeout(()=>{g=!0,f.kill("SIGTERM"),setTimeout(()=>f.kill("SIGKILL"),5e3)},s)),f.stdout.on("data",_=>{d+=h.write(_),d.length>a*2&&(d=Xe(d,a*2))}),f.stderr.on("data ...
297${e}`,w=Wr(t.loopType)||(/closed loop|目标完成后.*结束|完成后自动结束|达成.*停止/i.test(b)?"closed":"open");return{purpose:Dc(c,260),outcome:Dc(g,260),loopType:w==="closed"?"closed":"open"
298`).map(t=>/^\s*[-*+]\s+(.+)$/.exec(t)?.[1]).filter(Boolean).map(Xt)}function xc(e){return String
299`).map(t=>/^\s*\d+[.)]\s+(.+)$/.exec(t)?.[1]).filter(Boolean).map(Xt)}function em(e){return
300`)})}async function UA(e,t=Fc[e],n={}){if(!t)return null;let r=n.platform||process.platform,i={...process.env,...n.env||{}},s=n.pathModule||(r==="win32"?zr.win32:zr),a=s.delimiter,o=s.join(Mc,"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 GA(l)?l:await Mn(zA(e,t.command,{platform:r,env:i,pathModule:s}),{platform:r,env:c,pathModule:s,pathDelimiter:a});return u?{command:u,args:cm(t.args)}:null}function cm(e){return Array.isArray(e)?e.map(String):[]}async function WA(e,t){let n=await C(xs,{});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 · L291 HighCommand Output Exfiltration
Source combines command execution, command-output handling, and outbound requests; review data flow before blocking.
dist/install/runtime.mjsView on unpkg · L291 301${n.stderr||""}`;return n.code===0&&/(?:-p,\s*--print|--print\b)/.test(r)}async function YA(e,t=[["--version"],["-v"]]){for(let n of t){let
302`),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 XA(e){if(e===!0||e==="true")return!0;if(e===!1||e==="false")return!1}async function ZA(e,t={}){let n=q(t.projectRoot),r=Ps(n),i=await N(r.contentReadme(e));if(!i)throw new Error(`Loop
309`),await Lt(P.join(r,"policies","governance.yaml"),`schema_version: 1
310engine_findings_create_todos: false
Long lines were clipped for display.