@ironbee-ai/cli 0.31.0 → 0.33.0
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/CHANGELOG.md +8 -0
- package/dist/clients/base.js +1 -1
- package/dist/clients/claude/agents/ironbee-scenario.md +40 -11
- package/dist/clients/claude/agents/ironbee-verifier.md +40 -4
- package/dist/clients/claude/commands/ironbee-manage-scenario.md +2 -1
- package/dist/clients/claude/hooks/require-verdict.js +2 -2
- package/dist/clients/claude/hooks/require-verification.js +3 -3
- package/dist/clients/claude/hooks/track-action-monitor.js +1 -1
- package/dist/clients/claude/hooks/track-action.js +1 -1
- package/dist/clients/claude/index.js +4 -4
- package/dist/clients/claude/platforms/scenario.terminal.md +26 -0
- package/dist/clients/claude/platforms/skill.browser.md +1 -1
- package/dist/clients/claude/platforms/skill.terminal.md +62 -0
- package/dist/clients/codex/agents/ironbee-scenario.md +39 -10
- package/dist/clients/codex/agents/ironbee-verifier.md +39 -3
- package/dist/clients/codex/commands/ironbee-manage-scenario/SKILL.main.md +21 -6
- package/dist/clients/codex/commands/ironbee-manage-scenario/SKILL.md +2 -1
- package/dist/clients/codex/commands/ironbee-search-scenario/SKILL.main.md +3 -0
- package/dist/clients/codex/commands/ironbee-sync-scenario/SKILL.main.md +4 -1
- package/dist/clients/codex/commands/ironbee-verify/SKILL.main.md +4 -0
- package/dist/clients/codex/hooks/require-verification.js +1 -1
- package/dist/clients/codex/hooks/track-action.js +1 -1
- package/dist/clients/codex/index.js +2 -2
- package/dist/clients/codex/platforms/command-verify.terminal.md +61 -0
- package/dist/clients/codex/platforms/rule.terminal.md +31 -0
- package/dist/clients/codex/platforms/scenario.terminal.md +36 -0
- package/dist/clients/codex/platforms/skill.browser.md +1 -1
- package/dist/clients/codex/platforms/skill.terminal.md +57 -0
- package/dist/clients/codex/rules/ironbee-verification.main.md +3 -0
- package/dist/clients/codex/skills/ironbee-verification.main.md +14 -0
- package/dist/clients/codex/util.js +1 -1
- package/dist/clients/cursor/commands/ironbee-manage-scenario/SKILL.md +21 -6
- package/dist/clients/cursor/commands/ironbee-search-scenario/SKILL.md +3 -0
- package/dist/clients/cursor/commands/ironbee-sync-scenario/SKILL.md +4 -1
- package/dist/clients/cursor/commands/ironbee-verify/SKILL.md +4 -0
- package/dist/clients/cursor/hooks/require-verdict.js +2 -2
- package/dist/clients/cursor/hooks/require-verification.js +3 -3
- package/dist/clients/cursor/hooks/track-action-monitor.js +1 -1
- package/dist/clients/cursor/hooks/track-action.js +1 -1
- package/dist/clients/cursor/index.js +1 -1
- package/dist/clients/cursor/platforms/command-verify.terminal.md +61 -0
- package/dist/clients/cursor/platforms/rule.terminal.md +31 -0
- package/dist/clients/cursor/platforms/scenario.terminal.md +29 -0
- package/dist/clients/cursor/platforms/skill.browser.md +1 -1
- package/dist/clients/cursor/platforms/skill.terminal.md +54 -0
- package/dist/clients/cursor/rules/ironbee-verification.mdc +3 -0
- package/dist/clients/cursor/skills/ironbee-verification.md +14 -0
- package/dist/clients/registry.js +1 -1
- package/dist/commands/config.js +2 -2
- package/dist/commands/hook.js +22 -19
- package/dist/commands/install.js +1 -1
- package/dist/commands/platform-suggest.js +2 -0
- package/dist/commands/scenario.js +1 -1
- package/dist/commands/terminal.js +1 -0
- package/dist/hooks/core/actions.js +9 -7
- package/dist/hooks/core/run-checks.js +7 -0
- package/dist/hooks/core/verification-context.js +19 -15
- package/dist/hooks/core/verify-gate.js +35 -21
- package/dist/import/claude/events/tool-call.js +1 -1
- package/dist/import/codex/events/tool-call.js +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/config.js +1 -1
- package/dist/lib/event.js +1 -1
- package/dist/lib/headless.js +1 -0
- package/dist/lib/install-version.js +1 -1
- package/dist/lib/platform-section.js +5 -4
- package/dist/lib/prompt.js +6 -5
- package/dist/lib/scenario-staleness.js +1 -1
- package/dist/tui/config/schema.js +1 -1
- package/dist/tui/platforms/area.js +2 -2
- package/dist/tui/projects/area.js +4 -4
- package/dist/tui/shell/session.js +5 -5
- package/package.json +1 -1
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
"use strict";var y=Object.defineProperty;var
|
|
2
|
-
`,
|
|
3
|
-
`,
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";var y=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var Q=Object.prototype.hasOwnProperty;var l=(t,e)=>y(t,"name",{value:e,configurable:!0});var Y=(t,e)=>{for(var r in e)y(t,r,{get:e[r],enumerable:!0})},Z=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of K(e))!Q.call(t,n)&&n!==r&&y(t,n,{get:()=>e[n],enumerable:!(i=q(e,n))||i.enumerable});return t};var tt=t=>Z(y({},"__esModule",{value:!0}),t);var at={};Y(at,{VERIFICATION_DOC_DIR:()=>x,VERIFICATION_DOC_FILE:()=>I,buildVerificationContext:()=>H,buildVerificationContextForSession:()=>U,buildVerificationContextOnceForCycle:()=>lt,collectChangedPaths:()=>_,renderChangedPathsBlock:()=>L,renderMessageBlock:()=>G,resolveContextFiles:()=>j,resolveVerificationMessage:()=>W});module.exports=tt(at);var b=require("fs"),w=require("os"),s=require("path"),P=require("../../lib/runtime-paths"),u=require("../../lib/config"),N=require("../../lib/git"),m=require("../../lib/logger"),E=require("./session-state"),M=require("./actions");const x=".ironbee",I="VERIFICATION.md",nt=`===== IRONBEE \u2014 PROJECT VERIFICATION INSTRUCTIONS (path-scoped) =====
|
|
2
|
+
`,et=`The following areas changed this cycle. Follow this guidance IN ADDITION to the standard verification flow.
|
|
3
|
+
`,S=`====================================================================
|
|
4
|
+
`,rt=`===== IRONBEE \u2014 PROJECT VERIFICATION INSTRUCTIONS (always-on) =====
|
|
5
|
+
`,O=64*1024;function $(t){return Buffer.byteLength(t,"utf-8")}l($,"byteLen");function it(t){try{return(0,b.realpathSync)(t)}catch{return(0,s.resolve)(t)}}l(it,"canonicalDir");function st(t){const e=(0,s.resolve)(t),r=[];let i=e;for(;;)try{const n=(0,b.realpathSync)(i);return r.length>0?(0,s.join)(n,...r):n}catch{const n=(0,s.dirname)(i);if(n===i)return e;r.unshift((0,s.basename)(i)),i=n}}l(st,"canonicalizePath");function ot(t,e){const r=(0,s.relative)(t,e);return r.length>0&&!r.startsWith("..")&&!(0,s.isAbsolute)(r)}l(ot,"isUnderDir");function T(t){try{return(0,M.getFileChangesSinceLastVerification)(t).map(e=>e.file_path).filter(e=>typeof e=="string"&&e.length>0)}catch(e){return m.logger.debug(`verification-context: actions fallback failed: ${e instanceof Error?e.message:e}`),[]}}l(T,"changedFromActions");function _(t,e,r){let i;if(r.source==="actions")i=T(e);else{const o=(0,N.getChangedPaths)(t,r.commitDepth);i=o===null?T(e):o}const n=new Set;for(const o of i){const g=st((0,s.isAbsolute)(o)?o:(0,s.resolve)(t,o)),c=(0,s.relative)(t,g);c.length===0||c.startsWith("..")||(0,s.isAbsolute)(c)||c.split(s.sep).includes(x)||n.add(g)}return[...n]}l(_,"collectChangedPaths");function j(t,e){const r=new Map;for(const i of e){let n=(0,s.dirname)(i);if(!(n!==t&&!ot(t,n)))for(;;){const o=(0,s.join)(n,x,I);if(!r.has(o)&&(0,b.existsSync)(o))try{const c=(0,b.readFileSync)(o,"utf-8"),f=(0,s.relative)(t,n),h=f.length===0?"":f.split(s.sep).join("/"),d=h.length===0?0:h.split("/").length;r.set(o,{absPath:o,relDir:h,depth:d,content:c})}catch(c){m.logger.debug(`verification-context: failed to read ${o}: ${c instanceof Error?c.message:c}`)}if(n===t)break;const g=(0,s.dirname)(n);if(g===n)break;n=g}}return[...r.values()].sort((i,n)=>i.depth-n.depth||i.relDir.localeCompare(n.relDir))}l(j,"resolveContextFiles");function ct(t){return t.relDir.length===0?{label:"(repo root)",path:`${x}/${I}`}:{label:`${t.relDir}/`,path:`${t.relDir}/${x}/${I}`}}l(ct,"provenance");function V(t){const e=ct(t);return`
|
|
6
|
+
## ${e.label} \u2014 ${e.path}
|
|
6
7
|
${t.content.trimEnd()}
|
|
7
|
-
`}
|
|
8
|
-
- \u2026 +${
|
|
9
|
-
## Changed files this cycle (${
|
|
10
|
-
${
|
|
11
|
-
`)}${
|
|
12
|
-
`}
|
|
13
|
-
|
|
14
|
-
`)
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
`}l(V,"renderBlock");const F=100;function L(t,e){if(e.length===0)return"";const r=e.map(o=>(0,s.relative)(t,o).split(s.sep).join("/")).sort(),i=r.slice(0,F),n=r.length>F?`
|
|
9
|
+
- \u2026 +${r.length-F} more`:"";return`
|
|
10
|
+
## Changed files this cycle (${r.length})
|
|
11
|
+
${i.map(o=>`- ${o}`).join(`
|
|
12
|
+
`)}${n}
|
|
13
|
+
`}l(L,"renderChangedPathsBlock");function W(t,e){const r=t.trim();if(r.length===0)return"";const i="file:";if(!r.startsWith(i))return r;let n=r.slice(i.length).trim();if(n.length===0)return"";(n==="~"||n.startsWith("~/")||n.startsWith("~\\"))&&(n=(0,s.join)((0,w.homedir)(),n.slice(1).replace(/^[/\\]+/,"")));const o=(0,s.isAbsolute)(n)?n:(0,s.resolve)(e,n);try{const g=(0,b.readFileSync)(o,"utf-8"),c=Buffer.from(g,"utf-8");if(c.length>O){let f=O;for(;f>0&&(c[f]&192)===128;)f--;return`${c.subarray(0,f).toString("utf-8")}
|
|
14
|
+
... (truncated, message file exceeds ${O} bytes)
|
|
15
|
+
`}return g.trimEnd()}catch(g){return m.logger.debug(`verification-context: failed to read message file ${o}: ${g instanceof Error?g.message:g}`),""}}l(W,"resolveVerificationMessage");function G(t){return`${rt}${t.trimEnd()}
|
|
16
|
+
${S}`}l(G,"renderMessageBlock");function H(t,e){const r=e.changedPathsBlock??"";if(t.length===0&&r.length===0)return"";const i=[...t].sort((a,D)=>a.depth-D.depth||a.relDir.localeCompare(D.relDir)),n=nt+et+r,o=Math.max(0,e.maxBytes-$(n)-$(S)),g=[];let c=0;for(let a=i.length-1;a>=0;a--){const D=V(i[a]),C=$(D);if(c+C<=o)g.push(i[a]),c+=C;else if(g.length===0){const v=gt(i[a],o);g.push(v);break}else break}const f=g.reverse(),h=i.length-f.length,d=[n];for(const a of f)d.push(V(a));return h>0&&d.push(`
|
|
17
|
+
[${h} less-specific VERIFICATION.md file(s) omitted to fit the ${e.maxBytes}-byte cap]
|
|
18
|
+
`),d.push(S),d.join("")}l(H,"buildVerificationContext");function gt(t,e){const r=`
|
|
19
|
+
... (truncated)`,i=V({...t,content:""}),n=Math.max(0,e-$(i)-$(r)),o=Buffer.from(t.content,"utf-8").subarray(0,n).toString("utf-8");return{...t,content:o+r}}l(gt,"hardTruncate");function U(t,e,r){if(!(0,u.getVerificationContextEnabled)(r))return"";try{const i=it(t),n=(0,s.join)((0,P.sessionDir)(i,e),"actions.jsonl"),o=(0,u.getVerificationContextSource)(r),g=_(i,n,{source:o,commitDepth:(0,u.getVerificationContextCommitDepth)(r)}),c=g.filter(p=>!(0,u.isIgnoredVerifyPath)(r,p)),f=g.length-c.length,h=new Set;for(const p of c){const R=(0,s.relative)(i,(0,s.dirname)(p)).split(s.sep).join("/");h.add(R.length===0?"(root)":R)}const d=[...h].sort(),a=50,D=d.slice(0,a),C=d.length>a?` [+${d.length-a} more]`:"";m.logger.debug(`verification-context: source=${o} changed in ${d.length} dir(s)`+(f>0?` (${f} ignored)`:"")+`: ${D.join(", ")}${C}`);const v=j(i,c);for(const p of v){const R=p.relDir.length>0?`${p.relDir}/${x}/${I}`:`${x}/${I}`,B=p.content.replace(/\s+/g," ").trim(),X=B.length>100?`${B.slice(0,100)}...`:B;m.logger.debug(`verification-context: \u2022 ${R} \u2014 ${$(p.content)} bytes :: ${X}`)}const k=W((0,u.getVerificationContextMessage)(r),i),A=k.length>0?G(k):"",J=Math.max(0,(0,u.getVerificationContextMaxBytes)(r)-$(A)),z=H(v,{maxBytes:J,changedPathsBlock:L(i,c)});return A+z}catch(i){return m.logger.debug(`verification-context: build failed: ${i instanceof Error?i.message:i}`),""}}l(U,"buildVerificationContextForSession");function lt(t){const{projectDir:e,sessionId:r,sessionDir:i,activeVerificationId:n,config:o}=t;if(!n||!(0,u.getVerificationContextEnabled)(o)||(0,E.getContextInjectedVerificationId)(i)===n)return"";let g="";try{g=U(e,r,o)}catch(c){m.logger.debug(`verification-context: once-for-cycle build failed: ${c instanceof Error?c.message:c}`),g=""}if(g.length>0){const c=g.split(`
|
|
20
|
+
## `).length-1;m.logger.debug(`verification-context: injected ${Buffer.byteLength(g,"utf-8")} bytes, ${c} section(s) for cycle ${n}`)}else m.logger.debug(`verification-context: nothing to inject (no message, no changed paths) for cycle ${n}`);return(0,E.setContextInjectedVerificationId)(i,n),g}l(lt,"buildVerificationContextOnceForCycle");0&&(module.exports={VERIFICATION_DOC_DIR,VERIFICATION_DOC_FILE,buildVerificationContext,buildVerificationContextForSession,buildVerificationContextOnceForCycle,collectChangedPaths,renderChangedPathsBlock,renderMessageBlock,resolveContextFiles,resolveVerificationMessage});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var R=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var z=Object.getOwnPropertyNames;var K=Object.prototype.hasOwnProperty;var u=(e,t)=>R(e,"name",{value:t,configurable:!0});var W=(e,t)=>{for(var i in t)R(e,i,{get:t[i],enumerable:!0})},X=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of z(t))!K.call(e,s)&&s!==i&&R(e,s,{get:()=>t[s],enumerable:!(n=Q(t,s))||n.enumerable});return e};var Z=e=>X(R({},"__esModule",{value:!0}),e);var pe={};W(pe,{runVerifyGate:()=>he});module.exports=Z(pe);var b=require("fs"),f=require("../../lib/logger"),V=require("../../lib/telemetry"),h=require("./actions"),o=require("./session-state"),M=require("./activity-participants"),g=require("../../lib/config"),B=require("./required-tools");const ee=3,te=1;function ie(e){const t=g.CYCLE_TO_SERVER[e];if(t===void 0)throw new Error(`No MCP server registered for cycle '${e}'.`);return t}u(ie,"mcpServerForCycle");function C(e){return JSON.stringify({session_id:e,status:"pass",checks:["form submits successfully","new item appears in list","no console errors"]})}u(C,"verdictExamplePass");function q(e){return JSON.stringify({session_id:e,status:"fail",checks:["form renders","submit button unresponsive"],issues:["button click handler not firing","TypeError in console"]})}u(q,"verdictExampleFail");function w(...e){for(const t of e)try{(0,b.existsSync)(t)&&(0,b.unlinkSync)(t)}catch(i){f.logger.debug(`failed to cleanup ${t}: ${i}`)}}u(w,"cleanup");function ne(e){if(!(0,b.existsSync)(e))return null;try{return JSON.parse((0,b.readFileSync)(e,"utf-8"))}catch{return null}}u(ne,"readVerdictQuietly");function re(e,t){const i=(0,h.getFileChangesSinceLastVerification)(e),n=new Set;for(const c of i)for(const a of(0,g.getActiveCycles)(c.file_path,t))n.add(a);const s=[];n.has("browser")&&s.push("browser");for(const c of g.OPTIONAL_CYCLES)n.has(c)&&s.push(c);return s}u(re,"computeActiveCycles");function oe(e,t,i){const n=ie(e),s=new Set(t.filter(a=>a.tool_type==="mcp"&&a.mcp_server===n).map(a=>a.tool_name)),c=(0,g.getRequiredToolsConfig)(i,e);return{cycle:e,result:(0,B.satisfyRequiredTools)(s,c),config:c,usedCount:s.size}}u(oe,"checkCycleTools");function se(e){return{cycle:"browser",valid:!0,passCriteriaMet:!0}}u(se,"checkBrowserEvidence");function ae(e){return{cycle:"node",valid:!0,passCriteriaMet:!0}}u(ae,"checkNodeEvidence");function ce(e){return{cycle:"backend",valid:!0,passCriteriaMet:!0}}u(ce,"checkBackendEvidence");function le(e){return{cycle:"android",valid:!0,passCriteriaMet:!0}}u(le,"checkAndroidEvidence");function de(e){return{cycle:"terminal",valid:!0,passCriteriaMet:!0}}u(de,"checkTerminalEvidence");function ue(e,t){if(!Array.isArray(t.checks)||t.checks.length===0)return{cycle:e,valid:!1,reason:"missing checks"};if(e==="browser")return se(t);if(e==="node")return ae(t);if(e==="backend")return ce(t);if(e==="android")return le(t);if(e==="terminal")return de(t);throw new Error(`No evidence checker registered for cycle '${e}'.`)}u(ue,"checkCycleEvidence");function fe(e){const t=e.cycle.charAt(0).toUpperCase()+e.cycle.slice(1);if(e.result.missing.length===0)return`${t} cycle: ok.`;const i=e.result.missing.map(n=>` - ${n}`).join(`
|
|
2
2
|
`);return e.config.evidencePaths.length>0&&e.result.pathName!==void 0?`${t} cycle: incomplete (closest path "${e.result.pathName}", tried [${e.result.triedPaths.join(", ")}]):
|
|
3
3
|
${i}`:`${t} cycle: missing required tools:
|
|
4
|
-
${i}`}u(
|
|
4
|
+
${i}`}u(fe,"describeMissingTools");async function he(e){const{sessionId:t,sessionDir:i,actionsFile:n,verdictFile:s,maxRetries:c}=e,a=c??ee,m=e.config??(0,g.loadConfig)(e.projectDir);if(f.logger.debug(`verify-gate: session=${t} verdictExists=${(0,b.existsSync)(s)}`),(0,M.anyNonMainParticipants)(i)&&((0,o.getActiveVerificationId)(i)!==void 0||!(0,b.existsSync)(s)))return f.logger.debug("verifier sub-agent still running \u2014 allowing the main Stop, deferring activity close to the verifier (silent): verifier_running"),{action:"allow",reason:"verifier_running",message:"Verification is still running (delegated to the ironbee-verifier sub-agent). It continues in the background; you'll be re-invoked with its verdict when it finishes \u2014 do NOT claim completion yet, and do NOT spawn another verifier. A PASS completes the work; a FAIL means fix the reported issues and re-verify."};if((0,g.hasVerificationChecks)(m)&&(0,h.getLatestVerificationId)(n)!==void 0){const r=ge(n,m);if(r!==void 0)return f.logger.debug(`verify-gate: checks block (${r.reason})`),await d(n,i,t,"block",r.reason,[],e.projectDir),{action:"block",reason:r.reason,message:r.message}}if(!(0,h.hasFileChangesSinceLastVerification)(n)){if((0,o.getLastVerdictStatus)(i)==="fail"){if((0,o.getVerifyIntent)(i)!=="fix")return f.logger.debug("fail verdict with no code changes in window \u2014 status report, allowing"),(0,o.setLastVerdictStatus)(i,"fail_reported"),await d(n,i,t,"allow","fail_verdict_reported",[],e.projectDir),{action:"allow"};const r=(0,o.incrementRetries)(i);return r>=a?(f.logger.debug(`fix intent declared but retries exhausted (${r}/${a}) \u2014 releasing`),(0,o.resetRetries)(i),await(0,o.closeOpenCycles)(i,n,"max_retries_exceeded"),await d(n,i,t,"allow","max_retries_exceeded",[],e.projectDir),{action:"allow",message:`VERIFICATION FAILED ${a} TIMES. Allowing completion.
|
|
5
5
|
|
|
6
|
-
The fail verdict was never resolved. Report the unresolved issues in your final response.`}):(
|
|
6
|
+
The fail verdict was never resolved. Report the unresolved issues in your final response.`}):(f.logger.debug(`fix intent declared, fail verdict not addressed \u2014 blocking (unaddressed, attempt ${r}/${a})`),await d(n,i,t,"block","fail_verdict_unaddressed",[],e.projectDir),{action:"block",message:`VERIFICATION FAILED \u2014 unaddressed (attempt ${r}/${a}).
|
|
7
7
|
|
|
8
8
|
You submitted a fail verdict but did not address the reported issues. Either:
|
|
9
9
|
|
|
@@ -13,7 +13,7 @@ You submitted a fail verdict but did not address the reported issues. Either:
|
|
|
13
13
|
|
|
14
14
|
2. Or \u2014 if the issues genuinely cannot be fixed \u2014 re-verify (keep the --intent fix flag)
|
|
15
15
|
to confirm the failure: each blocked stop counts toward maxRetries; once exhausted,
|
|
16
|
-
the gate will allow completion with the issues reported.`})}return
|
|
16
|
+
the gate will allow completion with the issues reported.`})}return f.logger.debug("no code changes detected, allowing completion"),await d(n,i,t,"allow","no_edits",[],e.projectDir),{action:"allow"}}const l=re(n,m);if(l.length===0)return f.logger.debug("file changes match no cycle pattern, allowing completion"),await d(n,i,t,"allow","no_cycle_active",[],e.projectDir),{action:"allow"};const x=(0,g.getVerificationStrict)(m),U=(0,o.isFailLikeVerdictStatus)((0,o.getLastVerdictStatus)(i)),_=ne(s),N=!x&&!U&&_!==null&&Array.isArray(_.reason)&&_.reason.length>0;if(N&&_.status==="not_applicable")return f.logger.debug("global N/A verdict, allowing completion"),(0,o.resetRetries)(i),(0,o.setLastVerdictStatus)(i,"not_applicable"),await d(n,i,t,"allow","verdict_not_applicable",l,e.projectDir),{action:"allow"};let v=l;if(N&&Array.isArray(_.not_applicable_cycles)&&_.not_applicable_cycles.length>0){const r=new Set(_.not_applicable_cycles.filter(p=>l.includes(p)));if(v=l.filter(p=>!r.has(p)),v.length===0)return f.logger.debug("per-platform N/A exempted every active cycle \u2014 treating as global N/A"),(0,o.resetRetries)(i),(0,o.setLastVerdictStatus)(i,"not_applicable"),await d(n,i,t,"allow","verdict_not_applicable",l,e.projectDir),{action:"allow"};f.logger.debug(`per-platform N/A: exempt=[${[...r].join(",")}] enforced=[${v.join(",")}]`)}const J=(0,h.getToolCallsSinceLastFileChange)(n),S=v.map(r=>oe(r,J,m)),D=S.filter(r=>!r.result.satisfied);if(D.length>0){const r=S.every(y=>y.usedCount===0),p=(0,o.incrementRetries)(i),$=!(0,h.hasVerifierEverEngaged)(n),G=$&&p>te,H=p>=a;if(G||H){const y=$?"verifier_unavailable":"max_retries_exceeded";f.logger.debug(`tool-presence loop releasing (attempt ${p}/${a}, neverEngaged=${$}) \u2014 ${y}`),(0,o.resetRetries)(i),await(0,o.closeOpenCycles)(i,n,y),await d(n,i,t,"allow",y,l,e.projectDir);const A=l.join(", ");return $?{action:"allow",message:`VERIFICATION UNAVAILABLE \u2014 allowing completion.
|
|
17
17
|
|
|
18
18
|
The ${A} verification cycle could not run this session: no verification was ever started and no verification tool was recorded across the whole session. This points to an environment/setup problem rather than a skipped step. Check:
|
|
19
19
|
- the devtools MCP server is installed and loads (try \`npx -y @ironbee-ai/devtools\`);
|
|
@@ -22,7 +22,7 @@ The ${A} verification cycle could not run this session: no verification was ever
|
|
|
22
22
|
|
|
23
23
|
Report this change as UNVERIFIED in your final response.`}:{action:"allow",message:`VERIFICATION NOT COMPLETED after ${a} attempts. Allowing completion.
|
|
24
24
|
|
|
25
|
-
The ${A} verification cycle was attempted but its required tools were not all completed within ${a} attempts. If the change has no runtime surface to verify (e.g. a test-only or config change) or the verification tools are unavailable in this environment, say so in your final response; otherwise report the unresolved verification gap.`}}if(
|
|
25
|
+
The ${A} verification cycle was attempted but its required tools were not all completed within ${a} attempts. If the change has no runtime surface to verify (e.g. a test-only or config change) or the verification tools are unavailable in this environment, say so in your final response; otherwise report the unresolved verification gap.`}}if(r){await d(n,i,t,"block","no_tools",l,e.projectDir);const y=` echo '${C(t)}' | ironbee hook submit-verdict`,A=` On fail: echo '${q(t)}' | ironbee hook submit-verdict`;return{action:"block",message:`VERIFICATION REQUIRED (attempt ${p}/${a}).
|
|
26
26
|
|
|
27
27
|
You made code changes but did not verify them.
|
|
28
28
|
|
|
@@ -49,43 +49,57 @@ ${v.includes("browser")?`Browser cycle (UI verification):
|
|
|
49
49
|
1. Connect to a running device or emulator: adt_device_connect
|
|
50
50
|
2a. Device-evidence path: drive the app UI (adt_device_launch-app / adt_interaction_tap / adt_interaction_input-text / adt_interaction_swipe), then capture BOTH a screenshot (adt_content_take-screenshot) AND a UI snapshot (adt_a11y_take-ui-snapshot) to confirm the visual + structural result
|
|
51
51
|
2b. Log-evidence path: read Logcat output for the changed code path (adt_o11y_log-read / adt_o11y_log-follow) and confirm expected log lines / absence of errors
|
|
52
|
+
2c. Network-evidence path: capture the app's outgoing HTTP traffic (adt_o11y_get-http-requests \u2014 forward-looking: start capture, drive the app to trigger traffic, read again) and confirm the expected request(s) / response status
|
|
53
|
+
`:""}${v.includes("terminal")?`Terminal cycle (CLI / REPL / TUI verification \u2014 pick ONE evidence path):
|
|
54
|
+
1a. Run-evidence path: run the affected command one-shot via tdt_pty_run and confirm its output + exit code
|
|
55
|
+
1b. Interactive-evidence path: spawn a pane (tdt_pty_start), drive input (tdt_interaction_send-keys / tdt_interaction_send-text), and read the emitted output (tdt_content_capture); use tdt_sync_wait-for to block until expected output appears rather than guessing with delays
|
|
56
|
+
2. Confirm the output reflects your change (expected lines present, no errors / unexpected exit code)
|
|
52
57
|
`:""}
|
|
53
58
|
Then submit your verdict (single verdict covers every active cycle):
|
|
54
|
-
${
|
|
59
|
+
${y}
|
|
55
60
|
${A}
|
|
56
|
-
If failed, fix the code and re-verify until it passes.`}}await
|
|
57
|
-
`);return{action:"block",message:`INCOMPLETE VERIFICATION (attempt ${
|
|
61
|
+
If failed, fix the code and re-verify until it passes.`}}await d(n,i,t,"block","incomplete_tools",l,e.projectDir);const Y=D.map(y=>fe(y)).join(`
|
|
62
|
+
`);return{action:"block",message:`INCOMPLETE VERIFICATION (attempt ${p}/${a}).
|
|
58
63
|
|
|
59
64
|
You used the IronBee verification tools but skipped required checks:
|
|
60
65
|
|
|
61
|
-
${
|
|
66
|
+
${Y}
|
|
62
67
|
|
|
63
68
|
Run the missing tools, functionally test your changes, then submit your verdict:
|
|
64
|
-
Pass: echo '${
|
|
65
|
-
Fail: echo '${q(t)}' | ironbee hook submit-verdict`}}if(!(0,b.existsSync)(s))return await
|
|
69
|
+
Pass: echo '${C(t)}' | ironbee hook submit-verdict
|
|
70
|
+
Fail: echo '${q(t)}' | ironbee hook submit-verdict`}}if(!(0,b.existsSync)(s))return await d(n,i,t,"block","no_verdict",l,e.projectDir),{action:"block",message:`VERDICT MISSING.
|
|
66
71
|
|
|
67
|
-
You ran the verification tools but did not submit a verdict.${(0,
|
|
72
|
+
You ran the verification tools but did not submit a verdict.${(0,o.isRecordingActive)(i)?`
|
|
68
73
|
\u26A0 Recording is still active \u2014 call mcp__browser-devtools__bdt_content_stop-recording BEFORE submit-verdict (otherwise it will reject with "recording is still active").`:""}
|
|
69
74
|
|
|
70
75
|
Submit your verdict via:
|
|
71
|
-
echo '${
|
|
72
|
-
echo '${
|
|
73
|
-
echo '${
|
|
74
|
-
${
|
|
76
|
+
echo '${C(t)}' | ironbee hook submit-verdict`};let k;try{k=JSON.parse((0,b.readFileSync)(s,"utf-8"))}catch(r){return f.logger.debug(`failed to parse verdict ${s}: ${r}`),w(s),await d(n,i,t,"block","invalid_verdict",l,e.projectDir),{action:"block",message:`INVALID VERDICT JSON. Re-submit valid JSON:
|
|
77
|
+
echo '${C(t)}' | ironbee hook submit-verdict`}}if(k.status==="not_applicable")return w(s),await d(n,i,t,"block","not_applicable_rejected",v,e.projectDir),{action:"block",message:`VERDICT REJECTED: ${x?"N/A is not accepted in strict mode \u2014 verify the change with the required tools.":"N/A is not honored here \u2014 verify the change with the required tools, or report a fail."}
|
|
78
|
+
echo '${C(t)}' | ironbee hook submit-verdict`};const F=v.map(r=>ue(r,k)),L=F.filter(r=>!r.valid);if(L.length>0)return w(s),await d(n,i,t,"block","invalid_verdict",l,e.projectDir),{action:"block",message:`VERDICT REJECTED:
|
|
79
|
+
${L.map(p=>` - ${p.cycle} cycle: ${p.reason}`).join(`
|
|
75
80
|
`)}
|
|
76
81
|
|
|
77
82
|
Re-submit:
|
|
78
|
-
echo '${
|
|
79
|
-
echo '${
|
|
80
|
-
- `);return O>=a?(
|
|
83
|
+
echo '${C(t)}' | ironbee hook submit-verdict`};const E=k.status;if(E!=="pass"&&E!=="fail")return w(s),await d(n,i,t,"block","invalid_verdict",l,e.projectDir),{action:"block",message:`INVALID VERDICT STATUS: "${E}". Status must be "pass" or "fail".
|
|
84
|
+
echo '${C(t)}' | ironbee hook submit-verdict`};const T=F.filter(r=>r.passCriteriaMet===!1),j=E==="pass"&&T.length===0?"pass":"fail";if(E==="pass"&&j==="fail"&&f.logger.debug(`verify-gate: status=pass overridden to fail by cycle pass-criteria: ${T.map(r=>r.cycle).join(",")}`),j==="pass")return f.logger.debug("verdict passed, allowing completion"),(0,o.resetRetries)(i),await d(n,i,t,"allow","verdict_pass",l,e.projectDir),{action:"allow"};const O=(0,o.incrementRetries)(i),I=[];if(Array.isArray(k.issues))for(const r of k.issues)I.push(String(r));for(const r of T)I.push(`[${r.cycle}] ${r.passReason??"pass criteria not met"}`);I.length===0&&I.push("unknown");const P=I.join(`
|
|
85
|
+
- `);return O>=a?(w(s),(0,o.resetRetries)(i),await(0,o.closeOpenCycles)(i,n,"max_retries_exceeded"),await d(n,i,t,"allow","max_retries_exceeded",l,e.projectDir),{action:"allow",message:`VERIFICATION FAILED ${a} TIMES. Allowing completion.
|
|
81
86
|
|
|
82
87
|
Unresolved issues:
|
|
83
88
|
- ${P}
|
|
84
89
|
|
|
85
|
-
Report these issues in your final response.`}):(
|
|
90
|
+
Report these issues in your final response.`}):(w(s),await d(n,i,t,"block","verdict_fail",l,e.projectDir),{action:"block",message:`VERIFICATION FAILED (attempt ${O}/${a}).
|
|
86
91
|
|
|
87
92
|
Issues found:
|
|
88
93
|
- ${P}
|
|
89
94
|
|
|
90
95
|
Fix the issues, rebuild if needed, re-test functionally, and re-verify.
|
|
91
|
-
Submit verdict: echo '<verdict-json>' | ironbee hook submit-verdict`})}u(
|
|
96
|
+
Submit verdict: echo '<verdict-json>' | ironbee hook submit-verdict`})}u(he,"runVerifyGate");function ge(e,t){const i=(0,g.getVerificationChecks)(t),n=(0,h.getCheckResultsForLatestVerification)(e),s=new Map;for(const c of n)s.set(c.name,c);for(const c of i){if(c.required===!1)continue;const a=s.get(c.name);if(a===void 0)return{reason:"checks_not_run",message:`VERIFICATION REQUIRED: the project check "${c.name}" has not been run this cycle.
|
|
97
|
+
|
|
98
|
+
Run the configured project checks (lint/test/\u2026) first:
|
|
99
|
+
echo '{}' | ironbee hook run-checks
|
|
100
|
+
|
|
101
|
+
They are the first step of verification \u2014 they must pass before you complete the cycle.`};if(a.status==="fail"){const m=a.timed_out?" (timed out)":a.exit_code!==null?` (exit ${a.exit_code})`:"";return{reason:"check_failed",message:`VERIFICATION FAILED: project check "${c.name}" failed${m}.
|
|
102
|
+
|
|
103
|
+
${a.output}
|
|
104
|
+
|
|
105
|
+
Fix the failure, then re-run: echo '{}' | ironbee hook run-checks`}}}}u(ge,"evaluateChecks");async function d(e,t,i,n,s,c,a){n==="allow"&&(0,o.clearVerifyIntent)(t);const m=(0,o.getActiveActivityId)(t);if(!m){f.logger.debug(`verification_requested ${n}/${s} skipped \u2014 no active activity (would orphan)`),await(0,V.trackVerificationRequested)(i,n,s,a);return}const l={...(0,h.baseFields)(e),type:"verification_requested",timestamp:Date.now(),activity_id:m,action:n,reason:s,modes:c.length>0?c:void 0};await(0,h.appendAction)(e,l),await(0,V.trackVerificationRequested)(i,n,s,a)}u(d,"recordMarker");0&&(module.exports={runVerifyGate});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var c=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var a=(t,n)=>c(t,"name",{value:n,configurable:!0});var O=(t,n)=>{for(var e in n)c(t,e,{get:n[e],enumerable:!0})},U=(t,n,e,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of M(n))!N.call(t,i)&&i!==e&&c(t,i,{get:()=>n[i],enumerable:!(r=j(n,i))||r.enumerable});return t};var A=t=>U(c({},"__esModule",{value:!0}),t);var L={};O(L,{buildToolCall:()=>D});module.exports=A(L);var p=require("../../../clients/claude/util"),R=require("../../ids");const g=new Set(["browser-devtools","node-devtools","backend-devtools","android-devtools"]);function D(t){const{sessionId:n,projectName:e,activityId:r,timestamp:i,toolUse:s,toolResult:l}=t,o=(0,p.classifyTool)(s.name,s.input),I=z(n,o,s),C=o.tool_type==="mcp"&&o.mcp_server!==null&&g.has(o.mcp_server)?B(s.input):(0,p.extractClaudeToolInput)(s.name,s.input),x=k(s.input),d=l!==null&&l.is_error?F(l.content):void 0,S=d!==void 0&&/\[Request interrupted by user(?:[^\]]*)?\]/.test(d),w=d!==void 0?S?`interrupted: ${d}`:d:void 0,h=l!==null&&!l.is_error?k(l.content):0,y=Date.parse(i),T=t.resultTimestamp!==void 0&&t.resultTimestamp!==null?Date.parse(t.resultTimestamp):NaN,E=Number.isFinite(T)?T:Number.isFinite(y)?y:Date.now(),u={id:I,type:"tool_call",timestamp:E,session_id:n,project_name:e,activity_id:r,tool_name:o.tool_name,tool_use_id:s.id,tool_input:C,tool_input_size:x,tool_response_size:h,duration:t.durationMs??null};if(o.tool_type!==null&&(u.tool_type=o.tool_type),o.mcp_server!==null&&(u.mcp_server=o.mcp_server),w!==void 0&&(u.error=w),o.tool_type==="mcp"&&o.mcp_server!==null&&g.has(o.mcp_server)){const f=s.input._metadata;if(f!==null&&typeof f=="object"){const v=f,m=v.verificationId;typeof m=="string"&&b.test(m)&&(u.verification_id=m);const _=v.traceId;typeof _=="string"&&_.length>0&&(u.trace_id=_)}}return u}a(D,"buildToolCall");const b=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function z(t,n,e){if(n.tool_type==="mcp"&&n.mcp_server!==null&&g.has(n.mcp_server)){const r=e.input._metadata;if(r!==null&&typeof r=="object"){const i=r.toolCallId;if(typeof i=="string"&&b.test(i))return i}}return(0,R.deriveToolCallEventIdFromToolUseId)(t,e.id)}a(z,"resolveEventId");function B(t){if(!("_metadata"in t))return t;const{_metadata:n,...e}=t;return e}a(B,"stripMetadata");function k(t){if(t==null)return 0;try{const n=typeof t=="string"?t:JSON.stringify(t);return n===void 0?0:Buffer.byteLength(n,"utf-8")}catch{return 0}}a(k,"byteLengthOf");function F(t){if(typeof t=="string")return t;if(Array.isArray(t)){const n=[];for(const e of t)if(e!==null&&typeof e=="object"){const r=e.text;typeof r=="string"&&n.push(r)}return n.join(`
|
|
1
|
+
"use strict";var c=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var a=(t,n)=>c(t,"name",{value:n,configurable:!0});var O=(t,n)=>{for(var e in n)c(t,e,{get:n[e],enumerable:!0})},U=(t,n,e,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of M(n))!N.call(t,i)&&i!==e&&c(t,i,{get:()=>n[i],enumerable:!(r=j(n,i))||r.enumerable});return t};var A=t=>U(c({},"__esModule",{value:!0}),t);var L={};O(L,{buildToolCall:()=>D});module.exports=A(L);var p=require("../../../clients/claude/util"),R=require("../../ids");const g=new Set(["browser-devtools","node-devtools","backend-devtools","android-devtools","terminal-devtools"]);function D(t){const{sessionId:n,projectName:e,activityId:r,timestamp:i,toolUse:s,toolResult:l}=t,o=(0,p.classifyTool)(s.name,s.input),I=z(n,o,s),C=o.tool_type==="mcp"&&o.mcp_server!==null&&g.has(o.mcp_server)?B(s.input):(0,p.extractClaudeToolInput)(s.name,s.input),x=k(s.input),d=l!==null&&l.is_error?F(l.content):void 0,S=d!==void 0&&/\[Request interrupted by user(?:[^\]]*)?\]/.test(d),w=d!==void 0?S?`interrupted: ${d}`:d:void 0,h=l!==null&&!l.is_error?k(l.content):0,y=Date.parse(i),T=t.resultTimestamp!==void 0&&t.resultTimestamp!==null?Date.parse(t.resultTimestamp):NaN,E=Number.isFinite(T)?T:Number.isFinite(y)?y:Date.now(),u={id:I,type:"tool_call",timestamp:E,session_id:n,project_name:e,activity_id:r,tool_name:o.tool_name,tool_use_id:s.id,tool_input:C,tool_input_size:x,tool_response_size:h,duration:t.durationMs??null};if(o.tool_type!==null&&(u.tool_type=o.tool_type),o.mcp_server!==null&&(u.mcp_server=o.mcp_server),w!==void 0&&(u.error=w),o.tool_type==="mcp"&&o.mcp_server!==null&&g.has(o.mcp_server)){const f=s.input._metadata;if(f!==null&&typeof f=="object"){const v=f,m=v.verificationId;typeof m=="string"&&b.test(m)&&(u.verification_id=m);const _=v.traceId;typeof _=="string"&&_.length>0&&(u.trace_id=_)}}return u}a(D,"buildToolCall");const b=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function z(t,n,e){if(n.tool_type==="mcp"&&n.mcp_server!==null&&g.has(n.mcp_server)){const r=e.input._metadata;if(r!==null&&typeof r=="object"){const i=r.toolCallId;if(typeof i=="string"&&b.test(i))return i}}return(0,R.deriveToolCallEventIdFromToolUseId)(t,e.id)}a(z,"resolveEventId");function B(t){if(!("_metadata"in t))return t;const{_metadata:n,...e}=t;return e}a(B,"stripMetadata");function k(t){if(t==null)return 0;try{const n=typeof t=="string"?t:JSON.stringify(t);return n===void 0?0:Buffer.byteLength(n,"utf-8")}catch{return 0}}a(k,"byteLengthOf");function F(t){if(typeof t=="string")return t;if(Array.isArray(t)){const n=[];for(const e of t)if(e!==null&&typeof e=="object"){const r=e.text;typeof r=="string"&&n.push(r)}return n.join(`
|
|
2
2
|
`)}try{return JSON.stringify(t)}catch{return String(t)}}a(F,"extractErrorMessage");0&&(module.exports={buildToolCall});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var d=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var c=(e,t)=>d(e,"name",{value:t,configurable:!0});var O=(e,t)=>{for(var n in t)d(e,n,{get:t[n],enumerable:!0})},h=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of N(t))!S.call(e,o)&&o!==n&&d(e,o,{get:()=>t[o],enumerable:!(i=E(t,o))||i.enumerable});return e};var j=e=>h(d({},"__esModule",{value:!0}),e);var A={};O(A,{buildCodexToolCall:()=>D});module.exports=j(A);var p=require("../../../clients/codex/util"),w=require("../../ids");const v=new Set(["browser-devtools","node-devtools","backend-devtools","android-devtools"]);function D(e){const{sessionId:t,projectName:n,activityId:i,call:o,output:
|
|
1
|
+
"use strict";var d=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var c=(e,t)=>d(e,"name",{value:t,configurable:!0});var O=(e,t)=>{for(var n in t)d(e,n,{get:t[n],enumerable:!0})},h=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of N(t))!S.call(e,o)&&o!==n&&d(e,o,{get:()=>t[o],enumerable:!(i=E(t,o))||i.enumerable});return e};var j=e=>h(d({},"__esModule",{value:!0}),e);var A={};O(A,{buildCodexToolCall:()=>D});module.exports=j(A);var p=require("../../../clients/codex/util"),w=require("../../ids");const v=new Set(["browser-devtools","node-devtools","backend-devtools","android-devtools","terminal-devtools"]);function D(e){const{sessionId:t,projectName:n,activityId:i,call:o,output:l}=e,r=(0,p.classifyCodexTool)(o.name),y=F(t,r,o),I=(0,p.extractCodexToolInput)(o.name,o.args),x=z(o.args),T=l!==null&&!l.isError?Buffer.byteLength(l.output,"utf-8"):0,C=l!==null&&l.isError?l.output.slice(0,500):void 0,a=Date.parse(o.timestamp),u=l!==null?Date.parse(l.timestamp):NaN,k=Number.isFinite(a)&&Number.isFinite(u)&&u>=a?u-a:null,R=Number.isFinite(u)?u:Number.isFinite(a)?a:Date.now(),s={id:y,type:"tool_call",timestamp:R,session_id:t,project_name:n,activity_id:i,tool_name:r.tool_name,tool_use_id:o.callId,tool_input:I,tool_input_size:x,tool_response_size:T,duration:k};if(r.tool_type!==null&&(s.tool_type=r.tool_type),r.mcp_server!==null&&(s.mcp_server=r.mcp_server),C!==void 0&&(s.error=C),r.tool_type==="mcp"&&r.mcp_server!==null&&v.has(r.mcp_server)){const m=o.args._metadata;if(m!==null&&typeof m=="object"){const _=m,f=_.verificationId;typeof f=="string"&&b.test(f)&&(s.verification_id=f);const g=_.traceId;typeof g=="string"&&g.length>0&&(s.trace_id=g)}}return s}c(D,"buildCodexToolCall");const b=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function F(e,t,n){if(t.tool_type==="mcp"&&t.mcp_server!==null&&v.has(t.mcp_server)){const i=n.args._metadata;if(i!==null&&typeof i=="object"){const o=i.toolCallId;if(typeof o=="string"&&b.test(o))return o}}return(0,w.deriveToolCallEventIdFromToolUseId)(e,n.callId)}c(F,"resolveEventId");function z(e){if(e==null)return 0;try{return Buffer.byteLength(JSON.stringify(e),"utf-8")}catch{return 0}}c(z,"byteLengthOf");0&&(module.exports={buildCodexToolCall});
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var
|
|
2
|
+
"use strict";var O=Object.defineProperty;var t=(r,n)=>O(r,"name",{value:n,configurable:!0});var i=require("commander"),c=require("fs"),l=require("path"),m=require("./commands/install"),g=require("./commands/uninstall"),p=require("./commands/update"),f=require("./commands/hook"),C=require("./commands/status"),u=require("./commands/verify"),b=require("./commands/queue"),v=require("./commands/process-job-file"),y=require("./clients/codex/cli"),h=require("./commands/browser"),$=require("./commands/node"),j=require("./commands/backend"),w=require("./commands/android"),I=require("./commands/terminal"),k=require("./commands/verification"),T=require("./commands/telemetry"),B=require("./commands/privacy"),F=require("./commands/config"),q=require("./tui"),A=require("./commands/register"),L=require("./commands/unregister"),R=require("./commands/import"),S=require("./clients/claude/cli"),U=require("./commands/login"),x=require("./commands/scenario"),P=require("./queue"),H=require("./lib/icon"),s=require("./lib/version"),e=require("./lib/output");const d=JSON.parse((0,c.readFileSync)((0,l.join)(__dirname,"../package.json"),"utf-8"));(0,P.registerQueueHandlers)();const o=new i.Command;o.name("ironbee").description(d.description).version(d.version),o.addCommand(U.loginCommand),o.addCommand(m.installCommand),o.addCommand(g.uninstallCommand),o.addCommand(p.updateCommand),o.addCommand(C.statusCommand),o.addCommand(u.verifyCommand),o.addCommand(b.queueCommand),o.addCommand(h.browserCommand),o.addCommand($.nodeCommand),o.addCommand(j.backendCommand),o.addCommand(w.androidCommand),o.addCommand(I.terminalCommand),o.addCommand(k.verificationCommand),o.addCommand(T.telemetryCommand),o.addCommand(B.privacyCommand),o.addCommand(S.claudeCommand),o.addCommand(y.codexCommand),o.addCommand(F.configCommand),o.addCommand(q.tuiCommand),o.addCommand(A.registerCommand),o.addCommand(L.unregisterCommand),o.addCommand(R.importCommand),o.addCommand(x.scenarioCommand),o.addCommand(v.processJobFileCommand),o.addCommand(f.hookCommand);const _=process.argv[2]==="hook"||process.argv[2]==="process-job-file"||process.argv[2]==="claude"&&process.argv[3]==="process-analytics"||process.argv[2]==="codex"&&process.argv[3]==="process-analytics"||process.argv[2]==="claude"&&process.argv[3]==="otel"&&process.argv[4]==="run";if(process.argv.length===2){(0,H.printBanner)(),console.log(),console.log(` ${e.pc.bold("IronBee CLI")} ${e.pc.dim(`v${(0,s.getLocalVersion)()}`)}`),console.log(` ${e.pc.dim(d.description)}`),console.log(),console.log(` ${e.pc.bold(e.pc.cyan("Usage:"))} ${e.pc.green("ironbee")} ${e.pc.dim("<command> [options]")}`),console.log(),console.log(` ${e.pc.bold(e.pc.cyan("Commands:"))}`);const r=[{name:"install",args:"[project-dir]",desc:"Install hooks + guidance files into a project (--all: every registered project)"},{name:"uninstall",args:"[project-dir]",desc:"Remove IronBee from a project (--all: every registered project)"},{name:"update",args:"",desc:"Update IronBee CLI to the latest version"},{name:"tui",args:"[area]",desc:"Interactive full-screen UI (config \xB7 platforms \xB7 projects \xB7 sessions \xB7 queue \xB7 import)"},{name:"status",args:"[project-dir]",desc:"Show verification status for active sessions"},{name:"verify",args:"[session-id]",desc:"Dry-run verdict validation"},{name:"browser",args:"<enable|disable>",desc:"Toggle the browser verification cycle (default-on)"},{name:"node",args:"<enable|disable>",desc:"Toggle the Node.js runtime debug cycle (opt-in)"},{name:"backend",args:"<enable|disable>",desc:"Toggle the backend protocol cycle (opt-in)"},{name:"android",args:"<enable|disable>",desc:"Toggle the Android mobile verification cycle (opt-in)"},{name:"terminal",args:"<enable|disable>",desc:"Toggle the terminal interaction verification cycle (opt-in)"},{name:"verification",args:"<enable|disable>",desc:"Master toggle (enable = enforce; disable = monitoring-only)"},{name:"telemetry",args:"<enable|disable>",desc:"Anonymous PostHog telemetry toggle"},{name:"privacy",args:"<enable|disable>",desc:"Privacy mode \u2014 redact devtools tool detail / screenshots / recordings from collector"},{name:"claude statusline",args:"<enable|disable>",desc:"Claude statusline integration (Claude-only)"},{name:"claude otel",args:"<run|status|stop|retry>",desc:"Claude OTEL collector daemon (Claude-only)"},{name:"config",args:"<get|set|unset|list>",desc:"Read or write project / global / local config"},{name:"register",args:"[-p <dir>]",desc:"Add a project to the user-home inventory (no artifact writes)"},{name:"unregister",args:"[-p <dir>]",desc:"Remove a project from the inventory (no artifact writes)"},{name:"queue",args:"<status|drain|\u2026>",desc:"Inspect / drain the background job queue"},{name:"import",args:"",desc:"Import historical Claude sessions to the collector"}],n=t(a=>a.args.length>0?`${a.name} ${a.args}`:a.name,"term"),J=Math.max(...r.map(a=>n(a).length));for(const a of r){const M=a.args.length>0?`${e.pc.green(a.name)} ${e.pc.dim(a.args)}`:e.pc.green(a.name),N=" ".repeat(J-n(a).length);console.log(` ${M}${N} ${a.desc}`)}console.log(),console.log(` ${e.pc.dim("Run")} ${e.pc.cyan("ironbee <command> --help")} ${e.pc.dim("for more info on a command.")}`),console.log()}else _?o.parse(process.argv):(async()=>{await o.parseAsync(process.argv),(0,s.checkForUpdates)().catch(()=>{});const r=process.argv[2];r==="install"||r==="uninstall"||r==="update"||await(0,m.syncSchemaIfChanged)()})();
|
package/dist/lib/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var _=Object.defineProperty;var ue=Object.getOwnPropertyDescriptor;var fe=Object.getOwnPropertyNames;var ge=Object.prototype.hasOwnProperty;var o=(n,e)=>_(n,"name",{value:e,configurable:!0});var de=(n,e)=>{for(var t in e)_(n,t,{get:e[t],enumerable:!0})},pe=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of fe(e))!ge.call(n,i)&&i!==t&&_(n,i,{get:()=>e[i],enumerable:!(r=ue(e,i))||r.enumerable});return n};var be=n=>pe(_({},"__esModule",{value:!0}),n);var Ln={};de(Ln,{ALL_CYCLES:()=>Ee,CONFIG_TARGETS_BY_PRECEDENCE:()=>Oe,CYCLES_ENABLED_BY_DEFAULT:()=>P,CYCLE_DEFAULT_VERIFY_PATTERNS:()=>q,CYCLE_TOOL_PREFIXES:()=>_e,CYCLE_TO_SERVER:()=>ye,DEFAULT_ANDROID_ALWAYS_REQUIRED:()=>G,DEFAULT_ANDROID_EVIDENCE_PATHS:()=>Q,DEFAULT_ANDROID_VERIFY_PATTERNS:()=>U,DEFAULT_BACKEND_ALWAYS_REQUIRED:()=>H,DEFAULT_BACKEND_EVIDENCE_PATHS:()=>W,DEFAULT_BACKEND_VERIFY_PATTERNS:()=>V,DEFAULT_BROWSER_ALWAYS_REQUIRED:()=>K,DEFAULT_BROWSER_VERIFY_PATTERNS:()=>M,DEFAULT_IGNORED_VERIFY_PATTERNS:()=>$,DEFAULT_NODE_ALWAYS_REQUIRED:()=>Y,DEFAULT_NODE_EVIDENCE_PATHS:()=>X,DEFAULT_NODE_VERIFY_PATTERNS:()=>F,DEFAULT_OAUTH_USAGE_TTL_SECONDS:()=>ee,DEFAULT_OTEL_EMIT_MIN_INTERVAL_SECONDS:()=>re,DEFAULT_OTEL_ENSURE_MIN_INTERVAL_SECONDS:()=>oe,DEFAULT_OTEL_IDLE_TIMEOUT_SECONDS:()=>te,DEFAULT_OTEL_PORT:()=>ne,DEFAULT_VERIFICATION_CONTEXT_COMMIT_DEPTH:()=>ae,DEFAULT_VERIFICATION_CONTEXT_MAX_BYTES:()=>se,ENV_OVERRIDES:()=>R,OPTIONAL_CYCLES:()=>T,applyEnvOverrides:()=>z,findActiveEnvOverride:()=>Se,getActiveCycles:()=>J,getAnalyticsEmitOnStopMinIntervalSeconds:()=>kn,getAndroidDevToolsMcpEntry:()=>en,getAutoVerifyEnabled:()=>ie,getBackendDevToolsMcpEntry:()=>Ze,getCaptureFileChangeset:()=>wn,getClaudeOauthAccessEnabled:()=>cn,getClaudeOauthAccessUsageTtlSeconds:()=>gn,getCodexVerifierMode:()=>ln,getConfigLayerPaths:()=>w,getMaxChangesetBytes:()=>Rn,getMaxRetries:()=>nn,getMcpServerEntry:()=>ze,getNodeDevToolsMcpEntry:()=>Je,getOTELEmitMinIntervalSeconds:()=>yn,getOTELEnsureMinIntervalSeconds:()=>En,getOTELIdleTimeoutSeconds:()=>bn,getOTELPort:()=>pn,getPrivacyEnabled:()=>le,getRequiredToolsConfig:()=>Me,getStatusLineEmitMinIntervalSeconds:()=>an,getStatusLineRefreshInterval:()=>_n,getStatusLineRenderDefault:()=>sn,getTargetConfigPath:()=>ke,getTelemetryEnabled:()=>ce,getVerificationContextCommitDepth:()=>vn,getVerificationContextEnabled:()=>mn,getVerificationContextMaxBytes:()=>In,getVerificationContextSource:()=>An,getVerificationEnabled:()=>O,getVerificationMode:()=>xn,getVerificationModel:()=>Ae,getVerificationStrict:()=>Cn,isAnalyticsApiRequestEventsEnabled:()=>Sn,isAnalyticsEmitOnStopEnabled:()=>On,isAnalyticsEnabled:()=>jn,isAnalyticsStepEventsEnabled:()=>Bn,isAnalyticsTurnEventsEnabled:()=>hn,isAutoModeAllowlistEnabled:()=>un,isClaudeTrustWorkspaceEnabled:()=>fn,isCollectorConfigured:()=>j,isCycleEnabled:()=>Pe,isCyclePatternsActive:()=>Z,isIgnoredVerifyPath:()=>Tn,isJobQueueEnabled:()=>tn,isOTELEnabled:()=>dn,isRecordingEnabled:()=>on,isSessionStatusEnabled:()=>rn,loadConfig:()=>c,matchesAny:()=>E,requiresVerification:()=>De,resolveConfigTargetFromFlags:()=>he,resolveIgnoredVerifyPatterns:()=>x});module.exports=be(Ln);var y=require("fs"),b=require("path"),I=require("os"),D=require("./logger");const T=["node","backend","android"],Ee=["browser",...T],P=new Set(["browser"]),ye={browser:"browser-devtools",node:"node-devtools",backend:"backend-devtools",android:"android-devtools"},_e={browser:"bdt_",node:"ndt_",backend:"bedt_",android:"adt_"},M=["*.ts","*.tsx","*.js","*.jsx","*.mjs","*.cjs","*.vue","*.svelte","*.html","*.htm","*.css","*.scss","*.sass","*.less","*.styl","*.py","*.rb","*.erb","*.go","*.rs","*.java","*.kt","*.kts","*.swift","*.c","*.cpp","*.h","*.hpp","*.cs","*.php","*.dart","*.ex","*.exs","*.erl","*.lua","*.r","*.R","*.scala","*.clj","*.cljs","*.zig","*.nim","*.hbs","*.ejs","*.pug","*.jade","*.astro"],F=["server/**/*.{ts,js,mjs,cjs}","src/server/**/*.{ts,js,mjs,cjs}","backend/**/*.{ts,js,mjs,cjs}","api/**/*.{ts,js,mjs,cjs}","src/api/**/*.{ts,js,mjs,cjs}","pages/api/**/*.{ts,js,mjs,cjs}","app/api/**/*.{ts,js,mjs,cjs}","routes/**/*.{ts,js,mjs,cjs}","**/server.{ts,js,mjs,cjs}"],V=["server/**/*.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","src/server/**/*.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","backend/**/*.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","api/**/*.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","src/api/**/*.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","pages/api/**/*.{ts,js,mjs,cjs}","app/api/**/*.{ts,js,mjs,cjs}","routes/**/*.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","controllers/**/*.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","handlers/**/*.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","services/**/*.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","**/server.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","**/main.{go,py,java,rb,kt,scala}"],U=["android/**/*.{kt,java}","app/src/**/*.{kt,java}","mobile/**/*.{kt,java}","src/main/kotlin/**/*.kt","src/main/java/**/*.java","**/*.{kt,java}","**/res/**/*.xml","**/AndroidManifest.xml"],q={browser:M,node:F,backend:V,android:U},$=["**/*.spec.*","**/*.test.*","**/__tests__/**","**/__mocks__/**"];function x(n){const e=n.ignoredVerifyPatterns??[];return[...$,...e]}o(x,"resolveIgnoredVerifyPatterns");const K=["bdt_navigation_go-to","bdt_content_take-screenshot","bdt_a11y_take-aria-snapshot","bdt_o11y_get-console-messages"],Y=["ndt_debug_connect"],X=[{name:"probe",allOf:[{anyOf:["ndt_debug_put-tracepoint","ndt_debug_put-logpoint","ndt_debug_put-exceptionpoint"]},"ndt_debug_get-probe-snapshots"]},{name:"log",allOf:["ndt_debug_get-logs"]}],H=[],W=[{name:"protocol-call",allOf:[{anyOf:["bedt_request_http","bedt_request_grpc","bedt_request_graphql","bedt_request_websocket-open","bedt_request_replay"]}]},{name:"log-evidence",allOf:["bedt_log_register-source",{anyOf:["bedt_log_read","bedt_log_read-multi","bedt_log_follow"]}]},{name:"db-evidence",allOf:["bedt_db_connect",{anyOf:["bedt_db_query","bedt_db_describe-table","bedt_db_list-tables","bedt_db_snapshot","bedt_db_diff","bedt_db_get-changes"]}]}],G=["adt_device_connect"],Q=[{name:"device-evidence",allOf:[{anyOf:["adt_device_launch-app","adt_interaction_tap","adt_interaction_double-tap","adt_interaction_long-press","adt_interaction_input-text","adt_interaction_swipe","adt_interaction_scroll","adt_interaction_press-key","adt_interaction_deep-link"]},"adt_content_take-screenshot","adt_a11y_take-ui-snapshot"]},{name:"log-evidence",allOf:[{anyOf:["adt_o11y_log-read","adt_o11y_log-follow"]}]},{name:"network-evidence",allOf:["adt_o11y_get-http-requests"]}],Ce=3;function h(n){if(!(0,y.existsSync)(n))return{};try{return JSON.parse((0,y.readFileSync)(n,"utf-8"))}catch(e){return D.logger.debug(`failed to parse config ${n}: ${e}`),{}}}o(h,"loadJsonFile");function me(n,e){if(!Object.prototype.hasOwnProperty.call(n,"verification"))return;const t=n.verification;if(t===null||typeof t!="object"||Array.isArray(t))throw new Error(`Invalid IronBee config in ${e}: 'verification' must be an object. Expected shape: { "enable": boolean }.`);const r=t;if(Object.prototype.hasOwnProperty.call(r,"enable")&&typeof r.enable!="boolean")throw new Error(`Invalid IronBee config in ${e}: 'verification.enable' must be boolean. Got ${typeof r.enable}.`);if(Object.prototype.hasOwnProperty.call(r,"auto")&&typeof r.auto!="boolean")throw new Error(`Invalid IronBee config in ${e}: 'verification.auto' must be boolean. Got ${typeof r.auto}.`);if(Object.prototype.hasOwnProperty.call(r,"strict")&&typeof r.strict!="boolean")throw new Error(`Invalid IronBee config in ${e}: 'verification.strict' must be boolean. Got ${typeof r.strict}.`);if(Object.prototype.hasOwnProperty.call(r,"model")){const i=r.model,s=typeof i=="string",l=i!==null&&typeof i=="object"&&!Array.isArray(i)&&Object.values(i).every(a=>typeof a=="string");if(!s&&!l)throw new Error(`Invalid IronBee config in ${e}: 'verification.model' must be a string (applies to all clients) or an object of string values (per-client, e.g. { "claude": "sonnet", "codex": "gpt-5.5" }). Got ${Array.isArray(i)?"array":typeof i}.`)}}o(me,"assertVerificationShape");function Ae(n,e){const t=n.verification?.model;if(typeof t=="string")return t.length>0?t:void 0;if(t&&typeof t=="object"){const r=t[e];return typeof r=="string"&&r.length>0?r:void 0}}o(Ae,"getVerificationModel");function ve(n,e){if(!Object.prototype.hasOwnProperty.call(n,"telemetry"))return;const t=n.telemetry;if(t===null||typeof t!="object"||Array.isArray(t))throw new Error(`Invalid IronBee config in ${e}: 'telemetry' must be an object. Expected shape: { "enable": boolean }.`);const r=t;if(Object.prototype.hasOwnProperty.call(r,"enable")&&typeof r.enable!="boolean")throw new Error(`Invalid IronBee config in ${e}: 'telemetry.enable' must be boolean. Got ${typeof r.enable}.`)}o(ve,"assertTelemetryShape");function Ie(n,e){if(!Object.prototype.hasOwnProperty.call(n,"privacy"))return;const t=n.privacy;if(t===null||typeof t!="object"||Array.isArray(t))throw new Error(`Invalid IronBee config in ${e}: 'privacy' must be an object. Expected shape: { "enable": boolean }.`);const r=t;if(Object.prototype.hasOwnProperty.call(r,"enable")&&typeof r.enable!="boolean")throw new Error(`Invalid IronBee config in ${e}: 'privacy.enable' must be boolean. Got ${typeof r.enable}.`)}o(Ie,"assertPrivacyShape");function C(n,e){if(!(n===void 0&&e===void 0))return{...n??{},...e??{}}}o(C,"mergeCycleConfig");function B(n,e){const t={...n,...e};return t.browser=C(n.browser,e.browser),t.node=C(n.node,e.node),t.backend=C(n.backend,e.backend),t.android=C(n.android,e.android),t.claude=Re(n.claude,e.claude),t.codex=je(n.codex,e.codex),t.verification=we(n.verification,e.verification),t.verificationContext=xe(n.verificationContext,e.verificationContext),t.runtime=Te(n.runtime,e.runtime),t}o(B,"mergeConfigLayers");function Te(n,e){if(!(n===void 0&&e===void 0))return{...n??{},...e??{}}}o(Te,"mergeRuntimeConfig");function xe(n,e){if(!(n===void 0&&e===void 0))return{...n??{},...e??{}}}o(xe,"mergeVerificationContextConfig");function we(n,e){if(!(n===void 0&&e===void 0))return{...n??{},...e??{}}}o(we,"mergeVerificationConfig");function Re(n,e){if(n===void 0&&e===void 0)return;const t={...n??{},...e??{}};return(n?.oauthAccess!==void 0||e?.oauthAccess!==void 0)&&(t.oauthAccess={...n?.oauthAccess??{},...e?.oauthAccess??{}}),(n?.autoModeAllowlist!==void 0||e?.autoModeAllowlist!==void 0)&&(t.autoModeAllowlist={...n?.autoModeAllowlist??{},...e?.autoModeAllowlist??{}}),t}o(Re,"mergeClaudeConfig");function je(n,e){if(n===void 0&&e===void 0)return;const t={...n??{},...e??{}};return(n?.verifier!==void 0||e?.verifier!==void 0)&&(t.verifier={...n?.verifier??{},...e?.verifier??{}}),t}o(je,"mergeCodexConfig");function w(n){return{global:(0,b.join)((0,I.homedir)(),".ironbee","config.json"),project:n?(0,b.join)(n,".ironbee","config.json"):void 0,local:n?(0,b.join)(n,".ironbee","config.local.json"):void 0}}o(w,"getConfigLayerPaths");const Oe=["global","project","local"];function ke(n,e){const t=w(e);if(n==="global")return t.global;if(n==="project"){if(t.project===void 0)throw new Error("Project layer requested but no projectDir was provided.");return t.project}if(t.local===void 0)throw new Error("Local layer requested but no projectDir was provided.");return t.local}o(ke,"getTargetConfigPath");function he(n){if(n.global===!0&&n.local===!0)throw new Error("Pass at most one of --global / --local.");return n.global===!0?"global":n.local===!0?"local":"project"}o(he,"resolveConfigTargetFromFlags");function A(n){const e=h(n);return(0,y.existsSync)(n)&&(me(e,n),ve(e,n),Ie(e,n)),e}o(A,"loadAndValidateLayer");const R=[{envVar:"IRONBEE_API_KEY",configPath:"collector.apiKey"},{envVar:"IRONBEE_OAUTH_TOKEN",configPath:"collector.oauthToken"}];function Be(n,e,t){const r=e.split(".");let i=n;for(let s=0;s<r.length-1;s++){const l=r[s],a=i[l];a!=null&&typeof a=="object"&&!Array.isArray(a)?i[l]={...a}:i[l]={},i=i[l]}i[r[r.length-1]]=t}o(Be,"setAtConfigPath");function z(n){let e;for(const t of R){const r=process.env[t.envVar];if(r===void 0||r.length===0)continue;e===void 0&&(e={...n});const i=t.coerce?t.coerce(r):r;Be(e,t.configPath,i)}return e??n}o(z,"applyEnvOverrides");function Se(n){for(const e of R){if(e.configPath!==n)continue;const t=process.env[e.envVar];if(t!==void 0&&t.length>0)return e}}o(Se,"findActiveEnvOverride");function c(n){const e=w(n),t=A(e.global),r=e.project?A(e.project):{},i=e.local?A(e.local):{},s=B(B(t,r),i);return z(s)}o(c,"loadConfig");function Le(n){let e=n.replace(/\{([^}]+)\}/g,(t,r)=>`(${r.split(",").map(i=>i.trim()).join("|")})`);return e=e.replace(/\*\*\//g,"\0DSS\0").replace(/\*\*/g,"\0DS\0").replace(/\*/g,"\0SS\0").replace(/\?/g,"\0QM\0"),e=e.replace(/[.+^$\\[\]]/g,"\\$&"),e=e.replace(/\x00DSS\x00/g,"(?:.*/)?").replace(/\x00DS\x00/g,".*").replace(/\x00SS\x00/g,"[^/]*").replace(/\x00QM\x00/g,"[^/]"),new RegExp(`(^|/)${e}$`)}o(Le,"globToRegExp");function E(n,e){const t=n.replace(/\\/g,"/");for(const r of e)if(Le(r).test(t))return!0;return!1}o(E,"matchesAny");function Ne(n,e){if(e==="browser")return n.browser;if(e==="node")return n.node;if(e==="backend")return n.backend;if(e==="android")return n.android}o(Ne,"getCycleBlock");function v(n,e){const t=Ne(n,e);if(t!==void 0&&t.enable===!1)return[];const r=q[e]??[];if(t===void 0)return P.has(e)?[...r]:[];if(Array.isArray(t.verifyPatterns)&&t.verifyPatterns.length===0)return[];const i=t.verifyPatterns??r,s=t.additionalVerifyPatterns??[];return[...i,...s]}o(v,"getCyclePatterns");function J(n,e){const t=x(e);if(t.length>0&&E(n,t))return[];const r=[];E(n,v(e,"browser"))&&r.push("browser");for(const i of T){const s=v(e,i);s.length>0&&E(n,s)&&r.push(i)}return r}o(J,"getActiveCycles");function De(n,e){return J(n,e).length>0}o(De,"requiresVerification");function Pe(n,e){return O(n)?Z(n,e):!1}o(Pe,"isCycleEnabled");function Z(n,e){return v(n,e).length>0}o(Z,"isCyclePatternsActive");function Me(n,e){let t,r;if(e==="browser"?(t=n.browser?.alwaysRequired??K,r=n.browser?.evidencePaths??[]):e==="node"?(t=n.node?.alwaysRequired??Y,r=n.node?.evidencePaths??X):e==="backend"?(t=n.backend?.alwaysRequired??H,r=n.backend?.evidencePaths??W):e==="android"?(t=n.android?.alwaysRequired??G,r=n.android?.evidencePaths??Q):(t=[],r=[]),t.length===0&&r.length===0)throw new Error(`Invalid required-tools config for cycle '${e}': both 'alwaysRequired' and 'evidencePaths' are empty. At least one must specify required tools.`);return{alwaysRequired:t,evidencePaths:r}}o(Me,"getRequiredToolsConfig");const S="npx",Fe="^0.14.0",L=["-y",`@ironbee-ai/devtools@${Fe}`],Ve={TOOL_NAME_PREFIX:"bdt_",TOOL_INPUT_METADATA_ENABLE:"true",SCENARIOS_DIR:".ironbee/scenarios/bdt"},Ue={PLATFORM:"node",TOOL_NAME_PREFIX:"ndt_",TOOL_INPUT_METADATA_ENABLE:"true",SCENARIOS_DIR:".ironbee/scenarios/ndt"},qe={PLATFORM:"backend",TOOL_NAME_PREFIX:"bedt_",TOOL_INPUT_METADATA_ENABLE:"true",SCENARIOS_DIR:".ironbee/scenarios/bedt"},$e={PLATFORM:"android",TOOL_NAME_PREFIX:"adt_",TOOL_INPUT_METADATA_ENABLE:"true",SCENARIOS_DIR:".ironbee/scenarios/adt"},Ke={BROWSER_DEVTOOLS_INSTALL_CHROMIUM:"true"},Ye={},Xe={},He={};function We(n){return ce(n)?{}:{TELEMETRY_ENABLE:"false"}}o(We,"buildTelemetryEnv");function Ge(n){return le(n)?{COLLECTOR_EVENTS_TOOL_DETAILS_ENABLE:"false",COLLECTOR_ARTIFACTS_ENABLE:"false"}:{}}o(Ge,"buildPrivacyEnv");function Qe(n,e){if(!j(n))return{};const t=n.collector,i=h((0,b.join)((0,I.homedir)(),".ironbee","config.json")).collector??{},s=typeof i.oauthToken=="string"&&i.oauthToken.length>0,l=typeof i.apiKey=="string"&&i.apiKey.length>0;let a;t.oauthToken?a=s?"X-OAuth-Token=${file:~/.ironbee/config.json#collector.oauthToken}":`X-OAuth-Token=${t.oauthToken}`:a=l?"X-API-Key=${file:~/.ironbee/config.json#collector.apiKey}":`X-API-Key=${t.apiKey}`;const u={OTEL_ENABLE:"true",OTEL_EXPORTER_HTTP_URL:t.url,OTEL_EXPORTER_HTTP_HEADERS:a,OTEL_EXPORTER_TYPE:"otlp/http-protobuf"};return e==="browser"&&(u.OTEL_INSTRUMENTATION_USER_INTERACTION_EVENTS="change,input,click",u.BROWSER_HEADLESS_ENABLE="true"),u}o(Qe,"buildOTELEnv");function m(n,e,t,r,i){const s=Qe(n,i),l=We(n),a=Ge(n),u=n[e];if(u&&typeof u=="object"&&!Array.isArray(u)){const f=u;if(f.mcp&&typeof f.mcp=="object"&&!Array.isArray(f.mcp)){const g={...f.mcp},d={...s,...l,...a,...g.env??{},...t};return g.env=d,g}const k={};if(f.env&&typeof f.env=="object"&&!Array.isArray(f.env)){const g=f.env;for(const d of Object.keys(g))typeof g[d]=="string"&&(k[d]=g[d])}return{command:S,args:[...L],env:{...r,...s,...l,...a,...k,...t}}}return{command:S,args:[...L],env:{...r,...s,...l,...a,...t}}}o(m,"buildMcpEntry");function ze(n){const e=c(n);return m(e,"browserDevTools",Ve,Ke,"browser")}o(ze,"getMcpServerEntry");function Je(n){const e=c(n);return m(e,"nodeDevTools",Ue,Ye,"node")}o(Je,"getNodeDevToolsMcpEntry");function Ze(n){const e=c(n);return m(e,"backendDevTools",qe,Xe,"backend")}o(Ze,"getBackendDevToolsMcpEntry");function en(n){const e=c(n);return m(e,"androidDevTools",$e,He,"android")}o(en,"getAndroidDevToolsMcpEntry");function nn(n){return typeof n.maxRetries=="number"&&n.maxRetries>0?n.maxRetries:Ce}o(nn,"getMaxRetries");function j(n){if(process.env.IRONBEE_COLLECTOR==="false")return!1;const e=n.collector;if(!e||e.enable===!1||typeof e.url!="string"||e.url.length===0)return!1;const t=typeof e.oauthToken=="string"&&e.oauthToken.length>0,r=typeof e.apiKey=="string"&&e.apiKey.length>0;return!(!t&&!r)}o(j,"isCollectorConfigured");function tn(n){const e=c(n);return p(e,e.jobQueue)}o(tn,"isJobQueueEnabled");function on(n){const e=c(n);return p(e,e.recording)}o(on,"isRecordingEnabled");function rn(n){return p(n,n.statusLine)}o(rn,"isSessionStatusEnabled");function sn(n){const e=n.statusLine;return e!==void 0&&e.renderDefault===!0}o(sn,"getStatusLineRenderDefault");function an(n){const e=n.statusLine?.emitMinIntervalSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:10}o(an,"getStatusLineEmitMinIntervalSeconds");const ee=60;function cn(n){return n.claude?.oauthAccess?.enable!==!1}o(cn,"getClaudeOauthAccessEnabled");function ln(n){return n.codex?.verifier?.mode==="main-agent"?"main-agent":"sub-agent"}o(ln,"getCodexVerifierMode");function un(n){return n.claude?.autoModeAllowlist?.enable!==!1}o(un,"isAutoModeAllowlistEnabled");function fn(n){return n.claude?.trustWorkspace?.enable!==!1}o(fn,"isClaudeTrustWorkspaceEnabled");function gn(n){const e=n.claude?.oauthAccess?.usageTtlSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:ee}o(gn,"getClaudeOauthAccessUsageTtlSeconds");const ne=15986,te=600,oe=30,re=0;function dn(n){return p(n,n.otel)}o(dn,"isOTELEnabled");function pn(n){const e=n.otel?.port;return typeof e=="number"&&Number.isInteger(e)&&e>0&&e<65536?e:ne}o(pn,"getOTELPort");function bn(n){const e=n.otel?.idleTimeoutSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>0?e:te}o(bn,"getOTELIdleTimeoutSeconds");function En(n){const e=n.otel?.ensureMinIntervalSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:oe}o(En,"getOTELEnsureMinIntervalSeconds");function yn(n){const e=n.otel?.emitMinIntervalSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:re}o(yn,"getOTELEmitMinIntervalSeconds");function _n(n){const e=n.statusLine?.refreshInterval;if(typeof e=="number"&&Number.isFinite(e)&&e>=1)return e}o(_n,"getStatusLineRefreshInterval");function p(n,e){return e!=null&&typeof e=="object"&&!Array.isArray(e)?e.enable!==!1:j(n)}o(p,"isFeatureEnabledWithCollectorAutoEnable");function Dn(n){return n==null||typeof n!="object"||Array.isArray(n)?!1:n.enable!==!1}o(Dn,"isPresenceEnabled");function O(n){const e=n.verification;return e==null||typeof e!="object"||Array.isArray(e)?!0:e.enable!==!1}o(O,"getVerificationEnabled");function ie(n){const e=n.verification;return e==null||typeof e!="object"||Array.isArray(e)?!1:e.auto===!0}o(ie,"getAutoVerifyEnabled");function Cn(n){const e=n.verification;return e==null||typeof e!="object"||Array.isArray(e)?!1:e.strict===!0}o(Cn,"getVerificationStrict");const se=65536,ae=1;function mn(n){const e=n.verificationContext;return e==null||typeof e!="object"||Array.isArray(e)?!0:e.enable!==!1}o(mn,"getVerificationContextEnabled");function An(n){return n.verificationContext?.source==="actions"?"actions":"git"}o(An,"getVerificationContextSource");function vn(n){const e=n.verificationContext?.commitDepth;return typeof e=="number"&&Number.isFinite(e)&&e>=0?Math.floor(e):ae}o(vn,"getVerificationContextCommitDepth");function In(n){const e=n.verificationContext?.maxBytes;return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.floor(e):se}o(In,"getVerificationContextMaxBytes");function Tn(n,e){const t=x(n);return t.length>0&&E(e,t)}o(Tn,"isIgnoredVerifyPath");function xn(n){return O(n)?ie(n)?"enforce":"assist":"monitor"}o(xn,"getVerificationMode");function ce(n){const e=n.telemetry;return e==null||typeof e!="object"||Array.isArray(e)?!0:e.enable!==!1}o(ce,"getTelemetryEnabled");function le(n){const e=n.privacy;return e==null||typeof e!="object"||Array.isArray(e)?!1:e.enable===!0}o(le,"getPrivacyEnabled");const N=65536;function wn(n){const e=n.fileChange;return!e||typeof e!="object"||Array.isArray(e)?!1:e.captureChangeset===!0}o(wn,"getCaptureFileChangeset");function Rn(n){const e=n.fileChange;if(!e||typeof e!="object"||Array.isArray(e))return N;const t=e.maxChangesetBytes;return typeof t!="number"||!Number.isFinite(t)||t<=0?N:Math.floor(t)}o(Rn,"getMaxChangesetBytes");function jn(n){const e=c(n);return p(e,e.analytics)}o(jn,"isAnalyticsEnabled");function On(n){const t=c(n).analytics;return t===null||typeof t!="object"||Array.isArray(t)?!0:t.emitOnStop!==!1}o(On,"isAnalyticsEmitOnStopEnabled");function kn(n){const t=c(n).analytics;if(t===null||typeof t!="object"||Array.isArray(t))return 0;const r=t.emitOnStopMinIntervalSeconds;return typeof r=="number"&&r>=0?r:0}o(kn,"getAnalyticsEmitOnStopMinIntervalSeconds");function hn(n){const t=c(n).analytics;return t===null||typeof t!="object"||Array.isArray(t)?!1:t.emitTurnEvents===!0}o(hn,"isAnalyticsTurnEventsEnabled");function Bn(n){const t=c(n).analytics;return t===null||typeof t!="object"||Array.isArray(t)?!1:t.emitStepEvents===!0}o(Bn,"isAnalyticsStepEventsEnabled");function Sn(n){const t=c(n).analytics;return t===null||typeof t!="object"||Array.isArray(t)?!0:t.emitApiRequestEvents!==!1}o(Sn,"isAnalyticsApiRequestEventsEnabled");0&&(module.exports={ALL_CYCLES,CONFIG_TARGETS_BY_PRECEDENCE,CYCLES_ENABLED_BY_DEFAULT,CYCLE_DEFAULT_VERIFY_PATTERNS,CYCLE_TOOL_PREFIXES,CYCLE_TO_SERVER,DEFAULT_ANDROID_ALWAYS_REQUIRED,DEFAULT_ANDROID_EVIDENCE_PATHS,DEFAULT_ANDROID_VERIFY_PATTERNS,DEFAULT_BACKEND_ALWAYS_REQUIRED,DEFAULT_BACKEND_EVIDENCE_PATHS,DEFAULT_BACKEND_VERIFY_PATTERNS,DEFAULT_BROWSER_ALWAYS_REQUIRED,DEFAULT_BROWSER_VERIFY_PATTERNS,DEFAULT_IGNORED_VERIFY_PATTERNS,DEFAULT_NODE_ALWAYS_REQUIRED,DEFAULT_NODE_EVIDENCE_PATHS,DEFAULT_NODE_VERIFY_PATTERNS,DEFAULT_OAUTH_USAGE_TTL_SECONDS,DEFAULT_OTEL_EMIT_MIN_INTERVAL_SECONDS,DEFAULT_OTEL_ENSURE_MIN_INTERVAL_SECONDS,DEFAULT_OTEL_IDLE_TIMEOUT_SECONDS,DEFAULT_OTEL_PORT,DEFAULT_VERIFICATION_CONTEXT_COMMIT_DEPTH,DEFAULT_VERIFICATION_CONTEXT_MAX_BYTES,ENV_OVERRIDES,OPTIONAL_CYCLES,applyEnvOverrides,findActiveEnvOverride,getActiveCycles,getAnalyticsEmitOnStopMinIntervalSeconds,getAndroidDevToolsMcpEntry,getAutoVerifyEnabled,getBackendDevToolsMcpEntry,getCaptureFileChangeset,getClaudeOauthAccessEnabled,getClaudeOauthAccessUsageTtlSeconds,getCodexVerifierMode,getConfigLayerPaths,getMaxChangesetBytes,getMaxRetries,getMcpServerEntry,getNodeDevToolsMcpEntry,getOTELEmitMinIntervalSeconds,getOTELEnsureMinIntervalSeconds,getOTELIdleTimeoutSeconds,getOTELPort,getPrivacyEnabled,getRequiredToolsConfig,getStatusLineEmitMinIntervalSeconds,getStatusLineRefreshInterval,getStatusLineRenderDefault,getTargetConfigPath,getTelemetryEnabled,getVerificationContextCommitDepth,getVerificationContextEnabled,getVerificationContextMaxBytes,getVerificationContextSource,getVerificationEnabled,getVerificationMode,getVerificationModel,getVerificationStrict,isAnalyticsApiRequestEventsEnabled,isAnalyticsEmitOnStopEnabled,isAnalyticsEnabled,isAnalyticsStepEventsEnabled,isAnalyticsTurnEventsEnabled,isAutoModeAllowlistEnabled,isClaudeTrustWorkspaceEnabled,isCollectorConfigured,isCycleEnabled,isCyclePatternsActive,isIgnoredVerifyPath,isJobQueueEnabled,isOTELEnabled,isRecordingEnabled,isSessionStatusEnabled,loadConfig,matchesAny,requiresVerification,resolveConfigTargetFromFlags,resolveIgnoredVerifyPatterns});
|
|
1
|
+
"use strict";var A=Object.defineProperty;var de=Object.getOwnPropertyDescriptor;var pe=Object.getOwnPropertyNames;var be=Object.prototype.hasOwnProperty;var o=(n,e)=>A(n,"name",{value:e,configurable:!0});var Ee=(n,e)=>{for(var t in e)A(n,t,{get:e[t],enumerable:!0})},ye=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of pe(e))!be.call(n,i)&&i!==t&&A(n,i,{get:()=>e[i],enumerable:!(r=de(e,i))||r.enumerable});return n};var _e=n=>ye(A({},"__esModule",{value:!0}),n);var Kn={};Ee(Kn,{ALL_CYCLES:()=>me,CONFIG_TARGETS_BY_PRECEDENCE:()=>Be,CYCLES_ENABLED_BY_DEFAULT:()=>M,CYCLE_DEFAULT_VERIFY_PATTERNS:()=>$,CYCLE_TOOL_PREFIXES:()=>Ae,CYCLE_TO_SERVER:()=>Ce,DEFAULT_ANDROID_ALWAYS_REQUIRED:()=>Q,DEFAULT_ANDROID_EVIDENCE_PATHS:()=>z,DEFAULT_ANDROID_VERIFY_PATTERNS:()=>U,DEFAULT_BACKEND_ALWAYS_REQUIRED:()=>W,DEFAULT_BACKEND_EVIDENCE_PATHS:()=>G,DEFAULT_BACKEND_VERIFY_PATTERNS:()=>V,DEFAULT_BROWSER_ALWAYS_REQUIRED:()=>Y,DEFAULT_BROWSER_VERIFY_PATTERNS:()=>P,DEFAULT_CHECK_TIMEOUT_MS:()=>wn,DEFAULT_IGNORED_VERIFY_PATTERNS:()=>K,DEFAULT_NODE_ALWAYS_REQUIRED:()=>X,DEFAULT_NODE_EVIDENCE_PATHS:()=>H,DEFAULT_NODE_VERIFY_PATTERNS:()=>F,DEFAULT_OAUTH_USAGE_TTL_SECONDS:()=>oe,DEFAULT_OTEL_EMIT_MIN_INTERVAL_SECONDS:()=>ae,DEFAULT_OTEL_ENSURE_MIN_INTERVAL_SECONDS:()=>se,DEFAULT_OTEL_IDLE_TIMEOUT_SECONDS:()=>ie,DEFAULT_OTEL_PORT:()=>re,DEFAULT_TERMINAL_ALWAYS_REQUIRED:()=>J,DEFAULT_TERMINAL_EVIDENCE_PATHS:()=>Z,DEFAULT_TERMINAL_VERIFY_PATTERNS:()=>q,DEFAULT_VERIFICATION_CONTEXT_COMMIT_DEPTH:()=>ue,DEFAULT_VERIFICATION_CONTEXT_MAX_BYTES:()=>le,ENV_OVERRIDES:()=>k,OPTIONAL_CYCLES:()=>x,applyEnvOverrides:()=>ee,findActiveEnvOverride:()=>De,getActiveCycles:()=>ne,getAnalyticsEmitOnStopMinIntervalSeconds:()=>Vn,getAndroidDevToolsMcpEntry:()=>sn,getAutoVerifyEnabled:()=>ce,getBackendDevToolsMcpEntry:()=>rn,getCaptureFileChangeset:()=>Dn,getClaudeOauthAccessEnabled:()=>pn,getClaudeOauthAccessUsageTtlSeconds:()=>_n,getCodexVerifierMode:()=>bn,getConfigLayerPaths:()=>j,getMaxChangesetBytes:()=>Mn,getMaxRetries:()=>cn,getMcpServerEntry:()=>tn,getNodeDevToolsMcpEntry:()=>on,getOTELEmitMinIntervalSeconds:()=>In,getOTELEnsureMinIntervalSeconds:()=>vn,getOTELIdleTimeoutSeconds:()=>An,getOTELPort:()=>Cn,getPrivacyEnabled:()=>ge,getRequiredToolsConfig:()=>Ue,getStatusLineEmitMinIntervalSeconds:()=>dn,getStatusLineRefreshInterval:()=>Tn,getStatusLineRenderDefault:()=>gn,getTargetConfigPath:()=>Ne,getTelemetryEnabled:()=>fe,getTerminalDevToolsMcpEntry:()=>an,getVerificationChecks:()=>jn,getVerificationContextCommitDepth:()=>On,getVerificationContextEnabled:()=>Rn,getVerificationContextMaxBytes:()=>Bn,getVerificationContextMessage:()=>Nn,getVerificationContextSource:()=>hn,getVerificationEnabled:()=>h,getVerificationMode:()=>Sn,getVerificationModel:()=>Te,getVerificationStrict:()=>xn,hasVerificationChecks:()=>kn,isAnalyticsApiRequestEventsEnabled:()=>$n,isAnalyticsEmitOnStopEnabled:()=>Fn,isAnalyticsEnabled:()=>Pn,isAnalyticsStepEventsEnabled:()=>qn,isAnalyticsTurnEventsEnabled:()=>Un,isAutoModeAllowlistEnabled:()=>En,isClaudeTrustWorkspaceEnabled:()=>yn,isCollectorConfigured:()=>R,isCycleEnabled:()=>Ve,isCyclePatternsActive:()=>te,isIgnoredVerifyPath:()=>Ln,isJobQueueEnabled:()=>ln,isOTELEnabled:()=>mn,isRecordingEnabled:()=>un,isSessionStatusEnabled:()=>fn,loadConfig:()=>u,matchesAny:()=>_,requiresVerification:()=>Fe,resolveConfigTargetFromFlags:()=>Le,resolveIgnoredVerifyPatterns:()=>w});module.exports=_e(Kn);var m=require("fs"),y=require("path"),T=require("os"),D=require("./logger");const x=["node","backend","android","terminal"],me=["browser",...x],M=new Set(["browser"]),Ce={browser:"browser-devtools",node:"node-devtools",backend:"backend-devtools",android:"android-devtools",terminal:"terminal-devtools"},Ae={browser:"bdt_",node:"ndt_",backend:"bedt_",android:"adt_",terminal:"tdt_"},P=["*.ts","*.tsx","*.js","*.jsx","*.mjs","*.cjs","*.vue","*.svelte","*.html","*.htm","*.css","*.scss","*.sass","*.less","*.styl","*.py","*.rb","*.erb","*.go","*.rs","*.java","*.kt","*.kts","*.swift","*.c","*.cpp","*.h","*.hpp","*.cs","*.php","*.dart","*.ex","*.exs","*.erl","*.lua","*.r","*.R","*.scala","*.clj","*.cljs","*.zig","*.nim","*.hbs","*.ejs","*.pug","*.jade","*.astro"],F=["server/**/*.{ts,js,mjs,cjs}","src/server/**/*.{ts,js,mjs,cjs}","backend/**/*.{ts,js,mjs,cjs}","api/**/*.{ts,js,mjs,cjs}","src/api/**/*.{ts,js,mjs,cjs}","pages/api/**/*.{ts,js,mjs,cjs}","app/api/**/*.{ts,js,mjs,cjs}","routes/**/*.{ts,js,mjs,cjs}","**/server.{ts,js,mjs,cjs}"],V=["server/**/*.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","src/server/**/*.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","backend/**/*.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","api/**/*.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","src/api/**/*.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","pages/api/**/*.{ts,js,mjs,cjs}","app/api/**/*.{ts,js,mjs,cjs}","routes/**/*.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","controllers/**/*.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","handlers/**/*.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","services/**/*.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","**/server.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","**/main.{go,py,java,rb,kt,scala}"],U=["android/**/*.{kt,java}","app/src/**/*.{kt,java}","mobile/**/*.{kt,java}","src/main/kotlin/**/*.kt","src/main/java/**/*.java","**/*.{kt,java}","**/res/**/*.xml","**/AndroidManifest.xml"],q=["cli/**/*.{ts,js,mjs,cjs,py,go,rs,rb,java,kt}","cmd/**/*.{go,ts,js,mjs,cjs,py,rs}","**/cli/**/*.{ts,js,mjs,cjs,py,go,rs,rb,java,kt}","**/cmd/**/*.{go,ts,js,mjs,cjs,py,rs}","**/commands/**/*.{ts,js,mjs,cjs,py,go,rs,rb}","bin/**","**/bin/**/*.{ts,js,mjs,cjs,py,go,rs,rb,sh}","**/cli.{ts,js,mjs,cjs,py,go,rs,rb}","**/main.{go,rs}","**/*.{sh,bash,zsh,fish}"],$={browser:P,node:F,backend:V,android:U,terminal:q},K=["**/*.spec.*","**/*.test.*","**/__tests__/**","**/__mocks__/**"];function w(n){const e=n.ignoredVerifyPatterns??[];return[...K,...e]}o(w,"resolveIgnoredVerifyPatterns");const Y=["bdt_navigation_go-to","bdt_content_take-screenshot","bdt_a11y_take-aria-snapshot","bdt_o11y_get-console-messages"],X=["ndt_debug_connect"],H=[{name:"probe",allOf:[{anyOf:["ndt_debug_put-tracepoint","ndt_debug_put-logpoint","ndt_debug_put-exceptionpoint"]},"ndt_debug_get-probe-snapshots"]},{name:"log",allOf:["ndt_debug_get-logs"]}],W=[],G=[{name:"protocol-call",allOf:[{anyOf:["bedt_request_http","bedt_request_grpc","bedt_request_graphql","bedt_request_websocket-open","bedt_request_replay"]}]},{name:"log-evidence",allOf:["bedt_log_register-source",{anyOf:["bedt_log_read","bedt_log_read-multi","bedt_log_follow"]}]},{name:"db-evidence",allOf:["bedt_db_connect",{anyOf:["bedt_db_query","bedt_db_describe-table","bedt_db_list-tables","bedt_db_snapshot","bedt_db_diff","bedt_db_get-changes"]}]}],Q=["adt_device_connect"],z=[{name:"device-evidence",allOf:[{anyOf:["adt_device_launch-app","adt_interaction_tap","adt_interaction_double-tap","adt_interaction_long-press","adt_interaction_input-text","adt_interaction_swipe","adt_interaction_scroll","adt_interaction_press-key","adt_interaction_deep-link"]},"adt_content_take-screenshot","adt_a11y_take-ui-snapshot"]},{name:"log-evidence",allOf:[{anyOf:["adt_o11y_log-read","adt_o11y_log-follow"]}]},{name:"network-evidence",allOf:["adt_o11y_get-http-requests"]}],J=[],Z=[{name:"run-evidence",allOf:["tdt_pty_run"]},{name:"interactive-evidence",allOf:["tdt_pty_start",{anyOf:["tdt_interaction_send-keys","tdt_interaction_send-text"]},"tdt_content_capture"]}],ve=3;function O(n){if(!(0,m.existsSync)(n))return{};try{return JSON.parse((0,m.readFileSync)(n,"utf-8"))}catch(e){return D.logger.debug(`failed to parse config ${n}: ${e}`),{}}}o(O,"loadJsonFile");function Ie(n,e){if(!Object.prototype.hasOwnProperty.call(n,"verification"))return;const t=n.verification;if(t===null||typeof t!="object"||Array.isArray(t))throw new Error(`Invalid IronBee config in ${e}: 'verification' must be an object. Expected shape: { "enable": boolean }.`);const r=t;if(Object.prototype.hasOwnProperty.call(r,"enable")&&typeof r.enable!="boolean")throw new Error(`Invalid IronBee config in ${e}: 'verification.enable' must be boolean. Got ${typeof r.enable}.`);if(Object.prototype.hasOwnProperty.call(r,"auto")&&typeof r.auto!="boolean")throw new Error(`Invalid IronBee config in ${e}: 'verification.auto' must be boolean. Got ${typeof r.auto}.`);if(Object.prototype.hasOwnProperty.call(r,"strict")&&typeof r.strict!="boolean")throw new Error(`Invalid IronBee config in ${e}: 'verification.strict' must be boolean. Got ${typeof r.strict}.`);if(Object.prototype.hasOwnProperty.call(r,"model")){const i=r.model,s=typeof i=="string",c=i!==null&&typeof i=="object"&&!Array.isArray(i)&&Object.values(i).every(a=>typeof a=="string");if(!s&&!c)throw new Error(`Invalid IronBee config in ${e}: 'verification.model' must be a string (applies to all clients) or an object of string values (per-client, e.g. { "claude": "sonnet", "codex": "gpt-5.5" }). Got ${Array.isArray(i)?"array":typeof i}.`)}if(Object.prototype.hasOwnProperty.call(r,"context")){const i=r.context;if(i===null||typeof i!="object"||Array.isArray(i))throw new Error(`Invalid IronBee config in ${e}: 'verification.context' must be an object. Expected shape: { "enable"?: boolean, "source"?: "git"|"actions", "commitDepth"?: number, "maxBytes"?: number, "message"?: string }. Got ${Array.isArray(i)?"array":i===null?"null":typeof i}.`)}}o(Ie,"assertVerificationShape");function Te(n,e){const t=n.verification?.model;if(typeof t=="string")return t.length>0?t:void 0;if(t&&typeof t=="object"){const r=t[e];return typeof r=="string"&&r.length>0?r:void 0}}o(Te,"getVerificationModel");function xe(n,e){if(!Object.prototype.hasOwnProperty.call(n,"telemetry"))return;const t=n.telemetry;if(t===null||typeof t!="object"||Array.isArray(t))throw new Error(`Invalid IronBee config in ${e}: 'telemetry' must be an object. Expected shape: { "enable": boolean }.`);const r=t;if(Object.prototype.hasOwnProperty.call(r,"enable")&&typeof r.enable!="boolean")throw new Error(`Invalid IronBee config in ${e}: 'telemetry.enable' must be boolean. Got ${typeof r.enable}.`)}o(xe,"assertTelemetryShape");function we(n,e){if(!Object.prototype.hasOwnProperty.call(n,"privacy"))return;const t=n.privacy;if(t===null||typeof t!="object"||Array.isArray(t))throw new Error(`Invalid IronBee config in ${e}: 'privacy' must be an object. Expected shape: { "enable": boolean }.`);const r=t;if(Object.prototype.hasOwnProperty.call(r,"enable")&&typeof r.enable!="boolean")throw new Error(`Invalid IronBee config in ${e}: 'privacy.enable' must be boolean. Got ${typeof r.enable}.`)}o(we,"assertPrivacyShape");function p(n,e){if(!(n===void 0&&e===void 0))return{...n??{},...e??{}}}o(p,"mergeCycleConfig");function B(n,e){const t={...n,...e};return t.browser=p(n.browser,e.browser),t.node=p(n.node,e.node),t.backend=p(n.backend,e.backend),t.android=p(n.android,e.android),t.terminal=p(n.terminal,e.terminal),t.claude=he(n.claude,e.claude),t.codex=Oe(n.codex,e.codex),t.verification=Re(n.verification,e.verification),t.runtime=je(n.runtime,e.runtime),t}o(B,"mergeConfigLayers");function je(n,e){if(!(n===void 0&&e===void 0))return{...n??{},...e??{}}}o(je,"mergeRuntimeConfig");function ke(n,e){if(!(n===void 0&&e===void 0))return{...n??{},...e??{}}}o(ke,"mergeVerificationContextConfig");function Re(n,e){if(n===void 0&&e===void 0)return;const t={...n??{},...e??{}},r=ke(n?.context,e?.context);return r!==void 0?t.context=r:delete t.context,t}o(Re,"mergeVerificationConfig");function he(n,e){if(n===void 0&&e===void 0)return;const t={...n??{},...e??{}};return(n?.oauthAccess!==void 0||e?.oauthAccess!==void 0)&&(t.oauthAccess={...n?.oauthAccess??{},...e?.oauthAccess??{}}),(n?.autoModeAllowlist!==void 0||e?.autoModeAllowlist!==void 0)&&(t.autoModeAllowlist={...n?.autoModeAllowlist??{},...e?.autoModeAllowlist??{}}),t}o(he,"mergeClaudeConfig");function Oe(n,e){if(n===void 0&&e===void 0)return;const t={...n??{},...e??{}};return(n?.verifier!==void 0||e?.verifier!==void 0)&&(t.verifier={...n?.verifier??{},...e?.verifier??{}}),t}o(Oe,"mergeCodexConfig");function j(n){return{global:(0,y.join)((0,T.homedir)(),".ironbee","config.json"),project:n?(0,y.join)(n,".ironbee","config.json"):void 0,local:n?(0,y.join)(n,".ironbee","config.local.json"):void 0}}o(j,"getConfigLayerPaths");const Be=["global","project","local"];function Ne(n,e){const t=j(e);if(n==="global")return t.global;if(n==="project"){if(t.project===void 0)throw new Error("Project layer requested but no projectDir was provided.");return t.project}if(t.local===void 0)throw new Error("Local layer requested but no projectDir was provided.");return t.local}o(Ne,"getTargetConfigPath");function Le(n){if(n.global===!0&&n.local===!0)throw new Error("Pass at most one of --global / --local.");return n.global===!0?"global":n.local===!0?"local":"project"}o(Le,"resolveConfigTargetFromFlags");function v(n){const e=O(n);return(0,m.existsSync)(n)&&(Ie(e,n),xe(e,n),we(e,n)),e}o(v,"loadAndValidateLayer");const k=[{envVar:"IRONBEE_API_KEY",configPath:"collector.apiKey"},{envVar:"IRONBEE_OAUTH_TOKEN",configPath:"collector.oauthToken"}];function Se(n,e,t){const r=e.split(".");let i=n;for(let s=0;s<r.length-1;s++){const c=r[s],a=i[c];a!=null&&typeof a=="object"&&!Array.isArray(a)?i[c]={...a}:i[c]={},i=i[c]}i[r[r.length-1]]=t}o(Se,"setAtConfigPath");function ee(n){let e;for(const t of k){const r=process.env[t.envVar];if(r===void 0||r.length===0)continue;e===void 0&&(e={...n});const i=t.coerce?t.coerce(r):r;Se(e,t.configPath,i)}return e??n}o(ee,"applyEnvOverrides");function De(n){for(const e of k){if(e.configPath!==n)continue;const t=process.env[e.envVar];if(t!==void 0&&t.length>0)return e}}o(De,"findActiveEnvOverride");function u(n){const e=j(n),t=v(e.global),r=e.project?v(e.project):{},i=e.local?v(e.local):{},s=B(B(t,r),i);return ee(s)}o(u,"loadConfig");function Me(n){let e=n.replace(/\{([^}]+)\}/g,(t,r)=>`(${r.split(",").map(i=>i.trim()).join("|")})`);return e=e.replace(/\*\*\//g,"\0DSS\0").replace(/\*\*/g,"\0DS\0").replace(/\*/g,"\0SS\0").replace(/\?/g,"\0QM\0"),e=e.replace(/[.+^$\\[\]]/g,"\\$&"),e=e.replace(/\x00DSS\x00/g,"(?:.*/)?").replace(/\x00DS\x00/g,".*").replace(/\x00SS\x00/g,"[^/]*").replace(/\x00QM\x00/g,"[^/]"),new RegExp(`(^|/)${e}$`)}o(Me,"globToRegExp");function _(n,e){const t=n.replace(/\\/g,"/");for(const r of e)if(Me(r).test(t))return!0;return!1}o(_,"matchesAny");function Pe(n,e){if(e==="browser")return n.browser;if(e==="node")return n.node;if(e==="backend")return n.backend;if(e==="android")return n.android;if(e==="terminal")return n.terminal}o(Pe,"getCycleBlock");function I(n,e){const t=Pe(n,e);if(t!==void 0&&t.enable===!1)return[];const r=$[e]??[];if(t===void 0)return M.has(e)?[...r]:[];if(Array.isArray(t.verifyPatterns)&&t.verifyPatterns.length===0)return[];const i=t.verifyPatterns??r,s=t.additionalVerifyPatterns??[];return[...i,...s]}o(I,"getCyclePatterns");function ne(n,e){const t=w(e);if(t.length>0&&_(n,t))return[];const r=[];_(n,I(e,"browser"))&&r.push("browser");for(const i of x){const s=I(e,i);s.length>0&&_(n,s)&&r.push(i)}return r}o(ne,"getActiveCycles");function Fe(n,e){return ne(n,e).length>0}o(Fe,"requiresVerification");function Ve(n,e){return h(n)?te(n,e):!1}o(Ve,"isCycleEnabled");function te(n,e){return I(n,e).length>0}o(te,"isCyclePatternsActive");function Ue(n,e){let t,r;if(e==="browser"?(t=n.browser?.alwaysRequired??Y,r=n.browser?.evidencePaths??[]):e==="node"?(t=n.node?.alwaysRequired??X,r=n.node?.evidencePaths??H):e==="backend"?(t=n.backend?.alwaysRequired??W,r=n.backend?.evidencePaths??G):e==="android"?(t=n.android?.alwaysRequired??Q,r=n.android?.evidencePaths??z):e==="terminal"?(t=n.terminal?.alwaysRequired??J,r=n.terminal?.evidencePaths??Z):(t=[],r=[]),t.length===0&&r.length===0)throw new Error(`Invalid required-tools config for cycle '${e}': both 'alwaysRequired' and 'evidencePaths' are empty. At least one must specify required tools.`);return{alwaysRequired:t,evidencePaths:r}}o(Ue,"getRequiredToolsConfig");const N="npx",qe="^0.16.0",L=["-y",`@ironbee-ai/devtools@${qe}`],$e={TOOL_NAME_PREFIX:"bdt_",TOOL_INPUT_METADATA_ENABLE:"true",SCENARIOS_DIR:".ironbee/scenarios/bdt"},Ke={PLATFORM:"node",TOOL_NAME_PREFIX:"ndt_",TOOL_INPUT_METADATA_ENABLE:"true",SCENARIOS_DIR:".ironbee/scenarios/ndt"},Ye={PLATFORM:"backend",TOOL_NAME_PREFIX:"bedt_",TOOL_INPUT_METADATA_ENABLE:"true",SCENARIOS_DIR:".ironbee/scenarios/bedt"},Xe={PLATFORM:"android",TOOL_NAME_PREFIX:"adt_",TOOL_INPUT_METADATA_ENABLE:"true",SCENARIOS_DIR:".ironbee/scenarios/adt"},He={PLATFORM:"terminal",TOOL_NAME_PREFIX:"tdt_",TOOL_INPUT_METADATA_ENABLE:"true",SCENARIOS_DIR:".ironbee/scenarios/tdt"},We={BROWSER_DEVTOOLS_INSTALL_CHROMIUM:"true"},Ge={},Qe={},ze={},Je={};function Ze(n){return fe(n)?{}:{TELEMETRY_ENABLE:"false"}}o(Ze,"buildTelemetryEnv");function en(n){return ge(n)?{COLLECTOR_EVENTS_TOOL_DETAILS_ENABLE:"false",COLLECTOR_ARTIFACTS_ENABLE:"false"}:{}}o(en,"buildPrivacyEnv");function nn(n,e){if(!R(n))return{};const t=n.collector,i=O((0,y.join)((0,T.homedir)(),".ironbee","config.json")).collector??{},s=typeof i.oauthToken=="string"&&i.oauthToken.length>0,c=typeof i.apiKey=="string"&&i.apiKey.length>0;let a;t.oauthToken?a=s?"X-OAuth-Token=${file:~/.ironbee/config.json#collector.oauthToken}":`X-OAuth-Token=${t.oauthToken}`:a=c?"X-API-Key=${file:~/.ironbee/config.json#collector.apiKey}":`X-API-Key=${t.apiKey}`;const l={OTEL_ENABLE:"true",OTEL_EXPORTER_HTTP_URL:t.url,OTEL_EXPORTER_HTTP_HEADERS:a,OTEL_EXPORTER_TYPE:"otlp/http-protobuf"};return e==="browser"&&(l.OTEL_INSTRUMENTATION_USER_INTERACTION_EVENTS="change,input,click",l.BROWSER_HEADLESS_ENABLE="true"),l}o(nn,"buildOTELEnv");function b(n,e,t,r,i){const s=nn(n,i),c=Ze(n),a=en(n),l=n[e];if(l&&typeof l=="object"&&!Array.isArray(l)){const f=l;if(f.mcp&&typeof f.mcp=="object"&&!Array.isArray(f.mcp)){const g={...f.mcp},d={...s,...c,...a,...g.env??{},...t};return g.env=d,g}const C={};if(f.env&&typeof f.env=="object"&&!Array.isArray(f.env)){const g=f.env;for(const d of Object.keys(g))typeof g[d]=="string"&&(C[d]=g[d])}return{command:N,args:[...L],env:{...r,...s,...c,...a,...C,...t}}}return{command:N,args:[...L],env:{...r,...s,...c,...a,...t}}}o(b,"buildMcpEntry");function tn(n){const e=u(n);return b(e,"browserDevTools",$e,We,"browser")}o(tn,"getMcpServerEntry");function on(n){const e=u(n);return b(e,"nodeDevTools",Ke,Ge,"node")}o(on,"getNodeDevToolsMcpEntry");function rn(n){const e=u(n);return b(e,"backendDevTools",Ye,Qe,"backend")}o(rn,"getBackendDevToolsMcpEntry");function sn(n){const e=u(n);return b(e,"androidDevTools",Xe,ze,"android")}o(sn,"getAndroidDevToolsMcpEntry");function an(n){const e=u(n);return b(e,"terminalDevTools",He,Je,"terminal")}o(an,"getTerminalDevToolsMcpEntry");function cn(n){return typeof n.maxRetries=="number"&&n.maxRetries>0?n.maxRetries:ve}o(cn,"getMaxRetries");function R(n){if(process.env.IRONBEE_COLLECTOR==="false")return!1;const e=n.collector;if(!e||e.enable===!1||typeof e.url!="string"||e.url.length===0)return!1;const t=typeof e.oauthToken=="string"&&e.oauthToken.length>0,r=typeof e.apiKey=="string"&&e.apiKey.length>0;return!(!t&&!r)}o(R,"isCollectorConfigured");function ln(n){const e=u(n);return E(e,e.jobQueue)}o(ln,"isJobQueueEnabled");function un(n){const e=u(n);return E(e,e.recording)}o(un,"isRecordingEnabled");function fn(n){return E(n,n.statusLine)}o(fn,"isSessionStatusEnabled");function gn(n){const e=n.statusLine;return e!==void 0&&e.renderDefault===!0}o(gn,"getStatusLineRenderDefault");function dn(n){const e=n.statusLine?.emitMinIntervalSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:10}o(dn,"getStatusLineEmitMinIntervalSeconds");const oe=60;function pn(n){return n.claude?.oauthAccess?.enable!==!1}o(pn,"getClaudeOauthAccessEnabled");function bn(n){return n.codex?.verifier?.mode==="main-agent"?"main-agent":"sub-agent"}o(bn,"getCodexVerifierMode");function En(n){return n.claude?.autoModeAllowlist?.enable!==!1}o(En,"isAutoModeAllowlistEnabled");function yn(n){return n.claude?.trustWorkspace?.enable!==!1}o(yn,"isClaudeTrustWorkspaceEnabled");function _n(n){const e=n.claude?.oauthAccess?.usageTtlSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:oe}o(_n,"getClaudeOauthAccessUsageTtlSeconds");const re=15986,ie=600,se=30,ae=0;function mn(n){return E(n,n.otel)}o(mn,"isOTELEnabled");function Cn(n){const e=n.otel?.port;return typeof e=="number"&&Number.isInteger(e)&&e>0&&e<65536?e:re}o(Cn,"getOTELPort");function An(n){const e=n.otel?.idleTimeoutSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>0?e:ie}o(An,"getOTELIdleTimeoutSeconds");function vn(n){const e=n.otel?.ensureMinIntervalSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:se}o(vn,"getOTELEnsureMinIntervalSeconds");function In(n){const e=n.otel?.emitMinIntervalSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:ae}o(In,"getOTELEmitMinIntervalSeconds");function Tn(n){const e=n.statusLine?.refreshInterval;if(typeof e=="number"&&Number.isFinite(e)&&e>=1)return e}o(Tn,"getStatusLineRefreshInterval");function E(n,e){return e!=null&&typeof e=="object"&&!Array.isArray(e)?e.enable!==!1:R(n)}o(E,"isFeatureEnabledWithCollectorAutoEnable");function Xn(n){return n==null||typeof n!="object"||Array.isArray(n)?!1:n.enable!==!1}o(Xn,"isPresenceEnabled");function h(n){const e=n.verification;return e==null||typeof e!="object"||Array.isArray(e)?!0:e.enable!==!1}o(h,"getVerificationEnabled");function ce(n){const e=n.verification;return e==null||typeof e!="object"||Array.isArray(e)?!1:e.auto===!0}o(ce,"getAutoVerifyEnabled");function xn(n){const e=n.verification;return e==null||typeof e!="object"||Array.isArray(e)?!1:e.strict===!0}o(xn,"getVerificationStrict");const wn=12e4;function jn(n){const e=n.verification;if(e==null||typeof e!="object"||Array.isArray(e))return[];const t=e.checks;if(!Array.isArray(t))return[];const r=[];for(const i of t){if(i===null||typeof i!="object"||Array.isArray(i))continue;const s=i,c=s.name,a=s.command;if(typeof c!="string"||c.length===0||typeof a!="string"||a.length===0)continue;const l={name:c,command:a};if(Array.isArray(s.args)&&(l.args=s.args.filter(f=>typeof f=="string")),s.env!==null&&typeof s.env=="object"&&!Array.isArray(s.env)){const f={};for(const[C,g]of Object.entries(s.env))typeof g=="string"&&(f[C]=g);l.env=f}typeof s.cwd=="string"&&s.cwd.length>0&&(l.cwd=s.cwd),typeof s.timeoutMs=="number"&&Number.isFinite(s.timeoutMs)&&s.timeoutMs>0&&(l.timeoutMs=Math.floor(s.timeoutMs)),l.required=s.required!==!1,r.push(l)}return r}o(jn,"getVerificationChecks");function kn(n){const e=n.verification;if(e==null||typeof e!="object"||Array.isArray(e))return!1;const t=e.checks;return Array.isArray(t)&&t.length>0}o(kn,"hasVerificationChecks");const le=65536,ue=1;function Rn(n){const e=n.verification?.context;return e==null||typeof e!="object"||Array.isArray(e)?!0:e.enable!==!1}o(Rn,"getVerificationContextEnabled");function hn(n){return n.verification?.context?.source==="actions"?"actions":"git"}o(hn,"getVerificationContextSource");function On(n){const e=n.verification?.context?.commitDepth;return typeof e=="number"&&Number.isFinite(e)&&e>=0?Math.floor(e):ue}o(On,"getVerificationContextCommitDepth");function Bn(n){const e=n.verification?.context?.maxBytes;return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.floor(e):le}o(Bn,"getVerificationContextMaxBytes");function Nn(n){const e=n.verification?.context?.message;return typeof e=="string"?e.trim():""}o(Nn,"getVerificationContextMessage");function Ln(n,e){const t=w(n);return t.length>0&&_(e,t)}o(Ln,"isIgnoredVerifyPath");function Sn(n){return h(n)?ce(n)?"enforce":"assist":"monitor"}o(Sn,"getVerificationMode");function fe(n){const e=n.telemetry;return e==null||typeof e!="object"||Array.isArray(e)?!0:e.enable!==!1}o(fe,"getTelemetryEnabled");function ge(n){const e=n.privacy;return e==null||typeof e!="object"||Array.isArray(e)?!1:e.enable===!0}o(ge,"getPrivacyEnabled");const S=65536;function Dn(n){const e=n.fileChange;return!e||typeof e!="object"||Array.isArray(e)?!1:e.captureChangeset===!0}o(Dn,"getCaptureFileChangeset");function Mn(n){const e=n.fileChange;if(!e||typeof e!="object"||Array.isArray(e))return S;const t=e.maxChangesetBytes;return typeof t!="number"||!Number.isFinite(t)||t<=0?S:Math.floor(t)}o(Mn,"getMaxChangesetBytes");function Pn(n){const e=u(n);return E(e,e.analytics)}o(Pn,"isAnalyticsEnabled");function Fn(n){const t=u(n).analytics;return t===null||typeof t!="object"||Array.isArray(t)?!0:t.emitOnStop!==!1}o(Fn,"isAnalyticsEmitOnStopEnabled");function Vn(n){const t=u(n).analytics;if(t===null||typeof t!="object"||Array.isArray(t))return 0;const r=t.emitOnStopMinIntervalSeconds;return typeof r=="number"&&r>=0?r:0}o(Vn,"getAnalyticsEmitOnStopMinIntervalSeconds");function Un(n){const t=u(n).analytics;return t===null||typeof t!="object"||Array.isArray(t)?!1:t.emitTurnEvents===!0}o(Un,"isAnalyticsTurnEventsEnabled");function qn(n){const t=u(n).analytics;return t===null||typeof t!="object"||Array.isArray(t)?!1:t.emitStepEvents===!0}o(qn,"isAnalyticsStepEventsEnabled");function $n(n){const t=u(n).analytics;return t===null||typeof t!="object"||Array.isArray(t)?!0:t.emitApiRequestEvents!==!1}o($n,"isAnalyticsApiRequestEventsEnabled");0&&(module.exports={ALL_CYCLES,CONFIG_TARGETS_BY_PRECEDENCE,CYCLES_ENABLED_BY_DEFAULT,CYCLE_DEFAULT_VERIFY_PATTERNS,CYCLE_TOOL_PREFIXES,CYCLE_TO_SERVER,DEFAULT_ANDROID_ALWAYS_REQUIRED,DEFAULT_ANDROID_EVIDENCE_PATHS,DEFAULT_ANDROID_VERIFY_PATTERNS,DEFAULT_BACKEND_ALWAYS_REQUIRED,DEFAULT_BACKEND_EVIDENCE_PATHS,DEFAULT_BACKEND_VERIFY_PATTERNS,DEFAULT_BROWSER_ALWAYS_REQUIRED,DEFAULT_BROWSER_VERIFY_PATTERNS,DEFAULT_CHECK_TIMEOUT_MS,DEFAULT_IGNORED_VERIFY_PATTERNS,DEFAULT_NODE_ALWAYS_REQUIRED,DEFAULT_NODE_EVIDENCE_PATHS,DEFAULT_NODE_VERIFY_PATTERNS,DEFAULT_OAUTH_USAGE_TTL_SECONDS,DEFAULT_OTEL_EMIT_MIN_INTERVAL_SECONDS,DEFAULT_OTEL_ENSURE_MIN_INTERVAL_SECONDS,DEFAULT_OTEL_IDLE_TIMEOUT_SECONDS,DEFAULT_OTEL_PORT,DEFAULT_TERMINAL_ALWAYS_REQUIRED,DEFAULT_TERMINAL_EVIDENCE_PATHS,DEFAULT_TERMINAL_VERIFY_PATTERNS,DEFAULT_VERIFICATION_CONTEXT_COMMIT_DEPTH,DEFAULT_VERIFICATION_CONTEXT_MAX_BYTES,ENV_OVERRIDES,OPTIONAL_CYCLES,applyEnvOverrides,findActiveEnvOverride,getActiveCycles,getAnalyticsEmitOnStopMinIntervalSeconds,getAndroidDevToolsMcpEntry,getAutoVerifyEnabled,getBackendDevToolsMcpEntry,getCaptureFileChangeset,getClaudeOauthAccessEnabled,getClaudeOauthAccessUsageTtlSeconds,getCodexVerifierMode,getConfigLayerPaths,getMaxChangesetBytes,getMaxRetries,getMcpServerEntry,getNodeDevToolsMcpEntry,getOTELEmitMinIntervalSeconds,getOTELEnsureMinIntervalSeconds,getOTELIdleTimeoutSeconds,getOTELPort,getPrivacyEnabled,getRequiredToolsConfig,getStatusLineEmitMinIntervalSeconds,getStatusLineRefreshInterval,getStatusLineRenderDefault,getTargetConfigPath,getTelemetryEnabled,getTerminalDevToolsMcpEntry,getVerificationChecks,getVerificationContextCommitDepth,getVerificationContextEnabled,getVerificationContextMaxBytes,getVerificationContextMessage,getVerificationContextSource,getVerificationEnabled,getVerificationMode,getVerificationModel,getVerificationStrict,hasVerificationChecks,isAnalyticsApiRequestEventsEnabled,isAnalyticsEmitOnStopEnabled,isAnalyticsEnabled,isAnalyticsStepEventsEnabled,isAnalyticsTurnEventsEnabled,isAutoModeAllowlistEnabled,isClaudeTrustWorkspaceEnabled,isCollectorConfigured,isCycleEnabled,isCyclePatternsActive,isIgnoredVerifyPath,isJobQueueEnabled,isOTELEnabled,isRecordingEnabled,isSessionStatusEnabled,loadConfig,matchesAny,requiresVerification,resolveConfigTargetFromFlags,resolveIgnoredVerifyPatterns});
|
package/dist/lib/event.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var r=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var i=(t,e)=>r(t,"name",{value:e,configurable:!0});var l=(t,e)=>{for(var s in e)r(t,s,{get:e[s],enumerable:!0})},c=(t,e,s,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of _(e))!u.call(t,n)&&n!==s&&r(t,n,{get:()=>e[n],enumerable:!(a=o(e,n))||a.enumerable});return t};var y=t=>c(r({},"__esModule",{value:!0}),t);var E={};l(E,{EventType:()=>d,formatHexAsUuid:()=>g});module.exports=y(E);const d={SESSION_START:"session_start",SESSION_END:"session_end",ACTIVITY_START:"activity_start",ACTIVITY_END:"activity_end",VERIFICATION_START:"verification_start",VERIFICATION_END:"verification_end",VERIFICATION_REQUESTED:"verification_requested",VERDICT_WRITE:"verdict_write",FIX_START:"fix_start",FIX_END:"fix_end",FILE_CHANGE:"file_change",TOOL_CALL:"tool_call",SESSION_ANALYTICS:"session_analytics",SESSION_TURN:"session_turn_analytics",SESSION_TURN_STEP:"session_turn_step_analytics",API_REQUEST:"api_request",SESSION_STATUS:"session_status",SESSION_CONTEXT:"session_context"};function g(t){const e=t.padEnd(32,"0").slice(0,32);return`${e.slice(0,8)}-${e.slice(8,12)}-${e.slice(12,16)}-${e.slice(16,20)}-${e.slice(20,32)}`}i(g,"formatHexAsUuid");0&&(module.exports={EventType,formatHexAsUuid});
|
|
1
|
+
"use strict";var r=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var i=(t,e)=>r(t,"name",{value:e,configurable:!0});var l=(t,e)=>{for(var s in e)r(t,s,{get:e[s],enumerable:!0})},c=(t,e,s,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of _(e))!u.call(t,n)&&n!==s&&r(t,n,{get:()=>e[n],enumerable:!(a=o(e,n))||a.enumerable});return t};var y=t=>c(r({},"__esModule",{value:!0}),t);var E={};l(E,{EventType:()=>d,formatHexAsUuid:()=>g});module.exports=y(E);const d={SESSION_START:"session_start",SESSION_END:"session_end",ACTIVITY_START:"activity_start",ACTIVITY_END:"activity_end",VERIFICATION_START:"verification_start",VERIFICATION_END:"verification_end",VERIFICATION_REQUESTED:"verification_requested",VERDICT_WRITE:"verdict_write",FIX_START:"fix_start",FIX_END:"fix_end",FILE_CHANGE:"file_change",TOOL_CALL:"tool_call",SESSION_ANALYTICS:"session_analytics",SESSION_TURN:"session_turn_analytics",SESSION_TURN_STEP:"session_turn_step_analytics",API_REQUEST:"api_request",SESSION_STATUS:"session_status",SESSION_CONTEXT:"session_context",CHECK_RESULT:"check_result"};function g(t){const e=t.padEnd(32,"0").slice(0,32);return`${e.slice(0,8)}-${e.slice(8,12)}-${e.slice(12,16)}-${e.slice(16,20)}-${e.slice(20,32)}`}i(g,"formatHexAsUuid");0&&(module.exports={EventType,formatHexAsUuid});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var g=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var s=(n,t)=>g(n,"name",{value:t,configurable:!0});var A=(n,t)=>{for(var e in t)g(n,e,{get:t[e],enumerable:!0})},P=(n,t,e,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of C(t))!S.call(n,o)&&o!==e&&g(n,o,{get:()=>t[o],enumerable:!(l=x(t,o))||l.enumerable});return n};var R=n=>P(g({},"__esModule",{value:!0}),n);var H={};A(H,{runHeadlessCommand:()=>$});module.exports=R(H);var w=require("child_process");function $(n,t,e){return new Promise((l,o)=>{const d=new AbortController,c=s(()=>d.abort(),"onExternalAbort");e.signal&&(e.signal.aborted?d.abort():e.signal.addEventListener("abort",c,{once:!0}));const E=setTimeout(()=>d.abort(),Math.max(1,e.timeoutMs));let v="",f="",a=!1;const b=s(()=>{clearTimeout(E),e.signal&&e.signal.removeEventListener("abort",c)},"cleanup"),p=s(r=>{a||(a=!0,b(),l(r))},"settleResolve"),u=s(r=>{a||(a=!0,b(),o(r))},"settleReject"),h=e.input!==void 0?"pipe":"ignore";let i;try{i=(0,w.spawn)(n,[...t],{cwd:e.cwd,signal:d.signal,stdio:[h,"pipe","pipe"]})}catch(r){u(r instanceof Error?r:new Error(String(r)));return}i.stdout?.on("data",r=>{v+=r.toString()}),i.stderr?.on("data",r=>{f+=r.toString()}),i.on("error",r=>{u(r)}),i.on("close",r=>{if(d.signal.aborted){u(new Error("aborted"));return}if(r===0){p(v);return}const m=f.trim().slice(-200);u(new Error(`'${n}' exited with code ${r??"null"}${m?`: ${m}`:""}`))}),e.input!==void 0&&i.stdin&&(i.stdin.on("error",()=>{}),i.stdin.write(e.input),i.stdin.end())})}s($,"runHeadlessCommand");0&&(module.exports={runHeadlessCommand});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var r=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var L=(e,S)=>{for(var o in S)r(e,o,{get:S[o],enumerable:!0})},N=(e,S,o,t)=>{if(S&&typeof S=="object"||typeof S=="function")for(let n of E(S))!I.call(e,n)&&n!==o&&r(e,n,{get:()=>S[n],enumerable:!(t=A(S,n))||t.enumerable});return e};var _=e=>N(r({},"__esModule",{value:!0}),e);var c={};L(c,{INSTALL_SCHEMA_VERSION:()=>b});module.exports=_(c);const b=
|
|
1
|
+
"use strict";var r=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var L=(e,S)=>{for(var o in S)r(e,o,{get:S[o],enumerable:!0})},N=(e,S,o,t)=>{if(S&&typeof S=="object"||typeof S=="function")for(let n of E(S))!I.call(e,n)&&n!==o&&r(e,n,{get:()=>S[n],enumerable:!(t=A(S,n))||t.enumerable});return e};var _=e=>N(r({},"__esModule",{value:!0}),e);var c={};L(c,{INSTALL_SCHEMA_VERSION:()=>b});module.exports=_(c);const b=15;0&&(module.exports={INSTALL_SCHEMA_VERSION});
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
"use strict";var p=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var
|
|
1
|
+
"use strict";var p=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var E=Object.prototype.hasOwnProperty;var l=(e,n)=>p(e,"name",{value:n,configurable:!0});var O=(e,n)=>{for(var t in n)p(e,t,{get:n[t],enumerable:!0})},j=(e,n,t,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of x(n))!E.call(e,r)&&r!==t&&p(e,r,{get:()=>n[r],enumerable:!(i=F(n,r))||i.enumerable});return e};var B=e=>j(p({},"__esModule",{value:!0}),e);var _={};O(_,{PLATFORM_TARGETS:()=>v,applyPlatformSection:()=>R,applyPlatformToProjectFiles:()=>P,fragmentFilename:()=>$,readFragment:()=>A,syncPlatformSectionsToConfig:()=>C,togglePlatformSectionInFile:()=>w});module.exports=B(_);var c=require("fs"),m=require("./logger"),b=require("./config");const L={browser:["<!-- Browser cycle verification is OFF for this project."," - To verify frontend / UI changes by driving a real browser (DOM, console,"," screenshots, accessibility, network): run `ironbee browser enable` to enable."," This file will be auto-updated with the browser-cycle guidance."," - When OFF, do NOT invoke any `bdt_*` tools voluntarily \u2014 there is no"," active browser-cycle gate, so calling them only wastes cycles. -->"].join(`
|
|
2
2
|
`),node:["<!-- Node.js runtime debug verification is OFF for this project."," - If your backend is Node.js and you want non-blocking debugger probes:"," run `ironbee node enable` to enable. This file will be auto-updated"," with the node-cycle guidance."," - If your backend isn't Node.js (Java / Python / Go / Rust / .NET / Ruby / PHP / Elixir / \u2026):"," leave this OFF \u2014 `ndt_*` tools only attach to V8/Node processes and will fail elsewhere."," - When OFF, do NOT invoke any `ndt_*` tools voluntarily. -->"].join(`
|
|
3
3
|
`),backend:["<!-- Backend protocol verification is OFF for this project."," - To verify backend services by driving real protocol calls (HTTP / gRPC /"," GraphQL / WebSocket) \u2014 runtime- and language-agnostic \u2014 run `ironbee"," backend enable`. This file will be auto-updated with the backend-cycle"," guidance."," - When OFF, do NOT invoke any `bedt_*` tools voluntarily. -->"].join(`
|
|
4
4
|
`),android:["<!-- Android mobile verification is OFF for this project."," - To verify Android app changes by driving a real device or emulator (UI"," interactions, Logcat, screenshots): run `ironbee android enable`."," This file will be auto-updated with the android-cycle guidance."," - When OFF, do NOT invoke any `adt_*` tools voluntarily. -->"].join(`
|
|
5
|
-
`)
|
|
6
|
-
${
|
|
7
|
-
${
|
|
5
|
+
`),terminal:["<!-- Terminal interaction verification is OFF for this project."," - To verify CLI / REPL / TUI changes by driving the program in a PTY"," (send input, read output): run `ironbee terminal enable`. This file"," will be auto-updated with the terminal-cycle guidance."," - When OFF, do NOT invoke any `tdt_*` tools voluntarily. -->"].join(`
|
|
6
|
+
`)};function S(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}l(S,"escapeRegex");function I(e){return new RegExp(`<!--IRONBEE:PLATFORM:${S(e)}(?::([\\w-]+))?-->`,"g")}l(I,"startMarkerRegex");function M(e,n){return n.length>0?`<!--/IRONBEE:PLATFORM:${e}:${n}-->`:`<!--/IRONBEE:PLATFORM:${e}-->`}l(M,"endMarkerFor");function N(e,n,t){const i=I(n),r=[],d=new Set;let s=i.exec(e);for(;s!==null;){const o=s[1]??"",a=s.index+s[0].length,f=M(n,o),h=e.indexOf(f,a);if(h===-1){const g=t?` in ${t}`:"",u=o.length>0?`${n}:${o}`:n;m.logger.debug(`platform-section ${u}: start marker found without matching end marker${g}`),s=i.exec(e);continue}if(d.has(o)){const g=t?` in ${t}`:"",u=o.length>0?`${n}:${o}`:n;m.logger.warn(`platform-section ${u}: multiple marker blocks with the same key${g} \u2014 only the first will be updated. Either consolidate the blocks or use distinct keys (\`IRONBEE:PLATFORM:${n}:<key>\`) per position.`),s=i.exec(e);continue}d.add(o),r.push({key:o,startEnd:a,endIdx:h}),s=i.exec(e)}return r}l(N,"findMarkerBlocks");function R(e,n,t,i){const r=typeof t=="function"?t:()=>t,d=N(e,n,i);if(d.length===0)return e;const s=L[n];if(s===void 0)throw new Error(`No placeholder registered for platform '${n}'.`);let o=e;for(let a=d.length-1;a>=0;a--){const f=d[a],h=r(f.key)??s,g=o.substring(0,f.startEnd),u=o.substring(f.endIdx);o=`${g}
|
|
7
|
+
${h}
|
|
8
|
+
${u}`}return o}l(R,"applyPlatformSection");function $(e,n,t){return t.length>0?`${e}.${n}.${t}.md`:`${e}.${n}.md`}l($,"fragmentFilename");function A(e,n){const t=`${e}/${n}`;if(!(0,c.existsSync)(t))throw new Error(`Platform fragment not found: ${t}`);return(0,c.readFileSync)(t,"utf-8").trimEnd()}l(A,"readFragment");function w(e,n,t){if(!(0,c.existsSync)(e))return!1;const i=(0,c.readFileSync)(e,"utf-8"),r=R(i,n,t,e);return r===i?!1:((0,c.writeFileSync)(e,r),!0)}l(w,"togglePlatformSectionInFile");const v={claude:[{projectRelativePath:".claude/agents/ironbee-verifier.md",fragmentBase:"skill"},{projectRelativePath:".claude/agents/ironbee-scenario.md",fragmentBase:"scenario"}],cursor:[{projectRelativePath:".cursor/skills/ironbee-verification.md",fragmentBase:"skill"},{projectRelativePath:".cursor/rules/ironbee-verification.mdc",fragmentBase:"rule"},{projectRelativePath:".cursor/skills/ironbee-verify/SKILL.md",fragmentBase:"command-verify"},{projectRelativePath:".cursor/skills/ironbee-manage-scenario/SKILL.md",fragmentBase:"scenario"},{projectRelativePath:".cursor/skills/ironbee-search-scenario/SKILL.md",fragmentBase:"scenario"},{projectRelativePath:".cursor/skills/ironbee-sync-scenario/SKILL.md",fragmentBase:"scenario"}],codex:[]};function P(e,n,t,i,r){const d=[],s=Object.keys(v),o=r===void 0?s:s.filter(a=>r.includes(a));for(const a of o){const f=v[a],h=i(a);for(const g of f){const u=`${e}/${g.projectRelativePath}`;if(!(0,c.existsSync)(u))continue;w(u,n,t?y=>{const k=`${h}/${$(g.fragmentBase,n,y)}`;if(!(0,c.existsSync)(k)){const T=y.length>0?`${n}:${y}`:n;return m.logger.warn(`platform-section ${T}: missing fragment ${k} for ${g.projectRelativePath} \u2014 falling back to placeholder.`),null}return(0,c.readFileSync)(k,"utf-8").trimEnd()}:null)&&d.push(g.projectRelativePath)}}return d}l(P,"applyPlatformToProjectFiles");function C(e,n){const t=(0,b.loadConfig)(e);for(const i of b.ALL_CYCLES){const r=(0,b.isCycleEnabled)(t,i);P(e,i,r,n)}}l(C,"syncPlatformSectionsToConfig");0&&(module.exports={PLATFORM_TARGETS,applyPlatformSection,applyPlatformToProjectFiles,fragmentFilename,readFragment,syncPlatformSectionsToConfig,togglePlatformSectionInFile});
|