@ironbee-ai/cli 0.21.2 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/assets/auth.html +79 -0
  3. package/dist/clients/claude/agents/ironbee-verifier.md +12 -2
  4. package/dist/clients/claude/commands/ironbee-verify.md +28 -15
  5. package/dist/clients/claude/hooks/activity-start.js +1 -1
  6. package/dist/clients/claude/hooks/require-verdict.js +2 -2
  7. package/dist/clients/claude/hooks/require-verification.js +7 -7
  8. package/dist/clients/claude/hooks/track-action.js +1 -1
  9. package/dist/clients/claude/index.js +4 -4
  10. package/dist/clients/claude/platforms/skill.android.md +65 -0
  11. package/dist/clients/codex/agents/ironbee-verifier.md +11 -1
  12. package/dist/clients/codex/commands/ironbee-verify/SKILL.md +24 -5
  13. package/dist/clients/codex/hooks/require-verification.js +7 -7
  14. package/dist/clients/codex/hooks/track-action.js +1 -1
  15. package/dist/clients/codex/index.js +2 -2
  16. package/dist/clients/codex/platforms/command-verify.android.md +61 -0
  17. package/dist/clients/codex/platforms/rule.android.md +32 -0
  18. package/dist/clients/codex/platforms/skill.android.md +55 -0
  19. package/dist/clients/codex/skills/ironbee-verification.md +3 -0
  20. package/dist/clients/codex/util.js +11 -11
  21. package/dist/clients/cursor/commands/ironbee-verify/SKILL.md +21 -4
  22. package/dist/clients/cursor/hooks/require-verdict.js +1 -1
  23. package/dist/clients/cursor/hooks/require-verification.js +6 -6
  24. package/dist/clients/cursor/hooks/track-action.js +1 -1
  25. package/dist/clients/cursor/index.js +1 -1
  26. package/dist/clients/cursor/platforms/command-verify.android.md +61 -0
  27. package/dist/clients/cursor/platforms/rule.android.md +32 -0
  28. package/dist/clients/cursor/platforms/skill.android.md +55 -0
  29. package/dist/clients/cursor/rules/ironbee-verification.mdc +3 -0
  30. package/dist/clients/cursor/skills/ironbee-verification.md +3 -0
  31. package/dist/commands/android.js +1 -0
  32. package/dist/commands/config.js +2 -2
  33. package/dist/commands/cycle-toggle.js +4 -4
  34. package/dist/commands/hook.js +16 -15
  35. package/dist/commands/import.js +4 -4
  36. package/dist/commands/install.js +1 -1
  37. package/dist/commands/login.js +2 -2
  38. package/dist/commands/mode-select.js +2 -0
  39. package/dist/hooks/core/actions.js +6 -5
  40. package/dist/hooks/core/session-state.js +1 -1
  41. package/dist/hooks/core/submit-verdict.js +4 -4
  42. package/dist/hooks/core/verification-lifecycle.js +1 -1
  43. package/dist/hooks/core/verify-gate.js +29 -23
  44. package/dist/import/claude/events/tool-call.js +1 -1
  45. package/dist/import/codex/events/tool-call.js +1 -1
  46. package/dist/index.js +1 -1
  47. package/dist/lib/auth.js +5 -5
  48. package/dist/lib/collector.js +1 -1
  49. package/dist/lib/config.js +1 -1
  50. package/dist/lib/install-version.js +1 -0
  51. package/dist/lib/platform-section.js +4 -3
  52. package/dist/lib/prompt.js +4 -4
  53. package/dist/lib/recording-tools.js +1 -0
  54. package/dist/lib/schema-sync.js +2 -0
  55. package/dist/lib/version.js +1 -1
  56. package/dist/scripts/postinstall.js +1 -1
  57. package/dist/tui/config/schema.js +1 -1
  58. package/dist/tui/platforms/area.js +2 -2
  59. package/dist/tui/projects/area.js +4 -4
  60. package/dist/tui/sessions/area.js +3 -3
  61. package/package.json +1 -1
  62. package/dist/assets/login.html +0 -93
