@ironbee-ai/cli 0.31.0 → 0.32.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.
Files changed (60) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/clients/claude/agents/ironbee-scenario.md +4 -1
  3. package/dist/clients/claude/agents/ironbee-verifier.md +21 -3
  4. package/dist/clients/claude/hooks/require-verdict.js +2 -2
  5. package/dist/clients/claude/hooks/require-verification.js +3 -3
  6. package/dist/clients/claude/hooks/track-action-monitor.js +1 -1
  7. package/dist/clients/claude/hooks/track-action.js +1 -1
  8. package/dist/clients/claude/index.js +4 -4
  9. package/dist/clients/claude/platforms/scenario.terminal.md +26 -0
  10. package/dist/clients/claude/platforms/skill.browser.md +1 -1
  11. package/dist/clients/claude/platforms/skill.terminal.md +62 -0
  12. package/dist/clients/codex/agents/ironbee-scenario.md +3 -0
  13. package/dist/clients/codex/agents/ironbee-verifier.md +20 -2
  14. package/dist/clients/codex/commands/ironbee-manage-scenario/SKILL.main.md +3 -0
  15. package/dist/clients/codex/commands/ironbee-search-scenario/SKILL.main.md +3 -0
  16. package/dist/clients/codex/commands/ironbee-sync-scenario/SKILL.main.md +3 -0
  17. package/dist/clients/codex/commands/ironbee-verify/SKILL.main.md +3 -0
  18. package/dist/clients/codex/hooks/require-verification.js +1 -1
  19. package/dist/clients/codex/hooks/track-action.js +1 -1
  20. package/dist/clients/codex/index.js +2 -2
  21. package/dist/clients/codex/platforms/command-verify.terminal.md +61 -0
  22. package/dist/clients/codex/platforms/rule.terminal.md +31 -0
  23. package/dist/clients/codex/platforms/scenario.terminal.md +36 -0
  24. package/dist/clients/codex/platforms/skill.browser.md +1 -1
  25. package/dist/clients/codex/platforms/skill.terminal.md +57 -0
  26. package/dist/clients/codex/rules/ironbee-verification.main.md +3 -0
  27. package/dist/clients/codex/skills/ironbee-verification.main.md +3 -0
  28. package/dist/clients/codex/util.js +1 -1
  29. package/dist/clients/cursor/commands/ironbee-manage-scenario/SKILL.md +3 -0
  30. package/dist/clients/cursor/commands/ironbee-search-scenario/SKILL.md +3 -0
  31. package/dist/clients/cursor/commands/ironbee-sync-scenario/SKILL.md +3 -0
  32. package/dist/clients/cursor/commands/ironbee-verify/SKILL.md +3 -0
  33. package/dist/clients/cursor/hooks/require-verdict.js +2 -2
  34. package/dist/clients/cursor/hooks/require-verification.js +3 -3
  35. package/dist/clients/cursor/hooks/track-action-monitor.js +1 -1
  36. package/dist/clients/cursor/hooks/track-action.js +1 -1
  37. package/dist/clients/cursor/index.js +1 -1
  38. package/dist/clients/cursor/platforms/command-verify.terminal.md +61 -0
  39. package/dist/clients/cursor/platforms/rule.terminal.md +31 -0
  40. package/dist/clients/cursor/platforms/scenario.terminal.md +29 -0
  41. package/dist/clients/cursor/platforms/skill.browser.md +1 -1
  42. package/dist/clients/cursor/platforms/skill.terminal.md +54 -0
  43. package/dist/clients/cursor/rules/ironbee-verification.mdc +3 -0
  44. package/dist/clients/cursor/skills/ironbee-verification.md +9 -0
  45. package/dist/commands/config.js +2 -2
  46. package/dist/commands/install.js +1 -1
  47. package/dist/commands/scenario.js +1 -1
  48. package/dist/commands/terminal.js +1 -0
  49. package/dist/hooks/core/verification-context.js +19 -15
  50. package/dist/hooks/core/verify-gate.js +25 -20
  51. package/dist/import/claude/events/tool-call.js +1 -1
  52. package/dist/import/codex/events/tool-call.js +1 -1
  53. package/dist/index.js +1 -1
  54. package/dist/lib/config.js +1 -1
  55. package/dist/lib/install-version.js +1 -1
  56. package/dist/lib/platform-section.js +5 -4
  57. package/dist/lib/scenario-staleness.js +1 -1
  58. package/dist/tui/config/schema.js +1 -1
  59. package/dist/tui/platforms/area.js +2 -2
  60. package/package.json +1 -1
