@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
package/dist/commands/status.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var d=Object.defineProperty;var
|
|
1
|
+
"use strict";var d=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var m=(n,t)=>d(n,"name",{value:t,configurable:!0});var S=(n,t)=>{for(var e in t)d(n,e,{get:t[e],enumerable:!0})},w=(n,t,e,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of h(t))!k.call(n,o)&&o!==e&&d(n,o,{get:()=>t[o],enumerable:!(l=v(t,o))||l.enumerable});return n};var j=n=>w(d({},"__esModule",{value:!0}),n);var D={};S(D,{statusCommand:()=>C});module.exports=j(D);var y=require("commander"),i=require("fs"),c=require("path"),s=require("../lib/output"),$=require("../lib/runtime-paths");function _(n){const t=(0,c.join)(n,"actions.jsonl");if(!(0,i.existsSync)(t))return!1;let e;try{e=(0,i.readFileSync)(t,"utf-8")}catch{return!1}return e.includes('"type":"verification_requested"')||e.includes('"type": "verification_requested"')?!1:e.includes('"type":"session_start"')||e.includes('"type": "session_start"')}m(_,"isMonitoringOnlySession");const C=new y.Command("status").description("Show verification status for all active sessions").argument("[project-dir]","target project directory",".").action(n=>{const t=(0,c.resolve)(n),e=(0,$.sessionsRoot)(t);if(!(0,i.existsSync)(e)){s.log.warn("No .ironbee/sessions/ directory found. Run `ironbee install` first.");return}const l=(0,i.readdirSync)(e).filter(o=>(0,i.statSync)((0,c.join)(e,o)).isDirectory());if(l.length===0){s.log.dim(" .ironbee/sessions/ (no active sessions)");return}s.log.info(`Sessions in ${s.pc.dim(e)}`),s.log.blank();for(const o of l){const g=(0,c.join)(e,o,"verdict.json"),u=(0,c.join)(e,o,"retries"),a=(0,i.existsSync)(u)&&parseInt((0,i.readFileSync)(u,"utf-8"),10)||0;if(!(0,i.existsSync)(g)){console.log(` ${s.pc.bold(s.pc.cyan(o))}`),_((0,c.join)(e,o))?console.log(` ${s.pc.dim("verdict")} : ${s.pc.dim("none (monitoring-only session)")}`):console.log(` ${s.pc.dim("verdict")} : ${s.pc.yellow("missing")}`),a>0&&console.log(` ${s.pc.dim("retries")} : ${s.pc.yellow(`${a}/3`)}`),s.log.blank();continue}let r;try{r=JSON.parse((0,i.readFileSync)(g,"utf-8"))}catch{console.log(` ${s.pc.bold(s.pc.cyan(o))}`),console.log(` ${s.pc.dim("verdict")} : ${s.pc.red("invalid JSON")}`),s.log.blank();continue}const f=Array.isArray(r.checks)?r.checks.length:0,p=r.status==="pass"?s.pc.green:r.status==="not_applicable"?s.pc.dim:s.pc.red;if(console.log(` ${s.pc.bold(s.pc.cyan(o))}`),console.log(` ${s.pc.dim("status")} : ${p(r.status)}`),console.log(` ${s.pc.dim("checks")} : ${f>0?s.pc.green(String(f)):s.pc.yellow("0")}`),a>0&&console.log(` ${s.pc.dim("retries")} : ${s.pc.yellow(`${a}/3`)}`),r.status==="fail"&&r.issues?.length){console.log(` ${s.pc.dim("issues")} :`);for(const b of r.issues)console.log(` ${s.pc.red("\u2022")} ${b}`)}s.log.blank()}});0&&(module.exports={statusCommand});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var h=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var
|
|
1
|
+
"use strict";var h=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var u=(n,t)=>h(n,"name",{value:t,configurable:!0});var k=(n,t)=>{for(var r in t)h(n,r,{get:t[r],enumerable:!0})},U=(n,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of A(t))!N.call(n,i)&&i!==r&&h(n,i,{get:()=>t[i],enumerable:!(o=S(t,i))||o.enumerable});return n};var T=n=>U(h({},"__esModule",{value:!0}),n);var _={};k(_,{runUninstallAll:()=>x,uninstallCommand:()=>D});module.exports=T(_);var E=require("commander"),a=require("fs"),p=require("path"),l=require("../clients/registry"),e=require("../lib/output"),y=require("../lib/prompt"),m=require("../lib/projects-registry"),P=require("../lib/runtime-paths"),v=require("../lib/telemetry");function C(){return l.REGISTERED_CLIENTS.map(t=>t.name).join(", ")}u(C,"clientNames");const b=10;function $(n){const t=(0,P.externalRuntimeRoot)(n);(0,a.existsSync)(t)&&(0,a.rmSync)(t,{recursive:!0,force:!0})}u($,"pruneExternalRuntimeRoot");function w(n,t){for(const i of t)i.uninstall(n);const r=t.map(i=>i.name);(0,m.removeProject)(n);const o=(0,p.join)(n,".ironbee");return(0,a.existsSync)(o)&&(0,a.rmSync)(o,{recursive:!0,force:!0}),$(n),r}u(w,"uninstallOne");function I(n){if(n===void 0||n==="all")return l.REGISTERED_CLIENTS;const t=(0,l.findClient)(n);if(t===void 0)throw new Error(`Unknown client: '${n}'. Available: ${C()}.`);return[t]}u(I,"resolveClientsForUninstall");async function x(n){const t=(0,m.listProjects)();if(t.length===0)return e.log.info("No registered projects. Nothing to uninstall."),{failures:0,total:0};const r=[],o=[];for(const s of t)((0,l.isProjectActive)(s)?r:o).push(s);if(r.length===0){if(e.log.info("No active registered projects to uninstall from."),o.length>0){for(const s of o)$(s.path),(0,m.removeProject)(s.path);e.log.step(`Pruned ${e.pc.bold(String(o.length))} stale registry entr${o.length===1?"y":"ies"}.`)}return{failures:0,total:0}}e.log.warn(`About to uninstall ironbee from ${e.pc.bold(String(r.length))} project(s):`);const i=r.slice(0,b);for(const s of i)console.log(` ${e.pc.dim("\xB7")} ${e.pc.dim(s.path)}`);r.length>b&&console.log(` ${e.pc.dim("\u2026and")} ${e.pc.bold(String(r.length-b))} ${e.pc.dim("more")}`),o.length>0&&e.log.dim(`(${o.length} stale registry entr${o.length===1?"y":"ies"} will also be pruned)`);let g;if(n.yes===!0?g=!0:(0,y.isInteractive)()?g=await(0,y.promptYesNo)("Continue?",!1):(e.log.error("Refusing to batch-uninstall without --yes in a non-interactive context."),process.exit(1)),!g)return e.log.info("Aborted."),{failures:0,total:0};e.log.blank();let f=0;const c=[];for(const s of r)try{e.log.label("project",e.pc.dim(s.path));const d=I(n.client),R=w(s.path,d);c.push(...R)}catch(d){f++,e.log.error(` ${s.path}: ${d instanceof Error?d.message:String(d)}`)}for(const s of o)$(s.path),(0,m.removeProject)(s.path);e.log.blank(),f===0?e.log.success(`Uninstalled from ${r.length} project(s).${o.length>0?` Pruned ${o.length} stale entr${o.length===1?"y":"ies"}.`:""} ${e.pc.dim("Restart your AI coding client(s) to apply.")}`):e.log.warn(`Completed with ${f} failure(s) \u2014 see above.`);const j=Array.from(new Set(c));return j.length>0&&await(0,v.trackUninstall)(j),{failures:f,total:r.length}}u(x,"runUninstallAll");const D=new E.Command("uninstall").description("Remove IronBee hooks and guidance files from a project. Use --all to uninstall across every registered project (destructive \u2014 confirms before acting).").argument("[project-dir]","target project directory",".").option("--client <name>",`client to uninstall for (${C()}), or "all"`).option("--all","Uninstall across every project in the user-home inventory (~/.ironbee/projects.json). The [project-dir] argument is ignored when --all is set. Prompts before acting unless --yes is also passed.").option("-y, --yes","Skip the confirmation prompt for --all (required in non-interactive contexts).").action(async(n,t)=>{if(t.all===!0){(await x({client:t.client,yes:t.yes})).failures>0&&process.exit(1);return}const r=(0,p.resolve)(n);(0,a.existsSync)(r)||(e.log.error(`Directory not found: ${r}`),process.exit(1));let o;if(t.client!==void 0)try{o=I(t.client)}catch(c){e.log.error(c instanceof Error?c.message:String(c)),process.exit(1)}else if(o=(0,l.detectClients)(r),o.length===0){e.log.info("No client detected. Nothing to uninstall.");return}const i=(0,p.join)(r,".ironbee"),g=(0,a.existsSync)(i),f=w(r,o);g&&e.log.step(`Removed ${e.pc.dim(i)}`),e.log.blank(),e.log.success(`IronBee removed. ${e.pc.dim("Restart your AI coding client to apply changes.")}`),await(0,v.trackUninstall)(f,r)});0&&(module.exports={runUninstallAll,uninstallCommand});
|
package/dist/commands/verify.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var p=Object.defineProperty;var
|
|
1
|
+
"use strict";var p=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var c=(s,i)=>p(s,"name",{value:i,configurable:!0});var A=(s,i)=>{for(var n in i)p(s,n,{get:i[n],enumerable:!0})},S=(s,i,n,o)=>{if(i&&typeof i=="object"||typeof i=="function")for(let t of _(i))!w.call(s,t)&&t!==n&&p(s,t,{get:()=>i[t],enumerable:!(o=v(i,t))||o.enumerable});return s};var N=s=>S(p({},"__esModule",{value:!0}),s);var O={};A(O,{verifyCommand:()=>C});module.exports=N(O);var h=require("commander"),r=require("fs"),l=require("path"),e=require("../lib/output"),$=require("../lib/runtime-paths");function a(s){console.log(` ${e.pc.green("\u2713")} ${s}`)}c(a,"pass");function f(s,i){console.log(` ${e.pc.red("\u2717")} ${s}: ${e.pc.dim(i)}`)}c(f,"fail");function j(s){let i=!0;const n=s.status==="not_applicable",o=Array.isArray(s.not_applicable_cycles)?s.not_applicable_cycles:[];if(["pass","fail","not_applicable"].includes(s.status)?a(`status: ${s.status}`):(f("status",`unknown value "${s.status}" \u2014 must be "pass", "fail", or "not_applicable"`),i=!1),!n){const t=s.checks;Array.isArray(t)&&t.length>0?a(`checks (${t.length} item(s))`):(f("checks","checks is missing or empty"),i=!1)}return(n||o.length>0)&&(Array.isArray(s.reason)&&s.reason.length>0?a(`reason (${s.reason.length} item(s))`):(f("reason","required for N/A (global status or not_applicable_cycles)"),i=!1)),o.length>0&&a(`not_applicable_cycles: ${o.join(", ")}`),s.status==="fail"&&(!Array.isArray(s.issues)||s.issues.length===0?(f("issues",'required when status is "fail"'),i=!1):a(`errors (${s.issues.length} item(s))`)),i}c(j,"checkVerdict");function D(s){const i=(0,l.join)(s,"actions.jsonl");if(!(0,r.existsSync)(i))return!1;let n;try{n=(0,r.readFileSync)(i,"utf-8")}catch{return!1}return n.includes('"type":"verification_requested"')||n.includes('"type": "verification_requested"')?!1:n.includes('"type":"session_start"')||n.includes('"type": "session_start"')}c(D,"isMonitoringOnlySession");function x(s,i){if(i)return i;const n=(0,r.readdirSync)(s).filter(o=>(0,r.statSync)((0,l.join)(s,o)).isDirectory());return n.length===1?n[0]:null}c(x,"resolveSession");const C=new h.Command("verify").description("Validate a session verdict file (dry-run of the Stop hook checks)").argument("[session-id]","session ID to verify (auto-detected if only one active session)").option("-p, --project-dir <dir>","target project directory",".").action((s,i)=>{const n=(0,l.resolve)(i.projectDir),o=(0,$.sessionsRoot)(n);(0,r.existsSync)(o)||(e.log.error("No .ironbee/sessions/ directory found. Run `ironbee install` first."),process.exit(1));const t=x(o,s);if(!t){const g=(0,r.readdirSync)(o).filter(k=>(0,r.statSync)((0,l.join)(o,k)).isDirectory());if(g.length===0){e.log.info("No sessions found. No verification has been written yet.");return}e.log.error(`Multiple sessions found. Specify a session ID:
|
|
2
2
|
${g.join(`
|
|
3
|
-
`)}`),process.exit(1)}const d=(0,l.join)(o,t,"verdict.json"),m=(0,l.join)(o,t,"retries");if(e.log.info(`Verifying session: ${e.pc.bold(e.pc.cyan(t))}`),e.log.blank(),!(0,r.existsSync)(d)){const g=(0,l.join)(o,t);if(
|
|
3
|
+
`)}`),process.exit(1)}const d=(0,l.join)(o,t,"verdict.json"),m=(0,l.join)(o,t,"retries");if(e.log.info(`Verifying session: ${e.pc.bold(e.pc.cyan(t))}`),e.log.blank(),!(0,r.existsSync)(d)){const g=(0,l.join)(o,t);if(D(g)){e.log.info(`${e.pc.dim("\xB7")} No verdict found \u2014 this session ran in ${e.pc.bold("monitoring-only mode")} (verification.enable: false).`),e.log.dim(" Nothing to validate. Toggle on with `ironbee verification enable` if you want enforcement.");return}f("verdict file",`not found at ${e.pc.dim(d)}`),e.log.blank(),console.log(` ${e.pc.bold(e.pc.red("\u2717 FAIL"))} ${e.pc.dim("\u2014 no verdict written yet.")}`),process.exit(1)}a(`verdict file exists: ${e.pc.dim(d)}`);let u;try{u=JSON.parse((0,r.readFileSync)(d,"utf-8"))}catch{f("verdict file","invalid JSON"),e.log.blank(),console.log(` ${e.pc.bold(e.pc.red("\u2717 FAIL"))} ${e.pc.dim("\u2014 verdict is not valid JSON.")}`),process.exit(1)}a("verdict is valid JSON"),e.log.blank();const y=j(u),b=(0,r.existsSync)(m)&&parseInt((0,r.readFileSync)(m,"utf-8"),10)||0;b>0&&console.log(`
|
|
4
4
|
${e.pc.dim("retries:")} ${e.pc.yellow(`${b}/3`)}`),e.log.blank(),y&&u.status==="pass"?console.log(` ${e.pc.bold(e.pc.green("\u2713 PASS"))} ${e.pc.dim("\u2014 hook would allow completion.")}`):y&&u.status==="not_applicable"?console.log(` ${e.pc.bold(e.pc.green("\u2713 N/A"))} ${e.pc.dim("\u2014 no runtime surface; hook would allow (unless strict mode / fail-like prior verdict).")}`):y&&u.status==="fail"?console.log(` ${e.pc.bold(e.pc.red("\u2717 BLOCKED"))} ${e.pc.dim("\u2014 verdict status is fail. Fix issues and re-verify.")}`):console.log(` ${e.pc.bold(e.pc.red("\u2717 BLOCKED"))} ${e.pc.dim("\u2014 verdict has schema errors.")}`)});0&&(module.exports={verifyCommand});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
`)}catch(
|
|
3
|
-
`).filter(s=>s.length>0);for(let s=r.length-1;s>=0;s--)try{const o=JSON.parse(r[s]);if(o.type===e&&typeof o.timestamp=="number")return
|
|
4
|
-
`).filter(
|
|
5
|
-
`).filter(o=>o.length>0);let r=-1;const s=[];for(let o=0;o<
|
|
6
|
-
`).filter(o=>o.length>0).map(o=>{try{return JSON.parse(o)}catch{return null}});let r=-1;for(let o=0;o<
|
|
7
|
-
`).filter(
|
|
1
|
+
"use strict";var h=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var R=Object.prototype.hasOwnProperty;var c=(t,e)=>h(t,"name",{value:e,configurable:!0});var N=(t,e)=>{for(var i in e)h(t,i,{get:e[i],enumerable:!0})},D=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of P(e))!R.call(t,r)&&r!==i&&h(t,r,{get:()=>e[r],enumerable:!(n=j(e,r))||n.enumerable});return t};var q=t=>D(h({},"__esModule",{value:!0}),t);var ne={};N(ne,{ActivityAwareEvent:()=>d.ActivityAwareEvent,Event:()=>d.Event,EventType:()=>d.EventType,EventTypeValue:()=>d.EventTypeValue,FixAwareEvent:()=>d.FixAwareEvent,VerificationAwareEvent:()=>d.VerificationAwareEvent,appendAction:()=>J,baseFields:()=>T,deterministicSessionEndId:()=>I,findDurationSinceLastAction:()=>W,findLastActionTimestamp:()=>z,getFileChangesSinceLastFailVerdict:()=>Z,getFileChangesSinceLastVerification:()=>Y,getToolCallsSinceLastFileChange:()=>B,getToolCallsSinceLastVerification:()=>K,hasFileChangesSinceLastVerification:()=>H,hasToolCallsSinceLastVerdict:()=>Q,hasVerifierEverEngaged:()=>ee,readActionsSinceLastMarker:()=>w,resolveProjectName:()=>F,summarizeFixFileChanges:()=>te});module.exports=q(ne);var l=require("fs"),b=require("crypto"),a=require("path"),f=require("../../lib/logger"),_=require("../../lib/collector"),k=require("../../lib/config"),C=require("../../queue/submit"),S=require("../../queue/types"),V=require("../../queue/register-handlers"),d=require("../../lib/event");function F(t){let e=t,i;for(;;){const n=(0,a.join)(e,".git");if((0,l.existsSync)(n)){const s=L(n);if(s==="directory"){const o=A(n);return o||(0,a.basename)(e)}if(s==="linked-pointer"){const o=E(n),u=o!==void 0?A(o):void 0;return u||(0,a.basename)(e)}s==="worktree-pointer"&&i===void 0&&(i=M(n))}const r=(0,a.dirname)(e);if(r===e)break;e=r}return i??(0,a.basename)(t)}c(F,"resolveProjectName");function L(t){try{const e=(0,l.statSync)(t);if(e.isDirectory())return"directory";if(!e.isFile())return"other";const i=E(t);return i===void 0?"other":(0,l.existsSync)((0,a.join)(i,"commondir"))?"worktree-pointer":"linked-pointer"}catch(e){return f.logger.debug(`resolveProjectName: stat failed for ${t}: ${e instanceof Error?e.message:e}`),"other"}}c(L,"classifyGitEntry");function E(t){try{const i=(0,l.readFileSync)(t,"utf-8").trim().match(/^gitdir:\s*(.+)$/m);if(!i)return;const n=i[1].trim();return(0,a.isAbsolute)(n)?n:(0,a.resolve)((0,a.dirname)(t),n)}catch(e){f.logger.debug(`resolveProjectName: pointer at ${t} unreadable: ${e instanceof Error?e.message:e}`);return}}c(E,"readGitdirPointer");function A(t){try{const e=(0,a.join)(t,"config");if(!(0,l.existsSync)(e))return;const i=U((0,l.readFileSync)(e,"utf-8"));return i?O(i):void 0}catch(e){f.logger.debug(`resolveProjectName: failed to read git config at ${t}: ${e instanceof Error?e.message:e}`);return}}c(A,"repoNameFromGitConfig");function M(t){const e=E(t);if(e===void 0)return;const i=(0,a.join)(e,"commondir");let n;try{if((0,l.existsSync)(i)){const o=(0,l.readFileSync)(i,"utf-8").trim();n=(0,a.isAbsolute)(o)?o:(0,a.resolve)(e,o)}else n=e}catch(o){f.logger.debug(`resolveProjectName: commondir at ${i} unreadable: ${o instanceof Error?o.message:o}`);return}const r=A(n);if(r)return r;const s=(0,a.basename)(n)===".git"?(0,a.basename)((0,a.dirname)(n)):(0,a.basename)(n);return s.length>0?s:void 0}c(M,"repoNameFromWorktreePointer");function U(t){const e=t.split(/\r?\n/);let i=null,n=null,r,s;for(const o of e){const u=o.trim();if(u.length===0||u.startsWith("#")||u.startsWith(";"))continue;const g=u.match(/^\[([^\s\]]+)(?:\s+"([^"]*)")?\]$/);if(g){i=g[1].toLowerCase(),n=g[2]??null;continue}if(i!=="remote"||n===null)continue;const p=u.match(/^url\s*=\s*(.+?)\s*$/i);if(!p)continue;const m=p[1];n==="origin"&&(r=m),s===void 0&&(s=m)}return r??s}c(U,"readFirstRemoteUrl");function O(t){let e=t.trim();if(e.length===0)return;const i=e.match(/^[^/@]+@[^/:]+:(.+)$/);if(i?e=i[1]:e=e.replace(/^[a-z][a-z0-9+.-]*:\/\/[^/]*\//i,""),e=e.replace(/[?#].*$/,"").replace(/\/+$/,""),e.length===0)return;const r=(e.split("/").pop()??"").replace(/\.git$/i,"");return r.length>0?r:void 0}c(O,"repoNameFromRemoteUrl");function T(t){const e=(0,a.basename)((0,a.dirname)(t)),i=(0,a.dirname)(t),{getUserEmail:n,getUsageType:r,getUsagePlan:s,getProjectDir:o}=require("./session-state"),u=o(i)??(0,a.dirname)((0,a.dirname)((0,a.dirname)(i))),g=n(i),p=r(i),m=s(i),v={id:(0,b.randomUUID)(),session_id:e,project_name:F(u)};return g&&(v.user_email=g),p&&(v.usage_type=p),m&&(v.usage_plan=m),v}c(T,"baseFields");function I(t){const e=(0,b.createHash)("sha256").update("session_end:"+t).digest("hex");return`${e.slice(0,8)}-${e.slice(8,12)}-${e.slice(12,16)}-${e.slice(16,20)}-${e.slice(20,32)}`}c(I,"deterministicSessionEndId");async function J(t,e){const i=T(t);e.id||(e.id=i.id),e.session_id||(e.session_id=i.session_id),e.project_name||(e.project_name=i.project_name);try{(0,l.mkdirSync)((0,a.dirname)(t),{recursive:!0}),(0,l.appendFileSync)(t,JSON.stringify(e)+`
|
|
2
|
+
`)}catch(n){f.logger.debug(`failed to append action to ${t}: ${n}`)}if(e.type!=="tool_call"){const n=(0,a.dirname)(t),r=(0,a.basename)(n),{getProjectDir:s}=require("./session-state"),o=s(n)??(0,a.dirname)((0,a.dirname)((0,a.dirname)(n)));try{await(0,_.sendToCollector)(e,r,o)}catch(u){u instanceof _.RetriableCollectorError?G(o,r,e,u):f.logger.debug(`failed to send action to collector: ${u}`)}}}c(J,"appendAction");function G(t,e,i,n){if(!(0,k.isJobQueueEnabled)(t)){f.logger.debug(`collector fallback: jobQueue disabled, dropping type=${i.type} id=${i.id} (cause: ${n.message})`);return}try{(0,C.submit)(t,e,V.SEND_EVENT_TYPE,i),f.logger.debug(`collector fallback: enqueued type=${i.type} id=${i.id} as send_event (cause: ${n.message})`)}catch(r){if(r instanceof S.JobTooLargeError){f.logger.debug(`collector fallback: event too large for queue (${r.sizeBytes} bytes), dropping type=${i.type} id=${i.id}`);return}f.logger.debug(`collector fallback: queue submit failed for type=${i.type} id=${i.id}: ${r}`)}}c(G,"enqueueCollectorFallback");function W(t,e,i){if((0,l.existsSync)(t))try{const r=(0,l.readFileSync)(t,"utf-8").trim().split(`
|
|
3
|
+
`).filter(s=>s.length>0);for(let s=r.length-1;s>=0;s--)try{const o=JSON.parse(r[s]);if(o.type===e&&typeof o.timestamp=="number")return i-o.timestamp}catch{}}catch(n){f.logger.debug(`failed to find duration for ${e}: ${n}`)}}c(W,"findDurationSinceLastAction");function w(t,e){return y(t,i=>i.type===e)}c(w,"readActionsSinceLastMarker");function z(t){if((0,l.existsSync)(t))try{const i=(0,l.readFileSync)(t,"utf-8").trim().split(`
|
|
4
|
+
`).filter(n=>n.length>0);for(let n=i.length-1;n>=0;n--)try{const r=JSON.parse(i[n]);if(typeof r.timestamp=="number")return r.timestamp}catch{}}catch(e){f.logger.debug(`failed to read last action timestamp from ${t}: ${e}`)}}c(z,"findLastActionTimestamp");function y(t,e){if(!(0,l.existsSync)(t))return[];try{const n=(0,l.readFileSync)(t,"utf-8").trim().split(`
|
|
5
|
+
`).filter(o=>o.length>0);let r=-1;const s=[];for(let o=0;o<n.length;o++)try{const u=JSON.parse(n[o]);s.push(u),e(u)&&(r=o)}catch{}return s.slice(r+1)}catch(i){return f.logger.debug(`failed to read actions from ${t}: ${i}`),[]}}c(y,"readActionsSinceMatch");function x(t){return t.type!=="verification_requested"?!1:t.action==="allow"}c(x,"isAllowVerificationRequested");function $(t){if(t.type!=="tool_call")return!1;const e=t.verification_id;return typeof e=="string"&&e.length>0}c($,"isVerificationScopedToolCall");function K(t){return y(t,x).filter($)}c(K,"getToolCallsSinceLastVerification");function B(t){return w(t,"file_change").filter($)}c(B,"getToolCallsSinceLastFileChange");function Q(t){return w(t,"verdict_write").some($)}c(Q,"hasToolCallsSinceLastVerdict");function H(t){return y(t,x).some(i=>i.type==="file_change")}c(H,"hasFileChangesSinceLastVerification");function Y(t){return y(t,x).filter(i=>i.type==="file_change")}c(Y,"getFileChangesSinceLastVerification");function X(t){return t.type!=="verdict_write"?!1:t.verdict?.status==="fail"}c(X,"isFailVerdictWrite");function Z(t){if(!(0,l.existsSync)(t))return[];try{const n=(0,l.readFileSync)(t,"utf-8").trim().split(`
|
|
6
|
+
`).filter(o=>o.length>0).map(o=>{try{return JSON.parse(o)}catch{return null}});let r=-1;for(let o=0;o<n.length;o++){const u=n[o];u!==null&&X(u)&&(r=o)}if(r<0)return[];const s=[];for(let o=r+1;o<n.length;o++){const u=n[o];u!==null&&u.type==="file_change"&&s.push(u)}return s}catch(e){return f.logger.debug(`failed to read file changes since last fail verdict: ${e}`),[]}}c(Z,"getFileChangesSinceLastFailVerdict");function ee(t){if(!(0,l.existsSync)(t))return!1;try{const i=(0,l.readFileSync)(t,"utf-8").trim().split(`
|
|
7
|
+
`).filter(n=>n.length>0);for(const n of i){let r;try{r=JSON.parse(n)}catch{continue}if(r.type==="verification_start")return!0;if(r.type==="tool_call"){const s=r;if(s.tool_type==="mcp"&&typeof s.mcp_server=="string"&&s.mcp_server.endsWith("-devtools"))return!0}}return!1}catch(e){return f.logger.debug(`failed to scan verifier engagement in ${t}: ${e}`),!1}}c(ee,"hasVerifierEverEngaged");function te(t){if(t.length===0)return[];const e=new Map,i=[];for(const n of t){const r=n.file_path;let s=e.get(r);s||(s={op:n.operation,added:0,removed:0},e.set(r,s),i.push(r)),s.op=s.op==="create"||n.operation==="create"?"create":n.operation,s.added+=typeof n.lines_added=="number"?n.lines_added:0,s.removed+=typeof n.lines_removed=="number"?n.lines_removed:0}return i.map(n=>{const r=e.get(n);return`${r.op} ${n} (+${r.added}/-${r.removed})`})}c(te,"summarizeFixFileChanges");0&&(module.exports={ActivityAwareEvent,Event,EventType,EventTypeValue,FixAwareEvent,VerificationAwareEvent,appendAction,baseFields,deterministicSessionEndId,findDurationSinceLastAction,findLastActionTimestamp,getFileChangesSinceLastFailVerdict,getFileChangesSinceLastVerification,getToolCallsSinceLastFileChange,getToolCallsSinceLastVerification,hasFileChangesSinceLastVerification,hasToolCallsSinceLastVerdict,hasVerifierEverEngaged,readActionsSinceLastMarker,resolveProjectName,summarizeFixFileChanges});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var E=Object.prototype.hasOwnProperty;var l=(n,t)=>a(n,"name",{value:t,configurable:!0});var h=(n,t)=>{for(var r in t)a(n,r,{get:t[r],enumerable:!0})},S=(n,t,r,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of p(t))!E.call(n,i)&&i!==r&&a(n,i,{get:()=>t[i],enumerable:!(e=b(t,i))||e.enumerable});return n};var A=n=>S(a({},"__esModule",{value:!0}),n);var L={};h(L,{executeToolBareName:()=>O,extractNestedToolCalls:()=>j,extractNestedToolCallsFromResponse:()=>P,isNestedToolContainer:()=>R});module.exports=A(L);var g=require("../../lib/config");const d=Object.fromEntries(Object.entries(g.CYCLE_TO_SERVER).map(([n,t])=>[t,g.CYCLE_TOOL_PREFIXES[n]])),w=/callTool\s*\(\s*\\?[`'"]([^`'"\\]+)\\?[`'"]/g;function O(n){if(!n)return null;const t=d[n];return t!==void 0?`${t}execute`:null}l(O,"executeToolBareName");function R(n,t){if(!n||!t)return!1;const r=d[t];return r===void 0?!1:n===`${r}execute`||n===`${r}scenario-run`}l(R,"isNestedToolContainer");const k=16;function x(n){try{return JSON.parse(n)}catch{return}}l(x,"tryJsonParse");function c(n,t){if(t>k||n===null||n===void 0)return null;if(typeof n=="string"){const r=x(n);return r===void 0?null:c(r,t+1)}if(Array.isArray(n)){for(const r of n)if(r!==null&&typeof r=="object"){const e=r.text;if(typeof e=="string"){const i=x(e);if(i!==void 0){const s=c(i,t+1);if(s!==null)return s}}}return null}if(typeof n=="object"){const r=n;if(Array.isArray(r.toolCalls))return r.toolCalls;if(r.structuredContent!==void 0){const e=c(r.structuredContent,t+1);if(e!==null)return e}if(r.content!==void 0){const e=c(r.content,t+1);if(e!==null)return e}}return null}l(c,"locateToolCallsArray");function y(n,t,r,e,i){if(!(i>k))for(const s of n){if(s===null||typeof s!="object")continue;const u=s,o=u.name;if(typeof o=="string"&&o.length>0){const f={name:N(o,t,r),args:void 0};typeof u.startTime=="number"&&(f.startTime=u.startTime),typeof u.duration=="number"&&(f.duration=u.duration),e.push(f)}Array.isArray(u.children)&&y(u.children,t,r,e,i+1)}}l(y,"flattenResponseToolCalls");function P(n,t){const r=d[t];if(r===void 0)return null;const e=c(n,0);if(e===null)return null;const i=[];return y(e,t,r,i,0),i}l(P,"extractNestedToolCallsFromResponse");function N(n,t,r){let e=n;const i=`mcp__${t}__`,s=`mcp__${t.replace(/-/g,"_")}__`;return e.startsWith(i)?e=e.slice(i.length):e.startsWith(s)&&(e=e.slice(s.length)),e.startsWith("MCP:")&&(e=e.slice(4)),e.startsWith(r)||(e=`${r}${e}`),e}l(N,"normalizeNestedName");function $(n,t){if(n[t]!=="{")return;let r=0;for(let e=t;e<n.length;e++)if(n[e]==="{")r++;else if(n[e]==="}"&&(r--,r===0))return n.slice(t,e+1)}l($,"extractBalancedBraces");function j(n,t){const r=d[t];if(r===void 0)return[];const e=typeof n=="string"?n:JSON.stringify(n??""),i=[],s=new Set;w.lastIndex=0;let u=w.exec(e);for(;u!==null;){const o=N(u[1],t,r);if(!s.has(o)){s.add(o);let f;const _=u.index+u[0].length,C=e.slice(_).trimStart();if(C.startsWith(",")){const T=C.slice(1).trimStart();if(T.startsWith("{")){const m=$(T,0);if(m)try{f=JSON.parse(m)}catch{f=m}}}i.push({name:o,args:f})}u=w.exec(e)}return i}l(j,"extractNestedToolCalls");0&&(module.exports={executeToolBareName,extractNestedToolCalls,extractNestedToolCallsFromResponse,isNestedToolContainer});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var i=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var s=(n,e)=>i(n,"name",{value:e,configurable:!0});var p=(n,e)=>{for(var t in e)i(n,t,{get:e[t],enumerable:!0})},u=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of f(e))!g.call(n,o)&&o!==t&&i(n,o,{get:()=>e[o],enumerable:!(r=c(e,o))||r.enumerable});return n};var E=n=>u(i({},"__esModule",{value:!0}),n);var _={};p(_,{isScenarioTool:()=>R});module.exports=E(_);const O=/scenario[-_]/;function R(n){return typeof n=="string"&&O.test(n)}s(R,"isScenarioTool");0&&(module.exports={isScenarioTool});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var v=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var V=Object.prototype.hasOwnProperty;var a=(i,e)=>v(i,"name",{value:e,configurable:!0});var h=(i,e)=>{for(var n in e)v(i,n,{get:e[n],enumerable:!0})},_=(i,e,n,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of m(e))!V.call(i,r)&&r!==n&&v(i,r,{get:()=>e[r],enumerable:!(t=A(e,r))||t.enumerable});return i};var b=i=>_(v({},"__esModule",{value:!0}),i);var St={};h(St,{addPendingFixes:()=>ct,clearActiveActivity:()=>gt,clearActiveFix:()=>z,clearActiveVerification:()=>F,clearPendingFixes:()=>st,clearVerifyIntent:()=>ut,closeOpenCycles:()=>vt,generateTraceId:()=>T,getActiveActivityId:()=>Q,getActiveFixId:()=>C,getActiveTraceId:()=>E,getActiveVerificationId:()=>w,getChainedStatusLine:()=>et,getContextInjectedVerificationId:()=>nt,getLastVerdictHadIssues:()=>U,getLastVerdictStatus:()=>q,getPendingFixes:()=>at,getPhase:()=>O,getRetries:()=>R,getUsagePlan:()=>D,getUsageType:()=>Z,getUserEmail:()=>X,getVerifyIntent:()=>ot,incrementRetries:()=>L,isActive:()=>G,isFailLikeVerdictStatus:()=>lt,isRecordingActive:()=>M,isRecordingRequired:()=>J,readState:()=>c,reconcileAbandonedActivity:()=>yt,reconcileForCompact:()=>It,reconcileSessionState:()=>pt,resetRetries:()=>$,setActive:()=>K,setActiveActivity:()=>ft,setActiveFix:()=>k,setActiveVerification:()=>P,setChainedStatusLine:()=>it,setContextInjectedVerificationId:()=>rt,setLastVerdictHadIssues:()=>H,setLastVerdictStatus:()=>j,setPhase:()=>N,setRecordingActive:()=>W,setRecordingRequired:()=>B,setUsage:()=>tt,setUserEmail:()=>Y,setVerifyIntent:()=>dt,writeState:()=>u});module.exports=b(St);var x=require("crypto"),f=require("fs"),y=require("path"),l=require("../../lib/logger"),g=require("./activity-participants"),p=require("../../lib/atomic"),d=require("./actions");const I="state.json",S={retries:0,activeVerificationId:null,activeTraceId:null,lastVerdictStatus:null,lastVerdictHadIssues:!1,activeFixId:null,activeActivityId:null,phase:null,recordingRequired:!1,recordingActive:!1,active:!1,userEmail:null,usageType:null,usagePlan:null,chainedStatusLine:null,contextInjectedVerificationId:null,pendingFixes:[],verifyIntent:null};function T(){return(0,x.randomBytes)(16).toString("hex")}a(T,"generateTraceId");function c(i){const e=(0,y.join)(i,I);if(!(0,f.existsSync)(e))return{...S};try{const n=(0,f.readFileSync)(e,"utf-8"),t=JSON.parse(n),r=["coding","verifying","fixing"],s=["api","subscription"];return{retries:typeof t.retries=="number"?t.retries:0,activeVerificationId:typeof t.activeVerificationId=="string"?t.activeVerificationId:null,activeTraceId:typeof t.activeTraceId=="string"?t.activeTraceId:null,lastVerdictStatus:typeof t.lastVerdictStatus=="string"?t.lastVerdictStatus:null,lastVerdictHadIssues:typeof t.lastVerdictHadIssues=="boolean"?t.lastVerdictHadIssues:!1,activeFixId:typeof t.activeFixId=="string"?t.activeFixId:null,activeActivityId:typeof t.activeActivityId=="string"?t.activeActivityId:null,phase:typeof t.phase=="string"&&r.includes(t.phase)?t.phase:null,recordingRequired:typeof t.recordingRequired=="boolean"?t.recordingRequired:!1,recordingActive:typeof t.recordingActive=="boolean"?t.recordingActive:!1,active:typeof t.active=="boolean"?t.active:!1,userEmail:typeof t.userEmail=="string"?t.userEmail:null,usageType:typeof t.usageType=="string"&&s.includes(t.usageType)?t.usageType:null,usagePlan:typeof t.usagePlan=="string"&&t.usagePlan.length>0?t.usagePlan:null,chainedStatusLine:typeof t.chainedStatusLine=="string"&&t.chainedStatusLine.length>0?t.chainedStatusLine:null,contextInjectedVerificationId:typeof t.contextInjectedVerificationId=="string"?t.contextInjectedVerificationId:null,pendingFixes:Array.isArray(t.pendingFixes)?t.pendingFixes.filter(o=>typeof o=="string"&&o.length>0):[],verifyIntent:typeof t.verifyIntent=="string"&&t.verifyIntent.length>0?t.verifyIntent:null}}catch(n){return l.logger.debug(`failed to read state from ${e}: ${n}`),{...S}}}a(c,"readState");function u(i,e){const n=(0,y.join)(i,I);try{(0,f.mkdirSync)(i,{recursive:!0});const t=`${n}.tmp.${process.pid}.${Date.now()}`,r=JSON.stringify(e,null,2);try{(0,f.writeFileSync)(t,r),(0,p.renameWithRetry)(t,n)}catch(s){try{(0,f.existsSync)(t)&&(0,f.unlinkSync)(t)}catch{}throw s}(0,p.sweepStaleTmpFiles)(n)}catch(t){l.logger.debug(`failed to write state to ${n}: ${t}`)}}a(u,"writeState");function w(i){return c(i).activeVerificationId??void 0}a(w,"getActiveVerificationId");function P(i,e,n){const t=c(i);t.activeVerificationId=e,t.activeTraceId=n,t.phase="verifying",u(i,t)}a(P,"setActiveVerification");function E(i){return c(i).activeTraceId??void 0}a(E,"getActiveTraceId");function F(i){const e=c(i);e.activeVerificationId=null,e.activeTraceId=null,e.phase="coding",u(i,e)}a(F,"clearActiveVerification");function R(i){return c(i).retries}a(R,"getRetries");function L(i){const e=c(i);return e.retries=e.retries+1,u(i,e),e.retries}a(L,"incrementRetries");function $(i){const e=c(i);e.retries=0,u(i,e)}a($,"resetRetries");function q(i){return c(i).lastVerdictStatus??void 0}a(q,"getLastVerdictStatus");function j(i,e){const n=c(i);n.lastVerdictStatus=e,u(i,n)}a(j,"setLastVerdictStatus");function U(i){return c(i).lastVerdictHadIssues===!0}a(U,"getLastVerdictHadIssues");function H(i,e){const n=c(i);n.lastVerdictHadIssues=e,u(i,n)}a(H,"setLastVerdictHadIssues");function k(i,e){const n=c(i);n.activeFixId=e,u(i,n)}a(k,"setActiveFix");function C(i){return c(i).activeFixId??void 0}a(C,"getActiveFixId");function z(i){const e=c(i);e.activeFixId=null,u(i,e)}a(z,"clearActiveFix");function N(i,e){const n=c(i);n.phase=e,u(i,n)}a(N,"setPhase");function O(i){return c(i).phase}a(O,"getPhase");function J(i){return c(i).recordingRequired}a(J,"isRecordingRequired");function B(i,e){const n=c(i);n.recordingRequired=e,u(i,n)}a(B,"setRecordingRequired");function M(i){return c(i).recordingActive}a(M,"isRecordingActive");function W(i,e){const n=c(i);n.recordingActive=e,u(i,n)}a(W,"setRecordingActive");function G(i){return c(i).active}a(G,"isActive");function K(i,e){const n=c(i);n.active=e,e||(n.activeActivityId=null),u(i,n)}a(K,"setActive");function Q(i){return c(i).activeActivityId??void 0}a(Q,"getActiveActivityId");function X(i){return c(i).userEmail??void 0}a(X,"getUserEmail");function Y(i,e){const n=typeof e=="string"&&e.length>0?e:null,t=c(i);t.userEmail!==n&&(t.userEmail=n,u(i,t))}a(Y,"setUserEmail");function Z(i){return c(i).usageType??void 0}a(Z,"getUsageType");function D(i){return c(i).usagePlan??void 0}a(D,"getUsagePlan");function tt(i,e){const n=e.usage_type==="api"||e.usage_type==="subscription"?e.usage_type:null,t=typeof e.usage_plan=="string"&&e.usage_plan.length>0?e.usage_plan:null,r=c(i);r.usageType===n&&r.usagePlan===t||(r.usageType=n,r.usagePlan=t,u(i,r))}a(tt,"setUsage");function et(i){return c(i).chainedStatusLine??void 0}a(et,"getChainedStatusLine");function it(i,e){const n=typeof e=="string"&&e.length>0?e:null,t=c(i);t.chainedStatusLine!==n&&(t.chainedStatusLine=n,u(i,t))}a(it,"setChainedStatusLine");function nt(i){return c(i).contextInjectedVerificationId??void 0}a(nt,"getContextInjectedVerificationId");function rt(i,e){const n=typeof e=="string"&&e.length>0?e:null,t=c(i);t.contextInjectedVerificationId!==n&&(t.contextInjectedVerificationId=n,u(i,t))}a(rt,"setContextInjectedVerificationId");function at(i){return c(i).pendingFixes}a(at,"getPendingFixes");function ct(i,e){const n=e.filter(o=>typeof o=="string"&&o.length>0);if(n.length===0)return;const t=c(i),r=new Set(t.pendingFixes),s=[...t.pendingFixes];for(const o of n)r.has(o)||(r.add(o),s.push(o));s.length!==t.pendingFixes.length&&(t.pendingFixes=s,u(i,t))}a(ct,"addPendingFixes");function st(i){const e=c(i);e.pendingFixes.length!==0&&(e.pendingFixes=[],u(i,e))}a(st,"clearPendingFixes");function ot(i){return c(i).verifyIntent}a(ot,"getVerifyIntent");function dt(i,e){const n=c(i);n.verifyIntent!==e&&(n.verifyIntent=e,u(i,n))}a(dt,"setVerifyIntent");function ut(i){const e=c(i);e.verifyIntent!==null&&(e.verifyIntent=null,u(i,e))}a(ut,"clearVerifyIntent");function lt(i){return i==="fail"||i==="fail_reported"}a(lt,"isFailLikeVerdictStatus");function ft(i,e){const n=c(i);n.activeActivityId=e,n.active=!0,u(i,n)}a(ft,"setActiveActivity");function gt(i){const e=c(i);e.activeActivityId=null,e.active=!1,u(i,e)}a(gt,"clearActiveActivity");async function vt(i,e,n){const t=c(i);let r=!1;if(t.activeVerificationId){const s=Date.now(),o={...(0,d.baseFields)(e),type:"verification_end",timestamp:s,verification_id:t.activeVerificationId,activity_id:t.activeActivityId,trace_id:t.activeTraceId,duration:(0,d.findDurationSinceLastAction)(e,"verification_start",s),reason:n};await(0,d.appendAction)(e,o),l.logger.debug(`close-open-cycles: ended verification ${t.activeVerificationId} (${n})`),t.activeVerificationId=null,t.activeTraceId=null,t.contextInjectedVerificationId=null,r=!0}if(t.activeFixId){const s=Date.now(),o={...(0,d.baseFields)(e),type:"fix_end",timestamp:s,fix_id:t.activeFixId,activity_id:t.activeActivityId,duration:(0,d.findDurationSinceLastAction)(e,"fix_start",s),reason:n};await(0,d.appendAction)(e,o),l.logger.debug(`close-open-cycles: ended fix ${t.activeFixId} (${n})`),t.activeFixId=null,t.pendingFixes.length>0&&(t.pendingFixes=[]),r=!0}(t.recordingRequired||t.recordingActive)&&(t.recordingRequired=!1,t.recordingActive=!1,r=!0),t.phase!=="coding"&&(t.phase="coding",r=!0),t.verifyIntent!==null&&(t.verifyIntent=null,r=!0),r&&u(i,t)}a(vt,"closeOpenCycles");async function pt(i,e,n){const t=c(i);let r=!1;if(t.activeVerificationId){const s=Date.now(),o={...(0,d.baseFields)(e),type:"verification_end",timestamp:s,verification_id:t.activeVerificationId,activity_id:t.activeActivityId,trace_id:t.activeTraceId,duration:(0,d.findDurationSinceLastAction)(e,"verification_start",s),reason:"session_reconcile"};await n(e,o),l.logger.debug(`reconcile: ended abandoned verification ${t.activeVerificationId}`),t.activeVerificationId=null,t.activeTraceId=null,t.contextInjectedVerificationId=null,r=!0}if(t.activeFixId){const s=Date.now(),o={...(0,d.baseFields)(e),type:"fix_end",timestamp:s,fix_id:t.activeFixId,activity_id:t.activeActivityId,duration:(0,d.findDurationSinceLastAction)(e,"fix_start",s),reason:"session_reconcile"};await n(e,o),l.logger.debug(`reconcile: ended abandoned fix ${t.activeFixId}`),t.activeFixId=null,t.pendingFixes.length>0&&(t.pendingFixes=[]),r=!0}if(t.active){const s=Date.now(),o={...(0,d.baseFields)(e),type:"activity_end",timestamp:s,activity_id:t.activeActivityId,duration:(0,d.findDurationSinceLastAction)(e,"activity_start",s),reason:"session_reconcile"};await n(e,o),l.logger.debug(`reconcile: ended abandoned activity ${t.activeActivityId??""}`),t.active=!1,t.activeActivityId=null,(0,g.clearActivityParticipants)(i),r=!0}(t.recordingRequired||t.recordingActive)&&(t.recordingRequired=!1,t.recordingActive=!1,r=!0),t.phase!=="coding"&&(t.phase="coding",r=!0),t.verifyIntent!==null&&(t.verifyIntent=null,r=!0),r&&u(i,t)}a(pt,"reconcileSessionState");async function yt(i,e,n){const t=c(i);if(!t.active&&!t.activeVerificationId&&!t.activeFixId&&t.verifyIntent===null||!(0,g.isParticipantPresent)(i,g.MAIN_PARTICIPANT_ID)&&(0,g.anyActiveParticipants)(i))return;let r=!1;const s=(0,d.findLastActionTimestamp)(e)??Date.now();if(t.activeVerificationId){const o={...(0,d.baseFields)(e),type:"verification_end",timestamp:s,verification_id:t.activeVerificationId,activity_id:t.activeActivityId,trace_id:t.activeTraceId,duration:(0,d.findDurationSinceLastAction)(e,"verification_start",s),reason:"interrupt_inferred"};await n(e,o),l.logger.debug(`interrupt-reconcile: ended verification ${t.activeVerificationId}`),t.activeVerificationId=null,t.activeTraceId=null,t.contextInjectedVerificationId=null,r=!0}if(t.activeFixId){const o={...(0,d.baseFields)(e),type:"fix_end",timestamp:s,fix_id:t.activeFixId,activity_id:t.activeActivityId,duration:(0,d.findDurationSinceLastAction)(e,"fix_start",s),reason:"interrupt_inferred"};await n(e,o),l.logger.debug(`interrupt-reconcile: ended fix ${t.activeFixId}`),t.activeFixId=null,t.pendingFixes.length>0&&(t.pendingFixes=[]),r=!0}if(t.active){const o={...(0,d.baseFields)(e),type:"activity_end",timestamp:s,activity_id:t.activeActivityId,duration:(0,d.findDurationSinceLastAction)(e,"activity_start",s),reason:"interrupt_inferred"};await n(e,o),l.logger.debug(`interrupt-reconcile: ended activity ${t.activeActivityId??""}`),t.active=!1,t.activeActivityId=null,(0,g.clearActivityParticipants)(i),r=!0}(t.recordingRequired||t.recordingActive)&&(t.recordingRequired=!1,t.recordingActive=!1,r=!0),t.phase!=="coding"&&(t.phase="coding",r=!0),t.verifyIntent!==null&&(t.verifyIntent=null,r=!0),r&&u(i,t)}a(yt,"reconcileAbandonedActivity");async function It(i,e,n){const t=c(i);let r=!1;if(t.activeVerificationId){const s=Date.now(),o={...(0,d.baseFields)(e),type:"verification_end",timestamp:s,verification_id:t.activeVerificationId,activity_id:t.activeActivityId,trace_id:t.activeTraceId,duration:(0,d.findDurationSinceLastAction)(e,"verification_start",s),reason:"compact"};await n(e,o),l.logger.debug(`compact-reconcile: ended verification ${t.activeVerificationId}`),t.activeVerificationId=null,t.activeTraceId=null,t.contextInjectedVerificationId=null,r=!0}if(t.activeFixId){const s=Date.now(),o={...(0,d.baseFields)(e),type:"fix_end",timestamp:s,fix_id:t.activeFixId,activity_id:t.activeActivityId,duration:(0,d.findDurationSinceLastAction)(e,"fix_start",s),reason:"compact"};await n(e,o),l.logger.debug(`compact-reconcile: ended fix ${t.activeFixId}`),t.activeFixId=null,t.pendingFixes.length>0&&(t.pendingFixes=[]),r=!0}if(t.active){const s=Date.now(),o={...(0,d.baseFields)(e),type:"activity_end",timestamp:s,activity_id:t.activeActivityId,duration:(0,d.findDurationSinceLastAction)(e,"activity_start",s),reason:"compact"};await n(e,o),l.logger.debug(`compact-reconcile: ended activity ${t.activeActivityId??""}`),t.active=!1,t.activeActivityId=null,(0,g.clearActivityParticipants)(i),r=!0}(t.recordingRequired||t.recordingActive)&&(t.recordingRequired=!1,t.recordingActive=!1,r=!0),t.phase!=="coding"&&(t.phase="coding",r=!0),t.verifyIntent!==null&&(t.verifyIntent=null,r=!0),r&&u(i,t)}a(It,"reconcileForCompact");0&&(module.exports={addPendingFixes,clearActiveActivity,clearActiveFix,clearActiveVerification,clearPendingFixes,clearVerifyIntent,closeOpenCycles,generateTraceId,getActiveActivityId,getActiveFixId,getActiveTraceId,getActiveVerificationId,getChainedStatusLine,getContextInjectedVerificationId,getLastVerdictHadIssues,getLastVerdictStatus,getPendingFixes,getPhase,getRetries,getUsagePlan,getUsageType,getUserEmail,getVerifyIntent,incrementRetries,isActive,isFailLikeVerdictStatus,isRecordingActive,isRecordingRequired,readState,reconcileAbandonedActivity,reconcileForCompact,reconcileSessionState,resetRetries,setActive,setActiveActivity,setActiveFix,setActiveVerification,setChainedStatusLine,setContextInjectedVerificationId,setLastVerdictHadIssues,setLastVerdictStatus,setPhase,setRecordingActive,setRecordingRequired,setUsage,setUserEmail,setVerifyIntent,writeState});
|
|
1
|
+
"use strict";var v=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var r=(i,e)=>v(i,"name",{value:e,configurable:!0});var V=(i,e)=>{for(var n in e)v(i,n,{get:e[n],enumerable:!0})},_=(i,e,n,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of m(e))!h.call(i,a)&&a!==n&&v(i,a,{get:()=>e[a],enumerable:!(t=A(e,a))||t.enumerable});return i};var b=i=>_(v({},"__esModule",{value:!0}),i);var At={};V(At,{addPendingFixes:()=>ot,clearActiveActivity:()=>pt,clearActiveFix:()=>z,clearActiveVerification:()=>F,clearPendingFixes:()=>dt,clearVerifyIntent:()=>lt,closeOpenCycles:()=>yt,generateTraceId:()=>T,getActiveActivityId:()=>Q,getActiveFixId:()=>C,getActiveTraceId:()=>E,getActiveVerificationId:()=>w,getChainedStatusLine:()=>nt,getContextInjectedVerificationId:()=>at,getLastVerdictHadIssues:()=>U,getLastVerdictStatus:()=>$,getPendingFixes:()=>st,getPhase:()=>O,getProjectDir:()=>Z,getRetries:()=>j,getUsagePlan:()=>et,getUsageType:()=>tt,getUserEmail:()=>X,getVerifyIntent:()=>ut,incrementRetries:()=>R,isActive:()=>G,isFailLikeVerdictStatus:()=>gt,isRecordingActive:()=>M,isRecordingRequired:()=>J,readState:()=>c,reconcileAbandonedActivity:()=>St,reconcileForCompact:()=>xt,reconcileSessionState:()=>It,resetRetries:()=>L,setActive:()=>K,setActiveActivity:()=>vt,setActiveFix:()=>k,setActiveVerification:()=>P,setChainedStatusLine:()=>rt,setContextInjectedVerificationId:()=>ct,setLastVerdictHadIssues:()=>H,setLastVerdictStatus:()=>q,setPhase:()=>N,setProjectDir:()=>D,setRecordingActive:()=>W,setRecordingRequired:()=>B,setUsage:()=>it,setUserEmail:()=>Y,setVerifyIntent:()=>ft,writeState:()=>u});module.exports=b(At);var x=require("crypto"),l=require("fs"),y=require("path"),f=require("../../lib/logger"),g=require("./activity-participants"),p=require("../../lib/atomic"),d=require("./actions");const I="state.json",S={retries:0,activeVerificationId:null,activeTraceId:null,lastVerdictStatus:null,lastVerdictHadIssues:!1,activeFixId:null,activeActivityId:null,phase:null,recordingRequired:!1,recordingActive:!1,active:!1,userEmail:null,usageType:null,usagePlan:null,chainedStatusLine:null,contextInjectedVerificationId:null,pendingFixes:[],verifyIntent:null};function T(){return(0,x.randomBytes)(16).toString("hex")}r(T,"generateTraceId");function c(i){const e=(0,y.join)(i,I);if(!(0,l.existsSync)(e))return{...S};try{const n=(0,l.readFileSync)(e,"utf-8"),t=JSON.parse(n),a=["coding","verifying","fixing"],s=["api","subscription"];return{retries:typeof t.retries=="number"?t.retries:0,activeVerificationId:typeof t.activeVerificationId=="string"?t.activeVerificationId:null,activeTraceId:typeof t.activeTraceId=="string"?t.activeTraceId:null,lastVerdictStatus:typeof t.lastVerdictStatus=="string"?t.lastVerdictStatus:null,lastVerdictHadIssues:typeof t.lastVerdictHadIssues=="boolean"?t.lastVerdictHadIssues:!1,activeFixId:typeof t.activeFixId=="string"?t.activeFixId:null,activeActivityId:typeof t.activeActivityId=="string"?t.activeActivityId:null,phase:typeof t.phase=="string"&&a.includes(t.phase)?t.phase:null,recordingRequired:typeof t.recordingRequired=="boolean"?t.recordingRequired:!1,recordingActive:typeof t.recordingActive=="boolean"?t.recordingActive:!1,active:typeof t.active=="boolean"?t.active:!1,userEmail:typeof t.userEmail=="string"?t.userEmail:null,usageType:typeof t.usageType=="string"&&s.includes(t.usageType)?t.usageType:null,usagePlan:typeof t.usagePlan=="string"&&t.usagePlan.length>0?t.usagePlan:null,projectDir:typeof t.projectDir=="string"&&t.projectDir.length>0?t.projectDir:void 0,chainedStatusLine:typeof t.chainedStatusLine=="string"&&t.chainedStatusLine.length>0?t.chainedStatusLine:null,contextInjectedVerificationId:typeof t.contextInjectedVerificationId=="string"?t.contextInjectedVerificationId:null,pendingFixes:Array.isArray(t.pendingFixes)?t.pendingFixes.filter(o=>typeof o=="string"&&o.length>0):[],verifyIntent:typeof t.verifyIntent=="string"&&t.verifyIntent.length>0?t.verifyIntent:null}}catch(n){return f.logger.debug(`failed to read state from ${e}: ${n}`),{...S}}}r(c,"readState");function u(i,e){const n=(0,y.join)(i,I);try{(0,l.mkdirSync)(i,{recursive:!0});const t=`${n}.tmp.${process.pid}.${Date.now()}`,a=JSON.stringify(e,null,2);try{(0,l.writeFileSync)(t,a),(0,p.renameWithRetry)(t,n)}catch(s){try{(0,l.existsSync)(t)&&(0,l.unlinkSync)(t)}catch{}throw s}(0,p.sweepStaleTmpFiles)(n)}catch(t){f.logger.debug(`failed to write state to ${n}: ${t}`)}}r(u,"writeState");function w(i){return c(i).activeVerificationId??void 0}r(w,"getActiveVerificationId");function P(i,e,n){const t=c(i);t.activeVerificationId=e,t.activeTraceId=n,t.phase="verifying",u(i,t)}r(P,"setActiveVerification");function E(i){return c(i).activeTraceId??void 0}r(E,"getActiveTraceId");function F(i){const e=c(i);e.activeVerificationId=null,e.activeTraceId=null,e.phase="coding",u(i,e)}r(F,"clearActiveVerification");function j(i){return c(i).retries}r(j,"getRetries");function R(i){const e=c(i);return e.retries=e.retries+1,u(i,e),e.retries}r(R,"incrementRetries");function L(i){const e=c(i);e.retries=0,u(i,e)}r(L,"resetRetries");function $(i){return c(i).lastVerdictStatus??void 0}r($,"getLastVerdictStatus");function q(i,e){const n=c(i);n.lastVerdictStatus=e,u(i,n)}r(q,"setLastVerdictStatus");function U(i){return c(i).lastVerdictHadIssues===!0}r(U,"getLastVerdictHadIssues");function H(i,e){const n=c(i);n.lastVerdictHadIssues=e,u(i,n)}r(H,"setLastVerdictHadIssues");function k(i,e){const n=c(i);n.activeFixId=e,u(i,n)}r(k,"setActiveFix");function C(i){return c(i).activeFixId??void 0}r(C,"getActiveFixId");function z(i){const e=c(i);e.activeFixId=null,u(i,e)}r(z,"clearActiveFix");function N(i,e){const n=c(i);n.phase=e,u(i,n)}r(N,"setPhase");function O(i){return c(i).phase}r(O,"getPhase");function J(i){return c(i).recordingRequired}r(J,"isRecordingRequired");function B(i,e){const n=c(i);n.recordingRequired=e,u(i,n)}r(B,"setRecordingRequired");function M(i){return c(i).recordingActive}r(M,"isRecordingActive");function W(i,e){const n=c(i);n.recordingActive=e,u(i,n)}r(W,"setRecordingActive");function G(i){return c(i).active}r(G,"isActive");function K(i,e){const n=c(i);n.active=e,e||(n.activeActivityId=null),u(i,n)}r(K,"setActive");function Q(i){return c(i).activeActivityId??void 0}r(Q,"getActiveActivityId");function X(i){return c(i).userEmail??void 0}r(X,"getUserEmail");function Y(i,e){const n=typeof e=="string"&&e.length>0?e:null,t=c(i);t.userEmail!==n&&(t.userEmail=n,u(i,t))}r(Y,"setUserEmail");function Z(i){const e=c(i);return typeof e.projectDir=="string"&&e.projectDir.length>0?e.projectDir:void 0}r(Z,"getProjectDir");function D(i,e){const n=typeof e=="string"&&e.length>0?e:void 0;if(n===void 0)return;const t=c(i);t.projectDir!==n&&(t.projectDir=n,u(i,t))}r(D,"setProjectDir");function tt(i){return c(i).usageType??void 0}r(tt,"getUsageType");function et(i){return c(i).usagePlan??void 0}r(et,"getUsagePlan");function it(i,e){const n=e.usage_type==="api"||e.usage_type==="subscription"?e.usage_type:null,t=typeof e.usage_plan=="string"&&e.usage_plan.length>0?e.usage_plan:null,a=c(i);a.usageType===n&&a.usagePlan===t||(a.usageType=n,a.usagePlan=t,u(i,a))}r(it,"setUsage");function nt(i){return c(i).chainedStatusLine??void 0}r(nt,"getChainedStatusLine");function rt(i,e){const n=typeof e=="string"&&e.length>0?e:null,t=c(i);t.chainedStatusLine!==n&&(t.chainedStatusLine=n,u(i,t))}r(rt,"setChainedStatusLine");function at(i){return c(i).contextInjectedVerificationId??void 0}r(at,"getContextInjectedVerificationId");function ct(i,e){const n=typeof e=="string"&&e.length>0?e:null,t=c(i);t.contextInjectedVerificationId!==n&&(t.contextInjectedVerificationId=n,u(i,t))}r(ct,"setContextInjectedVerificationId");function st(i){return c(i).pendingFixes}r(st,"getPendingFixes");function ot(i,e){const n=e.filter(o=>typeof o=="string"&&o.length>0);if(n.length===0)return;const t=c(i),a=new Set(t.pendingFixes),s=[...t.pendingFixes];for(const o of n)a.has(o)||(a.add(o),s.push(o));s.length!==t.pendingFixes.length&&(t.pendingFixes=s,u(i,t))}r(ot,"addPendingFixes");function dt(i){const e=c(i);e.pendingFixes.length!==0&&(e.pendingFixes=[],u(i,e))}r(dt,"clearPendingFixes");function ut(i){return c(i).verifyIntent}r(ut,"getVerifyIntent");function ft(i,e){const n=c(i);n.verifyIntent!==e&&(n.verifyIntent=e,u(i,n))}r(ft,"setVerifyIntent");function lt(i){const e=c(i);e.verifyIntent!==null&&(e.verifyIntent=null,u(i,e))}r(lt,"clearVerifyIntent");function gt(i){return i==="fail"||i==="fail_reported"}r(gt,"isFailLikeVerdictStatus");function vt(i,e){const n=c(i);n.activeActivityId=e,n.active=!0,u(i,n)}r(vt,"setActiveActivity");function pt(i){const e=c(i);e.activeActivityId=null,e.active=!1,u(i,e)}r(pt,"clearActiveActivity");async function yt(i,e,n){const t=c(i);let a=!1;if(t.activeVerificationId){const s=Date.now(),o={...(0,d.baseFields)(e),type:"verification_end",timestamp:s,verification_id:t.activeVerificationId,activity_id:t.activeActivityId,trace_id:t.activeTraceId,duration:(0,d.findDurationSinceLastAction)(e,"verification_start",s),reason:n};await(0,d.appendAction)(e,o),f.logger.debug(`close-open-cycles: ended verification ${t.activeVerificationId} (${n})`),t.activeVerificationId=null,t.activeTraceId=null,t.contextInjectedVerificationId=null,a=!0}if(t.activeFixId){const s=Date.now(),o={...(0,d.baseFields)(e),type:"fix_end",timestamp:s,fix_id:t.activeFixId,activity_id:t.activeActivityId,duration:(0,d.findDurationSinceLastAction)(e,"fix_start",s),reason:n};await(0,d.appendAction)(e,o),f.logger.debug(`close-open-cycles: ended fix ${t.activeFixId} (${n})`),t.activeFixId=null,t.pendingFixes.length>0&&(t.pendingFixes=[]),a=!0}(t.recordingRequired||t.recordingActive)&&(t.recordingRequired=!1,t.recordingActive=!1,a=!0),t.phase!=="coding"&&(t.phase="coding",a=!0),t.verifyIntent!==null&&(t.verifyIntent=null,a=!0),a&&u(i,t)}r(yt,"closeOpenCycles");async function It(i,e,n){const t=c(i);let a=!1;if(t.activeVerificationId){const s=Date.now(),o={...(0,d.baseFields)(e),type:"verification_end",timestamp:s,verification_id:t.activeVerificationId,activity_id:t.activeActivityId,trace_id:t.activeTraceId,duration:(0,d.findDurationSinceLastAction)(e,"verification_start",s),reason:"session_reconcile"};await n(e,o),f.logger.debug(`reconcile: ended abandoned verification ${t.activeVerificationId}`),t.activeVerificationId=null,t.activeTraceId=null,t.contextInjectedVerificationId=null,a=!0}if(t.activeFixId){const s=Date.now(),o={...(0,d.baseFields)(e),type:"fix_end",timestamp:s,fix_id:t.activeFixId,activity_id:t.activeActivityId,duration:(0,d.findDurationSinceLastAction)(e,"fix_start",s),reason:"session_reconcile"};await n(e,o),f.logger.debug(`reconcile: ended abandoned fix ${t.activeFixId}`),t.activeFixId=null,t.pendingFixes.length>0&&(t.pendingFixes=[]),a=!0}if(t.active){const s=Date.now(),o={...(0,d.baseFields)(e),type:"activity_end",timestamp:s,activity_id:t.activeActivityId,duration:(0,d.findDurationSinceLastAction)(e,"activity_start",s),reason:"session_reconcile"};await n(e,o),f.logger.debug(`reconcile: ended abandoned activity ${t.activeActivityId??""}`),t.active=!1,t.activeActivityId=null,(0,g.clearActivityParticipants)(i),a=!0}(t.recordingRequired||t.recordingActive)&&(t.recordingRequired=!1,t.recordingActive=!1,a=!0),t.phase!=="coding"&&(t.phase="coding",a=!0),t.verifyIntent!==null&&(t.verifyIntent=null,a=!0),a&&u(i,t)}r(It,"reconcileSessionState");async function St(i,e,n){const t=c(i);if(!t.active&&!t.activeVerificationId&&!t.activeFixId&&t.verifyIntent===null||!(0,g.isParticipantPresent)(i,g.MAIN_PARTICIPANT_ID)&&(0,g.anyActiveParticipants)(i))return;let a=!1;const s=(0,d.findLastActionTimestamp)(e)??Date.now();if(t.activeVerificationId){const o={...(0,d.baseFields)(e),type:"verification_end",timestamp:s,verification_id:t.activeVerificationId,activity_id:t.activeActivityId,trace_id:t.activeTraceId,duration:(0,d.findDurationSinceLastAction)(e,"verification_start",s),reason:"interrupt_inferred"};await n(e,o),f.logger.debug(`interrupt-reconcile: ended verification ${t.activeVerificationId}`),t.activeVerificationId=null,t.activeTraceId=null,t.contextInjectedVerificationId=null,a=!0}if(t.activeFixId){const o={...(0,d.baseFields)(e),type:"fix_end",timestamp:s,fix_id:t.activeFixId,activity_id:t.activeActivityId,duration:(0,d.findDurationSinceLastAction)(e,"fix_start",s),reason:"interrupt_inferred"};await n(e,o),f.logger.debug(`interrupt-reconcile: ended fix ${t.activeFixId}`),t.activeFixId=null,t.pendingFixes.length>0&&(t.pendingFixes=[]),a=!0}if(t.active){const o={...(0,d.baseFields)(e),type:"activity_end",timestamp:s,activity_id:t.activeActivityId,duration:(0,d.findDurationSinceLastAction)(e,"activity_start",s),reason:"interrupt_inferred"};await n(e,o),f.logger.debug(`interrupt-reconcile: ended activity ${t.activeActivityId??""}`),t.active=!1,t.activeActivityId=null,(0,g.clearActivityParticipants)(i),a=!0}(t.recordingRequired||t.recordingActive)&&(t.recordingRequired=!1,t.recordingActive=!1,a=!0),t.phase!=="coding"&&(t.phase="coding",a=!0),t.verifyIntent!==null&&(t.verifyIntent=null,a=!0),a&&u(i,t)}r(St,"reconcileAbandonedActivity");async function xt(i,e,n){const t=c(i);let a=!1;if(t.activeVerificationId){const s=Date.now(),o={...(0,d.baseFields)(e),type:"verification_end",timestamp:s,verification_id:t.activeVerificationId,activity_id:t.activeActivityId,trace_id:t.activeTraceId,duration:(0,d.findDurationSinceLastAction)(e,"verification_start",s),reason:"compact"};await n(e,o),f.logger.debug(`compact-reconcile: ended verification ${t.activeVerificationId}`),t.activeVerificationId=null,t.activeTraceId=null,t.contextInjectedVerificationId=null,a=!0}if(t.activeFixId){const s=Date.now(),o={...(0,d.baseFields)(e),type:"fix_end",timestamp:s,fix_id:t.activeFixId,activity_id:t.activeActivityId,duration:(0,d.findDurationSinceLastAction)(e,"fix_start",s),reason:"compact"};await n(e,o),f.logger.debug(`compact-reconcile: ended fix ${t.activeFixId}`),t.activeFixId=null,t.pendingFixes.length>0&&(t.pendingFixes=[]),a=!0}if(t.active){const s=Date.now(),o={...(0,d.baseFields)(e),type:"activity_end",timestamp:s,activity_id:t.activeActivityId,duration:(0,d.findDurationSinceLastAction)(e,"activity_start",s),reason:"compact"};await n(e,o),f.logger.debug(`compact-reconcile: ended activity ${t.activeActivityId??""}`),t.active=!1,t.activeActivityId=null,(0,g.clearActivityParticipants)(i),a=!0}(t.recordingRequired||t.recordingActive)&&(t.recordingRequired=!1,t.recordingActive=!1,a=!0),t.phase!=="coding"&&(t.phase="coding",a=!0),t.verifyIntent!==null&&(t.verifyIntent=null,a=!0),a&&u(i,t)}r(xt,"reconcileForCompact");0&&(module.exports={addPendingFixes,clearActiveActivity,clearActiveFix,clearActiveVerification,clearPendingFixes,clearVerifyIntent,closeOpenCycles,generateTraceId,getActiveActivityId,getActiveFixId,getActiveTraceId,getActiveVerificationId,getChainedStatusLine,getContextInjectedVerificationId,getLastVerdictHadIssues,getLastVerdictStatus,getPendingFixes,getPhase,getProjectDir,getRetries,getUsagePlan,getUsageType,getUserEmail,getVerifyIntent,incrementRetries,isActive,isFailLikeVerdictStatus,isRecordingActive,isRecordingRequired,readState,reconcileAbandonedActivity,reconcileForCompact,reconcileSessionState,resetRetries,setActive,setActiveActivity,setActiveFix,setActiveVerification,setChainedStatusLine,setContextInjectedVerificationId,setLastVerdictHadIssues,setLastVerdictStatus,setPhase,setProjectDir,setRecordingActive,setRecordingRequired,setUsage,setUserEmail,setVerifyIntent,writeState});
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
"use strict";var y=Object.defineProperty;var
|
|
2
|
-
`,
|
|
1
|
+
"use strict";var y=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var H=Object.getOwnPropertyNames;var U=Object.prototype.hasOwnProperty;var g=(t,n)=>y(t,"name",{value:n,configurable:!0});var W=(t,n)=>{for(var i in n)y(t,i,{get:n[i],enumerable:!0})},z=(t,n,i,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of H(n))!U.call(t,e)&&e!==i&&y(t,e,{get:()=>n[e],enumerable:!(r=M(n,e))||r.enumerable});return t};var G=t=>z(y({},"__esModule",{value:!0}),t);var nt={};W(nt,{VERIFICATION_DOC_DIR:()=>b,VERIFICATION_DOC_FILE:()=>C,buildVerificationContext:()=>j,buildVerificationContextForSession:()=>_,buildVerificationContextOnceForCycle:()=>tt,collectChangedPaths:()=>P,renderChangedPathsBlock:()=>N,resolveContextFiles:()=>T});module.exports=G(nt);var D=require("fs"),o=require("path"),S=require("../../lib/runtime-paths"),u=require("../../lib/config"),w=require("../../lib/git"),h=require("../../lib/logger"),O=require("./session-state"),A=require("./actions");const b=".ironbee",C="VERIFICATION.md",J=`===== IRONBEE \u2014 PROJECT VERIFICATION INSTRUCTIONS (path-scoped) =====
|
|
2
|
+
`,q=`The following areas changed this cycle. Follow this guidance IN ADDITION to the standard verification flow.
|
|
3
3
|
`,k=`====================================================================
|
|
4
|
-
`;function
|
|
4
|
+
`;function v(t){return Buffer.byteLength(t,"utf-8")}g(v,"byteLen");function K(t){try{return(0,D.realpathSync)(t)}catch{return(0,o.resolve)(t)}}g(K,"canonicalDir");function Q(t){const n=(0,o.resolve)(t),i=[];let r=n;for(;;)try{const e=(0,D.realpathSync)(r);return i.length>0?(0,o.join)(e,...i):e}catch{const e=(0,o.dirname)(r);if(e===r)return n;i.unshift((0,o.basename)(r)),r=e}}g(Q,"canonicalizePath");function X(t,n){const i=(0,o.relative)(t,n);return i.length>0&&!i.startsWith("..")&&!(0,o.isAbsolute)(i)}g(X,"isUnderDir");function F(t){try{return(0,A.getFileChangesSinceLastVerification)(t).map(n=>n.file_path).filter(n=>typeof n=="string"&&n.length>0)}catch(n){return h.logger.debug(`verification-context: actions fallback failed: ${n instanceof Error?n.message:n}`),[]}}g(F,"changedFromActions");function P(t,n,i){let r;if(i.source==="actions")r=F(n);else{const s=(0,w.getChangedPaths)(t,i.commitDepth);r=s===null?F(n):s}const e=new Set;for(const s of r){const l=Q((0,o.isAbsolute)(s)?s:(0,o.resolve)(t,s)),c=(0,o.relative)(t,l);c.length===0||c.startsWith("..")||(0,o.isAbsolute)(c)||c.split(o.sep).includes(b)||e.add(l)}return[...e]}g(P,"collectChangedPaths");function T(t,n){const i=new Map;for(const r of n){let e=(0,o.dirname)(r);if(!(e!==t&&!X(t,e)))for(;;){const s=(0,o.join)(e,b,C);if(!i.has(s)&&(0,D.existsSync)(s))try{const c=(0,D.readFileSync)(s,"utf-8"),m=(0,o.relative)(t,e),d=m.length===0?"":m.split(o.sep).join("/"),f=d.length===0?0:d.split("/").length;i.set(s,{absPath:s,relDir:d,depth:f,content:c})}catch(c){h.logger.debug(`verification-context: failed to read ${s}: ${c instanceof Error?c.message:c}`)}if(e===t)break;const l=(0,o.dirname)(e);if(l===e)break;e=l}}return[...i.values()].sort((r,e)=>r.depth-e.depth||r.relDir.localeCompare(e.relDir))}g(T,"resolveContextFiles");function Y(t){return t.relDir.length===0?{label:"(repo root)",path:`${b}/${C}`}:{label:`${t.relDir}/`,path:`${t.relDir}/${b}/${C}`}}g(Y,"provenance");function E(t){const n=Y(t);return`
|
|
5
5
|
## ${n.label} \u2014 ${n.path}
|
|
6
6
|
${t.content.trimEnd()}
|
|
7
|
-
`}g(E,"renderBlock");const V=100;function
|
|
7
|
+
`}g(E,"renderBlock");const V=100;function N(t,n){if(n.length===0)return"";const i=n.map(s=>(0,o.relative)(t,s).split(o.sep).join("/")).sort(),r=i.slice(0,V),e=i.length>V?`
|
|
8
8
|
- \u2026 +${i.length-V} more`:"";return`
|
|
9
9
|
## Changed files this cycle (${i.length})
|
|
10
10
|
${r.map(s=>`- ${s}`).join(`
|
|
11
11
|
`)}${e}
|
|
12
|
-
`}g(
|
|
12
|
+
`}g(N,"renderChangedPathsBlock");function j(t,n){const i=n.changedPathsBlock??"";if(t.length===0&&i.length===0)return"";const r=[...t].sort((a,$)=>a.depth-$.depth||a.relDir.localeCompare($.relDir)),e=J+q+i,s=Math.max(0,n.maxBytes-v(e)-v(k)),l=[];let c=0;for(let a=r.length-1;a>=0;a--){const $=E(r[a]),x=v($);if(c+x<=s)l.push(r[a]),c+=x;else if(l.length===0){const I=Z(r[a],s);l.push(I);break}else break}const m=l.reverse(),d=r.length-m.length,f=[e];for(const a of m)f.push(E(a));return d>0&&f.push(`
|
|
13
13
|
[${d} less-specific VERIFICATION.md file(s) omitted to fit the ${n.maxBytes}-byte cap]
|
|
14
|
-
`),
|
|
15
|
-
... (truncated)`,r=E({...t,content:""}),e=Math.max(0,n-
|
|
16
|
-
## `).length-1;h.logger.debug(`verification-context: injected ${Buffer.byteLength(l,"utf-8")} bytes, ${c} area(s) for cycle ${e}`)}else h.logger.debug(`verification-context: nothing to inject (no changed paths) for cycle ${e}`);return(0,O.setContextInjectedVerificationId)(r,e),l}g(
|
|
14
|
+
`),f.push(k),f.join("")}g(j,"buildVerificationContext");function Z(t,n){const i=`
|
|
15
|
+
... (truncated)`,r=E({...t,content:""}),e=Math.max(0,n-v(r)-v(i)),s=Buffer.from(t.content,"utf-8").subarray(0,e).toString("utf-8");return{...t,content:s+i}}g(Z,"hardTruncate");function _(t,n,i){if(!(0,u.getVerificationContextEnabled)(i))return"";try{const r=K(t),e=(0,o.join)((0,S.sessionDir)(r,n),"actions.jsonl"),s=(0,u.getVerificationContextSource)(i),l=P(r,e,{source:s,commitDepth:(0,u.getVerificationContextCommitDepth)(i)}),c=l.filter(p=>!(0,u.isIgnoredVerifyPath)(i,p)),m=l.length-c.length,d=new Set;for(const p of c){const R=(0,o.relative)(r,(0,o.dirname)(p)).split(o.sep).join("/");d.add(R.length===0?"(root)":R)}const f=[...d].sort(),a=50,$=f.slice(0,a),x=f.length>a?` [+${f.length-a} more]`:"";h.logger.debug(`verification-context: source=${s} changed in ${f.length} dir(s)`+(m>0?` (${m} ignored)`:"")+`: ${$.join(", ")}${x}`);const I=T(r,c);for(const p of I){const R=p.relDir.length>0?`${p.relDir}/${b}/${C}`:`${b}/${C}`,B=p.content.replace(/\s+/g," ").trim(),L=B.length>100?`${B.slice(0,100)}...`:B;h.logger.debug(`verification-context: \u2022 ${R} \u2014 ${v(p.content)} bytes :: ${L}`)}return j(I,{maxBytes:(0,u.getVerificationContextMaxBytes)(i),changedPathsBlock:N(r,c)})}catch(r){return h.logger.debug(`verification-context: build failed: ${r instanceof Error?r.message:r}`),""}}g(_,"buildVerificationContextForSession");function tt(t){const{projectDir:n,sessionId:i,sessionDir:r,activeVerificationId:e,config:s}=t;if(!e||!(0,u.getVerificationContextEnabled)(s)||(0,O.getContextInjectedVerificationId)(r)===e)return"";let l="";try{l=_(n,i,s)}catch(c){h.logger.debug(`verification-context: once-for-cycle build failed: ${c instanceof Error?c.message:c}`),l=""}if(l.length>0){const c=l.split(`
|
|
16
|
+
## `).length-1;h.logger.debug(`verification-context: injected ${Buffer.byteLength(l,"utf-8")} bytes, ${c} area(s) for cycle ${e}`)}else h.logger.debug(`verification-context: nothing to inject (no changed paths) for cycle ${e}`);return(0,O.setContextInjectedVerificationId)(r,e),l}g(tt,"buildVerificationContextOnceForCycle");0&&(module.exports={VERIFICATION_DOC_DIR,VERIFICATION_DOC_FILE,buildVerificationContext,buildVerificationContextForSession,buildVerificationContextOnceForCycle,collectChangedPaths,renderChangedPathsBlock,resolveContextFiles});
|
package/dist/import/marker.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var s=Object.defineProperty;var
|
|
2
|
-
`),!0}catch(g){return m.logger.debug(`import marker: write ${
|
|
1
|
+
"use strict";var s=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var M=Object.prototype.hasOwnProperty;var a=(r,t)=>s(r,"name",{value:t,configurable:!0});var w=(r,t)=>{for(var e in t)s(r,e,{get:t[e],enumerable:!0})},x=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of S(t))!M.call(r,i)&&i!==e&&s(r,i,{get:()=>t[i],enumerable:!(n=I(t,i))||n.enumerable});return r};var y=r=>x(s({},"__esModule",{value:!0}),r);var v={};w(v,{MARKER_SCHEMA_VERSION:()=>k,markerPath:()=>f,readImportMarker:()=>_,writeImportMarker:()=>E});module.exports=y(v);var o=require("fs"),p=require("path"),m=require("../lib/logger"),c=require("../lib/gitignore"),l=require("../lib/runtime-paths");const k="1.0";function f(r,t){return(0,p.join)((0,l.sessionDir)(r,t),"imported.json")}a(f,"markerPath");function E(r,t,e,n,i){if(!(0,o.existsSync)(r))return m.logger.debug(`import marker: projectDir ${r} does not exist \u2014 skipping marker write`),!1;(0,c.ensureIronBeeGitignored)(r);const u=f(r,t),d={imported_at:new Date().toISOString(),transcript_path:e,transcript_offset:n,events_sent:i,schema_version:k};try{return(0,o.mkdirSync)((0,p.dirname)(u),{recursive:!0}),(0,o.writeFileSync)(u,JSON.stringify(d,null,2)+`
|
|
2
|
+
`),!0}catch(g){return m.logger.debug(`import marker: write ${u} failed: ${g instanceof Error?g.message:g}`),!1}}a(E,"writeImportMarker");function _(r,t){const e=f(r,t);if(!(0,o.existsSync)(e))return null;try{const n=(0,o.readFileSync)(e,"utf-8");return JSON.parse(n)}catch(n){return m.logger.debug(`import marker: read ${e} failed: ${n instanceof Error?n.message:n}`),null}}a(_,"readImportMarker");0&&(module.exports={MARKER_SCHEMA_VERSION,markerPath,readImportMarker,writeImportMarker});
|
package/dist/import/skip.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=Object.defineProperty;var
|
|
1
|
+
"use strict";var e=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var t=(r,o)=>e(r,"name",{value:o,configurable:!0});var u=(r,o)=>{for(var s in o)e(r,s,{get:o[s],enumerable:!0})},c=(r,o,s,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of p(o))!a.call(r,i)&&i!==s&&e(r,i,{get:()=>o[i],enumerable:!(n=l(o,i))||n.enumerable});return r};var g=r=>c(e({},"__esModule",{value:!0}),r);var S={};u(S,{shouldSkip:()=>D});module.exports=g(S);var f=require("fs"),m=require("../lib/runtime-paths");function D(r,o,s){if(s)return!1;const n=(0,m.sessionDir)(r,o);return(0,f.existsSync)(n)}t(D,"shouldSkip");0&&(module.exports={shouldSkip});
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var
|
|
2
|
+
"use strict";var N=Object.defineProperty;var t=(r,n)=>N(r,"name",{value:n,configurable:!0});var i=require("commander"),c=require("fs"),l=require("path"),m=require("./commands/install"),g=require("./commands/uninstall"),p=require("./commands/update"),f=require("./commands/hook"),C=require("./commands/status"),u=require("./commands/verify"),b=require("./commands/queue"),v=require("./commands/process-job-file"),y=require("./clients/codex/cli"),h=require("./commands/browser"),$=require("./commands/node"),j=require("./commands/backend"),w=require("./commands/android"),I=require("./commands/verification"),k=require("./commands/telemetry"),B=require("./commands/privacy"),F=require("./commands/config"),T=require("./tui"),q=require("./commands/register"),A=require("./commands/unregister"),L=require("./commands/import"),R=require("./clients/claude/cli"),S=require("./commands/login"),U=require("./commands/scenario"),x=require("./queue"),P=require("./lib/icon"),s=require("./lib/version"),e=require("./lib/output");const d=JSON.parse((0,c.readFileSync)((0,l.join)(__dirname,"../package.json"),"utf-8"));(0,x.registerQueueHandlers)();const o=new i.Command;o.name("ironbee").description(d.description).version(d.version),o.addCommand(S.loginCommand),o.addCommand(m.installCommand),o.addCommand(g.uninstallCommand),o.addCommand(p.updateCommand),o.addCommand(C.statusCommand),o.addCommand(u.verifyCommand),o.addCommand(b.queueCommand),o.addCommand(h.browserCommand),o.addCommand($.nodeCommand),o.addCommand(j.backendCommand),o.addCommand(w.androidCommand),o.addCommand(I.verificationCommand),o.addCommand(k.telemetryCommand),o.addCommand(B.privacyCommand),o.addCommand(R.claudeCommand),o.addCommand(y.codexCommand),o.addCommand(F.configCommand),o.addCommand(T.tuiCommand),o.addCommand(q.registerCommand),o.addCommand(A.unregisterCommand),o.addCommand(L.importCommand),o.addCommand(U.scenarioCommand),o.addCommand(v.processJobFileCommand),o.addCommand(f.hookCommand);const O=process.argv[2]==="hook"||process.argv[2]==="process-job-file"||process.argv[2]==="claude"&&process.argv[3]==="process-analytics"||process.argv[2]==="codex"&&process.argv[3]==="process-analytics"||process.argv[2]==="claude"&&process.argv[3]==="otel"&&process.argv[4]==="run";if(process.argv.length===2){(0,P.printBanner)(),console.log(),console.log(` ${e.pc.bold("IronBee CLI")} ${e.pc.dim(`v${(0,s.getLocalVersion)()}`)}`),console.log(` ${e.pc.dim(d.description)}`),console.log(),console.log(` ${e.pc.bold(e.pc.cyan("Usage:"))} ${e.pc.green("ironbee")} ${e.pc.dim("<command> [options]")}`),console.log(),console.log(` ${e.pc.bold(e.pc.cyan("Commands:"))}`);const r=[{name:"install",args:"[project-dir]",desc:"Install hooks + guidance files into a project (--all: every registered project)"},{name:"uninstall",args:"[project-dir]",desc:"Remove IronBee from a project (--all: every registered project)"},{name:"update",args:"",desc:"Update IronBee CLI to the latest version"},{name:"tui",args:"[area]",desc:"Interactive full-screen UI (config \xB7 platforms \xB7 projects \xB7 sessions \xB7 queue \xB7 import)"},{name:"status",args:"[project-dir]",desc:"Show verification status for active sessions"},{name:"verify",args:"[session-id]",desc:"Dry-run verdict validation"},{name:"browser",args:"<enable|disable>",desc:"Toggle the browser verification cycle (default-on)"},{name:"node",args:"<enable|disable>",desc:"Toggle the Node.js runtime debug cycle (opt-in)"},{name:"backend",args:"<enable|disable>",desc:"Toggle the backend protocol cycle (opt-in)"},{name:"android",args:"<enable|disable>",desc:"Toggle the Android mobile verification cycle (opt-in)"},{name:"verification",args:"<enable|disable>",desc:"Master toggle (enable = enforce; disable = monitoring-only)"},{name:"telemetry",args:"<enable|disable>",desc:"Anonymous PostHog telemetry toggle"},{name:"privacy",args:"<enable|disable>",desc:"Privacy mode \u2014 redact devtools tool detail / screenshots / recordings from collector"},{name:"claude statusline",args:"<enable|disable>",desc:"Claude statusline integration (Claude-only)"},{name:"claude otel",args:"<run|status|stop|retry>",desc:"Claude OTEL collector daemon (Claude-only)"},{name:"config",args:"<get|set|unset|list>",desc:"Read or write project / global / local config"},{name:"register",args:"[-p <dir>]",desc:"Add a project to the user-home inventory (no artifact writes)"},{name:"unregister",args:"[-p <dir>]",desc:"Remove a project from the inventory (no artifact writes)"},{name:"queue",args:"<status|drain|\u2026>",desc:"Inspect / drain the background job queue"},{name:"import",args:"",desc:"Import historical Claude sessions to the collector"}],n=t(a=>a.args.length>0?`${a.name} ${a.args}`:a.name,"term"),H=Math.max(...r.map(a=>n(a).length));for(const a of r){const J=a.args.length>0?`${e.pc.green(a.name)} ${e.pc.dim(a.args)}`:e.pc.green(a.name),M=" ".repeat(H-n(a).length);console.log(` ${J}${M} ${a.desc}`)}console.log(),console.log(` ${e.pc.dim("Run")} ${e.pc.cyan("ironbee <command> --help")} ${e.pc.dim("for more info on a command.")}`),console.log()}else O?o.parse(process.argv):(async()=>{await o.parseAsync(process.argv),(0,s.checkForUpdates)().catch(()=>{});const r=process.argv[2];r==="install"||r==="uninstall"||r==="update"||await(0,m.syncSchemaIfChanged)()})();
|
package/dist/lib/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var y=Object.defineProperty;var ue=Object.getOwnPropertyDescriptor;var fe=Object.getOwnPropertyNames;var ge=Object.prototype.hasOwnProperty;var o=(n,e)=>y(n,"name",{value:e,configurable:!0});var de=(n,e)=>{for(var t in e)y(n,t,{get:e[t],enumerable:!0})},pe=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of fe(e))!ge.call(n,i)&&i!==t&&y(n,i,{get:()=>e[i],enumerable:!(r=ue(e,i))||r.enumerable});return n};var be=n=>pe(y({},"__esModule",{value:!0}),n);var Bn={};de(Bn,{ALL_CYCLES:()=>Ee,CONFIG_TARGETS_BY_PRECEDENCE:()=>Re,CYCLES_ENABLED_BY_DEFAULT:()=>P,CYCLE_DEFAULT_VERIFY_PATTERNS:()=>$,CYCLE_TOOL_PREFIXES:()=>_e,CYCLE_TO_SERVER:()=>ye,DEFAULT_ANDROID_ALWAYS_REQUIRED:()=>W,DEFAULT_ANDROID_EVIDENCE_PATHS:()=>Q,DEFAULT_ANDROID_VERIFY_PATTERNS:()=>U,DEFAULT_BACKEND_ALWAYS_REQUIRED:()=>H,DEFAULT_BACKEND_EVIDENCE_PATHS:()=>G,DEFAULT_BACKEND_VERIFY_PATTERNS:()=>V,DEFAULT_BROWSER_ALWAYS_REQUIRED:()=>K,DEFAULT_BROWSER_VERIFY_PATTERNS:()=>M,DEFAULT_IGNORED_VERIFY_PATTERNS:()=>q,DEFAULT_NODE_ALWAYS_REQUIRED:()=>Y,DEFAULT_NODE_EVIDENCE_PATHS:()=>X,DEFAULT_NODE_VERIFY_PATTERNS:()=>F,DEFAULT_OAUTH_USAGE_TTL_SECONDS:()=>ee,DEFAULT_OTEL_EMIT_MIN_INTERVAL_SECONDS:()=>re,DEFAULT_OTEL_ENSURE_MIN_INTERVAL_SECONDS:()=>oe,DEFAULT_OTEL_IDLE_TIMEOUT_SECONDS:()=>te,DEFAULT_OTEL_PORT:()=>ne,DEFAULT_VERIFICATION_CONTEXT_COMMIT_DEPTH:()=>ae,DEFAULT_VERIFICATION_CONTEXT_MAX_BYTES:()=>se,ENV_OVERRIDES:()=>j,OPTIONAL_CYCLES:()=>T,applyEnvOverrides:()=>z,findActiveEnvOverride:()=>Be,getActiveCycles:()=>J,getAnalyticsEmitOnStopMinIntervalSeconds:()=>Rn,getAndroidDevToolsMcpEntry:()=>Ze,getAutoVerifyEnabled:()=>ie,getBackendDevToolsMcpEntry:()=>Je,getCaptureFileChangeset:()=>Tn,getClaudeOauthAccessEnabled:()=>an,getClaudeOauthAccessUsageTtlSeconds:()=>un,getCodexVerifierMode:()=>cn,getConfigLayerPaths:()=>w,getMaxChangesetBytes:()=>xn,getMaxRetries:()=>en,getMcpServerEntry:()=>Qe,getNodeDevToolsMcpEntry:()=>ze,getOTELEmitMinIntervalSeconds:()=>bn,getOTELEnsureMinIntervalSeconds:()=>pn,getOTELIdleTimeoutSeconds:()=>dn,getOTELPort:()=>gn,getPrivacyEnabled:()=>le,getRequiredToolsConfig:()=>Pe,getStatusLineEmitMinIntervalSeconds:()=>sn,getStatusLineRefreshInterval:()=>En,getStatusLineRenderDefault:()=>rn,getTargetConfigPath:()=>Oe,getTelemetryEnabled:()=>ce,getVerificationContextCommitDepth:()=>mn,getVerificationContextEnabled:()=>_n,getVerificationContextMaxBytes:()=>An,getVerificationContextSource:()=>Cn,getVerificationEnabled:()=>O,getVerificationMode:()=>In,getVerificationModel:()=>Ae,getVerificationStrict:()=>yn,isAnalyticsApiRequestEventsEnabled:()=>kn,isAnalyticsEmitOnStopEnabled:()=>jn,isAnalyticsEnabled:()=>wn,isAnalyticsStepEventsEnabled:()=>hn,isAnalyticsTurnEventsEnabled:()=>On,isAutoModeAllowlistEnabled:()=>ln,isCollectorConfigured:()=>R,isCycleEnabled:()=>De,isCyclePatternsActive:()=>Z,isIgnoredVerifyPath:()=>vn,isJobQueueEnabled:()=>nn,isOTELEnabled:()=>fn,isRecordingEnabled:()=>tn,isSessionStatusEnabled:()=>on,loadConfig:()=>c,requiresVerification:()=>Ne,resolveConfigTargetFromFlags:()=>he,resolveIgnoredVerifyPatterns:()=>x});module.exports=be(Bn);var E=require("fs"),b=require("path"),I=require("os"),D=require("./logger");const T=["node","backend","android"],Ee=["browser",...T],P=new Set(["browser"]),ye={browser:"browser-devtools",node:"node-devtools",backend:"backend-devtools",android:"android-devtools"},_e={browser:"bdt_",node:"ndt_",backend:"bedt_",android:"adt_"},M=["*.ts","*.tsx","*.js","*.jsx","*.mjs","*.cjs","*.vue","*.svelte","*.html","*.htm","*.css","*.scss","*.sass","*.less","*.styl","*.py","*.rb","*.erb","*.go","*.rs","*.java","*.kt","*.kts","*.swift","*.c","*.cpp","*.h","*.hpp","*.cs","*.php","*.dart","*.ex","*.exs","*.erl","*.lua","*.r","*.R","*.scala","*.clj","*.cljs","*.zig","*.nim","*.hbs","*.ejs","*.pug","*.jade","*.astro"],F=["server/**/*.{ts,js,mjs,cjs}","src/server/**/*.{ts,js,mjs,cjs}","backend/**/*.{ts,js,mjs,cjs}","api/**/*.{ts,js,mjs,cjs}","src/api/**/*.{ts,js,mjs,cjs}","pages/api/**/*.{ts,js,mjs,cjs}","app/api/**/*.{ts,js,mjs,cjs}","routes/**/*.{ts,js,mjs,cjs}","**/server.{ts,js,mjs,cjs}"],V=["server/**/*.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","src/server/**/*.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","backend/**/*.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","api/**/*.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","src/api/**/*.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","pages/api/**/*.{ts,js,mjs,cjs}","app/api/**/*.{ts,js,mjs,cjs}","routes/**/*.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","controllers/**/*.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","handlers/**/*.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","services/**/*.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","**/server.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","**/main.{go,py,java,rb,kt,scala}"],U=["android/**/*.{kt,java}","app/src/**/*.{kt,java}","mobile/**/*.{kt,java}","src/main/kotlin/**/*.kt","src/main/java/**/*.java","**/*.{kt,java}","**/res/**/*.xml","**/AndroidManifest.xml"],$={browser:M,node:F,backend:V,android:U},q=["**/*.spec.*","**/*.test.*","**/__tests__/**","**/__mocks__/**"];function x(n){const e=n.ignoredVerifyPatterns??[];return[...q,...e]}o(x,"resolveIgnoredVerifyPatterns");const K=["bdt_navigation_go-to","bdt_content_take-screenshot","bdt_a11y_take-aria-snapshot","bdt_o11y_get-console-messages"],Y=["ndt_debug_connect"],X=[{name:"probe",allOf:[{anyOf:["ndt_debug_put-tracepoint","ndt_debug_put-logpoint","ndt_debug_put-exceptionpoint"]},"ndt_debug_get-probe-snapshots"]},{name:"log",allOf:["ndt_debug_get-logs"]}],H=[],G=[{name:"protocol-call",allOf:[{anyOf:["bedt_request_http","bedt_request_grpc","bedt_request_graphql","bedt_request_websocket-open","bedt_request_replay"]}]},{name:"log-evidence",allOf:["bedt_log_register-source",{anyOf:["bedt_log_read","bedt_log_read-multi","bedt_log_follow"]}]},{name:"db-evidence",allOf:["bedt_db_connect",{anyOf:["bedt_db_query","bedt_db_describe-table","bedt_db_list-tables","bedt_db_snapshot","bedt_db_diff","bedt_db_get-changes"]}]}],W=["adt_device_connect"],Q=[{name:"device-evidence",allOf:[{anyOf:["adt_device_launch-app","adt_interaction_tap","adt_interaction_double-tap","adt_interaction_long-press","adt_interaction_input-text","adt_interaction_swipe","adt_interaction_scroll","adt_interaction_press-key","adt_interaction_deep-link"]},"adt_content_take-screenshot","adt_a11y_take-ui-snapshot"]},{name:"log-evidence",allOf:[{anyOf:["adt_o11y_log-read","adt_o11y_log-follow"]}]}],Ce=3;function k(n){if(!(0,E.existsSync)(n))return{};try{return JSON.parse((0,E.readFileSync)(n,"utf-8"))}catch(e){return D.logger.debug(`failed to parse config ${n}: ${e}`),{}}}o(k,"loadJsonFile");function me(n,e){if(!Object.prototype.hasOwnProperty.call(n,"verification"))return;const t=n.verification;if(t===null||typeof t!="object"||Array.isArray(t))throw new Error(`Invalid IronBee config in ${e}: 'verification' must be an object. Expected shape: { "enable": boolean }.`);const r=t;if(Object.prototype.hasOwnProperty.call(r,"enable")&&typeof r.enable!="boolean")throw new Error(`Invalid IronBee config in ${e}: 'verification.enable' must be boolean. Got ${typeof r.enable}.`);if(Object.prototype.hasOwnProperty.call(r,"auto")&&typeof r.auto!="boolean")throw new Error(`Invalid IronBee config in ${e}: 'verification.auto' must be boolean. Got ${typeof r.auto}.`);if(Object.prototype.hasOwnProperty.call(r,"strict")&&typeof r.strict!="boolean")throw new Error(`Invalid IronBee config in ${e}: 'verification.strict' must be boolean. Got ${typeof r.strict}.`);if(Object.prototype.hasOwnProperty.call(r,"model")){const i=r.model,s=typeof i=="string",l=i!==null&&typeof i=="object"&&!Array.isArray(i)&&Object.values(i).every(a=>typeof a=="string");if(!s&&!l)throw new Error(`Invalid IronBee config in ${e}: 'verification.model' must be a string (applies to all clients) or an object of string values (per-client, e.g. { "claude": "sonnet", "codex": "gpt-5.5" }). Got ${Array.isArray(i)?"array":typeof i}.`)}}o(me,"assertVerificationShape");function Ae(n,e){const t=n.verification?.model;if(typeof t=="string")return t.length>0?t:void 0;if(t&&typeof t=="object"){const r=t[e];return typeof r=="string"&&r.length>0?r:void 0}}o(Ae,"getVerificationModel");function ve(n,e){if(!Object.prototype.hasOwnProperty.call(n,"telemetry"))return;const t=n.telemetry;if(t===null||typeof t!="object"||Array.isArray(t))throw new Error(`Invalid IronBee config in ${e}: 'telemetry' must be an object. Expected shape: { "enable": boolean }.`);const r=t;if(Object.prototype.hasOwnProperty.call(r,"enable")&&typeof r.enable!="boolean")throw new Error(`Invalid IronBee config in ${e}: 'telemetry.enable' must be boolean. Got ${typeof r.enable}.`)}o(ve,"assertTelemetryShape");function Ie(n,e){if(!Object.prototype.hasOwnProperty.call(n,"privacy"))return;const t=n.privacy;if(t===null||typeof t!="object"||Array.isArray(t))throw new Error(`Invalid IronBee config in ${e}: 'privacy' must be an object. Expected shape: { "enable": boolean }.`);const r=t;if(Object.prototype.hasOwnProperty.call(r,"enable")&&typeof r.enable!="boolean")throw new Error(`Invalid IronBee config in ${e}: 'privacy.enable' must be boolean. Got ${typeof r.enable}.`)}o(Ie,"assertPrivacyShape");function _(n,e){if(!(n===void 0&&e===void 0))return{...n??{},...e??{}}}o(_,"mergeCycleConfig");function B(n,e){const t={...n,...e};return t.browser=_(n.browser,e.browser),t.node=_(n.node,e.node),t.backend=_(n.backend,e.backend),t.android=_(n.android,e.android),t.claude=we(n.claude,e.claude),t.codex=je(n.codex,e.codex),t.verification=xe(n.verification,e.verification),t.verificationContext=Te(n.verificationContext,e.verificationContext),t}o(B,"mergeConfigLayers");function Te(n,e){if(!(n===void 0&&e===void 0))return{...n??{},...e??{}}}o(Te,"mergeVerificationContextConfig");function xe(n,e){if(!(n===void 0&&e===void 0))return{...n??{},...e??{}}}o(xe,"mergeVerificationConfig");function we(n,e){if(n===void 0&&e===void 0)return;const t={...n??{},...e??{}};return(n?.oauthAccess!==void 0||e?.oauthAccess!==void 0)&&(t.oauthAccess={...n?.oauthAccess??{},...e?.oauthAccess??{}}),(n?.autoModeAllowlist!==void 0||e?.autoModeAllowlist!==void 0)&&(t.autoModeAllowlist={...n?.autoModeAllowlist??{},...e?.autoModeAllowlist??{}}),t}o(we,"mergeClaudeConfig");function je(n,e){if(n===void 0&&e===void 0)return;const t={...n??{},...e??{}};return(n?.verifier!==void 0||e?.verifier!==void 0)&&(t.verifier={...n?.verifier??{},...e?.verifier??{}}),t}o(je,"mergeCodexConfig");function w(n){return{global:(0,b.join)((0,I.homedir)(),".ironbee","config.json"),project:n?(0,b.join)(n,".ironbee","config.json"):void 0,local:n?(0,b.join)(n,".ironbee","config.local.json"):void 0}}o(w,"getConfigLayerPaths");const Re=["global","project","local"];function Oe(n,e){const t=w(e);if(n==="global")return t.global;if(n==="project"){if(t.project===void 0)throw new Error("Project layer requested but no projectDir was provided.");return t.project}if(t.local===void 0)throw new Error("Local layer requested but no projectDir was provided.");return t.local}o(Oe,"getTargetConfigPath");function he(n){if(n.global===!0&&n.local===!0)throw new Error("Pass at most one of --global / --local.");return n.global===!0?"global":n.local===!0?"local":"project"}o(he,"resolveConfigTargetFromFlags");function A(n){const e=k(n);return(0,E.existsSync)(n)&&(me(e,n),ve(e,n),Ie(e,n)),e}o(A,"loadAndValidateLayer");const j=[{envVar:"IRONBEE_API_KEY",configPath:"collector.apiKey"},{envVar:"IRONBEE_OAUTH_TOKEN",configPath:"collector.oauthToken"}];function ke(n,e,t){const r=e.split(".");let i=n;for(let s=0;s<r.length-1;s++){const l=r[s],a=i[l];a!=null&&typeof a=="object"&&!Array.isArray(a)?i[l]={...a}:i[l]={},i=i[l]}i[r[r.length-1]]=t}o(ke,"setAtConfigPath");function z(n){let e;for(const t of j){const r=process.env[t.envVar];if(r===void 0||r.length===0)continue;e===void 0&&(e={...n});const i=t.coerce?t.coerce(r):r;ke(e,t.configPath,i)}return e??n}o(z,"applyEnvOverrides");function Be(n){for(const e of j){if(e.configPath!==n)continue;const t=process.env[e.envVar];if(t!==void 0&&t.length>0)return e}}o(Be,"findActiveEnvOverride");function c(n){const e=w(n),t=A(e.global),r=e.project?A(e.project):{},i=e.local?A(e.local):{},s=B(B(t,r),i);return z(s)}o(c,"loadConfig");function Se(n){let e=n.replace(/\{([^}]+)\}/g,(t,r)=>`(${r.split(",").map(i=>i.trim()).join("|")})`);return e=e.replace(/\*\*\//g,"\0DSS\0").replace(/\*\*/g,"\0DS\0").replace(/\*/g,"\0SS\0").replace(/\?/g,"\0QM\0"),e=e.replace(/[.+^$\\[\]]/g,"\\$&"),e=e.replace(/\x00DSS\x00/g,"(?:.*/)?").replace(/\x00DS\x00/g,".*").replace(/\x00SS\x00/g,"[^/]*").replace(/\x00QM\x00/g,"[^/]"),new RegExp(`(^|/)${e}$`)}o(Se,"globToRegExp");function C(n,e){const t=n.replace(/\\/g,"/");for(const r of e)if(Se(r).test(t))return!0;return!1}o(C,"matchesAny");function Le(n,e){if(e==="browser")return n.browser;if(e==="node")return n.node;if(e==="backend")return n.backend;if(e==="android")return n.android}o(Le,"getCycleBlock");function v(n,e){const t=Le(n,e);if(t!==void 0&&t.enable===!1)return[];const r=$[e]??[];if(t===void 0)return P.has(e)?[...r]:[];if(Array.isArray(t.verifyPatterns)&&t.verifyPatterns.length===0)return[];const i=t.verifyPatterns??r,s=t.additionalVerifyPatterns??[];return[...i,...s]}o(v,"getCyclePatterns");function J(n,e){const t=x(e);if(t.length>0&&C(n,t))return[];const r=[];C(n,v(e,"browser"))&&r.push("browser");for(const i of T){const s=v(e,i);s.length>0&&C(n,s)&&r.push(i)}return r}o(J,"getActiveCycles");function Ne(n,e){return J(n,e).length>0}o(Ne,"requiresVerification");function De(n,e){return O(n)?Z(n,e):!1}o(De,"isCycleEnabled");function Z(n,e){return v(n,e).length>0}o(Z,"isCyclePatternsActive");function Pe(n,e){let t,r;if(e==="browser"?(t=n.browser?.alwaysRequired??K,r=n.browser?.evidencePaths??[]):e==="node"?(t=n.node?.alwaysRequired??Y,r=n.node?.evidencePaths??X):e==="backend"?(t=n.backend?.alwaysRequired??H,r=n.backend?.evidencePaths??G):e==="android"?(t=n.android?.alwaysRequired??W,r=n.android?.evidencePaths??Q):(t=[],r=[]),t.length===0&&r.length===0)throw new Error(`Invalid required-tools config for cycle '${e}': both 'alwaysRequired' and 'evidencePaths' are empty. At least one must specify required tools.`);return{alwaysRequired:t,evidencePaths:r}}o(Pe,"getRequiredToolsConfig");const S="npx",Me="^0.13.0",L=["-y",`@ironbee-ai/devtools@${Me}`],Fe={TOOL_NAME_PREFIX:"bdt_",TOOL_INPUT_METADATA_ENABLE:"true"},Ve={PLATFORM:"node",TOOL_NAME_PREFIX:"ndt_",TOOL_INPUT_METADATA_ENABLE:"true"},Ue={PLATFORM:"backend",TOOL_NAME_PREFIX:"bedt_",TOOL_INPUT_METADATA_ENABLE:"true"},$e={PLATFORM:"android",TOOL_NAME_PREFIX:"adt_",TOOL_INPUT_METADATA_ENABLE:"true"},qe={BROWSER_DEVTOOLS_INSTALL_CHROMIUM:"true"},Ke={},Ye={},Xe={};function He(n){return ce(n)?{}:{TELEMETRY_ENABLE:"false"}}o(He,"buildTelemetryEnv");function Ge(n){return le(n)?{COLLECTOR_EVENTS_TOOL_DETAILS_ENABLE:"false",COLLECTOR_ARTIFACTS_ENABLE:"false"}:{}}o(Ge,"buildPrivacyEnv");function We(n,e){if(!R(n))return{};const t=n.collector,i=k((0,b.join)((0,I.homedir)(),".ironbee","config.json")).collector??{},s=typeof i.oauthToken=="string"&&i.oauthToken.length>0,l=typeof i.apiKey=="string"&&i.apiKey.length>0;let a;t.oauthToken?a=s?"X-OAuth-Token=${file:~/.ironbee/config.json#collector.oauthToken}":`X-OAuth-Token=${t.oauthToken}`:a=l?"X-API-Key=${file:~/.ironbee/config.json#collector.apiKey}":`X-API-Key=${t.apiKey}`;const u={OTEL_ENABLE:"true",OTEL_EXPORTER_HTTP_URL:t.url,OTEL_EXPORTER_HTTP_HEADERS:a,OTEL_EXPORTER_TYPE:"otlp/http-protobuf"};return e==="browser"&&(u.OTEL_INSTRUMENTATION_USER_INTERACTION_EVENTS="change,input,click",u.BROWSER_HEADLESS_ENABLE="true"),u}o(We,"buildOTELEnv");function m(n,e,t,r,i){const s=We(n,i),l=He(n),a=Ge(n),u=n[e];if(u&&typeof u=="object"&&!Array.isArray(u)){const f=u;if(f.mcp&&typeof f.mcp=="object"&&!Array.isArray(f.mcp)){const g={...f.mcp},d={...s,...l,...a,...g.env??{},...t};return g.env=d,g}const h={};if(f.env&&typeof f.env=="object"&&!Array.isArray(f.env)){const g=f.env;for(const d of Object.keys(g))typeof g[d]=="string"&&(h[d]=g[d])}return{command:S,args:[...L],env:{...r,...s,...l,...a,...h,...t}}}return{command:S,args:[...L],env:{...r,...s,...l,...a,...t}}}o(m,"buildMcpEntry");function Qe(n){const e=c(n);return m(e,"browserDevTools",Fe,qe,"browser")}o(Qe,"getMcpServerEntry");function ze(n){const e=c(n);return m(e,"nodeDevTools",Ve,Ke,"node")}o(ze,"getNodeDevToolsMcpEntry");function Je(n){const e=c(n);return m(e,"backendDevTools",Ue,Ye,"backend")}o(Je,"getBackendDevToolsMcpEntry");function Ze(n){const e=c(n);return m(e,"androidDevTools",$e,Xe,"android")}o(Ze,"getAndroidDevToolsMcpEntry");function en(n){return typeof n.maxRetries=="number"&&n.maxRetries>0?n.maxRetries:Ce}o(en,"getMaxRetries");function R(n){if(process.env.IRONBEE_COLLECTOR==="false")return!1;const e=n.collector;if(!e||e.enable===!1||typeof e.url!="string"||e.url.length===0)return!1;const t=typeof e.oauthToken=="string"&&e.oauthToken.length>0,r=typeof e.apiKey=="string"&&e.apiKey.length>0;return!(!t&&!r)}o(R,"isCollectorConfigured");function nn(n){const e=c(n);return p(e,e.jobQueue)}o(nn,"isJobQueueEnabled");function tn(n){const e=c(n);return p(e,e.recording)}o(tn,"isRecordingEnabled");function on(n){return p(n,n.statusLine)}o(on,"isSessionStatusEnabled");function rn(n){const e=n.statusLine;return e!==void 0&&e.renderDefault===!0}o(rn,"getStatusLineRenderDefault");function sn(n){const e=n.statusLine?.emitMinIntervalSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:10}o(sn,"getStatusLineEmitMinIntervalSeconds");const ee=60;function an(n){return n.claude?.oauthAccess?.enable!==!1}o(an,"getClaudeOauthAccessEnabled");function cn(n){return n.codex?.verifier?.mode==="main-agent"?"main-agent":"sub-agent"}o(cn,"getCodexVerifierMode");function ln(n){return n.claude?.autoModeAllowlist?.enable!==!1}o(ln,"isAutoModeAllowlistEnabled");function un(n){const e=n.claude?.oauthAccess?.usageTtlSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:ee}o(un,"getClaudeOauthAccessUsageTtlSeconds");const ne=15986,te=600,oe=30,re=0;function fn(n){return p(n,n.otel)}o(fn,"isOTELEnabled");function gn(n){const e=n.otel?.port;return typeof e=="number"&&Number.isInteger(e)&&e>0&&e<65536?e:ne}o(gn,"getOTELPort");function dn(n){const e=n.otel?.idleTimeoutSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>0?e:te}o(dn,"getOTELIdleTimeoutSeconds");function pn(n){const e=n.otel?.ensureMinIntervalSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:oe}o(pn,"getOTELEnsureMinIntervalSeconds");function bn(n){const e=n.otel?.emitMinIntervalSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:re}o(bn,"getOTELEmitMinIntervalSeconds");function En(n){const e=n.statusLine?.refreshInterval;if(typeof e=="number"&&Number.isFinite(e)&&e>=1)return e}o(En,"getStatusLineRefreshInterval");function p(n,e){return e!=null&&typeof e=="object"&&!Array.isArray(e)?e.enable!==!1:R(n)}o(p,"isFeatureEnabledWithCollectorAutoEnable");function Ln(n){return n==null||typeof n!="object"||Array.isArray(n)?!1:n.enable!==!1}o(Ln,"isPresenceEnabled");function O(n){const e=n.verification;return e==null||typeof e!="object"||Array.isArray(e)?!0:e.enable!==!1}o(O,"getVerificationEnabled");function ie(n){const e=n.verification;return e==null||typeof e!="object"||Array.isArray(e)?!1:e.auto===!0}o(ie,"getAutoVerifyEnabled");function yn(n){const e=n.verification;return e==null||typeof e!="object"||Array.isArray(e)?!1:e.strict===!0}o(yn,"getVerificationStrict");const se=65536,ae=1;function _n(n){const e=n.verificationContext;return e==null||typeof e!="object"||Array.isArray(e)?!0:e.enable!==!1}o(_n,"getVerificationContextEnabled");function Cn(n){return n.verificationContext?.source==="actions"?"actions":"git"}o(Cn,"getVerificationContextSource");function mn(n){const e=n.verificationContext?.commitDepth;return typeof e=="number"&&Number.isFinite(e)&&e>=0?Math.floor(e):ae}o(mn,"getVerificationContextCommitDepth");function An(n){const e=n.verificationContext?.maxBytes;return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.floor(e):se}o(An,"getVerificationContextMaxBytes");function vn(n,e){const t=x(n);return t.length>0&&C(e,t)}o(vn,"isIgnoredVerifyPath");function In(n){return O(n)?ie(n)?"enforce":"assist":"monitor"}o(In,"getVerificationMode");function ce(n){const e=n.telemetry;return e==null||typeof e!="object"||Array.isArray(e)?!0:e.enable!==!1}o(ce,"getTelemetryEnabled");function le(n){const e=n.privacy;return e==null||typeof e!="object"||Array.isArray(e)?!1:e.enable===!0}o(le,"getPrivacyEnabled");const N=65536;function Tn(n){const e=n.fileChange;return!e||typeof e!="object"||Array.isArray(e)?!1:e.captureChangeset===!0}o(Tn,"getCaptureFileChangeset");function xn(n){const e=n.fileChange;if(!e||typeof e!="object"||Array.isArray(e))return N;const t=e.maxChangesetBytes;return typeof t!="number"||!Number.isFinite(t)||t<=0?N:Math.floor(t)}o(xn,"getMaxChangesetBytes");function wn(n){const e=c(n);return p(e,e.analytics)}o(wn,"isAnalyticsEnabled");function jn(n){const t=c(n).analytics;return t===null||typeof t!="object"||Array.isArray(t)?!0:t.emitOnStop!==!1}o(jn,"isAnalyticsEmitOnStopEnabled");function Rn(n){const t=c(n).analytics;if(t===null||typeof t!="object"||Array.isArray(t))return 0;const r=t.emitOnStopMinIntervalSeconds;return typeof r=="number"&&r>=0?r:0}o(Rn,"getAnalyticsEmitOnStopMinIntervalSeconds");function On(n){const t=c(n).analytics;return t===null||typeof t!="object"||Array.isArray(t)?!1:t.emitTurnEvents===!0}o(On,"isAnalyticsTurnEventsEnabled");function hn(n){const t=c(n).analytics;return t===null||typeof t!="object"||Array.isArray(t)?!1:t.emitStepEvents===!0}o(hn,"isAnalyticsStepEventsEnabled");function kn(n){const t=c(n).analytics;return t===null||typeof t!="object"||Array.isArray(t)?!0:t.emitApiRequestEvents!==!1}o(kn,"isAnalyticsApiRequestEventsEnabled");0&&(module.exports={ALL_CYCLES,CONFIG_TARGETS_BY_PRECEDENCE,CYCLES_ENABLED_BY_DEFAULT,CYCLE_DEFAULT_VERIFY_PATTERNS,CYCLE_TOOL_PREFIXES,CYCLE_TO_SERVER,DEFAULT_ANDROID_ALWAYS_REQUIRED,DEFAULT_ANDROID_EVIDENCE_PATHS,DEFAULT_ANDROID_VERIFY_PATTERNS,DEFAULT_BACKEND_ALWAYS_REQUIRED,DEFAULT_BACKEND_EVIDENCE_PATHS,DEFAULT_BACKEND_VERIFY_PATTERNS,DEFAULT_BROWSER_ALWAYS_REQUIRED,DEFAULT_BROWSER_VERIFY_PATTERNS,DEFAULT_IGNORED_VERIFY_PATTERNS,DEFAULT_NODE_ALWAYS_REQUIRED,DEFAULT_NODE_EVIDENCE_PATHS,DEFAULT_NODE_VERIFY_PATTERNS,DEFAULT_OAUTH_USAGE_TTL_SECONDS,DEFAULT_OTEL_EMIT_MIN_INTERVAL_SECONDS,DEFAULT_OTEL_ENSURE_MIN_INTERVAL_SECONDS,DEFAULT_OTEL_IDLE_TIMEOUT_SECONDS,DEFAULT_OTEL_PORT,DEFAULT_VERIFICATION_CONTEXT_COMMIT_DEPTH,DEFAULT_VERIFICATION_CONTEXT_MAX_BYTES,ENV_OVERRIDES,OPTIONAL_CYCLES,applyEnvOverrides,findActiveEnvOverride,getActiveCycles,getAnalyticsEmitOnStopMinIntervalSeconds,getAndroidDevToolsMcpEntry,getAutoVerifyEnabled,getBackendDevToolsMcpEntry,getCaptureFileChangeset,getClaudeOauthAccessEnabled,getClaudeOauthAccessUsageTtlSeconds,getCodexVerifierMode,getConfigLayerPaths,getMaxChangesetBytes,getMaxRetries,getMcpServerEntry,getNodeDevToolsMcpEntry,getOTELEmitMinIntervalSeconds,getOTELEnsureMinIntervalSeconds,getOTELIdleTimeoutSeconds,getOTELPort,getPrivacyEnabled,getRequiredToolsConfig,getStatusLineEmitMinIntervalSeconds,getStatusLineRefreshInterval,getStatusLineRenderDefault,getTargetConfigPath,getTelemetryEnabled,getVerificationContextCommitDepth,getVerificationContextEnabled,getVerificationContextMaxBytes,getVerificationContextSource,getVerificationEnabled,getVerificationMode,getVerificationModel,getVerificationStrict,isAnalyticsApiRequestEventsEnabled,isAnalyticsEmitOnStopEnabled,isAnalyticsEnabled,isAnalyticsStepEventsEnabled,isAnalyticsTurnEventsEnabled,isAutoModeAllowlistEnabled,isCollectorConfigured,isCycleEnabled,isCyclePatternsActive,isIgnoredVerifyPath,isJobQueueEnabled,isOTELEnabled,isRecordingEnabled,isSessionStatusEnabled,loadConfig,requiresVerification,resolveConfigTargetFromFlags,resolveIgnoredVerifyPatterns});
|
|
1
|
+
"use strict";var _=Object.defineProperty;var ue=Object.getOwnPropertyDescriptor;var fe=Object.getOwnPropertyNames;var ge=Object.prototype.hasOwnProperty;var o=(n,e)=>_(n,"name",{value:e,configurable:!0});var de=(n,e)=>{for(var t in e)_(n,t,{get:e[t],enumerable:!0})},pe=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of fe(e))!ge.call(n,i)&&i!==t&&_(n,i,{get:()=>e[i],enumerable:!(r=ue(e,i))||r.enumerable});return n};var be=n=>pe(_({},"__esModule",{value:!0}),n);var Ln={};de(Ln,{ALL_CYCLES:()=>Ee,CONFIG_TARGETS_BY_PRECEDENCE:()=>Oe,CYCLES_ENABLED_BY_DEFAULT:()=>P,CYCLE_DEFAULT_VERIFY_PATTERNS:()=>q,CYCLE_TOOL_PREFIXES:()=>_e,CYCLE_TO_SERVER:()=>ye,DEFAULT_ANDROID_ALWAYS_REQUIRED:()=>G,DEFAULT_ANDROID_EVIDENCE_PATHS:()=>Q,DEFAULT_ANDROID_VERIFY_PATTERNS:()=>U,DEFAULT_BACKEND_ALWAYS_REQUIRED:()=>H,DEFAULT_BACKEND_EVIDENCE_PATHS:()=>W,DEFAULT_BACKEND_VERIFY_PATTERNS:()=>V,DEFAULT_BROWSER_ALWAYS_REQUIRED:()=>K,DEFAULT_BROWSER_VERIFY_PATTERNS:()=>M,DEFAULT_IGNORED_VERIFY_PATTERNS:()=>$,DEFAULT_NODE_ALWAYS_REQUIRED:()=>Y,DEFAULT_NODE_EVIDENCE_PATHS:()=>X,DEFAULT_NODE_VERIFY_PATTERNS:()=>F,DEFAULT_OAUTH_USAGE_TTL_SECONDS:()=>ee,DEFAULT_OTEL_EMIT_MIN_INTERVAL_SECONDS:()=>re,DEFAULT_OTEL_ENSURE_MIN_INTERVAL_SECONDS:()=>oe,DEFAULT_OTEL_IDLE_TIMEOUT_SECONDS:()=>te,DEFAULT_OTEL_PORT:()=>ne,DEFAULT_VERIFICATION_CONTEXT_COMMIT_DEPTH:()=>ae,DEFAULT_VERIFICATION_CONTEXT_MAX_BYTES:()=>se,ENV_OVERRIDES:()=>R,OPTIONAL_CYCLES:()=>T,applyEnvOverrides:()=>z,findActiveEnvOverride:()=>Se,getActiveCycles:()=>J,getAnalyticsEmitOnStopMinIntervalSeconds:()=>kn,getAndroidDevToolsMcpEntry:()=>en,getAutoVerifyEnabled:()=>ie,getBackendDevToolsMcpEntry:()=>Ze,getCaptureFileChangeset:()=>wn,getClaudeOauthAccessEnabled:()=>cn,getClaudeOauthAccessUsageTtlSeconds:()=>gn,getCodexVerifierMode:()=>ln,getConfigLayerPaths:()=>w,getMaxChangesetBytes:()=>Rn,getMaxRetries:()=>nn,getMcpServerEntry:()=>ze,getNodeDevToolsMcpEntry:()=>Je,getOTELEmitMinIntervalSeconds:()=>yn,getOTELEnsureMinIntervalSeconds:()=>En,getOTELIdleTimeoutSeconds:()=>bn,getOTELPort:()=>pn,getPrivacyEnabled:()=>le,getRequiredToolsConfig:()=>Me,getStatusLineEmitMinIntervalSeconds:()=>an,getStatusLineRefreshInterval:()=>_n,getStatusLineRenderDefault:()=>sn,getTargetConfigPath:()=>ke,getTelemetryEnabled:()=>ce,getVerificationContextCommitDepth:()=>vn,getVerificationContextEnabled:()=>mn,getVerificationContextMaxBytes:()=>In,getVerificationContextSource:()=>An,getVerificationEnabled:()=>O,getVerificationMode:()=>xn,getVerificationModel:()=>Ae,getVerificationStrict:()=>Cn,isAnalyticsApiRequestEventsEnabled:()=>Sn,isAnalyticsEmitOnStopEnabled:()=>On,isAnalyticsEnabled:()=>jn,isAnalyticsStepEventsEnabled:()=>Bn,isAnalyticsTurnEventsEnabled:()=>hn,isAutoModeAllowlistEnabled:()=>un,isClaudeTrustWorkspaceEnabled:()=>fn,isCollectorConfigured:()=>j,isCycleEnabled:()=>Pe,isCyclePatternsActive:()=>Z,isIgnoredVerifyPath:()=>Tn,isJobQueueEnabled:()=>tn,isOTELEnabled:()=>dn,isRecordingEnabled:()=>on,isSessionStatusEnabled:()=>rn,loadConfig:()=>c,matchesAny:()=>E,requiresVerification:()=>De,resolveConfigTargetFromFlags:()=>he,resolveIgnoredVerifyPatterns:()=>x});module.exports=be(Ln);var y=require("fs"),b=require("path"),I=require("os"),D=require("./logger");const T=["node","backend","android"],Ee=["browser",...T],P=new Set(["browser"]),ye={browser:"browser-devtools",node:"node-devtools",backend:"backend-devtools",android:"android-devtools"},_e={browser:"bdt_",node:"ndt_",backend:"bedt_",android:"adt_"},M=["*.ts","*.tsx","*.js","*.jsx","*.mjs","*.cjs","*.vue","*.svelte","*.html","*.htm","*.css","*.scss","*.sass","*.less","*.styl","*.py","*.rb","*.erb","*.go","*.rs","*.java","*.kt","*.kts","*.swift","*.c","*.cpp","*.h","*.hpp","*.cs","*.php","*.dart","*.ex","*.exs","*.erl","*.lua","*.r","*.R","*.scala","*.clj","*.cljs","*.zig","*.nim","*.hbs","*.ejs","*.pug","*.jade","*.astro"],F=["server/**/*.{ts,js,mjs,cjs}","src/server/**/*.{ts,js,mjs,cjs}","backend/**/*.{ts,js,mjs,cjs}","api/**/*.{ts,js,mjs,cjs}","src/api/**/*.{ts,js,mjs,cjs}","pages/api/**/*.{ts,js,mjs,cjs}","app/api/**/*.{ts,js,mjs,cjs}","routes/**/*.{ts,js,mjs,cjs}","**/server.{ts,js,mjs,cjs}"],V=["server/**/*.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","src/server/**/*.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","backend/**/*.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","api/**/*.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","src/api/**/*.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","pages/api/**/*.{ts,js,mjs,cjs}","app/api/**/*.{ts,js,mjs,cjs}","routes/**/*.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","controllers/**/*.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","handlers/**/*.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","services/**/*.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","**/server.{ts,js,mjs,cjs,py,go,java,rb,cs,rs,kt,scala,ex,exs,php,clj}","**/main.{go,py,java,rb,kt,scala}"],U=["android/**/*.{kt,java}","app/src/**/*.{kt,java}","mobile/**/*.{kt,java}","src/main/kotlin/**/*.kt","src/main/java/**/*.java","**/*.{kt,java}","**/res/**/*.xml","**/AndroidManifest.xml"],q={browser:M,node:F,backend:V,android:U},$=["**/*.spec.*","**/*.test.*","**/__tests__/**","**/__mocks__/**"];function x(n){const e=n.ignoredVerifyPatterns??[];return[...$,...e]}o(x,"resolveIgnoredVerifyPatterns");const K=["bdt_navigation_go-to","bdt_content_take-screenshot","bdt_a11y_take-aria-snapshot","bdt_o11y_get-console-messages"],Y=["ndt_debug_connect"],X=[{name:"probe",allOf:[{anyOf:["ndt_debug_put-tracepoint","ndt_debug_put-logpoint","ndt_debug_put-exceptionpoint"]},"ndt_debug_get-probe-snapshots"]},{name:"log",allOf:["ndt_debug_get-logs"]}],H=[],W=[{name:"protocol-call",allOf:[{anyOf:["bedt_request_http","bedt_request_grpc","bedt_request_graphql","bedt_request_websocket-open","bedt_request_replay"]}]},{name:"log-evidence",allOf:["bedt_log_register-source",{anyOf:["bedt_log_read","bedt_log_read-multi","bedt_log_follow"]}]},{name:"db-evidence",allOf:["bedt_db_connect",{anyOf:["bedt_db_query","bedt_db_describe-table","bedt_db_list-tables","bedt_db_snapshot","bedt_db_diff","bedt_db_get-changes"]}]}],G=["adt_device_connect"],Q=[{name:"device-evidence",allOf:[{anyOf:["adt_device_launch-app","adt_interaction_tap","adt_interaction_double-tap","adt_interaction_long-press","adt_interaction_input-text","adt_interaction_swipe","adt_interaction_scroll","adt_interaction_press-key","adt_interaction_deep-link"]},"adt_content_take-screenshot","adt_a11y_take-ui-snapshot"]},{name:"log-evidence",allOf:[{anyOf:["adt_o11y_log-read","adt_o11y_log-follow"]}]},{name:"network-evidence",allOf:["adt_o11y_get-http-requests"]}],Ce=3;function h(n){if(!(0,y.existsSync)(n))return{};try{return JSON.parse((0,y.readFileSync)(n,"utf-8"))}catch(e){return D.logger.debug(`failed to parse config ${n}: ${e}`),{}}}o(h,"loadJsonFile");function me(n,e){if(!Object.prototype.hasOwnProperty.call(n,"verification"))return;const t=n.verification;if(t===null||typeof t!="object"||Array.isArray(t))throw new Error(`Invalid IronBee config in ${e}: 'verification' must be an object. Expected shape: { "enable": boolean }.`);const r=t;if(Object.prototype.hasOwnProperty.call(r,"enable")&&typeof r.enable!="boolean")throw new Error(`Invalid IronBee config in ${e}: 'verification.enable' must be boolean. Got ${typeof r.enable}.`);if(Object.prototype.hasOwnProperty.call(r,"auto")&&typeof r.auto!="boolean")throw new Error(`Invalid IronBee config in ${e}: 'verification.auto' must be boolean. Got ${typeof r.auto}.`);if(Object.prototype.hasOwnProperty.call(r,"strict")&&typeof r.strict!="boolean")throw new Error(`Invalid IronBee config in ${e}: 'verification.strict' must be boolean. Got ${typeof r.strict}.`);if(Object.prototype.hasOwnProperty.call(r,"model")){const i=r.model,s=typeof i=="string",l=i!==null&&typeof i=="object"&&!Array.isArray(i)&&Object.values(i).every(a=>typeof a=="string");if(!s&&!l)throw new Error(`Invalid IronBee config in ${e}: 'verification.model' must be a string (applies to all clients) or an object of string values (per-client, e.g. { "claude": "sonnet", "codex": "gpt-5.5" }). Got ${Array.isArray(i)?"array":typeof i}.`)}}o(me,"assertVerificationShape");function Ae(n,e){const t=n.verification?.model;if(typeof t=="string")return t.length>0?t:void 0;if(t&&typeof t=="object"){const r=t[e];return typeof r=="string"&&r.length>0?r:void 0}}o(Ae,"getVerificationModel");function ve(n,e){if(!Object.prototype.hasOwnProperty.call(n,"telemetry"))return;const t=n.telemetry;if(t===null||typeof t!="object"||Array.isArray(t))throw new Error(`Invalid IronBee config in ${e}: 'telemetry' must be an object. Expected shape: { "enable": boolean }.`);const r=t;if(Object.prototype.hasOwnProperty.call(r,"enable")&&typeof r.enable!="boolean")throw new Error(`Invalid IronBee config in ${e}: 'telemetry.enable' must be boolean. Got ${typeof r.enable}.`)}o(ve,"assertTelemetryShape");function Ie(n,e){if(!Object.prototype.hasOwnProperty.call(n,"privacy"))return;const t=n.privacy;if(t===null||typeof t!="object"||Array.isArray(t))throw new Error(`Invalid IronBee config in ${e}: 'privacy' must be an object. Expected shape: { "enable": boolean }.`);const r=t;if(Object.prototype.hasOwnProperty.call(r,"enable")&&typeof r.enable!="boolean")throw new Error(`Invalid IronBee config in ${e}: 'privacy.enable' must be boolean. Got ${typeof r.enable}.`)}o(Ie,"assertPrivacyShape");function C(n,e){if(!(n===void 0&&e===void 0))return{...n??{},...e??{}}}o(C,"mergeCycleConfig");function B(n,e){const t={...n,...e};return t.browser=C(n.browser,e.browser),t.node=C(n.node,e.node),t.backend=C(n.backend,e.backend),t.android=C(n.android,e.android),t.claude=Re(n.claude,e.claude),t.codex=je(n.codex,e.codex),t.verification=we(n.verification,e.verification),t.verificationContext=xe(n.verificationContext,e.verificationContext),t.runtime=Te(n.runtime,e.runtime),t}o(B,"mergeConfigLayers");function Te(n,e){if(!(n===void 0&&e===void 0))return{...n??{},...e??{}}}o(Te,"mergeRuntimeConfig");function xe(n,e){if(!(n===void 0&&e===void 0))return{...n??{},...e??{}}}o(xe,"mergeVerificationContextConfig");function we(n,e){if(!(n===void 0&&e===void 0))return{...n??{},...e??{}}}o(we,"mergeVerificationConfig");function Re(n,e){if(n===void 0&&e===void 0)return;const t={...n??{},...e??{}};return(n?.oauthAccess!==void 0||e?.oauthAccess!==void 0)&&(t.oauthAccess={...n?.oauthAccess??{},...e?.oauthAccess??{}}),(n?.autoModeAllowlist!==void 0||e?.autoModeAllowlist!==void 0)&&(t.autoModeAllowlist={...n?.autoModeAllowlist??{},...e?.autoModeAllowlist??{}}),t}o(Re,"mergeClaudeConfig");function je(n,e){if(n===void 0&&e===void 0)return;const t={...n??{},...e??{}};return(n?.verifier!==void 0||e?.verifier!==void 0)&&(t.verifier={...n?.verifier??{},...e?.verifier??{}}),t}o(je,"mergeCodexConfig");function w(n){return{global:(0,b.join)((0,I.homedir)(),".ironbee","config.json"),project:n?(0,b.join)(n,".ironbee","config.json"):void 0,local:n?(0,b.join)(n,".ironbee","config.local.json"):void 0}}o(w,"getConfigLayerPaths");const Oe=["global","project","local"];function ke(n,e){const t=w(e);if(n==="global")return t.global;if(n==="project"){if(t.project===void 0)throw new Error("Project layer requested but no projectDir was provided.");return t.project}if(t.local===void 0)throw new Error("Local layer requested but no projectDir was provided.");return t.local}o(ke,"getTargetConfigPath");function he(n){if(n.global===!0&&n.local===!0)throw new Error("Pass at most one of --global / --local.");return n.global===!0?"global":n.local===!0?"local":"project"}o(he,"resolveConfigTargetFromFlags");function A(n){const e=h(n);return(0,y.existsSync)(n)&&(me(e,n),ve(e,n),Ie(e,n)),e}o(A,"loadAndValidateLayer");const R=[{envVar:"IRONBEE_API_KEY",configPath:"collector.apiKey"},{envVar:"IRONBEE_OAUTH_TOKEN",configPath:"collector.oauthToken"}];function Be(n,e,t){const r=e.split(".");let i=n;for(let s=0;s<r.length-1;s++){const l=r[s],a=i[l];a!=null&&typeof a=="object"&&!Array.isArray(a)?i[l]={...a}:i[l]={},i=i[l]}i[r[r.length-1]]=t}o(Be,"setAtConfigPath");function z(n){let e;for(const t of R){const r=process.env[t.envVar];if(r===void 0||r.length===0)continue;e===void 0&&(e={...n});const i=t.coerce?t.coerce(r):r;Be(e,t.configPath,i)}return e??n}o(z,"applyEnvOverrides");function Se(n){for(const e of R){if(e.configPath!==n)continue;const t=process.env[e.envVar];if(t!==void 0&&t.length>0)return e}}o(Se,"findActiveEnvOverride");function c(n){const e=w(n),t=A(e.global),r=e.project?A(e.project):{},i=e.local?A(e.local):{},s=B(B(t,r),i);return z(s)}o(c,"loadConfig");function Le(n){let e=n.replace(/\{([^}]+)\}/g,(t,r)=>`(${r.split(",").map(i=>i.trim()).join("|")})`);return e=e.replace(/\*\*\//g,"\0DSS\0").replace(/\*\*/g,"\0DS\0").replace(/\*/g,"\0SS\0").replace(/\?/g,"\0QM\0"),e=e.replace(/[.+^$\\[\]]/g,"\\$&"),e=e.replace(/\x00DSS\x00/g,"(?:.*/)?").replace(/\x00DS\x00/g,".*").replace(/\x00SS\x00/g,"[^/]*").replace(/\x00QM\x00/g,"[^/]"),new RegExp(`(^|/)${e}$`)}o(Le,"globToRegExp");function E(n,e){const t=n.replace(/\\/g,"/");for(const r of e)if(Le(r).test(t))return!0;return!1}o(E,"matchesAny");function Ne(n,e){if(e==="browser")return n.browser;if(e==="node")return n.node;if(e==="backend")return n.backend;if(e==="android")return n.android}o(Ne,"getCycleBlock");function v(n,e){const t=Ne(n,e);if(t!==void 0&&t.enable===!1)return[];const r=q[e]??[];if(t===void 0)return P.has(e)?[...r]:[];if(Array.isArray(t.verifyPatterns)&&t.verifyPatterns.length===0)return[];const i=t.verifyPatterns??r,s=t.additionalVerifyPatterns??[];return[...i,...s]}o(v,"getCyclePatterns");function J(n,e){const t=x(e);if(t.length>0&&E(n,t))return[];const r=[];E(n,v(e,"browser"))&&r.push("browser");for(const i of T){const s=v(e,i);s.length>0&&E(n,s)&&r.push(i)}return r}o(J,"getActiveCycles");function De(n,e){return J(n,e).length>0}o(De,"requiresVerification");function Pe(n,e){return O(n)?Z(n,e):!1}o(Pe,"isCycleEnabled");function Z(n,e){return v(n,e).length>0}o(Z,"isCyclePatternsActive");function Me(n,e){let t,r;if(e==="browser"?(t=n.browser?.alwaysRequired??K,r=n.browser?.evidencePaths??[]):e==="node"?(t=n.node?.alwaysRequired??Y,r=n.node?.evidencePaths??X):e==="backend"?(t=n.backend?.alwaysRequired??H,r=n.backend?.evidencePaths??W):e==="android"?(t=n.android?.alwaysRequired??G,r=n.android?.evidencePaths??Q):(t=[],r=[]),t.length===0&&r.length===0)throw new Error(`Invalid required-tools config for cycle '${e}': both 'alwaysRequired' and 'evidencePaths' are empty. At least one must specify required tools.`);return{alwaysRequired:t,evidencePaths:r}}o(Me,"getRequiredToolsConfig");const S="npx",Fe="^0.14.0",L=["-y",`@ironbee-ai/devtools@${Fe}`],Ve={TOOL_NAME_PREFIX:"bdt_",TOOL_INPUT_METADATA_ENABLE:"true",SCENARIOS_DIR:".ironbee/scenarios/bdt"},Ue={PLATFORM:"node",TOOL_NAME_PREFIX:"ndt_",TOOL_INPUT_METADATA_ENABLE:"true",SCENARIOS_DIR:".ironbee/scenarios/ndt"},qe={PLATFORM:"backend",TOOL_NAME_PREFIX:"bedt_",TOOL_INPUT_METADATA_ENABLE:"true",SCENARIOS_DIR:".ironbee/scenarios/bedt"},$e={PLATFORM:"android",TOOL_NAME_PREFIX:"adt_",TOOL_INPUT_METADATA_ENABLE:"true",SCENARIOS_DIR:".ironbee/scenarios/adt"},Ke={BROWSER_DEVTOOLS_INSTALL_CHROMIUM:"true"},Ye={},Xe={},He={};function We(n){return ce(n)?{}:{TELEMETRY_ENABLE:"false"}}o(We,"buildTelemetryEnv");function Ge(n){return le(n)?{COLLECTOR_EVENTS_TOOL_DETAILS_ENABLE:"false",COLLECTOR_ARTIFACTS_ENABLE:"false"}:{}}o(Ge,"buildPrivacyEnv");function Qe(n,e){if(!j(n))return{};const t=n.collector,i=h((0,b.join)((0,I.homedir)(),".ironbee","config.json")).collector??{},s=typeof i.oauthToken=="string"&&i.oauthToken.length>0,l=typeof i.apiKey=="string"&&i.apiKey.length>0;let a;t.oauthToken?a=s?"X-OAuth-Token=${file:~/.ironbee/config.json#collector.oauthToken}":`X-OAuth-Token=${t.oauthToken}`:a=l?"X-API-Key=${file:~/.ironbee/config.json#collector.apiKey}":`X-API-Key=${t.apiKey}`;const u={OTEL_ENABLE:"true",OTEL_EXPORTER_HTTP_URL:t.url,OTEL_EXPORTER_HTTP_HEADERS:a,OTEL_EXPORTER_TYPE:"otlp/http-protobuf"};return e==="browser"&&(u.OTEL_INSTRUMENTATION_USER_INTERACTION_EVENTS="change,input,click",u.BROWSER_HEADLESS_ENABLE="true"),u}o(Qe,"buildOTELEnv");function m(n,e,t,r,i){const s=Qe(n,i),l=We(n),a=Ge(n),u=n[e];if(u&&typeof u=="object"&&!Array.isArray(u)){const f=u;if(f.mcp&&typeof f.mcp=="object"&&!Array.isArray(f.mcp)){const g={...f.mcp},d={...s,...l,...a,...g.env??{},...t};return g.env=d,g}const k={};if(f.env&&typeof f.env=="object"&&!Array.isArray(f.env)){const g=f.env;for(const d of Object.keys(g))typeof g[d]=="string"&&(k[d]=g[d])}return{command:S,args:[...L],env:{...r,...s,...l,...a,...k,...t}}}return{command:S,args:[...L],env:{...r,...s,...l,...a,...t}}}o(m,"buildMcpEntry");function ze(n){const e=c(n);return m(e,"browserDevTools",Ve,Ke,"browser")}o(ze,"getMcpServerEntry");function Je(n){const e=c(n);return m(e,"nodeDevTools",Ue,Ye,"node")}o(Je,"getNodeDevToolsMcpEntry");function Ze(n){const e=c(n);return m(e,"backendDevTools",qe,Xe,"backend")}o(Ze,"getBackendDevToolsMcpEntry");function en(n){const e=c(n);return m(e,"androidDevTools",$e,He,"android")}o(en,"getAndroidDevToolsMcpEntry");function nn(n){return typeof n.maxRetries=="number"&&n.maxRetries>0?n.maxRetries:Ce}o(nn,"getMaxRetries");function j(n){if(process.env.IRONBEE_COLLECTOR==="false")return!1;const e=n.collector;if(!e||e.enable===!1||typeof e.url!="string"||e.url.length===0)return!1;const t=typeof e.oauthToken=="string"&&e.oauthToken.length>0,r=typeof e.apiKey=="string"&&e.apiKey.length>0;return!(!t&&!r)}o(j,"isCollectorConfigured");function tn(n){const e=c(n);return p(e,e.jobQueue)}o(tn,"isJobQueueEnabled");function on(n){const e=c(n);return p(e,e.recording)}o(on,"isRecordingEnabled");function rn(n){return p(n,n.statusLine)}o(rn,"isSessionStatusEnabled");function sn(n){const e=n.statusLine;return e!==void 0&&e.renderDefault===!0}o(sn,"getStatusLineRenderDefault");function an(n){const e=n.statusLine?.emitMinIntervalSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:10}o(an,"getStatusLineEmitMinIntervalSeconds");const ee=60;function cn(n){return n.claude?.oauthAccess?.enable!==!1}o(cn,"getClaudeOauthAccessEnabled");function ln(n){return n.codex?.verifier?.mode==="main-agent"?"main-agent":"sub-agent"}o(ln,"getCodexVerifierMode");function un(n){return n.claude?.autoModeAllowlist?.enable!==!1}o(un,"isAutoModeAllowlistEnabled");function fn(n){return n.claude?.trustWorkspace?.enable!==!1}o(fn,"isClaudeTrustWorkspaceEnabled");function gn(n){const e=n.claude?.oauthAccess?.usageTtlSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:ee}o(gn,"getClaudeOauthAccessUsageTtlSeconds");const ne=15986,te=600,oe=30,re=0;function dn(n){return p(n,n.otel)}o(dn,"isOTELEnabled");function pn(n){const e=n.otel?.port;return typeof e=="number"&&Number.isInteger(e)&&e>0&&e<65536?e:ne}o(pn,"getOTELPort");function bn(n){const e=n.otel?.idleTimeoutSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>0?e:te}o(bn,"getOTELIdleTimeoutSeconds");function En(n){const e=n.otel?.ensureMinIntervalSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:oe}o(En,"getOTELEnsureMinIntervalSeconds");function yn(n){const e=n.otel?.emitMinIntervalSeconds;return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:re}o(yn,"getOTELEmitMinIntervalSeconds");function _n(n){const e=n.statusLine?.refreshInterval;if(typeof e=="number"&&Number.isFinite(e)&&e>=1)return e}o(_n,"getStatusLineRefreshInterval");function p(n,e){return e!=null&&typeof e=="object"&&!Array.isArray(e)?e.enable!==!1:j(n)}o(p,"isFeatureEnabledWithCollectorAutoEnable");function Dn(n){return n==null||typeof n!="object"||Array.isArray(n)?!1:n.enable!==!1}o(Dn,"isPresenceEnabled");function O(n){const e=n.verification;return e==null||typeof e!="object"||Array.isArray(e)?!0:e.enable!==!1}o(O,"getVerificationEnabled");function ie(n){const e=n.verification;return e==null||typeof e!="object"||Array.isArray(e)?!1:e.auto===!0}o(ie,"getAutoVerifyEnabled");function Cn(n){const e=n.verification;return e==null||typeof e!="object"||Array.isArray(e)?!1:e.strict===!0}o(Cn,"getVerificationStrict");const se=65536,ae=1;function mn(n){const e=n.verificationContext;return e==null||typeof e!="object"||Array.isArray(e)?!0:e.enable!==!1}o(mn,"getVerificationContextEnabled");function An(n){return n.verificationContext?.source==="actions"?"actions":"git"}o(An,"getVerificationContextSource");function vn(n){const e=n.verificationContext?.commitDepth;return typeof e=="number"&&Number.isFinite(e)&&e>=0?Math.floor(e):ae}o(vn,"getVerificationContextCommitDepth");function In(n){const e=n.verificationContext?.maxBytes;return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.floor(e):se}o(In,"getVerificationContextMaxBytes");function Tn(n,e){const t=x(n);return t.length>0&&E(e,t)}o(Tn,"isIgnoredVerifyPath");function xn(n){return O(n)?ie(n)?"enforce":"assist":"monitor"}o(xn,"getVerificationMode");function ce(n){const e=n.telemetry;return e==null||typeof e!="object"||Array.isArray(e)?!0:e.enable!==!1}o(ce,"getTelemetryEnabled");function le(n){const e=n.privacy;return e==null||typeof e!="object"||Array.isArray(e)?!1:e.enable===!0}o(le,"getPrivacyEnabled");const N=65536;function wn(n){const e=n.fileChange;return!e||typeof e!="object"||Array.isArray(e)?!1:e.captureChangeset===!0}o(wn,"getCaptureFileChangeset");function Rn(n){const e=n.fileChange;if(!e||typeof e!="object"||Array.isArray(e))return N;const t=e.maxChangesetBytes;return typeof t!="number"||!Number.isFinite(t)||t<=0?N:Math.floor(t)}o(Rn,"getMaxChangesetBytes");function jn(n){const e=c(n);return p(e,e.analytics)}o(jn,"isAnalyticsEnabled");function On(n){const t=c(n).analytics;return t===null||typeof t!="object"||Array.isArray(t)?!0:t.emitOnStop!==!1}o(On,"isAnalyticsEmitOnStopEnabled");function kn(n){const t=c(n).analytics;if(t===null||typeof t!="object"||Array.isArray(t))return 0;const r=t.emitOnStopMinIntervalSeconds;return typeof r=="number"&&r>=0?r:0}o(kn,"getAnalyticsEmitOnStopMinIntervalSeconds");function hn(n){const t=c(n).analytics;return t===null||typeof t!="object"||Array.isArray(t)?!1:t.emitTurnEvents===!0}o(hn,"isAnalyticsTurnEventsEnabled");function Bn(n){const t=c(n).analytics;return t===null||typeof t!="object"||Array.isArray(t)?!1:t.emitStepEvents===!0}o(Bn,"isAnalyticsStepEventsEnabled");function Sn(n){const t=c(n).analytics;return t===null||typeof t!="object"||Array.isArray(t)?!0:t.emitApiRequestEvents!==!1}o(Sn,"isAnalyticsApiRequestEventsEnabled");0&&(module.exports={ALL_CYCLES,CONFIG_TARGETS_BY_PRECEDENCE,CYCLES_ENABLED_BY_DEFAULT,CYCLE_DEFAULT_VERIFY_PATTERNS,CYCLE_TOOL_PREFIXES,CYCLE_TO_SERVER,DEFAULT_ANDROID_ALWAYS_REQUIRED,DEFAULT_ANDROID_EVIDENCE_PATHS,DEFAULT_ANDROID_VERIFY_PATTERNS,DEFAULT_BACKEND_ALWAYS_REQUIRED,DEFAULT_BACKEND_EVIDENCE_PATHS,DEFAULT_BACKEND_VERIFY_PATTERNS,DEFAULT_BROWSER_ALWAYS_REQUIRED,DEFAULT_BROWSER_VERIFY_PATTERNS,DEFAULT_IGNORED_VERIFY_PATTERNS,DEFAULT_NODE_ALWAYS_REQUIRED,DEFAULT_NODE_EVIDENCE_PATHS,DEFAULT_NODE_VERIFY_PATTERNS,DEFAULT_OAUTH_USAGE_TTL_SECONDS,DEFAULT_OTEL_EMIT_MIN_INTERVAL_SECONDS,DEFAULT_OTEL_ENSURE_MIN_INTERVAL_SECONDS,DEFAULT_OTEL_IDLE_TIMEOUT_SECONDS,DEFAULT_OTEL_PORT,DEFAULT_VERIFICATION_CONTEXT_COMMIT_DEPTH,DEFAULT_VERIFICATION_CONTEXT_MAX_BYTES,ENV_OVERRIDES,OPTIONAL_CYCLES,applyEnvOverrides,findActiveEnvOverride,getActiveCycles,getAnalyticsEmitOnStopMinIntervalSeconds,getAndroidDevToolsMcpEntry,getAutoVerifyEnabled,getBackendDevToolsMcpEntry,getCaptureFileChangeset,getClaudeOauthAccessEnabled,getClaudeOauthAccessUsageTtlSeconds,getCodexVerifierMode,getConfigLayerPaths,getMaxChangesetBytes,getMaxRetries,getMcpServerEntry,getNodeDevToolsMcpEntry,getOTELEmitMinIntervalSeconds,getOTELEnsureMinIntervalSeconds,getOTELIdleTimeoutSeconds,getOTELPort,getPrivacyEnabled,getRequiredToolsConfig,getStatusLineEmitMinIntervalSeconds,getStatusLineRefreshInterval,getStatusLineRenderDefault,getTargetConfigPath,getTelemetryEnabled,getVerificationContextCommitDepth,getVerificationContextEnabled,getVerificationContextMaxBytes,getVerificationContextSource,getVerificationEnabled,getVerificationMode,getVerificationModel,getVerificationStrict,isAnalyticsApiRequestEventsEnabled,isAnalyticsEmitOnStopEnabled,isAnalyticsEnabled,isAnalyticsStepEventsEnabled,isAnalyticsTurnEventsEnabled,isAutoModeAllowlistEnabled,isClaudeTrustWorkspaceEnabled,isCollectorConfigured,isCycleEnabled,isCyclePatternsActive,isIgnoredVerifyPath,isJobQueueEnabled,isOTELEnabled,isRecordingEnabled,isSessionStatusEnabled,loadConfig,matchesAny,requiresVerification,resolveConfigTargetFromFlags,resolveIgnoredVerifyPatterns});
|
package/dist/lib/git.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var u=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var i=(n,t)=>u(n,"name",{value:t,configurable:!0});var x=(n,t)=>{for(var r in t)u(n,r,{get:t[r],enumerable:!0})},y=(n,t,r,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of h(t))!b.call(n,o)&&o!==r&&u(n,o,{get:()=>t[o],enumerable:!(e=p(t,o))||e.enumerable});return n};var v=n=>y(u({},"__esModule",{value:!0}),n);var S={};x(S,{getChangedPaths:()=>C,getChangedPathsRelative:()=>A,gitChangedPathsSince:()=>w,gitCommitExists:()=>E,isGitRepo:()=>m});module.exports=v(S);var c=require("child_process"),f=require("path"),d=require("./logger");const z=5e3;function s(n,t){try{return(0,c.execFileSync)("git",["-c","core.quotePath=false",...t],{cwd:n,encoding:"utf-8",timeout:z,stdio:["ignore","pipe","ignore"],maxBuffer:16777216})}catch(r){return d.logger.debug(`git ${t.join(" ")} failed: ${r instanceof Error?r.message:r}`),null}}i(s,"runGit");function l(n){return n===null?[]:n.split("\0").filter(t=>t.length>0)}i(l,"splitNul");function m(n){const t=s(n,["rev-parse","--is-inside-work-tree"]);return t!==null&&t.trim()==="true"}i(m,"isGitRepo");function E(n,t){return t.length===0?!1:s(n,["cat-file","-e",`${t}^{commit}`])!==null}i(E,"gitCommitExists");function w(n,t){return l(s(n,["diff","--name-only","-M","-z",t]))}i(w,"gitChangedPathsSince");function a(n,t){const r=new Set;for(const e of l(s(n,["diff","--name-only","-z"])))r.add(e);for(const e of l(s(n,["diff","--name-only","-z","--cached"])))r.add(e);for(const e of l(s(n,["ls-files","--others","--exclude-standard","-z"])))r.add(e);if(t>0){const e=s(n,["diff","--name-only","-z",`HEAD~${t}`,"HEAD"]);if(e!==null)for(const o of l(e))r.add(o);else for(const o of l(s(n,["show","--name-only","--format=","-z","HEAD"])))r.add(o)}return Array.from(r)}i(a,"collectChangedRelative");function A(n,t){return m(n)?a(n,t):null}i(A,"getChangedPathsRelative");function C(n,t){const r=s(n,["rev-parse","--show-toplevel"]);if(r===null)return null;const e=r.trim();if(e.length===0)return null;const o=[];for(const g of a(n,t))o.push((0,f.isAbsolute)(g)?g:(0,f.join)(e,g));return o}i(C,"getChangedPaths");0&&(module.exports={getChangedPaths,getChangedPathsRelative,gitChangedPathsSince,gitCommitExists,isGitRepo});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var r=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var L=(e,S)=>{for(var o in S)r(e,o,{get:S[o],enumerable:!0})},N=(e,S,o,t)=>{if(S&&typeof S=="object"||typeof S=="function")for(let n of E(S))!I.call(e,n)&&n!==o&&r(e,n,{get:()=>S[n],enumerable:!(t=A(S,n))||t.enumerable});return e};var _=e=>N(r({},"__esModule",{value:!0}),e);var c={};L(c,{INSTALL_SCHEMA_VERSION:()=>b});module.exports=_(c);const b=
|
|
1
|
+
"use strict";var r=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var L=(e,S)=>{for(var o in S)r(e,o,{get:S[o],enumerable:!0})},N=(e,S,o,t)=>{if(S&&typeof S=="object"||typeof S=="function")for(let n of E(S))!I.call(e,n)&&n!==o&&r(e,n,{get:()=>S[n],enumerable:!(t=A(S,n))||t.enumerable});return e};var _=e=>N(r({},"__esModule",{value:!0}),e);var c={};L(c,{INSTALL_SCHEMA_VERSION:()=>b});module.exports=_(c);const b=11;0&&(module.exports={INSTALL_SCHEMA_VERSION});
|