package/dist/lib/auth.js CHANGED
@@ -1,17 +1,17 @@
1
- "use strict";var x=Object.create;var l=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var a=(e,t)=>l(e,"name",{value:t,configurable:!0});var T=(e,t)=>{for(var r in t)l(e,r,{get:t[r],enumerable:!0})},h=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of S(t))!k.call(e,i)&&i!==r&&l(e,i,{get:()=>t[i],enumerable:!(s=P(t,i))||s.enumerable});return e};var c=(e,t,r)=>(r=e!=null?x(E(e)):{},h(t||!e||!e.__esModule?l(r,"default",{value:e,enumerable:!0}):r,e)),$=e=>h(l({},"__esModule",{value:!0}),e);var U={};T(U,{findFreePort:()=>F,generateState:()=>Y,openBrowser:()=>B,startCallbackServer:()=>_});module.exports=$(U);var A=c(require("net")),H=c(require("http")),I=c(require("crypto")),L=c(require("fs")),R=c(require("path")),v=require("child_process");function F(){return new Promise((e,t)=>{const r=A.createServer();r.listen(0,"127.0.0.1",()=>{const s=r.address();if(!s||typeof s=="string"){r.close(),t(new Error("Could not determine free port"));return}const i=s.port;r.close(()=>e(i))}),r.on("error",t)})}a(F,"findFreePort");function Y(){return I.randomBytes(16).toString("hex")}a(Y,"generateState");function _(e,t,r=300*1e3,s){return new Promise((i,m)=>{const n=H.createServer((b,o)=>{const w=b.url??"/",d=new URL(w,`http://127.0.0.1:${e}`);if(d.pathname!=="/callback"){o.writeHead(404),o.end();return}const C=d.searchParams.get("state"),g=d.searchParams.get("api_key"),u=d.searchParams.get("error");if(u){o.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),o.end(p("Login Failed",`<p>Login failed: ${f(u)}.</p><p>You can close this tab.</p>`)),n.closeAllConnections(),n.close(),m(new Error(`Login failed: ${u}`));return}if(C!==t){o.writeHead(400,{"Content-Type":"text/html; charset=utf-8"}),o.end(p("Error","<p>Invalid state parameter. You can close this tab.</p>")),n.closeAllConnections(),n.close(),m(new Error("State mismatch \u2014 possible CSRF"));return}if(!g){o.writeHead(400,{"Content-Type":"text/html; charset=utf-8"}),o.end(p("Error","<p>No API key received. You can close this tab.</p>")),n.closeAllConnections(),n.close(),m(new Error("No api_key in callback"));return}o.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),o.end(N()),i({apiKey:g}),n.closeAllConnections(),n.close()}),y=setTimeout(()=>{n.closeAllConnections(),n.close(),m(new Error("Login timed out after 5 minutes"))},r).unref();n.on("close",()=>clearTimeout(y)),n.listen(e,"127.0.0.1",()=>{s?.()})})}a(_,"startCallbackServer");function B(e){let t;process.platform==="darwin"?t=`open "${e}"`:process.platform==="win32"?t=`start "" "${e}"`:t=`xdg-open "${e}"`,(0,v.exec)(t,r=>{})}a(B,"openBrowser");function f(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}a(f,"escapeHtml");function N(){try{const e=R.join(__dirname,"..","assets","login.html");return L.readFileSync(e,"utf-8")}catch{return p("Connected","<p>IronBee CLI connected successfully. You can close this tab.</p>")}}a(N,"connectedHtmlPage");function p(e,t){return`<!DOCTYPE html>
1
+ "use strict";var T=Object.create;var c=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,_=Object.prototype.hasOwnProperty;var i=(e,t)=>c(e,"name",{value:t,configurable:!0});var A=(e,t)=>{for(var r in t)c(e,r,{get:t[r],enumerable:!0})},C=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of I(t))!_.call(e,a)&&a!==r&&c(e,a,{get:()=>t[a],enumerable:!(s=E(t,a))||s.enumerable});return e};var m=(e,t,r)=>(r=e!=null?T(P(e)):{},C(t||!e||!e.__esModule?c(r,"default",{value:e,enumerable:!0}):r,e)),$=e=>C(c({},"__esModule",{value:!0}),e);var M={};A(M,{findFreePort:()=>F,generateState:()=>K,openBrowser:()=>O,startCallbackServer:()=>N});module.exports=$(M);var R=m(require("net")),B=m(require("http")),L=m(require("crypto")),Y=m(require("fs")),H=m(require("path")),k=require("child_process");function F(){return new Promise((e,t)=>{const r=R.createServer();r.listen(0,"127.0.0.1",()=>{const s=r.address();if(!s||typeof s=="string"){r.close(),t(new Error("Could not determine free port"));return}const a=s.port;r.close(()=>e(a))}),r.on("error",t)})}i(F,"findFreePort");function K(){return L.randomBytes(16).toString("hex")}i(K,"generateState");function N(e,t,r=300*1e3,s){return new Promise((a,u)=>{const n=B.createServer((y,o)=>{const x=y.url??"/",l=new URL(x,`http://127.0.0.1:${e}`);if(l.pathname!=="/callback"){o.writeHead(404),o.end();return}const S=l.searchParams.get("state"),g=l.searchParams.get("access_token"),f=l.searchParams.get("api_key"),b=l.searchParams.get("error");if(b){const v=z(b);o.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),o.end(p(v.title,`<p>${d(v.message)}</p><p>You can close this tab.</p>`)),n.closeAllConnections(),n.close(),u(new Error(v.message));return}if(S!==t){o.writeHead(400,{"Content-Type":"text/html; charset=utf-8"}),o.end(p("Something went wrong","<p>Invalid state parameter. You can close this tab.</p>")),n.closeAllConnections(),n.close(),u(new Error("State mismatch \u2014 possible CSRF"));return}if(!g&&!f){o.writeHead(400,{"Content-Type":"text/html; charset=utf-8"}),o.end(p("Something went wrong","<p>No credentials received. You can close this tab.</p>")),n.closeAllConnections(),n.close(),u(new Error("No access_token or api_key in callback"));return}o.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),o.end(p("IronBee CLI connected successfully","<p>You can close this tab.</p>"));const h={};g&&(h.accessToken=g),f&&(h.apiKey=f),a(h),n.closeAllConnections(),n.close()}),w=setTimeout(()=>{n.closeAllConnections(),n.close(),u(new Error("Login timed out after 5 minutes"))},r).unref();n.on("close",()=>clearTimeout(w)),n.listen(e,"127.0.0.1",()=>{s?.()})})}i(N,"startCallbackServer");function O(e){let t;process.platform==="darwin"?t=`open "${e}"`:process.platform==="win32"?t=`start "" "${e}"`:t=`xdg-open "${e}"`,(0,k.exec)(t,r=>{})}i(O,"openBrowser");const U=10;function z(e){return e==="token_limit_exceeded"?{title:"Token limit reached!",message:`You already have the maximum of ${U} access tokens, so a new one could not be issued for the CLI. Revoke one on the IronBee Console's API Tokens page, then run "ironbee login" again!`}:{title:"Login failed!",message:`IronBee Console reported an error (${e})`}}i(z,"describeCallbackError");function d(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}i(d,"escapeHtml");function p(e,t){try{const r=H.join(__dirname,"..","assets","auth.html");return Y.readFileSync(r,"utf-8").replace(/\{\{TITLE\}\}/g,d(e)).replace("{{BODY}}",()=>t)}catch{return D(e,t)}}i(p,"renderAuthPage");function D(e,t){return`<!DOCTYPE html>
2
2
  <html lang="en">
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
- <title>${f(e)} \u2014 IronBee</title>
5
+ <title>${d(e)} \u2014 IronBee</title>
6
6
  <style>
7
7
  body { font-family: system-ui, sans-serif; display: flex; align-items: center;
8
8
  justify-content: center; height: 100vh; margin: 0; background: #0f0f11; color: #e5e5e5; }
9
- div { text-align: center; max-width: 400px; padding: 2rem; }
9
+ .card { text-align: center; max-width: 500px; padding: 2rem; }
10
10
  h1 { font-size: 1.25rem; margin-bottom: 0.75rem; }
11
11
  p { color: #999; font-size: 0.9rem; line-height: 1.6; }
12
12
  </style>
13
13
  </head>
14
14
  <body>
15
- <div><h1>${f(e)}</h1>${t}</div>
15
+ <div class="card"><h1>${d(e)}</h1>${t}</div>
16
16
  </body>
17
- </html>`}a(p,"htmlPage");0&&(module.exports={findFreePort,generateState,openBrowser,startCallbackServer});
17
+ </html>`}i(D,"htmlPage");0&&(module.exports={findFreePort,generateState,openBrowser,startCallbackServer});
@@ -1 +1 @@
1
- "use strict";var y=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var c=(t,e)=>y(t,"name",{value:e,configurable:!0});var x=(t,e)=>{for(var o in e)y(t,o,{get:e[o],enumerable:!0})},k=(t,e,o,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of B(e))!I.call(t,i)&&i!==o&&y(t,i,{get:()=>e[i],enumerable:!(l=O(e,i))||l.enumerable});return t};var A=t=>k(y({},"__esModule",{value:!0}),t);var j={};x(j,{PermanentCollectorError:()=>_,RetriableCollectorError:()=>T,getCollectorTarget:()=>$,postEventsBatch:()=>v,sendEventsBatchToCollector:()=>N,sendToCollector:()=>K});module.exports=A(j);var M=require("https"),P=require("http"),R=require("./config"),g=require("./logger");const C=3e3,w=1e4,D=1e3,U=6e4,q="v1/events";function L(t){const e=new URL(t);return e.pathname.endsWith("/")||(e.pathname=`${e.pathname}/`),new URL(q,e)}c(L,"resolveEventsUrl");class T extends Error{static{c(this,"RetriableCollectorError")}constructor(e,o){super(e),this.name="RetriableCollectorError",this.status=o}}class _ extends Error{static{c(this,"PermanentCollectorError")}constructor(e,o){super(e),this.name="PermanentCollectorError",this.status=o}}async function v(t,e,o){const l=o?.timeoutMs??C;return new Promise((i,p)=>{let r=!1;const n=c(s=>{r||(r=!0,i(s))},"settleResolve"),a=c(s=>{r||(r=!0,p(s))},"settleReject");try{const s=JSON.stringify(t),u=L(e.url),h=u.protocol==="https:",f=h?M.request:P.request,b=setTimeout(()=>{a(new Error("collector: send timeout"))},l),m=f({hostname:u.hostname,port:u.port||(h?443:80),path:u.pathname+u.search,method:"POST",headers:{"Content-Type":"application/json","Content-Length":Buffer.byteLength(s),...e.apiKey?{"X-API-Key":e.apiKey}:{}},timeout:l},d=>{let E="";d.setEncoding("utf-8"),d.on("data",S=>{E+=S}),d.on("end",()=>{clearTimeout(b),n({status:d.statusCode??0,body:E})}),d.on("close",()=>{clearTimeout(b),n({status:d.statusCode??0,body:E})})});m.on("error",d=>{clearTimeout(b),a(d)}),m.on("timeout",()=>{clearTimeout(b),m.destroy(),a(new Error("collector: request timeout"))}),m.write(s),m.end()}catch(s){a(s instanceof Error?s:new Error(String(s)))}})}c(v,"postEventsBatch");function $(t){if(process.env.IRONBEE_COLLECTOR==="false")return null;const o=(0,R.loadConfig)(t).collector;return!o||o.enable===!1||typeof o.url!="string"||o.url.length===0||typeof o.apiKey!="string"||o.apiKey.length===0?null:{url:o.url,apiKey:o.apiKey,batchSize:typeof o.batchSize=="number"?o.batchSize:void 0,timeoutMs:typeof o.timeoutMs=="number"?H(o.timeoutMs):void 0}}c($,"getCollectorTarget");function H(t){return Number.isFinite(t)?Math.min(U,Math.max(D,Math.floor(t))):w}c(H,"clampTimeoutMs");async function K(t,e,o){const l=$(o);if(!l)return;const i=Date.now();let p;try{p=await v([t],l,{timeoutMs:C})}catch(s){const u=s instanceof Error?s.message:String(s);throw g.logger.debug(`collector: sendToCollector network/timeout type=${t.type} id=${t.id}: ${u}`),new T(`collector network error: ${u}`,null)}const r=p.status;if(r>=200&&r<300){g.logger.debug(`collector: posted type=${t.type} id=${t.id} in ${Date.now()-i}ms`);return}const n=200,a=p.body.length>n?`${p.body.slice(0,n)}\u2026`:p.body;throw r===429||r>=500?(g.logger.debug(`collector: sendToCollector retriable HTTP ${r} type=${t.type} id=${t.id}: ${a}`),new T(`collector HTTP ${r}: ${a}`,r)):(g.logger.debug(`collector: sendToCollector permanent HTTP ${r} type=${t.type} id=${t.id}: ${a}`),new _(`collector HTTP ${r}: ${a}`,r))}c(K,"sendToCollector");async function N(t,e,o,l){if(t.length===0)return;const i=l!==void 0?l:$(o);if(!i)return;const p=i.timeoutMs??w,r=Date.now();try{const n=await v(t,i,{timeoutMs:p});if(!(n.status>=200&&n.status<300)){const u=n.body.length>500?`${n.body.slice(0,500)}\u2026`:n.body,h=t[0]?.type??"(empty)",f={};for(const m of t)f[m.type]=(f[m.type]??0)+1;const b=Object.entries(f).map(([m,d])=>`${m}=${d}`).join(",");throw new Error(`collector: HTTP ${n.status} for batch of ${t.length} (first_type=${h}, types=${b})`+(u.length>0?`: ${u}`:""))}g.logger.debug(`collector: posted batch=${t.length} first_type=${t[0].type} in ${Date.now()-r}ms`)}catch(n){throw g.logger.debug(`collector: sendEventsBatchToCollector failed batch=${t.length}: ${n}`),n instanceof Error?n:new Error(String(n))}}c(N,"sendEventsBatchToCollector");0&&(module.exports={PermanentCollectorError,RetriableCollectorError,getCollectorTarget,postEventsBatch,sendEventsBatchToCollector,sendToCollector});
1
+ "use strict";var T=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var B=Object.prototype.hasOwnProperty;var c=(t,o)=>T(t,"name",{value:o,configurable:!0});var I=(t,o)=>{for(var e in o)T(t,e,{get:o[e],enumerable:!0})},x=(t,o,e,u)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of O(o))!B.call(t,s)&&s!==e&&T(t,s,{get:()=>o[s],enumerable:!(u=S(o,s))||u.enumerable});return t};var A=t=>x(T({},"__esModule",{value:!0}),t);var j={};I(j,{PermanentCollectorError:()=>k,RetriableCollectorError:()=>E,getCollectorTarget:()=>$,postEventsBatch:()=>v,sendEventsBatchToCollector:()=>N,sendToCollector:()=>H});module.exports=A(j);var M=require("https"),P=require("http"),R=require("./config"),g=require("./logger");const C=3e3,w=1e4,D=1e3,U=6e4,q="v1/events";function K(t){const o=new URL(t);return o.pathname.endsWith("/")||(o.pathname=`${o.pathname}/`),new URL(q,o)}c(K,"resolveEventsUrl");class E extends Error{static{c(this,"RetriableCollectorError")}constructor(o,e){super(o),this.name="RetriableCollectorError",this.status=e}}class k extends Error{static{c(this,"PermanentCollectorError")}constructor(o,e){super(o),this.name="PermanentCollectorError",this.status=e}}async function v(t,o,e){const u=e?.timeoutMs??C;return new Promise((s,p)=>{let n=!1;const r=c(i=>{n||(n=!0,s(i))},"settleResolve"),a=c(i=>{n||(n=!0,p(i))},"settleReject");try{const i=JSON.stringify(t),l=K(o.url),f=l.protocol==="https:",h=f?M.request:P.request,b=setTimeout(()=>{a(new Error("collector: send timeout"))},u),m=h({hostname:l.hostname,port:l.port||(f?443:80),path:l.pathname+l.search,method:"POST",headers:{"Content-Type":"application/json","Content-Length":Buffer.byteLength(i),...o.oauthToken?{"X-OAuth-Token":o.oauthToken}:o.apiKey?{"X-API-Key":o.apiKey}:{}},timeout:u},d=>{let y="";d.setEncoding("utf-8"),d.on("data",_=>{y+=_}),d.on("end",()=>{clearTimeout(b),r({status:d.statusCode??0,body:y})}),d.on("close",()=>{clearTimeout(b),r({status:d.statusCode??0,body:y})})});m.on("error",d=>{clearTimeout(b),a(d)}),m.on("timeout",()=>{clearTimeout(b),m.destroy(),a(new Error("collector: request timeout"))}),m.write(i),m.end()}catch(i){a(i instanceof Error?i:new Error(String(i)))}})}c(v,"postEventsBatch");function $(t){if(process.env.IRONBEE_COLLECTOR==="false")return null;const e=(0,R.loadConfig)(t).collector;if(!e||e.enable===!1||typeof e.url!="string"||e.url.length===0)return null;const u=typeof e.oauthToken=="string"&&e.oauthToken.length>0,s=typeof e.apiKey=="string"&&e.apiKey.length>0;return!u&&!s?null:{url:e.url,...u?{oauthToken:e.oauthToken}:{apiKey:e.apiKey},batchSize:typeof e.batchSize=="number"?e.batchSize:void 0,timeoutMs:typeof e.timeoutMs=="number"?L(e.timeoutMs):void 0}}c($,"getCollectorTarget");function L(t){return Number.isFinite(t)?Math.min(U,Math.max(D,Math.floor(t))):w}c(L,"clampTimeoutMs");async function H(t,o,e){const u=$(e);if(!u)return;const s=Date.now();let p;try{p=await v([t],u,{timeoutMs:C})}catch(i){const l=i instanceof Error?i.message:String(i);throw g.logger.debug(`collector: sendToCollector network/timeout type=${t.type} id=${t.id}: ${l}`),new E(`collector network error: ${l}`,null)}const n=p.status;if(n>=200&&n<300){g.logger.debug(`collector: posted type=${t.type} id=${t.id} in ${Date.now()-s}ms`);return}const r=200,a=p.body.length>r?`${p.body.slice(0,r)}\u2026`:p.body;throw n===429||n>=500?(g.logger.debug(`collector: sendToCollector retriable HTTP ${n} type=${t.type} id=${t.id}: ${a}`),new E(`collector HTTP ${n}: ${a}`,n)):(g.logger.debug(`collector: sendToCollector permanent HTTP ${n} type=${t.type} id=${t.id}: ${a}`),new k(`collector HTTP ${n}: ${a}`,n))}c(H,"sendToCollector");async function N(t,o,e,u){if(t.length===0)return;const s=u!==void 0?u:$(e);if(!s)return;const p=s.timeoutMs??w,n=Date.now();try{const r=await v(t,s,{timeoutMs:p});if(!(r.status>=200&&r.status<300)){const l=r.body.length>500?`${r.body.slice(0,500)}\u2026`:r.body,f=t[0]?.type??"(empty)",h={};for(const m of t)h[m.type]=(h[m.type]??0)+1;const b=Object.entries(h).map(([m,d])=>`${m}=${d}`).join(",");throw new Error(`collector: HTTP ${r.status} for batch of ${t.length} (first_type=${f}, types=${b})`+(l.length>0?`: ${l}`:""))}g.logger.debug(`collector: posted batch=${t.length} first_type=${t[0].type} in ${Date.now()-n}ms`)}catch(r){throw g.logger.debug(`collector: sendEventsBatchToCollector failed batch=${t.length}: ${r}`),r instanceof Error?r:new Error(String(r))}}c(N,"sendEventsBatchToCollector");0&&(module.exports={PermanentCollectorError,RetriableCollectorError,getCollectorTarget,postEventsBatch,sendEventsBatchToCollector,sendToCollector});
@@ -1 +1 @@
1
- "use strict";var E=Object.defineProperty;var oe=Object.getOwnPropertyDescriptor;var ie=Object.getOwnPropertyNames;var se=Object.prototype.hasOwnProperty;var r=(n,e)=>E(n,"name",{value:e,configurable:!0});var ae=(n,e)=>{for(var t in e)E(n,t,{get:e[t],enumerable:!0})},ce=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ie(e))!se.call(n,i)&&i!==t&&E(n,i,{get:()=>e[i],enumerable:!(o=oe(e,i))||o.enumerable});return n};var ue=n=>ce(E({},"__esModule",{value:!0}),n);var mn={};ae(mn,{ALL_CYCLES:()=>le,CONFIG_TARGETS_BY_PRECEDENCE:()=>ve,CYCLES_ENABLED_BY_DEFAULT:()=>N,CYCLE_DEFAULT_VERIFY_PATTERNS:()=>F,CYCLE_TO_SERVER:()=>fe,DEFAULT_BACKEND_ALWAYS_REQUIRED:()=>$,DEFAULT_BACKEND_EVIDENCE_PATHS:()=>Y,DEFAULT_BACKEND_VERIFY_PATTERNS:()=>M,DEFAULT_BROWSER_ALWAYS_REQUIRED:()=>V,DEFAULT_BROWSER_VERIFY_PATTERNS:()=>P,DEFAULT_NODE_ALWAYS_REQUIRED:()=>U,DEFAULT_NODE_EVIDENCE_PATHS:()=>q,DEFAULT_NODE_VERIFY_PATTERNS:()=>D,DEFAULT_OAUTH_USAGE_TTL_SECONDS:()=>H,DEFAULT_OTEL_EMIT_MIN_INTERVAL_SECONDS:()=>J,DEFAULT_OTEL_ENSURE_MIN_INTERVAL_SECONDS:()=>z,DEFAULT_OTEL_IDLE_TIMEOUT_SECONDS:()=>Q,DEFAULT_OTEL_PORT:()=>W,DEFAULT_VERIFICATION_CONTEXT_COMMIT_DEPTH:()=>ne,DEFAULT_VERIFICATION_CONTEXT_MAX_BYTES:()=>ee,ENV_OVERRIDES:()=>T,OPTIONAL_CYCLES:()=>I,applyEnvOverrides:()=>K,findActiveEnvOverride:()=>Te,getActiveCycles:()=>X,getAnalyticsEmitOnStopMinIntervalSeconds:()=>pn,getAutoVerifyEnabled:()=>Z,getBackendDevToolsMcpEntry:()=>$e,getCaptureFileChangeset:()=>fn,getClaudeOauthAccessEnabled:()=>Qe,getClaudeOauthAccessUsageTtlSeconds:()=>ze,getConfigLayerPaths:()=>x,getMaxChangesetBytes:()=>gn,getMaxRetries:()=>Ye,getMcpServerEntry:()=>Ue,getNodeDevToolsMcpEntry:()=>qe,getOTELEmitMinIntervalSeconds:()=>tn,getOTELEnsureMinIntervalSeconds:()=>nn,getOTELIdleTimeoutSeconds:()=>en,getOTELPort:()=>Ze,getPrivacyEnabled:()=>re,getRequiredToolsConfig:()=>Oe,getStatusLineEmitMinIntervalSeconds:()=>We,getStatusLineRefreshInterval:()=>rn,getStatusLineRenderDefault:()=>He,getTargetConfigPath:()=>Ae,getTelemetryEnabled:()=>te,getVerificationContextCommitDepth:()=>an,getVerificationContextEnabled:()=>on,getVerificationContextMaxBytes:()=>cn,getVerificationContextSource:()=>sn,getVerificationEnabled:()=>w,getVerificationMode:()=>ln,getVerificationModel:()=>pe,isAnalyticsApiRequestEventsEnabled:()=>Cn,isAnalyticsEmitOnStopEnabled:()=>bn,isAnalyticsEnabled:()=>dn,isAnalyticsStepEventsEnabled:()=>yn,isAnalyticsTurnEventsEnabled:()=>En,isCollectorConfigured:()=>j,isCycleEnabled:()=>Re,isCyclePatternsActive:()=>G,isIgnoredVerifyPath:()=>un,isJobQueueEnabled:()=>Ke,isOTELEnabled:()=>Je,isRecordingEnabled:()=>Xe,isSessionStatusEnabled:()=>Ge,loadConfig:()=>a,requiresVerification:()=>Be,resolveConfigTargetFromFlags:()=>Ie});module.exports=ue(mn);var b=require("fs"),C=require("path"),S=require("os"),L=require("./logger");const I=["node","backend"],le=["browser",...I],N=new Set(["browser"]),fe={browser:"browser-devtools",node:"node-devtools",backend:"backend-devtools"},P=["*.ts","*.tsx","*.js","*.jsx","*.mjs","*.cjs","*.vue","*.svelte","*.html","*.htm","*.css","*.scss","*.sass","*.less","*.styl","*.py","*.rb","*.erb","*.go","*.rs","*.java","*.kt","*.kts","*.swift","*.c","*.cpp","*.h","*.hpp","*.cs","*.php","*.dart","*.ex","*.exs","*.erl","*.lua","*.r","*.R","*.scala","*.clj","*.cljs","*.zig","*.nim","*.hbs","*.ejs","*.pug","*.jade","*.astro"],D=["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}"],M=["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}"],F={browser:P,node:D,backend:M},V=["bdt_navigation_go-to","bdt_content_take-screenshot","bdt_a11y_take-aria-snapshot","bdt_o11y_get-console-messages"],U=["ndt_debug_connect"],q=[{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"]}],$=[],Y=[{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"]}]}],ge=3;function de(n){if(!(0,b.existsSync)(n))return{};try{return JSON.parse((0,b.readFileSync)(n,"utf-8"))}catch(e){return L.logger.debug(`failed to parse config ${n}: ${e}`),{}}}r(de,"loadJsonFile");function be(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 o=t;if(Object.prototype.hasOwnProperty.call(o,"enable")&&typeof o.enable!="boolean")throw new Error(`Invalid IronBee config in ${e}: 'verification.enable' must be boolean. Got ${typeof o.enable}.`);if(Object.prototype.hasOwnProperty.call(o,"auto")&&typeof o.auto!="boolean")throw new Error(`Invalid IronBee config in ${e}: 'verification.auto' must be boolean. Got ${typeof o.auto}.`);if(Object.prototype.hasOwnProperty.call(o,"model")){const i=o.model,s=typeof i=="string",u=i!==null&&typeof i=="object"&&!Array.isArray(i)&&Object.values(i).every(c=>typeof c=="string");if(!s&&!u)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}.`)}}r(be,"assertVerificationShape");function pe(n,e){const t=n.verification?.model;if(typeof t=="string")return t.length>0?t:void 0;if(t&&typeof t=="object"){const o=t[e];return typeof o=="string"&&o.length>0?o:void 0}}r(pe,"getVerificationModel");function Ee(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 o=t;if(Object.prototype.hasOwnProperty.call(o,"enable")&&typeof o.enable!="boolean")throw new Error(`Invalid IronBee config in ${e}: 'telemetry.enable' must be boolean. Got ${typeof o.enable}.`)}r(Ee,"assertTelemetryShape");function ye(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 o=t;if(Object.prototype.hasOwnProperty.call(o,"enable")&&typeof o.enable!="boolean")throw new Error(`Invalid IronBee config in ${e}: 'privacy.enable' must be boolean. Got ${typeof o.enable}.`)}r(ye,"assertPrivacyShape");function m(n,e){if(!(n===void 0&&e===void 0))return{...n??{},...e??{}}}r(m,"mergeCycleConfig");function R(n,e){const t={...n,...e};return t.browser=m(n.browser,e.browser),t.node=m(n.node,e.node),t.backend=m(n.backend,e.backend),t.claude=_e(n.claude,e.claude),t.verification=me(n.verification,e.verification),t.verificationContext=Ce(n.verificationContext,e.verificationContext),t}r(R,"mergeConfigLayers");function Ce(n,e){if(!(n===void 0&&e===void 0))return{...n??{},...e??{}}}r(Ce,"mergeVerificationContextConfig");function me(n,e){if(!(n===void 0&&e===void 0))return{...n??{},...e??{}}}r(me,"mergeVerificationConfig");function _e(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??{}}),t}r(_e,"mergeClaudeConfig");function x(n){return{global:(0,C.join)((0,S.homedir)(),".ironbee","config.json"),project:n?(0,C.join)(n,".ironbee","config.json"):void 0,local:n?(0,C.join)(n,".ironbee","config.local.json"):void 0}}r(x,"getConfigLayerPaths");const ve=["global","project","local"];function Ae(n,e){const t=x(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}r(Ae,"getTargetConfigPath");function Ie(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"}r(Ie,"resolveConfigTargetFromFlags");function _(n){const e=de(n);return(0,b.existsSync)(n)&&(be(e,n),Ee(e,n),ye(e,n)),e}r(_,"loadAndValidateLayer");const T=[{envVar:"IRONBEE_API_KEY",configPath:"collector.apiKey"}];function xe(n,e,t){const o=e.split(".");let i=n;for(let s=0;s<o.length-1;s++){const u=o[s],c=i[u];c!=null&&typeof c=="object"&&!Array.isArray(c)?i[u]={...c}:i[u]={},i=i[u]}i[o[o.length-1]]=t}r(xe,"setAtConfigPath");function K(n){let e;for(const t of T){const o=process.env[t.envVar];if(o===void 0||o.length===0)continue;e===void 0&&(e={...n});const i=t.coerce?t.coerce(o):o;xe(e,t.configPath,i)}return e??n}r(K,"applyEnvOverrides");function Te(n){for(const e of T){if(e.configPath!==n)continue;const t=process.env[e.envVar];if(t!==void 0&&t.length>0)return e}}r(Te,"findActiveEnvOverride");function a(n){const e=x(n),t=_(e.global),o=e.project?_(e.project):{},i=e.local?_(e.local):{},s=R(R(t,o),i);return K(s)}r(a,"loadConfig");function je(n){let e=n.replace(/\{([^}]+)\}/g,(t,o)=>`(${o.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}$`)}r(je,"globToRegExp");function y(n,e){const t=n.replace(/\\/g,"/");for(const o of e)if(je(o).test(t))return!0;return!1}r(y,"matchesAny");function we(n,e){if(e==="browser")return n.browser;if(e==="node")return n.node;if(e==="backend")return n.backend}r(we,"getCycleBlock");function v(n,e){const t=we(n,e);if(t!==void 0&&t.enable===!1)return[];const o=F[e]??[];if(t===void 0)return N.has(e)?[...o]:[];if(Array.isArray(t.verifyPatterns)&&t.verifyPatterns.length===0)return[];const i=t.verifyPatterns??o,s=t.additionalVerifyPatterns??[];return[...i,...s]}r(v,"getCyclePatterns");function X(n,e){const t=e.ignoredVerifyPatterns??[];if(t.length>0&&y(n,t))return[];const o=[];y(n,v(e,"browser"))&&o.push("browser");for(const i of I){const s=v(e,i);s.length>0&&y(n,s)&&o.push(i)}return o}r(X,"getActiveCycles");function Be(n,e){return X(n,e).length>0}r(Be,"requiresVerification");function Re(n,e){return w(n)?G(n,e):!1}r(Re,"isCycleEnabled");function G(n,e){return v(n,e).length>0}r(G,"isCyclePatternsActive");function Oe(n,e){let t,o;if(e==="browser"?(t=n.browser?.alwaysRequired??V,o=n.browser?.evidencePaths??[]):e==="node"?(t=n.node?.alwaysRequired??U,o=n.node?.evidencePaths??q):e==="backend"?(t=n.backend?.alwaysRequired??$,o=n.backend?.evidencePaths??Y):(t=[],o=[]),t.length===0&&o.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:o}}r(Oe,"getRequiredToolsConfig");const O="npx",he="^0.10.7",h=["-y",`@ironbee-ai/devtools@${he}`],ke={TOOL_NAME_PREFIX:"bdt_",TOOL_INPUT_METADATA_ENABLE:"true"},Se={PLATFORM:"node",TOOL_NAME_PREFIX:"ndt_",TOOL_INPUT_METADATA_ENABLE:"true"},Le={PLATFORM:"backend",TOOL_NAME_PREFIX:"bedt_",TOOL_INPUT_METADATA_ENABLE:"true"},Ne={BROWSER_DEVTOOLS_INSTALL_CHROMIUM:"true"},Pe={},De={};function Me(n){return te(n)?{}:{TELEMETRY_ENABLE:"false"}}r(Me,"buildTelemetryEnv");function Fe(n){return re(n)?{COLLECTOR_EVENTS_TOOL_DETAILS_ENABLE:"false",COLLECTOR_ARTIFACTS_ENABLE:"false"}:{}}r(Fe,"buildPrivacyEnv");function Ve(n,e){if(!j(n))return{};const o={OTEL_ENABLE:"true",OTEL_EXPORTER_HTTP_URL:n.collector.url,OTEL_EXPORTER_HTTP_HEADERS:"X-API-Key=${file:~/.ironbee/config.json#collector.apiKey}",OTEL_EXPORTER_TYPE:"otlp/http-protobuf"};return e==="browser"&&(o.OTEL_INSTRUMENTATION_USER_INTERACTION_EVENTS="change,input,click",o.BROWSER_HEADLESS_ENABLE="true"),o}r(Ve,"buildOTELEnv");function A(n,e,t,o,i){const s=Ve(n,i),u=Me(n),c=Fe(n),p=n[e];if(p&&typeof p=="object"&&!Array.isArray(p)){const l=p;if(l.mcp&&typeof l.mcp=="object"&&!Array.isArray(l.mcp)){const f={...l.mcp},g={...s,...u,...c,...f.env??{},...t};return f.env=g,f}const B={};if(l.env&&typeof l.env=="object"&&!Array.isArray(l.env)){const f=l.env;for(const g of Object.keys(f))typeof f[g]=="string"&&(B[g]=f[g])}return{command:O,args:[...h],env:{...o,...s,...u,...c,...B,...t}}}return{command:O,args:[...h],env:{...o,...s,...u,...c,...t}}}r(A,"buildMcpEntry");function Ue(n){const e=a(n);return A(e,"browserDevTools",ke,Ne,"browser")}r(Ue,"getMcpServerEntry");function qe(n){const e=a(n);return A(e,"nodeDevTools",Se,Pe,"node")}r(qe,"getNodeDevToolsMcpEntry");function $e(n){const e=a(n);return A(e,"backendDevTools",Le,De,"backend")}r($e,"getBackendDevToolsMcpEntry");function Ye(n){return typeof n.maxRetries=="number"&&n.maxRetries>0?n.maxRetries:ge}r(Ye,"getMaxRetries");function j(n){if(process.env.IRONBEE_COLLECTOR==="false")return!1;const e=n.collector;return!(!e||e.enable===!1||typeof e.url!="string"||e.url.length===0||typeof e.apiKey!="string"||e.apiKey.length===0)}r(j,"isCollectorConfigured");function Ke(n){const e=a(n);return d(e,e.jobQueue)}r(Ke,"isJobQueueEnabled");function Xe(n){const e=a(n);return d(e,e.recording)}r(Xe,"isRecordingEnabled");function Ge(n){return d(n,n.statusLine)}r(Ge,"isSessionStatusEnabled");function He(n){const e=n.statusLine;return e!==void 0&&e.renderDefault===!0}r(He,"getStatusLineRenderDefault");function We(n){const e=n.statusLine?.emitMinIntervalSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:10}r(We,"getStatusLineEmitMinIntervalSeconds");const H=60;function Qe(n){return n.claude?.oauthAccess?.enable!==!1}r(Qe,"getClaudeOauthAccessEnabled");function ze(n){const e=n.claude?.oauthAccess?.usageTtlSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:H}r(ze,"getClaudeOauthAccessUsageTtlSeconds");const W=15986,Q=600,z=30,J=0;function Je(n){return d(n,n.otel)}r(Je,"isOTELEnabled");function Ze(n){const e=n.otel?.port;return typeof e=="number"&&Number.isInteger(e)&&e>0&&e<65536?e:W}r(Ze,"getOTELPort");function en(n){const e=n.otel?.idleTimeoutSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>0?e:Q}r(en,"getOTELIdleTimeoutSeconds");function nn(n){const e=n.otel?.ensureMinIntervalSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:z}r(nn,"getOTELEnsureMinIntervalSeconds");function tn(n){const e=n.otel?.emitMinIntervalSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:J}r(tn,"getOTELEmitMinIntervalSeconds");function rn(n){const e=n.statusLine?.refreshInterval;if(typeof e=="number"&&Number.isFinite(e)&&e>=1)return e}r(rn,"getStatusLineRefreshInterval");function d(n,e){return e!=null&&typeof e=="object"&&!Array.isArray(e)?e.enable!==!1:j(n)}r(d,"isFeatureEnabledWithCollectorAutoEnable");function vn(n){return n==null||typeof n!="object"||Array.isArray(n)?!1:n.enable!==!1}r(vn,"isPresenceEnabled");function w(n){const e=n.verification;return e==null||typeof e!="object"||Array.isArray(e)?!0:e.enable!==!1}r(w,"getVerificationEnabled");function Z(n){const e=n.verification;return e==null||typeof e!="object"||Array.isArray(e)?!0:e.auto!==!1}r(Z,"getAutoVerifyEnabled");const ee=65536,ne=1;function on(n){const e=n.verificationContext;return e==null||typeof e!="object"||Array.isArray(e)?!0:e.enable!==!1}r(on,"getVerificationContextEnabled");function sn(n){return n.verificationContext?.source==="actions"?"actions":"git"}r(sn,"getVerificationContextSource");function an(n){const e=n.verificationContext?.commitDepth;return typeof e=="number"&&Number.isFinite(e)&&e>=0?Math.floor(e):ne}r(an,"getVerificationContextCommitDepth");function cn(n){const e=n.verificationContext?.maxBytes;return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.floor(e):ee}r(cn,"getVerificationContextMaxBytes");function un(n,e){const t=n.ignoredVerifyPatterns??[];return t.length>0&&y(e,t)}r(un,"isIgnoredVerifyPath");function ln(n){return w(n)?Z(n)?"enforce":"assist":"monitor"}r(ln,"getVerificationMode");function te(n){const e=n.telemetry;return e==null||typeof e!="object"||Array.isArray(e)?!0:e.enable!==!1}r(te,"getTelemetryEnabled");function re(n){const e=n.privacy;return e==null||typeof e!="object"||Array.isArray(e)?!1:e.enable===!0}r(re,"getPrivacyEnabled");const k=65536;function fn(n){const e=n.fileChange;return!e||typeof e!="object"||Array.isArray(e)?!1:e.captureChangeset===!0}r(fn,"getCaptureFileChangeset");function gn(n){const e=n.fileChange;if(!e||typeof e!="object"||Array.isArray(e))return k;const t=e.maxChangesetBytes;return typeof t!="number"||!Number.isFinite(t)||t<=0?k:Math.floor(t)}r(gn,"getMaxChangesetBytes");function dn(n){const e=a(n);return d(e,e.analytics)}r(dn,"isAnalyticsEnabled");function bn(n){const t=a(n).analytics;return t===null||typeof t!="object"||Array.isArray(t)?!0:t.emitOnStop!==!1}r(bn,"isAnalyticsEmitOnStopEnabled");function pn(n){const t=a(n).analytics;if(t===null||typeof t!="object"||Array.isArray(t))return 0;const o=t.emitOnStopMinIntervalSeconds;return typeof o=="number"&&o>=0?o:0}r(pn,"getAnalyticsEmitOnStopMinIntervalSeconds");function En(n){const t=a(n).analytics;return t===null||typeof t!="object"||Array.isArray(t)?!1:t.emitTurnEvents===!0}r(En,"isAnalyticsTurnEventsEnabled");function yn(n){const t=a(n).analytics;return t===null||typeof t!="object"||Array.isArray(t)?!1:t.emitStepEvents===!0}r(yn,"isAnalyticsStepEventsEnabled");function Cn(n){const t=a(n).analytics;return t===null||typeof t!="object"||Array.isArray(t)?!0:t.emitApiRequestEvents!==!1}r(Cn,"isAnalyticsApiRequestEventsEnabled");0&&(module.exports={ALL_CYCLES,CONFIG_TARGETS_BY_PRECEDENCE,CYCLES_ENABLED_BY_DEFAULT,CYCLE_DEFAULT_VERIFY_PATTERNS,CYCLE_TO_SERVER,DEFAULT_BACKEND_ALWAYS_REQUIRED,DEFAULT_BACKEND_EVIDENCE_PATHS,DEFAULT_BACKEND_VERIFY_PATTERNS,DEFAULT_BROWSER_ALWAYS_REQUIRED,DEFAULT_BROWSER_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,getAutoVerifyEnabled,getBackendDevToolsMcpEntry,getCaptureFileChangeset,getClaudeOauthAccessEnabled,getClaudeOauthAccessUsageTtlSeconds,getConfigLayerPaths,getMaxChangesetBytes,getMaxRetries,getMcpServerEntry,getNodeDevToolsMcpEntry,getOTELEmitMinIntervalSeconds,getOTELEnsureMinIntervalSeconds,getOTELIdleTimeoutSeconds,getOTELPort,getPrivacyEnabled,getRequiredToolsConfig,getStatusLineEmitMinIntervalSeconds,getStatusLineRefreshInterval,getStatusLineRenderDefault,getTargetConfigPath,getTelemetryEnabled,getVerificationContextCommitDepth,getVerificationContextEnabled,getVerificationContextMaxBytes,getVerificationContextSource,getVerificationEnabled,getVerificationMode,getVerificationModel,isAnalyticsApiRequestEventsEnabled,isAnalyticsEmitOnStopEnabled,isAnalyticsEnabled,isAnalyticsStepEventsEnabled,isAnalyticsTurnEventsEnabled,isCollectorConfigured,isCycleEnabled,isCyclePatternsActive,isIgnoredVerifyPath,isJobQueueEnabled,isOTELEnabled,isRecordingEnabled,isSessionStatusEnabled,loadConfig,requiresVerification,resolveConfigTargetFromFlags});
1
+ "use strict";var y=Object.defineProperty;var ce=Object.getOwnPropertyDescriptor;var le=Object.getOwnPropertyNames;var ue=Object.prototype.hasOwnProperty;var o=(n,e)=>y(n,"name",{value:e,configurable:!0});var fe=(n,e)=>{for(var t in e)y(n,t,{get:e[t],enumerable:!0})},ge=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of le(e))!ue.call(n,i)&&i!==t&&y(n,i,{get:()=>e[i],enumerable:!(r=ce(e,i))||r.enumerable});return n};var de=n=>ge(y({},"__esModule",{value:!0}),n);var wn={};fe(wn,{ALL_CYCLES:()=>pe,CONFIG_TARGETS_BY_PRECEDENCE:()=>xe,CYCLES_ENABLED_BY_DEFAULT:()=>N,CYCLE_DEFAULT_VERIFY_PATTERNS:()=>U,CYCLE_TOOL_PREFIXES:()=>Ee,CYCLE_TO_SERVER:()=>be,DEFAULT_ANDROID_ALWAYS_REQUIRED:()=>H,DEFAULT_ANDROID_EVIDENCE_PATHS:()=>G,DEFAULT_ANDROID_VERIFY_PATTERNS:()=>V,DEFAULT_BACKEND_ALWAYS_REQUIRED:()=>Y,DEFAULT_BACKEND_EVIDENCE_PATHS:()=>X,DEFAULT_BACKEND_VERIFY_PATTERNS:()=>F,DEFAULT_BROWSER_ALWAYS_REQUIRED:()=>q,DEFAULT_BROWSER_VERIFY_PATTERNS:()=>P,DEFAULT_NODE_ALWAYS_REQUIRED:()=>$,DEFAULT_NODE_EVIDENCE_PATHS:()=>K,DEFAULT_NODE_VERIFY_PATTERNS:()=>M,DEFAULT_OAUTH_USAGE_TTL_SECONDS:()=>J,DEFAULT_OTEL_EMIT_MIN_INTERVAL_SECONDS:()=>te,DEFAULT_OTEL_ENSURE_MIN_INTERVAL_SECONDS:()=>ne,DEFAULT_OTEL_IDLE_TIMEOUT_SECONDS:()=>ee,DEFAULT_OTEL_PORT:()=>Z,DEFAULT_VERIFICATION_CONTEXT_COMMIT_DEPTH:()=>ie,DEFAULT_VERIFICATION_CONTEXT_MAX_BYTES:()=>re,ENV_OVERRIDES:()=>w,OPTIONAL_CYCLES:()=>I,applyEnvOverrides:()=>W,findActiveEnvOverride:()=>he,getActiveCycles:()=>Q,getAnalyticsEmitOnStopMinIntervalSeconds:()=>An,getAndroidDevToolsMcpEntry:()=>Qe,getAutoVerifyEnabled:()=>oe,getBackendDevToolsMcpEntry:()=>We,getCaptureFileChangeset:()=>_n,getClaudeOauthAccessEnabled:()=>on,getClaudeOauthAccessUsageTtlSeconds:()=>rn,getConfigLayerPaths:()=>x,getMaxChangesetBytes:()=>Cn,getMaxRetries:()=>ze,getMcpServerEntry:()=>He,getNodeDevToolsMcpEntry:()=>Ge,getOTELEmitMinIntervalSeconds:()=>un,getOTELEnsureMinIntervalSeconds:()=>ln,getOTELIdleTimeoutSeconds:()=>cn,getOTELPort:()=>an,getPrivacyEnabled:()=>ae,getRequiredToolsConfig:()=>Se,getStatusLineEmitMinIntervalSeconds:()=>tn,getStatusLineRefreshInterval:()=>fn,getStatusLineRenderDefault:()=>nn,getTargetConfigPath:()=>we,getTelemetryEnabled:()=>se,getVerificationContextCommitDepth:()=>pn,getVerificationContextEnabled:()=>gn,getVerificationContextMaxBytes:()=>bn,getVerificationContextSource:()=>dn,getVerificationEnabled:()=>R,getVerificationMode:()=>yn,getVerificationModel:()=>Ce,isAnalyticsApiRequestEventsEnabled:()=>xn,isAnalyticsEmitOnStopEnabled:()=>vn,isAnalyticsEnabled:()=>mn,isAnalyticsStepEventsEnabled:()=>In,isAnalyticsTurnEventsEnabled:()=>Tn,isCollectorConfigured:()=>j,isCycleEnabled:()=>Le,isCyclePatternsActive:()=>z,isIgnoredVerifyPath:()=>En,isJobQueueEnabled:()=>Je,isOTELEnabled:()=>sn,isRecordingEnabled:()=>Ze,isSessionStatusEnabled:()=>en,loadConfig:()=>c,requiresVerification:()=>Be,resolveConfigTargetFromFlags:()=>je});module.exports=de(wn);var E=require("fs"),b=require("path"),T=require("os"),D=require("./logger");const I=["node","backend","android"],pe=["browser",...I],N=new Set(["browser"]),be={browser:"browser-devtools",node:"node-devtools",backend:"backend-devtools",android:"android-devtools"},Ee={browser:"bdt_",node:"ndt_",backend:"bedt_",android:"adt_"},P=["*.ts","*.tsx","*.js","*.jsx","*.mjs","*.cjs","*.vue","*.svelte","*.html","*.htm","*.css","*.scss","*.sass","*.less","*.styl","*.py","*.rb","*.erb","*.go","*.rs","*.java","*.kt","*.kts","*.swift","*.c","*.cpp","*.h","*.hpp","*.cs","*.php","*.dart","*.ex","*.exs","*.erl","*.lua","*.r","*.R","*.scala","*.clj","*.cljs","*.zig","*.nim","*.hbs","*.ejs","*.pug","*.jade","*.astro"],M=["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}"],F=["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}"],V=["android/**/*.{kt,java}","app/src/**/*.{kt,java}","mobile/**/*.{kt,java}","src/main/kotlin/**/*.kt","src/main/java/**/*.java","**/*.{kt,java}","**/res/**/*.xml","**/AndroidManifest.xml"],U={browser:P,node:M,backend:F,android:V},q=["bdt_navigation_go-to","bdt_content_take-screenshot","bdt_a11y_take-aria-snapshot","bdt_o11y_get-console-messages"],$=["ndt_debug_connect"],K=[{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"]}],Y=[],X=[{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"]}]}],H=["adt_device_connect"],G=[{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"]}]}],ye=3;function O(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(O,"loadJsonFile");function _e(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,"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(_e,"assertVerificationShape");function Ce(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(Ce,"getVerificationModel");function me(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(me,"assertTelemetryShape");function ve(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(ve,"assertPrivacyShape");function _(n,e){if(!(n===void 0&&e===void 0))return{...n??{},...e??{}}}o(_,"mergeCycleConfig");function k(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=Ie(n.claude,e.claude),t.verification=Te(n.verification,e.verification),t.verificationContext=Ae(n.verificationContext,e.verificationContext),t}o(k,"mergeConfigLayers");function Ae(n,e){if(!(n===void 0&&e===void 0))return{...n??{},...e??{}}}o(Ae,"mergeVerificationContextConfig");function Te(n,e){if(!(n===void 0&&e===void 0))return{...n??{},...e??{}}}o(Te,"mergeVerificationConfig");function Ie(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??{}}),t}o(Ie,"mergeClaudeConfig");function x(n){return{global:(0,b.join)((0,T.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(x,"getConfigLayerPaths");const xe=["global","project","local"];function we(n,e){const t=x(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(we,"getTargetConfigPath");function je(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(je,"resolveConfigTargetFromFlags");function v(n){const e=O(n);return(0,E.existsSync)(n)&&(_e(e,n),me(e,n),ve(e,n)),e}o(v,"loadAndValidateLayer");const w=[{envVar:"IRONBEE_API_KEY",configPath:"collector.apiKey"},{envVar:"IRONBEE_OAUTH_TOKEN",configPath:"collector.oauthToken"}];function Re(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(Re,"setAtConfigPath");function W(n){let e;for(const t of w){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;Re(e,t.configPath,i)}return e??n}o(W,"applyEnvOverrides");function he(n){for(const e of w){if(e.configPath!==n)continue;const t=process.env[e.envVar];if(t!==void 0&&t.length>0)return e}}o(he,"findActiveEnvOverride");function c(n){const e=x(n),t=v(e.global),r=e.project?v(e.project):{},i=e.local?v(e.local):{},s=k(k(t,r),i);return W(s)}o(c,"loadConfig");function Oe(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(Oe,"globToRegExp");function C(n,e){const t=n.replace(/\\/g,"/");for(const r of e)if(Oe(r).test(t))return!0;return!1}o(C,"matchesAny");function ke(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(ke,"getCycleBlock");function A(n,e){const t=ke(n,e);if(t!==void 0&&t.enable===!1)return[];const r=U[e]??[];if(t===void 0)return N.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(A,"getCyclePatterns");function Q(n,e){const t=e.ignoredVerifyPatterns??[];if(t.length>0&&C(n,t))return[];const r=[];C(n,A(e,"browser"))&&r.push("browser");for(const i of I){const s=A(e,i);s.length>0&&C(n,s)&&r.push(i)}return r}o(Q,"getActiveCycles");function Be(n,e){return Q(n,e).length>0}o(Be,"requiresVerification");function Le(n,e){return R(n)?z(n,e):!1}o(Le,"isCycleEnabled");function z(n,e){return A(n,e).length>0}o(z,"isCyclePatternsActive");function Se(n,e){let t,r;if(e==="browser"?(t=n.browser?.alwaysRequired??q,r=n.browser?.evidencePaths??[]):e==="node"?(t=n.node?.alwaysRequired??$,r=n.node?.evidencePaths??K):e==="backend"?(t=n.backend?.alwaysRequired??Y,r=n.backend?.evidencePaths??X):e==="android"?(t=n.android?.alwaysRequired??H,r=n.android?.evidencePaths??G):(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(Se,"getRequiredToolsConfig");const B="npx",De="^0.11.0",L=["-y",`@ironbee-ai/devtools@${De}`],Ne={TOOL_NAME_PREFIX:"bdt_",TOOL_INPUT_METADATA_ENABLE:"true"},Pe={PLATFORM:"node",TOOL_NAME_PREFIX:"ndt_",TOOL_INPUT_METADATA_ENABLE:"true"},Me={PLATFORM:"backend",TOOL_NAME_PREFIX:"bedt_",TOOL_INPUT_METADATA_ENABLE:"true"},Fe={PLATFORM:"android",TOOL_NAME_PREFIX:"adt_",TOOL_INPUT_METADATA_ENABLE:"true"},Ve={BROWSER_DEVTOOLS_INSTALL_CHROMIUM:"true"},Ue={},qe={},$e={};function Ke(n){return se(n)?{}:{TELEMETRY_ENABLE:"false"}}o(Ke,"buildTelemetryEnv");function Ye(n){return ae(n)?{COLLECTOR_EVENTS_TOOL_DETAILS_ENABLE:"false",COLLECTOR_ARTIFACTS_ENABLE:"false"}:{}}o(Ye,"buildPrivacyEnv");function Xe(n,e){if(!j(n))return{};const t=n.collector,i=O((0,b.join)((0,T.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(Xe,"buildOTELEnv");function m(n,e,t,r,i){const s=Xe(n,i),l=Ke(n),a=Ye(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:B,args:[...L],env:{...r,...s,...l,...a,...h,...t}}}return{command:B,args:[...L],env:{...r,...s,...l,...a,...t}}}o(m,"buildMcpEntry");function He(n){const e=c(n);return m(e,"browserDevTools",Ne,Ve,"browser")}o(He,"getMcpServerEntry");function Ge(n){const e=c(n);return m(e,"nodeDevTools",Pe,Ue,"node")}o(Ge,"getNodeDevToolsMcpEntry");function We(n){const e=c(n);return m(e,"backendDevTools",Me,qe,"backend")}o(We,"getBackendDevToolsMcpEntry");function Qe(n){const e=c(n);return m(e,"androidDevTools",Fe,$e,"android")}o(Qe,"getAndroidDevToolsMcpEntry");function ze(n){return typeof n.maxRetries=="number"&&n.maxRetries>0?n.maxRetries:ye}o(ze,"getMaxRetries");function j(n){if(process.env.IRONBEE_COLLECTOR==="false")return!1;const e=n.collector;if(!e||e.enable===!1||typeof e.url!="string"||e.url.length===0)return!1;const t=typeof e.oauthToken=="string"&&e.oauthToken.length>0,r=typeof e.apiKey=="string"&&e.apiKey.length>0;return!(!t&&!r)}o(j,"isCollectorConfigured");function Je(n){const e=c(n);return p(e,e.jobQueue)}o(Je,"isJobQueueEnabled");function Ze(n){const e=c(n);return p(e,e.recording)}o(Ze,"isRecordingEnabled");function en(n){return p(n,n.statusLine)}o(en,"isSessionStatusEnabled");function nn(n){const e=n.statusLine;return e!==void 0&&e.renderDefault===!0}o(nn,"getStatusLineRenderDefault");function tn(n){const e=n.statusLine?.emitMinIntervalSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:10}o(tn,"getStatusLineEmitMinIntervalSeconds");const J=60;function on(n){return n.claude?.oauthAccess?.enable!==!1}o(on,"getClaudeOauthAccessEnabled");function rn(n){const e=n.claude?.oauthAccess?.usageTtlSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:J}o(rn,"getClaudeOauthAccessUsageTtlSeconds");const Z=15986,ee=600,ne=30,te=0;function sn(n){return p(n,n.otel)}o(sn,"isOTELEnabled");function an(n){const e=n.otel?.port;return typeof e=="number"&&Number.isInteger(e)&&e>0&&e<65536?e:Z}o(an,"getOTELPort");function cn(n){const e=n.otel?.idleTimeoutSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>0?e:ee}o(cn,"getOTELIdleTimeoutSeconds");function ln(n){const e=n.otel?.ensureMinIntervalSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:ne}o(ln,"getOTELEnsureMinIntervalSeconds");function un(n){const e=n.otel?.emitMinIntervalSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:te}o(un,"getOTELEmitMinIntervalSeconds");function fn(n){const e=n.statusLine?.refreshInterval;if(typeof e=="number"&&Number.isFinite(e)&&e>=1)return e}o(fn,"getStatusLineRefreshInterval");function p(n,e){return e!=null&&typeof e=="object"&&!Array.isArray(e)?e.enable!==!1:j(n)}o(p,"isFeatureEnabledWithCollectorAutoEnable");function Rn(n){return n==null||typeof n!="object"||Array.isArray(n)?!1:n.enable!==!1}o(Rn,"isPresenceEnabled");function R(n){const e=n.verification;return e==null||typeof e!="object"||Array.isArray(e)?!0:e.enable!==!1}o(R,"getVerificationEnabled");function oe(n){const e=n.verification;return e==null||typeof e!="object"||Array.isArray(e)?!0:e.auto!==!1}o(oe,"getAutoVerifyEnabled");const re=65536,ie=1;function gn(n){const e=n.verificationContext;return e==null||typeof e!="object"||Array.isArray(e)?!0:e.enable!==!1}o(gn,"getVerificationContextEnabled");function dn(n){return n.verificationContext?.source==="actions"?"actions":"git"}o(dn,"getVerificationContextSource");function pn(n){const e=n.verificationContext?.commitDepth;return typeof e=="number"&&Number.isFinite(e)&&e>=0?Math.floor(e):ie}o(pn,"getVerificationContextCommitDepth");function bn(n){const e=n.verificationContext?.maxBytes;return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.floor(e):re}o(bn,"getVerificationContextMaxBytes");function En(n,e){const t=n.ignoredVerifyPatterns??[];return t.length>0&&C(e,t)}o(En,"isIgnoredVerifyPath");function yn(n){return R(n)?oe(n)?"enforce":"assist":"monitor"}o(yn,"getVerificationMode");function se(n){const e=n.telemetry;return e==null||typeof e!="object"||Array.isArray(e)?!0:e.enable!==!1}o(se,"getTelemetryEnabled");function ae(n){const e=n.privacy;return e==null||typeof e!="object"||Array.isArray(e)?!1:e.enable===!0}o(ae,"getPrivacyEnabled");const S=65536;function _n(n){const e=n.fileChange;return!e||typeof e!="object"||Array.isArray(e)?!1:e.captureChangeset===!0}o(_n,"getCaptureFileChangeset");function Cn(n){const e=n.fileChange;if(!e||typeof e!="object"||Array.isArray(e))return S;const t=e.maxChangesetBytes;return typeof t!="number"||!Number.isFinite(t)||t<=0?S:Math.floor(t)}o(Cn,"getMaxChangesetBytes");function mn(n){const e=c(n);return p(e,e.analytics)}o(mn,"isAnalyticsEnabled");function vn(n){const t=c(n).analytics;return t===null||typeof t!="object"||Array.isArray(t)?!0:t.emitOnStop!==!1}o(vn,"isAnalyticsEmitOnStopEnabled");function An(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(An,"getAnalyticsEmitOnStopMinIntervalSeconds");function Tn(n){const t=c(n).analytics;return t===null||typeof t!="object"||Array.isArray(t)?!1:t.emitTurnEvents===!0}o(Tn,"isAnalyticsTurnEventsEnabled");function In(n){const t=c(n).analytics;return t===null||typeof t!="object"||Array.isArray(t)?!1:t.emitStepEvents===!0}o(In,"isAnalyticsStepEventsEnabled");function xn(n){const t=c(n).analytics;return t===null||typeof t!="object"||Array.isArray(t)?!0:t.emitApiRequestEvents!==!1}o(xn,"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_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,getConfigLayerPaths,getMaxChangesetBytes,getMaxRetries,getMcpServerEntry,getNodeDevToolsMcpEntry,getOTELEmitMinIntervalSeconds,getOTELEnsureMinIntervalSeconds,getOTELIdleTimeoutSeconds,getOTELPort,getPrivacyEnabled,getRequiredToolsConfig,getStatusLineEmitMinIntervalSeconds,getStatusLineRefreshInterval,getStatusLineRenderDefault,getTargetConfigPath,getTelemetryEnabled,getVerificationContextCommitDepth,getVerificationContextEnabled,getVerificationContextMaxBytes,getVerificationContextSource,getVerificationEnabled,getVerificationMode,getVerificationModel,isAnalyticsApiRequestEventsEnabled,isAnalyticsEmitOnStopEnabled,isAnalyticsEnabled,isAnalyticsStepEventsEnabled,isAnalyticsTurnEventsEnabled,isCollectorConfigured,isCycleEnabled,isCyclePatternsActive,isIgnoredVerifyPath,isJobQueueEnabled,isOTELEnabled,isRecordingEnabled,isSessionStatusEnabled,loadConfig,requiresVerification,resolveConfigTargetFromFlags});
@@ -0,0 +1 @@
1
+ "use strict";var r=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var L=(e,S)=>{for(var o in S)r(e,o,{get:S[o],enumerable:!0})},N=(e,S,o,t)=>{if(S&&typeof S=="object"||typeof S=="function")for(let n of E(S))!I.call(e,n)&&n!==o&&r(e,n,{get:()=>S[n],enumerable:!(t=A(S,n))||t.enumerable});return e};var _=e=>N(r({},"__esModule",{value:!0}),e);var c={};L(c,{INSTALL_SCHEMA_VERSION:()=>b});module.exports=_(c);const b=2;0&&(module.exports={INSTALL_SCHEMA_VERSION});
@@ -1,6 +1,7 @@
1
- "use strict";var h=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var a=(e,n)=>h(e,"name",{value:n,configurable:!0});var O=(e,n)=>{for(var t in n)h(e,t,{get:n[t],enumerable:!0})},j=(e,n,t,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of F(n))!T.call(e,r)&&r!==t&&h(e,r,{get:()=>n[r],enumerable:!(i=E(n,r))||i.enumerable});return e};var B=e=>j(h({},"__esModule",{value:!0}),e);var _={};O(_,{PLATFORM_TARGETS:()=>v,applyPlatformSection:()=>R,applyPlatformToProjectFiles:()=>P,fragmentFilename:()=>$,readFragment:()=>A,syncPlatformSectionsToConfig:()=>C,togglePlatformSectionInFile:()=>w});module.exports=B(_);var c=require("fs"),y=require("./logger"),p=require("./config");const S={browser:["<!-- Browser cycle verification is OFF for this project."," - To verify frontend / UI changes by driving a real browser (DOM, console,"," screenshots, accessibility, network): run `ironbee browser enable` to enable."," This file will be auto-updated with the browser-cycle guidance."," - When OFF, do NOT invoke any `bdt_*` tools voluntarily \u2014 there is no"," active browser-cycle gate, so calling them only wastes cycles. -->"].join(`
1
+ "use strict";var p=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var l=(e,n)=>p(e,"name",{value:n,configurable:!0});var O=(e,n)=>{for(var t in n)p(e,t,{get:n[t],enumerable:!0})},j=(e,n,t,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of E(n))!T.call(e,r)&&r!==t&&p(e,r,{get:()=>n[r],enumerable:!(i=F(n,r))||i.enumerable});return e};var B=e=>j(p({},"__esModule",{value:!0}),e);var _={};O(_,{PLATFORM_TARGETS:()=>v,applyPlatformSection:()=>R,applyPlatformToProjectFiles:()=>P,fragmentFilename:()=>$,readFragment:()=>A,syncPlatformSectionsToConfig:()=>C,togglePlatformSectionInFile:()=>w});module.exports=B(_);var c=require("fs"),y=require("./logger"),h=require("./config");const S={browser:["<!-- Browser cycle verification is OFF for this project."," - To verify frontend / UI changes by driving a real browser (DOM, console,"," screenshots, accessibility, network): run `ironbee browser enable` to enable."," This file will be auto-updated with the browser-cycle guidance."," - When OFF, do NOT invoke any `bdt_*` tools voluntarily \u2014 there is no"," active browser-cycle gate, so calling them only wastes cycles. -->"].join(`
2
2
  `),node:["<!-- Node.js runtime debug verification is OFF for this project."," - If your backend is Node.js and you want non-blocking debugger probes:"," run `ironbee node enable` to enable. This file will be auto-updated"," with the node-cycle guidance."," - If your backend isn't Node.js (Java / Python / Go / Rust / .NET / Ruby / PHP / Elixir / \u2026):"," leave this OFF \u2014 `ndt_*` tools only attach to V8/Node processes and will fail elsewhere."," - When OFF, do NOT invoke any `ndt_*` tools voluntarily. -->"].join(`
3
3
  `),backend:["<!-- Backend protocol verification is OFF for this project."," - To verify backend services by driving real protocol calls (HTTP / gRPC /"," GraphQL / WebSocket) \u2014 runtime- and language-agnostic \u2014 run `ironbee"," backend enable`. This file will be auto-updated with the backend-cycle"," guidance."," - When OFF, do NOT invoke any `bedt_*` tools voluntarily. -->"].join(`
4
- `)};function M(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(M,"escapeRegex");function I(e){return new RegExp(`<!--IRONBEE:PLATFORM:${M(e)}(?::([\\w-]+))?-->`,"g")}a(I,"startMarkerRegex");function L(e,n){return n.length>0?`<!--/IRONBEE:PLATFORM:${e}:${n}-->`:`<!--/IRONBEE:PLATFORM:${e}-->`}a(L,"endMarkerFor");function N(e,n,t){const i=I(n),r=[],d=new Set;let s=i.exec(e);for(;s!==null;){const o=s[1]??"",l=s.index+s[0].length,f=L(n,o),b=e.indexOf(f,l);if(b===-1){const g=t?` in ${t}`:"",u=o.length>0?`${n}:${o}`:n;y.logger.debug(`platform-section ${u}: start marker found without matching end marker${g}`),s=i.exec(e);continue}if(d.has(o)){const g=t?` in ${t}`:"",u=o.length>0?`${n}:${o}`:n;y.logger.warn(`platform-section ${u}: multiple marker blocks with the same key${g} \u2014 only the first will be updated. Either consolidate the blocks or use distinct keys (\`IRONBEE:PLATFORM:${n}:<key>\`) per position.`),s=i.exec(e);continue}d.add(o),r.push({key:o,startEnd:l,endIdx:b}),s=i.exec(e)}return r}a(N,"findMarkerBlocks");function R(e,n,t,i){const r=typeof t=="function"?t:()=>t,d=N(e,n,i);if(d.length===0)return e;const s=S[n];if(s===void 0)throw new Error(`No placeholder registered for platform '${n}'.`);let o=e;for(let l=d.length-1;l>=0;l--){const f=d[l],b=r(f.key)??s,g=o.substring(0,f.startEnd),u=o.substring(f.endIdx);o=`${g}
4
+ `),android:["<!-- Android mobile verification is OFF for this project."," - To verify Android app changes by driving a real device or emulator (UI"," interactions, Logcat, screenshots): run `ironbee android enable`."," This file will be auto-updated with the android-cycle guidance."," - When OFF, do NOT invoke any `adt_*` tools voluntarily. -->"].join(`
5
+ `)};function I(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}l(I,"escapeRegex");function L(e){return new RegExp(`<!--IRONBEE:PLATFORM:${I(e)}(?::([\\w-]+))?-->`,"g")}l(L,"startMarkerRegex");function M(e,n){return n.length>0?`<!--/IRONBEE:PLATFORM:${e}:${n}-->`:`<!--/IRONBEE:PLATFORM:${e}-->`}l(M,"endMarkerFor");function N(e,n,t){const i=L(n),r=[],d=new Set;let s=i.exec(e);for(;s!==null;){const o=s[1]??"",a=s.index+s[0].length,f=M(n,o),b=e.indexOf(f,a);if(b===-1){const g=t?` in ${t}`:"",u=o.length>0?`${n}:${o}`:n;y.logger.debug(`platform-section ${u}: start marker found without matching end marker${g}`),s=i.exec(e);continue}if(d.has(o)){const g=t?` in ${t}`:"",u=o.length>0?`${n}:${o}`:n;y.logger.warn(`platform-section ${u}: multiple marker blocks with the same key${g} \u2014 only the first will be updated. Either consolidate the blocks or use distinct keys (\`IRONBEE:PLATFORM:${n}:<key>\`) per position.`),s=i.exec(e);continue}d.add(o),r.push({key:o,startEnd:a,endIdx:b}),s=i.exec(e)}return r}l(N,"findMarkerBlocks");function R(e,n,t,i){const r=typeof t=="function"?t:()=>t,d=N(e,n,i);if(d.length===0)return e;const s=S[n];if(s===void 0)throw new Error(`No placeholder registered for platform '${n}'.`);let o=e;for(let a=d.length-1;a>=0;a--){const f=d[a],b=r(f.key)??s,g=o.substring(0,f.startEnd),u=o.substring(f.endIdx);o=`${g}
5
6
  ${b}
6
- ${u}`}return o}a(R,"applyPlatformSection");function $(e,n,t){return t.length>0?`${e}.${n}.${t}.md`:`${e}.${n}.md`}a($,"fragmentFilename");function A(e,n){const t=`${e}/${n}`;if(!(0,c.existsSync)(t))throw new Error(`Platform fragment not found: ${t}`);return(0,c.readFileSync)(t,"utf-8").trimEnd()}a(A,"readFragment");function w(e,n,t){if(!(0,c.existsSync)(e))return!1;const i=(0,c.readFileSync)(e,"utf-8"),r=R(i,n,t,e);return r===i?!1:((0,c.writeFileSync)(e,r),!0)}a(w,"togglePlatformSectionInFile");const v={claude:[{projectRelativePath:".claude/agents/ironbee-verifier.md",fragmentBase:"skill"}],cursor:[{projectRelativePath:".cursor/skills/ironbee-verification.md",fragmentBase:"skill"},{projectRelativePath:".cursor/rules/ironbee-verification.mdc",fragmentBase:"rule"},{projectRelativePath:".cursor/skills/ironbee-verify/SKILL.md",fragmentBase:"command-verify"}],codex:[{projectRelativePath:".agents/skills/ironbee-verification/SKILL.md",fragmentBase:"skill"},{projectRelativePath:".agents/skills/ironbee-verify/SKILL.md",fragmentBase:"command-verify"}]};function P(e,n,t,i,r){const d=[],s=Object.keys(v),o=r===void 0?s:s.filter(l=>r.includes(l));for(const l of o){const f=v[l],b=i(l);for(const g of f){const u=`${e}/${g.projectRelativePath}`;if(!(0,c.existsSync)(u))continue;w(u,n,t?m=>{const k=`${b}/${$(g.fragmentBase,n,m)}`;if(!(0,c.existsSync)(k)){const x=m.length>0?`${n}:${m}`:n;return y.logger.warn(`platform-section ${x}: missing fragment ${k} for ${g.projectRelativePath} \u2014 falling back to placeholder.`),null}return(0,c.readFileSync)(k,"utf-8").trimEnd()}:null)&&d.push(g.projectRelativePath)}}return d}a(P,"applyPlatformToProjectFiles");function C(e,n){const t=(0,p.loadConfig)(e);for(const i of p.ALL_CYCLES){const r=(0,p.isCycleEnabled)(t,i);P(e,i,r,n)}}a(C,"syncPlatformSectionsToConfig");0&&(module.exports={PLATFORM_TARGETS,applyPlatformSection,applyPlatformToProjectFiles,fragmentFilename,readFragment,syncPlatformSectionsToConfig,togglePlatformSectionInFile});
7
+ ${u}`}return o}l(R,"applyPlatformSection");function $(e,n,t){return t.length>0?`${e}.${n}.${t}.md`:`${e}.${n}.md`}l($,"fragmentFilename");function A(e,n){const t=`${e}/${n}`;if(!(0,c.existsSync)(t))throw new Error(`Platform fragment not found: ${t}`);return(0,c.readFileSync)(t,"utf-8").trimEnd()}l(A,"readFragment");function w(e,n,t){if(!(0,c.existsSync)(e))return!1;const i=(0,c.readFileSync)(e,"utf-8"),r=R(i,n,t,e);return r===i?!1:((0,c.writeFileSync)(e,r),!0)}l(w,"togglePlatformSectionInFile");const v={claude:[{projectRelativePath:".claude/agents/ironbee-verifier.md",fragmentBase:"skill"}],cursor:[{projectRelativePath:".cursor/skills/ironbee-verification.md",fragmentBase:"skill"},{projectRelativePath:".cursor/rules/ironbee-verification.mdc",fragmentBase:"rule"},{projectRelativePath:".cursor/skills/ironbee-verify/SKILL.md",fragmentBase:"command-verify"}],codex:[{projectRelativePath:".agents/skills/ironbee-verification/SKILL.md",fragmentBase:"skill"},{projectRelativePath:".agents/skills/ironbee-verify/SKILL.md",fragmentBase:"command-verify"}]};function P(e,n,t,i,r){const d=[],s=Object.keys(v),o=r===void 0?s:s.filter(a=>r.includes(a));for(const a of o){const f=v[a],b=i(a);for(const g of f){const u=`${e}/${g.projectRelativePath}`;if(!(0,c.existsSync)(u))continue;w(u,n,t?m=>{const k=`${b}/${$(g.fragmentBase,n,m)}`;if(!(0,c.existsSync)(k)){const x=m.length>0?`${n}:${m}`:n;return y.logger.warn(`platform-section ${x}: missing fragment ${k} for ${g.projectRelativePath} \u2014 falling back to placeholder.`),null}return(0,c.readFileSync)(k,"utf-8").trimEnd()}:null)&&d.push(g.projectRelativePath)}}return d}l(P,"applyPlatformToProjectFiles");function C(e,n){const t=(0,h.loadConfig)(e);for(const i of h.ALL_CYCLES){const r=(0,h.isCycleEnabled)(t,i);P(e,i,r,n)}}l(C,"syncPlatformSectionsToConfig");0&&(module.exports={PLATFORM_TARGETS,applyPlatformSection,applyPlatformToProjectFiles,fragmentFilename,readFragment,syncPlatformSectionsToConfig,togglePlatformSectionInFile});
@@ -1,6 +1,6 @@
1
- "use strict";var f=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var K=Object.prototype.hasOwnProperty;var a=(e,n)=>f(e,"name",{value:n,configurable:!0});var A=(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))!K.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 k={};A(k,{isInteractive:()=>h,keyToMultiSelectAction:()=>y,promptChoice:()=>N,promptMultiSelect:()=>T,promptSelect:()=>j,promptYesNo:()=>L,reduceMultiSelect:()=>M,renderMultiSelect:()=>v,renderSelect:()=>x});module.exports=E(k);var p=require("readline"),l=require("./output");function h(){return!!process.stdin.isTTY&&!!process.stdout.isTTY}a(h,"isInteractive");function N(e,n,o=0){const i=[e,...n.map((t,u)=>{const c=u===o?" (default)":"";return` ${u+1}) ${t}${c}`})].join(`
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(`
2
2
  `)+`
3
- > `,s=(0,p.createInterface)({input:process.stdin,output:process.stdout});return new Promise(t=>{s.question(i,u=>{s.close();const c=u.trim();if(c.length===0){t(o);return}const m=Number.parseInt(c,10);if(!Number.isNaN(m)&&m>=1&&m<=n.length){t(m-1);return}const d=n.findIndex(b=>b.toLowerCase()===c.toLowerCase());if(d!==-1){t(d);return}t(o)})})}a(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)})})}a(L,"promptYesNo");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"cancel";default:return"none"}}a(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}}a(M,"reduceMultiSelect");function g(e,n,o){return`${o(l.pc.bold(e))} ${l.pc.dim(n)}`}a(g,"keyHint");const w=l.pc.dim(" \xB7 ");function v(e,n,o){const r=n.reduce((t,u)=>Math.max(t,u.label.length),0),i=" "+[g("\u2191/\u2193","move",l.pc.cyan),g("space","select",l.pc.yellow),g("a","all",l.pc.magenta),g("enter","confirm",l.pc.green)].join(w),s=[e,i];return n.forEach((t,u)=>{const c=u===o.cursor,m=c?l.pc.cyan(">"):" ",d=o.selected.has(u)?l.pc.yellow("[x]"):"[ ]",b=c?l.pc.bold(t.label.padEnd(r)):t.label.padEnd(r),R=t.hint?" "+l.pc.dim(t.hint):"";s.push(`${m} ${d} ${b}${R}`)}),s}a(v,"renderMultiSelect");function T(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(()=>v(e,n,i),u=>u==="cancel"?"cancel":u==="submit"?"submit":M(i,u)?"redraw":"ignore",()=>s([...i.selected].sort((u,c)=>u-c)))||s([...r])})}a(T,"promptMultiSelect");function x(e,n,o){const r=n.reduce((t,u)=>Math.max(t,u.label.length),0),i=" "+[g("\u2191/\u2193","move",l.pc.cyan),g("enter","select",l.pc.green)].join(w),s=[e,i];return n.forEach((t,u)=>{const c=u===o,m=c?l.pc.cyan(">"):" ",d=c?l.pc.bold(t.label.padEnd(r)):t.label.padEnd(r),b=t.hint?" "+l.pc.dim(t.hint):"";s.push(`${m} ${d}${b}`)}),s}a(x,"renderSelect");function j(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)})}a(j,"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=a(m=>{!m&&s>0&&i.write(`\x1B[${s}A`),i.write("\x1B[0J");const d=e();i.write(d.join(`
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(`
4
4
  `)+`
5
- `),s=d.length},"draw"),u=a(()=>{r.removeListener("keypress",c),typeof r.setRawMode=="function"&&r.setRawMode(!1),r.pause()},"cleanup"),c=a((m,d)=>{if(!d)return;const b=n(y(d));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",c),t(!0),!0}a(S,"runRawKeypressUI");0&&(module.exports={isInteractive,keyToMultiSelectAction,promptChoice,promptMultiSelect,promptSelect,promptYesNo,reduceMultiSelect,renderMultiSelect,renderSelect});
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});
@@ -0,0 +1 @@
1
+ "use strict";var l=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var i=(o,r)=>l(o,"name",{value:r,configurable:!0});var u=(o,r)=>{for(var t in r)l(o,t,{get:r[t],enumerable:!0})},R=(o,r,t,c)=>{if(r&&typeof r=="object"||typeof r=="function")for(let e of T(r))!C.call(o,e)&&e!==t&&l(o,e,{get:()=>r[e],enumerable:!(c=d(r,e))||c.enumerable});return o};var a=o=>R(l({},"__esModule",{value:!0}),o);var y={};u(y,{RECORDING_CYCLES:()=>g,listRecordingCycleTools:()=>s,recordingToolsForBareTool:()=>f,recordingToolsForServer:()=>p});module.exports=a(y);var n=require("./config");const g=["browser","android"];function s(){return g.map(o=>({cycle:o,server:n.CYCLE_TO_SERVER[o],startTool:`${n.CYCLE_TOOL_PREFIXES[o]}content_start-recording`,stopTool:`${n.CYCLE_TOOL_PREFIXES[o]}content_stop-recording`}))}i(s,"listRecordingCycleTools");function p(o){return o?s().find(r=>r.server===o)??null:null}i(p,"recordingToolsForServer");function f(o){return s().find(r=>o.startsWith(n.CYCLE_TOOL_PREFIXES[r.cycle]))??null}i(f,"recordingToolsForBareTool");0&&(module.exports={RECORDING_CYCLES,listRecordingCycleTools,recordingToolsForBareTool,recordingToolsForServer});
@@ -0,0 +1,2 @@
1
+ "use strict";var a=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var s=(e,n)=>a(e,"name",{value:n,configurable:!0});var b=(e,n)=>{for(var t in n)a(e,t,{get:n[t],enumerable:!0})},w=(e,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of S(n))!l.call(e,i)&&i!==t&&a(e,i,{get:()=>n[i],enumerable:!(o=h(n,i))||o.enumerable});return e};var E=e=>w(a({},"__esModule",{value:!0}),e);var R={};b(R,{UNSYNCED_SCHEMA_VERSION:()=>c,isAutoRerenderDisabled:()=>N,readSyncedSchemaVersion:()=>k,schemaSyncStatePath:()=>f,writeSyncedSchemaVersion:()=>O});module.exports=E(R);var r=require("fs"),p=require("os"),m=require("path"),u=require("./logger");const c=0;function d(e){return e!==void 0&&e!==""&&e!=="0"&&e.toLowerCase()!=="false"}s(d,"envFlagOn");function N(){return d(process.env.IRONBEE_NO_AUTO_RERENDER)||d(process.env.CI)}s(N,"isAutoRerenderDisabled");function g(){return(0,m.join)((0,p.homedir)(),".ironbee")}s(g,"schemaSyncDir");function f(){return(0,m.join)(g(),"install-state.json")}s(f,"schemaSyncStatePath");function k(){const e=f();if(!(0,r.existsSync)(e))return c;try{const n=(0,r.readFileSync)(e,"utf-8");if(n.trim().length===0)return c;const t=JSON.parse(n);if(t===null||typeof t!="object")return u.logger.debug(`schema-sync: ${e} is not a JSON object \u2014 ignoring`),c;const o=t.schemaVersion;return typeof o!="number"||!Number.isFinite(o)?c:o}catch(n){return u.logger.debug(`schema-sync: failed to read ${e}: ${n instanceof Error?n.message:n}`),c}}s(k,"readSyncedSchemaVersion");function O(e){try{const n=g();(0,r.mkdirSync)(n,{recursive:!0});const t=f(),o=`${t}.tmp.${process.pid}.${Date.now()}`,i=JSON.stringify({schemaVersion:e},null,2)+`
2
+ `;try{(0,r.writeFileSync)(o,i),(0,r.renameSync)(o,t)}catch(y){try{(0,r.existsSync)(o)&&(0,r.unlinkSync)(o)}catch{}throw y}}catch(n){u.logger.debug(`schema-sync: write failed: ${n instanceof Error?n.message:n}`)}}s(O,"writeSyncedSchemaVersion");0&&(module.exports={UNSYNCED_SCHEMA_VERSION,isAutoRerenderDisabled,readSyncedSchemaVersion,schemaSyncStatePath,writeSyncedSchemaVersion});
@@ -1 +1 @@
1
- "use strict";var c=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var l=(t,n)=>c(t,"name",{value:n,configurable:!0});var x=(t,n)=>{for(var o in n)c(t,o,{get:n[o],enumerable:!0})},N=(t,n,o,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of w(n))!S.call(t,e)&&e!==o&&c(t,e,{get:()=>n[e],enumerable:!(r=h(n,e))||r.enumerable});return t};var P=t=>N(c({},"__esModule",{value:!0}),t);var k={};x(k,{checkForUpdates:()=>$,compareVersions:()=>b,fetchLatestVersion:()=>f,getLocalVersion:()=>d});module.exports=P(k);var p=require("https"),u=require("fs"),m=require("path"),i=require("./output");function d(){try{return JSON.parse((0,u.readFileSync)((0,m.join)(__dirname,"../../package.json"),"utf-8")).version}catch{return"0.0.0"}}l(d,"getLocalVersion");function f(){return new Promise(t=>{const n=(0,p.get)("https://registry.npmjs.org/@ironbee-ai%2fcli/latest",{timeout:3e3},o=>{let r="";o.on("data",e=>{r+=e.toString()}),o.on("end",()=>{try{const e=JSON.parse(r);t(e.version)}catch{t(null)}})});n.on("error",()=>{t(null)}),n.on("timeout",()=>{n.destroy(),t(null)})})}l(f,"fetchLatestVersion");function b(t,n){const o=t.split(".").map(Number),r=n.split(".").map(Number);for(let e=0;e<3;e++){const s=o[e]??0,a=r[e]??0;if(s>a)return 1;if(s<a)return-1}return 0}l(b,"compareVersions");async function $(){const t=d(),n=await f();if(n&&b(n,t)>0){const o=` Update available: ${t} \u2192 ${n}`,r=" Run npm install -g @ironbee-ai/cli to update",e=Math.max(o.length,r.length)+2,s=` Update available: ${i.pc.dim(t)} \u2192 ${i.pc.green(n)}`,a=` Run ${i.pc.cyan("npm install -g @ironbee-ai/cli")} to update`,v=" ".repeat(e-o.length),y=" ".repeat(e-r.length),g="\u2500".repeat(e);console.log(),console.log(i.pc.yellow(" \u250C"+g+"\u2510")),console.log(i.pc.yellow(" \u2502")+s+v+i.pc.yellow("\u2502")),console.log(i.pc.yellow(" \u2502")+a+y+i.pc.yellow("\u2502")),console.log(i.pc.yellow(" \u2514"+g+"\u2518")),console.log()}}l($,"checkForUpdates");0&&(module.exports={checkForUpdates,compareVersions,fetchLatestVersion,getLocalVersion});
1
+ "use strict";var c=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var s=(e,n)=>c(e,"name",{value:n,configurable:!0});var P=(e,n)=>{for(var o in n)c(e,o,{get:n[o],enumerable:!0})},S=(e,n,o,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of w(n))!N.call(e,t)&&t!==o&&c(e,t,{get:()=>n[t],enumerable:!(r=h(n,t))||r.enumerable});return e};var x=e=>S(c({},"__esModule",{value:!0}),e);var $={};P($,{checkForUpdates:()=>R,compareVersions:()=>b,fetchLatestVersion:()=>f,getLocalVersion:()=>m});module.exports=x($);var u=require("https"),p=require("fs"),d=require("path"),i=require("./output");function m(){try{return JSON.parse((0,p.readFileSync)((0,d.join)(__dirname,"../../package.json"),"utf-8")).version}catch{return"0.0.0"}}s(m,"getLocalVersion");function f(){return new Promise(e=>{const n=(0,u.get)("https://registry.npmjs.org/@ironbee-ai%2fcli/latest",{timeout:3e3},o=>{let r="";o.on("data",t=>{r+=t.toString()}),o.on("end",()=>{try{const t=JSON.parse(r);e(t.version)}catch{e(null)}})});n.on("error",()=>{e(null)}),n.on("timeout",()=>{n.destroy(),e(null)})})}s(f,"fetchLatestVersion");function b(e,n){const o=e.split(".").map(Number),r=n.split(".").map(Number);for(let t=0;t<3;t++){const l=o[t]??0,a=r[t]??0;if(l>a)return 1;if(l<a)return-1}return 0}s(b,"compareVersions");async function R(){if(process.env.IRONBEE_UPDATE_CHECK==="false")return;const e=m(),n=await f();if(n&&b(n,e)>0){const o=` Update available: ${e} \u2192 ${n}`,r=" Run ironbee update to upgrade",t=Math.max(o.length,r.length)+2,l=` Update available: ${i.pc.dim(e)} \u2192 ${i.pc.green(n)}`,a=` Run ${i.pc.cyan("ironbee update")} to upgrade`,v=" ".repeat(t-o.length),y=" ".repeat(t-r.length),g="\u2500".repeat(t);console.log(),console.log(i.pc.yellow(" \u250C"+g+"\u2510")),console.log(i.pc.yellow(" \u2502")+l+v+i.pc.yellow("\u2502")),console.log(i.pc.yellow(" \u2502")+a+y+i.pc.yellow("\u2502")),console.log(i.pc.yellow(" \u2514"+g+"\u2518")),console.log()}}s(R,"checkForUpdates");0&&(module.exports={checkForUpdates,compareVersions,fetchLatestVersion,getLocalVersion});
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var e=require("../lib/telemetry");(0,e.trackNpmInstall)().then(()=>process.exit(0)).catch(()=>process.exit(0));
2
+ "use strict";var s=Object.create;var a=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var p=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty;var c=(n,t)=>a(n,"name",{value:t,configurable:!0});var d=(n,t,o,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of m(t))!u.call(n,i)&&i!==o&&a(n,i,{get:()=>t[i],enumerable:!(e=l(t,i))||e.enumerable});return n};var f=(n,t,o)=>(o=n!=null?s(p(n)):{},d(t||!n||!n.__esModule?a(o,"default",{value:n,enumerable:!0}):o,n));var r=require("../lib/telemetry");function h(){const n=process.env.npm_config_global;return n==="true"||n==="1"}c(h,"isGlobalNpmInstall");async function g(){try{await(0,r.trackNpmInstall)()}catch{}if(h())try{const{syncSchemaIfChanged:n}=await Promise.resolve().then(()=>f(require("../commands/install")));await n()}catch{}}c(g,"run"),g().then(()=>process.exit(0)).catch(()=>process.exit(0));
@@ -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,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of u(t))!h.call(e,i)&&i!==o&&a(e,i,{get:()=>t[i],enumerable:!(r=p(t,i))||r.enumerable});return e};var b=e=>y(a({},"__esModule",{value:!0}),e);var T={};g(T,{ARTIFACT_AFFECTING_TOP_KEYS:()=>m,CONFIG_SCHEMA:()=>d,GROUP_ORDER:()=>s,GROUP_TITLES:()=>f,findSchemaEntry:()=>A,groupOf:()=>c,groupRank:()=>l,groupTitle:()=>w,orderedEntries:()=>k,topKey:()=>v});module.exports=b(T);const m=new Set(["verification","collector","browser","node","backend","browserDevTools","nodeDevTools","backendDevTools","telemetry","privacy","statusLine","otel"]),s=["general","verification","verificationContext","browser","node","backend","collector","recording","jobQueue","analytics","statusLine","claude","telemetry","privacy","otel","fileChange","import","browserDevTools","nodeDevTools","backendDevTools"],f={general:"General",verification:"Verification",verificationContext:"Verification context",browser:"Browser cycle",node:"Node cycle",backend:"Backend cycle",collector:"Collector",recording:"Recording",jobQueue:"Job queue",analytics:"Analytics",statusLine:"Statusline",claude:"Claude",telemetry:"Telemetry",privacy:"Privacy",otel:"OTEL collector",fileChange:"File change",import:"Import",browserDevTools:"Browser DevTools MCP",nodeDevTools:"Node DevTools MCP",backendDevTools:"Backend DevTools MCP"};function v(e){const t=e.indexOf(".");return t===-1?e:e.slice(0,t)}n(v,"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.",def:"[]",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). Inverse semantics \u2014 opt out with false for "assist mode": 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. true \u2192 full enforce mode.',def:"true",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:"collector.enable",type:"boolean",editor:"toggle",description:"Master switch for the IronBee Collector. Implicitly true when the section has both url and apiKey; set false to suspend while keeping url/apiKey/batchSize around.",def:"implicit true when url + 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.apiKey",type:"string",editor:"text",description:"API key for collector auth (X-API-Key header). Required for the collector to be active. Can be supplied via the IRONBEE_API_KEY env var instead of committing it.",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:"Browser-only recording enforcement. Presence opts in; enable:false opts out. Auto-enabled when a collector is configured. Backend/node 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:"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}];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)),r=l(c(t.path));return o!==r?o-r: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,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of u(t))!h.call(e,i)&&i!==o&&a(e,i,{get:()=>t[i],enumerable:!(r=p(t,i))||r.enumerable});return e};var b=e=>y(a({},"__esModule",{value:!0}),e);var k={};g(k,{ARTIFACT_AFFECTING_TOP_KEYS:()=>v,CONFIG_SCHEMA:()=>d,GROUP_ORDER:()=>s,GROUP_TITLES:()=>f,findSchemaEntry:()=>A,groupOf:()=>c,groupRank:()=>l,groupTitle:()=>w,orderedEntries:()=>T,topKey:()=>m});module.exports=b(k);const v=new Set(["verification","collector","browser","node","backend","android","browserDevTools","nodeDevTools","backendDevTools","androidDevTools","telemetry","privacy","statusLine","otel"]),s=["general","verification","verificationContext","browser","node","backend","android","collector","recording","jobQueue","analytics","statusLine","claude","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",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.",def:"[]",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). Inverse semantics \u2014 opt out with false for "assist mode": 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. true \u2192 full enforce mode.',def:"true",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:"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 T(){return[...d].sort((e,t)=>{const o=l(c(e.path)),r=l(c(t.path));return o!==r?o-r:e.path.localeCompare(t.path)})}n(T,"orderedEntries");0&&(module.exports={ARTIFACT_AFFECTING_TOP_KEYS,CONFIG_SCHEMA,GROUP_ORDER,GROUP_TITLES,findSchemaEntry,groupOf,groupRank,groupTitle,orderedEntries,topKey});
@@ -1,2 +1,2 @@
1
- "use strict";var D=Object.create;var h=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var H=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,W=Object.prototype.hasOwnProperty;var l=(e,n)=>h(e,"name",{value:n,configurable:!0});var O=(e,n)=>{for(var a in n)h(e,a,{get:n[a],enumerable:!0})},I=(e,n,a,b)=>{if(n&&typeof n=="object"||typeof n=="function")for(let f of H(n))!W.call(e,f)&&f!==a&&h(e,f,{get:()=>n[f],enumerable:!(b=Y(n,f))||b.enumerable});return e};var U=(e,n,a)=>(a=e!=null?D(q(e)):{},I(n||!e||!e.__esModule?h(a,"default",{value:e,enumerable:!0}):a,e)),z=e=>I(h({},"__esModule",{value:!0}),e);var Q={};O(Q,{platformsArea:()=>M});module.exports=z(Q);var j=U(require("blessed")),g=require("../../lib/config"),y=require("../config/introspect"),A=require("../config/value"),d=require("../shell/util"),L=require("../config/edit");const V={browser:"Browser",node:"Node",backend:"Backend"},F=" {bold}\u2191/\u2193{/bold} move {bold}e{/bold}/{bold}g{/bold}/{bold}l{/bold} toggle project/global/local {bold}x{/bold} clear enable flag {bold}Esc{/bold} back {bold}q{/bold} quit",G={global:"global ",project:"project",local:"local "};function J(e){const n=e.session.projectDir,a=g.ALL_CYCLES;let b=(0,y.loadLayers)(n),f=(0,g.loadConfig)(n),v=0;const i=j.list({parent:e.container,top:0,left:0,width:"40%",height:"100%",border:{type:"line"},label:" Cycles ",tags:!0,keys:!1,mouse:!1,style:{selected:{bg:"blue",fg:"white"},border:{fg:"cyan"}},items:[]}),C=j.box({parent:e.container,top:0,left:"40%",width:"60%",height:"100%",border:{type:"line"},label:" Detail ",tags:!0,scrollable:!0,alwaysScroll:!0,scrollbar:{ch:" "},style:{border:{fg:"cyan"}},content:""});function $(){return a[(0,d.clamp)(v,0,a.length-1)]}l($,"currentCycle");function E(r){return(0,g.isCycleEnabled)(f,r)}l(E,"enabled");function N(r){const t=E(r),s=t?"{green-fg}\u25CF{/green-fg}":"{gray-fg}\u25CB{/gray-fg}",c=t?"{green-fg}enabled{/green-fg}":"{gray-fg}disabled{/gray-fg}";return`${s} {bold}${V[r]??r}{/bold} ${c}`}l(N,"rowLabel");function P(r){const t=[],s=E(r),c=V[r]??r,o=g.CYCLE_TO_SERVER[r]??"";t.push(`{bold}{cyan-fg}${(0,d.escapeTags)(c)} cycle{/cyan-fg}{/bold} {gray-fg}${(0,d.escapeTags)(o)}{/gray-fg}`),t.push("{gray-fg}"+"\u2500".repeat(46)+"{/gray-fg}"),t.push(`Effective: ${s?"{green-fg}enabled{/green-fg}":"{gray-fg}disabled{/gray-fg}"}`),t.push("");const m=(0,y.introspectKey)(`${r}.enable`,b);t.push("{bold}enable flag by layer{/bold}");for(const p of m.layers){const K=p.present?(0,d.escapeTags)((0,A.formatValueShort)(p.value,20)):"{gray-fg}(unset){/gray-fg}",_=m.effective===p.layer?" {green-fg}\u2190 effective{/green-fg}":"";t.push(` ${G[p.layer]} ${K}${_}`)}if(m.effective==="none"){const p=r==="browser"?"on (browser is default-on)":"off (opt-in cycle)";t.push(` {gray-fg}(no enable flag set \u2014 default: ${p}){/gray-fg}`)}t.push("");const u=(0,y.introspectKey)(`${r}.verifyPatterns`,b);t.push("{bold}verifyPatterns (config){/bold}");const B=u.merged===void 0?"{gray-fg}(unset \u2192 code defaults apply when enabled){/gray-fg}":(0,d.escapeTags)((0,A.formatValueShort)(u.merged,60));return t.push(` ${B}`),t.push(" {gray-fg}edit patterns in the Configuration area{/gray-fg}"),t.push(""),t.push("{gray-fg}e/g/l toggles the enable flag in project/global/local; x clears it.{/gray-fg}"),t.join(`
2
- `)}l(P,"buildDetail");function k(){i.setItems(a.map(r=>N(r))),i.select((0,d.clamp)(v,0,a.length-1)),C.setContent(P($())),C.setScroll(0),e.screen.render()}l(k,"render");function T(){b=(0,y.loadLayers)(n),f=(0,g.loadConfig)(n),k()}l(T,"reload");function S(r){v=(0,d.clamp)(v+r,0,a.length-1),k()}l(S,"move");function w(r){const t=$(),s=!E(t),c=(0,g.getTargetConfigPath)(r,n);try{(0,L.setLayerValue)(c,`${t}.enable`,s?"true":"false",!1),e.session.markRerenderNeeded(n),T()}catch(o){e.session.message(`Toggle failed: ${o instanceof Error?o.message:String(o)}`)}}l(w,"toggleEnable");function R(){const r=$(),s=(0,y.introspectKey)(`${r}.enable`,b).layers.filter(o=>o.present);if(s.length===0){e.session.message(`${r}.enable is not set in any layer.`);return}const c=l(o=>{const m=(0,g.getTargetConfigPath)(o,n);try{(0,L.unsetLayerValue)(m,`${r}.enable`),e.session.markRerenderNeeded(n),T()}catch(u){e.session.message(`Clear failed: ${u instanceof Error?u.message:String(u)}`)}},"apply");if(s.length===1){c(s[0].layer);return}e.session.pick("Clear enable flag from which layer?",s.map(o=>o.layer),o=>{o>=0&&o<s.length&&c(s[o].layer)})}return l(R,"clearEnable"),i.key(["up","k"],()=>S(-1)),i.key(["down","j"],()=>S(1)),i.key(["e"],()=>w("project")),i.key(["g"],()=>w("global")),i.key(["l"],()=>w("local")),i.key(["x","d"],()=>R()),e.setStatus(F),k(),i.focus(),e.screen.render(),{unmount(){i.destroy(),C.destroy()}}}l(J,"mountPlatformsView");const M={id:"platforms",title:"Platforms",summary:"Enable / disable the browser \xB7 node \xB7 backend cycles per layer",mount(e){return J(e)}};0&&(module.exports={platformsArea});
1
+ "use strict";var D=Object.create;var h=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var H=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,W=Object.prototype.hasOwnProperty;var l=(e,n)=>h(e,"name",{value:n,configurable:!0});var O=(e,n)=>{for(var a in n)h(e,a,{get:n[a],enumerable:!0})},I=(e,n,a,b)=>{if(n&&typeof n=="object"||typeof n=="function")for(let f of H(n))!W.call(e,f)&&f!==a&&h(e,f,{get:()=>n[f],enumerable:!(b=Y(n,f))||b.enumerable});return e};var U=(e,n,a)=>(a=e!=null?D(q(e)):{},I(n||!e||!e.__esModule?h(a,"default",{value:e,enumerable:!0}):a,e)),z=e=>I(h({},"__esModule",{value:!0}),e);var Q={};O(Q,{platformsArea:()=>M});module.exports=z(Q);var j=U(require("blessed")),g=require("../../lib/config"),y=require("../config/introspect"),A=require("../config/value"),d=require("../shell/util"),L=require("../config/edit");const V={browser:"Browser",node:"Node",backend:"Backend",android:"Android"},F=" {bold}\u2191/\u2193{/bold} move {bold}e{/bold}/{bold}g{/bold}/{bold}l{/bold} toggle project/global/local {bold}x{/bold} clear enable flag {bold}Esc{/bold} back {bold}q{/bold} quit",G={global:"global ",project:"project",local:"local "};function J(e){const n=e.session.projectDir,a=g.ALL_CYCLES;let b=(0,y.loadLayers)(n),f=(0,g.loadConfig)(n),v=0;const i=j.list({parent:e.container,top:0,left:0,width:"40%",height:"100%",border:{type:"line"},label:" Cycles ",tags:!0,keys:!1,mouse:!1,style:{selected:{bg:"blue",fg:"white"},border:{fg:"cyan"}},items:[]}),C=j.box({parent:e.container,top:0,left:"40%",width:"60%",height:"100%",border:{type:"line"},label:" Detail ",tags:!0,scrollable:!0,alwaysScroll:!0,scrollbar:{ch:" "},style:{border:{fg:"cyan"}},content:""});function $(){return a[(0,d.clamp)(v,0,a.length-1)]}l($,"currentCycle");function E(r){return(0,g.isCycleEnabled)(f,r)}l(E,"enabled");function N(r){const t=E(r),s=t?"{green-fg}\u25CF{/green-fg}":"{gray-fg}\u25CB{/gray-fg}",c=t?"{green-fg}enabled{/green-fg}":"{gray-fg}disabled{/gray-fg}";return`${s} {bold}${V[r]??r}{/bold} ${c}`}l(N,"rowLabel");function P(r){const t=[],s=E(r),c=V[r]??r,o=g.CYCLE_TO_SERVER[r]??"";t.push(`{bold}{cyan-fg}${(0,d.escapeTags)(c)} cycle{/cyan-fg}{/bold} {gray-fg}${(0,d.escapeTags)(o)}{/gray-fg}`),t.push("{gray-fg}"+"\u2500".repeat(46)+"{/gray-fg}"),t.push(`Effective: ${s?"{green-fg}enabled{/green-fg}":"{gray-fg}disabled{/gray-fg}"}`),t.push("");const m=(0,y.introspectKey)(`${r}.enable`,b);t.push("{bold}enable flag by layer{/bold}");for(const p of m.layers){const K=p.present?(0,d.escapeTags)((0,A.formatValueShort)(p.value,20)):"{gray-fg}(unset){/gray-fg}",_=m.effective===p.layer?" {green-fg}\u2190 effective{/green-fg}":"";t.push(` ${G[p.layer]} ${K}${_}`)}if(m.effective==="none"){const p=r==="browser"?"on (browser is default-on)":"off (opt-in cycle)";t.push(` {gray-fg}(no enable flag set \u2014 default: ${p}){/gray-fg}`)}t.push("");const u=(0,y.introspectKey)(`${r}.verifyPatterns`,b);t.push("{bold}verifyPatterns (config){/bold}");const B=u.merged===void 0?"{gray-fg}(unset \u2192 code defaults apply when enabled){/gray-fg}":(0,d.escapeTags)((0,A.formatValueShort)(u.merged,60));return t.push(` ${B}`),t.push(" {gray-fg}edit patterns in the Configuration area{/gray-fg}"),t.push(""),t.push("{gray-fg}e/g/l toggles the enable flag in project/global/local; x clears it.{/gray-fg}"),t.join(`
2
+ `)}l(P,"buildDetail");function k(){i.setItems(a.map(r=>N(r))),i.select((0,d.clamp)(v,0,a.length-1)),C.setContent(P($())),C.setScroll(0),e.screen.render()}l(k,"render");function T(){b=(0,y.loadLayers)(n),f=(0,g.loadConfig)(n),k()}l(T,"reload");function S(r){v=(0,d.clamp)(v+r,0,a.length-1),k()}l(S,"move");function w(r){const t=$(),s=!E(t),c=(0,g.getTargetConfigPath)(r,n);try{(0,L.setLayerValue)(c,`${t}.enable`,s?"true":"false",!1),e.session.markRerenderNeeded(n),T()}catch(o){e.session.message(`Toggle failed: ${o instanceof Error?o.message:String(o)}`)}}l(w,"toggleEnable");function R(){const r=$(),s=(0,y.introspectKey)(`${r}.enable`,b).layers.filter(o=>o.present);if(s.length===0){e.session.message(`${r}.enable is not set in any layer.`);return}const c=l(o=>{const m=(0,g.getTargetConfigPath)(o,n);try{(0,L.unsetLayerValue)(m,`${r}.enable`),e.session.markRerenderNeeded(n),T()}catch(u){e.session.message(`Clear failed: ${u instanceof Error?u.message:String(u)}`)}},"apply");if(s.length===1){c(s[0].layer);return}e.session.pick("Clear enable flag from which layer?",s.map(o=>o.layer),o=>{o>=0&&o<s.length&&c(s[o].layer)})}return l(R,"clearEnable"),i.key(["up","k"],()=>S(-1)),i.key(["down","j"],()=>S(1)),i.key(["e"],()=>w("project")),i.key(["g"],()=>w("global")),i.key(["l"],()=>w("local")),i.key(["x","d"],()=>R()),e.setStatus(F),k(),i.focus(),e.screen.render(),{unmount(){i.destroy(),C.destroy()}}}l(J,"mountPlatformsView");const M={id:"platforms",title:"Platforms",summary:"Enable / disable the browser \xB7 node \xB7 backend \xB7 android cycles per layer",mount(e){return J(e)}};0&&(module.exports={platformsArea});