@ironbee-ai/cli 0.29.0 → 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/analytics/claude/emit.js +1 -1
- package/dist/analytics/claude/state.js +1 -1
- package/dist/analytics/codex/events-emit.js +2 -2
- package/dist/analytics/codex/subagent-transcripts.js +3 -3
- package/dist/clients/claude/agents/ironbee-scenario.md +191 -0
- package/dist/clients/claude/agents/ironbee-verifier.md +22 -5
- package/dist/clients/claude/commands/ironbee-manage-scenario.md +36 -0
- package/dist/clients/claude/commands/ironbee-search-scenario.md +22 -0
- package/dist/clients/claude/commands/ironbee-sync-scenario.md +31 -0
- package/dist/clients/claude/commands/ironbee-verify.md +13 -12
- package/dist/clients/claude/hooks/activity-end.js +1 -1
- package/dist/clients/claude/hooks/activity-start.js +1 -1
- package/dist/clients/claude/hooks/clear-verdict.js +1 -1
- package/dist/clients/claude/hooks/require-verdict.js +2 -2
- package/dist/clients/claude/hooks/require-verification.js +3 -3
- package/dist/clients/claude/hooks/session-end.js +1 -1
- package/dist/clients/claude/hooks/session-start.js +4 -4
- package/dist/clients/claude/hooks/session-status.js +2 -2
- package/dist/clients/claude/hooks/subagent-start.js +1 -1
- package/dist/clients/claude/hooks/subagent-stop.js +1 -1
- package/dist/clients/claude/hooks/track-action-monitor.js +1 -1
- package/dist/clients/claude/hooks/track-action.js +1 -1
- package/dist/clients/claude/hooks/verify-gate.js +4 -4
- package/dist/clients/claude/index.js +4 -4
- package/dist/clients/claude/platforms/scenario.android.md +32 -0
- package/dist/clients/claude/platforms/scenario.backend.md +26 -0
- package/dist/clients/claude/platforms/scenario.browser.md +41 -0
- package/dist/clients/claude/platforms/scenario.node.md +27 -0
- package/dist/clients/claude/platforms/skill.android.md +4 -0
- package/dist/clients/claude/process-analytics.js +1 -1
- package/dist/clients/claude/statusline-toggle.js +2 -2
- package/dist/clients/claude/trust.js +1 -0
- package/dist/clients/codex/agents/ironbee-scenario.md +179 -0
- package/dist/clients/codex/agents/ironbee-verifier.md +22 -5
- package/dist/clients/codex/commands/ironbee-manage-scenario/SKILL.main.md +102 -0
- package/dist/clients/codex/commands/ironbee-manage-scenario/SKILL.md +38 -0
- package/dist/clients/codex/commands/ironbee-search-scenario/SKILL.main.md +37 -0
- package/dist/clients/codex/commands/ironbee-search-scenario/SKILL.md +23 -0
- package/dist/clients/codex/commands/ironbee-sync-scenario/SKILL.main.md +55 -0
- package/dist/clients/codex/commands/ironbee-sync-scenario/SKILL.md +33 -0
- package/dist/clients/codex/commands/ironbee-verify/SKILL.main.md +12 -3
- package/dist/clients/codex/commands/ironbee-verify/SKILL.md +4 -3
- package/dist/clients/codex/hooks/activity-end.js +1 -1
- package/dist/clients/codex/hooks/activity-start.js +1 -1
- package/dist/clients/codex/hooks/clear-verdict.js +3 -3
- package/dist/clients/codex/hooks/require-verdict.js +2 -2
- package/dist/clients/codex/hooks/require-verification.js +3 -3
- package/dist/clients/codex/hooks/session-start.js +3 -3
- package/dist/clients/codex/hooks/subagent-start.js +1 -1
- package/dist/clients/codex/hooks/subagent-stop.js +1 -1
- package/dist/clients/codex/hooks/track-action-monitor.js +1 -1
- package/dist/clients/codex/hooks/track-action-pre.js +1 -1
- package/dist/clients/codex/hooks/track-action.js +1 -1
- package/dist/clients/codex/hooks/verify-gate.js +1 -1
- package/dist/clients/codex/index.js +2 -2
- package/dist/clients/codex/platforms/command-verify.android.md +1 -0
- package/dist/clients/codex/platforms/rule.android.md +2 -1
- package/dist/clients/codex/platforms/scenario.android.md +32 -0
- package/dist/clients/codex/platforms/scenario.backend.md +26 -0
- package/dist/clients/codex/platforms/scenario.browser.md +40 -0
- package/dist/clients/codex/platforms/scenario.node.md +27 -0
- package/dist/clients/codex/platforms/skill.android.md +4 -0
- package/dist/clients/codex/process-analytics.js +2 -2
- package/dist/clients/codex/thread-map.js +1 -1
- package/dist/clients/codex/util.js +44 -31
- package/dist/clients/cursor/commands/ironbee-manage-scenario/SKILL.md +100 -0
- package/dist/clients/cursor/commands/ironbee-search-scenario/SKILL.md +34 -0
- package/dist/clients/cursor/commands/ironbee-sync-scenario/SKILL.md +54 -0
- package/dist/clients/cursor/commands/ironbee-verify/SKILL.md +2 -1
- package/dist/clients/cursor/hooks/activity-end.js +1 -1
- package/dist/clients/cursor/hooks/activity-start.js +1 -1
- package/dist/clients/cursor/hooks/clear-verdict.js +1 -1
- package/dist/clients/cursor/hooks/require-verdict.js +2 -2
- package/dist/clients/cursor/hooks/require-verification.js +3 -3
- package/dist/clients/cursor/hooks/session-end.js +1 -1
- package/dist/clients/cursor/hooks/session-start.js +4 -4
- package/dist/clients/cursor/hooks/track-action-monitor.js +1 -1
- package/dist/clients/cursor/hooks/track-action.js +1 -1
- package/dist/clients/cursor/hooks/verify-gate.js +1 -1
- package/dist/clients/cursor/index.js +1 -1
- package/dist/clients/cursor/platforms/command-verify.android.md +1 -0
- package/dist/clients/cursor/platforms/rule.android.md +2 -1
- package/dist/clients/cursor/platforms/scenario.android.md +32 -0
- package/dist/clients/cursor/platforms/scenario.backend.md +26 -0
- package/dist/clients/cursor/platforms/scenario.browser.md +40 -0
- package/dist/clients/cursor/platforms/scenario.node.md +27 -0
- package/dist/clients/cursor/platforms/skill.android.md +4 -0
- package/dist/commands/config.js +1 -1
- package/dist/commands/hook.js +10 -10
- package/dist/commands/import.js +3 -3
- package/dist/commands/process-job-file.js +1 -1
- package/dist/commands/queue.js +16 -16
- package/dist/commands/scenario.js +1 -0
- package/dist/commands/status.js +1 -1
- package/dist/commands/uninstall.js +1 -1
- package/dist/commands/verify.js +2 -2
- package/dist/hooks/core/actions.js +7 -7
- package/dist/hooks/core/nested-tools.js +1 -1
- package/dist/hooks/core/scenario-tools.js +1 -0
- package/dist/hooks/core/session-state.js +1 -1
- package/dist/hooks/core/verification-context.js +8 -8
- package/dist/import/marker.js +2 -2
- package/dist/import/skip.js +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/config.js +1 -1
- package/dist/lib/git.js +1 -1
- package/dist/lib/install-version.js +1 -1
- package/dist/lib/platform-section.js +3 -3
- package/dist/lib/runtime-paths.js +1 -0
- package/dist/lib/scenario-staleness.js +1 -0
- package/dist/otel/claude/daemon/process.js +1 -1
- package/dist/otel/claude/daemon/reprocess.js +1 -1
- package/dist/otel/claude/daemon/response-usage.js +2 -2
- package/dist/queue/drain.js +1 -1
- package/dist/queue/flush.js +1 -1
- package/dist/queue/paths.js +1 -1
- package/dist/queue/process-file.js +2 -2
- package/dist/queue/spawn.js +1 -1
- package/dist/tui/config/schema.js +1 -1
- package/dist/tui/queue/read.js +4 -4
- package/dist/tui/scenarios/area.js +2 -0
- package/dist/tui/sessions/read.js +2 -2
- package/dist/tui/shell/registry.js +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";var p=Object.defineProperty;var
|
|
1
|
+
"use strict";var p=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var c=(e,n)=>p(e,"name",{value:n,configurable:!0});var O=(e,n)=>{for(var t in n)p(e,t,{get:n[t],enumerable:!0})},j=(e,n,t,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of E(n))!T.call(e,r)&&r!==t&&p(e,r,{get:()=>n[r],enumerable:!(i=F(n,r))||i.enumerable});return e};var B=e=>j(p({},"__esModule",{value:!0}),e);var _={};O(_,{PLATFORM_TARGETS:()=>v,applyPlatformSection:()=>R,applyPlatformToProjectFiles:()=>P,fragmentFilename:()=>$,readFragment:()=>A,syncPlatformSectionsToConfig:()=>C,togglePlatformSectionInFile:()=>w});module.exports=B(_);var l=require("fs"),m=require("./logger"),h=require("./config");const S={browser:["<!-- Browser cycle verification is OFF for this project."," - To verify frontend / UI changes by driving a real browser (DOM, console,"," screenshots, accessibility, network): run `ironbee browser enable` to enable."," This file will be auto-updated with the browser-cycle guidance."," - When OFF, do NOT invoke any `bdt_*` tools voluntarily \u2014 there is no"," active browser-cycle gate, so calling them only wastes cycles. -->"].join(`
|
|
2
2
|
`),node:["<!-- Node.js runtime debug verification is OFF for this project."," - If your backend is Node.js and you want non-blocking debugger probes:"," run `ironbee node enable` to enable. This file will be auto-updated"," with the node-cycle guidance."," - If your backend isn't Node.js (Java / Python / Go / Rust / .NET / Ruby / PHP / Elixir / \u2026):"," leave this OFF \u2014 `ndt_*` tools only attach to V8/Node processes and will fail elsewhere."," - When OFF, do NOT invoke any `ndt_*` tools voluntarily. -->"].join(`
|
|
3
3
|
`),backend:["<!-- Backend protocol verification is OFF for this project."," - To verify backend services by driving real protocol calls (HTTP / gRPC /"," GraphQL / WebSocket) \u2014 runtime- and language-agnostic \u2014 run `ironbee"," backend enable`. This file will be auto-updated with the backend-cycle"," guidance."," - When OFF, do NOT invoke any `bedt_*` tools voluntarily. -->"].join(`
|
|
4
4
|
`),android:["<!-- Android mobile verification is OFF for this project."," - To verify Android app changes by driving a real device or emulator (UI"," interactions, Logcat, screenshots): run `ironbee android enable`."," This file will be auto-updated with the android-cycle guidance."," - When OFF, do NOT invoke any `adt_*` tools voluntarily. -->"].join(`
|
|
5
|
-
`)};function
|
|
5
|
+
`)};function L(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}c(L,"escapeRegex");function I(e){return new RegExp(`<!--IRONBEE:PLATFORM:${L(e)}(?::([\\w-]+))?-->`,"g")}c(I,"startMarkerRegex");function M(e,n){return n.length>0?`<!--/IRONBEE:PLATFORM:${e}:${n}-->`:`<!--/IRONBEE:PLATFORM:${e}-->`}c(M,"endMarkerFor");function N(e,n,t){const i=I(n),r=[],d=new Set;let s=i.exec(e);for(;s!==null;){const o=s[1]??"",a=s.index+s[0].length,f=M(n,o),b=e.indexOf(f,a);if(b===-1){const g=t?` in ${t}`:"",u=o.length>0?`${n}:${o}`:n;m.logger.debug(`platform-section ${u}: start marker found without matching end marker${g}`),s=i.exec(e);continue}if(d.has(o)){const g=t?` in ${t}`:"",u=o.length>0?`${n}:${o}`:n;m.logger.warn(`platform-section ${u}: multiple marker blocks with the same key${g} \u2014 only the first will be updated. Either consolidate the blocks or use distinct keys (\`IRONBEE:PLATFORM:${n}:<key>\`) per position.`),s=i.exec(e);continue}d.add(o),r.push({key:o,startEnd:a,endIdx:b}),s=i.exec(e)}return r}c(N,"findMarkerBlocks");function R(e,n,t,i){const r=typeof t=="function"?t:()=>t,d=N(e,n,i);if(d.length===0)return e;const s=S[n];if(s===void 0)throw new Error(`No placeholder registered for platform '${n}'.`);let o=e;for(let a=d.length-1;a>=0;a--){const f=d[a],b=r(f.key)??s,g=o.substring(0,f.startEnd),u=o.substring(f.endIdx);o=`${g}
|
|
6
6
|
${b}
|
|
7
|
-
${u}`}return o}
|
|
7
|
+
${u}`}return o}c(R,"applyPlatformSection");function $(e,n,t){return t.length>0?`${e}.${n}.${t}.md`:`${e}.${n}.md`}c($,"fragmentFilename");function A(e,n){const t=`${e}/${n}`;if(!(0,l.existsSync)(t))throw new Error(`Platform fragment not found: ${t}`);return(0,l.readFileSync)(t,"utf-8").trimEnd()}c(A,"readFragment");function w(e,n,t){if(!(0,l.existsSync)(e))return!1;const i=(0,l.readFileSync)(e,"utf-8"),r=R(i,n,t,e);return r===i?!1:((0,l.writeFileSync)(e,r),!0)}c(w,"togglePlatformSectionInFile");const v={claude:[{projectRelativePath:".claude/agents/ironbee-verifier.md",fragmentBase:"skill"},{projectRelativePath:".claude/agents/ironbee-scenario.md",fragmentBase:"scenario"}],cursor:[{projectRelativePath:".cursor/skills/ironbee-verification.md",fragmentBase:"skill"},{projectRelativePath:".cursor/rules/ironbee-verification.mdc",fragmentBase:"rule"},{projectRelativePath:".cursor/skills/ironbee-verify/SKILL.md",fragmentBase:"command-verify"},{projectRelativePath:".cursor/skills/ironbee-manage-scenario/SKILL.md",fragmentBase:"scenario"},{projectRelativePath:".cursor/skills/ironbee-search-scenario/SKILL.md",fragmentBase:"scenario"},{projectRelativePath:".cursor/skills/ironbee-sync-scenario/SKILL.md",fragmentBase:"scenario"}],codex:[]};function P(e,n,t,i,r){const d=[],s=Object.keys(v),o=r===void 0?s:s.filter(a=>r.includes(a));for(const a of o){const f=v[a],b=i(a);for(const g of f){const u=`${e}/${g.projectRelativePath}`;if(!(0,l.existsSync)(u))continue;w(u,n,t?y=>{const k=`${b}/${$(g.fragmentBase,n,y)}`;if(!(0,l.existsSync)(k)){const x=y.length>0?`${n}:${y}`:n;return m.logger.warn(`platform-section ${x}: missing fragment ${k} for ${g.projectRelativePath} \u2014 falling back to placeholder.`),null}return(0,l.readFileSync)(k,"utf-8").trimEnd()}:null)&&d.push(g.projectRelativePath)}}return d}c(P,"applyPlatformToProjectFiles");function C(e,n){const t=(0,h.loadConfig)(e);for(const i of h.ALL_CYCLES){const r=(0,h.isCycleEnabled)(t,i);P(e,i,r,n)}}c(C,"syncPlatformSectionsToConfig");0&&(module.exports={PLATFORM_TARGETS,applyPlatformSection,applyPlatformToProjectFiles,fragmentFilename,readFragment,syncPlatformSectionsToConfig,togglePlatformSectionInFile});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var c=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var _=Object.prototype.hasOwnProperty;var e=(n,t)=>c(n,"name",{value:t,configurable:!0});var w=(n,t)=>{for(var i in t)c(n,i,{get:t[i],enumerable:!0})},y=(n,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of N(t))!_.call(n,o)&&o!==i&&c(n,o,{get:()=>t[o],enumerable:!(s=I(t,o))||s.enumerable});return n};var A=n=>y(c({},"__esModule",{value:!0}),n);var T={};w(T,{IRONBEE_DIRNAME:()=>a,_clearRuntimeLocationCache:()=>v,encodeProjectDir:()=>R,externalRuntimeRoot:()=>d,otelRawDir:()=>b,projectIronbeeDir:()=>x,resolveRuntimeLocation:()=>L,runtimeDir:()=>h,sessionActionsFile:()=>C,sessionAnalyticsDir:()=>B,sessionDir:()=>u,sessionLogFile:()=>O,sessionsRoot:()=>E});module.exports=A(T);var l=require("crypto"),p=require("fs"),m=require("os"),r=require("path");const a=".ironbee",M="IRONBEE_RUNTIME_LOCATION";function x(n){return(0,r.join)(n,a)}e(x,"projectIronbeeDir");function f(n){const t=(0,r.isAbsolute)(n)?n:(0,r.resolve)(n);try{return(0,p.realpathSync)(t)}catch{return t}}e(f,"canonicalProjectDir");function R(n){const t=f(n),i=(0,l.createHash)("sha256").update(t).digest("hex").slice(0,16);return`${((0,r.basename)(t)||"root").replace(/[^A-Za-z0-9._-]/g,"_").slice(0,40)||"root"}-${i}`}e(R,"encodeProjectDir");function d(n){return(0,r.join)((0,m.homedir)(),a,"projects",R(n))}e(d,"externalRuntimeRoot");const g=new Map;function j(n){try{const i=require("./config").loadConfig(n).runtime?.location;if(i==="in-project")return"in-project";if(i==="external")return"external"}catch{}return"external"}e(j,"configRuntimeLocation");function L(n){const t=process.env[M];if(t==="in-project"||t==="external")return t;const i=f(n),s=g.get(i);if(s!==void 0)return s;const o=j(n);return g.set(i,o),o}e(L,"resolveRuntimeLocation");function v(){g.clear()}e(v,"_clearRuntimeLocationCache");function h(n){return L(n)==="in-project"?(0,r.join)(n,a):d(n)}e(h,"runtimeDir");function E(n){return(0,r.join)(h(n),"sessions")}e(E,"sessionsRoot");function u(n,t){return(0,r.join)(E(n),t)}e(u,"sessionDir");function B(n,t){return(0,r.join)(u(n,t),"analytics")}e(B,"sessionAnalyticsDir");function C(n,t){return(0,r.join)(u(n,t),"actions.jsonl")}e(C,"sessionActionsFile");function O(n,t){return(0,r.join)(u(n,t),"session.log")}e(O,"sessionLogFile");function b(n){return(0,r.join)(x(n),"otel")}e(b,"otelRawDir");0&&(module.exports={IRONBEE_DIRNAME,_clearRuntimeLocationCache,encodeProjectDir,externalRuntimeRoot,otelRawDir,projectIronbeeDir,resolveRuntimeLocation,runtimeDir,sessionActionsFile,sessionAnalyticsDir,sessionDir,sessionLogFile,sessionsRoot});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var h=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var l=(e,n)=>h(e,"name",{value:n,configurable:!0});var E=(e,n)=>{for(var s in n)h(e,s,{get:n[s],enumerable:!0})},F=(e,n,s,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of P(n))!C.call(e,r)&&r!==s&&h(e,r,{get:()=>n[r],enumerable:!(a=k(n,r))||a.enumerable});return e};var x=e=>F(h({},"__esModule",{value:!0}),e);var A={};E(A,{checkScenarioFreshness:()=>V,coverageGaps:()=>O});module.exports=x(A);var g=require("fs"),p=require("path"),f=require("./git"),b=require("./config"),y=require("./logger");const S={bdt:"browser",ndt:"node",bedt:"backend",adt:"android"};function v(e){return e.length>7?e.slice(0,7):e}l(v,"shortSha");function $(e){const n=e.metadata;if(n===null||typeof n!="object")return{};const s=n.ironbee;return s!==null&&typeof s=="object"?s:{}}l($,"readIronBeeMeta");function w(e){const n=(0,p.join)(e,".ironbee","scenarios");if(!(0,g.existsSync)(n))return[];const s=[];for(const a of Object.keys(S)){const r=(0,p.join)(n,a);if(!(0,g.existsSync)(r))continue;let t;try{t=(0,g.readdirSync)(r).filter(o=>o.endsWith(".json"))}catch(o){y.logger.debug(`scenario-staleness: cannot read ${r}: ${o instanceof Error?o.message:o}`);continue}for(const o of t){const c=(0,p.join)(r,o);let i;try{i=JSON.parse((0,g.readFileSync)(c,"utf-8"))}catch(m){y.logger.debug(`scenario-staleness: bad JSON ${c}: ${m instanceof Error?m.message:m}`);continue}const u=typeof i.name=="string"&&i.name.length>0?i.name:o.replace(/\.json$/,""),d=$(i),R=Array.isArray(d.coveredPaths)?d.coveredPaths.filter(m=>typeof m=="string"):[];s.push({name:u,platform:S[a],file:c,coveredPaths:R,commit:typeof d.commit=="string"&&d.commit.length>0?d.commit:void 0,liveValidated:typeof d.liveValidated=="boolean"?d.liveValidated:void 0})}}return s}l(w,"readScenarioEntries");function V(e){const n=w(e);if(n.length===0)return[];const s=(0,f.isGitRepo)(e),a=new Map,r=[];for(const t of n){const o={name:t.name,platform:t.platform,file:t.file,coveredPaths:t.coveredPaths,commit:t.commit,liveValidated:t.liveValidated,changedCoveredPaths:[]};if(!s){r.push({...o,state:"unknown",reason:"not a git repository"});continue}if(t.coveredPaths.length===0){r.push({...o,state:"unknown",reason:"no ironbee.coveredPaths metadata"});continue}if(t.commit===void 0){r.push({...o,state:"unknown",reason:"no ironbee.commit baseline"});continue}if(!(0,f.gitCommitExists)(e,t.commit)){r.push({...o,state:"unknown",reason:`baseline commit ${v(t.commit)} not in history`});continue}let c;const i=a.get(t.commit);i!==void 0?c=i:(c=(0,f.gitChangedPathsSince)(e,t.commit),a.set(t.commit,c));const u=c.filter(d=>(0,b.matchesAny)(d,t.coveredPaths));if(u.length>0){r.push({...o,state:"stale",reason:`${u.length} covered file(s) changed since ${v(t.commit)}`,changedCoveredPaths:u});continue}if(t.liveValidated===!1){r.push({...o,state:"stale",reason:"authored as a draft \u2014 not live-validated by a passing run"});continue}r.push({...o,state:"fresh",reason:`no covered files changed since ${v(t.commit)}`})}return r}l(V,"checkScenarioFreshness");function O(e,n){const s=w(e),a=Array.from(new Set(n.filter(o=>o.length>0))),r=[],t=[];for(const o of a){const c=s.filter(i=>i.coveredPaths.length>0&&(0,b.matchesAny)(o,i.coveredPaths)).map(i=>i.name);c.length>0?r.push({path:o,scenarios:c}):t.push(o)}return{scenarioCount:s.length,covered:r,gaps:t,changed:a}}l(O,"coverageGaps");0&&(module.exports={checkScenarioFreshness,coverageGaps});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var l=Object.defineProperty;var
|
|
1
|
+
"use strict";var l=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var v=Object.prototype.hasOwnProperty;var o=(e,n)=>l(e,"name",{value:n,configurable:!0});var E=(e,n)=>{for(var t in n)l(e,t,{get:n[t],enumerable:!0})},T=(e,n,t,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of k(n))!v.call(e,r)&&r!==t&&l(e,r,{get:()=>n[r],enumerable:!(s=w(n,r))||s.enumerable});return e};var x=e=>T(l({},"__esModule",{value:!0}),e);var h={};E(h,{processBodyFile:()=>I});module.exports=x(h);var p=require("fs"),c=require("path"),a=require("../../../lib/logger"),m=require("../context/util"),_=require("../context/classify"),b=require("../context/build"),d=require("./paths"),S=require("../../../lib/runtime-paths");const y=3,C=50;function F(e){return new Promise(n=>{setTimeout(n,e)})}o(F,"delay");function i(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}o(i,"isObject");function q(e){try{const n=JSON.parse((0,p.readFileSync)(e,"utf8"));return i(n)?n:null}catch{return null}}o(q,"readJsonObject");function A(e){return i(e)&&typeof e.model=="string"&&e.model.length>0?e.model:null}o(A,"modelFromBody");function N(e){if(!i(e)||!i(e.metadata))return null;const n=e.metadata.user_id;if(typeof n!="string")return null;try{const t=JSON.parse(n);if(i(t)&&typeof t.session_id=="string")return t.session_id}catch{}return null}o(N,"sessionIdFromBody");function P(e,n){const t=q((0,c.join)((0,S.sessionDir)(e,n),"state.json"));if(!t)return{};const s={};return typeof t.userEmail=="string"&&(s.user_email=t.userEmail),(t.usageType==="api"||t.usageType==="subscription")&&(s.usage_type=t.usageType),typeof t.usagePlan=="string"&&(s.usage_plan=t.usagePlan),typeof t.projectName=="string"&&(s.projectName=t.projectName),s}o(P,"readSessionState");async function I(e){const n=(0,d.projectDirFromBodyRef)(e.body_ref);if(n===null)return a.logger.warn(`otel: refusing body_ref outside a .ironbee/otel dir: ${e.body_ref}`),null;let t=null;for(let f=0;f<y;f++){try{t=(0,p.readFileSync)(e.body_ref,"utf8")}catch{return null}if(e.body_length===null||(0,m.byteLen)(t)===e.body_length||f===y-1)break;await F(C)}if(t===null)return null;let s;try{s=JSON.parse(t)}catch{return a.logger.debug(`otel: unparseable body file ${e.body_ref}`),null}const r=e.session_id??N(s);if(!r)return a.logger.debug(`otel: no session_id for ${e.body_ref}; skipping`),null;const u=P(n,r),j=e.project_name??u.projectName??(0,c.basename)(n),g=A(s)??e.model,R=(0,_.classifyRequestBody)(s,g),B={session_id:r,project_name:j,model:g,query_source:e.query_source,agent_id:e.agent_id,sequence_number:e.sequence_number,timestamp:e.timestamp,request_uuid:(0,d.requestUuidFromBodyRef)(e.body_ref),user_email:u.user_email,usage_type:u.usage_type,usage_plan:u.usage_plan};return{event:(0,b.buildSessionContextEvent)(B,R),projectDir:n,bodyRef:e.body_ref}}o(I,"processBodyFile");0&&(module.exports={processBodyFile});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var i=Object.defineProperty;var
|
|
1
|
+
"use strict";var i=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var j=Object.prototype.hasOwnProperty;var u=(e,t)=>i(e,"name",{value:t,configurable:!0});var g=(e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})},q=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of b(t))!j.call(e,o)&&o!==r&&i(e,o,{get:()=>t[o],enumerable:!(n=y(t,o))||n.enumerable});return e};var _=e=>q(i({},"__esModule",{value:!0}),e);var O={};g(O,{countOrphanFiles:()=>M,reprocessOrphans:()=>E});module.exports=_(O);var s=require("fs"),h=require("path"),a=require("../../../lib/projects-registry"),l=require("../../../lib/logger"),p=require("../../../lib/runtime-paths");function M(){let e;try{e=(0,a.listProjects)()}catch{return 0}let t=0;for(const r of e)try{for(const n of(0,s.readdirSync)((0,p.otelRawDir)(r.path)))n.endsWith(".request.json")&&(t+=1)}catch{}return t}u(M,"countOrphanFiles");function S(e,t){return{body_ref:e,sequence_number:null,model:"",query_source:null,agent_id:null,body_length:null,session_id:null,project_name:null,timestamp:t,from_catchup:!0}}u(S,"orphanMeta");function E(e){let t;try{t=(0,a.listProjects)()}catch(n){return l.logger.debug(`otel: reprocess could not read project registry: ${n instanceof Error?n.message:String(n)}`),0}let r=0;for(const n of t){const o=(0,p.otelRawDir)(n.path);let f;try{f=(0,s.readdirSync)(o)}catch{continue}for(const c of f){const m=(0,h.join)(o,c);if(c.endsWith(".request.json")){let d=Date.now();try{d=(0,s.statSync)(m).mtimeMs}catch{continue}e.submit(S(m,d)),r+=1}else if(c.endsWith(".response.json"))try{(0,s.unlinkSync)(m)}catch{}}}return r>0&&l.logger.debug(`otel: reprocess resubmitted ${r} orphan request bodies`),r}u(E,"reprocessOrphans");0&&(module.exports={countOrphanFiles,reprocessOrphans});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";var g=Object.defineProperty;var
|
|
2
|
-
`)}catch{}}i(
|
|
1
|
+
"use strict";var g=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var i=(e,n)=>g(e,"name",{value:n,configurable:!0});var E=(e,n)=>{for(var t in n)g(e,t,{get:n[t],enumerable:!0})},T=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of q(n))!x.call(e,o)&&o!==t&&g(e,o,{get:()=>n[o],enumerable:!(r=L(n,o))||r.enumerable});return e};var N=e=>T(g({},"__esModule",{value:!0}),e);var j={};E(j,{classifyQuerySource:()=>k,extractResponseUsage:()=>h,otelRequestsSidecarPath:()=>b,recordResponseUsage:()=>F});module.exports=N(j);var c=require("fs"),f=require("path"),_=require("../../../lib/logger"),y=require("./paths"),R=require("../../../lib/runtime-paths");const U=new Set(["repl_main_thread","sdk","compact"]),v=new Set(["prompt_suggestion","generate_session_title"]);function k(e){return e==null||e.length===0?"main":e.startsWith("agent:")||e==="subagent"?"subagent":U.has(e)?"main":v.has(e)?"feature":"unknown"}i(k,"classifyQuerySource");function s(e,n){for(const t of e.attributes??[])if(t&&t.key===n&&typeof t.value?.stringValue=="string")return t.value.stringValue}i(s,"strAttr");function P(e){const n=s(e,"event.timestamp");if(n){const r=Date.parse(n);if(Number.isFinite(r))return r}const t=e.timeUnixNano??e.observedTimeUnixNano;if(t)try{return Number(BigInt(t)/1000000n)}catch{}return 0}i(P,"resolveTsMs");function I(e){return e.replace(/\[[^\]]*\]/g,"").trim()}i(I,"normalizeModel");function a(e){return typeof e=="number"&&Number.isFinite(e)?e:0}i(a,"numField");function h(e){const n=s(e,"body_ref");if(!n)return null;const t=(0,y.projectDirFromBodyRef)(n);if(t===null)return null;const r=s(e,"query_source"),o=k(r);if(o==="main")return null;if(o==="unknown")return _.logger.debug(`otel: unclassified query_source '${r??""}' \u2014 not folded into session_analytics (classify in response-usage.ts if it should be)`),null;const l=s(e,"request_id"),p=s(e,"session.id");if(!l||!p)return null;let d;try{d=JSON.parse((0,c.readFileSync)(n,"utf-8"))}catch{return null}const u=d.usage??{},m=u.cache_creation??{},w=u.server_tool_use??{},S=I(s(e,"model")??(typeof d.model=="string"?d.model:"")),O={request_id:l,message_id:typeof d.id=="string"?d.id:null,model:S,query_source:r,timestamp_ms:P(e),input_tokens:a(u.input_tokens),output_tokens:a(u.output_tokens),cache_read_tokens:a(u.cache_read_input_tokens),cache_creation_tokens:a(u.cache_creation_input_tokens),cache_creation_5m_tokens:a(m.ephemeral_5m_input_tokens),cache_creation_1h_tokens:a(m.ephemeral_1h_input_tokens),web_search_requests:a(w.web_search_requests),speed:typeof u.speed=="string"?u.speed:void 0};return{sessionId:p,projectDir:t,record:O}}i(h,"extractResponseUsage");function b(e,n){return(0,f.join)((0,R.sessionAnalyticsDir)(e,n),"otel-requests.jsonl")}i(b,"otelRequestsSidecarPath");function A(e){const n=process.env.IRONBEE_OTEL_CAPTURE;if(n)try{const t=s(e,"body_ref");let r=null,o=null;if(t!==void 0)try{const l=JSON.parse((0,c.readFileSync)(t,"utf-8"));r=l.usage??null,o=l.id??null}catch{}(0,c.appendFileSync)(n,JSON.stringify({query_source:s(e,"query_source")??null,request_id:s(e,"request_id")??null,session_id:s(e,"session.id")??null,model:s(e,"model")??null,message_id:o,agent_id_attr:s(e,"agent.id")??null,prompt_id_attr:s(e,"prompt.id")??null,usage:r})+`
|
|
2
|
+
`)}catch{}}i(A,"captureAllResponses");function F(e){A(e);const n=h(e);if(n!==null)try{const t=b(n.projectDir,n.sessionId);(0,c.mkdirSync)((0,f.dirname)(t),{recursive:!0}),(0,c.appendFileSync)(t,JSON.stringify(n.record)+`
|
|
3
3
|
`)}catch(t){_.logger.debug(`otel: failed to write otel-requests sidecar: ${t instanceof Error?t.message:String(t)}`)}}i(F,"recordResponseUsage");0&&(module.exports={classifyQuerySource,extractResponseUsage,otelRequestsSidecarPath,recordResponseUsage});
|
package/dist/queue/drain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var m=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var E=Object.prototype.hasOwnProperty;var c=(n,t)=>m(n,"name",{value:t,configurable:!0});var D=(n,t)=>{for(var r in t)m(n,r,{get:t[r],enumerable:!0})},k=(n,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of S(t))!E.call(n,e)&&e!==r&&m(n,e,{get:()=>t[e],enumerable:!(s=y(t,e))||s.enumerable});return n};var _=n=>k(m({},"__esModule",{value:!0}),n);var j={};D(j,{drain:()=>O});module.exports=_(j);var o=require("fs"),p=require("path"),R=require("./snapshot"),b=require("./process-file"),i=require("./paths");async function O(n,t,r){(0,i.validateSessionId)(t);const s=(0,i.queueDir)(n,t),e={snapshotsProcessed:0,snapshotsRemaining:0,cleanedQueueDir:!1,snapshotsSkippedRecent:0};if(!(0,o.existsSync)(s))return e;const a=r?.skipRecentMs??0;let u=null;try{u=(0,R.snapshot)(n,t)}catch{}const{eligible:f,skipped:l}=h(s,a,u);e.snapshotsSkippedRecent=l;for(const g of f)try{await(0,b.processFile)(g,{registry:r?.registry}),e.snapshotsProcessed++}catch{}return e.snapshotsRemaining=h(s,0,null).eligible.length,e.cleanedQueueDir=T(n,t),e}c(O,"drain");function h(n,t,r){let s;try{s=(0,o.readdirSync)(n)}catch{return{eligible:[],skipped:0}}const e=Date.now(),a=[];let u=0;for(const f of s){if(!i.SNAPSHOT_FILENAME_REGEX.test(f))continue;const l=(0,p.join)(n,f);if(r!==null&&l===r){a.push(l);continue}if(t>0)try{const g=(0,o.statSync)(l).mtimeMs;if(e-g<t){u++;continue}}catch{}a.push(l)}return a.sort(),{eligible:a,skipped:u}}c(h,"listSnapshots");function T(n,t){const r=(0,i.queueDir)(n,t);let s;try{s=(0,o.readdirSync)(r)}catch{return!1}for(const e of s)if(e==="jobs.jsonl"&&d((0,p.join)(r,e))>0||i.SNAPSHOT_FILENAME_REGEX.test(e)||(e==="dead-letter.jsonl"||i.DEAD_LETTER_ROTATED_REGEX.test(e))&&d((0,p.join)(r,e))>0)return!1;for(const e of s)if(e==="jobs.jsonl"||e==="dead-letter.jsonl"||i.DEAD_LETTER_ROTATED_REGEX.test(e)||e==="worker.log"||i.WORKER_LOG_ROTATED_REGEX.test(e))try{(0,o.unlinkSync)((0,p.join)(r,e))}catch{}try{return(0,o.rmdirSync)(r),!0}catch{return!1}}c(T,"tryCleanupQueueDir");function d(n){try{return(0,o.statSync)(n).size}catch{return 0}}c(d,"fileSize");0&&(module.exports={drain});
|
|
1
|
+
"use strict";var m=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var E=Object.prototype.hasOwnProperty;var c=(n,t)=>m(n,"name",{value:t,configurable:!0});var D=(n,t)=>{for(var r in t)m(n,r,{get:t[r],enumerable:!0})},k=(n,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of S(t))!E.call(n,e)&&e!==r&&m(n,e,{get:()=>t[e],enumerable:!(s=y(t,e))||s.enumerable});return n};var _=n=>k(m({},"__esModule",{value:!0}),n);var j={};D(j,{drain:()=>O});module.exports=_(j);var o=require("fs"),p=require("path"),R=require("./snapshot"),b=require("./process-file"),i=require("./paths");async function O(n,t,r){(0,i.validateSessionId)(t);const s=(0,i.queueDir)(n,t),e={snapshotsProcessed:0,snapshotsRemaining:0,cleanedQueueDir:!1,snapshotsSkippedRecent:0};if(!(0,o.existsSync)(s))return e;const a=r?.skipRecentMs??0;let u=null;try{u=(0,R.snapshot)(n,t)}catch{}const{eligible:f,skipped:l}=h(s,a,u);e.snapshotsSkippedRecent=l;for(const g of f)try{await(0,b.processFile)(g,{registry:r?.registry,projectDir:n,sessionId:t}),e.snapshotsProcessed++}catch{}return e.snapshotsRemaining=h(s,0,null).eligible.length,e.cleanedQueueDir=T(n,t),e}c(O,"drain");function h(n,t,r){let s;try{s=(0,o.readdirSync)(n)}catch{return{eligible:[],skipped:0}}const e=Date.now(),a=[];let u=0;for(const f of s){if(!i.SNAPSHOT_FILENAME_REGEX.test(f))continue;const l=(0,p.join)(n,f);if(r!==null&&l===r){a.push(l);continue}if(t>0)try{const g=(0,o.statSync)(l).mtimeMs;if(e-g<t){u++;continue}}catch{}a.push(l)}return a.sort(),{eligible:a,skipped:u}}c(h,"listSnapshots");function T(n,t){const r=(0,i.queueDir)(n,t);let s;try{s=(0,o.readdirSync)(r)}catch{return!1}for(const e of s)if(e==="jobs.jsonl"&&d((0,p.join)(r,e))>0||i.SNAPSHOT_FILENAME_REGEX.test(e)||(e==="dead-letter.jsonl"||i.DEAD_LETTER_ROTATED_REGEX.test(e))&&d((0,p.join)(r,e))>0)return!1;for(const e of s)if(e==="jobs.jsonl"||e==="dead-letter.jsonl"||i.DEAD_LETTER_ROTATED_REGEX.test(e)||e==="worker.log"||i.WORKER_LOG_ROTATED_REGEX.test(e))try{(0,o.unlinkSync)((0,p.join)(r,e))}catch{}try{return(0,o.rmdirSync)(r),!0}catch{return!1}}c(T,"tryCleanupQueueDir");function d(n){try{return(0,o.statSync)(n).size}catch{return 0}}c(d,"fileSize");0&&(module.exports={drain});
|
package/dist/queue/flush.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var l=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var a=(t,e)=>l(t,"name",{value:e,configurable:!0});var A=(t,e)=>{for(var n in e)l(t,n,{get:e[n],enumerable:!0})},x=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of F(e))!T.call(t,s)&&s!==n&&l(t,s,{get:()=>e[s],enumerable:!(r=w(e,s))||r.enumerable});return t};var B=t=>x(l({},"__esModule",{value:!0}),t);var N={};A(N,{DEFAULT_AUTO_FLUSH_INTERVAL_SECONDS:()=>y,DEFAULT_AUTO_FLUSH_SIZE_BYTES:()=>E,SESSION_END_SKIP_RECENT_MS:()=>k,flushInBackground:()=>_,flushStragglersInBackground:()=>
|
|
1
|
+
"use strict";var l=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var a=(t,e)=>l(t,"name",{value:e,configurable:!0});var A=(t,e)=>{for(var n in e)l(t,n,{get:e[n],enumerable:!0})},x=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of F(e))!T.call(t,s)&&s!==n&&l(t,s,{get:()=>e[s],enumerable:!(r=w(e,s))||r.enumerable});return t};var B=t=>x(l({},"__esModule",{value:!0}),t);var N={};A(N,{DEFAULT_AUTO_FLUSH_INTERVAL_SECONDS:()=>y,DEFAULT_AUTO_FLUSH_SIZE_BYTES:()=>E,SESSION_END_SKIP_RECENT_MS:()=>k,flushInBackground:()=>_,flushStragglersInBackground:()=>O,flushSynchronously:()=>I,maybeAutoFlush:()=>z});module.exports=B(N);var i=require("fs"),S=require("../lib/config"),u=require("../lib/logger"),p=require("./drain"),o=require("./paths"),b=require("./snapshot"),g=require("./spawn");const E=32*1024,y=60;function _(t,e){try{(0,o.validateSessionId)(e);const n=(0,b.snapshot)(t,e);n!==null&&(0,g.spawnDetachedWorker)(n,t,e)}catch(n){u.logger.debug(`queue flushInBackground failed: ${n instanceof Error?n.message:n}`)}}a(_,"flushInBackground");function O(t,e){try{(0,o.validateSessionId)(e);const n=(0,o.queueDir)(t,e);if(!(0,i.existsSync)(n)||!(0,i.readdirSync)(n).some(c=>o.SNAPSHOT_FILENAME_REGEX.test(c)))return;(0,g.spawnDetachedDrainer)(t,e)}catch(n){u.logger.debug(`queue flushStragglersInBackground failed: ${n instanceof Error?n.message:n}`)}}a(O,"flushStragglersInBackground");function z(t,e){try{const n=(0,S.loadConfig)(t),r=n.jobQueue?.autoFlushSizeBytes,s=typeof r=="number"?r:E,c=n.jobQueue?.autoFlushIntervalSeconds,m=typeof c=="number"?c:y,d=s>0,h=m>0;if(!d&&!h)return;const v=(0,o.liveQueueFile)(t,e),f=(0,i.statSync)(v);if(f.size<=0)return;const D=d&&f.size>=s,R=h&&Date.now()-f.birthtimeMs>=m*1e3;(D||R)&&_(t,e)}catch(n){u.logger.debug(`queue maybeAutoFlush skipped: ${n instanceof Error?n.message:n}`)}}a(z,"maybeAutoFlush");const k=2e3;async function I(t,e,n){try{(0,o.validateSessionId)(e);const r={...n,skipRecentMs:n?.skipRecentMs??k};return await(0,p.drain)(t,e,r)}catch(r){return u.logger.debug(`queue flushSynchronously failed: ${r instanceof Error?r.message:r}`),{snapshotsProcessed:0,snapshotsRemaining:0,cleanedQueueDir:!1,snapshotsSkippedRecent:0}}}a(I,"flushSynchronously");0&&(module.exports={DEFAULT_AUTO_FLUSH_INTERVAL_SECONDS,DEFAULT_AUTO_FLUSH_SIZE_BYTES,SESSION_END_SKIP_RECENT_MS,flushInBackground,flushStragglersInBackground,flushSynchronously,maybeAutoFlush});
|
package/dist/queue/paths.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var u=Object.defineProperty;var
|
|
1
|
+
"use strict";var u=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var i=(r,n)=>u(r,"name",{value:n,configurable:!0});var D=(r,n)=>{for(var t in n)u(r,t,{get:n[t],enumerable:!0})},S=(r,n,t,g)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of h(n))!w.call(r,o)&&o!==t&&u(r,o,{get:()=>n[o],enumerable:!(g=x(n,o))||g.enumerable});return r};var R=r=>S(u({},"__esModule",{value:!0}),r);var G={};D(G,{DEAD_LETTER_ROTATED_REGEX:()=>j,SESSION_ID_MAX_LEN:()=>l,SNAPSHOT_FILENAME_REGEX:()=>b,WORKER_LOG_ROTATED_REGEX:()=>_,deadLetterFile:()=>L,liveQueueFile:()=>$,parseSnapshotPath:()=>F,queueDir:()=>a,resolveProjectDir:()=>v,sessionDir:()=>m,sessionsRoot:()=>T,snapshotFile:()=>q,validateSessionId:()=>A,workerLogFile:()=>O});module.exports=R(G);var e=require("path"),s=require("./types"),d=require("../clients/agent-project-dir"),f=require("../lib/runtime-paths");const b=/^jobs-[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\.jsonl$/,j=/^dead-letter-[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\.jsonl$/,_=/^worker-[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\.log$/,l=128;function v(r){return(0,d.resolveAgentProjectDir)(r)}i(v,"resolveProjectDir");function A(r){if(typeof r!="string"||r.length===0)throw new s.InvalidSessionIdError("session id is empty");if(r.length>l)throw new s.InvalidSessionIdError(`session id exceeds ${l} chars`);if(r==="."||r==="..")throw new s.InvalidSessionIdError("session id is a reserved path component");for(let n=0;n<r.length;n++){const t=r.charCodeAt(n);if(t<32||t===127)throw new s.InvalidSessionIdError("session id contains ASCII control character")}if(r.includes("/")||r.includes("\\")||r.includes("\0"))throw new s.InvalidSessionIdError("session id contains path separator or null byte")}i(A,"validateSessionId");function T(r){return(0,f.sessionsRoot)(r)}i(T,"sessionsRoot");function m(r,n){return(0,f.sessionDir)(r,n)}i(m,"sessionDir");function a(r,n){return(0,e.join)(m(r,n),"queue")}i(a,"queueDir");function $(r,n){return(0,e.join)(a(r,n),"jobs.jsonl")}i($,"liveQueueFile");function q(r,n,t){return(0,e.join)(a(r,n),`jobs-${t}.jsonl`)}i(q,"snapshotFile");function L(r,n){return(0,e.join)(a(r,n),"dead-letter.jsonl")}i(L,"deadLetterFile");function O(r,n){return(0,e.join)(a(r,n),"worker.log")}i(O,"workerLogFile");function F(r){const n=(0,e.basename)(r),t=(0,e.dirname)(r),g=(0,e.dirname)(t),o=(0,e.dirname)(g),p=(0,e.dirname)(o),E=(0,e.dirname)(p);if((0,e.basename)(t)!=="queue"||(0,e.basename)(o)!=="sessions"||(0,e.basename)(p)!==".ironbee")throw new Error(`snapshot path is not under a valid session queue dir: ${r}`);const c=(0,e.basename)(g);if(c.length===0||c===".")throw new Error(`snapshot path is not under a valid session queue dir: ${r}`);return{projectDir:E,sessionId:c,filename:n}}i(F,"parseSnapshotPath");0&&(module.exports={DEAD_LETTER_ROTATED_REGEX,SESSION_ID_MAX_LEN,SNAPSHOT_FILENAME_REGEX,WORKER_LOG_ROTATED_REGEX,deadLetterFile,liveQueueFile,parseSnapshotPath,queueDir,resolveProjectDir,sessionDir,sessionsRoot,snapshotFile,validateSessionId,workerLogFile});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var k=Object.defineProperty;var
|
|
2
|
-
`)}catch{}}for(const e of s)try{(0,y.deadLetterParseError)({projectDir:c,sessionId:l,sourceFile:r},e.raw,`parse-error: ${e.message}`),n.info(`DEAD_LETTER parse-error from=${(0,R.basename)(r)}`)}catch(
|
|
1
|
+
"use strict";var k=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var L=Object.prototype.hasOwnProperty;var h=(r,t)=>k(r,"name",{value:t,configurable:!0});var N=(r,t)=>{for(var c in t)k(r,c,{get:t[c],enumerable:!0})},_=(r,t,c,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of F(t))!L.call(r,n)&&n!==c&&k(r,n,{get:()=>t[n],enumerable:!(l=D(t,n))||l.enumerable});return r};var H=r=>_(k({},"__esModule",{value:!0}),r);var C={};N(C,{processFile:()=>P});module.exports=H(C);var E=require("fs"),R=require("path"),S=require("readline"),m=require("./types"),j=require("./paths"),A=require("./registry"),y=require("./dead-letter"),T=require("./worker-log");async function P(r,t){if(!(0,E.existsSync)(r))return;const{projectDir:c,sessionId:l}=t?.projectDir!==void 0&&t?.sessionId!==void 0?{projectDir:t.projectDir,sessionId:t.sessionId}:(0,j.parseSnapshotPath)(r),n=new T.WorkerLog(c,l),d=t?.registry??(0,A.snapshotRegistry)(),i=[],s=[];try{await x(r,e=>{if(e.length!==0)try{const o=JSON.parse(e);if(!B(o)){s.push({raw:e,message:"not a valid job envelope"});return}i.push(o)}catch(o){const b=o instanceof Error?o.message:String(o);s.push({raw:e,message:b})}})}catch(e){const o=e instanceof Error?e.message:String(e);n.error(`failed to read ${r}: ${o}; leaving file`);return}if(n.info(`START path=${r} lines=${i.length+s.length} parse_errors=${s.length}`),d.size===0&&i.length>0){const e=`registry is empty but snapshot has ${i.length} job(s) \u2014 every job will be dead-lettered. Did registerQueueHandlers() fail to wire handlers?`;n.warn(e);try{process.stderr.write(`ironbee queue WARN: ${e}
|
|
2
|
+
`)}catch{}}for(const e of s)try{(0,y.deadLetterParseError)({projectDir:c,sessionId:l,sourceFile:r},e.raw,`parse-error: ${e.message}`),n.info(`DEAD_LETTER parse-error from=${(0,R.basename)(r)}`)}catch(o){const b=o instanceof Error?o.message:String(o);n.error(`failed to dead-letter parse-error: ${b}; leaving file`);return}const a=new Map;for(const e of i){const o=a.get(e.type);o?o.push(e):a.set(e.type,[e])}const f=[...a.keys()].sort();let $=s.length,u=0;for(const e of f){const o=a.get(e),b=d.get(e);if(!b){for(const g of o)try{(0,y.deadLetterParsed)({projectDir:c,sessionId:l,sourceFile:r},g,`no-handler-registered:${e}`),$++}catch(w){const p=w instanceof Error?w.message:String(w);n.error(`failed to dead-letter unhandled job ${g.id}: ${p}; leaving file`);return}n.info(`NO_HANDLER type=${e} count=${o.length}`);continue}try{await b.dispatch(o),u+=o.length,n.info(`BATCH_OK type=${e} count=${o.length}`)}catch(g){if(g instanceof m.TransientError){n.warn(`TRANSIENT type=${e}: ${g.message}; leaving file for retry`);return}if(g instanceof m.AuthError){n.error(`AUTH type=${e}: ${g.message}; leaving file; operator must fix credentials`);return}if(g instanceof m.BadRequestBatchError){n.warn(`BATCH_400 type=${e}: ${g.message}; falling back to per-job dispatch`);const p=await J(b,o,r,c,l,n);if(p.bailed)return;u+=p.ok,$+=p.dead;continue}const w=g instanceof Error?g.message:String(g);n.error(`BATCH_UNEXPECTED type=${e}: ${w}`);for(const p of o)try{(0,y.deadLetterParsed)({projectDir:c,sessionId:l,sourceFile:r},p,`unexpected:${w}`),$++}catch(v){const I=v instanceof Error?v.message:String(v);n.error(`failed to dead-letter unexpected-batch job ${p.id}: ${I}; leaving file`);return}}}try{(0,E.unlinkSync)(r),n.info(`DONE path=${(0,R.basename)(r)} lines_ok=${u} lines_dead=${$}`)}catch(e){const o=e instanceof Error?e.message:String(e);n.warn(`UNLINK_FAILED path=${r}: ${o}; leaving file for re-processing`)}}h(P,"processFile");async function J(r,t,c,l,n,d){let i=0,s=0;for(const a of t)try{await r.dispatchSingle(a),i++}catch(f){if(f instanceof m.BadRequestError){try{(0,y.deadLetterParsed)({projectDir:l,sessionId:n,sourceFile:c},a,f.message),s++}catch(u){const e=u instanceof Error?u.message:String(u);return d.error(`failed to dead-letter bad-request job ${a.id}: ${e}; leaving file`),{ok:i,dead:s,bailed:!0}}continue}if(f instanceof m.TransientError)return d.warn(`TRANSIENT_DURING_FALLBACK job=${a.id}: ${f.message}; leaving file`),{ok:i,dead:s,bailed:!0};if(f instanceof m.AuthError)return d.error(`AUTH_DURING_FALLBACK job=${a.id}: ${f.message}; leaving file`),{ok:i,dead:s,bailed:!0};const $=f instanceof Error?f.message:String(f);try{(0,y.deadLetterParsed)({projectDir:l,sessionId:n,sourceFile:c},a,`unexpected:${$}`),s++}catch(u){const e=u instanceof Error?u.message:String(u);return d.error(`failed to dead-letter unexpected job ${a.id}: ${e}; leaving file`),{ok:i,dead:s,bailed:!0}}}return{ok:i,dead:s,bailed:!1}}h(J,"fallbackPerJob");function x(r,t){return new Promise((c,l)=>{const n=(0,E.createReadStream)(r,{encoding:"utf-8"}),d=(0,S.createInterface)({input:n,crlfDelay:1/0});let i=null;d.on("line",s=>{if(!i)try{t(s)}catch(a){i=a instanceof Error?a:new Error(String(a)),d.close(),n.destroy()}}),d.on("close",()=>{i?l(i):c()}),n.on("error",s=>{l(s)})})}h(x,"readLinesStreaming");function B(r){if(typeof r!="object"||r===null)return!1;const t=r;return typeof t.id=="string"&&typeof t.type=="string"&&typeof t.created_at=="string"&&"data"in t}h(B,"isJob");0&&(module.exports={processFile});
|
package/dist/queue/spawn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var t=Object.defineProperty;var
|
|
1
|
+
"use strict";var t=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var i=(n,s)=>t(n,"name",{value:s,configurable:!0});var v=(n,s)=>{for(var r in s)t(n,r,{get:s[r],enumerable:!0})},h=(n,s,r,o)=>{if(s&&typeof s=="object"||typeof s=="function")for(let e of p(s))!u.call(n,e)&&e!==r&&t(n,e,{get:()=>s[e],enumerable:!(o=m(s,e))||o.enumerable});return n};var l=n=>h(t({},"__esModule",{value:!0}),n);var E={};v(E,{DRAINER_SKIP_RECENT_MS:()=>a,spawnDetachedDrainer:()=>x,spawnDetachedWorker:()=>f});module.exports=l(E);var c=require("child_process");function g(){const n=process.env.IRONBEE_BIN;if(n)return{command:n,args:[]};const s=process.argv[0],r=process.argv[1]??"";return r.endsWith("index.js")||r.endsWith("index.ts")?{command:s,args:[r]}:{command:"ironbee",args:[]}}i(g,"resolveInvocation");function f(n,s,r){const{command:o,args:e}=g(),d=[...e,"process-job-file",n,"--project",s,"--session",r];(0,c.spawn)(o,d,{detached:!0,stdio:"ignore",env:process.env}).unref()}i(f,"spawnDetachedWorker");const a=5e3;function x(n,s){const{command:r,args:o}=g(),e=[...o,"queue","drain","--session",s,"--project-dir",n,"--skip-recent-ms",String(a)];(0,c.spawn)(r,e,{detached:!0,stdio:"ignore",env:process.env}).unref()}i(x,"spawnDetachedDrainer");0&&(module.exports={DRAINER_SKIP_RECENT_MS,spawnDetachedDrainer,spawnDetachedWorker});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var a=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var n=(e,t)=>a(e,"name",{value:t,configurable:!0});var g=(e,t)=>{for(var o in t)a(e,o,{get:t[o],enumerable:!0})},y=(e,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of u(t))!h.call(e,r)&&r!==o&&a(e,r,{get:()=>t[r],enumerable:!(i=p(t,r))||i.enumerable});return e};var b=e=>y(a({},"__esModule",{value:!0}),e);var T={};g(T,{ARTIFACT_AFFECTING_TOP_KEYS:()=>v,CONFIG_SCHEMA:()=>d,GROUP_ORDER:()=>s,GROUP_TITLES:()=>f,findSchemaEntry:()=>A,groupOf:()=>c,groupRank:()=>l,groupTitle:()=>w,orderedEntries:()=>k,topKey:()=>m});module.exports=b(T);const v=new Set(["verification","collector","browser","node","backend","android","browserDevTools","nodeDevTools","backendDevTools","androidDevTools","telemetry","privacy","statusLine","otel","codex"]),s=["general","verification","verificationContext","browser","node","backend","android","collector","recording","jobQueue","analytics","statusLine","claude","codex","telemetry","privacy","otel","fileChange","import","browserDevTools","nodeDevTools","backendDevTools","androidDevTools"],f={general:"General",verification:"Verification",verificationContext:"Verification context",browser:"Browser cycle",node:"Node cycle",backend:"Backend cycle",android:"Android cycle",collector:"Collector",recording:"Recording",jobQueue:"Job queue",analytics:"Analytics",statusLine:"Statusline",claude:"Claude",codex:"Codex",telemetry:"Telemetry",privacy:"Privacy",otel:"OTEL collector",fileChange:"File change",import:"Import",browserDevTools:"Browser DevTools MCP",nodeDevTools:"Node DevTools MCP",backendDevTools:"Backend DevTools MCP",androidDevTools:"Android DevTools MCP"};function m(e){const t=e.indexOf(".");return t===-1?e:e.slice(0,t)}n(m,"topKey");function c(e){const t=e.indexOf(".");return t===-1?"general":e.slice(0,t)}n(c,"groupOf");function w(e){return f[e]??e}n(w,"groupTitle");function l(e){const t=s.indexOf(e);return t===-1?s.length:t}n(l,"groupRank");const d=[{path:"ignoredVerifyPatterns",type:"string-array",editor:"string-list",description:"Glob patterns excluded from verification, applied to every cycle (browser / node / backend). Checked first \u2014 a match here activates no cycle regardless of other patterns. Unioned on top of an always-on default set that excludes test files (**/*.spec.*, **/*.test.*, **/__tests__/**, **/__mocks__/**) \u2014 a test-only edit never activates a runtime-verification cycle.",def:"[] (plus always-on test-file defaults)",artifactAffecting:!1},{path:"maxRetries",type:"number",editor:"number",description:"Max verification retry attempts before the gate allows completion despite failures. Single global counter regardless of how many cycles ran.",def:"3",artifactAffecting:!1},{path:"verification.enable",type:"boolean",editor:"toggle",description:"Master enforcement switch. Inverse semantics \u2014 verification is the core feature, opt out with false. When false, IronBee runs monitoring-only: no enforcement hooks, no skill/rule, no MCP servers; only session/activity/tool_call events flow to the collector.",def:"true",artifactAffecting:!0},{path:"verification.auto",type:"boolean",editor:"toggle",description:"Automatic-enforcement sub-toggle (only meaningful when verification.enable !== false). Default FALSE \u2014 assist is the default mode (the safer default): the /ironbee-verify command + MCP servers stay installed so the agent can verify manually, but nothing is enforced \u2014 no Stop gate, non-blocking (soft) PreToolUse hooks, and the skill/rule are omitted. Opt into full enforcement with true (blocking Stop gate + skill/rule installed).",def:"false",artifactAffecting:!0},{path:"verification.strict",type:"boolean",editor:"toggle",description:'Strict mode (only meaningful in enforce mode). Default false. When true the verify-gate refuses N/A verdicts \u2014 both a global status "not_applicable" and per-platform not_applicable_cycles exemptions \u2014 so the agent must produce real verification tool evidence for every active cycle. Default (false) accepts N/A: the agent can declare a change has no runtime surface (globally or per-cycle) and the gate allows it, recorded + observable. Inert in assist/monitor (no gate runs). The gate reads it live; the rerender it shares with the rest of the verification block is idempotent (the N/A guidance is mode-agnostic, so the installed artifacts don\'t change). Set via `ironbee verification strict` enable/disable, `config set`, or at install \u2014 picking enforce opens a strictness sub-choice (interactive) and the `--strict` flag sets it non-interactively.',def:"false",artifactAffecting:!0},{path:"verification.model",type:"json",editor:"json",description:`Model the delegated verifier sub-agent uses. Unset \u2192 the verifier inherits the session model (Claude verifier omits model: \u2192 inherit; Codex verifier omits agent-toml model \u2192 inherits config.toml's model). Set to PIN a specific model \u2014 e.g. verify on a cheaper/faster model than the main agent, or guarantee a model on Codex when config.toml has none. Two shapes: a string (applies to all clients, e.g. "sonnet" / "gpt-5.5") or a per-client object { claude: "sonnet", codex: "gpt-5.5" } when a project has both clients. Cursor has no verifier sub-agent \u2192 no-op there. Never resolves to a literal "inherit" on Codex (a 400). Artifact-affecting.`,def:"unset (inherit the session model)",artifactAffecting:!0},{path:"verificationContext.enable",type:"boolean",editor:"toggle",description:"Master switch for path-scoped verification context. When a cycle begins, the first devtools tool call injects the .ironbee/VERIFICATION.md files on/above the changed paths (author-written area guidance) into the agent's context via the host's additionalContext channel. Advisory only (does not gate). Inverse semantics \u2014 default-on, opt out with false. Not artifact-affecting (read live).",def:"true",artifactAffecting:!1},{path:"verificationContext.source",type:"string",editor:"enum",enumValues:["git","actions"],description:`Changed-path source. "git" (default) = working tree + last N commits, with an actions.jsonl fallback when not a git repo. "actions" = IronBee's own file_change events only (no git subprocess).`,def:"git",artifactAffecting:!1},{path:"verificationContext.commitDepth",type:"number",editor:"number",description:'Number of recent commits included on the git source (uncommitted \u222A last N commits). 0 = uncommitted only. Ignored when source is "actions".',def:"1",artifactAffecting:!1},{path:"verificationContext.maxBytes",type:"number",editor:"number",description:"Aggregate byte cap on the injected context string. When exceeded, the least-specific (root-side) docs are dropped first (leaf-first truncation priority).",def:"65536 (64 KB)",artifactAffecting:!1},{path:"browser.enable",type:"boolean",editor:"toggle",description:"Explicit on/off for the browser cycle. Written false by `browser disable`, stripped by `browser enable`. When false the cycle is disabled regardless of patterns.",def:"(absent \u2192 on; browser is the only default-on cycle)",artifactAffecting:!0},{path:"browser.verifyPatterns",type:"string-array",editor:"string-list",description:"Glob patterns for files requiring browser verification. Four-state: absent \u2192 code defaults (40+ extensions); [] \u2192 hard kill; non-empty \u2192 custom patterns (replaces defaults).",def:"40+ code extensions when unset; [] hard-disables",artifactAffecting:!0},{path:"browser.additionalVerifyPatterns",type:"string-array",editor:"string-list",description:"Extra patterns appended to browser.verifyPatterns (or to code defaults when verifyPatterns is unset). Ignored when verifyPatterns is [] (hard kill wins).",def:"[]",artifactAffecting:!0},{path:"browser.alwaysRequired",type:"string-array",editor:"string-list",description:"Browser-cycle required tools (all-of). The verify-gate blocks completion until every listed bdt_* tool was used.",def:"bdt_navigation_go-to, bdt_content_take-screenshot, bdt_a11y_take-aria-snapshot, bdt_o11y_get-console-messages",artifactAffecting:!0},{path:"browser.evidencePaths",type:"json",editor:"json",description:"Alternative tool-satisfaction paths (any-of). Browser uses pure all-of, so default is empty. Each path: { name, allOf: (string | { anyOf: string[] })[] }.",def:"[]",artifactAffecting:!0},{path:"node.enable",type:"boolean",editor:"toggle",description:"Explicit on/off for the Node.js runtime debug cycle (node-devtools, ndt_* V8 inspector probes). Opt-in \u2014 written by `node enable`.",def:"(absent \u2192 off; node is opt-in)",artifactAffecting:!0},{path:"node.verifyPatterns",type:"string-array",editor:"string-list",description:"Glob patterns for the Node.js runtime debug cycle. Default-off \u2014 block absent = inert. Block present + unset \u2192 9 code defaults (server/api/routes paths).",def:"block absent \u2192 disabled; present + unset \u2192 code defaults",artifactAffecting:!0},{path:"node.additionalVerifyPatterns",type:"string-array",editor:"string-list",description:"Extra patterns appended to node.verifyPatterns (or to code defaults when unset). Ignored when verifyPatterns is [].",def:"[]",artifactAffecting:!0},{path:"node.alwaysRequired",type:"string-array",editor:"string-list",description:"Node-cycle required tools (all-of). ndt_debug_connect always; evidence paths supply the rest.",def:"[ndt_debug_connect]",artifactAffecting:!0},{path:"node.evidencePaths",type:"json",editor:"json",description:"Alternative tool paths (any-of). Default: probe path (a put-*point AND get-probe-snapshots) OR log path (get-logs).",def:"probe path + log path",artifactAffecting:!0},{path:"backend.enable",type:"boolean",editor:"toggle",description:"Explicit on/off for the runtime-agnostic backend protocol cycle (backend-devtools, bedt_* HTTP/gRPC/GraphQL/WebSocket). Opt-in \u2014 written by `backend enable`.",def:"(absent \u2192 off; backend is opt-in)",artifactAffecting:!0},{path:"backend.verifyPatterns",type:"string-array",editor:"string-list",description:"Glob patterns for the backend protocol cycle. Default-off \u2014 block absent = inert. Block present + unset \u2192 13 multi-language code defaults (ts/js/py/go/java/rb/cs/rs/kt/scala/ex/php/clj).",def:"block absent \u2192 disabled; present + unset \u2192 code defaults",artifactAffecting:!0},{path:"backend.additionalVerifyPatterns",type:"string-array",editor:"string-list",description:"Extra patterns appended to backend.verifyPatterns (or to code defaults when unset). Ignored when verifyPatterns is [].",def:"[]",artifactAffecting:!0},{path:"backend.alwaysRequired",type:"string-array",editor:"string-list",description:"Backend-cycle required tools (all-of). Empty by default \u2014 backend uses any-of evidence paths instead.",def:"[]",artifactAffecting:!0},{path:"backend.evidencePaths",type:"json",editor:"json",description:"Alternative tool paths (any-of). Default three: protocol-call (any request tool) OR log-evidence (register-source + read) OR db-evidence (db_connect + a read op).",def:"protocol-call OR log-evidence OR db-evidence",artifactAffecting:!0},{path:"android.enable",type:"boolean",editor:"toggle",description:"Explicit on/off for the Android mobile verification cycle (android-devtools, adt_* device/emulator interaction). Opt-in \u2014 written by `android enable`.",def:"(absent \u2192 off; android is opt-in)",artifactAffecting:!0},{path:"android.verifyPatterns",type:"string-array",editor:"string-list",description:"Glob patterns for the Android mobile verification cycle. Default-off \u2014 block absent = inert. Block present + unset \u2192 code defaults (Android/React Native paths).",def:"block absent \u2192 disabled; present + unset \u2192 code defaults",artifactAffecting:!0},{path:"android.additionalVerifyPatterns",type:"string-array",editor:"string-list",description:"Extra patterns appended to android.verifyPatterns (or to code defaults when unset). Ignored when verifyPatterns is [].",def:"[]",artifactAffecting:!0},{path:"android.alwaysRequired",type:"string-array",editor:"string-list",description:"Android-cycle required tools (all-of). adt_device_connect always; evidence paths supply the rest.",def:"[adt_device_connect]",artifactAffecting:!0},{path:"android.evidencePaths",type:"json",editor:"json",description:"Alternative tool paths (any-of). Default two: device-evidence (UI interaction + screenshot + UI snapshot) OR log-evidence (Logcat read/follow).",def:"device-evidence OR log-evidence",artifactAffecting:!0},{path:"collector.enable",type:"boolean",editor:"toggle",description:"Master switch for the IronBee Collector. Implicitly true when the section has url and at least one credential (oauthToken or apiKey); set false to suspend while keeping url/oauthToken/apiKey/batchSize around.",def:"implicit true when url + (oauthToken or apiKey) set",artifactAffecting:!0},{path:"collector.url",type:"string",editor:"text",description:"Remote collector endpoint URL (IronBee Platform). Required for the collector to be active. Events POST to {url}/v1/events.",def:"(unset \u2192 disabled)",artifactAffecting:!0},{path:"collector.oauthToken",type:"string",editor:"text",description:"Personal access token for collector auth (X-OAuth-Token header). Per-(user, account), independently revocable from the console's /access-tokens page. Minted by `ironbee login` \u2014 the primary path for interactive CLI use. Can be supplied via IRONBEE_OAUTH_TOKEN.",def:"(unset)",artifactAffecting:!0},{path:"collector.apiKey",type:"string",editor:"text",description:"Shared account API key for collector auth (X-API-Key header). Parallel first-class path alongside `oauthToken`, intended for CI / GitHub Actions / deployment tooling and other non-interactive integrations where rotating a per-engineer OAuth token is impractical. Either `oauthToken` OR `apiKey` is required for the collector to be active. Can be supplied via IRONBEE_API_KEY.",def:"(unset \u2192 disabled)",artifactAffecting:!0},{path:"collector.batchSize",type:"number",editor:"number",description:"Max events per POST from the send_event handler (the queue chunks bigger snapshots into N-sized POSTs).",def:"100",artifactAffecting:!0},{path:"collector.timeoutMs",type:"number",editor:"number",description:"Per-request HTTP timeout (ms) for batched analytics sends. Single-event interactive sends keep a fixed 3000ms cap. Clamped to [1000, 60000].",def:"10000",artifactAffecting:!0},{path:"recording.enable",type:"boolean",editor:"toggle",description:"Recording enforcement for the browser + android cycles. Presence opts in; enable:false opts out. Auto-enabled when a collector is configured. Node/backend cycles never trigger recording.",def:"implicit true when section present or collector configured",artifactAffecting:!1},{path:"jobQueue.enable",type:"boolean",editor:"toggle",description:"Master switch for the file-backed job queue. Presence opts in; enable:false opts out. Auto-enabled when a collector is configured (a collector is pointless without a queue feeding it).",def:"implicit true when section present or collector configured",artifactAffecting:!1},{path:"jobQueue.autoFlushSizeBytes",type:"number",editor:"number",description:"Size threshold (bytes) above which submit() spawns a detached worker mid-session. 0 / negative disables this check.",def:"32768 (32 KB)",artifactAffecting:!1},{path:"jobQueue.autoFlushIntervalSeconds",type:"number",editor:"number",description:"Interval threshold (seconds since the live jobs.jsonl was created) above which submit() spawns a detached worker. Complements size \u2014 whichever crosses first flushes. 0 / negative disables.",def:"60",artifactAffecting:!1},{path:"analytics.enable",type:"boolean",editor:"toggle",description:"Master switch for per-session structural analytics. Presence opts in; enable:false opts out. Auto-enabled when a collector is configured.",def:"implicit true when section present or collector configured",artifactAffecting:!1},{path:"analytics.emitOnStop",type:"boolean",editor:"toggle",description:"When true, project + emit analytics at every Stop hook. When false, only at SessionEnd.",def:"true",artifactAffecting:!1},{path:"analytics.emitOnStopMinIntervalSeconds",type:"number",editor:"number",description:"Throttle: skip Stop-hook projection if the last successful emit was within this many seconds. 0 disables the throttle (backend handles rate-limit / dedupe).",def:"0 (disabled)",artifactAffecting:!1},{path:"analytics.emitTurnEvents",type:"boolean",editor:"toggle",description:"Opt-in for per-turn session_turn_analytics wire records. High-volume secondary signal; the base session_analytics record always ships regardless.",def:"false",artifactAffecting:!1},{path:"analytics.emitStepEvents",type:"boolean",editor:"toggle",description:"Opt-in for per-step session_turn_step_analytics wire records (an order of magnitude higher volume than turn events). Independent of emitTurnEvents.",def:"false",artifactAffecting:!1},{path:"analytics.emitApiRequestEvents",type:"boolean",editor:"toggle",description:"Opt-OUT for per-API-request api_request wire records (one per assistant message, success + failure). Primary value for backend cost accounting, so ships by default.",def:"true",artifactAffecting:!1},{path:"statusLine.enable",type:"boolean",editor:"toggle",description:"Master switch for the Claude statusline integration (session_status event + statusline wrapper). Presence opts in; auto-enabled when a collector is configured. Claude-only.",def:"implicit true when section present or collector configured",artifactAffecting:!0},{path:"statusLine.renderDefault",type:"boolean",editor:"toggle",description:"When there is no upstream statusline to chain to, false keeps the statusline silent; true renders a minimal model + context-% line. No effect when the user already has a statusline.",def:"false",artifactAffecting:!0},{path:"statusLine.emitMinIntervalSeconds",type:"number",editor:"number",description:"Minimum seconds between two emitted session_status events, on top of skip-if-unchanged. Rapid changes coalesce to the latest state after the interval. 0 disables the throttle. Read live each tick.",def:"10",artifactAffecting:!0},{path:"statusLine.refreshInterval",type:"number",editor:"number",description:"Claude Code's own statusLine.refreshInterval (seconds, host min 1) \u2014 re-runs the statusline on a timer in addition to event-driven updates. Unset by default. Values < 1 treated as unset.",def:"unset",artifactAffecting:!0},{path:"claude.oauthAccess.enable",type:"boolean",editor:"toggle",description:"Whether IronBee may read the Claude Code OAuth token (macOS Keychain / ~/.claude/.credentials.json) and call OAuth-scoped Anthropic endpoints. Default-on (opt out with false or `ironbee claude oauth-access disable`). First consumer: the statusline rate-limit fallback \u2014 fetches /api/oauth/usage to fill rate_limits for plans the statusline JSON omits them for (team / enterprise). Claude-only; not artifact-affecting (read live).",def:"true",artifactAffecting:!1},{path:"claude.oauthAccess.usageTtlSeconds",type:"number",editor:"number",description:"TTL (seconds) for the statusline OAuth rate-limit fetch cache \u2014 the /api/oauth/usage call + credential read fire at most once per this interval even when the statusline ticks far more often. Default 60; 0 means every tick.",def:"60",artifactAffecting:!1},{path:"claude.autoModeAllowlist.enable",type:"boolean",editor:"toggle",description:"Whether IronBee writes the auto-mode allowlist carve-out for the verifier into .claude/settings.local.json. Claude Code 2.1.176+ ships a host-side sub-agent \"Content Integrity\" classifier (auto mode) that false-positives on IronBee's legitimate `ironbee hook submit-verdict` verdicts (the devtools calls happened earlier in the cycle, not re-shown in the handoff). When enabled (default), install adds a narrow, command-keyed autoMode.allow rule that exempts ONLY that command from the Content Integrity block ($defaults preserved \u2014 every other block rule still applies; IronBee's Stop-gate independently enforces real tool usage). Written only when verification is active (enforce/assist); inert when the host isn't in auto mode. Opt out with false \u2014 takes effect on the next `ironbee install`. Claude-only.",def:"true",artifactAffecting:!1},{path:"codex.verifier.mode",type:"string",editor:"enum",enumValues:["sub-agent","main-agent"],description:'How the Codex verification cycle is driven (Codex-only). "sub-agent" (default) delegates to the ironbee-verifier custom agent (per-agent MCP, SubagentStart bridge, slim delegation skill/rule/command). "main-agent" makes the MAIN agent drive the devtools tools directly (session-level [mcp_servers.*], no verifier agent, inline skill/rule/command) \u2014 the Cursor-style fallback for when Codex\'s sub-agent machinery regresses. Re-renders the Codex client. Toggle via `ironbee codex verifier mode <sub-agent|main-agent>`.',def:"sub-agent",artifactAffecting:!0},{path:"telemetry.enable",type:"boolean",editor:"toggle",description:"Master switch for anonymous PostHog telemetry (CLI's own product analytics). Inverse semantics \u2014 opt out with false. Disabling also injects TELEMETRY_ENABLE=false into devtools MCP env. Orthogonal to the collector pipeline.",def:"true",artifactAffecting:!0},{path:"privacy.enable",type:"boolean",editor:"toggle",description:"Privacy mode \u2014 a single cross-cutting switch (all platforms) that redacts potentially sensitive data from what the @ironbee-ai/devtools MCP servers ship to the collector. Opt-in, default OFF. When true, injects COLLECTOR_EVENTS_TOOL_DETAILS_ENABLE=false (tool input/output detail) + COLLECTOR_ARTIFACTS_ENABLE=false (screenshots, recordings) into every devtools MCP env. Devtools-side only \u2014 the CLI's own send_event pipeline already whitelists tool_input and strips tool_response. Orthogonal to telemetry (PostHog) and collector (the sink).",def:"false",artifactAffecting:!0},{path:"otel.enable",type:"boolean",editor:"toggle",description:"Master switch for the local OTEL collector pipeline (Claude Code OTLP raw-API-body export \u2192 local daemon \u2192 session_context context-usage events). Presence opts in; enable:false opts out; auto-enabled when a collector is configured. session_context derivation is the sole consumer, so this also gates whether the settings.json OTEL env block (incl. raw-bodies) is written. Orthogonal to telemetry (PostHog) and collector (event sink).",def:"implicit true when collector configured",artifactAffecting:!0},{path:"otel.port",type:"number",editor:"number",description:"Loopback port the shared OTEL collector daemon binds to, and which the settings.json OTEL endpoint env var points at. One daemon per machine across all sessions.",def:"15986",artifactAffecting:!0},{path:"otel.idleTimeoutSeconds",type:"number",editor:"number",description:"The daemon self-reaps (graceful shutdown) after this many seconds with no /health hit and no OTLP event. Restarted on the next session/turn ensure.",def:"600",artifactAffecting:!0},{path:"otel.ensureMinIntervalSeconds",type:"number",editor:"number",description:"Throttle (seconds) for the high-frequency liveness `ensure` from per-tool hooks, so we don't pay a /health check on every tool call. session-start / activity-start ensure are unthrottled.",def:"30",artifactAffecting:!0},{path:"otel.emitMinIntervalSeconds",type:"number",editor:"number",description:"Per-session session_context emit throttle: admit at most one event per session per interval (leading-edge \u2014 the first request in each window is emitted, in-between requests are coalesced away and their body files dropped). Applies to the live path only; the catch-up/reprocess path is never throttled. 0 = emit on every API request (full context-growth time series).",def:"0",artifactAffecting:!0},{path:"fileChange.captureChangeset",type:"boolean",editor:"toggle",description:"When true, every file_change event carries a hunks-only unified-diff changeset string. Off by default \u2014 the default wire shape stays metadata-only (operation + line counts).",def:"false",artifactAffecting:!1},{path:"fileChange.maxChangesetBytes",type:"number",editor:"number",description:"Hard cap on the changeset string size. Diffs over the cap are truncated with a footer so the collector POST stays within typical reverse-proxy body limits.",def:"65536 (64 KB)",artifactAffecting:!1},{path:"import.concurrency",type:"number",editor:"number",description:"Default number of sessions `ironbee import` processes in parallel. Resolution: --concurrency flag > this value > built-in default. Clamped to [1, 32].",def:"4",artifactAffecting:!1},{path:"browserDevTools.env",type:"json",editor:"json",description:"Env-var overrides merged into the browser-devtools MCP server entry. Operators can override individual OTEL keys; IronBee invariants (TOOL_NAME_PREFIX, \u2026) always win last.",def:"unset (defaults + auto-OTEL when collector configured)",artifactAffecting:!0},{path:"browserDevTools.mcp",type:"json",editor:"json",description:"Full-replacement MCP config for the browser-devtools server entry. Auto-OTEL + telemetry env are still injected; IronBee env wins last.",def:"unset (use default npx -y @ironbee-ai/devtools entry)",artifactAffecting:!0},{path:"nodeDevTools.env",type:"json",editor:"json",description:"Env-var overrides merged into the node-devtools MCP server entry. Same auto-OTEL injection as browserDevTools minus the browser-only vars.",def:"unset (defaults + auto-OTEL when collector configured)",artifactAffecting:!0},{path:"nodeDevTools.mcp",type:"json",editor:"json",description:"Full-replacement MCP config for the node-devtools server entry. IronBee env wins last.",def:"unset (use default npx -y @ironbee-ai/devtools entry)",artifactAffecting:!0},{path:"backendDevTools.env",type:"json",editor:"json",description:"Env-var overrides merged into the backend-devtools MCP server entry. Same auto-OTEL injection as nodeDevTools.",def:"unset (defaults + auto-OTEL when collector configured)",artifactAffecting:!0},{path:"backendDevTools.mcp",type:"json",editor:"json",description:"Full-replacement MCP config for the backend-devtools server entry. IronBee env wins last.",def:"unset (use default npx -y @ironbee-ai/devtools entry)",artifactAffecting:!0},{path:"androidDevTools.env",type:"json",editor:"json",description:"Env-var overrides merged into the android-devtools MCP server entry. Same auto-OTEL injection as nodeDevTools.",def:"unset (defaults + auto-OTEL when collector configured)",artifactAffecting:!0},{path:"androidDevTools.mcp",type:"json",editor:"json",description:"Full-replacement MCP config for the android-devtools server entry. IronBee env wins last.",def:"unset (use default npx -y @ironbee-ai/devtools entry)",artifactAffecting:!0}];function A(e){return d.find(t=>t.path===e)}n(A,"findSchemaEntry");function k(){return[...d].sort((e,t)=>{const o=l(c(e.path)),i=l(c(t.path));return o!==i?o-i:e.path.localeCompare(t.path)})}n(k,"orderedEntries");0&&(module.exports={ARTIFACT_AFFECTING_TOP_KEYS,CONFIG_SCHEMA,GROUP_ORDER,GROUP_TITLES,findSchemaEntry,groupOf,groupRank,groupTitle,orderedEntries,topKey});
|
|
1
|
+
"use strict";var a=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var n=(e,t)=>a(e,"name",{value:t,configurable:!0});var g=(e,t)=>{for(var o in t)a(e,o,{get:t[o],enumerable:!0})},y=(e,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of u(t))!h.call(e,r)&&r!==o&&a(e,r,{get:()=>t[r],enumerable:!(i=p(t,r))||i.enumerable});return e};var b=e=>y(a({},"__esModule",{value:!0}),e);var T={};g(T,{ARTIFACT_AFFECTING_TOP_KEYS:()=>v,CONFIG_SCHEMA:()=>d,GROUP_ORDER:()=>s,GROUP_TITLES:()=>f,findSchemaEntry:()=>A,groupOf:()=>l,groupRank:()=>c,groupTitle:()=>w,orderedEntries:()=>k,topKey:()=>m});module.exports=b(T);const v=new Set(["verification","collector","browser","node","backend","android","browserDevTools","nodeDevTools","backendDevTools","androidDevTools","telemetry","privacy","statusLine","otel","codex","runtime"]),s=["general","runtime","verification","verificationContext","browser","node","backend","android","collector","recording","jobQueue","analytics","statusLine","claude","codex","telemetry","privacy","otel","fileChange","import","browserDevTools","nodeDevTools","backendDevTools","androidDevTools"],f={general:"General",runtime:"Runtime",verification:"Verification",verificationContext:"Verification context",browser:"Browser cycle",node:"Node cycle",backend:"Backend cycle",android:"Android cycle",collector:"Collector",recording:"Recording",jobQueue:"Job queue",analytics:"Analytics",statusLine:"Statusline",claude:"Claude",codex:"Codex",telemetry:"Telemetry",privacy:"Privacy",otel:"OTEL collector",fileChange:"File change",import:"Import",browserDevTools:"Browser DevTools MCP",nodeDevTools:"Node DevTools MCP",backendDevTools:"Backend DevTools MCP",androidDevTools:"Android DevTools MCP"};function m(e){const t=e.indexOf(".");return t===-1?e:e.slice(0,t)}n(m,"topKey");function l(e){const t=e.indexOf(".");return t===-1?"general":e.slice(0,t)}n(l,"groupOf");function w(e){return f[e]??e}n(w,"groupTitle");function c(e){const t=s.indexOf(e);return t===-1?s.length:t}n(c,"groupRank");const d=[{path:"ignoredVerifyPatterns",type:"string-array",editor:"string-list",description:"Glob patterns excluded from verification, applied to every cycle (browser / node / backend). Checked first \u2014 a match here activates no cycle regardless of other patterns. Unioned on top of an always-on default set that excludes test files (**/*.spec.*, **/*.test.*, **/__tests__/**, **/__mocks__/**) \u2014 a test-only edit never activates a runtime-verification cycle.",def:"[] (plus always-on test-file defaults)",artifactAffecting:!1},{path:"maxRetries",type:"number",editor:"number",description:"Max verification retry attempts before the gate allows completion despite failures. Single global counter regardless of how many cycles ran.",def:"3",artifactAffecting:!1},{path:"runtime.location",type:"string",editor:"enum",enumValues:["external","in-project"],description:`Where per-session runtime data (the sessions/ folder \u2014 actions.jsonl, verdicts, queue, analytics) is stored. "external" (default) keeps it OUT of the project tree at ~/.ironbee/projects/<token> so a project never accumulates a growing sessions/ folder even when gitignored; "in-project" stores it under <project>/.ironbee/sessions (the legacy layout). Committed config / scenarios / VERIFICATION.md always stay in-project regardless. The IRONBEE_RUNTIME_LOCATION env var overrides this per process (used by the test suite). Artifact-affecting on Codex: the external layout adds a [sandbox_workspace_write].writable_roots grant so the agent's verdict write outside the workspace doesn't prompt. Takes effect on the next session.`,def:"external",artifactAffecting:!0},{path:"verification.enable",type:"boolean",editor:"toggle",description:"Master enforcement switch. Inverse semantics \u2014 verification is the core feature, opt out with false. When false, IronBee runs monitoring-only: no enforcement hooks, no skill/rule, no MCP servers; only session/activity/tool_call events flow to the collector.",def:"true",artifactAffecting:!0},{path:"verification.auto",type:"boolean",editor:"toggle",description:"Automatic-enforcement sub-toggle (only meaningful when verification.enable !== false). Default FALSE \u2014 assist is the default mode (the safer default): the /ironbee-verify command + MCP servers stay installed so the agent can verify manually, but nothing is enforced \u2014 no Stop gate, non-blocking (soft) PreToolUse hooks, and the skill/rule are omitted. Opt into full enforcement with true (blocking Stop gate + skill/rule installed).",def:"false",artifactAffecting:!0},{path:"verification.strict",type:"boolean",editor:"toggle",description:'Strict mode (only meaningful in enforce mode). Default false. When true the verify-gate refuses N/A verdicts \u2014 both a global status "not_applicable" and per-platform not_applicable_cycles exemptions \u2014 so the agent must produce real verification tool evidence for every active cycle. Default (false) accepts N/A: the agent can declare a change has no runtime surface (globally or per-cycle) and the gate allows it, recorded + observable. Inert in assist/monitor (no gate runs). The gate reads it live; the rerender it shares with the rest of the verification block is idempotent (the N/A guidance is mode-agnostic, so the installed artifacts don\'t change). Set via `ironbee verification strict` enable/disable, `config set`, or at install \u2014 picking enforce opens a strictness sub-choice (interactive) and the `--strict` flag sets it non-interactively.',def:"false",artifactAffecting:!0},{path:"verification.model",type:"json",editor:"json",description:`Model the delegated verifier sub-agent uses. Unset \u2192 the verifier inherits the session model (Claude verifier omits model: \u2192 inherit; Codex verifier omits agent-toml model \u2192 inherits config.toml's model). Set to PIN a specific model \u2014 e.g. verify on a cheaper/faster model than the main agent, or guarantee a model on Codex when config.toml has none. Two shapes: a string (applies to all clients, e.g. "sonnet" / "gpt-5.5") or a per-client object { claude: "sonnet", codex: "gpt-5.5" } when a project has both clients. Cursor has no verifier sub-agent \u2192 no-op there. Never resolves to a literal "inherit" on Codex (a 400). Artifact-affecting.`,def:"unset (inherit the session model)",artifactAffecting:!0},{path:"verificationContext.enable",type:"boolean",editor:"toggle",description:"Master switch for path-scoped verification context. When a cycle begins, the first devtools tool call injects the .ironbee/VERIFICATION.md files on/above the changed paths (author-written area guidance) into the agent's context via the host's additionalContext channel. Advisory only (does not gate). Inverse semantics \u2014 default-on, opt out with false. Not artifact-affecting (read live).",def:"true",artifactAffecting:!1},{path:"verificationContext.source",type:"string",editor:"enum",enumValues:["git","actions"],description:`Changed-path source. "git" (default) = working tree + last N commits, with an actions.jsonl fallback when not a git repo. "actions" = IronBee's own file_change events only (no git subprocess).`,def:"git",artifactAffecting:!1},{path:"verificationContext.commitDepth",type:"number",editor:"number",description:'Number of recent commits included on the git source (uncommitted \u222A last N commits). 0 = uncommitted only. Ignored when source is "actions".',def:"1",artifactAffecting:!1},{path:"verificationContext.maxBytes",type:"number",editor:"number",description:"Aggregate byte cap on the injected context string. When exceeded, the least-specific (root-side) docs are dropped first (leaf-first truncation priority).",def:"65536 (64 KB)",artifactAffecting:!1},{path:"browser.enable",type:"boolean",editor:"toggle",description:"Explicit on/off for the browser cycle. Written false by `browser disable`, stripped by `browser enable`. When false the cycle is disabled regardless of patterns.",def:"(absent \u2192 on; browser is the only default-on cycle)",artifactAffecting:!0},{path:"browser.verifyPatterns",type:"string-array",editor:"string-list",description:"Glob patterns for files requiring browser verification. Four-state: absent \u2192 code defaults (40+ extensions); [] \u2192 hard kill; non-empty \u2192 custom patterns (replaces defaults).",def:"40+ code extensions when unset; [] hard-disables",artifactAffecting:!0},{path:"browser.additionalVerifyPatterns",type:"string-array",editor:"string-list",description:"Extra patterns appended to browser.verifyPatterns (or to code defaults when verifyPatterns is unset). Ignored when verifyPatterns is [] (hard kill wins).",def:"[]",artifactAffecting:!0},{path:"browser.alwaysRequired",type:"string-array",editor:"string-list",description:"Browser-cycle required tools (all-of). The verify-gate blocks completion until every listed bdt_* tool was used.",def:"bdt_navigation_go-to, bdt_content_take-screenshot, bdt_a11y_take-aria-snapshot, bdt_o11y_get-console-messages",artifactAffecting:!0},{path:"browser.evidencePaths",type:"json",editor:"json",description:"Alternative tool-satisfaction paths (any-of). Browser uses pure all-of, so default is empty. Each path: { name, allOf: (string | { anyOf: string[] })[] }.",def:"[]",artifactAffecting:!0},{path:"node.enable",type:"boolean",editor:"toggle",description:"Explicit on/off for the Node.js runtime debug cycle (node-devtools, ndt_* V8 inspector probes). Opt-in \u2014 written by `node enable`.",def:"(absent \u2192 off; node is opt-in)",artifactAffecting:!0},{path:"node.verifyPatterns",type:"string-array",editor:"string-list",description:"Glob patterns for the Node.js runtime debug cycle. Default-off \u2014 block absent = inert. Block present + unset \u2192 9 code defaults (server/api/routes paths).",def:"block absent \u2192 disabled; present + unset \u2192 code defaults",artifactAffecting:!0},{path:"node.additionalVerifyPatterns",type:"string-array",editor:"string-list",description:"Extra patterns appended to node.verifyPatterns (or to code defaults when unset). Ignored when verifyPatterns is [].",def:"[]",artifactAffecting:!0},{path:"node.alwaysRequired",type:"string-array",editor:"string-list",description:"Node-cycle required tools (all-of). ndt_debug_connect always; evidence paths supply the rest.",def:"[ndt_debug_connect]",artifactAffecting:!0},{path:"node.evidencePaths",type:"json",editor:"json",description:"Alternative tool paths (any-of). Default: probe path (a put-*point AND get-probe-snapshots) OR log path (get-logs).",def:"probe path + log path",artifactAffecting:!0},{path:"backend.enable",type:"boolean",editor:"toggle",description:"Explicit on/off for the runtime-agnostic backend protocol cycle (backend-devtools, bedt_* HTTP/gRPC/GraphQL/WebSocket). Opt-in \u2014 written by `backend enable`.",def:"(absent \u2192 off; backend is opt-in)",artifactAffecting:!0},{path:"backend.verifyPatterns",type:"string-array",editor:"string-list",description:"Glob patterns for the backend protocol cycle. Default-off \u2014 block absent = inert. Block present + unset \u2192 13 multi-language code defaults (ts/js/py/go/java/rb/cs/rs/kt/scala/ex/php/clj).",def:"block absent \u2192 disabled; present + unset \u2192 code defaults",artifactAffecting:!0},{path:"backend.additionalVerifyPatterns",type:"string-array",editor:"string-list",description:"Extra patterns appended to backend.verifyPatterns (or to code defaults when unset). Ignored when verifyPatterns is [].",def:"[]",artifactAffecting:!0},{path:"backend.alwaysRequired",type:"string-array",editor:"string-list",description:"Backend-cycle required tools (all-of). Empty by default \u2014 backend uses any-of evidence paths instead.",def:"[]",artifactAffecting:!0},{path:"backend.evidencePaths",type:"json",editor:"json",description:"Alternative tool paths (any-of). Default three: protocol-call (any request tool) OR log-evidence (register-source + read) OR db-evidence (db_connect + a read op).",def:"protocol-call OR log-evidence OR db-evidence",artifactAffecting:!0},{path:"android.enable",type:"boolean",editor:"toggle",description:"Explicit on/off for the Android mobile verification cycle (android-devtools, adt_* device/emulator interaction). Opt-in \u2014 written by `android enable`.",def:"(absent \u2192 off; android is opt-in)",artifactAffecting:!0},{path:"android.verifyPatterns",type:"string-array",editor:"string-list",description:"Glob patterns for the Android mobile verification cycle. Default-off \u2014 block absent = inert. Block present + unset \u2192 code defaults (Android/React Native paths).",def:"block absent \u2192 disabled; present + unset \u2192 code defaults",artifactAffecting:!0},{path:"android.additionalVerifyPatterns",type:"string-array",editor:"string-list",description:"Extra patterns appended to android.verifyPatterns (or to code defaults when unset). Ignored when verifyPatterns is [].",def:"[]",artifactAffecting:!0},{path:"android.alwaysRequired",type:"string-array",editor:"string-list",description:"Android-cycle required tools (all-of). adt_device_connect always; evidence paths supply the rest.",def:"[adt_device_connect]",artifactAffecting:!0},{path:"android.evidencePaths",type:"json",editor:"json",description:"Alternative tool paths (any-of). Default three: device-evidence (UI interaction + screenshot + UI snapshot) OR log-evidence (Logcat read/follow) OR network-evidence (adt_o11y_get-http-requests HTTP capture). The adt_o11y_*-trace-context and adt_stub_* tools are auxiliary (NOT evidence paths).",def:"device-evidence OR log-evidence OR network-evidence",artifactAffecting:!0},{path:"collector.enable",type:"boolean",editor:"toggle",description:"Master switch for the IronBee Collector. Implicitly true when the section has url and at least one credential (oauthToken or apiKey); set false to suspend while keeping url/oauthToken/apiKey/batchSize around.",def:"implicit true when url + (oauthToken or apiKey) set",artifactAffecting:!0},{path:"collector.url",type:"string",editor:"text",description:"Remote collector endpoint URL (IronBee Platform). Required for the collector to be active. Events POST to {url}/v1/events.",def:"(unset \u2192 disabled)",artifactAffecting:!0},{path:"collector.oauthToken",type:"string",editor:"text",description:"Personal access token for collector auth (X-OAuth-Token header). Per-(user, account), independently revocable from the console's /access-tokens page. Minted by `ironbee login` \u2014 the primary path for interactive CLI use. Can be supplied via IRONBEE_OAUTH_TOKEN.",def:"(unset)",artifactAffecting:!0},{path:"collector.apiKey",type:"string",editor:"text",description:"Shared account API key for collector auth (X-API-Key header). Parallel first-class path alongside `oauthToken`, intended for CI / GitHub Actions / deployment tooling and other non-interactive integrations where rotating a per-engineer OAuth token is impractical. Either `oauthToken` OR `apiKey` is required for the collector to be active. Can be supplied via IRONBEE_API_KEY.",def:"(unset \u2192 disabled)",artifactAffecting:!0},{path:"collector.batchSize",type:"number",editor:"number",description:"Max events per POST from the send_event handler (the queue chunks bigger snapshots into N-sized POSTs).",def:"100",artifactAffecting:!0},{path:"collector.timeoutMs",type:"number",editor:"number",description:"Per-request HTTP timeout (ms) for batched analytics sends. Single-event interactive sends keep a fixed 3000ms cap. Clamped to [1000, 60000].",def:"10000",artifactAffecting:!0},{path:"recording.enable",type:"boolean",editor:"toggle",description:"Recording enforcement for the browser + android cycles. Presence opts in; enable:false opts out. Auto-enabled when a collector is configured. Node/backend cycles never trigger recording.",def:"implicit true when section present or collector configured",artifactAffecting:!1},{path:"jobQueue.enable",type:"boolean",editor:"toggle",description:"Master switch for the file-backed job queue. Presence opts in; enable:false opts out. Auto-enabled when a collector is configured (a collector is pointless without a queue feeding it).",def:"implicit true when section present or collector configured",artifactAffecting:!1},{path:"jobQueue.autoFlushSizeBytes",type:"number",editor:"number",description:"Size threshold (bytes) above which submit() spawns a detached worker mid-session. 0 / negative disables this check.",def:"32768 (32 KB)",artifactAffecting:!1},{path:"jobQueue.autoFlushIntervalSeconds",type:"number",editor:"number",description:"Interval threshold (seconds since the live jobs.jsonl was created) above which submit() spawns a detached worker. Complements size \u2014 whichever crosses first flushes. 0 / negative disables.",def:"60",artifactAffecting:!1},{path:"analytics.enable",type:"boolean",editor:"toggle",description:"Master switch for per-session structural analytics. Presence opts in; enable:false opts out. Auto-enabled when a collector is configured.",def:"implicit true when section present or collector configured",artifactAffecting:!1},{path:"analytics.emitOnStop",type:"boolean",editor:"toggle",description:"When true, project + emit analytics at every Stop hook. When false, only at SessionEnd.",def:"true",artifactAffecting:!1},{path:"analytics.emitOnStopMinIntervalSeconds",type:"number",editor:"number",description:"Throttle: skip Stop-hook projection if the last successful emit was within this many seconds. 0 disables the throttle (backend handles rate-limit / dedupe).",def:"0 (disabled)",artifactAffecting:!1},{path:"analytics.emitTurnEvents",type:"boolean",editor:"toggle",description:"Opt-in for per-turn session_turn_analytics wire records. High-volume secondary signal; the base session_analytics record always ships regardless.",def:"false",artifactAffecting:!1},{path:"analytics.emitStepEvents",type:"boolean",editor:"toggle",description:"Opt-in for per-step session_turn_step_analytics wire records (an order of magnitude higher volume than turn events). Independent of emitTurnEvents.",def:"false",artifactAffecting:!1},{path:"analytics.emitApiRequestEvents",type:"boolean",editor:"toggle",description:"Opt-OUT for per-API-request api_request wire records (one per assistant message, success + failure). Primary value for backend cost accounting, so ships by default.",def:"true",artifactAffecting:!1},{path:"statusLine.enable",type:"boolean",editor:"toggle",description:"Master switch for the Claude statusline integration (session_status event + statusline wrapper). Presence opts in; auto-enabled when a collector is configured. Claude-only.",def:"implicit true when section present or collector configured",artifactAffecting:!0},{path:"statusLine.renderDefault",type:"boolean",editor:"toggle",description:"When there is no upstream statusline to chain to, false keeps the statusline silent; true renders a minimal model + context-% line. No effect when the user already has a statusline.",def:"false",artifactAffecting:!0},{path:"statusLine.emitMinIntervalSeconds",type:"number",editor:"number",description:"Minimum seconds between two emitted session_status events, on top of skip-if-unchanged. Rapid changes coalesce to the latest state after the interval. 0 disables the throttle. Read live each tick.",def:"10",artifactAffecting:!0},{path:"statusLine.refreshInterval",type:"number",editor:"number",description:"Claude Code's own statusLine.refreshInterval (seconds, host min 1) \u2014 re-runs the statusline on a timer in addition to event-driven updates. Unset by default. Values < 1 treated as unset.",def:"unset",artifactAffecting:!0},{path:"claude.oauthAccess.enable",type:"boolean",editor:"toggle",description:"Whether IronBee may read the Claude Code OAuth token (macOS Keychain / ~/.claude/.credentials.json) and call OAuth-scoped Anthropic endpoints. Default-on (opt out with false or `ironbee claude oauth-access disable`). First consumer: the statusline rate-limit fallback \u2014 fetches /api/oauth/usage to fill rate_limits for plans the statusline JSON omits them for (team / enterprise). Claude-only; not artifact-affecting (read live).",def:"true",artifactAffecting:!1},{path:"claude.oauthAccess.usageTtlSeconds",type:"number",editor:"number",description:"TTL (seconds) for the statusline OAuth rate-limit fetch cache \u2014 the /api/oauth/usage call + credential read fire at most once per this interval even when the statusline ticks far more often. Default 60; 0 means every tick.",def:"60",artifactAffecting:!1},{path:"claude.autoModeAllowlist.enable",type:"boolean",editor:"toggle",description:"Whether IronBee writes the auto-mode allowlist carve-out for the verifier into .claude/settings.local.json. Claude Code 2.1.176+ ships a host-side sub-agent \"Content Integrity\" classifier (auto mode) that false-positives on IronBee's legitimate `ironbee hook submit-verdict` verdicts (the devtools calls happened earlier in the cycle, not re-shown in the handoff). When enabled (default), install adds a narrow, command-keyed autoMode.allow rule that exempts ONLY that command from the Content Integrity block ($defaults preserved \u2014 every other block rule still applies; IronBee's Stop-gate independently enforces real tool usage). Written only when verification is active (enforce/assist); inert when the host isn't in auto mode. Opt out with false \u2014 takes effect on the next `ironbee install`. Claude-only.",def:"true",artifactAffecting:!1},{path:"claude.trustWorkspace.enable",type:"boolean",editor:"toggle",description:"Whether `ironbee install` marks the installed project trusted in Claude Code's machine-global ~/.claude.json (projects[\"<dir>\"].hasTrustDialogAccepted: true) when it isn't already. Claude Code 2.1.x ignores a project's committed permissions.allow (the devtools + `Bash(ironbee *)` entries IronBee writes) until the workspace is trusted \u2014 and once onboarding has been seen the trust dialog no longer re-appears, so the entries stay silently disabled and the agent gets prompted on every devtools/ironbee call. Default-on (opt out with false). Only ever flips a missing/false flag to true; never clobbers other ~/.claude.json content. Best-effort + idempotent. Claude-only; not artifact-affecting (writes the host's global config, not a project artifact).",def:"true",artifactAffecting:!1},{path:"codex.verifier.mode",type:"string",editor:"enum",enumValues:["sub-agent","main-agent"],description:'How the Codex verification cycle is driven (Codex-only). "sub-agent" (default) delegates to the ironbee-verifier custom agent (per-agent MCP, SubagentStart bridge, slim delegation skill/rule/command). "main-agent" makes the MAIN agent drive the devtools tools directly (session-level [mcp_servers.*], no verifier agent, inline skill/rule/command) \u2014 the Cursor-style fallback for when Codex\'s sub-agent machinery regresses. Re-renders the Codex client. Toggle via `ironbee codex verifier mode <sub-agent|main-agent>`.',def:"sub-agent",artifactAffecting:!0},{path:"telemetry.enable",type:"boolean",editor:"toggle",description:"Master switch for anonymous PostHog telemetry (CLI's own product analytics). Inverse semantics \u2014 opt out with false. Disabling also injects TELEMETRY_ENABLE=false into devtools MCP env. Orthogonal to the collector pipeline.",def:"true",artifactAffecting:!0},{path:"privacy.enable",type:"boolean",editor:"toggle",description:"Privacy mode \u2014 a single cross-cutting switch (all platforms) that redacts potentially sensitive data from what the @ironbee-ai/devtools MCP servers ship to the collector. Opt-in, default OFF. When true, injects COLLECTOR_EVENTS_TOOL_DETAILS_ENABLE=false (tool input/output detail) + COLLECTOR_ARTIFACTS_ENABLE=false (screenshots, recordings) into every devtools MCP env. Devtools-side only \u2014 the CLI's own send_event pipeline already whitelists tool_input and strips tool_response. Orthogonal to telemetry (PostHog) and collector (the sink).",def:"false",artifactAffecting:!0},{path:"otel.enable",type:"boolean",editor:"toggle",description:"Master switch for the local OTEL collector pipeline (Claude Code OTLP raw-API-body export \u2192 local daemon \u2192 session_context context-usage events). Presence opts in; enable:false opts out; auto-enabled when a collector is configured. session_context derivation is the sole consumer, so this also gates whether the settings.json OTEL env block (incl. raw-bodies) is written. Orthogonal to telemetry (PostHog) and collector (event sink).",def:"implicit true when collector configured",artifactAffecting:!0},{path:"otel.port",type:"number",editor:"number",description:"Loopback port the shared OTEL collector daemon binds to, and which the settings.json OTEL endpoint env var points at. One daemon per machine across all sessions.",def:"15986",artifactAffecting:!0},{path:"otel.idleTimeoutSeconds",type:"number",editor:"number",description:"The daemon self-reaps (graceful shutdown) after this many seconds with no /health hit and no OTLP event. Restarted on the next session/turn ensure.",def:"600",artifactAffecting:!0},{path:"otel.ensureMinIntervalSeconds",type:"number",editor:"number",description:"Throttle (seconds) for the high-frequency liveness `ensure` from per-tool hooks, so we don't pay a /health check on every tool call. session-start / activity-start ensure are unthrottled.",def:"30",artifactAffecting:!0},{path:"otel.emitMinIntervalSeconds",type:"number",editor:"number",description:"Per-session session_context emit throttle: admit at most one event per session per interval (leading-edge \u2014 the first request in each window is emitted, in-between requests are coalesced away and their body files dropped). Applies to the live path only; the catch-up/reprocess path is never throttled. 0 = emit on every API request (full context-growth time series).",def:"0",artifactAffecting:!0},{path:"fileChange.captureChangeset",type:"boolean",editor:"toggle",description:"When true, every file_change event carries a hunks-only unified-diff changeset string. Off by default \u2014 the default wire shape stays metadata-only (operation + line counts).",def:"false",artifactAffecting:!1},{path:"fileChange.maxChangesetBytes",type:"number",editor:"number",description:"Hard cap on the changeset string size. Diffs over the cap are truncated with a footer so the collector POST stays within typical reverse-proxy body limits.",def:"65536 (64 KB)",artifactAffecting:!1},{path:"import.concurrency",type:"number",editor:"number",description:"Default number of sessions `ironbee import` processes in parallel. Resolution: --concurrency flag > this value > built-in default. Clamped to [1, 32].",def:"4",artifactAffecting:!1},{path:"browserDevTools.env",type:"json",editor:"json",description:"Env-var overrides merged into the browser-devtools MCP server entry. Operators can override individual OTEL keys; IronBee invariants (TOOL_NAME_PREFIX, \u2026) always win last.",def:"unset (defaults + auto-OTEL when collector configured)",artifactAffecting:!0},{path:"browserDevTools.mcp",type:"json",editor:"json",description:"Full-replacement MCP config for the browser-devtools server entry. Auto-OTEL + telemetry env are still injected; IronBee env wins last.",def:"unset (use default npx -y @ironbee-ai/devtools entry)",artifactAffecting:!0},{path:"nodeDevTools.env",type:"json",editor:"json",description:"Env-var overrides merged into the node-devtools MCP server entry. Same auto-OTEL injection as browserDevTools minus the browser-only vars.",def:"unset (defaults + auto-OTEL when collector configured)",artifactAffecting:!0},{path:"nodeDevTools.mcp",type:"json",editor:"json",description:"Full-replacement MCP config for the node-devtools server entry. IronBee env wins last.",def:"unset (use default npx -y @ironbee-ai/devtools entry)",artifactAffecting:!0},{path:"backendDevTools.env",type:"json",editor:"json",description:"Env-var overrides merged into the backend-devtools MCP server entry. Same auto-OTEL injection as nodeDevTools.",def:"unset (defaults + auto-OTEL when collector configured)",artifactAffecting:!0},{path:"backendDevTools.mcp",type:"json",editor:"json",description:"Full-replacement MCP config for the backend-devtools server entry. IronBee env wins last.",def:"unset (use default npx -y @ironbee-ai/devtools entry)",artifactAffecting:!0},{path:"androidDevTools.env",type:"json",editor:"json",description:"Env-var overrides merged into the android-devtools MCP server entry. Same auto-OTEL injection as nodeDevTools.",def:"unset (defaults + auto-OTEL when collector configured)",artifactAffecting:!0},{path:"androidDevTools.mcp",type:"json",editor:"json",description:"Full-replacement MCP config for the android-devtools server entry. IronBee env wins last.",def:"unset (use default npx -y @ironbee-ai/devtools entry)",artifactAffecting:!0}];function A(e){return d.find(t=>t.path===e)}n(A,"findSchemaEntry");function k(){return[...d].sort((e,t)=>{const o=c(l(e.path)),i=c(l(t.path));return o!==i?o-i:e.path.localeCompare(t.path)})}n(k,"orderedEntries");0&&(module.exports={ARTIFACT_AFFECTING_TOP_KEYS,CONFIG_SCHEMA,GROUP_ORDER,GROUP_TITLES,findSchemaEntry,groupOf,groupRank,groupTitle,orderedEntries,topKey});
|
package/dist/tui/queue/read.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var g=Object.defineProperty;var
|
|
2
|
-
`).filter(i=>i.trim().length>0).length}catch{return 0}}a(
|
|
3
|
-
`))if(
|
|
1
|
+
"use strict";var g=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var a=(r,t)=>g(r,"name",{value:t,configurable:!0});var L=(r,t)=>{for(var i in t)g(r,i,{get:t[i],enumerable:!0})},j=(r,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of S(t))!w.call(r,n)&&n!==i&&g(r,n,{get:()=>t[n],enumerable:!(s=D(t,n))||s.enumerable});return r};var F=r=>j(g({},"__esModule",{value:!0}),r);var $={};L($,{deadLetterStats:()=>v,listQueues:()=>x,purgeOldSessions:()=>q,purgeSnapshots:()=>Q,removeDeadLetterEntry:()=>E});module.exports=F($);var e=require("fs"),m=require("path"),y=require("../../queue"),d=require("../../lib/runtime-paths");function b(r){try{return(0,e.readFileSync)(r,"utf-8").split(`
|
|
2
|
+
`).filter(i=>i.trim().length>0).length}catch{return 0}}a(b,"countLines");function k(r){try{return(0,e.statSync)(r).isFile()}catch{return!1}}a(k,"isFile");function h(r,t){let i=0,s=0,n=0,u=[];try{u=(0,e.readdirSync)(r)}catch{u=[]}for(const o of u){const c=(0,m.join)(r,o);k(c)&&(o==="jobs.jsonl"?i+=b(c):/^jobs-.*\.jsonl$/.test(o)?(s+=1,i+=b(c)):(o==="dead-letter.jsonl"||/^dead-letter-.*\.jsonl$/.test(o))&&(n+=b(c)))}return{sessionId:t,pending:i,snapshots:s,deadLetter:n}}a(h,"readQueueDir");function x(r){const t=(0,d.sessionsRoot)(r);if(!(0,e.existsSync)(t))return[];let i;try{i=(0,e.readdirSync)(t,{withFileTypes:!0}).filter(n=>n.isDirectory()).map(n=>n.name)}catch{return[]}const s=[];for(const n of i){const u=(0,m.join)(t,n,"queue");s.push((0,e.existsSync)(u)?h(u,n):{sessionId:n,pending:0,snapshots:0,deadLetter:0})}return s}a(x,"listQueues");function E(r,t,i){const s=(0,y.deadLetterFile)(r,t);if(!(0,e.existsSync)(s))return!1;let n;try{n=(0,e.readFileSync)(s,"utf-8")}catch{return!1}const u=[];let o=!1;for(const l of n.split(`
|
|
3
|
+
`))if(l.length!==0){if(!o)try{const f=JSON.parse(l);if(f!==null&&typeof f=="object"&&"original"in f){const p=f.original;if(p!==null&&typeof p=="object"&&p.id===i){o=!0;continue}}}catch{}u.push(l)}if(!o)return!1;const c=`${s}.tmp-${process.pid}-${Date.now()}`;try{(0,e.writeFileSync)(c,u.length>0?u.join(`
|
|
4
4
|
`)+`
|
|
5
|
-
`:""),(0,e.renameSync)(c,s)}catch{try{(0,e.existsSync)(c)&&(0,e.unlinkSync)(c)}catch{}return!1}return!0}a(
|
|
5
|
+
`:""),(0,e.renameSync)(c,s)}catch{try{(0,e.existsSync)(c)&&(0,e.unlinkSync)(c)}catch{}return!1}return!0}a(E,"removeDeadLetterEntry");function Q(r){const t=(0,d.sessionsRoot)(r);if(!(0,e.existsSync)(t))return 0;let i;try{i=(0,e.readdirSync)(t,{withFileTypes:!0}).filter(n=>n.isDirectory()).map(n=>n.name)}catch{return 0}let s=0;for(const n of i){const u=(0,m.join)(t,n,"queue");if(!(0,e.existsSync)(u))continue;let o;try{o=(0,e.readdirSync)(u)}catch{continue}for(const c of o)if(y.SNAPSHOT_FILENAME_REGEX.test(c))try{(0,e.unlinkSync)((0,m.join)(u,c)),s+=1}catch{}}return s}a(Q,"purgeSnapshots");function q(r,t){const i=Date.now()-t,s=(0,d.sessionsRoot)(r);if(!(0,e.existsSync)(s))return 0;let n;try{n=(0,e.readdirSync)(s,{withFileTypes:!0}).filter(o=>o.isDirectory()).map(o=>o.name)}catch{return 0}let u=0;for(const o of n){const c=(0,m.join)(s,o,"queue");if(!(0,e.existsSync)(c))continue;const l=h(c,o);if(l.pending>0||l.snapshots>0||l.deadLetter>0)continue;let f;try{f=(0,e.statSync)(c).mtimeMs}catch{continue}if(!(f>i))try{(0,e.rmSync)(c,{recursive:!0,force:!0}),u+=1}catch{}}return u}a(q,"purgeOldSessions");function v(r){const t={};for(const i of r){const s="category"in i&&typeof i.category=="string"?i.category:"(unknown)";t[s]=(t[s]??0)+1}return{total:r.length,byCategory:t}}a(v,"deadLetterStats");0&&(module.exports={deadLetterStats,listQueues,purgeOldSessions,purgeSnapshots,removeDeadLetterEntry});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var S=Object.create;var g=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var k=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var i=(e,s)=>g(e,"name",{value:s,configurable:!0});var R=(e,s)=>{for(var n in s)g(e,n,{get:s[n],enumerable:!0})},y=(e,s,n,l)=>{if(s&&typeof s=="object"||typeof s=="function")for(let o of A(s))!F.call(e,o)&&o!==n&&g(e,o,{get:()=>s[o],enumerable:!(l=$(s,o))||l.enumerable});return e};var T=(e,s,n)=>(n=e!=null?S(k(e)):{},y(s||!e||!e.__esModule?g(n,"default",{value:e,enumerable:!0}):n,e)),j=e=>y(g({},"__esModule",{value:!0}),e);var x={};R(x,{scenariosArea:()=>E});module.exports=j(x);var b=T(require("blessed")),a=require("../shell/util"),u=require("../../lib/scenario-staleness");const C=" {bold}\u2191/\u2193{/bold} move {bold}r{/bold} refresh {bold}Esc{/bold} back {bold}q{/bold} quit";function p(e){return e==="fresh"?"{green-fg}fresh{/green-fg}":e==="stale"?"{yellow-fg}stale{/yellow-fg}":"{gray-fg}unknown{/gray-fg}"}i(p,"stateTag");function D(e){const s=e.session.projectDir;let n=(0,u.checkScenarioFreshness)(s),l=0;const o=b.list({parent:e.container,top:0,left:0,width:"55%",height:"100%",border:{type:"line"},label:" Scenarios ",tags:!0,keys:!1,mouse:!1,scrollbar:{ch:" "},style:{selected:{bg:"blue",fg:"white"},border:{fg:"cyan"}},items:[]}),d=b.box({parent:e.container,top:0,left:"55%",width:"45%",height:"100%",border:{type:"line"},label:" Detail ",tags:!0,scrollable:!0,alwaysScroll:!0,scrollbar:{ch:" "},style:{border:{fg:"cyan"}},content:""});function m(r){const t=r.name.length>24?r.name.slice(0,23)+"\u2026":r.name.padEnd(24," ");return`${p(r.state)} ${(0,a.escapeTags)(t)} {gray-fg}[${r.platform}]{/gray-fg}`}i(m,"rowLabel");function v(r){if(r===void 0)return"{gray-fg}No saved scenarios for this project (.ironbee/scenarios/).{/gray-fg}";const t=[];if(t.push(`{bold}${(0,a.escapeTags)(r.name)}{/bold} {gray-fg}[${r.platform}]{/gray-fg}`),t.push("{gray-fg}"+"\u2500".repeat(40)+"{/gray-fg}"),t.push(`{gray-fg}state:{/gray-fg} ${p(r.state)}`),t.push(`{gray-fg}why:{/gray-fg} ${(0,a.escapeTags)(r.reason)}`),t.push(`{gray-fg}commit:{/gray-fg} ${(0,a.escapeTags)(r.commit??"\u2014")}`),t.push(`{gray-fg}live:{/gray-fg} ${r.liveValidated===void 0?"\u2014":String(r.liveValidated)}`),t.push(""),t.push("{bold}covered paths{/bold}"),r.coveredPaths.length===0)t.push(" {gray-fg}(none recorded){/gray-fg}");else for(const c of r.coveredPaths){const w=r.changedCoveredPaths.includes(c);t.push(w?` {yellow-fg}\u2022{/yellow-fg} ${(0,a.escapeTags)(c)} {yellow-fg}(changed){/yellow-fg}`:` {gray-fg}\u2022{/gray-fg} ${(0,a.escapeTags)(c)}`)}return r.state==="stale"&&(t.push(""),t.push("{yellow-fg}Stale.{/yellow-fg} Repair with {bold}/ironbee-sync-scenario{/bold} in your agent,"),t.push("or re-validate via {bold}/ironbee-verify scenario:<name>{/bold}."),t.push("{gray-fg}(the TUI is read-only \u2014 repair needs the agent){/gray-fg}")),t.join(`
|
|
2
|
+
`)}i(v,"buildDetail");function f(){n.length===0?o.setItems(["{gray-fg}(no scenarios){/gray-fg}"]):(o.setItems(n.map(t=>m(t))),o.select((0,a.clamp)(l,0,n.length-1)));const r=n.length===0?void 0:n[(0,a.clamp)(l,0,n.length-1)];d.setContent(v(r)),d.setScroll(0),e.screen.render()}i(f,"render");function h(r){n.length!==0&&(l=(0,a.clamp)(l+r,0,n.length-1),f())}return i(h,"move"),o.key(["up","k"],()=>h(-1)),o.key(["down","j"],()=>h(1)),o.key(["r"],()=>{n=(0,u.checkScenarioFreshness)(s),l=(0,a.clamp)(l,0,Math.max(0,n.length-1)),f()}),e.setStatus(C),f(),o.focus(),e.screen.render(),{unmount(){o.destroy(),d.destroy()}}}i(D,"mountScenariosView");const E={id:"scenarios",title:"Scenarios",summary:"Browse saved scenarios + freshness (fresh / stale / unknown) vs current code",mount(e){return D(e)}};0&&(module.exports={scenariosArea});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var k=Object.defineProperty;var
|
|
2
|
-
`)){if(
|
|
1
|
+
"use strict";var k=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var l=(e,s)=>k(e,"name",{value:s,configurable:!0});var _=(e,s)=>{for(var n in s)k(e,n,{get:s[n],enumerable:!0})},D=(e,s,n,t)=>{if(s&&typeof s=="object"||typeof s=="function")for(let i of C(s))!x.call(e,i)&&i!==n&&k(e,i,{get:()=>s[i],enumerable:!(t=A(s,i))||t.enumerable});return e};var j=e=>D(k({},"__esModule",{value:!0}),e);var $={};_($,{listSessions:()=>R,readSessionDetail:()=>v,validateVerdict:()=>M});module.exports=j($);var a=require("fs"),p=require("path"),w=require("../../lib/runtime-paths");function V(e){if((0,a.existsSync)(e))try{const s=JSON.parse((0,a.readFileSync)(e,"utf-8"));return s===null||typeof s!="object"||Array.isArray(s)?void 0:s}catch{return}}l(V,"readJson");function g(e){return typeof e=="string"?e:void 0}l(g,"asString");function R(e){const s=(0,w.sessionsRoot)(e);if(!(0,a.existsSync)(s))return[];let n;try{n=(0,a.readdirSync)(s,{withFileTypes:!0}).filter(i=>i.isDirectory()).map(i=>i.name)}catch{return[]}const t=[];for(const i of n){const r=(0,p.join)(s,i),u=(0,p.join)(r,"state.json"),c=(0,p.join)(r,"verdict.json"),o=V(u),m=V(c);let f=0;try{f=(0,a.statSync)((0,a.existsSync)(u)?u:r).mtimeMs}catch{f=0}t.push({id:i,phase:g(o?.phase),verdictStatus:g(m?.status)??g(o?.lastVerdictStatus),active:typeof o?.active=="boolean"?o.active:void 0,retries:typeof o?.retries=="number"?o.retries:void 0,mtimeMs:f})}return t.sort((i,r)=>r.mtimeMs-i.mtimeMs),t}l(R,"listSessions");function M(e,s){if(e===void 0)return{hasVerdict:!1,status:void 0,checks:[],allPassed:!1,wouldAllow:!1,retries:s};const n=[];let t=!0;const i=e.status==="not_applicable";return e.status==="pass"||e.status==="fail"||e.status==="not_applicable"?n.push({label:`status: ${e.status}`,ok:!0}):(n.push({label:"status",ok:!1,reason:`unknown "${e.status??""}" \u2014 must be "pass", "fail", or "not_applicable"`}),t=!1),i||(e.checks.length>0?n.push({label:`checks (${e.checks.length} item(s))`,ok:!0}):(n.push({label:"checks",ok:!1,reason:"missing or empty"}),t=!1)),(i||e.notApplicableCycles.length>0)&&(e.reason.length>0?n.push({label:`reason (${e.reason.length} item(s))`,ok:!0}):(n.push({label:"reason",ok:!1,reason:"required for N/A (global or per-platform)"}),t=!1)),e.notApplicableCycles.length>0&&n.push({label:`not_applicable_cycles: ${e.notApplicableCycles.join(", ")}`,ok:!0}),e.status==="fail"&&(e.issues.length>0?n.push({label:`issues (${e.issues.length} item(s))`,ok:!0}):(n.push({label:"issues",ok:!1,reason:'required when status is "fail"'}),t=!1)),{hasVerdict:!0,status:e.status,checks:n,allPassed:t,wouldAllow:t&&(e.status==="pass"||e.status==="not_applicable"),retries:s}}l(M,"validateVerdict");function h(e){return Array.isArray(e)?e.filter(s=>typeof s=="string"):[]}l(h,"asStringArray");function v(e,s){const n=(0,w.sessionDir)(e,s),t=V((0,p.join)(n,"verdict.json")),i=t===void 0?void 0:{status:g(t.status),checks:h(t.checks),issues:h(t.issues),fixes:h(t.fixes),reason:h(t.reason),notApplicableCycles:h(t.not_applicable_cycles)},r={activities:0,verifications:0,fileChanges:0,toolCalls:0,verdicts:0};let u,c;const o=(0,p.join)(n,"actions.jsonl");if((0,a.existsSync)(o)){let m="";try{m=(0,a.readFileSync)(o,"utf-8")}catch{m=""}for(const f of m.split(`
|
|
2
|
+
`)){if(f.trim().length===0)continue;let S;try{const y=JSON.parse(f);if(y===null||typeof y!="object"||Array.isArray(y))continue;S=y}catch{continue}const b=g(S.type);b==="activity_start"?r.activities+=1:b==="verification_start"?r.verifications+=1:b==="file_change"?r.fileChanges+=1:b==="tool_call"?r.toolCalls+=1:b==="verdict_write"&&(r.verdicts+=1);const d=S.timestamp;typeof d=="number"&&Number.isFinite(d)&&(u=u===void 0?d:Math.min(u,d),c=c===void 0?d:Math.max(c,d))}}return{id:s,verdict:i,counts:r,firstTs:u,lastTs:c}}l(v,"readSessionDetail");0&&(module.exports={listSessions,readSessionDetail,validateVerdict});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var m=Object.defineProperty;var
|
|
1
|
+
"use strict";var m=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var a=(o,r)=>m(o,"name",{value:r,configurable:!0});var x=(o,r)=>{for(var i in r)m(o,i,{get:r[i],enumerable:!0})},b=(o,r,i,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let e of g(r))!l.call(o,e)&&e!==i&&m(o,e,{get:()=>r[e],enumerable:!(t=T(r,e))||t.enumerable});return o};var j=o=>b(m({},"__esModule",{value:!0}),o);var E={};x(E,{AREAS:()=>d,findArea:()=>q});module.exports=j(E);var f=require("../config/area"),A=require("../import/area"),n=require("../platforms/area"),p=require("../projects/area"),s=require("../queue/area"),u=require("../sessions/area"),c=require("../scenarios/area");const d=[f.configArea,n.platformsArea,p.projectsArea,u.sessionsArea,c.scenariosArea,s.queueArea,A.importArea];function q(o){return d.find(r=>r.id===o)}a(q,"findArea");0&&(module.exports={AREAS,findArea});
|