@@ -1,9 +1,9 @@
1
- "use strict";var T=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var z=Object.getOwnPropertyNames;var K=Object.prototype.hasOwnProperty;var u=(e,t)=>T(e,"name",{value:t,configurable:!0});var W=(e,t)=>{for(var i in t)T(e,i,{get:t[i],enumerable:!0})},X=(e,t,i,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of z(t))!K.call(e,s)&&s!==i&&T(e,s,{get:()=>t[s],enumerable:!(o=Q(t,s))||o.enumerable});return e};var Z=e=>X(T({},"__esModule",{value:!0}),e);var ge={};W(ge,{runVerifyGate:()=>fe});module.exports=Z(ge);var b=require("fs"),d=require("../../lib/logger"),V=require("../../lib/telemetry"),h=require("./actions"),r=require("./session-state"),B=require("./activity-participants"),p=require("../../lib/config"),M=require("./required-tools");const ee=3,te=1;function ie(e){const t=p.CYCLE_TO_SERVER[e];if(t===void 0)throw new Error(`No MCP server registered for cycle '${e}'.`);return t}u(ie,"mcpServerForCycle");function _(e){return JSON.stringify({session_id:e,status:"pass",checks:["form submits successfully","new item appears in list","no console errors"]})}u(_,"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 k(...e){for(const t of e)try{(0,b.existsSync)(t)&&(0,b.unlinkSync)(t)}catch(i){d.logger.debug(`failed to cleanup ${t}: ${i}`)}}u(k,"cleanup");function oe(e){if(!(0,b.existsSync)(e))return null;try{return JSON.parse((0,b.readFileSync)(e,"utf-8"))}catch{return null}}u(oe,"readVerdictQuietly");function re(e,t){const i=(0,h.getFileChangesSinceLastVerification)(e),o=new Set;for(const f of i)for(const a of(0,p.getActiveCycles)(f.file_path,t))o.add(a);const s=[];o.has("browser")&&s.push("browser");for(const f of p.OPTIONAL_CYCLES)o.has(f)&&s.push(f);return s}u(re,"computeActiveCycles");function ne(e,t,i){const o=ie(e),s=new Set(t.filter(a=>a.tool_type==="mcp"&&a.mcp_server===o).map(a=>a.tool_name)),f=(0,p.getRequiredToolsConfig)(i,e);return{cycle:e,result:(0,M.satisfyRequiredTools)(s,f),config:f,usedCount:s.size}}u(ne,"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,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);throw new Error(`No evidence checker registered for cycle '${e}'.`)}u(de,"checkCycleEvidence");function ue(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(o=>` - ${o}`).join(`
1
+ "use strict";var A=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var z=Object.getOwnPropertyNames;var K=Object.prototype.hasOwnProperty;var d=(e,t)=>A(e,"name",{value:t,configurable:!0});var W=(e,t)=>{for(var i in t)A(e,i,{get:t[i],enumerable:!0})},X=(e,t,i,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of z(t))!K.call(e,s)&&s!==i&&A(e,s,{get:()=>t[s],enumerable:!(r=Q(t,s))||r.enumerable});return e};var Z=e=>X(A({},"__esModule",{value:!0}),e);var he={};W(he,{runVerifyGate:()=>ge});module.exports=Z(he);var b=require("fs"),u=require("../../lib/logger"),V=require("../../lib/telemetry"),h=require("./actions"),o=require("./session-state"),M=require("./activity-participants"),p=require("../../lib/config"),B=require("./required-tools");const ee=3,te=1;function ie(e){const t=p.CYCLE_TO_SERVER[e];if(t===void 0)throw new Error(`No MCP server registered for cycle '${e}'.`);return t}d(ie,"mcpServerForCycle");function _(e){return JSON.stringify({session_id:e,status:"pass",checks:["form submits successfully","new item appears in list","no console errors"]})}d(_,"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"]})}d(q,"verdictExampleFail");function k(...e){for(const t of e)try{(0,b.existsSync)(t)&&(0,b.unlinkSync)(t)}catch(i){u.logger.debug(`failed to cleanup ${t}: ${i}`)}}d(k,"cleanup");function re(e){if(!(0,b.existsSync)(e))return null;try{return JSON.parse((0,b.readFileSync)(e,"utf-8"))}catch{return null}}d(re,"readVerdictQuietly");function oe(e,t){const i=(0,h.getFileChangesSinceLastVerification)(e),r=new Set;for(const f of i)for(const a of(0,p.getActiveCycles)(f.file_path,t))r.add(a);const s=[];r.has("browser")&&s.push("browser");for(const f of p.OPTIONAL_CYCLES)r.has(f)&&s.push(f);return s}d(oe,"computeActiveCycles");function ne(e,t,i){const r=ie(e),s=new Set(t.filter(a=>a.tool_type==="mcp"&&a.mcp_server===r).map(a=>a.tool_name)),f=(0,p.getRequiredToolsConfig)(i,e);return{cycle:e,result:(0,B.satisfyRequiredTools)(s,f),config:f,usedCount:s.size}}d(ne,"checkCycleTools");function se(e){return{cycle:"browser",valid:!0,passCriteriaMet:!0}}d(se,"checkBrowserEvidence");function ae(e){return{cycle:"node",valid:!0,passCriteriaMet:!0}}d(ae,"checkNodeEvidence");function ce(e){return{cycle:"backend",valid:!0,passCriteriaMet:!0}}d(ce,"checkBackendEvidence");function le(e){return{cycle:"android",valid:!0,passCriteriaMet:!0}}d(le,"checkAndroidEvidence");function de(e){return{cycle:"terminal",valid:!0,passCriteriaMet:!0}}d(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}'.`)}d(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(r=>` - ${r}`).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(ue,"describeMissingTools");async function fe(e){const{sessionId:t,sessionDir:i,actionsFile:o,verdictFile:s,maxRetries:f}=e,a=f??ee,C=e.config??(0,p.loadConfig)(e.projectDir);if(d.logger.debug(`verify-gate: session=${t} verdictExists=${(0,b.existsSync)(s)}`),(0,B.anyNonMainParticipants)(i)&&((0,r.getActiveVerificationId)(i)!==void 0||!(0,b.existsSync)(s)))return d.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,h.hasFileChangesSinceLastVerification)(o)){if((0,r.getLastVerdictStatus)(i)==="fail"){if((0,r.getVerifyIntent)(i)!=="fix")return d.logger.debug("fail verdict with no code changes in window \u2014 status report, allowing"),(0,r.setLastVerdictStatus)(i,"fail_reported"),await l(o,i,t,"allow","fail_verdict_reported",[],e.projectDir),{action:"allow"};const n=(0,r.incrementRetries)(i);return n>=a?(d.logger.debug(`fix intent declared but retries exhausted (${n}/${a}) \u2014 releasing`),(0,r.resetRetries)(i),await(0,r.closeOpenCycles)(i,o,"max_retries_exceeded"),await l(o,i,t,"allow","max_retries_exceeded",[],e.projectDir),{action:"allow",message:`VERIFICATION FAILED ${a} TIMES. Allowing completion.
4
+ ${i}`}d(fe,"describeMissingTools");async function ge(e){const{sessionId:t,sessionDir:i,actionsFile:r,verdictFile:s,maxRetries:f}=e,a=f??ee,C=e.config??(0,p.loadConfig)(e.projectDir);if(u.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 u.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,h.hasFileChangesSinceLastVerification)(r)){if((0,o.getLastVerdictStatus)(i)==="fail"){if((0,o.getVerifyIntent)(i)!=="fix")return u.logger.debug("fail verdict with no code changes in window \u2014 status report, allowing"),(0,o.setLastVerdictStatus)(i,"fail_reported"),await l(r,i,t,"allow","fail_verdict_reported",[],e.projectDir),{action:"allow"};const n=(0,o.incrementRetries)(i);return n>=a?(u.logger.debug(`fix intent declared but retries exhausted (${n}/${a}) \u2014 releasing`),(0,o.resetRetries)(i),await(0,o.closeOpenCycles)(i,r,"max_retries_exceeded"),await l(r,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.`}):(d.logger.debug(`fix intent declared, fail verdict not addressed \u2014 blocking (unaddressed, attempt ${n}/${a})`),await l(o,i,t,"block","fail_verdict_unaddressed",[],e.projectDir),{action:"block",message:`VERIFICATION FAILED \u2014 unaddressed (attempt ${n}/${a}).
6
+ The fail verdict was never resolved. Report the unresolved issues in your final response.`}):(u.logger.debug(`fix intent declared, fail verdict not addressed \u2014 blocking (unaddressed, attempt ${n}/${a})`),await l(r,i,t,"block","fail_verdict_unaddressed",[],e.projectDir),{action:"block",message:`VERIFICATION FAILED \u2014 unaddressed (attempt ${n}/${a}).
7
7
 
8
8
  You submitted a fail verdict but did not address the reported issues. Either:
9
9
 
@@ -13,16 +13,16 @@ 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 d.logger.debug("no code changes detected, allowing completion"),await l(o,i,t,"allow","no_edits",[],e.projectDir),{action:"allow"}}const c=re(o,C);if(c.length===0)return d.logger.debug("file changes match no cycle pattern, allowing completion"),await l(o,i,t,"allow","no_cycle_active",[],e.projectDir),{action:"allow"};const S=(0,p.getVerificationStrict)(C),U=(0,r.isFailLikeVerdictStatus)((0,r.getLastVerdictStatus)(i)),y=oe(s),x=!S&&!U&&y!==null&&Array.isArray(y.reason)&&y.reason.length>0;if(x&&y.status==="not_applicable")return d.logger.debug("global N/A verdict, allowing completion"),(0,r.resetRetries)(i),(0,r.setLastVerdictStatus)(i,"not_applicable"),await l(o,i,t,"allow","verdict_not_applicable",c,e.projectDir),{action:"allow"};let v=c;if(x&&Array.isArray(y.not_applicable_cycles)&&y.not_applicable_cycles.length>0){const n=new Set(y.not_applicable_cycles.filter(g=>c.includes(g)));if(v=c.filter(g=>!n.has(g)),v.length===0)return d.logger.debug("per-platform N/A exempted every active cycle \u2014 treating as global N/A"),(0,r.resetRetries)(i),(0,r.setLastVerdictStatus)(i,"not_applicable"),await l(o,i,t,"allow","verdict_not_applicable",c,e.projectDir),{action:"allow"};d.logger.debug(`per-platform N/A: exempt=[${[...n].join(",")}] enforced=[${v.join(",")}]`)}const J=(0,h.getToolCallsSinceLastFileChange)(o),N=v.map(n=>ne(n,J,C)),D=N.filter(n=>!n.result.satisfied);if(D.length>0){const n=N.every(m=>m.usedCount===0),g=(0,r.incrementRetries)(i),$=!(0,h.hasVerifierEverEngaged)(o),G=$&&g>te,Y=g>=a;if(G||Y){const m=$?"verifier_unavailable":"max_retries_exceeded";d.logger.debug(`tool-presence loop releasing (attempt ${g}/${a}, neverEngaged=${$}) \u2014 ${m}`),(0,r.resetRetries)(i),await(0,r.closeOpenCycles)(i,o,m),await l(o,i,t,"allow",m,c,e.projectDir);const A=c.join(", ");return $?{action:"allow",message:`VERIFICATION UNAVAILABLE \u2014 allowing completion.
16
+ the gate will allow completion with the issues reported.`})}return u.logger.debug("no code changes detected, allowing completion"),await l(r,i,t,"allow","no_edits",[],e.projectDir),{action:"allow"}}const c=oe(r,C);if(c.length===0)return u.logger.debug("file changes match no cycle pattern, allowing completion"),await l(r,i,t,"allow","no_cycle_active",[],e.projectDir),{action:"allow"};const x=(0,p.getVerificationStrict)(C),U=(0,o.isFailLikeVerdictStatus)((0,o.getLastVerdictStatus)(i)),y=re(s),N=!x&&!U&&y!==null&&Array.isArray(y.reason)&&y.reason.length>0;if(N&&y.status==="not_applicable")return u.logger.debug("global N/A verdict, allowing completion"),(0,o.resetRetries)(i),(0,o.setLastVerdictStatus)(i,"not_applicable"),await l(r,i,t,"allow","verdict_not_applicable",c,e.projectDir),{action:"allow"};let v=c;if(N&&Array.isArray(y.not_applicable_cycles)&&y.not_applicable_cycles.length>0){const n=new Set(y.not_applicable_cycles.filter(g=>c.includes(g)));if(v=c.filter(g=>!n.has(g)),v.length===0)return u.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 l(r,i,t,"allow","verdict_not_applicable",c,e.projectDir),{action:"allow"};u.logger.debug(`per-platform N/A: exempt=[${[...n].join(",")}] enforced=[${v.join(",")}]`)}const J=(0,h.getToolCallsSinceLastFileChange)(r),S=v.map(n=>ne(n,J,C)),D=S.filter(n=>!n.result.satisfied);if(D.length>0){const n=S.every(m=>m.usedCount===0),g=(0,o.incrementRetries)(i),$=!(0,h.hasVerifierEverEngaged)(r),G=$&&g>te,H=g>=a;if(G||H){const m=$?"verifier_unavailable":"max_retries_exceeded";u.logger.debug(`tool-presence loop releasing (attempt ${g}/${a}, neverEngaged=${$}) \u2014 ${m}`),(0,o.resetRetries)(i),await(0,o.closeOpenCycles)(i,r,m),await l(r,i,t,"allow",m,c,e.projectDir);const T=c.join(", ");return $?{action:"allow",message:`VERIFICATION UNAVAILABLE \u2014 allowing completion.
17
17
 
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:
18
+ The ${T} 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\`);
20
20
  - on Codex: the verifier sub-agent's model resolves (set \`verification.model\` or a config.toml model) and hooks are approved (\`/hooks\`);
21
21
  - the verification delegation actually spawns the ironbee-verifier sub-agent.
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(n){await l(o,i,t,"block","no_tools",c,e.projectDir);const m=` echo '${_(t)}' | ironbee hook submit-verdict`,A=` On fail: echo '${q(t)}' | ironbee hook submit-verdict`;return{action:"block",message:`VERIFICATION REQUIRED (attempt ${g}/${a}).
25
+ The ${T} 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(n){await l(r,i,t,"block","no_tools",c,e.projectDir);const m=` echo '${_(t)}' | ironbee hook submit-verdict`,T=` On fail: echo '${q(t)}' | ironbee hook submit-verdict`;return{action:"block",message:`VERIFICATION REQUIRED (attempt ${g}/${a}).
26
26
 
27
27
  You made code changes but did not verify them.
28
28
 
@@ -49,43 +49,48 @@ ${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
  ${m}
55
- ${A}
56
- If failed, fix the code and re-verify until it passes.`}}await l(o,i,t,"block","incomplete_tools",c,e.projectDir);const H=D.map(m=>ue(m)).join(`
60
+ ${T}
61
+ If failed, fix the code and re-verify until it passes.`}}await l(r,i,t,"block","incomplete_tools",c,e.projectDir);const Y=D.map(m=>fe(m)).join(`
57
62
  `);return{action:"block",message:`INCOMPLETE VERIFICATION (attempt ${g}/${a}).
58
63
 
59
64
  You used the IronBee verification tools but skipped required checks:
60
65
 
61
- ${H}
66
+ ${Y}
62
67
 
63
68
  Run the missing tools, functionally test your changes, then submit your verdict:
64
69
  Pass: echo '${_(t)}' | ironbee hook submit-verdict
65
- Fail: echo '${q(t)}' | ironbee hook submit-verdict`}}if(!(0,b.existsSync)(s))return await l(o,i,t,"block","no_verdict",c,e.projectDir),{action:"block",message:`VERDICT MISSING.
70
+ Fail: echo '${q(t)}' | ironbee hook submit-verdict`}}if(!(0,b.existsSync)(s))return await l(r,i,t,"block","no_verdict",c,e.projectDir),{action:"block",message:`VERDICT MISSING.
66
71
 
67
- You ran the verification tools but did not submit a verdict.${(0,r.isRecordingActive)(i)?`
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 '${_(t)}' | ironbee hook submit-verdict`};let w;try{w=JSON.parse((0,b.readFileSync)(s,"utf-8"))}catch(n){return d.logger.debug(`failed to parse verdict ${s}: ${n}`),k(s),await l(o,i,t,"block","invalid_verdict",c,e.projectDir),{action:"block",message:`INVALID VERDICT JSON. Re-submit valid JSON:
72
- echo '${_(t)}' | ironbee hook submit-verdict`}}if(w.status==="not_applicable")return k(s),await l(o,i,t,"block","not_applicable_rejected",v,e.projectDir),{action:"block",message:`VERDICT REJECTED: ${S?"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."}
73
- echo '${_(t)}' | ironbee hook submit-verdict`};const F=v.map(n=>de(n,w)),j=F.filter(n=>!n.valid);if(j.length>0)return k(s),await l(o,i,t,"block","invalid_verdict",c,e.projectDir),{action:"block",message:`VERDICT REJECTED:
74
- ${j.map(g=>` - ${g.cycle} cycle: ${g.reason}`).join(`
76
+ echo '${_(t)}' | ironbee hook submit-verdict`};let w;try{w=JSON.parse((0,b.readFileSync)(s,"utf-8"))}catch(n){return u.logger.debug(`failed to parse verdict ${s}: ${n}`),k(s),await l(r,i,t,"block","invalid_verdict",c,e.projectDir),{action:"block",message:`INVALID VERDICT JSON. Re-submit valid JSON:
77
+ echo '${_(t)}' | ironbee hook submit-verdict`}}if(w.status==="not_applicable")return k(s),await l(r,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 '${_(t)}' | ironbee hook submit-verdict`};const F=v.map(n=>ue(n,w)),L=F.filter(n=>!n.valid);if(L.length>0)return k(s),await l(r,i,t,"block","invalid_verdict",c,e.projectDir),{action:"block",message:`VERDICT REJECTED:
79
+ ${L.map(g=>` - ${g.cycle} cycle: ${g.reason}`).join(`
75
80
  `)}
76
81
 
77
82
  Re-submit:
78
- echo '${_(t)}' | ironbee hook submit-verdict`};const E=w.status;if(E!=="pass"&&E!=="fail")return k(s),await l(o,i,t,"block","invalid_verdict",c,e.projectDir),{action:"block",message:`INVALID VERDICT STATUS: "${E}". Status must be "pass" or "fail".
79
- echo '${_(t)}' | ironbee hook submit-verdict`};const R=F.filter(n=>n.passCriteriaMet===!1),L=E==="pass"&&R.length===0?"pass":"fail";if(E==="pass"&&L==="fail"&&d.logger.debug(`verify-gate: status=pass overridden to fail by cycle pass-criteria: ${R.map(n=>n.cycle).join(",")}`),L==="pass")return d.logger.debug("verdict passed, allowing completion"),(0,r.resetRetries)(i),await l(o,i,t,"allow","verdict_pass",c,e.projectDir),{action:"allow"};const O=(0,r.incrementRetries)(i),I=[];if(Array.isArray(w.issues))for(const n of w.issues)I.push(String(n));for(const n of R)I.push(`[${n.cycle}] ${n.passReason??"pass criteria not met"}`);I.length===0&&I.push("unknown");const P=I.join(`
80
- - `);return O>=a?(k(s),(0,r.resetRetries)(i),await(0,r.closeOpenCycles)(i,o,"max_retries_exceeded"),await l(o,i,t,"allow","max_retries_exceeded",c,e.projectDir),{action:"allow",message:`VERIFICATION FAILED ${a} TIMES. Allowing completion.
83
+ echo '${_(t)}' | ironbee hook submit-verdict`};const E=w.status;if(E!=="pass"&&E!=="fail")return k(s),await l(r,i,t,"block","invalid_verdict",c,e.projectDir),{action:"block",message:`INVALID VERDICT STATUS: "${E}". Status must be "pass" or "fail".
84
+ echo '${_(t)}' | ironbee hook submit-verdict`};const R=F.filter(n=>n.passCriteriaMet===!1),j=E==="pass"&&R.length===0?"pass":"fail";if(E==="pass"&&j==="fail"&&u.logger.debug(`verify-gate: status=pass overridden to fail by cycle pass-criteria: ${R.map(n=>n.cycle).join(",")}`),j==="pass")return u.logger.debug("verdict passed, allowing completion"),(0,o.resetRetries)(i),await l(r,i,t,"allow","verdict_pass",c,e.projectDir),{action:"allow"};const O=(0,o.incrementRetries)(i),I=[];if(Array.isArray(w.issues))for(const n of w.issues)I.push(String(n));for(const n of R)I.push(`[${n.cycle}] ${n.passReason??"pass criteria not met"}`);I.length===0&&I.push("unknown");const P=I.join(`
85
+ - `);return O>=a?(k(s),(0,o.resetRetries)(i),await(0,o.closeOpenCycles)(i,r,"max_retries_exceeded"),await l(r,i,t,"allow","max_retries_exceeded",c,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.`}):(k(s),await l(o,i,t,"block","verdict_fail",c,e.projectDir),{action:"block",message:`VERIFICATION FAILED (attempt ${O}/${a}).
90
+ Report these issues in your final response.`}):(k(s),await l(r,i,t,"block","verdict_fail",c,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(fe,"runVerifyGate");async function l(e,t,i,o,s,f,a){o==="allow"&&(0,r.clearVerifyIntent)(t);const C=(0,r.getActiveActivityId)(t);if(!C){d.logger.debug(`verification_requested ${o}/${s} skipped \u2014 no active activity (would orphan)`),await(0,V.trackVerificationRequested)(i,o,s,a);return}const c={...(0,h.baseFields)(e),type:"verification_requested",timestamp:Date.now(),activity_id:C,action:o,reason:s,modes:f.length>0?f:void 0};await(0,h.appendAction)(e,c),await(0,V.trackVerificationRequested)(i,o,s,a)}u(l,"recordMarker");0&&(module.exports={runVerifyGate});
96
+ Submit verdict: echo '<verdict-json>' | ironbee hook submit-verdict`})}d(ge,"runVerifyGate");async function l(e,t,i,r,s,f,a){r==="allow"&&(0,o.clearVerifyIntent)(t);const C=(0,o.getActiveActivityId)(t);if(!C){u.logger.debug(`verification_requested ${r}/${s} skipped \u2014 no active activity (would orphan)`),await(0,V.trackVerificationRequested)(i,r,s,a);return}const c={...(0,h.baseFields)(e),type:"verification_requested",timestamp:Date.now(),activity_id:C,action:r,reason:s,modes:f.length>0?f:void 0};await(0,h.appendAction)(e,c),await(0,V.trackVerificationRequested)(i,r,s,a)}d(l,"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:s}=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=s!==null&&!s.isError?Buffer.byteLength(s.output,"utf-8"):0,C=s!==null&&s.isError?s.output.slice(0,500):void 0,a=Date.parse(o.timestamp),u=s!==null?Date.parse(s.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(),l={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&&(l.tool_type=r.tool_type),r.mcp_server!==null&&(l.mcp_server=r.mcp_server),C!==void 0&&(l.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)&&(l.verification_id=f);const g=_.traceId;typeof g=="string"&&g.length>0&&(l.trace_id=g)}}return l}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});
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 N=Object.defineProperty;var t=(r,n)=>N(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/verification"),k=require("./commands/telemetry"),B=require("./commands/privacy"),F=require("./commands/config"),T=require("./tui"),q=require("./commands/register"),A=require("./commands/unregister"),L=require("./commands/import"),R=require("./clients/claude/cli"),S=require("./commands/login"),U=require("./commands/scenario"),x=require("./queue"),P=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,x.registerQueueHandlers)();const o=new i.Command;o.name("ironbee").description(d.description).version(d.version),o.addCommand(S.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.verificationCommand),o.addCommand(k.telemetryCommand),o.addCommand(B.privacyCommand),o.addCommand(R.claudeCommand),o.addCommand(y.codexCommand),o.addCommand(F.configCommand),o.addCommand(T.tuiCommand),o.addCommand(q.registerCommand),o.addCommand(A.unregisterCommand),o.addCommand(L.importCommand),o.addCommand(U.scenarioCommand),o.addCommand(v.processJobFileCommand),o.addCommand(f.hookCommand);const O=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,P.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:"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"),H=Math.max(...r.map(a=>n(a).length));for(const a of r){const J=a.args.length>0?`${e.pc.green(a.name)} ${e.pc.dim(a.args)}`:e.pc.green(a.name),M=" ".repeat(H-n(a).length);console.log(` ${J}${M} ${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?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)()})();
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)()})();
@@ -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 C=Object.defineProperty;var de=Object.getOwnPropertyDescriptor;var pe=Object.getOwnPropertyNames;var be=Object.prototype.hasOwnProperty;var o=(n,e)=>C(n,"name",{value:e,configurable:!0});var Ee=(n,e)=>{for(var t in e)C(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&&C(n,i,{get:()=>e[i],enumerable:!(r=de(e,i))||r.enumerable});return n};var _e=n=>ye(C({},"__esModule",{value:!0}),n);var Un={};Ee(Un,{ALL_CYCLES:()=>me,CONFIG_TARGETS_BY_PRECEDENCE:()=>ke,CYCLES_ENABLED_BY_DEFAULT:()=>P,CYCLE_DEFAULT_VERIFY_PATTERNS:()=>q,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:()=>K,DEFAULT_BROWSER_VERIFY_PATTERNS:()=>M,DEFAULT_IGNORED_VERIFY_PATTERNS:()=>Y,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:()=>$,DEFAULT_VERIFICATION_CONTEXT_COMMIT_DEPTH:()=>ue,DEFAULT_VERIFICATION_CONTEXT_MAX_BYTES:()=>le,ENV_OVERRIDES:()=>R,OPTIONAL_CYCLES:()=>T,applyEnvOverrides:()=>ee,findActiveEnvOverride:()=>De,getActiveCycles:()=>ne,getAnalyticsEmitOnStopMinIntervalSeconds:()=>Pn,getAndroidDevToolsMcpEntry:()=>sn,getAutoVerifyEnabled:()=>ce,getBackendDevToolsMcpEntry:()=>rn,getCaptureFileChangeset:()=>Nn,getClaudeOauthAccessEnabled:()=>pn,getClaudeOauthAccessUsageTtlSeconds:()=>_n,getCodexVerifierMode:()=>bn,getConfigLayerPaths:()=>j,getMaxChangesetBytes:()=>Ln,getMaxRetries:()=>cn,getMcpServerEntry:()=>tn,getNodeDevToolsMcpEntry:()=>on,getOTELEmitMinIntervalSeconds:()=>vn,getOTELEnsureMinIntervalSeconds:()=>In,getOTELIdleTimeoutSeconds:()=>An,getOTELPort:()=>Cn,getPrivacyEnabled:()=>ge,getRequiredToolsConfig:()=>Ue,getStatusLineEmitMinIntervalSeconds:()=>dn,getStatusLineRefreshInterval:()=>Tn,getStatusLineRenderDefault:()=>gn,getTargetConfigPath:()=>Ne,getTelemetryEnabled:()=>fe,getTerminalDevToolsMcpEntry:()=>an,getVerificationContextCommitDepth:()=>wn,getVerificationContextEnabled:()=>jn,getVerificationContextMaxBytes:()=>On,getVerificationContextMessage:()=>hn,getVerificationContextSource:()=>Rn,getVerificationEnabled:()=>O,getVerificationMode:()=>kn,getVerificationModel:()=>Te,getVerificationStrict:()=>xn,isAnalyticsApiRequestEventsEnabled:()=>Vn,isAnalyticsEmitOnStopEnabled:()=>Dn,isAnalyticsEnabled:()=>Sn,isAnalyticsStepEventsEnabled:()=>Fn,isAnalyticsTurnEventsEnabled:()=>Mn,isAutoModeAllowlistEnabled:()=>En,isClaudeTrustWorkspaceEnabled:()=>yn,isCollectorConfigured:()=>w,isCycleEnabled:()=>Ve,isCyclePatternsActive:()=>te,isIgnoredVerifyPath:()=>Bn,isJobQueueEnabled:()=>ln,isOTELEnabled:()=>mn,isRecordingEnabled:()=>un,isSessionStatusEnabled:()=>fn,loadConfig:()=>c,matchesAny:()=>_,requiresVerification:()=>Fe,resolveConfigTargetFromFlags:()=>Le,resolveIgnoredVerifyPatterns:()=>x});module.exports=_e(Un);var m=require("fs"),y=require("path"),v=require("os"),D=require("./logger");const T=["node","backend","android","terminal"],me=["browser",...T],P=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_"},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"],$=["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}"],q={browser:M,node:F,backend:V,android:U,terminal:$},Y=["**/*.spec.*","**/*.test.*","**/__tests__/**","**/__mocks__/**"];function x(n){const e=n.ignoredVerifyPatterns??[];return[...Y,...e]}o(x,"resolveIgnoredVerifyPatterns");const K=["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"]}],Ie=3;function B(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(B,"loadJsonFile");function ve(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}.`)}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(ve,"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 je(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(je,"assertPrivacyShape");function p(n,e){if(!(n===void 0&&e===void 0))return{...n??{},...e??{}}}o(p,"mergeCycleConfig");function k(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=Be(n.codex,e.codex),t.verification=Oe(n.verification,e.verification),t.runtime=Re(n.runtime,e.runtime),t}o(k,"mergeConfigLayers");function Re(n,e){if(!(n===void 0&&e===void 0))return{...n??{},...e??{}}}o(Re,"mergeRuntimeConfig");function we(n,e){if(!(n===void 0&&e===void 0))return{...n??{},...e??{}}}o(we,"mergeVerificationContextConfig");function Oe(n,e){if(n===void 0&&e===void 0)return;const t={...n??{},...e??{}},r=we(n?.context,e?.context);return r!==void 0?t.context=r:delete t.context,t}o(Oe,"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 Be(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(Be,"mergeCodexConfig");function j(n){return{global:(0,y.join)((0,v.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 ke=["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 A(n){const e=B(n);return(0,m.existsSync)(n)&&(ve(e,n),xe(e,n),je(e,n)),e}o(A,"loadAndValidateLayer");const R=[{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 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(Se,"setAtConfigPath");function ee(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;Se(e,t.configPath,i)}return e??n}o(ee,"applyEnvOverrides");function De(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(De,"findActiveEnvOverride");function c(n){const e=j(n),t=A(e.global),r=e.project?A(e.project):{},i=e.local?A(e.local):{},s=k(k(t,r),i);return ee(s)}o(c,"loadConfig");function Pe(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(Pe,"globToRegExp");function _(n,e){const t=n.replace(/\\/g,"/");for(const r of e)if(Pe(r).test(t))return!0;return!1}o(_,"matchesAny");function Me(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(Me,"getCycleBlock");function I(n,e){const t=Me(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(I,"getCyclePatterns");function ne(n,e){const t=x(e);if(t.length>0&&_(n,t))return[];const r=[];_(n,I(e,"browser"))&&r.push("browser");for(const i of T){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 O(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??K,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",$e="^0.14.0",L=["-y",`@ironbee-ai/devtools@${$e}`],qe={TOOL_NAME_PREFIX:"bdt_",TOOL_INPUT_METADATA_ENABLE:"true",SCENARIOS_DIR:".ironbee/scenarios/bdt"},Ye={PLATFORM:"node",TOOL_NAME_PREFIX:"ndt_",TOOL_INPUT_METADATA_ENABLE:"true",SCENARIOS_DIR:".ironbee/scenarios/ndt"},Ke={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(!w(n))return{};const t=n.collector,i=B((0,y.join)((0,v.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(nn,"buildOTELEnv");function b(n,e,t,r,i){const s=nn(n,i),l=Ze(n),a=en(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 h={};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"&&(h[d]=g[d])}return{command:N,args:[...L],env:{...r,...s,...l,...a,...h,...t}}}return{command:N,args:[...L],env:{...r,...s,...l,...a,...t}}}o(b,"buildMcpEntry");function tn(n){const e=c(n);return b(e,"browserDevTools",qe,We,"browser")}o(tn,"getMcpServerEntry");function on(n){const e=c(n);return b(e,"nodeDevTools",Ye,Ge,"node")}o(on,"getNodeDevToolsMcpEntry");function rn(n){const e=c(n);return b(e,"backendDevTools",Ke,Qe,"backend")}o(rn,"getBackendDevToolsMcpEntry");function sn(n){const e=c(n);return b(e,"androidDevTools",Xe,ze,"android")}o(sn,"getAndroidDevToolsMcpEntry");function an(n){const e=c(n);return b(e,"terminalDevTools",He,Je,"terminal")}o(an,"getTerminalDevToolsMcpEntry");function cn(n){return typeof n.maxRetries=="number"&&n.maxRetries>0?n.maxRetries:Ie}o(cn,"getMaxRetries");function w(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(w,"isCollectorConfigured");function ln(n){const e=c(n);return E(e,e.jobQueue)}o(ln,"isJobQueueEnabled");function un(n){const e=c(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 In(n){const e=n.otel?.ensureMinIntervalSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:se}o(In,"getOTELEnsureMinIntervalSeconds");function vn(n){const e=n.otel?.emitMinIntervalSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:ae}o(vn,"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:w(n)}o(E,"isFeatureEnabledWithCollectorAutoEnable");function qn(n){return n==null||typeof n!="object"||Array.isArray(n)?!1:n.enable!==!1}o(qn,"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 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 le=65536,ue=1;function jn(n){const e=n.verification?.context;return e==null||typeof e!="object"||Array.isArray(e)?!0:e.enable!==!1}o(jn,"getVerificationContextEnabled");function Rn(n){return n.verification?.context?.source==="actions"?"actions":"git"}o(Rn,"getVerificationContextSource");function wn(n){const e=n.verification?.context?.commitDepth;return typeof e=="number"&&Number.isFinite(e)&&e>=0?Math.floor(e):ue}o(wn,"getVerificationContextCommitDepth");function On(n){const e=n.verification?.context?.maxBytes;return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.floor(e):le}o(On,"getVerificationContextMaxBytes");function hn(n){const e=n.verification?.context?.message;return typeof e=="string"?e.trim():""}o(hn,"getVerificationContextMessage");function Bn(n,e){const t=x(n);return t.length>0&&_(e,t)}o(Bn,"isIgnoredVerifyPath");function kn(n){return O(n)?ce(n)?"enforce":"assist":"monitor"}o(kn,"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 Nn(n){const e=n.fileChange;return!e||typeof e!="object"||Array.isArray(e)?!1:e.captureChangeset===!0}o(Nn,"getCaptureFileChangeset");function Ln(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(Ln,"getMaxChangesetBytes");function Sn(n){const e=c(n);return E(e,e.analytics)}o(Sn,"isAnalyticsEnabled");function Dn(n){const t=c(n).analytics;return t===null||typeof t!="object"||Array.isArray(t)?!0:t.emitOnStop!==!1}o(Dn,"isAnalyticsEmitOnStopEnabled");function Pn(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(Pn,"getAnalyticsEmitOnStopMinIntervalSeconds");function Mn(n){const t=c(n).analytics;return t===null||typeof t!="object"||Array.isArray(t)?!1:t.emitTurnEvents===!0}o(Mn,"isAnalyticsTurnEventsEnabled");function Fn(n){const t=c(n).analytics;return t===null||typeof t!="object"||Array.isArray(t)?!1:t.emitStepEvents===!0}o(Fn,"isAnalyticsStepEventsEnabled");function Vn(n){const t=c(n).analytics;return t===null||typeof t!="object"||Array.isArray(t)?!0:t.emitApiRequestEvents!==!1}o(Vn,"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_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,getVerificationContextCommitDepth,getVerificationContextEnabled,getVerificationContextMaxBytes,getVerificationContextMessage,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 +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=11;0&&(module.exports={INSTALL_SCHEMA_VERSION});
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=13;0&&(module.exports={INSTALL_SCHEMA_VERSION});
@@ -1,7 +1,8 @@
1
- "use strict";var p=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var c=(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 E(n))!T.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 l=require("fs"),m=require("./logger"),h=require("./config");const S={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(`
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
- `)};function L(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}c(L,"escapeRegex");function I(e){return new RegExp(`<!--IRONBEE:PLATFORM:${L(e)}(?::([\\w-]+))?-->`,"g")}c(I,"startMarkerRegex");function M(e,n){return n.length>0?`<!--/IRONBEE:PLATFORM:${e}:${n}-->`:`<!--/IRONBEE:PLATFORM:${e}-->`}c(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),b=e.indexOf(f,a);if(b===-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:b}),s=i.exec(e)}return r}c(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=S[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],b=r(f.key)??s,g=o.substring(0,f.startEnd),u=o.substring(f.endIdx);o=`${g}
6
- ${b}
7
- ${u}`}return o}c(R,"applyPlatformSection");function $(e,n,t){return t.length>0?`${e}.${n}.${t}.md`:`${e}.${n}.md`}c($,"fragmentFilename");function A(e,n){const t=`${e}/${n}`;if(!(0,l.existsSync)(t))throw new Error(`Platform fragment not found: ${t}`);return(0,l.readFileSync)(t,"utf-8").trimEnd()}c(A,"readFragment");function w(e,n,t){if(!(0,l.existsSync)(e))return!1;const i=(0,l.readFileSync)(e,"utf-8"),r=R(i,n,t,e);return r===i?!1:((0,l.writeFileSync)(e,r),!0)}c(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],b=i(a);for(const g of f){const u=`${e}/${g.projectRelativePath}`;if(!(0,l.existsSync)(u))continue;w(u,n,t?y=>{const k=`${b}/${$(g.fragmentBase,n,y)}`;if(!(0,l.existsSync)(k)){const x=y.length>0?`${n}:${y}`:n;return m.logger.warn(`platform-section ${x}: missing fragment ${k} for ${g.projectRelativePath} \u2014 falling back to placeholder.`),null}return(0,l.readFileSync)(k,"utf-8").trimEnd()}:null)&&d.push(g.projectRelativePath)}}return d}c(P,"applyPlatformToProjectFiles");function C(e,n){const t=(0,h.loadConfig)(e);for(const i of h.ALL_CYCLES){const r=(0,h.isCycleEnabled)(t,i);P(e,i,r,n)}}c(C,"syncPlatformSectionsToConfig");0&&(module.exports={PLATFORM_TARGETS,applyPlatformSection,applyPlatformToProjectFiles,fragmentFilename,readFragment,syncPlatformSectionsToConfig,togglePlatformSectionInFile});
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});
@@ -1 +1 @@
1
- "use strict";var h=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var l=(e,n)=>h(e,"name",{value:n,configurable:!0});var E=(e,n)=>{for(var s in n)h(e,s,{get:n[s],enumerable:!0})},F=(e,n,s,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of P(n))!C.call(e,r)&&r!==s&&h(e,r,{get:()=>n[r],enumerable:!(a=k(n,r))||a.enumerable});return e};var x=e=>F(h({},"__esModule",{value:!0}),e);var A={};E(A,{checkScenarioFreshness:()=>V,coverageGaps:()=>O});module.exports=x(A);var g=require("fs"),p=require("path"),f=require("./git"),b=require("./config"),y=require("./logger");const S={bdt:"browser",ndt:"node",bedt:"backend",adt:"android"};function v(e){return e.length>7?e.slice(0,7):e}l(v,"shortSha");function $(e){const n=e.metadata;if(n===null||typeof n!="object")return{};const s=n.ironbee;return s!==null&&typeof s=="object"?s:{}}l($,"readIronBeeMeta");function w(e){const n=(0,p.join)(e,".ironbee","scenarios");if(!(0,g.existsSync)(n))return[];const s=[];for(const a of Object.keys(S)){const r=(0,p.join)(n,a);if(!(0,g.existsSync)(r))continue;let t;try{t=(0,g.readdirSync)(r).filter(o=>o.endsWith(".json"))}catch(o){y.logger.debug(`scenario-staleness: cannot read ${r}: ${o instanceof Error?o.message:o}`);continue}for(const o of t){const c=(0,p.join)(r,o);let i;try{i=JSON.parse((0,g.readFileSync)(c,"utf-8"))}catch(m){y.logger.debug(`scenario-staleness: bad JSON ${c}: ${m instanceof Error?m.message:m}`);continue}const u=typeof i.name=="string"&&i.name.length>0?i.name:o.replace(/\.json$/,""),d=$(i),R=Array.isArray(d.coveredPaths)?d.coveredPaths.filter(m=>typeof m=="string"):[];s.push({name:u,platform:S[a],file:c,coveredPaths:R,commit:typeof d.commit=="string"&&d.commit.length>0?d.commit:void 0,liveValidated:typeof d.liveValidated=="boolean"?d.liveValidated:void 0})}}return s}l(w,"readScenarioEntries");function V(e){const n=w(e);if(n.length===0)return[];const s=(0,f.isGitRepo)(e),a=new Map,r=[];for(const t of n){const o={name:t.name,platform:t.platform,file:t.file,coveredPaths:t.coveredPaths,commit:t.commit,liveValidated:t.liveValidated,changedCoveredPaths:[]};if(!s){r.push({...o,state:"unknown",reason:"not a git repository"});continue}if(t.coveredPaths.length===0){r.push({...o,state:"unknown",reason:"no ironbee.coveredPaths metadata"});continue}if(t.commit===void 0){r.push({...o,state:"unknown",reason:"no ironbee.commit baseline"});continue}if(!(0,f.gitCommitExists)(e,t.commit)){r.push({...o,state:"unknown",reason:`baseline commit ${v(t.commit)} not in history`});continue}let c;const i=a.get(t.commit);i!==void 0?c=i:(c=(0,f.gitChangedPathsSince)(e,t.commit),a.set(t.commit,c));const u=c.filter(d=>(0,b.matchesAny)(d,t.coveredPaths));if(u.length>0){r.push({...o,state:"stale",reason:`${u.length} covered file(s) changed since ${v(t.commit)}`,changedCoveredPaths:u});continue}if(t.liveValidated===!1){r.push({...o,state:"stale",reason:"authored as a draft \u2014 not live-validated by a passing run"});continue}r.push({...o,state:"fresh",reason:`no covered files changed since ${v(t.commit)}`})}return r}l(V,"checkScenarioFreshness");function O(e,n){const s=w(e),a=Array.from(new Set(n.filter(o=>o.length>0))),r=[],t=[];for(const o of a){const c=s.filter(i=>i.coveredPaths.length>0&&(0,b.matchesAny)(o,i.coveredPaths)).map(i=>i.name);c.length>0?r.push({path:o,scenarios:c}):t.push(o)}return{scenarioCount:s.length,covered:r,gaps:t,changed:a}}l(O,"coverageGaps");0&&(module.exports={checkScenarioFreshness,coverageGaps});
1
+ "use strict";var h=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var l=(e,n)=>h(e,"name",{value:n,configurable:!0});var E=(e,n)=>{for(var s in n)h(e,s,{get:n[s],enumerable:!0})},F=(e,n,s,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of P(n))!C.call(e,r)&&r!==s&&h(e,r,{get:()=>n[r],enumerable:!(a=k(n,r))||a.enumerable});return e};var x=e=>F(h({},"__esModule",{value:!0}),e);var A={};E(A,{checkScenarioFreshness:()=>V,coverageGaps:()=>O});module.exports=x(A);var g=require("fs"),p=require("path"),f=require("./git"),b=require("./config"),y=require("./logger");const S={bdt:"browser",ndt:"node",bedt:"backend",adt:"android",tdt:"terminal"};function v(e){return e.length>7?e.slice(0,7):e}l(v,"shortSha");function $(e){const n=e.metadata;if(n===null||typeof n!="object")return{};const s=n.ironbee;return s!==null&&typeof s=="object"?s:{}}l($,"readIronBeeMeta");function w(e){const n=(0,p.join)(e,".ironbee","scenarios");if(!(0,g.existsSync)(n))return[];const s=[];for(const a of Object.keys(S)){const r=(0,p.join)(n,a);if(!(0,g.existsSync)(r))continue;let t;try{t=(0,g.readdirSync)(r).filter(o=>o.endsWith(".json"))}catch(o){y.logger.debug(`scenario-staleness: cannot read ${r}: ${o instanceof Error?o.message:o}`);continue}for(const o of t){const c=(0,p.join)(r,o);let i;try{i=JSON.parse((0,g.readFileSync)(c,"utf-8"))}catch(u){y.logger.debug(`scenario-staleness: bad JSON ${c}: ${u instanceof Error?u.message:u}`);continue}const m=typeof i.name=="string"&&i.name.length>0?i.name:o.replace(/\.json$/,""),d=$(i),R=Array.isArray(d.coveredPaths)?d.coveredPaths.filter(u=>typeof u=="string"):[];s.push({name:m,platform:S[a],file:c,coveredPaths:R,commit:typeof d.commit=="string"&&d.commit.length>0?d.commit:void 0,liveValidated:typeof d.liveValidated=="boolean"?d.liveValidated:void 0})}}return s}l(w,"readScenarioEntries");function V(e){const n=w(e);if(n.length===0)return[];const s=(0,f.isGitRepo)(e),a=new Map,r=[];for(const t of n){const o={name:t.name,platform:t.platform,file:t.file,coveredPaths:t.coveredPaths,commit:t.commit,liveValidated:t.liveValidated,changedCoveredPaths:[]};if(!s){r.push({...o,state:"unknown",reason:"not a git repository"});continue}if(t.coveredPaths.length===0){r.push({...o,state:"unknown",reason:"no ironbee.coveredPaths metadata"});continue}if(t.commit===void 0){r.push({...o,state:"unknown",reason:"no ironbee.commit baseline"});continue}if(!(0,f.gitCommitExists)(e,t.commit)){r.push({...o,state:"unknown",reason:`baseline commit ${v(t.commit)} not in history`});continue}let c;const i=a.get(t.commit);i!==void 0?c=i:(c=(0,f.gitChangedPathsSince)(e,t.commit),a.set(t.commit,c));const m=c.filter(d=>(0,b.matchesAny)(d,t.coveredPaths));if(m.length>0){r.push({...o,state:"stale",reason:`${m.length} covered file(s) changed since ${v(t.commit)}`,changedCoveredPaths:m});continue}if(t.liveValidated===!1){r.push({...o,state:"stale",reason:"authored as a draft \u2014 not live-validated by a passing run"});continue}r.push({...o,state:"fresh",reason:`no covered files changed since ${v(t.commit)}`})}return r}l(V,"checkScenarioFreshness");function O(e,n){const s=w(e),a=Array.from(new Set(n.filter(o=>o.length>0))),r=[],t=[];for(const o of a){const c=s.filter(i=>i.coveredPaths.length>0&&(0,b.matchesAny)(o,i.coveredPaths)).map(i=>i.name);c.length>0?r.push({path:o,scenarios:c}):t.push(o)}return{scenarioCount:s.length,covered:r,gaps:t,changed:a}}l(O,"coverageGaps");0&&(module.exports={checkScenarioFreshness,coverageGaps});