@ironbee-ai/cli 0.28.0 → 0.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.29.0 (2026-06-22)
4
+
5
+ ### Features
6
+
7
+ * **verification:** read nested devtools calls from tool_response ([#32](https://github.com/ironbee-ai/ironbee-cli/issues/32)) ([5de693b](https://github.com/ironbee-ai/ironbee-cli/commit/5de693ba11d507dc306ddada46bcc3235f5a9ef0))
8
+
3
9
  ## 0.28.0 (2026-06-20)
4
10
 
5
11
  ### Features
@@ -1 +1 @@
1
- "use strict";var m=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var z=Object.prototype.hasOwnProperty;var f=(e,o)=>m(e,"name",{value:o,configurable:!0});var J=(e,o)=>{for(var i in o)m(e,i,{get:o[i],enumerable:!0})},U=(e,o,i,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of P(o))!z.call(e,r)&&r!==i&&m(e,r,{get:()=>o[r],enumerable:!(n=F(o,r))||n.enumerable});return e};var K=e=>U(m({},"__esModule",{value:!0}),e);var G={};J(G,{run:()=>j});module.exports=K(G);var d=require("../../../hooks/core/actions"),g=require("../../../hooks/core/nested-tools"),l=require("../../../hooks/core/session-state"),S=require("../../../import/ids"),O=require("../../../lib/config"),s=require("../../../lib/logger"),w=require("../../../lib/recording-tools"),N=require("../../../lib/stdin"),a=require("../../../queue"),T=require("../util");const M="browser-devtools",Q="node-devtools",W="backend-devtools",Y="android-devtools";async function j(e){let o;try{o=JSON.parse((0,N.readStdin)())}catch(c){s.logger.debug(`failed to parse stdin: ${c}`),process.exit(0)}const i=o.session_id??"default",n=`${e}/.ironbee/sessions/${i}`,r=`${n}/actions.jsonl`;(0,s.setLogFile)(`${n}/session.log`);const y=o.tool_name??"unknown",R=Date.now(),b=o.tool_input&&typeof o.tool_input=="object"&&!Array.isArray(o.tool_input)?{...o.tool_input,_metadata:void 0}:o.tool_input,C=(0,l.getActiveActivityId)(n),I=(0,l.getActiveVerificationId)(n),$=(0,l.getActiveTraceId)(n),t=(0,T.classifyTool)(y,o.tool_input),D=t.tool_type==="mcp"&&t.mcp_server===M,V=t.tool_type==="mcp"&&t.mcp_server===Q,L=t.tool_type==="mcp"&&t.mcp_server===W,h=t.tool_type==="mcp"&&t.mcp_server===Y,v=D||V||L||h,x=v?b:(0,T.extractClaudeToolInput)(y,b),E=typeof o.error=="string"&&o.error.length>0?o.error:void 0,u=E?o.is_interrupt?`interrupted: ${E}`:E:void 0,k={...(0,d.baseFields)(r),type:"tool_call",timestamp:R,tool_name:t.tool_name,tool_type:t.tool_type,tool_use_id:o.tool_use_id,tool_input:x,tool_input_size:A(b),tool_response:u?void 0:o.tool_response,tool_response_size:A(u?void 0:o.tool_response),activity_id:C,verification_id:I,trace_id:$,duration:typeof o.duration_ms=="number"?o.duration_ms:null,mcp_server:t.mcp_server,error:u};if(o.tool_use_id!==void 0&&o.tool_use_id.length>0&&(k.id=(0,S.deriveToolCallEventIdFromToolUseId)(i,o.tool_use_id)),v){await(0,d.appendAction)(r,k);const c=(0,w.recordingToolsForServer)(t.mcp_server);c!==null&&(t.tool_name===c.startTool?((0,l.setRecordingActive)(n,!0),s.logger.debug(`track-action: recording started (${c.cycle})`)):t.tool_name===c.stopTool&&((0,l.setRecordingActive)(n,!1),s.logger.debug(`track-action: recording stopped (${c.cycle})`)))}else q(e,i,k);if(s.logger.debug(`track-action: ${y}${u?" (failed)":""}`),v&&t.tool_name===(0,g.executeToolBareName)(t.mcp_server)&&!u){const c=(0,g.extractNestedToolCalls)(o.tool_input,t.mcp_server),_=(0,w.recordingToolsForServer)(t.mcp_server);for(const p of c){_!==null&&(p.name===_.startTool?((0,l.setRecordingActive)(n,!0),s.logger.debug(`track-action (nested): recording started (${_.cycle})`)):p.name===_.stopTool&&((0,l.setRecordingActive)(n,!1),s.logger.debug(`track-action (nested): recording stopped (${_.cycle})`)));const B={...(0,d.baseFields)(r),type:"tool_call",timestamp:R,tool_name:p.name,tool_type:"mcp",tool_input:p.args,activity_id:C,verification_id:I,trace_id:$,duration:null,mcp_server:t.mcp_server};await(0,d.appendAction)(r,B),s.logger.debug(`track-action (nested): ${p.name}`)}}process.exit(0)}f(j,"run");function q(e,o,i){if(!(0,O.isJobQueueEnabled)(e))return;const n={...i};delete n.tool_response;try{(0,a.submit)(e,o,a.SEND_EVENT_TYPE,n)}catch(r){if(r instanceof a.JobTooLargeError){s.logger.debug(`track-action: wire event too large for ${i.tool_name}; dropping`);return}s.logger.debug(`track-action: failed to submit ${i.tool_name}: ${r instanceof Error?r.message:r}`)}}f(q,"submitEvent");function A(e){if(e==null)return 0;try{const o=typeof e=="string"?e:JSON.stringify(e);return o===void 0?0:Buffer.byteLength(o,"utf-8")}catch{return 0}}f(A,"byteSize");0&&(module.exports={run});
1
+ "use strict";var f=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var J=Object.getOwnPropertyNames;var U=Object.prototype.hasOwnProperty;var g=(e,o)=>f(e,"name",{value:o,configurable:!0});var K=(e,o)=>{for(var r in o)f(e,r,{get:o[r],enumerable:!0})},M=(e,o,r,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of J(o))!U.call(e,s)&&s!==r&&f(e,s,{get:()=>o[s],enumerable:!(n=z(o,s))||n.enumerable});return e};var Q=e=>M(f({},"__esModule",{value:!0}),e);var X={};K(X,{run:()=>G});module.exports=Q(X);var a=require("../../../hooks/core/actions"),u=require("../../../hooks/core/nested-tools"),l=require("../../../hooks/core/session-state"),A=require("../../../import/ids"),O=require("../../../lib/config"),i=require("../../../lib/logger"),w=require("../../../lib/recording-tools"),D=require("../../../lib/stdin"),_=require("../../../queue"),T=require("../util");const W="browser-devtools",Y="node-devtools",j="backend-devtools",q="android-devtools";async function G(e){let o;try{o=JSON.parse((0,D.readStdin)())}catch(c){i.logger.debug(`failed to parse stdin: ${c}`),process.exit(0)}const r=o.session_id??"default",n=`${e}/.ironbee/sessions/${r}`,s=`${n}/actions.jsonl`;(0,i.setLogFile)(`${n}/session.log`);const y=o.tool_name??"unknown",C=Date.now(),b=o.tool_input&&typeof o.tool_input=="object"&&!Array.isArray(o.tool_input)?{...o.tool_input,_metadata:void 0}:o.tool_input,k=(0,l.getActiveActivityId)(n),S=(0,l.getActiveVerificationId)(n),I=(0,l.getActiveTraceId)(n),t=(0,T.classifyTool)(y,o.tool_input),V=t.tool_type==="mcp"&&t.mcp_server===W,h=t.tool_type==="mcp"&&t.mcp_server===Y,F=t.tool_type==="mcp"&&t.mcp_server===j,L=t.tool_type==="mcp"&&t.mcp_server===q,v=V||h||F||L,x=v?b:(0,T.extractClaudeToolInput)(y,b),E=typeof o.error=="string"&&o.error.length>0?o.error:void 0,p=E?o.is_interrupt?`interrupted: ${E}`:E:void 0,R={...(0,a.baseFields)(s),type:"tool_call",timestamp:C,tool_name:t.tool_name,tool_type:t.tool_type,tool_use_id:o.tool_use_id,tool_input:x,tool_input_size:$(b),tool_response:p?void 0:o.tool_response,tool_response_size:$(p?void 0:o.tool_response),activity_id:k,verification_id:S,trace_id:I,duration:typeof o.duration_ms=="number"?o.duration_ms:null,mcp_server:t.mcp_server,error:p};if(o.tool_use_id!==void 0&&o.tool_use_id.length>0&&(R.id=(0,A.deriveToolCallEventIdFromToolUseId)(r,o.tool_use_id)),v){await(0,a.appendAction)(s,R);const c=(0,w.recordingToolsForServer)(t.mcp_server);c!==null&&(t.tool_name===c.startTool?((0,l.setRecordingActive)(n,!0),i.logger.debug(`track-action: recording started (${c.cycle})`)):t.tool_name===c.stopTool&&((0,l.setRecordingActive)(n,!1),i.logger.debug(`track-action: recording stopped (${c.cycle})`)))}else H(e,r,R);if(i.logger.debug(`track-action: ${y}${p?" (failed)":""}`),v&&(0,u.isNestedToolContainer)(t.tool_name,t.mcp_server)&&!p){const B=(0,u.extractNestedToolCallsFromResponse)(o.tool_response,t.mcp_server)??(0,u.extractNestedToolCalls)(o.tool_input,t.mcp_server),m=(0,w.recordingToolsForServer)(t.mcp_server),N=new Set;for(const d of B){if(m!==null&&(d.name===m.startTool?((0,l.setRecordingActive)(n,!0),i.logger.debug(`track-action (nested): recording started (${m.cycle})`)):d.name===m.stopTool&&((0,l.setRecordingActive)(n,!1),i.logger.debug(`track-action (nested): recording stopped (${m.cycle})`))),N.has(d.name))continue;N.add(d.name);const P={...(0,a.baseFields)(s),type:"tool_call",timestamp:C,tool_name:d.name,tool_type:"mcp",tool_input:d.args,activity_id:k,verification_id:S,trace_id:I,duration:null,mcp_server:t.mcp_server};await(0,a.appendAction)(s,P),i.logger.debug(`track-action (nested): ${d.name}`)}}process.exit(0)}g(G,"run");function H(e,o,r){if(!(0,O.isJobQueueEnabled)(e))return;const n={...r};delete n.tool_response;try{(0,_.submit)(e,o,_.SEND_EVENT_TYPE,n)}catch(s){if(s instanceof _.JobTooLargeError){i.logger.debug(`track-action: wire event too large for ${r.tool_name}; dropping`);return}i.logger.debug(`track-action: failed to submit ${r.tool_name}: ${s instanceof Error?s.message:s}`)}}g(H,"submitEvent");function $(e){if(e==null)return 0;try{const o=typeof e=="string"?e:JSON.stringify(e);return o===void 0?0:Buffer.byteLength(o,"utf-8")}catch{return 0}}g($,"byteSize");0&&(module.exports={run});
@@ -1 +1 @@
1
- "use strict";var I=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var G=Object.prototype.hasOwnProperty;var b=(t,e)=>I(t,"name",{value:e,configurable:!0});var K=(t,e)=>{for(var o in e)I(t,o,{get:e[o],enumerable:!0})},W=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Y(e))!G.call(t,i)&&i!==o&&I(t,i,{get:()=>e[i],enumerable:!(n=Q(e,i))||n.enumerable});return t};var X=t=>W(I({},"__esModule",{value:!0}),t);var ne={};K(ne,{run:()=>oe});module.exports=X(ne);var _=require("../../../hooks/core/actions"),A=require("../../../hooks/core/nested-tools"),R=require("../../../import/ids"),r=require("../../../hooks/core/session-state"),M=require("../../../hooks/core/tool-use-stash"),O=require("../../../lib/config"),a=require("../../../lib/logger"),N=require("../../../lib/output"),j=require("../../../lib/recording-tools"),L=require("../../../lib/stdin"),v=require("../../../queue"),s=require("../util");function S(t){if(t==null)return 0;if(typeof t=="string")try{return Buffer.byteLength(t,"utf8")}catch{return 0}try{return Buffer.byteLength(JSON.stringify(t),"utf8")}catch{return 0}}b(S,"safeStringifyBytes");function Z(t){if(t==null)return{isError:!1,errorText:void 0};if(typeof t=="object"&&t!==null){const e=t;if(e.isError===!0||e.is_error===!0){const o=e.error??e.message??e.errorMessage;return{isError:!0,errorText:typeof o=="string"?o:JSON.stringify(e).slice(0,500)}}}if(typeof t=="string"){const e=t;if(/(?:^|\n)Process exited with code [1-9]/.test(e)||/^Exit code:\s*[1-9]/m.test(e)||/apply_patch verification failed/i.test(e)||/failed to find expected lines/i.test(e)||/^\s*Error\b/.test(e)||/(?:^|\n)\[Request interrupted by user\]/.test(e)||/modified since (?:last )?read|stale read/i.test(e)||/file (?:is )?too large|exceeds/i.test(e)||/file not found|No such file or directory|does not exist/i.test(e))return{isError:!0,errorText:e.slice(0,500)}}return{isError:!1,errorText:void 0}}b(Z,"detectFailure");function ee(t){if(t===null||typeof t!="object")return;const e=t._metadata;if(e===null||typeof e!="object")return;const o=e.toolCallId;if(typeof o=="string"&&/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(o))return o}b(ee,"extractMetadataToolCallId");function te(t,e){const o=(0,M.consumeToolUseData)(t,e);if(!o?.start_ns)return null;try{const n=process.hrtime.bigint()-BigInt(o.start_ns);return Number(n/1000000n)}catch(n){return a.logger.debug(`failed to derive duration from stash: ${n}`),null}}b(te,"deriveDurationMs");async function oe(t){const e=(0,s.parseCodexHookStdin)((0,L.readStdin)()),o=e.session_id??"default",n=`${t}/.ironbee/sessions/${o}`,i=`${n}/actions.jsonl`;(0,a.setLogFile)(`${n}/session.log`);const y=e.tool_name??"",l=e.tool_use_id??"",u=e.tool_input,h=u&&typeof u=="object"?{...u,_metadata:void 0}:void 0,$=e.tool_response,d=(0,s.extractCodexMcpServer)(y),P=d==="browser-devtools"||d==="node-devtools"||d==="backend-devtools"||d==="android-devtools",z=te(o,l),m=Z($),g=(0,s.classifyCodexTool)(y);if(P){const T=g.tool_name,c=(0,j.recordingToolsForServer)(d);c!==null&&(T===c.startTool?(0,r.setRecordingActive)(n,!0):T===c.stopTool&&(0,r.setRecordingActive)(n,!1));const w=(0,r.getActiveActivityId)(n),f={...(0,_.baseFields)(i),type:"tool_call",timestamp:Date.now(),tool_type:g.tool_type,tool_name:g.tool_name,mcp_server:g.mcp_server??d,tool_input:h,tool_input_size:S(h),tool_response_size:m.isError?0:S($),duration:z};w&&(f.activity_id=w);const B=ee(u);B!==void 0?f.id=B:l.length>0&&(f.id=(0,R.deriveToolCallEventIdFromToolUseId)(o,l)),l&&(f.tool_use_id=l);const C=(0,r.getActiveVerificationId)(n);C&&(f.verification_id=C);const k=(0,r.getActiveTraceId)(n);if(k&&(f.trace_id=k),m.isError&&(f.error=m.errorText),await(0,_.appendAction)(i,f),T===(0,A.executeToolBareName)(d)&&!m.isError){const V=(0,A.extractNestedToolCalls)(h??u,d);for(const x of V){c!==null&&(x.name===c.startTool?((0,r.setRecordingActive)(n,!0),a.logger.debug(`track-action (nested): recording started (${c.cycle})`)):x.name===c.stopTool&&((0,r.setRecordingActive)(n,!1),a.logger.debug(`track-action (nested): recording stopped (${c.cycle})`)));const E={...(0,_.baseFields)(i),type:"tool_call",timestamp:Date.now(),tool_name:x.name,tool_type:"mcp",tool_input:x.args,duration:null,mcp_server:d};w&&(E.activity_id=w),C&&(E.verification_id=C),k&&(E.trace_id=k),await(0,_.appendAction)(i,E),a.logger.debug(`track-action (nested): ${x.name}`)}}(0,N.writeAndExit)(JSON.stringify({}),0);return}if(!(0,O.isJobQueueEnabled)(t)){(0,N.writeAndExit)(JSON.stringify({}),0);return}const J=(0,r.getActiveActivityId)(n),U=(0,s.extractCodexToolInput)(y,u),q=S(u),H=m.isError?0:S($),p={...(0,_.baseFields)(i),type:"tool_call",timestamp:Date.now(),tool_type:g.tool_type,tool_name:g.tool_name||(0,s.normalizeCodexToolName)(y),mcp_server:g.mcp_server,tool_input:U,tool_input_size:q,tool_response_size:H,duration:z};J&&(p.activity_id=J),l.length>0&&(p.id=(0,R.deriveToolCallEventIdFromToolUseId)(o,l)),l&&(p.tool_use_id=l);const D=(0,r.getActiveVerificationId)(n);D&&(p.verification_id=D);const F=(0,r.getActiveTraceId)(n);F&&(p.trace_id=F),m.isError&&(p.error=m.errorText);try{(0,v.submit)(t,o,v.SEND_EVENT_TYPE,p)}catch(T){T instanceof v.JobTooLargeError?a.logger.debug(`track-action: wire event too large for tool_call ${y}; dropping`):a.logger.debug(`queue submit failed for tool_call ${y}: ${T}`)}(0,N.writeAndExit)(JSON.stringify({}),0)}b(oe,"run");0&&(module.exports={run});
1
+ "use strict";var N=Object.defineProperty;var K=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var X=Object.prototype.hasOwnProperty;var b=(t,e)=>N(t,"name",{value:e,configurable:!0});var Z=(t,e)=>{for(var o in e)N(t,o,{get:e[o],enumerable:!0})},ee=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of W(e))!X.call(t,i)&&i!==o&&N(t,i,{get:()=>e[i],enumerable:!(n=K(e,i))||n.enumerable});return t};var te=t=>ee(N({},"__esModule",{value:!0}),t);var se={};Z(se,{run:()=>ie});module.exports=te(se);var T=require("../../../hooks/core/actions"),v=require("../../../hooks/core/nested-tools"),R=require("../../../import/ids"),r=require("../../../hooks/core/session-state"),P=require("../../../hooks/core/tool-use-stash"),U=require("../../../lib/config"),a=require("../../../lib/logger"),A=require("../../../lib/output"),q=require("../../../lib/recording-tools"),H=require("../../../lib/stdin"),x=require("../../../queue"),l=require("../util");function h(t){if(t==null)return 0;if(typeof t=="string")try{return Buffer.byteLength(t,"utf8")}catch{return 0}try{return Buffer.byteLength(JSON.stringify(t),"utf8")}catch{return 0}}b(h,"safeStringifyBytes");function oe(t){if(t==null)return{isError:!1,errorText:void 0};if(typeof t=="object"&&t!==null){const e=t;if(e.isError===!0||e.is_error===!0){const o=e.error??e.message??e.errorMessage;return{isError:!0,errorText:typeof o=="string"?o:JSON.stringify(e).slice(0,500)}}}if(typeof t=="string"){const e=t;if(/(?:^|\n)Process exited with code [1-9]/.test(e)||/^Exit code:\s*[1-9]/m.test(e)||/apply_patch verification failed/i.test(e)||/failed to find expected lines/i.test(e)||/^\s*Error\b/.test(e)||/(?:^|\n)\[Request interrupted by user\]/.test(e)||/modified since (?:last )?read|stale read/i.test(e)||/file (?:is )?too large|exceeds/i.test(e)||/file not found|No such file or directory|does not exist/i.test(e))return{isError:!0,errorText:e.slice(0,500)}}return{isError:!1,errorText:void 0}}b(oe,"detectFailure");function ne(t){if(t===null||typeof t!="object")return;const e=t._metadata;if(e===null||typeof e!="object")return;const o=e.toolCallId;if(typeof o=="string"&&/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(o))return o}b(ne,"extractMetadataToolCallId");function re(t,e){const o=(0,P.consumeToolUseData)(t,e);if(!o?.start_ns)return null;try{const n=process.hrtime.bigint()-BigInt(o.start_ns);return Number(n/1000000n)}catch(n){return a.logger.debug(`failed to derive duration from stash: ${n}`),null}}b(re,"deriveDurationMs");async function ie(t){const e=(0,l.parseCodexHookStdin)((0,H.readStdin)()),o=e.session_id??"default",n=`${t}/.ironbee/sessions/${o}`,i=`${n}/actions.jsonl`;(0,a.setLogFile)(`${n}/session.log`);const y=e.tool_name??"",d=e.tool_use_id??"",m=e.tool_input,$=m&&typeof m=="object"?{...m,_metadata:void 0}:void 0,w=e.tool_response,s=(0,l.extractCodexMcpServer)(y),z=s==="browser-devtools"||s==="node-devtools"||s==="backend-devtools"||s==="android-devtools",F=re(o,d),c=(0,l.classifyCodexTool)(y),J=z&&(0,v.isNestedToolContainer)(c.tool_name,s),D=J?(0,v.extractNestedToolCallsFromResponse)(w,s):null,g=D!==null?{isError:!1,errorText:void 0}:oe(w);if(z){const C=c.tool_name,f=(0,q.recordingToolsForServer)(s);f!==null&&(C===f.startTool?(0,r.setRecordingActive)(n,!0):C===f.stopTool&&(0,r.setRecordingActive)(n,!1));const E=(0,r.getActiveActivityId)(n),u={...(0,T.baseFields)(i),type:"tool_call",timestamp:Date.now(),tool_type:c.tool_type,tool_name:c.tool_name,mcp_server:c.mcp_server??s,tool_input:$,tool_input_size:h($),tool_response_size:g.isError?0:h(w),duration:F};E&&(u.activity_id=E);const B=ne(m);B!==void 0?u.id=B:d.length>0&&(u.id=(0,R.deriveToolCallEventIdFromToolUseId)(o,d)),d&&(u.tool_use_id=d);const k=(0,r.getActiveVerificationId)(n);k&&(u.verification_id=k);const S=(0,r.getActiveTraceId)(n);if(S&&(u.trace_id=S),g.isError&&(u.error=g.errorText),await(0,T.appendAction)(i,u),J&&!g.isError){const G=D??(0,v.extractNestedToolCalls)($??m,s),L=new Set;for(const _ of G){if(f!==null&&(_.name===f.startTool?((0,r.setRecordingActive)(n,!0),a.logger.debug(`track-action (nested): recording started (${f.cycle})`)):_.name===f.stopTool&&((0,r.setRecordingActive)(n,!1),a.logger.debug(`track-action (nested): recording stopped (${f.cycle})`))),L.has(_.name))continue;L.add(_.name);const I={...(0,T.baseFields)(i),type:"tool_call",timestamp:Date.now(),tool_name:_.name,tool_type:"mcp",tool_input:_.args,duration:null,mcp_server:s};E&&(I.activity_id=E),k&&(I.verification_id=k),S&&(I.trace_id=S),await(0,T.appendAction)(i,I),a.logger.debug(`track-action (nested): ${_.name}`)}}(0,A.writeAndExit)(JSON.stringify({}),0);return}if(!(0,U.isJobQueueEnabled)(t)){(0,A.writeAndExit)(JSON.stringify({}),0);return}const M=(0,r.getActiveActivityId)(n),V=(0,l.extractCodexToolInput)(y,m),Q=h(m),Y=g.isError?0:h(w),p={...(0,T.baseFields)(i),type:"tool_call",timestamp:Date.now(),tool_type:c.tool_type,tool_name:c.tool_name||(0,l.normalizeCodexToolName)(y),mcp_server:c.mcp_server,tool_input:V,tool_input_size:Q,tool_response_size:Y,duration:F};M&&(p.activity_id=M),d.length>0&&(p.id=(0,R.deriveToolCallEventIdFromToolUseId)(o,d)),d&&(p.tool_use_id=d);const O=(0,r.getActiveVerificationId)(n);O&&(p.verification_id=O);const j=(0,r.getActiveTraceId)(n);j&&(p.trace_id=j),g.isError&&(p.error=g.errorText);try{(0,x.submit)(t,o,x.SEND_EVENT_TYPE,p)}catch(C){C instanceof x.JobTooLargeError?a.logger.debug(`track-action: wire event too large for tool_call ${y}; dropping`):a.logger.debug(`queue submit failed for tool_call ${y}: ${C}`)}(0,A.writeAndExit)(JSON.stringify({}),0)}b(ie,"run");0&&(module.exports={run});
@@ -1,3 +1,3 @@
1
- "use strict";var _=Object.defineProperty;var Z=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var ee=Object.prototype.hasOwnProperty;var y=(f,e)=>_(f,"name",{value:e,configurable:!0});var oe=(f,e)=>{for(var o in e)_(f,o,{get:e[o],enumerable:!0})},ne=(f,e,o,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of j(e))!ee.call(f,i)&&i!==o&&_(f,i,{get:()=>e[i],enumerable:!(s=Z(e,i))||s.enumerable});return f};var te=f=>ne(_({},"__esModule",{value:!0}),f);var le={};oe(le,{CodexClient:()=>se});module.exports=te(le);var r=require("fs"),g=require("path"),O=require("../../lib/gitignore"),b=require("../../lib/logger"),d=require("../../lib/output"),P=require("../../lib/fs-prune"),c=require("../../lib/config"),C=require("../../lib/platform-section"),n=require("./util"),M=require("./thread-map"),L=require("./hooks/verify-gate"),G=require("./hooks/activity-end"),J=require("./hooks/session-start"),F=require("./hooks/activity-start"),K=require("./hooks/require-verification"),U=require("./hooks/require-verdict"),q=require("./hooks/clear-verdict"),D=require("./hooks/track-action"),X=require("./hooks/track-action-monitor"),W=require("./hooks/track-action-pre"),Y=require("./hooks/subagent-start"),z=require("./hooks/subagent-stop");const x="browser-devtools",E="node-devtools",w="backend-devtools",T="android-devtools",ie="ironbee",k="ironbee-verifier",H=30,V="Verifies recent code changes through real browser/runtime/backend tools and submits the IronBee verdict. Spawn this custom agent (by agent_type) after editing code to run the verification cycle out-of-band \u2014 it drives the devtools tools, judges the result, and records the verdict in the shared session. It does NOT edit code.";function A(f){return(0,g.join)(__dirname,"..",f,"platforms")}y(A,"platformsDirFor");function h(f){return d.pc.dim(f)}y(h,"codexColor");function B(f){return f.hooks.some(e=>e.command.includes(ie))}y(B,"isIronBeeHookGroup");function re(f){const e=Object.keys(f);return e.length===0?!0:e.length===1&&e[0]==="hooks"?Object.keys(f.hooks??{}).length===0:!1}y(re,"isCodexHooksEmpty");class se{constructor(){this.name="codex";this.supportsVerifierModel=!0}static{y(this,"CodexClient")}detect(e){return(0,r.existsSync)((0,g.join)(e,".agents","skills","ironbee-verify"))}resolveProjectDir(){return process.env.CODEX_PROJECT_DIR??process.env.IRONBEE_PROJECT_DIR??process.cwd()}install(e,o){const s=o??(0,c.loadConfig)(e),i=(0,c.getVerificationMode)(s),t=i!=="monitor",a=(0,c.getCodexVerifierMode)(s);this.cleanupArtifacts(e);const l=(0,n.codexHooksJsonPath)(e);if(this.mergeHooksConfig(l,i,a),this.mergeConfigToml(e,s,t,a),t&&(i==="enforce"&&this.writeAgentsMdBlock(e,s,a),this.writeSkills(e,i==="enforce",s,a),(0,C.syncPlatformSectionsToConfig)(e,A)),(0,O.ensureIronBeeGitignored)(e),console.log(` ${d.pc.dim("\u2192")} ${h("[codex]")} hooks ${d.pc.dim("\u2192")} ${d.pc.dim(l)}`),console.log(` ${d.pc.dim("\u2192")} ${h("[codex]")} config ${d.pc.dim("\u2192")} ${d.pc.dim((0,n.codexConfigTomlPath)(e))}`),t){const p=a==="main-agent"?`${d.pc.yellow("main-agent")} (the main agent drives the devtools tools directly)`:`${d.pc.bold("sub-agent")} (delegated to the ironbee-verifier custom agent)`;console.log(` ${d.pc.dim("\u2192")} ${h("[codex]")} verify ${d.pc.dim("\u2192")} ${p}`)}i==="enforce"?(console.log(` ${d.pc.dim("\u2192")} ${h("[codex]")} agents ${d.pc.dim("\u2192")} ${d.pc.dim((0,g.join)(e,"AGENTS.md"))}`),console.log(` ${d.pc.dim("\u2192")} ${h("[codex]")} skill ${d.pc.dim("\u2192")} ${d.pc.dim((0,g.join)(e,".agents","skills","ironbee-verification","SKILL.md"))}`),console.log(` ${d.pc.dim("\u2192")} ${h("[codex]")} command ${d.pc.dim("\u2192")} ${d.pc.dim((0,g.join)(e,".agents","skills","ironbee-verify","SKILL.md"))}`)):i==="assist"?(console.log(` ${d.pc.dim("\u2192")} ${h("[codex]")} ${d.pc.yellow("assist mode")} (verification.auto: false) \u2014 manual $ironbee-verify only, no enforcement`),console.log(` ${d.pc.dim("\u2192")} ${h("[codex]")} command ${d.pc.dim("\u2192")} ${d.pc.dim((0,g.join)(e,".agents","skills","ironbee-verify","SKILL.md"))}`)):console.log(` ${d.pc.dim("\u2192")} ${h("[codex]")} ${d.pc.yellow("monitoring-only mode")} (verification.enable: false)`),console.log(),console.log(` ${d.pc.yellow("\u26A0")} ${d.pc.yellow("Codex requires one-time TUI setup:")}`),console.log(` ${d.pc.yellow("1.")} Run ${d.pc.bold("/hooks")} in a fresh Codex session to review and trust IronBee hooks`),console.log(` ${d.pc.yellow("2.")} Restart any open Codex sessions to pick up new hook config`)}uninstall(e){this.cleanupArtifacts(e),(0,P.pruneEmptyDirs)((0,g.join)(e,".codex"));const o=(0,M.codexThreadMapPath)(e);if((0,r.existsSync)(o))try{(0,r.unlinkSync)(o)}catch(s){b.logger.debug(`failed to remove codex thread map: ${s}`)}console.log(` ${d.pc.dim("\u2192")} ${h("[codex]")} removed hooks, MCP entries, AGENTS.md block, and skills`)}cleanupArtifacts(e){this.migrateAwayFromUserLevel();const o=(0,n.codexHooksJsonPath)(e);this.removeIronBeeHooks(o),this.maybeDeleteEmptyHooks(o),this.removeIronBeeMcpServers(e),this.removeVerifierAgentToml(e);const s=(0,g.join)(e,"AGENTS.md");if((0,r.existsSync)(s))try{const t=(0,r.readFileSync)(s,"utf-8"),a=(0,n.stripAgentsMdBlock)(t);a===null?(0,r.unlinkSync)(s):a!==t&&(0,r.writeFileSync)(s,a)}catch(t){b.logger.debug(`failed to strip AGENTS.md block: ${t}`)}const i=(0,g.join)(e,".agents","skills");this.removeDir((0,g.join)(i,"ironbee-verification")),this.removeDir((0,g.join)(i,"ironbee-verify")),(0,P.pruneEmptyDirs)((0,g.join)(e,".agents"))}async runVerifyGate(e){await(0,L.run)(e)}async runActivityEnd(e){await(0,G.run)(e)}async runSessionStart(e){await(0,J.run)(e)}async runActivityStart(e){await(0,F.run)(e)}async runRequireVerification(e,o){await(0,K.run)(e,o)}async runRequireVerdict(e,o){await(0,U.run)(e,o)}async runClearVerdict(e){await(0,q.run)(e)}async runTrackAction(e){await(0,D.run)(e)}async runTrackActionMonitor(e){await(0,X.run)(e)}async runTrackActionPre(e){await(0,W.run)(e)}async runSubagentStart(e){await(0,Y.run)(e)}async runSubagentStop(e){await(0,z.run)(e)}resolveAgentSessionId(e,o){const s=process.env.CODEX_THREAD_ID;if(typeof s=="string"&&s.length>0&&o)return(0,M.lookupThreadSession)(o,s)}async runSessionEnd(e){b.logger.debug("session-end: no-op on Codex (no SessionEnd hook event)")}mergeHooksConfig(e,o,s){const i=o!=="monitor",t=o==="assist"?" --soft":"";(0,r.mkdirSync)((0,g.dirname)(e),{recursive:!0});let a={hooks:{}};if((0,r.existsSync)(e))try{a=JSON.parse((0,r.readFileSync)(e,"utf-8")),a.hooks||(a.hooks={})}catch(u){b.logger.debug(`failed to parse ${e}: ${u}`),a={hooks:{}}}for(const u of Object.keys(a.hooks)){const m=a.hooks[u].filter(S=>!B(S));m.length===0?delete a.hooks[u]:a.hooks[u]=m}const l=y((u,m,S)=>{a.hooks[u]||(a.hooks[u]=[]),a.hooks[u].push({matcher:m,hooks:[{type:"command",command:S}]})},"addGroup");l("SessionStart",".*","ironbee hook session-start --client codex"),l("UserPromptSubmit",".*","ironbee hook activity-start --client codex"),l("PreToolUse",".*","ironbee hook track-action-pre --client codex"),i&&(l("PreToolUse","^mcp__(browser|node|backend|android)[-_]devtools__.*",`ironbee hook require-verification --client codex${t}`),l("PreToolUse","^apply_patch$",`ironbee hook require-verdict --client codex${t}`),l("PostToolUse","^apply_patch$","ironbee hook clear-verdict --client codex"),s==="sub-agent"&&l("SubagentStart",".*","ironbee hook subagent-start --client codex")),l("SubagentStop",".*","ironbee hook subagent-stop --client codex"),l("PostToolUse",".*",i?"ironbee hook track-action --client codex":"ironbee hook track-action-monitor --client codex"),l("Stop",".*",o==="enforce"?"ironbee hook verify-gate --client codex":"ironbee hook activity-end --client codex"),(0,r.writeFileSync)(e,JSON.stringify(a,null,2))}removeIronBeeHooks(e){if((0,r.existsSync)(e))try{const o=(0,r.readFileSync)(e,"utf-8"),s=JSON.parse(o);if(!s.hooks)return;let i=!1;for(const t of Object.keys(s.hooks)){const a=s.hooks[t].filter(l=>!B(l));a.length!==s.hooks[t].length&&(i=!0),a.length===0?delete s.hooks[t]:s.hooks[t]=a}i&&(0,r.writeFileSync)(e,JSON.stringify(s,null,2))}catch(o){b.logger.debug(`failed to strip IronBee hooks from ${e}: ${o}`)}}maybeDeleteEmptyHooks(e){if((0,r.existsSync)(e))try{const o=JSON.parse((0,r.readFileSync)(e,"utf-8"));re(o)&&(0,r.unlinkSync)(e)}catch(o){b.logger.debug(`failed to inspect ${e} for emptiness: ${o}`)}}mergeConfigToml(e,o,s,i){(0,r.mkdirSync)((0,g.join)(e,".codex"),{recursive:!0});let t=(0,n.readCodexConfigToml)(e);if(t=(0,n.ensureFeaturesHooksTrue)(t),t=(0,n.removeMcpServer)(t,x),t=(0,n.removeMcpServer)(t,E),t=(0,n.removeMcpServer)(t,w),t=(0,n.removeMcpServer)(t,T),s&&i==="main-agent"){t=this.upsertSessionMcpServers(t,e,o),t=(0,n.removeAgentsTable)(t,k),t=(0,n.removeMultiAgentV2SpawnMetadata)(t),this.removeVerifierAgentToml(e),(0,n.writeCodexConfigToml)(e,t);return}if(s){const a=(0,c.getVerificationModel)(o,"codex"),l=(0,r.existsSync)((0,n.userCodexConfigTomlPath)())?(0,r.readFileSync)((0,n.userCodexConfigTomlPath)(),"utf-8"):"",p=(0,n.extractTomlTopLevelModel)(t)===null&&(0,n.extractTomlTopLevelModel)(l)===null;a===void 0&&p&&console.log(` ${d.pc.dim("\u2192")} ${h("[codex]")} ${d.pc.yellow("\u26A0 no model for the verifier")} \u2014 the ${d.pc.bold("ironbee-verifier")} sub-agent inherits the session model, but neither this project's .codex/config.toml nor ~/.codex/config.toml has a top-level ${d.pc.bold("model")}, so it may fail to spawn ("could not resolve the child model"). Fix: set ${d.pc.bold("model")} in ~/.codex/config.toml, or set ${d.pc.bold("verification.model")} in your ironbee config.`),this.writeVerifierAgentToml(e,o,a),t=(0,n.upsertAgentsTable)(t,k,[`description = ${JSON.stringify(V)}`,`config_file = ${JSON.stringify(`agents/${k}.toml`)}`]),t=(0,n.ensureMultiAgentV2SpawnMetadataExposed)(t)}else t=(0,n.removeAgentsTable)(t,k),t=(0,n.removeMultiAgentV2SpawnMetadata)(t),this.removeVerifierAgentToml(e);(0,n.writeCodexConfigToml)(e,t)}writeVerifierAgentToml(e,o,s){const i=(0,g.join)(__dirname,"agents",`${k}.md`);let t;try{t=(0,r.readFileSync)(i,"utf-8")}catch(u){b.logger.debug(`failed to read verifier agent source ${i}: ${u}`);return}const a=A("codex");for(const u of c.ALL_CYCLES){const S=(0,c.isCycleEnabled)(o,u)?I=>{const $=(0,g.join)(a,(0,C.fragmentFilename)("skill",u,I));return(0,r.existsSync)($)?(0,r.readFileSync)($,"utf-8").trimEnd():null}:null;t=(0,C.applyPlatformSection)(t,u,S,`${k}.toml`)}const l=[];l.push(`name = ${JSON.stringify(k)}`),l.push(`description = ${JSON.stringify(V)}`),l.push('sandbox_mode = "read-only"'),s&&l.push(`model = ${JSON.stringify(s)}`),l.push("developer_instructions = '''"),l.push(t.replace(/'''/g,"```").trimEnd()),l.push("'''");const p=y((u,m,S)=>{u&&(l.push(""),l.push(`[mcp_servers.${m}]`),l.push(...N(S)),l.push(`startup_timeout_sec = ${H}`),l.push("required = true"),l.push('default_tools_approval_mode = "approve"'))},"addCycle");p((0,c.isCycleEnabled)(o,"browser"),x,(0,c.getMcpServerEntry)(e)),p((0,c.isCycleEnabled)(o,"node"),E,(0,c.getNodeDevToolsMcpEntry)(e)),p((0,c.isCycleEnabled)(o,"backend"),w,(0,c.getBackendDevToolsMcpEntry)(e)),p((0,c.isCycleEnabled)(o,"android"),T,(0,c.getAndroidDevToolsMcpEntry)(e));const v=(0,n.codexAgentTomlPath)(e,k);(0,r.mkdirSync)((0,g.dirname)(v),{recursive:!0}),(0,r.writeFileSync)(v,l.join(`
1
+ "use strict";var _=Object.defineProperty;var Z=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var ee=Object.prototype.hasOwnProperty;var y=(f,e)=>_(f,"name",{value:e,configurable:!0});var oe=(f,e)=>{for(var o in e)_(f,o,{get:e[o],enumerable:!0})},ne=(f,e,o,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of j(e))!ee.call(f,i)&&i!==o&&_(f,i,{get:()=>e[i],enumerable:!(s=Z(e,i))||s.enumerable});return f};var te=f=>ne(_({},"__esModule",{value:!0}),f);var le={};oe(le,{CodexClient:()=>se});module.exports=te(le);var r=require("fs"),g=require("path"),O=require("../../lib/gitignore"),b=require("../../lib/logger"),d=require("../../lib/output"),P=require("../../lib/fs-prune"),c=require("../../lib/config"),C=require("../../lib/platform-section"),n=require("./util"),M=require("./thread-map"),L=require("./hooks/verify-gate"),F=require("./hooks/activity-end"),G=require("./hooks/session-start"),J=require("./hooks/activity-start"),K=require("./hooks/require-verification"),U=require("./hooks/require-verdict"),q=require("./hooks/clear-verdict"),D=require("./hooks/track-action"),X=require("./hooks/track-action-monitor"),W=require("./hooks/track-action-pre"),Y=require("./hooks/subagent-start"),z=require("./hooks/subagent-stop");const x="browser-devtools",w="node-devtools",E="backend-devtools",T="android-devtools",ie="ironbee",k="ironbee-verifier",R=30,V="Verifies recent code changes through real browser/runtime/backend tools and submits the IronBee verdict. Spawn this custom agent (by agent_type) after editing code to run the verification cycle out-of-band \u2014 it drives the devtools tools, judges the result, and records the verdict in the shared session. It does NOT edit code.";function A(f){return(0,g.join)(__dirname,"..",f,"platforms")}y(A,"platformsDirFor");function h(f){return d.pc.dim(f)}y(h,"codexColor");function B(f){return f.hooks.some(e=>e.command.includes(ie))}y(B,"isIronBeeHookGroup");function re(f){const e=Object.keys(f);return e.length===0?!0:e.length===1&&e[0]==="hooks"?Object.keys(f.hooks??{}).length===0:!1}y(re,"isCodexHooksEmpty");class se{constructor(){this.name="codex";this.supportsVerifierModel=!0}static{y(this,"CodexClient")}detect(e){return(0,r.existsSync)((0,g.join)(e,".agents","skills","ironbee-verify"))}resolveProjectDir(){return process.env.CODEX_PROJECT_DIR??process.env.IRONBEE_PROJECT_DIR??process.cwd()}install(e,o){const s=o??(0,c.loadConfig)(e),i=(0,c.getVerificationMode)(s),t=i!=="monitor",a=(0,c.getCodexVerifierMode)(s);this.cleanupArtifacts(e);const l=(0,n.codexHooksJsonPath)(e);if(this.mergeHooksConfig(l,i,a),this.mergeConfigToml(e,s,t,a),t&&(i==="enforce"&&this.writeAgentsMdBlock(e,s,a),this.writeSkills(e,i==="enforce",s,a),(0,C.syncPlatformSectionsToConfig)(e,A)),(0,O.ensureIronBeeGitignored)(e),console.log(` ${d.pc.dim("\u2192")} ${h("[codex]")} hooks ${d.pc.dim("\u2192")} ${d.pc.dim(l)}`),console.log(` ${d.pc.dim("\u2192")} ${h("[codex]")} config ${d.pc.dim("\u2192")} ${d.pc.dim((0,n.codexConfigTomlPath)(e))}`),t){const p=a==="main-agent"?`${d.pc.yellow("main-agent")} (the main agent drives the devtools tools directly)`:`${d.pc.bold("sub-agent")} (delegated to the ironbee-verifier custom agent)`;console.log(` ${d.pc.dim("\u2192")} ${h("[codex]")} verify ${d.pc.dim("\u2192")} ${p}`)}i==="enforce"?(console.log(` ${d.pc.dim("\u2192")} ${h("[codex]")} agents ${d.pc.dim("\u2192")} ${d.pc.dim((0,g.join)(e,"AGENTS.md"))}`),console.log(` ${d.pc.dim("\u2192")} ${h("[codex]")} skill ${d.pc.dim("\u2192")} ${d.pc.dim((0,g.join)(e,".agents","skills","ironbee-verification","SKILL.md"))}`),console.log(` ${d.pc.dim("\u2192")} ${h("[codex]")} command ${d.pc.dim("\u2192")} ${d.pc.dim((0,g.join)(e,".agents","skills","ironbee-verify","SKILL.md"))}`)):i==="assist"?(console.log(` ${d.pc.dim("\u2192")} ${h("[codex]")} ${d.pc.yellow("assist mode")} (verification.auto: false) \u2014 manual $ironbee-verify only, no enforcement`),console.log(` ${d.pc.dim("\u2192")} ${h("[codex]")} command ${d.pc.dim("\u2192")} ${d.pc.dim((0,g.join)(e,".agents","skills","ironbee-verify","SKILL.md"))}`)):console.log(` ${d.pc.dim("\u2192")} ${h("[codex]")} ${d.pc.yellow("monitoring-only mode")} (verification.enable: false)`),console.log(),console.log(` ${d.pc.yellow("\u26A0")} ${d.pc.yellow("Codex requires one-time TUI setup:")}`),console.log(` ${d.pc.yellow("1.")} Run ${d.pc.bold("/hooks")} in a fresh Codex session to review and trust IronBee hooks`),console.log(` ${d.pc.yellow("2.")} Restart any open Codex sessions to pick up new hook config`)}uninstall(e){this.cleanupArtifacts(e),(0,r.existsSync)((0,n.codexHooksJsonPath)(e))||this.removeFeaturesHooksFlag(e),(0,P.pruneEmptyDirs)((0,g.join)(e,".codex"));const o=(0,M.codexThreadMapPath)(e);if((0,r.existsSync)(o))try{(0,r.unlinkSync)(o)}catch(s){b.logger.debug(`failed to remove codex thread map: ${s}`)}console.log(` ${d.pc.dim("\u2192")} ${h("[codex]")} removed hooks, MCP entries, AGENTS.md block, and skills`)}removeFeaturesHooksFlag(e){const o=(0,n.codexConfigTomlPath)(e);if((0,r.existsSync)(o))try{const s=(0,r.readFileSync)(o,"utf-8"),i=(0,n.removeFeaturesHooks)(s);i.trim().length===0?(0,r.unlinkSync)(o):i!==s&&(0,r.writeFileSync)(o,i)}catch(s){b.logger.debug(`failed to strip [features] hooks from config.toml: ${s}`)}}cleanupArtifacts(e){this.migrateAwayFromUserLevel();const o=(0,n.codexHooksJsonPath)(e);this.removeIronBeeHooks(o),this.maybeDeleteEmptyHooks(o),this.removeIronBeeMcpServers(e),this.removeVerifierAgentToml(e);const s=(0,g.join)(e,"AGENTS.md");if((0,r.existsSync)(s))try{const t=(0,r.readFileSync)(s,"utf-8"),a=(0,n.stripAgentsMdBlock)(t);a===null?(0,r.unlinkSync)(s):a!==t&&(0,r.writeFileSync)(s,a)}catch(t){b.logger.debug(`failed to strip AGENTS.md block: ${t}`)}const i=(0,g.join)(e,".agents","skills");this.removeDir((0,g.join)(i,"ironbee-verification")),this.removeDir((0,g.join)(i,"ironbee-verify")),(0,P.pruneEmptyDirs)((0,g.join)(e,".agents"))}async runVerifyGate(e){await(0,L.run)(e)}async runActivityEnd(e){await(0,F.run)(e)}async runSessionStart(e){await(0,G.run)(e)}async runActivityStart(e){await(0,J.run)(e)}async runRequireVerification(e,o){await(0,K.run)(e,o)}async runRequireVerdict(e,o){await(0,U.run)(e,o)}async runClearVerdict(e){await(0,q.run)(e)}async runTrackAction(e){await(0,D.run)(e)}async runTrackActionMonitor(e){await(0,X.run)(e)}async runTrackActionPre(e){await(0,W.run)(e)}async runSubagentStart(e){await(0,Y.run)(e)}async runSubagentStop(e){await(0,z.run)(e)}resolveAgentSessionId(e,o){const s=process.env.CODEX_THREAD_ID;if(typeof s=="string"&&s.length>0&&o)return(0,M.lookupThreadSession)(o,s)}async runSessionEnd(e){b.logger.debug("session-end: no-op on Codex (no SessionEnd hook event)")}mergeHooksConfig(e,o,s){const i=o!=="monitor",t=o==="assist"?" --soft":"";(0,r.mkdirSync)((0,g.dirname)(e),{recursive:!0});let a={hooks:{}};if((0,r.existsSync)(e))try{a=JSON.parse((0,r.readFileSync)(e,"utf-8")),a.hooks||(a.hooks={})}catch(u){b.logger.debug(`failed to parse ${e}: ${u}`),a={hooks:{}}}for(const u of Object.keys(a.hooks)){const m=a.hooks[u].filter(S=>!B(S));m.length===0?delete a.hooks[u]:a.hooks[u]=m}const l=y((u,m,S)=>{a.hooks[u]||(a.hooks[u]=[]),a.hooks[u].push({matcher:m,hooks:[{type:"command",command:S}]})},"addGroup");l("SessionStart",".*","ironbee hook session-start --client codex"),l("UserPromptSubmit",".*","ironbee hook activity-start --client codex"),l("PreToolUse",".*","ironbee hook track-action-pre --client codex"),i&&(l("PreToolUse","^mcp__(browser|node|backend|android)[-_]devtools__.*",`ironbee hook require-verification --client codex${t}`),l("PreToolUse","^apply_patch$",`ironbee hook require-verdict --client codex${t}`),l("PostToolUse","^apply_patch$","ironbee hook clear-verdict --client codex"),s==="sub-agent"&&l("SubagentStart",".*","ironbee hook subagent-start --client codex")),l("SubagentStop",".*","ironbee hook subagent-stop --client codex"),l("PostToolUse",".*",i?"ironbee hook track-action --client codex":"ironbee hook track-action-monitor --client codex"),l("Stop",".*",o==="enforce"?"ironbee hook verify-gate --client codex":"ironbee hook activity-end --client codex"),(0,r.writeFileSync)(e,JSON.stringify(a,null,2))}removeIronBeeHooks(e){if((0,r.existsSync)(e))try{const o=(0,r.readFileSync)(e,"utf-8"),s=JSON.parse(o);if(!s.hooks)return;let i=!1;for(const t of Object.keys(s.hooks)){const a=s.hooks[t].filter(l=>!B(l));a.length!==s.hooks[t].length&&(i=!0),a.length===0?delete s.hooks[t]:s.hooks[t]=a}i&&(0,r.writeFileSync)(e,JSON.stringify(s,null,2))}catch(o){b.logger.debug(`failed to strip IronBee hooks from ${e}: ${o}`)}}maybeDeleteEmptyHooks(e){if((0,r.existsSync)(e))try{const o=JSON.parse((0,r.readFileSync)(e,"utf-8"));re(o)&&(0,r.unlinkSync)(e)}catch(o){b.logger.debug(`failed to inspect ${e} for emptiness: ${o}`)}}mergeConfigToml(e,o,s,i){(0,r.mkdirSync)((0,g.join)(e,".codex"),{recursive:!0});let t=(0,n.readCodexConfigToml)(e);if(t=(0,n.ensureFeaturesHooksTrue)(t),t=(0,n.removeMcpServer)(t,x),t=(0,n.removeMcpServer)(t,w),t=(0,n.removeMcpServer)(t,E),t=(0,n.removeMcpServer)(t,T),s&&i==="main-agent"){t=this.upsertSessionMcpServers(t,e,o),t=(0,n.removeAgentsTable)(t,k),t=(0,n.removeMultiAgentV2SpawnMetadata)(t),this.removeVerifierAgentToml(e),(0,n.writeCodexConfigToml)(e,t);return}if(s){const a=(0,c.getVerificationModel)(o,"codex"),l=(0,r.existsSync)((0,n.userCodexConfigTomlPath)())?(0,r.readFileSync)((0,n.userCodexConfigTomlPath)(),"utf-8"):"",p=(0,n.extractTomlTopLevelModel)(t)===null&&(0,n.extractTomlTopLevelModel)(l)===null;a===void 0&&p&&console.log(` ${d.pc.dim("\u2192")} ${h("[codex]")} ${d.pc.yellow("\u26A0 no model for the verifier")} \u2014 the ${d.pc.bold("ironbee-verifier")} sub-agent inherits the session model, but neither this project's .codex/config.toml nor ~/.codex/config.toml has a top-level ${d.pc.bold("model")}, so it may fail to spawn ("could not resolve the child model"). Fix: set ${d.pc.bold("model")} in ~/.codex/config.toml, or set ${d.pc.bold("verification.model")} in your ironbee config.`),this.writeVerifierAgentToml(e,o,a),t=(0,n.upsertAgentsTable)(t,k,[`description = ${JSON.stringify(V)}`,`config_file = ${JSON.stringify(`agents/${k}.toml`)}`]),t=(0,n.ensureMultiAgentV2SpawnMetadataExposed)(t)}else t=(0,n.removeAgentsTable)(t,k),t=(0,n.removeMultiAgentV2SpawnMetadata)(t),this.removeVerifierAgentToml(e);(0,n.writeCodexConfigToml)(e,t)}writeVerifierAgentToml(e,o,s){const i=(0,g.join)(__dirname,"agents",`${k}.md`);let t;try{t=(0,r.readFileSync)(i,"utf-8")}catch(u){b.logger.debug(`failed to read verifier agent source ${i}: ${u}`);return}const a=A("codex");for(const u of c.ALL_CYCLES){const S=(0,c.isCycleEnabled)(o,u)?H=>{const $=(0,g.join)(a,(0,C.fragmentFilename)("skill",u,H));return(0,r.existsSync)($)?(0,r.readFileSync)($,"utf-8").trimEnd():null}:null;t=(0,C.applyPlatformSection)(t,u,S,`${k}.toml`)}const l=[];l.push(`name = ${JSON.stringify(k)}`),l.push(`description = ${JSON.stringify(V)}`),l.push('sandbox_mode = "read-only"'),s&&l.push(`model = ${JSON.stringify(s)}`),l.push("developer_instructions = '''"),l.push(t.replace(/'''/g,"```").trimEnd()),l.push("'''");const p=y((u,m,S)=>{u&&(l.push(""),l.push(`[mcp_servers.${m}]`),l.push(...N(S)),l.push(`startup_timeout_sec = ${R}`),l.push("required = true"),l.push('default_tools_approval_mode = "approve"'))},"addCycle");p((0,c.isCycleEnabled)(o,"browser"),x,(0,c.getMcpServerEntry)(e)),p((0,c.isCycleEnabled)(o,"node"),w,(0,c.getNodeDevToolsMcpEntry)(e)),p((0,c.isCycleEnabled)(o,"backend"),E,(0,c.getBackendDevToolsMcpEntry)(e)),p((0,c.isCycleEnabled)(o,"android"),T,(0,c.getAndroidDevToolsMcpEntry)(e));const v=(0,n.codexAgentTomlPath)(e,k);(0,r.mkdirSync)((0,g.dirname)(v),{recursive:!0}),(0,r.writeFileSync)(v,l.join(`
2
2
  `)+`
3
- `)}upsertSessionMcpServers(e,o,s){let i=e;const t=y((a,l,p)=>{if(!a)return;const v=[...N(p),`startup_timeout_sec = ${H}`,'default_tools_approval_mode = "approve"'];i=(0,n.upsertMcpServer)(i,l,v)},"addCycle");return t((0,c.isCycleEnabled)(s,"browser"),x,(0,c.getMcpServerEntry)(o)),t((0,c.isCycleEnabled)(s,"node"),E,(0,c.getNodeDevToolsMcpEntry)(o)),t((0,c.isCycleEnabled)(s,"backend"),w,(0,c.getBackendDevToolsMcpEntry)(o)),t((0,c.isCycleEnabled)(s,"android"),T,(0,c.getAndroidDevToolsMcpEntry)(o)),i}removeVerifierAgentToml(e){const o=(0,n.codexAgentTomlPath)(e,k);if((0,r.existsSync)(o))try{(0,r.unlinkSync)(o)}catch(s){b.logger.debug(`failed to remove verifier agent toml: ${s}`)}}removeIronBeeMcpServers(e){let o=(0,n.readCodexConfigToml)(e);o&&(o=(0,n.removeMcpServer)(o,x),o=(0,n.removeMcpServer)(o,E),o=(0,n.removeMcpServer)(o,w),o=(0,n.removeMcpServer)(o,T),o=(0,n.removeAgentsTable)(o,k),o=(0,n.removeMultiAgentV2SpawnMetadata)(o),(0,n.writeCodexConfigToml)(e,o))}migrateAwayFromUserLevel(){const e=(0,n.userCodexHooksJsonPath)();this.removeIronBeeHooks(e),this.maybeDeleteEmptyHooks(e);const o=(0,n.userCodexConfigTomlPath)();if((0,r.existsSync)(o))try{let i=(0,r.readFileSync)(o,"utf-8");const t=i;i=(0,n.removeMcpServer)(i,x),i=(0,n.removeMcpServer)(i,E),i=(0,n.removeMcpServer)(i,w),i=(0,n.removeMcpServer)(i,T),i=(0,n.removeAgentsTable)(i,k),i=(0,n.removeMultiAgentV2SpawnMetadata)(i),i!==t&&(0,r.writeFileSync)(o,i)}catch(i){b.logger.debug(`migrate: failed to clean user-level config.toml: ${i}`)}const s=(0,n.userCodexAgentTomlPath)(k);if((0,r.existsSync)(s))try{(0,r.unlinkSync)(s)}catch(i){b.logger.debug(`migrate: failed to remove user-level verifier toml: ${i}`)}}writeAgentsMdBlock(e,o,s){const i=(0,g.join)(e,"AGENTS.md"),t=s==="main-agent"?"ironbee-verification.main.md":"ironbee-verification.md",a=(0,g.join)(__dirname,"rules",t);let l;try{l=(0,r.readFileSync)(a,"utf-8")}catch(m){b.logger.debug(`failed to read rule source ${a}: ${m}`);return}const p=A("codex");for(const m of c.ALL_CYCLES){const I=(0,c.isCycleEnabled)(o,m)?$=>{const R=(0,g.join)(p,(0,C.fragmentFilename)("rule",m,$));if(!(0,r.existsSync)(R)){const Q=$.length>0?`${m}:${$}`:m;return b.logger.debug(`AGENTS.md platform-section ${Q}: missing fragment ${R}, using placeholder`),null}return(0,r.readFileSync)(R,"utf-8").trimEnd()}:null;l=(0,C.applyPlatformSection)(l,m,I,"AGENTS.md")}const v=(0,r.existsSync)(i)?(0,r.readFileSync)(i,"utf-8"):"",u=(0,n.upsertAgentsMdBlock)(v,l);(0,r.writeFileSync)(i,u)}writeSkills(e,o,s,i){const t=(0,g.join)(e,".agents","skills"),a=i==="main-agent";if(o){const v=(0,g.join)(t,"ironbee-verification");(0,r.mkdirSync)(v,{recursive:!0});const u=(0,g.join)(__dirname,"skills",a?"ironbee-verification.main.md":"ironbee-verification.md");try{let m=(0,r.readFileSync)(u,"utf-8");a&&(m=this.spliceCycleFragments(m,"skill",s,"ironbee-verification/SKILL.md")),(0,r.writeFileSync)((0,g.join)(v,"SKILL.md"),m)}catch(m){b.logger.debug(`failed to copy skill ${u}: ${m}`)}}const l=(0,g.join)(t,"ironbee-verify");(0,r.mkdirSync)(l,{recursive:!0});const p=(0,g.join)(__dirname,"commands","ironbee-verify",a?"SKILL.main.md":"SKILL.md");try{let v=(0,r.readFileSync)(p,"utf-8");a&&(v=this.spliceCycleFragments(v,"command-verify",s,"ironbee-verify/SKILL.md")),(0,r.writeFileSync)((0,g.join)(l,"SKILL.md"),v)}catch(v){b.logger.debug(`failed to copy verify command ${p}: ${v}`)}}spliceCycleFragments(e,o,s,i){const t=A("codex");let a=e;for(const l of c.ALL_CYCLES){const v=(0,c.isCycleEnabled)(s,l)?u=>{const m=(0,g.join)(t,(0,C.fragmentFilename)(o,l,u));return(0,r.existsSync)(m)?(0,r.readFileSync)(m,"utf-8").trimEnd():null}:null;a=(0,C.applyPlatformSection)(a,l,v,i)}return a}removeDir(e){if((0,r.existsSync)(e))try{(0,r.rmSync)(e,{recursive:!0,force:!0})}catch(o){b.logger.debug(`failed to remove ${e}: ${o}`)}}}function N(f){return(0,n.tomlBodyFromRecord)(f)}y(N,"mcpEntryToTomlBody");0&&(module.exports={CodexClient});
3
+ `)}upsertSessionMcpServers(e,o,s){let i=e;const t=y((a,l,p)=>{if(!a)return;const v=[...N(p),`startup_timeout_sec = ${R}`,'default_tools_approval_mode = "approve"'];i=(0,n.upsertMcpServer)(i,l,v)},"addCycle");return t((0,c.isCycleEnabled)(s,"browser"),x,(0,c.getMcpServerEntry)(o)),t((0,c.isCycleEnabled)(s,"node"),w,(0,c.getNodeDevToolsMcpEntry)(o)),t((0,c.isCycleEnabled)(s,"backend"),E,(0,c.getBackendDevToolsMcpEntry)(o)),t((0,c.isCycleEnabled)(s,"android"),T,(0,c.getAndroidDevToolsMcpEntry)(o)),i}removeVerifierAgentToml(e){const o=(0,n.codexAgentTomlPath)(e,k);if((0,r.existsSync)(o))try{(0,r.unlinkSync)(o)}catch(s){b.logger.debug(`failed to remove verifier agent toml: ${s}`)}}removeIronBeeMcpServers(e){let o=(0,n.readCodexConfigToml)(e);o&&(o=(0,n.removeMcpServer)(o,x),o=(0,n.removeMcpServer)(o,w),o=(0,n.removeMcpServer)(o,E),o=(0,n.removeMcpServer)(o,T),o=(0,n.removeAgentsTable)(o,k),o=(0,n.removeMultiAgentV2SpawnMetadata)(o),(0,n.writeCodexConfigToml)(e,o))}migrateAwayFromUserLevel(){const e=(0,n.userCodexHooksJsonPath)();this.removeIronBeeHooks(e),this.maybeDeleteEmptyHooks(e);const o=(0,n.userCodexConfigTomlPath)();if((0,r.existsSync)(o))try{let i=(0,r.readFileSync)(o,"utf-8");const t=i;i=(0,n.removeMcpServer)(i,x),i=(0,n.removeMcpServer)(i,w),i=(0,n.removeMcpServer)(i,E),i=(0,n.removeMcpServer)(i,T),i=(0,n.removeAgentsTable)(i,k),i=(0,n.removeMultiAgentV2SpawnMetadata)(i),i!==t&&(0,r.writeFileSync)(o,i)}catch(i){b.logger.debug(`migrate: failed to clean user-level config.toml: ${i}`)}const s=(0,n.userCodexAgentTomlPath)(k);if((0,r.existsSync)(s))try{(0,r.unlinkSync)(s)}catch(i){b.logger.debug(`migrate: failed to remove user-level verifier toml: ${i}`)}}writeAgentsMdBlock(e,o,s){const i=(0,g.join)(e,"AGENTS.md"),t=s==="main-agent"?"ironbee-verification.main.md":"ironbee-verification.md",a=(0,g.join)(__dirname,"rules",t);let l;try{l=(0,r.readFileSync)(a,"utf-8")}catch(m){b.logger.debug(`failed to read rule source ${a}: ${m}`);return}const p=A("codex");for(const m of c.ALL_CYCLES){const H=(0,c.isCycleEnabled)(o,m)?$=>{const I=(0,g.join)(p,(0,C.fragmentFilename)("rule",m,$));if(!(0,r.existsSync)(I)){const Q=$.length>0?`${m}:${$}`:m;return b.logger.debug(`AGENTS.md platform-section ${Q}: missing fragment ${I}, using placeholder`),null}return(0,r.readFileSync)(I,"utf-8").trimEnd()}:null;l=(0,C.applyPlatformSection)(l,m,H,"AGENTS.md")}const v=(0,r.existsSync)(i)?(0,r.readFileSync)(i,"utf-8"):"",u=(0,n.upsertAgentsMdBlock)(v,l);(0,r.writeFileSync)(i,u)}writeSkills(e,o,s,i){const t=(0,g.join)(e,".agents","skills"),a=i==="main-agent";if(o){const v=(0,g.join)(t,"ironbee-verification");(0,r.mkdirSync)(v,{recursive:!0});const u=(0,g.join)(__dirname,"skills",a?"ironbee-verification.main.md":"ironbee-verification.md");try{let m=(0,r.readFileSync)(u,"utf-8");a&&(m=this.spliceCycleFragments(m,"skill",s,"ironbee-verification/SKILL.md")),(0,r.writeFileSync)((0,g.join)(v,"SKILL.md"),m)}catch(m){b.logger.debug(`failed to copy skill ${u}: ${m}`)}}const l=(0,g.join)(t,"ironbee-verify");(0,r.mkdirSync)(l,{recursive:!0});const p=(0,g.join)(__dirname,"commands","ironbee-verify",a?"SKILL.main.md":"SKILL.md");try{let v=(0,r.readFileSync)(p,"utf-8");a&&(v=this.spliceCycleFragments(v,"command-verify",s,"ironbee-verify/SKILL.md")),(0,r.writeFileSync)((0,g.join)(l,"SKILL.md"),v)}catch(v){b.logger.debug(`failed to copy verify command ${p}: ${v}`)}}spliceCycleFragments(e,o,s,i){const t=A("codex");let a=e;for(const l of c.ALL_CYCLES){const v=(0,c.isCycleEnabled)(s,l)?u=>{const m=(0,g.join)(t,(0,C.fragmentFilename)(o,l,u));return(0,r.existsSync)(m)?(0,r.readFileSync)(m,"utf-8").trimEnd():null}:null;a=(0,C.applyPlatformSection)(a,l,v,i)}return a}removeDir(e){if((0,r.existsSync)(e))try{(0,r.rmSync)(e,{recursive:!0,force:!0})}catch(o){b.logger.debug(`failed to remove ${e}: ${o}`)}}}function N(f){return(0,n.tomlBodyFromRecord)(f)}y(N,"mcpEntryToTomlBody");0&&(module.exports={CodexClient});
@@ -1,48 +1,54 @@
1
- "use strict";var k=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var W=Object.prototype.hasOwnProperty;var o=(n,t)=>k(n,"name",{value:t,configurable:!0});var M=(n,t)=>{for(var e in t)k(n,e,{get:t[e],enumerable:!0})},P=(n,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of L(t))!W.call(n,r)&&r!==e&&k(n,r,{get:()=>t[r],enumerable:!(s=E(t,r))||s.enumerable});return n};var J=n=>P(k({},"__esModule",{value:!0}),n);var pn={};M(pn,{AGENTS_MD_END_MARKER:()=>x,AGENTS_MD_START_MARKER:()=>v,canonicalizeCodexServerName:()=>C,canonicalizeCodexToolName:()=>$,classifyCodexTool:()=>V,codexAgentTomlPath:()=>en,codexConfigTomlPath:()=>T,codexHooksJsonPath:()=>ln,decodeJwtPayload:()=>A,ensureFeaturesHooksTrue:()=>Z,ensureMultiAgentV2SpawnMetadataExposed:()=>q,extractBashBinary:()=>j,extractCodexMcpServer:()=>I,extractCodexToolInput:()=>D,extractTomlTopLevelModel:()=>rn,findTomlSection:()=>h,normalizeCodexToolName:()=>S,parseCodexHookStdin:()=>B,readCodexConfigToml:()=>an,removeAgentsTable:()=>tn,removeMcpServer:()=>N,removeMultiAgentV2SpawnMetadata:()=>Q,resolveCodexUsage:()=>U,stripAgentsMdBlock:()=>un,tomlBodyFromRecord:()=>sn,upsertAgentsMdBlock:()=>on,upsertAgentsTable:()=>nn,upsertMcpServer:()=>Y,userCodexAgentTomlPath:()=>fn,userCodexConfigTomlPath:()=>cn,userCodexHooksJsonPath:()=>gn,writeCodexConfigToml:()=>dn});module.exports=J(pn);var m=require("fs"),b=require("os"),p=require("path"),y=require("../../lib/logger");function B(n){try{return JSON.parse(n)}catch(t){return y.logger.debug(`failed to parse Codex hook stdin: ${t}`),{}}}o(B,"parseCodexHookStdin");const _="mcp__",z={browser_devtools:"browser-devtools",node_devtools:"node-devtools",backend_devtools:"backend-devtools",android_devtools:"android-devtools"},H=["bdt_","ndt_","bedt_","adt_"];function C(n){return z[n]??n}o(C,"canonicalizeCodexServerName");function $(n){if(!H.some(e=>n.startsWith(e)))return n;const t=n.split("_");return t.length<=3?n:`${t[0]}_${t[1]}_${t.slice(2).join("-")}`}o($,"canonicalizeCodexToolName");const F=[["bdt_","browser-devtools"],["ndt_","node-devtools"],["bedt_","backend-devtools"],["adt_","android-devtools"]];function I(n){if(!n)return null;if(n.startsWith(_)){const t=n.slice(_.length),e=t.indexOf("__");return e<0?null:C(t.slice(0,e))}for(const[t,e]of F)if(n.startsWith(t))return e;return null}o(I,"extractCodexMcpServer");function S(n){return n==="exec_command"?"Bash":n==="apply_patch"?"Edit":n==="update_plan"?"TodoWrite":n==="read_file"?"Read":n==="web_search"?"WebSearch":n==="web_fetch"?"WebFetch":n}o(S,"normalizeCodexToolName");function V(n){if(!n)return{tool_type:null,tool_name:"",mcp_server:null};if(n.startsWith(_)){const s=n.slice(_.length),r=s.indexOf("__");if(r>=0){const i=s.slice(0,r),u=C(i),a=s.slice(r+2);return{tool_type:"mcp",tool_name:$(a),mcp_server:u}}}const t=I(n);if(t!==null&&!n.startsWith(_))return{tool_type:"mcp",tool_name:$(n),mcp_server:t};const e=S(n);return n==="spawn_agent"||n==="wait_agent"||n==="close_agent"?{tool_type:"sub_agent",tool_name:e,mcp_server:null}:{tool_type:null,tool_name:e,mcp_server:null}}o(V,"classifyCodexTool");function D(n,t){if(!n||t===void 0)return;if(n==="apply_patch"){if(typeof t=="string")return{input_size:t.length};if(typeof t=="object"&&t!==null){const r=t,i=r.command??r.input;if(typeof i=="string")return{input_size:i.length}}return{input_size:void 0}}if(typeof t!="object"||t===null)return;const e=t;if(S(n)==="Bash"){const r=e.cmd??e.command,i=typeof r=="string"?j(r):void 0;return{workdir:e.workdir,binary:i}}if(n==="update_plan"){const r=e.explanation,i=e.plan;return{explanation:typeof r=="string"?r:void 0,plan_step_count:Array.isArray(i)?i.length:void 0}}if(n==="spawn_agent"){const r=e.agent_type,i=e.message,u=e.fork_context;return{agent_type:typeof r=="string"?r:void 0,message_size:typeof i=="string"?i.length:void 0,fork_context:typeof u=="boolean"?u:void 0}}if(n==="wait_agent"){const r=e.targets,i=e.timeout_ms;return{target_count:Array.isArray(r)?r.length:void 0,timeout_ms:typeof i=="number"?i:void 0}}if(n==="close_agent"){const r=e.target;return{target:typeof r=="string"?r:void 0}}if(n==="view_image"){const r=e.path,i=e.detail;return{path:typeof r=="string"?r:void 0,detail:typeof i=="string"?i:void 0}}if(n==="write_stdin"){const r=e.session_id,i=e.chars,u=e.yield_time_ms,a=e.max_output_tokens;return{session_id:typeof r=="number"?r:void 0,chars_size:typeof i=="string"?i.length:void 0,yield_time_ms:typeof u=="number"?u:void 0,max_output_tokens:typeof a=="number"?a:void 0}}if(n.startsWith(_)||I(n)!==null){if("_metadata"in e){const{_metadata:r,...i}=e;return i}return e}}o(D,"extractCodexToolInput");function j(n){const t=n.trim();if(!t)return;const e=t.split(/\s+/);for(const s of e)if(!/^[A-Za-z_][A-Za-z0-9_]*=/.test(s)&&s.length>0)return s.split(/[\\/]/).pop()??s}o(j,"extractBashBinary");function A(n){const t=n.split(".");if(t.length!==3)return null;try{const e=Buffer.from(t[1],"base64url").toString("utf-8"),s=JSON.parse(e);return typeof s!="object"||s===null?null:s}catch{return null}}o(A,"decodeJwtPayload");function K(n){if(typeof n=="string"){const t=A(n);return t?{email:t.email,planType:t["https://api.openai.com/auth"]?.chatgpt_plan_type}:{}}if(typeof n=="object"&&n!==null){const t=n;return{email:t.email,planType:t.chatgpt_plan_type}}return{}}o(K,"extractIdTokenFields");function U(n){const t=n??(0,p.join)((0,b.homedir)(),".codex","auth.json");if(!(0,m.existsSync)(t))return{};try{const e=JSON.parse((0,m.readFileSync)(t,"utf-8")),s=e.auth_mode==="chatgpt"||e.auth_mode==="swic"?"subscription":e.auth_mode==="api"?"api":void 0,{email:r,planType:i}=K(e.tokens?.id_token);return{usageType:s,usagePlan:i?.toLowerCase(),userEmail:r}}catch(e){return y.logger.debug(`failed to parse ${t}: ${e}`),{}}}o(U,"resolveCodexUsage");function X(n,t){return n.trim()===`[${t}]`}o(X,"tableHeaderLineExact");function G(n){const t=n.trim();return/^\[\[?[^\]]+\]\]?$/.test(t)}o(G,"isAnyTableHeader");function R(n){const e=n.trim().match(/^\[([^[\]]+)\]$/);return e===null?null:e[1]}o(R,"tableHeaderName");function h(n,t){let e=-1;for(let r=0;r<n.length;r+=1)if(X(n[r],t)){e=r;break}if(e<0)return null;let s=n.length;for(let r=e+1;r<n.length;r+=1)if(G(n[r])){s=r;break}return{startIdx:e,endIdx:s}}o(h,"findTomlSection");function O(n){const t=[...n];for(;t.length>0&&t[t.length-1].trim()==="";)t.pop();return t}o(O,"trimTrailingBlanks");function w(n,t){return n.length===0?t.join(`
1
+ "use strict";var k=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var W=Object.prototype.hasOwnProperty;var o=(n,t)=>k(n,"name",{value:t,configurable:!0});var M=(n,t)=>{for(var e in t)k(n,e,{get:t[e],enumerable:!0})},P=(n,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of L(t))!W.call(n,r)&&r!==e&&k(n,r,{get:()=>t[r],enumerable:!(s=E(t,r))||s.enumerable});return n};var J=n=>P(k({},"__esModule",{value:!0}),n);var mn={};M(mn,{AGENTS_MD_END_MARKER:()=>x,AGENTS_MD_START_MARKER:()=>I,canonicalizeCodexServerName:()=>C,canonicalizeCodexToolName:()=>$,classifyCodexTool:()=>V,codexAgentTomlPath:()=>rn,codexConfigTomlPath:()=>T,codexHooksJsonPath:()=>cn,decodeJwtPayload:()=>A,ensureFeaturesHooksTrue:()=>Z,ensureMultiAgentV2SpawnMetadataExposed:()=>Q,extractBashBinary:()=>j,extractCodexMcpServer:()=>S,extractCodexToolInput:()=>D,extractTomlTopLevelModel:()=>sn,findTomlSection:()=>_,normalizeCodexToolName:()=>R,parseCodexHookStdin:()=>B,readCodexConfigToml:()=>ln,removeAgentsTable:()=>en,removeFeaturesHooks:()=>q,removeMcpServer:()=>nn,removeMultiAgentV2SpawnMetadata:()=>Y,resolveCodexUsage:()=>U,stripAgentsMdBlock:()=>an,tomlBodyFromRecord:()=>on,upsertAgentsMdBlock:()=>un,upsertAgentsTable:()=>tn,upsertMcpServer:()=>N,userCodexAgentTomlPath:()=>pn,userCodexConfigTomlPath:()=>gn,userCodexHooksJsonPath:()=>fn,writeCodexConfigToml:()=>dn});module.exports=J(mn);var m=require("fs"),b=require("os"),p=require("path"),y=require("../../lib/logger");function B(n){try{return JSON.parse(n)}catch(t){return y.logger.debug(`failed to parse Codex hook stdin: ${t}`),{}}}o(B,"parseCodexHookStdin");const h="mcp__",z={browser_devtools:"browser-devtools",node_devtools:"node-devtools",backend_devtools:"backend-devtools",android_devtools:"android-devtools"},H=["bdt_","ndt_","bedt_","adt_"];function C(n){return z[n]??n}o(C,"canonicalizeCodexServerName");function $(n){if(!H.some(e=>n.startsWith(e)))return n;const t=n.split("_");return t.length<=3?n:`${t[0]}_${t[1]}_${t.slice(2).join("-")}`}o($,"canonicalizeCodexToolName");const F=[["bdt_","browser-devtools"],["ndt_","node-devtools"],["bedt_","backend-devtools"],["adt_","android-devtools"]];function S(n){if(!n)return null;if(n.startsWith(h)){const t=n.slice(h.length),e=t.indexOf("__");return e<0?null:C(t.slice(0,e))}for(const[t,e]of F)if(n.startsWith(t))return e;return null}o(S,"extractCodexMcpServer");function R(n){return n==="exec_command"?"Bash":n==="apply_patch"?"Edit":n==="update_plan"?"TodoWrite":n==="read_file"?"Read":n==="web_search"?"WebSearch":n==="web_fetch"?"WebFetch":n}o(R,"normalizeCodexToolName");function V(n){if(!n)return{tool_type:null,tool_name:"",mcp_server:null};if(n.startsWith(h)){const s=n.slice(h.length),r=s.indexOf("__");if(r>=0){const i=s.slice(0,r),u=C(i),a=s.slice(r+2);return{tool_type:"mcp",tool_name:$(a),mcp_server:u}}}const t=S(n);if(t!==null&&!n.startsWith(h))return{tool_type:"mcp",tool_name:$(n),mcp_server:t};const e=R(n);return n==="spawn_agent"||n==="wait_agent"||n==="close_agent"?{tool_type:"sub_agent",tool_name:e,mcp_server:null}:{tool_type:null,tool_name:e,mcp_server:null}}o(V,"classifyCodexTool");function D(n,t){if(!n||t===void 0)return;if(n==="apply_patch"){if(typeof t=="string")return{input_size:t.length};if(typeof t=="object"&&t!==null){const r=t,i=r.command??r.input;if(typeof i=="string")return{input_size:i.length}}return{input_size:void 0}}if(typeof t!="object"||t===null)return;const e=t;if(R(n)==="Bash"){const r=e.cmd??e.command,i=typeof r=="string"?j(r):void 0;return{workdir:e.workdir,binary:i}}if(n==="update_plan"){const r=e.explanation,i=e.plan;return{explanation:typeof r=="string"?r:void 0,plan_step_count:Array.isArray(i)?i.length:void 0}}if(n==="spawn_agent"){const r=e.agent_type,i=e.message,u=e.fork_context;return{agent_type:typeof r=="string"?r:void 0,message_size:typeof i=="string"?i.length:void 0,fork_context:typeof u=="boolean"?u:void 0}}if(n==="wait_agent"){const r=e.targets,i=e.timeout_ms;return{target_count:Array.isArray(r)?r.length:void 0,timeout_ms:typeof i=="number"?i:void 0}}if(n==="close_agent"){const r=e.target;return{target:typeof r=="string"?r:void 0}}if(n==="view_image"){const r=e.path,i=e.detail;return{path:typeof r=="string"?r:void 0,detail:typeof i=="string"?i:void 0}}if(n==="write_stdin"){const r=e.session_id,i=e.chars,u=e.yield_time_ms,a=e.max_output_tokens;return{session_id:typeof r=="number"?r:void 0,chars_size:typeof i=="string"?i.length:void 0,yield_time_ms:typeof u=="number"?u:void 0,max_output_tokens:typeof a=="number"?a:void 0}}if(n.startsWith(h)||S(n)!==null){if("_metadata"in e){const{_metadata:r,...i}=e;return i}return e}}o(D,"extractCodexToolInput");function j(n){const t=n.trim();if(!t)return;const e=t.split(/\s+/);for(const s of e)if(!/^[A-Za-z_][A-Za-z0-9_]*=/.test(s)&&s.length>0)return s.split(/[\\/]/).pop()??s}o(j,"extractBashBinary");function A(n){const t=n.split(".");if(t.length!==3)return null;try{const e=Buffer.from(t[1],"base64url").toString("utf-8"),s=JSON.parse(e);return typeof s!="object"||s===null?null:s}catch{return null}}o(A,"decodeJwtPayload");function K(n){if(typeof n=="string"){const t=A(n);return t?{email:t.email,planType:t["https://api.openai.com/auth"]?.chatgpt_plan_type}:{}}if(typeof n=="object"&&n!==null){const t=n;return{email:t.email,planType:t.chatgpt_plan_type}}return{}}o(K,"extractIdTokenFields");function U(n){const t=n??(0,p.join)((0,b.homedir)(),".codex","auth.json");if(!(0,m.existsSync)(t))return{};try{const e=JSON.parse((0,m.readFileSync)(t,"utf-8")),s=e.auth_mode==="chatgpt"||e.auth_mode==="swic"?"subscription":e.auth_mode==="api"?"api":void 0,{email:r,planType:i}=K(e.tokens?.id_token);return{usageType:s,usagePlan:i?.toLowerCase(),userEmail:r}}catch(e){return y.logger.debug(`failed to parse ${t}: ${e}`),{}}}o(U,"resolveCodexUsage");function X(n,t){return n.trim()===`[${t}]`}o(X,"tableHeaderLineExact");function G(n){const t=n.trim();return/^\[\[?[^\]]+\]\]?$/.test(t)}o(G,"isAnyTableHeader");function O(n){const e=n.trim().match(/^\[([^[\]]+)\]$/);return e===null?null:e[1]}o(O,"tableHeaderName");function _(n,t){let e=-1;for(let r=0;r<n.length;r+=1)if(X(n[r],t)){e=r;break}if(e<0)return null;let s=n.length;for(let r=e+1;r<n.length;r+=1)if(G(n[r])){s=r;break}return{startIdx:e,endIdx:s}}o(_,"findTomlSection");function v(n){const t=[...n];for(;t.length>0&&t[t.length-1].trim()==="";)t.pop();return t}o(v,"trimTrailingBlanks");function w(n,t){return n.length===0?t.join(`
2
2
  `)+`
3
3
  `:n.replace(/\n+$/,"")+`
4
4
 
5
5
  `+t.join(`
6
6
  `)+`
7
7
  `}o(w,"appendBlockWithSeparator");function Z(n){const t=n.split(`
8
- `),e=h(t,"features");if(e===null)return w(n,["[features]","hooks = true"]);const s=t.slice(e.startIdx+1,e.endIdx),r=/^\s*hooks\s*=/;let i=!1;for(let d=0;d<s.length;d+=1)if(r.test(s[d])){s[d]="hooks = true",i=!0;break}i||s.unshift("hooks = true");const u=O(s),c=[...t.slice(0,e.startIdx),t[e.startIdx],...u,...e.endIdx<t.length?[""]:[],...t.slice(e.endIdx)].join(`
9
- `);return c.endsWith(`
10
- `)?c:c+`
8
+ `),e=_(t,"features");if(e===null)return w(n,["[features]","hooks = true"]);const s=t.slice(e.startIdx+1,e.endIdx),r=/^\s*hooks\s*=/;let i=!1;for(let l=0;l<s.length;l+=1)if(r.test(s[l])){s[l]="hooks = true",i=!0;break}i||s.unshift("hooks = true");const u=v(s),d=[...t.slice(0,e.startIdx),t[e.startIdx],...u,...e.endIdx<t.length?[""]:[],...t.slice(e.endIdx)].join(`
9
+ `);return d.endsWith(`
10
+ `)?d:d+`
11
11
  `}o(Z,"ensureFeaturesHooksTrue");function q(n){const t=n.split(`
12
- `),e=h(t,"features.multi_agent_v2");if(e===null)return w(n,["[features.multi_agent_v2]","hide_spawn_agent_metadata = false"]);const s=t.slice(e.startIdx+1,e.endIdx),r=/^\s*hide_spawn_agent_metadata\s*=/;let i=!1;for(let d=0;d<s.length;d+=1)if(r.test(s[d])){s[d]="hide_spawn_agent_metadata = false",i=!0;break}i||s.unshift("hide_spawn_agent_metadata = false");const u=O(s),c=[...t.slice(0,e.startIdx),t[e.startIdx],...u,...e.endIdx<t.length?[""]:[],...t.slice(e.endIdx)].join(`
13
- `);return c.endsWith(`
14
- `)?c:c+`
15
- `}o(q,"ensureMultiAgentV2SpawnMetadataExposed");function Q(n){const t=n.split(`
16
- `),e=h(t,"features.multi_agent_v2");if(e===null)return n;const s=t.slice(e.startIdx+1,e.endIdx).filter(a=>a.trim().length>0);if(!(s.length===1&&/^\s*hide_spawn_agent_metadata\s*=\s*false\s*$/.test(s[0])))return n;const u=[...t.slice(0,e.startIdx),...t.slice(e.endIdx)].join(`
12
+ `),e=_(t,"features");if(e===null)return n;const s=t.slice(e.startIdx+1,e.endIdx),r=/^\s*hooks\s*=\s*true\s*$/,i=s.filter(l=>!r.test(l));if(i.length===s.length)return n;const u=i.some(l=>l.trim().length>0);let a;if(u){const l=v(i);a=[...t.slice(0,e.startIdx),t[e.startIdx],...l,...e.endIdx<t.length?[""]:[],...t.slice(e.endIdx)]}else a=[...t.slice(0,e.startIdx),...t.slice(e.endIdx)];const d=a.join(`
13
+ `).replace(/\n{3,}/g,`
14
+
15
+ `);return d.endsWith(`
16
+ `)?d:d+`
17
+ `}o(q,"removeFeaturesHooks");function Q(n){const t=n.split(`
18
+ `),e=_(t,"features.multi_agent_v2");if(e===null)return w(n,["[features.multi_agent_v2]","hide_spawn_agent_metadata = false"]);const s=t.slice(e.startIdx+1,e.endIdx),r=/^\s*hide_spawn_agent_metadata\s*=/;let i=!1;for(let l=0;l<s.length;l+=1)if(r.test(s[l])){s[l]="hide_spawn_agent_metadata = false",i=!0;break}i||s.unshift("hide_spawn_agent_metadata = false");const u=v(s),d=[...t.slice(0,e.startIdx),t[e.startIdx],...u,...e.endIdx<t.length?[""]:[],...t.slice(e.endIdx)].join(`
19
+ `);return d.endsWith(`
20
+ `)?d:d+`
21
+ `}o(Q,"ensureMultiAgentV2SpawnMetadataExposed");function Y(n){const t=n.split(`
22
+ `),e=_(t,"features.multi_agent_v2");if(e===null)return n;const s=t.slice(e.startIdx+1,e.endIdx).filter(a=>a.trim().length>0);if(!(s.length===1&&/^\s*hide_spawn_agent_metadata\s*=\s*false\s*$/.test(s[0])))return n;const u=[...t.slice(0,e.startIdx),...t.slice(e.endIdx)].join(`
17
23
  `).replace(/\n{3,}/g,`
18
24
 
19
25
  `);return u.endsWith(`
20
26
  `)?u:u+`
21
- `}o(Q,"removeMultiAgentV2SpawnMetadata");function Y(n,t,e){const s=`mcp_servers.${t}`,r=n.split(`
22
- `),i=h(r,s),a=[`[${s}]`,...e];if(i===null)return w(n,a);const c=r.slice(0,i.startIdx),d=r.slice(i.endIdx),l=[...c,...a,...d.length>0?[""]:[],...d].join(`
23
- `);return l.endsWith(`
24
- `)?l:l+`
25
- `}o(Y,"upsertMcpServer");function N(n,t){const e=`mcp_servers.${t}`,s=`${e}.`,r=n.split(`
26
- `),i=[];let u=!1,a=!1;for(const l of r){const g=R(l);if(g!==null&&(u=g===e||g.startsWith(s),u)){a=!0;continue}u||i.push(l)}if(!a)return n;const c=[];let d=!1;for(const l of i){const g=l.trim().length===0;g&&d||(c.push(l),d=g)}const f=c.join(`
27
+ `}o(Y,"removeMultiAgentV2SpawnMetadata");function N(n,t,e){const s=`mcp_servers.${t}`,r=n.split(`
28
+ `),i=_(r,s),a=[`[${s}]`,...e];if(i===null)return w(n,a);const d=r.slice(0,i.startIdx),l=r.slice(i.endIdx),c=[...d,...a,...l.length>0?[""]:[],...l].join(`
29
+ `);return c.endsWith(`
30
+ `)?c:c+`
31
+ `}o(N,"upsertMcpServer");function nn(n,t){const e=`mcp_servers.${t}`,s=`${e}.`,r=n.split(`
32
+ `),i=[];let u=!1,a=!1;for(const c of r){const g=O(c);if(g!==null&&(u=g===e||g.startsWith(s),u)){a=!0;continue}u||i.push(c)}if(!a)return n;const d=[];let l=!1;for(const c of i){const g=c.trim().length===0;g&&l||(d.push(c),l=g)}const f=d.join(`
27
33
  `);return f.endsWith(`
28
34
  `)||f.length===0?f:f+`
29
- `}o(N,"removeMcpServer");function nn(n,t,e){const s=`agents.${t}`,r=n.split(`
30
- `),i=h(r,s),a=[`[${s}]`,...e];if(i===null)return w(n,a);const c=r.slice(0,i.startIdx),d=r.slice(i.endIdx),l=[...c,...a,...d.length>0?[""]:[],...d].join(`
31
- `);return l.endsWith(`
32
- `)?l:l+`
33
- `}o(nn,"upsertAgentsTable");function tn(n,t){const e=`agents.${t}`,s=`${e}.`,r=n.split(`
34
- `),i=[];let u=!1,a=!1;for(const l of r){const g=R(l);if(g!==null&&(u=g===e||g.startsWith(s),u)){a=!0;continue}u||i.push(l)}if(!a)return n;const c=[];let d=!1;for(const l of i){const g=l.trim().length===0;g&&d||(c.push(l),d=g)}const f=c.join(`
35
+ `}o(nn,"removeMcpServer");function tn(n,t,e){const s=`agents.${t}`,r=n.split(`
36
+ `),i=_(r,s),a=[`[${s}]`,...e];if(i===null)return w(n,a);const d=r.slice(0,i.startIdx),l=r.slice(i.endIdx),c=[...d,...a,...l.length>0?[""]:[],...l].join(`
37
+ `);return c.endsWith(`
38
+ `)?c:c+`
39
+ `}o(tn,"upsertAgentsTable");function en(n,t){const e=`agents.${t}`,s=`${e}.`,r=n.split(`
40
+ `),i=[];let u=!1,a=!1;for(const c of r){const g=O(c);if(g!==null&&(u=g===e||g.startsWith(s),u)){a=!0;continue}u||i.push(c)}if(!a)return n;const d=[];let l=!1;for(const c of i){const g=c.trim().length===0;g&&l||(d.push(c),l=g)}const f=d.join(`
35
41
  `);return f.endsWith(`
36
42
  `)||f.length===0?f:f+`
37
- `}o(tn,"removeAgentsTable");function en(n,t){return(0,p.join)(n,".codex","agents",`${t}.toml`)}o(en,"codexAgentTomlPath");function rn(n){for(const t of n.split(`
38
- `)){const e=t.trim();if(e.startsWith("["))break;const s=e.match(/^model\s*=\s*"([^"]*)"/);if(s&&s[1].length>0)return s[1]}return null}o(rn,"extractTomlTopLevelModel");function sn(n){const t=[];for(const[e,s]of Object.entries(n))if(s!=null){if(typeof s=="string")t.push(`${e} = ${JSON.stringify(s)}`);else if(typeof s=="number"||typeof s=="boolean")t.push(`${e} = ${s}`);else if(Array.isArray(s)){const r=s.map(i=>typeof i=="string"?JSON.stringify(i):typeof i=="number"||typeof i=="boolean"?String(i):JSON.stringify(i));t.push(`${e} = [${r.join(", ")}]`)}else if(typeof s=="object"){const r=s,i=[];for(const[u,a]of Object.entries(r))a!=null&&(typeof a=="string"?i.push(`${u} = ${JSON.stringify(a)}`):typeof a=="number"||typeof a=="boolean"?i.push(`${u} = ${a}`):i.push(`${u} = ${JSON.stringify(a)}`));t.push(`${e} = { ${i.join(", ")} }`)}}return t}o(sn,"tomlBodyFromRecord");const v="<!-- ironbee:start -->",x="<!-- ironbee:end -->";function on(n,t){const e=`${v}
43
+ `}o(en,"removeAgentsTable");function rn(n,t){return(0,p.join)(n,".codex","agents",`${t}.toml`)}o(rn,"codexAgentTomlPath");function sn(n){for(const t of n.split(`
44
+ `)){const e=t.trim();if(e.startsWith("["))break;const s=e.match(/^model\s*=\s*"([^"]*)"/);if(s&&s[1].length>0)return s[1]}return null}o(sn,"extractTomlTopLevelModel");function on(n){const t=[];for(const[e,s]of Object.entries(n))if(s!=null){if(typeof s=="string")t.push(`${e} = ${JSON.stringify(s)}`);else if(typeof s=="number"||typeof s=="boolean")t.push(`${e} = ${s}`);else if(Array.isArray(s)){const r=s.map(i=>typeof i=="string"?JSON.stringify(i):typeof i=="number"||typeof i=="boolean"?String(i):JSON.stringify(i));t.push(`${e} = [${r.join(", ")}]`)}else if(typeof s=="object"){const r=s,i=[];for(const[u,a]of Object.entries(r))a!=null&&(typeof a=="string"?i.push(`${u} = ${JSON.stringify(a)}`):typeof a=="number"||typeof a=="boolean"?i.push(`${u} = ${a}`):i.push(`${u} = ${JSON.stringify(a)}`));t.push(`${e} = { ${i.join(", ")} }`)}}return t}o(on,"tomlBodyFromRecord");const I="<!-- ironbee:start -->",x="<!-- ironbee:end -->";function un(n,t){const e=`${I}
39
45
  ${t.trimEnd()}
40
- ${x}`,s=n.indexOf(v),r=n.indexOf(x);if(s>=0&&r>s){const i=n.slice(0,s),u=n.slice(r+x.length);return i+e+u}return n.trim().length===0?e+`
46
+ ${x}`,s=n.indexOf(I),r=n.indexOf(x);if(s>=0&&r>s){const i=n.slice(0,s),u=n.slice(r+x.length);return i+e+u}return n.trim().length===0?e+`
41
47
  `:n.trimEnd()+`
42
48
 
43
49
  `+e+`
44
- `}o(on,"upsertAgentsMdBlock");function un(n){const t=n.indexOf(v),e=n.indexOf(x);if(t<0||e<t)return n.trim().length===0?null:n;const s=n.slice(0,t).trimEnd(),r=n.slice(e+x.length).trimStart(),i=s+(s.length>0&&r.length>0?`
50
+ `}o(un,"upsertAgentsMdBlock");function an(n){const t=n.indexOf(I),e=n.indexOf(x);if(t<0||e<t)return n.trim().length===0?null:n;const s=n.slice(0,t).trimEnd(),r=n.slice(e+x.length).trimStart(),i=s+(s.length>0&&r.length>0?`
45
51
 
46
52
  `:"")+r;return i.trim().length===0?null:i.endsWith(`
47
53
  `)?i:i+`
48
- `}o(un,"stripAgentsMdBlock");function an(n){const t=T(n);if(!(0,m.existsSync)(t))return"";try{return(0,m.readFileSync)(t,"utf-8")}catch(e){return y.logger.debug(`failed to read ${t}: ${e}`),""}}o(an,"readCodexConfigToml");function dn(n,t){const e=T(n);try{(0,m.writeFileSync)(e,t)}catch(s){y.logger.debug(`failed to write ${e}: ${s}`)}}o(dn,"writeCodexConfigToml");function T(n){return(0,p.join)(n,".codex","config.toml")}o(T,"codexConfigTomlPath");function ln(n){return(0,p.join)(n,".codex","hooks.json")}o(ln,"codexHooksJsonPath");function cn(){return(0,p.join)((0,b.homedir)(),".codex","config.toml")}o(cn,"userCodexConfigTomlPath");function gn(){return(0,p.join)((0,b.homedir)(),".codex","hooks.json")}o(gn,"userCodexHooksJsonPath");function fn(n){return(0,p.join)((0,b.homedir)(),".codex","agents",`${n}.toml`)}o(fn,"userCodexAgentTomlPath");0&&(module.exports={AGENTS_MD_END_MARKER,AGENTS_MD_START_MARKER,canonicalizeCodexServerName,canonicalizeCodexToolName,classifyCodexTool,codexAgentTomlPath,codexConfigTomlPath,codexHooksJsonPath,decodeJwtPayload,ensureFeaturesHooksTrue,ensureMultiAgentV2SpawnMetadataExposed,extractBashBinary,extractCodexMcpServer,extractCodexToolInput,extractTomlTopLevelModel,findTomlSection,normalizeCodexToolName,parseCodexHookStdin,readCodexConfigToml,removeAgentsTable,removeMcpServer,removeMultiAgentV2SpawnMetadata,resolveCodexUsage,stripAgentsMdBlock,tomlBodyFromRecord,upsertAgentsMdBlock,upsertAgentsTable,upsertMcpServer,userCodexAgentTomlPath,userCodexConfigTomlPath,userCodexHooksJsonPath,writeCodexConfigToml});
54
+ `}o(an,"stripAgentsMdBlock");function ln(n){const t=T(n);if(!(0,m.existsSync)(t))return"";try{return(0,m.readFileSync)(t,"utf-8")}catch(e){return y.logger.debug(`failed to read ${t}: ${e}`),""}}o(ln,"readCodexConfigToml");function dn(n,t){const e=T(n);try{(0,m.writeFileSync)(e,t)}catch(s){y.logger.debug(`failed to write ${e}: ${s}`)}}o(dn,"writeCodexConfigToml");function T(n){return(0,p.join)(n,".codex","config.toml")}o(T,"codexConfigTomlPath");function cn(n){return(0,p.join)(n,".codex","hooks.json")}o(cn,"codexHooksJsonPath");function gn(){return(0,p.join)((0,b.homedir)(),".codex","config.toml")}o(gn,"userCodexConfigTomlPath");function fn(){return(0,p.join)((0,b.homedir)(),".codex","hooks.json")}o(fn,"userCodexHooksJsonPath");function pn(n){return(0,p.join)((0,b.homedir)(),".codex","agents",`${n}.toml`)}o(pn,"userCodexAgentTomlPath");0&&(module.exports={AGENTS_MD_END_MARKER,AGENTS_MD_START_MARKER,canonicalizeCodexServerName,canonicalizeCodexToolName,classifyCodexTool,codexAgentTomlPath,codexConfigTomlPath,codexHooksJsonPath,decodeJwtPayload,ensureFeaturesHooksTrue,ensureMultiAgentV2SpawnMetadataExposed,extractBashBinary,extractCodexMcpServer,extractCodexToolInput,extractTomlTopLevelModel,findTomlSection,normalizeCodexToolName,parseCodexHookStdin,readCodexConfigToml,removeAgentsTable,removeFeaturesHooks,removeMcpServer,removeMultiAgentV2SpawnMetadata,resolveCodexUsage,stripAgentsMdBlock,tomlBodyFromRecord,upsertAgentsMdBlock,upsertAgentsTable,upsertMcpServer,userCodexAgentTomlPath,userCodexConfigTomlPath,userCodexHooksJsonPath,writeCodexConfigToml});
@@ -1 +1 @@
1
- "use strict";var y=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var u=(i,e)=>y(i,"name",{value:e,configurable:!0});var T=(i,e)=>{for(var o in e)y(i,o,{get:e[o],enumerable:!0})},R=(i,e,o,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of A(e))!N.call(i,r)&&r!==o&&y(i,r,{get:()=>e[r],enumerable:!(a=V(e,r))||a.enumerable});return i};var B=i=>R(y({},"__esModule",{value:!0}),i);var q={};T(q,{CYCLE_HINTS:()=>D,installCommand:()=>F,runInstallAll:()=>v,syncSchemaIfChanged:()=>W});module.exports=B(q);var $=require("commander"),P=require("fs"),x=require("path"),c=require("../clients/registry"),M=require("../clients/claude"),m=require("../lib/config"),t=require("../lib/output"),j=require("../lib/projects-registry"),f=require("../lib/prompt"),w=require("../lib/telemetry"),S=require("../lib/install-version"),p=require("../lib/schema-sync"),C=require("./cycle-toggle"),l=require("./mode-select");const D={browser:"web UI \xB7 DOM \xB7 console \xB7 a11y \xB7 screenshots \xB7 recording",node:"Node.js runtime \xB7 tracepoints \xB7 logpoints \xB7 exceptions \xB7 variables \xB7 logs",backend:"HTTP \xB7 gRPC \xB7 GraphQL \xB7 WebSocket \xB7 DB \xB7 logs"};async function _(i,e){if(e!==void 0)return e;if(!(0,f.isInteractive)())return;const o=(0,l.resolveInstallDefaultMode)(i),a=Math.max(0,l.ALL_MODES.indexOf(o)),r=l.ALL_MODES.map(d=>({label:l.MODE_LABELS[d],hint:l.MODE_HINTS[d]})),s=await(0,f.promptSelect)("Which verification mode?",r,a);return l.ALL_MODES[s]}u(_,"resolveModeSelection");function k(i,e){if(e===void 0)return;const a=(0,l.applyModeToLayer)(i,"project",e)?"":t.pc.dim(" (unchanged)");t.log.info(`Mode: ${t.pc.bold(l.MODE_LABELS[e])}${a}`)}u(k,"applyModeSelection");async function O(i,e,o){if(e!==void 0)return e;const a=(0,m.loadConfig)(i);if((o??(0,m.getVerificationMode)(a))==="monitor"||!(0,f.isInteractive)())return;const s=m.ALL_CYCLES.map(n=>({label:n,hint:D[n]})),d=m.ALL_CYCLES.map((n,g)=>(0,m.isCyclePatternsActive)(a,n)?g:-1).filter(n=>n>=0);return(await(0,f.promptMultiSelect)("Which platforms should require verification?",s,d)).map(n=>m.ALL_CYCLES[n])}u(O,"resolvePlatformSelection");function E(i,e){if(e===void 0)return;const o=(0,C.reconcileCyclesInLayer)(i,"project",e,!0),a=e.length>0?t.pc.bold(e.join(", ")):t.pc.dim("none (monitoring tools only)"),r=o.length>0?t.pc.dim(` \u2014 updated: ${o.join(", ")}`):"";t.log.info(`Platforms: ${a}${r}`)}u(E,"applyPlatformSelection");function H(i,e){return e!==void 0?(0,c.resolveTargetClients)(i.path,e):(0,c.detectClients)(i.path)}u(H,"clientsForBatchEntry");async function v(i){const e=(0,c.listActiveProjects)();if(e.length===0)return t.log.info("No registered projects to install. Run `ironbee install` somewhere first."),{failures:0,total:0};t.log.info(`Installing across ${t.pc.bold(String(e.length))} registered project(s)\u2026`),t.log.blank();let o=0;const a=[];for(const s of e)try{const d=H(s,i.client);if(d.length===0){t.log.warn(`Skipping ${s.path} \u2014 no resolvable clients`);continue}const h=d.map(n=>n.name);t.log.label("project",t.pc.dim(s.path)),t.log.step(`installing ${t.pc.bold(h.join(", "))}`),(0,M.prepareIronBeeDir)(s.path),k(s.path,i.mode),E(s.path,i.platforms);for(const n of d)n.install(s.path);(0,j.upsertProject)(s.path),a.push(...h)}catch(d){o++,t.log.error(` ${s.path}: ${d instanceof Error?d.message:String(d)}`)}t.log.blank(),o===0?t.log.success(`Installed across ${e.length} project(s). ${t.pc.dim("Restart your AI coding client(s) to apply.")}`):t.log.warn(`Completed with ${o} failure(s) \u2014 see above.`);const r=Array.from(new Set(a));return r.length>0&&await(0,w.trackInstall)(r),{failures:o,total:e.length}}u(v,"runInstallAll");async function W(){try{if((0,p.isAutoRerenderDisabled)()||(0,p.readSyncedSchemaVersion)()>=S.INSTALL_SCHEMA_VERSION)return!1;const e=(0,c.listActiveProjects)();if(e.length===0)return(0,p.writeSyncedSchemaVersion)(S.INSTALL_SCHEMA_VERSION),!1;if(!(0,f.isInteractive)())return!1;t.log.blank(),t.log.warn(`IronBee's installed setup structure changed in this version \u2014 re-rendering ${t.pc.bold(String(e.length))} registered project(s):`);for(const o of e.slice(0,10))t.log.label("project",t.pc.dim(o.path));return e.length>10&&t.log.info(t.pc.dim(` \u2026and ${e.length-10} more`)),await(0,f.promptAcknowledge)(t.pc.dim(" Press Enter to update them now\u2026 ")),await v({}),(0,p.writeSyncedSchemaVersion)(S.INSTALL_SCHEMA_VERSION),!0}catch(i){return t.log.blank(),t.log.warn(`IronBee schema sync skipped: ${i instanceof Error?i.message:String(i)}`),!1}}u(W,"syncSchemaIfChanged");const F=new $.Command("install").description("Install IronBee hooks and guidance files into a project. Use --all to install across every registered project (e.g. after a global config change).").argument("[project-dir]","target project directory",".").option("--client <name>",`client to install for (${(0,c.clientNames)()}), or "all"`).option("--all","Install across every project in the user-home inventory (~/.ironbee/projects.json) instead of just one. The [project-dir] argument is ignored when --all is set.").option("--platforms <list>",`comma-separated platforms to enable (${m.ALL_CYCLES.join(", ")}); skips the interactive picker. Empty ("") disables all. Default: interactive picker (pre-checked from current config), browser-only on a fresh non-interactive install.`).option("--mode <mode>",`verification mode (${l.ALL_MODES.join(", ")}); skips the interactive picker. enforce = full enforcement, assist = tools installed but not enforced (default), monitor = monitoring-only. Default: interactive picker (pre-selecting the current mode), untouched on a non-interactive install.`).action(async(i,e)=>{let o;if(e.platforms!==void 0)try{o=(0,C.parsePlatformsFlag)(e.platforms)}catch(n){t.log.error(n instanceof Error?n.message:String(n)),process.exit(1)}let a;if(e.mode!==void 0)try{a=(0,l.parseModeFlag)(e.mode)}catch(n){t.log.error(n instanceof Error?n.message:String(n)),process.exit(1)}if(e.all===!0){(await v({client:e.client,platforms:o,mode:a})).failures>0&&process.exit(1);return}const r=(0,x.resolve)(i);(0,P.existsSync)(r)||(t.log.error(`Directory not found: ${r}`),process.exit(1));let s;if(e.client!==void 0)try{s=(0,c.resolveTargetClients)(r,e.client)}catch(n){t.log.error(n instanceof Error?n.message:String(n)),process.exit(1)}else{const n=(0,c.detectClients)(r);if(n.length>0){s=n;const g=n.map(I=>I.name).join(", ");t.log.info(`Detected client(s): ${t.pc.bold(g)}`)}else if((0,f.isInteractive)()){const g=[...c.REGISTERED_CLIENTS.map(b=>b.name),"all"],I=g.map(b=>({label:b,hint:b==="all"?"every registered client":void 0}));t.log.warn(`No client detected in ${t.pc.dim(r)}.`);const L=await(0,f.promptSelect)("Which client(s) to install for?",I,0);s=(0,c.resolveTargetClients)(r,g[L])}else t.log.warn(`No client detected. Defaulting to: ${c.REGISTERED_CLIENTS[0].name}`),s=[c.REGISTERED_CLIENTS[0]]}const d=await _(r,a),h=await O(r,o,d);t.log.blank(),(0,M.prepareIronBeeDir)(r),k(r,d),E(r,h);for(const n of s)n.install(r);(0,j.upsertProject)(r),t.log.blank(),t.log.label("project",t.pc.dim(r)),t.log.blank(),t.log.success(`IronBee installed. ${t.pc.dim("Restart your AI coding client to activate the hooks.")}`),await(0,w.trackInstall)(s.map(n=>n.name),r)});0&&(module.exports={CYCLE_HINTS,installCommand,runInstallAll,syncSchemaIfChanged});
1
+ "use strict";var S=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var R=Object.prototype.hasOwnProperty;var g=(n,e)=>S(n,"name",{value:e,configurable:!0});var V=(n,e)=>{for(var r in e)S(n,r,{get:e[r],enumerable:!0})},_=(n,e,r,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let d of A(e))!R.call(n,d)&&d!==r&&S(n,d,{get:()=>e[d],enumerable:!(c=N(e,d))||c.enumerable});return n};var B=n=>_(S({},"__esModule",{value:!0}),n);var G={};V(G,{CYCLE_HINTS:()=>L,installCommand:()=>q,runInstallAll:()=>j,syncSchemaIfChanged:()=>F});module.exports=B(G);var P=require("commander"),T=require("fs"),D=require("path"),f=require("../clients/registry"),M=require("../clients/claude"),p=require("../lib/config"),t=require("../lib/output"),k=require("../lib/projects-registry"),m=require("../lib/prompt"),v=require("../lib/telemetry"),C=require("../lib/install-version"),h=require("../lib/schema-sync"),I=require("./cycle-toggle"),o=require("./mode-select");const L={browser:"web UI \xB7 DOM \xB7 console \xB7 a11y \xB7 screenshots \xB7 recording",node:"Node.js runtime \xB7 tracepoints \xB7 logpoints \xB7 exceptions \xB7 variables \xB7 logs",backend:"HTTP \xB7 gRPC \xB7 GraphQL \xB7 WebSocket \xB7 DB \xB7 logs"};async function O(n,e,r){if(e!==void 0)return r&&e!=="enforce"&&t.log.warn(`--strict ignored: it only applies to --mode enforce (strict is inert in ${e}).`),{mode:e,strict:e==="enforce"&&r?!0:void 0};if(r&&t.log.warn("--strict ignored: pass it together with --mode enforce."),!(0,m.isInteractive)())return;const c=Math.max(0,o.ALL_MODES.indexOf((0,o.resolveInstallDefaultMode)(n))),d=o.ALL_MODES.map(u=>({label:o.MODE_LABELS[u],hint:o.MODE_HINTS[u]})),i=(0,o.resolveInstallDefaultStrict)(n)?1:0,a=o.STRICT_OPTIONS.map(u=>({label:o.STRICT_LABELS[u?"true":"false"],hint:o.STRICT_HINTS[u?"true":"false"]}));for(;;){const u=await(0,m.promptSelect)("Which verification mode?",d,c),l=o.ALL_MODES[u];if(l!=="enforce")return{mode:l};const s=await(0,m.promptSelect)(`How strict should verification be? (${t.pc.cyan("Esc")} = back)`,a,i,{allowBack:!0});if(s!==m.PROMPT_BACK)return{mode:l,strict:o.STRICT_OPTIONS[s]}}}g(O,"resolveModeSelection");function $(n,e){if(e===void 0)return;const{mode:r,strict:c}=e,i=(0,o.applyModeToLayer)(n,"project",r,c)?"":t.pc.dim(" (unchanged)"),a=r==="enforce"&&c!==void 0?t.pc.dim(` \xB7 ${o.STRICT_LABELS[c?"true":"false"]}`):"";t.log.info(`Mode: ${t.pc.bold(o.MODE_LABELS[r])}${a}${i}`)}g($,"applyModeSelection");async function H(n,e,r){if(e!==void 0)return e;const c=(0,p.loadConfig)(n);if((r??(0,p.getVerificationMode)(c))==="monitor"||!(0,m.isInteractive)())return;const i=p.ALL_CYCLES.map(l=>({label:l,hint:L[l]})),a=p.ALL_CYCLES.map((l,s)=>(0,p.isCyclePatternsActive)(c,l)?s:-1).filter(l=>l>=0);return(await(0,m.promptMultiSelect)("Which platforms should require verification?",i,a)).map(l=>p.ALL_CYCLES[l])}g(H,"resolvePlatformSelection");function E(n,e){if(e===void 0)return;const r=(0,I.reconcileCyclesInLayer)(n,"project",e,!0),c=e.length>0?t.pc.bold(e.join(", ")):t.pc.dim("none (monitoring tools only)"),d=r.length>0?t.pc.dim(` \u2014 updated: ${r.join(", ")}`):"";t.log.info(`Platforms: ${c}${d}`)}g(E,"applyPlatformSelection");function W(n,e){return e!==void 0?(0,f.resolveTargetClients)(n.path,e):(0,f.detectClients)(n.path)}g(W,"clientsForBatchEntry");async function j(n){const e=(0,f.listActiveProjects)();if(e.length===0)return t.log.info("No registered projects to install. Run `ironbee install` somewhere first."),{failures:0,total:0};t.log.info(`Installing across ${t.pc.bold(String(e.length))} registered project(s)\u2026`),t.log.blank();let r=0;const c=[];for(const i of e)try{const a=W(i,n.client);if(a.length===0){t.log.warn(`Skipping ${i.path} \u2014 no resolvable clients`);continue}const u=a.map(l=>l.name);t.log.label("project",t.pc.dim(i.path)),t.log.step(`installing ${t.pc.bold(u.join(", "))}`),(0,M.prepareIronBeeDir)(i.path),$(i.path,n.mode!==void 0?{mode:n.mode,strict:n.mode==="enforce"&&n.strict?!0:void 0}:void 0),E(i.path,n.platforms);for(const l of a)l.install(i.path);(0,k.upsertProject)(i.path),c.push(...u)}catch(a){r++,t.log.error(` ${i.path}: ${a instanceof Error?a.message:String(a)}`)}t.log.blank(),r===0?t.log.success(`Installed across ${e.length} project(s). ${t.pc.dim("Restart your AI coding client(s) to apply.")}`):t.log.warn(`Completed with ${r} failure(s) \u2014 see above.`);const d=Array.from(new Set(c));return d.length>0&&await(0,v.trackInstall)(d),{failures:r,total:e.length}}g(j,"runInstallAll");async function F(){try{if((0,h.isAutoRerenderDisabled)()||(0,h.readSyncedSchemaVersion)()>=C.INSTALL_SCHEMA_VERSION)return!1;const e=(0,f.listActiveProjects)();if(e.length===0)return(0,h.writeSyncedSchemaVersion)(C.INSTALL_SCHEMA_VERSION),!1;if(!(0,m.isInteractive)())return!1;t.log.blank(),t.log.warn(`IronBee's installed setup structure changed in this version \u2014 re-rendering ${t.pc.bold(String(e.length))} registered project(s):`);for(const r of e.slice(0,10))t.log.label("project",t.pc.dim(r.path));return e.length>10&&t.log.info(t.pc.dim(` \u2026and ${e.length-10} more`)),await(0,m.promptAcknowledge)(t.pc.dim(" Press Enter to update them now\u2026 ")),await j({}),(0,h.writeSyncedSchemaVersion)(C.INSTALL_SCHEMA_VERSION),!0}catch(n){return t.log.blank(),t.log.warn(`IronBee schema sync skipped: ${n instanceof Error?n.message:String(n)}`),!1}}g(F,"syncSchemaIfChanged");const q=new P.Command("install").description("Install IronBee hooks and guidance files into a project. Use --all to install across every registered project (e.g. after a global config change).").argument("[project-dir]","target project directory",".").option("--client <name>",`client to install for (${(0,f.clientNames)()}), or "all"`).option("--all","Install across every project in the user-home inventory (~/.ironbee/projects.json) instead of just one. The [project-dir] argument is ignored when --all is set.").option("--platforms <list>",`comma-separated platforms to enable (${p.ALL_CYCLES.join(", ")}); skips the interactive picker. Empty ("") disables all. Default: interactive picker (pre-checked from current config), browser-only on a fresh non-interactive install.`).option("--mode <mode>",`verification mode (${o.ALL_MODES.join(", ")}); skips the interactive picker. enforce = full enforcement, assist = tools installed but not enforced (default), monitor = monitoring-only. Default: interactive picker (pre-selecting the current mode), untouched on a non-interactive install.`).option("--strict","with --mode enforce: always make the agent actually try every change in the app \u2014 it can't skip any. Enforce-only (ignored for assist/monitor or with no --mode). Default: the agent may skip changes with nothing to try (refactors, type-only edits, docs). Interactively, picking enforce opens this as a sub-choice.").action(async(n,e)=>{let r;if(e.platforms!==void 0)try{r=(0,I.parsePlatformsFlag)(e.platforms)}catch(s){t.log.error(s instanceof Error?s.message:String(s)),process.exit(1)}let c;if(e.mode!==void 0)try{c=(0,o.parseModeFlag)(e.mode)}catch(s){t.log.error(s instanceof Error?s.message:String(s)),process.exit(1)}const d=e.strict===!0;if(e.all===!0){(await j({client:e.client,platforms:r,mode:c,strict:d})).failures>0&&process.exit(1);return}const i=(0,D.resolve)(n);(0,T.existsSync)(i)||(t.log.error(`Directory not found: ${i}`),process.exit(1));let a;if(e.client!==void 0)try{a=(0,f.resolveTargetClients)(i,e.client)}catch(s){t.log.error(s instanceof Error?s.message:String(s)),process.exit(1)}else{const s=(0,f.detectClients)(i);if(s.length>0){a=s;const b=s.map(w=>w.name).join(", ");t.log.info(`Detected client(s): ${t.pc.bold(b)}`)}else if((0,m.isInteractive)()){const b=[...f.REGISTERED_CLIENTS.map(y=>y.name),"all"],w=b.map(y=>({label:y,hint:y==="all"?"every registered client":void 0}));t.log.warn(`No client detected in ${t.pc.dim(i)}.`);const x=await(0,m.promptSelect)("Which client(s) to install for?",w,0);a=(0,f.resolveTargetClients)(i,b[x])}else t.log.warn(`No client detected. Defaulting to: ${f.REGISTERED_CLIENTS[0].name}`),a=[f.REGISTERED_CLIENTS[0]]}const u=await O(i,c,d),l=await H(i,r,u?.mode);t.log.blank(),(0,M.prepareIronBeeDir)(i),$(i,u),E(i,l);for(const s of a)s.install(i);(0,k.upsertProject)(i),t.log.blank(),t.log.label("project",t.pc.dim(i)),t.log.blank(),t.log.success(`IronBee installed. ${t.pc.dim("Restart your AI coding client to activate the hooks.")}`),await(0,v.trackInstall)(a.map(s=>s.name),i)});0&&(module.exports={CYCLE_HINTS,installCommand,runInstallAll,syncSchemaIfChanged});
@@ -1,2 +1,2 @@
1
- "use strict";var f=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var V=Object.prototype.hasOwnProperty;var t=(o,e)=>f(o,"name",{value:e,configurable:!0});var v=(o,e)=>{for(var n in e)f(o,n,{get:e[n],enumerable:!0})},M=(o,e,n,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of p(e))!V.call(o,i)&&i!==n&&f(o,i,{get:()=>e[i],enumerable:!(a=m(e,i))||a.enumerable});return o};var w=o=>M(f({},"__esModule",{value:!0}),o);var E={};v(E,{ALL_MODES:()=>g,MODE_HINTS:()=>C,MODE_LABELS:()=>L,applyModeToLayer:()=>O,buildVerificationBlockForMode:()=>y,parseModeFlag:()=>S,resolveInstallDefaultMode:()=>x});module.exports=w(E);var r=require("fs"),u=require("path"),c=require("../lib/config"),d=require("../lib/logger");const g=["enforce","assist","monitor"],L={enforce:"auto verify (enforce)",assist:"assist",monitor:"monitor only"},C={enforce:"block task completion until changes are verified \u2014 full enforcement",assist:"tools installed but not enforced \u2014 the agent verifies manually via /ironbee-verify (default)",monitor:"no enforcement \u2014 only track sessions / activity / tools for analytics"};function S(o){const e=o.trim().toLowerCase();if(e==="enforce"||e==="assist"||e==="monitor")return e;throw new Error(`Unknown mode '${o}'. Available: ${g.join(", ")}.`)}t(S,"parseModeFlag");function s(o){if(!(0,r.existsSync)(o))return{};try{return JSON.parse((0,r.readFileSync)(o,"utf-8"))}catch(e){throw d.logger.debug(`failed to read ${o}: ${e}`),new Error(`Config at ${o} is not valid JSON: ${e instanceof Error?e.message:e}`)}}t(s,"readLayerConfig");function B(o,e){(0,r.mkdirSync)((0,u.join)(o,".."),{recursive:!0}),(0,r.writeFileSync)(o,JSON.stringify(e,null,2)+`
2
- `)}t(B,"writeLayerConfig");function l(o){const e=o.verification;if(e&&typeof e=="object"&&!Array.isArray(e))return e}t(l,"readVerificationBlock");function x(o){let e,n;for(const a of["project","local"]){const i=l(s((0,c.getTargetConfigPath)(a,o)));i!==void 0&&(typeof i.enable=="boolean"&&(e=i.enable),typeof i.auto=="boolean"&&(n=i.auto))}return e===!1?"monitor":n===!0?"enforce":"assist"}t(x,"resolveInstallDefaultMode");function y(o,e){const n={...o??{}};switch(e){case"enforce":n.enable=!0,n.auto=!0,n.strict=n.strict??!1;break;case"assist":n.enable=!0,n.auto=!1,n.strict=n.strict??!1;break;case"monitor":n.enable=!1,delete n.auto,delete n.strict;break}return n}t(y,"buildVerificationBlockForMode");function O(o,e,n){const a=(0,c.getTargetConfigPath)(e,o),i=s(a),b=JSON.stringify(i.verification??null);i.verification=y(l(i),n);const k=JSON.stringify(i.verification);return b===k?!1:(B(a,i),!0)}t(O,"applyModeToLayer");0&&(module.exports={ALL_MODES,MODE_HINTS,MODE_LABELS,applyModeToLayer,buildVerificationBlockForMode,parseModeFlag,resolveInstallDefaultMode});
1
+ "use strict";var s=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var V=Object.prototype.hasOwnProperty;var r=(o,e)=>s(o,"name",{value:e,configurable:!0});var v=(o,e)=>{for(var t in e)s(o,t,{get:e[t],enumerable:!0})},w=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of S(e))!V.call(o,i)&&i!==t&&s(o,i,{get:()=>e[i],enumerable:!(n=m(e,i))||n.enumerable});return o};var C=o=>w(s({},"__esModule",{value:!0}),o);var R={};v(R,{ALL_MODES:()=>y,MODE_HINTS:()=>h,MODE_LABELS:()=>L,STRICT_HINTS:()=>T,STRICT_LABELS:()=>B,STRICT_OPTIONS:()=>M,applyModeToLayer:()=>N,buildVerificationBlockForMode:()=>b,parseModeFlag:()=>x,resolveInstallDefaultMode:()=>E,resolveInstallDefaultStrict:()=>I});module.exports=C(R);var a=require("fs"),d=require("path"),f=require("../lib/config"),g=require("../lib/logger");const y=["enforce","assist","monitor"],L={enforce:"auto verify (enforce)",assist:"assist",monitor:"monitor only"},h={enforce:"block task completion until changes are verified \u2014 full enforcement",assist:"tools installed but not enforced \u2014 the agent verifies manually via /ironbee-verify (default)",monitor:"no enforcement \u2014 only track sessions / activity / tools for analytics"},M=[!1,!0],B={false:"non-strict",true:"strict"},T={false:"the agent can skip checking changes with nothing to try in the app \u2014 e.g. refactors, type-only edits, docs (recommended)",true:"always make the agent actually try the change in the app \u2014 it can't skip any change"};function x(o){const e=o.trim().toLowerCase();if(e==="enforce"||e==="assist"||e==="monitor")return e;throw new Error(`Unknown mode '${o}'. Available: ${y.join(", ")}.`)}r(x,"parseModeFlag");function l(o){if(!(0,a.existsSync)(o))return{};try{return JSON.parse((0,a.readFileSync)(o,"utf-8"))}catch(e){throw g.logger.debug(`failed to read ${o}: ${e}`),new Error(`Config at ${o} is not valid JSON: ${e instanceof Error?e.message:e}`)}}r(l,"readLayerConfig");function O(o,e){(0,a.mkdirSync)((0,d.join)(o,".."),{recursive:!0}),(0,a.writeFileSync)(o,JSON.stringify(e,null,2)+`
2
+ `)}r(O,"writeLayerConfig");function u(o){const e=o.verification;if(e&&typeof e=="object"&&!Array.isArray(e))return e}r(u,"readVerificationBlock");function E(o){let e,t;for(const n of["project","local"]){const i=u(l((0,f.getTargetConfigPath)(n,o)));i!==void 0&&(typeof i.enable=="boolean"&&(e=i.enable),typeof i.auto=="boolean"&&(t=i.auto))}return e===!1?"monitor":t===!0?"enforce":"assist"}r(E,"resolveInstallDefaultMode");function I(o){let e;for(const t of["project","local"]){const n=u(l((0,f.getTargetConfigPath)(t,o)));n!==void 0&&typeof n.strict=="boolean"&&(e=n.strict)}return e===!0}r(I,"resolveInstallDefaultStrict");function b(o,e,t){const n={...o??{}};switch(e){case"enforce":n.enable=!0,n.auto=!0,n.strict=t!==void 0?t:n.strict??!1;break;case"assist":n.enable=!0,n.auto=!1,n.strict=n.strict??!1;break;case"monitor":n.enable=!1,delete n.auto,delete n.strict;break}return n}r(b,"buildVerificationBlockForMode");function N(o,e,t,n){const i=(0,f.getTargetConfigPath)(e,o),c=l(i),p=JSON.stringify(c.verification??null);c.verification=b(u(c),t,n);const k=JSON.stringify(c.verification);return p===k?!1:(O(i,c),!0)}r(N,"applyModeToLayer");0&&(module.exports={ALL_MODES,MODE_HINTS,MODE_LABELS,STRICT_HINTS,STRICT_LABELS,STRICT_OPTIONS,applyModeToLayer,buildVerificationBlockForMode,parseModeFlag,resolveInstallDefaultMode,resolveInstallDefaultStrict});
@@ -1 +1 @@
1
- "use strict";var a=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var c=(t,e)=>a(t,"name",{value:e,configurable:!0});var C=(t,e)=>{for(var i in e)a(t,i,{get:e[i],enumerable:!0})},T=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of p(e))!N.call(t,r)&&r!==i&&a(t,r,{get:()=>e[r],enumerable:!(n=E(e,r))||n.enumerable});return t};var S=t=>T(a({},"__esModule",{value:!0}),t);var L={};C(L,{executeToolBareName:()=>O,extractNestedToolCalls:()=>P});module.exports=S(L);var o=require("../../lib/config");const h=Object.fromEntries(Object.entries(o.CYCLE_TO_SERVER).map(([t,e])=>[e,o.CYCLE_TOOL_PREFIXES[t]])),d=/callTool\s*\(\s*\\?[`'"]([^`'"\\]+)\\?[`'"]/g;function O(t){if(!t)return null;const e=h[t];return e!==void 0?`${e}execute`:null}c(O,"executeToolBareName");function R(t,e,i){let n=t;const r=`mcp__${e}__`,s=`mcp__${e.replace(/-/g,"_")}__`;return n.startsWith(r)?n=n.slice(r.length):n.startsWith(s)&&(n=n.slice(s.length)),n.startsWith("MCP:")&&(n=n.slice(4)),n.startsWith(i)||(n=`${i}${n}`),n}c(R,"normalizeNestedName");function b(t,e){if(t[e]!=="{")return;let i=0;for(let n=e;n<t.length;n++)if(t[n]==="{")i++;else if(t[n]==="}"&&(i--,i===0))return t.slice(e,n+1)}c(b,"extractBalancedBraces");function P(t,e){const i=h[e];if(i===void 0)return[];const n=typeof t=="string"?t:JSON.stringify(t??""),r=[],s=new Set;d.lastIndex=0;let l=d.exec(n);for(;l!==null;){const f=R(l[1],e,i);if(!s.has(f)){s.add(f);let g;const x=l.index+l[0].length,m=n.slice(x).trimStart();if(m.startsWith(",")){const _=m.slice(1).trimStart();if(_.startsWith("{")){const u=b(_,0);if(u)try{g=JSON.parse(u)}catch{g=u}}}r.push({name:f,args:g})}l=d.exec(n)}return r}c(P,"extractNestedToolCalls");0&&(module.exports={executeToolBareName,extractNestedToolCalls});
1
+ "use strict";var c=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var s=(n,t)=>c(n,"name",{value:t,configurable:!0});var b=(n,t)=>{for(var r in t)c(n,r,{get:t[r],enumerable:!0})},S=(n,t,r,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of h(t))!p.call(n,i)&&i!==r&&c(n,i,{get:()=>t[i],enumerable:!(e=T(t,i))||e.enumerable});return n};var A=n=>S(c({},"__esModule",{value:!0}),n);var L={};b(L,{executeToolBareName:()=>O,extractNestedToolCalls:()=>j,extractNestedToolCallsFromResponse:()=>P,isNestedToolContainer:()=>R});module.exports=A(L);var d=require("../../lib/config");const a=Object.fromEntries(Object.entries(d.CYCLE_TO_SERVER).map(([n,t])=>[t,d.CYCLE_TOOL_PREFIXES[n]])),w=/callTool\s*\(\s*\\?[`'"]([^`'"\\]+)\\?[`'"]/g;function O(n){if(!n)return null;const t=a[n];return t!==void 0?`${t}execute`:null}s(O,"executeToolBareName");function R(n,t){if(!n||!t)return!1;const r=a[t];return r===void 0?!1:n===`${r}execute`||n===`${r}scenario-run`}s(R,"isNestedToolContainer");const x=16;function _(n){try{return JSON.parse(n)}catch{return}}s(_,"tryJsonParse");function f(n,t){if(t>x||n===null||n===void 0)return null;if(typeof n=="string"){const r=_(n);return r===void 0?null:f(r,t+1)}if(Array.isArray(n)){for(const r of n)if(r!==null&&typeof r=="object"){const e=r.text;if(typeof e=="string"){const i=_(e);if(i!==void 0){const u=f(i,t+1);if(u!==null)return u}}}return null}if(typeof n=="object"){const r=n;if(Array.isArray(r.toolCalls))return r.toolCalls;if(r.structuredContent!==void 0){const e=f(r.structuredContent,t+1);if(e!==null)return e}if(r.content!==void 0){const e=f(r.content,t+1);if(e!==null)return e}}return null}s(f,"locateToolCallsArray");function y(n,t,r,e,i){if(!(i>x))for(const u of n){if(u===null||typeof u!="object")continue;const l=u,o=l.name;typeof o=="string"&&o.length>0&&e.push({name:N(o,t,r),args:void 0}),Array.isArray(l.children)&&y(l.children,t,r,e,i+1)}}s(y,"flattenResponseToolCalls");function P(n,t){const r=a[t];if(r===void 0)return null;const e=f(n,0);if(e===null)return null;const i=[];return y(e,t,r,i,0),i}s(P,"extractNestedToolCallsFromResponse");function N(n,t,r){let e=n;const i=`mcp__${t}__`,u=`mcp__${t.replace(/-/g,"_")}__`;return e.startsWith(i)?e=e.slice(i.length):e.startsWith(u)&&(e=e.slice(u.length)),e.startsWith("MCP:")&&(e=e.slice(4)),e.startsWith(r)||(e=`${r}${e}`),e}s(N,"normalizeNestedName");function $(n,t){if(n[t]!=="{")return;let r=0;for(let e=t;e<n.length;e++)if(n[e]==="{")r++;else if(n[e]==="}"&&(r--,r===0))return n.slice(t,e+1)}s($,"extractBalancedBraces");function j(n,t){const r=a[t];if(r===void 0)return[];const e=typeof n=="string"?n:JSON.stringify(n??""),i=[],u=new Set;w.lastIndex=0;let l=w.exec(e);for(;l!==null;){const o=N(l[1],t,r);if(!u.has(o)){u.add(o);let g;const E=l.index+l[0].length,C=e.slice(E).trimStart();if(C.startsWith(",")){const k=C.slice(1).trimStart();if(k.startsWith("{")){const m=$(k,0);if(m)try{g=JSON.parse(m)}catch{g=m}}}i.push({name:o,args:g})}l=w.exec(e)}return i}s(j,"extractNestedToolCalls");0&&(module.exports={executeToolBareName,extractNestedToolCalls,extractNestedToolCallsFromResponse,isNestedToolContainer});
@@ -1 +1 @@
1
- "use strict";var y=Object.defineProperty;var ue=Object.getOwnPropertyDescriptor;var fe=Object.getOwnPropertyNames;var ge=Object.prototype.hasOwnProperty;var o=(n,e)=>y(n,"name",{value:e,configurable:!0});var de=(n,e)=>{for(var t in e)y(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&&y(n,i,{get:()=>e[i],enumerable:!(r=ue(e,i))||r.enumerable});return n};var be=n=>pe(y({},"__esModule",{value:!0}),n);var Bn={};de(Bn,{ALL_CYCLES:()=>Ee,CONFIG_TARGETS_BY_PRECEDENCE:()=>Re,CYCLES_ENABLED_BY_DEFAULT:()=>P,CYCLE_DEFAULT_VERIFY_PATTERNS:()=>$,CYCLE_TOOL_PREFIXES:()=>_e,CYCLE_TO_SERVER:()=>ye,DEFAULT_ANDROID_ALWAYS_REQUIRED:()=>W,DEFAULT_ANDROID_EVIDENCE_PATHS:()=>Q,DEFAULT_ANDROID_VERIFY_PATTERNS:()=>U,DEFAULT_BACKEND_ALWAYS_REQUIRED:()=>H,DEFAULT_BACKEND_EVIDENCE_PATHS:()=>G,DEFAULT_BACKEND_VERIFY_PATTERNS:()=>V,DEFAULT_BROWSER_ALWAYS_REQUIRED:()=>K,DEFAULT_BROWSER_VERIFY_PATTERNS:()=>M,DEFAULT_IGNORED_VERIFY_PATTERNS:()=>q,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:()=>j,OPTIONAL_CYCLES:()=>T,applyEnvOverrides:()=>z,findActiveEnvOverride:()=>Be,getActiveCycles:()=>J,getAnalyticsEmitOnStopMinIntervalSeconds:()=>Rn,getAndroidDevToolsMcpEntry:()=>Ze,getAutoVerifyEnabled:()=>ie,getBackendDevToolsMcpEntry:()=>Je,getCaptureFileChangeset:()=>Tn,getClaudeOauthAccessEnabled:()=>an,getClaudeOauthAccessUsageTtlSeconds:()=>un,getCodexVerifierMode:()=>cn,getConfigLayerPaths:()=>w,getMaxChangesetBytes:()=>xn,getMaxRetries:()=>en,getMcpServerEntry:()=>Qe,getNodeDevToolsMcpEntry:()=>ze,getOTELEmitMinIntervalSeconds:()=>bn,getOTELEnsureMinIntervalSeconds:()=>pn,getOTELIdleTimeoutSeconds:()=>dn,getOTELPort:()=>gn,getPrivacyEnabled:()=>le,getRequiredToolsConfig:()=>Pe,getStatusLineEmitMinIntervalSeconds:()=>sn,getStatusLineRefreshInterval:()=>En,getStatusLineRenderDefault:()=>rn,getTargetConfigPath:()=>Oe,getTelemetryEnabled:()=>ce,getVerificationContextCommitDepth:()=>mn,getVerificationContextEnabled:()=>_n,getVerificationContextMaxBytes:()=>An,getVerificationContextSource:()=>Cn,getVerificationEnabled:()=>O,getVerificationMode:()=>In,getVerificationModel:()=>Ae,getVerificationStrict:()=>yn,isAnalyticsApiRequestEventsEnabled:()=>kn,isAnalyticsEmitOnStopEnabled:()=>jn,isAnalyticsEnabled:()=>wn,isAnalyticsStepEventsEnabled:()=>hn,isAnalyticsTurnEventsEnabled:()=>On,isAutoModeAllowlistEnabled:()=>ln,isCollectorConfigured:()=>R,isCycleEnabled:()=>De,isCyclePatternsActive:()=>Z,isIgnoredVerifyPath:()=>vn,isJobQueueEnabled:()=>nn,isOTELEnabled:()=>fn,isRecordingEnabled:()=>tn,isSessionStatusEnabled:()=>on,loadConfig:()=>c,requiresVerification:()=>Ne,resolveConfigTargetFromFlags:()=>he,resolveIgnoredVerifyPatterns:()=>x});module.exports=be(Bn);var E=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"],$={browser:M,node:F,backend:V,android:U},q=["**/*.spec.*","**/*.test.*","**/__tests__/**","**/__mocks__/**"];function x(n){const e=n.ignoredVerifyPatterns??[];return[...q,...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=[],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"]}]}],W=["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"]}]}],Ce=3;function k(n){if(!(0,E.existsSync)(n))return{};try{return JSON.parse((0,E.readFileSync)(n,"utf-8"))}catch(e){return D.logger.debug(`failed to parse config ${n}: ${e}`),{}}}o(k,"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 _(n,e){if(!(n===void 0&&e===void 0))return{...n??{},...e??{}}}o(_,"mergeCycleConfig");function B(n,e){const t={...n,...e};return t.browser=_(n.browser,e.browser),t.node=_(n.node,e.node),t.backend=_(n.backend,e.backend),t.android=_(n.android,e.android),t.claude=we(n.claude,e.claude),t.codex=je(n.codex,e.codex),t.verification=xe(n.verification,e.verification),t.verificationContext=Te(n.verificationContext,e.verificationContext),t}o(B,"mergeConfigLayers");function Te(n,e){if(!(n===void 0&&e===void 0))return{...n??{},...e??{}}}o(Te,"mergeVerificationContextConfig");function xe(n,e){if(!(n===void 0&&e===void 0))return{...n??{},...e??{}}}o(xe,"mergeVerificationConfig");function we(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(we,"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 Re=["global","project","local"];function Oe(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(Oe,"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=k(n);return(0,E.existsSync)(n)&&(me(e,n),ve(e,n),Ie(e,n)),e}o(A,"loadAndValidateLayer");const j=[{envVar:"IRONBEE_API_KEY",configPath:"collector.apiKey"},{envVar:"IRONBEE_OAUTH_TOKEN",configPath:"collector.oauthToken"}];function ke(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(ke,"setAtConfigPath");function z(n){let e;for(const t of j){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;ke(e,t.configPath,i)}return e??n}o(z,"applyEnvOverrides");function Be(n){for(const e of j){if(e.configPath!==n)continue;const t=process.env[e.envVar];if(t!==void 0&&t.length>0)return e}}o(Be,"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 Se(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(Se,"globToRegExp");function C(n,e){const t=n.replace(/\\/g,"/");for(const r of e)if(Se(r).test(t))return!0;return!1}o(C,"matchesAny");function Le(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(Le,"getCycleBlock");function v(n,e){const t=Le(n,e);if(t!==void 0&&t.enable===!1)return[];const r=$[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&&C(n,t))return[];const r=[];C(n,v(e,"browser"))&&r.push("browser");for(const i of T){const s=v(e,i);s.length>0&&C(n,s)&&r.push(i)}return r}o(J,"getActiveCycles");function Ne(n,e){return J(n,e).length>0}o(Ne,"requiresVerification");function De(n,e){return O(n)?Z(n,e):!1}o(De,"isCycleEnabled");function Z(n,e){return v(n,e).length>0}o(Z,"isCyclePatternsActive");function Pe(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??G):e==="android"?(t=n.android?.alwaysRequired??W,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(Pe,"getRequiredToolsConfig");const S="npx",Me="^0.12.0",L=["-y",`@ironbee-ai/devtools@${Me}`],Fe={TOOL_NAME_PREFIX:"bdt_",TOOL_INPUT_METADATA_ENABLE:"true"},Ve={PLATFORM:"node",TOOL_NAME_PREFIX:"ndt_",TOOL_INPUT_METADATA_ENABLE:"true"},Ue={PLATFORM:"backend",TOOL_NAME_PREFIX:"bedt_",TOOL_INPUT_METADATA_ENABLE:"true"},$e={PLATFORM:"android",TOOL_NAME_PREFIX:"adt_",TOOL_INPUT_METADATA_ENABLE:"true"},qe={BROWSER_DEVTOOLS_INSTALL_CHROMIUM:"true"},Ke={},Ye={},Xe={};function He(n){return ce(n)?{}:{TELEMETRY_ENABLE:"false"}}o(He,"buildTelemetryEnv");function Ge(n){return le(n)?{COLLECTOR_EVENTS_TOOL_DETAILS_ENABLE:"false",COLLECTOR_ARTIFACTS_ENABLE:"false"}:{}}o(Ge,"buildPrivacyEnv");function We(n,e){if(!R(n))return{};const t=n.collector,i=k((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(We,"buildOTELEnv");function m(n,e,t,r,i){const s=We(n,i),l=He(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 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:S,args:[...L],env:{...r,...s,...l,...a,...h,...t}}}return{command:S,args:[...L],env:{...r,...s,...l,...a,...t}}}o(m,"buildMcpEntry");function Qe(n){const e=c(n);return m(e,"browserDevTools",Fe,qe,"browser")}o(Qe,"getMcpServerEntry");function ze(n){const e=c(n);return m(e,"nodeDevTools",Ve,Ke,"node")}o(ze,"getNodeDevToolsMcpEntry");function Je(n){const e=c(n);return m(e,"backendDevTools",Ue,Ye,"backend")}o(Je,"getBackendDevToolsMcpEntry");function Ze(n){const e=c(n);return m(e,"androidDevTools",$e,Xe,"android")}o(Ze,"getAndroidDevToolsMcpEntry");function en(n){return typeof n.maxRetries=="number"&&n.maxRetries>0?n.maxRetries:Ce}o(en,"getMaxRetries");function R(n){if(process.env.IRONBEE_COLLECTOR==="false")return!1;const e=n.collector;if(!e||e.enable===!1||typeof e.url!="string"||e.url.length===0)return!1;const t=typeof e.oauthToken=="string"&&e.oauthToken.length>0,r=typeof e.apiKey=="string"&&e.apiKey.length>0;return!(!t&&!r)}o(R,"isCollectorConfigured");function nn(n){const e=c(n);return p(e,e.jobQueue)}o(nn,"isJobQueueEnabled");function tn(n){const e=c(n);return p(e,e.recording)}o(tn,"isRecordingEnabled");function on(n){return p(n,n.statusLine)}o(on,"isSessionStatusEnabled");function rn(n){const e=n.statusLine;return e!==void 0&&e.renderDefault===!0}o(rn,"getStatusLineRenderDefault");function sn(n){const e=n.statusLine?.emitMinIntervalSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:10}o(sn,"getStatusLineEmitMinIntervalSeconds");const ee=60;function an(n){return n.claude?.oauthAccess?.enable!==!1}o(an,"getClaudeOauthAccessEnabled");function cn(n){return n.codex?.verifier?.mode==="main-agent"?"main-agent":"sub-agent"}o(cn,"getCodexVerifierMode");function ln(n){return n.claude?.autoModeAllowlist?.enable!==!1}o(ln,"isAutoModeAllowlistEnabled");function un(n){const e=n.claude?.oauthAccess?.usageTtlSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:ee}o(un,"getClaudeOauthAccessUsageTtlSeconds");const ne=15986,te=600,oe=30,re=0;function fn(n){return p(n,n.otel)}o(fn,"isOTELEnabled");function gn(n){const e=n.otel?.port;return typeof e=="number"&&Number.isInteger(e)&&e>0&&e<65536?e:ne}o(gn,"getOTELPort");function dn(n){const e=n.otel?.idleTimeoutSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>0?e:te}o(dn,"getOTELIdleTimeoutSeconds");function pn(n){const e=n.otel?.ensureMinIntervalSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:oe}o(pn,"getOTELEnsureMinIntervalSeconds");function bn(n){const e=n.otel?.emitMinIntervalSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:re}o(bn,"getOTELEmitMinIntervalSeconds");function En(n){const e=n.statusLine?.refreshInterval;if(typeof e=="number"&&Number.isFinite(e)&&e>=1)return e}o(En,"getStatusLineRefreshInterval");function p(n,e){return e!=null&&typeof e=="object"&&!Array.isArray(e)?e.enable!==!1:R(n)}o(p,"isFeatureEnabledWithCollectorAutoEnable");function Ln(n){return n==null||typeof n!="object"||Array.isArray(n)?!1:n.enable!==!1}o(Ln,"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 yn(n){const e=n.verification;return e==null||typeof e!="object"||Array.isArray(e)?!1:e.strict===!0}o(yn,"getVerificationStrict");const se=65536,ae=1;function _n(n){const e=n.verificationContext;return e==null||typeof e!="object"||Array.isArray(e)?!0:e.enable!==!1}o(_n,"getVerificationContextEnabled");function Cn(n){return n.verificationContext?.source==="actions"?"actions":"git"}o(Cn,"getVerificationContextSource");function mn(n){const e=n.verificationContext?.commitDepth;return typeof e=="number"&&Number.isFinite(e)&&e>=0?Math.floor(e):ae}o(mn,"getVerificationContextCommitDepth");function An(n){const e=n.verificationContext?.maxBytes;return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.floor(e):se}o(An,"getVerificationContextMaxBytes");function vn(n,e){const t=x(n);return t.length>0&&C(e,t)}o(vn,"isIgnoredVerifyPath");function In(n){return O(n)?ie(n)?"enforce":"assist":"monitor"}o(In,"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 Tn(n){const e=n.fileChange;return!e||typeof e!="object"||Array.isArray(e)?!1:e.captureChangeset===!0}o(Tn,"getCaptureFileChangeset");function xn(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(xn,"getMaxChangesetBytes");function wn(n){const e=c(n);return p(e,e.analytics)}o(wn,"isAnalyticsEnabled");function jn(n){const t=c(n).analytics;return t===null||typeof t!="object"||Array.isArray(t)?!0:t.emitOnStop!==!1}o(jn,"isAnalyticsEmitOnStopEnabled");function Rn(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(Rn,"getAnalyticsEmitOnStopMinIntervalSeconds");function On(n){const t=c(n).analytics;return t===null||typeof t!="object"||Array.isArray(t)?!1:t.emitTurnEvents===!0}o(On,"isAnalyticsTurnEventsEnabled");function hn(n){const t=c(n).analytics;return t===null||typeof t!="object"||Array.isArray(t)?!1:t.emitStepEvents===!0}o(hn,"isAnalyticsStepEventsEnabled");function kn(n){const t=c(n).analytics;return t===null||typeof t!="object"||Array.isArray(t)?!0:t.emitApiRequestEvents!==!1}o(kn,"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,isCollectorConfigured,isCycleEnabled,isCyclePatternsActive,isIgnoredVerifyPath,isJobQueueEnabled,isOTELEnabled,isRecordingEnabled,isSessionStatusEnabled,loadConfig,requiresVerification,resolveConfigTargetFromFlags,resolveIgnoredVerifyPatterns});
1
+ "use strict";var y=Object.defineProperty;var ue=Object.getOwnPropertyDescriptor;var fe=Object.getOwnPropertyNames;var ge=Object.prototype.hasOwnProperty;var o=(n,e)=>y(n,"name",{value:e,configurable:!0});var de=(n,e)=>{for(var t in e)y(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&&y(n,i,{get:()=>e[i],enumerable:!(r=ue(e,i))||r.enumerable});return n};var be=n=>pe(y({},"__esModule",{value:!0}),n);var Bn={};de(Bn,{ALL_CYCLES:()=>Ee,CONFIG_TARGETS_BY_PRECEDENCE:()=>Re,CYCLES_ENABLED_BY_DEFAULT:()=>P,CYCLE_DEFAULT_VERIFY_PATTERNS:()=>$,CYCLE_TOOL_PREFIXES:()=>_e,CYCLE_TO_SERVER:()=>ye,DEFAULT_ANDROID_ALWAYS_REQUIRED:()=>W,DEFAULT_ANDROID_EVIDENCE_PATHS:()=>Q,DEFAULT_ANDROID_VERIFY_PATTERNS:()=>U,DEFAULT_BACKEND_ALWAYS_REQUIRED:()=>H,DEFAULT_BACKEND_EVIDENCE_PATHS:()=>G,DEFAULT_BACKEND_VERIFY_PATTERNS:()=>V,DEFAULT_BROWSER_ALWAYS_REQUIRED:()=>K,DEFAULT_BROWSER_VERIFY_PATTERNS:()=>M,DEFAULT_IGNORED_VERIFY_PATTERNS:()=>q,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:()=>j,OPTIONAL_CYCLES:()=>T,applyEnvOverrides:()=>z,findActiveEnvOverride:()=>Be,getActiveCycles:()=>J,getAnalyticsEmitOnStopMinIntervalSeconds:()=>Rn,getAndroidDevToolsMcpEntry:()=>Ze,getAutoVerifyEnabled:()=>ie,getBackendDevToolsMcpEntry:()=>Je,getCaptureFileChangeset:()=>Tn,getClaudeOauthAccessEnabled:()=>an,getClaudeOauthAccessUsageTtlSeconds:()=>un,getCodexVerifierMode:()=>cn,getConfigLayerPaths:()=>w,getMaxChangesetBytes:()=>xn,getMaxRetries:()=>en,getMcpServerEntry:()=>Qe,getNodeDevToolsMcpEntry:()=>ze,getOTELEmitMinIntervalSeconds:()=>bn,getOTELEnsureMinIntervalSeconds:()=>pn,getOTELIdleTimeoutSeconds:()=>dn,getOTELPort:()=>gn,getPrivacyEnabled:()=>le,getRequiredToolsConfig:()=>Pe,getStatusLineEmitMinIntervalSeconds:()=>sn,getStatusLineRefreshInterval:()=>En,getStatusLineRenderDefault:()=>rn,getTargetConfigPath:()=>Oe,getTelemetryEnabled:()=>ce,getVerificationContextCommitDepth:()=>mn,getVerificationContextEnabled:()=>_n,getVerificationContextMaxBytes:()=>An,getVerificationContextSource:()=>Cn,getVerificationEnabled:()=>O,getVerificationMode:()=>In,getVerificationModel:()=>Ae,getVerificationStrict:()=>yn,isAnalyticsApiRequestEventsEnabled:()=>kn,isAnalyticsEmitOnStopEnabled:()=>jn,isAnalyticsEnabled:()=>wn,isAnalyticsStepEventsEnabled:()=>hn,isAnalyticsTurnEventsEnabled:()=>On,isAutoModeAllowlistEnabled:()=>ln,isCollectorConfigured:()=>R,isCycleEnabled:()=>De,isCyclePatternsActive:()=>Z,isIgnoredVerifyPath:()=>vn,isJobQueueEnabled:()=>nn,isOTELEnabled:()=>fn,isRecordingEnabled:()=>tn,isSessionStatusEnabled:()=>on,loadConfig:()=>c,requiresVerification:()=>Ne,resolveConfigTargetFromFlags:()=>he,resolveIgnoredVerifyPatterns:()=>x});module.exports=be(Bn);var E=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"],$={browser:M,node:F,backend:V,android:U},q=["**/*.spec.*","**/*.test.*","**/__tests__/**","**/__mocks__/**"];function x(n){const e=n.ignoredVerifyPatterns??[];return[...q,...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=[],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"]}]}],W=["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"]}]}],Ce=3;function k(n){if(!(0,E.existsSync)(n))return{};try{return JSON.parse((0,E.readFileSync)(n,"utf-8"))}catch(e){return D.logger.debug(`failed to parse config ${n}: ${e}`),{}}}o(k,"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 _(n,e){if(!(n===void 0&&e===void 0))return{...n??{},...e??{}}}o(_,"mergeCycleConfig");function B(n,e){const t={...n,...e};return t.browser=_(n.browser,e.browser),t.node=_(n.node,e.node),t.backend=_(n.backend,e.backend),t.android=_(n.android,e.android),t.claude=we(n.claude,e.claude),t.codex=je(n.codex,e.codex),t.verification=xe(n.verification,e.verification),t.verificationContext=Te(n.verificationContext,e.verificationContext),t}o(B,"mergeConfigLayers");function Te(n,e){if(!(n===void 0&&e===void 0))return{...n??{},...e??{}}}o(Te,"mergeVerificationContextConfig");function xe(n,e){if(!(n===void 0&&e===void 0))return{...n??{},...e??{}}}o(xe,"mergeVerificationConfig");function we(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(we,"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 Re=["global","project","local"];function Oe(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(Oe,"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=k(n);return(0,E.existsSync)(n)&&(me(e,n),ve(e,n),Ie(e,n)),e}o(A,"loadAndValidateLayer");const j=[{envVar:"IRONBEE_API_KEY",configPath:"collector.apiKey"},{envVar:"IRONBEE_OAUTH_TOKEN",configPath:"collector.oauthToken"}];function ke(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(ke,"setAtConfigPath");function z(n){let e;for(const t of j){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;ke(e,t.configPath,i)}return e??n}o(z,"applyEnvOverrides");function Be(n){for(const e of j){if(e.configPath!==n)continue;const t=process.env[e.envVar];if(t!==void 0&&t.length>0)return e}}o(Be,"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 Se(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(Se,"globToRegExp");function C(n,e){const t=n.replace(/\\/g,"/");for(const r of e)if(Se(r).test(t))return!0;return!1}o(C,"matchesAny");function Le(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(Le,"getCycleBlock");function v(n,e){const t=Le(n,e);if(t!==void 0&&t.enable===!1)return[];const r=$[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&&C(n,t))return[];const r=[];C(n,v(e,"browser"))&&r.push("browser");for(const i of T){const s=v(e,i);s.length>0&&C(n,s)&&r.push(i)}return r}o(J,"getActiveCycles");function Ne(n,e){return J(n,e).length>0}o(Ne,"requiresVerification");function De(n,e){return O(n)?Z(n,e):!1}o(De,"isCycleEnabled");function Z(n,e){return v(n,e).length>0}o(Z,"isCyclePatternsActive");function Pe(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??G):e==="android"?(t=n.android?.alwaysRequired??W,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(Pe,"getRequiredToolsConfig");const S="npx",Me="^0.13.0",L=["-y",`@ironbee-ai/devtools@${Me}`],Fe={TOOL_NAME_PREFIX:"bdt_",TOOL_INPUT_METADATA_ENABLE:"true"},Ve={PLATFORM:"node",TOOL_NAME_PREFIX:"ndt_",TOOL_INPUT_METADATA_ENABLE:"true"},Ue={PLATFORM:"backend",TOOL_NAME_PREFIX:"bedt_",TOOL_INPUT_METADATA_ENABLE:"true"},$e={PLATFORM:"android",TOOL_NAME_PREFIX:"adt_",TOOL_INPUT_METADATA_ENABLE:"true"},qe={BROWSER_DEVTOOLS_INSTALL_CHROMIUM:"true"},Ke={},Ye={},Xe={};function He(n){return ce(n)?{}:{TELEMETRY_ENABLE:"false"}}o(He,"buildTelemetryEnv");function Ge(n){return le(n)?{COLLECTOR_EVENTS_TOOL_DETAILS_ENABLE:"false",COLLECTOR_ARTIFACTS_ENABLE:"false"}:{}}o(Ge,"buildPrivacyEnv");function We(n,e){if(!R(n))return{};const t=n.collector,i=k((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(We,"buildOTELEnv");function m(n,e,t,r,i){const s=We(n,i),l=He(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 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:S,args:[...L],env:{...r,...s,...l,...a,...h,...t}}}return{command:S,args:[...L],env:{...r,...s,...l,...a,...t}}}o(m,"buildMcpEntry");function Qe(n){const e=c(n);return m(e,"browserDevTools",Fe,qe,"browser")}o(Qe,"getMcpServerEntry");function ze(n){const e=c(n);return m(e,"nodeDevTools",Ve,Ke,"node")}o(ze,"getNodeDevToolsMcpEntry");function Je(n){const e=c(n);return m(e,"backendDevTools",Ue,Ye,"backend")}o(Je,"getBackendDevToolsMcpEntry");function Ze(n){const e=c(n);return m(e,"androidDevTools",$e,Xe,"android")}o(Ze,"getAndroidDevToolsMcpEntry");function en(n){return typeof n.maxRetries=="number"&&n.maxRetries>0?n.maxRetries:Ce}o(en,"getMaxRetries");function R(n){if(process.env.IRONBEE_COLLECTOR==="false")return!1;const e=n.collector;if(!e||e.enable===!1||typeof e.url!="string"||e.url.length===0)return!1;const t=typeof e.oauthToken=="string"&&e.oauthToken.length>0,r=typeof e.apiKey=="string"&&e.apiKey.length>0;return!(!t&&!r)}o(R,"isCollectorConfigured");function nn(n){const e=c(n);return p(e,e.jobQueue)}o(nn,"isJobQueueEnabled");function tn(n){const e=c(n);return p(e,e.recording)}o(tn,"isRecordingEnabled");function on(n){return p(n,n.statusLine)}o(on,"isSessionStatusEnabled");function rn(n){const e=n.statusLine;return e!==void 0&&e.renderDefault===!0}o(rn,"getStatusLineRenderDefault");function sn(n){const e=n.statusLine?.emitMinIntervalSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:10}o(sn,"getStatusLineEmitMinIntervalSeconds");const ee=60;function an(n){return n.claude?.oauthAccess?.enable!==!1}o(an,"getClaudeOauthAccessEnabled");function cn(n){return n.codex?.verifier?.mode==="main-agent"?"main-agent":"sub-agent"}o(cn,"getCodexVerifierMode");function ln(n){return n.claude?.autoModeAllowlist?.enable!==!1}o(ln,"isAutoModeAllowlistEnabled");function un(n){const e=n.claude?.oauthAccess?.usageTtlSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:ee}o(un,"getClaudeOauthAccessUsageTtlSeconds");const ne=15986,te=600,oe=30,re=0;function fn(n){return p(n,n.otel)}o(fn,"isOTELEnabled");function gn(n){const e=n.otel?.port;return typeof e=="number"&&Number.isInteger(e)&&e>0&&e<65536?e:ne}o(gn,"getOTELPort");function dn(n){const e=n.otel?.idleTimeoutSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>0?e:te}o(dn,"getOTELIdleTimeoutSeconds");function pn(n){const e=n.otel?.ensureMinIntervalSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:oe}o(pn,"getOTELEnsureMinIntervalSeconds");function bn(n){const e=n.otel?.emitMinIntervalSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:re}o(bn,"getOTELEmitMinIntervalSeconds");function En(n){const e=n.statusLine?.refreshInterval;if(typeof e=="number"&&Number.isFinite(e)&&e>=1)return e}o(En,"getStatusLineRefreshInterval");function p(n,e){return e!=null&&typeof e=="object"&&!Array.isArray(e)?e.enable!==!1:R(n)}o(p,"isFeatureEnabledWithCollectorAutoEnable");function Ln(n){return n==null||typeof n!="object"||Array.isArray(n)?!1:n.enable!==!1}o(Ln,"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 yn(n){const e=n.verification;return e==null||typeof e!="object"||Array.isArray(e)?!1:e.strict===!0}o(yn,"getVerificationStrict");const se=65536,ae=1;function _n(n){const e=n.verificationContext;return e==null||typeof e!="object"||Array.isArray(e)?!0:e.enable!==!1}o(_n,"getVerificationContextEnabled");function Cn(n){return n.verificationContext?.source==="actions"?"actions":"git"}o(Cn,"getVerificationContextSource");function mn(n){const e=n.verificationContext?.commitDepth;return typeof e=="number"&&Number.isFinite(e)&&e>=0?Math.floor(e):ae}o(mn,"getVerificationContextCommitDepth");function An(n){const e=n.verificationContext?.maxBytes;return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.floor(e):se}o(An,"getVerificationContextMaxBytes");function vn(n,e){const t=x(n);return t.length>0&&C(e,t)}o(vn,"isIgnoredVerifyPath");function In(n){return O(n)?ie(n)?"enforce":"assist":"monitor"}o(In,"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 Tn(n){const e=n.fileChange;return!e||typeof e!="object"||Array.isArray(e)?!1:e.captureChangeset===!0}o(Tn,"getCaptureFileChangeset");function xn(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(xn,"getMaxChangesetBytes");function wn(n){const e=c(n);return p(e,e.analytics)}o(wn,"isAnalyticsEnabled");function jn(n){const t=c(n).analytics;return t===null||typeof t!="object"||Array.isArray(t)?!0:t.emitOnStop!==!1}o(jn,"isAnalyticsEmitOnStopEnabled");function Rn(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(Rn,"getAnalyticsEmitOnStopMinIntervalSeconds");function On(n){const t=c(n).analytics;return t===null||typeof t!="object"||Array.isArray(t)?!1:t.emitTurnEvents===!0}o(On,"isAnalyticsTurnEventsEnabled");function hn(n){const t=c(n).analytics;return t===null||typeof t!="object"||Array.isArray(t)?!1:t.emitStepEvents===!0}o(hn,"isAnalyticsStepEventsEnabled");function kn(n){const t=c(n).analytics;return t===null||typeof t!="object"||Array.isArray(t)?!0:t.emitApiRequestEvents!==!1}o(kn,"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,isCollectorConfigured,isCycleEnabled,isCyclePatternsActive,isIgnoredVerifyPath,isJobQueueEnabled,isOTELEnabled,isRecordingEnabled,isSessionStatusEnabled,loadConfig,requiresVerification,resolveConfigTargetFromFlags,resolveIgnoredVerifyPatterns});
@@ -1,6 +1,7 @@
1
- "use strict";var f=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var A=Object.prototype.hasOwnProperty;var l=(e,n)=>f(e,"name",{value:n,configurable:!0});var K=(e,n)=>{for(var o in n)f(e,o,{get:n[o],enumerable:!0})},P=(e,n,o,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of $(n))!A.call(e,i)&&i!==o&&f(e,i,{get:()=>n[i],enumerable:!(r=C(n,i))||r.enumerable});return e};var E=e=>P(f({},"__esModule",{value:!0}),e);var I={};K(I,{isInteractive:()=>h,keyToMultiSelectAction:()=>v,promptAcknowledge:()=>T,promptChoice:()=>N,promptMultiSelect:()=>j,promptSelect:()=>k,promptYesNo:()=>L,reduceMultiSelect:()=>y,renderMultiSelect:()=>M,renderSelect:()=>x});module.exports=E(I);var p=require("readline"),c=require("./output");function h(){return!!process.stdin.isTTY&&!!process.stdout.isTTY}l(h,"isInteractive");function N(e,n,o=0){const i=[e,...n.map((t,u)=>{const d=u===o?" (default)":"";return` ${u+1}) ${t}${d}`})].join(`
1
+ "use strict";var w=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var K=Object.prototype.hasOwnProperty;var c=(e,n)=>w(e,"name",{value:n,configurable:!0});var P=(e,n)=>{for(var o in n)w(e,o,{get:n[o],enumerable:!0})},$=(e,n,o,u)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of A(n))!K.call(e,t)&&t!==o&&w(e,t,{get:()=>n[t],enumerable:!(u=k(n,t))||u.enumerable});return e};var E=e=>$(w({},"__esModule",{value:!0}),e);var I={};P(I,{PROMPT_BACK:()=>C,isInteractive:()=>h,keyToMultiSelectAction:()=>y,promptAcknowledge:()=>L,promptChoice:()=>N,promptMultiSelect:()=>j,promptSelect:()=>B,promptYesNo:()=>T,reduceMultiSelect:()=>M,renderMultiSelect:()=>x,renderSelect:()=>R});module.exports=E(I);var f=require("readline"),a=require("./output");function h(){return!!process.stdin.isTTY&&!!process.stdout.isTTY}c(h,"isInteractive");function N(e,n,o=0){const t=[e,...n.map((r,i)=>{const l=i===o?" (default)":"";return` ${i+1}) ${r}${l}`})].join(`
2
2
  `)+`
3
- > `,s=(0,p.createInterface)({input:process.stdin,output:process.stdout});return new Promise(t=>{s.question(i,u=>{s.close();const d=u.trim();if(d.length===0){t(o);return}const m=Number.parseInt(d,10);if(!Number.isNaN(m)&&m>=1&&m<=n.length){t(m-1);return}const a=n.findIndex(b=>b.toLowerCase()===d.toLowerCase());if(a!==-1){t(a);return}t(o)})})}l(N,"promptChoice");function L(e,n){const o=n?" [Y/n] ":" [y/N] ",r=(0,p.createInterface)({input:process.stdin,output:process.stdout});return new Promise(i=>{r.question(e+o,s=>{r.close();const t=s.trim().toLowerCase();if(t.length===0){i(n);return}if(t==="y"||t==="yes"){i(!0);return}if(t==="n"||t==="no"){i(!1);return}i(n)})})}l(L,"promptYesNo");function T(e){const n=(0,p.createInterface)({input:process.stdin,output:process.stdout});return new Promise(o=>{let r=!1;const i=l(()=>{r||(r=!0,n.close(),o())},"done");n.question(e,()=>i()),n.on("close",()=>i())})}l(T,"promptAcknowledge");function v(e){if(e.ctrl===!0&&e.name==="c")return"cancel";switch(e.name){case"up":case"k":return"up";case"down":case"j":return"down";case"space":return"toggle";case"a":return"toggleAll";case"return":case"enter":return"submit";case"escape":return"cancel";default:return"none"}}l(v,"keyToMultiSelectAction");function y(e,n){if(e.n<=0)return!1;switch(n){case"up":return e.cursor=(e.cursor-1+e.n)%e.n,!0;case"down":return e.cursor=(e.cursor+1)%e.n,!0;case"toggle":return e.selected.has(e.cursor)?e.selected.delete(e.cursor):e.selected.add(e.cursor),!0;case"toggleAll":if(e.selected.size===e.n)e.selected.clear();else for(let o=0;o<e.n;o++)e.selected.add(o);return!0;default:return!1}}l(y,"reduceMultiSelect");function g(e,n,o){return`${o(c.pc.bold(e))} ${c.pc.dim(n)}`}l(g,"keyHint");const w=c.pc.dim(" \xB7 ");function M(e,n,o){const r=n.reduce((t,u)=>Math.max(t,u.label.length),0),i=" "+[g("\u2191/\u2193","move",c.pc.cyan),g("space","select",c.pc.yellow),g("a","all",c.pc.magenta),g("enter","confirm",c.pc.green)].join(w),s=[e,i];return n.forEach((t,u)=>{const d=u===o.cursor,m=d?c.pc.cyan(">"):" ",a=o.selected.has(u)?c.pc.yellow("[x]"):"[ ]",b=d?c.pc.bold(t.label.padEnd(r)):t.label.padEnd(r),R=t.hint?" "+c.pc.dim(t.hint):"";s.push(`${m} ${a} ${b}${R}`)}),s}l(M,"renderMultiSelect");function j(e,n,o){const r=o.filter(s=>s>=0&&s<n.length).sort((s,t)=>s-t);if(n.length===0)return Promise.resolve([...r]);const i={cursor:0,selected:new Set(r),n:n.length};return new Promise(s=>{S(()=>M(e,n,i),u=>u==="cancel"?"cancel":u==="submit"?"submit":y(i,u)?"redraw":"ignore",()=>s([...i.selected].sort((u,d)=>u-d)))||s([...r])})}l(j,"promptMultiSelect");function x(e,n,o){const r=n.reduce((t,u)=>Math.max(t,u.label.length),0),i=" "+[g("\u2191/\u2193","move",c.pc.cyan),g("enter","select",c.pc.green)].join(w),s=[e,i];return n.forEach((t,u)=>{const d=u===o,m=d?c.pc.cyan(">"):" ",a=d?c.pc.bold(t.label.padEnd(r)):t.label.padEnd(r),b=t.hint?" "+c.pc.dim(t.hint):"";s.push(`${m} ${a}${b}`)}),s}l(x,"renderSelect");function k(e,n,o=0){if(n.length===0)return Promise.resolve(o);let r=o>=0&&o<n.length?o:0;return new Promise(i=>{S(()=>x(e,n,r),t=>t==="cancel"?"cancel":t==="submit"?"submit":t==="up"?(r=(r-1+n.length)%n.length,"redraw"):t==="down"?(r=(r+1)%n.length,"redraw"):"ignore",()=>i(r))||i(o)})}l(k,"promptSelect");function S(e,n,o){const r=process.stdin;if(!h()||typeof r.setRawMode!="function")return!1;const i=process.stdout;let s=0;const t=l(m=>{!m&&s>0&&i.write(`\x1B[${s}A`),i.write("\x1B[0J");const a=e();i.write(a.join(`
3
+ > `,s=(0,f.createInterface)({input:process.stdin,output:process.stdout});return new Promise(r=>{s.question(t,i=>{s.close();const l=i.trim();if(l.length===0){r(o);return}const d=Number.parseInt(l,10);if(!Number.isNaN(d)&&d>=1&&d<=n.length){r(d-1);return}const b=n.findIndex(m=>m.toLowerCase()===l.toLowerCase());if(b!==-1){r(b);return}r(o)})})}c(N,"promptChoice");function T(e,n){const o=n?" [Y/n] ":" [y/N] ",u=(0,f.createInterface)({input:process.stdin,output:process.stdout});return new Promise(t=>{u.question(e+o,s=>{u.close();const r=s.trim().toLowerCase();if(r.length===0){t(n);return}if(r==="y"||r==="yes"){t(!0);return}if(r==="n"||r==="no"){t(!1);return}t(n)})})}c(T,"promptYesNo");function L(e){const n=(0,f.createInterface)({input:process.stdin,output:process.stdout});return new Promise(o=>{let u=!1;const t=c(()=>{u||(u=!0,n.close(),o())},"done");n.question(e,()=>t()),n.on("close",()=>t())})}c(L,"promptAcknowledge");function y(e){if(e.ctrl===!0&&e.name==="c")return"cancel";switch(e.name){case"up":case"k":return"up";case"down":case"j":return"down";case"space":return"toggle";case"a":return"toggleAll";case"return":case"enter":return"submit";case"escape":return"back";default:return"none"}}c(y,"keyToMultiSelectAction");function M(e,n){if(e.n<=0)return!1;switch(n){case"up":return e.cursor=(e.cursor-1+e.n)%e.n,!0;case"down":return e.cursor=(e.cursor+1)%e.n,!0;case"toggle":return e.selected.has(e.cursor)?e.selected.delete(e.cursor):e.selected.add(e.cursor),!0;case"toggleAll":if(e.selected.size===e.n)e.selected.clear();else for(let o=0;o<e.n;o++)e.selected.add(o);return!0;default:return!1}}c(M,"reduceMultiSelect");function p(e,n,o){return`${o(a.pc.bold(e))} ${a.pc.dim(n)}`}c(p,"keyHint");const S=a.pc.dim(" \xB7 ");function x(e,n,o){const u=n.reduce((r,i)=>Math.max(r,i.label.length),0),t=" "+[p("\u2191/\u2193","move",a.pc.cyan),p("space","select",a.pc.yellow),p("a","all",a.pc.magenta),p("enter","confirm",a.pc.green)].join(S),s=[e,t];return n.forEach((r,i)=>{const l=i===o.cursor,d=l?a.pc.cyan(">"):" ",b=o.selected.has(i)?a.pc.yellow("[x]"):"[ ]",m=l?a.pc.bold(r.label.padEnd(u)):r.label.padEnd(u),g=r.hint?" "+a.pc.dim(r.hint):"";s.push(`${d} ${b} ${m}${g}`)}),s}c(x,"renderMultiSelect");function j(e,n,o){const u=o.filter(s=>s>=0&&s<n.length).sort((s,r)=>s-r);if(n.length===0)return Promise.resolve([...u]);const t={cursor:0,selected:new Set(u),n:n.length};return new Promise(s=>{v(()=>x(e,n,t),i=>i==="cancel"||i==="back"?"cancel":i==="submit"?"submit":M(t,i)?"redraw":"ignore",()=>s([...t.selected].sort((i,l)=>i-l)))||s([...u])})}c(j,"promptMultiSelect");function R(e,n,o){const u=n.reduce((r,i)=>Math.max(r,i.label.length),0),t=" "+[p("\u2191/\u2193","move",a.pc.cyan),p("enter","select",a.pc.green)].join(S),s=[e,t];return n.forEach((r,i)=>{const l=i===o,d=l?a.pc.cyan(">"):" ",b=l?a.pc.bold(r.label.padEnd(u)):r.label.padEnd(u),m=r.hint?" "+a.pc.dim(r.hint):"";s.push(`${d} ${b}${m}`)}),s}c(R,"renderSelect");function B(e,n,o=0,u={}){if(n.length===0)return Promise.resolve(o);let t=o>=0&&o<n.length?o:0;return new Promise(s=>{v(()=>R(e,n,t),i=>i==="cancel"?"cancel":i==="back"?u.allowBack===!0?"back":"cancel":i==="submit"?"submit":i==="up"?(t=(t-1+n.length)%n.length,"redraw"):i==="down"?(t=(t+1)%n.length,"redraw"):"ignore",()=>s(t),u.allowBack===!0?()=>s(C):void 0)||s(o)})}c(B,"promptSelect");const C=-1;function v(e,n,o,u){const t=process.stdin;if(!h()||typeof t.setRawMode!="function")return!1;const s=process.stdout;let r=0;const i=c(b=>{!b&&r>0&&s.write(`\x1B[${r}A`),s.write("\x1B[0J");const m=e();s.write(m.join(`
4
4
  `)+`
5
- `),s=a.length},"draw"),u=l(()=>{r.removeListener("keypress",d),typeof r.setRawMode=="function"&&r.setRawMode(!1),r.pause()},"cleanup"),d=l((m,a)=>{if(!a)return;const b=n(v(a));if(b==="cancel"){u(),i.write(`
6
- `),process.exit(130);return}if(b==="submit"){u(),o();return}b==="redraw"&&t(!1)},"onKey");return(0,p.emitKeypressEvents)(r),r.setRawMode(!0),r.resume(),r.on("keypress",d),t(!0),!0}l(S,"runRawKeypressUI");0&&(module.exports={isInteractive,keyToMultiSelectAction,promptAcknowledge,promptChoice,promptMultiSelect,promptSelect,promptYesNo,reduceMultiSelect,renderMultiSelect,renderSelect});
5
+ `),r=m.length},"draw"),l=c(()=>{t.removeListener("keypress",d),typeof t.setRawMode=="function"&&t.setRawMode(!1),t.pause()},"cleanup"),d=c((b,m)=>{if(!m)return;const g=n(y(m));if(g==="cancel"){l(),s.write(`
6
+ `),process.exit(130);return}if(g==="back"){l(),u?u():(s.write(`
7
+ `),process.exit(130));return}if(g==="submit"){l(),o();return}g==="redraw"&&i(!1)},"onKey");return(0,f.emitKeypressEvents)(t),t.setRawMode(!0),t.resume(),t.on("keypress",d),i(!0),!0}c(v,"runRawKeypressUI");0&&(module.exports={PROMPT_BACK,isInteractive,keyToMultiSelectAction,promptAcknowledge,promptChoice,promptMultiSelect,promptSelect,promptYesNo,reduceMultiSelect,renderMultiSelect,renderSelect});
@@ -1 +1 @@
1
- "use strict";var a=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var n=(e,t)=>a(e,"name",{value:t,configurable:!0});var g=(e,t)=>{for(var o in t)a(e,o,{get:t[o],enumerable:!0})},y=(e,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of u(t))!h.call(e,r)&&r!==o&&a(e,r,{get:()=>t[r],enumerable:!(i=p(t,r))||i.enumerable});return e};var b=e=>y(a({},"__esModule",{value:!0}),e);var T={};g(T,{ARTIFACT_AFFECTING_TOP_KEYS:()=>v,CONFIG_SCHEMA:()=>d,GROUP_ORDER:()=>s,GROUP_TITLES:()=>f,findSchemaEntry:()=>A,groupOf:()=>l,groupRank:()=>c,groupTitle:()=>w,orderedEntries:()=>k,topKey:()=>m});module.exports=b(T);const v=new Set(["verification","collector","browser","node","backend","android","browserDevTools","nodeDevTools","backendDevTools","androidDevTools","telemetry","privacy","statusLine","otel","codex"]),s=["general","verification","verificationContext","browser","node","backend","android","collector","recording","jobQueue","analytics","statusLine","claude","codex","telemetry","privacy","otel","fileChange","import","browserDevTools","nodeDevTools","backendDevTools","androidDevTools"],f={general:"General",verification:"Verification",verificationContext:"Verification context",browser:"Browser cycle",node:"Node cycle",backend:"Backend cycle",android:"Android cycle",collector:"Collector",recording:"Recording",jobQueue:"Job queue",analytics:"Analytics",statusLine:"Statusline",claude:"Claude",codex:"Codex",telemetry:"Telemetry",privacy:"Privacy",otel:"OTEL collector",fileChange:"File change",import:"Import",browserDevTools:"Browser DevTools MCP",nodeDevTools:"Node DevTools MCP",backendDevTools:"Backend DevTools MCP",androidDevTools:"Android DevTools MCP"};function m(e){const t=e.indexOf(".");return t===-1?e:e.slice(0,t)}n(m,"topKey");function l(e){const t=e.indexOf(".");return t===-1?"general":e.slice(0,t)}n(l,"groupOf");function w(e){return f[e]??e}n(w,"groupTitle");function c(e){const t=s.indexOf(e);return t===-1?s.length:t}n(c,"groupRank");const d=[{path:"ignoredVerifyPatterns",type:"string-array",editor:"string-list",description:"Glob patterns excluded from verification, applied to every cycle (browser / node / backend). Checked first \u2014 a match here activates no cycle regardless of other patterns. Unioned on top of an always-on default set that excludes test files (**/*.spec.*, **/*.test.*, **/__tests__/**, **/__mocks__/**) \u2014 a test-only edit never activates a runtime-verification cycle.",def:"[] (plus always-on test-file defaults)",artifactAffecting:!1},{path:"maxRetries",type:"number",editor:"number",description:"Max verification retry attempts before the gate allows completion despite failures. Single global counter regardless of how many cycles ran.",def:"3",artifactAffecting:!1},{path:"verification.enable",type:"boolean",editor:"toggle",description:"Master enforcement switch. Inverse semantics \u2014 verification is the core feature, opt out with false. When false, IronBee runs monitoring-only: no enforcement hooks, no skill/rule, no MCP servers; only session/activity/tool_call events flow to the collector.",def:"true",artifactAffecting:!0},{path:"verification.auto",type:"boolean",editor:"toggle",description:"Automatic-enforcement sub-toggle (only meaningful when verification.enable !== false). Default FALSE \u2014 assist is the default mode (the safer default): the /ironbee-verify command + MCP servers stay installed so the agent can verify manually, but nothing is enforced \u2014 no Stop gate, non-blocking (soft) PreToolUse hooks, and the skill/rule are omitted. Opt into full enforcement with true (blocking Stop gate + skill/rule installed).",def:"false",artifactAffecting:!0},{path:"verification.strict",type:"boolean",editor:"toggle",description:`Strict mode (only meaningful in enforce mode). Default false. When true the verify-gate refuses N/A verdicts \u2014 both a global status "not_applicable" and per-platform not_applicable_cycles exemptions \u2014 so the agent must produce real verification tool evidence for every active cycle. Default (false) accepts N/A: the agent can declare a change has no runtime surface (globally or per-cycle) and the gate allows it, recorded + observable. Inert in assist/monitor (no gate runs). The gate reads it live; the rerender it shares with the rest of the verification block is idempotent (the N/A guidance is mode-agnostic, so the installed artifacts don't change).`,def:"false",artifactAffecting:!0},{path:"verification.model",type:"json",editor:"json",description:`Model the delegated verifier sub-agent uses. Unset \u2192 the verifier inherits the session model (Claude verifier omits model: \u2192 inherit; Codex verifier omits agent-toml model \u2192 inherits config.toml's model). Set to PIN a specific model \u2014 e.g. verify on a cheaper/faster model than the main agent, or guarantee a model on Codex when config.toml has none. Two shapes: a string (applies to all clients, e.g. "sonnet" / "gpt-5.5") or a per-client object { claude: "sonnet", codex: "gpt-5.5" } when a project has both clients. Cursor has no verifier sub-agent \u2192 no-op there. Never resolves to a literal "inherit" on Codex (a 400). Artifact-affecting.`,def:"unset (inherit the session model)",artifactAffecting:!0},{path:"verificationContext.enable",type:"boolean",editor:"toggle",description:"Master switch for path-scoped verification context. When a cycle begins, the first devtools tool call injects the .ironbee/VERIFICATION.md files on/above the changed paths (author-written area guidance) into the agent's context via the host's additionalContext channel. Advisory only (does not gate). Inverse semantics \u2014 default-on, opt out with false. Not artifact-affecting (read live).",def:"true",artifactAffecting:!1},{path:"verificationContext.source",type:"string",editor:"enum",enumValues:["git","actions"],description:`Changed-path source. "git" (default) = working tree + last N commits, with an actions.jsonl fallback when not a git repo. "actions" = IronBee's own file_change events only (no git subprocess).`,def:"git",artifactAffecting:!1},{path:"verificationContext.commitDepth",type:"number",editor:"number",description:'Number of recent commits included on the git source (uncommitted \u222A last N commits). 0 = uncommitted only. Ignored when source is "actions".',def:"1",artifactAffecting:!1},{path:"verificationContext.maxBytes",type:"number",editor:"number",description:"Aggregate byte cap on the injected context string. When exceeded, the least-specific (root-side) docs are dropped first (leaf-first truncation priority).",def:"65536 (64 KB)",artifactAffecting:!1},{path:"browser.enable",type:"boolean",editor:"toggle",description:"Explicit on/off for the browser cycle. Written false by `browser disable`, stripped by `browser enable`. When false the cycle is disabled regardless of patterns.",def:"(absent \u2192 on; browser is the only default-on cycle)",artifactAffecting:!0},{path:"browser.verifyPatterns",type:"string-array",editor:"string-list",description:"Glob patterns for files requiring browser verification. Four-state: absent \u2192 code defaults (40+ extensions); [] \u2192 hard kill; non-empty \u2192 custom patterns (replaces defaults).",def:"40+ code extensions when unset; [] hard-disables",artifactAffecting:!0},{path:"browser.additionalVerifyPatterns",type:"string-array",editor:"string-list",description:"Extra patterns appended to browser.verifyPatterns (or to code defaults when verifyPatterns is unset). Ignored when verifyPatterns is [] (hard kill wins).",def:"[]",artifactAffecting:!0},{path:"browser.alwaysRequired",type:"string-array",editor:"string-list",description:"Browser-cycle required tools (all-of). The verify-gate blocks completion until every listed bdt_* tool was used.",def:"bdt_navigation_go-to, bdt_content_take-screenshot, bdt_a11y_take-aria-snapshot, bdt_o11y_get-console-messages",artifactAffecting:!0},{path:"browser.evidencePaths",type:"json",editor:"json",description:"Alternative tool-satisfaction paths (any-of). Browser uses pure all-of, so default is empty. Each path: { name, allOf: (string | { anyOf: string[] })[] }.",def:"[]",artifactAffecting:!0},{path:"node.enable",type:"boolean",editor:"toggle",description:"Explicit on/off for the Node.js runtime debug cycle (node-devtools, ndt_* V8 inspector probes). Opt-in \u2014 written by `node enable`.",def:"(absent \u2192 off; node is opt-in)",artifactAffecting:!0},{path:"node.verifyPatterns",type:"string-array",editor:"string-list",description:"Glob patterns for the Node.js runtime debug cycle. Default-off \u2014 block absent = inert. Block present + unset \u2192 9 code defaults (server/api/routes paths).",def:"block absent \u2192 disabled; present + unset \u2192 code defaults",artifactAffecting:!0},{path:"node.additionalVerifyPatterns",type:"string-array",editor:"string-list",description:"Extra patterns appended to node.verifyPatterns (or to code defaults when unset). Ignored when verifyPatterns is [].",def:"[]",artifactAffecting:!0},{path:"node.alwaysRequired",type:"string-array",editor:"string-list",description:"Node-cycle required tools (all-of). ndt_debug_connect always; evidence paths supply the rest.",def:"[ndt_debug_connect]",artifactAffecting:!0},{path:"node.evidencePaths",type:"json",editor:"json",description:"Alternative tool paths (any-of). Default: probe path (a put-*point AND get-probe-snapshots) OR log path (get-logs).",def:"probe path + log path",artifactAffecting:!0},{path:"backend.enable",type:"boolean",editor:"toggle",description:"Explicit on/off for the runtime-agnostic backend protocol cycle (backend-devtools, bedt_* HTTP/gRPC/GraphQL/WebSocket). Opt-in \u2014 written by `backend enable`.",def:"(absent \u2192 off; backend is opt-in)",artifactAffecting:!0},{path:"backend.verifyPatterns",type:"string-array",editor:"string-list",description:"Glob patterns for the backend protocol cycle. Default-off \u2014 block absent = inert. Block present + unset \u2192 13 multi-language code defaults (ts/js/py/go/java/rb/cs/rs/kt/scala/ex/php/clj).",def:"block absent \u2192 disabled; present + unset \u2192 code defaults",artifactAffecting:!0},{path:"backend.additionalVerifyPatterns",type:"string-array",editor:"string-list",description:"Extra patterns appended to backend.verifyPatterns (or to code defaults when unset). Ignored when verifyPatterns is [].",def:"[]",artifactAffecting:!0},{path:"backend.alwaysRequired",type:"string-array",editor:"string-list",description:"Backend-cycle required tools (all-of). Empty by default \u2014 backend uses any-of evidence paths instead.",def:"[]",artifactAffecting:!0},{path:"backend.evidencePaths",type:"json",editor:"json",description:"Alternative tool paths (any-of). Default three: protocol-call (any request tool) OR log-evidence (register-source + read) OR db-evidence (db_connect + a read op).",def:"protocol-call OR log-evidence OR db-evidence",artifactAffecting:!0},{path:"android.enable",type:"boolean",editor:"toggle",description:"Explicit on/off for the Android mobile verification cycle (android-devtools, adt_* device/emulator interaction). Opt-in \u2014 written by `android enable`.",def:"(absent \u2192 off; android is opt-in)",artifactAffecting:!0},{path:"android.verifyPatterns",type:"string-array",editor:"string-list",description:"Glob patterns for the Android mobile verification cycle. Default-off \u2014 block absent = inert. Block present + unset \u2192 code defaults (Android/React Native paths).",def:"block absent \u2192 disabled; present + unset \u2192 code defaults",artifactAffecting:!0},{path:"android.additionalVerifyPatterns",type:"string-array",editor:"string-list",description:"Extra patterns appended to android.verifyPatterns (or to code defaults when unset). Ignored when verifyPatterns is [].",def:"[]",artifactAffecting:!0},{path:"android.alwaysRequired",type:"string-array",editor:"string-list",description:"Android-cycle required tools (all-of). adt_device_connect always; evidence paths supply the rest.",def:"[adt_device_connect]",artifactAffecting:!0},{path:"android.evidencePaths",type:"json",editor:"json",description:"Alternative tool paths (any-of). Default two: device-evidence (UI interaction + screenshot + UI snapshot) OR log-evidence (Logcat read/follow).",def:"device-evidence OR log-evidence",artifactAffecting:!0},{path:"collector.enable",type:"boolean",editor:"toggle",description:"Master switch for the IronBee Collector. Implicitly true when the section has url and at least one credential (oauthToken or apiKey); set false to suspend while keeping url/oauthToken/apiKey/batchSize around.",def:"implicit true when url + (oauthToken or apiKey) set",artifactAffecting:!0},{path:"collector.url",type:"string",editor:"text",description:"Remote collector endpoint URL (IronBee Platform). Required for the collector to be active. Events POST to {url}/v1/events.",def:"(unset \u2192 disabled)",artifactAffecting:!0},{path:"collector.oauthToken",type:"string",editor:"text",description:"Personal access token for collector auth (X-OAuth-Token header). Per-(user, account), independently revocable from the console's /access-tokens page. Minted by `ironbee login` \u2014 the primary path for interactive CLI use. Can be supplied via IRONBEE_OAUTH_TOKEN.",def:"(unset)",artifactAffecting:!0},{path:"collector.apiKey",type:"string",editor:"text",description:"Shared account API key for collector auth (X-API-Key header). Parallel first-class path alongside `oauthToken`, intended for CI / GitHub Actions / deployment tooling and other non-interactive integrations where rotating a per-engineer OAuth token is impractical. Either `oauthToken` OR `apiKey` is required for the collector to be active. Can be supplied via IRONBEE_API_KEY.",def:"(unset \u2192 disabled)",artifactAffecting:!0},{path:"collector.batchSize",type:"number",editor:"number",description:"Max events per POST from the send_event handler (the queue chunks bigger snapshots into N-sized POSTs).",def:"100",artifactAffecting:!0},{path:"collector.timeoutMs",type:"number",editor:"number",description:"Per-request HTTP timeout (ms) for batched analytics sends. Single-event interactive sends keep a fixed 3000ms cap. Clamped to [1000, 60000].",def:"10000",artifactAffecting:!0},{path:"recording.enable",type:"boolean",editor:"toggle",description:"Recording enforcement for the browser + android cycles. Presence opts in; enable:false opts out. Auto-enabled when a collector is configured. Node/backend cycles never trigger recording.",def:"implicit true when section present or collector configured",artifactAffecting:!1},{path:"jobQueue.enable",type:"boolean",editor:"toggle",description:"Master switch for the file-backed job queue. Presence opts in; enable:false opts out. Auto-enabled when a collector is configured (a collector is pointless without a queue feeding it).",def:"implicit true when section present or collector configured",artifactAffecting:!1},{path:"jobQueue.autoFlushSizeBytes",type:"number",editor:"number",description:"Size threshold (bytes) above which submit() spawns a detached worker mid-session. 0 / negative disables this check.",def:"32768 (32 KB)",artifactAffecting:!1},{path:"jobQueue.autoFlushIntervalSeconds",type:"number",editor:"number",description:"Interval threshold (seconds since the live jobs.jsonl was created) above which submit() spawns a detached worker. Complements size \u2014 whichever crosses first flushes. 0 / negative disables.",def:"60",artifactAffecting:!1},{path:"analytics.enable",type:"boolean",editor:"toggle",description:"Master switch for per-session structural analytics. Presence opts in; enable:false opts out. Auto-enabled when a collector is configured.",def:"implicit true when section present or collector configured",artifactAffecting:!1},{path:"analytics.emitOnStop",type:"boolean",editor:"toggle",description:"When true, project + emit analytics at every Stop hook. When false, only at SessionEnd.",def:"true",artifactAffecting:!1},{path:"analytics.emitOnStopMinIntervalSeconds",type:"number",editor:"number",description:"Throttle: skip Stop-hook projection if the last successful emit was within this many seconds. 0 disables the throttle (backend handles rate-limit / dedupe).",def:"0 (disabled)",artifactAffecting:!1},{path:"analytics.emitTurnEvents",type:"boolean",editor:"toggle",description:"Opt-in for per-turn session_turn_analytics wire records. High-volume secondary signal; the base session_analytics record always ships regardless.",def:"false",artifactAffecting:!1},{path:"analytics.emitStepEvents",type:"boolean",editor:"toggle",description:"Opt-in for per-step session_turn_step_analytics wire records (an order of magnitude higher volume than turn events). Independent of emitTurnEvents.",def:"false",artifactAffecting:!1},{path:"analytics.emitApiRequestEvents",type:"boolean",editor:"toggle",description:"Opt-OUT for per-API-request api_request wire records (one per assistant message, success + failure). Primary value for backend cost accounting, so ships by default.",def:"true",artifactAffecting:!1},{path:"statusLine.enable",type:"boolean",editor:"toggle",description:"Master switch for the Claude statusline integration (session_status event + statusline wrapper). Presence opts in; auto-enabled when a collector is configured. Claude-only.",def:"implicit true when section present or collector configured",artifactAffecting:!0},{path:"statusLine.renderDefault",type:"boolean",editor:"toggle",description:"When there is no upstream statusline to chain to, false keeps the statusline silent; true renders a minimal model + context-% line. No effect when the user already has a statusline.",def:"false",artifactAffecting:!0},{path:"statusLine.emitMinIntervalSeconds",type:"number",editor:"number",description:"Minimum seconds between two emitted session_status events, on top of skip-if-unchanged. Rapid changes coalesce to the latest state after the interval. 0 disables the throttle. Read live each tick.",def:"10",artifactAffecting:!0},{path:"statusLine.refreshInterval",type:"number",editor:"number",description:"Claude Code's own statusLine.refreshInterval (seconds, host min 1) \u2014 re-runs the statusline on a timer in addition to event-driven updates. Unset by default. Values < 1 treated as unset.",def:"unset",artifactAffecting:!0},{path:"claude.oauthAccess.enable",type:"boolean",editor:"toggle",description:"Whether IronBee may read the Claude Code OAuth token (macOS Keychain / ~/.claude/.credentials.json) and call OAuth-scoped Anthropic endpoints. Default-on (opt out with false or `ironbee claude oauth-access disable`). First consumer: the statusline rate-limit fallback \u2014 fetches /api/oauth/usage to fill rate_limits for plans the statusline JSON omits them for (team / enterprise). Claude-only; not artifact-affecting (read live).",def:"true",artifactAffecting:!1},{path:"claude.oauthAccess.usageTtlSeconds",type:"number",editor:"number",description:"TTL (seconds) for the statusline OAuth rate-limit fetch cache \u2014 the /api/oauth/usage call + credential read fire at most once per this interval even when the statusline ticks far more often. Default 60; 0 means every tick.",def:"60",artifactAffecting:!1},{path:"claude.autoModeAllowlist.enable",type:"boolean",editor:"toggle",description:"Whether IronBee writes the auto-mode allowlist carve-out for the verifier into .claude/settings.local.json. Claude Code 2.1.176+ ships a host-side sub-agent \"Content Integrity\" classifier (auto mode) that false-positives on IronBee's legitimate `ironbee hook submit-verdict` verdicts (the devtools calls happened earlier in the cycle, not re-shown in the handoff). When enabled (default), install adds a narrow, command-keyed autoMode.allow rule that exempts ONLY that command from the Content Integrity block ($defaults preserved \u2014 every other block rule still applies; IronBee's Stop-gate independently enforces real tool usage). Written only when verification is active (enforce/assist); inert when the host isn't in auto mode. Opt out with false \u2014 takes effect on the next `ironbee install`. Claude-only.",def:"true",artifactAffecting:!1},{path:"codex.verifier.mode",type:"string",editor:"enum",enumValues:["sub-agent","main-agent"],description:'How the Codex verification cycle is driven (Codex-only). "sub-agent" (default) delegates to the ironbee-verifier custom agent (per-agent MCP, SubagentStart bridge, slim delegation skill/rule/command). "main-agent" makes the MAIN agent drive the devtools tools directly (session-level [mcp_servers.*], no verifier agent, inline skill/rule/command) \u2014 the Cursor-style fallback for when Codex\'s sub-agent machinery regresses. Re-renders the Codex client. Toggle via `ironbee codex verifier mode <sub-agent|main-agent>`.',def:"sub-agent",artifactAffecting:!0},{path:"telemetry.enable",type:"boolean",editor:"toggle",description:"Master switch for anonymous PostHog telemetry (CLI's own product analytics). Inverse semantics \u2014 opt out with false. Disabling also injects TELEMETRY_ENABLE=false into devtools MCP env. Orthogonal to the collector pipeline.",def:"true",artifactAffecting:!0},{path:"privacy.enable",type:"boolean",editor:"toggle",description:"Privacy mode \u2014 a single cross-cutting switch (all platforms) that redacts potentially sensitive data from what the @ironbee-ai/devtools MCP servers ship to the collector. Opt-in, default OFF. When true, injects COLLECTOR_EVENTS_TOOL_DETAILS_ENABLE=false (tool input/output detail) + COLLECTOR_ARTIFACTS_ENABLE=false (screenshots, recordings) into every devtools MCP env. Devtools-side only \u2014 the CLI's own send_event pipeline already whitelists tool_input and strips tool_response. Orthogonal to telemetry (PostHog) and collector (the sink).",def:"false",artifactAffecting:!0},{path:"otel.enable",type:"boolean",editor:"toggle",description:"Master switch for the local OTEL collector pipeline (Claude Code OTLP raw-API-body export \u2192 local daemon \u2192 session_context context-usage events). Presence opts in; enable:false opts out; auto-enabled when a collector is configured. session_context derivation is the sole consumer, so this also gates whether the settings.json OTEL env block (incl. raw-bodies) is written. Orthogonal to telemetry (PostHog) and collector (event sink).",def:"implicit true when collector configured",artifactAffecting:!0},{path:"otel.port",type:"number",editor:"number",description:"Loopback port the shared OTEL collector daemon binds to, and which the settings.json OTEL endpoint env var points at. One daemon per machine across all sessions.",def:"15986",artifactAffecting:!0},{path:"otel.idleTimeoutSeconds",type:"number",editor:"number",description:"The daemon self-reaps (graceful shutdown) after this many seconds with no /health hit and no OTLP event. Restarted on the next session/turn ensure.",def:"600",artifactAffecting:!0},{path:"otel.ensureMinIntervalSeconds",type:"number",editor:"number",description:"Throttle (seconds) for the high-frequency liveness `ensure` from per-tool hooks, so we don't pay a /health check on every tool call. session-start / activity-start ensure are unthrottled.",def:"30",artifactAffecting:!0},{path:"otel.emitMinIntervalSeconds",type:"number",editor:"number",description:"Per-session session_context emit throttle: admit at most one event per session per interval (leading-edge \u2014 the first request in each window is emitted, in-between requests are coalesced away and their body files dropped). Applies to the live path only; the catch-up/reprocess path is never throttled. 0 = emit on every API request (full context-growth time series).",def:"0",artifactAffecting:!0},{path:"fileChange.captureChangeset",type:"boolean",editor:"toggle",description:"When true, every file_change event carries a hunks-only unified-diff changeset string. Off by default \u2014 the default wire shape stays metadata-only (operation + line counts).",def:"false",artifactAffecting:!1},{path:"fileChange.maxChangesetBytes",type:"number",editor:"number",description:"Hard cap on the changeset string size. Diffs over the cap are truncated with a footer so the collector POST stays within typical reverse-proxy body limits.",def:"65536 (64 KB)",artifactAffecting:!1},{path:"import.concurrency",type:"number",editor:"number",description:"Default number of sessions `ironbee import` processes in parallel. Resolution: --concurrency flag > this value > built-in default. Clamped to [1, 32].",def:"4",artifactAffecting:!1},{path:"browserDevTools.env",type:"json",editor:"json",description:"Env-var overrides merged into the browser-devtools MCP server entry. Operators can override individual OTEL keys; IronBee invariants (TOOL_NAME_PREFIX, \u2026) always win last.",def:"unset (defaults + auto-OTEL when collector configured)",artifactAffecting:!0},{path:"browserDevTools.mcp",type:"json",editor:"json",description:"Full-replacement MCP config for the browser-devtools server entry. Auto-OTEL + telemetry env are still injected; IronBee env wins last.",def:"unset (use default npx -y @ironbee-ai/devtools entry)",artifactAffecting:!0},{path:"nodeDevTools.env",type:"json",editor:"json",description:"Env-var overrides merged into the node-devtools MCP server entry. Same auto-OTEL injection as browserDevTools minus the browser-only vars.",def:"unset (defaults + auto-OTEL when collector configured)",artifactAffecting:!0},{path:"nodeDevTools.mcp",type:"json",editor:"json",description:"Full-replacement MCP config for the node-devtools server entry. IronBee env wins last.",def:"unset (use default npx -y @ironbee-ai/devtools entry)",artifactAffecting:!0},{path:"backendDevTools.env",type:"json",editor:"json",description:"Env-var overrides merged into the backend-devtools MCP server entry. Same auto-OTEL injection as nodeDevTools.",def:"unset (defaults + auto-OTEL when collector configured)",artifactAffecting:!0},{path:"backendDevTools.mcp",type:"json",editor:"json",description:"Full-replacement MCP config for the backend-devtools server entry. IronBee env wins last.",def:"unset (use default npx -y @ironbee-ai/devtools entry)",artifactAffecting:!0},{path:"androidDevTools.env",type:"json",editor:"json",description:"Env-var overrides merged into the android-devtools MCP server entry. Same auto-OTEL injection as nodeDevTools.",def:"unset (defaults + auto-OTEL when collector configured)",artifactAffecting:!0},{path:"androidDevTools.mcp",type:"json",editor:"json",description:"Full-replacement MCP config for the android-devtools server entry. IronBee env wins last.",def:"unset (use default npx -y @ironbee-ai/devtools entry)",artifactAffecting:!0}];function A(e){return d.find(t=>t.path===e)}n(A,"findSchemaEntry");function k(){return[...d].sort((e,t)=>{const o=c(l(e.path)),i=c(l(t.path));return o!==i?o-i:e.path.localeCompare(t.path)})}n(k,"orderedEntries");0&&(module.exports={ARTIFACT_AFFECTING_TOP_KEYS,CONFIG_SCHEMA,GROUP_ORDER,GROUP_TITLES,findSchemaEntry,groupOf,groupRank,groupTitle,orderedEntries,topKey});
1
+ "use strict";var a=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var n=(e,t)=>a(e,"name",{value:t,configurable:!0});var g=(e,t)=>{for(var o in t)a(e,o,{get:t[o],enumerable:!0})},y=(e,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of u(t))!h.call(e,r)&&r!==o&&a(e,r,{get:()=>t[r],enumerable:!(i=p(t,r))||i.enumerable});return e};var b=e=>y(a({},"__esModule",{value:!0}),e);var T={};g(T,{ARTIFACT_AFFECTING_TOP_KEYS:()=>v,CONFIG_SCHEMA:()=>d,GROUP_ORDER:()=>s,GROUP_TITLES:()=>f,findSchemaEntry:()=>A,groupOf:()=>c,groupRank:()=>l,groupTitle:()=>w,orderedEntries:()=>k,topKey:()=>m});module.exports=b(T);const v=new Set(["verification","collector","browser","node","backend","android","browserDevTools","nodeDevTools","backendDevTools","androidDevTools","telemetry","privacy","statusLine","otel","codex"]),s=["general","verification","verificationContext","browser","node","backend","android","collector","recording","jobQueue","analytics","statusLine","claude","codex","telemetry","privacy","otel","fileChange","import","browserDevTools","nodeDevTools","backendDevTools","androidDevTools"],f={general:"General",verification:"Verification",verificationContext:"Verification context",browser:"Browser cycle",node:"Node cycle",backend:"Backend cycle",android:"Android cycle",collector:"Collector",recording:"Recording",jobQueue:"Job queue",analytics:"Analytics",statusLine:"Statusline",claude:"Claude",codex:"Codex",telemetry:"Telemetry",privacy:"Privacy",otel:"OTEL collector",fileChange:"File change",import:"Import",browserDevTools:"Browser DevTools MCP",nodeDevTools:"Node DevTools MCP",backendDevTools:"Backend DevTools MCP",androidDevTools:"Android DevTools MCP"};function m(e){const t=e.indexOf(".");return t===-1?e:e.slice(0,t)}n(m,"topKey");function c(e){const t=e.indexOf(".");return t===-1?"general":e.slice(0,t)}n(c,"groupOf");function w(e){return f[e]??e}n(w,"groupTitle");function l(e){const t=s.indexOf(e);return t===-1?s.length:t}n(l,"groupRank");const d=[{path:"ignoredVerifyPatterns",type:"string-array",editor:"string-list",description:"Glob patterns excluded from verification, applied to every cycle (browser / node / backend). Checked first \u2014 a match here activates no cycle regardless of other patterns. Unioned on top of an always-on default set that excludes test files (**/*.spec.*, **/*.test.*, **/__tests__/**, **/__mocks__/**) \u2014 a test-only edit never activates a runtime-verification cycle.",def:"[] (plus always-on test-file defaults)",artifactAffecting:!1},{path:"maxRetries",type:"number",editor:"number",description:"Max verification retry attempts before the gate allows completion despite failures. Single global counter regardless of how many cycles ran.",def:"3",artifactAffecting:!1},{path:"verification.enable",type:"boolean",editor:"toggle",description:"Master enforcement switch. Inverse semantics \u2014 verification is the core feature, opt out with false. When false, IronBee runs monitoring-only: no enforcement hooks, no skill/rule, no MCP servers; only session/activity/tool_call events flow to the collector.",def:"true",artifactAffecting:!0},{path:"verification.auto",type:"boolean",editor:"toggle",description:"Automatic-enforcement sub-toggle (only meaningful when verification.enable !== false). Default FALSE \u2014 assist is the default mode (the safer default): the /ironbee-verify command + MCP servers stay installed so the agent can verify manually, but nothing is enforced \u2014 no Stop gate, non-blocking (soft) PreToolUse hooks, and the skill/rule are omitted. Opt into full enforcement with true (blocking Stop gate + skill/rule installed).",def:"false",artifactAffecting:!0},{path:"verification.strict",type:"boolean",editor:"toggle",description:'Strict mode (only meaningful in enforce mode). Default false. When true the verify-gate refuses N/A verdicts \u2014 both a global status "not_applicable" and per-platform not_applicable_cycles exemptions \u2014 so the agent must produce real verification tool evidence for every active cycle. Default (false) accepts N/A: the agent can declare a change has no runtime surface (globally or per-cycle) and the gate allows it, recorded + observable. Inert in assist/monitor (no gate runs). The gate reads it live; the rerender it shares with the rest of the verification block is idempotent (the N/A guidance is mode-agnostic, so the installed artifacts don\'t change). Set via `ironbee verification strict` enable/disable, `config set`, or at install \u2014 picking enforce opens a strictness sub-choice (interactive) and the `--strict` flag sets it non-interactively.',def:"false",artifactAffecting:!0},{path:"verification.model",type:"json",editor:"json",description:`Model the delegated verifier sub-agent uses. Unset \u2192 the verifier inherits the session model (Claude verifier omits model: \u2192 inherit; Codex verifier omits agent-toml model \u2192 inherits config.toml's model). Set to PIN a specific model \u2014 e.g. verify on a cheaper/faster model than the main agent, or guarantee a model on Codex when config.toml has none. Two shapes: a string (applies to all clients, e.g. "sonnet" / "gpt-5.5") or a per-client object { claude: "sonnet", codex: "gpt-5.5" } when a project has both clients. Cursor has no verifier sub-agent \u2192 no-op there. Never resolves to a literal "inherit" on Codex (a 400). Artifact-affecting.`,def:"unset (inherit the session model)",artifactAffecting:!0},{path:"verificationContext.enable",type:"boolean",editor:"toggle",description:"Master switch for path-scoped verification context. When a cycle begins, the first devtools tool call injects the .ironbee/VERIFICATION.md files on/above the changed paths (author-written area guidance) into the agent's context via the host's additionalContext channel. Advisory only (does not gate). Inverse semantics \u2014 default-on, opt out with false. Not artifact-affecting (read live).",def:"true",artifactAffecting:!1},{path:"verificationContext.source",type:"string",editor:"enum",enumValues:["git","actions"],description:`Changed-path source. "git" (default) = working tree + last N commits, with an actions.jsonl fallback when not a git repo. "actions" = IronBee's own file_change events only (no git subprocess).`,def:"git",artifactAffecting:!1},{path:"verificationContext.commitDepth",type:"number",editor:"number",description:'Number of recent commits included on the git source (uncommitted \u222A last N commits). 0 = uncommitted only. Ignored when source is "actions".',def:"1",artifactAffecting:!1},{path:"verificationContext.maxBytes",type:"number",editor:"number",description:"Aggregate byte cap on the injected context string. When exceeded, the least-specific (root-side) docs are dropped first (leaf-first truncation priority).",def:"65536 (64 KB)",artifactAffecting:!1},{path:"browser.enable",type:"boolean",editor:"toggle",description:"Explicit on/off for the browser cycle. Written false by `browser disable`, stripped by `browser enable`. When false the cycle is disabled regardless of patterns.",def:"(absent \u2192 on; browser is the only default-on cycle)",artifactAffecting:!0},{path:"browser.verifyPatterns",type:"string-array",editor:"string-list",description:"Glob patterns for files requiring browser verification. Four-state: absent \u2192 code defaults (40+ extensions); [] \u2192 hard kill; non-empty \u2192 custom patterns (replaces defaults).",def:"40+ code extensions when unset; [] hard-disables",artifactAffecting:!0},{path:"browser.additionalVerifyPatterns",type:"string-array",editor:"string-list",description:"Extra patterns appended to browser.verifyPatterns (or to code defaults when verifyPatterns is unset). Ignored when verifyPatterns is [] (hard kill wins).",def:"[]",artifactAffecting:!0},{path:"browser.alwaysRequired",type:"string-array",editor:"string-list",description:"Browser-cycle required tools (all-of). The verify-gate blocks completion until every listed bdt_* tool was used.",def:"bdt_navigation_go-to, bdt_content_take-screenshot, bdt_a11y_take-aria-snapshot, bdt_o11y_get-console-messages",artifactAffecting:!0},{path:"browser.evidencePaths",type:"json",editor:"json",description:"Alternative tool-satisfaction paths (any-of). Browser uses pure all-of, so default is empty. Each path: { name, allOf: (string | { anyOf: string[] })[] }.",def:"[]",artifactAffecting:!0},{path:"node.enable",type:"boolean",editor:"toggle",description:"Explicit on/off for the Node.js runtime debug cycle (node-devtools, ndt_* V8 inspector probes). Opt-in \u2014 written by `node enable`.",def:"(absent \u2192 off; node is opt-in)",artifactAffecting:!0},{path:"node.verifyPatterns",type:"string-array",editor:"string-list",description:"Glob patterns for the Node.js runtime debug cycle. Default-off \u2014 block absent = inert. Block present + unset \u2192 9 code defaults (server/api/routes paths).",def:"block absent \u2192 disabled; present + unset \u2192 code defaults",artifactAffecting:!0},{path:"node.additionalVerifyPatterns",type:"string-array",editor:"string-list",description:"Extra patterns appended to node.verifyPatterns (or to code defaults when unset). Ignored when verifyPatterns is [].",def:"[]",artifactAffecting:!0},{path:"node.alwaysRequired",type:"string-array",editor:"string-list",description:"Node-cycle required tools (all-of). ndt_debug_connect always; evidence paths supply the rest.",def:"[ndt_debug_connect]",artifactAffecting:!0},{path:"node.evidencePaths",type:"json",editor:"json",description:"Alternative tool paths (any-of). Default: probe path (a put-*point AND get-probe-snapshots) OR log path (get-logs).",def:"probe path + log path",artifactAffecting:!0},{path:"backend.enable",type:"boolean",editor:"toggle",description:"Explicit on/off for the runtime-agnostic backend protocol cycle (backend-devtools, bedt_* HTTP/gRPC/GraphQL/WebSocket). Opt-in \u2014 written by `backend enable`.",def:"(absent \u2192 off; backend is opt-in)",artifactAffecting:!0},{path:"backend.verifyPatterns",type:"string-array",editor:"string-list",description:"Glob patterns for the backend protocol cycle. Default-off \u2014 block absent = inert. Block present + unset \u2192 13 multi-language code defaults (ts/js/py/go/java/rb/cs/rs/kt/scala/ex/php/clj).",def:"block absent \u2192 disabled; present + unset \u2192 code defaults",artifactAffecting:!0},{path:"backend.additionalVerifyPatterns",type:"string-array",editor:"string-list",description:"Extra patterns appended to backend.verifyPatterns (or to code defaults when unset). Ignored when verifyPatterns is [].",def:"[]",artifactAffecting:!0},{path:"backend.alwaysRequired",type:"string-array",editor:"string-list",description:"Backend-cycle required tools (all-of). Empty by default \u2014 backend uses any-of evidence paths instead.",def:"[]",artifactAffecting:!0},{path:"backend.evidencePaths",type:"json",editor:"json",description:"Alternative tool paths (any-of). Default three: protocol-call (any request tool) OR log-evidence (register-source + read) OR db-evidence (db_connect + a read op).",def:"protocol-call OR log-evidence OR db-evidence",artifactAffecting:!0},{path:"android.enable",type:"boolean",editor:"toggle",description:"Explicit on/off for the Android mobile verification cycle (android-devtools, adt_* device/emulator interaction). Opt-in \u2014 written by `android enable`.",def:"(absent \u2192 off; android is opt-in)",artifactAffecting:!0},{path:"android.verifyPatterns",type:"string-array",editor:"string-list",description:"Glob patterns for the Android mobile verification cycle. Default-off \u2014 block absent = inert. Block present + unset \u2192 code defaults (Android/React Native paths).",def:"block absent \u2192 disabled; present + unset \u2192 code defaults",artifactAffecting:!0},{path:"android.additionalVerifyPatterns",type:"string-array",editor:"string-list",description:"Extra patterns appended to android.verifyPatterns (or to code defaults when unset). Ignored when verifyPatterns is [].",def:"[]",artifactAffecting:!0},{path:"android.alwaysRequired",type:"string-array",editor:"string-list",description:"Android-cycle required tools (all-of). adt_device_connect always; evidence paths supply the rest.",def:"[adt_device_connect]",artifactAffecting:!0},{path:"android.evidencePaths",type:"json",editor:"json",description:"Alternative tool paths (any-of). Default two: device-evidence (UI interaction + screenshot + UI snapshot) OR log-evidence (Logcat read/follow).",def:"device-evidence OR log-evidence",artifactAffecting:!0},{path:"collector.enable",type:"boolean",editor:"toggle",description:"Master switch for the IronBee Collector. Implicitly true when the section has url and at least one credential (oauthToken or apiKey); set false to suspend while keeping url/oauthToken/apiKey/batchSize around.",def:"implicit true when url + (oauthToken or apiKey) set",artifactAffecting:!0},{path:"collector.url",type:"string",editor:"text",description:"Remote collector endpoint URL (IronBee Platform). Required for the collector to be active. Events POST to {url}/v1/events.",def:"(unset \u2192 disabled)",artifactAffecting:!0},{path:"collector.oauthToken",type:"string",editor:"text",description:"Personal access token for collector auth (X-OAuth-Token header). Per-(user, account), independently revocable from the console's /access-tokens page. Minted by `ironbee login` \u2014 the primary path for interactive CLI use. Can be supplied via IRONBEE_OAUTH_TOKEN.",def:"(unset)",artifactAffecting:!0},{path:"collector.apiKey",type:"string",editor:"text",description:"Shared account API key for collector auth (X-API-Key header). Parallel first-class path alongside `oauthToken`, intended for CI / GitHub Actions / deployment tooling and other non-interactive integrations where rotating a per-engineer OAuth token is impractical. Either `oauthToken` OR `apiKey` is required for the collector to be active. Can be supplied via IRONBEE_API_KEY.",def:"(unset \u2192 disabled)",artifactAffecting:!0},{path:"collector.batchSize",type:"number",editor:"number",description:"Max events per POST from the send_event handler (the queue chunks bigger snapshots into N-sized POSTs).",def:"100",artifactAffecting:!0},{path:"collector.timeoutMs",type:"number",editor:"number",description:"Per-request HTTP timeout (ms) for batched analytics sends. Single-event interactive sends keep a fixed 3000ms cap. Clamped to [1000, 60000].",def:"10000",artifactAffecting:!0},{path:"recording.enable",type:"boolean",editor:"toggle",description:"Recording enforcement for the browser + android cycles. Presence opts in; enable:false opts out. Auto-enabled when a collector is configured. Node/backend cycles never trigger recording.",def:"implicit true when section present or collector configured",artifactAffecting:!1},{path:"jobQueue.enable",type:"boolean",editor:"toggle",description:"Master switch for the file-backed job queue. Presence opts in; enable:false opts out. Auto-enabled when a collector is configured (a collector is pointless without a queue feeding it).",def:"implicit true when section present or collector configured",artifactAffecting:!1},{path:"jobQueue.autoFlushSizeBytes",type:"number",editor:"number",description:"Size threshold (bytes) above which submit() spawns a detached worker mid-session. 0 / negative disables this check.",def:"32768 (32 KB)",artifactAffecting:!1},{path:"jobQueue.autoFlushIntervalSeconds",type:"number",editor:"number",description:"Interval threshold (seconds since the live jobs.jsonl was created) above which submit() spawns a detached worker. Complements size \u2014 whichever crosses first flushes. 0 / negative disables.",def:"60",artifactAffecting:!1},{path:"analytics.enable",type:"boolean",editor:"toggle",description:"Master switch for per-session structural analytics. Presence opts in; enable:false opts out. Auto-enabled when a collector is configured.",def:"implicit true when section present or collector configured",artifactAffecting:!1},{path:"analytics.emitOnStop",type:"boolean",editor:"toggle",description:"When true, project + emit analytics at every Stop hook. When false, only at SessionEnd.",def:"true",artifactAffecting:!1},{path:"analytics.emitOnStopMinIntervalSeconds",type:"number",editor:"number",description:"Throttle: skip Stop-hook projection if the last successful emit was within this many seconds. 0 disables the throttle (backend handles rate-limit / dedupe).",def:"0 (disabled)",artifactAffecting:!1},{path:"analytics.emitTurnEvents",type:"boolean",editor:"toggle",description:"Opt-in for per-turn session_turn_analytics wire records. High-volume secondary signal; the base session_analytics record always ships regardless.",def:"false",artifactAffecting:!1},{path:"analytics.emitStepEvents",type:"boolean",editor:"toggle",description:"Opt-in for per-step session_turn_step_analytics wire records (an order of magnitude higher volume than turn events). Independent of emitTurnEvents.",def:"false",artifactAffecting:!1},{path:"analytics.emitApiRequestEvents",type:"boolean",editor:"toggle",description:"Opt-OUT for per-API-request api_request wire records (one per assistant message, success + failure). Primary value for backend cost accounting, so ships by default.",def:"true",artifactAffecting:!1},{path:"statusLine.enable",type:"boolean",editor:"toggle",description:"Master switch for the Claude statusline integration (session_status event + statusline wrapper). Presence opts in; auto-enabled when a collector is configured. Claude-only.",def:"implicit true when section present or collector configured",artifactAffecting:!0},{path:"statusLine.renderDefault",type:"boolean",editor:"toggle",description:"When there is no upstream statusline to chain to, false keeps the statusline silent; true renders a minimal model + context-% line. No effect when the user already has a statusline.",def:"false",artifactAffecting:!0},{path:"statusLine.emitMinIntervalSeconds",type:"number",editor:"number",description:"Minimum seconds between two emitted session_status events, on top of skip-if-unchanged. Rapid changes coalesce to the latest state after the interval. 0 disables the throttle. Read live each tick.",def:"10",artifactAffecting:!0},{path:"statusLine.refreshInterval",type:"number",editor:"number",description:"Claude Code's own statusLine.refreshInterval (seconds, host min 1) \u2014 re-runs the statusline on a timer in addition to event-driven updates. Unset by default. Values < 1 treated as unset.",def:"unset",artifactAffecting:!0},{path:"claude.oauthAccess.enable",type:"boolean",editor:"toggle",description:"Whether IronBee may read the Claude Code OAuth token (macOS Keychain / ~/.claude/.credentials.json) and call OAuth-scoped Anthropic endpoints. Default-on (opt out with false or `ironbee claude oauth-access disable`). First consumer: the statusline rate-limit fallback \u2014 fetches /api/oauth/usage to fill rate_limits for plans the statusline JSON omits them for (team / enterprise). Claude-only; not artifact-affecting (read live).",def:"true",artifactAffecting:!1},{path:"claude.oauthAccess.usageTtlSeconds",type:"number",editor:"number",description:"TTL (seconds) for the statusline OAuth rate-limit fetch cache \u2014 the /api/oauth/usage call + credential read fire at most once per this interval even when the statusline ticks far more often. Default 60; 0 means every tick.",def:"60",artifactAffecting:!1},{path:"claude.autoModeAllowlist.enable",type:"boolean",editor:"toggle",description:"Whether IronBee writes the auto-mode allowlist carve-out for the verifier into .claude/settings.local.json. Claude Code 2.1.176+ ships a host-side sub-agent \"Content Integrity\" classifier (auto mode) that false-positives on IronBee's legitimate `ironbee hook submit-verdict` verdicts (the devtools calls happened earlier in the cycle, not re-shown in the handoff). When enabled (default), install adds a narrow, command-keyed autoMode.allow rule that exempts ONLY that command from the Content Integrity block ($defaults preserved \u2014 every other block rule still applies; IronBee's Stop-gate independently enforces real tool usage). Written only when verification is active (enforce/assist); inert when the host isn't in auto mode. Opt out with false \u2014 takes effect on the next `ironbee install`. Claude-only.",def:"true",artifactAffecting:!1},{path:"codex.verifier.mode",type:"string",editor:"enum",enumValues:["sub-agent","main-agent"],description:'How the Codex verification cycle is driven (Codex-only). "sub-agent" (default) delegates to the ironbee-verifier custom agent (per-agent MCP, SubagentStart bridge, slim delegation skill/rule/command). "main-agent" makes the MAIN agent drive the devtools tools directly (session-level [mcp_servers.*], no verifier agent, inline skill/rule/command) \u2014 the Cursor-style fallback for when Codex\'s sub-agent machinery regresses. Re-renders the Codex client. Toggle via `ironbee codex verifier mode <sub-agent|main-agent>`.',def:"sub-agent",artifactAffecting:!0},{path:"telemetry.enable",type:"boolean",editor:"toggle",description:"Master switch for anonymous PostHog telemetry (CLI's own product analytics). Inverse semantics \u2014 opt out with false. Disabling also injects TELEMETRY_ENABLE=false into devtools MCP env. Orthogonal to the collector pipeline.",def:"true",artifactAffecting:!0},{path:"privacy.enable",type:"boolean",editor:"toggle",description:"Privacy mode \u2014 a single cross-cutting switch (all platforms) that redacts potentially sensitive data from what the @ironbee-ai/devtools MCP servers ship to the collector. Opt-in, default OFF. When true, injects COLLECTOR_EVENTS_TOOL_DETAILS_ENABLE=false (tool input/output detail) + COLLECTOR_ARTIFACTS_ENABLE=false (screenshots, recordings) into every devtools MCP env. Devtools-side only \u2014 the CLI's own send_event pipeline already whitelists tool_input and strips tool_response. Orthogonal to telemetry (PostHog) and collector (the sink).",def:"false",artifactAffecting:!0},{path:"otel.enable",type:"boolean",editor:"toggle",description:"Master switch for the local OTEL collector pipeline (Claude Code OTLP raw-API-body export \u2192 local daemon \u2192 session_context context-usage events). Presence opts in; enable:false opts out; auto-enabled when a collector is configured. session_context derivation is the sole consumer, so this also gates whether the settings.json OTEL env block (incl. raw-bodies) is written. Orthogonal to telemetry (PostHog) and collector (event sink).",def:"implicit true when collector configured",artifactAffecting:!0},{path:"otel.port",type:"number",editor:"number",description:"Loopback port the shared OTEL collector daemon binds to, and which the settings.json OTEL endpoint env var points at. One daemon per machine across all sessions.",def:"15986",artifactAffecting:!0},{path:"otel.idleTimeoutSeconds",type:"number",editor:"number",description:"The daemon self-reaps (graceful shutdown) after this many seconds with no /health hit and no OTLP event. Restarted on the next session/turn ensure.",def:"600",artifactAffecting:!0},{path:"otel.ensureMinIntervalSeconds",type:"number",editor:"number",description:"Throttle (seconds) for the high-frequency liveness `ensure` from per-tool hooks, so we don't pay a /health check on every tool call. session-start / activity-start ensure are unthrottled.",def:"30",artifactAffecting:!0},{path:"otel.emitMinIntervalSeconds",type:"number",editor:"number",description:"Per-session session_context emit throttle: admit at most one event per session per interval (leading-edge \u2014 the first request in each window is emitted, in-between requests are coalesced away and their body files dropped). Applies to the live path only; the catch-up/reprocess path is never throttled. 0 = emit on every API request (full context-growth time series).",def:"0",artifactAffecting:!0},{path:"fileChange.captureChangeset",type:"boolean",editor:"toggle",description:"When true, every file_change event carries a hunks-only unified-diff changeset string. Off by default \u2014 the default wire shape stays metadata-only (operation + line counts).",def:"false",artifactAffecting:!1},{path:"fileChange.maxChangesetBytes",type:"number",editor:"number",description:"Hard cap on the changeset string size. Diffs over the cap are truncated with a footer so the collector POST stays within typical reverse-proxy body limits.",def:"65536 (64 KB)",artifactAffecting:!1},{path:"import.concurrency",type:"number",editor:"number",description:"Default number of sessions `ironbee import` processes in parallel. Resolution: --concurrency flag > this value > built-in default. Clamped to [1, 32].",def:"4",artifactAffecting:!1},{path:"browserDevTools.env",type:"json",editor:"json",description:"Env-var overrides merged into the browser-devtools MCP server entry. Operators can override individual OTEL keys; IronBee invariants (TOOL_NAME_PREFIX, \u2026) always win last.",def:"unset (defaults + auto-OTEL when collector configured)",artifactAffecting:!0},{path:"browserDevTools.mcp",type:"json",editor:"json",description:"Full-replacement MCP config for the browser-devtools server entry. Auto-OTEL + telemetry env are still injected; IronBee env wins last.",def:"unset (use default npx -y @ironbee-ai/devtools entry)",artifactAffecting:!0},{path:"nodeDevTools.env",type:"json",editor:"json",description:"Env-var overrides merged into the node-devtools MCP server entry. Same auto-OTEL injection as browserDevTools minus the browser-only vars.",def:"unset (defaults + auto-OTEL when collector configured)",artifactAffecting:!0},{path:"nodeDevTools.mcp",type:"json",editor:"json",description:"Full-replacement MCP config for the node-devtools server entry. IronBee env wins last.",def:"unset (use default npx -y @ironbee-ai/devtools entry)",artifactAffecting:!0},{path:"backendDevTools.env",type:"json",editor:"json",description:"Env-var overrides merged into the backend-devtools MCP server entry. Same auto-OTEL injection as nodeDevTools.",def:"unset (defaults + auto-OTEL when collector configured)",artifactAffecting:!0},{path:"backendDevTools.mcp",type:"json",editor:"json",description:"Full-replacement MCP config for the backend-devtools server entry. IronBee env wins last.",def:"unset (use default npx -y @ironbee-ai/devtools entry)",artifactAffecting:!0},{path:"androidDevTools.env",type:"json",editor:"json",description:"Env-var overrides merged into the android-devtools MCP server entry. Same auto-OTEL injection as nodeDevTools.",def:"unset (defaults + auto-OTEL when collector configured)",artifactAffecting:!0},{path:"androidDevTools.mcp",type:"json",editor:"json",description:"Full-replacement MCP config for the android-devtools server entry. IronBee env wins last.",def:"unset (use default npx -y @ironbee-ai/devtools entry)",artifactAffecting:!0}];function A(e){return d.find(t=>t.path===e)}n(A,"findSchemaEntry");function k(){return[...d].sort((e,t)=>{const o=l(c(e.path)),i=l(c(t.path));return o!==i?o-i:e.path.localeCompare(t.path)})}n(k,"orderedEntries");0&&(module.exports={ARTIFACT_AFFECTING_TOP_KEYS,CONFIG_SCHEMA,GROUP_ORDER,GROUP_TITLES,findSchemaEntry,groupOf,groupRank,groupTitle,orderedEntries,topKey});
@@ -1,4 +1,4 @@
1
- "use strict";var ye=Object.create;var S=Object.defineProperty;var pe=Object.getOwnPropertyDescriptor;var he=Object.getOwnPropertyNames;var be=Object.getPrototypeOf,me=Object.prototype.hasOwnProperty;var r=(n,o)=>S(n,"name",{value:o,configurable:!0});var ve=(n,o)=>{for(var p in o)S(n,p,{get:o[p],enumerable:!0})},q=(n,o,p,y)=>{if(o&&typeof o=="object"||typeof o=="function")for(let g of he(o))!me.call(n,g)&&g!==p&&S(n,g,{get:()=>o[g],enumerable:!(y=pe(o,g))||y.enumerable});return n};var we=(n,o,p)=>(p=n!=null?ye(be(n)):{},q(o||!n||!n.__esModule?S(p,"default",{value:n,enumerable:!0}):p,n)),je=n=>q(S({},"__esModule",{value:!0}),n);var Ee={};ve(Ee,{projectsArea:()=>Ce});module.exports=je(Ee);var V=we(require("blessed")),D=require("fs"),G=require("path"),b=require("../../clients/registry"),U=require("../../commands/install"),Y=require("../../commands/cycle-toggle"),w=require("../../commands/mode-select"),z=require("../../commands/uninstall"),v=require("../../lib/config"),m=require("../../lib/projects-registry"),f=require("../shell/util");const A=6;function u(n){const o=n.replace(/[/\\]+$/,"").split(/[/\\]/);return o[o.length-1]||n}r(u,"basename");function $e(n){const o=n.session.launchDir;function p(e){try{return(0,m.canonicalizePath)(e)}catch{return e}}r(p,"safeCanonical");const y=p(o);let g=(0,m.listProjects)(),$=Math.max(0,g.findIndex(e=>e.path===y)),T=p(n.session.projectDir),h="cwd";const P=V.box({parent:n.container,top:0,left:0,width:"100%",height:A,border:{type:"line"},label:" Current directory ",tags:!0,style:{border:{fg:"yellow"}},content:""}),d=V.list({parent:n.container,top:A,left:0,width:"52%",height:`100%-${A}`,border:{type:"line"},label:" Registered projects ",tags:!0,keys:!1,mouse:!1,invertSelected:!1,scrollbar:{ch:" "},style:{selected:{bg:"blue"},border:{fg:"cyan"}},items:[]}),L=V.box({parent:n.container,top:A,left:"52%",width:"48%",height:`100%-${A}`,border:{type:"line"},label:" Detail ",tags:!0,scrollable:!0,alwaysScroll:!0,scrollbar:{ch:" "},style:{border:{fg:"cyan"}},content:""});function I(){return g.length===0?void 0:g[(0,f.clamp)($,0,g.length-1)]}r(I,"selected");function E(e){return(0,b.detectClients)(e).map(i=>i.name).join(", ")}r(E,"detectedNames");function M(e){return e===T||p(e)===T}r(M,"isActive");function X(e){const s=(0,b.isProjectActive)(e)?"{green-fg}\u25CF{/green-fg}":"{red-fg}\u25CB{/red-fg}";return`${M(e.path)?"{yellow-fg}\u2605{/yellow-fg} ":" "}${s} ${(0,f.escapeTags)(u(e.path))} {gray-fg}${(0,f.escapeTags)(E(e.path))}{/gray-fg}`}r(X,"rowLabel");function B(){return{installed:E(o),registered:g.some(e=>e.path===y),active:M(y)}}r(B,"cwdState");function j(e,i){return i?`{bold}${e}{/bold}`:`{gray-fg}${e}{/gray-fg}`}r(j,"keyLabel");function J(){const{installed:e,registered:i,active:s}=B(),t=e.length>0,c=[];c.push(t?`{green-fg}\u25CF installed{/green-fg} {gray-fg}(${(0,f.escapeTags)(e)}){/gray-fg}`:"{gray-fg}\u25CB not installed{/gray-fg}"),c.push(i?"{green-fg}registered{/green-fg}":"{gray-fg}not registered{/gray-fg}"),c.push(s?"{yellow-fg}\u2605 active project{/yellow-fg}":"{gray-fg}not the active project{/gray-fg}");const a=`${j("i install",!t)} ${j("x uninstall",t)} {gray-fg}\xB7{/gray-fg} ${j("a register",!i)} ${j("d unregister",i)} {gray-fg}\xB7{/gray-fg} ${j("c make active",!s)}`,l=[];return l.push(`{bold}${(0,f.escapeTags)(o)}{/bold}`),l.push(c.join(" {gray-fg}\xB7{/gray-fg} ")),l.push(a),l.join(`
2
- `)}r(J,"buildCwdPanel");function K(){const e="{bold}Tab{/bold} switch section {bold}I/X{/bold} all {bold}r{/bold} refresh {bold}Esc/q{/bold}";let i;if(h==="cwd"){const{installed:s,registered:t}=B(),c=s.length>0;i=`{cyan-fg}cwd:{/cyan-fg} ${j("i install",!c)} ${j("x uninstall",c)} ${j("a register",!t)} ${j("d unregister",t)} {bold}c{/bold} make active`}else i="{bold}\u2191/\u2193{/bold} move {bold}Enter{/bold} switch {bold}i{/bold} install {bold}x{/bold} uninstall {bold}d{/bold} unregister";return` ${i} {gray-fg}\u2502{/gray-fg} ${e}`}r(K,"buildStatus");function Z(e){if(e===void 0){const c=E(o).length>0,a=[];return a.push("{gray-fg}No projects registered yet.{/gray-fg}"),a.push(""),a.push("{gray-fg}Use the {/gray-fg}{bold}Current directory{/bold}{gray-fg} panel above:{/gray-fg}"),a.push(c?"{bold}x{/bold} {gray-fg}\u2014 uninstall IronBee from here (removes hooks + guidance){/gray-fg}":"{bold}i{/bold} {gray-fg}\u2014 install IronBee here (writes hooks + guidance, registers it){/gray-fg}"),a.push("{bold}a{/bold} {gray-fg}\u2014 register here only (inventory, no artifact writes){/gray-fg}"),a.join(`
3
- `)}const i=(0,b.isProjectActive)(e),s=(0,v.getConfigLayerPaths)(e.path),t=[];return t.push(`{bold}${(0,f.escapeTags)(u(e.path))}{/bold}`),t.push("{gray-fg}"+"\u2500".repeat(46)+"{/gray-fg}"),t.push(`{gray-fg}path:{/gray-fg} ${(0,f.escapeTags)(e.path)}`),t.push(`{gray-fg}detected:{/gray-fg} ${(0,f.escapeTags)(E(e.path))||"(none on disk)"}`),t.push(`{gray-fg}added:{/gray-fg} ${(0,f.escapeTags)(e.installedAt)}`),t.push(`{gray-fg}on disk:{/gray-fg} ${i?"{green-fg}detected{/green-fg}":"{red-fg}stale (artifacts not detected){/red-fg}"}`),t.push(""),t.push("{bold}config layers{/bold}"),t.push(` {gray-fg}global {/gray-fg} ${(0,f.escapeTags)(s.global)}`),t.push(` {gray-fg}project{/gray-fg} ${(0,f.escapeTags)(s.project??"-")}`),t.push(` {gray-fg}local {/gray-fg} ${(0,f.escapeTags)(s.local??"-")}`),t.push(""),M(e.path)?(t.push("{yellow-fg}\u2605 active project{/yellow-fg} \u2014 Config / Sessions / Queue target this."),t.push("{gray-fg}c (in the cwd panel) = unselect \u2192 back to the current directory{/gray-fg}")):t.push("{gray-fg}Enter/s = make active (Config / Sessions / Queue switch to it){/gray-fg}"),t.push("{gray-fg}i = install \xB7 x = uninstall (pick a client when >1 registered; runs here, blocking){/gray-fg}"),t.join(`
4
- `)}r(Z,"buildDetail");function W(e,i){const s=e.style;s.border!==void 0&&(s.border.fg=i)}r(W,"setBorderFg");function x(){const e=h==="cwd";P.setLabel(e?" {yellow-fg}\u25B8 Current directory{/yellow-fg} ":" Current directory "),d.setLabel(e?" Registered projects ":" {yellow-fg}\u25B8 Registered projects{/yellow-fg} "),W(P,e?"yellow":"gray"),W(d,e?"gray":"yellow"),W(L,e?"gray":"cyan");const i=d.style.selected??{};i.bg=e?void 0:"blue",i.fg=void 0}r(x,"applyFocusStyles");function k(){T=p(n.session.projectDir),n.setStatus(K()),x(),P.setContent(J()),g.length===0?d.setItems(["{gray-fg}(no registered projects){/gray-fg}"]):(d.setItems(g.map(e=>X(e))),d.select((0,f.clamp)($,0,g.length-1))),L.setContent(Z(I())),L.setScroll(0),n.screen.render()}r(k,"render");function H(){h=h==="cwd"?"list":"cwd",k()}r(H,"toggleSection");function C(e){if(g=(0,m.listProjects)(),e!==void 0){const i=g.findIndex(s=>s.path===e);i>=0&&($=i)}$=(0,f.clamp)($,0,Math.max(0,g.length-1)),k()}r(C,"refresh");function _(e){g.length!==0&&($=(0,f.clamp)($+e,0,g.length-1),k())}r(_,"move");function ee(){try{(0,m.upsertProject)(o),C(y),n.session.message(`Registered ${u(o)} in the inventory. Use d to unregister, i to install.`)}catch(e){n.session.message(`Register failed: ${e instanceof Error?e.message:String(e)}`)}}r(ee,"registerCwd");function ne(){n.session.confirm(`Unregister ${u(o)}? (inventory only, no files touched)`,e=>{if(e)try{(0,m.removeProject)(o),C()}catch(i){n.session.message(`Unregister failed: ${i instanceof Error?i.message:String(i)}`)}})}r(ne,"unregisterCwd");function te(){if(g.some(e=>e.path===y)){n.session.message(`${u(o)} is already registered \u2014 press d to unregister.`);return}ee()}r(te,"cwdRegister");function ie(){if(!g.some(e=>e.path===y)){n.session.message(`${u(o)} is not registered \u2014 nothing to unregister.`);return}ne()}r(ie,"cwdUnregister");function O(){if(M(y)){n.session.message(`The current directory (${u(o)}) is already the active project.`);return}n.setActiveProject(y);const e=g.findIndex(i=>i.path===y);e>=0&&($=e),k(),n.session.message(`Active project \u2192 current directory (${u(o)}). Any switched project is unselected.`)}r(O,"setActiveToCwd");function re(e,i){const s=n.session.silently(()=>(0,w.resolveInstallDefaultMode)(e)),t=[s,...w.ALL_MODES.filter(a=>a!==s)],c=t.map(a=>`${w.MODE_LABELS[a]} \u2014 ${w.MODE_HINTS[a]}`);n.session.pick("Which verification mode?",c,a=>{if(a<0){i("cancel");return}i(t[a])})}r(re,"chooseMode");function oe(e,i,s){if(i==="monitor"){s(void 0);return}const t=n.session.silently(()=>(0,v.loadConfig)(e)),c=v.ALL_CYCLES.map(l=>`${l} \u2014 ${U.CYCLE_HINTS[l]}`),a=v.ALL_CYCLES.map((l,R)=>(0,v.isCyclePatternsActive)(t,l)?R:-1).filter(l=>l>=0);n.session.pickMulti("Which platforms should require verification?",c,a,l=>{if(l===null){s("cancel");return}s(l.map(R=>v.ALL_CYCLES[R]))})}r(oe,"choosePlatforms");function N(e,i,s){Q(i,t=>{re(e,c=>{c!=="cancel"&&oe(e,c,a=>{a!=="cancel"&&n.session.runWithOutput(`Install ${u(e)} (${t.map(l=>l.name).join(", ")})`,()=>{(0,w.applyModeToLayer)(e,"project",c),a!==void 0&&(0,Y.reconcileCyclesInLayer)(e,"project",a,!0);for(const l of t)l.install(e);(0,m.upsertProject)(e)}).then(()=>C(s))})})})}r(N,"doInstall");function F(e,i){Q("Uninstall which client?",s=>{n.session.confirm(`Uninstall ${s.map(t=>t.name).join(", ")} from ${u(e)}?`,t=>{t&&n.session.runWithOutput(`Uninstall ${u(e)} (${s.map(c=>c.name).join(", ")})`,()=>{const c=new Set(s.map(l=>l.name));for(const l of s)l.uninstall(e);if(!b.REGISTERED_CLIENTS.some(l=>!c.has(l.name)&&l.detect(e))){const l=(0,G.join)(e,".ironbee");(0,D.existsSync)(l)&&(0,D.rmSync)(l,{recursive:!0,force:!0}),(0,m.removeProject)(e)}}).then(()=>C(i))})})}r(F,"doUninstall");function se(){if(E(o).length>0){n.session.message(`${u(o)} is already installed \u2014 press x to uninstall.`);return}N(o,"Install into the current directory \u2014 which client?",y)}r(se,"cwdInstall");function le(){if(E(o).length===0){n.session.message(`${u(o)} is not installed \u2014 nothing to uninstall.`);return}F(o,y)}r(le,"cwdUninstall");function ae(){const e=I();e!==void 0&&(n.setActiveProject(e.path),k(),n.session.message(`Active project \u2192 ${u(e.path)}. Config / Sessions / Queue now target it.`))}r(ae,"switchTo");function ge(){const e=I();e!==void 0&&n.session.confirm(`Unregister ${u(e.path)}? (inventory only, no files touched)`,i=>{if(i)try{(0,m.removeProject)(e.path),C()}catch(s){n.session.message(`Unregister failed: ${s instanceof Error?s.message:String(s)}`)}})}r(ge,"unregisterSelected");function Q(e,i){if(b.REGISTERED_CLIENTS.length<=1){i(b.REGISTERED_CLIENTS);return}const s=b.REGISTERED_CLIENTS.map(t=>t.name);n.session.pick(e,["All clients",...s],t=>{t<0||i(t===0?b.REGISTERED_CLIENTS:[b.REGISTERED_CLIENTS[t-1]])})}r(Q,"pickClient");function de(){const e=I();e!==void 0&&N(e.path,"Install which client?")}r(de,"installSelected");function ce(){const e=I();e!==void 0&&F(e.path)}r(ce,"uninstallSelected");async function fe(){await n.session.runWithOutput("Install \u2014 all registered projects",async()=>{await(0,U.runInstallAll)({})}),C()}r(fe,"installAll");function ue(){n.session.confirm("Uninstall IronBee from ALL registered projects? (destructive)",e=>{e&&n.session.runWithOutput("Uninstall \u2014 all registered projects",async()=>{await(0,z.runUninstallAll)({yes:!0})}).then(()=>C())})}return r(ue,"uninstallAllFlow"),d.key(["tab"],()=>H()),d.key(["S-tab"],()=>H()),d.key(["up","k"],()=>{h==="list"&&_(-1)}),d.key(["down","j"],()=>{h==="list"&&_(1)}),d.key(["i"],()=>{h==="cwd"?se():de()}),d.key(["x"],()=>{h==="cwd"?le():ce()}),d.key(["d"],()=>{h==="cwd"?ie():ge()}),d.key(["a"],()=>{h==="cwd"&&te()}),d.key(["c"],()=>{h==="cwd"&&O()}),d.key(["enter","s"],()=>{h==="list"?ae():O()}),d.key(["S-i"],()=>{fe()}),d.key(["S-x"],()=>ue()),d.key(["r"],()=>C()),k(),d.focus(),n.screen.render(),{unmount(){P.destroy(),d.destroy(),L.destroy()}}}r($e,"mountProjectsView");const Ce={id:"projects",title:"Projects",summary:"Registry \u2014 switch active \xB7 register / unregister \xB7 install / uninstall (+ --all)",mount(n){return $e(n)}};0&&(module.exports={projectsArea});
1
+ "use strict";var me=Object.create;var P=Object.defineProperty;var ve=Object.getOwnPropertyDescriptor;var we=Object.getOwnPropertyNames;var je=Object.getPrototypeOf,$e=Object.prototype.hasOwnProperty;var r=(n,o)=>P(n,"name",{value:o,configurable:!0});var Ce=(n,o)=>{for(var b in o)P(n,b,{get:o[b],enumerable:!0})},X=(n,o,b,y)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of we(o))!$e.call(n,a)&&a!==b&&P(n,a,{get:()=>o[a],enumerable:!(y=ve(o,a))||y.enumerable});return n};var Ee=(n,o,b)=>(b=n!=null?me(je(n)):{},X(o||!n||!n.__esModule?P(b,"default",{value:n,enumerable:!0}):b,n)),Ie=n=>X(P({},"__esModule",{value:!0}),n);var Ae={};Ce(Ae,{projectsArea:()=>Se});module.exports=Ie(Ae);var H=Ee(require("blessed")),U=require("fs"),J=require("path"),m=require("../../clients/registry"),R=require("../../commands/install"),K=require("../../commands/cycle-toggle"),f=require("../../commands/mode-select"),Z=require("../../commands/uninstall"),j=require("../../lib/config"),v=require("../../lib/projects-registry"),c=require("../shell/util");const L=6;function u(n){const o=n.replace(/[/\\]+$/,"").split(/[/\\]/);return o[o.length-1]||n}r(u,"basename");function ke(n){const o=n.session.launchDir;function b(e){try{return(0,v.canonicalizePath)(e)}catch{return e}}r(b,"safeCanonical");const y=b(o);let a=(0,v.listProjects)(),E=Math.max(0,a.findIndex(e=>e.path===y)),W=b(n.session.projectDir),h="cwd";const M=H.box({parent:n.container,top:0,left:0,width:"100%",height:L,border:{type:"line"},label:" Current directory ",tags:!0,style:{border:{fg:"yellow"}},content:""}),g=H.list({parent:n.container,top:L,left:0,width:"52%",height:`100%-${L}`,border:{type:"line"},label:" Registered projects ",tags:!0,keys:!1,mouse:!1,invertSelected:!1,scrollbar:{ch:" "},style:{selected:{bg:"blue"},border:{fg:"cyan"}},items:[]}),T=H.box({parent:n.container,top:L,left:"52%",width:"48%",height:`100%-${L}`,border:{type:"line"},label:" Detail ",tags:!0,scrollable:!0,alwaysScroll:!0,scrollbar:{ch:" "},style:{border:{fg:"cyan"}},content:""});function A(){return a.length===0?void 0:a[(0,c.clamp)(E,0,a.length-1)]}r(A,"selected");function k(e){return(0,m.detectClients)(e).map(t=>t.name).join(", ")}r(k,"detectedNames");function D(e){return e===W||b(e)===W}r(D,"isActive");function x(e){const s=(0,m.isProjectActive)(e)?"{green-fg}\u25CF{/green-fg}":"{red-fg}\u25CB{/red-fg}";return`${D(e.path)?"{yellow-fg}\u2605{/yellow-fg} ":" "}${s} ${(0,c.escapeTags)(u(e.path))} {gray-fg}${(0,c.escapeTags)(k(e.path))}{/gray-fg}`}r(x,"rowLabel");function _(){return{installed:k(o),registered:a.some(e=>e.path===y),active:D(y)}}r(_,"cwdState");function $(e,t){return t?`{bold}${e}{/bold}`:`{gray-fg}${e}{/gray-fg}`}r($,"keyLabel");function ee(){const{installed:e,registered:t,active:s}=_(),i=e.length>0,d=[];d.push(i?`{green-fg}\u25CF installed{/green-fg} {gray-fg}(${(0,c.escapeTags)(e)}){/gray-fg}`:"{gray-fg}\u25CB not installed{/gray-fg}"),d.push(t?"{green-fg}registered{/green-fg}":"{gray-fg}not registered{/gray-fg}"),d.push(s?"{yellow-fg}\u2605 active project{/yellow-fg}":"{gray-fg}not the active project{/gray-fg}");const p=`${$("i install",!i)} ${$("x uninstall",i)} {gray-fg}\xB7{/gray-fg} ${$("a register",!t)} ${$("d unregister",t)} {gray-fg}\xB7{/gray-fg} ${$("c make active",!s)}`,l=[];return l.push(`{bold}${(0,c.escapeTags)(o)}{/bold}`),l.push(d.join(" {gray-fg}\xB7{/gray-fg} ")),l.push(p),l.join(`
2
+ `)}r(ee,"buildCwdPanel");function ne(){const e="{bold}Tab{/bold} switch section {bold}I/X{/bold} all {bold}r{/bold} refresh {bold}Esc/q{/bold}";let t;if(h==="cwd"){const{installed:s,registered:i}=_(),d=s.length>0;t=`{cyan-fg}cwd:{/cyan-fg} ${$("i install",!d)} ${$("x uninstall",d)} ${$("a register",!i)} ${$("d unregister",i)} {bold}c{/bold} make active`}else t="{bold}\u2191/\u2193{/bold} move {bold}Enter{/bold} switch {bold}i{/bold} install {bold}x{/bold} uninstall {bold}d{/bold} unregister";return` ${t} {gray-fg}\u2502{/gray-fg} ${e}`}r(ne,"buildStatus");function te(e){if(e===void 0){const d=k(o).length>0,p=[];return p.push("{gray-fg}No projects registered yet.{/gray-fg}"),p.push(""),p.push("{gray-fg}Use the {/gray-fg}{bold}Current directory{/bold}{gray-fg} panel above:{/gray-fg}"),p.push(d?"{bold}x{/bold} {gray-fg}\u2014 uninstall IronBee from here (removes hooks + guidance){/gray-fg}":"{bold}i{/bold} {gray-fg}\u2014 install IronBee here (writes hooks + guidance, registers it){/gray-fg}"),p.push("{bold}a{/bold} {gray-fg}\u2014 register here only (inventory, no artifact writes){/gray-fg}"),p.join(`
3
+ `)}const t=(0,m.isProjectActive)(e),s=(0,j.getConfigLayerPaths)(e.path),i=[];return i.push(`{bold}${(0,c.escapeTags)(u(e.path))}{/bold}`),i.push("{gray-fg}"+"\u2500".repeat(46)+"{/gray-fg}"),i.push(`{gray-fg}path:{/gray-fg} ${(0,c.escapeTags)(e.path)}`),i.push(`{gray-fg}detected:{/gray-fg} ${(0,c.escapeTags)(k(e.path))||"(none on disk)"}`),i.push(`{gray-fg}added:{/gray-fg} ${(0,c.escapeTags)(e.installedAt)}`),i.push(`{gray-fg}on disk:{/gray-fg} ${t?"{green-fg}detected{/green-fg}":"{red-fg}stale (artifacts not detected){/red-fg}"}`),i.push(""),i.push("{bold}config layers{/bold}"),i.push(` {gray-fg}global {/gray-fg} ${(0,c.escapeTags)(s.global)}`),i.push(` {gray-fg}project{/gray-fg} ${(0,c.escapeTags)(s.project??"-")}`),i.push(` {gray-fg}local {/gray-fg} ${(0,c.escapeTags)(s.local??"-")}`),i.push(""),D(e.path)?(i.push("{yellow-fg}\u2605 active project{/yellow-fg} \u2014 Config / Sessions / Queue target this."),i.push("{gray-fg}c (in the cwd panel) = unselect \u2192 back to the current directory{/gray-fg}")):i.push("{gray-fg}Enter/s = make active (Config / Sessions / Queue switch to it){/gray-fg}"),i.push("{gray-fg}i = install \xB7 x = uninstall (pick a client when >1 registered; runs here, blocking){/gray-fg}"),i.join(`
4
+ `)}r(te,"buildDetail");function V(e,t){const s=e.style;s.border!==void 0&&(s.border.fg=t)}r(V,"setBorderFg");function ie(){const e=h==="cwd";M.setLabel(e?" {yellow-fg}\u25B8 Current directory{/yellow-fg} ":" Current directory "),g.setLabel(e?" Registered projects ":" {yellow-fg}\u25B8 Registered projects{/yellow-fg} "),V(M,e?"yellow":"gray"),V(g,e?"gray":"yellow"),V(T,e?"gray":"cyan");const t=g.style.selected??{};t.bg=e?void 0:"blue",t.fg=void 0}r(ie,"applyFocusStyles");function S(){W=b(n.session.projectDir),n.setStatus(ne()),ie(),M.setContent(ee()),a.length===0?g.setItems(["{gray-fg}(no registered projects){/gray-fg}"]):(g.setItems(a.map(e=>x(e))),g.select((0,c.clamp)(E,0,a.length-1))),T.setContent(te(A())),T.setScroll(0),n.screen.render()}r(S,"render");function O(){h=h==="cwd"?"list":"cwd",S()}r(O,"toggleSection");function I(e){if(a=(0,v.listProjects)(),e!==void 0){const t=a.findIndex(s=>s.path===e);t>=0&&(E=t)}E=(0,c.clamp)(E,0,Math.max(0,a.length-1)),S()}r(I,"refresh");function N(e){a.length!==0&&(E=(0,c.clamp)(E+e,0,a.length-1),S())}r(N,"move");function re(){try{(0,v.upsertProject)(o),I(y),n.session.message(`Registered ${u(o)} in the inventory. Use d to unregister, i to install.`)}catch(e){n.session.message(`Register failed: ${e instanceof Error?e.message:String(e)}`)}}r(re,"registerCwd");function oe(){n.session.confirm(`Unregister ${u(o)}? (inventory only, no files touched)`,e=>{if(e)try{(0,v.removeProject)(o),I()}catch(t){n.session.message(`Unregister failed: ${t instanceof Error?t.message:String(t)}`)}})}r(oe,"unregisterCwd");function se(){if(a.some(e=>e.path===y)){n.session.message(`${u(o)} is already registered \u2014 press d to unregister.`);return}re()}r(se,"cwdRegister");function le(){if(!a.some(e=>e.path===y)){n.session.message(`${u(o)} is not registered \u2014 nothing to unregister.`);return}oe()}r(le,"cwdUnregister");function F(){if(D(y)){n.session.message(`The current directory (${u(o)}) is already the active project.`);return}n.setActiveProject(y);const e=a.findIndex(t=>t.path===y);e>=0&&(E=e),S(),n.session.message(`Active project \u2192 current directory (${u(o)}). Any switched project is unselected.`)}r(F,"setActiveToCwd");function ae(e,t){const s=n.session.silently(()=>(0,f.resolveInstallDefaultMode)(e)),i=[s,...f.ALL_MODES.filter(w=>w!==s)],d=i.map(w=>`${f.MODE_LABELS[w]} \u2014 ${f.MODE_HINTS[w]}`),l=n.session.silently(()=>(0,f.resolveInstallDefaultStrict)(e))?[!0,!1]:[!1,!0],C=l.map(w=>`${f.STRICT_LABELS[w?"true":"false"]} \u2014 ${f.STRICT_HINTS[w?"true":"false"]}`),Y=r(()=>{n.session.pick("Which verification mode?",d,w=>{if(w<0){t("cancel");return}const B=i[w];if(B!=="enforce"){t(B);return}n.session.pick("How strict should verification be? ({cyan-fg}Esc{/cyan-fg} = back)",C,z=>{if(z<0){Y();return}t(B,l[z])})})},"askMode");Y()}r(ae,"chooseMode");function ge(e,t,s){if(t==="monitor"){s(void 0);return}const i=n.session.silently(()=>(0,j.loadConfig)(e)),d=j.ALL_CYCLES.map(l=>`${l} \u2014 ${R.CYCLE_HINTS[l]}`),p=j.ALL_CYCLES.map((l,C)=>(0,j.isCyclePatternsActive)(i,l)?C:-1).filter(l=>l>=0);n.session.pickMulti("Which platforms should require verification?",d,p,l=>{if(l===null){s("cancel");return}s(l.map(C=>j.ALL_CYCLES[C]))})}r(ge,"choosePlatforms");function Q(e,t,s){G(t,i=>{ae(e,(d,p)=>{d!=="cancel"&&ge(e,d,l=>{l!=="cancel"&&n.session.runWithOutput(`Install ${u(e)} (${i.map(C=>C.name).join(", ")})`,()=>{(0,f.applyModeToLayer)(e,"project",d,p),l!==void 0&&(0,K.reconcileCyclesInLayer)(e,"project",l,!0);for(const C of i)C.install(e);(0,v.upsertProject)(e)}).then(()=>I(s))})})})}r(Q,"doInstall");function q(e,t){G("Uninstall which client?",s=>{n.session.confirm(`Uninstall ${s.map(i=>i.name).join(", ")} from ${u(e)}?`,i=>{i&&n.session.runWithOutput(`Uninstall ${u(e)} (${s.map(d=>d.name).join(", ")})`,()=>{const d=new Set(s.map(l=>l.name));for(const l of s)l.uninstall(e);if(!m.REGISTERED_CLIENTS.some(l=>!d.has(l.name)&&l.detect(e))){const l=(0,J.join)(e,".ironbee");(0,U.existsSync)(l)&&(0,U.rmSync)(l,{recursive:!0,force:!0}),(0,v.removeProject)(e)}}).then(()=>I(t))})})}r(q,"doUninstall");function de(){if(k(o).length>0){n.session.message(`${u(o)} is already installed \u2014 press x to uninstall.`);return}Q(o,"Install into the current directory \u2014 which client?",y)}r(de,"cwdInstall");function ce(){if(k(o).length===0){n.session.message(`${u(o)} is not installed \u2014 nothing to uninstall.`);return}q(o,y)}r(ce,"cwdUninstall");function fe(){const e=A();e!==void 0&&(n.setActiveProject(e.path),S(),n.session.message(`Active project \u2192 ${u(e.path)}. Config / Sessions / Queue now target it.`))}r(fe,"switchTo");function ue(){const e=A();e!==void 0&&n.session.confirm(`Unregister ${u(e.path)}? (inventory only, no files touched)`,t=>{if(t)try{(0,v.removeProject)(e.path),I()}catch(s){n.session.message(`Unregister failed: ${s instanceof Error?s.message:String(s)}`)}})}r(ue,"unregisterSelected");function G(e,t){if(m.REGISTERED_CLIENTS.length<=1){t(m.REGISTERED_CLIENTS);return}const s=m.REGISTERED_CLIENTS.map(i=>i.name);n.session.pick(e,["All clients",...s],i=>{i<0||t(i===0?m.REGISTERED_CLIENTS:[m.REGISTERED_CLIENTS[i-1]])})}r(G,"pickClient");function ye(){const e=A();e!==void 0&&Q(e.path,"Install which client?")}r(ye,"installSelected");function pe(){const e=A();e!==void 0&&q(e.path)}r(pe,"uninstallSelected");async function be(){await n.session.runWithOutput("Install \u2014 all registered projects",async()=>{await(0,R.runInstallAll)({})}),I()}r(be,"installAll");function he(){n.session.confirm("Uninstall IronBee from ALL registered projects? (destructive)",e=>{e&&n.session.runWithOutput("Uninstall \u2014 all registered projects",async()=>{await(0,Z.runUninstallAll)({yes:!0})}).then(()=>I())})}return r(he,"uninstallAllFlow"),g.key(["tab"],()=>O()),g.key(["S-tab"],()=>O()),g.key(["up","k"],()=>{h==="list"&&N(-1)}),g.key(["down","j"],()=>{h==="list"&&N(1)}),g.key(["i"],()=>{h==="cwd"?de():ye()}),g.key(["x"],()=>{h==="cwd"?ce():pe()}),g.key(["d"],()=>{h==="cwd"?le():ue()}),g.key(["a"],()=>{h==="cwd"&&se()}),g.key(["c"],()=>{h==="cwd"&&F()}),g.key(["enter","s"],()=>{h==="list"?fe():F()}),g.key(["S-i"],()=>{be()}),g.key(["S-x"],()=>he()),g.key(["r"],()=>I()),S(),g.focus(),n.screen.render(),{unmount(){M.destroy(),g.destroy(),T.destroy()}}}r(ke,"mountProjectsView");const Se={id:"projects",title:"Projects",summary:"Registry \u2014 switch active \xB7 register / unregister \xB7 install / uninstall (+ --all)",mount(n){return ke(n)}};0&&(module.exports={projectsArea});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ironbee-ai/cli",
3
- "version": "0.28.0",
3
+ "version": "0.29.0",
4
4
  "description": "The CLI for IronBee — Verification and Intelligence Layer for Agentic Development",
5
5
  "main": "dist/index.js",
6
6
  "bin": {