@caveman-ai/cloud 0.0.0-stage → 0.0.1
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/LICENSE +202 -0
- package/README.md +21 -2
- package/bin/cvm.mjs +91 -0
- package/dist/cloud-client.mjs +52 -0
- package/dist/cloud-mcp.mjs +69 -0
- package/package.json +34 -4
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { createRequire as __cloudRequire } from "node:module"; const require = __cloudRequire(import.meta.url);
|
|
2
|
+
var Zd=Object.create;var oi=Object.defineProperty;var Rd=Object.getOwnPropertyDescriptor;var Cd=Object.getOwnPropertyNames;var Nd=Object.getPrototypeOf,Dd=Object.prototype.hasOwnProperty;var Ze=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(i){throw r=[i],i}};var h=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Lt=(e,t)=>{for(var r in t)oi(e,r,{get:t[r],enumerable:!0})},Md=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Cd(t))!Dd.call(e,a)&&a!==r&&oi(e,a,{get:()=>t[a],enumerable:!(i=Rd(t,a))||i.enumerable});return e};var Fs=(e,t,r)=>(r=e!=null?Zd(Nd(e)):{},Md(t||!e||!e.__esModule?oi(r,"default",{value:e,enumerable:!0}):r,e));var Ct=h(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.regexpCode=N.getEsmExportName=N.getProperty=N.safeStringify=N.stringify=N.strConcat=N.addCodeArg=N.str=N._=N.nil=N._Code=N.Name=N.IDENTIFIER=N._CodeOrName=void 0;var Zt=class{};N._CodeOrName=Zt;N.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Be=class extends Zt{constructor(t){if(super(),!N.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};N.Name=Be;var me=class extends Zt{constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((r,i)=>`${r}${i}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((r,i)=>(i instanceof Be&&(r[i.str]=(r[i.str]||0)+1),r),{})}};N._Code=me;N.nil=new me("");function Us(e,...t){let r=[e[0]],i=0;for(;i<t.length;)di(r,t[i]),r.push(e[++i]);return new me(r)}N._=Us;var pi=new me("+");function Vs(e,...t){let r=[Rt(e[0])],i=0;for(;i<t.length;)r.push(pi),di(r,t[i]),r.push(pi,Rt(e[++i]));return Gd(r),new me(r)}N.str=Vs;function di(e,t){t instanceof me?e.push(...t._items):t instanceof Be?e.push(t):e.push(Vd(t))}N.addCodeArg=di;function Gd(e){let t=1;for(;t<e.length-1;){if(e[t]===pi){let r=Fd(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function Fd(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof Be||e[e.length-1]!=='"'?void 0:typeof t!="string"?`${e.slice(0,-1)}${t}"`:t[0]==='"'?e.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(e instanceof Be))return`"${e}${t.slice(1)}`}function Ud(e,t){return t.emptyStr()?e:e.emptyStr()?t:Vs`${e}${t}`}N.strConcat=Ud;function Vd(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Rt(Array.isArray(e)?e.join(","):e)}function Hd(e){return new me(Rt(e))}N.stringify=Hd;function Rt(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}N.safeStringify=Rt;function Kd(e){return typeof e=="string"&&N.IDENTIFIER.test(e)?new me(`.${e}`):Us`[${e}]`}N.getProperty=Kd;function Bd(e){if(typeof e=="string"&&N.IDENTIFIER.test(e))return new me(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}N.getEsmExportName=Bd;function Jd(e){return new me(e.toString())}N.regexpCode=Jd});var li=h(pe=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});pe.ValueScope=pe.ValueScopeName=pe.Scope=pe.varKinds=pe.UsedValueState=void 0;var oe=Ct(),ci=class extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}},fr;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(fr||(pe.UsedValueState=fr={}));pe.varKinds={const:new oe.Name("const"),let:new oe.Name("let"),var:new oe.Name("var")};var hr=class{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof oe.Name?t:this.name(t)}name(t){return new oe.Name(this._newName(t))}_newName(t){let r=this._names[t]||this._nameGroup(t);return`${t}${r.index++}`}_nameGroup(t){var r,i;if(!((i=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||i===void 0)&&i.has(t)||this._prefixes&&!this._prefixes.has(t))throw new Error(`CodeGen: prefix "${t}" is not allowed in this scope`);return this._names[t]={prefix:t,index:0}}};pe.Scope=hr;var br=class extends oe.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:i}){this.value=t,this.scopePath=(0,oe._)`.${new oe.Name(r)}[${i}]`}};pe.ValueScopeName=br;var Wd=(0,oe._)`\n`,ui=class extends hr{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?Wd:oe.nil}}get(){return this._scope}name(t){return new br(t,this._newName(t))}value(t,r){var i;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let a=this.toName(t),{prefix:s}=a,n=(i=r.key)!==null&&i!==void 0?i:r.ref,o=this._values[s];if(o){let d=o.get(n);if(d)return d}else o=this._values[s]=new Map;o.set(n,a);let p=this._scope[s]||(this._scope[s]=[]),c=p.length;return p[c]=r.ref,a.setValue(r,{property:s,itemIndex:c}),a}getValue(t,r){let i=this._values[t];if(i)return i.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,i=>{if(i.scopePath===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return(0,oe._)`${t}${i.scopePath}`})}scopeCode(t=this._values,r,i){return this._reduceValues(t,a=>{if(a.value===void 0)throw new Error(`CodeGen: name "${a}" has no value`);return a.value.code},r,i)}_reduceValues(t,r,i={},a){let s=oe.nil;for(let n in t){let o=t[n];if(!o)continue;let p=i[n]=i[n]||new Map;o.forEach(c=>{if(p.has(c))return;p.set(c,fr.Started);let d=r(c);if(d){let u=this.opts.es5?pe.varKinds.var:pe.varKinds.const;s=(0,oe._)`${s}${u} ${c} = ${d};${this.opts._n}`}else if(d=a?.(c))s=(0,oe._)`${s}${d}${this.opts._n}`;else throw new ci(c);p.set(c,fr.Completed)})}return s}};pe.ValueScope=ui});var I=h(E=>{"use strict";Object.defineProperty(E,"__esModule",{value:!0});E.or=E.and=E.not=E.CodeGen=E.operators=E.varKinds=E.ValueScopeName=E.ValueScope=E.Scope=E.Name=E.regexpCode=E.stringify=E.getProperty=E.nil=E.strConcat=E.str=E._=void 0;var R=Ct(),je=li(),Re=Ct();Object.defineProperty(E,"_",{enumerable:!0,get:function(){return Re._}});Object.defineProperty(E,"str",{enumerable:!0,get:function(){return Re.str}});Object.defineProperty(E,"strConcat",{enumerable:!0,get:function(){return Re.strConcat}});Object.defineProperty(E,"nil",{enumerable:!0,get:function(){return Re.nil}});Object.defineProperty(E,"getProperty",{enumerable:!0,get:function(){return Re.getProperty}});Object.defineProperty(E,"stringify",{enumerable:!0,get:function(){return Re.stringify}});Object.defineProperty(E,"regexpCode",{enumerable:!0,get:function(){return Re.regexpCode}});Object.defineProperty(E,"Name",{enumerable:!0,get:function(){return Re.Name}});var qr=li();Object.defineProperty(E,"Scope",{enumerable:!0,get:function(){return qr.Scope}});Object.defineProperty(E,"ValueScope",{enumerable:!0,get:function(){return qr.ValueScope}});Object.defineProperty(E,"ValueScopeName",{enumerable:!0,get:function(){return qr.ValueScopeName}});Object.defineProperty(E,"varKinds",{enumerable:!0,get:function(){return qr.varKinds}});E.operators={GT:new R._Code(">"),GTE:new R._Code(">="),LT:new R._Code("<"),LTE:new R._Code("<="),EQ:new R._Code("==="),NEQ:new R._Code("!=="),NOT:new R._Code("!"),OR:new R._Code("||"),AND:new R._Code("&&"),ADD:new R._Code("+")};var Ee=class{optimizeNodes(){return this}optimizeNames(t,r){return this}},yi=class extends Ee{constructor(t,r,i){super(),this.varKind=t,this.name=r,this.rhs=i}render({es5:t,_n:r}){let i=t?je.varKinds.var:this.varKind,a=this.rhs===void 0?"":` = ${this.rhs}`;return`${i} ${this.name}${a};`+r}optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=ut(this.rhs,t,r)),this}get names(){return this.rhs instanceof R._CodeOrName?this.rhs.names:{}}},vr=class extends Ee{constructor(t,r,i){super(),this.lhs=t,this.rhs=r,this.sideEffects=i}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,r){if(!(this.lhs instanceof R.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=ut(this.rhs,t,r),this}get names(){let t=this.lhs instanceof R.Name?{}:{...this.lhs.names};return wr(t,this.rhs)}},mi=class extends vr{constructor(t,r,i,a){super(t,i,a),this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},_i=class extends Ee{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},gi=class extends Ee{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},fi=class extends Ee{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},hi=class extends Ee{constructor(t){super(),this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,r){return this.code=ut(this.code,t,r),this}get names(){return this.code instanceof R._CodeOrName?this.code.names:{}}},Nt=class extends Ee{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((r,i)=>r+i.render(t),"")}optimizeNodes(){let{nodes:t}=this,r=t.length;for(;r--;){let i=t[r].optimizeNodes();Array.isArray(i)?t.splice(r,1,...i):i?t[r]=i:t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){let{nodes:i}=this,a=i.length;for(;a--;){let s=i[a];s.optimizeNames(t,r)||(Qd(t,s.names),i.splice(a,1))}return i.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>Qe(t,r.names),{})}},Se=class extends Nt{render(t){return"{"+t._n+super.render(t)+"}"+t._n}},bi=class extends Nt{},ct=class extends Se{};ct.kind="else";var Je=class e extends Se{constructor(t,r){super(r),this.condition=t}render(t){let r=`if(${this.condition})`+super.render(t);return this.else&&(r+="else "+this.else.render(t)),r}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let r=this.else;if(r){let i=r.optimizeNodes();r=this.else=Array.isArray(i)?new ct(i):i}if(r)return t===!1?r instanceof e?r:r.nodes:this.nodes.length?this:new e(Hs(t),r instanceof e?[r]:r.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,r){var i;if(this.else=(i=this.else)===null||i===void 0?void 0:i.optimizeNames(t,r),!!(super.optimizeNames(t,r)||this.else))return this.condition=ut(this.condition,t,r),this}get names(){let t=super.names;return wr(t,this.condition),this.else&&Qe(t,this.else.names),t}};Je.kind="if";var We=class extends Se{};We.kind="for";var vi=class extends We{constructor(t){super(),this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iteration=ut(this.iteration,t,r),this}get names(){return Qe(super.names,this.iteration.names)}},ji=class extends We{constructor(t,r,i,a){super(),this.varKind=t,this.name=r,this.from=i,this.to=a}render(t){let r=t.es5?je.varKinds.var:this.varKind,{name:i,from:a,to:s}=this;return`for(${r} ${i}=${a}; ${i}<${s}; ${i}++)`+super.render(t)}get names(){let t=wr(super.names,this.from);return wr(t,this.to)}},jr=class extends We{constructor(t,r,i,a){super(),this.loop=t,this.varKind=r,this.name=i,this.iterable=a}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iterable=ut(this.iterable,t,r),this}get names(){return Qe(super.names,this.iterable.names)}},Dt=class extends Se{constructor(t,r,i){super(),this.name=t,this.args=r,this.async=i}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}};Dt.kind="func";var Mt=class extends Nt{render(t){return"return "+super.render(t)}};Mt.kind="return";var wi=class extends Se{render(t){let r="try"+super.render(t);return this.catch&&(r+=this.catch.render(t)),this.finally&&(r+=this.finally.render(t)),r}optimizeNodes(){var t,r;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(t,r){var i,a;return super.optimizeNames(t,r),(i=this.catch)===null||i===void 0||i.optimizeNames(t,r),(a=this.finally)===null||a===void 0||a.optimizeNames(t,r),this}get names(){let t=super.names;return this.catch&&Qe(t,this.catch.names),this.finally&&Qe(t,this.finally.names),t}},Gt=class extends Se{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};Gt.kind="catch";var Ft=class extends Se{render(t){return"finally"+super.render(t)}};Ft.kind="finally";var qi=class{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
3
|
+
`:""},this._extScope=t,this._scope=new je.Scope({parent:t}),this._nodes=[new bi]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let i=this._extScope.value(t,r);return(this._values[i.prefix]||(this._values[i.prefix]=new Set)).add(i),i}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,i,a){let s=this._scope.toName(r);return i!==void 0&&a&&(this._constants[s.str]=i),this._leafNode(new yi(t,s,i)),s}const(t,r,i){return this._def(je.varKinds.const,t,r,i)}let(t,r,i){return this._def(je.varKinds.let,t,r,i)}var(t,r,i){return this._def(je.varKinds.var,t,r,i)}assign(t,r,i){return this._leafNode(new vr(t,r,i))}add(t,r){return this._leafNode(new mi(t,E.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==R.nil&&this._leafNode(new hi(t)),this}object(...t){let r=["{"];for(let[i,a]of t)r.length>1&&r.push(","),r.push(i),(i!==a||this.opts.es5)&&(r.push(":"),(0,R.addCodeArg)(r,a));return r.push("}"),new R._Code(r)}if(t,r,i){if(this._blockNode(new Je(t)),r&&i)this.code(r).else().code(i).endIf();else if(r)this.code(r).endIf();else if(i)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new Je(t))}else(){return this._elseNode(new ct)}endIf(){return this._endBlockNode(Je,ct)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new vi(t),r)}forRange(t,r,i,a,s=this.opts.es5?je.varKinds.var:je.varKinds.let){let n=this._scope.toName(t);return this._for(new ji(s,n,r,i),()=>a(n))}forOf(t,r,i,a=je.varKinds.const){let s=this._scope.toName(t);if(this.opts.es5){let n=r instanceof R.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,R._)`${n}.length`,o=>{this.var(s,(0,R._)`${n}[${o}]`),i(s)})}return this._for(new jr("of",a,s,r),()=>i(s))}forIn(t,r,i,a=this.opts.es5?je.varKinds.var:je.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,R._)`Object.keys(${r})`,i);let s=this._scope.toName(t);return this._for(new jr("in",a,s,r),()=>i(s))}endFor(){return this._endBlockNode(We)}label(t){return this._leafNode(new _i(t))}break(t){return this._leafNode(new gi(t))}return(t){let r=new Mt;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Mt)}try(t,r,i){if(!r&&!i)throw new Error('CodeGen: "try" without "catch" and "finally"');let a=new wi;if(this._blockNode(a),this.code(t),r){let s=this.name("e");this._currNode=a.catch=new Gt(s),r(s)}return i&&(this._currNode=a.finally=new Ft,this.code(i)),this._endBlockNode(Gt,Ft)}throw(t){return this._leafNode(new fi(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let i=this._nodes.length-r;if(i<0||t!==void 0&&i!==t)throw new Error(`CodeGen: wrong number of nodes: ${i} vs ${t} expected`);return this._nodes.length=r,this}func(t,r=R.nil,i,a){return this._blockNode(new Dt(t,r,i)),a&&this.code(a).endFunc(),this}endFunc(){return this._endBlockNode(Dt)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let i=this._currNode;if(i instanceof t||r&&i instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${t.kind}/${r.kind}`:t.kind}"`)}_elseNode(t){let r=this._currNode;if(!(r instanceof Je))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};E.CodeGen=qi;function Qe(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function wr(e,t){return t instanceof R._CodeOrName?Qe(e,t.names):e}function ut(e,t,r){if(e instanceof R.Name)return i(e);if(!a(e))return e;return new R._Code(e._items.reduce((s,n)=>(n instanceof R.Name&&(n=i(n)),n instanceof R._Code?s.push(...n._items):s.push(n),s),[]));function i(s){let n=r[s.str];return n===void 0||t[s.str]!==1?s:(delete t[s.str],n)}function a(s){return s instanceof R._Code&&s._items.some(n=>n instanceof R.Name&&t[n.str]===1&&r[n.str]!==void 0)}}function Qd(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function Hs(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,R._)`!${Pi(e)}`}E.not=Hs;var Yd=Ks(E.operators.AND);function Xd(...e){return e.reduce(Yd)}E.and=Xd;var ec=Ks(E.operators.OR);function tc(...e){return e.reduce(ec)}E.or=tc;function Ks(e){return(t,r)=>t===R.nil?r:r===R.nil?t:(0,R._)`${Pi(t)} ${e} ${Pi(r)}`}function Pi(e){return e instanceof R.Name?e:(0,R._)`(${e})`}});var Z=h(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});L.checkStrictMode=L.getErrorPath=L.Type=L.useFunc=L.setEvaluated=L.evaluatedPropsToName=L.mergeEvaluated=L.eachItem=L.unescapeJsonPointer=L.escapeJsonPointer=L.escapeFragment=L.unescapeFragment=L.schemaRefOrVal=L.schemaHasRulesButRef=L.schemaHasRules=L.checkUnknownRules=L.alwaysValidSchema=L.toHash=void 0;var U=I(),rc=Ct();function ic(e){let t={};for(let r of e)t[r]=!0;return t}L.toHash=ic;function ac(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(Ws(e,t),!Qs(t,e.self.RULES.all))}L.alwaysValidSchema=ac;function Ws(e,t=e.schema){let{opts:r,self:i}=e;if(!r.strictSchema||typeof t=="boolean")return;let a=i.RULES.keywords;for(let s in t)a[s]||en(e,`unknown keyword: "${s}"`)}L.checkUnknownRules=Ws;function Qs(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}L.schemaHasRules=Qs;function sc(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}L.schemaHasRulesButRef=sc;function nc({topSchemaRef:e,schemaPath:t},r,i,a){if(!a){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,U._)`${r}`}return(0,U._)`${e}${t}${(0,U.getProperty)(i)}`}L.schemaRefOrVal=nc;function oc(e){return Ys(decodeURIComponent(e))}L.unescapeFragment=oc;function pc(e){return encodeURIComponent(xi(e))}L.escapeFragment=pc;function xi(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}L.escapeJsonPointer=xi;function Ys(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}L.unescapeJsonPointer=Ys;function dc(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}L.eachItem=dc;function Bs({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:i}){return(a,s,n,o)=>{let p=n===void 0?s:n instanceof U.Name?(s instanceof U.Name?e(a,s,n):t(a,s,n),n):s instanceof U.Name?(t(a,n,s),s):r(s,n);return o===U.Name&&!(p instanceof U.Name)?i(a,p):p}}L.mergeEvaluated={props:Bs({mergeNames:(e,t,r)=>e.if((0,U._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,U._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,U._)`${r} || {}`).code((0,U._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,U._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,U._)`${r} || {}`),Oi(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:Xs}),items:Bs({mergeNames:(e,t,r)=>e.if((0,U._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,U._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,U._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,U._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function Xs(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,U._)`{}`);return t!==void 0&&Oi(e,r,t),r}L.evaluatedPropsToName=Xs;function Oi(e,t,r){Object.keys(r).forEach(i=>e.assign((0,U._)`${t}${(0,U.getProperty)(i)}`,!0))}L.setEvaluated=Oi;var Js={};function cc(e,t){return e.scopeValue("func",{ref:t,code:Js[t.code]||(Js[t.code]=new rc._Code(t.code))})}L.useFunc=cc;var ki;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(ki||(L.Type=ki={}));function uc(e,t,r){if(e instanceof U.Name){let i=t===ki.Num;return r?i?(0,U._)`"[" + ${e} + "]"`:(0,U._)`"['" + ${e} + "']"`:i?(0,U._)`"/" + ${e}`:(0,U._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,U.getProperty)(e).toString():"/"+xi(e)}L.getErrorPath=uc;function en(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}L.checkStrictMode=en});var _e=h($i=>{"use strict";Object.defineProperty($i,"__esModule",{value:!0});var ee=I(),lc={data:new ee.Name("data"),valCxt:new ee.Name("valCxt"),instancePath:new ee.Name("instancePath"),parentData:new ee.Name("parentData"),parentDataProperty:new ee.Name("parentDataProperty"),rootData:new ee.Name("rootData"),dynamicAnchors:new ee.Name("dynamicAnchors"),vErrors:new ee.Name("vErrors"),errors:new ee.Name("errors"),this:new ee.Name("this"),self:new ee.Name("self"),scope:new ee.Name("scope"),json:new ee.Name("json"),jsonPos:new ee.Name("jsonPos"),jsonLen:new ee.Name("jsonLen"),jsonPart:new ee.Name("jsonPart")};$i.default=lc});var Ut=h(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.extendErrors=te.resetErrorsCount=te.reportExtraError=te.reportError=te.keyword$DataError=te.keywordError=void 0;var C=I(),Pr=Z(),se=_e();te.keywordError={message:({keyword:e})=>(0,C.str)`must pass "${e}" keyword validation`};te.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,C.str)`"${e}" keyword must be ${t} ($data)`:(0,C.str)`"${e}" keyword is invalid ($data)`};function yc(e,t=te.keywordError,r,i){let{it:a}=e,{gen:s,compositeRule:n,allErrors:o}=a,p=an(e,t,r);i??(n||o)?tn(s,p):rn(a,(0,C._)`[${p}]`)}te.reportError=yc;function mc(e,t=te.keywordError,r){let{it:i}=e,{gen:a,compositeRule:s,allErrors:n}=i,o=an(e,t,r);tn(a,o),s||n||rn(i,se.default.vErrors)}te.reportExtraError=mc;function _c(e,t){e.assign(se.default.errors,t),e.if((0,C._)`${se.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,C._)`${se.default.vErrors}.length`,t),()=>e.assign(se.default.vErrors,null)))}te.resetErrorsCount=_c;function gc({gen:e,keyword:t,schemaValue:r,data:i,errsCount:a,it:s}){if(a===void 0)throw new Error("ajv implementation error");let n=e.name("err");e.forRange("i",a,se.default.errors,o=>{e.const(n,(0,C._)`${se.default.vErrors}[${o}]`),e.if((0,C._)`${n}.instancePath === undefined`,()=>e.assign((0,C._)`${n}.instancePath`,(0,C.strConcat)(se.default.instancePath,s.errorPath))),e.assign((0,C._)`${n}.schemaPath`,(0,C.str)`${s.errSchemaPath}/${t}`),s.opts.verbose&&(e.assign((0,C._)`${n}.schema`,r),e.assign((0,C._)`${n}.data`,i))})}te.extendErrors=gc;function tn(e,t){let r=e.const("err",t);e.if((0,C._)`${se.default.vErrors} === null`,()=>e.assign(se.default.vErrors,(0,C._)`[${r}]`),(0,C._)`${se.default.vErrors}.push(${r})`),e.code((0,C._)`${se.default.errors}++`)}function rn(e,t){let{gen:r,validateName:i,schemaEnv:a}=e;a.$async?r.throw((0,C._)`new ${e.ValidationError}(${t})`):(r.assign((0,C._)`${i}.errors`,t),r.return(!1))}var Ye={keyword:new C.Name("keyword"),schemaPath:new C.Name("schemaPath"),params:new C.Name("params"),propertyName:new C.Name("propertyName"),message:new C.Name("message"),schema:new C.Name("schema"),parentSchema:new C.Name("parentSchema")};function an(e,t,r){let{createErrors:i}=e.it;return i===!1?(0,C._)`{}`:fc(e,t,r)}function fc(e,t,r={}){let{gen:i,it:a}=e,s=[hc(a,r),bc(e,r)];return vc(e,t,s),i.object(...s)}function hc({errorPath:e},{instancePath:t}){let r=t?(0,C.str)`${e}${(0,Pr.getErrorPath)(t,Pr.Type.Str)}`:e;return[se.default.instancePath,(0,C.strConcat)(se.default.instancePath,r)]}function bc({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:i}){let a=i?t:(0,C.str)`${t}/${e}`;return r&&(a=(0,C.str)`${a}${(0,Pr.getErrorPath)(r,Pr.Type.Str)}`),[Ye.schemaPath,a]}function vc(e,{params:t,message:r},i){let{keyword:a,data:s,schemaValue:n,it:o}=e,{opts:p,propertyName:c,topSchemaRef:d,schemaPath:u}=o;i.push([Ye.keyword,a],[Ye.params,typeof t=="function"?t(e):t||(0,C._)`{}`]),p.messages&&i.push([Ye.message,typeof r=="function"?r(e):r]),p.verbose&&i.push([Ye.schema,n],[Ye.parentSchema,(0,C._)`${d}${u}`],[se.default.data,s]),c&&i.push([Ye.propertyName,c])}});var nn=h(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.boolOrEmptySchema=lt.topBoolOrEmptySchema=void 0;var jc=Ut(),wc=I(),qc=_e(),Pc={message:"boolean schema is false"};function kc(e){let{gen:t,schema:r,validateName:i}=e;r===!1?sn(e,!1):typeof r=="object"&&r.$async===!0?t.return(qc.default.data):(t.assign((0,wc._)`${i}.errors`,null),t.return(!0))}lt.topBoolOrEmptySchema=kc;function xc(e,t){let{gen:r,schema:i}=e;i===!1?(r.var(t,!1),sn(e)):r.var(t,!0)}lt.boolOrEmptySchema=xc;function sn(e,t){let{gen:r,data:i}=e,a={gen:r,keyword:"false schema",data:i,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,jc.reportError)(a,Pc,void 0,t)}});var Ii=h(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.getRules=yt.isJSONType=void 0;var Oc=["string","number","integer","boolean","null","object","array"],$c=new Set(Oc);function Ic(e){return typeof e=="string"&&$c.has(e)}yt.isJSONType=Ic;function Ac(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}yt.getRules=Ac});var Ai=h(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});Ce.shouldUseRule=Ce.shouldUseGroup=Ce.schemaHasRulesForType=void 0;function zc({schema:e,self:t},r){let i=t.RULES.types[r];return i&&i!==!0&&on(e,i)}Ce.schemaHasRulesForType=zc;function on(e,t){return t.rules.some(r=>pn(e,r))}Ce.shouldUseGroup=on;function pn(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(i=>e[i]!==void 0))}Ce.shouldUseRule=pn});var Vt=h(re=>{"use strict";Object.defineProperty(re,"__esModule",{value:!0});re.reportTypeError=re.checkDataTypes=re.checkDataType=re.coerceAndCheckDataType=re.getJSONTypes=re.getSchemaTypes=re.DataType=void 0;var Tc=Ii(),Ec=Ai(),Sc=Ut(),z=I(),dn=Z(),mt;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(mt||(re.DataType=mt={}));function Lc(e){let t=cn(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}re.getSchemaTypes=Lc;function cn(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(Tc.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}re.getJSONTypes=cn;function Zc(e,t){let{gen:r,data:i,opts:a}=e,s=Rc(t,a.coerceTypes),n=t.length>0&&!(s.length===0&&t.length===1&&(0,Ec.schemaHasRulesForType)(e,t[0]));if(n){let o=Ti(t,i,a.strictNumbers,mt.Wrong);r.if(o,()=>{s.length?Cc(e,t,s):Ei(e)})}return n}re.coerceAndCheckDataType=Zc;var un=new Set(["string","number","integer","boolean","null"]);function Rc(e,t){return t?e.filter(r=>un.has(r)||t==="array"&&r==="array"):[]}function Cc(e,t,r){let{gen:i,data:a,opts:s}=e,n=i.let("dataType",(0,z._)`typeof ${a}`),o=i.let("coerced",(0,z._)`undefined`);s.coerceTypes==="array"&&i.if((0,z._)`${n} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,()=>i.assign(a,(0,z._)`${a}[0]`).assign(n,(0,z._)`typeof ${a}`).if(Ti(t,a,s.strictNumbers),()=>i.assign(o,a))),i.if((0,z._)`${o} !== undefined`);for(let c of r)(un.has(c)||c==="array"&&s.coerceTypes==="array")&&p(c);i.else(),Ei(e),i.endIf(),i.if((0,z._)`${o} !== undefined`,()=>{i.assign(a,o),Nc(e,o)});function p(c){switch(c){case"string":i.elseIf((0,z._)`${n} == "number" || ${n} == "boolean"`).assign(o,(0,z._)`"" + ${a}`).elseIf((0,z._)`${a} === null`).assign(o,(0,z._)`""`);return;case"number":i.elseIf((0,z._)`${n} == "boolean" || ${a} === null
|
|
4
|
+
|| (${n} == "string" && ${a} && ${a} == +${a})`).assign(o,(0,z._)`+${a}`);return;case"integer":i.elseIf((0,z._)`${n} === "boolean" || ${a} === null
|
|
5
|
+
|| (${n} === "string" && ${a} && ${a} == +${a} && !(${a} % 1))`).assign(o,(0,z._)`+${a}`);return;case"boolean":i.elseIf((0,z._)`${a} === "false" || ${a} === 0 || ${a} === null`).assign(o,!1).elseIf((0,z._)`${a} === "true" || ${a} === 1`).assign(o,!0);return;case"null":i.elseIf((0,z._)`${a} === "" || ${a} === 0 || ${a} === false`),i.assign(o,null);return;case"array":i.elseIf((0,z._)`${n} === "string" || ${n} === "number"
|
|
6
|
+
|| ${n} === "boolean" || ${a} === null`).assign(o,(0,z._)`[${a}]`)}}}function Nc({gen:e,parentData:t,parentDataProperty:r},i){e.if((0,z._)`${t} !== undefined`,()=>e.assign((0,z._)`${t}[${r}]`,i))}function zi(e,t,r,i=mt.Correct){let a=i===mt.Correct?z.operators.EQ:z.operators.NEQ,s;switch(e){case"null":return(0,z._)`${t} ${a} null`;case"array":s=(0,z._)`Array.isArray(${t})`;break;case"object":s=(0,z._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":s=n((0,z._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":s=n();break;default:return(0,z._)`typeof ${t} ${a} ${e}`}return i===mt.Correct?s:(0,z.not)(s);function n(o=z.nil){return(0,z.and)((0,z._)`typeof ${t} == "number"`,o,r?(0,z._)`isFinite(${t})`:z.nil)}}re.checkDataType=zi;function Ti(e,t,r,i){if(e.length===1)return zi(e[0],t,r,i);let a,s=(0,dn.toHash)(e);if(s.array&&s.object){let n=(0,z._)`typeof ${t} != "object"`;a=s.null?n:(0,z._)`!${t} || ${n}`,delete s.null,delete s.array,delete s.object}else a=z.nil;s.number&&delete s.integer;for(let n in s)a=(0,z.and)(a,zi(n,t,r,i));return a}re.checkDataTypes=Ti;var Dc={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,z._)`{type: ${e}}`:(0,z._)`{type: ${t}}`};function Ei(e){let t=Mc(e);(0,Sc.reportError)(t,Dc)}re.reportTypeError=Ei;function Mc(e){let{gen:t,data:r,schema:i}=e,a=(0,dn.schemaRefOrVal)(e,i,"type");return{gen:t,keyword:"type",data:r,schema:i.type,schemaCode:a,schemaValue:a,parentSchema:i,params:{},it:e}}});var yn=h(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.assignDefaults=void 0;var _t=I(),Gc=Z();function Fc(e,t){let{properties:r,items:i}=e.schema;if(t==="object"&&r)for(let a in r)ln(e,a,r[a].default);else t==="array"&&Array.isArray(i)&&i.forEach((a,s)=>ln(e,s,a.default))}kr.assignDefaults=Fc;function ln(e,t,r){let{gen:i,compositeRule:a,data:s,opts:n}=e;if(r===void 0)return;let o=(0,_t._)`${s}${(0,_t.getProperty)(t)}`;if(a){(0,Gc.checkStrictMode)(e,`default is ignored for: ${o}`);return}let p=(0,_t._)`${o} === undefined`;n.useDefaults==="empty"&&(p=(0,_t._)`${p} || ${o} === null || ${o} === ""`),i.if(p,(0,_t._)`${o} = ${(0,_t.stringify)(r)}`)}});var ge=h(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.validateUnion=G.validateArray=G.usePattern=G.callValidateCode=G.schemaProperties=G.allSchemaProperties=G.noPropertyInData=G.propertyInData=G.isOwnProperty=G.hasPropFunc=G.reportMissingProp=G.checkMissingProp=G.checkReportMissingProp=void 0;var H=I(),Si=Z(),Ne=_e(),Uc=Z();function Vc(e,t){let{gen:r,data:i,it:a}=e;r.if(Zi(r,i,t,a.opts.ownProperties),()=>{e.setParams({missingProperty:(0,H._)`${t}`},!0),e.error()})}G.checkReportMissingProp=Vc;function Hc({gen:e,data:t,it:{opts:r}},i,a){return(0,H.or)(...i.map(s=>(0,H.and)(Zi(e,t,s,r.ownProperties),(0,H._)`${a} = ${s}`)))}G.checkMissingProp=Hc;function Kc(e,t){e.setParams({missingProperty:t},!0),e.error()}G.reportMissingProp=Kc;function mn(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,H._)`Object.prototype.hasOwnProperty`})}G.hasPropFunc=mn;function Li(e,t,r){return(0,H._)`${mn(e)}.call(${t}, ${r})`}G.isOwnProperty=Li;function Bc(e,t,r,i){let a=(0,H._)`${t}${(0,H.getProperty)(r)} !== undefined`;return i?(0,H._)`${a} && ${Li(e,t,r)}`:a}G.propertyInData=Bc;function Zi(e,t,r,i){let a=(0,H._)`${t}${(0,H.getProperty)(r)} === undefined`;return i?(0,H.or)(a,(0,H.not)(Li(e,t,r))):a}G.noPropertyInData=Zi;function _n(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}G.allSchemaProperties=_n;function Jc(e,t){return _n(t).filter(r=>!(0,Si.alwaysValidSchema)(e,t[r]))}G.schemaProperties=Jc;function Wc({schemaCode:e,data:t,it:{gen:r,topSchemaRef:i,schemaPath:a,errorPath:s},it:n},o,p,c){let d=c?(0,H._)`${e}, ${t}, ${i}${a}`:t,u=[[Ne.default.instancePath,(0,H.strConcat)(Ne.default.instancePath,s)],[Ne.default.parentData,n.parentData],[Ne.default.parentDataProperty,n.parentDataProperty],[Ne.default.rootData,Ne.default.rootData]];n.opts.dynamicRef&&u.push([Ne.default.dynamicAnchors,Ne.default.dynamicAnchors]);let f=(0,H._)`${d}, ${r.object(...u)}`;return p!==H.nil?(0,H._)`${o}.call(${p}, ${f})`:(0,H._)`${o}(${f})`}G.callValidateCode=Wc;var Qc=(0,H._)`new RegExp`;function Yc({gen:e,it:{opts:t}},r){let i=t.unicodeRegExp?"u":"",{regExp:a}=t.code,s=a(r,i);return e.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,H._)`${a.code==="new RegExp"?Qc:(0,Uc.useFunc)(e,a)}(${r}, ${i})`})}G.usePattern=Yc;function Xc(e){let{gen:t,data:r,keyword:i,it:a}=e,s=t.name("valid");if(a.allErrors){let o=t.let("valid",!0);return n(()=>t.assign(o,!1)),o}return t.var(s,!0),n(()=>t.break()),s;function n(o){let p=t.const("len",(0,H._)`${r}.length`);t.forRange("i",0,p,c=>{e.subschema({keyword:i,dataProp:c,dataPropType:Si.Type.Num},s),t.if((0,H.not)(s),o)})}}G.validateArray=Xc;function eu(e){let{gen:t,schema:r,keyword:i,it:a}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(p=>(0,Si.alwaysValidSchema)(a,p))&&!a.opts.unevaluated)return;let n=t.let("valid",!1),o=t.name("_valid");t.block(()=>r.forEach((p,c)=>{let d=e.subschema({keyword:i,schemaProp:c,compositeRule:!0},o);t.assign(n,(0,H._)`${n} || ${o}`),e.mergeValidEvaluated(d,o)||t.if((0,H.not)(n))})),e.result(n,()=>e.reset(),()=>e.error(!0))}G.validateUnion=eu});var hn=h(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.validateKeywordUsage=Oe.validSchemaType=Oe.funcKeywordCode=Oe.macroKeywordCode=void 0;var ne=I(),Xe=_e(),tu=ge(),ru=Ut();function iu(e,t){let{gen:r,keyword:i,schema:a,parentSchema:s,it:n}=e,o=t.macro.call(n.self,a,s,n),p=fn(r,i,o);n.opts.validateSchema!==!1&&n.self.validateSchema(o,!0);let c=r.name("valid");e.subschema({schema:o,schemaPath:ne.nil,errSchemaPath:`${n.errSchemaPath}/${i}`,topSchemaRef:p,compositeRule:!0},c),e.pass(c,()=>e.error(!0))}Oe.macroKeywordCode=iu;function au(e,t){var r;let{gen:i,keyword:a,schema:s,parentSchema:n,$data:o,it:p}=e;nu(p,t);let c=!o&&t.compile?t.compile.call(p.self,s,n,p):t.validate,d=fn(i,a,c),u=i.let("valid");e.block$data(u,f),e.ok((r=t.valid)!==null&&r!==void 0?r:u);function f(){if(t.errors===!1)_(),t.modifying&&gn(e),g(()=>e.error());else{let b=t.async?y():l();t.modifying&&gn(e),g(()=>su(e,b))}}function y(){let b=i.let("ruleErrs",null);return i.try(()=>_((0,ne._)`await `),k=>i.assign(u,!1).if((0,ne._)`${k} instanceof ${p.ValidationError}`,()=>i.assign(b,(0,ne._)`${k}.errors`),()=>i.throw(k))),b}function l(){let b=(0,ne._)`${d}.errors`;return i.assign(b,null),_(ne.nil),b}function _(b=t.async?(0,ne._)`await `:ne.nil){let k=p.opts.passContext?Xe.default.this:Xe.default.self,q=!("compile"in t&&!o||t.schema===!1);i.assign(u,(0,ne._)`${b}${(0,tu.callValidateCode)(e,d,k,q)}`,t.modifying)}function g(b){var k;i.if((0,ne.not)((k=t.valid)!==null&&k!==void 0?k:u),b)}}Oe.funcKeywordCode=au;function gn(e){let{gen:t,data:r,it:i}=e;t.if(i.parentData,()=>t.assign(r,(0,ne._)`${i.parentData}[${i.parentDataProperty}]`))}function su(e,t){let{gen:r}=e;r.if((0,ne._)`Array.isArray(${t})`,()=>{r.assign(Xe.default.vErrors,(0,ne._)`${Xe.default.vErrors} === null ? ${t} : ${Xe.default.vErrors}.concat(${t})`).assign(Xe.default.errors,(0,ne._)`${Xe.default.vErrors}.length`),(0,ru.extendErrors)(e)},()=>e.error())}function nu({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function fn(e,t,r){if(r===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,ne.stringify)(r)})}function ou(e,t,r=!1){return!t.length||t.some(i=>i==="array"?Array.isArray(e):i==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==i||r&&typeof e>"u")}Oe.validSchemaType=ou;function pu({schema:e,opts:t,self:r,errSchemaPath:i},a,s){if(Array.isArray(a.keyword)?!a.keyword.includes(s):a.keyword!==s)throw new Error("ajv implementation error");let n=a.dependencies;if(n?.some(o=>!Object.prototype.hasOwnProperty.call(e,o)))throw new Error(`parent schema must have dependencies of ${s}: ${n.join(",")}`);if(a.validateSchema&&!a.validateSchema(e[s])){let p=`keyword "${s}" value is invalid at path "${i}": `+r.errorsText(a.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(p);else throw new Error(p)}}Oe.validateKeywordUsage=pu});var vn=h(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.extendSubschemaMode=De.extendSubschemaData=De.getSubschema=void 0;var $e=I(),bn=Z();function du(e,{keyword:t,schemaProp:r,schema:i,schemaPath:a,errSchemaPath:s,topSchemaRef:n}){if(t!==void 0&&i!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let o=e.schema[t];return r===void 0?{schema:o,schemaPath:(0,$e._)`${e.schemaPath}${(0,$e.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:o[r],schemaPath:(0,$e._)`${e.schemaPath}${(0,$e.getProperty)(t)}${(0,$e.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,bn.escapeFragment)(r)}`}}if(i!==void 0){if(a===void 0||s===void 0||n===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:a,topSchemaRef:n,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}De.getSubschema=du;function cu(e,t,{dataProp:r,dataPropType:i,data:a,dataTypes:s,propertyName:n}){if(a!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:o}=t;if(r!==void 0){let{errorPath:c,dataPathArr:d,opts:u}=t,f=o.let("data",(0,$e._)`${t.data}${(0,$e.getProperty)(r)}`,!0);p(f),e.errorPath=(0,$e.str)`${c}${(0,bn.getErrorPath)(r,i,u.jsPropertySyntax)}`,e.parentDataProperty=(0,$e._)`${r}`,e.dataPathArr=[...d,e.parentDataProperty]}if(a!==void 0){let c=a instanceof $e.Name?a:o.let("data",a,!0);p(c),n!==void 0&&(e.propertyName=n)}s&&(e.dataTypes=s);function p(c){e.data=c,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,c]}}De.extendSubschemaData=cu;function uu(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:i,createErrors:a,allErrors:s}){i!==void 0&&(e.compositeRule=i),a!==void 0&&(e.createErrors=a),s!==void 0&&(e.allErrors=s),e.jtdDiscriminator=t,e.jtdMetadata=r}De.extendSubschemaMode=uu});var Ri=h((eh,jn)=>{"use strict";jn.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var i,a,s;if(Array.isArray(t)){if(i=t.length,i!=r.length)return!1;for(a=i;a--!==0;)if(!e(t[a],r[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(s=Object.keys(t),i=s.length,i!==Object.keys(r).length)return!1;for(a=i;a--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[a]))return!1;for(a=i;a--!==0;){var n=s[a];if(!e(t[n],r[n]))return!1}return!0}return t!==t&&r!==r}});var qn=h((th,wn)=>{"use strict";var Me=wn.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var i=typeof r=="function"?r:r.pre||function(){},a=r.post||function(){};xr(t,i,a,e,"",e)};Me.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Me.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Me.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Me.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function xr(e,t,r,i,a,s,n,o,p,c){if(i&&typeof i=="object"&&!Array.isArray(i)){t(i,a,s,n,o,p,c);for(var d in i){var u=i[d];if(Array.isArray(u)){if(d in Me.arrayKeywords)for(var f=0;f<u.length;f++)xr(e,t,r,u[f],a+"/"+d+"/"+f,s,a,d,i,f)}else if(d in Me.propsKeywords){if(u&&typeof u=="object")for(var y in u)xr(e,t,r,u[y],a+"/"+d+"/"+lu(y),s,a,d,i,y)}else(d in Me.keywords||e.allKeys&&!(d in Me.skipKeywords))&&xr(e,t,r,u,a+"/"+d,s,a,d,i)}r(i,a,s,n,o,p,c)}}function lu(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var Ht=h(de=>{"use strict";Object.defineProperty(de,"__esModule",{value:!0});de.getSchemaRefs=de.resolveUrl=de.normalizeId=de._getFullPath=de.getFullPath=de.inlineRef=void 0;var yu=Z(),mu=Ri(),_u=qn(),gu=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function fu(e,t=!0){return typeof e=="boolean"?!0:t===!0?!Ci(e):t?Pn(e)<=t:!1}de.inlineRef=fu;var hu=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Ci(e){for(let t in e){if(hu.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(Ci)||typeof r=="object"&&Ci(r))return!0}return!1}function Pn(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!gu.has(r)&&(typeof e[r]=="object"&&(0,yu.eachItem)(e[r],i=>t+=Pn(i)),t===1/0))return 1/0}return t}function kn(e,t="",r){r!==!1&&(t=gt(t));let i=e.parse(t);return xn(e,i)}de.getFullPath=kn;function xn(e,t){return e.serialize(t).split("#")[0]+"#"}de._getFullPath=xn;var bu=/#\/?$/;function gt(e){return e?e.replace(bu,""):""}de.normalizeId=gt;function vu(e,t,r){return r=gt(r),e.resolve(t,r)}de.resolveUrl=vu;var ju=/^[a-z_][-a-z0-9._]*$/i;function wu(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:i}=this.opts,a=gt(e[r]||t),s={"":a},n=kn(i,a,!1),o={},p=new Set;return _u(e,{allKeys:!0},(u,f,y,l)=>{if(l===void 0)return;let _=n+f,g=s[l];typeof u[r]=="string"&&(g=b.call(this,u[r])),k.call(this,u.$anchor),k.call(this,u.$dynamicAnchor),s[f]=g;function b(q){let j=this.opts.uriResolver.resolve;if(q=gt(g?j(g,q):q),p.has(q))throw d(q);p.add(q);let P=this.refs[q];return typeof P=="string"&&(P=this.refs[P]),typeof P=="object"?c(u,P.schema,q):q!==gt(_)&&(q[0]==="#"?(c(u,o[q],q),o[q]=u):this.refs[q]=_),q}function k(q){if(typeof q=="string"){if(!ju.test(q))throw new Error(`invalid anchor "${q}"`);b.call(this,`#${q}`)}}}),o;function c(u,f,y){if(f!==void 0&&!mu(u,f))throw d(y)}function d(u){return new Error(`reference "${u}" resolves to more than one schema`)}}de.getSchemaRefs=wu});var ft=h(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.getData=Ge.KeywordCxt=Ge.validateFunctionCode=void 0;var zn=nn(),On=Vt(),Di=Ai(),Or=Vt(),qu=yn(),Bt=hn(),Ni=vn(),w=I(),O=_e(),Pu=Ht(),Le=Z(),Kt=Ut();function ku(e){if(Sn(e)&&(Ln(e),En(e))){$u(e);return}Tn(e,()=>(0,zn.topBoolOrEmptySchema)(e))}Ge.validateFunctionCode=ku;function Tn({gen:e,validateName:t,schema:r,schemaEnv:i,opts:a},s){a.code.es5?e.func(t,(0,w._)`${O.default.data}, ${O.default.valCxt}`,i.$async,()=>{e.code((0,w._)`"use strict"; ${$n(r,a)}`),Ou(e,a),e.code(s)}):e.func(t,(0,w._)`${O.default.data}, ${xu(a)}`,i.$async,()=>e.code($n(r,a)).code(s))}function xu(e){return(0,w._)`{${O.default.instancePath}="", ${O.default.parentData}, ${O.default.parentDataProperty}, ${O.default.rootData}=${O.default.data}${e.dynamicRef?(0,w._)`, ${O.default.dynamicAnchors}={}`:w.nil}}={}`}function Ou(e,t){e.if(O.default.valCxt,()=>{e.var(O.default.instancePath,(0,w._)`${O.default.valCxt}.${O.default.instancePath}`),e.var(O.default.parentData,(0,w._)`${O.default.valCxt}.${O.default.parentData}`),e.var(O.default.parentDataProperty,(0,w._)`${O.default.valCxt}.${O.default.parentDataProperty}`),e.var(O.default.rootData,(0,w._)`${O.default.valCxt}.${O.default.rootData}`),t.dynamicRef&&e.var(O.default.dynamicAnchors,(0,w._)`${O.default.valCxt}.${O.default.dynamicAnchors}`)},()=>{e.var(O.default.instancePath,(0,w._)`""`),e.var(O.default.parentData,(0,w._)`undefined`),e.var(O.default.parentDataProperty,(0,w._)`undefined`),e.var(O.default.rootData,O.default.data),t.dynamicRef&&e.var(O.default.dynamicAnchors,(0,w._)`{}`)})}function $u(e){let{schema:t,opts:r,gen:i}=e;Tn(e,()=>{r.$comment&&t.$comment&&Rn(e),Eu(e),i.let(O.default.vErrors,null),i.let(O.default.errors,0),r.unevaluated&&Iu(e),Zn(e),Zu(e)})}function Iu(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,w._)`${r}.evaluated`),t.if((0,w._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,w._)`${e.evaluated}.props`,(0,w._)`undefined`)),t.if((0,w._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,w._)`${e.evaluated}.items`,(0,w._)`undefined`))}function $n(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,w._)`/*# sourceURL=${r} */`:w.nil}function Au(e,t){if(Sn(e)&&(Ln(e),En(e))){zu(e,t);return}(0,zn.boolOrEmptySchema)(e,t)}function En({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function Sn(e){return typeof e.schema!="boolean"}function zu(e,t){let{schema:r,gen:i,opts:a}=e;a.$comment&&r.$comment&&Rn(e),Su(e),Lu(e);let s=i.const("_errs",O.default.errors);Zn(e,s),i.var(t,(0,w._)`${s} === ${O.default.errors}`)}function Ln(e){(0,Le.checkUnknownRules)(e),Tu(e)}function Zn(e,t){if(e.opts.jtd)return In(e,[],!1,t);let r=(0,On.getSchemaTypes)(e.schema),i=(0,On.coerceAndCheckDataType)(e,r);In(e,r,!i,t)}function Tu(e){let{schema:t,errSchemaPath:r,opts:i,self:a}=e;t.$ref&&i.ignoreKeywordsWithRef&&(0,Le.schemaHasRulesButRef)(t,a.RULES)&&a.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function Eu(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Le.checkStrictMode)(e,"default is ignored in the schema root")}function Su(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,Pu.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function Lu(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function Rn({gen:e,schemaEnv:t,schema:r,errSchemaPath:i,opts:a}){let s=r.$comment;if(a.$comment===!0)e.code((0,w._)`${O.default.self}.logger.log(${s})`);else if(typeof a.$comment=="function"){let n=(0,w.str)`${i}/$comment`,o=e.scopeValue("root",{ref:t.root});e.code((0,w._)`${O.default.self}.opts.$comment(${s}, ${n}, ${o}.schema)`)}}function Zu(e){let{gen:t,schemaEnv:r,validateName:i,ValidationError:a,opts:s}=e;r.$async?t.if((0,w._)`${O.default.errors} === 0`,()=>t.return(O.default.data),()=>t.throw((0,w._)`new ${a}(${O.default.vErrors})`)):(t.assign((0,w._)`${i}.errors`,O.default.vErrors),s.unevaluated&&Ru(e),t.return((0,w._)`${O.default.errors} === 0`))}function Ru({gen:e,evaluated:t,props:r,items:i}){r instanceof w.Name&&e.assign((0,w._)`${t}.props`,r),i instanceof w.Name&&e.assign((0,w._)`${t}.items`,i)}function In(e,t,r,i){let{gen:a,schema:s,data:n,allErrors:o,opts:p,self:c}=e,{RULES:d}=c;if(s.$ref&&(p.ignoreKeywordsWithRef||!(0,Le.schemaHasRulesButRef)(s,d))){a.block(()=>Nn(e,"$ref",d.all.$ref.definition));return}p.jtd||Cu(e,t),a.block(()=>{for(let f of d.rules)u(f);u(d.post)});function u(f){(0,Di.shouldUseGroup)(s,f)&&(f.type?(a.if((0,Or.checkDataType)(f.type,n,p.strictNumbers)),An(e,f),t.length===1&&t[0]===f.type&&r&&(a.else(),(0,Or.reportTypeError)(e)),a.endIf()):An(e,f),o||a.if((0,w._)`${O.default.errors} === ${i||0}`))}}function An(e,t){let{gen:r,schema:i,opts:{useDefaults:a}}=e;a&&(0,qu.assignDefaults)(e,t.type),r.block(()=>{for(let s of t.rules)(0,Di.shouldUseRule)(i,s)&&Nn(e,s.keyword,s.definition,t.type)})}function Cu(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(Nu(e,t),e.opts.allowUnionTypes||Du(e,t),Mu(e,e.dataTypes))}function Nu(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{Cn(e.dataTypes,r)||Mi(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),Fu(e,t)}}function Du(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&Mi(e,"use allowUnionTypes to allow union type keyword")}function Mu(e,t){let r=e.self.RULES.all;for(let i in r){let a=r[i];if(typeof a=="object"&&(0,Di.shouldUseRule)(e.schema,a)){let{type:s}=a.definition;s.length&&!s.some(n=>Gu(t,n))&&Mi(e,`missing type "${s.join(",")}" for keyword "${i}"`)}}}function Gu(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function Cn(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function Fu(e,t){let r=[];for(let i of e.dataTypes)Cn(t,i)?r.push(i):t.includes("integer")&&i==="number"&&r.push("integer");e.dataTypes=r}function Mi(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,Le.checkStrictMode)(e,t,e.opts.strictTypes)}var $r=class{constructor(t,r,i){if((0,Bt.validateKeywordUsage)(t,r,i),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=i,this.data=t.data,this.schema=t.schema[i],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Le.schemaRefOrVal)(t,this.schema,i,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",Dn(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,Bt.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${i} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",O.default.errors))}result(t,r,i){this.failResult((0,w.not)(t),r,i)}failResult(t,r,i){this.gen.if(t),i?i():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,w.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:r}=this;this.fail((0,w._)`${r} !== undefined && (${(0,w.or)(this.invalid$data(),t)})`)}error(t,r,i){if(r){this.setParams(r),this._error(t,i),this.setParams({});return}this._error(t,i)}_error(t,r){(t?Kt.reportExtraError:Kt.reportError)(this,this.def.error,r)}$dataError(){(0,Kt.reportError)(this,this.def.$dataError||Kt.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Kt.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,i=w.nil){this.gen.block(()=>{this.check$data(t,i),r()})}check$data(t=w.nil,r=w.nil){if(!this.$data)return;let{gen:i,schemaCode:a,schemaType:s,def:n}=this;i.if((0,w.or)((0,w._)`${a} === undefined`,r)),t!==w.nil&&i.assign(t,!0),(s.length||n.validateSchema)&&(i.elseIf(this.invalid$data()),this.$dataError(),t!==w.nil&&i.assign(t,!1)),i.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:i,def:a,it:s}=this;return(0,w.or)(n(),o());function n(){if(i.length){if(!(r instanceof w.Name))throw new Error("ajv implementation error");let p=Array.isArray(i)?i:[i];return(0,w._)`${(0,Or.checkDataTypes)(p,r,s.opts.strictNumbers,Or.DataType.Wrong)}`}return w.nil}function o(){if(a.validateSchema){let p=t.scopeValue("validate$data",{ref:a.validateSchema});return(0,w._)`!${p}(${r})`}return w.nil}}subschema(t,r){let i=(0,Ni.getSubschema)(this.it,t);(0,Ni.extendSubschemaData)(i,this.it,t),(0,Ni.extendSubschemaMode)(i,t);let a={...this.it,...i,items:void 0,props:void 0};return Au(a,r),a}mergeEvaluated(t,r){let{it:i,gen:a}=this;i.opts.unevaluated&&(i.props!==!0&&t.props!==void 0&&(i.props=Le.mergeEvaluated.props(a,t.props,i.props,r)),i.items!==!0&&t.items!==void 0&&(i.items=Le.mergeEvaluated.items(a,t.items,i.items,r)))}mergeValidEvaluated(t,r){let{it:i,gen:a}=this;if(i.opts.unevaluated&&(i.props!==!0||i.items!==!0))return a.if(r,()=>this.mergeEvaluated(t,w.Name)),!0}};Ge.KeywordCxt=$r;function Nn(e,t,r,i){let a=new $r(e,r,t);"code"in r?r.code(a,i):a.$data&&r.validate?(0,Bt.funcKeywordCode)(a,r):"macro"in r?(0,Bt.macroKeywordCode)(a,r):(r.compile||r.validate)&&(0,Bt.funcKeywordCode)(a,r)}var Uu=/^\/(?:[^~]|~0|~1)*$/,Vu=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Dn(e,{dataLevel:t,dataNames:r,dataPathArr:i}){let a,s;if(e==="")return O.default.rootData;if(e[0]==="/"){if(!Uu.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);a=e,s=O.default.rootData}else{let c=Vu.exec(e);if(!c)throw new Error(`Invalid JSON-pointer: ${e}`);let d=+c[1];if(a=c[2],a==="#"){if(d>=t)throw new Error(p("property/index",d));return i[t-d]}if(d>t)throw new Error(p("data",d));if(s=r[t-d],!a)return s}let n=s,o=a.split("/");for(let c of o)c&&(s=(0,w._)`${s}${(0,w.getProperty)((0,Le.unescapeJsonPointer)(c))}`,n=(0,w._)`${n} && ${s}`);return n;function p(c,d){return`Cannot access ${c} ${d} levels up, current level is ${t}`}}Ge.getData=Dn});var Jt=h(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});var Gi=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};Fi.default=Gi});var ht=h(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});var Ui=Ht(),Vi=class extends Error{constructor(t,r,i,a){super(a||`can't resolve reference ${i} from id ${r}`),this.missingRef=(0,Ui.resolveUrl)(t,r,i),this.missingSchema=(0,Ui.normalizeId)((0,Ui.getFullPath)(t,this.missingRef))}};Hi.default=Vi});var Wt=h(fe=>{"use strict";Object.defineProperty(fe,"__esModule",{value:!0});fe.resolveSchema=fe.getCompilingSchema=fe.resolveRef=fe.compileSchema=fe.SchemaEnv=void 0;var we=I(),Hu=Jt(),et=_e(),qe=Ht(),Mn=Z(),Ku=ft(),bt=class{constructor(t){var r;this.refs={},this.dynamicAnchors={};let i;typeof t.schema=="object"&&(i=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,qe.normalizeId)(i?.[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=i?.$async,this.refs={}}};fe.SchemaEnv=bt;function Bi(e){let t=Gn.call(this,e);if(t)return t;let r=(0,qe.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:i,lines:a}=this.opts.code,{ownProperties:s}=this.opts,n=new we.CodeGen(this.scope,{es5:i,lines:a,ownProperties:s}),o;e.$async&&(o=n.scopeValue("Error",{ref:Hu.default,code:(0,we._)`require("ajv/dist/runtime/validation_error").default`}));let p=n.scopeName("validate");e.validateName=p;let c={gen:n,allErrors:this.opts.allErrors,data:et.default.data,parentData:et.default.parentData,parentDataProperty:et.default.parentDataProperty,dataNames:[et.default.data],dataPathArr:[we.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:n.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,we.stringify)(e.schema)}:{ref:e.schema}),validateName:p,ValidationError:o,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:we.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,we._)`""`,opts:this.opts,self:this},d;try{this._compilations.add(e),(0,Ku.validateFunctionCode)(c),n.optimize(this.opts.code.optimize);let u=n.toString();d=`${n.scopeRefs(et.default.scope)}return ${u}`,this.opts.code.process&&(d=this.opts.code.process(d,e));let y=new Function(`${et.default.self}`,`${et.default.scope}`,d)(this,this.scope.get());if(this.scope.value(p,{ref:y}),y.errors=null,y.schema=e.schema,y.schemaEnv=e,e.$async&&(y.$async=!0),this.opts.code.source===!0&&(y.source={validateName:p,validateCode:u,scopeValues:n._values}),this.opts.unevaluated){let{props:l,items:_}=c;y.evaluated={props:l instanceof we.Name?void 0:l,items:_ instanceof we.Name?void 0:_,dynamicProps:l instanceof we.Name,dynamicItems:_ instanceof we.Name},y.source&&(y.source.evaluated=(0,we.stringify)(y.evaluated))}return e.validate=y,e}catch(u){throw delete e.validate,delete e.validateName,d&&this.logger.error("Error compiling schema, function code:",d),u}finally{this._compilations.delete(e)}}fe.compileSchema=Bi;function Bu(e,t,r){var i;r=(0,qe.resolveUrl)(this.opts.uriResolver,t,r);let a=e.refs[r];if(a)return a;let s=Qu.call(this,e,r);if(s===void 0){let n=(i=e.localRefs)===null||i===void 0?void 0:i[r],{schemaId:o}=this.opts;n&&(s=new bt({schema:n,schemaId:o,root:e,baseId:t}))}if(s!==void 0)return e.refs[r]=Ju.call(this,s)}fe.resolveRef=Bu;function Ju(e){return(0,qe.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Bi.call(this,e)}function Gn(e){for(let t of this._compilations)if(Wu(t,e))return t}fe.getCompilingSchema=Gn;function Wu(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function Qu(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||Ir.call(this,e,t)}function Ir(e,t){let r=this.opts.uriResolver.parse(t),i=(0,qe._getFullPath)(this.opts.uriResolver,r),a=(0,qe.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&i===a)return Ki.call(this,r,e);let s=(0,qe.normalizeId)(i),n=this.refs[s]||this.schemas[s];if(typeof n=="string"){let o=Ir.call(this,e,n);return typeof o?.schema!="object"?void 0:Ki.call(this,r,o)}if(typeof n?.schema=="object"){if(n.validate||Bi.call(this,n),s===(0,qe.normalizeId)(t)){let{schema:o}=n,{schemaId:p}=this.opts,c=o[p];return c&&(a=(0,qe.resolveUrl)(this.opts.uriResolver,a,c)),new bt({schema:o,schemaId:p,root:e,baseId:a})}return Ki.call(this,r,n)}}fe.resolveSchema=Ir;var Yu=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Ki(e,{baseId:t,schema:r,root:i}){var a;if(((a=e.fragment)===null||a===void 0?void 0:a[0])!=="/")return;for(let o of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let p=r[(0,Mn.unescapeFragment)(o)];if(p===void 0)return;r=p;let c=typeof r=="object"&&r[this.opts.schemaId];!Yu.has(o)&&c&&(t=(0,qe.resolveUrl)(this.opts.uriResolver,t,c))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,Mn.schemaHasRulesButRef)(r,this.RULES)){let o=(0,qe.resolveUrl)(this.opts.uriResolver,t,r.$ref);s=Ir.call(this,i,o)}let{schemaId:n}=this.opts;if(s=s||new bt({schema:r,schemaId:n,root:i,baseId:t}),s.schema!==s.root.schema)return s}});var Fn=h((oh,Xu)=>{Xu.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var ea=h((ph,Wn)=>{"use strict";var el=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Wi=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),tl=RegExp.prototype.test.bind(/^\d*$/u),tt=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),Qi=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),Vn=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),Yi=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),rl=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u),ce=new Array(256);{let e="0123456789ABCDEF";for(let t=0;t<256;t++)ce[t]="%"+e[t>>4]+e[t&15]}function ie(e){return e<2048?ce[192|e>>6]+ce[128|e&63]:e<65536?ce[224|e>>12]+ce[128|e>>6&63]+ce[128|e&63]:ce[240|e>>18]+ce[128|e>>12&63]+ce[128|e>>6&63]+ce[128|e&63]}function il(e){let t="",r=0,i=0;for(i=0;i<e.length;i++)if(r=e[i].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[i];break}for(i+=1;i<e.length;i++){if(r=e[i].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[i]}return t}var al=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),sl=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),nl=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),ol=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function pl(e){if(e.length===0)return!1;for(let t=0;t<e.length;t++)if(!nl(e[t])){if(e[t]==="%"&&t+2<e.length&&tt(e.slice(t+1,t+3))){t+=2;continue}return!1}return!0}function Un(e){let t=-1,r=0,i=-1,a=0;for(let o=0;o<e.length;o++)e[o]==="0"?(i===-1&&(i=o),a++,a>r&&(r=a,t=i)):(i=-1,a=0);if(r<2)return e.join(":");let s=e.slice(0,t).join(":"),n=e.slice(t+r).join(":");return s+"::"+n}function dl(e){let t=e.indexOf("::");if(t!==-1&&e.indexOf("::",t+1)!==-1)return;let r=t===-1?e.split(":"):e.slice(0,t).split(":"),i=t===-1?[]:e.slice(t+2).split(":");t!==-1&&(r.length===1&&r[0]===""&&(r.length=0),i.length===1&&i[0]===""&&(i.length=0));let a=r.concat(i),s=0;for(let o=0;o<a.length;o++){let p=a[o];if(p==="")return;if(p.indexOf(".")!==-1){if(o!==a.length-1||t!==-1&&i.length===0||!Wi(p))return;s+=2;continue}if(!al(p))return;a[o]=parseInt(p,16).toString(16),s++}if(t===-1)return s!==8?void 0:Un(a);if(s>=8)return;let n=a.slice(0,r.length);for(let o=s;o<8;o++)n.push("0");for(let o=r.length;o<a.length;o++)n.push(a[o]);return Un(n)}function Ji(e){let t=e[0]==="["&&e[e.length-1]==="]";if((e[0]==="["||e[e.length-1]==="]")&&!t)return{host:e,isIPV6:!1,error:!0};let i=t?e.slice(1,-1):e;if(t&&sl(i))return i=i.toLowerCase(),{host:`[${i}]`,escapedHost:i,isIPV6:!1,isIPVFuture:!0};if(cl(i,":")<2)return{host:e,isIPV6:!1,error:t};let a="",s=i.indexOf("%");if(s!==-1){let o=i.slice(s,s+3).toLowerCase()==="%25"?3:1;if(a=i.slice(s+o),!pl(a))return{host:e,isIPV6:!1,error:!0};i=i.slice(0,s)}let n=dl(i);return n===void 0?{host:e,isIPV6:!1,error:!0}:{host:n+(a?"%"+a:""),escapedHost:n+(a?"%25"+a:""),isIPV6:!0}}function cl(e,t){let r=0;for(let i=0;i<e.length;i++)e[i]===t&&r++;return r}function ul(e){let t=e,r=[],i=-1,a=0;for(;a=t.length;){if(a===1){if(t===".")break;if(t==="/"){r.push("/");break}else{r.push(t);break}}else if(a===2){if(t[0]==="."){if(t[1]===".")break;if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&(t[1]==="."||t[1]==="/")){r.push("/");break}}else if(a===3&&t==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."&&t[3]==="/"){t=t.slice(3),r.length!==0&&r.pop();continue}}if((i=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,i)),t=t.slice(i)}return r.join("")}var ll={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},yl=/[@/?#:]/g,ml=/[@/?#]/g;function Hn(e,t){let r=t?ml:yl;return r.lastIndex=0,e.replace(r,i=>ll[i])}function Kn(e,t=!1){if(e.indexOf("%")===-1)return e;let r="";for(let i=0;i<e.length;i++){if(e[i]==="%"&&i+2<e.length){let a=e.slice(i+1,i+3);if(tt(a)){let s=a.toUpperCase(),n=String.fromCharCode(parseInt(s,16));t&&Qi(n)?r+=n:r+="%"+s,i+=2;continue}}r+=e[i]}return r}function _l(e){let t="";for(let r=0;r<e.length;r++){let i=e[r];if(i==="%"&&r+2<e.length){let a=e.slice(r+1,r+3);if(tt(a)){let s=a.toUpperCase(),n=String.fromCharCode(parseInt(s,16));n!=="."&&Qi(n)?t+=n:t+="%"+s,r+=2;continue}}if(Vn(i))t+=i;else{let a=e.charCodeAt(r);if(a<128)t+=Jn(a)?i:ce[a];else if(a<55296||a>57343)t+=ie(a);else if(a<=56319&&r+1<e.length){let s=e.charCodeAt(r+1);s>=56320&&s<=57343?(t+=ie(65536+(a-55296<<10)+(s-56320)),r++):t+=ie(65533)}else t+=ie(65533)}}return t}function gl(e,t=!1){let r="",i=t&&e[0]!=="/";for(let a=0;a<e.length;a++){let s=e[a];if(s==="%"&&a+2<e.length){let n=e.slice(a+1,a+3);if(tt(n)){r+="%"+n.toUpperCase(),a+=2;continue}}if(s==="/"&&(i=!1),Vn(s)&&(s!==":"||!i))r+=s;else{let n=e.charCodeAt(a);if(n<128)r+=ce[n];else if(n<55296||n>57343)r+=ie(n);else if(n<=56319&&a+1<e.length){let o=e.charCodeAt(a+1);o>=56320&&o<=57343?(r+=ie(65536+(n-55296<<10)+(o-56320)),a++):r+=ie(65533)}else r+=ie(65533)}}return r}function Xi(e,t){let r="";for(let i=0;i<e.length;i++){let a=e[i];if(a==="%"&&i+2<e.length){let s=e.slice(i+1,i+3);if(tt(s)){r+="%"+s.toUpperCase(),i+=2;continue}}if(t(a))r+=a;else{let s=e.charCodeAt(i);if(s<128)r+=ce[s];else if(s<55296||s>57343)r+=ie(s);else if(s<=56319&&i+1<e.length){let n=e.charCodeAt(i+1);n>=56320&&n<=57343?(r+=ie(65536+(s-55296<<10)+(n-56320)),i++):r+=ie(65533)}else r+=ie(65533)}}return r}function Bn(e){return Xi(e,rl)}function fl(e){return Xi(e,Yi)}function hl(e){return Xi(e,Yi)}function Jn(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===42||e===43||e===45||e===46||e===47||e===64||e===95}function bl(e){let t="";for(let r=0;r<e.length;r++){let i=e[r];if(i==="%"&&r+2<e.length){let a=e.slice(r+1,r+3);if(tt(a)){let s=a.toUpperCase(),n=String.fromCharCode(parseInt(s,16));Qi(n)?t+=n:t+="%"+s,r+=2;continue}}if(Yi(i))t+=i;else{let a=e.charCodeAt(r);if(a<128)t+=Jn(a)?i:ce[a];else if(a<55296||a>57343)t+=ie(a);else if(a<=56319&&r+1<e.length){let s=e.charCodeAt(r+1);s>=56320&&s<=57343?(t+=ie(65536+(a-55296<<10)+(s-56320)),r++):t+=ie(65533)}else t+=ie(65533)}}return t}function vl(e){let t="";for(let r=0;r<e.length;r++){if(e[r]==="%"&&r+2<e.length){let i=e.slice(r+1,r+3);if(tt(i)){t+="%"+i.toUpperCase(),r+=2;continue}}t+=escape(e[r])}return t}function jl(e){let t=[];if(e.userinfo!==void 0&&(t.push(Bn(e.userinfo)),t.push("@")),e.host!==void 0){let r=e.host;if(!Wi(r)){let i=Ji(r);i.isIPV6!==!0&&i.isIPVFuture!==!0&&(r=Kn(r,!0),i=Ji(r)),i.isIPV6===!0||i.isIPVFuture===!0?r=`[${i.escapedHost}]`:r=Hn(r,!1)}t.push(r)}if(typeof e.port=="number"||typeof e.port=="string"){let r=String(e.port);if(!tl(r))throw new TypeError("URI port is malformed.");t.push(":"),t.push(r)}return t.length?t.join(""):void 0}Wn.exports={nonSimpleDomain:ol,recomposeAuthority:jl,reescapeHostDelimiters:Hn,normalizePercentEncoding:Kn,normalizePathEncoding:_l,serializePathEncoding:gl,normalizeQueryFragmentEncoding:bl,encodeUserinfo:Bn,encodeQuery:fl,encodeFragment:hl,escapePreservingEscapes:vl,removeDotSegments:ul,isIPv4:Wi,isUUID:el,normalizeIPv6:Ji,stringArrayToHexStripped:il}});var to=h((dh,eo)=>{"use strict";var{isUUID:wl}=ea(),ql=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu,Pl=["http","https","ws","wss","urn","urn:uuid"];function kl(e){return Pl.indexOf(e)!==-1}function ta(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S"):!1}function Qn(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function Yn(e){let t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function xl(e){return e.secure=ta(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function Ol(e){if((e.port===(ta(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let t=e.resourceName.indexOf("?"),r=t===-1?e.resourceName:e.resourceName.slice(0,t);e.path=r&&r!=="/"?r:void 0,e.query=t===-1?void 0:e.resourceName.slice(t+1),e.resourceName=void 0}return e.fragment=void 0,e}function $l(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(ql);if(r&&r[0]===e.path){let i=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let a=`${i}:${t.nid||e.nid}`,s=ra(a);e.path=void 0,s&&(e=s.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function Il(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",i=e.nid.toLowerCase(),a=`${r}:${t.nid||i}`,s=ra(a);s&&(e=s.serialize(e,t));let n=e,o=e.nss;return n.path=`${i||t.nid}:${o}`,t.skipEscape=!0,n}function Al(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!wl(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function zl(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var Xn={scheme:"http",domainHost:!0,parse:Qn,serialize:Yn},Tl={scheme:"https",domainHost:Xn.domainHost,parse:Qn,serialize:Yn},Ar={scheme:"ws",domainHost:!0,parse:xl,serialize:Ol},El={scheme:"wss",domainHost:Ar.domainHost,parse:Ar.parse,serialize:Ar.serialize},Sl={scheme:"urn",parse:$l,serialize:Il,skipNormalize:!0},Ll={scheme:"urn:uuid",parse:Al,serialize:zl,skipNormalize:!0},zr={http:Xn,https:Tl,ws:Ar,wss:El,urn:Sl,"urn:uuid":Ll};Object.setPrototypeOf(zr,null);function ra(e){return e&&(zr[e]||zr[e.toLowerCase()])||void 0}eo.exports={wsIsSecure:ta,SCHEMES:zr,isValidSchemeName:kl,getSchemeHandler:ra}});var _o=h((ch,Sr)=>{"use strict";var{normalizeIPv6:no,removeDotSegments:Yt,recomposeAuthority:Zl,normalizePercentEncoding:ia,normalizePathEncoding:Rl,serializePathEncoding:ro,normalizeQueryFragmentEncoding:io,encodeQuery:Cl,encodeFragment:Nl,reescapeHostDelimiters:Dl,isIPv4:oo,nonSimpleDomain:Ml}=ea(),{SCHEMES:po,getSchemeHandler:aa}=to(),co=/^[A-Za-z][A-Za-z0-9+.-]*$/u,uo="URI scheme is malformed.";function ao(e){let t=unescape(String(e));if(!co.test(t))throw new TypeError(uo);return t}function Gl(e,t){return typeof e=="string"?e=Wl(e,t):typeof e=="object"&&(e=Er(rt(e,t),t)),e}function Fl(e,t,r){let i=r?Object.assign({scheme:"null"},r):{scheme:"null"},{parsed:a,malformedAuthorityOrPort:s,malformedPercentEncoding:n,malformedSchemeSpecific:o,malformedHost:p,malformedScheme:c}=Tr(e,i),{parsed:d,malformedAuthorityOrPort:u,malformedPercentEncoding:f,malformedSchemeSpecific:y,malformedHost:l,malformedScheme:_}=Tr(t,i);if(s||u||n||f||o||y||p||l||c||_)throw new Error(a.error||d.error||"URI is malformed.");let g=lo(a,d,i,!0),b=aa(r&&r.scheme||g.scheme),k=g.host,q=k!==void 0&&k!==""&&(oo(k)||no(k).isIPV6);yo(g,r||{},b,q);let j=k&&k.indexOf("%")!==-1&&!new RegExp("\\P{ASCII}","u").test(k);if(g.error&&!j)throw new Error(g.error);return i.skipEscape=!0,rt(g,i)}function lo(e,t,r,i){let a={};return i||(e=Er(rt(e,r),r),t=Er(rt(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(a.scheme=t.scheme,a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=Yt(t.path||""),a.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=Yt(t.path||""),a.query=t.query):(t.path?(t.path[0]==="/"?a.path=Yt(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?a.path="/"+t.path:e.path?a.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:a.path=t.path,a.path=Yt(a.path)),a.query=t.query):(a.path=e.path,t.query!==void 0?a.query=t.query:a.query=e.query),a.userinfo=e.userinfo,a.host=e.host,a.port=e.port),a.scheme=e.scheme),a.fragment=t.fragment,a}function Ul(e,t,r){let i=so(e,r),a=so(t,r);return i!==void 0&&a!==void 0&&i===a}function rt(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},i=Object.assign({},t),a=[];r.scheme&&(r.scheme=ao(r.scheme));let s=aa(i.scheme||r.scheme);s&&s.serialize&&s.serialize(r,i);let n=r.userinfo!==void 0||r.host!==void 0||r.port!==void 0,o=!i.skipEscape&&r.scheme===void 0&&!n;r.path!==void 0&&(i.skipEscape?r.path=ia(r.path):r.path=ro(r.path,o)),i.reference!=="suffix"&&r.scheme&&(r.scheme=ao(r.scheme),a.push(r.scheme,":"));let p=Zl(r);if(p!==void 0&&(i.reference!=="suffix"&&a.push("//"),a.push(p),r.path&&r.path[0]!=="/"&&a.push("/")),r.path!==void 0){let c=r.path;!i.absolutePath&&(!s||!s.absolutePath)&&(c=Yt(c)),o&&(c=ro(c,!0)),p===void 0&&c[0]==="/"&&c[1]==="/"&&(c="/%2F"+c.slice(2)),a.push(c)}return r.query!==void 0&&a.push("?",Cl(r.query)),r.fragment!==void 0&&a.push("#",Nl(r.fragment)),a.join("")}var Vl=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,Hl=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,Kl=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function Bl(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof e.port=="number"&&(e.port<0||e.port>65535))return"URI port is malformed."}function Qt(e){if(e===void 0)return!1;let t=e.indexOf("%");for(;t!==-1;){if(t+2>=e.length||!/^[\da-f]{2}$/iu.test(e.slice(t+1,t+3)))return!0;t=e.indexOf("%",t+3)}return!1}function sa(e){return e[0]==="["&&e[e.length-1]==="]"}function Jl(e){let t=e[4];return Qt(e[3])||t!==void 0&&!sa(t)&&Qt(t)||Qt(e[6])||Qt(e[7])||Qt(e[8])}function yo(e,t,r,i){if(!t.unicodeSupport&&(!r||!r.unicodeSupport)&&e.host&&!sa(e.host)&&(t.domainHost||r&&r.domainHost)&&i===!1&&Ml(e.host))try{e.host=new URL("http://"+e.host).hostname}catch(a){return e.error=e.error||"Host's domain name can not be converted to ASCII: "+a,!0}return!1}function Tr(e,t){let r=Object.assign({},t),i={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},a=!1,s=!1,n=!1,o=!1,p=!1,c=!1,d=!1;r.reference==="suffix"&&(r.scheme?e=r.scheme+":"+e:e="//"+e);let u=e.match(Hl);u!==null&&u[1].indexOf("\\")!==-1&&(i.error="URI authority must not contain a literal backslash.",a=!0);let f=e.match(Kl);if(f!==null){let l=f[1],_=l.replace(/[\t\n\r]/g,"");_.length>=2&&(_.slice(0,2)!=="//"?(i.error=i.error||"URI authority must not contain a literal backslash.",a=!0):l.length!==_.length&&(i.error=i.error||"URI authority introducer must not contain whitespace.",a=!0))}let y=e.match(Vl);if(y){if(i.scheme=y[1],i.userinfo=y[3],i.host=y[4],i.port=parseInt(y[5],10),i.path=y[6]||"",i.query=y[7],i.fragment=y[8],i.scheme!==void 0){let g=unescape(i.scheme);co.test(g)?i.scheme=g.toLowerCase():(i.error=i.error||uo,c=!0)}s=Jl(y),s&&(i.error=i.error||"URI contains malformed percent-encoding."),isNaN(i.port)&&(i.port=y[5]);let l=Bl(i,y);if(l!==void 0&&(i.error=i.error||l,a=!0),i.host)if(oo(i.host)===!1){let b=sa(i.host),k=i.host.indexOf("[")!==-1||i.host.indexOf("]")!==-1,q=no(i.host);d=q.isIPV6||q.isIPVFuture===!0,p=k&&(!b||q.error===!0),i.host=d?q.host:q.host.toLowerCase(),p&&(i.error=i.error||"URI host is malformed.",a=!0)}else d=!0;i.scheme===void 0&&i.userinfo===void 0&&i.host===void 0&&i.port===void 0&&i.query===void 0&&!i.path?i.reference="same-document":i.scheme===void 0?i.reference="relative":i.fragment===void 0?i.reference="absolute":i.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==i.reference&&(i.error=i.error||"URI is not a "+r.reference+" reference.");let _=aa(r.scheme||i.scheme);if(p||(o=yo(i,r,_,d)),e.indexOf("%")!==-1&&i.host!==void 0&&!p){let g=d?i.host:ia(i.host,!0);d||(g=ia(g.toLowerCase())),i.host=Dl(g,d)}(!_||_&&!_.skipNormalize)&&(i.path&&(i.path=Rl(i.path)),i.query&&(i.query=io(i.query)),i.fragment&&(i.fragment=io(i.fragment))),_&&_.parse&&(_.parse(i,r),_===po.urn&&i.nid===void 0&&(n=!0))}else i.error=i.error||"URI can not be parsed.";return{parsed:i,malformedAuthorityOrPort:a,malformedPercentEncoding:s,malformedSchemeSpecific:n,malformedHost:o,malformedScheme:c}}function Er(e,t){return Tr(e,t).parsed}function Wl(e,t){return mo(e,t).normalized}function mo(e,t){let{parsed:r,malformedAuthorityOrPort:i,malformedPercentEncoding:a,malformedSchemeSpecific:s,malformedHost:n,malformedScheme:o}=Tr(e,t);return{normalized:i||a||s||n||o?e:rt(r,t),malformedAuthorityOrPort:i,malformedPercentEncoding:a,malformedSchemeSpecific:s,malformedHost:n,malformedScheme:o}}function so(e,t){if(typeof e!="string"&&typeof e!="object")return;let r;try{r=typeof e=="string"?e:rt(e,t)}catch{return}let{normalized:i,malformedAuthorityOrPort:a,malformedPercentEncoding:s,malformedSchemeSpecific:n,malformedHost:o,malformedScheme:p}=mo(r,t);return a||s||n||o||p?void 0:i}var na={SCHEMES:po,normalize:Gl,resolve:Fl,resolveComponent:lo,equal:Ul,serialize:rt,parse:Er};Sr.exports=na;Sr.exports.default=na;Sr.exports.fastUri=na});var fo=h(oa=>{"use strict";Object.defineProperty(oa,"__esModule",{value:!0});var go=_o();go.code='require("ajv/dist/runtime/uri").default';oa.default=go});var ca=h(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.CodeGen=Q.Name=Q.nil=Q.stringify=Q.str=Q._=Q.KeywordCxt=void 0;var Ql=ft();Object.defineProperty(Q,"KeywordCxt",{enumerable:!0,get:function(){return Ql.KeywordCxt}});var vt=I();Object.defineProperty(Q,"_",{enumerable:!0,get:function(){return vt._}});Object.defineProperty(Q,"str",{enumerable:!0,get:function(){return vt.str}});Object.defineProperty(Q,"stringify",{enumerable:!0,get:function(){return vt.stringify}});Object.defineProperty(Q,"nil",{enumerable:!0,get:function(){return vt.nil}});Object.defineProperty(Q,"Name",{enumerable:!0,get:function(){return vt.Name}});Object.defineProperty(Q,"CodeGen",{enumerable:!0,get:function(){return vt.CodeGen}});var Yl=Jt(),wo=ht(),Xl=Ii(),Xt=Wt(),ey=I(),er=Ht(),Lr=Vt(),da=Z(),ho=Fn(),ty=fo(),qo=(e,t)=>new RegExp(e,t);qo.code="new RegExp";var ry=["removeAdditional","useDefaults","coerceTypes"],iy=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),ay={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},sy={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},bo=200;function ny(e){var t,r,i,a,s,n,o,p,c,d,u,f,y,l,_,g,b,k,q,j,P,D,le,pt,ye;let W=e.strict,Ke=(t=e.code)===null||t===void 0?void 0:t.optimize,v=Ke===!0||Ke===void 0?1:Ke||0,x=(i=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&i!==void 0?i:qo,$=(a=e.uriResolver)!==null&&a!==void 0?a:ty.default;return{strictSchema:(n=(s=e.strictSchema)!==null&&s!==void 0?s:W)!==null&&n!==void 0?n:!0,strictNumbers:(p=(o=e.strictNumbers)!==null&&o!==void 0?o:W)!==null&&p!==void 0?p:!0,strictTypes:(d=(c=e.strictTypes)!==null&&c!==void 0?c:W)!==null&&d!==void 0?d:"log",strictTuples:(f=(u=e.strictTuples)!==null&&u!==void 0?u:W)!==null&&f!==void 0?f:"log",strictRequired:(l=(y=e.strictRequired)!==null&&y!==void 0?y:W)!==null&&l!==void 0?l:!1,code:e.code?{...e.code,optimize:v,regExp:x}:{optimize:v,regExp:x},loopRequired:(_=e.loopRequired)!==null&&_!==void 0?_:bo,loopEnum:(g=e.loopEnum)!==null&&g!==void 0?g:bo,meta:(b=e.meta)!==null&&b!==void 0?b:!0,messages:(k=e.messages)!==null&&k!==void 0?k:!0,inlineRefs:(q=e.inlineRefs)!==null&&q!==void 0?q:!0,schemaId:(j=e.schemaId)!==null&&j!==void 0?j:"$id",addUsedSchema:(P=e.addUsedSchema)!==null&&P!==void 0?P:!0,validateSchema:(D=e.validateSchema)!==null&&D!==void 0?D:!0,validateFormats:(le=e.validateFormats)!==null&&le!==void 0?le:!0,unicodeRegExp:(pt=e.unicodeRegExp)!==null&&pt!==void 0?pt:!0,int32range:(ye=e.int32range)!==null&&ye!==void 0?ye:!0,uriResolver:$}}var tr=class{constructor(t={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...ny(t)};let{es5:r,lines:i}=this.opts.code;this.scope=new ey.ValueScope({scope:{},prefixes:iy,es5:r,lines:i}),this.logger=ly(t.logger);let a=t.validateFormats;t.validateFormats=!1,this.RULES=(0,Xl.getRules)(),vo.call(this,ay,t,"NOT SUPPORTED"),vo.call(this,sy,t,"DEPRECATED","warn"),this._metaOpts=cy.call(this),t.formats&&py.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&dy.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),oy.call(this),t.validateFormats=a}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:i}=this.opts,a=ho;i==="id"&&(a={...ho},a.id=a.$id,delete a.$id),r&&t&&this.addMetaSchema(a,a[i],!1)}defaultMeta(){let{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[r]||t:void 0}validate(t,r){let i;if(typeof t=="string"){if(i=this.getSchema(t),!i)throw new Error(`no schema with key or ref "${t}"`)}else i=this.compile(t);let a=i(r);return"$async"in i||(this.errors=i.errors),a}compile(t,r){let i=this._addSchema(t,r);return i.validate||this._compileSchemaEnv(i)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:i}=this.opts;return a.call(this,t,r);async function a(d,u){await s.call(this,d.$schema);let f=this._addSchema(d,u);return f.validate||n.call(this,f)}async function s(d){d&&!this.getSchema(d)&&await a.call(this,{$ref:d},!0)}async function n(d){try{return this._compileSchemaEnv(d)}catch(u){if(!(u instanceof wo.default))throw u;return o.call(this,u),await p.call(this,u.missingSchema),n.call(this,d)}}function o({missingSchema:d,missingRef:u}){if(this.refs[d])throw new Error(`AnySchema ${d} is loaded but ${u} cannot be resolved`)}async function p(d){let u=await c.call(this,d);this.refs[d]||await s.call(this,u.$schema),this.refs[d]||this.addSchema(u,d,r)}async function c(d){let u=this._loading[d];if(u)return u;try{return await(this._loading[d]=i(d))}finally{delete this._loading[d]}}}addSchema(t,r,i,a=this.opts.validateSchema){if(Array.isArray(t)){for(let n of t)this.addSchema(n,void 0,i,a);return this}let s;if(typeof t=="object"){let{schemaId:n}=this.opts;if(s=t[n],s!==void 0&&typeof s!="string")throw new Error(`schema ${n} must be string`)}return r=(0,er.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(t,i,r,a,!0),this}addMetaSchema(t,r,i=this.opts.validateSchema){return this.addSchema(t,r,!0,i),this}validateSchema(t,r){if(typeof t=="boolean")return!0;let i;if(i=t.$schema,i!==void 0&&typeof i!="string")throw new Error("$schema must be a string");if(i=i||this.opts.defaultMeta||this.defaultMeta(),!i)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let a=this.validate(i,t);if(!a&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return a}getSchema(t){let r;for(;typeof(r=jo.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:i}=this.opts,a=new Xt.SchemaEnv({schema:{},schemaId:i});if(r=Xt.resolveSchema.call(this,a,t),!r)return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=jo.call(this,t);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{let r=t;this._cache.delete(r);let i=t[this.opts.schemaId];return i&&(i=(0,er.normalizeId)(i),delete this.schemas[i],delete this.refs[i]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let r of t)this.addKeyword(r);return this}addKeyword(t,r){let i;if(typeof t=="string")i=t,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=i);else if(typeof t=="object"&&r===void 0){if(r=t,i=r.keyword,Array.isArray(i)&&!i.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(my.call(this,i,r),!r)return(0,da.eachItem)(i,s=>pa.call(this,s)),this;gy.call(this,r);let a={...r,type:(0,Lr.getJSONTypes)(r.type),schemaType:(0,Lr.getJSONTypes)(r.schemaType)};return(0,da.eachItem)(i,a.type.length===0?s=>pa.call(this,s,a):s=>a.type.forEach(n=>pa.call(this,s,a,n))),this}getKeyword(t){let r=this.RULES.all[t];return typeof r=="object"?r.definition:!!r}removeKeyword(t){let{RULES:r}=this;delete r.keywords[t],delete r.all[t];for(let i of r.rules){let a=i.rules.findIndex(s=>s.keyword===t);a>=0&&i.rules.splice(a,1)}return this}addFormat(t,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[t]=r,this}errorsText(t=this.errors,{separator:r=", ",dataVar:i="data"}={}){return!t||t.length===0?"No errors":t.map(a=>`${i}${a.instancePath} ${a.message}`).reduce((a,s)=>a+r+s)}$dataMetaSchema(t,r){let i=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let a of r){let s=a.split("/").slice(1),n=t;for(let o of s)n=n[o];for(let o in i){let p=i[o];if(typeof p!="object")continue;let{$data:c}=p.definition,d=n[o];c&&d&&(n[o]=Po(d))}}return t}_removeAllSchemas(t,r){for(let i in t){let a=t[i];(!r||r.test(i))&&(typeof a=="string"?delete t[i]:a&&!a.meta&&(this._cache.delete(a.schema),delete t[i]))}}_addSchema(t,r,i,a=this.opts.validateSchema,s=this.opts.addUsedSchema){let n,{schemaId:o}=this.opts;if(typeof t=="object")n=t[o];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof t!="boolean")throw new Error("schema must be object or boolean")}let p=this._cache.get(t);if(p!==void 0)return p;i=(0,er.normalizeId)(n||i);let c=er.getSchemaRefs.call(this,t,i);return p=new Xt.SchemaEnv({schema:t,schemaId:o,meta:r,baseId:i,localRefs:c}),this._cache.set(p.schema,p),s&&!i.startsWith("#")&&(i&&this._checkUnique(i),this.refs[i]=p),a&&this.validateSchema(t,!0),p}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):Xt.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let r=this.opts;this.opts=this._metaOpts;try{Xt.compileSchema.call(this,t)}finally{this.opts=r}}};tr.ValidationError=Yl.default;tr.MissingRefError=wo.default;Q.default=tr;function vo(e,t,r,i="error"){for(let a in e){let s=a;s in t&&this.logger[i](`${r}: option ${a}. ${e[s]}`)}}function jo(e){return e=(0,er.normalizeId)(e),this.schemas[e]||this.refs[e]}function oy(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function py(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function dy(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}function cy(){let e={...this.opts};for(let t of ry)delete e[t];return e}var uy={log(){},warn(){},error(){}};function ly(e){if(e===!1)return uy;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}var yy=/^[a-z_$][a-z0-9_$:-]*$/i;function my(e,t){let{RULES:r}=this;if((0,da.eachItem)(e,i=>{if(r.keywords[i])throw new Error(`Keyword ${i} is already defined`);if(!yy.test(i))throw new Error(`Keyword ${i} has invalid name`)}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function pa(e,t,r){var i;let a=t?.post;if(r&&a)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,n=a?s.post:s.rules.find(({type:p})=>p===r);if(n||(n={type:r,rules:[]},s.rules.push(n)),s.keywords[e]=!0,!t)return;let o={keyword:e,definition:{...t,type:(0,Lr.getJSONTypes)(t.type),schemaType:(0,Lr.getJSONTypes)(t.schemaType)}};t.before?_y.call(this,n,o,t.before):n.rules.push(o),s.all[e]=o,(i=t.implements)===null||i===void 0||i.forEach(p=>this.addKeyword(p))}function _y(e,t,r){let i=e.rules.findIndex(a=>a.keyword===r);i>=0?e.rules.splice(i,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function gy(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=Po(t)),e.validateSchema=this.compile(t,!0))}var fy={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Po(e){return{anyOf:[e,fy]}}});var ko=h(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});var hy={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};ua.default=hy});var Cr=h(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.callRef=it.getValidate=void 0;var by=ht(),xo=ge(),ue=I(),jt=_e(),Oo=Wt(),Zr=Z(),vy={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:i}=e,{baseId:a,schemaEnv:s,validateName:n,opts:o,self:p}=i,{root:c}=s;if((r==="#"||r==="#/")&&a===c.baseId)return u();let d=Oo.resolveRef.call(p,c,a,r);if(d===void 0)throw new by.default(i.opts.uriResolver,a,r);if(d instanceof Oo.SchemaEnv)return f(d);return y(d);function u(){if(s===c)return Rr(e,n,s,s.$async);let l=t.scopeValue("root",{ref:c});return Rr(e,(0,ue._)`${l}.validate`,c,c.$async)}function f(l){let _=$o(e,l);Rr(e,_,l,l.$async)}function y(l){let _=t.scopeValue("schema",o.code.source===!0?{ref:l,code:(0,ue.stringify)(l)}:{ref:l}),g=t.name("valid"),b=e.subschema({schema:l,dataTypes:[],schemaPath:ue.nil,topSchemaRef:_,errSchemaPath:r},g);e.mergeEvaluated(b),e.ok(g)}}};function $o(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,ue._)`${r.scopeValue("wrapper",{ref:t})}.validate`}it.getValidate=$o;function Rr(e,t,r,i){let{gen:a,it:s}=e,{allErrors:n,schemaEnv:o,opts:p}=s,c=p.passContext?jt.default.this:ue.nil;i?d():u();function d(){if(!o.$async)throw new Error("async schema referenced by sync schema");let l=a.let("valid");a.try(()=>{a.code((0,ue._)`await ${(0,xo.callValidateCode)(e,t,c)}`),y(t),n||a.assign(l,!0)},_=>{a.if((0,ue._)`!(${_} instanceof ${s.ValidationError})`,()=>a.throw(_)),f(_),n||a.assign(l,!1)}),e.ok(l)}function u(){e.result((0,xo.callValidateCode)(e,t,c),()=>y(t),()=>f(t))}function f(l){let _=(0,ue._)`${l}.errors`;a.assign(jt.default.vErrors,(0,ue._)`${jt.default.vErrors} === null ? ${_} : ${jt.default.vErrors}.concat(${_})`),a.assign(jt.default.errors,(0,ue._)`${jt.default.vErrors}.length`)}function y(l){var _;if(!s.opts.unevaluated)return;let g=(_=r?.validate)===null||_===void 0?void 0:_.evaluated;if(s.props!==!0)if(g&&!g.dynamicProps)g.props!==void 0&&(s.props=Zr.mergeEvaluated.props(a,g.props,s.props));else{let b=a.var("props",(0,ue._)`${l}.evaluated.props`);s.props=Zr.mergeEvaluated.props(a,b,s.props,ue.Name)}if(s.items!==!0)if(g&&!g.dynamicItems)g.items!==void 0&&(s.items=Zr.mergeEvaluated.items(a,g.items,s.items));else{let b=a.var("items",(0,ue._)`${l}.evaluated.items`);s.items=Zr.mergeEvaluated.items(a,b,s.items,ue.Name)}}}it.callRef=Rr;it.default=vy});var ya=h(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});var jy=ko(),wy=Cr(),qy=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",jy.default,wy.default];la.default=qy});var Io=h(ma=>{"use strict";Object.defineProperty(ma,"__esModule",{value:!0});var Nr=I(),Fe=Nr.operators,Dr={maximum:{okStr:"<=",ok:Fe.LTE,fail:Fe.GT},minimum:{okStr:">=",ok:Fe.GTE,fail:Fe.LT},exclusiveMaximum:{okStr:"<",ok:Fe.LT,fail:Fe.GTE},exclusiveMinimum:{okStr:">",ok:Fe.GT,fail:Fe.LTE}},Py={message:({keyword:e,schemaCode:t})=>(0,Nr.str)`must be ${Dr[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Nr._)`{comparison: ${Dr[e].okStr}, limit: ${t}}`},ky={keyword:Object.keys(Dr),type:"number",schemaType:"number",$data:!0,error:Py,code(e){let{keyword:t,data:r,schemaCode:i}=e;e.fail$data((0,Nr._)`${r} ${Dr[t].fail} ${i} || isNaN(${r})`)}};ma.default=ky});var Ao=h(_a=>{"use strict";Object.defineProperty(_a,"__esModule",{value:!0});var rr=I(),xy={message:({schemaCode:e})=>(0,rr.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,rr._)`{multipleOf: ${e}}`},Oy={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:xy,code(e){let{gen:t,data:r,schemaCode:i,it:a}=e,s=a.opts.multipleOfPrecision,n=t.let("res"),o=s?(0,rr._)`Math.abs(Math.round(${n}) - ${n}) > 1e-${s}`:(0,rr._)`${n} !== parseInt(${n})`;e.fail$data((0,rr._)`(${i} === 0 || (${n} = ${r}/${i}, ${o}))`)}};_a.default=Oy});var To=h(ga=>{"use strict";Object.defineProperty(ga,"__esModule",{value:!0});function zo(e){let t=e.length,r=0,i=0,a;for(;i<t;)r++,a=e.charCodeAt(i++),a>=55296&&a<=56319&&i<t&&(a=e.charCodeAt(i),(a&64512)===56320&&i++);return r}ga.default=zo;zo.code='require("ajv/dist/runtime/ucs2length").default'});var Eo=h(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});var at=I(),$y=Z(),Iy=To(),Ay={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,at.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,at._)`{limit: ${e}}`},zy={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Ay,code(e){let{keyword:t,data:r,schemaCode:i,it:a}=e,s=t==="maxLength"?at.operators.GT:at.operators.LT,n=a.opts.unicode===!1?(0,at._)`${r}.length`:(0,at._)`${(0,$y.useFunc)(e.gen,Iy.default)}(${r})`;e.fail$data((0,at._)`${n} ${s} ${i}`)}};fa.default=zy});var So=h(ha=>{"use strict";Object.defineProperty(ha,"__esModule",{value:!0});var Ty=ge(),Ey=Z(),wt=I(),Sy={message:({schemaCode:e})=>(0,wt.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,wt._)`{pattern: ${e}}`},Ly={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Sy,code(e){let{gen:t,data:r,$data:i,schema:a,schemaCode:s,it:n}=e,o=n.opts.unicodeRegExp?"u":"";if(i){let{regExp:p}=n.opts.code,c=p.code==="new RegExp"?(0,wt._)`new RegExp`:(0,Ey.useFunc)(t,p),d=t.let("valid");t.try(()=>t.assign(d,(0,wt._)`${c}(${s}, ${o}).test(${r})`),()=>t.assign(d,!1)),e.fail$data((0,wt._)`!${d}`)}else{let p=(0,Ty.usePattern)(e,a);e.fail$data((0,wt._)`!${p}.test(${r})`)}}};ha.default=Ly});var Lo=h(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});var ir=I(),Zy={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,ir.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,ir._)`{limit: ${e}}`},Ry={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Zy,code(e){let{keyword:t,data:r,schemaCode:i}=e,a=t==="maxProperties"?ir.operators.GT:ir.operators.LT;e.fail$data((0,ir._)`Object.keys(${r}).length ${a} ${i}`)}};ba.default=Ry});var Zo=h(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});var ar=ge(),sr=I(),Cy=Z(),Ny={message:({params:{missingProperty:e}})=>(0,sr.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,sr._)`{missingProperty: ${e}}`},Dy={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Ny,code(e){let{gen:t,schema:r,schemaCode:i,data:a,$data:s,it:n}=e,{opts:o}=n;if(!s&&r.length===0)return;let p=r.length>=o.loopRequired;if(n.allErrors?c():d(),o.strictRequired){let y=e.parentSchema.properties,{definedProperties:l}=e.it;for(let _ of r)if(y?.[_]===void 0&&!l.has(_)){let g=n.schemaEnv.baseId+n.errSchemaPath,b=`required property "${_}" is not defined at "${g}" (strictRequired)`;(0,Cy.checkStrictMode)(n,b,n.opts.strictRequired)}}function c(){if(p||s)e.block$data(sr.nil,u);else for(let y of r)(0,ar.checkReportMissingProp)(e,y)}function d(){let y=t.let("missing");if(p||s){let l=t.let("valid",!0);e.block$data(l,()=>f(y,l)),e.ok(l)}else t.if((0,ar.checkMissingProp)(e,r,y)),(0,ar.reportMissingProp)(e,y),t.else()}function u(){t.forOf("prop",i,y=>{e.setParams({missingProperty:y}),t.if((0,ar.noPropertyInData)(t,a,y,o.ownProperties),()=>e.error())})}function f(y,l){e.setParams({missingProperty:y}),t.forOf(y,i,()=>{t.assign(l,(0,ar.propertyInData)(t,a,y,o.ownProperties)),t.if((0,sr.not)(l),()=>{e.error(),t.break()})},sr.nil)}}};va.default=Dy});var Ro=h(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});var nr=I(),My={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,nr.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,nr._)`{limit: ${e}}`},Gy={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:My,code(e){let{keyword:t,data:r,schemaCode:i}=e,a=t==="maxItems"?nr.operators.GT:nr.operators.LT;e.fail$data((0,nr._)`${r}.length ${a} ${i}`)}};ja.default=Gy});var Mr=h(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});var Co=Ri();Co.code='require("ajv/dist/runtime/equal").default';wa.default=Co});var No=h(Pa=>{"use strict";Object.defineProperty(Pa,"__esModule",{value:!0});var qa=Vt(),Y=I(),Fy=Z(),Uy=Mr(),Vy={message:({params:{i:e,j:t}})=>(0,Y.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,Y._)`{i: ${e}, j: ${t}}`},Hy={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Vy,code(e){let{gen:t,data:r,$data:i,schema:a,parentSchema:s,schemaCode:n,it:o}=e;if(!i&&!a)return;let p=t.let("valid"),c=s.items?(0,qa.getSchemaTypes)(s.items):[];e.block$data(p,d,(0,Y._)`${n} === false`),e.ok(p);function d(){let l=t.let("i",(0,Y._)`${r}.length`),_=t.let("j");e.setParams({i:l,j:_}),t.assign(p,!0),t.if((0,Y._)`${l} > 1`,()=>(u()?f:y)(l,_))}function u(){return c.length>0&&!c.some(l=>l==="object"||l==="array")}function f(l,_){let g=t.name("item"),b=(0,qa.checkDataTypes)(c,g,o.opts.strictNumbers,qa.DataType.Wrong),k=t.const("indices",(0,Y._)`{}`);t.for((0,Y._)`;${l}--;`,()=>{t.let(g,(0,Y._)`${r}[${l}]`),t.if(b,(0,Y._)`continue`),c.length>1&&t.if((0,Y._)`typeof ${g} == "string"`,(0,Y._)`${g} += "_"`),t.if((0,Y._)`typeof ${k}[${g}] == "number"`,()=>{t.assign(_,(0,Y._)`${k}[${g}]`),e.error(),t.assign(p,!1).break()}).code((0,Y._)`${k}[${g}] = ${l}`)})}function y(l,_){let g=(0,Fy.useFunc)(t,Uy.default),b=t.name("outer");t.label(b).for((0,Y._)`;${l}--;`,()=>t.for((0,Y._)`${_} = ${l}; ${_}--;`,()=>t.if((0,Y._)`${g}(${r}[${l}], ${r}[${_}])`,()=>{e.error(),t.assign(p,!1).break(b)})))}}};Pa.default=Hy});var Do=h(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});var ka=I(),Ky=Z(),By=Mr(),Jy={message:"must be equal to constant",params:({schemaCode:e})=>(0,ka._)`{allowedValue: ${e}}`},Wy={keyword:"const",$data:!0,error:Jy,code(e){let{gen:t,data:r,$data:i,schemaCode:a,schema:s}=e;i||s&&typeof s=="object"?e.fail$data((0,ka._)`!${(0,Ky.useFunc)(t,By.default)}(${r}, ${a})`):e.fail((0,ka._)`${s} !== ${r}`)}};xa.default=Wy});var Mo=h(Oa=>{"use strict";Object.defineProperty(Oa,"__esModule",{value:!0});var or=I(),Qy=Z(),Yy=Mr(),Xy={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,or._)`{allowedValues: ${e}}`},em={keyword:"enum",schemaType:"array",$data:!0,error:Xy,code(e){let{gen:t,data:r,$data:i,schema:a,schemaCode:s,it:n}=e;if(!i&&a.length===0)throw new Error("enum must have non-empty array");let o=a.length>=n.opts.loopEnum,p,c=()=>p??(p=(0,Qy.useFunc)(t,Yy.default)),d;if(o||i)d=t.let("valid"),e.block$data(d,u);else{if(!Array.isArray(a))throw new Error("ajv implementation error");let y=t.const("vSchema",s);d=(0,or.or)(...a.map((l,_)=>f(y,_)))}e.pass(d);function u(){t.assign(d,!1),t.forOf("v",s,y=>t.if((0,or._)`${c()}(${r}, ${y})`,()=>t.assign(d,!0).break()))}function f(y,l){let _=a[l];return typeof _=="object"&&_!==null?(0,or._)`${c()}(${r}, ${y}[${l}])`:(0,or._)`${r} === ${_}`}}};Oa.default=em});var Ia=h($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});var tm=Io(),rm=Ao(),im=Eo(),am=So(),sm=Lo(),nm=Zo(),om=Ro(),pm=No(),dm=Do(),cm=Mo(),um=[tm.default,rm.default,im.default,am.default,sm.default,nm.default,om.default,pm.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},dm.default,cm.default];$a.default=um});var za=h(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.validateAdditionalItems=void 0;var st=I(),Aa=Z(),lm={message:({params:{len:e}})=>(0,st.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,st._)`{limit: ${e}}`},ym={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:lm,code(e){let{parentSchema:t,it:r}=e,{items:i}=t;if(!Array.isArray(i)){(0,Aa.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Go(e,i)}};function Go(e,t){let{gen:r,schema:i,data:a,keyword:s,it:n}=e;n.items=!0;let o=r.const("len",(0,st._)`${a}.length`);if(i===!1)e.setParams({len:t.length}),e.pass((0,st._)`${o} <= ${t.length}`);else if(typeof i=="object"&&!(0,Aa.alwaysValidSchema)(n,i)){let c=r.var("valid",(0,st._)`${o} <= ${t.length}`);r.if((0,st.not)(c),()=>p(c)),e.ok(c)}function p(c){r.forRange("i",t.length,o,d=>{e.subschema({keyword:s,dataProp:d,dataPropType:Aa.Type.Num},c),n.allErrors||r.if((0,st.not)(c),()=>r.break())})}}pr.validateAdditionalItems=Go;pr.default=ym});var Ta=h(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});dr.validateTuple=void 0;var Fo=I(),Gr=Z(),mm=ge(),_m={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return Uo(e,"additionalItems",t);r.items=!0,!(0,Gr.alwaysValidSchema)(r,t)&&e.ok((0,mm.validateArray)(e))}};function Uo(e,t,r=e.schema){let{gen:i,parentSchema:a,data:s,keyword:n,it:o}=e;d(a),o.opts.unevaluated&&r.length&&o.items!==!0&&(o.items=Gr.mergeEvaluated.items(i,r.length,o.items));let p=i.name("valid"),c=i.const("len",(0,Fo._)`${s}.length`);r.forEach((u,f)=>{(0,Gr.alwaysValidSchema)(o,u)||(i.if((0,Fo._)`${c} > ${f}`,()=>e.subschema({keyword:n,schemaProp:f,dataProp:f},p)),e.ok(p))});function d(u){let{opts:f,errSchemaPath:y}=o,l=r.length,_=l===u.minItems&&(l===u.maxItems||u[t]===!1);if(f.strictTuples&&!_){let g=`"${n}" is ${l}-tuple, but minItems or maxItems/${t} are not specified or different at path "${y}"`;(0,Gr.checkStrictMode)(o,g,f.strictTuples)}}}dr.validateTuple=Uo;dr.default=_m});var Vo=h(Ea=>{"use strict";Object.defineProperty(Ea,"__esModule",{value:!0});var gm=Ta(),fm={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,gm.validateTuple)(e,"items")};Ea.default=fm});var Ko=h(Sa=>{"use strict";Object.defineProperty(Sa,"__esModule",{value:!0});var Ho=I(),hm=Z(),bm=ge(),vm=za(),jm={message:({params:{len:e}})=>(0,Ho.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Ho._)`{limit: ${e}}`},wm={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:jm,code(e){let{schema:t,parentSchema:r,it:i}=e,{prefixItems:a}=r;i.items=!0,!(0,hm.alwaysValidSchema)(i,t)&&(a?(0,vm.validateAdditionalItems)(e,a):e.ok((0,bm.validateArray)(e)))}};Sa.default=wm});var Bo=h(La=>{"use strict";Object.defineProperty(La,"__esModule",{value:!0});var he=I(),Fr=Z(),qm={message:({params:{min:e,max:t}})=>t===void 0?(0,he.str)`must contain at least ${e} valid item(s)`:(0,he.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,he._)`{minContains: ${e}}`:(0,he._)`{minContains: ${e}, maxContains: ${t}}`},Pm={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:qm,code(e){let{gen:t,schema:r,parentSchema:i,data:a,it:s}=e,n,o,{minContains:p,maxContains:c}=i;s.opts.next?(n=p===void 0?1:p,o=c):n=1;let d=t.const("len",(0,he._)`${a}.length`);if(e.setParams({min:n,max:o}),o===void 0&&n===0){(0,Fr.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(o!==void 0&&n>o){(0,Fr.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,Fr.alwaysValidSchema)(s,r)){let _=(0,he._)`${d} >= ${n}`;o!==void 0&&(_=(0,he._)`${_} && ${d} <= ${o}`),e.pass(_);return}s.items=!0;let u=t.name("valid");o===void 0&&n===1?y(u,()=>t.if(u,()=>t.break())):n===0?(t.let(u,!0),o!==void 0&&t.if((0,he._)`${a}.length > 0`,f)):(t.let(u,!1),f()),e.result(u,()=>e.reset());function f(){let _=t.name("_valid"),g=t.let("count",0);y(_,()=>t.if(_,()=>l(g)))}function y(_,g){t.forRange("i",0,d,b=>{e.subschema({keyword:"contains",dataProp:b,dataPropType:Fr.Type.Num,compositeRule:!0},_),g()})}function l(_){t.code((0,he._)`${_}++`),o===void 0?t.if((0,he._)`${_} >= ${n}`,()=>t.assign(u,!0).break()):(t.if((0,he._)`${_} > ${o}`,()=>t.assign(u,!1).break()),n===1?t.assign(u,!0):t.if((0,he._)`${_} >= ${n}`,()=>t.assign(u,!0)))}}};La.default=Pm});var Ur=h(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.validateSchemaDeps=Ie.validatePropertyDeps=Ie.error=void 0;var Za=I(),km=Z(),cr=ge();Ie.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let i=t===1?"property":"properties";return(0,Za.str)`must have ${i} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:i}})=>(0,Za._)`{property: ${e},
|
|
7
|
+
missingProperty: ${i},
|
|
8
|
+
depsCount: ${t},
|
|
9
|
+
deps: ${r}}`};var xm={keyword:"dependencies",type:"object",schemaType:"object",error:Ie.error,code(e){let[t,r]=Om(e);Jo(e,t),Wo(e,r)}};function Om({schema:e}){let t={},r={};for(let i in e){if(i==="__proto__")continue;let a=Array.isArray(e[i])?t:r;a[i]=e[i]}return[t,r]}function Jo(e,t=e.schema){let{gen:r,data:i,it:a}=e;if(Object.keys(t).length===0)return;let s=r.let("missing");for(let n in t){let o=t[n];if(o.length===0)continue;let p=(0,cr.propertyInData)(r,i,n,a.opts.ownProperties);e.setParams({property:n,depsCount:o.length,deps:o.join(", ")}),a.allErrors?r.if(p,()=>{for(let c of o)(0,cr.checkReportMissingProp)(e,c)}):(r.if((0,Za._)`${p} && (${(0,cr.checkMissingProp)(e,o,s)})`),(0,cr.reportMissingProp)(e,s),r.else())}}Ie.validatePropertyDeps=Jo;function Wo(e,t=e.schema){let{gen:r,data:i,keyword:a,it:s}=e,n=r.name("valid");for(let o in t)(0,km.alwaysValidSchema)(s,t[o])||(r.if((0,cr.propertyInData)(r,i,o,s.opts.ownProperties),()=>{let p=e.subschema({keyword:a,schemaProp:o},n);e.mergeValidEvaluated(p,n)},()=>r.var(n,!0)),e.ok(n))}Ie.validateSchemaDeps=Wo;Ie.default=xm});var Yo=h(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});var Qo=I(),$m=Z(),Im={message:"property name must be valid",params:({params:e})=>(0,Qo._)`{propertyName: ${e.propertyName}}`},Am={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Im,code(e){let{gen:t,schema:r,data:i,it:a}=e;if((0,$m.alwaysValidSchema)(a,r))return;let s=t.name("valid");t.forIn("key",i,n=>{e.setParams({propertyName:n}),e.subschema({keyword:"propertyNames",data:n,dataTypes:["string"],propertyName:n,compositeRule:!0},s),t.if((0,Qo.not)(s),()=>{e.error(!0),a.allErrors||t.break()})}),e.ok(s)}};Ra.default=Am});var Na=h(Ca=>{"use strict";Object.defineProperty(Ca,"__esModule",{value:!0});var Vr=ge(),Pe=I(),zm=_e(),Hr=Z(),Tm={message:"must NOT have additional properties",params:({params:e})=>(0,Pe._)`{additionalProperty: ${e.additionalProperty}}`},Em={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Tm,code(e){let{gen:t,schema:r,parentSchema:i,data:a,errsCount:s,it:n}=e;if(!s)throw new Error("ajv implementation error");let{allErrors:o,opts:p}=n;if(n.props=!0,p.removeAdditional!=="all"&&(0,Hr.alwaysValidSchema)(n,r))return;let c=(0,Vr.allSchemaProperties)(i.properties),d=(0,Vr.allSchemaProperties)(i.patternProperties);u(),e.ok((0,Pe._)`${s} === ${zm.default.errors}`);function u(){t.forIn("key",a,g=>{!c.length&&!d.length?l(g):t.if(f(g),()=>l(g))})}function f(g){let b;if(c.length>8){let k=(0,Hr.schemaRefOrVal)(n,i.properties,"properties");b=(0,Vr.isOwnProperty)(t,k,g)}else c.length?b=(0,Pe.or)(...c.map(k=>(0,Pe._)`${g} === ${k}`)):b=Pe.nil;return d.length&&(b=(0,Pe.or)(b,...d.map(k=>(0,Pe._)`${(0,Vr.usePattern)(e,k)}.test(${g})`))),(0,Pe.not)(b)}function y(g){t.code((0,Pe._)`delete ${a}[${g}]`)}function l(g){if(p.removeAdditional==="all"||p.removeAdditional&&r===!1){y(g);return}if(r===!1){e.setParams({additionalProperty:g}),e.error(),o||t.break();return}if(typeof r=="object"&&!(0,Hr.alwaysValidSchema)(n,r)){let b=t.name("valid");p.removeAdditional==="failing"?(_(g,b,!1),t.if((0,Pe.not)(b),()=>{e.reset(),y(g)})):(_(g,b),o||t.if((0,Pe.not)(b),()=>t.break()))}}function _(g,b,k){let q={keyword:"additionalProperties",dataProp:g,dataPropType:Hr.Type.Str};k===!1&&Object.assign(q,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(q,b)}}};Ca.default=Em});var tp=h(Ma=>{"use strict";Object.defineProperty(Ma,"__esModule",{value:!0});var Sm=ft(),Xo=ge(),Da=Z(),ep=Na(),Lm={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:i,data:a,it:s}=e;s.opts.removeAdditional==="all"&&i.additionalProperties===void 0&&ep.default.code(new Sm.KeywordCxt(s,ep.default,"additionalProperties"));let n=(0,Xo.allSchemaProperties)(r);for(let u of n)s.definedProperties.add(u);s.opts.unevaluated&&n.length&&s.props!==!0&&(s.props=Da.mergeEvaluated.props(t,(0,Da.toHash)(n),s.props));let o=n.filter(u=>!(0,Da.alwaysValidSchema)(s,r[u]));if(o.length===0)return;let p=t.name("valid");for(let u of o)c(u)?d(u):(t.if((0,Xo.propertyInData)(t,a,u,s.opts.ownProperties)),d(u),s.allErrors||t.else().var(p,!0),t.endIf()),e.it.definedProperties.add(u),e.ok(p);function c(u){return s.opts.useDefaults&&!s.compositeRule&&r[u].default!==void 0}function d(u){e.subschema({keyword:"properties",schemaProp:u,dataProp:u},p)}}};Ma.default=Lm});var sp=h(Ga=>{"use strict";Object.defineProperty(Ga,"__esModule",{value:!0});var rp=ge(),Kr=I(),ip=Z(),ap=Z(),Zm={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:i,parentSchema:a,it:s}=e,{opts:n}=s,o=(0,rp.allSchemaProperties)(r),p=o.filter(_=>(0,ip.alwaysValidSchema)(s,r[_]));if(o.length===0||p.length===o.length&&(!s.opts.unevaluated||s.props===!0))return;let c=n.strictSchema&&!n.allowMatchingProperties&&a.properties,d=t.name("valid");s.props!==!0&&!(s.props instanceof Kr.Name)&&(s.props=(0,ap.evaluatedPropsToName)(t,s.props));let{props:u}=s;f();function f(){for(let _ of o)c&&y(_),s.allErrors?l(_):(t.var(d,!0),l(_),t.if(d))}function y(_){for(let g in c)new RegExp(_).test(g)&&(0,ip.checkStrictMode)(s,`property ${g} matches pattern ${_} (use allowMatchingProperties)`)}function l(_){t.forIn("key",i,g=>{t.if((0,Kr._)`${(0,rp.usePattern)(e,_)}.test(${g})`,()=>{let b=p.includes(_);b||e.subschema({keyword:"patternProperties",schemaProp:_,dataProp:g,dataPropType:ap.Type.Str},d),s.opts.unevaluated&&u!==!0?t.assign((0,Kr._)`${u}[${g}]`,!0):!b&&!s.allErrors&&t.if((0,Kr.not)(d),()=>t.break())})})}}};Ga.default=Zm});var np=h(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});var Rm=Z(),Cm={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:i}=e;if((0,Rm.alwaysValidSchema)(i,r)){e.fail();return}let a=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},a),e.failResult(a,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};Fa.default=Cm});var op=h(Ua=>{"use strict";Object.defineProperty(Ua,"__esModule",{value:!0});var Nm=ge(),Dm={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Nm.validateUnion,error:{message:"must match a schema in anyOf"}};Ua.default=Dm});var pp=h(Va=>{"use strict";Object.defineProperty(Va,"__esModule",{value:!0});var Br=I(),Mm=Z(),Gm={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,Br._)`{passingSchemas: ${e.passing}}`},Fm={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Gm,code(e){let{gen:t,schema:r,parentSchema:i,it:a}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(a.opts.discriminator&&i.discriminator)return;let s=r,n=t.let("valid",!1),o=t.let("passing",null),p=t.name("_valid");e.setParams({passing:o}),t.block(c),e.result(n,()=>e.reset(),()=>e.error(!0));function c(){s.forEach((d,u)=>{let f;(0,Mm.alwaysValidSchema)(a,d)?t.var(p,!0):f=e.subschema({keyword:"oneOf",schemaProp:u,compositeRule:!0},p),u>0&&t.if((0,Br._)`${p} && ${n}`).assign(n,!1).assign(o,(0,Br._)`[${o}, ${u}]`).else(),t.if(p,()=>{t.assign(n,!0),t.assign(o,u),f&&e.mergeEvaluated(f,Br.Name)})})}}};Va.default=Fm});var dp=h(Ha=>{"use strict";Object.defineProperty(Ha,"__esModule",{value:!0});var Um=Z(),Vm={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");let a=t.name("valid");r.forEach((s,n)=>{if((0,Um.alwaysValidSchema)(i,s))return;let o=e.subschema({keyword:"allOf",schemaProp:n},a);e.ok(a),e.mergeEvaluated(o)})}};Ha.default=Vm});var lp=h(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});var Jr=I(),up=Z(),Hm={message:({params:e})=>(0,Jr.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,Jr._)`{failingKeyword: ${e.ifClause}}`},Km={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Hm,code(e){let{gen:t,parentSchema:r,it:i}=e;r.then===void 0&&r.else===void 0&&(0,up.checkStrictMode)(i,'"if" without "then" and "else" is ignored');let a=cp(i,"then"),s=cp(i,"else");if(!a&&!s)return;let n=t.let("valid",!0),o=t.name("_valid");if(p(),e.reset(),a&&s){let d=t.let("ifClause");e.setParams({ifClause:d}),t.if(o,c("then",d),c("else",d))}else a?t.if(o,c("then")):t.if((0,Jr.not)(o),c("else"));e.pass(n,()=>e.error(!0));function p(){let d=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},o);e.mergeEvaluated(d)}function c(d,u){return()=>{let f=e.subschema({keyword:d},o);t.assign(n,o),e.mergeValidEvaluated(f,n),u?t.assign(u,(0,Jr._)`${d}`):e.setParams({ifClause:d})}}}};function cp(e,t){let r=e.schema[t];return r!==void 0&&!(0,up.alwaysValidSchema)(e,r)}Ka.default=Km});var yp=h(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});var Bm=Z(),Jm={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,Bm.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};Ba.default=Jm});var Wa=h(Ja=>{"use strict";Object.defineProperty(Ja,"__esModule",{value:!0});var Wm=za(),Qm=Vo(),Ym=Ta(),Xm=Ko(),e_=Bo(),t_=Ur(),r_=Yo(),i_=Na(),a_=tp(),s_=sp(),n_=np(),o_=op(),p_=pp(),d_=dp(),c_=lp(),u_=yp();function l_(e=!1){let t=[n_.default,o_.default,p_.default,d_.default,c_.default,u_.default,r_.default,i_.default,t_.default,a_.default,s_.default];return e?t.push(Qm.default,Xm.default):t.push(Wm.default,Ym.default),t.push(e_.default),t}Ja.default=l_});var Ya=h(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.dynamicAnchor=void 0;var Qa=I(),y_=_e(),mp=Wt(),m_=Cr(),__={keyword:"$dynamicAnchor",schemaType:"string",code:e=>_p(e,e.schema)};function _p(e,t){let{gen:r,it:i}=e;i.schemaEnv.root.dynamicAnchors[t]=!0;let a=(0,Qa._)`${y_.default.dynamicAnchors}${(0,Qa.getProperty)(t)}`,s=i.errSchemaPath==="#"?i.validateName:g_(e);r.if((0,Qa._)`!${a}`,()=>r.assign(a,s))}ur.dynamicAnchor=_p;function g_(e){let{schemaEnv:t,schema:r,self:i}=e.it,{root:a,baseId:s,localRefs:n,meta:o}=t.root,{schemaId:p}=i.opts,c=new mp.SchemaEnv({schema:r,schemaId:p,root:a,baseId:s,localRefs:n,meta:o});return mp.compileSchema.call(i,c),(0,m_.getValidate)(e,c)}ur.default=__});var Xa=h(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.dynamicRef=void 0;var gp=I(),f_=_e(),fp=Cr(),h_={keyword:"$dynamicRef",schemaType:"string",code:e=>hp(e,e.schema)};function hp(e,t){let{gen:r,keyword:i,it:a}=e;if(t[0]!=="#")throw new Error(`"${i}" only supports hash fragment reference`);let s=t.slice(1);if(a.allErrors)n();else{let p=r.let("valid",!1);n(p),e.ok(p)}function n(p){if(a.schemaEnv.root.dynamicAnchors[s]){let c=r.let("_v",(0,gp._)`${f_.default.dynamicAnchors}${(0,gp.getProperty)(s)}`);r.if(c,o(c,p),o(a.validateName,p))}else o(a.validateName,p)()}function o(p,c){return c?()=>r.block(()=>{(0,fp.callRef)(e,p),r.let(c,!0)}):()=>(0,fp.callRef)(e,p)}}lr.dynamicRef=hp;lr.default=h_});var bp=h(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});var b_=Ya(),v_=Z(),j_={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){e.schema?(0,b_.dynamicAnchor)(e,""):(0,v_.checkStrictMode)(e.it,"$recursiveAnchor: false is ignored")}};es.default=j_});var vp=h(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});var w_=Xa(),q_={keyword:"$recursiveRef",schemaType:"string",code:e=>(0,w_.dynamicRef)(e,e.schema)};ts.default=q_});var jp=h(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});var P_=Ya(),k_=Xa(),x_=bp(),O_=vp(),$_=[P_.default,k_.default,x_.default,O_.default];rs.default=$_});var qp=h(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});var wp=Ur(),I_={keyword:"dependentRequired",type:"object",schemaType:"object",error:wp.error,code:e=>(0,wp.validatePropertyDeps)(e)};is.default=I_});var Pp=h(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});var A_=Ur(),z_={keyword:"dependentSchemas",type:"object",schemaType:"object",code:e=>(0,A_.validateSchemaDeps)(e)};as.default=z_});var kp=h(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});var T_=Z(),E_={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:e,parentSchema:t,it:r}){t.contains===void 0&&(0,T_.checkStrictMode)(r,`"${e}" without "contains" is ignored`)}};ss.default=E_});var xp=h(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});var S_=qp(),L_=Pp(),Z_=kp(),R_=[S_.default,L_.default,Z_.default];ns.default=R_});var $p=h(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});var Ue=I(),Op=Z(),C_=_e(),N_={message:"must NOT have unevaluated properties",params:({params:e})=>(0,Ue._)`{unevaluatedProperty: ${e.unevaluatedProperty}}`},D_={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:N_,code(e){let{gen:t,schema:r,data:i,errsCount:a,it:s}=e;if(!a)throw new Error("ajv implementation error");let{allErrors:n,props:o}=s;o instanceof Ue.Name?t.if((0,Ue._)`${o} !== true`,()=>t.forIn("key",i,u=>t.if(c(o,u),()=>p(u)))):o!==!0&&t.forIn("key",i,u=>o===void 0?p(u):t.if(d(o,u),()=>p(u))),s.props=!0,e.ok((0,Ue._)`${a} === ${C_.default.errors}`);function p(u){if(r===!1){e.setParams({unevaluatedProperty:u}),e.error(),n||t.break();return}if(!(0,Op.alwaysValidSchema)(s,r)){let f=t.name("valid");e.subschema({keyword:"unevaluatedProperties",dataProp:u,dataPropType:Op.Type.Str},f),n||t.if((0,Ue.not)(f),()=>t.break())}}function c(u,f){return(0,Ue._)`!${u} || !${u}[${f}]`}function d(u,f){let y=[];for(let l in u)u[l]===!0&&y.push((0,Ue._)`${f} !== ${l}`);return(0,Ue.and)(...y)}}};os.default=D_});var Ap=h(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});var nt=I(),Ip=Z(),M_={message:({params:{len:e}})=>(0,nt.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,nt._)`{limit: ${e}}`},G_={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:M_,code(e){let{gen:t,schema:r,data:i,it:a}=e,s=a.items||0;if(s===!0)return;let n=t.const("len",(0,nt._)`${i}.length`);if(r===!1)e.setParams({len:s}),e.fail((0,nt._)`${n} > ${s}`);else if(typeof r=="object"&&!(0,Ip.alwaysValidSchema)(a,r)){let p=t.var("valid",(0,nt._)`${n} <= ${s}`);t.if((0,nt.not)(p),()=>o(p,s)),e.ok(p)}a.items=!0;function o(p,c){t.forRange("i",c,n,d=>{e.subschema({keyword:"unevaluatedItems",dataProp:d,dataPropType:Ip.Type.Num},p),a.allErrors||t.if((0,nt.not)(p),()=>t.break())})}}};ps.default=G_});var zp=h(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});var F_=$p(),U_=Ap(),V_=[F_.default,U_.default];ds.default=V_});var Tp=h(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});var J=I(),H_={message:({schemaCode:e})=>(0,J.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,J._)`{format: ${e}}`},K_={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:H_,code(e,t){let{gen:r,data:i,$data:a,schema:s,schemaCode:n,it:o}=e,{opts:p,errSchemaPath:c,schemaEnv:d,self:u}=o;if(!p.validateFormats)return;a?f():y();function f(){let l=r.scopeValue("formats",{ref:u.formats,code:p.code.formats}),_=r.const("fDef",(0,J._)`${l}[${n}]`),g=r.let("fType"),b=r.let("format");r.if((0,J._)`typeof ${_} == "object" && !(${_} instanceof RegExp)`,()=>r.assign(g,(0,J._)`${_}.type || "string"`).assign(b,(0,J._)`${_}.validate`),()=>r.assign(g,(0,J._)`"string"`).assign(b,_)),e.fail$data((0,J.or)(k(),q()));function k(){return p.strictSchema===!1?J.nil:(0,J._)`${n} && !${b}`}function q(){let j=d.$async?(0,J._)`(${_}.async ? await ${b}(${i}) : ${b}(${i}))`:(0,J._)`${b}(${i})`,P=(0,J._)`(typeof ${b} == "function" ? ${j} : ${b}.test(${i}))`;return(0,J._)`${b} && ${b} !== true && ${g} === ${t} && !${P}`}}function y(){let l=u.formats[s];if(!l){k();return}if(l===!0)return;let[_,g,b]=q(l);_===t&&e.pass(j());function k(){if(p.strictSchema===!1){u.logger.warn(P());return}throw new Error(P());function P(){return`unknown format "${s}" ignored in schema at path "${c}"`}}function q(P){let D=P instanceof RegExp?(0,J.regexpCode)(P):p.code.formats?(0,J._)`${p.code.formats}${(0,J.getProperty)(s)}`:void 0,le=r.scopeValue("formats",{key:s,ref:P,code:D});return typeof P=="object"&&!(P instanceof RegExp)?[P.type||"string",P.validate,(0,J._)`${le}.validate`]:["string",P,le]}function j(){if(typeof l=="object"&&!(l instanceof RegExp)&&l.async){if(!d.$async)throw new Error("async format in sync schema");return(0,J._)`await ${b}(${i})`}return typeof g=="function"?(0,J._)`${b}(${i})`:(0,J._)`${b}.test(${i})`}}}};cs.default=K_});var ls=h(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});var B_=Tp(),J_=[B_.default];us.default=J_});var ys=h(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.contentVocabulary=qt.metadataVocabulary=void 0;qt.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];qt.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Sp=h(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});var W_=ya(),Q_=Ia(),Y_=Wa(),X_=jp(),eg=xp(),tg=zp(),rg=ls(),Ep=ys(),ig=[X_.default,W_.default,Q_.default,(0,Y_.default)(!0),rg.default,Ep.metadataVocabulary,Ep.contentVocabulary,eg.default,tg.default];ms.default=ig});var Zp=h(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.DiscrError=void 0;var Lp;(function(e){e.Tag="tag",e.Mapping="mapping"})(Lp||(Wr.DiscrError=Lp={}))});var fs=h(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});var Pt=I(),_s=Zp(),Rp=Wt(),ag=ht(),sg=Z(),ng={message:({params:{discrError:e,tagName:t}})=>e===_s.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,Pt._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},og={keyword:"discriminator",type:"object",schemaType:"object",error:ng,code(e){let{gen:t,data:r,schema:i,parentSchema:a,it:s}=e,{oneOf:n}=a;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let o=i.propertyName;if(typeof o!="string")throw new Error("discriminator: requires propertyName");if(i.mapping)throw new Error("discriminator: mapping is not supported");if(!n)throw new Error("discriminator: requires oneOf keyword");let p=t.let("valid",!1),c=t.const("tag",(0,Pt._)`${r}${(0,Pt.getProperty)(o)}`);t.if((0,Pt._)`typeof ${c} == "string"`,()=>d(),()=>e.error(!1,{discrError:_s.DiscrError.Tag,tag:c,tagName:o})),e.ok(p);function d(){let y=f();t.if(!1);for(let l in y)t.elseIf((0,Pt._)`${c} === ${l}`),t.assign(p,u(y[l]));t.else(),e.error(!1,{discrError:_s.DiscrError.Mapping,tag:c,tagName:o}),t.endIf()}function u(y){let l=t.name("valid"),_=e.subschema({keyword:"oneOf",schemaProp:y},l);return e.mergeEvaluated(_,Pt.Name),l}function f(){var y;let l={},_=b(a),g=!0;for(let j=0;j<n.length;j++){let P=n[j];if(P?.$ref&&!(0,sg.schemaHasRulesButRef)(P,s.self.RULES)){let le=P.$ref;if(P=Rp.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,le),P instanceof Rp.SchemaEnv&&(P=P.schema),P===void 0)throw new ag.default(s.opts.uriResolver,s.baseId,le)}let D=(y=P?.properties)===null||y===void 0?void 0:y[o];if(typeof D!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${o}"`);g=g&&(_||b(P)),k(D,j)}if(!g)throw new Error(`discriminator: "${o}" must be required`);return l;function b({required:j}){return Array.isArray(j)&&j.includes(o)}function k(j,P){if(j.const)q(j.const,P);else if(j.enum)for(let D of j.enum)q(D,P);else throw new Error(`discriminator: "properties/${o}" must have "const" or "enum"`)}function q(j,P){if(typeof j!="string"||j in l)throw new Error(`discriminator: "${o}" values must be unique strings`);l[j]=P}}}};gs.default=og});var Cp=h((cb,pg)=>{pg.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}});var Np=h((ub,dg)=>{dg.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}});var Dp=h((lb,cg)=>{cg.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}});var Mp=h((yb,ug)=>{ug.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}});var Gp=h((mb,lg)=>{lg.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}});var Fp=h((_b,yg)=>{yg.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}});var Up=h((gb,mg)=>{mg.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}});var Vp=h((fb,_g)=>{_g.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}});var Hp=h(hs=>{"use strict";Object.defineProperty(hs,"__esModule",{value:!0});var gg=Cp(),fg=Np(),hg=Dp(),bg=Mp(),vg=Gp(),jg=Fp(),wg=Up(),qg=Vp(),Pg=["/properties"];function kg(e){return[gg,fg,hg,bg,vg,t(this,jg),wg,t(this,qg)].forEach(r=>this.addMetaSchema(r,void 0,!1)),this;function t(r,i){return e?r.$dataMetaSchema(i,Pg):i}}hs.default=kg});var Kp=h((K,vs)=>{"use strict";Object.defineProperty(K,"__esModule",{value:!0});K.MissingRefError=K.ValidationError=K.CodeGen=K.Name=K.nil=K.stringify=K.str=K._=K.KeywordCxt=K.Ajv2020=void 0;var xg=ca(),Og=Sp(),$g=fs(),Ig=Hp(),bs="https://json-schema.org/draft/2020-12/schema",kt=class extends xg.default{constructor(t={}){super({...t,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),Og.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword($g.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:t,meta:r}=this.opts;r&&(Ig.default.call(this,t),this.refs["http://json-schema.org/schema"]=bs)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(bs)?bs:void 0)}};K.Ajv2020=kt;vs.exports=K=kt;vs.exports.Ajv2020=kt;Object.defineProperty(K,"__esModule",{value:!0});K.default=kt;var Ag=ft();Object.defineProperty(K,"KeywordCxt",{enumerable:!0,get:function(){return Ag.KeywordCxt}});var xt=I();Object.defineProperty(K,"_",{enumerable:!0,get:function(){return xt._}});Object.defineProperty(K,"str",{enumerable:!0,get:function(){return xt.str}});Object.defineProperty(K,"stringify",{enumerable:!0,get:function(){return xt.stringify}});Object.defineProperty(K,"nil",{enumerable:!0,get:function(){return xt.nil}});Object.defineProperty(K,"Name",{enumerable:!0,get:function(){return xt.Name}});Object.defineProperty(K,"CodeGen",{enumerable:!0,get:function(){return xt.CodeGen}});var zg=Jt();Object.defineProperty(K,"ValidationError",{enumerable:!0,get:function(){return zg.default}});var Tg=ht();Object.defineProperty(K,"MissingRefError",{enumerable:!0,get:function(){return Tg.default}})});var td=h(ze=>{"use strict";Object.defineProperty(ze,"__esModule",{value:!0});ze.formatNames=ze.fastFormats=ze.fullFormats=void 0;function Ae(e,t){return{validate:e,compare:t}}ze.fullFormats={date:Ae(Qp,Ps),time:Ae(ws(!0),ks),"date-time":Ae(Bp(!0),Xp),"iso-time":Ae(ws(),Yp),"iso-date-time":Ae(Bp(),ed),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:Cg,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:Vg,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:Ng,int32:{type:"number",validate:Gg},int64:{type:"number",validate:Fg},float:{type:"number",validate:Wp},double:{type:"number",validate:Wp},password:!0,binary:!0};ze.fastFormats={...ze.fullFormats,date:Ae(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Ps),time:Ae(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,ks),"date-time":Ae(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Xp),"iso-time":Ae(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Yp),"iso-date-time":Ae(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,ed),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};ze.formatNames=Object.keys(ze.fullFormats);function Eg(e){return e%4===0&&(e%100!==0||e%400===0)}var Sg=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Lg=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Qp(e){let t=Sg.exec(e);if(!t)return!1;let r=+t[1],i=+t[2],a=+t[3];return i>=1&&i<=12&&a>=1&&a<=(i===2&&Eg(r)?29:Lg[i])}function Ps(e,t){if(e&&t)return e>t?1:e<t?-1:0}var js=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function ws(e){return function(r){let i=js.exec(r);if(!i)return!1;let a=+i[1],s=+i[2],n=+i[3],o=i[4],p=i[5]==="-"?-1:1,c=+(i[6]||0),d=+(i[7]||0);if(c>23||d>59||e&&!o)return!1;if(a<=23&&s<=59&&n<60)return!0;let u=s-d*p,f=a-c*p-(u<0?1:0);return(f===23||f===-1)&&(u===59||u===-1)&&n<61}}function ks(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),i=new Date("2020-01-01T"+t).valueOf();if(r&&i)return r-i}function Yp(e,t){if(!(e&&t))return;let r=js.exec(e),i=js.exec(t);if(r&&i)return e=r[1]+r[2]+r[3],t=i[1]+i[2]+i[3],e>t?1:e<t?-1:0}var qs=/t|\s/i;function Bp(e){let t=ws(e);return function(i){let a=i.split(qs);return a.length===2&&Qp(a[0])&&t(a[1])}}function Xp(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),i=new Date(t).valueOf();if(r&&i)return r-i}function ed(e,t){if(!(e&&t))return;let[r,i]=e.split(qs),[a,s]=t.split(qs),n=Ps(r,a);if(n!==void 0)return n||ks(i,s)}var Zg=/\/|:/,Rg=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function Cg(e){return Zg.test(e)&&Rg.test(e)}var Jp=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function Ng(e){return Jp.lastIndex=0,Jp.test(e)}var Dg=-(2**31),Mg=2**31-1;function Gg(e){return Number.isInteger(e)&&e<=Mg&&e>=Dg}function Fg(e){return Number.isInteger(e)}function Wp(){return!0}var Ug=/[^\\]\\Z/;function Vg(e){if(Ug.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}});var id=h(xs=>{"use strict";Object.defineProperty(xs,"__esModule",{value:!0});var Hg=ya(),Kg=Ia(),Bg=Wa(),Jg=ls(),rd=ys(),Wg=[Hg.default,Kg.default,(0,Bg.default)(),Jg.default,rd.metadataVocabulary,rd.contentVocabulary];xs.default=Wg});var ad=h((jb,Qg)=>{Qg.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var nd=h((B,Os)=>{"use strict";Object.defineProperty(B,"__esModule",{value:!0});B.MissingRefError=B.ValidationError=B.CodeGen=B.Name=B.nil=B.stringify=B.str=B._=B.KeywordCxt=B.Ajv=void 0;var Yg=ca(),Xg=id(),ef=fs(),sd=ad(),tf=["/properties"],Qr="http://json-schema.org/draft-07/schema",Ot=class extends Yg.default{_addVocabularies(){super._addVocabularies(),Xg.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(ef.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(sd,tf):sd;this.addMetaSchema(t,Qr,!1),this.refs["http://json-schema.org/schema"]=Qr}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Qr)?Qr:void 0)}};B.Ajv=Ot;Os.exports=B=Ot;Os.exports.Ajv=Ot;Object.defineProperty(B,"__esModule",{value:!0});B.default=Ot;var rf=ft();Object.defineProperty(B,"KeywordCxt",{enumerable:!0,get:function(){return rf.KeywordCxt}});var $t=I();Object.defineProperty(B,"_",{enumerable:!0,get:function(){return $t._}});Object.defineProperty(B,"str",{enumerable:!0,get:function(){return $t.str}});Object.defineProperty(B,"stringify",{enumerable:!0,get:function(){return $t.stringify}});Object.defineProperty(B,"nil",{enumerable:!0,get:function(){return $t.nil}});Object.defineProperty(B,"Name",{enumerable:!0,get:function(){return $t.Name}});Object.defineProperty(B,"CodeGen",{enumerable:!0,get:function(){return $t.CodeGen}});var af=Jt();Object.defineProperty(B,"ValidationError",{enumerable:!0,get:function(){return af.default}});var sf=ht();Object.defineProperty(B,"MissingRefError",{enumerable:!0,get:function(){return sf.default}})});var od=h(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.formatLimitDefinition=void 0;var nf=nd(),ke=I(),Ve=ke.operators,Yr={formatMaximum:{okStr:"<=",ok:Ve.LTE,fail:Ve.GT},formatMinimum:{okStr:">=",ok:Ve.GTE,fail:Ve.LT},formatExclusiveMaximum:{okStr:"<",ok:Ve.LT,fail:Ve.GTE},formatExclusiveMinimum:{okStr:">",ok:Ve.GT,fail:Ve.LTE}},of={message:({keyword:e,schemaCode:t})=>(0,ke.str)`should be ${Yr[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,ke._)`{comparison: ${Yr[e].okStr}, limit: ${t}}`};It.formatLimitDefinition={keyword:Object.keys(Yr),type:"string",schemaType:"string",$data:!0,error:of,code(e){let{gen:t,data:r,schemaCode:i,keyword:a,it:s}=e,{opts:n,self:o}=s;if(!n.validateFormats)return;let p=new nf.KeywordCxt(s,o.RULES.all.format.definition,"format");p.$data?c():d();function c(){let f=t.scopeValue("formats",{ref:o.formats,code:n.code.formats}),y=t.const("fmt",(0,ke._)`${f}[${p.schemaCode}]`);e.fail$data((0,ke.or)((0,ke._)`typeof ${y} != "object"`,(0,ke._)`${y} instanceof RegExp`,(0,ke._)`typeof ${y}.compare != "function"`,u(y)))}function d(){let f=p.schema,y=o.formats[f];if(!y||y===!0)return;if(typeof y!="object"||y instanceof RegExp||typeof y.compare!="function")throw new Error(`"${a}": format "${f}" does not define "compare" function`);let l=t.scopeValue("formats",{key:f,ref:y,code:n.code.formats?(0,ke._)`${n.code.formats}${(0,ke.getProperty)(f)}`:void 0});e.fail$data(u(l))}function u(f){return(0,ke._)`${f}.compare(${r}, ${i}) ${Yr[a].fail} 0`}},dependencies:["format"]};var pf=e=>(e.addKeyword(It.formatLimitDefinition),e);It.default=pf});var ud=h((yr,cd)=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});var At=td(),df=od(),$s=I(),pd=new $s.Name("fullFormats"),cf=new $s.Name("fastFormats"),Is=(e,t={keywords:!0})=>{if(Array.isArray(t))return dd(e,t,At.fullFormats,pd),e;let[r,i]=t.mode==="fast"?[At.fastFormats,cf]:[At.fullFormats,pd],a=t.formats||At.formatNames;return dd(e,a,r,i),t.keywords&&(0,df.default)(e),e};Is.get=(e,t="full")=>{let i=(t==="fast"?At.fastFormats:At.fullFormats)[e];if(!i)throw new Error(`Unknown format "${e}"`);return i};function dd(e,t,r,i){var a,s;(a=(s=e.opts.code).formats)!==null&&a!==void 0||(s.formats=(0,$s._)`require("ajv-formats/dist/formats").${i}`);for(let n of t)e.addFormat(n,r[n])}cd.exports=yr=Is;Object.defineProperty(yr,"__esModule",{value:!0});yr.default=Is});var As,ld=Ze(()=>{As={schema_version:1,contract_sha256:"fb95fb47ebddc9565e5f202cba70a3aad171517dd9deec778fcd6fca483e9dd7",operations:[{id:"artifacts.list",version:"1",summary:"human: artifacts",method:"GET",path:"/artifacts",permissions:["artifact:read_metadata"],scope:"project",access:"none",exclusion:"Deletes, exports or changes the retention of tenant data. Irreversible or data-egress; requires a human actor in the audit trail.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"f2498bc09eef461f7e233fb15ec376790336a16ab8671eb968c7eab343042e84"},{id:"artifacts.get",version:"1",summary:"human: artifact",method:"GET",path:"/artifacts/{artifactId}",permissions:["artifact:read_metadata"],scope:"project",access:"none",exclusion:"Deletes, exports or changes the retention of tenant data. Irreversible or data-egress; requires a human actor in the audit trail.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{parameters:{type:"object",additionalProperties:!1,properties:{artifactId:{type:"string"}},required:["artifactId"]},query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}}},required:["parameters"]},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"267b47886d139cb40d10ff52827d8fd6c79eef361e25e1399677f8733df34e73"},{id:"audit.list",version:"1",summary:"audit: list",method:"GET",path:"/audit-logs",permissions:["auditlog:read"],scope:"project",access:"read",aliases:["caveman_audit.list"],input_schema:{type:"object",additionalProperties:!1,properties:{action:{type:"string"},actor_id:{type:"string"},cursor:{type:"string"},limit:{type:"integer",minimum:0},since:{type:"string"},until:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string",format:"uuid"},actor_type:{type:"string"},actor_id:{type:["string","null"]},action:{type:"string"},resource_type:{type:"string"},resource_id:{type:["string","null"]},metadata:{},created_at:{type:"string",format:"date-time"}},required:["id","actor_type","actor_id","action","resource_type","resource_id","metadata","created_at"]}},next_cursor:{type:["string","null"]}},required:["data","next_cursor"]},binding:{path_inputs:{},query_inputs:["action","actor_id","cursor","limit","since","until"],body_inputs:[]},contract_sha256:"90d549f14e149fb476abb0a5933a48668959fbb68e79772f6849202f5864dd56"},{id:"human.audits",version:"1",summary:"human: audits",method:"GET",path:"/audits",permissions:["trace:read_metadata"],scope:"project",access:"none",exclusion:"Audits are a governance artifact with a named human owner.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"c07079a1461a10aee03d76cb169375d0fa91419913a70ab3ac56b55239c1ce8d"},{id:"human.create_audit",version:"1",summary:"human: create_audit",method:"POST",path:"/audits",permissions:["experiment:run"],scope:"project",access:"none",exclusion:"Audits are a governance artifact with a named human owner.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}},body:{type:"object",additionalProperties:!0}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"362f3a1e775bbdb0a60a1532e2ca8e7f8eaf08ad7c4968ee0c455250ad557457"},{id:"human.audit",version:"1",summary:"human: audit",method:"GET",path:"/audits/{auditId}",permissions:["trace:read_metadata"],scope:"project",access:"none",exclusion:"Audits are a governance artifact with a named human owner.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{parameters:{type:"object",additionalProperties:!1,properties:{auditId:{type:"string"}},required:["auditId"]},query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}}},required:["parameters"]},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"b616fbf794c169ae59c174015e6f3550a9ea6952549e19437fb0ebb6d79afde0"},{id:"human.audit_findings",version:"1",summary:"human: audit_findings",method:"GET",path:"/audits/{auditId}/findings",permissions:["trace:read_metadata"],scope:"project",access:"none",exclusion:"Audits are a governance artifact with a named human owner.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{parameters:{type:"object",additionalProperties:!1,properties:{auditId:{type:"string"}},required:["auditId"]},query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}}},required:["parameters"]},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"5c1fb21ebc676106b5e0a92fa6281afd73a14470a84ef8131a0ddae6508cfe50"},{id:"context.whoami",version:"1",summary:"context: whoami",method:"GET",path:"/auth/me",permissions:["org:read"],scope:"organization",access:"read",aliases:["caveman_context.whoami"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{user:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},email:{type:"string"},name:{type:"string"},organization_id:{type:"string"},role:{type:"string"},project_id:{type:"string"},project_ids:{type:["array","null"],items:{type:"string"}},scopes:{type:["array","null"],items:{type:"string"}}},required:["id","email","name","organization_id","role"]},plan:{type:"string"},deployment:{type:"string"},data:{type:"object",additionalProperties:!1,properties:{level:{type:"string"},content:{type:"boolean"},locked:{type:"boolean"}},required:["level","content","locked"]},can_invite:{type:"boolean"},products:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},unit:{type:"string"},free_allowance:{type:"integer"},used:{anyOf:[{type:"integer"},{type:"null"}]},period_end:{type:"string",format:"date-time"},state:{type:"string"},reason:{type:"string"}},required:["id","unit","free_allowance","used","period_end","state"]}}},required:["user","plan","deployment","data","can_invite","products"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"02a93fce28e7dd0367159b6d27f86f63666c996f47b4f14e6949348fd7c23112"},{id:"human.organizations",version:"1",summary:"human: organizations",method:"GET",path:"/auth/organizations",permissions:["org:read"],scope:"organization",access:"none",exclusion:"Moves the caller across the organization boundary. A project-scoped agent session must never leave its tenant.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"16965e6f630126f3c2acbb0629ba02d8e66d42b1d0b62c9614730f3312c08415"},{id:"human.billing_account",version:"1",summary:"human: billing_account",method:"GET",path:"/billing/account",permissions:["billing:read"],scope:"organization",access:"none",exclusion:"Changes billing, spend ceilings, or the money contract. Human-only regardless of agent competence.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"c44f1bb7588a52876e90eef36875c58af61818e499fafb0d621a64e6938c8b62"},{id:"reports.billing_usage",version:"1",summary:"reports: billing_usage",method:"GET",path:"/billing/usage",permissions:["org:read"],scope:"organization",access:"read",aliases:["caveman_reports.billing_usage"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{ai_credits:{anyOf:[{type:"object",additionalProperties:!1,properties:{allowance_micros:{type:"integer"},spent_micros:{type:"integer"},reserved_micros:{type:"integer"},remaining_micros:{type:"integer"},requests_per_minute:{type:"integer"},tokens_per_minute:{type:"integer"},concurrent_requests:{type:"integer"},basis:{type:"string"}},required:["allowance_micros","spent_micros","reserved_micros","remaining_micros","requests_per_minute","tokens_per_minute","concurrent_requests","basis"]},{type:"null"}]},plan:{type:"string"},package:{anyOf:[{type:"string"},{type:"null"}]},entitlements:{type:["array","null"],items:{type:"string"}},billing_enabled:{type:"boolean"},card_on_file:{type:"boolean"},period:{type:"object",additionalProperties:!1,properties:{start:{type:"string",format:"date-time"},end:{type:"string",format:"date-time"}},required:["start","end"]},products:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{key:{type:"string"},label:{type:"string"},unit:{type:"string"},unit_plural:{type:"string"},usage:{type:"integer"},free_allowance:{type:"integer"},current_micros:{anyOf:[{type:"integer"},{type:"null"}]},projected_usage:{type:"integer"},projected_micros:{anyOf:[{type:"integer"},{type:"null"}]},limit_micros:{anyOf:[{type:"integer"},{type:"null"}]},limited:{type:"boolean"},tiers:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{up_to:{anyOf:[{type:"integer"},{type:"null"}]},unit_usd:{type:"string"}},required:["up_to","unit_usd"]}}},required:["key","label","unit","unit_plural","usage","free_allowance","current_micros","projected_usage","projected_micros","limit_micros","limited","tiers"]}},current_micros:{anyOf:[{type:"integer"},{type:"null"}]},projected_micros:{anyOf:[{type:"integer"},{type:"null"}]}},required:["plan","package","entitlements","billing_enabled","card_on_file","period","products","current_micros","projected_micros"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"e68e4a56ca3ef40d0b8ffb39196a6a5e76a5bf66a5863df22d6f0ee81ba0101d"},{id:"plan.org_plan",version:"1",summary:"plan: org_plan",method:"GET",path:"/cave-plan",permissions:["trace:read_metadata"],scope:"organization",access:"read",aliases:["caveman_plan.org_plan"],input_schema:{type:"object",additionalProperties:!1,properties:{from:{type:"string",format:"date-time"},sample_data:{type:"boolean"},to:{type:"string",format:"date-time"},window:{type:"string"}}},output_schema:{anyOf:[{type:"object",additionalProperties:!1,properties:{headline:{type:"object",additionalProperties:!1,properties:{low:{type:"number"},base:{type:"number"},high:{type:"number"},basis:{type:"string"},move_count:{type:"integer"}},required:["low","base","high","basis","move_count"]},headroom_by_class:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{safety_class:{type:"string"},low:{type:"number"},base:{type:"number"},high:{type:"number"},move_count:{type:"integer"}},required:["safety_class","low","base","high","move_count"]}},moves:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{optimizer_id:{type:"string"},title:{type:"string"},family:{type:"string"},safety_class:{type:"string"},basis:{type:"string"},confidence:{type:"string"},quality_risk:{type:"string"},implementation_effort:{type:"string"},requires_eval_gate:{type:"boolean"},enablement_only:{type:"boolean"},scope_count:{type:"integer"},sample_size:{type:"integer"},savings_usd_low:{type:"number"},savings_usd_base:{type:"number"},savings_usd_high:{type:"number"},share_of_headline_pct:{type:"number"},next_action:{type:"string"},apply_capability:{type:"string"},summary:{type:"string"},already_active_note:{type:"string"},top_scopes:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{agent_id:{type:"string"},workflow_id:{type:"string"},agent_name:{type:"string"},workflow_name:{type:"string"},provider:{type:"string"},model:{type:"string"},savings_usd_base:{type:"number"},share_pct:{type:"number"}},required:["savings_usd_base","share_pct"]}},evidence_stage:{type:"string"}},required:["optimizer_id","title","family","safety_class","basis","confidence","quality_risk","implementation_effort","requires_eval_gate","enablement_only","scope_count","sample_size","savings_usd_low","savings_usd_base","savings_usd_high","share_of_headline_pct","next_action","summary"]}},no_signal:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{optimizer_id:{type:"string"},title:{type:"string"},reason_code:{type:"string"},reason:{type:"string"}},required:["optimizer_id","title","reason_code","reason"]}},methodology:{type:"string"},as_of:{type:"string"},detectors_last_ran:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},diagnostics:{type:["array","null"],items:{type:"string"}},scope:{type:"string"},project_id:{type:"string"},since_last:{anyOf:[{type:"object",additionalProperties:!1,properties:{since:{type:"string"},headline_base_delta:{type:"number"},score_delta:{anyOf:[{type:"integer"},{type:"null"}]},new_moves:{type:["array","null"],items:{type:"string"}},applied_moves:{type:["array","null"],items:{type:"string"}},regressed:{type:["array","null"],items:{type:"string"}},invalidated:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{optimizer_id:{type:"string"},reason:{type:"string"}},required:["optimizer_id","reason"]}}},required:["since","headline_base_delta","score_delta","new_moves","applied_moves","regressed","invalidated"]},{type:"null"}]},local_practice_findings:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{practice_id:{type:"string"},title:{type:"string"},sink_id:{type:"string"},basis:{type:"string"},tokens_per_turn:{type:"integer"},tokens_per_day_rate:{type:"integer"},sessions_scanned:{type:"integer"},observed_at:{type:"string",format:"date-time"}},required:["practice_id","title","sink_id","basis","tokens_per_turn","tokens_per_day_rate","sessions_scanned","observed_at"]}}},required:["headline","headroom_by_class","moves","no_signal","methodology","scope","project_id","since_last","local_practice_findings"]},{type:"object",additionalProperties:!1,properties:{scope:{type:"string"},headline:{type:"object",additionalProperties:!1,properties:{low:{type:"number"},base:{type:"number"},high:{type:"number"},basis:{type:"string"},move_count:{type:"integer"}},required:["low","base","high","basis","move_count"]},projects:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{project_id:{type:"string"},name:{type:"string"},score:{anyOf:[{type:"integer"},{type:"null"}]},scored:{type:"boolean"},headline_base:{type:"number"},move_count:{type:"integer"},top_move:{anyOf:[{type:"object",additionalProperties:!1,properties:{optimizer_id:{type:"string"},title:{type:"string"},savings_usd_base:{type:"number"}},required:["optimizer_id","title","savings_usd_base"]},{type:"null"}]},as_of:{type:"string"}},required:["project_id","name","score","scored","headline_base","move_count","top_move"]}}},required:["scope","headline","projects"]}]},binding:{path_inputs:{},query_inputs:["from","sample_data","to","window"],body_inputs:[]},contract_sha256:"122397773d40bb58a4a16ecd3fd8e4907a741f03931712128b3c9be947a08789"},{id:"human.data_requests",version:"1",summary:"human: data_requests",method:"GET",path:"/data-requests",permissions:["auditlog:read"],scope:"project",access:"none",exclusion:"Records consent or a data-subject decision on behalf of the organization. Legal effect, so a human must be the actor.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"91759f326d50a0b788390855984270bce429afb61cada914ba22b0f007e3a6d1"},{id:"human.data_request",version:"1",summary:"human: data_request",method:"GET",path:"/data-requests/{requestId}",permissions:["auditlog:read"],scope:"project",access:"none",exclusion:"Records consent or a data-subject decision on behalf of the organization. Legal effect, so a human must be the actor.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{parameters:{type:"object",additionalProperties:!1,properties:{requestId:{type:"string"}},required:["requestId"]},query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}}},required:["parameters"]},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"cd25e4653c5d002b20e73ab44bb9b2c89500d3058589a2629a90e6f04f31c50d"},{id:"context.data_source_catalog",version:"1",summary:"context: data_source_catalog",method:"GET",path:"/data-sources/catalog",permissions:["trace:read_metadata"],scope:"organization",access:"read",aliases:["caveman_context.data_source_catalog"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},aliases:{type:["array","null"],items:{type:"string"}},lane:{type:"string"},availability:{type:"string"},recommended:{type:"boolean"},capabilities:{type:"object",additionalProperties:!1,properties:{live_traces:{type:"boolean"},trace_history:{type:"boolean"},eval_evidence:{type:"boolean"},file_import:{type:"boolean"}},required:["live_traces","trace_history","eval_evidence","file_import"]},minimum_access:{type:"string"},content_mode:{type:"string"},setup_path:{type:"string"},documentation_url:{type:"string"},mapping_version:{type:"integer"}},required:["id","name","aliases","lane","availability","recommended","capabilities","minimum_access","content_mode","setup_path","mapping_version"]}},defaults:{type:"object",additionalProperties:!1,properties:{live:{const:"otel"},content_mode:{const:"metadata_only"},history_window_hours:{const:24}},required:["live","content_mode","history_window_hours"]}},required:["data","defaults"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"203b024984d3ca53049a976bdafe546519a0026dc4bf78806d126ca9d02b2fb7"},{id:"reports.dev_agents",version:"1",summary:"reports: dev_agents",method:"GET",path:"/dev/agents",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_reports.dev_agents"],input_schema:{type:"object",additionalProperties:!1,properties:{from:{type:"string",format:"date-time"},project_id:{type:"string"},sample_data:{type:"boolean"},scope:{type:"string"},to:{type:"string",format:"date-time"},window:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{from:{type:"string"},to:{type:"string"},scope:{type:"string"},agents:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{install_id:{type:"string"},agent:{type:"string"},agent_version:{type:"string"},last_seen:{type:"string"},requests:{type:"integer"},subscription_requests:{type:"integer"},routing:{type:"object",additionalProperties:!1,properties:{routed:{type:"integer"},kept:{type:"integer"},degraded:{type:"integer"},paused:{type:"integer"},off:{type:"integer"},not_reported:{type:"integer"}},required:["routed","kept","degraded","paused","off","not_reported"]},models:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{model:{type:"string"},requests:{type:"integer"}},required:["model","requests"]}},measured_tokens:{type:"object",additionalProperties:!1,properties:{label:{type:"string"},requests:{type:"integer"},input:{type:"integer"},output:{type:"integer"},cache_read:{type:"integer"},cache_write:{type:"integer"}},required:["label","requests","input","output","cache_read","cache_write"]},kept_out_of_context:{type:"object",additionalProperties:!1,properties:{label:{type:"string"},requests:{type:"integer"},tokens:{type:"integer"}},required:["label","requests","tokens"]}},required:["install_id","agent","agent_version","last_seen","requests","subscription_requests","routing","models","measured_tokens","kept_out_of_context"]}},routing_paused_this_month:{type:"boolean"}},required:["from","to","scope","agents","routing_paused_this_month"]},binding:{path_inputs:{},query_inputs:["from","project_id","sample_data","scope","to","window"],body_inputs:[]},contract_sha256:"2be328ef3f9d8965204fecfa1836318f2988f4981730e33a9dd054e6bbb12113"},{id:"evals.list_evidence",version:"1",summary:"evals: list_evidence",method:"GET",path:"/eval-evidence",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_evals.list_evidence"],input_schema:{type:"object",additionalProperties:!1,properties:{from:{type:"string",format:"date-time"},limit:{type:"integer",minimum:0},sample_data:{type:"boolean"},to:{type:"string",format:"date-time"},trace_id:{type:"string"},window:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{observed_at:{type:"string"},result_at:{type:"string"},evidence_id:{type:"string"},trace_id:{type:"string"},span_id:{type:"string"},response_id:{type:"string"},source_system:{type:"string"},source_run_id:{type:"string"},source_suite_id:{type:"string"},source_case_id:{type:"string"},source_result_id:{type:"string"},ingestion_id:{type:"string"},evaluator_name:{type:"string"},evaluator_type:{type:"string"},evaluator_version:{type:"string"},evaluator_config_digest:{type:"string"},status:{type:"string"},fault:{type:"string"},score_label:{type:"string"},explanation:{type:"string"},explanation_artifact_ref:{type:"string"},payload_digest:{type:"string"},fixture_digest:{type:"string"},completeness:{type:"string"},authority:{type:"string"},basis:{type:"string"},normalization_version:{type:"string"},idempotency_key:{type:"string"},score:{type:["number","null"]},score_min:{type:["number","null"]},score_max:{type:["number","null"]},passed:{type:["boolean","integer","null"]}},required:["observed_at","result_at","evidence_id","trace_id","span_id","response_id","source_system","source_run_id","source_suite_id","source_case_id","source_result_id","ingestion_id","evaluator_name","evaluator_type","evaluator_version","evaluator_config_digest","status","fault","score_label","explanation","explanation_artifact_ref","payload_digest","fixture_digest","completeness","authority","basis","normalization_version","idempotency_key","score","score_min","score_max","passed"]}},next_cursor:{type:"null"}},required:["data","next_cursor"]},binding:{path_inputs:{},query_inputs:["from","limit","sample_data","to","trace_id","window"],body_inputs:[]},contract_sha256:"6dcbc41de14fc14c1b1e4973533f7472c9e1978dcdc84caed5fdedc44424396f"},{id:"evals.ingest_evidence",version:"1",summary:"evals: ingest_evidence",method:"POST",path:"/eval-evidence/batches",permissions:["eval:write"],scope:"project",access:"write",aliases:["caveman_evals_write.ingest_evidence"],input_schema:{type:"object",additionalProperties:!1,properties:{dry_run:{type:"boolean"},items:{type:"array",minItems:1,maxItems:1e3,items:{type:"object",additionalProperties:!1,properties:{observed_at:{type:"string"},result_at:{type:"string"},trace_id:{type:"string"},span_id:{type:"string"},response_id:{type:"string"},source_system:{type:"string"},source_run_id:{type:"string"},source_suite_id:{type:"string"},source_case_id:{type:"string"},source_result_id:{type:"string"},ingestion_id:{type:"string"},evaluator_name:{type:"string"},evaluator_type:{type:"string"},evaluator_version:{type:"string"},evaluator_config_digest:{type:"string"},status:{enum:["processed","skipped","error"]},fault:{type:"string"},score_label:{type:"string"},explanation:{type:"string"},explanation_artifact_ref:{type:"string"},payload_digest:{type:"string"},fixture_digest:{type:"string"},completeness:{enum:["complete","partial","unknown"]},idempotency_key:{type:"string"},passed:{type:["boolean","null"]},score:{type:["number","null"]},score_min:{type:["number","null"]},score_max:{type:["number","null"]}},required:["observed_at","result_at","source_system","evaluator_name","evaluator_type","evaluator_version","evaluator_config_digest","status","completeness","idempotency_key"]}}},required:["items"]},output_schema:{type:"object",additionalProperties:!1,properties:{accepted:{type:"integer"},rejected:{type:"integer"},duplicate:{type:"integer"},conflict:{type:"integer"},dry_run:{type:"boolean"},errors:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{index:{type:"integer"},code:{type:"string"}},required:["index","code"]}}},required:["accepted","rejected","duplicate","conflict","dry_run","errors"]},binding:{path_inputs:{},query_inputs:[],body_inputs:["dry_run","items"],body_project:!0},contract_sha256:"999dd7ee98ff540525b0d2e94f11cc75293ff48ccfcc7158a48a40278b483307"},{id:"evals.list_suites",version:"1",summary:"evals: list_suites",method:"GET",path:"/eval-suites",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_evals.list_suites"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},name:{type:"string"},description:{type:"string"},version:{type:"integer"},status:{type:"string"},case_count:{type:"integer"},latest_baseline_experiment_id:{anyOf:[{type:"string"},{type:"null"}]},latest_baseline_state:{anyOf:[{type:"string"},{type:"null"}]},current_baseline_passed:{type:"boolean"},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"}},required:["id","project_id","name","description","version","status","case_count","current_baseline_passed","created_at","updated_at"]}},next_cursor:{type:"null"}},required:["data","next_cursor"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"2eb5fd849e60497faad95b7ea13c59803bfcf8dec9deb3a526155287e54c178f"},{id:"evals.create_suite",version:"1",summary:"evals: create_suite",method:"POST",path:"/eval-suites",permissions:["eval:write"],scope:"project",access:"write",aliases:["caveman_evals_write.create_suite"],input_schema:{type:"object",additionalProperties:!1,properties:{description:{type:"string"},name:{type:"string",minLength:1,maxLength:200}},required:["name"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},name:{type:"string"},description:{type:"string"},version:{type:"integer"},status:{type:"string"},case_count:{type:"integer"},latest_baseline_experiment_id:{anyOf:[{type:"string"},{type:"null"}]},latest_baseline_state:{anyOf:[{type:"string"},{type:"null"}]},current_baseline_passed:{type:"boolean"},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"}},required:["id","project_id","name","description","version","status","case_count","current_baseline_passed","created_at","updated_at"]},binding:{path_inputs:{},query_inputs:[],body_inputs:["description","name"]},contract_sha256:"e27785e1a62f72eda9571389eb23d36f46f56efde4705bebd350b6163dc0e899"},{id:"evals.get_suite",version:"1",summary:"evals: get_suite",method:"GET",path:"/eval-suites/{suiteId}",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_evals.get_suite"],input_schema:{type:"object",additionalProperties:!1,properties:{suite_id:{type:"string",format:"uuid"}},required:["suite_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},name:{type:"string"},description:{type:"string"},version:{type:"integer"},status:{type:"string"},case_count:{type:"integer"},latest_baseline_experiment_id:{anyOf:[{type:"string"},{type:"null"}]},latest_baseline_state:{anyOf:[{type:"string"},{type:"null"}]},current_baseline_passed:{type:"boolean"},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"}},required:["id","project_id","name","description","version","status","case_count","current_baseline_passed","created_at","updated_at"]},binding:{path_inputs:{suiteId:"suite_id"},query_inputs:[],body_inputs:[]},contract_sha256:"4859b6edf58523536afd42fa7751d48add007cf57743fce9d8e6986c21f642e0"},{id:"evals.update_suite",version:"1",summary:"evals: update_suite",method:"PUT",path:"/eval-suites/{suiteId}",permissions:["eval:write"],scope:"project",access:"write",aliases:["caveman_evals_write.update_suite"],input_schema:{type:"object",additionalProperties:!1,properties:{description:{type:"string"},name:{type:"string",minLength:1,maxLength:200},status:{enum:["draft","active","archived"]},suite_id:{type:"string",format:"uuid"}},required:["suite_id","name","status"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},name:{type:"string"},description:{type:"string"},version:{type:"integer"},status:{type:"string"},case_count:{type:"integer"},latest_baseline_experiment_id:{anyOf:[{type:"string"},{type:"null"}]},latest_baseline_state:{anyOf:[{type:"string"},{type:"null"}]},current_baseline_passed:{type:"boolean"},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"}},required:["id","project_id","name","description","version","status","case_count","current_baseline_passed","created_at","updated_at"]},binding:{path_inputs:{suiteId:"suite_id"},query_inputs:[],body_inputs:["description","name","status"]},contract_sha256:"812c12b8a1387445abc31c1ada470bb733d246177bf5b419ab89d49cedc5e303"},{id:"evals.list_cases",version:"1",summary:"evals: list_cases",method:"GET",path:"/eval-suites/{suiteId}/cases",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_evals.list_cases"],input_schema:{type:"object",additionalProperties:!1,properties:{suite_id:{type:"string",format:"uuid"}},required:["suite_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},eval_suite_id:{type:"string"},name:{type:"string"},fixture_storage_key:{type:"string"},fixture_sha256:{type:"string"},graders_json:{},tags:{type:["array","null"],items:{type:"string"}},enabled:{type:"boolean"},created_at:{type:"string",format:"date-time"}},required:["id","eval_suite_id","name","fixture_storage_key","fixture_sha256","graders_json","tags","enabled","created_at"]}},next_cursor:{type:"null"}},required:["data","next_cursor"]},binding:{path_inputs:{suiteId:"suite_id"},query_inputs:[],body_inputs:[]},contract_sha256:"598d2621fee126736ee8641603eae046977ab005355ba6087a969fd4b99afc18"},{id:"evals.add_case",version:"1",summary:"evals: add_case",method:"POST",path:"/eval-suites/{suiteId}/cases",permissions:["eval:write"],scope:"project",access:"write",aliases:["caveman_evals_write.add_case"],input_schema:{type:"object",additionalProperties:!1,properties:{fixture:{},fixture_sha256:{type:"string"},fixture_storage_key:{type:"string"},graders:{type:"array",items:{type:"object",additionalProperties:!1,properties:{options:{},type:{type:"string"}}}},graders_json:{},name:{type:"string"},tags:{type:"array",items:{type:"string"}},suite_id:{type:"string",format:"uuid"}},required:["suite_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},eval_suite_id:{type:"string"},name:{type:"string"},fixture_storage_key:{type:"string"},fixture_sha256:{type:"string"},graders_json:{},tags:{type:["array","null"],items:{type:"string"}},enabled:{type:"boolean"},created_at:{type:"string",format:"date-time"}},required:["id","eval_suite_id","name","fixture_storage_key","fixture_sha256","graders_json","tags","enabled","created_at"]},binding:{path_inputs:{suiteId:"suite_id"},query_inputs:[],body_inputs:["fixture","fixture_sha256","fixture_storage_key","graders","graders_json","name","tags"]},contract_sha256:"969a9b4a41ac23db10cfac8e685559a5d0182280453b563ef8f7aa57e4c98677"},{id:"evals.replace_cases",version:"1",summary:"evals: replace_cases",method:"PUT",path:"/eval-suites/{suiteId}/cases",permissions:["eval:write"],scope:"project",access:"write",aliases:["caveman_evals_write.replace_cases"],input_schema:{type:"object",additionalProperties:!1,properties:{cases:{type:"array",items:{type:"object",additionalProperties:!1,properties:{fixture:{},graders:{type:"array",items:{type:"object",additionalProperties:!1,properties:{options:{},type:{type:"string"}}}},name:{type:"string"},tags:{type:"array",items:{type:"string"}}}},minItems:1,maxItems:200},suite_id:{type:"string",format:"uuid"}},required:["suite_id","cases"]},output_schema:{type:"object",additionalProperties:!1,properties:{cases:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},eval_suite_id:{type:"string"},name:{type:"string"},fixture_storage_key:{type:"string"},fixture_sha256:{type:"string"},graders_json:{},tags:{type:["array","null"],items:{type:"string"}},enabled:{type:"boolean"},created_at:{type:"string",format:"date-time"}},required:["id","eval_suite_id","name","fixture_storage_key","fixture_sha256","graders_json","tags","enabled","created_at"]}}},required:["cases"]},binding:{path_inputs:{suiteId:"suite_id"},query_inputs:[],body_inputs:["cases"]},contract_sha256:"39722b8bb1d055e0f8a92d69079f16962498d63b2b69b0ddc48dd11f45041822"},{id:"evals.run_baseline",version:"1",summary:"evals: run_baseline",method:"POST",path:"/eval-suites/{suiteId}/run-baseline",permissions:["experiment:run"],scope:"project",access:"write",aliases:["caveman_evals_write.run_baseline"],input_schema:{type:"object",additionalProperties:!1,properties:{suite_id:{type:"string",format:"uuid"}},required:["suite_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{experiment_id:{type:"string",format:"uuid"},state:{const:"queued"},outbox_id:{type:"string",format:"uuid"},delivery_status:{type:"string"}},required:["experiment_id","state","outbox_id","delivery_status"]},binding:{path_inputs:{suiteId:"suite_id"},query_inputs:[],body_inputs:[]},contract_sha256:"fbeae0cd4c21244ea41e91854d6ec4836449567e02eaaaeb80e89cb87b4e9bc3"},{id:"experiments.list",version:"1",summary:"experiments: list",method:"GET",path:"/experiments",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_experiments.list"],input_schema:{type:"object",additionalProperties:!1,properties:{workflow:{type:"string"},eval_suite_id:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},opportunity_id:{anyOf:[{type:"string"},{type:"null"}]},eval_suite_id:{anyOf:[{type:"string"},{type:"null"}]},optimizer_id:{anyOf:[{type:"string"},{type:"null"}]},practice_id:{anyOf:[{type:"string"},{type:"null"}]},practice_metric:{anyOf:[{type:"string"},{type:"null"}]},name:{type:"string"},type:{type:"string"},state:{type:"string"},baseline_config:{},candidate_config:{},guardrails_json:{},results_json:{},created_at:{type:"string",format:"date-time"},created_via:{type:"string"}},required:["id","project_id","name","type","state","baseline_config","candidate_config","guardrails_json","results_json","created_at"]}},next_cursor:{type:"null"}},required:["data","next_cursor"]},binding:{path_inputs:{},query_inputs:["workflow","eval_suite_id"],body_inputs:[]},contract_sha256:"8e24e5d02dab1e4b8deda8716f8f651407525aa9505f442b7375d7ec09035409"},{id:"experiments.create",version:"1",summary:"experiments: create",method:"POST",path:"/experiments",permissions:["experiment:run"],scope:"project",access:"write",aliases:["caveman_experiments_write.create"],input_schema:{type:"object",additionalProperties:!1,properties:{baseline_config:{},candidate_config:{},eval_suite_id:{type:"string"},guardrails:{},name:{type:"string"},opportunity_id:{type:"string"},practice_id:{type:"string"},type:{enum:["replay","shadow","canary","density-canary","before_after"]}}},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},opportunity_id:{anyOf:[{type:"string"},{type:"null"}]},eval_suite_id:{anyOf:[{type:"string"},{type:"null"}]},optimizer_id:{anyOf:[{type:"string"},{type:"null"}]},practice_id:{anyOf:[{type:"string"},{type:"null"}]},practice_metric:{anyOf:[{type:"string"},{type:"null"}]},name:{type:"string"},type:{type:"string"},state:{type:"string"},baseline_config:{},candidate_config:{},guardrails_json:{},results_json:{},created_at:{type:"string",format:"date-time"},created_via:{type:"string"}},required:["id","project_id","name","type","state","baseline_config","candidate_config","guardrails_json","results_json","created_at"]},binding:{path_inputs:{},query_inputs:[],body_inputs:["baseline_config","candidate_config","eval_suite_id","guardrails","name","opportunity_id","practice_id","type"]},contract_sha256:"43b61851a6ba3f424e3f1b1514e02a36d2cf12d47f6d6b37bd7251f60e3e07a0"},{id:"experiments.get",version:"1",summary:"experiments: get",method:"GET",path:"/experiments/{experimentId}",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_experiments.get"],input_schema:{type:"object",additionalProperties:!1,properties:{experiment_id:{type:"string",format:"uuid"}},required:["experiment_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},opportunity_id:{anyOf:[{type:"string"},{type:"null"}]},eval_suite_id:{anyOf:[{type:"string"},{type:"null"}]},optimizer_id:{anyOf:[{type:"string"},{type:"null"}]},practice_id:{anyOf:[{type:"string"},{type:"null"}]},practice_metric:{anyOf:[{type:"string"},{type:"null"}]},name:{type:"string"},type:{type:"string"},state:{type:"string"},baseline_config:{},candidate_config:{},guardrails_json:{},results_json:{},created_at:{type:"string",format:"date-time"},created_via:{type:"string"}},required:["id","project_id","name","type","state","baseline_config","candidate_config","guardrails_json","results_json","created_at"]},binding:{path_inputs:{experimentId:"experiment_id"},query_inputs:[],body_inputs:[]},contract_sha256:"967fcaa4861fe70c8d6714d72b51c642b8ad154f1d3309d0758e50b8cbda1e4b"},{id:"experiments.cancel",version:"1",summary:"experiments: cancel",method:"POST",path:"/experiments/{experimentId}/cancel",permissions:["experiment:run"],scope:"project",access:"write",aliases:["caveman_experiments_write.cancel"],input_schema:{type:"object",additionalProperties:!1,properties:{experiment_id:{type:"string",format:"uuid"}},required:["experiment_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{ok:{const:!0},id:{type:"string",format:"uuid"},state:{const:"cancelled"}},required:["ok","id","state"]},binding:{path_inputs:{experimentId:"experiment_id"},query_inputs:[],body_inputs:[]},contract_sha256:"5f3ac939e9aeb2d779a2b217ab6135ddc27f1ac3711b78351ef8c84f3a8632ec"},{id:"experiments.results",version:"1",summary:"experiments: results",method:"GET",path:"/experiments/{experimentId}/results",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_experiments.results"],input_schema:{type:"object",additionalProperties:!1,properties:{experiment_id:{type:"string",format:"uuid"}},required:["experiment_id"]},output_schema:{type:"object",additionalProperties:!0,description:"Retained experiment result document. Historical evaluation producers have different field sets; domain storage preserves them. Pending status is not quality evidence.",properties:{status:{type:"string"},results:{},total_cases:{type:"integer"},candidate_pass_rate:{type:"number"},candidate_error_rate:{type:"number"},candidate_mean_score:{type:"number"},guardrail_violations:{type:["array","null"],items:{type:"string"}},evaluated_at:{type:"string"}}},binding:{path_inputs:{experimentId:"experiment_id"},query_inputs:[],body_inputs:[]},contract_sha256:"fbb24b583218cfd4d2c4599bdde4608d3df7e5254cf83aa06c554af04b0e740d"},{id:"experiments.runs",version:"1",summary:"experiments: runs",method:"GET",path:"/experiments/{experimentId}/runs",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_experiments.runs"],input_schema:{type:"object",additionalProperties:!1,properties:{experiment_id:{type:"string",format:"uuid"}},required:["experiment_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{runs:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},experiment_id:{type:"string"},eval_case_id:{anyOf:[{type:"string"},{type:"null"}]},eval_case_name:{anyOf:[{type:"string"},{type:"null"}]},variant:{type:"string"},status:{type:"string"},metrics_json:{},created_at:{type:"string",format:"date-time"}},required:["id","experiment_id","variant","status","metrics_json","created_at"]}}},required:["runs"]},binding:{path_inputs:{experimentId:"experiment_id"},query_inputs:[],body_inputs:[]},contract_sha256:"e41853b257a5ff006ab993d44daeb4e38213d447946afa60a0a55074a3ca0d2a"},{id:"experiments.start",version:"1",summary:"experiments: start",method:"POST",path:"/experiments/{experimentId}/start",permissions:["experiment:run"],scope:"project",access:"write",aliases:["caveman_experiments_write.start"],input_schema:{type:"object",additionalProperties:!1,properties:{experiment_id:{type:"string",format:"uuid"}},required:["experiment_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{experiment_id:{type:"string",format:"uuid"},state:{const:"queued"},outbox_id:{type:"string",format:"uuid"},delivery_status:{type:"string"}},required:["experiment_id","state","outbox_id","delivery_status"]},binding:{path_inputs:{experimentId:"experiment_id"},query_inputs:[],body_inputs:[]},contract_sha256:"4acda219c7f6aa9e9981dce38b7249fcc9f24564761dce438f59996937909bbd"},{id:"human.exports",version:"1",summary:"human: exports",method:"GET",path:"/exports",permissions:["trace:read_metadata"],scope:"project",access:"none",exclusion:"Deletes, exports or changes the retention of tenant data. Irreversible or data-egress; requires a human actor in the audit trail.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"fc3d92546a1d102ecfd83300dd46145ea4a705dedbbd5dc2e3ff88e5353ad49d"},{id:"human.imports",version:"1",summary:"human: imports",method:"GET",path:"/imports",permissions:["trace:read_metadata"],scope:"project",access:"none",exclusion:"Bulk-ingests traces into the evidence plane. A wrong import silently corrupts every downstream cost and savings number, so a human owns the decision.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"e7bf442dc2e8d6831acb09d9578ff1c433f056f58c27e0bcbb7c8c1b6e0461f1"},{id:"human.create_import",version:"1",summary:"human: create_import",method:"POST",path:"/imports",permissions:["experiment:run"],scope:"project",access:"none",exclusion:"Bulk-ingests traces into the evidence plane. A wrong import silently corrupts every downstream cost and savings number, so a human owns the decision.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}},body:{type:"object",additionalProperties:!0}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"b9a545e9040e0f466c7d06497998615f2eea95639b1427d696ae36e60c5ce1c2"},{id:"human.import_gateway_config",version:"1",summary:"human: import_gateway_config",method:"POST",path:"/imports/gateway-config",permissions:["policy:draft"],scope:"project",access:"none",exclusion:"Reads another gateway's configuration and, on apply, mints credentials, invites members and rewrites the admission policy. Every one of those is a human decision, and the source file can carry provider secrets.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}},body:{type:"object",additionalProperties:!0}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"7d4e8f27090db204ced05e0ab16cc321220b5a80b3e06c8da2a93a7573dcbb41"},{id:"inbox.list",version:"1",summary:"inbox: list",method:"GET",path:"/inbox/items",permissions:["inbox:read"],scope:"project",access:"read",aliases:["caveman_inbox.list"],input_schema:{type:"object",additionalProperties:!1,properties:{cursor:{type:"string"},kind:{type:"string"},limit:{type:"integer",minimum:0},priority:{type:"string"},project_id:{type:"string"},q:{type:"string"},source:{type:"string"},status:{type:"string"},workflow:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{anyOf:[{type:"string"},{type:"null"}]},kind:{type:"string"},status:{type:"string"},priority:{type:"integer"},source:{type:"string"},scope:{type:"string"},title:{type:"string"},summary:{type:"string"},actor:{type:"string"},ref_type:{type:"string"},ref_id:{type:"string"},href:{type:"string"},dedupe_key:{type:"string"},actions:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{key:{type:"string"},label:{type:"string"},kind:{type:"string"},href:{type:"string"},tone:{type:"string"},resolves:{type:"boolean"}},required:["key","label","kind"]}},artifacts:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{type:{type:"string"},title:{type:"string"},patch:{type:"string"},facts:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{label:{type:"string"},value:{type:"string"},basis:{type:"string"}},required:["label","value"]}},text:{type:"string"},data_untrusted:{type:"boolean"}},required:["type","title"]}},occurred_at:{type:"string",format:"date-time"},read_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},resolved_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},archived_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"},data:{type:"object",additionalProperties:!1,properties:{workflow:{type:"string"},state:{type:"string"},outcome:{type:"string"},candidate_model:{type:"string"},experiment_id:{type:"string"},proving_item_id:{type:"string"},exclusion_id:{type:"string"},next_item_id:{type:"string"},started_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},saving_usd_per_day:{anyOf:[{type:"number"},{type:"null"}]},saving_basis:{type:"string"},same_family_judge:{type:"boolean"}},required:[]}},required:["id","organization_id","project_id","kind","status","priority","source","scope","title","summary","actor","ref_type","ref_id","href","dedupe_key","actions","artifacts","occurred_at","read_at","resolved_at","archived_at","created_at","updated_at","data"]}},next_cursor:{type:["string","null"]}},required:["data","next_cursor"]},binding:{path_inputs:{},query_inputs:["cursor","kind","limit","priority","project_id","q","source","status","workflow"],body_inputs:[]},contract_sha256:"41eb23675ac5b841afd13a0eea6ea43a91b3ad647e52584f4a0789eebf18c1d9"},{id:"inbox.emit",version:"1",summary:"inbox: emit",method:"POST",path:"/inbox/items",permissions:["inbox:write"],scope:"project",access:"write",aliases:["caveman_inbox_write.emit"],input_schema:{type:"object",additionalProperties:!1,properties:{actions:{type:"array",items:{}},artifacts:{type:"array",items:{}},data:{type:"object",additionalProperties:!1,properties:{workflow:{type:"string",pattern:"^[a-z0-9_-]{1,200}$"}}},dedupe_key:{type:"string"},href:{type:"string"},kind:{type:"string"},occurred_at:{type:"string"},priority:{type:"integer"},ref_id:{type:"string"},ref_type:{type:"string"},scope:{type:"string"},source:{type:"string"},summary:{type:"string"},title:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{anyOf:[{type:"string"},{type:"null"}]},kind:{type:"string"},status:{type:"string"},priority:{type:"integer"},source:{type:"string"},scope:{type:"string"},title:{type:"string"},summary:{type:"string"},actor:{type:"string"},ref_type:{type:"string"},ref_id:{type:"string"},href:{type:"string"},dedupe_key:{type:"string"},actions:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{key:{type:"string"},label:{type:"string"},kind:{type:"string"},href:{type:"string"},tone:{type:"string"},resolves:{type:"boolean"}},required:["key","label","kind"]}},artifacts:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{type:{type:"string"},title:{type:"string"},patch:{type:"string"},facts:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{label:{type:"string"},value:{type:"string"},basis:{type:"string"}},required:["label","value"]}},text:{type:"string"},data_untrusted:{type:"boolean"}},required:["type","title"]}},occurred_at:{type:"string",format:"date-time"},read_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},resolved_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},archived_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"},data:{type:"object",additionalProperties:!1,properties:{workflow:{type:"string"},state:{type:"string"},outcome:{type:"string"},candidate_model:{type:"string"},experiment_id:{type:"string"},proving_item_id:{type:"string"},exclusion_id:{type:"string"},next_item_id:{type:"string"},started_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},saving_usd_per_day:{anyOf:[{type:"number"},{type:"null"}]},saving_basis:{type:"string"},same_family_judge:{type:"boolean"}},required:[]}},required:["id","organization_id","project_id","kind","status","priority","source","scope","title","summary","actor","ref_type","ref_id","href","dedupe_key","actions","artifacts","occurred_at","read_at","resolved_at","archived_at","created_at","updated_at","data"]},binding:{path_inputs:{},query_inputs:[],body_inputs:["actions","artifacts","data","dedupe_key","href","kind","occurred_at","priority","ref_id","ref_type","scope","source","summary","title"],body_project:!0},contract_sha256:"e054377c1a88dd438a76a0c182a25984dcdfd72677be31d74e11be13db89b347"},{id:"inbox.get",version:"1",summary:"inbox: get",method:"GET",path:"/inbox/items/{itemId}",permissions:["inbox:read"],scope:"project",access:"read",aliases:["caveman_inbox.get"],input_schema:{type:"object",additionalProperties:!1,properties:{item_id:{type:"string",format:"uuid"}},required:["item_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{anyOf:[{type:"string"},{type:"null"}]},kind:{type:"string"},status:{type:"string"},priority:{type:"integer"},source:{type:"string"},scope:{type:"string"},title:{type:"string"},summary:{type:"string"},actor:{type:"string"},ref_type:{type:"string"},ref_id:{type:"string"},href:{type:"string"},dedupe_key:{type:"string"},actions:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{key:{type:"string"},label:{type:"string"},kind:{type:"string"},href:{type:"string"},tone:{type:"string"},resolves:{type:"boolean"}},required:["key","label","kind"]}},artifacts:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{type:{type:"string"},title:{type:"string"},patch:{type:"string"},facts:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{label:{type:"string"},value:{type:"string"},basis:{type:"string"}},required:["label","value"]}},text:{type:"string"},data_untrusted:{type:"boolean"}},required:["type","title"]}},occurred_at:{type:"string",format:"date-time"},read_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},resolved_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},archived_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"},data:{type:"object",additionalProperties:!1,properties:{workflow:{type:"string"},state:{type:"string"},outcome:{type:"string"},candidate_model:{type:"string"},experiment_id:{type:"string"},proving_item_id:{type:"string"},exclusion_id:{type:"string"},next_item_id:{type:"string"},started_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},saving_usd_per_day:{anyOf:[{type:"number"},{type:"null"}]},saving_basis:{type:"string"},same_family_judge:{type:"boolean"}},required:[]}},required:["id","organization_id","project_id","kind","status","priority","source","scope","title","summary","actor","ref_type","ref_id","href","dedupe_key","actions","artifacts","occurred_at","read_at","resolved_at","archived_at","created_at","updated_at","data"]},binding:{path_inputs:{itemId:"item_id"},query_inputs:[],body_inputs:[]},contract_sha256:"3a6bbdca65f51205867950222466910446e44ce3d2e6f47289898e7bba6800ba"},{id:"inbox.act",version:"1",summary:"inbox: act",method:"POST",path:"/inbox/items/{itemId}/actions/{actionKey}",permissions:["inbox:write"],scope:"project",access:"write",aliases:["caveman_inbox_write.act"],input_schema:{type:"object",additionalProperties:!1,properties:{item_id:{type:"string",format:"uuid"},action_key:{type:"string",minLength:1,maxLength:200}},required:["item_id","action_key"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{anyOf:[{type:"string"},{type:"null"}]},kind:{type:"string"},status:{type:"string"},priority:{type:"integer"},source:{type:"string"},scope:{type:"string"},title:{type:"string"},summary:{type:"string"},actor:{type:"string"},ref_type:{type:"string"},ref_id:{type:"string"},href:{type:"string"},dedupe_key:{type:"string"},actions:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{key:{type:"string"},label:{type:"string"},kind:{type:"string"},href:{type:"string"},tone:{type:"string"},resolves:{type:"boolean"}},required:["key","label","kind"]}},artifacts:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{type:{type:"string"},title:{type:"string"},patch:{type:"string"},facts:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{label:{type:"string"},value:{type:"string"},basis:{type:"string"}},required:["label","value"]}},text:{type:"string"},data_untrusted:{type:"boolean"}},required:["type","title"]}},occurred_at:{type:"string",format:"date-time"},read_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},resolved_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},archived_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"},data:{type:"object",additionalProperties:!1,properties:{workflow:{type:"string"},state:{type:"string"},outcome:{type:"string"},candidate_model:{type:"string"},experiment_id:{type:"string"},proving_item_id:{type:"string"},exclusion_id:{type:"string"},next_item_id:{type:"string"},started_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},saving_usd_per_day:{anyOf:[{type:"number"},{type:"null"}]},saving_basis:{type:"string"},same_family_judge:{type:"boolean"}},required:[]}},required:["id","organization_id","project_id","kind","status","priority","source","scope","title","summary","actor","ref_type","ref_id","href","dedupe_key","actions","artifacts","occurred_at","read_at","resolved_at","archived_at","created_at","updated_at","data"]},binding:{path_inputs:{itemId:"item_id",actionKey:"action_key"},query_inputs:[],body_inputs:[]},contract_sha256:"c7e2ef3dc68701ed674ebdf8a9f8453be6fa314bf49da1741fdba0b8599fb0cf"},{id:"inbox.summary",version:"1",summary:"inbox: summary",method:"GET",path:"/inbox/summary",permissions:["inbox:read"],scope:"project",access:"read",aliases:["caveman_inbox.summary"],input_schema:{type:"object",additionalProperties:!1,properties:{project_id:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{open_by_kind:{type:["object","null"],additionalProperties:{type:"integer"}},unread:{type:"integer"},closed:{type:"integer"},sources:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{source:{type:"string"},open:{type:"integer"},latest_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]}},required:["source","open","latest_at"]}}},required:["open_by_kind","unread","closed","sources"]},binding:{path_inputs:{},query_inputs:["project_id"],body_inputs:[]},contract_sha256:"6102dc525bc5cfc29b342948c9a59ba9afad2288f5eb0fb5d1dc708db9bceaef"},{id:"human.job",version:"1",summary:"human: job",method:"GET",path:"/jobs/{jobId}",permissions:["trace:read_metadata"],scope:"project",access:"none",exclusion:"Internal job plumbing. Agents observe outcomes through the resource they acted on, not the queue underneath it.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{parameters:{type:"object",additionalProperties:!1,properties:{jobId:{type:"string"}},required:["jobId"]},query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}}},required:["parameters"]},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"ea7e85f510ad266afedd89db7f9b5f26876d027d4069b8513895baeffb0edf02"},{id:"people.my_delivery",version:"1",summary:"people: my_delivery",method:"GET",path:"/me/delivery",permissions:["org:read"],scope:"project",access:"read",aliases:["caveman_people.my_delivery"],input_schema:{type:"object",additionalProperties:!1,properties:{from:{type:"string",format:"date-time"},sample_data:{type:"boolean"},to:{type:"string",format:"date-time"},window:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{window:{type:"string"},scope:{type:"string"},connected:{type:"boolean"},history_import:{type:"string"},repos:{type:["array","null"],items:{type:"string"}},basis:{type:"string"},totals:{type:"object",additionalProperties:!1,properties:{merged_prs:{type:"integer"},attributed_prs:{type:"integer"},cost_to_merge_usd:{type:"number"},median_cost_usd:{anyOf:[{type:"number"},{type:"null"}]},p90_cost_usd:{anyOf:[{type:"number"},{type:"null"}]},median_sessions:{anyOf:[{type:"number"},{type:"null"}]},unlanded_branches:{type:"integer"},unlanded_sessions:{type:"integer"},unlanded_cost_usd:{type:"number"},in_flight_branches:{type:"integer"},in_flight_sessions:{type:"integer"},in_flight_cost_usd:{type:"number"},unresolved_cost_usd:{type:"number"},branch_tagged_cost_usd:{type:"number"},untagged_cost_usd:{type:"number"},attribution_statuses:{type:["object","null"],additionalProperties:{type:"integer"}},session_linked_requests:{type:"integer"},branch_tagged_requests:{type:"integer"},priced_requests:{type:"integer"},coverage:{type:"number"}},required:["merged_prs","attributed_prs","cost_to_merge_usd","median_cost_usd","p90_cost_usd","median_sessions","unlanded_branches","unlanded_sessions","unlanded_cost_usd","in_flight_branches","in_flight_sessions","in_flight_cost_usd","unresolved_cost_usd","branch_tagged_cost_usd","untagged_cost_usd","attribution_statuses","session_linked_requests","branch_tagged_requests","priced_requests","coverage"]},by_work_type:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{key:{type:"string"},label:{type:"string"},merged_prs:{type:"integer"},attributed_prs:{type:"integer"},total_cost_usd:{type:"number"},median_cost_usd:{anyOf:[{type:"number"},{type:"null"}]},median_changed_files:{anyOf:[{type:"number"},{type:"null"}]}},required:["key","label","merged_prs","attributed_prs","total_cost_usd","median_cost_usd","median_changed_files"]}},by_harness:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{agent_slug:{type:"string"},attributed_prs:{type:"integer"},total_cost_usd:{type:"number"},median_cost_usd:{anyOf:[{type:"number"},{type:"null"}]},median_sessions:{anyOf:[{type:"number"},{type:"null"}]},median_floor:{type:"integer"}},required:["agent_slug","attributed_prs","total_cost_usd","median_cost_usd","median_sessions","median_floor"]}},by_repo:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{repo:{type:"string"},merged_prs:{type:"integer"},attributed_prs:{type:"integer"},total_cost_usd:{type:"number"},median_cost_usd:{anyOf:[{type:"number"},{type:"null"}]}},required:["repo","merged_prs","attributed_prs","total_cost_usd","median_cost_usd"]}},prs:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{project_id:{type:"string"},classification:{type:"object",additionalProperties:!1,properties:{key:{type:"string"},source:{type:"string"},version:{type:"string"},branch_type:{type:"string"},title_type:{type:"string"}},required:["key","source","version","branch_type","title_type"]},attribution_status:{type:"string"},evidence:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{member_user_id:{type:"string"},name:{type:"string"},email:{type:"string"},agent_slug:{type:"string"},model:{type:"string"},requests:{type:"integer"},priced_requests:{type:"integer"},cost_usd:{type:"number"}},required:["member_user_id","name","email","agent_slug","model","requests","priced_requests","cost_usd"]}},evidence_truncated:{type:"boolean"},repo:{type:"string"},number:{type:"integer"},title:{type:"string"},branch:{type:"string"},base_branch:{type:"string"},head_sha:{type:"string"},base_sha:{type:"string"},merge_commit_sha:{type:"string"},commit_count:{anyOf:[{type:"integer"},{type:"null"}]},author_login:{type:"string"},work_type:{type:"string"},merged_at:{type:"string"},opened_at:{type:"string"},additions:{type:"integer"},deletions:{type:"integer"},changed_files:{type:"integer"},attributed:{type:"boolean"},sessions:{type:"integer"},requests:{type:"integer"},cost_usd:{type:"number"},optimizers:{type:["array","null"],items:{type:"string"}}},required:["project_id","classification","attribution_status","evidence","evidence_truncated","repo","number","title","branch","author_login","work_type","merged_at","additions","deletions","changed_files","attributed","sessions","requests","cost_usd","optimizers"]}},unlanded:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{repo:{type:"string"},project_id:{type:"string"},branch:{type:"string"},sessions:{type:"integer"},requests:{type:"integer"},cost_usd:{type:"number"},last_seen:{type:"string"}},required:["repo","project_id","branch","sessions","requests","cost_usd","last_seen"]}},optimizer_effects:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{optimizer_id:{type:"string"},with_prs:{type:"integer"},without_prs:{type:"integer"},mixed_prs:{type:"integer"},with_median_usd:{anyOf:[{type:"number"},{type:"null"}]},without_median_usd:{anyOf:[{type:"number"},{type:"null"}]},comparable:{type:"boolean"}},required:["optimizer_id","with_prs","without_prs","mixed_prs","with_median_usd","without_median_usd","comparable"]}},truncated:{type:"boolean"},basis_notes:{type:"object",additionalProperties:!1,properties:{join:{type:"string"},cost:{type:"string"},optimizer:{type:"string"},attribution:{type:"string"},medians:{type:"string"}},required:["join","cost","optimizer","attribution","medians"]}},required:["window","scope","connected","history_import","repos","basis","totals","by_work_type","by_harness","by_repo","prs","unlanded","optimizer_effects","truncated","basis_notes"]},binding:{path_inputs:{},query_inputs:["from","sample_data","to","window"],body_inputs:[]},contract_sha256:"12f865f7f72f97af6eb91b5d80692e90b3afdf7bf0a6248bcc3c7f58822c135b"},{id:"people.my_sessions",version:"1",summary:"people: my_sessions",method:"GET",path:"/me/sessions",permissions:["org:read"],scope:"project",access:"read",aliases:["caveman_people.my_sessions"],input_schema:{type:"object",additionalProperties:!1,properties:{agent:{type:"string"},branch:{type:"string"},from:{type:"string",format:"date-time"},limit:{type:"integer",minimum:0},member_user_id:{type:"string"},offset:{type:"integer",minimum:0},project_id:{type:"string"},q:{type:"string"},repo:{type:"string"},sample_data:{type:"boolean"},snapshot:{type:"string"},sort:{type:"string"},to:{type:"string",format:"date-time"},window:{type:"string"},work_type:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{filter:{type:"object",additionalProperties:!1,properties:{member_user_id:{type:"string"},work_type:{type:"string"},agent:{type:"string"},repo:{type:"string"},branch:{type:"string"},q:{type:"string"}},required:[]},page:{type:"object",additionalProperties:!1,properties:{limit:{type:"integer"},offset:{type:"integer"},next_offset:{anyOf:[{type:"integer"},{type:"null"}]},from:{type:"string"},to:{type:"string"},snapshot:{type:"string"}},required:["limit","offset","next_offset","from","to","snapshot"]},scope:{type:"string"},sort:{type:"string"},totals:{type:"object",additionalProperties:!1,properties:{sessions:{type:"integer"},requests:{type:"integer"},priced_requests:{type:"integer"},unpriced_requests:{type:"integer"},provider_incomplete_requests:{type:"integer"},errors:{type:"integer"},input_tokens:{type:"integer"},cached_input_tokens:{type:"integer"},output_tokens:{type:"integer"},spend_usd:{type:"number"},p95_spend_usd:{type:"number"}},required:["sessions","requests","priced_requests","unpriced_requests","provider_incomplete_requests","errors","input_tokens","cached_input_tokens","output_tokens","spend_usd","p95_spend_usd"]},sessions:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{session_id:{type:"string"},project_id:{type:"string"},member_user_id:{type:"string"},name:{type:"string"},email:{type:"string"},agent_slug:{type:"string"},started_at:{type:"string"},ended_at:{type:"string"},requests:{type:"integer"},priced_requests:{type:"integer"},provider_incomplete_requests:{type:"integer"},peak_input_tokens:{type:"integer"},errors:{type:"integer"},spend_usd:{type:"number"},input_tokens:{type:"integer"},cached_input_tokens:{type:"integer"},output_tokens:{type:"integer"},cache_missed_input_tokens:{type:"integer"},tool_schema_tokens:{type:"integer"},cache_breaks:{type:"integer"},top_model:{type:"string"},work_type:{type:"string"},repo:{type:"string"},branch:{type:"string"}},required:["session_id","project_id","member_user_id","name","email","agent_slug","started_at","ended_at","requests","priced_requests","provider_incomplete_requests","peak_input_tokens","errors","spend_usd","input_tokens","cached_input_tokens","output_tokens","cache_missed_input_tokens","tool_schema_tokens","cache_breaks","top_model","work_type","repo","branch"]}},truncated:{type:"boolean"},work_type_version:{type:"string"},spend_basis:{type:"string"}},required:["filter","page","scope","sort","totals","sessions","truncated","work_type_version","spend_basis"]},binding:{path_inputs:{},query_inputs:["agent","branch","from","limit","member_user_id","offset","project_id","q","repo","sample_data","snapshot","sort","to","window","work_type"],body_inputs:[]},contract_sha256:"22504537057acb2901bf20dfe71a965bda158abc6444b9593440fc589e2752a9"},{id:"people.my_session",version:"1",summary:"people: my_session",method:"GET",path:"/me/sessions/{sessionId}",permissions:["org:read"],scope:"project",access:"read",aliases:["caveman_people.my_session"],input_schema:{type:"object",additionalProperties:!1,properties:{agent:{type:"string"},branch:{type:"string"},from:{type:"string",format:"date-time"},limit:{type:"integer",minimum:0},member_user_id:{type:"string"},offset:{type:"integer",minimum:0},project_id:{type:"string"},q:{type:"string"},repo:{type:"string"},sample_data:{type:"boolean"},snapshot:{type:"string"},sort:{type:"string"},to:{type:"string",format:"date-time"},window:{type:"string"},work_type:{type:"string"},session_id:{type:"string",pattern:"^[A-Za-z0-9._:-]{1,128}$"}},required:["session_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{session:{type:"object",additionalProperties:!1,properties:{session_id:{type:"string"},project_id:{type:"string"},member_user_id:{type:"string"},name:{type:"string"},email:{type:"string"},agent_slug:{type:"string"},started_at:{type:"string"},ended_at:{type:"string"},requests:{type:"integer"},priced_requests:{type:"integer"},provider_incomplete_requests:{type:"integer"},peak_input_tokens:{type:"integer"},errors:{type:"integer"},spend_usd:{type:"number"},input_tokens:{type:"integer"},cached_input_tokens:{type:"integer"},output_tokens:{type:"integer"},cache_missed_input_tokens:{type:"integer"},tool_schema_tokens:{type:"integer"},cache_breaks:{type:"integer"},top_model:{type:"string"},work_type:{type:"string"},repo:{type:"string"},branch:{type:"string"}},required:["session_id","project_id","member_user_id","name","email","agent_slug","started_at","ended_at","requests","priced_requests","provider_incomplete_requests","peak_input_tokens","errors","spend_usd","input_tokens","cached_input_tokens","output_tokens","cache_missed_input_tokens","tool_schema_tokens","cache_breaks","top_model","work_type","repo","branch"]},page:{type:"object",additionalProperties:!1,properties:{limit:{type:"integer"},offset:{type:"integer"},next_offset:{anyOf:[{type:"integer"},{type:"null"}]},from:{type:"string"},to:{type:"string"},snapshot:{type:"string"}},required:["limit","offset","next_offset","from","to","snapshot"]},scope:{type:"string"},permissions:{type:"object",additionalProperties:!1,properties:{trace_metadata:{type:"boolean"},trace_content:{type:"boolean"}},required:["trace_metadata","trace_content"]},turns:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{index:{type:"integer"},request_id:{type:"string"},trace_id:{type:"string"},timestamp:{type:"string"},model:{type:"string"},provider:{type:"string"},status_code:{type:"integer"},latency_ms:{type:"integer"},priced:{type:"boolean"},provider_usage_complete:{type:"boolean"},spend_usd:{type:"number"},input_tokens:{type:"integer"},cached_input_tokens:{type:"integer"},cache_creation_input_tokens:{type:"integer"},output_tokens:{type:"integer"},cache_miss_reason:{type:"string"},cache_break:{type:"boolean"},cache_divergence_component:{type:"string"},cache_divergence_message_position:{type:"integer"},cache_divergence_message_role:{type:"string"},cache_prev_message_count:{type:"integer"},cache_message_count:{type:"integer"},cache_missed_input_tokens:{type:"integer"},tool_schema_tokens:{type:"integer"},result_tool_tokens:{type:"integer"},task_type:{type:"string"},work_type:{type:"string"},route_effort:{type:"string"},route_to:{type:"string"}},required:["index","request_id","trace_id","timestamp","model","provider","status_code","latency_ms","priced","provider_usage_complete","spend_usd","input_tokens","cached_input_tokens","cache_creation_input_tokens","output_tokens","cache_miss_reason","cache_break","cache_divergence_component","cache_divergence_message_position","cache_divergence_message_role","cache_prev_message_count","cache_message_count","cache_missed_input_tokens","tool_schema_tokens","result_tool_tokens","task_type","work_type","route_effort","route_to"]}},truncated:{type:"boolean"},work_type_version:{type:"string"},spend_basis:{type:"string"}},required:["session","page","scope","permissions","turns","truncated","work_type_version","spend_basis"]},binding:{path_inputs:{sessionId:"session_id"},query_inputs:["agent","branch","from","limit","member_user_id","offset","project_id","q","repo","sample_data","snapshot","sort","to","window","work_type"],body_inputs:[]},contract_sha256:"b4815914417d1b0dfb92e741e5a3047e696029d98fd11f0490bddc2276343836"},{id:"people.my_usage",version:"1",summary:"people: my_usage",method:"GET",path:"/me/usage",permissions:["org:read"],scope:"project",access:"read",aliases:["caveman_people.my_usage"],input_schema:{type:"object",additionalProperties:!1,properties:{from:{type:"string",format:"date-time"},sample_data:{type:"boolean"},to:{type:"string",format:"date-time"},window:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{member_user_id:{type:"string"},window:{type:"string"},totals:{type:"object",additionalProperties:!1,properties:{spend_usd:{type:"number"},prev_spend_usd:{anyOf:[{type:"number"},{type:"null"}]},requests:{type:"integer"},priced_requests:{type:"integer"},input_tokens:{type:"integer"},output_tokens:{type:"integer"},cached_input_tokens:{type:"integer"},verified_savings_usd:{type:"number"}},required:["spend_usd","requests","priced_requests","input_tokens","output_tokens","cached_input_tokens","verified_savings_usd"]},series:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{day:{type:"string"},spend_usd:{type:"number"},requests:{type:"integer"}},required:["day","spend_usd","requests"]}},top_models:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{model:{type:"string"},spend_usd:{type:"number"}},required:["model","spend_usd"]}},harnesses:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{agent_slug:{type:"string"},requests:{type:"integer"},spend_usd:{type:"number"}},required:["agent_slug","requests","spend_usd"]}},devices:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},device_name:{type:"string"},created_at:{type:"string",format:"date-time"},last_refreshed_at:{type:"string",format:"date-time"},last_wrapped_run_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]}},required:["id","device_name","created_at","last_refreshed_at","last_wrapped_run_at"]}},last_login:{type:"string"},personal_keys:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},key_prefix:{type:"string"},project_id:{type:"string"},created_at:{type:"string",format:"date-time"},revoked_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},blocked_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},expires_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]}},required:["id","name","key_prefix","project_id","created_at","revoked_at","blocked_at","expires_at"]}},attribution:{type:"string"}},required:["member_user_id","window","totals","series","top_models","harnesses","devices","last_login","personal_keys","attribution"]},binding:{path_inputs:{},query_inputs:["from","sample_data","to","window"],body_inputs:[]},contract_sha256:"4da1410a65a20063fc3d0555570332f0f188f07a8cd2671139c2851358e6d585"},{id:"human.metering_receipts",version:"1",summary:"human: metering_receipts",method:"GET",path:"/metering/receipts",permissions:["billing:read"],scope:"project",access:"none",exclusion:"Changes billing, spend ceilings, or the money contract. Human-only regardless of agent competence.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"36f9f68fa8cd06429b2829726abae2ece69c4f243ecea0a4e0450ac6aa69b26f"},{id:"fixes.list_opportunities",version:"1",summary:"fixes: list_opportunities",method:"GET",path:"/opportunities",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_fixes.list_opportunities"],input_schema:{type:"object",additionalProperties:!1,properties:{from:{type:"string",format:"date-time"},sample_data:{type:"boolean"},to:{type:"string",format:"date-time"},window:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},agent_id:{anyOf:[{type:"string"},{type:"null"}]},workflow_id:{anyOf:[{type:"string"},{type:"null"}]},optimizer_id:{type:"string"},provider:{type:"string"},model:{type:"string"},optimizer_version:{type:"integer"},safety_class:{type:"string"},status:{type:"string"},confidence:{type:"string"},basis:{type:"string"},estimated_daily_savings_usd_low:{type:"number"},estimated_daily_savings_usd_base:{type:"number"},estimated_daily_savings_usd_high:{type:"number"},quality_risk:{type:"string"},implementation_effort:{type:"string"},sample_size:{type:"integer"},evidence_json:{},first_seen_at:{type:"string",format:"date-time"},last_seen_at:{type:"string",format:"date-time"},signal_day:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},status_reason:{anyOf:[{type:"string"},{type:"null"}]},implemented_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},regressed_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]}},required:["id","project_id","optimizer_id","provider","model","optimizer_version","safety_class","status","confidence","basis","estimated_daily_savings_usd_low","estimated_daily_savings_usd_base","estimated_daily_savings_usd_high","quality_risk","implementation_effort","sample_size","evidence_json","first_seen_at","last_seen_at","status_reason","implemented_at","regressed_at"]}},report_only_observations:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},optimizer_id:{type:"string"},title:{type:"string"},observation:{type:"string"},status:{type:"string"},report_only:{type:"boolean"},last_seen_at:{type:"string",format:"date-time"}},required:["id","project_id","optimizer_id","title","observation","status","report_only","last_seen_at"]}},next_cursor:{type:"null"}},required:["data","report_only_observations","next_cursor"]},binding:{path_inputs:{},query_inputs:["from","sample_data","to","window"],body_inputs:[]},contract_sha256:"0ce96d7f3805e3e04ed330f85988c83d0b8fde75616fa795f594ab2eee9c6752"},{id:"fixes.get_opportunity",version:"1",summary:"fixes: get_opportunity",method:"GET",path:"/opportunities/{opportunityId}",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_fixes.get_opportunity"],input_schema:{type:"object",additionalProperties:!1,properties:{opportunity_id:{type:"string",format:"uuid"}},required:["opportunity_id"]},output_schema:{anyOf:[{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},optimizer_id:{type:"string"},title:{type:"string"},observation:{type:"string"},status:{type:"string"},report_only:{type:"boolean"},last_seen_at:{type:"string",format:"date-time"}},required:["id","project_id","optimizer_id","title","observation","status","report_only","last_seen_at"]},{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},agent_id:{anyOf:[{type:"string"},{type:"null"}]},workflow_id:{anyOf:[{type:"string"},{type:"null"}]},optimizer_id:{type:"string"},provider:{type:"string"},model:{type:"string"},optimizer_version:{type:"integer"},safety_class:{type:"string"},status:{type:"string"},confidence:{type:"string"},basis:{type:"string"},estimated_daily_savings_usd_low:{type:"number"},estimated_daily_savings_usd_base:{type:"number"},estimated_daily_savings_usd_high:{type:"number"},quality_risk:{type:"string"},implementation_effort:{type:"string"},sample_size:{type:"integer"},evidence_json:{},first_seen_at:{type:"string",format:"date-time"},last_seen_at:{type:"string",format:"date-time"},signal_day:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},status_reason:{anyOf:[{type:"string"},{type:"null"}]},implemented_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},regressed_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},wrap_directive:{type:"object",additionalProperties:!1,properties:{recipe_id:{type:"string"},executor:{type:"string"},install_command:{type:"string"},undo_command:{type:"string"},note:{type:"string"},eval_gate:{type:"object",additionalProperties:!1,properties:{kind:{type:"string"},ready:{type:"boolean"},reason:{type:"string"}},required:["kind","ready"]},token_replay:{type:"object",additionalProperties:!1,properties:{recipe_id:{type:"string"},window_start:{type:"string"},window_end:{type:"string"},closed_days:{type:"integer"},cases_measured:{type:"integer"},delta_tokens:{type:"integer"},count_label:{type:"string"},fidelity:{type:"string"},limits:{},detail:{},created_at:{type:"string"}},required:["recipe_id","window_start","window_end","closed_days","cases_measured","delta_tokens","count_label","fidelity","limits","detail","created_at"]}},required:["recipe_id","executor","install_command","undo_command","note","eval_gate"]}},required:["id","project_id","optimizer_id","provider","model","optimizer_version","safety_class","status","confidence","basis","estimated_daily_savings_usd_low","estimated_daily_savings_usd_base","estimated_daily_savings_usd_high","quality_risk","implementation_effort","sample_size","evidence_json","first_seen_at","last_seen_at","status_reason","implemented_at","regressed_at"]}]},binding:{path_inputs:{opportunityId:"opportunity_id"},query_inputs:[],body_inputs:[]},contract_sha256:"fa44aff71c652b883e1643cd648356cc8673947ce1e831a2cea1595ddd051c7f"},{id:"fixes.create_experiment",version:"1",summary:"fixes: create_experiment",method:"POST",path:"/opportunities/{opportunityId}/create-experiment",permissions:["experiment:run"],scope:"project",access:"write",aliases:["caveman_fixes_write.create_experiment"],input_schema:{type:"object",additionalProperties:!1,properties:{baseline_config:{},candidate_config:{},eval_suite_id:{type:"string"},guardrails:{},name:{type:"string"},opportunity_id:{type:"string",format:"uuid"},practice_id:{type:"string"},type:{enum:["replay","shadow","canary","density-canary","before_after"]}},required:["opportunity_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},opportunity_id:{anyOf:[{type:"string"},{type:"null"}]},eval_suite_id:{anyOf:[{type:"string"},{type:"null"}]},optimizer_id:{anyOf:[{type:"string"},{type:"null"}]},practice_id:{anyOf:[{type:"string"},{type:"null"}]},practice_metric:{anyOf:[{type:"string"},{type:"null"}]},name:{type:"string"},type:{type:"string"},state:{type:"string"},baseline_config:{},candidate_config:{},guardrails_json:{},results_json:{},created_at:{type:"string",format:"date-time"},created_via:{type:"string"}},required:["id","project_id","name","type","state","baseline_config","candidate_config","guardrails_json","results_json","created_at"]},binding:{path_inputs:{opportunityId:"opportunity_id"},query_inputs:[],body_inputs:["baseline_config","candidate_config","eval_suite_id","guardrails","name","opportunity_id","practice_id","type"]},contract_sha256:"6a4a8df5711c38308820ba30723993b142367fb8fbe19234edd56b98accbe803"},{id:"fixes.dismiss_opportunity",version:"1",summary:"fixes: dismiss_opportunity",method:"POST",path:"/opportunities/{opportunityId}/dismiss",permissions:["opportunity:write"],scope:"project",access:"write",aliases:["caveman_fixes_write.dismiss_opportunity"],input_schema:{type:"object",additionalProperties:!1,properties:{opportunity_id:{type:"string",format:"uuid"}},required:["opportunity_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{ok:{const:!0},id:{type:"string",format:"uuid"},status:{const:"dismissed"}},required:["ok","id","status"]},binding:{path_inputs:{opportunityId:"opportunity_id"},query_inputs:[],body_inputs:[]},contract_sha256:"929efc11df1e060e398973eba93d1105cbf7723dc6f398ba2417b5439340b19e"},{id:"fixes.mark_implemented",version:"1",summary:"fixes: mark_implemented",method:"POST",path:"/opportunities/{opportunityId}/mark-implemented",permissions:["opportunity:write"],scope:"project",access:"write",aliases:["caveman_fixes_write.mark_implemented"],input_schema:{type:"object",additionalProperties:!1,properties:{opportunity_id:{type:"string",format:"uuid"}},required:["opportunity_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{ok:{const:!0},id:{type:"string",format:"uuid"},status:{const:"implemented"}},required:["ok","id","status"]},binding:{path_inputs:{opportunityId:"opportunity_id"},query_inputs:[],body_inputs:[]},contract_sha256:"85d4d8de26126766f58b06cbf1437362ecb7d32a2a6d4f53cb783b635bd915a7"},{id:"proposals.list",version:"1",summary:"fixes: list_proposals",method:"GET",path:"/optimization-proposals",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_fixes.list_proposals"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},opportunity_id:{anyOf:[{type:"string"},{type:"null"}]},optimizer_id:{type:"string"},family:{type:"string"},safety_class:{type:"string"},basis:{type:"string"},requires_eval_gate:{type:"boolean"},engine_lossy:{type:"boolean"},savings_usd_low:{type:"number"},savings_usd_base:{type:"number"},savings_usd_high:{type:"number"},cave_score_before:{anyOf:[{type:"integer"},{type:"null"}]},cave_score_target:{anyOf:[{type:"integer"},{type:"null"}]},status:{type:"string"},fix_state:{type:"string"},runner:{type:"string"},evidence_source:{type:"string"},fix_state_reason:{type:"string"},fixed_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},pr_url:{type:"string"},pr_number:{anyOf:[{type:"integer"},{type:"null"}]},repo:{type:"string"},branch:{type:"string"},blast_radius:{},evidence:{},execution_claim:{anyOf:[{type:"object",additionalProperties:!1,properties:{generation:{type:"integer"},dispatch_seq:{type:"integer"},state:{type:"string"},claimed_at:{type:"string",format:"date-time"},lease_expires_at:{type:"string",format:"date-time"}},required:["generation","dispatch_seq","state","claimed_at","lease_expires_at"]},{type:"null"}]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"}},required:["id","project_id","optimizer_id","family","safety_class","basis","requires_eval_gate","engine_lossy","savings_usd_low","savings_usd_base","savings_usd_high","status","fix_state","runner","evidence_source","fix_state_reason","pr_url","repo","branch","blast_radius","evidence","created_at","updated_at"]}},next_cursor:{type:"null"}},required:["data","next_cursor"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"68bad9ded3dc8574508bc5e5ad9e5350310f8baa2969f0b3b93720692fffea08"},{id:"proposals.get",version:"1",summary:"fixes: get_proposal",method:"GET",path:"/optimization-proposals/{proposalId}",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_fixes.get_proposal"],input_schema:{type:"object",additionalProperties:!1,properties:{proposal_id:{type:"string",format:"uuid"}},required:["proposal_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},opportunity_id:{anyOf:[{type:"string"},{type:"null"}]},optimizer_id:{type:"string"},family:{type:"string"},safety_class:{type:"string"},basis:{type:"string"},requires_eval_gate:{type:"boolean"},engine_lossy:{type:"boolean"},savings_usd_low:{type:"number"},savings_usd_base:{type:"number"},savings_usd_high:{type:"number"},cave_score_before:{anyOf:[{type:"integer"},{type:"null"}]},cave_score_target:{anyOf:[{type:"integer"},{type:"null"}]},status:{type:"string"},fix_state:{type:"string"},runner:{type:"string"},evidence_source:{type:"string"},fix_state_reason:{type:"string"},fixed_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},pr_url:{type:"string"},pr_number:{anyOf:[{type:"integer"},{type:"null"}]},repo:{type:"string"},branch:{type:"string"},blast_radius:{},evidence:{},execution_claim:{anyOf:[{type:"object",additionalProperties:!1,properties:{generation:{type:"integer"},dispatch_seq:{type:"integer"},state:{type:"string"},claimed_at:{type:"string",format:"date-time"},lease_expires_at:{type:"string",format:"date-time"}},required:["generation","dispatch_seq","state","claimed_at","lease_expires_at"]},{type:"null"}]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"}},required:["id","project_id","optimizer_id","family","safety_class","basis","requires_eval_gate","engine_lossy","savings_usd_low","savings_usd_base","savings_usd_high","status","fix_state","runner","evidence_source","fix_state_reason","pr_url","repo","branch","blast_radius","evidence","created_at","updated_at"]},binding:{path_inputs:{proposalId:"proposal_id"},query_inputs:[],body_inputs:[]},contract_sha256:"65f699cb84a717bb6e74eed3f4170231ba4766823ce82b95983f778269f00651"},{id:"human.add_proposal_evidence",version:"1",summary:"human: add_proposal_evidence",method:"POST",path:"/optimization-proposals/{proposalId}/evidence",permissions:["proposal:draft"],scope:"project",access:"none",exclusion:"The proposal-keyed spelling of the local fix lane's evidence, driven by `caveman agent submit` and gated on proposal:draft, which an MCP agent connection is never granted (only the onboarding wizard's connection holds it). An agent reports the same bundle by brief (briefs.fix_report): an agent grading its own work is exactly why the server labels it self_reported and caps it at candidate.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{parameters:{type:"object",additionalProperties:!1,properties:{proposalId:{type:"string"}},required:["proposalId"]},query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}},body:{type:"object",additionalProperties:!0}},required:["parameters"]},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"a07223003eca55ec3a430cbf11037b4900e8a19f21dd9c22545abeee0b8a886e"},{id:"fixes.proposal_runs",version:"1",summary:"fixes: proposal_runs",method:"GET",path:"/optimization-proposals/{proposalId}/runs",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_fixes.proposal_runs"],input_schema:{type:"object",additionalProperties:!1,properties:{after_seq:{type:"integer",minimum:0},proposal_id:{type:"string",format:"uuid"}},required:["proposal_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{proposal:{type:"object",additionalProperties:!1,properties:{id:{type:"string",format:"uuid"},status:{type:"string"},pr_url:{type:"string"},pr_number:{type:["integer","null"]}},required:["id","status","pr_url","pr_number"]},runs:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{seq:{type:"integer"},action:{type:"string"},detail:{},cost_usd:{type:"number"},created_at:{type:"string",format:"date-time"}},required:["seq","action","detail","cost_usd","created_at"]}},next_after_seq:{type:"integer"},next_poll_ms:{type:"integer"},terminal:{type:"boolean"},deferred:{type:"boolean"},retryable:{type:"boolean"}},required:["proposal","runs","next_after_seq","next_poll_ms","terminal","deferred","retryable"]},binding:{path_inputs:{proposalId:"proposal_id"},query_inputs:["after_seq"],body_inputs:[]},contract_sha256:"beccabd93c0c437d26ae48b5b537ec2d3900a0379fb26d85465c0a528c54125b"},{id:"context.get_org",version:"1",summary:"context: get_org",method:"GET",path:"/org",permissions:["org:read"],scope:"organization",access:"read",aliases:["caveman_context.get_org"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},slug:{type:"string"},mode:{type:"string"},status:{type:"string"},plan:{anyOf:[{type:"string"},{type:"null"}]}},required:["id","name","slug","mode","status","plan"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"6f1518c098e5b10aecb89c9ac692e43bf86c46214cc97ac4e39ad71bbfb3fabc"},{id:"human.update_org",version:"1",summary:"human: update_org",method:"PATCH",path:"/org",permissions:["org:update"],scope:"organization",access:"none",exclusion:"Changes organization-wide settings that every project inherits. Outside a project-scoped agent connection's blast radius by design.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}},body:{type:"object",additionalProperties:!0}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"445ce8379f6821b6613a41acc474933bbc4cbc13e9fc7f8f247b5e2a924ddf2b"},{id:"human.compute_usage",version:"1",summary:"human: compute_usage",method:"GET",path:"/org/compute-usage",permissions:["org:read"],scope:"organization",access:"none",exclusion:"Compute metering is a billing surface; it is read in the dashboard next to the invoice it explains.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"70992019a1b9e8f7cacdb31bc7c4de782c75970412afc27acbf34c16ab8fcc4f"},{id:"human.consents",version:"1",summary:"human: consents",method:"GET",path:"/org/consents",permissions:["auditlog:read"],scope:"organization",access:"none",exclusion:"Records consent or a data-subject decision on behalf of the organization. Legal effect, so a human must be the actor.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"c549851391efdba0306eee2393e5dfc07eca238527277de6c484ffcaa2f0c551"},{id:"policy.consent_status",version:"1",summary:"policy: consent_status",method:"GET",path:"/org/consents/status",permissions:["org:read"],scope:"organization",access:"read",aliases:["caveman_policy.consent_status"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{document:{type:"string"},version:{type:"string"}},required:["document","version"]}}},required:["data"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"2b61e8cd850456b1b55d3ff9e7f504bc8f562b411216186f161d91031cf0d5c3"},{id:"people.list_members",version:"1",summary:"people: list_members",method:"GET",path:"/org/members",permissions:["org:read"],scope:"organization",access:"read",aliases:["caveman_people.list_members"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},user:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},email:{type:"string"},name:{type:"string"},organization_id:{type:"string"},role:{type:"string"},project_id:{type:"string"},project_ids:{type:["array","null"],items:{type:"string"}},scopes:{type:["array","null"],items:{type:"string"}}},required:["id","email","name","organization_id","role"]},role:{type:"string"},identity_source:{type:"string"},joined_at:{type:"string",format:"date-time"},status:{type:"string"},accepted_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},invited_by:{anyOf:[{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},email:{type:"string"}},required:["id","name","email"]},{type:"null"}]},invite_expires_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},joined_via:{anyOf:[{type:"string"},{type:"null"}]},account_status:{type:"string"}},required:["id","user","role","identity_source","joined_at","status","accepted_at","invited_by","invite_expires_at","joined_via"]}},next_cursor:{type:"null"}},required:["data","next_cursor"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"bfaf11c041f9f811f20ec7a095b589bf68ccd1d706e66bde3d8b8397fd65b33f"},{id:"human.sso",version:"1",summary:"human: sso",method:"GET",path:"/org/oidc",permissions:["org:read"],scope:"organization",access:"none",exclusion:"Creates or changes an organization identity. An agent proposes members; a human invites them, because a wrongly-added member is an access-control breach, not a config mistake.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"d1e7de02236e84b0d6f0271c8980b9c509176bc514592c54ac0ecac8cab860e1"},{id:"human.practice_consents",version:"1",summary:"human: practice_consents",method:"GET",path:"/org/practice-rollup-consents",permissions:["settings:read"],scope:"organization",access:"none",exclusion:"Records consent or a data-subject decision on behalf of the organization. Legal effect, so a human must be the actor.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"35e2f3e37b260335f5300114701d001dceed5b58b4bb5e9ce104e0aa1d1bf907"},{id:"policy.org_redaction_rules",version:"1",summary:"policy: org_redaction_rules",method:"GET",path:"/org/redaction-rules",permissions:["settings:read"],scope:"organization",access:"read",aliases:["caveman_policy.org_redaction_rules"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{anyOf:[{type:"string"},{type:"null"}]},name:{type:"string"},rule_type:{type:"string"},pattern:{type:"string"},replacement:{type:"string"},enabled:{type:"boolean"},priority:{type:"integer"},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"},unsupported_reason:{type:"string"}},required:["id","project_id","name","rule_type","pattern","replacement","enabled","priority","created_at","updated_at"]}},next_cursor:{type:"null"}},required:["data","next_cursor"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"4ec475fec6955254799af084c3d6ae9bb6365eff27b4ade3b5e0cd38c4286b4c"},{id:"human.replay_consents",version:"1",summary:"human: replay_consents",method:"GET",path:"/org/replay-consents",permissions:["settings:read"],scope:"organization",access:"none",exclusion:"Records consent or a data-subject decision on behalf of the organization. Legal effect, so a human must be the actor.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"9dd5919e0e8ac90dbda0e7078e19b93a514168b094cc6724f515469d46b9b987"},{id:"policy.org_retention",version:"1",summary:"policy: org_retention",method:"GET",path:"/org/retention",permissions:["settings:read"],scope:"organization",access:"read",aliases:["caveman_policy.org_retention"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},name:{type:"string"},raw_payload_storage:{type:"boolean"},metadata_storage:{type:"boolean"},payload_hash_storage:{type:"boolean"},artifact_storage:{type:"boolean"},trace_retention_days:{type:["integer","null"],minimum:1,description:"Days to keep request history. null keeps it until you delete it."},raw_payload_retention_days:{type:["integer","null"],minimum:1,description:"Days to keep request and response bodies. null keeps them until you delete them."},artifact_retention_days:{type:["integer","null"],minimum:1,description:"Days to keep agent artifacts. null keeps them until you delete them."},training_use_allowed:{type:"boolean"},history_deleted_before:{type:["string","null"],format:"date",description:"First day of request history still kept after a shorter window was lifted; earlier days were deleted. null when nothing was deleted."}},required:["id","organization_id","name","raw_payload_storage","metadata_storage","payload_hash_storage","artifact_storage","trace_retention_days","raw_payload_retention_days","artifact_retention_days","training_use_allowed","history_deleted_before"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"ea64f90adde387114ce45c545837f962db5622dc96a0b543a0047912579dd449"},{id:"retention.update",version:"1",summary:"Set how long request history, saved request bodies and artifacts are kept, and whether bodies are saved at all.",method:"PATCH",path:"/org/retention",permissions:["org:update"],scope:"organization",access:"none",exclusion:"Deletes, exports or changes the retention of tenant data. Irreversible or data-egress; requires a human actor in the audit trail.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}},body:{type:"object",additionalProperties:!0}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"6477a8e3ef7658caae9fde48ba81c54dd17abefe7aa7cf70f9caa003bbc4a785"},{id:"autopilot.resume",version:"1",summary:"Resume automatic work for the organization.",method:"DELETE",path:"/orgs/{orgId}/autopilot/pause",permissions:["autopilot:manage"],scope:"organization",access:"none",exclusion:"Pauses or resumes every automatic change in the organization. A person pulls and releases that brake; an agent session never flips it for itself.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}},body:{type:"object",additionalProperties:!0}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"19dd995217ff032fdc8164e23081bf8cd1748c96973b66c27a21b8915b7d8863"},{id:"autopilot.pause_status",version:"1",summary:"Read whether automatic work is paused for the organization, and by whom.",method:"GET",path:"/orgs/{orgId}/autopilot/pause",permissions:["settings:read"],scope:"organization",access:"read",aliases:["caveman_policy.autopilot_pause"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{organization_id:{type:"string",format:"uuid"},paused:{type:"boolean"},paused_by:{type:"string"},paused_at:{type:"string",format:"date-time"}},required:["organization_id","paused"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"ec1867dcbbb38189c97ca2974a6fd2f9c63b67c9cf8f3d81ecfdec06af60d700"},{id:"autopilot.pause",version:"1",summary:"Pause automatic work for the whole organization.",method:"POST",path:"/orgs/{orgId}/autopilot/pause",permissions:["autopilot:manage"],scope:"organization",access:"none",exclusion:"Pauses or resumes every automatic change in the organization. A person pulls and releases that brake; an agent session never flips it for itself.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}},body:{type:"object",additionalProperties:!0}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"9c68dbf7343250a23a0b309f3c8770f6853a21d69f1a637bbe78035e948f2b8d"},{id:"fixes.org_practice_evidence",version:"1",summary:"fixes: org_practice_evidence",method:"GET",path:"/practice-evidence",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_fixes.org_practice_evidence"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},practice_id:{type:"string"},source_experiment_id:{type:"string"},metric:{type:"string"},basis:{type:"string"},baseline_value:{type:"number"},candidate_value:{type:"number"},effect_value:{type:"number"},sample_size:{type:"integer"},observed_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"}},required:["id","project_id","practice_id","source_experiment_id","metric","basis","baseline_value","candidate_value","effect_value","sample_size","observed_at","updated_at"]}},next_cursor:{type:"null"},cross_tenant:{const:!1}},required:["data","next_cursor","cross_tenant"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"7d782c618383c6d359e11e9e75fbd51663a6707438324c4c2aa27539c5204034"},{id:"fixes.submit_practice_findings",version:"1",summary:"fixes: submit_practice_findings",method:"POST",path:"/practice-findings",permissions:["experiment:run"],scope:"project",access:"write",aliases:["caveman_fixes_write.submit_practice_findings"],input_schema:{type:"object",additionalProperties:!1,properties:{findings:{type:"array",items:{type:"object",additionalProperties:!1,properties:{basis:{type:"string"},observed_at:{type:"string"},practice_id:{type:"string"},sessions_scanned:{type:"integer"},sink_id:{type:"string"},tokens_per_day_rate:{type:"integer"},tokens_per_turn:{type:"integer"}}}}},required:["findings"]},output_schema:{type:"object",additionalProperties:!1,properties:{status:{const:"completed"},row_count:{type:"integer",minimum:0},basis:{const:"inferred"}},required:["status","row_count","basis"]},binding:{path_inputs:{},query_inputs:[],body_inputs:["findings"]},contract_sha256:"b17fc138b21d328220ccf1b2efdb6d0090bd08d0e909dd57cd1094aa7616c281"},{id:"projects.list",version:"1",summary:"context: list_projects",method:"GET",path:"/projects",permissions:["org:read"],scope:"organization",access:"read",aliases:["caveman_context.list_projects"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},name:{type:"string"},slug:{type:"string"},runtime_mode:{type:"string"},fail_policy:{type:"string"},policy_version:{type:"integer"}},required:["id","organization_id","name","slug","runtime_mode","fail_policy","policy_version"]}},next_cursor:{type:"null"}},required:["data","next_cursor"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"6717a3b8d1930bcb863e485734623317c0db6dfbd79405aa2173444012ea2861"},{id:"projects.create",version:"1",summary:"human: create_project",method:"POST",path:"/projects",permissions:["policy:draft"],scope:"organization",access:"none",exclusion:"Creates a new tenant container. A project-scoped connection is bound to one project and cannot create siblings; keeping this human-only makes that bound explicit rather than incidental.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{name:{type:"string",minLength:1,maxLength:64},slug:{type:"string"}},required:["name"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},name:{type:"string"},slug:{type:"string"},runtime_mode:{type:"string"},fail_policy:{type:"string"},policy_version:{type:"integer"},delivery_id:{type:"string",format:"uuid"},delivery_sequence:{type:"integer"},delivery_status:{type:"string"}},required:["id","organization_id","name","slug","runtime_mode","fail_policy","policy_version","delivery_id","delivery_sequence","delivery_status"]},binding:{path_inputs:{},query_inputs:[],body_inputs:["name","slug"]},contract_sha256:"730dad7db6984a4de00289e24fbafef64faab394bef54d3939f2840043c07355"},{id:"projects.get",version:"1",summary:"context: get_project",method:"GET",path:"/projects/{projectId}",permissions:["org:read"],scope:"project",access:"read",aliases:["caveman_context.get_project"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},name:{type:"string"},slug:{type:"string"},runtime_mode:{type:"string"},fail_policy:{type:"string"},policy_version:{type:"integer"}},required:["id","organization_id","name","slug","runtime_mode","fail_policy","policy_version"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"d1e8b3d7eb6ad5b4738bc122bff46ade367f11bdd0a1c3977498a5f2bf73f9ad"},{id:"projects.update",version:"1",summary:"human: update_project",method:"PATCH",path:"/projects/{projectId}",permissions:["policy:draft"],scope:"project",access:"none",exclusion:"Renames the project other systems and reports key on. Cosmetic but confusing to do behind a human's back.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{name:{type:"string",minLength:1,maxLength:64}},required:["name"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},name:{type:"string"},slug:{type:"string"},runtime_mode:{type:"string"},fail_policy:{type:"string"},policy_version:{type:"integer"}},required:["id","organization_id","name","slug","runtime_mode","fail_policy","policy_version"]},binding:{path_inputs:{},query_inputs:[],body_inputs:["name"]},contract_sha256:"5fac8d8039edf17d1c527b67c2981cc32b96e7c57cc1b716618ad13a01e67acb"},{id:"policy.access",version:"1",summary:"policy: access",method:"GET",path:"/projects/{projectId}/access",permissions:["billing:read","policy:draft"],scope:"project",access:"read",aliases:["caveman_policy.access"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{allowed_providers:{type:["array","null"],items:{type:"string"}},allowed_models:{type:["array","null"],items:{type:"string"}},requests_per_minute:{type:"integer"},concurrent_requests:{type:"integer"},max_request_bytes:{type:"integer"}},required:["allowed_providers","allowed_models","requests_per_minute","concurrent_requests","max_request_bytes"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"b23420399c81d03f42b380f0d348bf9c506b4b7e9f1dbbb73ba7c749a3494eaa"},{id:"builds.regressions",version:"1",summary:"builds: regressions",method:"GET",path:"/projects/{projectId}/agent-build-regressions",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_builds.regressions"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},agent_slug:{type:"string"},current_build_sha256:{type:"string"},baseline_build_sha256:{type:"string"},kind:{type:"string"},baseline_value:{type:"number"},current_value:{type:"number"},delta_ratio:{type:"number"},baseline_requests:{type:"integer"},current_requests:{type:"integer"},evidence_basis:{type:"string"},status:{type:"string"},observed_at:{type:"string",format:"date-time"}},required:["id","project_id","agent_slug","current_build_sha256","baseline_build_sha256","kind","baseline_value","current_value","delta_ratio","baseline_requests","current_requests","evidence_basis","status","observed_at"]}}},required:["data"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"1e907e8cdfdd61535ac15c2c4b81960a57bed6aa2c407207f65eecdb4f743e3d"},{id:"builds.list",version:"1",summary:"builds: list",method:"GET",path:"/projects/{projectId}/agent-builds",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_builds.list"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},agent_slug:{type:"string"},build_sha256:{type:"string"},plan_sha256:{type:"string"},source_sha256:{type:"string"},eval_suite_sha256:{type:"string"},catalog_sha256:{type:"string"},transform_registry_sha256:{type:"string"},harness:{type:"string"},adapter_version:{type:"string"},upstream_version:{type:"string"},runtime_version:{type:"string"},evidence_status:{type:"string"},evidence_basis:{type:"string"},lock:{},registered_by:{type:"string"},created_at:{type:"string",format:"date-time"}},required:["id","project_id","agent_slug","build_sha256","plan_sha256","source_sha256","eval_suite_sha256","catalog_sha256","transform_registry_sha256","harness","adapter_version","upstream_version","runtime_version","evidence_status","evidence_basis","lock","registered_by","created_at"]}},next_cursor:{type:"null"}},required:["data","next_cursor"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"15d04faacafc1adc4d5c3c392866be624eea8ec0027bfe9e0369195caa97c430"},{id:"builds.register",version:"1",summary:"builds: register",method:"POST",path:"/projects/{projectId}/agent-builds",permissions:["policy:draft"],scope:"project",access:"write",aliases:["caveman_builds_write.register"],input_schema:{type:"object",additionalProperties:!1,properties:{adapter_version:{type:"string"},agent_slug:{type:"string"},build_sha256:{type:"string",pattern:"^[a-f0-9]{64}$"},catalog_sha256:{type:"string",pattern:"^[a-f0-9]{64}$"},eval_suite_sha256:{type:"string",pattern:"^[a-f0-9]{64}$"},evidence_basis:{const:"inferred"},evidence_status:{const:"locked"},harness:{enum:["pi","vercel-ai-sdk","eve","mastra"]},lock:{},plan_sha256:{type:"string",pattern:"^[a-f0-9]{64}$"},runtime_version:{type:"string"},source_sha256:{type:"string",pattern:"^[a-f0-9]{64}$"},transform_registry_sha256:{type:"string",pattern:"^[a-f0-9]{64}$"},upstream_version:{type:"string"}},required:["adapter_version","agent_slug","build_sha256","catalog_sha256","eval_suite_sha256","evidence_basis","evidence_status","harness","lock","plan_sha256","runtime_version","source_sha256","transform_registry_sha256","upstream_version"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},agent_slug:{type:"string"},build_sha256:{type:"string"},plan_sha256:{type:"string"},source_sha256:{type:"string"},eval_suite_sha256:{type:"string"},catalog_sha256:{type:"string"},transform_registry_sha256:{type:"string"},harness:{type:"string"},adapter_version:{type:"string"},upstream_version:{type:"string"},runtime_version:{type:"string"},evidence_status:{type:"string"},evidence_basis:{type:"string"},lock:{},registered_by:{type:"string"},created_at:{type:"string",format:"date-time"}},required:["id","project_id","agent_slug","build_sha256","plan_sha256","source_sha256","eval_suite_sha256","catalog_sha256","transform_registry_sha256","harness","adapter_version","upstream_version","runtime_version","evidence_status","evidence_basis","lock","registered_by","created_at"]},binding:{path_inputs:{},query_inputs:[],body_inputs:["adapter_version","agent_slug","build_sha256","catalog_sha256","eval_suite_sha256","evidence_basis","evidence_status","harness","lock","plan_sha256","runtime_version","source_sha256","transform_registry_sha256","upstream_version"]},contract_sha256:"21a98fc3f56f140f86f0ae0a050918333b40449a07ec3b7ebc10dac5973f104b"},{id:"builds.get",version:"1",summary:"builds: get",method:"GET",path:"/projects/{projectId}/agent-builds/{buildSha256}",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_builds.get"],input_schema:{type:"object",additionalProperties:!1,properties:{build_sha256:{type:"string",pattern:"^[a-f0-9]{64}$"}},required:["build_sha256"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},agent_slug:{type:"string"},build_sha256:{type:"string"},plan_sha256:{type:"string"},source_sha256:{type:"string"},eval_suite_sha256:{type:"string"},catalog_sha256:{type:"string"},transform_registry_sha256:{type:"string"},harness:{type:"string"},adapter_version:{type:"string"},upstream_version:{type:"string"},runtime_version:{type:"string"},evidence_status:{type:"string"},evidence_basis:{type:"string"},lock:{},registered_by:{type:"string"},created_at:{type:"string",format:"date-time"}},required:["id","project_id","agent_slug","build_sha256","plan_sha256","source_sha256","eval_suite_sha256","catalog_sha256","transform_registry_sha256","harness","adapter_version","upstream_version","runtime_version","evidence_status","evidence_basis","lock","registered_by","created_at"]},binding:{path_inputs:{buildSha256:"build_sha256"},query_inputs:[],body_inputs:[]},contract_sha256:"7d1faed0b9ccbf4256ed95b253fc8a4258e0162f820ae567fa8761afd5ca162f"},{id:"builds.evidence",version:"1",summary:"builds: evidence",method:"GET",path:"/projects/{projectId}/agent-builds/{buildSha256}/evidence",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_builds.evidence"],input_schema:{type:"object",additionalProperties:!1,properties:{from:{type:"string",format:"date-time"},sample_data:{type:"boolean"},to:{type:"string",format:"date-time"},window:{type:"string"},build_sha256:{type:"string",pattern:"^[a-f0-9]{64}$"}},required:["build_sha256"]},output_schema:{type:"object",additionalProperties:!1,properties:{build_sha256:{type:"string"},plan_sha256:{type:"string"},registered:{type:"boolean"},requests:{type:"integer"},catalog_priced_complete_requests:{type:"integer"},first_seen:{type:"string"},last_seen:{type:"string"},context_tokens:{type:["object","null"],additionalProperties:{type:"integer"}},transform_ids:{type:["array","null"],items:{type:"string"}},transform_trace:{type:["array","null"],items:{type:"string"}},catalog_cost_usd:{type:"number"},evidence_basis:{type:"string"},attribution_basis:{type:"string"},verified_savings_usd:{type:"number"}},required:["build_sha256","plan_sha256","registered","requests","catalog_priced_complete_requests","context_tokens","transform_ids","transform_trace","catalog_cost_usd","evidence_basis","attribution_basis","verified_savings_usd"]},binding:{path_inputs:{buildSha256:"build_sha256"},query_inputs:["from","sample_data","to","window"],body_inputs:[]},contract_sha256:"f71ce1acefd179009e6bbc38789954bacda453748f5cfcf28efb655c2ac248ba"},{id:"candidates.route",version:"1",summary:"Try a route idea from an improvement case: replay a workload's saved traffic on one to four targets (provider, model, optional effort) as a Compare paid from the project's proving budget. Only an improvement session's case token may call it; a winner reaches the Inbox.",method:"POST",path:"/projects/{projectId}/agent-candidates/routes",permissions:["experiment:run"],scope:"project",access:"write",aliases:["caveman_candidates_write.route"],input_schema:{type:"object",additionalProperties:!1,properties:{workflow:{type:"string",minLength:1,maxLength:64},targets:{type:"array",minItems:1,maxItems:4,items:{type:"object",additionalProperties:!1,properties:{provider:{type:"string"},model:{type:"string"},effort:{type:"string"}},required:["provider","model"]}},days:{type:"integer",minimum:1,maximum:30},note:{type:"string",minLength:1,maxLength:300}},required:["workflow","targets","note"]},output_schema:{type:"object",additionalProperties:!1,required:["experiment_id","state","budget_usd","proving_remaining_usd"],properties:{experiment_id:{type:"string",format:"uuid"},state:{const:"queued"},budget_usd:{type:"number"},proving_remaining_usd:{type:"number"}}},binding:{path_inputs:{},query_inputs:[],body_inputs:["workflow","targets","days","note"]},contract_sha256:"ff4a30d36efdecd7df474aa0e61fd28bb3d3e71fb468264eadb784bbf004982a"},{id:"candidates.runs",version:"1",summary:"Read this improvement session's practice runs and route tries, optionally waiting up to 25 seconds for a pending one to settle.",method:"POST",path:"/projects/{projectId}/agent-candidates/runs",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_candidates.runs"],input_schema:{type:"object",additionalProperties:!1,properties:{wait_seconds:{type:"integer",minimum:0,maximum:25}}},output_schema:{type:"object",additionalProperties:!1,properties:{remaining_usd:{type:"number"},practice:{type:"object",additionalProperties:!1,properties:{status:{type:"string"},tasks:{type:"integer"},reason:{type:"string"}},required:["status","tasks","reason"]},runs:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{request_id:{type:"string"},commit:{type:"string"},note:{type:"string"},status:{type:"string"},patch_digest:{type:"string"},files:{type:["array","null"],items:{type:"string"}},reason:{type:"string"},detail:{type:"string"},cost_ratio:{anyOf:[{type:"object",additionalProperties:!1,properties:{point:{anyOf:[{type:"number"},{type:"null"}]},low:{anyOf:[{type:"number"},{type:"null"}]},high:{anyOf:[{type:"number"},{type:"null"}]}},required:["point","low","high"]},{type:"null"}]},pass:{anyOf:[{type:"object",additionalProperties:!1,required:["baseline","candidate"],properties:{baseline:{type:"array",items:{type:"integer"},minItems:2,maxItems:2},candidate:{type:"array",items:{type:"integer"},minItems:2,maxItems:2}}},{type:"null"}]},reason_codes:{type:["array","null"],items:{type:"string"}},cost_usd:{type:"number"},pooled_runs:{type:"integer"},tasks:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{name:{type:"string"},baseline:{type:"object",additionalProperties:!1,properties:{outcome:{type:"string"},cost_usd:{type:"number"}},required:["outcome","cost_usd"]},candidate:{type:"object",additionalProperties:!1,properties:{outcome:{type:"string"},cost_usd:{type:"number"},violations:{type:["array","null"],items:{type:"string"}}},required:["outcome","cost_usd","violations"]}},required:["name","baseline","candidate"]}}},required:["request_id","commit","note","status","patch_digest","files","reason","detail","cost_ratio","pass","reason_codes","cost_usd","pooled_runs","tasks"]}},routes:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{experiment_id:{type:"string"},workflow:{type:"string"},targets:{type:["array","null"],items:{type:"string"}},state:{type:"string"},results:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{target:{type:"string"},verdict:{type:"string"},cost_ratio:{anyOf:[{type:"number"},{type:"null"}]},quality_delta_pts:{anyOf:[{type:"number"},{type:"null"}]}},required:["target","verdict","cost_ratio","quality_delta_pts"]}},judge_reliable:{type:"boolean"},filed:{type:"string"},spent_usd:{type:"number"}},required:["experiment_id","workflow","targets","state","results","judge_reliable","filed","spent_usd"]}}},required:["remaining_usd","practice","runs","routes"]},binding:{path_inputs:{},query_inputs:[],body_inputs:["wait_seconds"]},contract_sha256:"655f0c83d7b89caa3588efca442b77e6c3a5cc10adc8b20151efa810f4a28bb7"},{id:"candidates.score",version:"1",summary:"Score one commit of this improvement session on the case's practice set. Fixed code runs the original and the commit on every practice task and marks the run kept or discarded; nothing ships from it.",method:"POST",path:"/projects/{projectId}/agent-candidates/scores",permissions:["proposal:draft"],scope:"project",access:"write",aliases:["caveman_candidates_write.score"],input_schema:{type:"object",additionalProperties:!1,properties:{commit:{type:"string",description:"The full lowercase 40-hex SHA of the commit to score (git rev-parse HEAD)."},note:{type:"string",description:"What the commit tries, in 1 to 300 characters."}},required:["commit","note"]},output_schema:{type:"object",additionalProperties:!1,properties:{request_id:{type:"string"},status:{type:"string"},estimate_usd:{type:"number"},remaining_usd:{type:"number"},practice_tasks:{type:"integer"}},required:["request_id","status","estimate_usd","remaining_usd","practice_tasks"]},binding:{path_inputs:{},query_inputs:[],body_inputs:["commit","note"]},contract_sha256:"e963e6e7aacad3300a400539f96c2854552d7efa04be88383ebee6b2fe9d41da"},{id:"cases.get",version:"1",summary:"Read an improvement or setup case, its phase, blockers and runs.",method:"GET",path:"/projects/{projectId}/agent-cases/{caseId}",permissions:["trace:read_metadata"],scope:"project",access:"none",exclusion:"Native user authority over factory case admission, bounded policy, binding approval and cancellation. An agent session must never read a case, resolve a setup blocker, approve an execution binding, admit paid improvement work or cancel a fence.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{parameters:{type:"object",additionalProperties:!1,properties:{caseId:{type:"string"}},required:["caseId"]},query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}}},required:["parameters"]},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"8fbc2bd35343979202133debe745a258955706d3cffd5f80dd488112473bd7e8"},{id:"cases.cancel",version:"1",summary:"Cancel an improvement case and fence its open runs.",method:"POST",path:"/projects/{projectId}/agent-cases/{caseId}/cancel",permissions:["autopilot:manage"],scope:"project",access:"none",exclusion:"Native user authority over factory case admission, bounded policy, binding approval and cancellation. An agent session must never read a case, resolve a setup blocker, approve an execution binding, admit paid improvement work or cancel a fence.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{parameters:{type:"object",additionalProperties:!1,properties:{caseId:{type:"string"}},required:["caseId"]},query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}},body:{type:"object",additionalProperties:!0}},required:["parameters"]},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"69b0fb9793c20bf7ad0282e6519dcd96298f34b1e7673d944b7bf1c8c3047815"},{id:"human.agent_connections",version:"1",summary:"human: agent_connections",method:"GET",path:"/projects/{projectId}/agent-connections",permissions:["org:read"],scope:"project",access:"none",exclusion:"Agent connections name an agent's own brokered session and key (migration 0107). Listing them is the human owner's audit view; an agent enumerating sessions would be reading about its peers' credentials.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"9e0c51b3377461d29da3dd403ba9183bbdca3209ffa5df6c6e9bb94d769f78a5"},{id:"evaluators.activate",version:"1",summary:"Request activation of a qualification this session started. It goes live only when independently qualified; pending waits for that.",method:"POST",path:"/projects/{projectId}/agent-evaluators/activations",permissions:["autopilot:manage"],scope:"project",access:"write",aliases:["caveman_authoring_write.activate_evaluator"],input_schema:{type:"object",additionalProperties:!1,required:["qualification_id"],properties:{qualification_id:{type:"string",format:"uuid"}}},output_schema:{type:"object",additionalProperties:!1,required:["query_digest","project_id","status"],properties:{query_digest:{type:"string",pattern:"^[a-f0-9]{64}$"},project_id:{type:"string",format:"uuid"},status:{enum:["pending","active","unavailable"]},reason:{type:"string"},qualification_id:{type:"string",format:"uuid"},activation:{type:"string"},scoring:{type:"string"},next_action:{type:"string"},monitor_id:{type:"string",format:"uuid"},monitor_version:{type:"integer"},sample_rate:{type:"number"},native_path:{type:"string"}}},binding:{body_inputs:["qualification_id"]},native_evaluation:!1,additional_permissions:["eval:write"],contract_sha256:"1b73af4dabef7570207fc1ee224917cfc88e92534c28b62b6840246e13dc6ac6"},{id:"evaluators.draft",version:"1",summary:"Record this session's one evaluator draft, grounded in digests of tool results the session received. The draft is unqualified and not live.",method:"POST",path:"/projects/{projectId}/agent-evaluators/drafts",permissions:["eval:write"],scope:"project",access:"write",aliases:["caveman_authoring_write.draft_evaluator"],input_schema:{type:"object",additionalProperties:!1,required:["name","description","config","evidence_queries"],properties:{name:{type:"string",minLength:1,maxLength:180},description:{type:"string",maxLength:2e3},config:{type:"object",additionalProperties:!1,required:["schema_version","grader_type","options","input_mapping"],properties:{schema_version:{const:1},grader_type:{type:"string",enum:["exact_match","contains","not_contains","regex","not_regex","blocklist","json_schema","json_path_assertion","tool_called","tool_not_called","tool_sequence","tool_argument_assertion","http_status","latency_threshold","cost_threshold","token_threshold","bleu_score","rouge_score","context_f1","no_pii","localization_f1","llm_judge","llm_score","llm_category","llm_pairwise","llm_answer_match"],description:"One of the platform's grader families; any other name is refused before any effect. Free-text contracts: contains (required facts) and not_contains (forbidden literals). Tool use: tool_called, tool_not_called, tool_sequence, tool_argument_assertion. Spend: cost_threshold, token_threshold, latency_threshold."},options:{type:"object",description:"The grader family's own options. The draft records them; they are checked when the evaluator is qualified, not here."},input_mapping:{type:"object",additionalProperties:!1,required:["candidate"],description:"Only candidate, reference and baseline are accepted; any other key is refused.",properties:{candidate:{type:"object",additionalProperties:!1,required:["source","key"],description:`what is graded: {"source":"target","key":"$target"} for the target's own output`,properties:{source:{type:"string",enum:["dataset","target"]},key:{type:"string",anyOf:[{pattern:"^[A-Za-z0-9][A-Za-z0-9_-]{0,95}$"},{const:"$target"}],description:"a dataset column key, or $target (source target only) for the graded output itself"}}},reference:{type:"object",additionalProperties:!1,required:["source","key"],description:"optional expected value, usually a dataset column",properties:{source:{type:"string",enum:["dataset","target"]},key:{type:"string",anyOf:[{pattern:"^[A-Za-z0-9][A-Za-z0-9_-]{0,95}$"},{const:"$target"}],description:"a dataset column key, or $target (source target only) for the graded output itself"}}},baseline:{type:"object",additionalProperties:!1,required:["source","key"],description:"optional comparison value for pairwise graders",properties:{source:{type:"string",enum:["dataset","target"]},key:{type:"string",anyOf:[{pattern:"^[A-Za-z0-9][A-Za-z0-9_-]{0,95}$"},{const:"$target"}],description:"a dataset column key, or $target (source target only) for the graded output itself"}}}}}}},evidence_queries:{type:"array",minItems:1,maxItems:24,uniqueItems:!0,items:{type:"string",pattern:"^[a-f0-9]{64}$"}}}},output_schema:{type:"object",additionalProperties:!1,required:["query_digest","project_id","evaluator_id","evaluator_version","config_sha256","status","qualification","activation","scoring","limitation","native_path"],properties:{query_digest:{type:"string",pattern:"^[a-f0-9]{64}$"},project_id:{type:"string",format:"uuid"},evaluator_id:{type:"string",format:"uuid"},evaluator_version:{const:1},config_sha256:{type:"string",pattern:"^[a-f0-9]{64}$"},status:{const:"draft"},qualification:{const:"unqualified"},activation:{const:"not_active"},scoring:{const:"not_started"},limitation:{const:"independent_qualification_required"},native_path:{type:"string"}}},binding:{body_inputs:["name","description","config","evidence_queries"]},native_evaluation:!1,contract_sha256:"4cb3a45b2c36a38de6cc97606c2c344763b2742cc4df6876c4c268413955a89b"},{id:"evaluators.qualification_sets",version:"1",summary:"List the independent qualification sets a session's draft can be qualified against: names and grader types only, never their contents.",method:"POST",path:"/projects/{projectId}/agent-evaluators/qualification-sets",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_authoring_write.qualification_sets"],input_schema:{type:"object",additionalProperties:!1,required:[],properties:{}},output_schema:{type:"object",additionalProperties:!1,required:["query_digest","project_id","sets"],properties:{query_digest:{type:"string",pattern:"^[a-f0-9]{64}$"},project_id:{type:"string",format:"uuid"},sets:{type:"array",maxItems:20,items:{type:"object",additionalProperties:!1,required:["id","name","invariant","grader_type","created_at","supports_live_scoring"],properties:{id:{type:"string",format:"uuid"},name:{type:"string"},invariant:{type:"string"},grader_type:{type:"string"},created_at:{type:"string"},supports_live_scoring:{type:"boolean"}}}},has_more:{const:!0}}},binding:{body_inputs:[]},native_evaluation:!1,contract_sha256:"0b26b8e7e76220312d4b68ec176b74552feeb68c8f3d88fbd9e1c7873496900e"},{id:"evaluators.qualify",version:"1",summary:"Qualify this session's evaluator draft against one independent set; the answer is qualified, failed, pending or unavailable.",method:"POST",path:"/projects/{projectId}/agent-evaluators/qualifications",permissions:["eval:write"],scope:"project",access:"write",aliases:["caveman_authoring_write.qualify_evaluator"],input_schema:{type:"object",additionalProperties:!1,required:["evaluator_id","version","set_id"],properties:{evaluator_id:{type:"string",format:"uuid"},version:{type:"integer",minimum:1},set_id:{type:"string",format:"uuid"}}},output_schema:{type:"object",additionalProperties:!1,required:["query_digest","project_id","status"],properties:{query_digest:{type:"string",pattern:"^[a-f0-9]{64}$"},project_id:{type:"string",format:"uuid"},status:{enum:["pending","qualified","failed","unavailable"]},reason:{type:"string"},qualification:{type:"object"},native_path:{type:"string"}}},binding:{body_inputs:["evaluator_id","version","set_id"]},native_evaluation:!1,contract_sha256:"baa7a24226a52c63ce973988fbb1d063cba880c01f4058115be52c7ea978550d"},{id:"notebook.append",version:"1",summary:"Append one row to the improvement case's notebook. Only an improvement session's case token may write; the row authorizes nothing.",method:"POST",path:"/projects/{projectId}/agent-notebook/entries",permissions:["proposal:draft"],scope:"project",access:"write",aliases:["caveman_notebook_write.append"],input_schema:{type:"object",additionalProperties:!1,required:["kind","summary"],properties:{kind:{enum:["plan","hypothesis","check_authored","edit","dev_result","dead_end","capability_request","notes","inbox_closed"]},summary:{type:"string",minLength:1,maxLength:500},ref:{type:"string",maxLength:120},metric:{type:"object",maxProperties:16},detail:{type:"string",maxLength:16384}},allOf:[{if:{required:["kind"],properties:{kind:{const:"notes"}}},else:{not:{required:["detail"]}}}]},output_schema:{type:"object",additionalProperties:!1,required:["query_digest","project_id","case_ref","kind","sequence","recorded_at","coverage","authority"],properties:{query_digest:{type:"string",pattern:"^[a-f0-9]{64}$"},project_id:{type:"string",format:"uuid"},case_ref:{type:"string",format:"uuid"},kind:{enum:["plan","hypothesis","check_authored","edit","dev_result","dead_end","capability_request","notes","inbox_closed"]},sequence:{type:"integer",minimum:1},recorded_at:{type:"string",format:"date-time"},coverage:{const:"one_case_event_appended"},authority:{const:"none"}}},binding:{body_inputs:["kind","summary","ref","metric","detail"]},contract_sha256:"7c50a82da0a00a0771f4c6af0e2871a695107a14e9d02c46f1a96b77c8350f40"},{id:"agent.run",version:"1",summary:"agent run",method:"POST",path:"/projects/{projectId}/agent-runs",permissions:["proposal:draft"],scope:"project",access:"write",aliases:["caveman_evals_write.run_agent"],input_schema:{type:"object",additionalProperties:!1,properties:{parent_run_id:{type:"string",format:"uuid"},request_id:{type:"string",format:"uuid"},deadline:{type:"string",format:"date-time"},fix:{type:"boolean",description:"Ask for a repair case instead of an answer."},input:{type:"object",additionalProperties:!1,properties:{question:{type:"string",minLength:1,maxLength:16e3},window:{type:"object",additionalProperties:!1,properties:{from:{type:"string",format:"date-time"},to:{type:"string",format:"date-time"}},required:["from","to"]},context:{type:"object",description:"The console page the question was asked from."}},required:["question","window"]}},required:["request_id","input"]},output_schema:{type:"object",additionalProperties:!1,properties:{principal_id:{type:"string",maxLength:200},result_ref:{type:["string","null"],format:"uuid"},id:{type:"string",format:"uuid"},organization_id:{type:"string",format:"uuid"},project_id:{type:"string",format:"uuid"},case_id:{type:"string",format:"uuid"},generation:{type:"integer",minimum:1},grant_id:{type:["string","null"],format:"uuid",description:"Null: runs admit without a grant (ADR 0069). Set only on runs of the retired executor."},grant_revision:{type:["integer","null"],minimum:1},definition_id:{type:"string",minLength:1,maxLength:100},definition_version:{type:"string",minLength:1,maxLength:100},definition_digest:{type:"string",pattern:"^[a-f0-9]{64}$"},origin:{enum:["chat","pull_request","trace","monitor","deployment","scan","optimization"]},input_ref:{type:"string",format:"uuid"},budget_keys:{type:"array",items:{type:"string",minLength:1,maxLength:200},minItems:2,maxItems:8},status:{enum:["queued","running","completed","incomplete","cancelled","stale"]},reason:{type:"string"},deadline:{type:"string",format:"date-time"},created_at:{type:"string",format:"date-time"},model_id:{type:["string","null"]},model_version:{type:["string","null"]}},required:["principal_id","result_ref","id","organization_id","project_id","case_id","generation","definition_id","definition_version","definition_digest","origin","input_ref","budget_keys","status","reason","deadline","created_at"]},binding:{body_inputs:["parent_run_id","request_id","deadline","fix","input"]},additional_permissions:["agent:execute"],async_kind:"agent",idempotency:"request_id",contract_sha256:"c4e4ce82f7d37075803c92e42a89086b3a1bae11d2ad0048414d883e67a3bb5d"},{id:"runs.get",version:"1",summary:"runs get",method:"GET",path:"/projects/{projectId}/agent-runs/{runId}",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_context.agent_run"],input_schema:{type:"object",additionalProperties:!1,properties:{run_id:{type:"string",format:"uuid"}},required:["run_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{principal_id:{type:"string",maxLength:200},result_ref:{type:["string","null"],format:"uuid"},id:{type:"string",format:"uuid"},organization_id:{type:"string",format:"uuid"},project_id:{type:"string",format:"uuid"},case_id:{type:"string",format:"uuid"},generation:{type:"integer",minimum:1},grant_id:{type:["string","null"],format:"uuid",description:"Null: runs admit without a grant (ADR 0069). Set only on runs of the retired executor."},grant_revision:{type:["integer","null"],minimum:1},definition_id:{type:"string",minLength:1,maxLength:100},definition_version:{type:"string",minLength:1,maxLength:100},definition_digest:{type:"string",pattern:"^[a-f0-9]{64}$"},origin:{enum:["chat","pull_request","trace","monitor","deployment","scan","optimization"]},input_ref:{type:"string",format:"uuid"},budget_keys:{type:"array",items:{type:"string",minLength:1,maxLength:200},minItems:2,maxItems:8},status:{enum:["queued","running","completed","incomplete","cancelled","stale"]},reason:{type:"string"},deadline:{type:"string",format:"date-time"},created_at:{type:"string",format:"date-time"},model_id:{type:["string","null"]},model_version:{type:["string","null"]}},required:["principal_id","result_ref","id","organization_id","project_id","case_id","generation","definition_id","definition_version","definition_digest","origin","input_ref","budget_keys","status","reason","deadline","created_at"]},binding:{path_inputs:{runId:"run_id"}},contract_sha256:"1362291f81e9e43c41b3a85c2cceef2fe73a73d121ed2dcfff9475c03f26792d"},{id:"runs.cancel",version:"1",summary:"runs cancel",method:"POST",path:"/projects/{projectId}/agent-runs/{runId}/cancel",permissions:["proposal:draft"],scope:"project",access:"write",aliases:["caveman_evals_write.cancel_agent_run"],input_schema:{type:"object",additionalProperties:!1,properties:{run_id:{type:"string",format:"uuid"}},required:["run_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{ok:{const:!0},run_id:{type:"string",format:"uuid"}},required:["ok","run_id"]},binding:{path_inputs:{runId:"run_id"}},additional_permissions:["agent:execute"],contract_sha256:"16ffe3185a990493468573c6578c68db9ad8ba9404d507a9047d3a1e90ba7ce3"},{id:"runs.events",version:"1",summary:"runs events",method:"GET",path:"/projects/{projectId}/agent-runs/{runId}/events",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_context.agent_run_events"],input_schema:{type:"object",additionalProperties:!1,properties:{run_id:{type:"string",format:"uuid"},after:{type:"integer",minimum:0}},required:["run_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{sequence:{type:"integer"},kind:{type:"string"},operation_key:{anyOf:[{type:"string"},{type:"null"}]},artifact_ref:{anyOf:[{type:"string"},{type:"null"}]},created_at:{type:"string",format:"date-time"}},required:["sequence","kind","operation_key","artifact_ref","created_at"]}},next_cursor:{type:"integer",minimum:0}},required:["data","next_cursor"]},binding:{path_inputs:{runId:"run_id"},query_inputs:["after"]},contract_sha256:"7a292ee64415d6ffe0d37588a2b3f1b3792712fc68053aee5c83257881e5f082"},{id:"runs.result",version:"1",summary:"runs result",method:"GET",path:"/projects/{projectId}/agent-runs/{runId}/result",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_context.agent_run_result"],input_schema:{type:"object",additionalProperties:!1,properties:{run_id:{type:"string",format:"uuid"}},required:["run_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{operations:{type:"array",items:{type:"object",required:["schema_version","operation","ok","status","data","receipt_id"],properties:{schema_version:{const:1},operation:{type:"string",minLength:1,maxLength:100},ok:{const:!0},status:{enum:["completed","accepted"]},data:{type:"object",description:"Recorded resource identities only. Resource pages hydrate content under current access."},receipt_id:{type:"string",format:"uuid"}}},minItems:0,maxItems:128},evaluators:{type:"array",items:{type:"object",additionalProperties:!1,properties:{evaluator_id:{type:"string",format:"uuid"},version:{type:"integer",minimum:1},config_sha256:{type:"string",minLength:1,maxLength:64},resource_status:{enum:["draft","active","archived"]}},required:["evaluator_id","version","config_sha256","resource_status"]},minItems:0,maxItems:1},scenarios:{type:"array",items:{type:"object",additionalProperties:!1,properties:{dataset_id:{type:"string",format:"uuid"},version:{type:"integer",minimum:1},scenario_sha256:{type:"string",minLength:1,maxLength:64},resource_status:{type:"string"}},required:["dataset_id","version","scenario_sha256","resource_status"]},minItems:0,maxItems:1},run_id:{type:"string",format:"uuid"},result_ref:{type:"string",format:"uuid"},result:{description:"Output validated against the pinned agent definition."},delivery:{oneOf:[{type:"object",additionalProperties:!1,properties:{id:{type:"string",format:"uuid"},state:{enum:["pending","publishing","uncertain","published","stale","unavailable"]},reason:{type:"string"},recorded_at:{type:"string",format:"date-time"},pull_request_url:{type:"string",description:"Recorded GitHub PR URL or empty. Does not assert current PR/CI state."},target_branch:{type:"string",minLength:1,maxLength:200},parent_sha:{type:"string",pattern:"^[a-f0-9]{40}$"},execution_verified:{type:"boolean",description:"Broker-verified frozen synthetic task: baseline failed, fresh candidate and verifier passed. Does not assert full test-suite or remote CI success."}},required:["id","state","reason","recorded_at","pull_request_url","target_branch","parent_sha","execution_verified"]},{type:"null"}],description:"Service-owned publication receipt, separate from model output. Null means no recorded intent yet."}},required:["operations","evaluators","scenarios","run_id","result_ref","result","delivery"]},binding:{path_inputs:{runId:"run_id"}},additional_permissions:["agent:execute"],contract_sha256:"697a63014b09bb4720220a72b91212cfc7782f7105e1bb1da8ad97e92f02a1d4"},{id:"scenarios.draft",version:"1",summary:"Record a scenario definition drafted by this session. It is not executed and its fixtures are unvalidated.",method:"POST",path:"/projects/{projectId}/agent-scenarios/drafts",permissions:["eval:write"],scope:"project",access:"write",aliases:["caveman_authoring_write.draft_scenario"],input_schema:{type:"object",additionalProperties:!1,properties:{schema_version:{const:1},adapter:{enum:["python-module-task-v1","node-module-task-v1"]},name:{type:"string",minLength:1,maxLength:200},invariant:{type:"string",minLength:1,maxLength:4e3},entrypoint:{type:"string",maxLength:200,pattern:"^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*:[A-Za-z_][A-Za-z0-9_]*|[A-Za-z0-9_][A-Za-z0-9_./-]*\\.(js|mjs|ts):[A-Za-z_$][A-Za-z0-9_$]*)$"},input:{},initial_state:{type:"object"},tools:{type:"array",items:{type:"object",additionalProperties:!1,properties:{name:{type:"string",minLength:1,maxLength:100},arguments:{},result:{},error:{type:"string",maxLength:500}},required:["name","arguments","result"]},minItems:0,maxItems:100},read_only_tools:{type:"array",description:"Declared tool names whose calls change nothing. A trial may then skip a call that exactly repeats that tool's latest earlier call (same arguments, result and error); every other fixture must be called in order. Omit when any tool has side effects you are unsure of.",items:{type:"string",minLength:1,maxLength:100},maxItems:100,uniqueItems:!0},assertions:{type:"array",items:{type:"object",additionalProperties:!1,properties:{subject:{enum:["output","state"]},pointer:{type:"string",maxLength:1e3},operator:{enum:["equals","contains","not_contains"]},value:{}},allOf:[{if:{properties:{operator:{enum:["contains","not_contains"]}}},then:{properties:{value:{type:"string",minLength:1}}}}],required:["subject","pointer","operator","value"]},minItems:1,maxItems:100},expected_failure:{type:"object",additionalProperties:!1,properties:{exception_type:{type:"string",minLength:1,maxLength:200},path:{type:"string",minLength:1,maxLength:500},function:{type:"string",minLength:1,maxLength:100}},required:["exception_type","path","function"]},historical:{type:"array",items:{type:"object",additionalProperties:!1,properties:{commit_sha:{type:"string",pattern:"^[a-f0-9]{40}$"},expected:{enum:["passed","failed"]}},required:["commit_sha","expected"]},minItems:0,maxItems:20},provenance:{type:"object",additionalProperties:!1,properties:{evidence_digests:{type:"array",items:{type:"string",pattern:"^[a-f0-9]{64}$"},minItems:1,maxItems:24,uniqueItems:!0},fixture_basis:{const:"synthetic"},fixture_rationale:{type:"string",minLength:1,maxLength:2e3}},required:["evidence_digests","fixture_basis","fixture_rationale"]}},required:["schema_version","adapter","name","invariant","entrypoint","input","initial_state","tools","assertions","historical","provenance"]},output_schema:{type:"object",additionalProperties:!1,required:["query_digest","project_id","dataset_id","version","scenario_sha256","execution_status","fixture_validation","native_path"],properties:{query_digest:{type:"string",pattern:"^[a-f0-9]{64}$"},project_id:{type:"string",format:"uuid"},dataset_id:{type:"string",format:"uuid"},version:{type:"integer",minimum:1},scenario_sha256:{type:"string",pattern:"^[a-f0-9]{64}$"},execution_status:{const:"not_executed"},fixture_validation:{const:"unvalidated"},native_path:{type:"string"}}},binding:{body_inputs:["schema_version","adapter","name","invariant","entrypoint","input","initial_state","tools","read_only_tools","assertions","expected_failure","historical","provenance"]},native_evaluation:!1,contract_sha256:"8bcdb3acd7a97265050eb126e37e6af2a86916dd0018aa99903399aaee3b9888"},{id:"setups.create",version:"1",summary:"Start setup for an agent against a connected repository, with five or more different scenarios you drafted for it as `tasks`. Discovery reads the repository and spends nothing; a person approves the tests and the budget with one click in the Inbox.",method:"POST",path:"/projects/{projectId}/agent-setups",permissions:["autopilot:manage","scenario:write"],scope:"project",access:"write",aliases:["caveman_evals_write.create_setup"],input_schema:{type:"object",additionalProperties:!1,properties:{agent_id:{type:"string",format:"uuid"},repository_binding_id:{type:"string",format:"uuid"},tasks:{type:"array",minItems:5,maxItems:32,items:{type:"object",additionalProperties:!1,properties:{dataset_id:{type:"string",format:"uuid"},version:{type:"integer",minimum:1}},required:["dataset_id","version"]}}},required:["agent_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{case_id:{type:"string",format:"uuid"},setup_status:{type:"string"},approval_requested:{type:"boolean"}},required:["case_id","setup_status","approval_requested"]},binding:{path_inputs:{},query_inputs:[],body_inputs:["agent_id","repository_binding_id","tasks"]},contract_sha256:"c5b375a652826273a6177161e699a3cdb20ccbb083c84b8279869c0d49b8f5b7"},{id:"setups.decide",version:"1",summary:"Approve or reject what setup proposed, including the execution binding.",method:"POST",path:"/projects/{projectId}/agent-setups/{caseId}/decisions",permissions:["autopilot:manage"],scope:"project",access:"none",exclusion:"Native user authority over factory case admission, bounded policy, binding approval and cancellation. An agent session must never read a case, resolve a setup blocker, approve an execution binding, admit paid improvement work or cancel a fence.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{parameters:{type:"object",additionalProperties:!1,properties:{caseId:{type:"string"}},required:["caseId"]},query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}},body:{type:"object",additionalProperties:!0}},required:["parameters"]},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"c0a44ff5da28e7c9aab9022355bb2b1466c1f318c192a0ed4a60c3afb1394617"},{id:"workflows.list_agents",version:"1",summary:"workflows: list_agents",method:"GET",path:"/projects/{projectId}/agents",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_workflows.list_agents"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},slug:{type:"string"},name:{type:"string"},description:{type:"string"},discovered:{type:"boolean"}},required:["id","project_id","slug","name","description","discovered"]}},next_cursor:{type:"null"}},required:["data","next_cursor"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"67100171dcf2f82b29836b548388bffdc1a1d188412d0cf82be1ecd54efb4663"},{id:"workflows.create_agent",version:"1",summary:"workflows: create_agent",method:"POST",path:"/projects/{projectId}/agents",permissions:["policy:draft"],scope:"project",access:"write",aliases:["caveman_workflows_write.create_agent"],input_schema:{type:"object",additionalProperties:!1,properties:{description:{type:"string"},name:{type:"string"},slug:{type:"string"}},required:["slug","name"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},slug:{type:"string"},name:{type:"string"},description:{type:"string"},discovered:{type:"boolean"}},required:["id","project_id","slug","name","description","discovered"]},binding:{path_inputs:{},query_inputs:[],body_inputs:["description","name","slug"]},contract_sha256:"a60ccacde59926deab38c0d509a9fad57337a95029d31c62403262fa78b3ffb4"},{id:"workflows.get_agent",version:"1",summary:"workflows: get_agent",method:"GET",path:"/projects/{projectId}/agents/{agentId}",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_workflows.get_agent"],input_schema:{type:"object",additionalProperties:!1,properties:{agent_id:{type:"string",format:"uuid"}},required:["agent_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},slug:{type:"string"},name:{type:"string"},description:{type:"string"},discovered:{type:"boolean"}},required:["id","project_id","slug","name","description","discovered"]},binding:{path_inputs:{agentId:"agent_id"},query_inputs:[],body_inputs:[]},contract_sha256:"6d08fd5d8622b405a77a7a1c534e4e9fde56cd8cffd1b332db532678f3d13af1"},{id:"workflows.update_agent",version:"1",summary:"workflows: update_agent",method:"PATCH",path:"/projects/{projectId}/agents/{agentId}",permissions:["policy:draft"],scope:"project",access:"write",aliases:["caveman_workflows_write.update_agent"],input_schema:{type:"object",additionalProperties:!1,properties:{description:{type:"string"},name:{type:"string"},agent_id:{type:"string",format:"uuid"}},required:["agent_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},slug:{type:"string"},name:{type:"string"},description:{type:"string"},discovered:{type:"boolean"}},required:["id","project_id","slug","name","description","discovered"]},binding:{path_inputs:{agentId:"agent_id"},query_inputs:[],body_inputs:["description","name"]},contract_sha256:"7dc28a8376150320d19933eb58b6ae1c85544b36212a3c502ab1b6c7834e124e"},{id:"cases.admit",version:"1",summary:"Admit an improvement case for an agent; Caveman starts its engineer run at once.",method:"POST",path:"/projects/{projectId}/agents/{agentId}/cases",permissions:["autopilot:manage"],scope:"project",access:"none",exclusion:"Native user authority over factory case admission, bounded policy, binding approval and cancellation. An agent session must never read a case, resolve a setup blocker, approve an execution binding, admit paid improvement work or cancel a fence.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{parameters:{type:"object",additionalProperties:!1,properties:{agentId:{type:"string"}},required:["agentId"]},query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}},body:{type:"object",additionalProperties:!0}},required:["parameters"]},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"f741ce79d3288b84f4f8d93f1a76d7f7b0dd51e852a9e46fbb4bddc1d4170e11"},{id:"factory.get_policy",version:"1",summary:"Read the factory policy an agent's improvement cases run under.",method:"GET",path:"/projects/{projectId}/agents/{agentId}/factory-policy",permissions:["trace:read_metadata"],scope:"project",access:"none",exclusion:"Native user authority over factory case admission, bounded policy, binding approval and cancellation. An agent session must never read a case, resolve a setup blocker, approve an execution binding, admit paid improvement work or cancel a fence.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{parameters:{type:"object",additionalProperties:!1,properties:{agentId:{type:"string"}},required:["agentId"]},query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}}},required:["parameters"]},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"0b651c34f271b7d09038f4c6dff889019e3c521622cd8150e6b3fd3748f5d503"},{id:"factory.set_policy",version:"1",summary:"Approve or change the factory policy for an agent.",method:"PUT",path:"/projects/{projectId}/agents/{agentId}/factory-policy",permissions:["autopilot:manage"],scope:"project",access:"none",exclusion:"Native user authority over factory case admission, bounded policy, binding approval and cancellation. An agent session must never read a case, resolve a setup blocker, approve an execution binding, admit paid improvement work or cancel a fence.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{parameters:{type:"object",additionalProperties:!1,properties:{agentId:{type:"string"}},required:["agentId"]},query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}},body:{type:"object",additionalProperties:!0}},required:["parameters"]},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"ef0de271f1394686fde087fa560a7216a19688610992042d5289e2ae257f81be"},{id:"workflows.list",version:"1",summary:"workflows: list",method:"GET",path:"/projects/{projectId}/agents/{agentId}/workflows",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_workflows.list"],input_schema:{type:"object",additionalProperties:!1,properties:{agent_id:{type:"string",format:"uuid"}},required:["agent_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},agent_id:{type:"string"},project_id:{type:"string"},slug:{type:"string"},name:{type:"string"},description:{type:"string"},discovered:{type:"boolean"},risk_level:{type:"string"}},required:["id","agent_id","project_id","slug","name","description","discovered","risk_level"]}},next_cursor:{type:"null"}},required:["data","next_cursor"]},binding:{path_inputs:{agentId:"agent_id"},query_inputs:[],body_inputs:[]},contract_sha256:"a7440716b529664fe5acab686589b9a5c1016765866e7615a08a0d12c8865438"},{id:"workflows.create",version:"1",summary:"workflows: create",method:"POST",path:"/projects/{projectId}/agents/{agentId}/workflows",permissions:["policy:draft"],scope:"project",access:"write",aliases:["caveman_workflows_write.create"],input_schema:{type:"object",additionalProperties:!1,properties:{description:{type:"string"},name:{type:"string"},risk_level:{type:"string"},slug:{type:"string"},agent_id:{type:"string",format:"uuid"}},required:["agent_id","slug","name"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},agent_id:{type:"string"},project_id:{type:"string"},slug:{type:"string"},name:{type:"string"},description:{type:"string"},discovered:{type:"boolean"},risk_level:{type:"string"}},required:["id","agent_id","project_id","slug","name","description","discovered","risk_level"]},binding:{path_inputs:{agentId:"agent_id"},query_inputs:[],body_inputs:["description","name","risk_level","slug"]},contract_sha256:"050f64fcf414f011f0e3b752b130eb1c244c6c5e5f6f39433fa9f41be9fe675f"},{id:"autopilot.get",version:"1",summary:"Read the project autopilot dial: off, suggest or on.",method:"GET",path:"/projects/{projectId}/autopilot",permissions:["org:read"],scope:"project",access:"read",aliases:["caveman_policy.autopilot"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{mode:{enum:["off","suggest","on"]}},required:["mode"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"3f3b5fd735640ed789a19ef53a6be12af67b0328c7f0a3d1427c265d676b5b01"},{id:"autopilot.set",version:"1",summary:"Move the project autopilot dial to off, suggest or on.",method:"PUT",path:"/projects/{projectId}/autopilot",permissions:["autopilot:manage"],scope:"project",access:"none",exclusion:"Moves the autopilot dial, which can switch changes on for live traffic. A human sets it.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{mode:{enum:["off","suggest","on"]}},required:["mode"]},output_schema:{type:"object",additionalProperties:!0},binding:{path_inputs:{},query_inputs:[],body_inputs:["mode"]},contract_sha256:"ad78e146f05e1f20772c396341c8b3db02e324aa3feda2cc78b51e2b531e1a0e"},{id:"fixes.list_moves",version:"1",summary:"fixes: list_moves",method:"GET",path:"/projects/{projectId}/autopilot/moves",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_fixes.list_moves"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},opportunity_id:{anyOf:[{type:"string"},{type:"null"}]},canary_experiment_id:{anyOf:[{type:"string"},{type:"null"}]},recipe_id:{type:"string"},optimizer_id:{type:"string"},scope_hash:{type:"string"},status:{type:"string"},flip_effective_date:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},watch_days:{type:"integer"},rolled_back_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},rollback_reason:{anyOf:[{type:"string"},{type:"null"}]},created_at:{type:"string",format:"date-time"},workflow:{anyOf:[{type:"string"},{type:"null"}]},saving_usd_per_day:{anyOf:[{type:"number"},{type:"null"}]},saving_basis:{type:"string"},watch_line:{type:"string"},rollback_reason_line:{type:"string"},verified:{anyOf:[{type:"object",additionalProperties:!1,properties:{sole_claim_total_usd:{type:"number"},days:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{day:{type:"string"},verified_usd:{type:"number"},sole_claimant:{type:"boolean"},requests_by_optimizer:{type:["object","null"],additionalProperties:{type:"integer"}},note:{type:"string"}},required:["day","verified_usd","sole_claimant"]}},rollback_line:{type:"string"}},required:["sole_claim_total_usd","days"]},{type:"null"}]}},required:["id","recipe_id","optimizer_id","scope_hash","status","watch_days","created_at","workflow","saving_usd_per_day","saving_basis"]}}},required:["data"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"99b056cb1501c767433278ae451ac3114b541f560dc9213551381a80159cb5c6"},{id:"briefs.list",version:"1",summary:"List the project's briefs: in progress first, then open, then closed, by priority and most recent change. Filter by status (csv), scout, priority, assignee (me, a member id or none) and q.",method:"GET",path:"/projects/{projectId}/briefs",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_briefs.list"],input_schema:{type:"object",additionalProperties:!1,properties:{status:{type:"string"},scout:{type:"string"},priority:{type:"string"},assignee:{type:"string"},q:{type:"string"},cursor:{type:"string"},limit:{type:"integer",minimum:0}}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},number:{type:"integer"},scout:{type:"string"},scout_label:{type:"string"},status:{type:"string"},priority:{type:"integer"},title:{type:"string"},summary_line:{type:"string"},impact:{type:"object",additionalProperties:!1,properties:{usd_per_day:{anyOf:[{type:"number"},{type:"null"}]},basis:{anyOf:[{type:"string"},{type:"null"}]},confidence:{anyOf:[{type:"string"},{type:"null"}]},share_of_scope:{anyOf:[{type:"number"},{type:"null"}]}},required:["usd_per_day","basis","confidence"]},scope:{type:"object",additionalProperties:!1,properties:{label:{type:"string"},workflow:{type:"string"},agent:{type:"string"},model:{type:"string"},provider:{type:"string"}},required:["label"]},assignee:{anyOf:[{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},email:{type:"string"},kind:{type:"string"}},required:["id","name","kind"]},{type:"null"}]},writer_kind:{type:"string"},comment_count:{type:"integer"},open_annotations:{type:"integer"},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"},proof_summary:{anyOf:[{type:"object",additionalProperties:!1,properties:{state:{type:"string"},saving_usd_per_day:{anyOf:[{type:"number"},{type:"null"}]},quality:{anyOf:[{type:"object",additionalProperties:!1,properties:{verdict:{type:"string"}},required:["verdict"]},{type:"null"}]},byte_identical:{anyOf:[{type:"boolean"},{type:"null"}]}},required:["state","saving_usd_per_day","quality","byte_identical"]},{type:"null"}]}},required:["id","project_id","number","scout","scout_label","status","priority","title","summary_line","impact","scope","assignee","writer_kind","comment_count","open_annotations","created_at","updated_at","proof_summary"]}},next_cursor:{type:["string","null"]}},required:["data","next_cursor"]},binding:{path_inputs:{},query_inputs:["status","scout","priority","assignee","q","cursor","limit"],body_inputs:[]},contract_sha256:"3706c4ea4aeb0b532f1794060bed3d4870a4faa4ee470b5ec8b27bbf404a0688"},{id:"briefs.get",version:"1",summary:"Read one brief by id or by its per-project number: summary, body, cited sources, impact, scope, declared actions, version and proof (the newest Prove result, null if never proven). agent_report is what your agent reported through the fix packet, always self_reported (null if nothing). An agent connection reads work as null; people see where Caveman's improvement attempt on the finding stands.",method:"GET",path:"/projects/{projectId}/briefs/{briefId}",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_briefs.get"],input_schema:{type:"object",additionalProperties:!1,properties:{brief_id:{type:"string",pattern:"^([1-9][0-9]{0,8}|[0-9a-fA-F-]{36})$",description:"The brief id or its per-project number."}},required:["brief_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},number:{type:"integer"},scout:{type:"string"},scout_label:{type:"string"},status:{type:"string"},priority:{type:"integer"},title:{type:"string"},summary_line:{type:"string"},impact:{type:"object",additionalProperties:!1,properties:{usd_per_day:{anyOf:[{type:"number"},{type:"null"}]},basis:{anyOf:[{type:"string"},{type:"null"}]},confidence:{anyOf:[{type:"string"},{type:"null"}]},share_of_scope:{anyOf:[{type:"number"},{type:"null"}]}},required:["usd_per_day","basis","confidence"]},scope:{type:"object",additionalProperties:!1,properties:{label:{type:"string"},workflow:{type:"string"},agent:{type:"string"},model:{type:"string"},provider:{type:"string"}},required:["label"]},assignee:{anyOf:[{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},email:{type:"string"},kind:{type:"string"}},required:["id","name","kind"]},{type:"null"}]},writer_kind:{type:"string"},comment_count:{type:"integer"},open_annotations:{type:"integer"},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"},proof_summary:{anyOf:[{type:"object",additionalProperties:!1,properties:{state:{type:"string"},saving_usd_per_day:{anyOf:[{type:"number"},{type:"null"}]},quality:{anyOf:[{type:"object",additionalProperties:!1,properties:{verdict:{type:"string"}},required:["verdict"]},{type:"null"}]},byte_identical:{anyOf:[{type:"boolean"},{type:"null"}]}},required:["state","saving_usd_per_day","quality","byte_identical"]},{type:"null"}]},subject:{type:"object",additionalProperties:!1,properties:{type:{type:"string"},id:{type:"string"},href:{type:"string"}},required:["type","id","href"]},summary_md:{type:"string"},body_md:{type:"string"},sources:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{n:{type:"integer"},kind:{type:"string"},label:{type:"string"},href:{type:"string"},detail:{type:"string"}},required:["n","kind","label"]}},actions:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{key:{type:"string"},label:{type:"string"},tone:{type:"string"},status_after:{type:"string"}},required:["key","label","status_after"]}},version:{type:"integer"},writer_name:{type:"string"},edited_by:{anyOf:[{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},email:{type:"string"},kind:{type:"string"}},required:["id","name","kind"]},{type:"null"}]},edited_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},status_changed_by:{anyOf:[{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},email:{type:"string"},kind:{type:"string"}},required:["id","name","kind"]},{type:"null"}]},status_changed_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},evidence_version:{anyOf:[{type:"integer"},{type:"null"}]},work:{anyOf:[{type:"object",additionalProperties:!1,properties:{case_id:{type:"string"},case_href:{type:"string"},state:{enum:["queued","working","reviewing","ready","published","merged","closed","declined","blocked","failed"]},steps:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{key:{enum:["engineer","compare","review","pull_request"]},label:{type:"string"},state:{enum:["done","active","pending","failed"]}},required:["key","label","state"]}},detail:{anyOf:[{type:"string"},{type:"null"}]},pull_request:{anyOf:[{type:"object",additionalProperties:!1,properties:{repo:{type:"string"},number:{type:"integer"},url:{type:"string"},state:{enum:["draft","open","merged","closed"]},branch:{anyOf:[{type:"string"},{type:"null"}]}},required:["repo","number","url","state","branch"]},{type:"null"}]},publish:{anyOf:[{type:"object",additionalProperties:!1,properties:{inbox_item_id:{type:"string"}},required:["inbox_item_id"]},{type:"null"}]},retryable:{type:"boolean"},updated_at:{type:"string",format:"date-time"},tries:{anyOf:[{type:"object",additionalProperties:!1,properties:{runs:{type:"integer"},kept:{type:"integer"},discarded:{type:"integer"},best_ratio:{anyOf:[{type:"number"},{type:"null"}]},routes:{type:"integer"}},required:["runs","kept","discarded","best_ratio","routes"]},{type:"null"}]}},required:["case_id","case_href","state","steps","detail","pull_request","publish","retryable","updated_at","tries"]},{type:"null"}]},proof:{anyOf:[{type:"object",additionalProperties:!1,properties:{experiment_id:{type:"string"},kind:{enum:["compare","replay"]},state:{enum:["queued","running","done","failed"]},detail:{anyOf:[{type:"string"},{type:"null"}]},requests:{anyOf:[{type:"integer"},{type:"null"}]},window_days:{anyOf:[{type:"integer"},{type:"null"}]},baseline_usd:{type:["number","null"],description:"Recorded cost of the replayed requests, USD."},candidate_usd:{type:["number","null"],description:"The same requests under the change, USD."},saving_usd_per_day:{type:["number","null"],description:"The replayed saving per request times the scope's recorded requests per day, USD per day; null when the judged answers got worse."},saving_pct:{type:["number","null"],description:"(baseline_usd - candidate_usd) / baseline_usd over the replayed requests the change touches and the proof could count: a ratio in 0..1 (0.27 = 27%), negative when the change costs more; null when the judged answers got worse."},basis:{const:"inferred",description:"A replay of recorded traffic is a counterfactual: always inferred, never measured or verified savings."},quality:{anyOf:[{type:"object",additionalProperties:!1,properties:{verdict:{enum:["same","better","worse","inconclusive","not_checked"]},judge_model:{anyOf:[{type:"string"},{type:"null"}]},same_family_judge:{type:"boolean",description:"The judge is from the same model family as the models compared and is none of them: no judge from another family was available, so the verdict is labelled same-family."},pass_rate:{type:["number","null"],description:"Share of judged cases where the changed answer won or tied: a ratio in 0..1."},noise:{anyOf:[{type:"string"},{type:"null"}]}},required:["verdict","judge_model","same_family_judge","pass_rate","noise"]},{type:"null"}]},coverage:{anyOf:[{type:"object",additionalProperties:!1,properties:{touched:{type:"integer"},total:{type:"integer"}},required:["touched","total"]},{type:"null"}]},byte_identical:{anyOf:[{type:"boolean"},{type:"null"}]},spent_usd:{type:["number","null"],description:"What the proof spent on the project's keys, USD."},started_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},finished_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]}},required:["experiment_id","kind","state","detail","requests","window_days","baseline_usd","candidate_usd","saving_usd_per_day","saving_pct","basis","quality","coverage","byte_identical","spent_usd","started_at","finished_at"]},{type:"null"}]},agent_report:{anyOf:[{type:"object",additionalProperties:!1,properties:{proposal_id:{type:"string"},state:{enum:["candidate","reverted"]},reason:{type:"string"},evidence_source:{const:"self_reported"},runner:{type:"string"},branch:{type:"string"},pr_url:{type:"string"},checks:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{name:{type:"string"},exit:{type:"integer"}},required:["name","exit"]}},reported_at:{type:"string",format:"date-time"}},required:["proposal_id","state","reason","evidence_source","runner","branch","pr_url","checks","reported_at"]},{type:"null"}]},after_fix:{anyOf:[{type:"object",additionalProperties:!1,properties:{status:{enum:["collecting","insufficient","observed","no_clear_change","cost_rose","scope_unavailable","not_watched"]},basis:{const:"observed",description:"A correlation between the fourteen closed days before and after the fix reached the finding's own traffic: observed, never a measured or verified saving."},implemented_at:{type:"string",format:"date-time"},watch_until:{type:"string",format:"date-time"},predicted_at_implementation:{anyOf:[{type:"object",additionalProperties:!1,properties:{schema:{type:"string"},implemented_at:{type:"string",format:"date-time"},snapshotted_at:{type:"string",format:"date-time"},low_usd_per_day:{type:"number"},base_usd_per_day:{type:"number"},high_usd_per_day:{type:"number"},basis:{type:"string"},confidence:{type:"string"},band_method:{anyOf:[{type:"string"},{type:"null"}]},status:{type:"string"},reason:{anyOf:[{type:"string"},{type:"null"}]},pull_request:{anyOf:[{type:"object",additionalProperties:!1,properties:{repo:{type:"string"},number:{type:"integer"},case_id:{type:"string"},proposal_id:{type:"string"},merge_commit_sha:{type:"string"}},required:[]},{type:"null"}]},tasks_per_day:{anyOf:[{type:"number"},{type:"null"}]},tasks_window:{anyOf:[{type:"object",additionalProperties:!1,properties:{start:{type:"string"},end:{type:"string"}},required:["start","end"]},{type:"null"}]},per_task_usd:{anyOf:[{type:"object",additionalProperties:!1,properties:{low:{type:"number"},base:{type:"number"},high:{type:"number"}},required:["low","base","high"]},{type:"null"}]},previous:{}},required:["schema","implemented_at","snapshotted_at","low_usd_per_day","base_usd_per_day","high_usd_per_day","basis","confidence","band_method","status","reason"]},{type:"null"}]},outcome:{anyOf:[{type:"object",additionalProperties:!1,properties:{metric:{type:"string"},unit:{type:"string"},before:{anyOf:[{type:"number"},{type:"null"}]},after:{anyOf:[{type:"number"},{type:"null"}]},delta_usd_per_day:{type:["number","null"],description:"Dollars per day the change removed: (before - after) per task times the after window's tasks per day, priced as dollar_basis says; negative when the metric rose; null for a ratio or per-request metric, when the metric did not move past the noise floor, and when the scope's cost per task rose past it, unless the metric is that cost (cheaper-action-fit), whose rise is the negative figure."},dollar_basis:{type:"string"},decimals:{type:"integer"},window_days_before:{type:"integer"},window_days_after:{type:"integer"},computed_at:{type:"string"},basis:{const:"observed"},note:{type:"string"},status:{type:"string"},watch_status:{enum:["collecting","insufficient","observed","no_clear_change","cost_rose","scope_unavailable","not_watched"]},window_complete:{type:"boolean"},windows:{anyOf:[{type:"object",additionalProperties:!1,properties:{before:{type:"object",additionalProperties:!1,properties:{start:{type:"string"},end:{type:"string"}},required:["start","end"]},after:{type:"object",additionalProperties:!1,properties:{start:{type:"string"},end:{type:"string"}},required:["start","end"]}},required:["before","after"]},{type:"null"}]},anchor:{anyOf:[{type:"object",additionalProperties:!1,properties:{implemented_at:{type:"string"},day:{type:"string"},deploy_detected:{type:"boolean"},signal:{type:"string"},share:{anyOf:[{type:"number"},{type:"null"}]}},required:["implemented_at","day","deploy_detected"]},{type:"null"}]},tasks:{anyOf:[{type:"object",additionalProperties:!1,properties:{before:{type:"integer"},after:{type:"integer"},per_day_before:{type:"number"},per_day_after:{type:"number"},active_days_before:{type:"integer"},active_days_after:{type:"integer"},unbounded_spend_share_before:{type:"number"},unbounded_spend_share_after:{type:"number"}},required:["before","after","per_day_before","per_day_after","active_days_before","active_days_after","unbounded_spend_share_before","unbounded_spend_share_after"]},{type:"null"}]},change:{anyOf:[{type:"object",additionalProperties:!1,properties:{delta:{type:"number"},relative:{type:"number"},interval_low:{type:"number"},interval_high:{type:"number"},clear:{type:"boolean"}},required:["delta","relative","interval_low","interval_high","clear"]},{type:"null"}]},guard:{anyOf:[{type:"object",additionalProperties:!1,properties:{metric:{type:"string"},before:{type:"number"},after:{type:"number"},rose:{type:"boolean"},change:{type:"object",additionalProperties:!1,properties:{delta:{type:"number"},relative:{type:"number"},interval_low:{type:"number"},interval_high:{type:"number"},clear:{type:"boolean"}},required:["delta","relative","interval_low","interval_high","clear"]}},required:["metric","before","after","rose","change"]},{type:"null"}]},pricing:{anyOf:[{type:"object",additionalProperties:!1,properties:{method:{enum:["catalog_reprice","recorded"]},catalog_versions:{type:["array","null"],items:{type:"string"}},reason:{type:"string"},input_usd_per_million:{anyOf:[{type:"number"},{type:"null"}]}},required:["method"]},{type:"null"}]},sample:{anyOf:[{type:"object",additionalProperties:!1,properties:{before:{type:"object",additionalProperties:!1,properties:{sessions:{type:"integer"},walked:{type:"integer"},dropped:{type:"integer"}},required:["sessions","walked","dropped"]},after:{type:"object",additionalProperties:!1,properties:{sessions:{type:"integer"},walked:{type:"integer"},dropped:{type:"integer"}},required:["sessions","walked","dropped"]}},required:["before","after"]},{type:"null"}]},attempts:{type:"integer"},last_error:{type:"string"},insufficient_reason:{enum:["too_few_tasks","no_session_ids","session_spans_days","session_coverage_changed","sessions_unreadable","read_failed"],description:"Why watch_status is insufficient; absent otherwise. A task is a session id: no_session_ids and session_spans_days mean too much of the spend has no task under it, session_coverage_changed that requests gained or lost session ids across the change, so the tasks before and after are not the same population."}},required:["metric","delta_usd_per_day","decimals","window_days_before","window_days_after","computed_at","basis","note"]},{type:"null"}]}},required:["status","basis","implemented_at","watch_until","predicted_at_implementation","outcome"]},{type:"null"}]}},required:["id","project_id","number","scout","scout_label","status","priority","title","summary_line","impact","scope","assignee","writer_kind","comment_count","open_annotations","created_at","updated_at","proof_summary","subject","summary_md","body_md","sources","actions","version","writer_name","edited_by","edited_at","status_changed_by","status_changed_at","evidence_version","work","proof","agent_report","after_fix"]},binding:{path_inputs:{briefId:"brief_id"},query_inputs:[],body_inputs:[]},contract_sha256:"374238aac4ee25b595c1b5dbc4baae67dc3c80a8ed5972ebb54d6939a13a7268"},{id:"briefs.edit",version:"1",summary:"Edit a brief. Content (title, summary_md, body_md, sources) needs expected_version and writes a revision; every [^n] must cite a listed source. Status, priority and assignee_id changes are recorded in the activity.",method:"PATCH",path:"/projects/{projectId}/briefs/{briefId}",permissions:["opportunity:write"],scope:"project",access:"write",aliases:["caveman_briefs_write.edit"],input_schema:{type:"object",additionalProperties:!1,properties:{expected_version:{type:"integer",minimum:1},title:{type:"string",minLength:1,maxLength:200},summary_md:{type:"string",maxLength:16384},body_md:{type:"string",maxLength:65536},sources:{type:"array",maxItems:24,items:{type:"object",additionalProperties:!1,properties:{n:{type:"integer",minimum:1},kind:{enum:["finding","evidence","trace","report","query"]},label:{type:"string",minLength:1,maxLength:200},href:{type:"string",pattern:"^/"},detail:{type:"string",maxLength:500}},required:["n","kind","label"]}},status:{enum:["open","in_progress","done","dismissed"]},priority:{type:"integer",minimum:1,maximum:3},assignee_id:{type:["string","null"]},brief_id:{type:"string",pattern:"^([1-9][0-9]{0,8}|[0-9a-fA-F-]{36})$",description:"The brief id or its per-project number."}},required:["brief_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},number:{type:"integer"},scout:{type:"string"},scout_label:{type:"string"},status:{type:"string"},priority:{type:"integer"},title:{type:"string"},summary_line:{type:"string"},impact:{type:"object",additionalProperties:!1,properties:{usd_per_day:{anyOf:[{type:"number"},{type:"null"}]},basis:{anyOf:[{type:"string"},{type:"null"}]},confidence:{anyOf:[{type:"string"},{type:"null"}]},share_of_scope:{anyOf:[{type:"number"},{type:"null"}]}},required:["usd_per_day","basis","confidence"]},scope:{type:"object",additionalProperties:!1,properties:{label:{type:"string"},workflow:{type:"string"},agent:{type:"string"},model:{type:"string"},provider:{type:"string"}},required:["label"]},assignee:{anyOf:[{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},email:{type:"string"},kind:{type:"string"}},required:["id","name","kind"]},{type:"null"}]},writer_kind:{type:"string"},comment_count:{type:"integer"},open_annotations:{type:"integer"},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"},proof_summary:{anyOf:[{type:"object",additionalProperties:!1,properties:{state:{type:"string"},saving_usd_per_day:{anyOf:[{type:"number"},{type:"null"}]},quality:{anyOf:[{type:"object",additionalProperties:!1,properties:{verdict:{type:"string"}},required:["verdict"]},{type:"null"}]},byte_identical:{anyOf:[{type:"boolean"},{type:"null"}]}},required:["state","saving_usd_per_day","quality","byte_identical"]},{type:"null"}]},subject:{type:"object",additionalProperties:!1,properties:{type:{type:"string"},id:{type:"string"},href:{type:"string"}},required:["type","id","href"]},summary_md:{type:"string"},body_md:{type:"string"},sources:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{n:{type:"integer"},kind:{type:"string"},label:{type:"string"},href:{type:"string"},detail:{type:"string"}},required:["n","kind","label"]}},actions:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{key:{type:"string"},label:{type:"string"},tone:{type:"string"},status_after:{type:"string"}},required:["key","label","status_after"]}},version:{type:"integer"},writer_name:{type:"string"},edited_by:{anyOf:[{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},email:{type:"string"},kind:{type:"string"}},required:["id","name","kind"]},{type:"null"}]},edited_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},status_changed_by:{anyOf:[{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},email:{type:"string"},kind:{type:"string"}},required:["id","name","kind"]},{type:"null"}]},status_changed_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},evidence_version:{anyOf:[{type:"integer"},{type:"null"}]},work:{anyOf:[{type:"object",additionalProperties:!1,properties:{case_id:{type:"string"},case_href:{type:"string"},state:{enum:["queued","working","reviewing","ready","published","merged","closed","declined","blocked","failed"]},steps:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{key:{enum:["engineer","compare","review","pull_request"]},label:{type:"string"},state:{enum:["done","active","pending","failed"]}},required:["key","label","state"]}},detail:{anyOf:[{type:"string"},{type:"null"}]},pull_request:{anyOf:[{type:"object",additionalProperties:!1,properties:{repo:{type:"string"},number:{type:"integer"},url:{type:"string"},state:{enum:["draft","open","merged","closed"]},branch:{anyOf:[{type:"string"},{type:"null"}]}},required:["repo","number","url","state","branch"]},{type:"null"}]},publish:{anyOf:[{type:"object",additionalProperties:!1,properties:{inbox_item_id:{type:"string"}},required:["inbox_item_id"]},{type:"null"}]},retryable:{type:"boolean"},updated_at:{type:"string",format:"date-time"},tries:{anyOf:[{type:"object",additionalProperties:!1,properties:{runs:{type:"integer"},kept:{type:"integer"},discarded:{type:"integer"},best_ratio:{anyOf:[{type:"number"},{type:"null"}]},routes:{type:"integer"}},required:["runs","kept","discarded","best_ratio","routes"]},{type:"null"}]}},required:["case_id","case_href","state","steps","detail","pull_request","publish","retryable","updated_at","tries"]},{type:"null"}]},proof:{anyOf:[{type:"object",additionalProperties:!1,properties:{experiment_id:{type:"string"},kind:{enum:["compare","replay"]},state:{enum:["queued","running","done","failed"]},detail:{anyOf:[{type:"string"},{type:"null"}]},requests:{anyOf:[{type:"integer"},{type:"null"}]},window_days:{anyOf:[{type:"integer"},{type:"null"}]},baseline_usd:{type:["number","null"],description:"Recorded cost of the replayed requests, USD."},candidate_usd:{type:["number","null"],description:"The same requests under the change, USD."},saving_usd_per_day:{type:["number","null"],description:"The replayed saving per request times the scope's recorded requests per day, USD per day; null when the judged answers got worse."},saving_pct:{type:["number","null"],description:"(baseline_usd - candidate_usd) / baseline_usd over the replayed requests the change touches and the proof could count: a ratio in 0..1 (0.27 = 27%), negative when the change costs more; null when the judged answers got worse."},basis:{const:"inferred",description:"A replay of recorded traffic is a counterfactual: always inferred, never measured or verified savings."},quality:{anyOf:[{type:"object",additionalProperties:!1,properties:{verdict:{enum:["same","better","worse","inconclusive","not_checked"]},judge_model:{anyOf:[{type:"string"},{type:"null"}]},same_family_judge:{type:"boolean",description:"The judge is from the same model family as the models compared and is none of them: no judge from another family was available, so the verdict is labelled same-family."},pass_rate:{type:["number","null"],description:"Share of judged cases where the changed answer won or tied: a ratio in 0..1."},noise:{anyOf:[{type:"string"},{type:"null"}]}},required:["verdict","judge_model","same_family_judge","pass_rate","noise"]},{type:"null"}]},coverage:{anyOf:[{type:"object",additionalProperties:!1,properties:{touched:{type:"integer"},total:{type:"integer"}},required:["touched","total"]},{type:"null"}]},byte_identical:{anyOf:[{type:"boolean"},{type:"null"}]},spent_usd:{type:["number","null"],description:"What the proof spent on the project's keys, USD."},started_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},finished_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]}},required:["experiment_id","kind","state","detail","requests","window_days","baseline_usd","candidate_usd","saving_usd_per_day","saving_pct","basis","quality","coverage","byte_identical","spent_usd","started_at","finished_at"]},{type:"null"}]},agent_report:{anyOf:[{type:"object",additionalProperties:!1,properties:{proposal_id:{type:"string"},state:{enum:["candidate","reverted"]},reason:{type:"string"},evidence_source:{const:"self_reported"},runner:{type:"string"},branch:{type:"string"},pr_url:{type:"string"},checks:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{name:{type:"string"},exit:{type:"integer"}},required:["name","exit"]}},reported_at:{type:"string",format:"date-time"}},required:["proposal_id","state","reason","evidence_source","runner","branch","pr_url","checks","reported_at"]},{type:"null"}]},after_fix:{anyOf:[{type:"object",additionalProperties:!1,properties:{status:{enum:["collecting","insufficient","observed","no_clear_change","cost_rose","scope_unavailable","not_watched"]},basis:{const:"observed",description:"A correlation between the fourteen closed days before and after the fix reached the finding's own traffic: observed, never a measured or verified saving."},implemented_at:{type:"string",format:"date-time"},watch_until:{type:"string",format:"date-time"},predicted_at_implementation:{anyOf:[{type:"object",additionalProperties:!1,properties:{schema:{type:"string"},implemented_at:{type:"string",format:"date-time"},snapshotted_at:{type:"string",format:"date-time"},low_usd_per_day:{type:"number"},base_usd_per_day:{type:"number"},high_usd_per_day:{type:"number"},basis:{type:"string"},confidence:{type:"string"},band_method:{anyOf:[{type:"string"},{type:"null"}]},status:{type:"string"},reason:{anyOf:[{type:"string"},{type:"null"}]},pull_request:{anyOf:[{type:"object",additionalProperties:!1,properties:{repo:{type:"string"},number:{type:"integer"},case_id:{type:"string"},proposal_id:{type:"string"},merge_commit_sha:{type:"string"}},required:[]},{type:"null"}]},tasks_per_day:{anyOf:[{type:"number"},{type:"null"}]},tasks_window:{anyOf:[{type:"object",additionalProperties:!1,properties:{start:{type:"string"},end:{type:"string"}},required:["start","end"]},{type:"null"}]},per_task_usd:{anyOf:[{type:"object",additionalProperties:!1,properties:{low:{type:"number"},base:{type:"number"},high:{type:"number"}},required:["low","base","high"]},{type:"null"}]},previous:{}},required:["schema","implemented_at","snapshotted_at","low_usd_per_day","base_usd_per_day","high_usd_per_day","basis","confidence","band_method","status","reason"]},{type:"null"}]},outcome:{anyOf:[{type:"object",additionalProperties:!1,properties:{metric:{type:"string"},unit:{type:"string"},before:{anyOf:[{type:"number"},{type:"null"}]},after:{anyOf:[{type:"number"},{type:"null"}]},delta_usd_per_day:{type:["number","null"],description:"Dollars per day the change removed: (before - after) per task times the after window's tasks per day, priced as dollar_basis says; negative when the metric rose; null for a ratio or per-request metric, when the metric did not move past the noise floor, and when the scope's cost per task rose past it, unless the metric is that cost (cheaper-action-fit), whose rise is the negative figure."},dollar_basis:{type:"string"},decimals:{type:"integer"},window_days_before:{type:"integer"},window_days_after:{type:"integer"},computed_at:{type:"string"},basis:{const:"observed"},note:{type:"string"},status:{type:"string"},watch_status:{enum:["collecting","insufficient","observed","no_clear_change","cost_rose","scope_unavailable","not_watched"]},window_complete:{type:"boolean"},windows:{anyOf:[{type:"object",additionalProperties:!1,properties:{before:{type:"object",additionalProperties:!1,properties:{start:{type:"string"},end:{type:"string"}},required:["start","end"]},after:{type:"object",additionalProperties:!1,properties:{start:{type:"string"},end:{type:"string"}},required:["start","end"]}},required:["before","after"]},{type:"null"}]},anchor:{anyOf:[{type:"object",additionalProperties:!1,properties:{implemented_at:{type:"string"},day:{type:"string"},deploy_detected:{type:"boolean"},signal:{type:"string"},share:{anyOf:[{type:"number"},{type:"null"}]}},required:["implemented_at","day","deploy_detected"]},{type:"null"}]},tasks:{anyOf:[{type:"object",additionalProperties:!1,properties:{before:{type:"integer"},after:{type:"integer"},per_day_before:{type:"number"},per_day_after:{type:"number"},active_days_before:{type:"integer"},active_days_after:{type:"integer"},unbounded_spend_share_before:{type:"number"},unbounded_spend_share_after:{type:"number"}},required:["before","after","per_day_before","per_day_after","active_days_before","active_days_after","unbounded_spend_share_before","unbounded_spend_share_after"]},{type:"null"}]},change:{anyOf:[{type:"object",additionalProperties:!1,properties:{delta:{type:"number"},relative:{type:"number"},interval_low:{type:"number"},interval_high:{type:"number"},clear:{type:"boolean"}},required:["delta","relative","interval_low","interval_high","clear"]},{type:"null"}]},guard:{anyOf:[{type:"object",additionalProperties:!1,properties:{metric:{type:"string"},before:{type:"number"},after:{type:"number"},rose:{type:"boolean"},change:{type:"object",additionalProperties:!1,properties:{delta:{type:"number"},relative:{type:"number"},interval_low:{type:"number"},interval_high:{type:"number"},clear:{type:"boolean"}},required:["delta","relative","interval_low","interval_high","clear"]}},required:["metric","before","after","rose","change"]},{type:"null"}]},pricing:{anyOf:[{type:"object",additionalProperties:!1,properties:{method:{enum:["catalog_reprice","recorded"]},catalog_versions:{type:["array","null"],items:{type:"string"}},reason:{type:"string"},input_usd_per_million:{anyOf:[{type:"number"},{type:"null"}]}},required:["method"]},{type:"null"}]},sample:{anyOf:[{type:"object",additionalProperties:!1,properties:{before:{type:"object",additionalProperties:!1,properties:{sessions:{type:"integer"},walked:{type:"integer"},dropped:{type:"integer"}},required:["sessions","walked","dropped"]},after:{type:"object",additionalProperties:!1,properties:{sessions:{type:"integer"},walked:{type:"integer"},dropped:{type:"integer"}},required:["sessions","walked","dropped"]}},required:["before","after"]},{type:"null"}]},attempts:{type:"integer"},last_error:{type:"string"},insufficient_reason:{enum:["too_few_tasks","no_session_ids","session_spans_days","session_coverage_changed","sessions_unreadable","read_failed"],description:"Why watch_status is insufficient; absent otherwise. A task is a session id: no_session_ids and session_spans_days mean too much of the spend has no task under it, session_coverage_changed that requests gained or lost session ids across the change, so the tasks before and after are not the same population."}},required:["metric","delta_usd_per_day","decimals","window_days_before","window_days_after","computed_at","basis","note"]},{type:"null"}]}},required:["status","basis","implemented_at","watch_until","predicted_at_implementation","outcome"]},{type:"null"}]}},required:["id","project_id","number","scout","scout_label","status","priority","title","summary_line","impact","scope","assignee","writer_kind","comment_count","open_annotations","created_at","updated_at","proof_summary","subject","summary_md","body_md","sources","actions","version","writer_name","edited_by","edited_at","status_changed_by","status_changed_at","evidence_version","work","proof","agent_report","after_fix"]},binding:{path_inputs:{briefId:"brief_id"},query_inputs:[],body_inputs:["expected_version","title","summary_md","body_md","sources","status","priority","assignee_id"]},contract_sha256:"f0fc9d1af3f0d6411bd3182c9930579df568bb210490411a359e0a42a623fcd7"},{id:"briefs.act",version:"1",summary:"Run an action the brief declares on its finding: mark_implemented, dismiss; fix (Caveman writes the change for the finding's agent) needs a person's own session and is refused to agent connections, which use fix_packet instead; create_experiment (Prove it on recorded traffic) replays the change on captured requests within the proving budget, needs experiment:run, leaves the status alone, and runs one proof at a time. The brief's status moves only when the action takes.",method:"POST",path:"/projects/{projectId}/briefs/{briefId}/actions/{actionKey}",permissions:["opportunity:write"],scope:"project",access:"write",aliases:["caveman_briefs_write.act"],input_schema:{type:"object",additionalProperties:!1,properties:{brief_id:{type:"string",pattern:"^([1-9][0-9]{0,8}|[0-9a-fA-F-]{36})$",description:"The brief id or its per-project number."},action_key:{type:"string",minLength:1,maxLength:200}},required:["brief_id","action_key"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},number:{type:"integer"},scout:{type:"string"},scout_label:{type:"string"},status:{type:"string"},priority:{type:"integer"},title:{type:"string"},summary_line:{type:"string"},impact:{type:"object",additionalProperties:!1,properties:{usd_per_day:{anyOf:[{type:"number"},{type:"null"}]},basis:{anyOf:[{type:"string"},{type:"null"}]},confidence:{anyOf:[{type:"string"},{type:"null"}]},share_of_scope:{anyOf:[{type:"number"},{type:"null"}]}},required:["usd_per_day","basis","confidence"]},scope:{type:"object",additionalProperties:!1,properties:{label:{type:"string"},workflow:{type:"string"},agent:{type:"string"},model:{type:"string"},provider:{type:"string"}},required:["label"]},assignee:{anyOf:[{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},email:{type:"string"},kind:{type:"string"}},required:["id","name","kind"]},{type:"null"}]},writer_kind:{type:"string"},comment_count:{type:"integer"},open_annotations:{type:"integer"},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"},proof_summary:{anyOf:[{type:"object",additionalProperties:!1,properties:{state:{type:"string"},saving_usd_per_day:{anyOf:[{type:"number"},{type:"null"}]},quality:{anyOf:[{type:"object",additionalProperties:!1,properties:{verdict:{type:"string"}},required:["verdict"]},{type:"null"}]},byte_identical:{anyOf:[{type:"boolean"},{type:"null"}]}},required:["state","saving_usd_per_day","quality","byte_identical"]},{type:"null"}]},subject:{type:"object",additionalProperties:!1,properties:{type:{type:"string"},id:{type:"string"},href:{type:"string"}},required:["type","id","href"]},summary_md:{type:"string"},body_md:{type:"string"},sources:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{n:{type:"integer"},kind:{type:"string"},label:{type:"string"},href:{type:"string"},detail:{type:"string"}},required:["n","kind","label"]}},actions:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{key:{type:"string"},label:{type:"string"},tone:{type:"string"},status_after:{type:"string"}},required:["key","label","status_after"]}},version:{type:"integer"},writer_name:{type:"string"},edited_by:{anyOf:[{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},email:{type:"string"},kind:{type:"string"}},required:["id","name","kind"]},{type:"null"}]},edited_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},status_changed_by:{anyOf:[{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},email:{type:"string"},kind:{type:"string"}},required:["id","name","kind"]},{type:"null"}]},status_changed_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},evidence_version:{anyOf:[{type:"integer"},{type:"null"}]},work:{anyOf:[{type:"object",additionalProperties:!1,properties:{case_id:{type:"string"},case_href:{type:"string"},state:{enum:["queued","working","reviewing","ready","published","merged","closed","declined","blocked","failed"]},steps:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{key:{enum:["engineer","compare","review","pull_request"]},label:{type:"string"},state:{enum:["done","active","pending","failed"]}},required:["key","label","state"]}},detail:{anyOf:[{type:"string"},{type:"null"}]},pull_request:{anyOf:[{type:"object",additionalProperties:!1,properties:{repo:{type:"string"},number:{type:"integer"},url:{type:"string"},state:{enum:["draft","open","merged","closed"]},branch:{anyOf:[{type:"string"},{type:"null"}]}},required:["repo","number","url","state","branch"]},{type:"null"}]},publish:{anyOf:[{type:"object",additionalProperties:!1,properties:{inbox_item_id:{type:"string"}},required:["inbox_item_id"]},{type:"null"}]},retryable:{type:"boolean"},updated_at:{type:"string",format:"date-time"},tries:{anyOf:[{type:"object",additionalProperties:!1,properties:{runs:{type:"integer"},kept:{type:"integer"},discarded:{type:"integer"},best_ratio:{anyOf:[{type:"number"},{type:"null"}]},routes:{type:"integer"}},required:["runs","kept","discarded","best_ratio","routes"]},{type:"null"}]}},required:["case_id","case_href","state","steps","detail","pull_request","publish","retryable","updated_at","tries"]},{type:"null"}]},proof:{anyOf:[{type:"object",additionalProperties:!1,properties:{experiment_id:{type:"string"},kind:{enum:["compare","replay"]},state:{enum:["queued","running","done","failed"]},detail:{anyOf:[{type:"string"},{type:"null"}]},requests:{anyOf:[{type:"integer"},{type:"null"}]},window_days:{anyOf:[{type:"integer"},{type:"null"}]},baseline_usd:{type:["number","null"],description:"Recorded cost of the replayed requests, USD."},candidate_usd:{type:["number","null"],description:"The same requests under the change, USD."},saving_usd_per_day:{type:["number","null"],description:"The replayed saving per request times the scope's recorded requests per day, USD per day; null when the judged answers got worse."},saving_pct:{type:["number","null"],description:"(baseline_usd - candidate_usd) / baseline_usd over the replayed requests the change touches and the proof could count: a ratio in 0..1 (0.27 = 27%), negative when the change costs more; null when the judged answers got worse."},basis:{const:"inferred",description:"A replay of recorded traffic is a counterfactual: always inferred, never measured or verified savings."},quality:{anyOf:[{type:"object",additionalProperties:!1,properties:{verdict:{enum:["same","better","worse","inconclusive","not_checked"]},judge_model:{anyOf:[{type:"string"},{type:"null"}]},same_family_judge:{type:"boolean",description:"The judge is from the same model family as the models compared and is none of them: no judge from another family was available, so the verdict is labelled same-family."},pass_rate:{type:["number","null"],description:"Share of judged cases where the changed answer won or tied: a ratio in 0..1."},noise:{anyOf:[{type:"string"},{type:"null"}]}},required:["verdict","judge_model","same_family_judge","pass_rate","noise"]},{type:"null"}]},coverage:{anyOf:[{type:"object",additionalProperties:!1,properties:{touched:{type:"integer"},total:{type:"integer"}},required:["touched","total"]},{type:"null"}]},byte_identical:{anyOf:[{type:"boolean"},{type:"null"}]},spent_usd:{type:["number","null"],description:"What the proof spent on the project's keys, USD."},started_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},finished_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]}},required:["experiment_id","kind","state","detail","requests","window_days","baseline_usd","candidate_usd","saving_usd_per_day","saving_pct","basis","quality","coverage","byte_identical","spent_usd","started_at","finished_at"]},{type:"null"}]},agent_report:{anyOf:[{type:"object",additionalProperties:!1,properties:{proposal_id:{type:"string"},state:{enum:["candidate","reverted"]},reason:{type:"string"},evidence_source:{const:"self_reported"},runner:{type:"string"},branch:{type:"string"},pr_url:{type:"string"},checks:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{name:{type:"string"},exit:{type:"integer"}},required:["name","exit"]}},reported_at:{type:"string",format:"date-time"}},required:["proposal_id","state","reason","evidence_source","runner","branch","pr_url","checks","reported_at"]},{type:"null"}]},after_fix:{anyOf:[{type:"object",additionalProperties:!1,properties:{status:{enum:["collecting","insufficient","observed","no_clear_change","cost_rose","scope_unavailable","not_watched"]},basis:{const:"observed",description:"A correlation between the fourteen closed days before and after the fix reached the finding's own traffic: observed, never a measured or verified saving."},implemented_at:{type:"string",format:"date-time"},watch_until:{type:"string",format:"date-time"},predicted_at_implementation:{anyOf:[{type:"object",additionalProperties:!1,properties:{schema:{type:"string"},implemented_at:{type:"string",format:"date-time"},snapshotted_at:{type:"string",format:"date-time"},low_usd_per_day:{type:"number"},base_usd_per_day:{type:"number"},high_usd_per_day:{type:"number"},basis:{type:"string"},confidence:{type:"string"},band_method:{anyOf:[{type:"string"},{type:"null"}]},status:{type:"string"},reason:{anyOf:[{type:"string"},{type:"null"}]},pull_request:{anyOf:[{type:"object",additionalProperties:!1,properties:{repo:{type:"string"},number:{type:"integer"},case_id:{type:"string"},proposal_id:{type:"string"},merge_commit_sha:{type:"string"}},required:[]},{type:"null"}]},tasks_per_day:{anyOf:[{type:"number"},{type:"null"}]},tasks_window:{anyOf:[{type:"object",additionalProperties:!1,properties:{start:{type:"string"},end:{type:"string"}},required:["start","end"]},{type:"null"}]},per_task_usd:{anyOf:[{type:"object",additionalProperties:!1,properties:{low:{type:"number"},base:{type:"number"},high:{type:"number"}},required:["low","base","high"]},{type:"null"}]},previous:{}},required:["schema","implemented_at","snapshotted_at","low_usd_per_day","base_usd_per_day","high_usd_per_day","basis","confidence","band_method","status","reason"]},{type:"null"}]},outcome:{anyOf:[{type:"object",additionalProperties:!1,properties:{metric:{type:"string"},unit:{type:"string"},before:{anyOf:[{type:"number"},{type:"null"}]},after:{anyOf:[{type:"number"},{type:"null"}]},delta_usd_per_day:{type:["number","null"],description:"Dollars per day the change removed: (before - after) per task times the after window's tasks per day, priced as dollar_basis says; negative when the metric rose; null for a ratio or per-request metric, when the metric did not move past the noise floor, and when the scope's cost per task rose past it, unless the metric is that cost (cheaper-action-fit), whose rise is the negative figure."},dollar_basis:{type:"string"},decimals:{type:"integer"},window_days_before:{type:"integer"},window_days_after:{type:"integer"},computed_at:{type:"string"},basis:{const:"observed"},note:{type:"string"},status:{type:"string"},watch_status:{enum:["collecting","insufficient","observed","no_clear_change","cost_rose","scope_unavailable","not_watched"]},window_complete:{type:"boolean"},windows:{anyOf:[{type:"object",additionalProperties:!1,properties:{before:{type:"object",additionalProperties:!1,properties:{start:{type:"string"},end:{type:"string"}},required:["start","end"]},after:{type:"object",additionalProperties:!1,properties:{start:{type:"string"},end:{type:"string"}},required:["start","end"]}},required:["before","after"]},{type:"null"}]},anchor:{anyOf:[{type:"object",additionalProperties:!1,properties:{implemented_at:{type:"string"},day:{type:"string"},deploy_detected:{type:"boolean"},signal:{type:"string"},share:{anyOf:[{type:"number"},{type:"null"}]}},required:["implemented_at","day","deploy_detected"]},{type:"null"}]},tasks:{anyOf:[{type:"object",additionalProperties:!1,properties:{before:{type:"integer"},after:{type:"integer"},per_day_before:{type:"number"},per_day_after:{type:"number"},active_days_before:{type:"integer"},active_days_after:{type:"integer"},unbounded_spend_share_before:{type:"number"},unbounded_spend_share_after:{type:"number"}},required:["before","after","per_day_before","per_day_after","active_days_before","active_days_after","unbounded_spend_share_before","unbounded_spend_share_after"]},{type:"null"}]},change:{anyOf:[{type:"object",additionalProperties:!1,properties:{delta:{type:"number"},relative:{type:"number"},interval_low:{type:"number"},interval_high:{type:"number"},clear:{type:"boolean"}},required:["delta","relative","interval_low","interval_high","clear"]},{type:"null"}]},guard:{anyOf:[{type:"object",additionalProperties:!1,properties:{metric:{type:"string"},before:{type:"number"},after:{type:"number"},rose:{type:"boolean"},change:{type:"object",additionalProperties:!1,properties:{delta:{type:"number"},relative:{type:"number"},interval_low:{type:"number"},interval_high:{type:"number"},clear:{type:"boolean"}},required:["delta","relative","interval_low","interval_high","clear"]}},required:["metric","before","after","rose","change"]},{type:"null"}]},pricing:{anyOf:[{type:"object",additionalProperties:!1,properties:{method:{enum:["catalog_reprice","recorded"]},catalog_versions:{type:["array","null"],items:{type:"string"}},reason:{type:"string"},input_usd_per_million:{anyOf:[{type:"number"},{type:"null"}]}},required:["method"]},{type:"null"}]},sample:{anyOf:[{type:"object",additionalProperties:!1,properties:{before:{type:"object",additionalProperties:!1,properties:{sessions:{type:"integer"},walked:{type:"integer"},dropped:{type:"integer"}},required:["sessions","walked","dropped"]},after:{type:"object",additionalProperties:!1,properties:{sessions:{type:"integer"},walked:{type:"integer"},dropped:{type:"integer"}},required:["sessions","walked","dropped"]}},required:["before","after"]},{type:"null"}]},attempts:{type:"integer"},last_error:{type:"string"},insufficient_reason:{enum:["too_few_tasks","no_session_ids","session_spans_days","session_coverage_changed","sessions_unreadable","read_failed"],description:"Why watch_status is insufficient; absent otherwise. A task is a session id: no_session_ids and session_spans_days mean too much of the spend has no task under it, session_coverage_changed that requests gained or lost session ids across the change, so the tasks before and after are not the same population."}},required:["metric","delta_usd_per_day","decimals","window_days_before","window_days_after","computed_at","basis","note"]},{type:"null"}]}},required:["status","basis","implemented_at","watch_until","predicted_at_implementation","outcome"]},{type:"null"}]}},required:["id","project_id","number","scout","scout_label","status","priority","title","summary_line","impact","scope","assignee","writer_kind","comment_count","open_annotations","created_at","updated_at","proof_summary","subject","summary_md","body_md","sources","actions","version","writer_name","edited_by","edited_at","status_changed_by","status_changed_at","evidence_version","work","proof","agent_report","after_fix"]},binding:{path_inputs:{briefId:"brief_id",actionKey:"action_key"},query_inputs:[],body_inputs:[]},contract_sha256:"d58339a3476d8e8b9940e9d6662c6ad34f01163c3a41d318ac1d47c9dfac2e2a"},{id:"briefs.activity",version:"1",summary:"Read a brief's revisions and status, assignee and priority changes, oldest first.",method:"GET",path:"/projects/{projectId}/briefs/{briefId}/activity",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_briefs.activity"],input_schema:{type:"object",additionalProperties:!1,properties:{brief_id:{type:"string",pattern:"^([1-9][0-9]{0,8}|[0-9a-fA-F-]{36})$",description:"The brief id or its per-project number."}},required:["brief_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{anyOf:[{type:"object",additionalProperties:!1,properties:{kind:{type:"string"},version:{type:"integer"},writer_kind:{type:"string"},actor:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},email:{type:"string"},kind:{type:"string"}},required:["id","name","kind"]},at:{type:"string",format:"date-time"}},required:["kind","version","writer_kind","actor","at"]},{type:"object",additionalProperties:!1,properties:{kind:{type:"string"},actor:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},email:{type:"string"},kind:{type:"string"}},required:["id","name","kind"]},from:{anyOf:[{type:"string"},{type:"null"}]},to:{anyOf:[{type:"string"},{type:"null"}]},at:{type:"string",format:"date-time"}},required:["kind","actor","from","to","at"]}]}}},required:["data"]},binding:{path_inputs:{briefId:"brief_id"},query_inputs:[],body_inputs:[]},contract_sha256:"6baaa20c7114388fad6e639a0d5cce1737049b84d71b6c43bc6b0fc90ff8fb5c"},{id:"briefs.comments",version:"1",summary:"Read a brief's comments and one-level replies, oldest first, with any quote they are anchored to.",method:"GET",path:"/projects/{projectId}/briefs/{briefId}/comments",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_briefs.comments"],input_schema:{type:"object",additionalProperties:!1,properties:{brief_id:{type:"string",pattern:"^([1-9][0-9]{0,8}|[0-9a-fA-F-]{36})$",description:"The brief id or its per-project number."}},required:["brief_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},parent_id:{anyOf:[{type:"string"},{type:"null"}]},author:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},email:{type:"string"},kind:{type:"string"}},required:["id","name","kind"]},body:{type:"string"},anchor:{anyOf:[{type:"object",additionalProperties:!1,properties:{field:{type:"string"},quote:{type:"string"},prefix:{type:"string"},suffix:{type:"string"}},required:["field","quote","prefix","suffix"]},{type:"null"}]},resolved_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},resolved_by:{anyOf:[{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},email:{type:"string"},kind:{type:"string"}},required:["id","name","kind"]},{type:"null"}]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"},edited:{type:"boolean"}},required:["id","parent_id","author","body","anchor","resolved_at","resolved_by","created_at","updated_at","edited"]}}},required:["data"]},binding:{path_inputs:{briefId:"brief_id"},query_inputs:[],body_inputs:[]},contract_sha256:"aa9097c9fb9b3bec71030da580a9787fdb77d7943c1b284580ff67f2ba63a14c"},{id:"briefs.comment",version:"1",summary:"Comment on a brief, reply to a comment, or anchor a comment to a quote in its summary or body.",method:"POST",path:"/projects/{projectId}/briefs/{briefId}/comments",permissions:["opportunity:write"],scope:"project",access:"write",aliases:["caveman_briefs_write.comment"],input_schema:{type:"object",additionalProperties:!1,properties:{body:{type:"string",minLength:1,maxLength:8e3},parent_id:{type:"string",format:"uuid"},anchor:{type:"object",additionalProperties:!1,properties:{field:{enum:["summary","body"]},quote:{type:"string",minLength:1,maxLength:500},prefix:{type:"string",maxLength:64},suffix:{type:"string",maxLength:64}},required:["field","quote"]},brief_id:{type:"string",pattern:"^([1-9][0-9]{0,8}|[0-9a-fA-F-]{36})$",description:"The brief id or its per-project number."}},required:["brief_id","body"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},parent_id:{anyOf:[{type:"string"},{type:"null"}]},author:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},email:{type:"string"},kind:{type:"string"}},required:["id","name","kind"]},body:{type:"string"},anchor:{anyOf:[{type:"object",additionalProperties:!1,properties:{field:{type:"string"},quote:{type:"string"},prefix:{type:"string"},suffix:{type:"string"}},required:["field","quote","prefix","suffix"]},{type:"null"}]},resolved_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},resolved_by:{anyOf:[{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},email:{type:"string"},kind:{type:"string"}},required:["id","name","kind"]},{type:"null"}]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"},edited:{type:"boolean"}},required:["id","parent_id","author","body","anchor","resolved_at","resolved_by","created_at","updated_at","edited"]},binding:{path_inputs:{briefId:"brief_id"},query_inputs:[],body_inputs:["body","parent_id","anchor"]},contract_sha256:"999604c9551d72c27c7b089bea5ca1a914a6712085aa4103532993b4fed19dbc"},{id:"briefs.delete_comment",version:"1",summary:"Delete a comment you wrote (a project admin may delete any).",method:"DELETE",path:"/projects/{projectId}/briefs/{briefId}/comments/{commentId}",permissions:["opportunity:write"],scope:"project",access:"write",aliases:["caveman_briefs_write.delete_comment"],input_schema:{type:"object",additionalProperties:!1,properties:{brief_id:{type:"string",pattern:"^([1-9][0-9]{0,8}|[0-9a-fA-F-]{36})$",description:"The brief id or its per-project number."},comment_id:{type:"string",format:"uuid"}},required:["brief_id","comment_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{status:{const:"deleted"}},required:["status"]},binding:{path_inputs:{briefId:"brief_id",commentId:"comment_id"},query_inputs:[],body_inputs:[]},contract_sha256:"791609ce3490c26dd4c7fdf6217fd9e4aba48e2accac82cc3dd35360fda3951e"},{id:"briefs.update_comment",version:"1",summary:"Resolve or reopen a comment; only its author edits the body.",method:"PATCH",path:"/projects/{projectId}/briefs/{briefId}/comments/{commentId}",permissions:["opportunity:write"],scope:"project",access:"write",aliases:["caveman_briefs_write.update_comment"],input_schema:{type:"object",additionalProperties:!1,properties:{body:{type:"string",minLength:1,maxLength:8e3},resolved:{type:"boolean"},brief_id:{type:"string",pattern:"^([1-9][0-9]{0,8}|[0-9a-fA-F-]{36})$",description:"The brief id or its per-project number."},comment_id:{type:"string",format:"uuid"}},required:["brief_id","comment_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},parent_id:{anyOf:[{type:"string"},{type:"null"}]},author:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},email:{type:"string"},kind:{type:"string"}},required:["id","name","kind"]},body:{type:"string"},anchor:{anyOf:[{type:"object",additionalProperties:!1,properties:{field:{type:"string"},quote:{type:"string"},prefix:{type:"string"},suffix:{type:"string"}},required:["field","quote","prefix","suffix"]},{type:"null"}]},resolved_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},resolved_by:{anyOf:[{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},email:{type:"string"},kind:{type:"string"}},required:["id","name","kind"]},{type:"null"}]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"},edited:{type:"boolean"}},required:["id","parent_id","author","body","anchor","resolved_at","resolved_by","created_at","updated_at","edited"]},binding:{path_inputs:{briefId:"brief_id",commentId:"comment_id"},query_inputs:[],body_inputs:["body","resolved"]},contract_sha256:"e0ed79af639d957532bd60e2db903d900bc88cba73d744a53036e2a0171a3f90"},{id:"briefs.fix_packet",version:"1",summary:"Pull the brief's fix packet so your own agent implements the fix in its own checkout, with no credential. A finding a codemod recipe covers gets that recipe, described in transform.recipe_doc; any other finding tied to an agent gets a brief_fix packet carrying the brief, its evidence links and what done means. Either lists the checks to run locally and the ones Caveman runs later. 422 cave_packet_not_local only when the finding has neither an agent nor a recipe; 409 cave_brief_fix_in_gateway when Caveman's gateway owns the fix. Opens no Caveman work and moves no status; report back with fix_report.",method:"POST",path:"/projects/{projectId}/briefs/{briefId}/fix-packet",permissions:["opportunity:write"],scope:"project",access:"write",aliases:["caveman_briefs_write.fix_packet"],input_schema:{type:"object",additionalProperties:!1,properties:{brief_id:{type:"string",pattern:"^([1-9][0-9]{0,8}|[0-9a-fA-F-]{36})$",description:"The brief id or its per-project number."}},required:["brief_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{packet:{type:"object",additionalProperties:!1,properties:{schema_version:{type:"integer"},run_id:{type:"string"},proposal_id:{type:"string"},finding_id:{type:"string"},practice_id:{type:"string"},executor:{type:"string"},safety_class:{type:"string"},runner:{type:"string"},scope:{type:"object",additionalProperties:!1,properties:{repo:{type:"string"},base_sha:{type:"string"},base_branch:{type:"string"},path_globs:{type:["array","null"],items:{type:"string"}},callsite_hints:{type:["array","null"],items:{type:"string"}}},required:["repo","base_sha","base_branch","path_globs","callsite_hints"]},transform:{type:"object",additionalProperties:!1,properties:{recipe_id:{type:"string"},params:{type:["object","null"],additionalProperties:{type:"string"}},prompt_section:{type:"string"},recipe_doc:{type:"string"},profile:{type:"string"}},required:["recipe_id","params","prompt_section"]},oracles:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{name:{type:"string"},command:{type:"string"},note:{type:"string"}},required:["name"]}},budget:{type:"object",additionalProperties:!1,properties:{max_files:{type:"integer"},max_loc:{type:"integer"},max_turns:{type:"integer"},wall_clock_s:{type:"integer"},max_usd:{type:"number"}},required:["max_files","max_loc","max_turns","wall_clock_s","max_usd"]},protected_paths:{type:["array","null"],items:{type:"string"}},hosted_checks:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{name:{type:"string"},command:{type:"string"},note:{type:"string"}},required:["name"]}},gateway:{anyOf:[{type:"object",additionalProperties:!1,properties:{url:{type:"string"},run_key:{type:"string"},model:{type:"string"}},required:["url","run_key"]},{type:"null"}]},pr:{type:"object",additionalProperties:!1,properties:{branch:{type:"string"}},required:["branch"]},verify_only:{type:"boolean"},brief:{anyOf:[{type:"object",additionalProperties:!1,properties:{id:{type:"string"},number:{type:"integer"},title:{type:"string"},scope:{type:"string"},summary_md:{type:"string"},body_md:{type:"string"},evidence:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{n:{type:"integer"},kind:{type:"string"},label:{type:"string"},href:{type:"string"},detail:{type:"string"}},required:["n","kind","label"]}},success:{type:["array","null"],items:{type:"string"}}},required:["id","number","title","scope","summary_md","body_md","evidence","success"]},{type:"null"}]}},required:["schema_version","run_id","proposal_id","finding_id","practice_id","executor","safety_class","runner","scope","transform","oracles","budget","protected_paths","pr"]},skill:{type:"object",additionalProperties:!1,properties:{name:{type:"string"},install:{type:"string"},path:{type:"string"}},required:["name","install","path"]}},required:["packet","skill"]},binding:{path_inputs:{briefId:"brief_id"},query_inputs:[],body_inputs:[]},contract_sha256:"1171cef455099e31292a69d2eaef99c94eab0669f2d8838be169402c4fda4963"},{id:"briefs.fix_report",version:"1",summary:"Report what your agent did with the brief's fix packet: a RunResult v1 bundle with every check in the packet's oracles, plus branch, head_sha and pr_url. The server labels it self_reported whatever the bundle says: candidate when every check your agent could run passed, reverted when one failed. It never counts as savings, never publishes, and reads back as the brief's agent_report.",method:"POST",path:"/projects/{projectId}/briefs/{briefId}/fix-report",permissions:["opportunity:write"],scope:"project",access:"write",aliases:["caveman_briefs_write.fix_report"],input_schema:{type:"object",additionalProperties:!1,properties:{schema_version:{const:1},run_id:{type:"string",pattern:"^[A-Za-z0-9_-]{1,64}$"},runner:{enum:["","recipe","caveman","claude-code","codex"]},outcome:{type:"string"},reason:{type:"string"},evidence_source:{type:"string"},summary:{type:"string"},oracles:{type:"array",minItems:1,items:{type:"object",additionalProperties:!1,properties:{name:{type:"string"},exit:{type:"integer"},duration_ms:{type:"integer"},tail:{type:"string"}},required:["name","exit"]}},changed_files:{type:"array",items:{type:"string"}},loc_added:{type:"integer"},loc_removed:{type:"integer"},injection_observed:{type:"array",items:{type:"string"}},branch:{type:"string",maxLength:255},head_sha:{type:"string"},pr_url:{type:"string",pattern:"^(https://|$)"},brief_id:{type:"string",pattern:"^([1-9][0-9]{0,8}|[0-9a-fA-F-]{36})$",description:"The brief id or its per-project number."}},required:["brief_id","schema_version","run_id","oracles"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},fix_state:{enum:["candidate","reverted"]},fix_state_reason:{type:"string"},evidence_source:{const:"self_reported"},runner:{type:"string"},branch:{type:"string"},run_seq:{type:"integer"},bundle_sha256:{type:"string",pattern:"^[a-f0-9]{64}$"}},required:["id","fix_state","fix_state_reason","evidence_source","runner","branch","run_seq","bundle_sha256"]},binding:{path_inputs:{briefId:"brief_id"},query_inputs:[],body_inputs:["schema_version","run_id","runner","outcome","reason","evidence_source","summary","oracles","changed_files","loc_added","loc_removed","injection_observed","branch","head_sha","pr_url"]},contract_sha256:"a5c79d24ca476b048bf17fe22859bffd8dd343a077e7fcd2dd5001bf029783a6"},{id:"briefs.revision",version:"1",summary:"Read one stored revision of a brief.",method:"GET",path:"/projects/{projectId}/briefs/{briefId}/revisions/{version}",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_briefs.revision"],input_schema:{type:"object",additionalProperties:!1,properties:{brief_id:{type:"string",pattern:"^([1-9][0-9]{0,8}|[0-9a-fA-F-]{36})$",description:"The brief id or its per-project number."},version:{type:"integer",minimum:1}},required:["brief_id","version"]},output_schema:{type:"object",additionalProperties:!1,properties:{brief_id:{type:"string"},version:{type:"integer"},title:{type:"string"},summary_md:{type:"string"},body_md:{type:"string"},sources:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{n:{type:"integer"},kind:{type:"string"},label:{type:"string"},href:{type:"string"},detail:{type:"string"}},required:["n","kind","label"]}},writer_kind:{type:"string"},writer_name:{type:"string"},actor:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},email:{type:"string"},kind:{type:"string"}},required:["id","name","kind"]},created_at:{type:"string",format:"date-time"}},required:["brief_id","version","title","summary_md","body_md","sources","writer_kind","writer_name","actor","created_at"]},binding:{path_inputs:{briefId:"brief_id",version:"version"},query_inputs:[],body_inputs:[]},contract_sha256:"af67cb4e5808a03ca8c181cb67bc27ceca3d05b4a66ea88d760e943e9b22ff6f"},{id:"briefs.summary",version:"1",summary:"Count the project's briefs by status, and the open ones by scout and by assignee.",method:"GET",path:"/projects/{projectId}/briefs/summary",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_briefs.summary"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{by_status:{type:["object","null"],additionalProperties:{type:"integer"}},scouts:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{scout:{type:"string"},label:{type:"string"},open:{type:"integer"}},required:["scout","label","open"]}},assignees:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},open:{type:"integer"}},required:["id","name","open"]}}},required:["by_status","scouts","assignees"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"70251a2e0c4e6f1b0936e7358b7740a9c4fde600bb14d8b302020075288e378c"},{id:"policy.budgets",version:"1",summary:"policy: budgets",method:"GET",path:"/projects/{projectId}/budgets",permissions:["billing:read","policy:draft"],scope:"project",access:"read",aliases:["caveman_policy.budgets"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{soft_usd:{type:"number"},hard_usd:{type:"number"},spend_rate:{type:"object",additionalProperties:!1,properties:{window_seconds:{type:"integer"},per_key_usd:{type:"number"},per_workflow_usd:{type:"number"},soft_block:{type:"boolean"}},required:["window_seconds","per_key_usd","per_workflow_usd","soft_block"]},enforced_spend_usd:{anyOf:[{type:"number"},{type:"null"}]},reserved_usd:{anyOf:[{type:"number"},{type:"null"}]},spend_basis:{type:"string"},spend_rate_alerts_available:{type:"boolean"},spend_rate_alerts_partial:{type:"boolean"},recent_spend_rate_alerts:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{schema:{type:"string"},id:{type:"string"},scope_type:{type:"string"},scope_id:{type:"string"},scope_label:{type:"string"},threshold_usd:{type:"number"},estimated_spend_usd:{type:"number"},window_seconds:{type:"integer"},soft_block:{type:"boolean"},observed_at:{type:"string"},basis:{type:"string"}},required:["schema","id","scope_type","scope_id","scope_label","threshold_usd","estimated_spend_usd","window_seconds","soft_block","observed_at","basis"]}}},required:["soft_usd","hard_usd","spend_rate","enforced_spend_usd","spend_basis","spend_rate_alerts_available","spend_rate_alerts_partial","recent_spend_rate_alerts"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"a51dc31d72238393031b144e47295dcdf195be1772ac9ddf18baeebaeb720e59"},{id:"human.update_budget",version:"1",summary:"human: update_budget",method:"PATCH",path:"/projects/{projectId}/budgets",permissions:["policy:draft"],scope:"project",access:"none",exclusion:"Changes billing, spend ceilings, or the money contract. Human-only regardless of agent competence.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}},body:{type:"object",additionalProperties:!0}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"370c6eb020d1a418ca008dc1d696428310a8fc2613920cd5cdfa9d0b3cf9d482"},{id:"plan.project_plan",version:"1",summary:"plan: project_plan",method:"GET",path:"/projects/{projectId}/cave-plan",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_plan.project_plan"],input_schema:{type:"object",additionalProperties:!1,properties:{from:{type:"string",format:"date-time"},sample_data:{type:"boolean"},to:{type:"string",format:"date-time"},window:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{headline:{type:"object",additionalProperties:!1,properties:{low:{type:"number"},base:{type:"number"},high:{type:"number"},basis:{type:"string"},move_count:{type:"integer"}},required:["low","base","high","basis","move_count"]},headroom_by_class:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{safety_class:{type:"string"},low:{type:"number"},base:{type:"number"},high:{type:"number"},move_count:{type:"integer"}},required:["safety_class","low","base","high","move_count"]}},moves:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{optimizer_id:{type:"string"},title:{type:"string"},family:{type:"string"},safety_class:{type:"string"},basis:{type:"string"},confidence:{type:"string"},quality_risk:{type:"string"},implementation_effort:{type:"string"},requires_eval_gate:{type:"boolean"},enablement_only:{type:"boolean"},scope_count:{type:"integer"},sample_size:{type:"integer"},savings_usd_low:{type:"number"},savings_usd_base:{type:"number"},savings_usd_high:{type:"number"},share_of_headline_pct:{type:"number"},next_action:{type:"string"},apply_capability:{type:"string"},summary:{type:"string"},already_active_note:{type:"string"},top_scopes:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{agent_id:{type:"string"},workflow_id:{type:"string"},agent_name:{type:"string"},workflow_name:{type:"string"},provider:{type:"string"},model:{type:"string"},savings_usd_base:{type:"number"},share_pct:{type:"number"}},required:["savings_usd_base","share_pct"]}},evidence_stage:{type:"string"}},required:["optimizer_id","title","family","safety_class","basis","confidence","quality_risk","implementation_effort","requires_eval_gate","enablement_only","scope_count","sample_size","savings_usd_low","savings_usd_base","savings_usd_high","share_of_headline_pct","next_action","summary"]}},no_signal:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{optimizer_id:{type:"string"},title:{type:"string"},reason_code:{type:"string"},reason:{type:"string"}},required:["optimizer_id","title","reason_code","reason"]}},methodology:{type:"string"},as_of:{type:"string"},detectors_last_ran:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},diagnostics:{type:["array","null"],items:{type:"string"}},scope:{type:"string"},project_id:{type:"string"},since_last:{anyOf:[{type:"object",additionalProperties:!1,properties:{since:{type:"string"},headline_base_delta:{type:"number"},score_delta:{anyOf:[{type:"integer"},{type:"null"}]},new_moves:{type:["array","null"],items:{type:"string"}},applied_moves:{type:["array","null"],items:{type:"string"}},regressed:{type:["array","null"],items:{type:"string"}},invalidated:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{optimizer_id:{type:"string"},reason:{type:"string"}},required:["optimizer_id","reason"]}}},required:["since","headline_base_delta","score_delta","new_moves","applied_moves","regressed","invalidated"]},{type:"null"}]},local_practice_findings:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{practice_id:{type:"string"},title:{type:"string"},sink_id:{type:"string"},basis:{type:"string"},tokens_per_turn:{type:"integer"},tokens_per_day_rate:{type:"integer"},sessions_scanned:{type:"integer"},observed_at:{type:"string",format:"date-time"}},required:["practice_id","title","sink_id","basis","tokens_per_turn","tokens_per_day_rate","sessions_scanned","observed_at"]}}},required:["headline","headroom_by_class","moves","no_signal","methodology","scope","project_id","since_last","local_practice_findings"]},binding:{path_inputs:{},query_inputs:["from","sample_data","to","window"],body_inputs:[]},contract_sha256:"37f2b02fa9cb3154455dac8a583f49f17ff271bd10ce2df5212052a866897b80"},{id:"charts.catalog",version:"1",summary:"Fields, aggregations, presets and data-driven chart suggestions for a dashboard type.",method:"GET",path:"/projects/{projectId}/charts/catalog",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_charts.catalog"],input_schema:{type:"object",additionalProperties:!1,properties:{type:{type:"string"},range:{type:"string"},from:{type:"string",format:"date-time"},to:{type:"string",format:"date-time"},sample_data:{type:"boolean"}}},output_schema:{type:"object",additionalProperties:!1,properties:{type:{enum:["logs","experiments"]},sources:{type:["array","null"],items:{anyOf:[{type:"object",additionalProperties:!1,properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},fields:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{name:{type:"string"},label:{type:"string"},kind:{enum:["string","number","bool"]},unit:{type:"string"},dimension:{type:"boolean"},measure:{type:"boolean"},permission:{type:"string"},high_cardinality:{type:"boolean"},description:{type:"string"}},required:["name","label","kind","dimension","measure","high_cardinality","description"]}},map_fields:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{prefix:{type:"string"},aliases:{type:["array","null"],items:{type:"string"}},description:{type:"string"},permission:{type:"string"}},required:["prefix","aliases","description","permission"]}}},required:["name","label","description","fields","map_fields"]},{type:"null"}]}},aggregations:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{name:{type:"string"},label:{type:"string"},needs_field:{type:"boolean"},description:{type:"string"}},required:["name","label","needs_field","description"]}},presets:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{key:{type:"string"},description:{type:"string"},chart:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},title:{type:"string"},type:{enum:["timeseries","toplist","bignumber"]},source:{enum:["requests","spans","tools","evals"]},preset:{anyOf:[{type:"string"},{type:"null"}]},measures:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{label:{type:"string"},field:{type:"string"},agg:{enum:["count","sum","avg","min","max","count_distinct","percentile"]},p:{type:"number"},expr:{type:"string"}},required:[]}},filters:{type:"object",additionalProperties:!1,properties:{row:{type:"string"},trace:{type:"string"}},required:["row","trace"]},group_by:{type:"string"},options:{type:"object",additionalProperties:!1,properties:{unit:{enum:["duration","cost","count","percent","bytes"]},viz:{enum:["line","bar"]},stacked:{anyOf:[{type:"boolean"},{type:"null"}]},interval:{enum:["auto","hour","day","week"]},sort:{enum:["value_desc","value_asc","name_asc","name_desc"]},limit:{type:"integer"}},required:[]},layout:{type:"object",additionalProperties:!1,properties:{w:{enum:[3,4,6,8,12]},h:{enum:[1,2,3]}},required:["w","h"]},section_id:{anyOf:[{type:"string"},{type:"null"}]}},required:["id","title","type","source","measures","filters","group_by","options","layout"]}},required:["key","description","chart"]}},suggestions:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{chart:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},title:{type:"string"},type:{enum:["timeseries","toplist","bignumber"]},source:{enum:["requests","spans","tools","evals"]},preset:{anyOf:[{type:"string"},{type:"null"}]},measures:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{label:{type:"string"},field:{type:"string"},agg:{enum:["count","sum","avg","min","max","count_distinct","percentile"]},p:{type:"number"},expr:{type:"string"}},required:[]}},filters:{type:"object",additionalProperties:!1,properties:{row:{type:"string"},trace:{type:"string"}},required:["row","trace"]},group_by:{type:"string"},options:{type:"object",additionalProperties:!1,properties:{unit:{enum:["duration","cost","count","percent","bytes"]},viz:{enum:["line","bar"]},stacked:{anyOf:[{type:"boolean"},{type:"null"}]},interval:{enum:["auto","hour","day","week"]},sort:{enum:["value_desc","value_asc","name_asc","name_desc"]},limit:{type:"integer"}},required:[]},layout:{type:"object",additionalProperties:!1,properties:{w:{enum:[3,4,6,8,12]},h:{enum:[1,2,3]}},required:["w","h"]},section_id:{anyOf:[{type:"string"},{type:"null"}]}},required:["id","title","type","source","measures","filters","group_by","options","layout"]},reason:{type:"string"}},required:["chart","reason"]}},tag_keys:{type:["array","null"],items:{type:"string"}}},required:["type","sources","aggregations","presets","suggestions","tag_keys"]},binding:{path_inputs:{},query_inputs:["type","range","from","to","sample_data"],body_inputs:[]},contract_sha256:"014f278521da502d5765a676255a94e2d16e85e173befe103931817d1b469c6b"},{id:"charts.query",version:"1",summary:"Run a chart spec over a range and return its series, totals, units, warnings and notices.",method:"POST",path:"/projects/{projectId}/charts/query",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_charts.query"],input_schema:{type:"object",additionalProperties:!1,properties:{chart:{type:"object",additionalProperties:!1,properties:{id:{type:"string",pattern:"^[A-Za-z0-9_-]{1,64}$"},title:{type:"string",minLength:1,maxLength:120},type:{enum:["timeseries","toplist","bignumber"]},source:{enum:["requests","spans","tools","evals"]},preset:{type:["string","null"]},measures:{type:"array",items:{type:"object",additionalProperties:!1,properties:{label:{type:"string"},field:{type:"string"},agg:{enum:["count","sum","avg","min","max","count_distinct","percentile"]},p:{type:"number",exclusiveMinimum:0,exclusiveMaximum:1},expr:{type:"string",maxLength:2e3}}},minItems:1,maxItems:6},filters:{type:"object",additionalProperties:!1,properties:{row:{type:"string",maxLength:2e3},trace:{type:"string",maxLength:2e3}}},group_by:{type:"string"},options:{type:"object",additionalProperties:!1,properties:{unit:{enum:["duration","cost","count","percent","bytes"]},viz:{enum:["line","bar"]},stacked:{type:"boolean"},interval:{enum:["auto","hour","day","week"]},sort:{enum:["value_desc","value_asc","name_asc","name_desc"]},limit:{type:"integer",minimum:1,maximum:50}}},layout:{type:"object",additionalProperties:!1,properties:{w:{enum:[3,4,6,8,12]},h:{enum:[1,2,3]}},required:["w","h"]},section_id:{type:["string","null"]}},required:["title","type","source","measures"]},range:{type:"object",additionalProperties:!1,properties:{preset:{enum:["1h","6h","24h","3d","7d","14d","30d","60d","90d"]},from:{type:"string",format:"date-time"},to:{type:"string",format:"date-time"}}},dashboard:{type:"object",additionalProperties:!1,properties:{filters:{type:"array",items:{type:"string",maxLength:2e3},maxItems:20},search:{type:"string",maxLength:200},group_by:{type:"string"}}},sample_data:{type:"boolean"}},required:["chart","range"]},output_schema:{type:"object",additionalProperties:!1,properties:{type:{enum:["timeseries","toplist","bignumber"]},window:{type:"object",additionalProperties:!1,properties:{from:{type:"string"},to:{type:"string"}},required:["from","to"]},interval:{enum:["1m","5m","15m","30m","1h","3h","12h","1d","1w"]},buckets:{type:["array","null"],items:{type:"string"}},series:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{key:{type:"string"},measure:{type:"integer"},group:{anyOf:[{type:"string"},{type:"null"}]},label:{type:"string"},total:{anyOf:[{type:"number"},{type:"null"}]},points:{type:["array","null"],items:{anyOf:[{type:"number"},{type:"null"}]}},previous:{anyOf:[{type:"number"},{type:"null"}]}},required:["key","measure","group","label","total"]}},overall:{type:["array","null"],items:{anyOf:[{type:"number"},{type:"null"}]}},groups_total:{anyOf:[{type:"integer"},{type:"null"}]},other:{type:"boolean"},units:{type:["array","null"],items:{enum:["duration","cost","count","percent","bytes"]}},warnings:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{target:{type:"string"},message:{type:"string"}},required:["target","message"]}},notices:{type:["array","null"],items:{type:"string"}},group_by:{type:"string"},group_kind:{enum:["","string","number","bool"]}},required:["type","window","series","overall","units","warnings","notices","group_by","group_kind"]},binding:{path_inputs:{},query_inputs:["sample_data"],body_inputs:["chart","range","dashboard"]},contract_sha256:"066c801db1ccacf432d44d148c1e6e680eb4f596f1daaff0c4b394b17ea37ea6"},{id:"charts.samples",version:"1",summary:"List the traces behind a chart, a group or a point's range.",method:"POST",path:"/projects/{projectId}/charts/samples",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_charts.samples"],input_schema:{type:"object",additionalProperties:!1,properties:{chart:{type:"object",additionalProperties:!1,properties:{id:{type:"string",pattern:"^[A-Za-z0-9_-]{1,64}$"},title:{type:"string",minLength:1,maxLength:120},type:{enum:["timeseries","toplist","bignumber"]},source:{enum:["requests","spans","tools","evals"]},preset:{type:["string","null"]},measures:{type:"array",items:{type:"object",additionalProperties:!1,properties:{label:{type:"string"},field:{type:"string"},agg:{enum:["count","sum","avg","min","max","count_distinct","percentile"]},p:{type:"number",exclusiveMinimum:0,exclusiveMaximum:1},expr:{type:"string",maxLength:2e3}}},minItems:1,maxItems:6},filters:{type:"object",additionalProperties:!1,properties:{row:{type:"string",maxLength:2e3},trace:{type:"string",maxLength:2e3}}},group_by:{type:"string"},options:{type:"object",additionalProperties:!1,properties:{unit:{enum:["duration","cost","count","percent","bytes"]},viz:{enum:["line","bar"]},stacked:{type:"boolean"},interval:{enum:["auto","hour","day","week"]},sort:{enum:["value_desc","value_asc","name_asc","name_desc"]},limit:{type:"integer",minimum:1,maximum:50}}},layout:{type:"object",additionalProperties:!1,properties:{w:{enum:[3,4,6,8,12]},h:{enum:[1,2,3]}},required:["w","h"]},section_id:{type:["string","null"]}},required:["title","type","source","measures"]},range:{type:"object",additionalProperties:!1,properties:{preset:{enum:["1h","6h","24h","3d","7d","14d","30d","60d","90d"]},from:{type:"string",format:"date-time"},to:{type:"string",format:"date-time"}}},dashboard:{type:"object",additionalProperties:!1,properties:{filters:{type:"array",items:{type:"string",maxLength:2e3},maxItems:20},search:{type:"string",maxLength:200},group_by:{type:"string"}}},group:{type:["string","null"]},limit:{type:"integer",minimum:1,maximum:100},sample_data:{type:"boolean"}},required:["chart","range"]},output_schema:{type:"object",additionalProperties:!1,properties:{matched_rows:{type:"integer"},matched_traces:{type:"integer"},traces:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{trace_id:{type:"string"},timestamp:{type:"string"},label:{type:"string"},model:{type:"string"},workflow:{type:"string"},rows:{type:"integer"},cost:{anyOf:[{type:"number"},{type:"null"}]},latency_ms:{anyOf:[{type:"number"},{type:"null"}]},status_code:{anyOf:[{type:"integer"},{type:"null"}]},error:{anyOf:[{type:"boolean"},{type:"null"}]}},required:["trace_id","timestamp","label","rows"]}}},required:["matched_rows","matched_traces","traces"]},binding:{path_inputs:{},query_inputs:["sample_data"],body_inputs:["chart","range","dashboard","group","limit"]},contract_sha256:"003bb575b438d069124f5a94ebf40f4c8abb2f292c06ff96b75f3bced59ba076"},{id:"charts.values",version:"1",summary:"Top values of a field, or ready filter expressions when no field is given.",method:"GET",path:"/projects/{projectId}/charts/values",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_charts.values"],input_schema:{type:"object",additionalProperties:!1,properties:{source:{type:"string"},field:{type:"string"},q:{type:"string"},range:{type:"string"},from:{type:"string",format:"date-time"},to:{type:"string",format:"date-time"},limit:{type:"integer",minimum:0},sample_data:{type:"boolean"}}},output_schema:{type:"object",additionalProperties:!1,properties:{values:{anyOf:[{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{value:{type:"string"},count:{type:"integer"}},required:["value","count"]}},{type:"null"}]},suggestions:{anyOf:[{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{field:{type:"string"},value:{type:"string"},count:{type:"integer"},expr:{type:"string"}},required:["field","value","count","expr"]}},{type:"null"}]}},required:[]},binding:{path_inputs:{},query_inputs:["source","field","q","range","from","to","limit","sample_data"],body_inputs:[]},contract_sha256:"c07e4a45791dac4f4f10a9c51188b3d6b96a1efdf63cf62acca297eec49b74a0"},{id:"ci.start",version:"1",summary:"Start a CI run by hand and mint its key.",method:"POST",path:"/projects/{projectId}/ci/runs",permissions:["experiment:run"],scope:"project",access:"none",exclusion:"Mints a spend-capped gateway key returned once to the caller. An agent must never mint credentials (the boundary POST /keys keeps).",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{event:{enum:["pull_request","push","merge_group"]},pr_number:{type:"integer",minimum:1},base_sha:{type:"string"},base_ref:{type:"string"},job:{type:"string",pattern:"^[A-Za-z0-9_-]{1,100}$"},suite:{type:"object",additionalProperties:!1,properties:{name:{type:"string",maxLength:100},matrix:{type:"object"},test_ids_sha256:{type:"string",pattern:"^[a-f0-9]{64}$"},lockfile_sha256:{type:"string",pattern:"^[a-f0-9]{64}$"}}},max_usd:{type:"number",minimum:0},fork:{type:"boolean"},request_id:{type:"string",format:"uuid"},repository_id:{type:"integer",minimum:1},sha:{type:"string",pattern:"^[0-9a-f]{40}$"},ref:{type:"string"},run_id:{type:"string",pattern:"^[0-9]{1,20}$"},run_attempt:{type:"integer",minimum:1}},required:["request_id","event","job","repository_id","sha","ref","run_id","run_attempt"]},output_schema:{type:"object",additionalProperties:!0},binding:{path_inputs:{},query_inputs:[],body_inputs:["event","pr_number","base_sha","base_ref","job","suite","max_usd","fork","request_id","repository_id","sha","ref","run_id","run_attempt"]},idempotency:"request_id",contract_sha256:"c70bab039af16a1f381d42b32b5162d5a66800bc0156095368b2b24bc42a9cda"},{id:"ci.finish",version:"1",summary:"Finish a CI run with its JUnit results.",method:"POST",path:"/projects/{projectId}/ci/runs/{runId}/finish",permissions:["experiment:run"],scope:"project",access:"none",exclusion:"Reads or completes a run whose key was minted to a person or a CI identity. Agents read its verdict through verdicts.get.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{status:{enum:["completed","failed","cancelled"]},junit:{type:"array",items:{type:"string"},maxItems:20},run_id:{type:"string",format:"uuid"}},required:["run_id","status"]},output_schema:{type:"object",additionalProperties:!0},binding:{path_inputs:{runId:"run_id"},query_inputs:[],body_inputs:["status","junit"]},contract_sha256:"962bd166cc75629655f16720f7171b5fde37116ce4474d8c47468a3dc086e1a2"},{id:"ci.set_checks",version:"1",summary:"Turn CI checks on or off for the project's repository.",method:"PUT",path:"/projects/{projectId}/ci/settings",permissions:["experiment:approve_s3"],scope:"project",access:"none",exclusion:"Turning CI checks on lets the bound repository's workflows mint spend-capped gateway keys. It is an audited owner or admin decision.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{checks_enabled:{type:"boolean"}},required:["checks_enabled"]},output_schema:{type:"object",additionalProperties:!0},binding:{path_inputs:{},query_inputs:[],body_inputs:["checks_enabled"]},contract_sha256:"07618e486a449711e1488e9b90ed97ed711137fa3037ca3e465b2c85d80feac4"},{id:"ci.suites",version:"1",summary:"CI suites, their mode, whether they can gate, and whether GitHub has approved checks.",method:"GET",path:"/projects/{projectId}/ci/suites",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_quality.ci_suites"],input_schema:{type:"object",additionalProperties:!1,properties:{cursor:{type:"string"},limit:{type:"integer",minimum:0}}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{fingerprint:{type:"string",pattern:"^[a-f0-9]{64}$"},name:{type:"string"},repo:{type:"string"},workflow:{type:"string"},job:{type:"string"},tests:{type:"integer"},llm_tests:{type:"integer"},mode:{enum:["advisory","gate"]},eligible:{type:"boolean"},needed_llm_tests:{type:"integer"},margin_pp:{type:"number"},last_run:{anyOf:[{type:"object",additionalProperties:!1,properties:{ref:{type:"object",additionalProperties:!1,properties:{source:{type:"string"},run_id:{type:"string"}},required:["source","run_id"]},workload:{anyOf:[{type:"object",additionalProperties:!1,properties:{id:{type:"string"},slug:{anyOf:[{type:"string"},{type:"null"}]},display_name:{type:"string"},agent_id:{anyOf:[{type:"string"},{type:"null"}]}},required:["id","slug","display_name","agent_id"]},{type:"null"}]},label:{type:"string"},executor:{type:"string"},state:{type:"string"},verdict:{anyOf:[{type:"string"},{type:"null"}]},reason:{type:"string"},sentence:{type:"string"},quality:{anyOf:[{type:"object",additionalProperties:!1,properties:{estimate:{type:"number"},lower:{type:"number"},upper:{type:"number"}},required:["estimate","lower","upper"]},{type:"null"}]},cost:{anyOf:[{type:"object",additionalProperties:!1,properties:{estimate:{type:"number"},lower:{type:"number"},upper:{type:"number"}},required:["estimate","lower","upper"]},{type:"null"}]},cost_rung:{anyOf:[{type:"string"},{type:"null"}]},paired_cases:{type:"integer"},look:{type:"integer"},started_at:{type:"string",format:"date-time"},computed_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},proving_cost:{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]},decision:{type:"string"},pr:{anyOf:[{type:"object",additionalProperties:!1,properties:{repo:{type:"string"},number:{type:"integer"},sha:{type:"string"}},required:["repo","number","sha"]},{type:"null"}]},gate:{anyOf:[{type:"object",additionalProperties:!1,properties:{mode:{type:"string"},conclusion:{type:"string"}},required:["mode","conclusion"]},{type:"null"}]}},required:["ref","workload","label","executor","state","verdict","reason","sentence","quality","cost","cost_rung","paired_cases","look","started_at","computed_at","proving_cost","decision","pr","gate"]},{type:"null"}]},revision:{type:"integer"}},required:["fingerprint","name","repo","workflow","job","tests","llm_tests","mode","eligible","needed_llm_tests","margin_pp","last_run","revision"]}},next_cursor:{type:["string","null"]},checks_enabled:{type:"boolean"},github:{type:"object",additionalProperties:!1,properties:{app:{enum:["installed","not_installed"]},checks:{enum:["granted","needs_approval"]},review_url:{type:["string","null"]}},required:["app","checks","review_url"]}},required:["data","next_cursor","checks_enabled","github"]},binding:{path_inputs:{},query_inputs:["cursor","limit"],body_inputs:[]},contract_sha256:"13d83120d06dea03bcf83ad6846c03875998865a1255b1e737285a5281a3ed97"},{id:"ci.set_mode",version:"1",summary:"Switch a CI suite between advisory and gate.",method:"PUT",path:"/projects/{projectId}/ci/suites/{suiteFingerprint}/mode",permissions:["experiment:approve_s3"],scope:"project",access:"none",exclusion:"Gate mode blocks merges. Changing it is an audited owner or admin decision (SPEC \xA74.12).",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{mode:{enum:["advisory","gate"]},revision:{type:"integer",minimum:1},suite_fingerprint:{type:"string",pattern:"^[a-f0-9]{64}$"}},required:["suite_fingerprint","mode","revision"]},output_schema:{type:"object",additionalProperties:!0},binding:{path_inputs:{suiteFingerprint:"suite_fingerprint"},query_inputs:[],body_inputs:["mode","revision"]},contract_sha256:"c6100196f68933e57aa240cd07e1b6a17eaa3cdb564d20e6535252e9f53dbac9"},{id:"human.connectors",version:"1",summary:"human: connectors",method:"GET",path:"/projects/{projectId}/connectors",permissions:["org:read"],scope:"project",access:"none",exclusion:"Connector rows exist to manage stored admin credentials. Agents never handle or enumerate credential state; the usage they sync is readable through the reports surfaces.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"e953e5546061503d833484ff784ea36d1a0fc92edde420e47e2d45541aae2c09"},{id:"fixes.latest_improvement_report",version:"1",summary:"fixes: latest_improvement_report",method:"GET",path:"/projects/{projectId}/continuous-improvement",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_fixes.latest_improvement_report"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},schema_version:{type:"string"},report_sha256:{type:"string"},previous_report_sha256:{anyOf:[{type:"string"},{type:"null"}]},record_sha256:{type:"string"},report:{},generated_at:{type:"string",format:"date-time"},created_at:{type:"string",format:"date-time"}},required:["id","organization_id","project_id","schema_version","report_sha256","previous_report_sha256","record_sha256","report","generated_at","created_at"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"5425db90371f71e1ee189e1b953aa6120766c7cd5ed9d3c7144c812d359fa21e"},{id:"fixes.get_improvement_report",version:"1",summary:"fixes: get_improvement_report",method:"GET",path:"/projects/{projectId}/continuous-improvement/{reportId}",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_fixes.get_improvement_report"],input_schema:{type:"object",additionalProperties:!1,properties:{report_id:{type:"string",format:"uuid"}},required:["report_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},schema_version:{type:"string"},report_sha256:{type:"string"},previous_report_sha256:{anyOf:[{type:"string"},{type:"null"}]},record_sha256:{type:"string"},report:{},generated_at:{type:"string",format:"date-time"},created_at:{type:"string",format:"date-time"}},required:["id","organization_id","project_id","schema_version","report_sha256","previous_report_sha256","record_sha256","report","generated_at","created_at"]},binding:{path_inputs:{reportId:"report_id"},query_inputs:[],body_inputs:[]},contract_sha256:"d6a2d4eeb947f1afeba526c3ede9176802676202285cdef032760e3682ec0fa5"},{id:"human.replay_continuous_report",version:"1",summary:"human: replay_continuous_report",method:"POST",path:"/projects/{projectId}/continuous-improvement/{reportId}/replay",permissions:["experiment:run"],scope:"project",access:"none",exclusion:"Replays recorded traffic against a provider, which spends real money and is gated on replay consent.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{parameters:{type:"object",additionalProperties:!1,properties:{reportId:{type:"string"}},required:["reportId"]},query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}},body:{type:"object",additionalProperties:!0}},required:["parameters"]},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"b6aff7c47f0c68b177a5a3161d3ca8940f28232127dc2c9e58167318fabbb990"},{id:"human.reconcile_continuous_replay",version:"1",summary:"human: reconcile_continuous_replay",method:"POST",path:"/projects/{projectId}/continuous-improvement/{reportId}/replay/{jobId}/reconcile",permissions:["experiment:run"],scope:"project",access:"none",exclusion:"Replays recorded traffic against a provider, which spends real money and is gated on replay consent.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{parameters:{type:"object",additionalProperties:!1,properties:{reportId:{type:"string"},jobId:{type:"string"}},required:["reportId","jobId"]},query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}},body:{type:"object",additionalProperties:!0}},required:["parameters"]},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"d1c21a4ada9aad5c891aee4b1cdc8440aa3f993f911c45589bbca9e6949892b1"},{id:"criteria.list",version:"1",summary:"Criteria with their trust, 7-day pass rate and daily cost.",method:"GET",path:"/projects/{projectId}/criteria",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_quality.list_criteria"],input_schema:{type:"object",additionalProperties:!1,properties:{workload_id:{type:"string"},trust:{type:"string"},gating:{type:"string"},state:{type:"string"},cursor:{type:"string"},limit:{type:"integer",minimum:0}}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},version:{type:"integer"},revision:{type:"integer"},workload:{anyOf:[{type:"object",additionalProperties:!1,properties:{id:{type:"string"},slug:{anyOf:[{type:"string"},{type:"null"}]},display_name:{type:"string"},agent_id:{anyOf:[{type:"string"},{type:"null"}]}},required:["id","slug","display_name","agent_id"]},{type:"null"}]},scope:{type:"string"},level:{type:"string"},kind:{type:"string"},label:{type:"string"},statement:{anyOf:[{type:"string"},{type:"null"}]},pass_def:{anyOf:[{type:"string"},{type:"null"}]},fail_def:{anyOf:[{type:"string"},{type:"null"}]},na_def:{anyOf:[{type:"string"},{type:"null"}]},selector:{},params:{},code:{anyOf:[{type:"object",additionalProperties:!1,properties:{ref:{type:"string"},sha256:{type:"string"}},required:["ref","sha256"]},{type:"null"}]},provenance:{type:"object",additionalProperties:!1,properties:{author:{enum:["eval_engineer","agent_connection","person","imported"]},motivating_units:{}},required:["author","motivating_units"]},state:{type:"string"},gating:{type:"boolean"},trust:{type:"object",additionalProperties:!1,properties:{state:{type:"string"},trusted_for:{anyOf:[{type:"string"},{type:"null"}]},sentence:{type:"string"}},required:["state","trusted_for","sentence"]},pass_rate_7d:{anyOf:[{type:"object",additionalProperties:!1,properties:{value:{type:"number"},n:{type:"integer"},lower:{type:"number"},upper:{type:"number"}},required:["value","n","lower","upper"]},{type:"null"}]},judged_7d:{type:"integer"},cost_per_day:{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]},judge:{type:"object",additionalProperties:!1,properties:{wire:{anyOf:[{type:"string"},{type:"null"}]},model_id:{anyOf:[{type:"string"},{type:"null"}]},family:{anyOf:[{type:"string"},{type:"null"}]},judge_id:{anyOf:[{type:"string"},{type:"null"}]}},required:["wire","model_id","family","judge_id"]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"}},required:["id","version","revision","workload","scope","level","kind","label","statement","pass_def","fail_def","na_def","selector","params","code","provenance","state","gating","trust","pass_rate_7d","judged_7d","cost_per_day","judge","created_at","updated_at"]}},next_cursor:{type:["string","null"]}},required:["data","next_cursor"]},binding:{path_inputs:{},query_inputs:["workload_id","trust","gating","state","cursor","limit"],body_inputs:[]},contract_sha256:"dd0574bc93989dbe3c118e9464e8f29c20eb3e694902d8fd802e982ff9d99f2d"},{id:"criteria.get",version:"1",summary:"One criterion: its statement, definitions, judge and trust.",method:"GET",path:"/projects/{projectId}/criteria/{criterionId}",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_quality.get_criterion"],input_schema:{type:"object",additionalProperties:!1,properties:{version:{type:"string"},criterion_id:{type:"string",format:"uuid"}},required:["criterion_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},version:{type:"integer"},revision:{type:"integer"},workload:{anyOf:[{type:"object",additionalProperties:!1,properties:{id:{type:"string"},slug:{anyOf:[{type:"string"},{type:"null"}]},display_name:{type:"string"},agent_id:{anyOf:[{type:"string"},{type:"null"}]}},required:["id","slug","display_name","agent_id"]},{type:"null"}]},scope:{type:"string"},level:{type:"string"},kind:{type:"string"},label:{type:"string"},statement:{anyOf:[{type:"string"},{type:"null"}]},pass_def:{anyOf:[{type:"string"},{type:"null"}]},fail_def:{anyOf:[{type:"string"},{type:"null"}]},na_def:{anyOf:[{type:"string"},{type:"null"}]},selector:{},params:{},code:{anyOf:[{type:"object",additionalProperties:!1,properties:{ref:{type:"string"},sha256:{type:"string"}},required:["ref","sha256"]},{type:"null"}]},provenance:{type:"object",additionalProperties:!1,properties:{author:{enum:["eval_engineer","agent_connection","person","imported"]},motivating_units:{}},required:["author","motivating_units"]},state:{type:"string"},gating:{type:"boolean"},trust:{type:"object",additionalProperties:!1,properties:{state:{type:"string"},trusted_for:{anyOf:[{type:"string"},{type:"null"}]},sentence:{type:"string"}},required:["state","trusted_for","sentence"]},pass_rate_7d:{anyOf:[{type:"object",additionalProperties:!1,properties:{value:{type:"number"},n:{type:"integer"},lower:{type:"number"},upper:{type:"number"}},required:["value","n","lower","upper"]},{type:"null"}]},judged_7d:{type:"integer"},cost_per_day:{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]},judge:{type:"object",additionalProperties:!1,properties:{wire:{anyOf:[{type:"string"},{type:"null"}]},model_id:{anyOf:[{type:"string"},{type:"null"}]},family:{anyOf:[{type:"string"},{type:"null"}]},judge_id:{anyOf:[{type:"string"},{type:"null"}]}},required:["wire","model_id","family","judge_id"]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"}},required:["id","version","revision","workload","scope","level","kind","label","statement","pass_def","fail_def","na_def","selector","params","code","provenance","state","gating","trust","pass_rate_7d","judged_7d","cost_per_day","judge","created_at","updated_at"]},binding:{path_inputs:{criterionId:"criterion_id"},query_inputs:["version"],body_inputs:[]},contract_sha256:"b226f76b4c0e7581e8f38a6230417131423d2cf3a14254f1cfc369cfee127778"},{id:"criteria.edit",version:"1",summary:"Edit a criterion as a new version that requalifies.",method:"PATCH",path:"/projects/{projectId}/criteria/{criterionId}",permissions:["eval:write"],scope:"project",access:"none",exclusion:"Criteria are the fixed scoring an improving agent is held to (ADR 0050). An agent must not edit or drop what it is scored on; it proposes, and a person changes them.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{revision:{type:"integer",minimum:1},statement:{type:"string",maxLength:500},pass_def:{type:"string"},fail_def:{type:"string"},na_def:{type:"string"},params:{type:"object"},gating:{type:"boolean"},criterion_id:{type:"string",format:"uuid"}},required:["criterion_id","revision"]},output_schema:{type:"object",additionalProperties:!1,properties:{criterion:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},version:{type:"integer"},revision:{type:"integer"},workload:{anyOf:[{type:"object",additionalProperties:!1,properties:{id:{type:"string"},slug:{anyOf:[{type:"string"},{type:"null"}]},display_name:{type:"string"},agent_id:{anyOf:[{type:"string"},{type:"null"}]}},required:["id","slug","display_name","agent_id"]},{type:"null"}]},scope:{type:"string"},level:{type:"string"},kind:{type:"string"},label:{type:"string"},statement:{anyOf:[{type:"string"},{type:"null"}]},pass_def:{anyOf:[{type:"string"},{type:"null"}]},fail_def:{anyOf:[{type:"string"},{type:"null"}]},na_def:{anyOf:[{type:"string"},{type:"null"}]},selector:{},params:{},code:{anyOf:[{type:"object",additionalProperties:!1,properties:{ref:{type:"string"},sha256:{type:"string"}},required:["ref","sha256"]},{type:"null"}]},provenance:{type:"object",additionalProperties:!1,properties:{author:{enum:["eval_engineer","agent_connection","person","imported"]},motivating_units:{}},required:["author","motivating_units"]},state:{type:"string"},gating:{type:"boolean"},trust:{type:"object",additionalProperties:!1,properties:{state:{type:"string"},trusted_for:{anyOf:[{type:"string"},{type:"null"}]},sentence:{type:"string"}},required:["state","trusted_for","sentence"]},pass_rate_7d:{anyOf:[{type:"object",additionalProperties:!1,properties:{value:{type:"number"},n:{type:"integer"},lower:{type:"number"},upper:{type:"number"}},required:["value","n","lower","upper"]},{type:"null"}]},judged_7d:{type:"integer"},cost_per_day:{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]},judge:{type:"object",additionalProperties:!1,properties:{wire:{anyOf:[{type:"string"},{type:"null"}]},model_id:{anyOf:[{type:"string"},{type:"null"}]},family:{anyOf:[{type:"string"},{type:"null"}]},judge_id:{anyOf:[{type:"string"},{type:"null"}]}},required:["wire","model_id","family","judge_id"]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"}},required:["id","version","revision","workload","scope","level","kind","label","statement","pass_def","fail_def","na_def","selector","params","code","provenance","state","gating","trust","pass_rate_7d","judged_7d","cost_per_day","judge","created_at","updated_at"]},diff:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{field:{type:"string"},before:{anyOf:[{type:"string"},{type:"null"}]},after:{anyOf:[{type:"string"},{type:"null"}]}},required:["field","before","after"]}},qualification_id:{type:["string","null"]}},required:["criterion","diff","qualification_id"]},binding:{path_inputs:{criterionId:"criterion_id"},query_inputs:[],body_inputs:["revision","statement","pass_def","fail_def","na_def","params","gating"]},contract_sha256:"946cd985c197a08efcf1fadafab234f09029b34485d615f4c1b70c69a9c89405"},{id:"criteria.skip",version:"1",summary:"Stop or restore grading a criterion.",method:"POST",path:"/projects/{projectId}/criteria/{criterionId}/skip",permissions:["eval:write"],scope:"project",access:"none",exclusion:"Criteria are the fixed scoring an improving agent is held to (ADR 0050). An agent must not edit or drop what it is scored on; it proposes, and a person changes them.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{revision:{type:"integer",minimum:1},action:{enum:["skip","restore"]},reason:{type:"string",maxLength:280},criterion_id:{type:"string",format:"uuid"}},required:["criterion_id","revision","action"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},version:{type:"integer"},revision:{type:"integer"},workload:{anyOf:[{type:"object",additionalProperties:!1,properties:{id:{type:"string"},slug:{anyOf:[{type:"string"},{type:"null"}]},display_name:{type:"string"},agent_id:{anyOf:[{type:"string"},{type:"null"}]}},required:["id","slug","display_name","agent_id"]},{type:"null"}]},scope:{type:"string"},level:{type:"string"},kind:{type:"string"},label:{type:"string"},statement:{anyOf:[{type:"string"},{type:"null"}]},pass_def:{anyOf:[{type:"string"},{type:"null"}]},fail_def:{anyOf:[{type:"string"},{type:"null"}]},na_def:{anyOf:[{type:"string"},{type:"null"}]},selector:{},params:{},code:{anyOf:[{type:"object",additionalProperties:!1,properties:{ref:{type:"string"},sha256:{type:"string"}},required:["ref","sha256"]},{type:"null"}]},provenance:{type:"object",additionalProperties:!1,properties:{author:{enum:["eval_engineer","agent_connection","person","imported"]},motivating_units:{}},required:["author","motivating_units"]},state:{type:"string"},gating:{type:"boolean"},trust:{type:"object",additionalProperties:!1,properties:{state:{type:"string"},trusted_for:{anyOf:[{type:"string"},{type:"null"}]},sentence:{type:"string"}},required:["state","trusted_for","sentence"]},pass_rate_7d:{anyOf:[{type:"object",additionalProperties:!1,properties:{value:{type:"number"},n:{type:"integer"},lower:{type:"number"},upper:{type:"number"}},required:["value","n","lower","upper"]},{type:"null"}]},judged_7d:{type:"integer"},cost_per_day:{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]},judge:{type:"object",additionalProperties:!1,properties:{wire:{anyOf:[{type:"string"},{type:"null"}]},model_id:{anyOf:[{type:"string"},{type:"null"}]},family:{anyOf:[{type:"string"},{type:"null"}]},judge_id:{anyOf:[{type:"string"},{type:"null"}]}},required:["wire","model_id","family","judge_id"]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"}},required:["id","version","revision","workload","scope","level","kind","label","statement","pass_def","fail_def","na_def","selector","params","code","provenance","state","gating","trust","pass_rate_7d","judged_7d","cost_per_day","judge","created_at","updated_at"]},binding:{path_inputs:{criterionId:"criterion_id"},query_inputs:[],body_inputs:["revision","action","reason"]},contract_sha256:"59050c6d88a6a7fcb1e46d333b3fdf522daaf7cc19de7e33ad5ce93c695100fa"},{id:"spot_checks.next",version:"1",summary:"Start or resume a blind 20-item spot check.",method:"POST",path:"/projects/{projectId}/criteria/{criterionId}/spot-check",permissions:["payload:read"],scope:"project",access:"none",exclusion:"Spot-check labels are human gold anchors for judge trust (SPEC \xA74.6). An agent cannot stand in for a human reviewer.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{criterion_id:{type:"string",format:"uuid"}},required:["criterion_id"]},output_schema:{type:"object",additionalProperties:!0},binding:{path_inputs:{criterionId:"criterion_id"},query_inputs:[],body_inputs:[]},contract_sha256:"0581f6e609183bd4ac7a490d90bcd2c8e5693dddc65411af120445fe021c539d"},{id:"criteria.trust",version:"1",summary:"How far a criterion's judge is trusted: catch rate, false alarms, consistency, anchors, drift.",method:"GET",path:"/projects/{projectId}/criteria/{criterionId}/trust",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_quality.criterion_trust"],input_schema:{type:"object",additionalProperties:!1,properties:{criterion_id:{type:"string",format:"uuid"}},required:["criterion_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{criterion_id:{type:"string"},version:{type:"integer"},trust:{type:"object",additionalProperties:!1,properties:{state:{type:"string"},trusted_for:{anyOf:[{type:"string"},{type:"null"}]},sentence:{type:"string"}},required:["state","trusted_for","sentence"]},measurements:{type:"object",additionalProperties:!1,properties:{tpr:{anyOf:[{type:"object",additionalProperties:!1,properties:{value:{type:"number"},n:{type:"integer"},lower:{type:"number"},upper:{type:"number"}},required:["value","n","lower","upper"]},{type:"null"}]},tnr:{anyOf:[{type:"object",additionalProperties:!1,properties:{value:{type:"number"},n:{type:"integer"},lower:{type:"number"},upper:{type:"number"}},required:["value","n","lower","upper"]},{type:"null"}]},order_consistency:{anyOf:[{type:"object",additionalProperties:!1,properties:{value:{type:"number"},n:{type:"integer"},lower:{type:"number"},upper:{type:"number"}},required:["value","n","lower","upper"]},{type:"null"}]},repeat_stability:{anyOf:[{type:"object",additionalProperties:!1,properties:{value:{type:"number"},n:{type:"integer"},lower:{type:"number"},upper:{type:"number"}},required:["value","n","lower","upper"]},{type:"null"}]},aa_drift:{anyOf:[{type:"number"},{type:"null"}]},coverage:{anyOf:[{type:"object",additionalProperties:!1,properties:{value:{type:"number"},n:{type:"integer"},lower:{type:"number"},upper:{type:"number"}},required:["value","n","lower","upper"]},{type:"null"}]},calibration_error:{anyOf:[{type:"number"},{type:"null"}]},kappa:{anyOf:[{type:"number"},{type:"null"}]}},required:["tpr","tnr","order_consistency","repeat_stability","aa_drift","coverage","calibration_error","kappa"]},anchors:{type:"object",additionalProperties:!1,properties:{planted_failures:{type:"integer"},pass_assertions:{type:"integer"},pass_outcomes:{type:"integer"},pass_human:{type:"integer"},from_annotations:{type:"integer"},minimum:{type:"integer"}},required:["planted_failures","pass_assertions","pass_outcomes","pass_human","from_annotations","minimum"]},bars:{type:"object",additionalProperties:!1,properties:{tpr_lower:{type:"number"},tnr_lower:{type:"number"},order_consistency:{type:"number"},repeat_stability:{type:"number"}},required:["tpr_lower","tnr_lower","order_consistency","repeat_stability"]},qualification:{anyOf:[{type:"object",additionalProperties:!1,properties:{id:{type:"string"},state:{type:"string"},started_at:{type:"string",format:"date-time"},finished_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},cost:{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]}},required:["id","state","started_at","finished_at","cost"]},{type:"null"}]},drift:{type:"object",additionalProperties:!1,properties:{state:{type:"string"},since:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},model_change:{anyOf:[{type:"object",additionalProperties:!1,properties:{from:{type:"string"},to:{type:"string"}},required:["from","to"]},{type:"null"}]}},required:["state","since","model_change"]},spot_check:{type:"object",additionalProperties:!1,properties:{enabled:{type:"boolean"},available:{type:"boolean"},judged:{type:"integer"},state:{type:"string"},labelled:{type:"integer"},total:{type:"integer"},reviewers:{type:"integer"},agreement_with_judge:{anyOf:[{type:"object",additionalProperties:!1,properties:{value:{type:"number"},n:{type:"integer"},lower:{type:"number"},upper:{type:"number"}},required:["value","n","lower","upper"]},{type:"null"}]},between_reviewers:{anyOf:[{type:"object",additionalProperties:!1,properties:{value:{type:"number"},n:{type:"integer"},lower:{type:"number"},upper:{type:"number"}},required:["value","n","lower","upper"]},{type:"null"}]}},required:["enabled","available","judged","state","labelled","total","reviewers","agreement_with_judge","between_reviewers"]}},required:["criterion_id","version","trust","measurements","anchors","bars","qualification","drift","spot_check"]},binding:{path_inputs:{criterionId:"criterion_id"},query_inputs:[],body_inputs:[]},contract_sha256:"d76bcd8fbfe83b35ba0063ffc586639e026a0ef6f19e49df2d259d710d76bbd0"},{id:"criteria.propose",version:"1",summary:"Propose a criterion, or a new code version of one; it stays proposed until a person turns it on.",method:"POST",path:"/projects/{projectId}/criteria/proposals",permissions:["eval:write"],scope:"project",access:"write",aliases:["caveman_evals_write.propose_criterion"],input_schema:{type:"object",additionalProperties:!1,properties:{workload_id:{type:["string","null"],format:"uuid"},scope:{enum:["span","trace","task"]},level:{enum:["step","outcome"]},kind:{enum:["assertion","question","output_grader","code"]},statement:{type:"string",maxLength:500},pass_def:{type:"string"},fail_def:{type:"string"},na_def:{type:"string"},selector:{type:"object"},params:{type:"object"},code:{type:"object",additionalProperties:!1,properties:{ref:{type:"string",maxLength:500},sha256:{type:"string",pattern:"^[a-f0-9]{64}$"}},required:["ref","sha256"]},motivating_units:{type:"array",items:{type:"object",additionalProperties:!1,properties:{scope:{enum:["span","trace","task"]},unit_id:{type:"string",minLength:1,maxLength:512},task_key:{type:["string","null"]},trace_id:{type:["string","null"]},cell_id:{type:["string","null"]}},required:["scope","unit_id"]},maxItems:5}},required:["scope","level","kind","statement"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},version:{type:"integer"},revision:{type:"integer"},workload:{anyOf:[{type:"object",additionalProperties:!1,properties:{id:{type:"string"},slug:{anyOf:[{type:"string"},{type:"null"}]},display_name:{type:"string"},agent_id:{anyOf:[{type:"string"},{type:"null"}]}},required:["id","slug","display_name","agent_id"]},{type:"null"}]},scope:{type:"string"},level:{type:"string"},kind:{type:"string"},label:{type:"string"},statement:{anyOf:[{type:"string"},{type:"null"}]},pass_def:{anyOf:[{type:"string"},{type:"null"}]},fail_def:{anyOf:[{type:"string"},{type:"null"}]},na_def:{anyOf:[{type:"string"},{type:"null"}]},selector:{},params:{},code:{anyOf:[{type:"object",additionalProperties:!1,properties:{ref:{type:"string"},sha256:{type:"string"}},required:["ref","sha256"]},{type:"null"}]},provenance:{type:"object",additionalProperties:!1,properties:{author:{enum:["eval_engineer","agent_connection","person","imported"]},motivating_units:{}},required:["author","motivating_units"]},state:{type:"string"},gating:{type:"boolean"},trust:{type:"object",additionalProperties:!1,properties:{state:{type:"string"},trusted_for:{anyOf:[{type:"string"},{type:"null"}]},sentence:{type:"string"}},required:["state","trusted_for","sentence"]},pass_rate_7d:{anyOf:[{type:"object",additionalProperties:!1,properties:{value:{type:"number"},n:{type:"integer"},lower:{type:"number"},upper:{type:"number"}},required:["value","n","lower","upper"]},{type:"null"}]},judged_7d:{type:"integer"},cost_per_day:{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]},judge:{type:"object",additionalProperties:!1,properties:{wire:{anyOf:[{type:"string"},{type:"null"}]},model_id:{anyOf:[{type:"string"},{type:"null"}]},family:{anyOf:[{type:"string"},{type:"null"}]},judge_id:{anyOf:[{type:"string"},{type:"null"}]}},required:["wire","model_id","family","judge_id"]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"}},required:["id","version","revision","workload","scope","level","kind","label","statement","pass_def","fail_def","na_def","selector","params","code","provenance","state","gating","trust","pass_rate_7d","judged_7d","cost_per_day","judge","created_at","updated_at"]},binding:{path_inputs:{},query_inputs:[],body_inputs:["workload_id","scope","level","kind","statement","pass_def","fail_def","na_def","selector","params","code","motivating_units"]},contract_sha256:"b8ae294a922d18b220c406bb2a1a30cfac2da3214a0037147dbd4a784c24f898"},{id:"dashboards.list",version:"1",summary:"List the project's dashboards, built-ins first.",method:"GET",path:"/projects/{projectId}/dashboards",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_dashboards.list"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{dashboards:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},type:{enum:["logs","experiments"]},builtin:{type:"boolean"},editable:{type:"boolean"},starred:{type:"boolean"},chart_count:{type:"integer"},created_by:{anyOf:[{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"}},required:["id","name"]},{type:"null"}]},created_at:{anyOf:[{type:"string"},{type:"null"}]},updated_at:{anyOf:[{type:"string"},{type:"null"}]}},required:["id","name","type","builtin","editable","starred","chart_count","created_by","created_at","updated_at"]}}},required:["dashboards"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"58937abfbe34874048d99c0024c982bcebdc588a926fbd4efd7ea35fef1c60f4"},{id:"dashboards.create",version:"1",summary:"Create a dashboard, or clone one with source_dashboard_id.",method:"POST",path:"/projects/{projectId}/dashboards",permissions:["dashboard:write"],scope:"project",access:"write",aliases:["caveman_dashboards_write.create"],input_schema:{type:"object",additionalProperties:!1,properties:{name:{type:"string",minLength:1,maxLength:120},type:{enum:["logs","experiments"]},document:{type:"object",additionalProperties:!1,properties:{filters:{type:"array",items:{type:"string",maxLength:2e3},maxItems:20},search:{type:"string",maxLength:200},group_by:{type:"string"},range:{type:"object",additionalProperties:!1,properties:{preset:{enum:["1h","6h","24h","3d","7d","14d","30d","60d","90d"]},from:{type:"string",format:"date-time"},to:{type:"string",format:"date-time"}}},sections:{type:"array",items:{type:"object",additionalProperties:!1,properties:{id:{type:"string",pattern:"^[A-Za-z0-9_-]{1,64}$"},title:{type:"string",maxLength:120}},required:["title"]},maxItems:20},charts:{type:"array",items:{type:"object",additionalProperties:!1,properties:{id:{type:"string",pattern:"^[A-Za-z0-9_-]{1,64}$"},title:{type:"string",minLength:1,maxLength:120},type:{enum:["timeseries","toplist","bignumber"]},source:{enum:["requests","spans","tools","evals"]},preset:{type:["string","null"]},measures:{type:"array",items:{type:"object",additionalProperties:!1,properties:{label:{type:"string"},field:{type:"string"},agg:{enum:["count","sum","avg","min","max","count_distinct","percentile"]},p:{type:"number",exclusiveMinimum:0,exclusiveMaximum:1},expr:{type:"string",maxLength:2e3}}},minItems:1,maxItems:6},filters:{type:"object",additionalProperties:!1,properties:{row:{type:"string",maxLength:2e3},trace:{type:"string",maxLength:2e3}}},group_by:{type:"string"},options:{type:"object",additionalProperties:!1,properties:{unit:{enum:["duration","cost","count","percent","bytes"]},viz:{enum:["line","bar"]},stacked:{type:"boolean"},interval:{enum:["auto","hour","day","week"]},sort:{enum:["value_desc","value_asc","name_asc","name_desc"]},limit:{type:"integer",minimum:1,maximum:50}}},layout:{type:"object",additionalProperties:!1,properties:{w:{enum:[3,4,6,8,12]},h:{enum:[1,2,3]}},required:["w","h"]},section_id:{type:["string","null"]}},required:["title","type","source","measures"]},maxItems:60}}},source_dashboard_id:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},type:{enum:["logs","experiments"]},builtin:{type:"boolean"},editable:{type:"boolean"},starred:{type:"boolean"},chart_count:{type:"integer"},created_by:{anyOf:[{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"}},required:["id","name"]},{type:"null"}]},created_at:{anyOf:[{type:"string"},{type:"null"}]},updated_at:{anyOf:[{type:"string"},{type:"null"}]},version:{type:"integer"},document:{type:"object",additionalProperties:!1,properties:{filters:{type:["array","null"],items:{type:"string"}},search:{type:"string"},group_by:{type:"string"},range:{type:"object",additionalProperties:!1,properties:{preset:{enum:["1h","6h","24h","3d","7d","14d","30d","60d","90d"]},from:{type:"string"},to:{type:"string"}},required:[]},sections:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},title:{type:"string"}},required:["id","title"]}},charts:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},title:{type:"string"},type:{enum:["timeseries","toplist","bignumber"]},source:{enum:["requests","spans","tools","evals"]},preset:{anyOf:[{type:"string"},{type:"null"}]},measures:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{label:{type:"string"},field:{type:"string"},agg:{enum:["count","sum","avg","min","max","count_distinct","percentile"]},p:{type:"number"},expr:{type:"string"}},required:[]}},filters:{type:"object",additionalProperties:!1,properties:{row:{type:"string"},trace:{type:"string"}},required:["row","trace"]},group_by:{type:"string"},options:{type:"object",additionalProperties:!1,properties:{unit:{enum:["duration","cost","count","percent","bytes"]},viz:{enum:["line","bar"]},stacked:{anyOf:[{type:"boolean"},{type:"null"}]},interval:{enum:["auto","hour","day","week"]},sort:{enum:["value_desc","value_asc","name_asc","name_desc"]},limit:{type:"integer"}},required:[]},layout:{type:"object",additionalProperties:!1,properties:{w:{enum:[3,4,6,8,12]},h:{enum:[1,2,3]}},required:["w","h"]},section_id:{anyOf:[{type:"string"},{type:"null"}]}},required:["id","title","type","source","measures","filters","group_by","options","layout"]}}},required:["filters","search","group_by","range","sections","charts"]}},required:["id","name","type","builtin","editable","starred","chart_count","created_by","created_at","updated_at","version","document"]},binding:{path_inputs:{},query_inputs:[],body_inputs:["name","type","document","source_dashboard_id"]},contract_sha256:"c5a28bf3d1180ef37bd86434b2c565ade81758198d1649ff71cf433d6fc3d9e9"},{id:"dashboards.delete",version:"1",summary:"Delete a dashboard; its alerts stay and detach.",method:"DELETE",path:"/projects/{projectId}/dashboards/{dashboardId}",permissions:["dashboard:write"],scope:"project",access:"write",aliases:["caveman_dashboards_write.delete"],input_schema:{type:"object",additionalProperties:!1,properties:{dashboard_id:{type:"string",pattern:"^(builtin:[a-z-]{1,40}|[0-9a-fA-F-]{36})$"}},required:["dashboard_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{status:{const:"deleted"}},required:["status"]},binding:{path_inputs:{dashboardId:"dashboard_id"},query_inputs:[],body_inputs:[]},contract_sha256:"0d1b3997a3e5b9224231fd82a847e9e4a493f154c548948e069673b8d3af1e9c"},{id:"dashboards.get",version:"1",summary:"Read one dashboard (a builtin:* id included) with its document.",method:"GET",path:"/projects/{projectId}/dashboards/{dashboardId}",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_dashboards.get"],input_schema:{type:"object",additionalProperties:!1,properties:{dashboard_id:{type:"string",pattern:"^(builtin:[a-z-]{1,40}|[0-9a-fA-F-]{36})$"}},required:["dashboard_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},type:{enum:["logs","experiments"]},builtin:{type:"boolean"},editable:{type:"boolean"},starred:{type:"boolean"},chart_count:{type:"integer"},created_by:{anyOf:[{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"}},required:["id","name"]},{type:"null"}]},created_at:{anyOf:[{type:"string"},{type:"null"}]},updated_at:{anyOf:[{type:"string"},{type:"null"}]},version:{type:"integer"},document:{type:"object",additionalProperties:!1,properties:{filters:{type:["array","null"],items:{type:"string"}},search:{type:"string"},group_by:{type:"string"},range:{type:"object",additionalProperties:!1,properties:{preset:{enum:["1h","6h","24h","3d","7d","14d","30d","60d","90d"]},from:{type:"string"},to:{type:"string"}},required:[]},sections:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},title:{type:"string"}},required:["id","title"]}},charts:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},title:{type:"string"},type:{enum:["timeseries","toplist","bignumber"]},source:{enum:["requests","spans","tools","evals"]},preset:{anyOf:[{type:"string"},{type:"null"}]},measures:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{label:{type:"string"},field:{type:"string"},agg:{enum:["count","sum","avg","min","max","count_distinct","percentile"]},p:{type:"number"},expr:{type:"string"}},required:[]}},filters:{type:"object",additionalProperties:!1,properties:{row:{type:"string"},trace:{type:"string"}},required:["row","trace"]},group_by:{type:"string"},options:{type:"object",additionalProperties:!1,properties:{unit:{enum:["duration","cost","count","percent","bytes"]},viz:{enum:["line","bar"]},stacked:{anyOf:[{type:"boolean"},{type:"null"}]},interval:{enum:["auto","hour","day","week"]},sort:{enum:["value_desc","value_asc","name_asc","name_desc"]},limit:{type:"integer"}},required:[]},layout:{type:"object",additionalProperties:!1,properties:{w:{enum:[3,4,6,8,12]},h:{enum:[1,2,3]}},required:["w","h"]},section_id:{anyOf:[{type:"string"},{type:"null"}]}},required:["id","title","type","source","measures","filters","group_by","options","layout"]}}},required:["filters","search","group_by","range","sections","charts"]}},required:["id","name","type","builtin","editable","starred","chart_count","created_by","created_at","updated_at","version","document"]},binding:{path_inputs:{dashboardId:"dashboard_id"},query_inputs:[],body_inputs:[]},contract_sha256:"bf0d04d58baf37bc5ab9848823be43f0d9f57fcbb8a433259054f4ac42a0b29c"},{id:"dashboards.update",version:"1",summary:"Rename, star or replace a dashboard's document at its current version.",method:"PATCH",path:"/projects/{projectId}/dashboards/{dashboardId}",permissions:["dashboard:write"],scope:"project",access:"write",aliases:["caveman_dashboards_write.update"],input_schema:{type:"object",additionalProperties:!1,properties:{version:{type:"integer",minimum:1},name:{type:"string",minLength:1,maxLength:120},starred:{type:"boolean"},document:{type:"object",additionalProperties:!1,properties:{filters:{type:"array",items:{type:"string",maxLength:2e3},maxItems:20},search:{type:"string",maxLength:200},group_by:{type:"string"},range:{type:"object",additionalProperties:!1,properties:{preset:{enum:["1h","6h","24h","3d","7d","14d","30d","60d","90d"]},from:{type:"string",format:"date-time"},to:{type:"string",format:"date-time"}}},sections:{type:"array",items:{type:"object",additionalProperties:!1,properties:{id:{type:"string",pattern:"^[A-Za-z0-9_-]{1,64}$"},title:{type:"string",maxLength:120}},required:["title"]},maxItems:20},charts:{type:"array",items:{type:"object",additionalProperties:!1,properties:{id:{type:"string",pattern:"^[A-Za-z0-9_-]{1,64}$"},title:{type:"string",minLength:1,maxLength:120},type:{enum:["timeseries","toplist","bignumber"]},source:{enum:["requests","spans","tools","evals"]},preset:{type:["string","null"]},measures:{type:"array",items:{type:"object",additionalProperties:!1,properties:{label:{type:"string"},field:{type:"string"},agg:{enum:["count","sum","avg","min","max","count_distinct","percentile"]},p:{type:"number",exclusiveMinimum:0,exclusiveMaximum:1},expr:{type:"string",maxLength:2e3}}},minItems:1,maxItems:6},filters:{type:"object",additionalProperties:!1,properties:{row:{type:"string",maxLength:2e3},trace:{type:"string",maxLength:2e3}}},group_by:{type:"string"},options:{type:"object",additionalProperties:!1,properties:{unit:{enum:["duration","cost","count","percent","bytes"]},viz:{enum:["line","bar"]},stacked:{type:"boolean"},interval:{enum:["auto","hour","day","week"]},sort:{enum:["value_desc","value_asc","name_asc","name_desc"]},limit:{type:"integer",minimum:1,maximum:50}}},layout:{type:"object",additionalProperties:!1,properties:{w:{enum:[3,4,6,8,12]},h:{enum:[1,2,3]}},required:["w","h"]},section_id:{type:["string","null"]}},required:["title","type","source","measures"]},maxItems:60}}},dashboard_id:{type:"string",pattern:"^(builtin:[a-z-]{1,40}|[0-9a-fA-F-]{36})$"}},required:["dashboard_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},type:{enum:["logs","experiments"]},builtin:{type:"boolean"},editable:{type:"boolean"},starred:{type:"boolean"},chart_count:{type:"integer"},created_by:{anyOf:[{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"}},required:["id","name"]},{type:"null"}]},created_at:{anyOf:[{type:"string"},{type:"null"}]},updated_at:{anyOf:[{type:"string"},{type:"null"}]},version:{type:"integer"},document:{type:"object",additionalProperties:!1,properties:{filters:{type:["array","null"],items:{type:"string"}},search:{type:"string"},group_by:{type:"string"},range:{type:"object",additionalProperties:!1,properties:{preset:{enum:["1h","6h","24h","3d","7d","14d","30d","60d","90d"]},from:{type:"string"},to:{type:"string"}},required:[]},sections:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},title:{type:"string"}},required:["id","title"]}},charts:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},title:{type:"string"},type:{enum:["timeseries","toplist","bignumber"]},source:{enum:["requests","spans","tools","evals"]},preset:{anyOf:[{type:"string"},{type:"null"}]},measures:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{label:{type:"string"},field:{type:"string"},agg:{enum:["count","sum","avg","min","max","count_distinct","percentile"]},p:{type:"number"},expr:{type:"string"}},required:[]}},filters:{type:"object",additionalProperties:!1,properties:{row:{type:"string"},trace:{type:"string"}},required:["row","trace"]},group_by:{type:"string"},options:{type:"object",additionalProperties:!1,properties:{unit:{enum:["duration","cost","count","percent","bytes"]},viz:{enum:["line","bar"]},stacked:{anyOf:[{type:"boolean"},{type:"null"}]},interval:{enum:["auto","hour","day","week"]},sort:{enum:["value_desc","value_asc","name_asc","name_desc"]},limit:{type:"integer"}},required:[]},layout:{type:"object",additionalProperties:!1,properties:{w:{enum:[3,4,6,8,12]},h:{enum:[1,2,3]}},required:["w","h"]},section_id:{anyOf:[{type:"string"},{type:"null"}]}},required:["id","title","type","source","measures","filters","group_by","options","layout"]}}},required:["filters","search","group_by","range","sections","charts"]}},required:["id","name","type","builtin","editable","starred","chart_count","created_by","created_at","updated_at","version","document"]},binding:{path_inputs:{dashboardId:"dashboard_id"},query_inputs:[],body_inputs:["version","name","starred","document"]},contract_sha256:"197990cf8812da4364fd13f22fd51670e55d9ef9ec90ccd7a6689a0b3e218e9b"},{id:"dashboards.add_chart",version:"1",summary:"Append one chart to a dashboard.",method:"POST",path:"/projects/{projectId}/dashboards/{dashboardId}/charts",permissions:["dashboard:write"],scope:"project",access:"write",aliases:["caveman_dashboards_write.add_chart"],input_schema:{type:"object",additionalProperties:!1,properties:{chart:{type:"object",additionalProperties:!1,properties:{id:{type:"string",pattern:"^[A-Za-z0-9_-]{1,64}$"},title:{type:"string",minLength:1,maxLength:120},type:{enum:["timeseries","toplist","bignumber"]},source:{enum:["requests","spans","tools","evals"]},preset:{type:["string","null"]},measures:{type:"array",items:{type:"object",additionalProperties:!1,properties:{label:{type:"string"},field:{type:"string"},agg:{enum:["count","sum","avg","min","max","count_distinct","percentile"]},p:{type:"number",exclusiveMinimum:0,exclusiveMaximum:1},expr:{type:"string",maxLength:2e3}}},minItems:1,maxItems:6},filters:{type:"object",additionalProperties:!1,properties:{row:{type:"string",maxLength:2e3},trace:{type:"string",maxLength:2e3}}},group_by:{type:"string"},options:{type:"object",additionalProperties:!1,properties:{unit:{enum:["duration","cost","count","percent","bytes"]},viz:{enum:["line","bar"]},stacked:{type:"boolean"},interval:{enum:["auto","hour","day","week"]},sort:{enum:["value_desc","value_asc","name_asc","name_desc"]},limit:{type:"integer",minimum:1,maximum:50}}},layout:{type:"object",additionalProperties:!1,properties:{w:{enum:[3,4,6,8,12]},h:{enum:[1,2,3]}},required:["w","h"]},section_id:{type:["string","null"]}},required:["title","type","source","measures"]},section_id:{type:["string","null"]},dashboard_id:{type:"string",pattern:"^(builtin:[a-z-]{1,40}|[0-9a-fA-F-]{36})$"}},required:["dashboard_id","chart"]},output_schema:{type:"object",additionalProperties:!1,properties:{dashboard:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},type:{enum:["logs","experiments"]},builtin:{type:"boolean"},editable:{type:"boolean"},starred:{type:"boolean"},chart_count:{type:"integer"},created_by:{anyOf:[{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"}},required:["id","name"]},{type:"null"}]},created_at:{anyOf:[{type:"string"},{type:"null"}]},updated_at:{anyOf:[{type:"string"},{type:"null"}]},version:{type:"integer"},document:{type:"object",additionalProperties:!1,properties:{filters:{type:["array","null"],items:{type:"string"}},search:{type:"string"},group_by:{type:"string"},range:{type:"object",additionalProperties:!1,properties:{preset:{enum:["1h","6h","24h","3d","7d","14d","30d","60d","90d"]},from:{type:"string"},to:{type:"string"}},required:[]},sections:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},title:{type:"string"}},required:["id","title"]}},charts:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},title:{type:"string"},type:{enum:["timeseries","toplist","bignumber"]},source:{enum:["requests","spans","tools","evals"]},preset:{anyOf:[{type:"string"},{type:"null"}]},measures:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{label:{type:"string"},field:{type:"string"},agg:{enum:["count","sum","avg","min","max","count_distinct","percentile"]},p:{type:"number"},expr:{type:"string"}},required:[]}},filters:{type:"object",additionalProperties:!1,properties:{row:{type:"string"},trace:{type:"string"}},required:["row","trace"]},group_by:{type:"string"},options:{type:"object",additionalProperties:!1,properties:{unit:{enum:["duration","cost","count","percent","bytes"]},viz:{enum:["line","bar"]},stacked:{anyOf:[{type:"boolean"},{type:"null"}]},interval:{enum:["auto","hour","day","week"]},sort:{enum:["value_desc","value_asc","name_asc","name_desc"]},limit:{type:"integer"}},required:[]},layout:{type:"object",additionalProperties:!1,properties:{w:{enum:[3,4,6,8,12]},h:{enum:[1,2,3]}},required:["w","h"]},section_id:{anyOf:[{type:"string"},{type:"null"}]}},required:["id","title","type","source","measures","filters","group_by","options","layout"]}}},required:["filters","search","group_by","range","sections","charts"]}},required:["id","name","type","builtin","editable","starred","chart_count","created_by","created_at","updated_at","version","document"]},chart_id:{type:"string"},chart:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},title:{type:"string"},type:{enum:["timeseries","toplist","bignumber"]},source:{enum:["requests","spans","tools","evals"]},preset:{anyOf:[{type:"string"},{type:"null"}]},measures:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{label:{type:"string"},field:{type:"string"},agg:{enum:["count","sum","avg","min","max","count_distinct","percentile"]},p:{type:"number"},expr:{type:"string"}},required:[]}},filters:{type:"object",additionalProperties:!1,properties:{row:{type:"string"},trace:{type:"string"}},required:["row","trace"]},group_by:{type:"string"},options:{type:"object",additionalProperties:!1,properties:{unit:{enum:["duration","cost","count","percent","bytes"]},viz:{enum:["line","bar"]},stacked:{anyOf:[{type:"boolean"},{type:"null"}]},interval:{enum:["auto","hour","day","week"]},sort:{enum:["value_desc","value_asc","name_asc","name_desc"]},limit:{type:"integer"}},required:[]},layout:{type:"object",additionalProperties:!1,properties:{w:{enum:[3,4,6,8,12]},h:{enum:[1,2,3]}},required:["w","h"]},section_id:{anyOf:[{type:"string"},{type:"null"}]}},required:["id","title","type","source","measures","filters","group_by","options","layout"]}},required:["dashboard","chart_id","chart"]},binding:{path_inputs:{dashboardId:"dashboard_id"},query_inputs:[],body_inputs:["chart","section_id"]},contract_sha256:"5f982a1c804aee5c42f2ddf82dcd13db72604c8f5a3fe26e328986e47736df7d"},{id:"dashboards.delete_chart",version:"1",summary:"Remove one chart from a dashboard.",method:"DELETE",path:"/projects/{projectId}/dashboards/{dashboardId}/charts/{chartId}",permissions:["dashboard:write"],scope:"project",access:"write",aliases:["caveman_dashboards_write.delete_chart"],input_schema:{type:"object",additionalProperties:!1,properties:{dashboard_id:{type:"string",pattern:"^(builtin:[a-z-]{1,40}|[0-9a-fA-F-]{36})$"},chart_id:{type:"string",pattern:"^[A-Za-z0-9_-]{1,64}$"}},required:["dashboard_id","chart_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},type:{enum:["logs","experiments"]},builtin:{type:"boolean"},editable:{type:"boolean"},starred:{type:"boolean"},chart_count:{type:"integer"},created_by:{anyOf:[{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"}},required:["id","name"]},{type:"null"}]},created_at:{anyOf:[{type:"string"},{type:"null"}]},updated_at:{anyOf:[{type:"string"},{type:"null"}]},version:{type:"integer"},document:{type:"object",additionalProperties:!1,properties:{filters:{type:["array","null"],items:{type:"string"}},search:{type:"string"},group_by:{type:"string"},range:{type:"object",additionalProperties:!1,properties:{preset:{enum:["1h","6h","24h","3d","7d","14d","30d","60d","90d"]},from:{type:"string"},to:{type:"string"}},required:[]},sections:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},title:{type:"string"}},required:["id","title"]}},charts:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},title:{type:"string"},type:{enum:["timeseries","toplist","bignumber"]},source:{enum:["requests","spans","tools","evals"]},preset:{anyOf:[{type:"string"},{type:"null"}]},measures:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{label:{type:"string"},field:{type:"string"},agg:{enum:["count","sum","avg","min","max","count_distinct","percentile"]},p:{type:"number"},expr:{type:"string"}},required:[]}},filters:{type:"object",additionalProperties:!1,properties:{row:{type:"string"},trace:{type:"string"}},required:["row","trace"]},group_by:{type:"string"},options:{type:"object",additionalProperties:!1,properties:{unit:{enum:["duration","cost","count","percent","bytes"]},viz:{enum:["line","bar"]},stacked:{anyOf:[{type:"boolean"},{type:"null"}]},interval:{enum:["auto","hour","day","week"]},sort:{enum:["value_desc","value_asc","name_asc","name_desc"]},limit:{type:"integer"}},required:[]},layout:{type:"object",additionalProperties:!1,properties:{w:{enum:[3,4,6,8,12]},h:{enum:[1,2,3]}},required:["w","h"]},section_id:{anyOf:[{type:"string"},{type:"null"}]}},required:["id","title","type","source","measures","filters","group_by","options","layout"]}}},required:["filters","search","group_by","range","sections","charts"]}},required:["id","name","type","builtin","editable","starred","chart_count","created_by","created_at","updated_at","version","document"]},binding:{path_inputs:{dashboardId:"dashboard_id",chartId:"chart_id"},query_inputs:[],body_inputs:[]},contract_sha256:"9958dc69c51774605620e9540f92bd51267d7c2eaee47f7a455c9efb3b0b3913"},{id:"dashboards.update_chart",version:"1",summary:"Merge a partial chart into one chart of a dashboard.",method:"PATCH",path:"/projects/{projectId}/dashboards/{dashboardId}/charts/{chartId}",permissions:["dashboard:write"],scope:"project",access:"write",aliases:["caveman_dashboards_write.update_chart"],input_schema:{type:"object",additionalProperties:!1,properties:{chart:{type:"object",additionalProperties:!1,properties:{id:{type:"string",pattern:"^[A-Za-z0-9_-]{1,64}$"},title:{type:"string",minLength:1,maxLength:120},type:{enum:["timeseries","toplist","bignumber"]},source:{enum:["requests","spans","tools","evals"]},preset:{type:["string","null"]},measures:{type:"array",items:{type:"object",additionalProperties:!1,properties:{label:{type:"string"},field:{type:"string"},agg:{enum:["count","sum","avg","min","max","count_distinct","percentile"]},p:{type:"number",exclusiveMinimum:0,exclusiveMaximum:1},expr:{type:"string",maxLength:2e3}}},minItems:1,maxItems:6},filters:{type:"object",additionalProperties:!1,properties:{row:{type:"string",maxLength:2e3},trace:{type:"string",maxLength:2e3}}},group_by:{type:"string"},options:{type:"object",additionalProperties:!1,properties:{unit:{enum:["duration","cost","count","percent","bytes"]},viz:{enum:["line","bar"]},stacked:{type:"boolean"},interval:{enum:["auto","hour","day","week"]},sort:{enum:["value_desc","value_asc","name_asc","name_desc"]},limit:{type:"integer",minimum:1,maximum:50}}},layout:{type:"object",additionalProperties:!1,properties:{w:{enum:[3,4,6,8,12]},h:{enum:[1,2,3]}},required:["w","h"]},section_id:{type:["string","null"]}}},dashboard_id:{type:"string",pattern:"^(builtin:[a-z-]{1,40}|[0-9a-fA-F-]{36})$"},chart_id:{type:"string",pattern:"^[A-Za-z0-9_-]{1,64}$"}},required:["dashboard_id","chart_id","chart"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},type:{enum:["logs","experiments"]},builtin:{type:"boolean"},editable:{type:"boolean"},starred:{type:"boolean"},chart_count:{type:"integer"},created_by:{anyOf:[{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"}},required:["id","name"]},{type:"null"}]},created_at:{anyOf:[{type:"string"},{type:"null"}]},updated_at:{anyOf:[{type:"string"},{type:"null"}]},version:{type:"integer"},document:{type:"object",additionalProperties:!1,properties:{filters:{type:["array","null"],items:{type:"string"}},search:{type:"string"},group_by:{type:"string"},range:{type:"object",additionalProperties:!1,properties:{preset:{enum:["1h","6h","24h","3d","7d","14d","30d","60d","90d"]},from:{type:"string"},to:{type:"string"}},required:[]},sections:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},title:{type:"string"}},required:["id","title"]}},charts:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},title:{type:"string"},type:{enum:["timeseries","toplist","bignumber"]},source:{enum:["requests","spans","tools","evals"]},preset:{anyOf:[{type:"string"},{type:"null"}]},measures:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{label:{type:"string"},field:{type:"string"},agg:{enum:["count","sum","avg","min","max","count_distinct","percentile"]},p:{type:"number"},expr:{type:"string"}},required:[]}},filters:{type:"object",additionalProperties:!1,properties:{row:{type:"string"},trace:{type:"string"}},required:["row","trace"]},group_by:{type:"string"},options:{type:"object",additionalProperties:!1,properties:{unit:{enum:["duration","cost","count","percent","bytes"]},viz:{enum:["line","bar"]},stacked:{anyOf:[{type:"boolean"},{type:"null"}]},interval:{enum:["auto","hour","day","week"]},sort:{enum:["value_desc","value_asc","name_asc","name_desc"]},limit:{type:"integer"}},required:[]},layout:{type:"object",additionalProperties:!1,properties:{w:{enum:[3,4,6,8,12]},h:{enum:[1,2,3]}},required:["w","h"]},section_id:{anyOf:[{type:"string"},{type:"null"}]}},required:["id","title","type","source","measures","filters","group_by","options","layout"]}}},required:["filters","search","group_by","range","sections","charts"]}},required:["id","name","type","builtin","editable","starred","chart_count","created_by","created_at","updated_at","version","document"]},binding:{path_inputs:{dashboardId:"dashboard_id",chartId:"chart_id"},query_inputs:[],body_inputs:["chart"]},contract_sha256:"a3fdf4b93acbbbd5953d845cb5f38f47caafc88fe7372f95e0140e231b6d57b6"},{id:"evals.list_annotation_queue",version:"1",summary:"Reads project review assignments with evaluation outputs and grader verdicts; requires explicit payload:read scope.",method:"GET",path:"/projects/{projectId}/eval-annotations",permissions:["payload:read"],scope:"project",access:"read",aliases:["caveman_evals.list_annotation_queue"],input_schema:{type:"object",additionalProperties:!1,properties:{assignee_id:{type:"string"},limit:{type:"integer",minimum:0},status:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},cell_id:{type:"string"},label:{type:"string"},note:{type:"string"},value:{},status:{type:"string"},assignee_id:{anyOf:[{type:"string"},{type:"null"}]},revision:{type:"integer"},created_by:{anyOf:[{type:"string"},{type:"null"}]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"},workbench_id:{type:"string"},workbench_name:{type:"string"},run_id:{type:"string"},dataset_row_key:{type:"string"},target_key:{type:"string"},output:{},evaluator_results:{}},required:["id","organization_id","project_id","cell_id","label","note","value","status","revision","created_at","updated_at","workbench_id","workbench_name","run_id","dataset_row_key","target_key","output","evaluator_results"]}},next_cursor:{type:"null"}},required:["data","next_cursor"]},binding:{path_inputs:{},query_inputs:["assignee_id","limit","status"],body_inputs:[]},contract_sha256:"d3ffcd0ca0cb65a75d44a175f01906d391a022d16c4b019957667d22a38711b6"},{id:"datasets.list",version:"1",summary:"datasets list",method:"GET",path:"/projects/{projectId}/eval-datasets",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_evals.list_datasets"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},name:{type:"string"},description:{type:"string"},status:{type:"string"},columns:{type:"array",minItems:1,maxItems:64,items:{type:"object",required:["key","name","type","role"],additionalProperties:!1,properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},type:{enum:["string","number","boolean","json","image_url","messages"]},role:{enum:["input","expected","metadata","output"]}}}},revision:{type:"integer"},current_version:{type:"integer"},row_count:{type:"integer"},created_by:{anyOf:[{type:"string"},{type:"null"}]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"},provenance:{}},required:["id","organization_id","project_id","name","description","status","columns","revision","current_version","row_count","created_at","updated_at","provenance"]}},next_cursor:{type:"null"}},required:["data","next_cursor"]},binding:{},native_evaluation:!0,contract_sha256:"df4c089a6973d4bc7545a4903a7e60c5462ce61019700f3cb2a5549eca7c35c3"},{id:"datasets.create",version:"1",summary:"datasets create",method:"POST",path:"/projects/{projectId}/eval-datasets",permissions:["eval:write"],scope:"project",access:"write",aliases:["caveman_evals_write.create_dataset"],input_schema:{type:"object",additionalProperties:!1,properties:{name:{type:"string",minLength:1,maxLength:200},description:{type:"string",maxLength:2e3},document:{title:"Caveman evaluation dataset",description:"Canonical dataset snapshot used by an evaluation workbench run.",type:"object",required:["schema_version","columns","rows"],additionalProperties:!1,properties:{schema_version:{const:1},columns:{type:"array",minItems:1,maxItems:64,items:{type:"object",required:["key","name","type","role"],additionalProperties:!1,properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},type:{enum:["string","number","boolean","json","image_url","messages"]},role:{enum:["input","expected","metadata","output"]}}}},rows:{type:"array",maxItems:1e4,items:{type:"object",required:["row_key","values"],additionalProperties:!1,properties:{row_key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},values:{type:"object"},tags:{type:"array",maxItems:32,items:{type:"string",minLength:1,maxLength:100},uniqueItems:!0}}}}}}},required:["name","document"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string",format:"uuid"},project_id:{type:"string",format:"uuid"},revision:{type:"integer",minimum:1},current_version:{type:"integer",minimum:0},status:{type:"string"},document_sha256:{type:"string",pattern:"^[a-f0-9]{64}$"},config_sha256:{type:"string",pattern:"^[a-f0-9]{64}$"}},required:["id","project_id","revision","status"]},binding:{body_inputs:["name","description","document"]},native_evaluation:!0,transactional:!0,resources:[{type:"datasets",id_field:"id",version_field:"current_version",revision_field:"revision"}],contract_sha256:"5187a0a13458e1ce60077a88a2411e907ace13e93e1dae496184b8329a6c5626"},{id:"datasets.archive",version:"1",summary:"datasets archive",method:"DELETE",path:"/projects/{projectId}/eval-datasets/{datasetId}",permissions:["eval:write"],scope:"project",access:"none",exclusion:"Archives a shared evaluation dataset and removes it from authoring flows. Agents may create and version datasets; a human retires shared evidence assets.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{dataset_id:{type:"string",format:"uuid"},revision:{type:"integer",minimum:1}},required:["dataset_id","revision"]},output_schema:{type:"object",additionalProperties:!0},binding:{path_inputs:{datasetId:"dataset_id"},query_inputs:["revision"]},transactional:!0,contract_sha256:"13eb866e37a149fc46b6225a9aa6711d9cf9e98586ceb0a1bd299be5a63fc6ef"},{id:"datasets.get",version:"1",summary:"Reads authored evaluation row payloads; requires explicit payload:read scope.",method:"GET",path:"/projects/{projectId}/eval-datasets/{datasetId}",permissions:["payload:read"],scope:"project",access:"read",aliases:["caveman_evals.get_dataset"],input_schema:{type:"object",additionalProperties:!1,properties:{dataset_id:{type:"string",format:"uuid"}},required:["dataset_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{dataset:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},name:{type:"string"},description:{type:"string"},status:{type:"string"},columns:{type:"array",minItems:1,maxItems:64,items:{type:"object",required:["key","name","type","role"],additionalProperties:!1,properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},type:{enum:["string","number","boolean","json","image_url","messages"]},role:{enum:["input","expected","metadata","output"]}}}},revision:{type:"integer"},current_version:{type:"integer"},row_count:{type:"integer"},created_by:{anyOf:[{type:"string"},{type:"null"}]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"},provenance:{}},required:["id","organization_id","project_id","name","description","status","columns","revision","current_version","row_count","created_at","updated_at","provenance"]},rows:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},dataset_id:{type:"string"},row_key:{type:"string"},position:{type:"integer"},values:{},tags:{type:["array","null"],items:{type:"string"}},revision:{type:"integer"},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"}},required:["id","organization_id","project_id","dataset_id","row_key","position","values","tags","revision","created_at","updated_at"]}},versions:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},dataset_id:{type:"string"},version:{type:"integer"},document:{title:"Caveman evaluation dataset",description:"Canonical dataset snapshot used by an evaluation workbench run.",type:"object",required:["schema_version","columns","rows"],additionalProperties:!1,properties:{schema_version:{const:1},columns:{type:"array",minItems:1,maxItems:64,items:{type:"object",required:["key","name","type","role"],additionalProperties:!1,properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},type:{enum:["string","number","boolean","json","image_url","messages"]},role:{enum:["input","expected","metadata","output"]}}}},rows:{type:"array",maxItems:1e4,items:{type:"object",required:["row_key","values"],additionalProperties:!1,properties:{row_key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},values:{type:"object"},tags:{type:"array",maxItems:32,items:{type:"string",minLength:1,maxLength:100},uniqueItems:!0}}}}}},document_sha256:{type:"string"},row_count:{type:"integer"},source:{},created_by:{anyOf:[{type:"string"},{type:"null"}]},created_at:{type:"string",format:"date-time"}},required:["id","organization_id","project_id","dataset_id","version","document","document_sha256","row_count","source","created_at"]}}},required:["dataset","rows","versions"]},binding:{path_inputs:{datasetId:"dataset_id"}},native_evaluation:!0,contract_sha256:"10a3ed6f55cddca23d05863d2a52eda9898ed6cfd7061fa1d84900c100bbfb71"},{id:"datasets.update",version:"1",summary:"datasets update",method:"PUT",path:"/projects/{projectId}/eval-datasets/{datasetId}",permissions:["eval:write"],scope:"project",access:"write",aliases:["caveman_evals_write.update_dataset"],input_schema:{type:"object",additionalProperties:!1,properties:{dataset_id:{type:"string",format:"uuid"},revision:{type:"integer",minimum:1},name:{type:"string",minLength:1,maxLength:200},description:{type:"string",maxLength:2e3},document:{title:"Caveman evaluation dataset",description:"Canonical dataset snapshot used by an evaluation workbench run.",type:"object",required:["schema_version","columns","rows"],additionalProperties:!1,properties:{schema_version:{const:1},columns:{type:"array",minItems:1,maxItems:64,items:{type:"object",required:["key","name","type","role"],additionalProperties:!1,properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},type:{enum:["string","number","boolean","json","image_url","messages"]},role:{enum:["input","expected","metadata","output"]}}}},rows:{type:"array",maxItems:1e4,items:{type:"object",required:["row_key","values"],additionalProperties:!1,properties:{row_key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},values:{type:"object"},tags:{type:"array",maxItems:32,items:{type:"string",minLength:1,maxLength:100},uniqueItems:!0}}}}}}},required:["dataset_id","revision","name","document"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string",format:"uuid"},project_id:{type:"string",format:"uuid"},revision:{type:"integer",minimum:1},current_version:{type:"integer",minimum:0},status:{type:"string"},document_sha256:{type:"string",pattern:"^[a-f0-9]{64}$"},config_sha256:{type:"string",pattern:"^[a-f0-9]{64}$"}},required:["id","project_id","revision","status"]},binding:{path_inputs:{datasetId:"dataset_id"},body_inputs:["revision","name","description","document"]},native_evaluation:!0,transactional:!0,resources:[{type:"datasets",id_field:"id",version_field:"current_version",revision_field:"revision"}],contract_sha256:"ef9265c434378cb879b708f85d918511e5268ca4c285bcdd52b4f6c741eef7b5"},{id:"datasets.snapshot",version:"1",summary:"datasets snapshot",method:"POST",path:"/projects/{projectId}/eval-datasets/{datasetId}/versions",permissions:["eval:write"],scope:"project",access:"write",aliases:["caveman_evals_write.snapshot_dataset"],input_schema:{type:"object",additionalProperties:!1,properties:{dataset_id:{type:"string",format:"uuid"},source:{type:"object",additionalProperties:!0}},required:["dataset_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},dataset_id:{type:"string"},version:{type:"integer"},document_sha256:{type:"string"}},required:["id","project_id","dataset_id","version","document_sha256"]},binding:{path_inputs:{datasetId:"dataset_id"},body_inputs:["source"]},native_evaluation:!0,transactional:!0,contract_sha256:"10fc4692f3c18d905b19cada050b0df262f45dcb29b11d41abb576cdc65ae3aa"},{id:"eval_drafts.list",version:"1",summary:"List the project's latest eval drafting runs: state, refusal, provenance, label basis and judge spend.",method:"GET",path:"/projects/{projectId}/eval-drafts",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_evals.list_eval_drafts"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},trigger:{type:"string"},requested_by:{anyOf:[{type:"string"},{type:"null"}]},state:{type:"string"},status:{type:"string"},refusal:{type:"string"},refusal_detail:{type:"string"},provenance:{type:"string"},budget_usd:{type:"number"},judge_spent_usd:{anyOf:[{type:"number"},{type:"null"}]},judge_spend_basis:{type:"string"},result:{},approved_by:{anyOf:[{type:"string"},{type:"null"}]},approved_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},declined_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},created_at:{type:"string",format:"date-time"},finished_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]}},required:["id","project_id","trigger","requested_by","state","status","refusal","refusal_detail","provenance","budget_usd","judge_spent_usd","judge_spend_basis","result","approved_by","approved_at","declined_at","created_at","finished_at"]}}},required:["data"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"ff019be7770bf64e0959e8f62639ac52819de85872c4d498501c4bf65ab63105"},{id:"eval_drafts.request",version:"1",summary:"Ask Caveman to draft eval suites from saved traffic now; the worker picks the run up within five minutes.",method:"POST",path:"/projects/{projectId}/eval-drafts",permissions:["eval:write"],scope:"project",access:"write",aliases:["caveman_evals_write.draft_evals_from_traffic"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},trigger:{type:"string"},requested_by:{anyOf:[{type:"string"},{type:"null"}]},state:{type:"string"},status:{type:"string"},refusal:{type:"string"},refusal_detail:{type:"string"},provenance:{type:"string"},budget_usd:{type:"number"},judge_spent_usd:{anyOf:[{type:"number"},{type:"null"}]},judge_spend_basis:{type:"string"},result:{},approved_by:{anyOf:[{type:"string"},{type:"null"}]},approved_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},declined_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},created_at:{type:"string",format:"date-time"},finished_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]}},required:["id","project_id","trigger","requested_by","state","status","refusal","refusal_detail","provenance","budget_usd","judge_spent_usd","judge_spend_basis","result","approved_by","approved_at","declined_at","created_at","finished_at"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"964849168e02905345bcac6e45755fa88be8ef9d9275ffd120818257213b5d00"},{id:"eval_drafts.approve",version:"1",summary:"Approve a drafted suite: its datasets and qualified criteria become active.",method:"POST",path:"/projects/{projectId}/eval-drafts/{runId}/approve",permissions:["autopilot:manage"],scope:"project",access:"none",exclusion:"Approving a drafted suite makes its datasets and qualified criteria active for every comparison. A person decides.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{run_id:{type:"string",format:"uuid"}},required:["run_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},trigger:{type:"string"},requested_by:{anyOf:[{type:"string"},{type:"null"}]},state:{type:"string"},status:{type:"string"},refusal:{type:"string"},refusal_detail:{type:"string"},provenance:{type:"string"},budget_usd:{type:"number"},judge_spent_usd:{anyOf:[{type:"number"},{type:"null"}]},judge_spend_basis:{type:"string"},result:{},approved_by:{anyOf:[{type:"string"},{type:"null"}]},approved_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},declined_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},created_at:{type:"string",format:"date-time"},finished_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]}},required:["id","project_id","trigger","requested_by","state","status","refusal","refusal_detail","provenance","budget_usd","judge_spent_usd","judge_spend_basis","result","approved_by","approved_at","declined_at","created_at","finished_at"]},binding:{path_inputs:{runId:"run_id"},query_inputs:[],body_inputs:[]},contract_sha256:"775c941c250b45b57004fcceca22d4b7be4df23ac227d7c8de0ca7f666056006"},{id:"eval_drafts.decline",version:"1",summary:"Decline a drafted suite; nothing it drafted becomes active.",method:"POST",path:"/projects/{projectId}/eval-drafts/{runId}/decline",permissions:["autopilot:manage"],scope:"project",access:"none",exclusion:"Declining a drafted suite discards what Caveman drafted. A person decides.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{run_id:{type:"string",format:"uuid"}},required:["run_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},trigger:{type:"string"},requested_by:{anyOf:[{type:"string"},{type:"null"}]},state:{type:"string"},status:{type:"string"},refusal:{type:"string"},refusal_detail:{type:"string"},provenance:{type:"string"},budget_usd:{type:"number"},judge_spent_usd:{anyOf:[{type:"number"},{type:"null"}]},judge_spend_basis:{type:"string"},result:{},approved_by:{anyOf:[{type:"string"},{type:"null"}]},approved_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},declined_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},created_at:{type:"string",format:"date-time"},finished_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]}},required:["id","project_id","trigger","requested_by","state","status","refusal","refusal_detail","provenance","budget_usd","judge_spent_usd","judge_spend_basis","result","approved_by","approved_at","declined_at","created_at","finished_at"]},binding:{path_inputs:{runId:"run_id"},query_inputs:[],body_inputs:[]},contract_sha256:"2a428d20c6e062a6a694a864d9e3694be81c27fcf787071a83420ada88e60de7"},{id:"evaluators.list",version:"1",summary:"evaluators list",method:"GET",path:"/projects/{projectId}/eval-evaluators",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_evals.list_evaluators"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},name:{type:"string"},description:{type:"string"},grader_type:{type:"string"},options:{},input_mapping:{},status:{type:"string"},revision:{type:"integer"},current_version:{type:"integer"},config_sha256:{type:"string"},created_by:{anyOf:[{type:"string"},{type:"null"}]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"},provenance:{}},required:["id","organization_id","project_id","name","description","grader_type","options","input_mapping","status","revision","current_version","config_sha256","created_at","updated_at","provenance"]}},next_cursor:{type:"null"}},required:["data","next_cursor"]},binding:{},native_evaluation:!0,contract_sha256:"55db15d293536d670bc23f9d5f610b1752a6dead2e6bdfc4db3eb50694484d35"},{id:"evaluators.create",version:"1",summary:"evaluators create",method:"POST",path:"/projects/{projectId}/eval-evaluators",permissions:["eval:write"],scope:"project",access:"write",aliases:["caveman_evals_write.create_evaluator"],input_schema:{type:"object",additionalProperties:!1,properties:{name:{type:"string",minLength:1,maxLength:200},description:{type:"string",maxLength:2e3},config:{title:"Caveman reusable evaluator",description:"Versioned evaluator configuration. grader_type is validated against grader-registry.json by control-api.",type:"object",required:["schema_version","grader_type","options","input_mapping"],additionalProperties:!1,properties:{schema_version:{const:1},grader_type:{type:"string",minLength:1,maxLength:100},options:{type:"object"},input_mapping:{type:"object",required:["candidate"],additionalProperties:!1,properties:{candidate:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},reference:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},baseline:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}}}}}}},required:["name","config"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string",format:"uuid"},project_id:{type:"string",format:"uuid"},revision:{type:"integer",minimum:1},current_version:{type:"integer",minimum:0},status:{type:"string"},document_sha256:{type:"string",pattern:"^[a-f0-9]{64}$"},config_sha256:{type:"string",pattern:"^[a-f0-9]{64}$"}},required:["id","project_id","revision","status"]},binding:{body_inputs:["name","description","config"]},native_evaluation:!0,transactional:!0,resources:[{type:"evaluators",id_field:"id",version_field:"current_version",revision_field:"revision"}],contract_sha256:"7de7cc70b04eae67398d4086d13755785ba80e3c4b6409ed0379bbc142b8ff34"},{id:"evaluators.archive",version:"1",summary:"evaluators archive",method:"DELETE",path:"/projects/{projectId}/eval-evaluators/{evaluatorId}",permissions:["eval:write"],scope:"project",access:"none",exclusion:"Archives a reusable evaluator used by shared workbenches. Agents may create and version evaluators; a human retires shared quality policy.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{evaluator_id:{type:"string",format:"uuid"},revision:{type:"integer",minimum:1}},required:["evaluator_id","revision"]},output_schema:{type:"object",additionalProperties:!0},binding:{path_inputs:{evaluatorId:"evaluator_id"},query_inputs:["revision"]},transactional:!0,contract_sha256:"989baa35dbdb83b668485499c8db8341e7c552a10dc77d1fbad5b57953549a89"},{id:"evaluators.get",version:"1",summary:"evaluators get",method:"GET",path:"/projects/{projectId}/eval-evaluators/{evaluatorId}",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_evals.get_evaluator"],input_schema:{type:"object",additionalProperties:!1,properties:{evaluator_id:{type:"string",format:"uuid"}},required:["evaluator_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{evaluator:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},name:{type:"string"},description:{type:"string"},grader_type:{type:"string"},options:{},input_mapping:{},status:{type:"string"},revision:{type:"integer"},current_version:{type:"integer"},config_sha256:{type:"string"},created_by:{anyOf:[{type:"string"},{type:"null"}]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"},provenance:{}},required:["id","organization_id","project_id","name","description","grader_type","options","input_mapping","status","revision","current_version","config_sha256","created_at","updated_at","provenance"]},versions:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},evaluator_id:{type:"string"},version:{type:"integer"},grader_type:{type:"string"},options:{},input_mapping:{},config_sha256:{type:"string"},created_by:{anyOf:[{type:"string"},{type:"null"}]},created_at:{type:"string",format:"date-time"},source:{}},required:["id","organization_id","project_id","evaluator_id","version","grader_type","options","input_mapping","config_sha256","created_at","source"]}}},required:["evaluator","versions"]},binding:{path_inputs:{evaluatorId:"evaluator_id"}},native_evaluation:!0,contract_sha256:"f602a3e76637dc20ca67031ccf92b4567854b43f9662dcc4dc691db21f6ba992"},{id:"evaluators.update",version:"1",summary:"evaluators update",method:"PUT",path:"/projects/{projectId}/eval-evaluators/{evaluatorId}",permissions:["eval:write"],scope:"project",access:"write",aliases:["caveman_evals_write.update_evaluator"],input_schema:{type:"object",additionalProperties:!1,properties:{evaluator_id:{type:"string",format:"uuid"},revision:{type:"integer",minimum:1},name:{type:"string",minLength:1,maxLength:200},description:{type:"string",maxLength:2e3},config:{title:"Caveman reusable evaluator",description:"Versioned evaluator configuration. grader_type is validated against grader-registry.json by control-api.",type:"object",required:["schema_version","grader_type","options","input_mapping"],additionalProperties:!1,properties:{schema_version:{const:1},grader_type:{type:"string",minLength:1,maxLength:100},options:{type:"object"},input_mapping:{type:"object",required:["candidate"],additionalProperties:!1,properties:{candidate:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},reference:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},baseline:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}}}}}}},required:["evaluator_id","revision","name","config"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string",format:"uuid"},project_id:{type:"string",format:"uuid"},revision:{type:"integer",minimum:1},current_version:{type:"integer",minimum:0},status:{type:"string"},document_sha256:{type:"string",pattern:"^[a-f0-9]{64}$"},config_sha256:{type:"string",pattern:"^[a-f0-9]{64}$"}},required:["id","project_id","revision","status"]},binding:{path_inputs:{evaluatorId:"evaluator_id"},body_inputs:["revision","name","description","config"]},native_evaluation:!0,transactional:!0,resources:[{type:"evaluators",id_field:"id",version_field:"current_version",revision_field:"revision"}],contract_sha256:"2c7356fd797311f886f83a807dd9151f47502349095d63422d9abbde561bbf1e"},{id:"qualifications.list",version:"1",summary:"qualifications list",method:"GET",path:"/projects/{projectId}/eval-evaluators/{evaluatorId}/qualifications",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_evals.list_qualifications"],input_schema:{type:"object",additionalProperties:!1,properties:{evaluator_id:{type:"string",format:"uuid"}},required:["evaluator_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string",format:"uuid"},set_id:{type:"string",format:"uuid"},challenge_run_id:{type:"string",format:"uuid"},population_run_id:{type:"string",format:"uuid"},challenge_workbench_id:{type:"string",format:"uuid"},population_workbench_id:{type:"string",format:"uuid"},version:{type:"integer"},config_sha256:{type:"string"},status:{type:"string"},activation_status:{type:"string"},source_run_id:{type:["string","null"]},result:{},monitor_id:{type:["string","null"]},monitor_status:{type:["string","null"]},created_at:{type:"string",format:"date-time"}},required:["id","set_id","challenge_run_id","population_run_id","challenge_workbench_id","population_workbench_id","version","config_sha256","status","activation_status","source_run_id","result","monitor_id","monitor_status","created_at"]}}},required:["data"]},binding:{path_inputs:{evaluatorId:"evaluator_id"}},additional_permissions:["evaluator:qualify"],contract_sha256:"0863de6cd4b4b966a11c8f60a4df6b02f5469036be2d9442b5374ab60071a786"},{id:"evaluators.calibrate",version:"1",summary:"evaluators calibrate",method:"POST",path:"/projects/{projectId}/eval-evaluators/{evaluatorId}/qualify",permissions:["eval:write"],scope:"project",access:"write",aliases:["caveman_evals_write.calibrate_evaluator"],input_schema:{type:"object",additionalProperties:!1,properties:{evaluator_id:{type:"string",format:"uuid"},version:{type:"integer",minimum:1},set_id:{type:"string",format:"uuid"}},required:["evaluator_id","version","set_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},evaluator_version_id:{type:"string"},set_id:{type:"string"},challenge_run_id:{type:"string"},population_run_id:{type:"string"},config_sha256:{type:"string"},status:{type:"string"}},required:["id","evaluator_version_id","set_id","challenge_run_id","population_run_id","config_sha256","status"]},binding:{path_inputs:{evaluatorId:"evaluator_id"},body_inputs:["version","set_id"]},native_evaluation:!1,transactional:!0,additional_permissions:["evaluator:qualify"],contract_sha256:"40dbfaa6b89540d0f2354440943d35014edccae78f5c3846325d36d94c3cccb2"},{id:"evals.plan",version:"1",summary:"Smallest detectable drop now, cases needed, price and time before anything runs.",method:"POST",path:"/projects/{projectId}/eval-plan",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_quality.plan"],input_schema:{type:"object",additionalProperties:!1,properties:{workload_id:{type:"string",format:"uuid"},run:{type:"object",additionalProperties:!1,properties:{source:{enum:["eval_run","experiment","scenario_run","factory_comparison"]},run_id:{type:"string",format:"uuid"}},required:["source","run_id"]},metric:{enum:["preference","pass_rate"]},margin:{type:"number",exclusiveMinimum:0},claim:{enum:["cost_and_quality","quality_only"]},criteria:{type:"array",items:{type:"string",format:"uuid"}},cases_available:{type:"integer",minimum:0},trials:{type:"integer",minimum:0},power:{type:"number",exclusiveMinimum:0,exclusiveMaximum:1}},required:["workload_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{sentence:{type:"string"},available_cases:{type:"integer"},mde_at_available:{anyOf:[{type:"number"},{type:"null"}]},required_cases:{anyOf:[{type:"integer"},{type:"null"}]},required_cost:{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]},eta_hours:{anyOf:[{type:"number"},{type:"null"}]},floor_cases:{type:"integer"},joint_power_at_required:{type:"number"},gate_eligible:{anyOf:[{type:"boolean"},{type:"null"}]},assumptions:{type:"object",additionalProperties:!1,properties:{sigma:{anyOf:[{type:"number"},{type:"null"}]},aa_half_width:{anyOf:[{type:"number"},{type:"null"}]},per_case:{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]},tasks_per_hour:{anyOf:[{type:"number"},{type:"null"}]}},required:["sigma","aa_half_width","per_case","tasks_per_hour"]}},required:["sentence","available_cases","mde_at_available","required_cases","required_cost","eta_hours","floor_cases","joint_power_at_required","gate_eligible","assumptions"]},binding:{path_inputs:{},query_inputs:[],body_inputs:["workload_id","run","metric","margin","claim","criteria","cases_available","trials","power"]},contract_sha256:"12b46c670c70121371752f4c3d93174aab9f51ebc2f5c385043345d21566c066"},{id:"qualifications.sets",version:"1",summary:"qualifications sets",method:"GET",path:"/projects/{projectId}/eval-qualification-sets",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_evals.qualification_sets"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{anyOf:[{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{identity_column:{type:"string"},agent_id:{anyOf:[{type:"string"},{type:"null"}]},workflow_id:{anyOf:[{type:"string"},{type:"null"}]},id:{type:"string"},name:{type:"string"},invariant:{type:"string"},grader_type:{type:"string"},subject_column:{type:"string"},label_column:{type:"string"},challenge_version_id:{type:"string"},population_version_id:{type:"string"},sampling_method:{type:"string"},population_definition:{type:"string"},label_provenance:{type:"string"},created_at:{type:"string",format:"date-time"},revoked_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]}},required:["identity_column","agent_id","workflow_id","id","name","invariant","grader_type","subject_column","label_column","challenge_version_id","population_version_id","sampling_method","population_definition","label_provenance","created_at","revoked_at"]}}},required:["data"]},{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string",format:"uuid"},name:{type:"string"},invariant:{type:"string"},grader_type:{type:"string"},created_at:{type:"string",format:"date-time"},supports_live_scoring:{type:"boolean"}},required:["id","name","invariant","grader_type","created_at","supports_live_scoring"]}},has_more:{type:"boolean"}},required:["data","has_more"]}]},binding:{},additional_permissions:["evaluator:qualify"],contract_sha256:"49f4a8031bffd423cd1235c95ce1cd70cf82e05cc326c0958c188307405f65e0"},{id:"qualifications.activate",version:"1",summary:"qualifications activate",method:"POST",path:"/projects/{projectId}/eval-qualifications/{qualificationId}/activate",permissions:["autopilot:manage"],scope:"project",access:"write",aliases:["caveman_evals_write.activate_qualification"],input_schema:{type:"object",additionalProperties:!1,properties:{qualification_id:{type:"string",format:"uuid"}},required:["qualification_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{scoring_authorized:{anyOf:[{type:"boolean"},{type:"null"}]},qualification_id:{anyOf:[{type:"string"},{type:"null"}]},evaluator_id:{anyOf:[{type:"string"},{type:"null"}]},evaluator_version:{anyOf:[{type:"integer"},{type:"null"}]},id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},agent_id:{anyOf:[{type:"string"},{type:"null"}]},workflow_id:{anyOf:[{type:"string"},{type:"null"}]},name:{type:"string"},description:{type:"string"},status:{type:"string"},version:{type:"integer"},graders_json:{},sample_rate:{type:"number"},preconditions_json:{},payload_required:{type:"boolean"},thresholds_json:{},dataset_destination_json:{},created_by:{anyOf:[{type:"string"},{type:"null"}]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"},workload_id:{anyOf:[{type:"string"},{type:"null"}]},scope:{type:"string"},criteria:{type:["array","null"],items:{type:"string"}},sample:{type:"object",additionalProperties:!1,properties:{target_rate:{type:"number"},effective_rate:{type:"number"},paced:{type:"boolean"}},required:["target_rate","effective_rate","paced"]},budget:{anyOf:[{type:"object",additionalProperties:!1,properties:{daily:{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]},spent_today:{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]}},required:["daily","spent_today"]},{type:"null"}]},task_idle_minutes:{type:"integer"},last_result:{anyOf:[{type:"object",additionalProperties:!1,properties:{graded_at:{type:"string",format:"date-time"},verdict:{type:"string"},sampled:{type:"integer"},graded:{type:"integer"},not_graded:{type:"object",additionalProperties:!1,properties:{over_budget:{type:"integer"},too_large:{type:"integer"},stranded:{type:"integer"}},required:["over_budget","too_large","stranded"]}},required:["graded_at","verdict","sampled","graded","not_graded"]},{type:"null"}]}},required:["id","organization_id","project_id","agent_id","workflow_id","name","description","status","version","graders_json","sample_rate","preconditions_json","payload_required","thresholds_json","dataset_destination_json","created_at","updated_at","workload_id","scope","criteria","sample","budget","task_idle_minutes","last_result"]},binding:{path_inputs:{qualificationId:"qualification_id"}},additional_permissions:["evaluator:activate"],contract_sha256:"f8cdfad5c9b9c01981fa66b52a5a5bbf19877e351713e43d38f1bfe6bd9449d3"},{id:"qualifications.cancel",version:"1",summary:"qualifications cancel",method:"POST",path:"/projects/{projectId}/eval-qualifications/{qualificationId}/cancel",permissions:["eval:write"],scope:"project",access:"write",aliases:["caveman_evals_write.cancel_qualification"],input_schema:{type:"object",additionalProperties:!1,properties:{qualification_id:{type:"string",format:"uuid"}},required:["qualification_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string",format:"uuid"},evaluator_version_id:{type:"string",format:"uuid"},set_id:{type:"string",format:"uuid"},challenge_run_id:{type:"string",format:"uuid"},population_run_id:{type:"string",format:"uuid"},config_sha256:{type:"string",pattern:"^[a-f0-9]{64}$"},status:{enum:["pending","qualified","failed","unavailable"]},activation_status:{enum:["not_requested","pending","active","unavailable"]},result:{type:"object",description:"Measured independent challenge and representative-population outcomes. No invented labels or synthetic deployment precision."},source_run_id:{type:["string","null"],format:"uuid"},created_at:{type:"string",format:"date-time"},completed_at:{type:["string","null"],format:"date-time"}},required:["id","evaluator_version_id","set_id","challenge_run_id","population_run_id","config_sha256","status","activation_status","result","source_run_id","created_at","completed_at"]},binding:{path_inputs:{qualificationId:"qualification_id"}},additional_permissions:["evaluator:qualify"],contract_sha256:"37e1f7375efce93660a78b3578c0dbe2968b644ef39052d81425d3d419d52c26"},{id:"qualifications.refresh",version:"1",summary:"qualifications refresh",method:"POST",path:"/projects/{projectId}/eval-qualifications/{qualificationId}/refresh",permissions:["eval:write"],scope:"project",access:"write",aliases:["caveman_evals_write.refresh_qualification"],input_schema:{type:"object",additionalProperties:!1,properties:{qualification_id:{type:"string",format:"uuid"}},required:["qualification_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string",format:"uuid"},evaluator_version_id:{type:"string",format:"uuid"},set_id:{type:"string",format:"uuid"},challenge_run_id:{type:"string",format:"uuid"},population_run_id:{type:"string",format:"uuid"},config_sha256:{type:"string",pattern:"^[a-f0-9]{64}$"},status:{enum:["pending","qualified","failed","unavailable"]},activation_status:{enum:["not_requested","pending","active","unavailable"]},result:{type:"object",description:"Measured independent challenge and representative-population outcomes. No invented labels or synthetic deployment precision."},source_run_id:{type:["string","null"],format:"uuid"},created_at:{type:"string",format:"date-time"},completed_at:{type:["string","null"],format:"date-time"}},required:["id","evaluator_version_id","set_id","challenge_run_id","population_run_id","config_sha256","status","activation_status","result","source_run_id","created_at","completed_at"]},binding:{path_inputs:{qualificationId:"qualification_id"}},additional_permissions:["evaluator:qualify"],contract_sha256:"03b899eb0c7211b605083ea12d245b9ec8a4033a2f71e8eecf62cc15cbbbc4cf"},{id:"scenarios.list",version:"1",summary:"scenarios list",method:"GET",path:"/projects/{projectId}/eval-scenarios",permissions:["payload:read"],scope:"project",access:"read",aliases:["caveman_evals.list_scenarios"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{dataset_id:{type:"string"},name:{type:"string"},scenario_sha256:{type:"string"},source_run_id:{type:"string"},case_id:{type:"string"},execution_status:{type:"string"},version:{type:"integer"}},required:["dataset_id","name","scenario_sha256","source_run_id","case_id","execution_status","version"]}}},required:["data"]},binding:{},native_evaluation:!0,additional_permissions:["scenario:read"],contract_sha256:"dd125831f93cdc0aefbe66bad3a6e3059cc2c58178cc9cd77b1c13cf71eb7bd2"},{id:"scenarios.create",version:"1",summary:"scenarios create",method:"POST",path:"/projects/{projectId}/eval-scenarios",permissions:["eval:write","scenario:write"],scope:"project",access:"write",aliases:["caveman_evals_write.create_scenario"],input_schema:{type:"object",additionalProperties:!1,properties:{schema_version:{const:1},adapter:{enum:["python-module-task-v1","node-module-task-v1"]},name:{type:"string",minLength:1,maxLength:200},invariant:{type:"string",minLength:1,maxLength:4e3},entrypoint:{type:"string",maxLength:200,pattern:"^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*:[A-Za-z_][A-Za-z0-9_]*|[A-Za-z0-9_][A-Za-z0-9_./-]*\\.(js|mjs|ts):[A-Za-z_$][A-Za-z0-9_$]*)$"},input:{},initial_state:{type:"object"},tools:{type:"array",items:{type:"object",additionalProperties:!1,properties:{name:{type:"string",minLength:1,maxLength:100},arguments:{},result:{},error:{type:"string",maxLength:500}},required:["name","arguments","result"]},minItems:0,maxItems:100},read_only_tools:{type:"array",description:"Declared tool names whose calls change nothing. A trial may then skip a call that exactly repeats that tool's latest earlier call (same arguments, result and error); every other fixture must be called in order. Omit when any tool has side effects you are unsure of.",items:{type:"string",minLength:1,maxLength:100},maxItems:100,uniqueItems:!0},assertions:{type:"array",items:{type:"object",additionalProperties:!1,properties:{subject:{enum:["output","state"]},pointer:{type:"string",maxLength:1e3},operator:{enum:["equals","contains","not_contains"]},value:{}},allOf:[{if:{properties:{operator:{enum:["contains","not_contains"]}}},then:{properties:{value:{type:"string",minLength:1}}}}],required:["subject","pointer","operator","value"]},minItems:1,maxItems:100},expected_failure:{type:"object",additionalProperties:!1,properties:{exception_type:{type:"string",minLength:1,maxLength:200},path:{type:"string",minLength:1,maxLength:500},function:{type:"string",minLength:1,maxLength:100}},required:["exception_type","path","function"]},historical:{type:"array",items:{type:"object",additionalProperties:!1,properties:{commit_sha:{type:"string",pattern:"^[a-f0-9]{40}$"},expected:{enum:["passed","failed"]}},required:["commit_sha","expected"]},minItems:0,maxItems:20},provenance:{type:"object",additionalProperties:!1,properties:{evidence_digests:{type:"array",items:{type:"string",pattern:"^[a-f0-9]{64}$"},minItems:1,maxItems:24,uniqueItems:!0},fixture_basis:{const:"synthetic"},fixture_rationale:{type:"string",minLength:1,maxLength:2e3}},required:["evidence_digests","fixture_basis","fixture_rationale"]}},required:["schema_version","adapter","name","invariant","entrypoint","input","initial_state","tools","assertions","historical","provenance"]},output_schema:{type:"object",additionalProperties:!1,properties:{revision:{type:"integer"},project_id:{type:"string"},dataset_id:{type:"string"},version_id:{type:"string"},version:{type:"integer"},scenario_sha256:{type:"string"},execution_status:{type:"string"}},required:["revision","project_id","dataset_id","version_id","version","scenario_sha256","execution_status"]},binding:{body_inputs:["schema_version","adapter","name","invariant","entrypoint","input","initial_state","tools","read_only_tools","assertions","expected_failure","historical","provenance"]},transactional:!0,additional_permissions:["scenario:write"],contract_sha256:"8a2d36e7a9ecbfeb39bb247f56bc825b7c7b6cac592d555dc16adb0179f6ceb5"},{id:"scenarios.update",version:"1",summary:"scenarios update",method:"PUT",path:"/projects/{projectId}/eval-scenarios/{datasetId}",permissions:["eval:write","scenario:write"],scope:"project",access:"write",aliases:["caveman_evals_write.update_scenario"],input_schema:{type:"object",additionalProperties:!1,properties:{dataset_id:{type:"string",format:"uuid"},revision:{type:"integer",minimum:1},definition:{type:"object",additionalProperties:!1,properties:{schema_version:{const:1},adapter:{enum:["python-module-task-v1","node-module-task-v1"]},name:{type:"string",minLength:1,maxLength:200},invariant:{type:"string",minLength:1,maxLength:4e3},entrypoint:{type:"string",maxLength:200,pattern:"^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*:[A-Za-z_][A-Za-z0-9_]*|[A-Za-z0-9_][A-Za-z0-9_./-]*\\.(js|mjs|ts):[A-Za-z_$][A-Za-z0-9_$]*)$"},input:{},initial_state:{type:"object"},tools:{type:"array",items:{type:"object",additionalProperties:!1,properties:{name:{type:"string",minLength:1,maxLength:100},arguments:{},result:{},error:{type:"string",maxLength:500}},required:["name","arguments","result"]},minItems:0,maxItems:100},read_only_tools:{type:"array",description:"Declared tool names whose calls change nothing. A trial may then skip a call that exactly repeats that tool's latest earlier call (same arguments, result and error); every other fixture must be called in order. Omit when any tool has side effects you are unsure of.",items:{type:"string",minLength:1,maxLength:100},maxItems:100,uniqueItems:!0},assertions:{type:"array",items:{type:"object",additionalProperties:!1,properties:{subject:{enum:["output","state"]},pointer:{type:"string",maxLength:1e3},operator:{enum:["equals","contains","not_contains"]},value:{}},allOf:[{if:{properties:{operator:{enum:["contains","not_contains"]}}},then:{properties:{value:{type:"string",minLength:1}}}}],required:["subject","pointer","operator","value"]},minItems:1,maxItems:100},expected_failure:{type:"object",additionalProperties:!1,properties:{exception_type:{type:"string",minLength:1,maxLength:200},path:{type:"string",minLength:1,maxLength:500},function:{type:"string",minLength:1,maxLength:100}},required:["exception_type","path","function"]},historical:{type:"array",items:{type:"object",additionalProperties:!1,properties:{commit_sha:{type:"string",pattern:"^[a-f0-9]{40}$"},expected:{enum:["passed","failed"]}},required:["commit_sha","expected"]},minItems:0,maxItems:20},provenance:{type:"object",additionalProperties:!1,properties:{evidence_digests:{type:"array",items:{type:"string",pattern:"^[a-f0-9]{64}$"},minItems:1,maxItems:24,uniqueItems:!0},fixture_basis:{const:"synthetic"},fixture_rationale:{type:"string",minLength:1,maxLength:2e3}},required:["evidence_digests","fixture_basis","fixture_rationale"]}},required:["schema_version","adapter","name","invariant","entrypoint","input","initial_state","tools","assertions","historical","provenance"]}},required:["dataset_id","revision","definition"]},output_schema:{type:"object",additionalProperties:!1,properties:{revision:{type:"integer"},project_id:{type:"string"},dataset_id:{type:"string"},version_id:{type:"string"},version:{type:"integer"},scenario_sha256:{type:"string"},execution_status:{type:"string"}},required:["revision","project_id","dataset_id","version_id","version","scenario_sha256","execution_status"]},binding:{path_inputs:{datasetId:"dataset_id"},body_inputs:["revision","definition"]},transactional:!0,additional_permissions:["scenario:write"],contract_sha256:"a308913866681f619dfde102642f09529f2d23a9c037b6510d18484501b45604"},{id:"scenarios.get",version:"1",summary:"scenarios get",method:"GET",path:"/projects/{projectId}/eval-scenarios/{datasetId}/versions/{version}",permissions:["payload:read"],scope:"project",access:"read",aliases:["caveman_evals.get_scenario"],input_schema:{type:"object",additionalProperties:!1,properties:{dataset_id:{type:"string",format:"uuid"},version:{type:"integer",minimum:1}},required:["dataset_id","version"]},output_schema:{type:"object",additionalProperties:!1,properties:{revision:{type:"integer"},project_id:{type:"string"},executions:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{run_id:{type:"string"},workbench_id:{type:"string"},native_run_id:{type:"string"},commit_sha:{type:"string"},status:{type:"string"},assessment:{},created_at:{type:"string",format:"date-time"}},required:["run_id","workbench_id","native_run_id","commit_sha","status","assessment","created_at"]}},dataset_id:{type:"string"},version_id:{type:"string"},version:{type:"integer"},definition:{type:"object",additionalProperties:!1,properties:{schema_version:{const:1},adapter:{enum:["python-module-task-v1","node-module-task-v1"]},name:{type:"string",minLength:1,maxLength:200},invariant:{type:"string",minLength:1,maxLength:4e3},entrypoint:{type:"string",maxLength:200,pattern:"^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*:[A-Za-z_][A-Za-z0-9_]*|[A-Za-z0-9_][A-Za-z0-9_./-]*\\.(js|mjs|ts):[A-Za-z_$][A-Za-z0-9_$]*)$"},input:{},initial_state:{type:"object"},tools:{type:"array",items:{type:"object",additionalProperties:!1,properties:{name:{type:"string",minLength:1,maxLength:100},arguments:{},result:{},error:{type:"string",maxLength:500}},required:["name","arguments","result"]},minItems:0,maxItems:100},read_only_tools:{type:"array",description:"Declared tool names whose calls change nothing. A trial may then skip a call that exactly repeats that tool's latest earlier call (same arguments, result and error); every other fixture must be called in order. Omit when any tool has side effects you are unsure of.",items:{type:"string",minLength:1,maxLength:100},maxItems:100,uniqueItems:!0},assertions:{type:"array",items:{type:"object",additionalProperties:!1,properties:{subject:{enum:["output","state"]},pointer:{type:"string",maxLength:1e3},operator:{enum:["equals","contains","not_contains"]},value:{}},allOf:[{if:{properties:{operator:{enum:["contains","not_contains"]}}},then:{properties:{value:{type:"string",minLength:1}}}}],required:["subject","pointer","operator","value"]},minItems:1,maxItems:100},expected_failure:{type:"object",additionalProperties:!1,properties:{exception_type:{type:"string",minLength:1,maxLength:200},path:{type:"string",minLength:1,maxLength:500},function:{type:"string",minLength:1,maxLength:100}},required:["exception_type","path","function"]},historical:{type:"array",items:{type:"object",additionalProperties:!1,properties:{commit_sha:{type:"string",pattern:"^[a-f0-9]{40}$"},expected:{enum:["passed","failed"]}},required:["commit_sha","expected"]},minItems:0,maxItems:20},provenance:{type:"object",additionalProperties:!1,properties:{evidence_digests:{type:"array",items:{type:"string",pattern:"^[a-f0-9]{64}$"},minItems:1,maxItems:24,uniqueItems:!0},fixture_basis:{const:"synthetic"},fixture_rationale:{type:"string",minLength:1,maxLength:2e3}},required:["evidence_digests","fixture_basis","fixture_rationale"]}},required:["schema_version","adapter","name","invariant","entrypoint","input","initial_state","tools","assertions","historical","provenance"]},scenario_sha256:{type:"string"},source_run_id:{type:"string"},case_id:{type:"string"},execution_status:{type:"string"}},required:["revision","project_id","executions","dataset_id","version_id","version","definition","scenario_sha256","execution_status"]},binding:{path_inputs:{datasetId:"dataset_id",version:"version"}},native_evaluation:!0,additional_permissions:["scenario:read"],contract_sha256:"876d9b152c72c3b462134fd8340032c68dc2dcb9bb805599a1ddae5306c05c1e"},{id:"scenarios.compare",version:"1",summary:"scenarios compare",method:"GET",path:"/projects/{projectId}/eval-scenarios/{datasetId}/versions/{version}/runs/compare",permissions:["payload:read"],scope:"project",access:"read",aliases:["caveman_evals.compare_scenarios"],input_schema:{type:"object",additionalProperties:!1,properties:{dataset_id:{type:"string",format:"uuid"},version:{type:"integer",minimum:1},baseline_run_id:{type:"string",format:"uuid"},candidate_run_id:{type:"string",format:"uuid"}},required:["dataset_id","version","baseline_run_id","candidate_run_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{baseline_run_id:{type:"string"},candidate_run_id:{type:"string"},baseline_commit_sha:{type:"string"},candidate_commit_sha:{type:"string"},scenario_sha256:{type:"string"},baseline:{type:"object",additionalProperties:!1,properties:{status:{type:"string"},failure_class:{type:"string"},expected_failure_matched:{type:"boolean"},assertions_passed:{type:"integer"},assertions_total:{type:"integer"},tools_matched:{type:"boolean"},failed_assertions:{type:["array","null"],items:{type:"integer"}},skipped_repeats:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{fixture:{type:"integer"},name:{type:"string"},arguments_sha256:{type:"string"}},required:["fixture","name","arguments_sha256"]}}},required:["status","expected_failure_matched","assertions_passed","assertions_total","tools_matched","failed_assertions"]},candidate:{type:"object",additionalProperties:!1,properties:{status:{type:"string"},failure_class:{type:"string"},expected_failure_matched:{type:"boolean"},assertions_passed:{type:"integer"},assertions_total:{type:"integer"},tools_matched:{type:"boolean"},failed_assertions:{type:["array","null"],items:{type:"integer"}},skipped_repeats:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{fixture:{type:"integer"},name:{type:"string"},arguments_sha256:{type:"string"}},required:["fixture","name","arguments_sha256"]}}},required:["status","expected_failure_matched","assertions_passed","assertions_total","tools_matched","failed_assertions"]},quality:{type:"string"},regressions:{type:"integer"},improvements:{type:"integer"},evidence_basis:{type:"string"},cost_savings_usd:{anyOf:[{type:"number"},{type:"null"}]}},required:["baseline_run_id","candidate_run_id","baseline_commit_sha","candidate_commit_sha","scenario_sha256","baseline","candidate","quality","regressions","improvements","evidence_basis","cost_savings_usd"]},binding:{path_inputs:{datasetId:"dataset_id",version:"version"},query_inputs:["baseline_run_id","candidate_run_id"]},native_evaluation:!0,additional_permissions:["scenario:read"],contract_sha256:"a88d1ae20956986b0d6777f6905721f829edb5fd4a7df2e16a28900ebd421498"},{id:"evals.list",version:"1",summary:"evals list",method:"GET",path:"/projects/{projectId}/eval-workbenches",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_evals.list_workbenches"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},name:{type:"string"},description:{type:"string"},status:{type:"string"},document:{title:"Caveman evaluation workbench",description:"Versioned dataset-target-evaluator document used by UI, REST, CI and agent tools.",type:"object",required:["schema_version","datasets","active_dataset_key","targets","evaluators","settings"],additionalProperties:!1,properties:{schema_version:{const:1},datasets:{type:"array",minItems:1,maxItems:8,items:{type:"object",required:["key","dataset_id"],additionalProperties:!1,properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},dataset_id:{type:"string",format:"uuid"},version:{type:"integer",minimum:1},document_sha256:{type:"string",pattern:"^[0-9a-f]{64}$"}},dependentRequired:{version:["document_sha256"],document_sha256:["version"]}}},active_dataset_key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},targets:{type:"array",minItems:1,maxItems:24,items:{oneOf:[{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"prompt"},config:{type:"object",required:["prompt_id","prompt_version","provider","model"],additionalProperties:!1,properties:{prompt_id:{type:"string",format:"uuid"},prompt_version:{type:"integer",minimum:1},provider:{type:"string",minLength:1,maxLength:100},model:{type:"string",minLength:1,maxLength:200},temperature:{type:"number",minimum:0,maximum:2},max_tokens:{type:"integer",minimum:1,maximum:1048576},response_format:{enum:["text","json"]}}}}}],unevaluatedProperties:!1},{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"agent"},config:{type:"object",required:["agent_id","endpoint","method","authentication"],additionalProperties:!1,properties:{agent_id:{type:"string",format:"uuid"},workflow_id:{type:"string",format:"uuid"},endpoint:{type:"string",format:"uri",pattern:"^https://[^?#]+$"},method:{const:"POST"},authentication:{type:"object",required:["type"],additionalProperties:!1,properties:{type:{const:"none"}}},output_path:{type:"string",pattern:"^/"}}}}}],unevaluatedProperties:!1},{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"workflow"},config:{type:"object",required:["workflow_id","endpoint","method","authentication"],additionalProperties:!1,properties:{workflow_id:{type:"string",format:"uuid"},endpoint:{type:"string",format:"uri",pattern:"^https://[^?#]+$"},method:{const:"POST"},authentication:{type:"object",required:["type"],additionalProperties:!1,properties:{type:{const:"none"}}},output_path:{type:"string",pattern:"^/"}}}}}],unevaluatedProperties:!1},{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"recorded"},config:{type:"object",required:["output_column"],additionalProperties:!1,properties:{output_column:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}}}}],unevaluatedProperties:!1},{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"http"},config:{type:"object",required:["endpoint","method","authentication"],additionalProperties:!1,properties:{endpoint:{type:"string",format:"uri",pattern:"^https://[^?#]+$"},method:{const:"POST"},authentication:{type:"object",required:["type"],additionalProperties:!1,properties:{type:{const:"none"}}},output_path:{type:"string",pattern:"^/"}}}}}],unevaluatedProperties:!1},{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"model"},config:{type:"object",required:["user_template","provider","model"],additionalProperties:!1,properties:{provider:{type:"string",minLength:1,maxLength:100},model:{type:"string",minLength:1,maxLength:200},temperature:{type:"number",minimum:0,maximum:2},max_tokens:{type:"integer",minimum:1,maximum:1048576},response_format:{enum:["text","json"]},user_template:{type:"string",minLength:1,maxLength:262144},system_template:{type:"string",maxLength:262144}}}}}],unevaluatedProperties:!1},{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"evaluator"},config:{type:"object",additionalProperties:!1,required:["evaluator_id","evaluator_version","config_sha256"],properties:{evaluator_id:{type:"string",format:"uuid"},evaluator_version:{type:"integer",minimum:1},config_sha256:{type:"string",pattern:"^[0-9a-f]{64}$"}}}}}],unevaluatedProperties:!1},{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"scenario"},config:{type:"object",additionalProperties:!1,required:["dataset_id","version","scenario_sha256","repository_commit_sha","recipe_id","recipe_sha256"],properties:{dataset_id:{type:"string",format:"uuid"},version:{type:"integer",minimum:1},scenario_sha256:{type:"string",pattern:"^[0-9a-f]{64}$"},repository_commit_sha:{type:"string",pattern:"^[a-f0-9]{40}$"},recipe_id:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},recipe_sha256:{type:"string",pattern:"^[0-9a-f]{64}$"}}}}}],unevaluatedProperties:!1}]}},evaluators:{type:"array",maxItems:24,items:{oneOf:[{type:"object",required:["key","name","source","evaluator_id","evaluator_version","config_sha256"],additionalProperties:!1,properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},source:{const:"saved"},target_keys:{type:"array",uniqueItems:!0,items:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},evaluator_id:{type:"string",format:"uuid"},evaluator_version:{type:"integer",minimum:1},config_sha256:{type:"string",pattern:"^[0-9a-f]{64}$"},input_mapping:{type:"object",required:["candidate"],additionalProperties:!1,properties:{candidate:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},reference:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},baseline:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}}}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",required:["candidate"],additionalProperties:!1,properties:{candidate:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},reference:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},baseline:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}}}}}}},{type:"object",required:["key","name","source","grader_type","options","input_mapping"],additionalProperties:!1,properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},source:{const:"inline"},target_keys:{type:"array",uniqueItems:!0,items:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},grader_type:{type:"string",minLength:1,maxLength:100},options:{type:"object"},input_mapping:{type:"object",required:["candidate"],additionalProperties:!1,properties:{candidate:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},reference:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},baseline:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}}}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",required:["candidate"],additionalProperties:!1,properties:{candidate:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},reference:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},baseline:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}}}}}}}]}},settings:{type:"object",required:["concurrency","row_height"],additionalProperties:!1,properties:{concurrency:{type:"integer",minimum:1,maximum:24},row_height:{enum:["compact","comfortable"]},judge_order:{enum:["randomized","fixed"]},judge_seed:{type:"integer",minimum:0}}},comparison:{type:"object",additionalProperties:!1,properties:{primary_evaluator_key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},confidence_level:{enum:[.9,.95,.99]},minimum_samples:{type:"integer",minimum:2,maximum:1e4}}}}},document_sha256:{type:"string"},revision:{type:"integer"},current_version:{type:"integer"},created_by:{anyOf:[{type:"string"},{type:"null"}]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"}},required:["id","organization_id","project_id","name","description","status","document","document_sha256","revision","current_version","created_at","updated_at"]}},next_cursor:{type:"null"}},required:["data","next_cursor"]},binding:{},native_evaluation:!0,contract_sha256:"ed6722a99e448741c640b975931c4f55857d92c3dac51f97f149b2f46d41394a"},{id:"evals.create",version:"1",summary:"evals create",method:"POST",path:"/projects/{projectId}/eval-workbenches",permissions:["eval:write"],scope:"project",access:"write",aliases:["caveman_evals_write.create_workbench"],input_schema:{type:"object",additionalProperties:!1,properties:{name:{type:"string",minLength:1,maxLength:200},description:{type:"string",maxLength:2e3},document:{title:"Caveman evaluation workbench",description:"Versioned dataset-target-evaluator document used by UI, REST, CI and agent tools.",type:"object",required:["schema_version","datasets","active_dataset_key","targets","evaluators","settings"],additionalProperties:!1,properties:{schema_version:{const:1},datasets:{type:"array",minItems:1,maxItems:8,items:{type:"object",required:["key","dataset_id"],additionalProperties:!1,properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},dataset_id:{type:"string",format:"uuid"},version:{type:"integer",minimum:1},document_sha256:{type:"string",pattern:"^[0-9a-f]{64}$"}},dependentRequired:{version:["document_sha256"],document_sha256:["version"]}}},active_dataset_key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},targets:{type:"array",minItems:1,maxItems:24,items:{oneOf:[{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"prompt"},config:{type:"object",required:["prompt_id","prompt_version","provider","model"],additionalProperties:!1,properties:{prompt_id:{type:"string",format:"uuid"},prompt_version:{type:"integer",minimum:1},provider:{type:"string",minLength:1,maxLength:100},model:{type:"string",minLength:1,maxLength:200},temperature:{type:"number",minimum:0,maximum:2},max_tokens:{type:"integer",minimum:1,maximum:1048576},response_format:{enum:["text","json"]}}}}}],unevaluatedProperties:!1},{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"agent"},config:{type:"object",required:["agent_id","endpoint","method","authentication"],additionalProperties:!1,properties:{agent_id:{type:"string",format:"uuid"},workflow_id:{type:"string",format:"uuid"},endpoint:{type:"string",format:"uri",pattern:"^https://[^?#]+$"},method:{const:"POST"},authentication:{type:"object",required:["type"],additionalProperties:!1,properties:{type:{const:"none"}}},output_path:{type:"string",pattern:"^/"}}}}}],unevaluatedProperties:!1},{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"workflow"},config:{type:"object",required:["workflow_id","endpoint","method","authentication"],additionalProperties:!1,properties:{workflow_id:{type:"string",format:"uuid"},endpoint:{type:"string",format:"uri",pattern:"^https://[^?#]+$"},method:{const:"POST"},authentication:{type:"object",required:["type"],additionalProperties:!1,properties:{type:{const:"none"}}},output_path:{type:"string",pattern:"^/"}}}}}],unevaluatedProperties:!1},{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"recorded"},config:{type:"object",required:["output_column"],additionalProperties:!1,properties:{output_column:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}}}}],unevaluatedProperties:!1},{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"http"},config:{type:"object",required:["endpoint","method","authentication"],additionalProperties:!1,properties:{endpoint:{type:"string",format:"uri",pattern:"^https://[^?#]+$"},method:{const:"POST"},authentication:{type:"object",required:["type"],additionalProperties:!1,properties:{type:{const:"none"}}},output_path:{type:"string",pattern:"^/"}}}}}],unevaluatedProperties:!1},{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"model"},config:{type:"object",required:["user_template","provider","model"],additionalProperties:!1,properties:{provider:{type:"string",minLength:1,maxLength:100},model:{type:"string",minLength:1,maxLength:200},temperature:{type:"number",minimum:0,maximum:2},max_tokens:{type:"integer",minimum:1,maximum:1048576},response_format:{enum:["text","json"]},user_template:{type:"string",minLength:1,maxLength:262144},system_template:{type:"string",maxLength:262144}}}}}],unevaluatedProperties:!1},{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"evaluator"},config:{type:"object",additionalProperties:!1,required:["evaluator_id","evaluator_version","config_sha256"],properties:{evaluator_id:{type:"string",format:"uuid"},evaluator_version:{type:"integer",minimum:1},config_sha256:{type:"string",pattern:"^[0-9a-f]{64}$"}}}}}],unevaluatedProperties:!1},{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"scenario"},config:{type:"object",additionalProperties:!1,required:["dataset_id","version","scenario_sha256","repository_commit_sha","recipe_id","recipe_sha256"],properties:{dataset_id:{type:"string",format:"uuid"},version:{type:"integer",minimum:1},scenario_sha256:{type:"string",pattern:"^[0-9a-f]{64}$"},repository_commit_sha:{type:"string",pattern:"^[a-f0-9]{40}$"},recipe_id:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},recipe_sha256:{type:"string",pattern:"^[0-9a-f]{64}$"}}}}}],unevaluatedProperties:!1}]}},evaluators:{type:"array",maxItems:24,items:{oneOf:[{type:"object",required:["key","name","source","evaluator_id","evaluator_version","config_sha256"],additionalProperties:!1,properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},source:{const:"saved"},target_keys:{type:"array",uniqueItems:!0,items:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},evaluator_id:{type:"string",format:"uuid"},evaluator_version:{type:"integer",minimum:1},config_sha256:{type:"string",pattern:"^[0-9a-f]{64}$"},input_mapping:{type:"object",required:["candidate"],additionalProperties:!1,properties:{candidate:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},reference:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},baseline:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}}}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",required:["candidate"],additionalProperties:!1,properties:{candidate:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},reference:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},baseline:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}}}}}}},{type:"object",required:["key","name","source","grader_type","options","input_mapping"],additionalProperties:!1,properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},source:{const:"inline"},target_keys:{type:"array",uniqueItems:!0,items:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},grader_type:{type:"string",minLength:1,maxLength:100},options:{type:"object"},input_mapping:{type:"object",required:["candidate"],additionalProperties:!1,properties:{candidate:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},reference:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},baseline:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}}}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",required:["candidate"],additionalProperties:!1,properties:{candidate:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},reference:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},baseline:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}}}}}}}]}},settings:{type:"object",required:["concurrency","row_height"],additionalProperties:!1,properties:{concurrency:{type:"integer",minimum:1,maximum:24},row_height:{enum:["compact","comfortable"]},judge_order:{enum:["randomized","fixed"]},judge_seed:{type:"integer",minimum:0}}},comparison:{type:"object",additionalProperties:!1,properties:{primary_evaluator_key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},confidence_level:{enum:[.9,.95,.99]},minimum_samples:{type:"integer",minimum:2,maximum:1e4}}}}}},required:["name","document"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string",format:"uuid"},project_id:{type:"string",format:"uuid"},revision:{type:"integer",minimum:1},current_version:{type:"integer",minimum:0},status:{type:"string"},document_sha256:{type:"string",pattern:"^[a-f0-9]{64}$"},config_sha256:{type:"string",pattern:"^[a-f0-9]{64}$"}},required:["id","project_id","revision","status"]},binding:{body_inputs:["name","description","document"]},native_evaluation:!0,transactional:!0,resources:[{type:"evals",id_field:"id",version_field:"current_version",revision_field:"revision"}],contract_sha256:"2c33ce3794460500285fe5bd7c44163a6174c9035662ce796ae8d1cc66eefb8b"},{id:"evals.archive",version:"1",summary:"evals archive",method:"DELETE",path:"/projects/{projectId}/eval-workbenches/{workbenchId}",permissions:["eval:write"],scope:"project",access:"none",exclusion:"Archives a shared workbench and removes it from active experiment authoring. A human owns retirement of shared evaluation work.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{workbench_id:{type:"string",format:"uuid"},revision:{type:"integer",minimum:1}},required:["workbench_id","revision"]},output_schema:{type:"object",additionalProperties:!0},binding:{path_inputs:{workbenchId:"workbench_id"},query_inputs:["revision"]},transactional:!0,contract_sha256:"ffe3c4130ef404e7ebb783216eb5786fd28d63e62293d6c1981b51bf2d197c0e"},{id:"evals.get",version:"1",summary:"evals get",method:"GET",path:"/projects/{projectId}/eval-workbenches/{workbenchId}",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_evals.get_workbench"],input_schema:{type:"object",additionalProperties:!1,properties:{workbench_id:{type:"string",format:"uuid"}},required:["workbench_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{workbench:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},name:{type:"string"},description:{type:"string"},status:{type:"string"},document:{title:"Caveman evaluation workbench",description:"Versioned dataset-target-evaluator document used by UI, REST, CI and agent tools.",type:"object",required:["schema_version","datasets","active_dataset_key","targets","evaluators","settings"],additionalProperties:!1,properties:{schema_version:{const:1},datasets:{type:"array",minItems:1,maxItems:8,items:{type:"object",required:["key","dataset_id"],additionalProperties:!1,properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},dataset_id:{type:"string",format:"uuid"},version:{type:"integer",minimum:1},document_sha256:{type:"string",pattern:"^[0-9a-f]{64}$"}},dependentRequired:{version:["document_sha256"],document_sha256:["version"]}}},active_dataset_key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},targets:{type:"array",minItems:1,maxItems:24,items:{oneOf:[{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"prompt"},config:{type:"object",required:["prompt_id","prompt_version","provider","model"],additionalProperties:!1,properties:{prompt_id:{type:"string",format:"uuid"},prompt_version:{type:"integer",minimum:1},provider:{type:"string",minLength:1,maxLength:100},model:{type:"string",minLength:1,maxLength:200},temperature:{type:"number",minimum:0,maximum:2},max_tokens:{type:"integer",minimum:1,maximum:1048576},response_format:{enum:["text","json"]}}}}}],unevaluatedProperties:!1},{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"agent"},config:{type:"object",required:["agent_id","endpoint","method","authentication"],additionalProperties:!1,properties:{agent_id:{type:"string",format:"uuid"},workflow_id:{type:"string",format:"uuid"},endpoint:{type:"string",format:"uri",pattern:"^https://[^?#]+$"},method:{const:"POST"},authentication:{type:"object",required:["type"],additionalProperties:!1,properties:{type:{const:"none"}}},output_path:{type:"string",pattern:"^/"}}}}}],unevaluatedProperties:!1},{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"workflow"},config:{type:"object",required:["workflow_id","endpoint","method","authentication"],additionalProperties:!1,properties:{workflow_id:{type:"string",format:"uuid"},endpoint:{type:"string",format:"uri",pattern:"^https://[^?#]+$"},method:{const:"POST"},authentication:{type:"object",required:["type"],additionalProperties:!1,properties:{type:{const:"none"}}},output_path:{type:"string",pattern:"^/"}}}}}],unevaluatedProperties:!1},{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"recorded"},config:{type:"object",required:["output_column"],additionalProperties:!1,properties:{output_column:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}}}}],unevaluatedProperties:!1},{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"http"},config:{type:"object",required:["endpoint","method","authentication"],additionalProperties:!1,properties:{endpoint:{type:"string",format:"uri",pattern:"^https://[^?#]+$"},method:{const:"POST"},authentication:{type:"object",required:["type"],additionalProperties:!1,properties:{type:{const:"none"}}},output_path:{type:"string",pattern:"^/"}}}}}],unevaluatedProperties:!1},{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"model"},config:{type:"object",required:["user_template","provider","model"],additionalProperties:!1,properties:{provider:{type:"string",minLength:1,maxLength:100},model:{type:"string",minLength:1,maxLength:200},temperature:{type:"number",minimum:0,maximum:2},max_tokens:{type:"integer",minimum:1,maximum:1048576},response_format:{enum:["text","json"]},user_template:{type:"string",minLength:1,maxLength:262144},system_template:{type:"string",maxLength:262144}}}}}],unevaluatedProperties:!1},{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"evaluator"},config:{type:"object",additionalProperties:!1,required:["evaluator_id","evaluator_version","config_sha256"],properties:{evaluator_id:{type:"string",format:"uuid"},evaluator_version:{type:"integer",minimum:1},config_sha256:{type:"string",pattern:"^[0-9a-f]{64}$"}}}}}],unevaluatedProperties:!1},{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"scenario"},config:{type:"object",additionalProperties:!1,required:["dataset_id","version","scenario_sha256","repository_commit_sha","recipe_id","recipe_sha256"],properties:{dataset_id:{type:"string",format:"uuid"},version:{type:"integer",minimum:1},scenario_sha256:{type:"string",pattern:"^[0-9a-f]{64}$"},repository_commit_sha:{type:"string",pattern:"^[a-f0-9]{40}$"},recipe_id:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},recipe_sha256:{type:"string",pattern:"^[0-9a-f]{64}$"}}}}}],unevaluatedProperties:!1}]}},evaluators:{type:"array",maxItems:24,items:{oneOf:[{type:"object",required:["key","name","source","evaluator_id","evaluator_version","config_sha256"],additionalProperties:!1,properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},source:{const:"saved"},target_keys:{type:"array",uniqueItems:!0,items:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},evaluator_id:{type:"string",format:"uuid"},evaluator_version:{type:"integer",minimum:1},config_sha256:{type:"string",pattern:"^[0-9a-f]{64}$"},input_mapping:{type:"object",required:["candidate"],additionalProperties:!1,properties:{candidate:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},reference:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},baseline:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}}}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",required:["candidate"],additionalProperties:!1,properties:{candidate:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},reference:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},baseline:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}}}}}}},{type:"object",required:["key","name","source","grader_type","options","input_mapping"],additionalProperties:!1,properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},source:{const:"inline"},target_keys:{type:"array",uniqueItems:!0,items:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},grader_type:{type:"string",minLength:1,maxLength:100},options:{type:"object"},input_mapping:{type:"object",required:["candidate"],additionalProperties:!1,properties:{candidate:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},reference:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},baseline:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}}}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",required:["candidate"],additionalProperties:!1,properties:{candidate:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},reference:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},baseline:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}}}}}}}]}},settings:{type:"object",required:["concurrency","row_height"],additionalProperties:!1,properties:{concurrency:{type:"integer",minimum:1,maximum:24},row_height:{enum:["compact","comfortable"]},judge_order:{enum:["randomized","fixed"]},judge_seed:{type:"integer",minimum:0}}},comparison:{type:"object",additionalProperties:!1,properties:{primary_evaluator_key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},confidence_level:{enum:[.9,.95,.99]},minimum_samples:{type:"integer",minimum:2,maximum:1e4}}}}},document_sha256:{type:"string"},revision:{type:"integer"},current_version:{type:"integer"},created_by:{anyOf:[{type:"string"},{type:"null"}]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"}},required:["id","organization_id","project_id","name","description","status","document","document_sha256","revision","current_version","created_at","updated_at"]},versions:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},workbench_id:{type:"string"},version:{type:"integer"},document:{title:"Caveman evaluation workbench",description:"Versioned dataset-target-evaluator document used by UI, REST, CI and agent tools.",type:"object",required:["schema_version","datasets","active_dataset_key","targets","evaluators","settings"],additionalProperties:!1,properties:{schema_version:{const:1},datasets:{type:"array",minItems:1,maxItems:8,items:{type:"object",required:["key","dataset_id"],additionalProperties:!1,properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},dataset_id:{type:"string",format:"uuid"},version:{type:"integer",minimum:1},document_sha256:{type:"string",pattern:"^[0-9a-f]{64}$"}},dependentRequired:{version:["document_sha256"],document_sha256:["version"]}}},active_dataset_key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},targets:{type:"array",minItems:1,maxItems:24,items:{oneOf:[{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"prompt"},config:{type:"object",required:["prompt_id","prompt_version","provider","model"],additionalProperties:!1,properties:{prompt_id:{type:"string",format:"uuid"},prompt_version:{type:"integer",minimum:1},provider:{type:"string",minLength:1,maxLength:100},model:{type:"string",minLength:1,maxLength:200},temperature:{type:"number",minimum:0,maximum:2},max_tokens:{type:"integer",minimum:1,maximum:1048576},response_format:{enum:["text","json"]}}}}}],unevaluatedProperties:!1},{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"agent"},config:{type:"object",required:["agent_id","endpoint","method","authentication"],additionalProperties:!1,properties:{agent_id:{type:"string",format:"uuid"},workflow_id:{type:"string",format:"uuid"},endpoint:{type:"string",format:"uri",pattern:"^https://[^?#]+$"},method:{const:"POST"},authentication:{type:"object",required:["type"],additionalProperties:!1,properties:{type:{const:"none"}}},output_path:{type:"string",pattern:"^/"}}}}}],unevaluatedProperties:!1},{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"workflow"},config:{type:"object",required:["workflow_id","endpoint","method","authentication"],additionalProperties:!1,properties:{workflow_id:{type:"string",format:"uuid"},endpoint:{type:"string",format:"uri",pattern:"^https://[^?#]+$"},method:{const:"POST"},authentication:{type:"object",required:["type"],additionalProperties:!1,properties:{type:{const:"none"}}},output_path:{type:"string",pattern:"^/"}}}}}],unevaluatedProperties:!1},{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"recorded"},config:{type:"object",required:["output_column"],additionalProperties:!1,properties:{output_column:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}}}}],unevaluatedProperties:!1},{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"http"},config:{type:"object",required:["endpoint","method","authentication"],additionalProperties:!1,properties:{endpoint:{type:"string",format:"uri",pattern:"^https://[^?#]+$"},method:{const:"POST"},authentication:{type:"object",required:["type"],additionalProperties:!1,properties:{type:{const:"none"}}},output_path:{type:"string",pattern:"^/"}}}}}],unevaluatedProperties:!1},{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"model"},config:{type:"object",required:["user_template","provider","model"],additionalProperties:!1,properties:{provider:{type:"string",minLength:1,maxLength:100},model:{type:"string",minLength:1,maxLength:200},temperature:{type:"number",minimum:0,maximum:2},max_tokens:{type:"integer",minimum:1,maximum:1048576},response_format:{enum:["text","json"]},user_template:{type:"string",minLength:1,maxLength:262144},system_template:{type:"string",maxLength:262144}}}}}],unevaluatedProperties:!1},{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"evaluator"},config:{type:"object",additionalProperties:!1,required:["evaluator_id","evaluator_version","config_sha256"],properties:{evaluator_id:{type:"string",format:"uuid"},evaluator_version:{type:"integer",minimum:1},config_sha256:{type:"string",pattern:"^[0-9a-f]{64}$"}}}}}],unevaluatedProperties:!1},{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"scenario"},config:{type:"object",additionalProperties:!1,required:["dataset_id","version","scenario_sha256","repository_commit_sha","recipe_id","recipe_sha256"],properties:{dataset_id:{type:"string",format:"uuid"},version:{type:"integer",minimum:1},scenario_sha256:{type:"string",pattern:"^[0-9a-f]{64}$"},repository_commit_sha:{type:"string",pattern:"^[a-f0-9]{40}$"},recipe_id:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},recipe_sha256:{type:"string",pattern:"^[0-9a-f]{64}$"}}}}}],unevaluatedProperties:!1}]}},evaluators:{type:"array",maxItems:24,items:{oneOf:[{type:"object",required:["key","name","source","evaluator_id","evaluator_version","config_sha256"],additionalProperties:!1,properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},source:{const:"saved"},target_keys:{type:"array",uniqueItems:!0,items:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},evaluator_id:{type:"string",format:"uuid"},evaluator_version:{type:"integer",minimum:1},config_sha256:{type:"string",pattern:"^[0-9a-f]{64}$"},input_mapping:{type:"object",required:["candidate"],additionalProperties:!1,properties:{candidate:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},reference:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},baseline:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}}}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",required:["candidate"],additionalProperties:!1,properties:{candidate:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},reference:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},baseline:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}}}}}}},{type:"object",required:["key","name","source","grader_type","options","input_mapping"],additionalProperties:!1,properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},source:{const:"inline"},target_keys:{type:"array",uniqueItems:!0,items:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},grader_type:{type:"string",minLength:1,maxLength:100},options:{type:"object"},input_mapping:{type:"object",required:["candidate"],additionalProperties:!1,properties:{candidate:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},reference:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},baseline:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}}}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",required:["candidate"],additionalProperties:!1,properties:{candidate:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},reference:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},baseline:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}}}}}}}]}},settings:{type:"object",required:["concurrency","row_height"],additionalProperties:!1,properties:{concurrency:{type:"integer",minimum:1,maximum:24},row_height:{enum:["compact","comfortable"]},judge_order:{enum:["randomized","fixed"]},judge_seed:{type:"integer",minimum:0}}},comparison:{type:"object",additionalProperties:!1,properties:{primary_evaluator_key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},confidence_level:{enum:[.9,.95,.99]},minimum_samples:{type:"integer",minimum:2,maximum:1e4}}}}},document_sha256:{type:"string"},provenance:{},snapshot_reason:{type:"string"},created_by:{anyOf:[{type:"string"},{type:"null"}]},created_at:{type:"string",format:"date-time"}},required:["id","organization_id","project_id","workbench_id","version","document","document_sha256","provenance","snapshot_reason","created_at"]}}},required:["workbench","versions"]},binding:{path_inputs:{workbenchId:"workbench_id"}},native_evaluation:!0,contract_sha256:"c7f5e10aade0d75775ac59b283cc9bc26c0acb5db554316ff2310b74f5e65663"},{id:"evals.update",version:"1",summary:"evals update",method:"PUT",path:"/projects/{projectId}/eval-workbenches/{workbenchId}",permissions:["eval:write"],scope:"project",access:"write",aliases:["caveman_evals_write.update_workbench"],input_schema:{type:"object",additionalProperties:!1,properties:{workbench_id:{type:"string",format:"uuid"},revision:{type:"integer",minimum:1},name:{type:"string",minLength:1,maxLength:200},description:{type:"string",maxLength:2e3},document:{title:"Caveman evaluation workbench",description:"Versioned dataset-target-evaluator document used by UI, REST, CI and agent tools.",type:"object",required:["schema_version","datasets","active_dataset_key","targets","evaluators","settings"],additionalProperties:!1,properties:{schema_version:{const:1},datasets:{type:"array",minItems:1,maxItems:8,items:{type:"object",required:["key","dataset_id"],additionalProperties:!1,properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},dataset_id:{type:"string",format:"uuid"},version:{type:"integer",minimum:1},document_sha256:{type:"string",pattern:"^[0-9a-f]{64}$"}},dependentRequired:{version:["document_sha256"],document_sha256:["version"]}}},active_dataset_key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},targets:{type:"array",minItems:1,maxItems:24,items:{oneOf:[{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"prompt"},config:{type:"object",required:["prompt_id","prompt_version","provider","model"],additionalProperties:!1,properties:{prompt_id:{type:"string",format:"uuid"},prompt_version:{type:"integer",minimum:1},provider:{type:"string",minLength:1,maxLength:100},model:{type:"string",minLength:1,maxLength:200},temperature:{type:"number",minimum:0,maximum:2},max_tokens:{type:"integer",minimum:1,maximum:1048576},response_format:{enum:["text","json"]}}}}}],unevaluatedProperties:!1},{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"agent"},config:{type:"object",required:["agent_id","endpoint","method","authentication"],additionalProperties:!1,properties:{agent_id:{type:"string",format:"uuid"},workflow_id:{type:"string",format:"uuid"},endpoint:{type:"string",format:"uri",pattern:"^https://[^?#]+$"},method:{const:"POST"},authentication:{type:"object",required:["type"],additionalProperties:!1,properties:{type:{const:"none"}}},output_path:{type:"string",pattern:"^/"}}}}}],unevaluatedProperties:!1},{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"workflow"},config:{type:"object",required:["workflow_id","endpoint","method","authentication"],additionalProperties:!1,properties:{workflow_id:{type:"string",format:"uuid"},endpoint:{type:"string",format:"uri",pattern:"^https://[^?#]+$"},method:{const:"POST"},authentication:{type:"object",required:["type"],additionalProperties:!1,properties:{type:{const:"none"}}},output_path:{type:"string",pattern:"^/"}}}}}],unevaluatedProperties:!1},{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"recorded"},config:{type:"object",required:["output_column"],additionalProperties:!1,properties:{output_column:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}}}}],unevaluatedProperties:!1},{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"http"},config:{type:"object",required:["endpoint","method","authentication"],additionalProperties:!1,properties:{endpoint:{type:"string",format:"uri",pattern:"^https://[^?#]+$"},method:{const:"POST"},authentication:{type:"object",required:["type"],additionalProperties:!1,properties:{type:{const:"none"}}},output_path:{type:"string",pattern:"^/"}}}}}],unevaluatedProperties:!1},{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"model"},config:{type:"object",required:["user_template","provider","model"],additionalProperties:!1,properties:{provider:{type:"string",minLength:1,maxLength:100},model:{type:"string",minLength:1,maxLength:200},temperature:{type:"number",minimum:0,maximum:2},max_tokens:{type:"integer",minimum:1,maximum:1048576},response_format:{enum:["text","json"]},user_template:{type:"string",minLength:1,maxLength:262144},system_template:{type:"string",maxLength:262144}}}}}],unevaluatedProperties:!1},{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"evaluator"},config:{type:"object",additionalProperties:!1,required:["evaluator_id","evaluator_version","config_sha256"],properties:{evaluator_id:{type:"string",format:"uuid"},evaluator_version:{type:"integer",minimum:1},config_sha256:{type:"string",pattern:"^[0-9a-f]{64}$"}}}}}],unevaluatedProperties:!1},{allOf:[{type:"object",required:["key","name","kind","input_mapping","config"],properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},kind:{enum:["prompt","agent","workflow","recorded","http","model","evaluator","scenario"]},input_mapping:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}}},config:{type:"object"}}},{properties:{kind:{const:"scenario"},config:{type:"object",additionalProperties:!1,required:["dataset_id","version","scenario_sha256","repository_commit_sha","recipe_id","recipe_sha256"],properties:{dataset_id:{type:"string",format:"uuid"},version:{type:"integer",minimum:1},scenario_sha256:{type:"string",pattern:"^[0-9a-f]{64}$"},repository_commit_sha:{type:"string",pattern:"^[a-f0-9]{40}$"},recipe_id:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},recipe_sha256:{type:"string",pattern:"^[0-9a-f]{64}$"}}}}}],unevaluatedProperties:!1}]}},evaluators:{type:"array",maxItems:24,items:{oneOf:[{type:"object",required:["key","name","source","evaluator_id","evaluator_version","config_sha256"],additionalProperties:!1,properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},source:{const:"saved"},target_keys:{type:"array",uniqueItems:!0,items:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},evaluator_id:{type:"string",format:"uuid"},evaluator_version:{type:"integer",minimum:1},config_sha256:{type:"string",pattern:"^[0-9a-f]{64}$"},input_mapping:{type:"object",required:["candidate"],additionalProperties:!1,properties:{candidate:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},reference:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},baseline:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}}}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",required:["candidate"],additionalProperties:!1,properties:{candidate:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},reference:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},baseline:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}}}}}}},{type:"object",required:["key","name","source","grader_type","options","input_mapping"],additionalProperties:!1,properties:{key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},name:{type:"string",minLength:1,maxLength:200},source:{const:"inline"},target_keys:{type:"array",uniqueItems:!0,items:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"}},grader_type:{type:"string",minLength:1,maxLength:100},options:{type:"object"},input_mapping:{type:"object",required:["candidate"],additionalProperties:!1,properties:{candidate:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},reference:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},baseline:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}}}},dataset_input_mappings:{type:"object",additionalProperties:{type:"object",required:["candidate"],additionalProperties:!1,properties:{candidate:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},reference:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}},baseline:{type:"object",required:["source","key"],additionalProperties:!1,properties:{source:{enum:["dataset","target"]},key:{oneOf:[{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},{const:"$target"}]}}}}}}}}]}},settings:{type:"object",required:["concurrency","row_height"],additionalProperties:!1,properties:{concurrency:{type:"integer",minimum:1,maximum:24},row_height:{enum:["compact","comfortable"]},judge_order:{enum:["randomized","fixed"]},judge_seed:{type:"integer",minimum:0}}},comparison:{type:"object",additionalProperties:!1,properties:{primary_evaluator_key:{type:"string",pattern:"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$"},confidence_level:{enum:[.9,.95,.99]},minimum_samples:{type:"integer",minimum:2,maximum:1e4}}}}}},required:["workbench_id","revision","name","document"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string",format:"uuid"},project_id:{type:"string",format:"uuid"},revision:{type:"integer",minimum:1},current_version:{type:"integer",minimum:0},status:{type:"string"},document_sha256:{type:"string",pattern:"^[a-f0-9]{64}$"},config_sha256:{type:"string",pattern:"^[a-f0-9]{64}$"}},required:["id","project_id","revision","status"]},binding:{path_inputs:{workbenchId:"workbench_id"},body_inputs:["revision","name","description","document"]},native_evaluation:!0,transactional:!0,resources:[{type:"evals",id_field:"id",version_field:"current_version",revision_field:"revision"}],contract_sha256:"f6e4077673fb01d7f51bc07477011abaa01d877616efb1678a4ca499ac8d412a"},{id:"evals.restore",version:"1",summary:"evals restore",method:"POST",path:"/projects/{projectId}/eval-workbenches/{workbenchId}/restore",permissions:["eval:write"],scope:"project",access:"write",aliases:["caveman_evals_write.restore_workbench_version"],input_schema:{type:"object",additionalProperties:!1,properties:{workbench_id:{type:"string",format:"uuid"},revision:{type:"integer",minimum:1},version:{type:"integer",minimum:1}},required:["workbench_id","revision","version"]},output_schema:{type:"object",additionalProperties:!1,properties:{workbench:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},status:{type:"string"},document_sha256:{type:"string"},revision:{type:"integer"},current_version:{type:"integer"}},required:["id","project_id","status","document_sha256","revision","current_version"]},preserved_version:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},workbench_id:{type:"string"},version:{type:"integer"},document_sha256:{type:"string"}},required:["id","project_id","workbench_id","version","document_sha256"]}},required:["workbench","preserved_version"]},binding:{path_inputs:{workbenchId:"workbench_id"},body_inputs:["revision","version"]},native_evaluation:!0,transactional:!0,contract_sha256:"056f330c56169444d85010b059b352eb664abb1e64385328a7214fd158580521"},{id:"evals.runs",version:"1",summary:"evals runs",method:"GET",path:"/projects/{projectId}/eval-workbenches/{workbenchId}/runs",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_evals.list_workbench_runs"],input_schema:{type:"object",additionalProperties:!1,properties:{workbench_id:{type:"string",format:"uuid"}},required:["workbench_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},workbench_id:{type:"string"},workbench_version_id:{type:"string"},status:{type:"string"},scope:{},concurrency:{type:"integer"},progress_completed:{type:"integer"},progress_total:{type:"integer"},summary:{},error_code:{anyOf:[{type:"string"},{type:"null"}]},error_message:{anyOf:[{type:"string"},{type:"null"}]},created_by:{anyOf:[{type:"string"},{type:"null"}]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"},started_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},completed_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]}},required:["id","organization_id","project_id","workbench_id","workbench_version_id","status","scope","concurrency","progress_completed","progress_total","summary","created_at","updated_at"]}},next_cursor:{type:"null"}},required:["data","next_cursor"]},binding:{path_inputs:{workbenchId:"workbench_id"}},native_evaluation:!0,contract_sha256:"f09375f97bbf4b02986101a08bf7a4834d4efed02f44d64c4778ac0bfcdc1d49"},{id:"evals.run",version:"1",summary:"evals run",method:"POST",path:"/projects/{projectId}/eval-workbenches/{workbenchId}/runs",permissions:["experiment:run"],scope:"project",access:"write",aliases:["caveman_evals_write.run_workbench"],input_schema:{type:"object",additionalProperties:!1,properties:{workbench_id:{type:"string",format:"uuid"},concurrency:{type:"integer",minimum:1,maximum:24},scope:{type:"object",additionalProperties:!1,properties:{kind:{enum:["all","target","row","cell","evaluator"]},target_key:{type:"string"},row_key:{type:"string"},evaluator_key:{type:"string"},source_run_id:{type:"string",format:"uuid"}},required:["kind"]}},required:["workbench_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{run:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},workbench_id:{type:"string"},status:{type:"string"}},required:["id","project_id","workbench_id","status"]},outbox_id:{type:"string",format:"uuid"},delivery_status:{type:"string"}},required:["run","outbox_id","delivery_status"]},binding:{path_inputs:{workbenchId:"workbench_id"},body_inputs:["scope","concurrency"]},native_evaluation:!0,transactional:!0,async_kind:"eval",contract_sha256:"901c7b2a5b8c5c38df865bdd28494c579b1b2b46fc377f4da43f68720aeaf8b8"},{id:"evals.result",version:"1",summary:"Reads immutable evaluation inputs, target outputs, metrics and grader verdicts; requires explicit payload:read scope. While the run is queued or running, since (an earlier read's next_since) returns only the cells changed after it, without their inputs; merge them by id.",method:"GET",path:"/projects/{projectId}/eval-workbenches/{workbenchId}/runs/{runId}",permissions:["payload:read"],scope:"project",access:"read",aliases:["caveman_evals.get_workbench_run"],input_schema:{type:"object",additionalProperties:!1,properties:{workbench_id:{type:"string",format:"uuid"},run_id:{type:"string",format:"uuid"},since:{type:"string",format:"date-time"}},required:["workbench_id","run_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{run:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},workbench_id:{type:"string"},workbench_version_id:{type:"string"},status:{type:"string"},scope:{},concurrency:{type:"integer"},progress_completed:{type:"integer"},progress_total:{type:"integer"},summary:{},error_code:{anyOf:[{type:"string"},{type:"null"}]},error_message:{anyOf:[{type:"string"},{type:"null"}]},created_by:{anyOf:[{type:"string"},{type:"null"}]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"},started_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},completed_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]}},required:["id","organization_id","project_id","workbench_id","workbench_version_id","status","scope","concurrency","progress_completed","progress_total","summary","created_at","updated_at"]},cells:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},run_id:{type:"string"},dataset_row_key:{type:"string"},target_key:{type:"string"},status:{type:"string"},input:{},output:{},evaluator_results:{},metrics:{},error_code:{anyOf:[{type:"string"},{type:"null"}]},error_message:{anyOf:[{type:"string"},{type:"null"}]},trace_id:{anyOf:[{type:"string"},{type:"null"}]},started_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},completed_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"}},required:["id","organization_id","project_id","run_id","dataset_row_key","target_key","status","input","output","evaluator_results","metrics","created_at","updated_at"]}},quality:{type:"object",additionalProperties:!1,properties:{status:{type:"string"},reason:{type:"string"},passed:{type:"integer"},failed:{type:"integer"},cells:{type:"integer"},evidence_basis:{type:"string"}},required:["status","passed","failed","cells","evidence_basis"]},next_since:{type:"string",format:"date-time"}},required:["run","cells","quality"]},binding:{path_inputs:{workbenchId:"workbench_id",runId:"run_id"},query_inputs:["since"]},native_evaluation:!0,contract_sha256:"6acce553302026fbdf985f8ff6e28a275b42a14315cd57b8ae97234b165f6aca"},{id:"evals.list_run_annotations",version:"1",summary:"Reads human review notes attached to evaluation cells; requires explicit payload:read scope.",method:"GET",path:"/projects/{projectId}/eval-workbenches/{workbenchId}/runs/{runId}/annotations",permissions:["payload:read"],scope:"project",access:"read",aliases:["caveman_evals.list_run_annotations"],input_schema:{type:"object",additionalProperties:!1,properties:{cell_id:{type:"string"},status:{type:"string"},workbench_id:{type:"string",format:"uuid"},run_id:{type:"string",format:"uuid"}},required:["workbench_id","run_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},cell_id:{type:"string"},label:{type:"string"},note:{type:"string"},value:{},status:{type:"string"},assignee_id:{anyOf:[{type:"string"},{type:"null"}]},revision:{type:"integer"},created_by:{anyOf:[{type:"string"},{type:"null"}]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"}},required:["id","organization_id","project_id","cell_id","label","note","value","status","revision","created_at","updated_at"]}},next_cursor:{type:"null"}},required:["data","next_cursor"]},binding:{path_inputs:{workbenchId:"workbench_id",runId:"run_id"},query_inputs:["cell_id","status"],body_inputs:[]},contract_sha256:"277055a8884df9f65f2f07a603ac7f6468ac422477eccefa9b4651fc2467c186"},{id:"evals.cancel",version:"1",summary:"evals cancel",method:"POST",path:"/projects/{projectId}/eval-workbenches/{workbenchId}/runs/{runId}/cancel",permissions:["experiment:run"],scope:"project",access:"write",aliases:["caveman_evals_write.cancel_workbench_run"],input_schema:{type:"object",additionalProperties:!1,properties:{workbench_id:{type:"string",format:"uuid"},run_id:{type:"string",format:"uuid"}},required:["workbench_id","run_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},workbench_id:{type:"string"},status:{type:"string"}},required:["id","project_id","workbench_id","status"]},binding:{path_inputs:{workbenchId:"workbench_id",runId:"run_id"},body_inputs:[]},native_evaluation:!0,transactional:!0,contract_sha256:"2b11e9cac452df107ec9279ab1252fcb9d146a47dfd811864afe6e88abe95897"},{id:"evals.compare",version:"1",summary:"Compare persisted complete runs with identical dataset and evaluator provenance. Returns paired verdicts; never certifies savings or rollout authority.",method:"GET",path:"/projects/{projectId}/eval-workbenches/{workbenchId}/runs/compare",permissions:["payload:read"],scope:"project",access:"read",aliases:["caveman_evals.compare_runs"],input_schema:{type:"object",additionalProperties:!1,properties:{workbench_id:{type:"string",format:"uuid"},baseline_run_id:{type:"string",format:"uuid"},candidate_run_id:{type:"string",format:"uuid"}},required:["workbench_id","baseline_run_id","candidate_run_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{baseline_run_id:{type:"string"},candidate_run_id:{type:"string"},baseline_document_sha256:{type:"string"},candidate_document_sha256:{type:"string"},baseline:{type:"object",additionalProperties:!1,properties:{status:{type:"string"},reason:{type:"string"},passed:{type:"integer"},failed:{type:"integer"},cells:{type:"integer"},evidence_basis:{type:"string"}},required:["status","passed","failed","cells","evidence_basis"]},candidate:{type:"object",additionalProperties:!1,properties:{status:{type:"string"},reason:{type:"string"},passed:{type:"integer"},failed:{type:"integer"},cells:{type:"integer"},evidence_basis:{type:"string"}},required:["status","passed","failed","cells","evidence_basis"]},paired_cells:{type:"integer"},regressions:{type:"integer"},improvements:{type:"integer"},quality:{type:"string"},cost_basis:{type:"string"},cost_savings_usd:{anyOf:[{type:"number"},{type:"null"}]},limitations:{type:["array","null"],items:{type:"string"}}},required:["baseline_run_id","candidate_run_id","baseline_document_sha256","candidate_document_sha256","baseline","candidate","paired_cells","regressions","improvements","quality","cost_basis","cost_savings_usd","limitations"]},binding:{path_inputs:{workbenchId:"workbench_id"},query_inputs:["baseline_run_id","candidate_run_id"]},native_evaluation:!0,contract_sha256:"ba4b1a75d542c772c38a5676dcd05a48d83d6c82b243433e372bcf760135b4b0"},{id:"evals.snapshot",version:"1",summary:"evals snapshot",method:"POST",path:"/projects/{projectId}/eval-workbenches/{workbenchId}/versions",permissions:["eval:write"],scope:"project",access:"write",aliases:["caveman_evals_write.snapshot_workbench"],input_schema:{type:"object",additionalProperties:!1,properties:{workbench_id:{type:"string",format:"uuid"},reason:{const:"manual"}},required:["workbench_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},workbench_id:{type:"string"},version:{type:"integer"},document_sha256:{type:"string"}},required:["id","project_id","workbench_id","version","document_sha256"]},binding:{path_inputs:{workbenchId:"workbench_id"},body_inputs:["reason"]},native_evaluation:!0,transactional:!0,contract_sha256:"6df794637edd3cba08950b8cde80037de13dc2eadde07a80d6a3d8fb575b1f3f"},{id:"human.github",version:"1",summary:"human: github",method:"GET",path:"/projects/{projectId}/github",permissions:["trace:read_metadata"],scope:"project",access:"none",exclusion:"Repository binding is an OAuth trust relationship between two accounts. The human owns both sides of it.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"cd0427b23ec10dd8e4b8f42d9030749158bb3d30de9b5ca2221dcece49b6579f"},{id:"github.connect_init",version:"1",summary:"Start connecting a GitHub repository to the project.",method:"POST",path:"/projects/{projectId}/github/connect-init",permissions:["repo:connect"],scope:"project",access:"none",exclusion:"Repository binding is an OAuth trust relationship between two accounts. The human owns both sides of it.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}},body:{type:"object",additionalProperties:!0}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"a43f80f1f3d9a26fc043064a179e547f054f23c9aca7290cdb323d70c43ac822"},{id:"github.select_repo",version:"1",summary:"Bind one repository from the GitHub installation to the project.",method:"POST",path:"/projects/{projectId}/github/select-repo",permissions:["repo:connect"],scope:"project",access:"none",exclusion:"Repository binding is an OAuth trust relationship between two accounts. The human owns both sides of it.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}},body:{type:"object",additionalProperties:!0}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"808b337b49b81a5b8e520f427bffc5462506598cadb9db34007d210c7127055f"},{id:"github.set_test_command",version:"1",summary:"Set the command the fix sandbox runs as the repository test oracle.",method:"PUT",path:"/projects/{projectId}/github/test-command",permissions:["repo:connect"],scope:"project",access:"none",exclusion:"Sets the shell command the fix sandbox runs as the repo_tests oracle. A human confirming that line is what makes the oracle evidence rather than a stranger's shell; an agent that could set it would be choosing the gate it is judged by.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}},body:{type:"object",additionalProperties:!0}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"0e7789ab0318dcae2ed72ed526762999f73cc43f7b049f077b3727eae9d95d00"},{id:"policy.guardrails",version:"1",summary:"policy: guardrails",method:"GET",path:"/projects/{projectId}/guardrails",permissions:["settings:read","policy:draft"],scope:"project",access:"read",aliases:["caveman_policy.guardrails"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{rules:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{name:{type:"string"},kind:{type:"string"},mode:{type:"string"},action:{type:"string"},default_on:{type:"boolean"},patterns:{type:["array","null"],items:{type:"string"}},keywords:{type:["array","null"],items:{type:"string"}},entities:{type:["array","null"],items:{type:"string"}},url:{type:"string"},timeout_ms:{type:"integer"},on_error:{type:"string"},secret_ref:{type:"string"}},required:["name","kind","mode","action"]}},signing_secrets:{type:["object","null"],additionalProperties:{type:"string"}}},required:["rules"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"93786d68be5f0fe6aeee7c091f79a7395889a9de29cccd1c5838de84b62a9910"},{id:"human.update_guardrails",version:"1",summary:"human: update_guardrails",method:"PUT",path:"/projects/{projectId}/guardrails",permissions:["policy:draft"],scope:"project",access:"none",exclusion:"A guardrail is the control that constrains this agent's own traffic; an agent able to edit one is able to remove it. Human-only regardless of agent competence.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}},body:{type:"object",additionalProperties:!0}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"76cead7c10c903e9956310e5058b9eaa5a8d5031497dcf5d4be14570017101f9"},{id:"policy.guardrail_hits",version:"1",summary:"policy: guardrail_hits",method:"GET",path:"/projects/{projectId}/guardrails/hits",permissions:["settings:read","policy:draft"],scope:"project",access:"read",aliases:["caveman_policy.guardrail_hits"],input_schema:{type:"object",additionalProperties:!1,properties:{window:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{available:{type:"boolean"},window:{type:"string"},hits:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{name:{type:"string"},action:{type:"string"},count:{type:"integer"}},required:["name","action","count"]}}},required:["available","window","hits"]},binding:{path_inputs:{},query_inputs:["window"],body_inputs:[]},contract_sha256:"86330cf5248f384103f660cb2edfbd9288e81a039c7e773f493dd01cc64c4ddd"},{id:"policy.test_guardrails",version:"1",summary:"policy: test_guardrails",method:"POST",path:"/projects/{projectId}/guardrails/test",permissions:["policy:draft"],scope:"project",access:"read",aliases:["caveman_policy.test_guardrails"],input_schema:{type:"object",additionalProperties:!1,properties:{text:{type:"string"},direction:{enum:["request","response"]}}},output_schema:{type:"object",additionalProperties:!1,properties:{verdicts:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{action:{type:"string"},rule:{type:"string"},kind:{type:"string"},mode:{type:"string"}},required:["action","rule","kind","mode"]}},masked:{type:"string"},blocked:{type:"boolean"}},required:["verdicts","masked","blocked"]},binding:{path_inputs:{},query_inputs:[],body_inputs:["text","direction"]},contract_sha256:"c0e22e191d3a194c70939912a5e220a89d736f0709e3df0d00de0a05f65ffa5e"},{id:"judges.list",version:"1",summary:"Judges in resolution order and which ones draft, grade and gate.",method:"GET",path:"/projects/{projectId}/judges",permissions:["org:read"],scope:"project",access:"read",aliases:["caveman_quality.list_judges"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},rank:{type:"integer"},source:{type:"string"},role:{type:"string"},name:{type:"string"},wire:{anyOf:[{type:"string"},{type:"null"}]},endpoint_host:{anyOf:[{type:"string"},{type:"null"}]},model_id:{type:"string"},family:{type:"string"},qualifies:{type:"boolean"},reasons:{type:["array","null"],items:{type:"string"}},gating_eligible:{type:"boolean"},calibrations:{type:"integer"},last_tested_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]}},required:["id","rank","source","role","name","wire","endpoint_host","model_id","family","qualifies","reasons","gating_eligible","calibrations","last_tested_at"]}},active:{type:"object",additionalProperties:!1,properties:{drafting:{type:["string","null"]},grading:{type:["string","null"]},gating:{type:["array","null"],items:{type:"string"}}},required:["drafting","grading","gating"]}},required:["data","active"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"461627b68d1f420f37c3c9621bbd4553a5434437c95e8ac75066f69e0aeb41a0"},{id:"judges.calibration",version:"1",summary:"A judge's calibration per criterion version.",method:"GET",path:"/projects/{projectId}/judges/{judgeId}/calibrations",permissions:["org:read"],scope:"project",access:"read",aliases:["caveman_quality.judge_calibration"],input_schema:{type:"object",additionalProperties:!1,properties:{criterion_id:{type:"string"},cursor:{type:"string"},limit:{type:"integer",minimum:0},judge_id:{anyOf:[{type:"string",format:"uuid"},{const:"installation"}]}},required:["judge_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{model_id:{type:"string"},criterion_id:{type:"string"},criterion_version:{type:"integer"},criterion_label:{type:"string"},temperature:{type:"number"},escalate_below_margin:{anyOf:[{type:"number"},{type:"null"}]},anchors:{type:"integer"},base_rate:{type:"number"},calibration_error:{type:"number"},fitted_at:{type:"string",format:"date-time"}},required:["model_id","criterion_id","criterion_version","criterion_label","temperature","escalate_below_margin","anchors","base_rate","calibration_error","fitted_at"]}},next_cursor:{type:["string","null"]}},required:["data","next_cursor"]},binding:{path_inputs:{judgeId:"judge_id"},query_inputs:["criterion_id","cursor","limit"],body_inputs:[]},contract_sha256:"b3195d4064805deb064289d84f254a61fc884f288c2c8e3dde6cfc8956c04ed1"},{id:"judges.test",version:"1",summary:"Ask a judge a fixed probe set and report its typed answers.",method:"POST",path:"/projects/{projectId}/judges/{judgeId}/test",permissions:["provider:manage"],scope:"project",access:"none",exclusion:"Calls a judge with the project's stored credential. Agents never use or verify the secrets that pay for judging.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{judge_id:{anyOf:[{type:"string",format:"uuid"},{const:"installation"}]}},required:["judge_id"]},output_schema:{type:"object",additionalProperties:!0},binding:{path_inputs:{judgeId:"judge_id"},query_inputs:[],body_inputs:[]},contract_sha256:"3234f249a7116fd49eb327f72feaccb07dcfc615df4abde3c6a3e692624fe9df"},{id:"judgments.list",version:"1",summary:"Judgments on a unit, run, monitor, criterion or workload, with culprit steps as refs.",method:"GET",path:"/projects/{projectId}/judgments",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_traces.list_judgments"],input_schema:{type:"object",additionalProperties:!1,properties:{unit_id:{type:"string"},task_key:{type:"string"},trace_id:{type:"string"},run_id:{type:"string"},monitor_id:{type:"string"},criterion_id:{type:"string"},workload_id:{type:"string"},verdict:{type:"string"},latest:{type:"string"},from:{type:"string",format:"date-time"},to:{type:"string",format:"date-time"},cursor:{type:"string"},limit:{type:"integer",minimum:0}}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},scope:{type:"string"},unit_id:{type:"string"},task_key:{anyOf:[{type:"string"},{type:"null"}]},trace_id:{anyOf:[{type:"string"},{type:"null"}]},request_id:{anyOf:[{type:"string"},{type:"null"}]},criterion_id:{type:"string"},criterion_version:{type:"integer"},label:{type:"string"},statement:{anyOf:[{type:"string"},{type:"null"}]},run_id:{anyOf:[{type:"string"},{type:"null"}]},cell_id:{anyOf:[{type:"string"},{type:"null"}]},arm:{anyOf:[{type:"string"},{type:"null"}]},trial:{anyOf:[{type:"integer"},{type:"null"}]},monitor_id:{anyOf:[{type:"string"},{type:"null"}]},verdict:{type:"string"},reason_code:{anyOf:[{type:"string"},{type:"null"}]},probability:{anyOf:[{type:"number"},{type:"null"}]},margin:{anyOf:[{type:"number"},{type:"null"}]},calibrated:{type:"boolean"},source:{type:"string"},connection:{anyOf:[{type:"string"},{type:"null"}]},model_id:{anyOf:[{type:"string"},{type:"null"}]},family:{anyOf:[{type:"string"},{type:"null"}]},escalated_from:{anyOf:[{type:"string"},{type:"null"}]},failing_steps:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{step_id:{type:"string"},body_ref:{anyOf:[{type:"object",additionalProperties:!1,properties:{request_id:{type:"string"},kind:{type:"string"},offset:{type:"integer"},len:{type:"integer"}},required:["request_id","kind","offset","len"]},{type:"null"}]}},required:["step_id","body_ref"]}},failing_windows:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{first_step_id:{type:"string"},last_step_id:{type:"string"}},required:["first_step_id","last_step_id"]}},category:{anyOf:[{type:"string"},{type:"null"}]},windows_scored:{type:"integer"},windows_total:{type:"integer"},capture_gaps:{type:["array","null"],items:{type:"string"}},rung:{type:"string"},provenance:{type:"string"},inclusion_probability:{type:"number"},trusted:{type:"boolean"},judge_cost:{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]},graded_at:{type:"string"}},required:["id","scope","unit_id","task_key","trace_id","request_id","criterion_id","criterion_version","label","statement","run_id","cell_id","arm","trial","monitor_id","verdict","reason_code","probability","margin","calibrated","source","connection","model_id","family","escalated_from","failing_steps","failing_windows","category","windows_scored","windows_total","capture_gaps","rung","provenance","inclusion_probability","trusted","judge_cost","graded_at"]}},next_cursor:{type:["string","null"]}},required:["data","next_cursor"]},binding:{path_inputs:{},query_inputs:["unit_id","task_key","trace_id","run_id","monitor_id","criterion_id","workload_id","verdict","latest","from","to","cursor","limit"],body_inputs:[]},contract_sha256:"256a1a0314e92ef4e7129c2d31278e9d49de5d745d1fda9c506f1dc10d353041"},{id:"judgments.explain",version:"1",summary:"One-sentence explanation of a failed judgment, written when a person opens it.",method:"POST",path:"/projects/{projectId}/judgments/{judgmentId}/explanation",permissions:["payload:read"],scope:"project",access:"none",exclusion:"Spends a cross-family LLM call on captured content when a person opens a failed judgment (SPEC \xA74.3). Agents read failing steps and evidence refs instead.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{judgment_id:{type:"string",pattern:"^[a-f0-9]{32}$"}},required:["judgment_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{judgment_id:{type:"string"},sentence:{type:"string"},steps:{type:["array","null"],items:{type:"string"}},model_id:{type:"string"},family:{type:"string"},cost:{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]},cached:{type:"boolean"}},required:["judgment_id","sentence","steps","model_id","family","cost","cached"]},binding:{path_inputs:{judgmentId:"judgment_id"},query_inputs:[],body_inputs:[]},contract_sha256:"3327cdbf7cebaca4259b2ebf01659a8d1a6561dee3abde22579321317f6d6537"},{id:"human.list_keys",version:"1",summary:"human: list_keys",method:"GET",path:"/projects/{projectId}/keys",permissions:["key:manage"],scope:"project",access:"none",exclusion:"Mints or approves a credential. An agent must never be able to widen its own access \u2014 this is the escalation boundary that makes scoped agent connections meaningful.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"8ae555bc3ff59c030b3c296417f4515cdb9e4aa7f096619212098742cb741e8f"},{id:"alerts.list",version:"1",summary:"List the project's metric alerts, optionally for one dashboard.",method:"GET",path:"/projects/{projectId}/metric-alerts",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_alerts.list"],input_schema:{type:"object",additionalProperties:!1,properties:{dashboard_id:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{alerts:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},dashboard_id:{anyOf:[{type:"string"},{type:"null"}]},chart_id:{anyOf:[{type:"string"},{type:"null"}]},name:{type:"string"},query:{},comparator:{enum:[">",">=","<","<="]},threshold:{type:"number"},window_minutes:{type:"integer"},notify_interval_minutes:{type:"integer"},no_data:{enum:["keep","resolve","trigger"]},webhook_id:{anyOf:[{type:"string"},{type:"null"}]},paused:{type:"boolean"},state:{enum:["ok","firing","no_data","failing"]},last_value:{anyOf:[{type:"number"},{type:"null"}]},last_error:{anyOf:[{type:"string"},{type:"null"}]},last_evaluated_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},last_fired_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},created_by:{anyOf:[{type:"string"},{type:"null"}]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"}},required:["id","project_id","dashboard_id","chart_id","name","query","comparator","threshold","window_minutes","notify_interval_minutes","no_data","webhook_id","paused","state","last_value","last_error","last_evaluated_at","last_fired_at","created_by","created_at","updated_at"]}}},required:["alerts"]},binding:{path_inputs:{},query_inputs:["dashboard_id"],body_inputs:[]},contract_sha256:"9ada057b7a596e6938006a1f47f5321c502c66391aba764dec71396c7c4ade70"},{id:"alerts.create",version:"1",summary:"Create a metric alert on a big-number query; it notifies owners and admins, and an existing webhook if named.",method:"POST",path:"/projects/{projectId}/metric-alerts",permissions:["dashboard:write"],scope:"project",access:"write",aliases:["caveman_alerts_write.create"],input_schema:{type:"object",additionalProperties:!1,properties:{name:{type:"string",minLength:1,maxLength:120},dashboard_id:{type:["string","null"],maxLength:64},chart_id:{type:["string","null"]},query:{type:"object",additionalProperties:!1,properties:{id:{type:"string",pattern:"^[A-Za-z0-9_-]{1,64}$"},title:{type:"string",minLength:1,maxLength:120},type:{enum:["timeseries","toplist","bignumber"]},source:{enum:["requests","spans","tools","evals"]},preset:{type:["string","null"]},measures:{type:"array",items:{type:"object",additionalProperties:!1,properties:{label:{type:"string"},field:{type:"string"},agg:{enum:["count","sum","avg","min","max","count_distinct","percentile"]},p:{type:"number",exclusiveMinimum:0,exclusiveMaximum:1},expr:{type:"string",maxLength:2e3}}},minItems:1,maxItems:6},filters:{type:"object",additionalProperties:!1,properties:{row:{type:"string",maxLength:2e3},trace:{type:"string",maxLength:2e3}}},group_by:{type:"string"},options:{type:"object",additionalProperties:!1,properties:{unit:{enum:["duration","cost","count","percent","bytes"]},viz:{enum:["line","bar"]},stacked:{type:"boolean"},interval:{enum:["auto","hour","day","week"]},sort:{enum:["value_desc","value_asc","name_asc","name_desc"]},limit:{type:"integer",minimum:1,maximum:50}}},layout:{type:"object",additionalProperties:!1,properties:{w:{enum:[3,4,6,8,12]},h:{enum:[1,2,3]}},required:["w","h"]},section_id:{type:["string","null"]}},required:["title","type","source","measures"]},comparator:{enum:[">",">=","<","<="]},threshold:{type:"number"},window_minutes:{type:"integer",minimum:5,maximum:1440},notify_interval_minutes:{type:"integer",minimum:5,maximum:1440},no_data:{enum:["keep","resolve","trigger"]},webhook_id:{type:["string","null"],format:"uuid"},paused:{type:"boolean"}},required:["name","query","comparator","threshold","window_minutes","notify_interval_minutes"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},dashboard_id:{anyOf:[{type:"string"},{type:"null"}]},chart_id:{anyOf:[{type:"string"},{type:"null"}]},name:{type:"string"},query:{},comparator:{enum:[">",">=","<","<="]},threshold:{type:"number"},window_minutes:{type:"integer"},notify_interval_minutes:{type:"integer"},no_data:{enum:["keep","resolve","trigger"]},webhook_id:{anyOf:[{type:"string"},{type:"null"}]},paused:{type:"boolean"},state:{enum:["ok","firing","no_data","failing"]},last_value:{anyOf:[{type:"number"},{type:"null"}]},last_error:{anyOf:[{type:"string"},{type:"null"}]},last_evaluated_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},last_fired_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},created_by:{anyOf:[{type:"string"},{type:"null"}]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"}},required:["id","project_id","dashboard_id","chart_id","name","query","comparator","threshold","window_minutes","notify_interval_minutes","no_data","webhook_id","paused","state","last_value","last_error","last_evaluated_at","last_fired_at","created_by","created_at","updated_at"]},binding:{path_inputs:{},query_inputs:[],body_inputs:["name","dashboard_id","chart_id","query","comparator","threshold","window_minutes","notify_interval_minutes","no_data","webhook_id","paused"]},contract_sha256:"bdb1010a904c33826bb9b1d65651ca071d934195518f05e848dae9eeed708ae0"},{id:"alerts.delete",version:"1",summary:"Delete a metric alert.",method:"DELETE",path:"/projects/{projectId}/metric-alerts/{alertId}",permissions:["dashboard:write"],scope:"project",access:"write",aliases:["caveman_alerts_write.delete"],input_schema:{type:"object",additionalProperties:!1,properties:{alert_id:{type:"string",format:"uuid"}},required:["alert_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{status:{const:"deleted"}},required:["status"]},binding:{path_inputs:{alertId:"alert_id"},query_inputs:[],body_inputs:[]},contract_sha256:"de0fa88b380619cf8f18134fec4f716c8db3b1898798f8acb24e7f4e95e9c9c2"},{id:"alerts.update",version:"1",summary:"Change, pause or resume a metric alert.",method:"PATCH",path:"/projects/{projectId}/metric-alerts/{alertId}",permissions:["dashboard:write"],scope:"project",access:"write",aliases:["caveman_alerts_write.update"],input_schema:{type:"object",additionalProperties:!1,properties:{name:{type:"string",minLength:1,maxLength:120},dashboard_id:{type:["string","null"],maxLength:64},chart_id:{type:["string","null"]},query:{type:"object",additionalProperties:!1,properties:{id:{type:"string",pattern:"^[A-Za-z0-9_-]{1,64}$"},title:{type:"string",minLength:1,maxLength:120},type:{enum:["timeseries","toplist","bignumber"]},source:{enum:["requests","spans","tools","evals"]},preset:{type:["string","null"]},measures:{type:"array",items:{type:"object",additionalProperties:!1,properties:{label:{type:"string"},field:{type:"string"},agg:{enum:["count","sum","avg","min","max","count_distinct","percentile"]},p:{type:"number",exclusiveMinimum:0,exclusiveMaximum:1},expr:{type:"string",maxLength:2e3}}},minItems:1,maxItems:6},filters:{type:"object",additionalProperties:!1,properties:{row:{type:"string",maxLength:2e3},trace:{type:"string",maxLength:2e3}}},group_by:{type:"string"},options:{type:"object",additionalProperties:!1,properties:{unit:{enum:["duration","cost","count","percent","bytes"]},viz:{enum:["line","bar"]},stacked:{type:"boolean"},interval:{enum:["auto","hour","day","week"]},sort:{enum:["value_desc","value_asc","name_asc","name_desc"]},limit:{type:"integer",minimum:1,maximum:50}}},layout:{type:"object",additionalProperties:!1,properties:{w:{enum:[3,4,6,8,12]},h:{enum:[1,2,3]}},required:["w","h"]},section_id:{type:["string","null"]}},required:["title","type","source","measures"]},comparator:{enum:[">",">=","<","<="]},threshold:{type:"number"},window_minutes:{type:"integer",minimum:5,maximum:1440},notify_interval_minutes:{type:"integer",minimum:5,maximum:1440},no_data:{enum:["keep","resolve","trigger"]},webhook_id:{type:["string","null"],format:"uuid"},paused:{type:"boolean"},alert_id:{type:"string",format:"uuid"}},required:["alert_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},dashboard_id:{anyOf:[{type:"string"},{type:"null"}]},chart_id:{anyOf:[{type:"string"},{type:"null"}]},name:{type:"string"},query:{},comparator:{enum:[">",">=","<","<="]},threshold:{type:"number"},window_minutes:{type:"integer"},notify_interval_minutes:{type:"integer"},no_data:{enum:["keep","resolve","trigger"]},webhook_id:{anyOf:[{type:"string"},{type:"null"}]},paused:{type:"boolean"},state:{enum:["ok","firing","no_data","failing"]},last_value:{anyOf:[{type:"number"},{type:"null"}]},last_error:{anyOf:[{type:"string"},{type:"null"}]},last_evaluated_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},last_fired_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},created_by:{anyOf:[{type:"string"},{type:"null"}]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"}},required:["id","project_id","dashboard_id","chart_id","name","query","comparator","threshold","window_minutes","notify_interval_minutes","no_data","webhook_id","paused","state","last_value","last_error","last_evaluated_at","last_fired_at","created_by","created_at","updated_at"]},binding:{path_inputs:{alertId:"alert_id"},query_inputs:[],body_inputs:["name","dashboard_id","chart_id","query","comparator","threshold","window_minutes","notify_interval_minutes","no_data","webhook_id","paused"]},contract_sha256:"30a5e275a9e4d0f8be5718d8c6afe2adec2caab7aef971b6f6a11b8226994599"},{id:"fixes.list_novelty",version:"1",summary:"fixes: list_novelty",method:"GET",path:"/projects/{projectId}/novelty",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_fixes.list_novelty"],input_schema:{type:"object",additionalProperties:!1,properties:{classification:{type:"string"},status:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},facet:{type:"string"},summary:{type:"string"},classification:{type:"string"},signal_json:{},unit_id:{anyOf:[{type:"string"},{type:"null"}]},trace_id:{anyOf:[{type:"string"},{type:"null"}]},embedding_provider:{anyOf:[{type:"string"},{type:"null"}]},embedding_dimensions:{anyOf:[{type:"integer"},{type:"null"}]},status:{type:"string"},curator_proposal_json:{},critic_verdict_json:{},report_sha256:{type:"string"},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"}},required:["id","organization_id","project_id","facet","summary","classification","signal_json","unit_id","trace_id","embedding_provider","embedding_dimensions","status","curator_proposal_json","critic_verdict_json","report_sha256","created_at","updated_at"]}},limit:{type:"integer"}},required:["data","limit"]},binding:{path_inputs:{},query_inputs:["classification","status"],body_inputs:[]},contract_sha256:"3a5dc4a85c5fddb87a218ab815eaa114e3e329f3687975e535f9187192ea81a6"},{id:"fixes.dismiss_novelty",version:"1",summary:"fixes: dismiss_novelty",method:"POST",path:"/projects/{projectId}/novelty/{noveltyId}/dismiss",permissions:["opportunity:write"],scope:"project",access:"write",aliases:["caveman_fixes_write.dismiss_novelty"],input_schema:{type:"object",additionalProperties:!1,properties:{novelty_id:{type:"string",format:"uuid"}},required:["novelty_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},facet:{type:"string"},summary:{type:"string"},classification:{type:"string"},signal_json:{},unit_id:{anyOf:[{type:"string"},{type:"null"}]},trace_id:{anyOf:[{type:"string"},{type:"null"}]},embedding_provider:{anyOf:[{type:"string"},{type:"null"}]},embedding_dimensions:{anyOf:[{type:"integer"},{type:"null"}]},status:{type:"string"},curator_proposal_json:{},critic_verdict_json:{},report_sha256:{type:"string"},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"}},required:["id","organization_id","project_id","facet","summary","classification","signal_json","unit_id","trace_id","embedding_provider","embedding_dimensions","status","curator_proposal_json","critic_verdict_json","report_sha256","created_at","updated_at"]},changed:{type:"boolean"}},required:["data","changed"]},binding:{path_inputs:{noveltyId:"novelty_id"},query_inputs:[],body_inputs:[]},contract_sha256:"80d129552d9bc3910c89ec1774638719e5e0fb6bbdf32293af14fde005fee064"},{id:"fixes.promote_novelty",version:"1",summary:"fixes: promote_novelty",method:"POST",path:"/projects/{projectId}/novelty/{noveltyId}/promote",permissions:["opportunity:write"],scope:"project",access:"write",aliases:["caveman_fixes_write.promote_novelty"],input_schema:{type:"object",additionalProperties:!1,properties:{novelty_id:{type:"string",format:"uuid"}},required:["novelty_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},facet:{type:"string"},summary:{type:"string"},classification:{type:"string"},signal_json:{},unit_id:{anyOf:[{type:"string"},{type:"null"}]},trace_id:{anyOf:[{type:"string"},{type:"null"}]},embedding_provider:{anyOf:[{type:"string"},{type:"null"}]},embedding_dimensions:{anyOf:[{type:"integer"},{type:"null"}]},status:{type:"string"},curator_proposal_json:{},critic_verdict_json:{},report_sha256:{type:"string"},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"}},required:["id","organization_id","project_id","facet","summary","classification","signal_json","unit_id","trace_id","embedding_provider","embedding_dimensions","status","curator_proposal_json","critic_verdict_json","report_sha256","created_at","updated_at"]},changed:{type:"boolean"}},required:["data","changed"]},binding:{path_inputs:{noveltyId:"novelty_id"},query_inputs:[],body_inputs:[]},contract_sha256:"efd0cabcdbab31b092cefbc904dbf1d0ed8e8228b02696c66e9f430f9629fb9f"},{id:"human.onboarding",version:"1",summary:"human: onboarding",method:"GET",path:"/projects/{projectId}/onboarding",permissions:["trace:read_metadata"],scope:"project",access:"none",exclusion:"A person's own first hour. The evidence an agent would want (opportunities, improvement report, imports) is already exposed through caveman_fixes and caveman_plan; this surface only adds what the human said about themselves.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"efa24cde07da976e03deb0c34a4ce6b3d38daa0bafa6265bd9130fa8e16ffeef"},{id:"human.update_onboarding",version:"1",summary:"human: update_onboarding",method:"PATCH",path:"/projects/{projectId}/onboarding",permissions:["settings:read"],scope:"project",access:"none",exclusion:"Records what a HUMAN says they did, on a row their teammates read. An agent marking someone's onboarding done would put words in their mouth.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}},body:{type:"object",additionalProperties:!0}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"fa94e71d6671f749989e6a696e190d4176b81b849e084c42859f2e879aef7469"},{id:"human.onboarding_learn",version:"1",summary:"human: onboarding_learn",method:"GET",path:"/projects/{projectId}/onboarding/learn",permissions:["trace:read_metadata"],scope:"project",access:"none",exclusion:"Stage status for the human-facing learning page. Agents read the same evidence directly from the opportunities and continuous-improvement surfaces.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"b88405172eef545722e92518c3337833db2ea019ef388174fb4f8d27fc682dd2"},{id:"human.start_onboarding_learn",version:"1",summary:"human: start_onboarding_learn",method:"POST",path:"/projects/{projectId}/onboarding/learn",permissions:["policy:draft"],scope:"project",access:"none",exclusion:"Pulls the whole fleet's daily detection scan forward. Day-keyed so it cannot be repeated, but the decision to spend that scan early is the operator's.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}},body:{type:"object",additionalProperties:!0}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"e0a3d55c205326cc9b36cf0de0a5f23f07fad6c998c9cc53553366da7357a80a"},{id:"fixes.list_outcomes",version:"1",summary:"fixes: list_outcomes",method:"GET",path:"/projects/{projectId}/outcomes",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_fixes.list_outcomes"],input_schema:{type:"object",additionalProperties:!1,properties:{correlation_id:{type:"string"},correlation_kind:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},correlation_kind:{type:"string"},correlation_id:{type:"string"},source:{type:"string"},observed_outcome:{type:"string"},verified_outcome:{anyOf:[{type:"string"},{type:"null"}]},confidence:{type:"number"},evidence_refs:{type:["array","null"],items:{type:"string"}},occurred_at:{type:"string",format:"date-time"},payload_sha256:{type:"string"},created_at:{type:"string",format:"date-time"}},required:["id","organization_id","project_id","correlation_kind","correlation_id","source","observed_outcome","verified_outcome","confidence","evidence_refs","occurred_at","payload_sha256","created_at"]}},limit:{type:"integer"}},required:["data","limit"]},binding:{path_inputs:{},query_inputs:["correlation_id","correlation_kind"],body_inputs:[]},contract_sha256:"cd8c96388edb3e7a59b5c827e6e20a9ebc1162efe24673a295328d269000ce82"},{id:"fixes.record_outcome",version:"1",summary:"fixes: record_outcome",method:"POST",path:"/projects/{projectId}/outcomes",permissions:["outcome:write"],scope:"project",access:"write",aliases:["caveman_fixes_write.record_outcome"],input_schema:{type:"object",additionalProperties:!1,properties:{confidence:{type:"number",minimum:0,maximum:1},correlation_id:{type:"string"},correlation_kind:{type:"string"},evidence_refs:{type:"array",items:{type:"string"}},observed_outcome:{type:"string"},occurred_at:{type:"string",format:"date-time"},source:{type:"string"},verified_outcome:{type:"string"}},required:["correlation_kind","correlation_id","source","observed_outcome","confidence","evidence_refs","occurred_at"]},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},correlation_kind:{type:"string"},correlation_id:{type:"string"},source:{type:"string"},observed_outcome:{type:"string"},verified_outcome:{anyOf:[{type:"string"},{type:"null"}]},confidence:{type:"number"},evidence_refs:{type:["array","null"],items:{type:"string"}},occurred_at:{type:"string",format:"date-time"},payload_sha256:{type:"string"},created_at:{type:"string",format:"date-time"}},required:["id","organization_id","project_id","correlation_kind","correlation_id","source","observed_outcome","verified_outcome","confidence","evidence_refs","occurred_at","payload_sha256","created_at"]},created:{type:"boolean"}},required:["data","created"]},binding:{path_inputs:{},query_inputs:[],body_inputs:["confidence","correlation_id","correlation_kind","evidence_refs","observed_outcome","occurred_at","source","verified_outcome"]},contract_sha256:"3d6c58f64fef2053f06fa40d8ac0c548d622cd27f703053dd6ffa2bde7eaeab6"},{id:"project_setup.set_pixel_density",version:"1",summary:"project_setup: set_pixel_density",method:"POST",path:"/projects/{projectId}/pixel-density",permissions:["policy:publish_s0_s1"],scope:"project",access:"write",aliases:["caveman_project_setup.set_pixel_density"],input_schema:{type:"object",additionalProperties:!1,properties:{level:{enum:["conservative","balanced","max"]}},required:["level"]},output_schema:{type:"object",additionalProperties:!1,properties:{pixel_density:{type:"string"},pixel_density_missing:{type:["array","null"],items:{type:"string"}},compress_blocked_reason:{type:"string"}},required:[]},binding:{path_inputs:{},query_inputs:[],body_inputs:["level"]},contract_sha256:"2f9e708ac62285109ae0736295f007451acbd93760b9f09e68da8b6be8e929bb"},{id:"human.policies",version:"1",summary:"human: policies",method:"GET",path:"/projects/{projectId}/policies",permissions:["policy:draft"],scope:"project",access:"none",exclusion:"Policy documents are drafted through experiments and the Cave Plan, not edited directly by agents; direct drafting bypasses the evidence path that makes a change defensible.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"7efdf3c40f0557be556081517609f4ea7302b80191cb66af9b033e7fa0e1a620"},{id:"human.create_policy_draft",version:"1",summary:"human: create_policy_draft",method:"POST",path:"/projects/{projectId}/policies",permissions:["policy:draft"],scope:"project",access:"none",exclusion:"Policy documents are drafted through experiments and the Cave Plan, not edited directly by agents; direct drafting bypasses the evidence path that makes a change defensible.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}},body:{type:"object",additionalProperties:!0}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"98afe0aad8b84f379ea5d99232e96d929be2c7a3f790cf1e4750411aabc0b8a0"},{id:"human.policy",version:"1",summary:"human: policy",method:"GET",path:"/projects/{projectId}/policies/{policyId}",permissions:["policy:draft"],scope:"project",access:"none",exclusion:"Policy documents are drafted through experiments and the Cave Plan, not edited directly by agents; direct drafting bypasses the evidence path that makes a change defensible.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{parameters:{type:"object",additionalProperties:!1,properties:{policyId:{type:"string"}},required:["policyId"]},query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}}},required:["parameters"]},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"a6763d4c087f025202a4cd67a66ce9361c6a2a47146b238f5fbab76f83982e2a"},{id:"human.update_policy_draft",version:"1",summary:"human: update_policy_draft",method:"PATCH",path:"/projects/{projectId}/policies/{policyId}",permissions:["policy:draft"],scope:"project",access:"none",exclusion:"Policy documents are drafted through experiments and the Cave Plan, not edited directly by agents; direct drafting bypasses the evidence path that makes a change defensible.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{parameters:{type:"object",additionalProperties:!1,properties:{policyId:{type:"string"}},required:["policyId"]},query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}},body:{type:"object",additionalProperties:!0}},required:["parameters"]},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"877e9b6cb517d3e9301dfb7398e21400855540f87608b4bb0d22ffc37da61b53"},{id:"human.validate_policy_draft",version:"1",summary:"human: validate_policy_draft",method:"POST",path:"/projects/{projectId}/policies/{policyId}/validate",permissions:["policy:draft"],scope:"project",access:"none",exclusion:"Policy documents are drafted through experiments and the Cave Plan, not edited directly by agents; direct drafting bypasses the evidence path that makes a change defensible.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{parameters:{type:"object",additionalProperties:!1,properties:{policyId:{type:"string"}},required:["policyId"]},query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}},body:{type:"object",additionalProperties:!0}},required:["parameters"]},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"158817d788021ae427dfa9ec3a3ba66546260a919b88130e7df257fc8d309aa4"},{id:"policy.current",version:"1",summary:"policy: current",method:"GET",path:"/projects/{projectId}/policies/current",permissions:["org:read"],scope:"project",access:"read",aliases:["caveman_policy.current"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},version:{type:"integer"},status:{type:"string"},policy_json:{},created_by:{type:"string"},published_by:{anyOf:[{type:"string"},{type:"null"}]},created_at:{type:"string",format:"date-time"},published_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]}},required:["id","project_id","version","status","policy_json","created_by","created_at"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"b59b1ef38198308ae7f80a481a9bb1238fdc39abacc42985d1ca5c14cf679f34"},{id:"policy.delivery_status",version:"1",summary:"policy: delivery_status",method:"GET",path:"/projects/{projectId}/policy-delivery",permissions:["org:read"],scope:"project",access:"read",aliases:["caveman_policy.delivery_status"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{delivery_id:{type:"string"},delivery_sequence:{type:"integer"},organization_id:{type:"string"},project_id:{type:"string"},target_policy_id:{type:"string"},target_policy_version:{type:"integer"},operation_kind:{type:"string"},operation_resource_id:{type:"string"},delivery_status:{type:"string"},attempts:{type:"integer"},available_at:{type:"string",format:"date-time"},created_at:{type:"string",format:"date-time"}},required:["delivery_id","delivery_sequence","project_id","target_policy_id","target_policy_version","operation_kind","operation_resource_id","delivery_status","attempts","available_at","created_at"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"ac4aec53b447572051e1c195cbe213206410320a51e779aef33df3b5dddf4d83"},{id:"fixes.practice_evidence",version:"1",summary:"fixes: practice_evidence",method:"GET",path:"/projects/{projectId}/practice-evidence",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_fixes.practice_evidence"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},practice_id:{type:"string"},source_experiment_id:{type:"string"},metric:{type:"string"},basis:{type:"string"},baseline_value:{type:"number"},candidate_value:{type:"number"},effect_value:{type:"number"},sample_size:{type:"integer"},observed_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"}},required:["id","project_id","practice_id","source_experiment_id","metric","basis","baseline_value","candidate_value","effect_value","sample_size","observed_at","updated_at"]}},next_cursor:{type:"null"},cross_tenant:{const:!1}},required:["data","next_cursor","cross_tenant"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"db6dba6e7515f716ec8ea8929f60590ced9169b7547c8af8cda7ef15c4f866e7"},{id:"prompts.list",version:"1",summary:"prompts: list",method:"GET",path:"/projects/{projectId}/prompts",permissions:["prompt:read"],scope:"project",access:"read",aliases:["caveman_prompts.list"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},name:{type:"string"},description:{type:"string"},pinned_version:{anyOf:[{type:"integer"},{type:"null"}]},archived:{type:"boolean"},created_by:{anyOf:[{type:"string"},{type:"null"}]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"},version_count:{type:"integer"},latest_version:{anyOf:[{type:"integer"},{type:"null"}]}},required:["id","organization_id","project_id","name","description","pinned_version","archived","created_at","updated_at","version_count","latest_version"]}},next_cursor:{type:"null"}},required:["data","next_cursor"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"5c4afea2ad8306d8f37ae8218d78fb02239956b9ec264d154b1086f7d9a77b45"},{id:"prompts.create",version:"1",summary:"prompts: create",method:"POST",path:"/projects/{projectId}/prompts",permissions:["prompt:write"],scope:"project",access:"write",aliases:["caveman_prompts_write.create"],input_schema:{type:"object",additionalProperties:!1,properties:{commit_message:{type:"string"},description:{type:"string"},model_defaults:{},name:{type:"string",minLength:1},system_text:{type:"string"},tags:{type:"array",items:{type:"string"}},user_text:{type:"string"},variables:{}},required:["name"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},name:{type:"string"},description:{type:"string"},pinned_version:{anyOf:[{type:"integer"},{type:"null"}]},archived:{type:"boolean"},created_by:{anyOf:[{type:"string"},{type:"null"}]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"},version_count:{type:"integer"},latest_version:{anyOf:[{type:"integer"},{type:"null"}]}},required:["id","organization_id","project_id","name","description","pinned_version","archived","created_at","updated_at","version_count","latest_version"]},binding:{path_inputs:{},query_inputs:[],body_inputs:["commit_message","description","model_defaults","name","system_text","tags","user_text","variables"]},contract_sha256:"03ea211ba11b7b6a18a69a7bb93630a9aafcaa65fb45128b28cd5daa33356698"},{id:"prompts.delete",version:"1",summary:"prompts: delete",method:"DELETE",path:"/projects/{projectId}/prompts/{promptId}",permissions:["prompt:write"],scope:"project",access:"write",aliases:["caveman_prompts_write.delete"],input_schema:{type:"object",additionalProperties:!1,properties:{prompt_id:{type:"string",format:"uuid"}},required:["prompt_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{status:{const:"deleted"}},required:["status"]},binding:{path_inputs:{promptId:"prompt_id"},query_inputs:[],body_inputs:[]},contract_sha256:"090670353cd6d1325ec2962abcdee3807a5f658105e08b6f2a81ea3bf6e0757a"},{id:"prompts.get",version:"1",summary:"prompts: get",method:"GET",path:"/projects/{projectId}/prompts/{promptId}",permissions:["prompt:read"],scope:"project",access:"read",aliases:["caveman_prompts.get"],input_schema:{type:"object",additionalProperties:!1,properties:{prompt_id:{type:"string",format:"uuid"}},required:["prompt_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{prompt:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},name:{type:"string"},description:{type:"string"},pinned_version:{anyOf:[{type:"integer"},{type:"null"}]},archived:{type:"boolean"},created_by:{anyOf:[{type:"string"},{type:"null"}]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"},version_count:{type:"integer"},latest_version:{anyOf:[{type:"integer"},{type:"null"}]}},required:["id","organization_id","project_id","name","description","pinned_version","archived","created_at","updated_at","version_count","latest_version"]},versions:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},prompt_id:{type:"string"},organization_id:{type:"string"},version:{type:"integer"},system_text:{type:"string"},user_text:{type:"string"},variables:{},model_defaults:{},commit_message:{type:"string"},tags:{type:["array","null"],items:{type:"string"}},created_by:{anyOf:[{type:"string"},{type:"null"}]},created_at:{type:"string",format:"date-time"}},required:["id","prompt_id","organization_id","version","system_text","user_text","variables","model_defaults","commit_message","tags","created_at"]}}},required:["prompt","versions"]},binding:{path_inputs:{promptId:"prompt_id"},query_inputs:[],body_inputs:[]},contract_sha256:"03599984abd8c6d91b0076524327c328cef2341c6c18c21679eff9af8b359dc1"},{id:"prompts.pin_version",version:"1",summary:"prompts: pin_version",method:"POST",path:"/projects/{projectId}/prompts/{promptId}/pin",permissions:["prompt:write"],scope:"project",access:"write",aliases:["caveman_prompts_write.pin_version"],input_schema:{type:"object",additionalProperties:!1,properties:{version:{type:"integer",minimum:1},prompt_id:{type:"string",format:"uuid"}},required:["prompt_id","version"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},name:{type:"string"},description:{type:"string"},pinned_version:{anyOf:[{type:"integer"},{type:"null"}]},archived:{type:"boolean"},created_by:{anyOf:[{type:"string"},{type:"null"}]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"},version_count:{type:"integer"},latest_version:{anyOf:[{type:"integer"},{type:"null"}]}},required:["id","organization_id","project_id","name","description","pinned_version","archived","created_at","updated_at","version_count","latest_version"]},binding:{path_inputs:{promptId:"prompt_id"},query_inputs:[],body_inputs:["version"]},contract_sha256:"229ce55a1606a834fe18b97e5d54378ab3b537bf5fe6e8c9dccfddb54df639a8"},{id:"prompts.add_version",version:"1",summary:"prompts: add_version",method:"POST",path:"/projects/{projectId}/prompts/{promptId}/versions",permissions:["prompt:write"],scope:"project",access:"write",aliases:["caveman_prompts_write.add_version"],input_schema:{type:"object",additionalProperties:!1,properties:{expected_version:{type:"integer",minimum:1},commit_message:{type:"string"},model_defaults:{},system_text:{type:"string"},tags:{type:"array",items:{type:"string"}},user_text:{type:"string"},variables:{},prompt_id:{type:"string",format:"uuid"}},required:["prompt_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},prompt_id:{type:"string"},organization_id:{type:"string"},version:{type:"integer"},system_text:{type:"string"},user_text:{type:"string"},variables:{},model_defaults:{},commit_message:{type:"string"},tags:{type:["array","null"],items:{type:"string"}},created_by:{anyOf:[{type:"string"},{type:"null"}]},created_at:{type:"string",format:"date-time"}},required:["id","prompt_id","organization_id","version","system_text","user_text","variables","model_defaults","commit_message","tags","created_at"]},binding:{path_inputs:{promptId:"prompt_id"},query_inputs:[],body_inputs:["expected_version","commit_message","model_defaults","system_text","tags","user_text","variables"]},contract_sha256:"077f61d25ede653b6bfeb7f421255db2ebf94dae381e747f63e5ef8f6ff6acba"},{id:"prompts.get_version",version:"1",summary:"prompts: get_version",method:"GET",path:"/projects/{projectId}/prompts/{promptId}/versions/{version}",permissions:["prompt:read"],scope:"project",access:"read",aliases:["caveman_prompts.get_version"],input_schema:{type:"object",additionalProperties:!1,properties:{prompt_id:{type:"string",format:"uuid"},version:{type:"integer",minimum:1}},required:["prompt_id","version"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},prompt_id:{type:"string"},organization_id:{type:"string"},version:{type:"integer"},system_text:{type:"string"},user_text:{type:"string"},variables:{},model_defaults:{},commit_message:{type:"string"},tags:{type:["array","null"],items:{type:"string"}},created_by:{anyOf:[{type:"string"},{type:"null"}]},created_at:{type:"string",format:"date-time"}},required:["id","prompt_id","organization_id","version","system_text","user_text","variables","model_defaults","commit_message","tags","created_at"]},binding:{path_inputs:{promptId:"prompt_id",version:"version"},query_inputs:[],body_inputs:[]},contract_sha256:"58e4bb78fdc4ea326573dd388705b2ba9dde4b1fd64a744384e48abc7878500d"},{id:"providers.list",version:"1",summary:"context: list_providers",method:"GET",path:"/projects/{projectId}/providers",permissions:["org:read"],scope:"project",access:"read",aliases:["caveman_context.list_providers"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},provider:{type:"string"},slug:{type:"string"},display_name:{type:"string"},credential_mode:{type:"string"},credential_metadata:{},base_url:{anyOf:[{type:"string"},{type:"null"}]},capabilities:{},status:{type:"string"},last_verified_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},credential_configured:{type:"boolean"}},required:["id","provider","slug","display_name","credential_mode","credential_metadata","capabilities","status","credential_configured"]}},next_cursor:{type:"null"}},required:["data","next_cursor"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"897c3ae0664ab8abbacf1c1e4da3eee9814a1d47580db2d90203459e85fc06d3"},{id:"providers.create",version:"1",summary:"Connect a provider or a judge with its credential.",method:"POST",path:"/projects/{projectId}/providers",permissions:["provider:manage"],scope:"project",access:"none",exclusion:"Handles provider credentials or their verification. Agents route traffic; they never hold or rotate the secrets that pay for it.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}},body:{type:"object",additionalProperties:!0}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"02ab4a0e8681433f3467fe48e4a0cf47c917f41a73809b5316e375a542d5325d"},{id:"providers.delete",version:"1",summary:"Remove a provider connection and its stored credential.",method:"DELETE",path:"/projects/{projectId}/providers/{connectionId}",permissions:["provider:manage"],scope:"project",access:"none",exclusion:"Handles provider credentials or their verification. Agents route traffic; they never hold or rotate the secrets that pay for it.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{parameters:{type:"object",additionalProperties:!1,properties:{connectionId:{type:"string"}},required:["connectionId"]},query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}},body:{type:"object",additionalProperties:!0}},required:["parameters"]},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"caaf0030162ba5b14134ea38028c0c52050e42e262c2d6a2a76bd49799ac31ff"},{id:"providers.rotate_secret",version:"1",summary:"Replace the stored credential of a provider connection.",method:"POST",path:"/projects/{projectId}/providers/{connectionId}/rotate-secret",permissions:["provider:manage"],scope:"project",access:"none",exclusion:"Handles provider credentials or their verification. Agents route traffic; they never hold or rotate the secrets that pay for it.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{parameters:{type:"object",additionalProperties:!1,properties:{connectionId:{type:"string"}},required:["connectionId"]},query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}},body:{type:"object",additionalProperties:!0}},required:["parameters"]},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"8c3d663959ecc69b1013b8e703dd4aa91e61ea9c9a240ffd09a2b3f1094379b0"},{id:"providers.verify",version:"1",summary:"human: verify_provider",method:"POST",path:"/projects/{projectId}/providers/{connectionId}/verify",permissions:["provider:manage"],scope:"project",access:"none",exclusion:"Handles provider credentials or their verification. Agents route traffic; they never hold or rotate the secrets that pay for it.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{parameters:{type:"object",additionalProperties:!1,properties:{connectionId:{type:"string"}},required:["connectionId"]},query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}},body:{type:"object",additionalProperties:!0}},required:["parameters"]},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"88de71079437d46c58656dc9865a6c410858ba6bed99a3fdaacaeb6d4ca327a7"},{id:"quality.status",version:"1",summary:"Each workload's 7-day pass rate, worst criterion, issues, cost per task, live verdict and judge trust.",method:"GET",path:"/projects/{projectId}/quality",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_quality.status"],input_schema:{type:"object",additionalProperties:!1,properties:{workload_id:{type:"string"},slug:{type:"string"},workflow:{type:"string"},cursor:{type:"string"},limit:{type:"integer",minimum:0}}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{workload:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},slug:{anyOf:[{type:"string"},{type:"null"}]},display_name:{type:"string"},agent_id:{anyOf:[{type:"string"},{type:"null"}]}},required:["id","slug","display_name","agent_id"]},workflows:{type:["array","null"],items:{type:"string"}},readiness:{type:"string"},waiting_for:{anyOf:[{type:"string"},{type:"null"}]},tasks_7d:{type:"integer"},judged_7d:{anyOf:[{type:"integer"},{type:"null"}]},pass_rate_7d:{anyOf:[{type:"object",additionalProperties:!1,properties:{value:{type:"number"},n:{type:"integer"},lower:{type:"number"},upper:{type:"number"}},required:["value","n","lower","upper"]},{type:"null"}]},pass_rate_scale:{type:"string"},change_7d:{},worst_criterion:{},issues:{anyOf:[{type:"object",additionalProperties:!1,properties:{open:{type:"integer"},proving:{type:"integer"},fixing:{type:"integer"},watching:{type:"integer"}},required:["open","proving","fixing","watching"]},{type:"null"}]},cost_per_task:{anyOf:[{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]},{type:"null"}]},live_verdict:{},trust:{type:"object",additionalProperties:!1,properties:{trusted:{type:"integer"},unproven:{type:"integer"},failing:{type:"integer"},requalifying:{type:"integer"},total:{type:"integer"}},required:["trusted","unproven","failing","requalifying","total"]},ci:{anyOf:[{type:"object",additionalProperties:!1,properties:{suites:{type:"integer"},gated:{type:"integer"}},required:["suites","gated"]},{type:"null"}]},suggested_candidate:{}},required:["workload","workflows","readiness","waiting_for","tasks_7d","judged_7d","pass_rate_7d","pass_rate_scale","change_7d","worst_criterion","issues","cost_per_task","live_verdict","trust","ci","suggested_candidate"]}},next_cursor:{type:["string","null"]},as_of:{type:"string",format:"date-time"}},required:["data","next_cursor","as_of"]},binding:{path_inputs:{},query_inputs:["workload_id","slug","workflow","cursor","limit"],body_inputs:[]},contract_sha256:"26108fc3589299831524fecb8dad7bfe6eb3732b7a66641ece4dcaf1480e2a01"},{id:"quality_setup.proposals",version:"1",summary:"What Caveman found and drafted, and the criteria, budget and judge it proposes per workload.",method:"GET",path:"/projects/{projectId}/quality/setup",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_quality.setup_proposals"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{steps:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{key:{type:"string"},state:{type:"string"},sentence:{type:"string"},count:{anyOf:[{type:"integer"},{type:"null"}]}},required:["key","state","sentence","count"]}},blocked:{anyOf:[{type:"object",additionalProperties:!1,properties:{reason:{type:"string"},sentence:{type:"string"}},required:["reason","sentence"]},{type:"null"}]},allowance:{type:"object",additionalProperties:!1,properties:{spent:{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]},cap:{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]},resets_at:{type:"string",format:"date-time"}},required:["spent","cap","resets_at"]},unbound_spend_7d:{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]},proposals:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{workload:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},slug:{anyOf:[{type:"string"},{type:"null"}]},display_name:{type:"string"},agent_id:{anyOf:[{type:"string"},{type:"null"}]}},required:["id","slug","display_name","agent_id"]},revision:{type:"integer"},state:{type:"string"},decided:{anyOf:[{type:"object",additionalProperties:!1,properties:{by:{type:"string"},at:{type:"string",format:"date-time"}},required:["by","at"]},{type:"null"}]},criteria:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{draft_id:{type:"string"},label:{type:"string"},statement:{anyOf:[{type:"string"},{type:"null"}]},kind:{type:"string"},scope:{type:"string"},level:{type:"string"},pass_def:{anyOf:[{type:"string"},{type:"null"}]},fail_def:{anyOf:[{type:"string"},{type:"null"}]},na_def:{anyOf:[{type:"string"},{type:"null"}]},author:{type:"string"},checked_against_traffic:{type:"boolean"},evidence:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{unit:{type:"object",additionalProperties:!1,properties:{scope:{type:"string"},unit_id:{type:"string"},task_key:{anyOf:[{type:"string"},{type:"null"}]},trace_id:{anyOf:[{type:"string"},{type:"null"}]},cell_id:{anyOf:[{type:"string"},{type:"null"}]}},required:["scope","unit_id","task_key","trace_id","cell_id"]},verdict:{type:"string"}},required:["unit","verdict"]}},qualification_cost:{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]},daily_cost:{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]},synthetic:{type:"boolean"}},required:["draft_id","label","statement","kind","scope","level","pass_def","fail_def","na_def","author","checked_against_traffic","evidence","qualification_cost","daily_cost","synthetic"]}},totals:{type:"object",additionalProperties:!1,properties:{qualification_cost:{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]},daily_cost:{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]}},required:["qualification_cost","daily_cost"]},budget:{type:"object",additionalProperties:!1,properties:{daily_cap:{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]},qualification_cap:{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]},paid_by:{type:"string"}},required:["daily_cap","qualification_cap","paid_by"]},judge:{anyOf:[{type:"object",additionalProperties:!1,properties:{judge_id:{type:"string"},name:{type:"string"},endpoint_host:{anyOf:[{type:"string"},{type:"null"}]},runs_in:{type:"string"}},required:["judge_id","name","endpoint_host","runs_in"]},{type:"null"}]},drafted_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]}},required:["workload","revision","state","decided","criteria","totals","budget","judge","drafted_at"]}}},required:["steps","blocked","allowance","unbound_spend_7d","proposals"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"36fc69bf36f143723683b9025346b8a416444958c2514db3fe2475369d06d611"},{id:"quality_setup.approve",version:"1",summary:"Turn on a workload's criteria, the judge and the budget to qualify and run them.",method:"POST",path:"/projects/{projectId}/quality/setup/{workloadId}/approve",permissions:["autopilot:manage"],scope:"project",access:"none",exclusion:"Turn on approves criteria, the judge and the budget to qualify and run them (ADR 0063 addendum). A person decides.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{request_id:{type:"string",format:"uuid"},revision:{type:"integer",minimum:1},skip:{type:"array",items:{type:"string",format:"uuid"}},edits:{type:"array",items:{type:"object",additionalProperties:!1,properties:{draft_id:{type:"string",format:"uuid"},statement:{type:"string",maxLength:300},pass_def:{type:"string",maxLength:1e3},fail_def:{type:"string",maxLength:1e3},na_def:{type:"string",maxLength:1e3}},required:["draft_id"]}},daily_budget_usd:{type:"number",minimum:0},workload_id:{type:"string",format:"uuid"}},required:["workload_id","request_id","revision"]},output_schema:{type:"object",additionalProperties:!0},binding:{path_inputs:{workloadId:"workload_id"},query_inputs:[],body_inputs:["request_id","revision","skip","edits","daily_budget_usd"]},idempotency:"request_id",contract_sha256:"c7da0c9753ffe6cb78e248136c53a074379428163b8ceb6d8521da569893a716"},{id:"quality_setup.decline",version:"1",summary:"Decline a workload's proposed criteria.",method:"POST",path:"/projects/{projectId}/quality/setup/{workloadId}/decline",permissions:["autopilot:manage"],scope:"project",access:"none",exclusion:"Turn on approves criteria, the judge and the budget to qualify and run them (ADR 0063 addendum). A person decides.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{revision:{type:"integer",minimum:1},workload_id:{type:"string",format:"uuid"}},required:["workload_id","revision"]},output_schema:{type:"object",additionalProperties:!0},binding:{path_inputs:{workloadId:"workload_id"},query_inputs:[],body_inputs:["revision"]},contract_sha256:"13edd80d67bbec11f54315052534605e73689be35b79f67178c86566c41f5082"},{id:"quality_setup.draft",version:"1",summary:"Ask Caveman to draft criteria again now, within the drafting allowance.",method:"POST",path:"/projects/{projectId}/quality/setup/draft",permissions:["eval:write"],scope:"project",access:"write",aliases:["caveman_evals_write.draft_quality_setup"],input_schema:{type:"object",additionalProperties:!1,properties:{workload_id:{type:"string",format:"uuid"}}},output_schema:{type:"object",additionalProperties:!1,properties:{queued:{const:!0}},required:["queued"]},binding:{path_inputs:{},query_inputs:[],body_inputs:["workload_id"]},contract_sha256:"68eb8d0a0bf0ba0f54f003be146c47fe1a4a0a06c1862d6ea12bc8904d17437e"},{id:"consents.set_replay",version:"1",summary:"Allow or withdraw replay of this project's saved requests against candidate models and the judge.",method:"PATCH",path:"/projects/{projectId}/replay-consent",permissions:["org:update"],scope:"project",access:"none",exclusion:"Records consent or a data-subject decision on behalf of the organization. Legal effect, so a human must be the actor.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}},body:{type:"object",additionalProperties:!0}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"b772060323ec109780298f1bb2784ec2c95d12c4ed6cf13d4ec6ef1104116e69"},{id:"people.repo_contributors",version:"1",summary:"people: repo_contributors",method:"GET",path:"/projects/{projectId}/repo-contributors",permissions:["member:manage"],scope:"project",access:"read",aliases:["caveman_people.repo_contributors"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{login:{type:"string"},name:{type:"string"},email:{type:"string"},commits_90d:{type:"integer"},total_contributions:{type:"integer"},existing_member:{type:"boolean"},invited:{type:"boolean"}},required:["login","name","email","commits_90d","total_contributions","existing_member","invited"]}},repo:{type:"string"},window_days:{type:"integer"},propose_only:{const:!0}},required:["data","repo","window_days","propose_only"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"8bb8424c33e23b27c6f4e60238f470fe91be936b47481f9abcd5967d8dee88f4"},{id:"policy.retention",version:"1",summary:"policy: retention",method:"GET",path:"/projects/{projectId}/retention",permissions:["settings:read"],scope:"project",access:"read",aliases:["caveman_policy.retention"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},name:{type:"string"},raw_payload_storage:{type:"boolean"},metadata_storage:{type:"boolean"},payload_hash_storage:{type:"boolean"},artifact_storage:{type:"boolean"},trace_retention_days:{type:["integer","null"],minimum:1,description:"Days to keep request history. null keeps it until you delete it."},raw_payload_retention_days:{type:["integer","null"],minimum:1,description:"Days to keep request and response bodies. null keeps them until you delete them."},artifact_retention_days:{type:["integer","null"],minimum:1,description:"Days to keep agent artifacts. null keeps them until you delete them."},training_use_allowed:{type:"boolean"},history_deleted_before:{type:["string","null"],format:"date",description:"First day of request history still kept after a shorter window was lifted; earlier days were deleted. null when nothing was deleted."}},required:["id","organization_id","name","raw_payload_storage","metadata_storage","payload_hash_storage","artifact_storage","trace_retention_days","raw_payload_retention_days","artifact_retention_days","training_use_allowed","history_deleted_before"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"97c42f6e613100bba6bb7ab76c8ec56773d24432717e7cc503e111f60bb47c78"},{id:"autoclimb.get",version:"1",summary:"Read automatic route backtests: the proving budget, auto-publish, and the proving ledger.",method:"GET",path:"/projects/{projectId}/route-autoclimb",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_policy.route_autoclimb"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{autopublish:{type:"boolean"},proving_budget_usd_month:{anyOf:[{type:"number"},{type:"null"}]},spent_usd_month:{type:"number"},spent_usd_month_replay:{type:"number"},replay_spend_basis:{type:"string"},spent_usd_month_judge:{type:"number"},spent_usd_month_eval_drafts:{type:"number"},draft_spend_basis:{type:"string"},judge_spend_basis:{type:"string"},spent_usd_month_reserved:{type:"number"},judge_spend_scope:{type:"string"},effective_mode:{type:"string"},org_paused:{type:"boolean"},effective_budget_usd_month:{anyOf:[{type:"number"},{type:"null"}]},budget_source:{type:"string"},spend_30d_usd:{anyOf:[{type:"number"},{type:"null"}]},spend_30d_imported_usd:{anyOf:[{type:"number"},{type:"null"}]},spend_30d_imported_basis:{type:"string"},spent_usd_month_sessions:{anyOf:[{type:"number"},{type:"null"}]},sessions_spend_basis:{type:"string"},global_paused:{type:"boolean"}},required:["autopublish","proving_budget_usd_month","spent_usd_month","spent_usd_month_replay","replay_spend_basis","spent_usd_month_judge","spent_usd_month_eval_drafts","draft_spend_basis","judge_spend_basis","spent_usd_month_reserved","judge_spend_scope","effective_mode","org_paused","effective_budget_usd_month","budget_source","spend_30d_usd","spend_30d_imported_usd","spend_30d_imported_basis","spent_usd_month_sessions","sessions_spend_basis","global_paused"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"57aabe5798580df66377c73f8ba192ca3403d1c940eff41396b15d669072fcb5"},{id:"autoclimb.update",version:"1",summary:"Set the proving budget and whether Caveman publishes routes without asking.",method:"PATCH",path:"/projects/{projectId}/route-autoclimb",permissions:["policy:publish_s2_s3"],scope:"project",access:"none",exclusion:"Sets how much provider money automatic backtests may spend and whether Caveman publishes routes without asking. Turning on auto-publish grants publishing, so a human with publish permission decides.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}},body:{type:"object",additionalProperties:!0}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"7286fd5eeabdbc7264b4b7964782ddfa83010d7911be3f0fadd1358309afe704"},{id:"autoclimb.exclusions",version:"1",summary:"List the (workload, candidate model) pairs a person told Caveman to stop proving.",method:"GET",path:"/projects/{projectId}/route-autoclimb/exclusions",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_autoclimb.exclusions"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},workflow:{type:"string"},candidate_model:{type:"string"},created_by:{anyOf:[{type:"string"},{type:"null"}]},created_at:{type:"string",format:"date-time"},cleared_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},cleared_by:{anyOf:[{type:"string"},{type:"null"}]},cancelled_experiment_ids:{type:["array","null"],items:{type:"string"}},live_split_experiment_ids:{type:["array","null"],items:{type:"string"}}},required:["id","project_id","workflow","candidate_model","created_by","created_at","cleared_at","cleared_by","cancelled_experiment_ids","live_split_experiment_ids"]}}},required:["data"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"0215bd054b795b5e5386e76e23da7c2bba515bed33d0879638bf27d1b794f8ad"},{id:"autoclimb.exclude",version:"1",summary:"Stop Caveman proving a candidate model for a workload; its running Compares are cancelled.",method:"POST",path:"/projects/{projectId}/route-autoclimb/exclusions",permissions:["experiment:run"],scope:"project",access:"none",exclusion:"Stops Caveman proving a candidate model for a workload until a person clears it. Which models Caveman may test on a customer's traffic is a person's call.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{workflow:{type:"string",pattern:"^[a-z0-9_-]{1,200}$"},candidate_model:{type:"string",minLength:1,maxLength:200}},required:["workflow","candidate_model"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},workflow:{type:"string"},candidate_model:{type:"string"},created_by:{anyOf:[{type:"string"},{type:"null"}]},created_at:{type:"string",format:"date-time"},cleared_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},cleared_by:{anyOf:[{type:"string"},{type:"null"}]},cancelled_experiment_ids:{type:["array","null"],items:{type:"string"}},live_split_experiment_ids:{type:["array","null"],items:{type:"string"}}},required:["id","project_id","workflow","candidate_model","created_by","created_at","cleared_at","cleared_by","cancelled_experiment_ids","live_split_experiment_ids"]},binding:{path_inputs:{},query_inputs:[],body_inputs:["workflow","candidate_model"]},contract_sha256:"03e23ca9e19c5671eb7844208e92674ea527ffca5bb378e778b5c2775464fea1"},{id:"autoclimb.unexclude",version:"1",summary:"Clear an exclusion so Caveman may prove that candidate again.",method:"DELETE",path:"/projects/{projectId}/route-autoclimb/exclusions/{exclusionId}",permissions:["experiment:run"],scope:"project",access:"none",exclusion:"Lets Caveman prove an excluded candidate again, which spends the project's proving budget on the customer's keys. A person clears what a person excluded.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{exclusion_id:{type:"string",format:"uuid"}},required:["exclusion_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},workflow:{type:"string"},candidate_model:{type:"string"},created_by:{anyOf:[{type:"string"},{type:"null"}]},created_at:{type:"string",format:"date-time"},cleared_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},cleared_by:{anyOf:[{type:"string"},{type:"null"}]},cancelled_experiment_ids:{type:["array","null"],items:{type:"string"}},live_split_experiment_ids:{type:["array","null"],items:{type:"string"}}},required:["id","project_id","workflow","candidate_model","created_by","created_at","cleared_at","cleared_by","cancelled_experiment_ids","live_split_experiment_ids"]},binding:{path_inputs:{exclusionId:"exclusion_id"},query_inputs:[],body_inputs:[]},contract_sha256:"f76f9b9f8bff28b99334677f9f7fa13fac96f100ddc7e9b4953757e673d8d688"},{id:"autoclimb.workload",version:"1",summary:"Read one workload's climb: saved requests, whether it can be proved and why not, what is proving and its spend.",method:"GET",path:"/projects/{projectId}/route-autoclimb/workloads/{workflow}",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_autoclimb.workload"],input_schema:{type:"object",additionalProperties:!1,properties:{workflow:{type:"string",minLength:1,maxLength:200}},required:["workflow"]},output_schema:{type:"object",additionalProperties:!1,properties:{workflow:{type:"string"},saved_requests_7d:{anyOf:[{type:"integer"},{type:"null"}]},per_day:{anyOf:[{type:"number"},{type:"null"}]},needed:{type:"integer"},can_prove:{type:"boolean"},blocked_by:{type:["array","null"],items:{type:"string"}},proving:{anyOf:[{type:"object",additionalProperties:!1,properties:{experiment_id:{type:"string"},candidate_model:{type:"string"},candidate_models:{type:["array","null"],items:{type:"string"}},cases:{anyOf:[{type:"integer"},{type:"null"}]},spent_usd:{type:"number"},spend_basis:{type:"string"},started_at:{type:"string",format:"date-time"}},required:["experiment_id","candidate_model","candidate_models","cases","spent_usd","spend_basis","started_at"]},{type:"null"}]},active_move:{anyOf:[{type:"object",additionalProperties:!1,properties:{id:{type:"string"},candidate_model:{type:"string"},share:{type:"number"},until:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},saving_usd_per_day:{anyOf:[{type:"number"},{type:"null"}]},saving_basis:{type:"string"}},required:["id","candidate_model","share","until","saving_usd_per_day","saving_basis"]},{type:"null"}]},spent_usd_total:{type:"number"},spent_basis:{type:"string"},reserved_usd:{type:"number"},unreported_usd:{type:"number"},exclusions:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},workflow:{type:"string"},candidate_model:{type:"string"},created_by:{anyOf:[{type:"string"},{type:"null"}]},created_at:{type:"string",format:"date-time"},cleared_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},cleared_by:{anyOf:[{type:"string"},{type:"null"}]},cancelled_experiment_ids:{type:["array","null"],items:{type:"string"}},live_split_experiment_ids:{type:["array","null"],items:{type:"string"}}},required:["id","project_id","workflow","candidate_model","created_by","created_at","cleared_at","cleared_by","cancelled_experiment_ids","live_split_experiment_ids"]}}},required:["workflow","saved_requests_7d","per_day","needed","can_prove","blocked_by","proving","active_move","spent_usd_total","spent_basis","reserved_usd","unreported_usd","exclusions"]},binding:{path_inputs:{workflow:"workflow"},query_inputs:[],body_inputs:[]},contract_sha256:"ffe96a2b50d557d6288e7ed795c977cc672fb30b50d9aa599eadb22bfb02c9cc"},{id:"routes.compare",version:"1",summary:"Start a Compare: replay saved requests against candidate models and judge the answers.",method:"POST",path:"/projects/{projectId}/routes/compare",permissions:["experiment:run"],scope:"project",access:"none",exclusion:"Spends the project's provider money replaying saved requests against candidate models; a person starts it from the route builder or the CLI.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}},body:{type:"object",additionalProperties:!0}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"aa95b85ad0f9fd2c7fa70d980cc1a74c07b834d5a5f915303a305c4f02573316"},{id:"human.create_sample_data",version:"1",summary:"human: create_sample_data",method:"POST",path:"/projects/{projectId}/sample-data",permissions:["policy:draft"],scope:"project",access:"none",exclusion:"Writes sample rows a human could mistake for real evidence. Sample data is an explicit human choice, never something an agent turns on while setting a project up.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}},body:{type:"object",additionalProperties:!0}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"9b0a35239fc2bc87c36ca64a2fa198a631ed06b6825d8852ba949d7ef07d4502"},{id:"evals.get_scenario_projects_projectid_scenario_connections",version:"1",summary:"scenario-connections.list",method:"GET",path:"/projects/{projectId}/scenario-connections",permissions:["payload:read"],scope:"project",access:"read",aliases:["caveman_evals.get_scenario_projects_projectid_scenario_connections","scenario-connections.list"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:"array",items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},endpoint:{type:"string"},reset_endpoint:{type:"string"},environment:{type:"string"},revision:{type:"integer"}},required:["id","name","endpoint","reset_endpoint","environment","revision"]}}},required:["data"]},binding:{},native_evaluation:!1,contract_sha256:"6b0ee57c89b4e8a72f49578405ddafd4afea8866b57a2688719867af1503816e"},{id:"evals.get_scenario_projects_projectid_scenario_runs_runid",version:"1",summary:"scenario-runs.get",method:"GET",path:"/projects/{projectId}/scenario-runs/{runId}",permissions:["payload:read"],scope:"project",access:"read",aliases:["caveman_evals.get_scenario_projects_projectid_scenario_runs_runid","scenario-runs.get"],input_schema:{type:"object",additionalProperties:!1,properties:{run_id:{type:"string",format:"uuid"}},required:["run_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},suite_id:{type:"string"},suite_revision:{type:"integer"},document:{type:"object",additionalProperties:!1,properties:{schema_version:{type:"integer"},cases:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},situation:{type:"string"},persona:{type:"string"},source:{type:"string"},source_id:{type:"string"},split:{type:"string"},script:{type:["array","null"],items:{type:"string"}},fixtures:{},fixture_version:{type:"string"},criteria:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},description:{type:"string"},kind:{type:"string"},tool:{type:"string"},path:{type:"string"},equals:{}},required:["id","description","kind"]}}},required:["id","name","situation","persona","source","split","script","fixtures","fixture_version","criteria"]}},variants:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},connection_id:{type:"string"},agent_version:{type:"string"},policy_version:{type:"string"},parameters:{type:["object","null"],additionalProperties:{}}},required:["id","name","connection_id","agent_version","policy_version","parameters"]}},mode:{type:"string"},trials:{type:"integer"},max_turns:{type:"integer"},timeout_seconds:{type:"integer"},budget_micros:{type:"integer"},call_budget_micros:{type:"integer"},simulator:{type:"object",additionalProperties:!1,properties:{provider:{type:"string"},model:{type:"string"},version:{type:"string"}},required:["provider","model","version"]},judge:{type:"object",additionalProperties:!1,properties:{provider:{type:"string"},model:{type:"string"},version:{type:"string"}},required:["provider","model","version"]},seed:{type:"integer"}},required:["schema_version","cases","variants","mode","trials","max_turns","timeout_seconds","budget_micros","call_budget_micros","simulator","judge","seed"]},document_sha256:{type:"string"},connections:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},endpoint:{type:"string"},reset_endpoint:{type:"string"},environment:{type:"string"},revision:{type:"integer"}},required:["id","name","endpoint","reset_endpoint","environment","revision"]}},engine_version:{type:"string"},split:{enum:["optimization","holdout"]},status:{enum:["queued","running","completed","cancelled","interrupted","error"]},trials:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},case_id:{type:"string"},variant_id:{type:"string"},repeat:{type:"integer"},status:{type:"string"},reason:{type:"string"},verdicts:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},status:{type:"string"},reason:{type:"string"}},required:["id","status","reason"]}},target_micros:{type:"integer"},simulator_micros:{type:"integer"},judge_micros:{type:"integer"},cost_complete:{type:"boolean"},calls:{type:"integer"},attempts:{type:"integer"},latency_ms:{type:"integer"}},required:["id","case_id","variant_id","repeat","status","reason","verdicts","target_micros","simulator_micros","judge_micros","cost_complete","calls","attempts","latency_ms"]}},summary:{type:["object","null"],additionalProperties:{type:"object",additionalProperties:!1,properties:{trials:{type:"integer"},passed:{type:"integer"},failed:{type:"integer"},inconclusive:{type:"integer"},target_micros:{type:"integer"},simulator_micros:{type:"integer"},judge_micros:{type:"integer"},cost_per_success_micros:{anyOf:[{type:"number"},{type:"null"}]},cost_complete:{type:"boolean"},retries:{type:"integer"},mean_latency_ms:{type:"number"}},required:["trials","passed","failed","inconclusive","target_micros","simulator_micros","judge_micros","cost_per_success_micros","cost_complete","retries","mean_latency_ms"]}},gate:{},created_at:{type:"string",format:"date-time"},evidence_basis:{const:"simulation"}},required:["id","suite_id","suite_revision","document","document_sha256","connections","engine_version","split","status","trials","summary","gate","created_at","evidence_basis"]},binding:{path_inputs:{runId:"run_id"}},native_evaluation:!1,contract_sha256:"c7a3c3e5eff847c01411553751aeb438220c1dec3397c7972f6e5709e1a6f33f"},{id:"evals.post_scenario_projects_projectid_scenario_runs_runid_cancel",version:"1",summary:"scenario-runs.cancel",method:"POST",path:"/projects/{projectId}/scenario-runs/{runId}/cancel",permissions:["experiment:run"],scope:"project",access:"write",aliases:["caveman_evals_write.post_scenario_projects_projectid_scenario_runs_runid_cancel","scenario-runs.cancel"],input_schema:{type:"object",additionalProperties:!1,properties:{run_id:{type:"string",format:"uuid"}},required:["run_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{status:{const:"cancelled"}},required:["status"]},binding:{path_inputs:{runId:"run_id"}},native_evaluation:!1,contract_sha256:"ce28fdc960864cd8f73bbf5ad02e1bfdad02f044b30a254c5d0528f57cbce9de"},{id:"evals.get_scenario_projects_projectid_scenario_runs_runid_events",version:"1",summary:"scenario-runs.events",method:"GET",path:"/projects/{projectId}/scenario-runs/{runId}/events",permissions:["payload:read"],scope:"project",access:"read",aliases:["caveman_evals.get_scenario_projects_projectid_scenario_runs_runid_events","scenario-runs.events"],input_schema:{type:"object",additionalProperties:!1,properties:{run_id:{type:"string",format:"uuid"},after:{type:"integer",minimum:0}},required:["run_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:"array",items:{type:"object",additionalProperties:!1,properties:{id:{type:"integer"},trial_id:{type:"string"},kind:{type:"string"},role:{type:"string"},body:{},created_at:{type:"string",format:"date-time"}},required:["id","trial_id","kind","role","body","created_at"]}}},required:["data"]},binding:{path_inputs:{runId:"run_id"},query_inputs:["after"]},native_evaluation:!1,contract_sha256:"4343a8df6f8d657ce1fbceffc34960f35e290d77ecc831a70c737398b37b3984"},{id:"evals.get_scenario_projects_projectid_scenario_runs_runid_gate",version:"1",summary:"scenario-runs.gate",method:"GET",path:"/projects/{projectId}/scenario-runs/{runId}/gate",permissions:["payload:read"],scope:"project",access:"read",aliases:["caveman_evals.get_scenario_projects_projectid_scenario_runs_runid_gate","scenario-runs.gate"],input_schema:{type:"object",additionalProperties:!1,properties:{run_id:{type:"string",format:"uuid"},candidate:{type:"string",minLength:1},purpose:{enum:["regression","rollout"]}},required:["run_id","candidate"]},output_schema:{type:"object",additionalProperties:!1,properties:{eligible:{type:"boolean"},reasons:{type:["array","null"],items:{type:"string"}},evidence_basis:{const:"simulation"},outcome:{type:"string"},needs_cases:{type:"integer"},needs_more_cases:{type:"integer"}},required:["eligible","reasons","evidence_basis"]},binding:{path_inputs:{runId:"run_id"},query_inputs:["candidate","purpose"]},native_evaluation:!1,contract_sha256:"1fbb860f75cb61f3041a8790424be106bc39fe5f232410e702f63f93b85cecf9"},{id:"evals.post_scenario_projects_projectid_scenario_runs_runid_regression",version:"1",summary:"scenario-runs.regression",method:"POST",path:"/projects/{projectId}/scenario-runs/{runId}/regression",permissions:["eval:write"],scope:"project",access:"write",aliases:["caveman_evals_write.post_scenario_projects_projectid_scenario_runs_runid_regression","scenario-runs.regression"],input_schema:{type:"object",additionalProperties:!1,properties:{run_id:{type:"string",format:"uuid"},trial_id:{type:"string",minLength:1}},required:["run_id","trial_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},revision:{type:"integer"},document:{type:"object",additionalProperties:!1,properties:{schema_version:{type:"integer"},cases:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},situation:{type:"string"},persona:{type:"string"},source:{type:"string"},source_id:{type:"string"},split:{type:"string"},script:{type:["array","null"],items:{type:"string"}},fixtures:{},fixture_version:{type:"string"},criteria:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},description:{type:"string"},kind:{type:"string"},tool:{type:"string"},path:{type:"string"},equals:{}},required:["id","description","kind"]}}},required:["id","name","situation","persona","source","split","script","fixtures","fixture_version","criteria"]}},variants:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},connection_id:{type:"string"},agent_version:{type:"string"},policy_version:{type:"string"},parameters:{type:["object","null"],additionalProperties:{}}},required:["id","name","connection_id","agent_version","policy_version","parameters"]}},mode:{type:"string"},trials:{type:"integer"},max_turns:{type:"integer"},timeout_seconds:{type:"integer"},budget_micros:{type:"integer"},call_budget_micros:{type:"integer"},simulator:{type:"object",additionalProperties:!1,properties:{provider:{type:"string"},model:{type:"string"},version:{type:"string"}},required:["provider","model","version"]},judge:{type:"object",additionalProperties:!1,properties:{provider:{type:"string"},model:{type:"string"},version:{type:"string"}},required:["provider","model","version"]},seed:{type:"integer"}},required:["schema_version","cases","variants","mode","trials","max_turns","timeout_seconds","budget_micros","call_budget_micros","simulator","judge","seed"]},updated_at:{type:"string",format:"date-time"}},required:["id","name","revision","document","updated_at"]},binding:{path_inputs:{runId:"run_id"},body_inputs:["trial_id"]},native_evaluation:!1,contract_sha256:"5802c202592967583def30737946b1155cfe49d6fc348c8b8c93f12e1805d7bb"},{id:"evals.get_scenario_projects_projectid_scenario_suites",version:"1",summary:"scenario-suites.list",method:"GET",path:"/projects/{projectId}/scenario-suites",permissions:["payload:read"],scope:"project",access:"read",aliases:["caveman_evals.get_scenario_projects_projectid_scenario_suites","scenario-suites.list"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:"array",items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},revision:{type:"integer"},document:{type:"object",additionalProperties:!1,properties:{schema_version:{type:"integer"},cases:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},situation:{type:"string"},persona:{type:"string"},source:{type:"string"},source_id:{type:"string"},split:{type:"string"},script:{type:["array","null"],items:{type:"string"}},fixtures:{},fixture_version:{type:"string"},criteria:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},description:{type:"string"},kind:{type:"string"},tool:{type:"string"},path:{type:"string"},equals:{}},required:["id","description","kind"]}}},required:["id","name","situation","persona","source","split","script","fixtures","fixture_version","criteria"]}},variants:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},connection_id:{type:"string"},agent_version:{type:"string"},policy_version:{type:"string"},parameters:{type:["object","null"],additionalProperties:{}}},required:["id","name","connection_id","agent_version","policy_version","parameters"]}},mode:{type:"string"},trials:{type:"integer"},max_turns:{type:"integer"},timeout_seconds:{type:"integer"},budget_micros:{type:"integer"},call_budget_micros:{type:"integer"},simulator:{type:"object",additionalProperties:!1,properties:{provider:{type:"string"},model:{type:"string"},version:{type:"string"}},required:["provider","model","version"]},judge:{type:"object",additionalProperties:!1,properties:{provider:{type:"string"},model:{type:"string"},version:{type:"string"}},required:["provider","model","version"]},seed:{type:"integer"}},required:["schema_version","cases","variants","mode","trials","max_turns","timeout_seconds","budget_micros","call_budget_micros","simulator","judge","seed"]},updated_at:{type:"string",format:"date-time"}},required:["id","name","revision","document","updated_at"]}}},required:["data"]},binding:{},native_evaluation:!1,contract_sha256:"8c8291df42967f47c057a40f8140b6932374403834cbdc8aa8ea974832df8693"},{id:"evals.post_scenario_projects_projectid_scenario_suites",version:"1",summary:"scenario-suites.create",method:"POST",path:"/projects/{projectId}/scenario-suites",permissions:["eval:write"],scope:"project",access:"write",aliases:["caveman_evals_write.post_scenario_projects_projectid_scenario_suites","scenario-suites.create"],input_schema:{type:"object",additionalProperties:!1,properties:{name:{type:"string",minLength:1,maxLength:200},document:{type:"object",properties:{schema_version:{const:1},cases:{type:"array",items:{type:"object",properties:{id:{type:"string"},name:{type:"string"},situation:{type:"string"},persona:{type:"string"},source:{enum:["operator","trace","synthetic","regression"]},source_id:{type:"string"},split:{enum:["optimization","holdout"]},script:{type:["array","null"],items:{type:"string"}},fixtures:{},fixture_version:{type:"string"},criteria:{type:"array",items:{type:"object",properties:{id:{type:"string"},description:{type:"string"},kind:{enum:["tool_result","fixture_state","llm"]},tool:{type:"string"},path:{type:"string"},equals:{}},required:["id","description","kind"],additionalProperties:!1}}},required:["id","name","situation","source","split","script","fixtures","fixture_version","criteria"],additionalProperties:!1},minItems:1,maxItems:400},variants:{type:"array",items:{type:"object",properties:{id:{type:"string"},name:{type:"string"},connection_id:{type:"string",format:"uuid"},agent_version:{type:"string"},policy_version:{type:"string"},parameters:{type:["object","null"]}},required:["id","name","connection_id","agent_version","policy_version"],additionalProperties:!1},minItems:1,maxItems:8},mode:{enum:["frozen","adaptive"]},trials:{type:"integer",minimum:1,maximum:100},max_turns:{type:"integer",minimum:1,maximum:50},timeout_seconds:{type:"integer",minimum:1,maximum:600},budget_micros:{type:"integer",minimum:1,maximum:1e9},call_budget_micros:{type:"integer",minimum:1},simulator:{type:"object",properties:{provider:{type:"string"},model:{type:"string"},version:{type:"string"}},required:["provider","model","version"],additionalProperties:!1},judge:{type:"object",properties:{provider:{type:"string"},model:{type:"string"},version:{type:"string"}},required:["provider","model","version"],additionalProperties:!1},seed:{type:"integer"}},required:["schema_version","cases","variants","mode","trials","max_turns","timeout_seconds","budget_micros","call_budget_micros"],additionalProperties:!1},revision:{type:"integer",minimum:0}},required:["name","document"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},revision:{type:"integer"},document:{type:"object",additionalProperties:!1,properties:{schema_version:{type:"integer"},cases:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},situation:{type:"string"},persona:{type:"string"},source:{type:"string"},source_id:{type:"string"},split:{type:"string"},script:{type:["array","null"],items:{type:"string"}},fixtures:{},fixture_version:{type:"string"},criteria:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},description:{type:"string"},kind:{type:"string"},tool:{type:"string"},path:{type:"string"},equals:{}},required:["id","description","kind"]}}},required:["id","name","situation","persona","source","split","script","fixtures","fixture_version","criteria"]}},variants:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},connection_id:{type:"string"},agent_version:{type:"string"},policy_version:{type:"string"},parameters:{type:["object","null"],additionalProperties:{}}},required:["id","name","connection_id","agent_version","policy_version","parameters"]}},mode:{type:"string"},trials:{type:"integer"},max_turns:{type:"integer"},timeout_seconds:{type:"integer"},budget_micros:{type:"integer"},call_budget_micros:{type:"integer"},simulator:{type:"object",additionalProperties:!1,properties:{provider:{type:"string"},model:{type:"string"},version:{type:"string"}},required:["provider","model","version"]},judge:{type:"object",additionalProperties:!1,properties:{provider:{type:"string"},model:{type:"string"},version:{type:"string"}},required:["provider","model","version"]},seed:{type:"integer"}},required:["schema_version","cases","variants","mode","trials","max_turns","timeout_seconds","budget_micros","call_budget_micros","simulator","judge","seed"]},updated_at:{type:"string",format:"date-time"}},required:["id","name","revision","document","updated_at"]},binding:{body_inputs:["name","document","revision"]},native_evaluation:!1,contract_sha256:"446e173e37ed8a36f9a1ebaa777b805b06a6fdc15de1382881d762c93fb1f9df"},{id:"evals.put_scenario_projects_projectid_scenario_suites_suiteid",version:"1",summary:"scenario-suites.update",method:"PUT",path:"/projects/{projectId}/scenario-suites/{suiteId}",permissions:["eval:write"],scope:"project",access:"write",aliases:["caveman_evals_write.put_scenario_projects_projectid_scenario_suites_suiteid","scenario-suites.update"],input_schema:{type:"object",additionalProperties:!1,properties:{suite_id:{type:"string",format:"uuid"},revision:{type:"integer",minimum:1},name:{type:"string",minLength:1,maxLength:200},document:{type:"object",properties:{schema_version:{const:1},cases:{type:"array",items:{type:"object",properties:{id:{type:"string"},name:{type:"string"},situation:{type:"string"},persona:{type:"string"},source:{enum:["operator","trace","synthetic","regression"]},source_id:{type:"string"},split:{enum:["optimization","holdout"]},script:{type:["array","null"],items:{type:"string"}},fixtures:{},fixture_version:{type:"string"},criteria:{type:"array",items:{type:"object",properties:{id:{type:"string"},description:{type:"string"},kind:{enum:["tool_result","fixture_state","llm"]},tool:{type:"string"},path:{type:"string"},equals:{}},required:["id","description","kind"],additionalProperties:!1}}},required:["id","name","situation","source","split","script","fixtures","fixture_version","criteria"],additionalProperties:!1},minItems:1,maxItems:400},variants:{type:"array",items:{type:"object",properties:{id:{type:"string"},name:{type:"string"},connection_id:{type:"string",format:"uuid"},agent_version:{type:"string"},policy_version:{type:"string"},parameters:{type:["object","null"]}},required:["id","name","connection_id","agent_version","policy_version"],additionalProperties:!1},minItems:1,maxItems:8},mode:{enum:["frozen","adaptive"]},trials:{type:"integer",minimum:1,maximum:100},max_turns:{type:"integer",minimum:1,maximum:50},timeout_seconds:{type:"integer",minimum:1,maximum:600},budget_micros:{type:"integer",minimum:1,maximum:1e9},call_budget_micros:{type:"integer",minimum:1},simulator:{type:"object",properties:{provider:{type:"string"},model:{type:"string"},version:{type:"string"}},required:["provider","model","version"],additionalProperties:!1},judge:{type:"object",properties:{provider:{type:"string"},model:{type:"string"},version:{type:"string"}},required:["provider","model","version"],additionalProperties:!1},seed:{type:"integer"}},required:["schema_version","cases","variants","mode","trials","max_turns","timeout_seconds","budget_micros","call_budget_micros"],additionalProperties:!1}},required:["suite_id","revision","name","document"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},revision:{type:"integer"},document:{type:"object",additionalProperties:!1,properties:{schema_version:{type:"integer"},cases:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},situation:{type:"string"},persona:{type:"string"},source:{type:"string"},source_id:{type:"string"},split:{type:"string"},script:{type:["array","null"],items:{type:"string"}},fixtures:{},fixture_version:{type:"string"},criteria:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},description:{type:"string"},kind:{type:"string"},tool:{type:"string"},path:{type:"string"},equals:{}},required:["id","description","kind"]}}},required:["id","name","situation","persona","source","split","script","fixtures","fixture_version","criteria"]}},variants:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},connection_id:{type:"string"},agent_version:{type:"string"},policy_version:{type:"string"},parameters:{type:["object","null"],additionalProperties:{}}},required:["id","name","connection_id","agent_version","policy_version","parameters"]}},mode:{type:"string"},trials:{type:"integer"},max_turns:{type:"integer"},timeout_seconds:{type:"integer"},budget_micros:{type:"integer"},call_budget_micros:{type:"integer"},simulator:{type:"object",additionalProperties:!1,properties:{provider:{type:"string"},model:{type:"string"},version:{type:"string"}},required:["provider","model","version"]},judge:{type:"object",additionalProperties:!1,properties:{provider:{type:"string"},model:{type:"string"},version:{type:"string"}},required:["provider","model","version"]},seed:{type:"integer"}},required:["schema_version","cases","variants","mode","trials","max_turns","timeout_seconds","budget_micros","call_budget_micros","simulator","judge","seed"]},updated_at:{type:"string",format:"date-time"}},required:["id","name","revision","document","updated_at"]},binding:{path_inputs:{suiteId:"suite_id"},body_inputs:["revision","name","document"]},native_evaluation:!1,contract_sha256:"b3dae565e574d28f7384c6a274158cdc3c8dd4069b9f51d83612c96d21d6572c"},{id:"evals.get_scenario_projects_projectid_scenario_suites_suiteid_runs",version:"1",summary:"scenario-suites.runs",method:"GET",path:"/projects/{projectId}/scenario-suites/{suiteId}/runs",permissions:["payload:read"],scope:"project",access:"read",aliases:["caveman_evals.get_scenario_projects_projectid_scenario_suites_suiteid_runs","scenario-suites.runs"],input_schema:{type:"object",additionalProperties:!1,properties:{suite_id:{type:"string",format:"uuid"}},required:["suite_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:"array",items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},suite_id:{type:"string"},suite_revision:{type:"integer"},document:{type:"object",additionalProperties:!1,properties:{schema_version:{type:"integer"},cases:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},situation:{type:"string"},persona:{type:"string"},source:{type:"string"},source_id:{type:"string"},split:{type:"string"},script:{type:["array","null"],items:{type:"string"}},fixtures:{},fixture_version:{type:"string"},criteria:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},description:{type:"string"},kind:{type:"string"},tool:{type:"string"},path:{type:"string"},equals:{}},required:["id","description","kind"]}}},required:["id","name","situation","persona","source","split","script","fixtures","fixture_version","criteria"]}},variants:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},connection_id:{type:"string"},agent_version:{type:"string"},policy_version:{type:"string"},parameters:{type:["object","null"],additionalProperties:{}}},required:["id","name","connection_id","agent_version","policy_version","parameters"]}},mode:{type:"string"},trials:{type:"integer"},max_turns:{type:"integer"},timeout_seconds:{type:"integer"},budget_micros:{type:"integer"},call_budget_micros:{type:"integer"},simulator:{type:"object",additionalProperties:!1,properties:{provider:{type:"string"},model:{type:"string"},version:{type:"string"}},required:["provider","model","version"]},judge:{type:"object",additionalProperties:!1,properties:{provider:{type:"string"},model:{type:"string"},version:{type:"string"}},required:["provider","model","version"]},seed:{type:"integer"}},required:["schema_version","cases","variants","mode","trials","max_turns","timeout_seconds","budget_micros","call_budget_micros","simulator","judge","seed"]},document_sha256:{type:"string"},connections:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},endpoint:{type:"string"},reset_endpoint:{type:"string"},environment:{type:"string"},revision:{type:"integer"}},required:["id","name","endpoint","reset_endpoint","environment","revision"]}},engine_version:{type:"string"},split:{enum:["optimization","holdout"]},status:{enum:["queued","running","completed","cancelled","interrupted","error"]},trials:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},case_id:{type:"string"},variant_id:{type:"string"},repeat:{type:"integer"},status:{type:"string"},reason:{type:"string"},verdicts:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},status:{type:"string"},reason:{type:"string"}},required:["id","status","reason"]}},target_micros:{type:"integer"},simulator_micros:{type:"integer"},judge_micros:{type:"integer"},cost_complete:{type:"boolean"},calls:{type:"integer"},attempts:{type:"integer"},latency_ms:{type:"integer"}},required:["id","case_id","variant_id","repeat","status","reason","verdicts","target_micros","simulator_micros","judge_micros","cost_complete","calls","attempts","latency_ms"]}},summary:{type:["object","null"],additionalProperties:{type:"object",additionalProperties:!1,properties:{trials:{type:"integer"},passed:{type:"integer"},failed:{type:"integer"},inconclusive:{type:"integer"},target_micros:{type:"integer"},simulator_micros:{type:"integer"},judge_micros:{type:"integer"},cost_per_success_micros:{anyOf:[{type:"number"},{type:"null"}]},cost_complete:{type:"boolean"},retries:{type:"integer"},mean_latency_ms:{type:"number"}},required:["trials","passed","failed","inconclusive","target_micros","simulator_micros","judge_micros","cost_per_success_micros","cost_complete","retries","mean_latency_ms"]}},gate:{},created_at:{type:"string",format:"date-time"},evidence_basis:{const:"simulation"}},required:["id","suite_id","suite_revision","document","document_sha256","connections","engine_version","split","status","trials","summary","gate","created_at","evidence_basis"]}}},required:["data"]},binding:{path_inputs:{suiteId:"suite_id"}},native_evaluation:!1,contract_sha256:"7fcdc2a830d371eb515e96c66799a43250c161b4ec90cac4fb9d47331ff7e261"},{id:"evals.post_scenario_projects_projectid_scenario_suites_suiteid_runs",version:"1",summary:"scenario-suites.run",method:"POST",path:"/projects/{projectId}/scenario-suites/{suiteId}/runs",permissions:["experiment:run"],scope:"project",access:"write",aliases:["caveman_evals_write.post_scenario_projects_projectid_scenario_suites_suiteid_runs","scenario-suites.run"],input_schema:{type:"object",additionalProperties:!1,properties:{suite_id:{type:"string",format:"uuid"},revision:{type:"integer",minimum:1},split:{enum:["optimization","holdout"]}},required:["suite_id","revision","split"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},suite_id:{type:"string"},suite_revision:{type:"integer"},document:{type:"object",additionalProperties:!1,properties:{schema_version:{type:"integer"},cases:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},situation:{type:"string"},persona:{type:"string"},source:{type:"string"},source_id:{type:"string"},split:{type:"string"},script:{type:["array","null"],items:{type:"string"}},fixtures:{},fixture_version:{type:"string"},criteria:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},description:{type:"string"},kind:{type:"string"},tool:{type:"string"},path:{type:"string"},equals:{}},required:["id","description","kind"]}}},required:["id","name","situation","persona","source","split","script","fixtures","fixture_version","criteria"]}},variants:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},connection_id:{type:"string"},agent_version:{type:"string"},policy_version:{type:"string"},parameters:{type:["object","null"],additionalProperties:{}}},required:["id","name","connection_id","agent_version","policy_version","parameters"]}},mode:{type:"string"},trials:{type:"integer"},max_turns:{type:"integer"},timeout_seconds:{type:"integer"},budget_micros:{type:"integer"},call_budget_micros:{type:"integer"},simulator:{type:"object",additionalProperties:!1,properties:{provider:{type:"string"},model:{type:"string"},version:{type:"string"}},required:["provider","model","version"]},judge:{type:"object",additionalProperties:!1,properties:{provider:{type:"string"},model:{type:"string"},version:{type:"string"}},required:["provider","model","version"]},seed:{type:"integer"}},required:["schema_version","cases","variants","mode","trials","max_turns","timeout_seconds","budget_micros","call_budget_micros","simulator","judge","seed"]},document_sha256:{type:"string"},connections:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},name:{type:"string"},endpoint:{type:"string"},reset_endpoint:{type:"string"},environment:{type:"string"},revision:{type:"integer"}},required:["id","name","endpoint","reset_endpoint","environment","revision"]}},engine_version:{type:"string"},split:{enum:["optimization","holdout"]},status:{enum:["queued","running","completed","cancelled","interrupted","error"]},trials:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},case_id:{type:"string"},variant_id:{type:"string"},repeat:{type:"integer"},status:{type:"string"},reason:{type:"string"},verdicts:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},status:{type:"string"},reason:{type:"string"}},required:["id","status","reason"]}},target_micros:{type:"integer"},simulator_micros:{type:"integer"},judge_micros:{type:"integer"},cost_complete:{type:"boolean"},calls:{type:"integer"},attempts:{type:"integer"},latency_ms:{type:"integer"}},required:["id","case_id","variant_id","repeat","status","reason","verdicts","target_micros","simulator_micros","judge_micros","cost_complete","calls","attempts","latency_ms"]}},summary:{type:["object","null"],additionalProperties:{type:"object",additionalProperties:!1,properties:{trials:{type:"integer"},passed:{type:"integer"},failed:{type:"integer"},inconclusive:{type:"integer"},target_micros:{type:"integer"},simulator_micros:{type:"integer"},judge_micros:{type:"integer"},cost_per_success_micros:{anyOf:[{type:"number"},{type:"null"}]},cost_complete:{type:"boolean"},retries:{type:"integer"},mean_latency_ms:{type:"number"}},required:["trials","passed","failed","inconclusive","target_micros","simulator_micros","judge_micros","cost_per_success_micros","cost_complete","retries","mean_latency_ms"]}},gate:{},created_at:{type:"string",format:"date-time"},evidence_basis:{const:"simulation"}},required:["id","suite_id","suite_revision","document","document_sha256","connections","engine_version","split","status","trials","summary","gate","created_at","evidence_basis"]},binding:{path_inputs:{suiteId:"suite_id"},body_inputs:["revision","split"]},native_evaluation:!1,async_kind:"simulation",contract_sha256:"6d6996cef0ea3295090383347df1396b1cac5b822cd30ddf8fb16d49aae9b608"},{id:"context.get_semantic_cache",version:"1",summary:"context: get_semantic_cache",method:"GET",path:"/projects/{projectId}/semantic-cache",permissions:["org:read"],scope:"project",access:"read",aliases:["caveman_context.get_semantic_cache"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{mode:{type:"string"},threshold:{type:"number"},threshold_pinned:{type:"boolean"},ttl_seconds:{type:"integer"},embedder_configured:{type:"boolean"},embedder:{type:"object",additionalProperties:!1,properties:{configured:{type:"boolean"},model:{type:"string"},dimensions:{type:"integer"},source:{type:"string"},reachable:{anyOf:[{type:"boolean"},{type:"null"}]},latency_ms:{type:"integer"},error:{type:"string"},timeout_ms:{type:"integer"}},required:["configured","timeout_ms"]},judge:{type:"object",additionalProperties:!1,properties:{configured:{type:"boolean"},model:{type:"string"},source:{type:"string"}},required:["configured"]},limits:{type:"object",additionalProperties:!1,properties:{threshold_min:{type:"number"},threshold_max:{type:"number"},threshold_default:{type:"number"},ttl_min_seconds:{type:"integer"},ttl_max_seconds:{type:"integer"},ttl_default_seconds:{type:"integer"}},required:["threshold_min","threshold_max","threshold_default","ttl_min_seconds","ttl_max_seconds","ttl_default_seconds"]},plan_allows_serve:{type:"boolean"},gate:{type:"object",additionalProperties:!1,properties:{required_judged:{type:"integer"},required_precision:{type:"number"},window_days:{type:"integer"},judged:{type:"integer"},approved:{type:"integer"},precision:{type:"number"},shadow_requests:{type:"integer"},would_hit_rate:{type:"number"},met:{type:"boolean"},blocked_reason:{type:"string"},pending:{type:"integer"}},required:["required_judged","required_precision","window_days","judged","approved","precision","shadow_requests","would_hit_rate","met","blocked_reason","pending"]},window:{type:"object",additionalProperties:!1,properties:{days:{type:"integer"},total_requests:{type:"integer"},eligible_requests:{type:"integer"},exact_hits:{type:"integer"},semantic_hits:{type:"integer"},shadow_hits:{type:"integer"},grey:{type:"integer"},avoided_input_tokens:{type:"integer"},avoided_output_tokens:{type:"integer"},estimated_avoided_usd:{type:"number"},would_avoid_usd_estimate:{type:"number"},p50_hit_latency_ms:{type:"integer"},p50_upstream_latency_ms:{type:"integer"},misses:{type:"integer"},guard_vetoes:{type:"integer"},refused_requests:{type:"integer"},embedding_requests:{type:"integer"},embedding_failures:{type:"integer"},embedding_input_tokens:{type:"integer"},embedding_usage_requests:{type:"integer"},p50_embedding_ms:{type:"integer"},samples_blocked:{type:"integer"}},required:["days","total_requests","eligible_requests","exact_hits","semantic_hits","shadow_hits","grey","avoided_input_tokens","avoided_output_tokens","estimated_avoided_usd","would_avoid_usd_estimate","p50_hit_latency_ms","p50_upstream_latency_ms","misses","guard_vetoes","refused_requests","embedding_requests","embedding_failures","embedding_input_tokens","embedding_usage_requests","p50_embedding_ms","samples_blocked"]},by_agent:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{agent_slug:{type:"string"},requests:{type:"integer"},eligible_requests:{type:"integer"},shadow_hits:{type:"integer"},semantic_hits:{type:"integer"},refused_requests:{type:"integer"},top_refusal:{type:"string"},would_avoid_usd_estimate:{type:"number"}},required:["agent_slug","requests","eligible_requests","shadow_hits","semantic_hits","refused_requests","top_refusal","would_avoid_usd_estimate"]}},samples:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{at:{type:"string"},similarity:{type:"number"},zone:{type:"string"},verdict:{type:"string"},query_excerpt:{type:"string"},entry_excerpt:{type:"string"},judge_reason:{type:"string"}},required:["at","similarity","zone","verdict","query_excerpt","entry_excerpt","judge_reason"]}},sampling:{type:"object",additionalProperties:!1,properties:{payload_storage_allowed:{type:"boolean"},evaluation_allowed:{type:"boolean"},enabled:{type:"boolean"},sample_percent:{type:"integer"},blocked_reason:{type:"string"}},required:["payload_storage_allowed","evaluation_allowed","enabled","sample_percent"]}},required:["mode","threshold","threshold_pinned","ttl_seconds","embedder_configured","embedder","judge","limits","plan_allows_serve","gate","window","by_agent","samples","sampling"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"6b7a88afa2f43cb7c1bae6c52af51ee9dc4b77740b2709a7833238aaa1b4ae46"},{id:"project_setup.set_semantic_cache",version:"1",summary:"project_setup: set_semantic_cache",method:"PUT",path:"/projects/{projectId}/semantic-cache",permissions:["policy:publish_s0_s1"],scope:"project",access:"write",aliases:["caveman_project_setup.set_semantic_cache"],input_schema:{type:"object",additionalProperties:!1,properties:{mode:{enum:["off","shadow"]},threshold:{type:"number",minimum:.85,maximum:.99},threshold_mode:{enum:["auto","pinned"]},ttl_seconds:{type:"integer",minimum:60,maximum:86400}}},output_schema:{type:"object",additionalProperties:!1,properties:{mode:{type:"string"},threshold:{type:"number"},threshold_pinned:{type:"boolean"},ttl_seconds:{type:"integer"},embedder_configured:{type:"boolean"},embedder:{type:"object",additionalProperties:!1,properties:{configured:{type:"boolean"},model:{type:"string"},dimensions:{type:"integer"},source:{type:"string"},reachable:{anyOf:[{type:"boolean"},{type:"null"}]},latency_ms:{type:"integer"},error:{type:"string"},timeout_ms:{type:"integer"}},required:["configured","timeout_ms"]},judge:{type:"object",additionalProperties:!1,properties:{configured:{type:"boolean"},model:{type:"string"},source:{type:"string"}},required:["configured"]},limits:{type:"object",additionalProperties:!1,properties:{threshold_min:{type:"number"},threshold_max:{type:"number"},threshold_default:{type:"number"},ttl_min_seconds:{type:"integer"},ttl_max_seconds:{type:"integer"},ttl_default_seconds:{type:"integer"}},required:["threshold_min","threshold_max","threshold_default","ttl_min_seconds","ttl_max_seconds","ttl_default_seconds"]},plan_allows_serve:{type:"boolean"},gate:{type:"object",additionalProperties:!1,properties:{required_judged:{type:"integer"},required_precision:{type:"number"},window_days:{type:"integer"},judged:{type:"integer"},approved:{type:"integer"},precision:{type:"number"},shadow_requests:{type:"integer"},would_hit_rate:{type:"number"},met:{type:"boolean"},blocked_reason:{type:"string"},pending:{type:"integer"}},required:["required_judged","required_precision","window_days","judged","approved","precision","shadow_requests","would_hit_rate","met","blocked_reason","pending"]},window:{type:"object",additionalProperties:!1,properties:{days:{type:"integer"},total_requests:{type:"integer"},eligible_requests:{type:"integer"},exact_hits:{type:"integer"},semantic_hits:{type:"integer"},shadow_hits:{type:"integer"},grey:{type:"integer"},avoided_input_tokens:{type:"integer"},avoided_output_tokens:{type:"integer"},estimated_avoided_usd:{type:"number"},would_avoid_usd_estimate:{type:"number"},p50_hit_latency_ms:{type:"integer"},p50_upstream_latency_ms:{type:"integer"},misses:{type:"integer"},guard_vetoes:{type:"integer"},refused_requests:{type:"integer"},embedding_requests:{type:"integer"},embedding_failures:{type:"integer"},embedding_input_tokens:{type:"integer"},embedding_usage_requests:{type:"integer"},p50_embedding_ms:{type:"integer"},samples_blocked:{type:"integer"}},required:["days","total_requests","eligible_requests","exact_hits","semantic_hits","shadow_hits","grey","avoided_input_tokens","avoided_output_tokens","estimated_avoided_usd","would_avoid_usd_estimate","p50_hit_latency_ms","p50_upstream_latency_ms","misses","guard_vetoes","refused_requests","embedding_requests","embedding_failures","embedding_input_tokens","embedding_usage_requests","p50_embedding_ms","samples_blocked"]},by_agent:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{agent_slug:{type:"string"},requests:{type:"integer"},eligible_requests:{type:"integer"},shadow_hits:{type:"integer"},semantic_hits:{type:"integer"},refused_requests:{type:"integer"},top_refusal:{type:"string"},would_avoid_usd_estimate:{type:"number"}},required:["agent_slug","requests","eligible_requests","shadow_hits","semantic_hits","refused_requests","top_refusal","would_avoid_usd_estimate"]}},samples:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{at:{type:"string"},similarity:{type:"number"},zone:{type:"string"},verdict:{type:"string"},query_excerpt:{type:"string"},entry_excerpt:{type:"string"},judge_reason:{type:"string"}},required:["at","similarity","zone","verdict","query_excerpt","entry_excerpt","judge_reason"]}},sampling:{type:"object",additionalProperties:!1,properties:{payload_storage_allowed:{type:"boolean"},evaluation_allowed:{type:"boolean"},enabled:{type:"boolean"},sample_percent:{type:"integer"},blocked_reason:{type:"string"}},required:["payload_storage_allowed","evaluation_allowed","enabled","sample_percent"]}},required:["mode","threshold","threshold_pinned","ttl_seconds","embedder_configured","embedder","judge","limits","plan_allows_serve","gate","window","by_agent","samples","sampling"]},binding:{path_inputs:{},query_inputs:[],body_inputs:["mode","threshold","threshold_mode","ttl_seconds"]},contract_sha256:"8a60920050eac61ca12d75f28f8cbe9fe5512f78afefef912937579496271e4d"},{id:"project_setup.compare_semantic_cache",version:"1",summary:"project_setup: compare_semantic_cache",method:"POST",path:"/projects/{projectId}/semantic-cache/compare",permissions:["policy:publish_s0_s1"],scope:"project",access:"write",aliases:["caveman_project_setup.compare_semantic_cache"],input_schema:{type:"object",additionalProperties:!1,properties:{original:{type:"string",minLength:2,maxLength:7994},candidate:{type:"string",minLength:2,maxLength:7994}},required:["original","candidate"]},output_schema:{type:"object",additionalProperties:!1,properties:{similarity:{type:"number"},threshold:{type:"number"},guard_passed:{type:"boolean"},would_match:{type:"boolean"},model:{type:"string"},latency_ms:{type:"integer"},input_tokens:{anyOf:[{type:"integer"},{type:"null"}]},reason:{type:"string"}},required:["similarity","threshold","guard_passed","would_match","model","latency_ms","input_tokens","reason"]},binding:{path_inputs:{},query_inputs:[],body_inputs:["original","candidate"]},contract_sha256:"00db7bb58ca24ff4ac699fd7d98d8d9ff2847ca234da3a12f07840b3b7cbbb2b"},{id:"setup.show",version:"1",summary:"Read setup: the asserted inventory with each item's label, drafted eval cases, detections, the traffic meter and held changes.",method:"GET",path:"/projects/{projectId}/setup",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_workflows.get_setup"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{project_id:{type:"string"},repository:{type:"object",additionalProperties:!1,properties:{connected:{type:"boolean"},owner:{type:"string"},name:{type:"string"},verification:{type:"string"}},required:["connected","verification"]},asserted_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},items:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{kind:{type:"string"},name:{type:"string"},path:{type:"string"},line:{type:"integer"},workload:{type:"string"},vendor:{type:"string"},input:{type:"string"},expected:{type:"string"},label:{type:"string"},label_reason:{type:"string"},verified_commit:{type:"string"}},required:["kind","name","path","label"]}},cards:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{workload:{type:"string"},path:{type:"string"},label:{type:"string"},label_reason:{type:"string"},registered:{type:"boolean"},prompts:{type:"integer"},tools:{type:"integer"},models:{type:["array","null"],items:{type:"string"}},eval_cases:{type:"integer"}},required:["workload","path","label","registered","prompts","tools","models","eval_cases"]}},suite:{type:"object",additionalProperties:!1,properties:{provenance:{type:"string"},status:{type:"string"},data_untrusted:{type:"boolean"},cases:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{kind:{type:"string"},name:{type:"string"},path:{type:"string"},line:{type:"integer"},workload:{type:"string"},vendor:{type:"string"},input:{type:"string"},expected:{type:"string"},label:{type:"string"},label_reason:{type:"string"},verified_commit:{type:"string"}},required:["kind","name","path","label"]}},unverified:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{kind:{type:"string"},name:{type:"string"},path:{type:"string"},line:{type:"integer"},workload:{type:"string"},vendor:{type:"string"},input:{type:"string"},expected:{type:"string"},label:{type:"string"},label_reason:{type:"string"},verified_commit:{type:"string"}},required:["kind","name","path","label"]}}},required:["provenance","status","data_untrusted","cases","unverified"]},detections:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{vendor:{type:"string"},kind:{type:"string"},paths:{type:["array","null"],items:{type:"string"}},label:{type:"string"},action:{type:"object",additionalProperties:!1,properties:{key:{type:"string"},title:{type:"string"},how:{type:"string"},purpose:{type:"string"},format:{type:"string"},endpoint:{type:"string"},setup_path:{type:"string"}},required:["key","title","how"]}},required:["vendor","kind","paths","label","action"]}},meter:{anyOf:[{type:"object",additionalProperties:!1,properties:{stage:{type:"string"},workload:{type:"string"},saved_requests_7d:{type:"integer"},needed:{type:"integer"},per_day:{type:"number"},needed_per_day:{type:"integer"},expected_on:{anyOf:[{type:"string"},{type:"null"}]},imported_requests_30d:{type:"integer"},next:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{key:{type:"string"},status:{type:"string"},blocked_by:{type:["array","null"],items:{type:"string"}},summary:{type:"string"},inbox_item_id:{type:"string"}},required:["key","status","summary"]}}},required:["stage","saved_requests_7d","needed","per_day","needed_per_day","expected_on","imported_requests_30d","next"]},{type:"null"}]},changes:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},inbox_item_id:{type:"string"},purpose:{type:"string"},title:{type:"string"},status:{type:"string"},branch:{type:"string"},revert_variable:{type:"string"},pr_url:{type:"string"},created_at:{type:"string",format:"date-time"},published_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]}},required:["id","purpose","title","status","revert_variable","created_at"]}}},required:["project_id","repository","asserted_at","items","cards","suite","detections","meter","changes"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"79f340f48d76a54298cfc9bc979ad441073731acef711c8870bc50612f178705"},{id:"setup.hold",version:"1",summary:"Hold a wiring change for a person to publish from the Inbox. Nothing is pushed.",method:"POST",path:"/projects/{projectId}/setup/changes",permissions:["proposal:draft"],scope:"project",access:"write",aliases:["caveman_workflows_write.hold_setup_change"],input_schema:{type:"object",additionalProperties:!1,properties:{purpose:{type:"string"},branch:{type:"string"},revert_variable:{type:"string"},files:{type:"array",items:{type:"object",additionalProperties:!1,properties:{path:{type:"string"},before_sha256:{type:"string"},edits:{type:"array",items:{type:"object",additionalProperties:!1,properties:{old:{type:"string"},new:{type:"string"}}}},create:{type:"string"}}}}},required:["purpose","revert_variable","files"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string",format:"uuid"},status:{const:"held"},title:{type:"string"},revert_variable:{type:"string"}},required:["id","status","title","revert_variable"]},binding:{path_inputs:{},query_inputs:[],body_inputs:["purpose","branch","revert_variable","files"]},contract_sha256:"1dc948f32fb77a44f01e2cd69fc2412fb275e62fac1930a4ceee17ed807a7bd6"},{id:"setup.assert",version:"1",summary:"Assert what the repository contains: workloads, prompts, tools, models and eval cases. The server labels each item agent_asserted until it re-reads it.",method:"PUT",path:"/projects/{projectId}/setup/inventory",permissions:["proposal:draft"],scope:"project",access:"write",aliases:["caveman_workflows_write.assert_setup_inventory"],input_schema:{type:"object",additionalProperties:!1,properties:{items:{type:"array",items:{type:"object",additionalProperties:!1,properties:{kind:{type:"string"},name:{type:"string"},path:{type:"string"},line:{type:"integer"},workload:{type:"string"},vendor:{type:"string"},input:{type:"string"},expected:{type:"string"}}}}},required:["items"]},output_schema:{type:"object",additionalProperties:!1,properties:{project_id:{type:"string"},repository:{type:"object",additionalProperties:!1,properties:{connected:{type:"boolean"},owner:{type:"string"},name:{type:"string"},verification:{type:"string"}},required:["connected","verification"]},asserted_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},items:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{kind:{type:"string"},name:{type:"string"},path:{type:"string"},line:{type:"integer"},workload:{type:"string"},vendor:{type:"string"},input:{type:"string"},expected:{type:"string"},label:{type:"string"},label_reason:{type:"string"},verified_commit:{type:"string"}},required:["kind","name","path","label"]}},cards:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{workload:{type:"string"},path:{type:"string"},label:{type:"string"},label_reason:{type:"string"},registered:{type:"boolean"},prompts:{type:"integer"},tools:{type:"integer"},models:{type:["array","null"],items:{type:"string"}},eval_cases:{type:"integer"}},required:["workload","path","label","registered","prompts","tools","models","eval_cases"]}},suite:{type:"object",additionalProperties:!1,properties:{provenance:{type:"string"},status:{type:"string"},data_untrusted:{type:"boolean"},cases:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{kind:{type:"string"},name:{type:"string"},path:{type:"string"},line:{type:"integer"},workload:{type:"string"},vendor:{type:"string"},input:{type:"string"},expected:{type:"string"},label:{type:"string"},label_reason:{type:"string"},verified_commit:{type:"string"}},required:["kind","name","path","label"]}},unverified:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{kind:{type:"string"},name:{type:"string"},path:{type:"string"},line:{type:"integer"},workload:{type:"string"},vendor:{type:"string"},input:{type:"string"},expected:{type:"string"},label:{type:"string"},label_reason:{type:"string"},verified_commit:{type:"string"}},required:["kind","name","path","label"]}}},required:["provenance","status","data_untrusted","cases","unverified"]},detections:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{vendor:{type:"string"},kind:{type:"string"},paths:{type:["array","null"],items:{type:"string"}},label:{type:"string"},action:{type:"object",additionalProperties:!1,properties:{key:{type:"string"},title:{type:"string"},how:{type:"string"},purpose:{type:"string"},format:{type:"string"},endpoint:{type:"string"},setup_path:{type:"string"}},required:["key","title","how"]}},required:["vendor","kind","paths","label","action"]}},meter:{anyOf:[{type:"object",additionalProperties:!1,properties:{stage:{type:"string"},workload:{type:"string"},saved_requests_7d:{type:"integer"},needed:{type:"integer"},per_day:{type:"number"},needed_per_day:{type:"integer"},expected_on:{anyOf:[{type:"string"},{type:"null"}]},imported_requests_30d:{type:"integer"},next:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{key:{type:"string"},status:{type:"string"},blocked_by:{type:["array","null"],items:{type:"string"}},summary:{type:"string"},inbox_item_id:{type:"string"}},required:["key","status","summary"]}}},required:["stage","saved_requests_7d","needed","per_day","needed_per_day","expected_on","imported_requests_30d","next"]},{type:"null"}]},changes:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},inbox_item_id:{type:"string"},purpose:{type:"string"},title:{type:"string"},status:{type:"string"},branch:{type:"string"},revert_variable:{type:"string"},pr_url:{type:"string"},created_at:{type:"string",format:"date-time"},published_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]}},required:["id","purpose","title","status","revert_variable","created_at"]}}},required:["project_id","repository","asserted_at","items","cards","suite","detections","meter","changes"]},binding:{path_inputs:{},query_inputs:[],body_inputs:["items"]},contract_sha256:"8ddb2740c7125ba2b172d49043961b7f0d6422c2e8d83eeccd947da9107282bb"},{id:"spot_checks.submit",version:"1",summary:"Label one spot-check item.",method:"POST",path:"/projects/{projectId}/spot-checks/{batchId}/labels",permissions:["eval:write"],scope:"project",access:"none",exclusion:"Spot-check labels are human gold anchors for judge trust (SPEC \xA74.6). An agent cannot stand in for a human reviewer.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{item_id:{type:"string",format:"uuid"},label:{enum:["pass","fail","not_applicable","skip"]},note:{type:"string",maxLength:280},batch_id:{type:"string",format:"uuid"}},required:["batch_id","item_id","label"]},output_schema:{type:"object",additionalProperties:!0},binding:{path_inputs:{batchId:"batch_id"},query_inputs:[],body_inputs:["item_id","label","note"]},contract_sha256:"a8525ea48a47dfd899607e9a3ccdcabbd7f36b70f3f262297467ee9f557e9f95"},{id:"sql.query",version:"1",summary:"Run one read-only ClickHouse SELECT over the project's SQL tables within a window (default 7 days). Read sql.schema first; money columns carry their basis and are NULL when unpriced.",method:"POST",path:"/projects/{projectId}/sql",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_sql.query"],input_schema:{type:"object",additionalProperties:!1,required:["sql"],properties:{sql:{type:"string",minLength:1,maxLength:65536,description:"One ClickHouse SELECT over the SQL tables that sql.schema lists. Bind values as {name:Type} placeholders."},params:{type:"object",maxProperties:100,description:"Values for the {name:Type} placeholders; names may not start with cave_ or param_.",additionalProperties:{anyOf:[{type:"string",maxLength:4096},{type:"number"},{type:"array",maxItems:1e3,items:{type:"string",maxLength:4096}}]}},window:{type:"string",pattern:"^[1-9][0-9]{0,3}[hd]$",description:"Look back from now, 1h to 90d. Send window or from/to; neither reads the last 7 days."},from:{type:"string",maxLength:40,description:"UTC start, RFC3339 or YYYY-MM-DD; at most 90 days before to."},to:{type:"string",maxLength:40,description:"UTC end, RFC3339 or YYYY-MM-DD; defaults to now."}}},output_schema:{type:"object",additionalProperties:!0,properties:{columns:{type:"array"},rows:{type:"array"},truncated:{type:"boolean"},window:{type:"object"},query_digest:{type:"string"},notices:{type:"array"}}},binding:{body_inputs:["sql","params","window","from","to"]},contract_sha256:"f4034423b801e9b24de9ed924fb83aa9e0a38402664b9a79d6cbacd6b4916902"},{id:"sql.schema",version:"1",summary:"List the SQL tables, rules, limits and examples, or one table's columns with class, type and money basis (table).",method:"GET",path:"/projects/{projectId}/sql/schema",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_sql.schema"],input_schema:{type:"object",additionalProperties:!1,properties:{table:{type:"string",minLength:1,maxLength:64,description:"One SQL table's columns; omit for the overview of tables, rules and examples."}}},output_schema:{type:"object",additionalProperties:!0,properties:{rules:{type:"object"},tables:{type:"array"},examples:{type:"array"},columns:{type:"array"},hidden:{type:"array"}}},binding:{query_inputs:["table"]},contract_sha256:"92dfe9cda2a4cd83f6d535cc784b24226f21e89f38745823019368eea5ed494b"},{id:"sql.tag_keys",version:"1",summary:"List the tag keys this project made metadata: callers that cannot read a tags map whole (payload access, plus billing:read on requests) read only these keys of the requests and tool_events tags maps.",method:"GET",path:"/projects/{projectId}/sql/tag-keys",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_sql.tag_keys"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{project_id:{type:"string",format:"uuid"},keys:{type:"array",items:{type:"string"},maxItems:32},max_keys:{type:"integer",minimum:1},updated_by:{anyOf:[{type:"string",format:"uuid"},{type:"null"}]},updated_at:{anyOf:[{type:"string"},{type:"null"}]}},required:["project_id","keys","max_keys"]},binding:{},contract_sha256:"22b5664c32be7aeb19903778f0df0908e4e0c69640c3ed43cde11fb51999c81d"},{id:"tasks.get",version:"1",summary:"One task as steps, outline and latest judgments, without content.",method:"GET",path:"/projects/{projectId}/tasks/{taskKey}",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_traces.get_task"],input_schema:{type:"object",additionalProperties:!1,properties:{cursor:{type:"string"},limit:{type:"integer",minimum:0},task_key:{type:"string",pattern:"^[A-Za-z0-9._:~-]{1,160}$"}},required:["task_key"]},output_schema:{type:"object",additionalProperties:!1,properties:{task_key:{type:"string"},workload:{},trace_ids:{type:["array","null"],items:{type:"string"}},started_at:{type:"string"},ended_at:{anyOf:[{type:"string"},{type:"null"}]},closed:{type:"boolean"},closes_after_idle_minutes:{type:"integer"},goal:{type:"object",additionalProperties:!1,properties:{digest:{type:"string"},system_prompt_sha256:{type:["string","null"]}},required:["digest","system_prompt_sha256"]},outcome:{type:"object",additionalProperties:!1,properties:{status:{type:["string","null"]}},required:["status"]},steps:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{step_id:{type:"string"},short_id:{type:"string"},parent_id:{anyOf:[{type:"string"},{type:"null"}]},trace_id:{type:"string"},turn:{anyOf:[{type:"integer"},{type:"null"}]},kind:{type:"string"},name:{type:"string"},agent:{anyOf:[{type:"string"},{type:"null"}]},model:{anyOf:[{type:"string"},{type:"null"}]},status:{type:"string"},error:{anyOf:[{type:"string"},{type:"null"}]},duration_ms:{anyOf:[{type:"integer"},{type:"null"}]},tokens:{anyOf:[{type:"integer"},{type:"null"}]},cost:{anyOf:[{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]},{type:"null"}]},args_digest:{anyOf:[{type:"string"},{type:"null"}]},result_digest:{anyOf:[{type:"string"},{type:"null"}]},body_ref:{anyOf:[{type:"object",additionalProperties:!1,properties:{request_id:{type:"string"},kind:{type:"string"},offset:{type:"integer"},len:{type:"integer"}},required:["request_id","kind","offset","len"]},{type:"null"}]},repeat_of:{anyOf:[{type:"string"},{type:"null"}]}},required:["step_id","short_id","parent_id","trace_id","turn","kind","name","agent","model","status","error","duration_ms","tokens","cost","args_digest","result_digest","body_ref","repeat_of"]}},outline:{type:"string"},stats:{type:"object",additionalProperties:!1,properties:{steps:{type:"integer"},tool_calls:{type:"integer"},errors:{type:"integer"},est_tokens:{type:"integer"},turns:{type:"integer"},compaction_boundaries:{type:["array","null"],items:{type:"string"}},capture_gaps:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{step_id:{type:"string"},gap:{type:"string"}},required:["step_id","gap"]}}},required:["steps","tool_calls","errors","est_tokens","turns","compaction_boundaries","capture_gaps"]},judgments:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{judgment_id:{type:"string"},criterion:{type:"object",additionalProperties:!1,properties:{criterion_id:{type:"string"},version:{type:"integer"},label:{type:"string"},statement:{anyOf:[{type:"string"},{type:"null"}]}},required:["criterion_id","version","label","statement"]},verdict:{type:"string"},failing_steps:{type:["array","null"],items:{type:"string"}},failing_windows:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{first_step_id:{type:"string"},last_step_id:{type:"string"}},required:["first_step_id","last_step_id"]}},trusted:{type:"boolean"}},required:["judgment_id","criterion","verdict","failing_steps","failing_windows","trusted"]}},similar_failures_7d:{anyOf:[{type:"object",additionalProperties:!1,properties:{count:{type:"integer"},issue_id:{type:"string"}},required:["count","issue_id"]},{type:"null"}]},next_cursor:{anyOf:[{type:"string"},{type:"null"}]}},required:["task_key","workload","trace_ids","started_at","ended_at","closed","closes_after_idle_minutes","goal","outcome","steps","outline","stats","judgments","similar_failures_7d","next_cursor"]},binding:{path_inputs:{taskKey:"task_key"},query_inputs:["cursor","limit"],body_inputs:[]},contract_sha256:"6fb861ebe3057e4b201ee04170da105f4ae44965af14feaa760843e1c4c28f30"},{id:"tasks.content",version:"1",summary:"Captured content of named task steps, under payload permission and disclosure audit.",method:"GET",path:"/projects/{projectId}/tasks/{taskKey}/content",permissions:["payload:read"],scope:"project",access:"read",aliases:["caveman_traces.task_content"],input_schema:{type:"object",additionalProperties:!1,properties:{steps:{type:"string"},part:{type:"string"},task_key:{type:"string",pattern:"^[A-Za-z0-9._:~-]{1,160}$"}},required:["task_key"]},output_schema:{type:"object",additionalProperties:!1,properties:{task_key:{type:"string"},goal:{anyOf:[{type:"string"},{type:"null"}]},outcome:{anyOf:[{type:"string"},{type:"null"}]},steps:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{step_id:{type:"string"},input:{anyOf:[{type:"string"},{type:"null"}]},output:{anyOf:[{type:"string"},{type:"null"}]},digested:{type:"boolean"},gap:{anyOf:[{type:"string"},{type:"null"}]}},required:["step_id","input","output","digested","gap"]}}},required:["task_key","goal","outcome","steps"]},binding:{path_inputs:{taskKey:"task_key"},query_inputs:["steps","part"],body_inputs:[]},additional_permissions:["trace:read_payload"],contract_sha256:"f9e920588200dd6344f9c1616dc16b7f6e2b70c05326d4289fe4c54458451546"},{id:"fixes.list_themes",version:"1",summary:"fixes: list_themes",method:"GET",path:"/projects/{projectId}/themes",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_fixes.list_themes"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},facet:{type:"string"},summary:{type:"string"},status:{type:"string"},stability_score:{type:"number"},membership_count:{type:"integer"},batch_count:{type:"integer"},member_trace_ids:{type:["array","null"],items:{type:"string"}},first_observed_at:{type:"string",format:"date-time"},last_observed_at:{type:"string",format:"date-time"},last_report_sha256:{anyOf:[{type:"string"},{type:"null"}]},last_theme_id:{anyOf:[{type:"string"},{type:"null"}]},lineage:{},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"}},required:["id","organization_id","project_id","facet","summary","status","stability_score","membership_count","batch_count","member_trace_ids","first_observed_at","last_observed_at","last_report_sha256","last_theme_id","lineage","created_at","updated_at"]}},limit:{type:"integer"}},required:["data","limit"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"df1fafbfbd6a9b87876d75d5e533cc13e19411fde9f7512c0d5bc81f032b515e"},{id:"fixes.get_theme",version:"1",summary:"fixes: get_theme",method:"GET",path:"/projects/{projectId}/themes/{themeId}",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_fixes.get_theme"],input_schema:{type:"object",additionalProperties:!1,properties:{theme_id:{type:"string",format:"uuid"}},required:["theme_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},facet:{type:"string"},summary:{type:"string"},status:{type:"string"},stability_score:{type:"number"},membership_count:{type:"integer"},batch_count:{type:"integer"},member_trace_ids:{type:["array","null"],items:{type:"string"}},first_observed_at:{type:"string",format:"date-time"},last_observed_at:{type:"string",format:"date-time"},last_report_sha256:{anyOf:[{type:"string"},{type:"null"}]},last_theme_id:{anyOf:[{type:"string"},{type:"null"}]},lineage:{},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"}},required:["id","organization_id","project_id","facet","summary","status","stability_score","membership_count","batch_count","member_trace_ids","first_observed_at","last_observed_at","last_report_sha256","last_theme_id","lineage","created_at","updated_at"]}},required:["data"]},binding:{path_inputs:{themeId:"theme_id"},query_inputs:[],body_inputs:[]},contract_sha256:"2177e432f0f009cdd4457f333ad55ffa63f49e9e7437339540923b663f81bd67"},{id:"traces.payload",version:"1",summary:"Read one explicitly authorized redacted capture under current payload permission, retention, source integrity and disclosure audit. One capture is not a complete conversation.",method:"POST",path:"/projects/{projectId}/trace-payload",permissions:["payload:read"],scope:"project",access:"read",aliases:["caveman_traces.payload"],input_schema:{type:"object",additionalProperties:!1,required:["from","to","trace_id","request_id","kind"],properties:{from:{type:"string",format:"date-time",description:"Explicit UTC start of a window spanning at most 90 days."},to:{type:"string",format:"date-time",description:"Explicit UTC end, after from and at most 90 days later."},trace_id:{type:"string",pattern:"^[a-fA-F0-9]{16,64}$"},request_id:{type:"string",format:"uuid"},kind:{type:"string",enum:["request","response","request_compressed"]}}},output_schema:{type:"object",required:["query_digest","project_id","trace_id","request_id","kind","window","status","coverage"],properties:{status:{type:"string",enum:["captured","unavailable"]},coverage:{const:"single_captured_request"}}},binding:{body_inputs:["from","to","trace_id","request_id","kind"]},additional_permissions:["trace:read_payload"],contract_sha256:"ada9eda1930d50f385c8d8e5055155e4d3431f9a7c4c99c099ca58818bb2a375"},{id:"traces.compare",version:"1",summary:"Compare two trace windows of one project: requests, errors, conversations and catalog-priced cost per segment.",method:"POST",path:"/projects/{projectId}/traces/compare",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_traces.compare"],input_schema:{type:"object",additionalProperties:!1,required:["baseline","current"],properties:{baseline:{type:"object",additionalProperties:!1,required:["from","to"],properties:{from:{type:"string",format:"date-time",description:"Earliest UTC start; current.to must be at most 90 days later."},to:{type:"string",format:"date-time"}}},current:{type:"object",additionalProperties:!1,required:["from","to"],properties:{from:{type:"string",format:"date-time"},to:{type:"string",format:"date-time",description:"UTC end, after current.from and at most 90 days after baseline.from."}}},filters:{type:"object",additionalProperties:!1,properties:{agent:{type:"array",maxItems:50,items:{type:"string",maxLength:200}},workflow:{type:"array",maxItems:50,items:{type:"string",maxLength:200}},model:{type:"array",maxItems:50,items:{type:"string",maxLength:200}},provider:{type:"array",maxItems:50,items:{type:"string",maxLength:200}},session_id:{type:"array",maxItems:50,items:{type:"string",maxLength:200}},trace_id:{type:"array",maxItems:50,items:{type:"string",maxLength:200}}}}}},output_schema:{type:"object",required:["query_digest","project_id","baseline","current","segments","effects","cost_basis","limitations"],properties:{query_digest:{type:"string",pattern:"^[a-f0-9]{64}$"},project_id:{type:"string"},baseline:{type:"object"},current:{type:"object"},segments:{type:"array"},effects:{type:"object"},cost_basis:{type:"string"},limitations:{type:"array",items:{type:"string"}}}},binding:{body_inputs:["baseline","current","filters"]},contract_sha256:"bb2b77facdd5d0f488560f6efd2e8151a69cfe285de8d88211fd0d70a81e008c"},{id:"usage.compare",version:"1",summary:"Compare spend between two windows of one project and split the change into volume, mix and unit-cost effects.",method:"POST",path:"/projects/{projectId}/usage/compare",permissions:["billing:read"],scope:"project",access:"read",aliases:["caveman_reports.compare_usage"],input_schema:{type:"object",additionalProperties:!1,required:["baseline","current"],properties:{baseline:{type:"object",additionalProperties:!1,required:["from","to"],properties:{from:{type:"string",format:"date-time",description:"Earliest UTC start; current.to must be at most 90 days later."},to:{type:"string",format:"date-time"}}},current:{type:"object",additionalProperties:!1,required:["from","to"],properties:{from:{type:"string",format:"date-time"},to:{type:"string",format:"date-time",description:"UTC end, after current.from and at most 90 days after baseline.from."}}},filters:{type:"object",additionalProperties:!1,properties:{agent:{type:"array",maxItems:50,items:{type:"string",maxLength:200}},workflow:{type:"array",maxItems:50,items:{type:"string",maxLength:200}},model:{type:"array",maxItems:50,items:{type:"string",maxLength:200}},provider:{type:"array",maxItems:50,items:{type:"string",maxLength:200}},session_id:{type:"array",maxItems:50,items:{type:"string",maxLength:200}},trace_id:{type:"array",maxItems:50,items:{type:"string",maxLength:200}}}}}},output_schema:{type:"object",required:["query_digest","project_id","baseline","current","segments","effects","cost_basis","limitations"],properties:{query_digest:{type:"string",pattern:"^[a-f0-9]{64}$"},project_id:{type:"string"},baseline:{type:"object"},current:{type:"object"},segments:{type:"array"},effects:{type:"object"},cost_basis:{type:"string"},limitations:{type:"array",items:{type:"string"}}}},binding:{body_inputs:["baseline","current","filters"]},additional_permissions:["trace:read_metadata"],contract_sha256:"4e13b050cca844cc656f07b12d7b575b1d5469c533337e909c89302cc9230d19"},{id:"verdicts.list",version:"1",summary:"Every comparison and pull-request check with its verdict: Ship, Pass, Don't ship, Need more data or Skipped.",method:"GET",path:"/projects/{projectId}/verdicts",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_quality.list_verdicts"],input_schema:{type:"object",additionalProperties:!1,properties:{workload_id:{type:"string"},source:{type:"string"},executor:{type:"string"},verdict:{type:"string"},state:{type:"string"},decision:{type:"string"},repo:{type:"string"},sha:{type:"string"},pr:{type:"string"},cursor:{type:"string"},limit:{type:"integer",minimum:0}}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{ref:{type:"object",additionalProperties:!1,properties:{source:{type:"string"},run_id:{type:"string"}},required:["source","run_id"]},workload:{anyOf:[{type:"object",additionalProperties:!1,properties:{id:{type:"string"},slug:{anyOf:[{type:"string"},{type:"null"}]},display_name:{type:"string"},agent_id:{anyOf:[{type:"string"},{type:"null"}]}},required:["id","slug","display_name","agent_id"]},{type:"null"}]},label:{type:"string"},executor:{type:"string"},state:{type:"string"},verdict:{anyOf:[{type:"string"},{type:"null"}]},reason:{type:"string"},sentence:{type:"string"},quality:{anyOf:[{type:"object",additionalProperties:!1,properties:{estimate:{type:"number"},lower:{type:"number"},upper:{type:"number"}},required:["estimate","lower","upper"]},{type:"null"}]},cost:{anyOf:[{type:"object",additionalProperties:!1,properties:{estimate:{type:"number"},lower:{type:"number"},upper:{type:"number"}},required:["estimate","lower","upper"]},{type:"null"}]},cost_rung:{anyOf:[{type:"string"},{type:"null"}]},paired_cases:{type:"integer"},look:{type:"integer"},started_at:{type:"string",format:"date-time"},computed_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},proving_cost:{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]},decision:{type:"string"},pr:{anyOf:[{type:"object",additionalProperties:!1,properties:{repo:{type:"string"},number:{type:"integer"},sha:{type:"string"}},required:["repo","number","sha"]},{type:"null"}]},gate:{anyOf:[{type:"object",additionalProperties:!1,properties:{mode:{type:"string"},conclusion:{type:"string"}},required:["mode","conclusion"]},{type:"null"}]}},required:["ref","workload","label","executor","state","verdict","reason","sentence","quality","cost","cost_rung","paired_cases","look","started_at","computed_at","proving_cost","decision","pr","gate"]}},next_cursor:{anyOf:[{type:"string"},{type:"null"}]}},required:["data","next_cursor"]},binding:{path_inputs:{},query_inputs:["workload_id","source","executor","verdict","state","decision","repo","sha","pr","cursor","limit"],body_inputs:[]},contract_sha256:"9e3ff4f3bfde1111d21e121623b0e372606639824a037ecb04d986664492a8f8"},{id:"verdicts.get",version:"1",summary:"One verdict with intervals, sample checks, judge trust and the price of settling it.",method:"GET",path:"/projects/{projectId}/verdicts/{source}/{runId}",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_quality.get_verdict"],input_schema:{type:"object",additionalProperties:!1,properties:{source:{enum:["eval_run","experiment","scenario_run","factory_comparison"]},run_id:{type:"string",format:"uuid"}},required:["source","run_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{ref:{type:"object",additionalProperties:!1,properties:{source:{type:"string"},run_id:{type:"string"}},required:["source","run_id"]},workload:{anyOf:[{type:"object",additionalProperties:!1,properties:{id:{type:"string"},slug:{anyOf:[{type:"string"},{type:"null"}]},display_name:{type:"string"},agent_id:{anyOf:[{type:"string"},{type:"null"}]}},required:["id","slug","display_name","agent_id"]},{type:"null"}]},label:{type:"string"},executor:{type:"string"},state:{type:"string"},verdict:{anyOf:[{type:"string"},{type:"null"}]},reason:{type:"string"},sentence:{type:"string"},quality:{anyOf:[{type:"object",additionalProperties:!1,properties:{estimate:{type:"number"},lower:{type:"number"},upper:{type:"number"}},required:["estimate","lower","upper"]},{type:"null"}]},cost:{anyOf:[{type:"object",additionalProperties:!1,properties:{estimate:{type:"number"},lower:{type:"number"},upper:{type:"number"}},required:["estimate","lower","upper"]},{type:"null"}]},cost_rung:{anyOf:[{type:"string"},{type:"null"}]},paired_cases:{type:"integer"},look:{type:"integer"},started_at:{type:"string",format:"date-time"},computed_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},proving_cost:{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]},decision:{type:"string"},pr:{anyOf:[{type:"object",additionalProperties:!1,properties:{repo:{type:"string"},number:{type:"integer"},sha:{type:"string"}},required:["repo","number","sha"]},{type:"null"}]},gate:{anyOf:[{type:"object",additionalProperties:!1,properties:{mode:{type:"string"},conclusion:{type:"string"}},required:["mode","conclusion"]},{type:"null"}]},arms:{type:"object",additionalProperties:!1,properties:{baseline:{type:"object",additionalProperties:!1,properties:{label:{type:"string"},model:{anyOf:[{type:"string"},{type:"null"}]},effort:{anyOf:[{type:"string"},{type:"null"}]},prompt_version:{anyOf:[{type:"string"},{type:"null"}]},tool_config_sha256:{anyOf:[{type:"string"},{type:"null"}]},code_sha:{anyOf:[{type:"string"},{type:"null"}]},route:{anyOf:[{type:"string"},{type:"null"}]}},required:["label","model","effort","prompt_version","tool_config_sha256","code_sha","route"]},candidate:{type:"object",additionalProperties:!1,properties:{label:{type:"string"},model:{anyOf:[{type:"string"},{type:"null"}]},effort:{anyOf:[{type:"string"},{type:"null"}]},prompt_version:{anyOf:[{type:"string"},{type:"null"}]},tool_config_sha256:{anyOf:[{type:"string"},{type:"null"}]},code_sha:{anyOf:[{type:"string"},{type:"null"}]},route:{anyOf:[{type:"string"},{type:"null"}]}},required:["label","model","effort","prompt_version","tool_config_sha256","code_sha","route"]}},required:["baseline","candidate"]},margin:{type:"object",additionalProperties:!1,properties:{value:{type:"number"},scale:{type:"string"}},required:["value","scale"]},useful_cost_effect:{type:"number"},alpha:{type:"number"},quality_outcome:{type:"string"},cost_detail:{anyOf:[{type:"object",additionalProperties:!1,properties:{baseline_per_task:{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]},candidate_per_task:{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]},outcome:{type:"string"}},required:["baseline_per_task","candidate_per_task","outcome"]},{type:"null"}]},criteria:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{criterion:{type:"object",additionalProperties:!1,properties:{criterion_id:{anyOf:[{type:"string"},{type:"null"}]},version:{type:"integer"},label:{type:"string"},statement:{anyOf:[{type:"string"},{type:"null"}]}},required:["criterion_id","version","label","statement"]},gating:{type:"boolean"},trust:{type:"object",additionalProperties:!1,properties:{state:{type:"string"},trusted_for:{anyOf:[{type:"string"},{type:"null"}]},sentence:{type:"string"}},required:["state","trusted_for","sentence"]},interval:{anyOf:[{type:"object",additionalProperties:!1,properties:{estimate:{type:"number"},lower:{type:"number"},upper:{type:"number"}},required:["estimate","lower","upper"]},{type:"null"}]},outcome:{type:"string"},significant:{type:"boolean"},n:{type:"integer"}},required:["criterion","gating","trust","interval","outcome","significant","n"]}},segments:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{key:{type:"string"},label:{type:"string"},interval:{type:"object",additionalProperties:!1,properties:{estimate:{type:"number"},lower:{type:"number"},upper:{type:"number"}},required:["estimate","lower","upper"]},outcome:{type:"string"}},required:["key","label","interval","outcome"]}},sample:{type:"object",additionalProperties:!1,properties:{paired_cases:{type:"integer"},clusters:{type:"integer"},few_clusters:{type:"boolean"},trials:{type:"integer"},floor_cases:{type:"integer"},inconclusive:{type:"object",additionalProperties:!1,properties:{baseline:{type:"object",additionalProperties:!1,properties:{value:{type:"number"},n:{type:"integer"},lower:{type:"number"},upper:{type:"number"}},required:["value","n","lower","upper"]},candidate:{type:"object",additionalProperties:!1,properties:{value:{type:"number"},n:{type:"integer"},lower:{type:"number"},upper:{type:"number"}},required:["value","n","lower","upper"]}},required:["baseline","candidate"]},coverage:{anyOf:[{type:"object",additionalProperties:!1,properties:{value:{type:"number"},n:{type:"integer"},lower:{type:"number"},upper:{type:"number"}},required:["value","n","lower","upper"]},{type:"null"}]},judges:{type:"object",additionalProperties:!1,properties:{trusted:{type:"integer"},total:{type:"integer"}},required:["trusted","total"]},aa_half_width:{anyOf:[{type:"number"},{type:"null"}]},errors:{type:"integer"},effective_cases:{anyOf:[{type:"number"},{type:"null"}]}},required:["paired_cases","clusters","few_clusters","trials","floor_cases","inconclusive","coverage","judges","aa_half_width","errors","effective_cases"]},need:{anyOf:[{type:"object",additionalProperties:!1,properties:{cases:{type:"integer"},total_cases:{type:"integer"},cost:{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]},eta_hours:{anyOf:[{type:"number"},{type:"null"}]}},required:["cases","total_cases","cost","eta_hours"]},{type:"null"}]},changed:{type:"object",additionalProperties:!1,properties:{worse:{type:"integer"},better:{type:"integer"}},required:["worse","better"]},diverged:{anyOf:[{type:"object",additionalProperties:!1,properties:{baseline:{type:"object",additionalProperties:!1,properties:{value:{type:"number"},n:{type:"integer"},lower:{type:"number"},upper:{type:"number"}},required:["value","n","lower","upper"]},candidate:{type:"object",additionalProperties:!1,properties:{value:{type:"number"},n:{type:"integer"},lower:{type:"number"},upper:{type:"number"}},required:["value","n","lower","upper"]}},required:["baseline","candidate"]},{type:"null"}]},pareto:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{label:{type:"string"},ref:{type:"object",additionalProperties:!1,properties:{source:{type:"string"},run_id:{type:"string"}},required:["source","run_id"]},cost_per_task:{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]},quality:{type:"number"},frontier:{type:"boolean"},holdout_confirmed:{type:"boolean"}},required:["label","ref","cost_per_task","quality","frontier","holdout_confirmed"]}},decision_detail:{anyOf:[{type:"object",additionalProperties:!1,properties:{by:{type:"string"},at:{type:"string",format:"date-time"},note:{anyOf:[{type:"string"},{type:"null"}]}},required:["by","at","note"]},{type:"null"}]},actions:{type:"object",additionalProperties:!1,properties:{ship:{type:"object",additionalProperties:!1,properties:{allowed:{type:"boolean"},reason:{anyOf:[{type:"string"},{type:"null"}]},kind:{anyOf:[{type:"string"},{type:"null"}]}},required:["allowed","reason","kind"]},run_more:{type:"object",additionalProperties:!1,properties:{allowed:{type:"boolean"},reason:{anyOf:[{type:"string"},{type:"null"}]},cases:{anyOf:[{type:"integer"},{type:"null"}]},cost:{anyOf:[{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]},{type:"null"}]}},required:["allowed","reason","cases","cost"]},dont_ship:{type:"object",additionalProperties:!1,properties:{allowed:{type:"boolean"},reason:{anyOf:[{type:"string"},{type:"null"}]}},required:["allowed","reason"]},accept_regression:{type:"object",additionalProperties:!1,properties:{allowed:{type:"boolean"},reason:{anyOf:[{type:"string"},{type:"null"}]}},required:["allowed","reason"]}},required:["ship","run_more","dont_ship","accept_regression"]},links:{type:"object",additionalProperties:!1,properties:{workbench_id:{anyOf:[{type:"string"},{type:"null"}]},rollout_experiment_id:{anyOf:[{type:"string"},{type:"null"}]},brief_id:{anyOf:[{type:"string"},{type:"null"}]},pr:{anyOf:[{type:"object",additionalProperties:!1,properties:{repo:{type:"string"},number:{type:"integer"},check_run_url:{anyOf:[{type:"string"},{type:"null"}]}},required:["repo","number","check_run_url"]},{type:"null"}]}},required:["workbench_id","rollout_experiment_id","brief_id","pr"]},kernel_version:{type:"string"},row:{anyOf:[{type:"integer"},{type:"null"}]}},required:["ref","workload","label","executor","state","verdict","reason","sentence","quality","cost","cost_rung","paired_cases","look","started_at","computed_at","proving_cost","decision","pr","gate","arms","margin","useful_cost_effect","alpha","quality_outcome","cost_detail","criteria","segments","sample","need","changed","diverged","pareto","decision_detail","actions","links","kernel_version","row"]},binding:{path_inputs:{source:"source",runId:"run_id"},query_inputs:[],body_inputs:[]},contract_sha256:"140fd675cec77f35c6792ba38da2dd4137e1a880e4e857bb37fb517676c7124b"},{id:"verdicts.cases",version:"1",summary:"Cases that changed between arms, regressions first.",method:"GET",path:"/projects/{projectId}/verdicts/{source}/{runId}/cases",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_quality.verdict_cases"],input_schema:{type:"object",additionalProperties:!1,properties:{order:{type:"string"},include_same:{type:"string"},cursor:{type:"string"},limit:{type:"integer",minimum:0},source:{enum:["eval_run","experiment","scenario_run","factory_comparison"]},run_id:{type:"string",format:"uuid"}},required:["source","run_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{case_id:{type:"string"},cluster_id:{anyOf:[{type:"string"},{type:"null"}]},change:{type:"string"},baseline:{type:"object",additionalProperties:!1,properties:{scope:{type:"string"},unit_id:{type:"string"},task_key:{anyOf:[{type:"string"},{type:"null"}]},trace_id:{anyOf:[{type:"string"},{type:"null"}]},cell_id:{anyOf:[{type:"string"},{type:"null"}]}},required:["scope","unit_id","task_key","trace_id","cell_id"]},candidate:{type:"object",additionalProperties:!1,properties:{scope:{type:"string"},unit_id:{type:"string"},task_key:{anyOf:[{type:"string"},{type:"null"}]},trace_id:{anyOf:[{type:"string"},{type:"null"}]},cell_id:{anyOf:[{type:"string"},{type:"null"}]}},required:["scope","unit_id","task_key","trace_id","cell_id"]},criteria:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{criterion:{type:"object",additionalProperties:!1,properties:{criterion_id:{anyOf:[{type:"string"},{type:"null"}]},version:{type:"integer"},label:{type:"string"},statement:{anyOf:[{type:"string"},{type:"null"}]}},required:["criterion_id","version","label","statement"]},baseline:{type:"string"},candidate:{type:"string"}},required:["criterion","baseline","candidate"]}},diverged_at:{anyOf:[{type:"integer"},{type:"null"}]},cost:{type:"object",additionalProperties:!1,properties:{baseline:{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]},candidate:{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]}},required:["baseline","candidate"]}},required:["case_id","cluster_id","change","baseline","candidate","criteria","diverged_at","cost"]}},next_cursor:{anyOf:[{type:"string"},{type:"null"}]}},required:["data","next_cursor"]},binding:{path_inputs:{source:"source",runId:"run_id"},query_inputs:["order","include_same","cursor","limit"],body_inputs:[]},contract_sha256:"2163442e343247ba5271c4c1d06ef68179131f978fb217bed75f3675fcc5caf2"},{id:"verdicts.decide",version:"1",summary:"Ship, don't ship, or accept a CI regression.",method:"POST",path:"/projects/{projectId}/verdicts/{source}/{runId}/decision",permissions:["experiment:approve_s3"],scope:"project",access:"none",exclusion:"Ship starts a rollout or a pull request, and Don't ship or Accept regression closes a comparison. Each is an audited human decision (ADR 0046).",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{decision:{enum:["ship","dont_ship","accept_regression"]},note:{type:"string",maxLength:500},source:{enum:["eval_run","experiment","scenario_run","factory_comparison"]},run_id:{type:"string",format:"uuid"}},required:["source","run_id","decision"]},output_schema:{type:"object",additionalProperties:!1,properties:{decision:{type:"string"},rollout_experiment_id:{anyOf:[{type:"string"},{type:"null"}]},brief_id:{anyOf:[{type:"string"},{type:"null"}]}},required:["decision","rollout_experiment_id","brief_id"]},binding:{path_inputs:{source:"source",runId:"run_id"},query_inputs:[],body_inputs:["decision","note"]},contract_sha256:"a9bb9ae042ce0e99e1ab44346e9492fedf18a23e750ad0ff1a7dc33be307bca4"},{id:"wizard.start",version:"1",summary:"Start an onboarding wizard session for this project; any open session of yours here is cancelled. Returns the id and the heartbeat interval.",method:"POST",path:"/projects/{projectId}/wizard-sessions",permissions:["proposal:draft"],scope:"project",access:"write",aliases:["caveman_wizard_write.start"],input_schema:{type:"object",additionalProperties:!1,properties:{client:{enum:["claude","codex"]},repo_owner:{type:"string"},repo_name:{type:"string"},default_branch:{type:"string"},head_sha:{type:"string"}},required:["client"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string",format:"uuid"},heartbeat_interval_s:{type:"integer",minimum:1}},required:["id","heartbeat_interval_s"]},binding:{path_inputs:{},query_inputs:[],body_inputs:["client","repo_owner","repo_name","default_branch","head_sha"]},contract_sha256:"e780f733692c9fea9e6a0d178467b8f1ab030130cd2a7dda5007ff2aed2f2f6a"},{id:"wizard.get",version:"1",summary:"Read one wizard session with the server's health reading.",method:"GET",path:"/projects/{projectId}/wizard-sessions/{sessionId}",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_wizard.get"],input_schema:{type:"object",additionalProperties:!1,properties:{session_id:{type:"string",pattern:"^[A-Za-z0-9._:-]{1,128}$"}},required:["session_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},user_id:{type:"string"},client:{type:"string"},phase:{type:"string"},tasks:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},label:{type:"string"},status:{type:"string"},detail:{type:"string"}},required:["id","label","status"]}},pending_input:{anyOf:[{type:"string"},{type:"null"}]},branch:{anyOf:[{type:"string"},{type:"null"}]},pr_url:{anyOf:[{type:"string"},{type:"null"}]},error:{anyOf:[{type:"string"},{type:"null"}]},repo_owner:{anyOf:[{type:"string"},{type:"null"}]},repo_name:{anyOf:[{type:"string"},{type:"null"}]},default_branch:{anyOf:[{type:"string"},{type:"null"}]},head_sha:{anyOf:[{type:"string"},{type:"null"}]},started_at:{type:"string",format:"date-time"},last_heartbeat_at:{type:"string",format:"date-time"},finished_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},created_at:{type:"string",format:"date-time"},health:{type:"string"}},required:["id","organization_id","project_id","user_id","client","phase","tasks","pending_input","branch","pr_url","error","repo_owner","repo_name","default_branch","head_sha","started_at","last_heartbeat_at","finished_at","created_at","health"]},binding:{path_inputs:{sessionId:"session_id"},query_inputs:[],body_inputs:[]},contract_sha256:"cd10d013a3c42ed6257c03279621ffac611b764e622e58b252f9f23350f28848"},{id:"wizard.update",version:"1",summary:"Report wizard progress: phase, tasks, the pending terminal question, branch, pull request link or error. Every update is a heartbeat.",method:"PATCH",path:"/projects/{projectId}/wizard-sessions/{sessionId}",permissions:["proposal:draft"],scope:"project",access:"write",aliases:["caveman_wizard_write.update"],input_schema:{type:"object",additionalProperties:!1,properties:{phase:{enum:["connecting","planning","awaiting_confirmation","editing","testing","publishing","completed","failed","cancelled"]},tasks:{type:"array",maxItems:16,items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},label:{type:"string",maxLength:80},status:{enum:["pending","running","done","blocked","failed"]},detail:{type:"string",maxLength:240}},required:["id","label","status"]}},pending_input:{type:"string",maxLength:500},branch:{type:"string"},pr_url:{type:"string",pattern:"^(https://|$)"},error:{type:"string",maxLength:500},session_id:{type:"string",pattern:"^[A-Za-z0-9._:-]{1,128}$"}},required:["session_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},user_id:{type:"string"},client:{type:"string"},phase:{type:"string"},tasks:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},label:{type:"string"},status:{type:"string"},detail:{type:"string"}},required:["id","label","status"]}},pending_input:{anyOf:[{type:"string"},{type:"null"}]},branch:{anyOf:[{type:"string"},{type:"null"}]},pr_url:{anyOf:[{type:"string"},{type:"null"}]},error:{anyOf:[{type:"string"},{type:"null"}]},repo_owner:{anyOf:[{type:"string"},{type:"null"}]},repo_name:{anyOf:[{type:"string"},{type:"null"}]},default_branch:{anyOf:[{type:"string"},{type:"null"}]},head_sha:{anyOf:[{type:"string"},{type:"null"}]},started_at:{type:"string",format:"date-time"},last_heartbeat_at:{type:"string",format:"date-time"},finished_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},created_at:{type:"string",format:"date-time"},health:{type:"string"}},required:["id","organization_id","project_id","user_id","client","phase","tasks","pending_input","branch","pr_url","error","repo_owner","repo_name","default_branch","head_sha","started_at","last_heartbeat_at","finished_at","created_at","health"]},binding:{path_inputs:{sessionId:"session_id"},query_inputs:[],body_inputs:["phase","tasks","pending_input","branch","pr_url","error"]},contract_sha256:"4cedaf4a6853bae83e964dd51a609540fda8d53adf7bd5e787fd93ced4185bef"},{id:"wizard.cancel",version:"1",summary:"Cancel a wizard session.",method:"POST",path:"/projects/{projectId}/wizard-sessions/{sessionId}/cancel",permissions:["proposal:draft","settings:read"],scope:"project",access:"write",aliases:["caveman_wizard_write.cancel"],input_schema:{type:"object",additionalProperties:!1,properties:{session_id:{type:"string",pattern:"^[A-Za-z0-9._:-]{1,128}$"}},required:["session_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},user_id:{type:"string"},client:{type:"string"},phase:{type:"string"},tasks:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},label:{type:"string"},status:{type:"string"},detail:{type:"string"}},required:["id","label","status"]}},pending_input:{anyOf:[{type:"string"},{type:"null"}]},branch:{anyOf:[{type:"string"},{type:"null"}]},pr_url:{anyOf:[{type:"string"},{type:"null"}]},error:{anyOf:[{type:"string"},{type:"null"}]},repo_owner:{anyOf:[{type:"string"},{type:"null"}]},repo_name:{anyOf:[{type:"string"},{type:"null"}]},default_branch:{anyOf:[{type:"string"},{type:"null"}]},head_sha:{anyOf:[{type:"string"},{type:"null"}]},started_at:{type:"string",format:"date-time"},last_heartbeat_at:{type:"string",format:"date-time"},finished_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},created_at:{type:"string",format:"date-time"},health:{type:"string"}},required:["id","organization_id","project_id","user_id","client","phase","tasks","pending_input","branch","pr_url","error","repo_owner","repo_name","default_branch","head_sha","started_at","last_heartbeat_at","finished_at","created_at","health"]},binding:{path_inputs:{sessionId:"session_id"},query_inputs:[],body_inputs:[]},contract_sha256:"c263a775029426c318c6ed9fa79a2fc3d04eda4853cddaa723d29b8d25468941"},{id:"wizard.current",version:"1",summary:"Read the project's latest wizard session that is open or finished in the last 24 hours, with the server's health reading.",method:"GET",path:"/projects/{projectId}/wizard-sessions/current",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_wizard.current"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},user_id:{type:"string"},client:{type:"string"},phase:{type:"string"},tasks:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},label:{type:"string"},status:{type:"string"},detail:{type:"string"}},required:["id","label","status"]}},pending_input:{anyOf:[{type:"string"},{type:"null"}]},branch:{anyOf:[{type:"string"},{type:"null"}]},pr_url:{anyOf:[{type:"string"},{type:"null"}]},error:{anyOf:[{type:"string"},{type:"null"}]},repo_owner:{anyOf:[{type:"string"},{type:"null"}]},repo_name:{anyOf:[{type:"string"},{type:"null"}]},default_branch:{anyOf:[{type:"string"},{type:"null"}]},head_sha:{anyOf:[{type:"string"},{type:"null"}]},started_at:{type:"string",format:"date-time"},last_heartbeat_at:{type:"string",format:"date-time"},finished_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},created_at:{type:"string",format:"date-time"},health:{type:"string"}},required:["id","organization_id","project_id","user_id","client","phase","tasks","pending_input","branch","pr_url","error","repo_owner","repo_name","default_branch","head_sha","started_at","last_heartbeat_at","finished_at","created_at","health"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"e4838bf423937853437f05bb543e3eae1cb1f4494e84bf72be3a352d74a60449"},{id:"workflows.get",version:"1",summary:"workflows: get",method:"GET",path:"/projects/{projectId}/workflows/{workflowId}",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_workflows.get"],input_schema:{type:"object",additionalProperties:!1,properties:{workflow_id:{type:"string",format:"uuid"}},required:["workflow_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},agent_id:{type:"string"},project_id:{type:"string"},slug:{type:"string"},name:{type:"string"},description:{type:"string"},discovered:{type:"boolean"},risk_level:{type:"string"}},required:["id","agent_id","project_id","slug","name","description","discovered","risk_level"]},binding:{path_inputs:{workflowId:"workflow_id"},query_inputs:[],body_inputs:[]},contract_sha256:"a4e95cdfad6b2245a7de1214c2da6e6f4498707d5a17b6200f6aa7701e71d6ef"},{id:"workflows.update",version:"1",summary:"workflows: update",method:"PATCH",path:"/projects/{projectId}/workflows/{workflowId}",permissions:["policy:draft"],scope:"project",access:"write",aliases:["caveman_workflows_write.update"],input_schema:{type:"object",additionalProperties:!1,properties:{description:{type:"string"},name:{type:"string"},risk_level:{type:"string"},workflow_id:{type:"string",format:"uuid"}},required:["workflow_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},agent_id:{type:"string"},project_id:{type:"string"},slug:{type:"string"},name:{type:"string"},description:{type:"string"},discovered:{type:"boolean"},risk_level:{type:"string"}},required:["id","agent_id","project_id","slug","name","description","discovered","risk_level"]},binding:{path_inputs:{workflowId:"workflow_id"},query_inputs:[],body_inputs:["description","name","risk_level"]},contract_sha256:"aba819064e4f647b1752017a2bde7428971bff3aef0242d7dcf974ca016abb1f"},{id:"human.provider_catalog",version:"1",summary:"human: provider_catalog",method:"GET",path:"/providers/catalog",permissions:[],scope:"organization",access:"none",exclusion:"Not RBAC-guarded \u2014 part of the authentication or webhook plane. Agents authenticate through a scoped control-plane session and never touch these directly.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"401a24ad3d219061639bf2758cc7c4a9197f82967666092e86496f00c0084c5b"},{id:"monitors.list",version:"1",summary:"monitors: list",method:"GET",path:"/quality-monitors",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_monitors.list"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{scoring_authorized:{anyOf:[{type:"boolean"},{type:"null"}]},qualification_id:{anyOf:[{type:"string"},{type:"null"}]},evaluator_id:{anyOf:[{type:"string"},{type:"null"}]},evaluator_version:{anyOf:[{type:"integer"},{type:"null"}]},id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},agent_id:{anyOf:[{type:"string"},{type:"null"}]},workflow_id:{anyOf:[{type:"string"},{type:"null"}]},name:{type:"string"},description:{type:"string"},status:{type:"string"},version:{type:"integer"},graders_json:{},sample_rate:{type:"number"},preconditions_json:{},payload_required:{type:"boolean"},thresholds_json:{},dataset_destination_json:{},created_by:{anyOf:[{type:"string"},{type:"null"}]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"},workload_id:{anyOf:[{type:"string"},{type:"null"}]},scope:{type:"string"},criteria:{type:["array","null"],items:{type:"string"}},sample:{type:"object",additionalProperties:!1,properties:{target_rate:{type:"number"},effective_rate:{type:"number"},paced:{type:"boolean"}},required:["target_rate","effective_rate","paced"]},budget:{anyOf:[{type:"object",additionalProperties:!1,properties:{daily:{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]},spent_today:{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]}},required:["daily","spent_today"]},{type:"null"}]},task_idle_minutes:{type:"integer"},last_result:{anyOf:[{type:"object",additionalProperties:!1,properties:{graded_at:{type:"string",format:"date-time"},verdict:{type:"string"},sampled:{type:"integer"},graded:{type:"integer"},not_graded:{type:"object",additionalProperties:!1,properties:{over_budget:{type:"integer"},too_large:{type:"integer"},stranded:{type:"integer"}},required:["over_budget","too_large","stranded"]}},required:["graded_at","verdict","sampled","graded","not_graded"]},{type:"null"}]}},required:["id","organization_id","project_id","agent_id","workflow_id","name","description","status","version","graders_json","sample_rate","preconditions_json","payload_required","thresholds_json","dataset_destination_json","created_at","updated_at","workload_id","scope","criteria","sample","budget","task_idle_minutes","last_result"]}},next_cursor:{type:"null"}},required:["data","next_cursor"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"7ae4962e2a11eaa284c7450d66b9b32626d067a34810f39c9dd6ba67a4cd8cc9"},{id:"monitors.create",version:"1",summary:"human: create_quality_monitor",method:"POST",path:"/quality-monitors",permissions:["eval:write"],scope:"project",access:"none",exclusion:"Quality monitors carry a caller-supplied grader egress URL that receives captured response payloads server-side. Creating or editing that target is human-only (ONBOARDING_V2_SPEC non-goal; caveman-cloud-project skill section 5).",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}},body:{type:"object",additionalProperties:!0}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"ed4c235d195e0a8cabe3d324c2a715748da945d70fbc59410bc0a3ffcd363cf5"},{id:"monitors.get",version:"1",summary:"monitors: get",method:"GET",path:"/quality-monitors/{monitorId}",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_monitors.get"],input_schema:{type:"object",additionalProperties:!1,properties:{monitor_id:{type:"string",format:"uuid"}},required:["monitor_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{scoring_authorized:{anyOf:[{type:"boolean"},{type:"null"}]},qualification_id:{anyOf:[{type:"string"},{type:"null"}]},evaluator_id:{anyOf:[{type:"string"},{type:"null"}]},evaluator_version:{anyOf:[{type:"integer"},{type:"null"}]},id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},agent_id:{anyOf:[{type:"string"},{type:"null"}]},workflow_id:{anyOf:[{type:"string"},{type:"null"}]},name:{type:"string"},description:{type:"string"},status:{type:"string"},version:{type:"integer"},graders_json:{},sample_rate:{type:"number"},preconditions_json:{},payload_required:{type:"boolean"},thresholds_json:{},dataset_destination_json:{},created_by:{anyOf:[{type:"string"},{type:"null"}]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"},workload_id:{anyOf:[{type:"string"},{type:"null"}]},scope:{type:"string"},criteria:{type:["array","null"],items:{type:"string"}},sample:{type:"object",additionalProperties:!1,properties:{target_rate:{type:"number"},effective_rate:{type:"number"},paced:{type:"boolean"}},required:["target_rate","effective_rate","paced"]},budget:{anyOf:[{type:"object",additionalProperties:!1,properties:{daily:{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]},spent_today:{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]}},required:["daily","spent_today"]},{type:"null"}]},task_idle_minutes:{type:"integer"},last_result:{anyOf:[{type:"object",additionalProperties:!1,properties:{graded_at:{type:"string",format:"date-time"},verdict:{type:"string"},sampled:{type:"integer"},graded:{type:"integer"},not_graded:{type:"object",additionalProperties:!1,properties:{over_budget:{type:"integer"},too_large:{type:"integer"},stranded:{type:"integer"}},required:["over_budget","too_large","stranded"]}},required:["graded_at","verdict","sampled","graded","not_graded"]},{type:"null"}]}},required:["id","organization_id","project_id","agent_id","workflow_id","name","description","status","version","graders_json","sample_rate","preconditions_json","payload_required","thresholds_json","dataset_destination_json","created_at","updated_at","workload_id","scope","criteria","sample","budget","task_idle_minutes","last_result"]},binding:{path_inputs:{monitorId:"monitor_id"},query_inputs:[],body_inputs:[]},contract_sha256:"afb41c77200942f16c3742051fd6243cfdf058fee6bbe9d13796a94e22a3ded9"},{id:"monitors.update",version:"1",summary:"human: update_quality_monitor",method:"PUT",path:"/quality-monitors/{monitorId}",permissions:["eval:write"],scope:"project",access:"none",exclusion:"Quality monitors carry a caller-supplied grader egress URL that receives captured response payloads server-side. Creating or editing that target is human-only (ONBOARDING_V2_SPEC non-goal; caveman-cloud-project skill section 5).",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{parameters:{type:"object",additionalProperties:!1,properties:{monitorId:{type:"string"}},required:["monitorId"]},query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}},body:{type:"object",additionalProperties:!0}},required:["parameters"]},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"f0a93870f599dcd835b23e20343228e9fd193e827269d1b9a0420e096234bffb"},{id:"monitors.results",version:"1",summary:"monitors: results",method:"GET",path:"/quality-monitors/{monitorId}/results",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_monitors.results"],input_schema:{type:"object",additionalProperties:!1,properties:{from:{type:"string",format:"date-time"},sample_data:{type:"boolean"},to:{type:"string",format:"date-time"},window:{type:"string"},monitor_id:{type:"string",format:"uuid"}},required:["monitor_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{monitor_id:{type:"string"},summary:{type:"object",additionalProperties:!1,properties:{graded:{type:"integer"},passed:{type:"integer"},failed:{type:"integer"},errors:{type:"integer"},skipped:{type:"integer"},incomplete:{type:"integer"},pass_rate:{type:"number"},error_rate:{type:"number"},health:{type:"string"},basis:{type:"string"}},required:["graded","passed","failed","errors","skipped","incomplete","pass_rate","error_rate","health","basis"]},items:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{timestamp:{type:"string"},graded_at:{type:"string"},monitor_version:{type:"integer"},trace_id:{type:"string"},request_id:{type:"string"},span_id:{type:"string"},agent_slug:{type:"string"},workflow_slug:{type:"string"},model:{type:"string"},grader_type:{type:"string"},status:{type:"string"},fault:{type:"string"},passed:{anyOf:[{type:"boolean"},{type:"null"}]},score:{anyOf:[{type:"number"},{type:"null"}]},label:{type:"string"},details:{type:"string"},error:{type:"string"},sample_rate:{type:"number"},basis:{type:"string"}},required:["timestamp","graded_at","monitor_version","trace_id","request_id","grader_type","status","passed","score","sample_rate","basis"]}}},required:["monitor_id","summary","items"]},binding:{path_inputs:{monitorId:"monitor_id"},query_inputs:["from","sample_data","to","window"],body_inputs:[]},contract_sha256:"8f5b0d89e138e575a292310f15f34256a75a6f6a07e4466568a1f6663890c56b"},{id:"monitors.set_status",version:"1",summary:"monitors: set_status",method:"POST",path:"/quality-monitors/{monitorId}/status",permissions:["eval:write"],scope:"project",access:"write",aliases:["caveman_monitors_write.set_status"],input_schema:{type:"object",additionalProperties:!1,properties:{status:{enum:["draft","active","archived"]},monitor_id:{type:"string",format:"uuid"}},required:["monitor_id","status"]},output_schema:{type:"object",additionalProperties:!1,properties:{scoring_authorized:{anyOf:[{type:"boolean"},{type:"null"}]},qualification_id:{anyOf:[{type:"string"},{type:"null"}]},evaluator_id:{anyOf:[{type:"string"},{type:"null"}]},evaluator_version:{anyOf:[{type:"integer"},{type:"null"}]},id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},agent_id:{anyOf:[{type:"string"},{type:"null"}]},workflow_id:{anyOf:[{type:"string"},{type:"null"}]},name:{type:"string"},description:{type:"string"},status:{type:"string"},version:{type:"integer"},graders_json:{},sample_rate:{type:"number"},preconditions_json:{},payload_required:{type:"boolean"},thresholds_json:{},dataset_destination_json:{},created_by:{anyOf:[{type:"string"},{type:"null"}]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"},workload_id:{anyOf:[{type:"string"},{type:"null"}]},scope:{type:"string"},criteria:{type:["array","null"],items:{type:"string"}},sample:{type:"object",additionalProperties:!1,properties:{target_rate:{type:"number"},effective_rate:{type:"number"},paced:{type:"boolean"}},required:["target_rate","effective_rate","paced"]},budget:{anyOf:[{type:"object",additionalProperties:!1,properties:{daily:{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]},spent_today:{type:"object",additionalProperties:!1,properties:{usd:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"}},required:["usd","basis"]}},required:["daily","spent_today"]},{type:"null"}]},task_idle_minutes:{type:"integer"},last_result:{anyOf:[{type:"object",additionalProperties:!1,properties:{graded_at:{type:"string",format:"date-time"},verdict:{type:"string"},sampled:{type:"integer"},graded:{type:"integer"},not_graded:{type:"object",additionalProperties:!1,properties:{over_budget:{type:"integer"},too_large:{type:"integer"},stranded:{type:"integer"}},required:["over_budget","too_large","stranded"]}},required:["graded_at","verdict","sampled","graded","not_graded"]},{type:"null"}]}},required:["id","organization_id","project_id","agent_id","workflow_id","name","description","status","version","graders_json","sample_rate","preconditions_json","payload_required","thresholds_json","dataset_destination_json","created_at","updated_at","workload_id","scope","criteria","sample","budget","task_idle_minutes","last_result"]},binding:{path_inputs:{monitorId:"monitor_id"},query_inputs:[],body_inputs:["status"]},contract_sha256:"d54d5c235bd8877d9716a92027c201a29ab927e35d25f0c288b4da647982a436"},{id:"reports.agents",version:"1",summary:"reports: agents",method:"GET",path:"/reports/agents",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_reports.agents"],input_schema:{type:"object",additionalProperties:!1,properties:{from:{type:"string",format:"date-time"},sample_data:{type:"boolean"},to:{type:"string",format:"date-time"},window:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{slug:{type:"string"},requests:{type:"integer"},spend:{type:"number"},catalog_priced_complete_rows:{type:"integer"},unpriced_complete_rows:{type:"integer"},provider_incomplete_rows:{type:"integer"},cave_score:{anyOf:[{type:"integer"},{type:"null"}]},prefill_amplification:{anyOf:[{type:"number"},{type:"null"}]},paf_session_requests:{type:"integer"}},required:["slug","requests","spend","catalog_priced_complete_rows","unpriced_complete_rows","provider_incomplete_rows"]}},next_cursor:{type:"null"}},required:["data","next_cursor"]},binding:{path_inputs:{},query_inputs:["from","sample_data","to","window"],body_inputs:[]},contract_sha256:"279b33432647de4f87ad630b995dfddf6123304eae7ff12f88b41a667f4ec2b3"},{id:"reports.cache",version:"1",summary:"reports: cache",method:"GET",path:"/reports/cache",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_reports.cache"],input_schema:{type:"object",additionalProperties:!1,properties:{from:{type:"string",format:"date-time"},sample_data:{type:"boolean"},to:{type:"string",format:"date-time"},window:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{cache_hit_ratio:{type:"number"},cached_input_tokens:{type:"integer"}},required:["cache_hit_ratio","cached_input_tokens"]},binding:{path_inputs:{},query_inputs:["from","sample_data","to","window"],body_inputs:[]},contract_sha256:"4ec319a544a98f9d3477fc80b8fffcd3983d76a1d24d1f506a22835fabf9484a"},{id:"plan.score",version:"1",summary:"plan: score",method:"GET",path:"/reports/cave-score",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_plan.score"],input_schema:{type:"object",additionalProperties:!1,properties:{from:{type:"string",format:"date-time"},sample_data:{type:"boolean"},to:{type:"string",format:"date-time"},window:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{scored:{type:"boolean"},score:{type:"integer"},penalties:{type:["object","null"],additionalProperties:{type:"integer"}},penalty_rows:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{key:{type:"string"},points:{type:"integer"},cap:{type:"integer"},kind:{type:"string"},headroom_usd_per_day:{type:"number"},optimizer_id:{type:"string"}},required:["key","points","cap","kind"]}},measured_spend:{anyOf:[{type:"number"},{type:"null"}]},projected_available_savings:{anyOf:[{type:"number"},{type:"null"}]},basis:{type:"string"},requests_per_day:{anyOf:[{type:"number"},{type:"null"}]},trend:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{day:{type:"string"},score:{anyOf:[{type:"integer"},{type:"null"}]}},required:["day","score"]}}},required:["scored","score","penalties","penalty_rows","projected_available_savings","basis","requests_per_day","trend"]},binding:{path_inputs:{},query_inputs:["from","sample_data","to","window"],body_inputs:[]},contract_sha256:"f05c94e29c4aff4288498b47c486bb8aee2652bf99dca739f2d454684c7e6a83"},{id:"reports.compression",version:"1",summary:"reports: compression",method:"GET",path:"/reports/compression",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_reports.compression"],input_schema:{type:"object",additionalProperties:!1,properties:{from:{type:"string",format:"date-time"},sample_data:{type:"boolean"},to:{type:"string",format:"date-time"},window:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{compressor_id:{type:"string"},requests_compressed:{type:"integer"},tokens_before:{type:"integer"},tokens_after:{type:"integer"},avg_ratio:{type:"number"},basis:{type:"string"},token_count_basis:{type:"string"}},required:["compressor_id","requests_compressed","tokens_before","tokens_after","avg_ratio","basis","token_count_basis"]}},next_cursor:{type:"null"}},required:["data","next_cursor"]},binding:{path_inputs:{},query_inputs:["from","sample_data","to","window"],body_inputs:[]},contract_sha256:"692f99ad8abf4be2bf2610bb8465e42d06a6544a7162116e9bca4552a8d276a1"},{id:"reports.costs",version:"1",summary:"reports: costs",method:"GET",path:"/reports/costs",permissions:["billing:read"],scope:"project",access:"read",aliases:["caveman_reports.costs"],input_schema:{type:"object",additionalProperties:!1,properties:{from:{type:"string",format:"date-time"},sample_data:{type:"boolean"},to:{type:"string",format:"date-time"},window:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{automatic_savings:{type:"object",additionalProperties:!1,properties:{cache_observed_usd:{type:"number"},cache_requests:{type:"integer"},cache_basis:{type:"string"},router_inferred_usd:{type:"number"},router_baseline_usd:{type:"number"},router_actual_usd:{type:"number"},router_requests:{type:"integer"},router_basis:{type:"string"},baseline_models:{type:["array","null"],items:{type:"string"}},unconfirmed_baseline_models:{type:["array","null"],items:{type:"string"}}},required:["cache_observed_usd","cache_requests","cache_basis","router_inferred_usd","router_baseline_usd","router_actual_usd","router_requests","router_basis","baseline_models","unconfirmed_baseline_models"]},currency:{type:"string"},measured_spend:{type:"number"},imported_observed_spend:{type:"number"},verified_savings:{type:"number"},projected_available_savings:{type:"number"},projected_available_savings_unit:{type:"string"},projected_available_savings_basis:{type:"string"},series:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{day:{type:"string"},spend:{type:"number"},total_rows:{type:"integer"},catalog_priced_complete_rows:{type:"integer"},unpriced_complete_rows:{type:"integer"},provider_incomplete_rows:{type:"integer"}},required:["day","spend","total_rows","catalog_priced_complete_rows","unpriced_complete_rows","provider_incomplete_rows"]}},pricing_accounting:{type:"object",additionalProperties:!1,properties:{total_rows:{type:"integer"},catalog_priced_complete_rows:{type:"integer"},unpriced_complete_rows:{type:"integer"},provider_incomplete_rows:{type:"integer"},spend_basis:{type:"string"}},required:["total_rows","catalog_priced_complete_rows","unpriced_complete_rows","provider_incomplete_rows","spend_basis"]},imported_spend_basis:{type:"string"},subscription_unpriced_rows:{type:"integer"}},required:["automatic_savings","currency","measured_spend","imported_observed_spend","verified_savings","projected_available_savings","projected_available_savings_unit","projected_available_savings_basis","series","pricing_accounting","imported_spend_basis","subscription_unpriced_rows"]},binding:{path_inputs:{},query_inputs:["from","sample_data","to","window"],body_inputs:[]},contract_sha256:"bb1804f7bb5b51b1c21e955e8f7eea82a6d94de3cf8af36260d024db96d5a2ee"},{id:"people.delivery",version:"1",summary:"people: delivery",method:"GET",path:"/reports/delivery",permissions:["billing:read"],scope:"project",access:"read",aliases:["caveman_people.delivery"],input_schema:{type:"object",additionalProperties:!1,properties:{from:{type:"string",format:"date-time"},sample_data:{type:"boolean"},to:{type:"string",format:"date-time"},window:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{window:{type:"string"},scope:{type:"string"},connected:{type:"boolean"},history_import:{type:"string"},repos:{type:["array","null"],items:{type:"string"}},basis:{type:"string"},totals:{type:"object",additionalProperties:!1,properties:{merged_prs:{type:"integer"},attributed_prs:{type:"integer"},cost_to_merge_usd:{type:"number"},median_cost_usd:{anyOf:[{type:"number"},{type:"null"}]},p90_cost_usd:{anyOf:[{type:"number"},{type:"null"}]},median_sessions:{anyOf:[{type:"number"},{type:"null"}]},unlanded_branches:{type:"integer"},unlanded_sessions:{type:"integer"},unlanded_cost_usd:{type:"number"},in_flight_branches:{type:"integer"},in_flight_sessions:{type:"integer"},in_flight_cost_usd:{type:"number"},unresolved_cost_usd:{type:"number"},branch_tagged_cost_usd:{type:"number"},untagged_cost_usd:{type:"number"},attribution_statuses:{type:["object","null"],additionalProperties:{type:"integer"}},session_linked_requests:{type:"integer"},branch_tagged_requests:{type:"integer"},priced_requests:{type:"integer"},coverage:{type:"number"}},required:["merged_prs","attributed_prs","cost_to_merge_usd","median_cost_usd","p90_cost_usd","median_sessions","unlanded_branches","unlanded_sessions","unlanded_cost_usd","in_flight_branches","in_flight_sessions","in_flight_cost_usd","unresolved_cost_usd","branch_tagged_cost_usd","untagged_cost_usd","attribution_statuses","session_linked_requests","branch_tagged_requests","priced_requests","coverage"]},by_work_type:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{key:{type:"string"},label:{type:"string"},merged_prs:{type:"integer"},attributed_prs:{type:"integer"},total_cost_usd:{type:"number"},median_cost_usd:{anyOf:[{type:"number"},{type:"null"}]},median_changed_files:{anyOf:[{type:"number"},{type:"null"}]}},required:["key","label","merged_prs","attributed_prs","total_cost_usd","median_cost_usd","median_changed_files"]}},by_harness:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{agent_slug:{type:"string"},attributed_prs:{type:"integer"},total_cost_usd:{type:"number"},median_cost_usd:{anyOf:[{type:"number"},{type:"null"}]},median_sessions:{anyOf:[{type:"number"},{type:"null"}]},median_floor:{type:"integer"}},required:["agent_slug","attributed_prs","total_cost_usd","median_cost_usd","median_sessions","median_floor"]}},by_repo:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{repo:{type:"string"},merged_prs:{type:"integer"},attributed_prs:{type:"integer"},total_cost_usd:{type:"number"},median_cost_usd:{anyOf:[{type:"number"},{type:"null"}]}},required:["repo","merged_prs","attributed_prs","total_cost_usd","median_cost_usd"]}},prs:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{project_id:{type:"string"},classification:{type:"object",additionalProperties:!1,properties:{key:{type:"string"},source:{type:"string"},version:{type:"string"},branch_type:{type:"string"},title_type:{type:"string"}},required:["key","source","version","branch_type","title_type"]},attribution_status:{type:"string"},evidence:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{member_user_id:{type:"string"},name:{type:"string"},email:{type:"string"},agent_slug:{type:"string"},model:{type:"string"},requests:{type:"integer"},priced_requests:{type:"integer"},cost_usd:{type:"number"}},required:["member_user_id","name","email","agent_slug","model","requests","priced_requests","cost_usd"]}},evidence_truncated:{type:"boolean"},repo:{type:"string"},number:{type:"integer"},title:{type:"string"},branch:{type:"string"},base_branch:{type:"string"},head_sha:{type:"string"},base_sha:{type:"string"},merge_commit_sha:{type:"string"},commit_count:{anyOf:[{type:"integer"},{type:"null"}]},author_login:{type:"string"},work_type:{type:"string"},merged_at:{type:"string"},opened_at:{type:"string"},additions:{type:"integer"},deletions:{type:"integer"},changed_files:{type:"integer"},attributed:{type:"boolean"},sessions:{type:"integer"},requests:{type:"integer"},cost_usd:{type:"number"},optimizers:{type:["array","null"],items:{type:"string"}}},required:["project_id","classification","attribution_status","evidence","evidence_truncated","repo","number","title","branch","author_login","work_type","merged_at","additions","deletions","changed_files","attributed","sessions","requests","cost_usd","optimizers"]}},unlanded:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{repo:{type:"string"},project_id:{type:"string"},branch:{type:"string"},sessions:{type:"integer"},requests:{type:"integer"},cost_usd:{type:"number"},last_seen:{type:"string"}},required:["repo","project_id","branch","sessions","requests","cost_usd","last_seen"]}},optimizer_effects:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{optimizer_id:{type:"string"},with_prs:{type:"integer"},without_prs:{type:"integer"},mixed_prs:{type:"integer"},with_median_usd:{anyOf:[{type:"number"},{type:"null"}]},without_median_usd:{anyOf:[{type:"number"},{type:"null"}]},comparable:{type:"boolean"}},required:["optimizer_id","with_prs","without_prs","mixed_prs","with_median_usd","without_median_usd","comparable"]}},truncated:{type:"boolean"},basis_notes:{type:"object",additionalProperties:!1,properties:{join:{type:"string"},cost:{type:"string"},optimizer:{type:"string"},attribution:{type:"string"},medians:{type:"string"}},required:["join","cost","optimizer","attribution","medians"]}},required:["window","scope","connected","history_import","repos","basis","totals","by_work_type","by_harness","by_repo","prs","unlanded","optimizer_effects","truncated","basis_notes"]},binding:{path_inputs:{},query_inputs:["from","sample_data","to","window"],body_inputs:[]},contract_sha256:"77138675fe17092f08195684e24a003312d1fe5a664b4d4daf5c061f8debb3db"},{id:"people.developers",version:"1",summary:"people: developers",method:"GET",path:"/reports/developers",permissions:["billing:read"],scope:"project",access:"read",aliases:["caveman_people.developers"],input_schema:{type:"object",additionalProperties:!1,properties:{from:{type:"string",format:"date-time"},project_id:{type:"string"},sample_data:{type:"boolean"},to:{type:"string",format:"date-time"},window:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{days:{type:["array","null"],items:{type:"string"}},totals:{type:"object",additionalProperties:!1,properties:{developers:{type:"integer"},seat_holders:{type:"integer"},seats_limit:{anyOf:[{type:"integer"},{type:"null"}]},devices:{type:"integer"},project_members:{anyOf:[{type:"integer"},{type:"null"}]},prev_requests:{anyOf:[{type:"integer"},{type:"null"}]},prev_spend_usd:{anyOf:[{type:"number"},{type:"null"}]},prev_developers:{anyOf:[{type:"integer"},{type:"null"}]},requests:{type:"integer"},priced_requests:{type:"integer"},spend_usd:{type:"number"},org_spend_usd:{type:"number"},attribution_coverage:{type:"number"},verified_savings_usd:{type:"number"}},required:["developers","seat_holders","seats_limit","devices","requests","priced_requests","spend_usd","org_spend_usd","attribution_coverage","verified_savings_usd"]},series:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{day:{type:"string"},agent_slug:{type:"string"},requests:{type:"integer"},spend_usd:{type:"number"}},required:["day","agent_slug","requests","spend_usd"]}},harnesses:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{agent_slug:{type:"string"},requests:{type:"integer"},priced_requests:{type:"integer"},spend_usd:{type:"number"},developers:{type:"integer"},input_tokens:{type:"integer"},output_tokens:{type:"integer"}},required:["agent_slug","requests","priced_requests","spend_usd","developers","input_tokens","output_tokens"]}},models:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{model:{type:"string"},provider:{type:"string"},requests:{type:"integer"},spend_usd:{type:"number"},developers:{type:"integer"}},required:["model","provider","requests","spend_usd","developers"]}},developers:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{member_user_id:{type:"string"},name:{type:"string"},email:{type:"string"},former_member:{type:"boolean"},project_member:{anyOf:[{type:"boolean"},{type:"null"}]},requests:{type:"integer"},priced_requests:{type:"integer"},input_tokens:{type:"integer"},output_tokens:{type:"integer"},cached_input_tokens:{type:"integer"},spend_usd:{type:"number"},prev_spend_usd:{anyOf:[{type:"number"},{type:"null"}]},verified_savings_usd:{type:"number"},top_harnesses:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{agent_slug:{type:"string"},requests:{type:"integer"},spend_usd:{type:"number"}},required:["agent_slug","requests","spend_usd"]}},top_models:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{model:{type:"string"},spend_usd:{type:"number"}},required:["model","spend_usd"]}},top_work_types:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{key:{type:"string"},label:{type:"string"},spend_usd:{type:"number"}},required:["key","label","spend_usd"]}},spark:{type:["array","null"],items:{type:"number"}},last_seen:{type:"string"},devices:{type:"integer"},last_login:{type:"string"}},required:["member_user_id","name","email","former_member","requests","priced_requests","input_tokens","output_tokens","cached_input_tokens","spend_usd","verified_savings_usd","top_harnesses","top_models","top_work_types","spark","last_seen","devices","last_login"]}},work_types:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{key:{type:"string"},label:{type:"string"},requests:{type:"integer"},spend_usd:{type:"number"},prev_spend_usd:{anyOf:[{type:"number"},{type:"null"}]},developers:{type:"integer"},sessions:{type:"integer"},input_tokens:{type:"integer"},cached_input_tokens:{type:"integer"},cache_missed_input_tokens:{type:"integer"},tool_schema_tokens:{type:"integer"},tier_spend_usd:{type:["object","null"],additionalProperties:{type:"number"}},top_developers:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{member_user_id:{type:"string"},spend_usd:{type:"number"}},required:["member_user_id","spend_usd"]}}},required:["key","label","requests","spend_usd","developers","sessions","input_tokens","cached_input_tokens","cache_missed_input_tokens","tool_schema_tokens","tier_spend_usd","top_developers"]}},series_work:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{day:{type:"string"},key:{type:"string"},requests:{type:"integer"},spend_usd:{type:"number"}},required:["day","key","requests","spend_usd"]}},work_type_version:{type:"string"}},required:["days","totals","series","harnesses","models","developers","work_types","series_work","work_type_version"]},binding:{path_inputs:{},query_inputs:["from","project_id","sample_data","to","window"],body_inputs:[]},contract_sha256:"62a9735be064cd9ca6ede64255b42c342ba4f73bb28e9b6be53d95d9f16e9fbc"},{id:"people.digest",version:"1",summary:"people: digest",method:"GET",path:"/reports/digest",permissions:["billing:read"],scope:"project",access:"read",aliases:["caveman_people.digest"],input_schema:{type:"object",additionalProperties:!1,properties:{from:{type:"string",format:"date-time"},to:{type:"string",format:"date-time"},window:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{window:{type:"string"},period:{type:"object",additionalProperties:!1,properties:{month:{type:"string"},from:{type:"string"},to:{type:"string"}},required:["month","from","to"]},current:{type:"object",additionalProperties:!1,properties:{requests:{type:"integer"},unpriced_requests:{type:"integer"},provider_incomplete_requests:{type:"integer"},measured_spend_microusd:{type:"integer"},attributed_spend_microusd:{type:"integer"},attribution_coverage_bps:{anyOf:[{type:"integer"},{type:"null"}]},developers:{type:"integer"},sessions:{type:"integer"},price_catalog_versions:{type:["array","null"],items:{type:"string"}},inferred_routing_savings_microusd:{type:"integer"},inferred_routing_unconfirmed_savings_microusd:{type:"integer"},compression_tokens_saved:{type:"integer"},verified_savings_microusd:{type:"integer"},work_types:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{key:{type:"string"},label:{type:"string"},spend_microusd:{type:"integer"},requests:{type:"integer"}},required:["key","label","spend_microusd","requests"]}}},required:["requests","unpriced_requests","provider_incomplete_requests","measured_spend_microusd","attributed_spend_microusd","developers","sessions","price_catalog_versions","inferred_routing_savings_microusd","inferred_routing_unconfirmed_savings_microusd","compression_tokens_saved","verified_savings_microusd","work_types"]},previous:{anyOf:[{type:"object",additionalProperties:!1,properties:{requests:{type:"integer"},unpriced_requests:{type:"integer"},provider_incomplete_requests:{type:"integer"},measured_spend_microusd:{type:"integer"},attributed_spend_microusd:{type:"integer"},attribution_coverage_bps:{anyOf:[{type:"integer"},{type:"null"}]},developers:{type:"integer"},sessions:{type:"integer"},price_catalog_versions:{type:["array","null"],items:{type:"string"}},inferred_routing_savings_microusd:{type:"integer"},inferred_routing_unconfirmed_savings_microusd:{type:"integer"},compression_tokens_saved:{type:"integer"},verified_savings_microusd:{type:"integer"},work_types:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{key:{type:"string"},label:{type:"string"},spend_microusd:{type:"integer"},requests:{type:"integer"}},required:["key","label","spend_microusd","requests"]}}},required:["requests","unpriced_requests","provider_incomplete_requests","measured_spend_microusd","attributed_spend_microusd","developers","sessions","price_catalog_versions","inferred_routing_savings_microusd","inferred_routing_unconfirmed_savings_microusd","compression_tokens_saved","verified_savings_microusd","work_types"]},{type:"null"}]},movers:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{key:{type:"string"},label:{type:"string"},spend_microusd:{type:"integer"},prev_spend_microusd:{type:"integer"},delta_microusd:{type:"integer"}},required:["key","label","spend_microusd","prev_spend_microusd","delta_microusd"]}},materiality_microusd:{type:"integer"},work_type_version:{type:"string"},basis:{type:["object","null"],additionalProperties:{type:"string"}},links:{type:["object","null"],additionalProperties:{type:"string"}}},required:["window","period","current","movers","materiality_microusd","work_type_version","basis","links"]},binding:{path_inputs:{},query_inputs:["from","to","window"],body_inputs:[]},contract_sha256:"fbc08bf3239074c1e739d1f6a047550625e8539dbf69d559c9d9710245394609"},{id:"human.external_spend",version:"1",summary:"human: external_spend",method:"GET",path:"/reports/external-spend",permissions:["billing:read"],scope:"project",access:"none",exclusion:"Provider-reported dollars behind billing:read. Keeping it human-only until an agent surface needs it; nothing here feeds savings claims.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"f5ad746b35138cc4f3489ebf6a010429fab739324828d5305ce68ce7a87c630d"},{id:"reports.fleet",version:"1",summary:"reports: fleet",method:"GET",path:"/reports/fleet",permissions:["org:read"],scope:"project",access:"read",aliases:["caveman_reports.fleet"],input_schema:{type:"object",additionalProperties:!1,properties:{from:{type:"string",format:"date-time"},project_id:{type:"string"},sample_data:{type:"boolean"},to:{type:"string",format:"date-time"},window:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{days:{type:["array","null"],items:{type:"string"}},workflow_days:{type:["array","null"],items:{type:"string"}},totals:{type:"object",additionalProperties:!1,properties:{org_requests:{type:"integer"},attributed_requests:{type:"integer"},unattributed_requests:{type:"integer"},coverage:{type:"number"},seat_holders:{type:"integer"},devices:{type:"integer"},project_members:{anyOf:[{type:"integer"},{type:"null"}]}},required:["org_requests","attributed_requests","unattributed_requests","coverage","seat_holders","devices"]},developers:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{member_user_id:{type:"string"},name:{type:"string"},email:{type:"string"},former_member:{type:"boolean"},project_member:{anyOf:[{type:"boolean"},{type:"null"}]},requests:{type:"integer"},spark:{type:["array","null"],items:{type:"number"}},top_harnesses:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{agent_slug:{type:"string"},requests:{type:"integer"}},required:["agent_slug","requests"]}},last_seen:{type:"string"},devices:{type:"integer"},last_login:{type:"string"}},required:["member_user_id","name","email","former_member","requests","spark","top_harnesses","last_seen","devices","last_login"]}},workflows:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{slug:{type:"string"},name:{type:"string"},trace_count:{type:"integer"},requests:{type:"integer"},spark:{type:["array","null"],items:{type:"number"}}},required:["slug","name","trace_count","requests","spark"]}},basis_notes:{type:"object",additionalProperties:!1,properties:{fleet:{type:"string"}},required:["fleet"]}},required:["days","workflow_days","totals","developers","workflows","basis_notes"]},binding:{path_inputs:{},query_inputs:["from","project_id","sample_data","to","window"],body_inputs:[]},contract_sha256:"87a69a3144ec405da1a4a76c4174c7bdd5e718abaedaae64b8033be737ebd4b6"},{id:"people.member_spend",version:"1",summary:"people: member_spend",method:"GET",path:"/reports/members",permissions:["billing:read"],scope:"project",access:"read",aliases:["caveman_people.member_spend"],input_schema:{type:"object",additionalProperties:!1,properties:{from:{type:"string",format:"date-time"},sample_data:{type:"boolean"},to:{type:"string",format:"date-time"},window:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{totals:{type:"object",additionalProperties:!1,properties:{spend_usd:{type:"number"},requests:{type:"integer"},attributed_spend_usd:{type:"number"},attribution_coverage:{type:"number"}},required:["spend_usd","requests","attributed_spend_usd","attribution_coverage"]},series:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{day:{type:"string"},member_user_id:{type:"string"},spend_usd:{type:"number"}},required:["day","member_user_id","spend_usd"]}},members:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{member_user_id:{type:"string"},name:{type:"string"},email:{type:"string"},former_member:{type:"boolean"},spend_usd:{type:"number"},prev_spend_usd:{anyOf:[{type:"number"},{type:"null"}]},requests:{type:"integer"},input_tokens:{type:"integer"},output_tokens:{type:"integer"},cached_input_tokens:{type:"integer"},spark:{type:["array","null"],items:{type:"number"}},top_models:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{model:{type:"string"},spend_usd:{type:"number"}},required:["model","spend_usd"]}},top_workflows:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{workflow_slug:{type:"string"},spend_usd:{type:"number"}},required:["workflow_slug","spend_usd"]}}},required:["member_user_id","name","email","former_member","spend_usd","requests","input_tokens","output_tokens","cached_input_tokens","spark","top_models","top_workflows"]}},keys:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{api_key_id:{type:"string"},key_name:{type:"string"},member_user_id:{anyOf:[{type:"string"},{type:"null"}]},spend_usd:{type:"number"},requests:{type:"integer"}},required:["api_key_id","key_name","member_user_id","spend_usd","requests"]}}},required:["totals","series","members","keys"]},binding:{path_inputs:{},query_inputs:["from","sample_data","to","window"],body_inputs:[]},contract_sha256:"97a0d077802c3ac8e832778515a066e3b3ef06a23621fdbf0f27b936b5ca1ef6"},{id:"reports.models",version:"1",summary:"reports: models",method:"GET",path:"/reports/models",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_reports.models"],input_schema:{type:"object",additionalProperties:!1,properties:{from:{type:"string",format:"date-time"},sample_data:{type:"boolean"},to:{type:"string",format:"date-time"},window:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{provider:{type:"string"},model:{type:"string"},spend:{type:"number"},requests:{type:"integer"},input_tokens:{type:"integer"},output_tokens:{type:"integer"},cached_input_tokens:{type:"integer"},total_rows:{type:"integer"},catalog_priced_complete_rows:{type:"integer"},unpriced_complete_rows:{type:"integer"},provider_incomplete_rows:{type:"integer"}},required:["provider","model","spend","requests","input_tokens","output_tokens","cached_input_tokens","total_rows","catalog_priced_complete_rows","unpriced_complete_rows","provider_incomplete_rows"]}},next_cursor:{type:"null"}},required:["data","next_cursor"]},binding:{path_inputs:{},query_inputs:["from","sample_data","to","window"],body_inputs:[]},contract_sha256:"89433be943b77dbfd864914d6ec8e5b2bbd446d685d81a90029734f72ad65e08"},{id:"reports.overview",version:"1",summary:"reports: overview",method:"GET",path:"/reports/overview",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_reports.overview"],input_schema:{type:"object",additionalProperties:!1,properties:{from:{type:"string",format:"date-time"},sample_data:{type:"boolean"},to:{type:"string",format:"date-time"},window:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{automatic_savings:{type:"object",additionalProperties:!1,properties:{cache_observed_usd:{type:"number"},cache_requests:{type:"integer"},cache_basis:{type:"string"},router_inferred_usd:{type:"number"},router_baseline_usd:{type:"number"},router_actual_usd:{type:"number"},router_requests:{type:"integer"},router_basis:{type:"string"},baseline_models:{type:["array","null"],items:{type:"string"}},unconfirmed_baseline_models:{type:["array","null"],items:{type:"string"}}},required:["cache_observed_usd","cache_requests","cache_basis","router_inferred_usd","router_baseline_usd","router_actual_usd","router_requests","router_basis","baseline_models","unconfirmed_baseline_models"]},measured_spend:{type:"number"},projected_month_end_spend:{type:"number"},verified_savings:{type:"number"},projected_available_savings:{type:"number"},projected_available_savings_unit:{type:"string"},projected_available_savings_basis:{type:"string"},requests:{type:"integer"},success_rate:{type:"number"},input_tokens:{type:"integer"},output_tokens:{type:"integer"},cached_input_tokens:{type:"integer"},cache_hit_ratio:{type:"number"},cave_score:{anyOf:[{type:"integer"},{type:"null"}]},top_opportunities:{type:["array","null"],items:{type:"string"}},token_accounting:{type:"object",additionalProperties:!1,properties:{contract:{type:"string"},legacy_rows:{type:"integer"},normalized_rows:{type:"integer"},provider_complete_rows:{type:"integer"},provider_partial_rows:{type:"integer"},provider_malformed_rows:{type:"integer"},unavailable_rows:{type:"integer"},compression_estimated_rows:{type:"integer"}},required:["contract","legacy_rows","normalized_rows","provider_complete_rows","provider_partial_rows","provider_malformed_rows","unavailable_rows","compression_estimated_rows"]},pricing_accounting:{type:"object",additionalProperties:!1,properties:{total_rows:{type:"integer"},catalog_priced_complete_rows:{type:"integer"},unpriced_complete_rows:{type:"integer"},provider_incomplete_rows:{type:"integer"},spend_basis:{type:"string"}},required:["total_rows","catalog_priced_complete_rows","unpriced_complete_rows","provider_incomplete_rows","spend_basis"]}},required:["automatic_savings","measured_spend","projected_month_end_spend","verified_savings","projected_available_savings","projected_available_savings_unit","projected_available_savings_basis","requests","success_rate","input_tokens","output_tokens","cached_input_tokens","cache_hit_ratio","cave_score","top_opportunities","token_accounting","pricing_accounting"]},binding:{path_inputs:{},query_inputs:["from","sample_data","to","window"],body_inputs:[]},contract_sha256:"278697007295c3e31b2aa4d2a74481abee0731ccf8a66b3d9c3ec967627c63a0"},{id:"reports.routes",version:"1",summary:"reports: routes",method:"GET",path:"/reports/routes",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_reports.routes"],input_schema:{type:"object",additionalProperties:!1,properties:{from:{type:"string",format:"date-time"},sample_data:{type:"boolean"},to:{type:"string",format:"date-time"},window:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{provider:{type:"string"},route_from:{type:"string"},route_to:{type:"string"},route_applied:{type:"boolean"},spend:{type:"number"},requests:{type:"integer"},catalog_priced_complete_rows:{type:"integer"},unpriced_complete_rows:{type:"integer"},provider_incomplete_rows:{type:"integer"},router_not_configured_rows:{type:"integer"},router_skipped_zdr_rows:{type:"integer"},classifier_not_configured_rows:{type:"integer"}},required:["provider","route_from","route_to","route_applied","spend","requests","catalog_priced_complete_rows","unpriced_complete_rows","provider_incomplete_rows","router_not_configured_rows","router_skipped_zdr_rows","classifier_not_configured_rows"]}},next_cursor:{type:"null"}},required:["data","next_cursor"]},binding:{path_inputs:{},query_inputs:["from","sample_data","to","window"],body_inputs:[]},contract_sha256:"0b5860fcc9887b1257ad9de9081054dbd8324b80378b5b4631a24f26943bb992"},{id:"people.sessions",version:"1",summary:"people: sessions",method:"GET",path:"/reports/sessions",permissions:["billing:read"],scope:"project",access:"read",aliases:["caveman_people.sessions"],input_schema:{type:"object",additionalProperties:!1,properties:{agent:{type:"string"},branch:{type:"string"},from:{type:"string",format:"date-time"},limit:{type:"integer",minimum:0},member_user_id:{type:"string"},offset:{type:"integer",minimum:0},project_id:{type:"string"},q:{type:"string"},repo:{type:"string"},sample_data:{type:"boolean"},snapshot:{type:"string"},sort:{type:"string"},to:{type:"string",format:"date-time"},window:{type:"string"},work_type:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{filter:{type:"object",additionalProperties:!1,properties:{member_user_id:{type:"string"},work_type:{type:"string"},agent:{type:"string"},repo:{type:"string"},branch:{type:"string"},q:{type:"string"}},required:[]},page:{type:"object",additionalProperties:!1,properties:{limit:{type:"integer"},offset:{type:"integer"},next_offset:{anyOf:[{type:"integer"},{type:"null"}]},from:{type:"string"},to:{type:"string"},snapshot:{type:"string"}},required:["limit","offset","next_offset","from","to","snapshot"]},scope:{type:"string"},sort:{type:"string"},totals:{type:"object",additionalProperties:!1,properties:{sessions:{type:"integer"},requests:{type:"integer"},priced_requests:{type:"integer"},unpriced_requests:{type:"integer"},provider_incomplete_requests:{type:"integer"},errors:{type:"integer"},input_tokens:{type:"integer"},cached_input_tokens:{type:"integer"},output_tokens:{type:"integer"},spend_usd:{type:"number"},p95_spend_usd:{type:"number"}},required:["sessions","requests","priced_requests","unpriced_requests","provider_incomplete_requests","errors","input_tokens","cached_input_tokens","output_tokens","spend_usd","p95_spend_usd"]},sessions:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{session_id:{type:"string"},project_id:{type:"string"},member_user_id:{type:"string"},name:{type:"string"},email:{type:"string"},agent_slug:{type:"string"},started_at:{type:"string"},ended_at:{type:"string"},requests:{type:"integer"},priced_requests:{type:"integer"},provider_incomplete_requests:{type:"integer"},peak_input_tokens:{type:"integer"},errors:{type:"integer"},spend_usd:{type:"number"},input_tokens:{type:"integer"},cached_input_tokens:{type:"integer"},output_tokens:{type:"integer"},cache_missed_input_tokens:{type:"integer"},tool_schema_tokens:{type:"integer"},cache_breaks:{type:"integer"},top_model:{type:"string"},work_type:{type:"string"},repo:{type:"string"},branch:{type:"string"}},required:["session_id","project_id","member_user_id","name","email","agent_slug","started_at","ended_at","requests","priced_requests","provider_incomplete_requests","peak_input_tokens","errors","spend_usd","input_tokens","cached_input_tokens","output_tokens","cache_missed_input_tokens","tool_schema_tokens","cache_breaks","top_model","work_type","repo","branch"]}},truncated:{type:"boolean"},work_type_version:{type:"string"},spend_basis:{type:"string"}},required:["filter","page","scope","sort","totals","sessions","truncated","work_type_version","spend_basis"]},binding:{path_inputs:{},query_inputs:["agent","branch","from","limit","member_user_id","offset","project_id","q","repo","sample_data","snapshot","sort","to","window","work_type"],body_inputs:[]},contract_sha256:"a3ae0766e75e384736da01a34022bcf8c8885560c95088908cbc348ce28b18ab"},{id:"people.session",version:"1",summary:"people: session",method:"GET",path:"/reports/sessions/{sessionId}",permissions:["billing:read"],scope:"project",access:"read",aliases:["caveman_people.session"],input_schema:{type:"object",additionalProperties:!1,properties:{agent:{type:"string"},branch:{type:"string"},from:{type:"string",format:"date-time"},limit:{type:"integer",minimum:0},member_user_id:{type:"string"},offset:{type:"integer",minimum:0},project_id:{type:"string"},q:{type:"string"},repo:{type:"string"},sample_data:{type:"boolean"},snapshot:{type:"string"},sort:{type:"string"},to:{type:"string",format:"date-time"},window:{type:"string"},work_type:{type:"string"},session_id:{type:"string",pattern:"^[A-Za-z0-9._:-]{1,128}$"}},required:["session_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{session:{type:"object",additionalProperties:!1,properties:{session_id:{type:"string"},project_id:{type:"string"},member_user_id:{type:"string"},name:{type:"string"},email:{type:"string"},agent_slug:{type:"string"},started_at:{type:"string"},ended_at:{type:"string"},requests:{type:"integer"},priced_requests:{type:"integer"},provider_incomplete_requests:{type:"integer"},peak_input_tokens:{type:"integer"},errors:{type:"integer"},spend_usd:{type:"number"},input_tokens:{type:"integer"},cached_input_tokens:{type:"integer"},output_tokens:{type:"integer"},cache_missed_input_tokens:{type:"integer"},tool_schema_tokens:{type:"integer"},cache_breaks:{type:"integer"},top_model:{type:"string"},work_type:{type:"string"},repo:{type:"string"},branch:{type:"string"}},required:["session_id","project_id","member_user_id","name","email","agent_slug","started_at","ended_at","requests","priced_requests","provider_incomplete_requests","peak_input_tokens","errors","spend_usd","input_tokens","cached_input_tokens","output_tokens","cache_missed_input_tokens","tool_schema_tokens","cache_breaks","top_model","work_type","repo","branch"]},page:{type:"object",additionalProperties:!1,properties:{limit:{type:"integer"},offset:{type:"integer"},next_offset:{anyOf:[{type:"integer"},{type:"null"}]},from:{type:"string"},to:{type:"string"},snapshot:{type:"string"}},required:["limit","offset","next_offset","from","to","snapshot"]},scope:{type:"string"},permissions:{type:"object",additionalProperties:!1,properties:{trace_metadata:{type:"boolean"},trace_content:{type:"boolean"}},required:["trace_metadata","trace_content"]},turns:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{index:{type:"integer"},request_id:{type:"string"},trace_id:{type:"string"},timestamp:{type:"string"},model:{type:"string"},provider:{type:"string"},status_code:{type:"integer"},latency_ms:{type:"integer"},priced:{type:"boolean"},provider_usage_complete:{type:"boolean"},spend_usd:{type:"number"},input_tokens:{type:"integer"},cached_input_tokens:{type:"integer"},cache_creation_input_tokens:{type:"integer"},output_tokens:{type:"integer"},cache_miss_reason:{type:"string"},cache_break:{type:"boolean"},cache_divergence_component:{type:"string"},cache_divergence_message_position:{type:"integer"},cache_divergence_message_role:{type:"string"},cache_prev_message_count:{type:"integer"},cache_message_count:{type:"integer"},cache_missed_input_tokens:{type:"integer"},tool_schema_tokens:{type:"integer"},result_tool_tokens:{type:"integer"},task_type:{type:"string"},work_type:{type:"string"},route_effort:{type:"string"},route_to:{type:"string"}},required:["index","request_id","trace_id","timestamp","model","provider","status_code","latency_ms","priced","provider_usage_complete","spend_usd","input_tokens","cached_input_tokens","cache_creation_input_tokens","output_tokens","cache_miss_reason","cache_break","cache_divergence_component","cache_divergence_message_position","cache_divergence_message_role","cache_prev_message_count","cache_message_count","cache_missed_input_tokens","tool_schema_tokens","result_tool_tokens","task_type","work_type","route_effort","route_to"]}},truncated:{type:"boolean"},work_type_version:{type:"string"},spend_basis:{type:"string"}},required:["session","page","scope","permissions","turns","truncated","work_type_version","spend_basis"]},binding:{path_inputs:{sessionId:"session_id"},query_inputs:["agent","branch","from","limit","member_user_id","offset","project_id","q","repo","sample_data","snapshot","sort","to","window","work_type"],body_inputs:[]},contract_sha256:"674de234f8148398c418598ede859cdc5f2858976ae0b95ed6462f03c01cd82e"},{id:"people.spend_breakdown",version:"1",summary:"people: spend_breakdown",method:"GET",path:"/reports/spend-breakdown",permissions:["billing:read"],scope:"project",access:"read",aliases:["caveman_people.spend_breakdown"],input_schema:{type:"object",additionalProperties:!1,properties:{dimension:{type:"string"},from:{type:"string",format:"date-time"},sample_data:{type:"boolean"},to:{type:"string",format:"date-time"},window:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{dimension:{type:"string"},days:{type:["array","null"],items:{type:"string"}},totals:{type:"object",additionalProperties:!1,properties:{spend_usd:{type:"number"},prev_spend_usd:{anyOf:[{type:"number"},{type:"null"}]},requests:{type:"integer"},attributed_spend_usd:{type:"number"},attribution_coverage:{type:"number"},groups:{type:"integer"},listed_spend_usd:{type:"number"}},required:["spend_usd","requests","attributed_spend_usd","attribution_coverage","groups","listed_spend_usd"]},rows:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{key:{type:"string"},label:{type:"string"},attributed:{type:"boolean"},spend_usd:{type:"number"},prev_spend_usd:{anyOf:[{type:"number"},{type:"null"}]},requests:{type:"integer"},traces:{type:"integer"},input_tokens:{type:"integer"},output_tokens:{type:"integer"},cached_input_tokens:{type:"integer"},spark:{type:["array","null"],items:{type:"number"}}},required:["key","label","attributed","spend_usd","requests","traces","input_tokens","output_tokens","cached_input_tokens","spark"]}},axis_coverage:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{dimension:{type:"string"},spend_usd:{type:"number"},coverage:{type:"number"}},required:["dimension","spend_usd","coverage"]}},truncated:{type:"boolean"},pricing_accounting:{type:"object",additionalProperties:!1,properties:{total_rows:{type:"integer"},catalog_priced_complete_rows:{type:"integer"},unpriced_complete_rows:{type:"integer"},provider_incomplete_rows:{type:"integer"},spend_basis:{type:"string"}},required:["total_rows","catalog_priced_complete_rows","unpriced_complete_rows","provider_incomplete_rows","spend_basis"]},spend_basis:{type:"string"}},required:["dimension","days","totals","rows","axis_coverage","truncated","pricing_accounting","spend_basis"]},binding:{path_inputs:{},query_inputs:["dimension","from","sample_data","to","window"],body_inputs:[]},contract_sha256:"0c7040cc0b0ec0f0ffe51a7239bab4927b0a715678f0a7bc0be73f4b0436c8cc"},{id:"reports.spend_flow",version:"1",summary:"reports: spend_flow",method:"GET",path:"/reports/spend-flow",permissions:["billing:read"],scope:"project",access:"read",aliases:["caveman_reports.spend_flow"],input_schema:{type:"object",additionalProperties:!1,properties:{from:{type:"string",format:"date-time"},sample_data:{type:"boolean"},to:{type:"string",format:"date-time"},window:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{stages:{type:["array","null"],items:{type:"string"}},nodes:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{stage:{type:"integer"},key:{type:"string"},label:{type:"string"},attributed:{type:"boolean"},spend_usd:{type:"number"},requests:{type:"integer"},bucket:{type:"string"}},required:["stage","key","label","attributed","spend_usd","requests"]}},links:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{from:{type:"string"},to:{type:"string"},spend_usd:{type:"number"},requests:{type:"integer"}},required:["from","to","spend_usd","requests"]}},totals:{type:"object",additionalProperties:!1,properties:{spend_usd:{type:"number"},classified_spend_usd:{type:"number"},classification_coverage:{type:"number"},requests:{type:"integer"}},required:["spend_usd","classified_spend_usd","classification_coverage","requests"]},truncated:{type:"boolean"},pricing_accounting:{type:"object",additionalProperties:!1,properties:{total_rows:{type:"integer"},catalog_priced_complete_rows:{type:"integer"},unpriced_complete_rows:{type:"integer"},provider_incomplete_rows:{type:"integer"},spend_basis:{type:"string"}},required:["total_rows","catalog_priced_complete_rows","unpriced_complete_rows","provider_incomplete_rows","spend_basis"]},spend_basis:{type:"string"}},required:["stages","nodes","links","totals","truncated","pricing_accounting","spend_basis"]},binding:{path_inputs:{},query_inputs:["from","sample_data","to","window"],body_inputs:[]},contract_sha256:"e959f939e79617c76fba22b096d86f7fed3616f6f7a5d441b554fc91d699af53"},{id:"people.statement",version:"1",summary:"people: statement",method:"GET",path:"/reports/statement",permissions:["billing:read"],scope:"project",access:"read",aliases:["caveman_people.statement"],input_schema:{type:"object",additionalProperties:!1,properties:{month:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{statement:{type:"object",additionalProperties:!1,properties:{schema:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},period:{type:"object",additionalProperties:!1,properties:{month:{type:"string"},from:{type:"string"},to:{type:"string"}},required:["month","from","to"]},generated_at:{type:"string"},work_type_version:{type:"string"},figures:{type:"object",additionalProperties:!1,properties:{requests:{type:"integer"},unpriced_requests:{type:"integer"},provider_incomplete_requests:{type:"integer"},measured_spend_microusd:{type:"integer"},attributed_spend_microusd:{type:"integer"},attribution_coverage_bps:{anyOf:[{type:"integer"},{type:"null"}]},developers:{type:"integer"},sessions:{type:"integer"},price_catalog_versions:{type:["array","null"],items:{type:"string"}},inferred_routing_savings_microusd:{type:"integer"},inferred_routing_unconfirmed_savings_microusd:{type:"integer"},compression_tokens_saved:{type:"integer"},verified_savings_microusd:{type:"integer"},work_types:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{key:{type:"string"},label:{type:"string"},spend_microusd:{type:"integer"},requests:{type:"integer"}},required:["key","label","spend_microusd","requests"]}}},required:["requests","unpriced_requests","provider_incomplete_requests","measured_spend_microusd","attributed_spend_microusd","developers","sessions","price_catalog_versions","inferred_routing_savings_microusd","inferred_routing_unconfirmed_savings_microusd","compression_tokens_saved","verified_savings_microusd","work_types"]},basis:{type:["object","null"],additionalProperties:{type:"string"}},sources:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{report:{type:"string"},path:{type:"string"}},required:["report","path"]}}},required:["schema","organization_id","period","generated_at","work_type_version","figures","basis","sources"]},payload:{type:"string"},payload_digest:{type:"string"},signed:{type:"boolean"},unsigned_reason:{type:"string"},envelope:{anyOf:[{type:"object",additionalProperties:!1,properties:{domain:{type:"string"},payloadDigest:{type:"string"},keyId:{type:"string"},algorithm:{type:"string"},signatureBase64:{type:"string"}},required:["domain","payloadDigest","keyId","algorithm","signatureBase64"]},{type:"null"}]}},required:["statement","payload","payload_digest","signed"]},binding:{path_inputs:{},query_inputs:["month"],body_inputs:[]},contract_sha256:"98254647a5e2374d67b580a8f86e429bef07cb0f9cb8783376c234f2acd7422c"},{id:"reports.traffic_shape",version:"1",summary:"reports: traffic_shape",method:"GET",path:"/reports/traffic-shape",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_reports.traffic_shape"],input_schema:{type:"object",additionalProperties:!1,properties:{from:{type:"string",format:"date-time"},sample_data:{type:"boolean"},to:{type:"string",format:"date-time"},window:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:"object",additionalProperties:!1,properties:{clustering_enabled:{type:"boolean"},window_start:{type:"string"},window_end:{type:"string"},vector_space:{type:"object",additionalProperties:!1,properties:{embedding_provider:{type:"string"},embedding_dimensions:{type:"integer"},semantic:{type:"boolean"}},required:["embedding_provider","embedding_dimensions","semantic"]},coverage:{type:"object",additionalProperties:!1,properties:{embedded_requests:{type:"integer"},billable_requests:{type:"integer"}},required:["embedded_requests","billable_requests"]},clusters:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{cluster_id:{type:"string"},label:{type:"string"},size:{type:"integer"},total_cost_usd:{type:"string"},model_split:{type:["object","null"],additionalProperties:{type:"integer"}},exemplars:{type:["array","null"],items:{type:"string"}}},required:["cluster_id","label","size","total_cost_usd","model_split"]}},history:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{window_end:{type:"string"},clusters:{type:"integer"},requests:{type:"integer"},total_cost_usd:{type:"string"},top_label:{type:"string"}},required:["window_end","clusters","requests","total_cost_usd","top_label"]}}},required:["clustering_enabled","window_start","window_end","vector_space","coverage","clusters","history"]},next_cursor:{type:"null"}},required:["data","next_cursor"]},binding:{path_inputs:{},query_inputs:["from","sample_data","to","window"],body_inputs:[]},contract_sha256:"a7ae4f9530252efc44fd3c36623a764a196badb0305d1039b08827dd56cadc17"},{id:"reports.usage",version:"1",summary:"reports: usage",method:"GET",path:"/reports/usage",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_reports.usage"],input_schema:{type:"object",additionalProperties:!1,properties:{from:{type:"string",format:"date-time"},sample_data:{type:"boolean"},to:{type:"string",format:"date-time"},window:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{totals:{type:"object",additionalProperties:!1,properties:{input_tokens:{type:"integer"},output_tokens:{type:"integer"},cached_input_tokens:{type:"integer"},cache_creation_input_tokens:{type:"integer"},reasoning_tokens:{type:"integer"},requests:{type:"integer"},spend:{type:"number"},error_rate:{type:"number"},latency_p50_ms:{type:"number"},latency_p95_ms:{type:"number"},ttfb_p95_ms:{type:"number"}},required:["input_tokens","output_tokens","cached_input_tokens","cache_creation_input_tokens","reasoning_tokens","requests","spend","error_rate","latency_p50_ms","latency_p95_ms","ttfb_p95_ms"]},series:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{day:{type:"string"},input_tokens:{type:"integer"},output_tokens:{type:"integer"},cached_input_tokens:{type:"integer"},cache_creation_input_tokens:{type:"integer"},requests:{type:"integer"},spend:{type:"number"}},required:["day","input_tokens","output_tokens","cached_input_tokens","cache_creation_input_tokens","requests","spend"]}},series_by_model:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{day:{type:"string"},model:{type:"string"},tokens:{type:"integer"}},required:["day","model","tokens"]}},by_model:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{provider:{type:"string"},model:{type:"string"},spend:{type:"number"},requests:{type:"integer"},input_tokens:{type:"integer"},output_tokens:{type:"integer"},cached_input_tokens:{type:"integer"},total_rows:{type:"integer"},catalog_priced_complete_rows:{type:"integer"},unpriced_complete_rows:{type:"integer"},provider_incomplete_rows:{type:"integer"}},required:["provider","model","spend","requests","input_tokens","output_tokens","cached_input_tokens","total_rows","catalog_priced_complete_rows","unpriced_complete_rows","provider_incomplete_rows"]}},by_agent:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{slug:{type:"string"},input_tokens:{type:"integer"},output_tokens:{type:"integer"},cached_input_tokens:{type:"integer"},requests:{type:"integer"},spend:{type:"number"}},required:["slug","input_tokens","output_tokens","cached_input_tokens","requests","spend"]}},token_accounting:{type:"object",additionalProperties:!1,properties:{contract:{type:"string"},legacy_rows:{type:"integer"},normalized_rows:{type:"integer"},provider_complete_rows:{type:"integer"},provider_partial_rows:{type:"integer"},provider_malformed_rows:{type:"integer"},unavailable_rows:{type:"integer"},compression_estimated_rows:{type:"integer"}},required:["contract","legacy_rows","normalized_rows","provider_complete_rows","provider_partial_rows","provider_malformed_rows","unavailable_rows","compression_estimated_rows"]},pricing_accounting:{type:"object",additionalProperties:!1,properties:{total_rows:{type:"integer"},catalog_priced_complete_rows:{type:"integer"},unpriced_complete_rows:{type:"integer"},provider_incomplete_rows:{type:"integer"},spend_basis:{type:"string"}},required:["total_rows","catalog_priced_complete_rows","unpriced_complete_rows","provider_incomplete_rows","spend_basis"]},imported_standalone:{type:"object",additionalProperties:!1,properties:{input_tokens:{type:"integer"},output_tokens:{type:"integer"},cached_input_tokens:{type:"integer"},cache_creation_input_tokens:{type:"integer"},requests:{type:"integer"},spend:{type:"number"},provider_complete_rows:{type:"integer"},reported_rows:{type:"integer"},estimated_rows:{type:"integer"},unavailable_rows:{type:"integer"}},required:["input_tokens","output_tokens","cached_input_tokens","cache_creation_input_tokens","requests","spend","provider_complete_rows","reported_rows","estimated_rows","unavailable_rows"]}},required:["totals","series","series_by_model","by_model","by_agent","token_accounting","pricing_accounting","imported_standalone"]},binding:{path_inputs:{},query_inputs:["from","sample_data","to","window"],body_inputs:[]},contract_sha256:"80dd771507838feb0317b02972accc0de4ff4892aafbc6f5c2bc3eadbbf4d2cc"},{id:"reports.verified_savings",version:"1",summary:"reports: verified_savings",method:"GET",path:"/reports/verified-savings",permissions:["billing:read"],scope:"project",access:"read",aliases:["caveman_reports.verified_savings"],input_schema:{type:"object",additionalProperties:!1,properties:{from:{type:"string",format:"date-time"},sample_data:{type:"boolean"},to:{type:"string",format:"date-time"},window:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{currency:{type:"string"},total_verified_savings_usd:{type:"number"},requests_optimized:{type:"integer"},entries:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{date:{type:"string"},verified_savings_usd:{type:"number"},requests_optimized:{type:"integer"},receipt:{anyOf:[{type:"object",additionalProperties:!1,properties:{seq:{type:"integer"},receipt_hash:{type:"string"},key_id:{type:"string"}},required:["seq","receipt_hash","key_id"]},{type:"null"}]}},required:["date","verified_savings_usd","requests_optimized"]}},optimizers:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{optimizer_id:{type:"string"},requests_optimized:{type:"integer"}},required:["optimizer_id","requests_optimized"]}},counted_baseline:{anyOf:[{type:"object",additionalProperties:!1,properties:{counted_requests:{type:"integer"},transform_requests:{type:"integer"}},required:["counted_requests","transform_requests"]},{type:"null"}]}},required:["currency","total_verified_savings_usd","requests_optimized","entries","optimizers"]},binding:{path_inputs:{},query_inputs:["from","sample_data","to","window"],body_inputs:[]},contract_sha256:"1bfc7e619225afd4182c5dea1bc1e88460fa0d9b890039102e3a272e204e8416"},{id:"reports.why",version:"1",summary:"reports: why",method:"GET",path:"/reports/why",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_reports.why"],input_schema:{type:"object",additionalProperties:!1,properties:{from:{type:"string",format:"date-time"},sample_data:{type:"boolean"},to:{type:"string",format:"date-time"},window:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{ready:{type:"boolean"},retained_days:{type:"integer"},required_retained_days:{type:"integer"},provider_complete_requests:{type:"integer"},measured_spend_usd_per_day:{type:"number"},measured_spend_basis:{type:"string"},scope_line:{type:"string"},families:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{name:{type:"string"},basis:{type:"string"},headroom_usd_per_day:{type:"number"},causes:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{optimizer_id:{type:"string"},title:{type:"string"},basis:{type:"string"},headroom_usd_per_day:{type:"number"},safety_class:{type:"string"},requires_eval_gate:{type:"boolean"},next_action:{type:"string"},top_scopes:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{agent_id:{type:"string"},workflow_id:{type:"string"},agent_name:{type:"string"},workflow_name:{type:"string"},provider:{type:"string"},model:{type:"string"},savings_usd_base:{type:"number"},share_pct:{type:"number"}},required:["savings_usd_base","share_pct"]}}},required:["optimizer_id","title","basis","headroom_usd_per_day","safety_class","requires_eval_gate","next_action","top_scopes"]}}},required:["name","basis","headroom_usd_per_day","causes"]}},coverage:{type:"object",additionalProperties:!1,properties:{basis:{type:"string"},unlabeled_share:{type:"number"},unlabeled_spend_usd_per_day:{type:"number"},measured_spend_usd_per_day:{type:"number"},message:{type:"string"}},required:["basis","unlabeled_share","unlabeled_spend_usd_per_day","measured_spend_usd_per_day","message"]},not_yet_detectable:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{optimizer_id:{type:"string"},title:{type:"string"},reason:{type:"string"}},required:["optimizer_id","title","reason"]}},methodology:{type:"string"}},required:["ready","retained_days","required_retained_days","provider_complete_requests","measured_spend_usd_per_day","measured_spend_basis","scope_line","families","coverage","not_yet_detectable","methodology"]},binding:{path_inputs:{},query_inputs:["from","sample_data","to","window"],body_inputs:[]},contract_sha256:"c14ce7ac0769bb1782b32f98c58935313c7d6b775e113c1930cef213ce557d9e"},{id:"reports.workflows",version:"1",summary:"reports: workflows",method:"GET",path:"/reports/workflows",permissions:["org:read"],scope:"project",access:"read",aliases:["caveman_reports.workflows"],input_schema:{type:"object",additionalProperties:!1,properties:{from:{type:"string",format:"date-time"},sample_data:{type:"boolean"},to:{type:"string",format:"date-time"},window:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{slug:{type:"string"},requests:{type:"integer"},trace_count:{type:"integer"},spend:{type:"number"},spark:{type:["array","null"],items:{type:"number"}},catalog_priced_complete_rows:{type:"integer"},unpriced_complete_rows:{type:"integer"},provider_incomplete_rows:{type:"integer"}},required:["slug","requests","trace_count","spend","spark","catalog_priced_complete_rows","unpriced_complete_rows","provider_incomplete_rows"]}},next_cursor:{type:"null"}},required:["data","next_cursor"]},binding:{path_inputs:{},query_inputs:["from","sample_data","to","window"],body_inputs:[]},contract_sha256:"098890b63e56bb48a7fb63d06212ee021ef0b278918b02f6fa7d4c813aa4b54c"},{id:"reports.workflow_detail",version:"1",summary:"reports: workflow_detail",method:"GET",path:"/reports/workflows/{workflowSlug}",permissions:["org:read"],scope:"project",access:"read",aliases:["caveman_reports.workflow_detail"],input_schema:{type:"object",additionalProperties:!1,properties:{from:{type:"string",format:"date-time"},sample_data:{type:"boolean"},to:{type:"string",format:"date-time"},window:{type:"string"},workflow_slug:{type:"string",minLength:1,maxLength:200}},required:["workflow_slug"]},output_schema:{type:"object",additionalProperties:!1,properties:{workflow_slug:{type:"string"},totals:{type:"object",additionalProperties:!1,properties:{spend_usd:{type:"number"},requests:{type:"integer"},traces:{type:"integer"},priced_traces:{type:"integer"},avg_cost_per_trace_usd:{type:"number"},p95_cost_per_trace_usd:{type:"number"},first_seen:{type:"string"},last_seen:{type:"string"}},required:["spend_usd","requests","traces","priced_traces","avg_cost_per_trace_usd","p95_cost_per_trace_usd","first_seen","last_seen"]},series:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{day:{type:"string"},spend_usd:{type:"number"},requests:{type:"integer"}},required:["day","spend_usd","requests"]}},by_model:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{provider:{type:"string"},model:{type:"string"},spend_usd:{type:"number"},requests:{type:"integer"}},required:["provider","model","spend_usd","requests"]}},by_agent:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{agent_slug:{type:"string"},spend_usd:{type:"number"},requests:{type:"integer"}},required:["agent_slug","spend_usd","requests"]}},by_member:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{member_user_id:{type:"string"},name:{type:"string"},email:{type:"string"},former_member:{type:"boolean"},spend_usd:{type:"number"},requests:{type:"integer"}},required:["member_user_id","name","email","former_member","spend_usd","requests"]}},recent_traces:{type:["array","null"],items:{type:["object","null"],additionalProperties:{}}}},required:["workflow_slug","totals","series","by_model","by_agent","by_member","recent_traces"]},binding:{path_inputs:{workflowSlug:"workflow_slug"},query_inputs:["from","sample_data","to","window"],body_inputs:[]},contract_sha256:"4a0b90fdbaa73822d09f4e07ace384bdb77f0efe274edeb22d19a0d4dac241dc"},{id:"reports.wrap_savings",version:"1",summary:"reports: wrap_savings",method:"GET",path:"/reports/wrap-savings",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_reports.wrap_savings"],input_schema:{type:"object",additionalProperties:!1,properties:{from:{type:"string",format:"date-time"},sample_data:{type:"boolean"},to:{type:"string",format:"date-time"},window:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{totals:{type:"object",additionalProperties:!1,properties:{requests:{type:"integer"},tokens_before:{type:"integer"},tokens_after:{type:"integer"},tokens_saved:{type:"integer"},cached_input_tokens:{type:"integer"},cache_creation_input_tokens:{type:"integer"},headline_compression_refused:{type:"boolean"}},required:["requests","tokens_before","tokens_after","tokens_saved","cached_input_tokens","cache_creation_input_tokens","headline_compression_refused"]},by_auth_mode:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{auth_mode:{type:"string"},requests:{type:"integer"},tokens_before:{type:"integer"},tokens_after:{type:"integer"},tokens_saved:{type:"integer"},cached_input_tokens:{type:"integer"},cache_creation_input_tokens:{type:"integer"},headline_compression_refused:{type:"boolean"}},required:["auth_mode","requests","tokens_before","tokens_after","tokens_saved","cached_input_tokens","cache_creation_input_tokens","headline_compression_refused"]}},series:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{day:{type:"string"},project_id:{type:"string"},auth_mode:{type:"string"},requests:{type:"integer"},tokens_before:{type:"integer"},tokens_after:{type:"integer"},tokens_saved:{type:"integer"},cached_input_tokens:{type:"integer"},cache_creation_input_tokens:{type:"integer"},headline_compression_refused:{type:"boolean"}},required:["day","project_id","auth_mode","requests","tokens_before","tokens_after","tokens_saved","cached_input_tokens","cache_creation_input_tokens","headline_compression_refused"]}},basis:{type:"string"},wrap_token_savings_basis:{type:"string"},traffic_by_auth_mode:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{auth_mode:{type:"string"},provider:{type:"string"},requests:{type:"integer"},input_tokens:{type:"integer"},output_tokens:{type:"integer"},request_share_bps:{type:"integer"}},required:["auth_mode","provider","requests","input_tokens","output_tokens","request_share_bps"]}}},required:["totals","by_auth_mode","series","basis","wrap_token_savings_basis","traffic_by_auth_mode"]},binding:{path_inputs:{},query_inputs:["from","sample_data","to","window"],body_inputs:[]},contract_sha256:"0b8642e907ff17fb97023b0ede8bd397027621fb6d0ad9d2d42017a737b20b6e"},{id:"project_setup.preview_routing",version:"1",summary:"project_setup: preview_routing",method:"POST",path:"/routes/preview",permissions:["policy:draft"],scope:"project",access:"write",aliases:["caveman_project_setup.preview_routing"],input_schema:{type:"object",additionalProperties:!1,properties:{endpoint:{type:"string"},model_routing:{type:"object",additionalProperties:!1,properties:{allow_cross_provider:{type:"boolean"},alpha:{type:"number"},baseline_models:{type:"object",additionalProperties:{type:"string"}},candidate_allowlist:{type:"object",additionalProperties:{type:"array",items:{type:"string"}}},data_residency:{type:"array",items:{type:"string"}},disable_cross_provider:{type:"boolean"},max_cost_ratio:{type:"number"},max_error_delta:{type:"number"},max_p95_latency_delta_ms:{type:"integer"},max_quality_delta:{type:"number"},quality_floor:{type:"number"},route_capacity:{type:"object",additionalProperties:{type:"object",additionalProperties:!1,properties:{concurrent_requests:{type:"integer"},input_tokens_per_minute:{type:"integer"},output_tokens_per_minute:{type:"integer"},requests_per_minute:{type:"integer"}}}},route_denylist:{type:"array",items:{type:"string"}},router_version:{type:"string"}}},provider:{type:"string"},task_profile:{type:"object",additionalProperties:!1,properties:{alpha:{type:"number"},candidate_allowlist:{type:"array",items:{type:"string"}},candidate_denylist:{type:"array",items:{type:"string"}},cross_provider:{type:"boolean"},data_residency:{type:"array",items:{type:"string"}},max_cost_ratio:{type:"number"},max_error_delta:{type:"number"},max_p95_latency_delta_ms:{type:"integer"},quality_floor:{type:"number"}}},workflow_slug:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{scope:{type:"object",additionalProperties:!1,properties:{provider:{type:"string"},endpoint:{type:"string"},workflow_slug:{type:"string"},router_version:{type:"string"},evidence:{type:"string"},remaining_runtime_checks:{type:["array","null"],items:{type:"string"}}},required:["workflow_slug","router_version","evidence","remaining_runtime_checks"]},passing:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{provider:{type:"string"},model:{type:"string"},quality_lcb:{type:"number"},sample_count:{type:"integer"},price_in:{type:"number"},price_out:{type:"number"},expected_cost_usd:{type:"number"},expected_p95_latency_ms:{type:"integer"},error_rate:{type:"number"},cross_provider:{type:"boolean"},runtime_status:{type:"string"}},required:["provider","model","quality_lcb","sample_count","price_in","price_out","cross_provider","runtime_status"]}},rejected:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{candidate:{type:"string"},reason:{type:"string"}},required:["candidate","reason"]}},changes:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{candidate:{type:"string"},change:{type:"string"},reason:{type:"string"}},required:["candidate","change"]}}},required:["scope","passing","rejected","changes"]},binding:{path_inputs:{},query_inputs:[],body_inputs:["endpoint","model_routing","provider","task_profile","workflow_slug"],body_project:!0},contract_sha256:"445cf84674a905d172a987a151ea7dfb115fecd9c7fbf13147966413e27babfe"},{id:"findings.list",version:"1",summary:"fixes: list_findings",method:"GET",path:"/surveyor-findings",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_fixes.list_findings"],input_schema:{type:"object",additionalProperties:!1,properties:{limit:{type:"integer",minimum:0}}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},hypothesis_key:{type:"string"},detector_family:{type:"string"},params:{},caption:{type:"string"},hypothesis_label:{type:"string"},submitted_by:{type:"string"},author_label:{type:"string"},status:{type:"string"},checked_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},outcome_opportunity_id:{anyOf:[{type:"string"},{type:"null"}]},outcome_detector_id:{anyOf:[{type:"string"},{type:"null"}]},outcome_band_low_usd:{anyOf:[{type:"number"},{type:"null"}]},outcome_band_base_usd:{anyOf:[{type:"number"},{type:"null"}]},outcome_band_high_usd:{anyOf:[{type:"number"},{type:"null"}]},outcome_band_method:{anyOf:[{type:"string"},{type:"null"}]},outcome_reason:{anyOf:[{type:"string"},{type:"null"}]},created_at:{type:"string",format:"date-time"}},required:["id","project_id","hypothesis_key","detector_family","params","caption","hypothesis_label","submitted_by","author_label","status","checked_at","outcome_opportunity_id","outcome_detector_id","outcome_band_low_usd","outcome_band_base_usd","outcome_band_high_usd","outcome_band_method","outcome_reason","created_at"]}},limit:{type:"integer",minimum:1},author_rates:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{submitted_by:{type:"string"},author_label:{type:"string"},pre_registered:{type:"integer"},confirmed:{type:"integer"},confirmed_rate:{type:"number"}},required:["submitted_by","author_label","pre_registered","confirmed","confirmed_rate"]}}},required:["data","limit","author_rates"]},binding:{path_inputs:{},query_inputs:["limit"],body_inputs:[]},contract_sha256:"b1f637ed6f9865cc7a653627ec8740eadad9ae2fa83bc670d92119d9cb4090b8"},{id:"findings.create",version:"1",summary:"fixes: submit_finding",method:"POST",path:"/surveyor-findings",permissions:["opportunity:write"],scope:"project",access:"write",aliases:["caveman_fixes_write.submit_finding"],input_schema:{type:"object",additionalProperties:!1,properties:{caption:{type:"string"},detector_family:{type:"string"},params:{type:"object",additionalProperties:{}}},required:["detector_family","caption","params"]},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},hypothesis_key:{type:"string"},detector_family:{type:"string"},params:{},caption:{type:"string"},hypothesis_label:{type:"string"},submitted_by:{type:"string"},author_label:{type:"string"},status:{type:"string"},checked_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},outcome_opportunity_id:{anyOf:[{type:"string"},{type:"null"}]},outcome_detector_id:{anyOf:[{type:"string"},{type:"null"}]},outcome_band_low_usd:{anyOf:[{type:"number"},{type:"null"}]},outcome_band_base_usd:{anyOf:[{type:"number"},{type:"null"}]},outcome_band_high_usd:{anyOf:[{type:"number"},{type:"null"}]},outcome_band_method:{anyOf:[{type:"string"},{type:"null"}]},outcome_reason:{anyOf:[{type:"string"},{type:"null"}]},created_at:{type:"string",format:"date-time"}},required:["id","project_id","hypothesis_key","detector_family","params","caption","hypothesis_label","submitted_by","author_label","status","checked_at","outcome_opportunity_id","outcome_detector_id","outcome_band_low_usd","outcome_band_base_usd","outcome_band_high_usd","outcome_band_method","outcome_reason","created_at"]},pre_registered:{type:"boolean"}},required:["data","pre_registered"]},binding:{path_inputs:{},query_inputs:[],body_inputs:["caption","detector_family","params"],body_project:!0},contract_sha256:"f63a0eb0a8e4209e4ef2befe208f133499d5c6e07698a919fe53a7ef0a4a06d0"},{id:"context.provider_capabilities",version:"1",summary:"context: provider_capabilities",method:"GET",path:"/system/provider-capabilities",permissions:["settings:read"],scope:"organization",access:"read",aliases:["caveman_context.provider_capabilities"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{version:{type:"string"},axes:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{key:{type:"string"},label:{type:"string"},question:{type:"string"},registry:{type:"string"}},required:["key","label","question","registry"]}},providers:{type:["object","null"],additionalProperties:{type:["object","null"],additionalProperties:{type:"object",additionalProperties:!1,properties:{status:{type:"string"},reason:{type:"string"}},required:["status"]}}},stored_credentials_enabled:{type:"boolean"},ask_enabled:{type:"boolean"},automation_enabled:{type:"boolean"},improvement_enabled:{type:"boolean"},ask_model_provider:{type:"string"},improvement_model_providers:{type:["array","null"],items:{type:"string"}},client_ip_resolved:{type:"boolean"},bedrock_aws_identity:{type:"string"},bedrock_executor_role_arn:{type:"string"}},required:["version","axes","providers","stored_credentials_enabled","ask_enabled","automation_enabled","improvement_enabled","ask_model_provider","improvement_model_providers","client_ip_resolved","bedrock_aws_identity","bedrock_executor_role_arn"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"bfe969c2404ce7ac87891f9e65bf45d6df339e824a9b1785792f75198835ce09"},{id:"context.system_status",version:"1",summary:"context: system_status",method:"GET",path:"/system/status",permissions:["settings:read"],scope:"organization",access:"read",aliases:["caveman_context.system_status"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{postgres:{type:"string"},clickhouse:{type:"string"},valkey:{type:"string"},dead_letter_jobs:{type:"integer"},telemetry_retry_status_platform:{type:"string"},telemetry_retry_backlog_platform:{type:["integer","null"]},telemetry_retry_oldest_age_seconds_platform:{type:["number","null"]}},required:["postgres","clickhouse","valkey","dead_letter_jobs","telemetry_retry_status_platform","telemetry_retry_backlog_platform","telemetry_retry_oldest_age_seconds_platform"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"3611ff02f9de6100fadf30d5bdedea3c4bb8eb270e93d66a61fd5cb92abc7dc3"},{id:"human.system_version",version:"1",summary:"human: system_version",method:"GET",path:"/system/version",permissions:[],scope:"organization",access:"none",exclusion:"Not RBAC-guarded \u2014 part of the authentication or webhook plane. Agents authenticate through a scoped control-plane session and never touch these directly.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"c374ba51968a689cdf75cc59bb0c15dd0e0c1838023600d6ee0199dde6d6a4c7"},{id:"traces.list",version:"1",summary:"traces: list",method:"GET",path:"/traces",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_traces.list"],input_schema:{type:"object",additionalProperties:!1,properties:{from:{type:"string",format:"date-time"},limit:{type:"integer",minimum:0},member_user_id:{type:"string"},sample_data:{type:"boolean"},to:{type:"string",format:"date-time"},window:{type:"string"},workflow:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{trace_id:{type:"string"},request_id:{type:"string"},timestamp:{type:"string"},provider:{type:"string"},model:{type:"string"},agent_slug:{type:"string"},workflow_slug:{type:"string"},status_code:{type:["integer","string"]},total_cost_usd:{type:["number","string"]},input_tokens:{type:"integer"},output_tokens:{type:"integer"},cached_input_tokens:{type:"integer"},cache_creation_input_tokens:{type:"integer"},reasoning_tokens:{type:"integer"},read_only_tool_result_tokens:{type:"integer"},compression_tokens_before:{type:"integer"},compression_tokens_after:{type:"integer"},token_usage_contract_version:{type:["integer","string"]},token_usage_basis:{type:"string"},compression_token_count_basis:{type:"string"},price_catalog_version:{type:"string"},auth_mode:{type:"string"},runtime_mode:{type:"string"},source_kinds:{type:["array","null"],items:{type:"string"}},source_systems:{type:["array","null"],items:{type:"string"}},ingestion_ids:{type:["array","null"],items:{type:"string"}},span_count:{type:["integer","string"]},has_gateway_requests:{type:["boolean","integer"]},cache_status:{type:"string"},optimization_ids:{type:["array","null"],items:{type:"string"}},route_from:{type:"string"},route_to:{type:"string"},session_id:{type:"string"},recovery_handle:{type:"string"}},required:["trace_id"],description:"Typed trace metadata. Capture-authorized legacy detail also preserves additional retained gateway columns; current server payload policy controls disclosure."}},next_cursor:{type:"null"}},required:["data","next_cursor"]},binding:{path_inputs:{},query_inputs:["from","limit","member_user_id","sample_data","to","window","workflow"],body_inputs:[]},contract_sha256:"9c4c7a8c8eedb0684379cc460131c57904962423e51dd7befc0e70bd15557748"},{id:"traces.get",version:"1",summary:"traces: get",method:"GET",path:"/traces/{traceId}",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_traces.get"],input_schema:{type:"object",additionalProperties:!1,properties:{from:{type:"string",format:"date-time"},sample_data:{type:"boolean"},to:{type:"string",format:"date-time"},window:{type:"string"},trace_id:{type:"string",minLength:1,maxLength:128}},required:["trace_id"]},output_schema:{type:"object",additionalProperties:!0,properties:{trace_id:{type:"string"},request_id:{type:"string"},timestamp:{type:"string"},provider:{type:"string"},model:{type:"string"},agent_slug:{type:"string"},workflow_slug:{type:"string"},status_code:{type:["integer","string"]},total_cost_usd:{type:["number","string"]},input_tokens:{type:"integer"},output_tokens:{type:"integer"},cached_input_tokens:{type:"integer"},cache_creation_input_tokens:{type:"integer"},reasoning_tokens:{type:"integer"},read_only_tool_result_tokens:{type:"integer"},compression_tokens_before:{type:"integer"},compression_tokens_after:{type:"integer"},token_usage_contract_version:{type:["integer","string"]},token_usage_basis:{type:"string"},compression_token_count_basis:{type:"string"},price_catalog_version:{type:"string"},auth_mode:{type:"string"},runtime_mode:{type:"string"},source_kinds:{type:["array","null"],items:{type:"string"}},source_systems:{type:["array","null"],items:{type:"string"}},ingestion_ids:{type:["array","null"],items:{type:"string"}},span_count:{type:["integer","string"]},has_gateway_requests:{type:["boolean","integer"]},cache_status:{type:"string"},optimization_ids:{type:["array","null"],items:{type:"string"}},route_from:{type:"string"},route_to:{type:"string"},session_id:{type:"string"},recovery_handle:{type:"string"}},required:["trace_id"],description:"Typed trace metadata. Capture-authorized legacy detail also preserves additional retained gateway columns; current server payload policy controls disclosure."},binding:{path_inputs:{traceId:"trace_id"},query_inputs:["from","sample_data","to","window"],body_inputs:[]},contract_sha256:"ffab924cccd4888360cd2883fcfc5cc3efae0abf469f558f5b055a54a72443c0"},{id:"traces.spans",version:"1",summary:"traces: spans",method:"GET",path:"/traces/{traceId}/spans",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_traces.spans"],input_schema:{type:"object",additionalProperties:!1,properties:{from:{type:"string",format:"date-time"},sample_data:{type:"boolean"},to:{type:"string",format:"date-time"},window:{type:"string"},trace_id:{type:"string",minLength:1,maxLength:128}},required:["trace_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{spans:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{span_id:{type:"string"},parent_span_id:{type:"string"},span_type:{type:"string"},span_name:{type:"string"},status:{type:"string"},duration_ms:{type:"number"},provider:{type:"string"},model:{type:"string"},input_tokens:{type:"integer"},output_tokens:{type:"integer"},cached_input_tokens:{type:"integer"},total_cost_usd:{type:"number"},source:{type:"string"},source_kind:{type:"string"},source_system:{type:"string"},ingestion_id:{type:"string"},normalization_version:{type:"integer"},content_mode:{type:"string"},token_usage_basis:{type:"string"},price_catalog_version:{type:"string"},request_id:{type:"string"},attributes:{type:["object","null"],additionalProperties:{type:"string"}},events_json:{type:"string"},efficiency:{anyOf:[{type:"object",additionalProperties:!1,properties:{cache_status:{type:"string"},optimization_ids:{type:["array","null"],items:{type:"string"}},compression_tokens_before:{type:"integer"},compression_tokens_after:{type:"integer"},request_rewritten:{type:"boolean"},route_from:{type:"string"},route_to:{type:"string"},session_id:{type:"string"}},required:[]},{type:"null"}]}},required:["span_id","span_type","span_name","status","duration_ms"]}},timeline:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{span_id:{type:"string"},request_id:{type:"string"},name:{type:"string"},type:{type:"string"},start_ms:{type:"number"},duration_ms:{type:"number"}},required:["span_id","name","type","start_ms","duration_ms"]}}},required:["spans","timeline"]},binding:{path_inputs:{traceId:"trace_id"},query_inputs:["from","sample_data","to","window"],body_inputs:[]},contract_sha256:"d1392cef8dd2df5269a959ffdca6856a6076712f8fb8837e62acde5f4eea24a6"},{id:"traces.timeline",version:"1",summary:"traces: timeline",method:"GET",path:"/traces/{traceId}/timeline",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_traces.timeline"],input_schema:{type:"object",additionalProperties:!1,properties:{from:{type:"string",format:"date-time"},sample_data:{type:"boolean"},to:{type:"string",format:"date-time"},window:{type:"string"},trace_id:{type:"string",minLength:1,maxLength:128}},required:["trace_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{spans:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{span_id:{type:"string"},parent_span_id:{type:"string"},span_type:{type:"string"},span_name:{type:"string"},status:{type:"string"},duration_ms:{type:"number"},provider:{type:"string"},model:{type:"string"},input_tokens:{type:"integer"},output_tokens:{type:"integer"},cached_input_tokens:{type:"integer"},total_cost_usd:{type:"number"},source:{type:"string"},source_kind:{type:"string"},source_system:{type:"string"},ingestion_id:{type:"string"},normalization_version:{type:"integer"},content_mode:{type:"string"},token_usage_basis:{type:"string"},price_catalog_version:{type:"string"},request_id:{type:"string"},attributes:{type:["object","null"],additionalProperties:{type:"string"}},events_json:{type:"string"},efficiency:{anyOf:[{type:"object",additionalProperties:!1,properties:{cache_status:{type:"string"},optimization_ids:{type:["array","null"],items:{type:"string"}},compression_tokens_before:{type:"integer"},compression_tokens_after:{type:"integer"},request_rewritten:{type:"boolean"},route_from:{type:"string"},route_to:{type:"string"},session_id:{type:"string"}},required:[]},{type:"null"}]}},required:["span_id","span_type","span_name","status","duration_ms"]}},timeline:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{span_id:{type:"string"},request_id:{type:"string"},name:{type:"string"},type:{type:"string"},start_ms:{type:"number"},duration_ms:{type:"number"}},required:["span_id","name","type","start_ms","duration_ms"]}}},required:["spans","timeline"]},binding:{path_inputs:{traceId:"trace_id"},query_inputs:["from","sample_data","to","window"],body_inputs:[]},contract_sha256:"a24a6f96040239b1a113bac5869fd0f720d5b047e0fa1f29a612ea5bfb5b8196"},{id:"traces.scores",version:"1",summary:"traces: scores",method:"POST",path:"/traces/scores",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_traces.scores"],input_schema:{type:"object",additionalProperties:!1,properties:{from:{type:"string"},to:{type:"string"},trace_ids:{type:"array",items:{type:"string"}},project_id:{type:"string"},window:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{items:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{trace_id:{type:"string"},evaluations:{type:"integer"},passed:{type:"integer"},failed:{type:"integer"},avg_score:{anyOf:[{type:"number"},{type:"null"}]},mixed_scales:{type:"boolean"},evaluators:{type:["array","null"],items:{type:"string"}}},required:["trace_id","evaluations","passed","failed","avg_score","mixed_scales","evaluators"]}},trend:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{day:{type:"string"},avg_score:{anyOf:[{type:"number"},{type:"null"}]},evaluations:{type:"integer"}},required:["day","avg_score","evaluations"]}}},required:["items","trend"]},binding:{path_inputs:{},query_inputs:["from","project_id","to","window"],body_inputs:["from","to","trace_ids"]},contract_sha256:"8c6a687b514e2deacd70e9dcfc9bbc324aa0737269b20593a8f70da5a1d573d4"},{id:"traces.search",version:"1",summary:"traces search",method:"POST",path:"/traces/search",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_traces.search"],input_schema:{type:"object",additionalProperties:!1,required:["from","to"],properties:{from:{type:"string",format:"date-time",description:"Explicit UTC start of a window spanning at most 90 days."},to:{type:"string",format:"date-time",description:"Explicit UTC end, after from and at most 90 days later."},filters:{type:"object"},group_by:{type:"string"},page_size:{type:"integer",minimum:1,maximum:100},sort:{type:"object"},cursor:{type:"object"}}},output_schema:{type:"object",additionalProperties:!1,properties:{query_digest:{type:"string",pattern:"^[a-f0-9]{64}$"},project_id:{type:"string",format:"uuid"},window:{type:"object",additionalProperties:!1,properties:{from:{type:"string",format:"date-time"},to:{type:"string",format:"date-time"}},required:["from","to"]},data:{type:"object",additionalProperties:!1,properties:{items:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{trace_id:{type:"string"},root_request_id:{type:"string"},started_at:{type:"string"},ended_at:{type:"string"},provider:{type:"string"},model:{type:"string"},agent_slug:{type:"string"},workflow_slug:{type:"string"},session_id:{type:"string"},auth_mode:{type:"string"},request_count:{type:"integer"},error_count:{type:"integer"},max_status_code:{type:"integer"},latency_ms:{type:"integer"},total_cost_usd:{type:"number"},priced_gateway_requests:{type:"integer"},unknown_gateway_requests:{type:"integer"},input_tokens:{type:"integer"},output_tokens:{type:"integer"},cached_input_tokens:{type:"integer"},optimization_ids:{type:["array","null"],items:{type:"string"}},compressed_requests:{type:"integer"},span_count:{type:"integer"},reported_cost_spans:{type:"integer"},has_gateway_requests:{type:"boolean"},source_kinds:{type:["array","null"],items:{type:"string"}},source_systems:{type:["array","null"],items:{type:"string"}},ingestion_ids:{type:["array","null"],items:{type:"string"}},sort_value:{type:"string"},response_cache_hits:{type:"integer"}},required:["trace_id","root_request_id","started_at","ended_at","provider","model","agent_slug","workflow_slug","auth_mode","request_count","error_count","max_status_code","latency_ms","total_cost_usd","priced_gateway_requests","unknown_gateway_requests","input_tokens","output_tokens","cached_input_tokens","optimization_ids","compressed_requests","span_count","reported_cost_spans","has_gateway_requests","source_kinds","source_systems","ingestion_ids","sort_value","response_cache_hits"]}},groups:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{group_key:{type:"string"},traces:{type:"integer"},gateway_traces:{type:"integer"},requests:{type:"integer"},error_count:{type:"integer"},total_cost_usd:{type:"number"},priced_gateway_requests:{type:"integer"},unknown_gateway_requests:{type:"integer"},reported_observed_traces:{type:"integer"},input_tokens:{type:"integer"},output_tokens:{type:"integer"},last_seen:{type:"string"},sort_value:{type:"string"}},required:["group_key","traces","gateway_traces","requests","error_count","total_cost_usd","priced_gateway_requests","unknown_gateway_requests","reported_observed_traces","input_tokens","output_tokens","last_seen","sort_value"]}},group_by:{type:"string"},next_cursor:{anyOf:[{type:"object",additionalProperties:!1,properties:{sort_value:{type:"string"},request_id:{type:"string"},group_key:{type:"string"}},required:["sort_value"]},{type:"null"}]},total_hits:{type:"integer"}},required:["items","groups","next_cursor","total_hits"]},cost_basis:{const:"telemetry_list_price"},native_path:{const:"/traces"},coverage:{const:"bounded_query_page"},observed_at:{type:"string",format:"date-time"},snapshot_consistency:{const:"independent_page_and_count_queries"}},required:["query_digest","project_id","window","data","cost_basis","native_path","coverage","observed_at","snapshot_consistency"]},binding:{body_inputs:["from","to","filters","group_by","page_size","sort","cursor"],handler:"cloudTracesSearch"},contract_sha256:"4df67fe438b35bf70d7054411a18ca449fb39c218ad11b96d9b661075186daa2"},{id:"traces.views",version:"1",summary:"traces: views",method:"GET",path:"/traces/views",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_traces.views"],input_schema:{type:"object",additionalProperties:!1,properties:{project_id:{type:"string"}}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},name:{type:"string"},view:{},created_by:{anyOf:[{type:"string"},{type:"null"}]},share_token:{anyOf:[{type:"string"},{type:"null"}]},share_expires_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},alert_window_minutes:{anyOf:[{type:"integer"},{type:"null"}]},alert_threshold:{anyOf:[{type:"integer"},{type:"null"}]},alert_webhook_id:{anyOf:[{type:"string"},{type:"null"}]},alert_last_fired_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"}},required:["id","organization_id","project_id","name","view","created_at","updated_at"]}},next_cursor:{type:"null"}},required:["data","next_cursor"]},binding:{path_inputs:{},query_inputs:["project_id"],body_inputs:[]},contract_sha256:"b27df65d7be4671d803c24c6b3a37376d2a1e284b8f9ce1f7676c0460c32c3d4"},{id:"traces.shared_view",version:"1",summary:"traces: shared_view",method:"GET",path:"/traces/views/shared/{shareToken}",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_traces.shared_view"],input_schema:{type:"object",additionalProperties:!1,properties:{share_token:{type:"string",minLength:1,maxLength:200}},required:["share_token"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},name:{type:"string"},view:{},created_by:{anyOf:[{type:"string"},{type:"null"}]},share_token:{anyOf:[{type:"string"},{type:"null"}]},share_expires_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},alert_window_minutes:{anyOf:[{type:"integer"},{type:"null"}]},alert_threshold:{anyOf:[{type:"integer"},{type:"null"}]},alert_webhook_id:{anyOf:[{type:"string"},{type:"null"}]},alert_last_fired_at:{anyOf:[{type:"string",format:"date-time"},{type:"null"}]},created_at:{type:"string",format:"date-time"},updated_at:{type:"string",format:"date-time"}},required:["id","organization_id","project_id","name","view","created_at","updated_at"]},binding:{path_inputs:{shareToken:"share_token"},query_inputs:[],body_inputs:[]},contract_sha256:"98ccd60257075b5e996ed6f74a7fbcb04eeeb4a00f7b5b41ab557a4fc5013f60"},{id:"human.webhooks",version:"1",summary:"human: webhooks",method:"GET",path:"/webhooks",permissions:["settings:read"],scope:"project",access:"none",exclusion:"Webhook targets are an egress channel; an agent that could add one could exfiltrate tenant events.",aliases:[],input_schema:{type:"object",additionalProperties:!1,properties:{query:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{type:"string"}}]}}}},output_schema:{type:"object",additionalProperties:!0},binding:{legacy:!0},contract_sha256:"b71df661fb07fcdf4c7f2fa02c326c76d34f1b3f8f149a8a33f33151d2ebed68"},{id:"workflows.list_fingerprints",version:"1",summary:"workflows: list_fingerprints",method:"GET",path:"/workflow-fingerprints",permissions:["trace:read_metadata"],scope:"project",access:"read",aliases:["caveman_workflows.list_fingerprints"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{workflow_fingerprints:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},project_id:{type:"string"},fingerprint:{type:"string"},fingerprint_family:{type:"string"},display_slug:{type:"string"},client_slug:{type:"string"},status:{type:"string"},first_seen:{type:"string",format:"date-time"},last_seen:{type:"string",format:"date-time"},req_7d:{type:"integer"},spend_7d_usd:{type:"number"},autopilot_class:{type:"string"},holdout_frac:{type:"number"},holdout_ceiling:{type:"number"},s2_unlocked:{type:"boolean"}},required:["id","project_id","fingerprint","fingerprint_family","display_slug","client_slug","status","first_seen","last_seen","req_7d","spend_7d_usd","autopilot_class","holdout_frac","holdout_ceiling","s2_unlocked"]}}},required:["workflow_fingerprints"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"bcce89b67d42100bfa3011fcf46d0f8184e99d3c8d0656de834d9942047412bc"}],exclusions:[{method:"GET",path:"/admin/clickhouse-usage",reason:"Not RBAC-guarded \u2014 part of the authentication or webhook plane. Agents authenticate through a scoped control-plane session and never touch these directly."},{method:"PUT",path:"/admin/hosted-ai/users/{userId}/limit",reason:"Private platform operator token changes Caveman-funded allowances across organisations; tenant agents cannot grant platform credit."},{method:"POST",path:"/admin/model-catalog/decisions",reason:"Not RBAC-guarded \u2014 part of the authentication or webhook plane. Agents authenticate through a scoped control-plane session and never touch these directly."},{method:"GET",path:"/admin/model-catalog/reviews",reason:"Not RBAC-guarded \u2014 part of the authentication or webhook plane. Agents authenticate through a scoped control-plane session and never touch these directly."},{method:"POST",path:"/admin/model-catalog/reviews/{reviewId}/approve",reason:"Not RBAC-guarded \u2014 part of the authentication or webhook plane. Agents authenticate through a scoped control-plane session and never touch these directly."},{method:"POST",path:"/admin/model-catalog/reviews/{reviewId}/reject",reason:"Not RBAC-guarded \u2014 part of the authentication or webhook plane. Agents authenticate through a scoped control-plane session and never touch these directly."},{method:"POST",path:"/admin/orgs",reason:"Not RBAC-guarded \u2014 part of the authentication or webhook plane. Agents authenticate through a scoped control-plane session and never touch these directly."},{method:"PATCH",path:"/admin/orgs/{orgId}/plan",reason:"Not RBAC-guarded \u2014 part of the authentication or webhook plane. Agents authenticate through a scoped control-plane session and never touch these directly."},{method:"DELETE",path:"/artifacts/{artifactId}",reason:"Deletes, exports or changes the retention of tenant data. Irreversible or data-egress; requires a human actor in the audit trail."},{method:"GET",path:"/audit-logs/export",reason:"Deletes, exports or changes the retention of tenant data. Irreversible or data-egress; requires a human actor in the audit trail."},{method:"POST",path:"/auth/bootstrap-owner",reason:"Not RBAC-guarded \u2014 part of the authentication or webhook plane. Agents authenticate through a scoped control-plane session and never touch these directly."},{method:"GET",path:"/auth/config",reason:"Browser authentication mode discovery; no agent capability."},{method:"POST",path:"/auth/device/ack",reason:"Client credential-delivery acknowledgement, not an MCP tool. Scoped clients may ACK their approved grant with its device code and delivery secret; this cannot mint or widen access."},{method:"POST",path:"/auth/device/approve",reason:"Mints or approves a credential. An agent must never be able to widen its own access \u2014 this is the escalation boundary that makes scoped agent connections meaningful."},{method:"POST",path:"/auth/device/code",reason:"Not RBAC-guarded \u2014 part of the authentication or webhook plane. Agents authenticate through a scoped control-plane session and never touch these directly."},{method:"POST",path:"/auth/device/token",reason:"Not RBAC-guarded \u2014 part of the authentication or webhook plane. Agents authenticate through a scoped control-plane session and never touch these directly."},{method:"POST",path:"/auth/login",reason:"Not RBAC-guarded \u2014 part of the authentication or webhook plane. Agents authenticate through a scoped control-plane session and never touch these directly."},{method:"POST",path:"/auth/logout",reason:"Not RBAC-guarded \u2014 part of the authentication or webhook plane. Agents authenticate through a scoped control-plane session and never touch these directly."},{method:"GET",path:"/auth/oidc/{provider}/callback",reason:"Not RBAC-guarded \u2014 part of the authentication or webhook plane. Agents authenticate through a scoped control-plane session and never touch these directly."},{method:"GET",path:"/auth/oidc/{provider}/start",reason:"Not RBAC-guarded \u2014 part of the authentication or webhook plane. Agents authenticate through a scoped control-plane session and never touch these directly."},{method:"POST",path:"/auth/password/change",reason:"Mints or approves a credential. An agent must never be able to widen its own access \u2014 this is the escalation boundary that makes scoped agent connections meaningful."},{method:"POST",path:"/auth/password/reset/confirm",reason:"Not RBAC-guarded \u2014 part of the authentication or webhook plane. Agents authenticate through a scoped control-plane session and never touch these directly."},{method:"POST",path:"/auth/password/reset/request",reason:"Not RBAC-guarded \u2014 part of the authentication or webhook plane. Agents authenticate through a scoped control-plane session and never touch these directly."},{method:"POST",path:"/auth/refresh",reason:"Not RBAC-guarded \u2014 part of the authentication or webhook plane. Agents authenticate through a scoped control-plane session and never touch these directly."},{method:"POST",path:"/auth/saml/{provider}/acs",reason:"Not RBAC-guarded \u2014 part of the authentication or webhook plane. Agents authenticate through a scoped control-plane session and never touch these directly."},{method:"GET",path:"/auth/saml/{provider}/metadata",reason:"Not RBAC-guarded \u2014 part of the authentication or webhook plane. Agents authenticate through a scoped control-plane session and never touch these directly."},{method:"POST",path:"/auth/sso/discover",reason:"Public sign-in discovery before authentication: it names the identity provider for an email address. Part of the authentication plane; agents authenticate through a scoped control-plane session and never touch it."},{method:"POST",path:"/auth/switch-organization",reason:"Moves the caller across the organization boundary. A project-scoped agent session must never leave its tenant."},{method:"POST",path:"/billing/checkout",reason:"Changes billing, spend ceilings, or the money contract. Human-only regardless of agent competence."},{method:"PUT",path:"/billing/limits/{product}",reason:"Changes billing, spend ceilings, or the money contract. Human-only regardless of agent competence."},{method:"DELETE",path:"/billing/packages/{package}",reason:"Changes billing, spend ceilings, or the money contract. Human-only regardless of agent competence."},{method:"POST",path:"/billing/packages/{package}",reason:"Changes billing, spend ceilings, or the money contract. Human-only regardless of agent competence."},{method:"POST",path:"/billing/portal",reason:"Changes billing, spend ceilings, or the money contract. Human-only regardless of agent competence."},{method:"POST",path:"/ci/runs",reason:"Not RBAC-guarded: authenticated by the CI provider's OIDC token for one job. Agents never hold that token."},{method:"POST",path:"/ci/runs/{runId}/finish",reason:"Not RBAC-guarded: authenticated by the CI provider's OIDC token for one job. Agents never hold that token."},{method:"GET",path:"/cloud/operations",reason:"Operation transport infrastructure; not a recursive command."},{method:"POST",path:"/cloud/operations/{operationId}",reason:"Operation transport infrastructure; not a recursive command."},{method:"POST",path:"/data-requests",reason:"Records consent or a data-subject decision on behalf of the organization. Legal effect, so a human must be the actor."},{method:"GET",path:"/data-requests/{requestId}/download",reason:"Records consent or a data-subject decision on behalf of the organization. Legal effect, so a human must be the actor."},{method:"POST",path:"/experiments/{experimentId}/approve",reason:"Publishes or rolls back live traffic policy at S2/S3. Agents draft and experiment; a human promotes."},{method:"POST",path:"/experiments/{experimentId}/rollback",reason:"Publishes or rolls back live traffic policy at S2/S3. Agents draft and experiment; a human promotes."},{method:"GET",path:"/github/admin-proof/callback",reason:"Not RBAC-guarded \u2014 it is the browser redirect that carries a GitHub user authorization back to this installation. The proof it records is about a human's repository administration, so only that human's browser can complete it."},{method:"GET",path:"/github/callback",reason:"Not RBAC-guarded \u2014 part of the authentication or webhook plane. Agents authenticate through a scoped control-plane session and never touch these directly."},{method:"POST",path:"/github/webhook",reason:"Not RBAC-guarded \u2014 part of the authentication or webhook plane. Agents authenticate through a scoped control-plane session and never touch these directly."},{method:"POST",path:"/join/link/accept",reason:"Moves the caller across the organization boundary. A project-scoped agent session must never leave its tenant."},{method:"POST",path:"/join/link/inspect",reason:"Public invite-link inspection before sign-in; not RBAC-guarded and part of the authentication plane. Agents authenticate through a scoped control-plane session and never touch it."},{method:"POST",path:"/join/start",reason:"Public request for a join confirmation email before sign-in; not RBAC-guarded and part of the authentication plane. Agents authenticate through a scoped control-plane session and never touch it."},{method:"GET",path:"/me/joinable-organizations",reason:"Moves the caller across the organization boundary. A project-scoped agent session must never leave its tenant."},{method:"POST",path:"/me/joinable-organizations/{organizationId}/join",reason:"Moves the caller across the organization boundary. A project-scoped agent session must never leave its tenant."},{method:"POST",path:"/me/personal-key",reason:"Mints or approves a credential. An agent must never be able to widen its own access \u2014 this is the escalation boundary that makes scoped agent connections meaningful."},{method:"POST",path:"/me/wrap-entitlement",reason:"Mints or approves a credential. An agent must never be able to widen its own access \u2014 this is the escalation boundary that makes scoped agent connections meaningful."},{method:"GET",path:"/oauth/authorize",reason:"OAuth credential and consent ceremony. Only verified human approval and registered client proof may create or revoke this resource connection."},{method:"POST",path:"/oauth/authorize",reason:"OAuth credential and consent ceremony. Only verified human approval and registered client proof may create or revoke this resource connection."},{method:"POST",path:"/oauth/revoke",reason:"OAuth credential and consent ceremony. Only verified human approval and registered client proof may create or revoke this resource connection."},{method:"POST",path:"/oauth/token",reason:"OAuth credential and consent ceremony. Only verified human approval and registered client proof may create or revoke this resource connection."},{method:"GET",path:"/optimization-proposals/{proposalId}/packet",reason:"The proposal-keyed spelling of the local fix lane, driven by `caveman agent pull` and gated on proposal:draft, which an MCP agent connection is never granted (only the onboarding wizard's connection holds it). An agent pulls the same packet by brief (briefs.fix_packet); the GitHub App token this route mints to resolve the base commit never leaves the server."},{method:"POST",path:"/optimization-proposals/{proposalId}/reject",reason:"Records a human rejection reason and feeds it into optimization learning. Agent access would let the optimizer impersonate its reviewer and poison its own feedback signal."},{method:"PUT",path:"/org/compute-budget",reason:"Changes billing, spend ceilings, or the money contract. Human-only regardless of agent competence."},{method:"POST",path:"/org/compute-budget/check",reason:"Writes into the compute metering ledger that billing reads. Only the worker and the human-facing plane may write it."},{method:"POST",path:"/org/consents",reason:"Records consent or a data-subject decision on behalf of the organization. Legal effect, so a human must be the actor."},{method:"DELETE",path:"/org/data",reason:"Deletes, exports or changes the retention of tenant data. Irreversible or data-egress; requires a human actor in the audit trail."},{method:"GET",path:"/org/domains",reason:"Changes who may join the organization and how (invite link, approved domains, join role, who can invite, required SSO). An agent proposes; a human decides, because a wrong setting opens the organization to people it did not choose."},{method:"POST",path:"/org/domains",reason:"Changes who may join the organization and how (invite link, approved domains, join role, who can invite, required SSO). An agent proposes; a human decides, because a wrong setting opens the organization to people it did not choose."},{method:"DELETE",path:"/org/domains/{domainId}",reason:"Changes who may join the organization and how (invite link, approved domains, join role, who can invite, required SSO). An agent proposes; a human decides, because a wrong setting opens the organization to people it did not choose."},{method:"PATCH",path:"/org/domains/{domainId}",reason:"Changes who may join the organization and how (invite link, approved domains, join role, who can invite, required SSO). An agent proposes; a human decides, because a wrong setting opens the organization to people it did not choose."},{method:"POST",path:"/org/domains/{domainId}/verify",reason:"Changes who may join the organization and how (invite link, approved domains, join role, who can invite, required SSO). An agent proposes; a human decides, because a wrong setting opens the organization to people it did not choose."},{method:"GET",path:"/org/github/app",reason:"The organization's own GitHub App identity: app id, slug, owner and key revision. An agent has no reason to inspect the customer's registration, and the endpoint carries no credential it could use."},{method:"POST",path:"/org/github/app-manifest",reason:"Creates the manifest an organization owner posts to their own GitHub account. Registering the customer's App is an account permission ceremony a person performs in a browser; an agent can neither approve it nor hold its key."},{method:"POST",path:"/org/github/app-manifest/complete",reason:"Exchanges the one-use registration code for the customer's App and stores its private key and secrets under this installation's secret provider. Nothing about this step is delegable: an agent must never be able to introduce a source identity."},{method:"POST",path:"/org/invite-link/reset",reason:"Changes who may join the organization and how (invite link, approved domains, join role, who can invite, required SSO). An agent proposes; a human decides, because a wrong setting opens the organization to people it did not choose."},{method:"GET",path:"/org/join-settings",reason:"Changes who may join the organization and how (invite link, approved domains, join role, who can invite, required SSO). An agent proposes; a human decides, because a wrong setting opens the organization to people it did not choose."},{method:"PATCH",path:"/org/join-settings",reason:"Changes who may join the organization and how (invite link, approved domains, join role, who can invite, required SSO). An agent proposes; a human decides, because a wrong setting opens the organization to people it did not choose."},{method:"DELETE",path:"/org/members/{membershipId}",reason:"Creates or changes an organization identity. An agent proposes members; a human invites them, because a wrongly-added member is an access-control breach, not a config mistake."},{method:"PATCH",path:"/org/members/{membershipId}",reason:"Creates or changes an organization identity. An agent proposes members; a human invites them, because a wrongly-added member is an access-control breach, not a config mistake."},{method:"POST",path:"/org/members/{membershipId}/resend-invite",reason:"Creates or changes an organization identity. An agent proposes members; a human invites them, because a wrongly-added member is an access-control breach, not a config mistake."},{method:"POST",path:"/org/members/invite",reason:"Creates or changes an organization identity. An agent proposes members; a human invites them, because a wrongly-added member is an access-control breach, not a config mistake."},{method:"POST",path:"/org/oidc",reason:"Creates or changes an organization identity. An agent proposes members; a human invites them, because a wrongly-added member is an access-control breach, not a config mistake."},{method:"DELETE",path:"/org/oidc/{providerId}",reason:"Creates or changes an organization identity. An agent proposes members; a human invites them, because a wrongly-added member is an access-control breach, not a config mistake."},{method:"PATCH",path:"/org/oidc/{providerId}",reason:"Creates or changes an organization identity. An agent proposes members; a human invites them, because a wrongly-added member is an access-control breach, not a config mistake."},{method:"POST",path:"/org/redaction-rules",reason:"Changes what is masked out of captured payloads before storage. A wrong rule silently stops redacting; a human owns that decision."},{method:"DELETE",path:"/org/redaction-rules/{ruleId}",reason:"Removes a rule that masks data out of captured payloads. A wrong deletion silently stops redacting; a human owns that decision."},{method:"PATCH",path:"/org/redaction-rules/{ruleId}",reason:"Changes what is masked out of captured payloads before storage. A wrong rule silently stops redacting; a human owns that decision."},{method:"GET",path:"/org/roles",reason:"Organization role metadata is administrative reference information for human operators, not an agent action."},{method:"GET",path:"/org/router-learning-consents",reason:"Exposes organization decisions governing whether tenant traffic may train shared routing models. Legal and data-use consent state stays human-only."},{method:"GET",path:"/org/scim/groups",reason:"SCIM-provisioned group membership is an administrative identity view; agents must not inspect or change organization provisioning state."},{method:"GET",path:"/org/scim/tokens",reason:"Creates or changes an organization identity. An agent proposes members; a human invites them, because a wrongly-added member is an access-control breach, not a config mistake."},{method:"POST",path:"/org/scim/tokens",reason:"Mints a bearer that can provision and deprovision organization members. Creates or changes an organization identity. An agent proposes members; a human invites them, because a wrongly-added member is an access-control breach, not a config mistake."},{method:"DELETE",path:"/org/scim/tokens/{tokenId}",reason:"Creates or changes an organization identity. An agent proposes members; a human invites them, because a wrongly-added member is an access-control breach, not a config mistake."},{method:"GET",path:"/org/sso/group-mappings",reason:"IdP group mappings change organization access policy; agents must not create or modify identity controls."},{method:"POST",path:"/org/sso/group-mappings",reason:"IdP group mappings change organization access policy; agents must not create or modify identity controls."},{method:"DELETE",path:"/org/sso/group-mappings/{mappingId}",reason:"IdP group mappings change organization access policy; agents must not create or modify identity controls."},{method:"PATCH",path:"/org/sso/group-mappings/{mappingId}",reason:"IdP group mappings change organization access policy; agents must not create or modify identity controls."},{method:"DELETE",path:"/projects/{projectId}",reason:"Deleting a project is irreversible and cascades keys, policies, and telemetry. It stays a human owner's decision, like every other destructive lifecycle action."},{method:"PATCH",path:"/projects/{projectId}/access",reason:"Changes which providers and models any key in the project may reach, and the ceilings every key shares. An admission control is a security boundary, not a tuning knob."},{method:"PUT",path:"/projects/{projectId}/agent-automations/{automationId}",reason:"Native user control of standing automation: which sources may open repair cases, under which repository scope and publication rule, owned by the caller. Workload credentials and scoped agent connections cannot configure, resume or pause automations."},{method:"POST",path:"/projects/{projectId}/agent-automations/{automationId}/pause",reason:"Native user control of standing automation: which sources may open repair cases, under which repository scope and publication rule, owned by the caller. Workload credentials and scoped agent connections cannot configure, resume or pause automations."},{method:"PUT",path:"/projects/{projectId}/agent-budget",reason:"Native user control of shared agent authority and execution. Workload credentials and scoped agent connections cannot expand grants, budgets or recursively admit runs."},{method:"POST",path:"/projects/{projectId}/agent-cases/{caseId}/refresh-source",reason:"Native user authority over factory evidence eligibility. Re-reading the bound repository head can invalidate an accepted comparison and block publication, so an agent session must never decide that its own evidence is still current."},{method:"DELETE",path:"/projects/{projectId}/agent-connections/{connectionId}",reason:"Revocation is the human owner's kill switch over an agent's session. An agent must not be able to revoke its own or a peer's access."},{method:"POST",path:"/projects/{projectId}/agent-deployments",reason:"Native user registration of immutable deployment source identity; requires autopilot:manage and repo:connect. Model and workload callers cannot mint deployment attribution."},{method:"GET",path:"/projects/{projectId}/agent-runs",reason:"Native user history of immutable owned chat runs. Shared agents use the protected journal."},{method:"GET",path:"/projects/{projectId}/agent-runs/{runId}/case",reason:"Discloses protected native case context under current ownership and transactional payload audit."},{method:"GET",path:"/projects/{projectId}/agent-runs/{runId}/evidence",reason:"Discloses protected native evidence under current ownership and transactional payload audit."},{method:"GET",path:"/projects/{projectId}/agent-runs/{runId}/input",reason:"Discloses retained native input under current ownership and transactional payload audit."},{method:"GET",path:"/projects/{projectId}/agent-runs/{runId}/ledger",reason:"Console view of a role session's ledger under current result authority and transactional audit; agents read a run through agent_run_events."},{method:"GET",path:"/projects/{projectId}/agent-sentinel",reason:"Native user inbox of automatic work. Requires payload disclosure permission; never widens personal chat history."},{method:"GET",path:"/projects/{projectId}/agent-setup",reason:"Native user configuration of shared execution authority; grants and provider bindings remain private."},{method:"GET",path:"/projects/{projectId}/agent-setups/{caseId}",reason:"Native user authority over factory case admission, bounded policy, binding approval and cancellation. An agent session must never read a case, resolve a setup blocker, approve an execution binding, admit paid improvement work or cancel a fence."},{method:"GET",path:"/projects/{projectId}/agents/{agentId}/cases",reason:"Native user authority over factory case admission, bounded policy, binding approval and cancellation. An agent session must never read a case, resolve a setup blocker, approve an execution binding, admit paid improvement work or cancel a fence."},{method:"GET",path:"/projects/{projectId}/agents/{agentId}/execution-binding",reason:"Native user authority over factory case admission, bounded policy, binding approval and cancellation. An agent session must never read a case, resolve a setup blocker, approve an execution binding, admit paid improvement work or cancel a fence."},{method:"POST",path:"/projects/{projectId}/cloud/operations/{operationId}",reason:"Operation transport infrastructure; not a recursive command."},{method:"POST",path:"/projects/{projectId}/compute-usage",reason:"Writes into the compute metering ledger that billing reads. Only the worker and the human-facing plane may write it."},{method:"POST",path:"/projects/{projectId}/connectors",reason:"Accepts a provider ADMIN KEY in the request body. Agents never handle a credential -- the standing rule the connect skill restates -- so this door is human-only."},{method:"DELETE",path:"/projects/{projectId}/connectors/{connectorId}",reason:"Revoking a stored admin credential is the human owner's decision, like every other credential lifecycle action."},{method:"PATCH",path:"/projects/{projectId}/eval-annotations/{annotationId}",reason:"Changes human review labels, assignments or resolution state. Agents can read review state but cannot impersonate a human reviewer."},{method:"POST",path:"/projects/{projectId}/eval-qualification-sets",reason:"Independent holdout labels must not be authored by the agent whose evaluator they qualify."},{method:"GET",path:"/projects/{projectId}/eval-scenarios/{datasetId}/versions/{version}/export.zip",reason:"Bulk scenario download is a native authenticated data export; JSON discovery and authored scenarios use scoped reads."},{method:"POST",path:"/projects/{projectId}/eval-workbenches/{workbenchId}/runs/{runId}/annotations",reason:"Creates human review labels and comments. Agents can read review state but cannot impersonate a human reviewer."},{method:"GET",path:"/projects/{projectId}/eval-workbenches/{workbenchId}/runs/{runId}/export.csv",reason:"Exports authored inputs and model outputs as a tenant-data download. Bulk data egress requires a human actor."},{method:"POST",path:"/projects/{projectId}/eval-workbenches/{workbenchId}/runs/{runId}/promote",reason:"Promotes passing workbench evidence into a strict rollout-authority suite. Human approval is required."},{method:"GET",path:"/projects/{projectId}/factory-models",reason:"Native user authority over factory case admission, bounded policy, binding approval and cancellation. An agent session must never read a case, resolve a setup blocker, approve an execution binding, admit paid improvement work or cancel a fence."},{method:"PUT",path:"/projects/{projectId}/factory-models",reason:"Native user authority over factory case admission, bounded policy, binding approval and cancellation. An agent session must never read a case, resolve a setup blocker, approve an execution binding, admit paid improvement work or cancel a fence."},{method:"DELETE",path:"/projects/{projectId}/github",reason:"Repository binding is an OAuth trust relationship between two accounts. The human owns both sides of it."},{method:"POST",path:"/projects/{projectId}/github/admin-proof-init",reason:"Starts a GitHub user authorization that proves a human administers the repository. An agent asking for it would be asking a person to grant authority on its behalf."},{method:"GET",path:"/projects/{projectId}/github/repositories",reason:"Lists repositories for the human repository connection ceremony. Choosing the repository is the person's call."},{method:"DELETE",path:"/projects/{projectId}/gitlab",reason:"Revokes the repository connection and its dedicated SCM credentials. Source access changes remain a human administrator decision."},{method:"GET",path:"/projects/{projectId}/gitlab",reason:"Shows service-credential assurance for the human repository connection ceremony."},{method:"POST",path:"/projects/{projectId}/gitlab",reason:"Accepts and verifies dedicated SCM secrets supplied by an organization administrator. Source credentials are never agent tool arguments."},{method:"POST",path:"/projects/{projectId}/keys",reason:"Mints or approves a credential. An agent must never be able to widen its own access \u2014 this is the escalation boundary that makes scoped agent connections meaningful."},{method:"GET",path:"/projects/{projectId}/keys/{keyId}",reason:"Mints or approves a credential. An agent must never be able to widen its own access \u2014 this is the escalation boundary that makes scoped agent connections meaningful."},{method:"PATCH",path:"/projects/{projectId}/keys/{keyId}",reason:"Mints or approves a credential. An agent must never be able to widen its own access \u2014 this is the escalation boundary that makes scoped agent connections meaningful."},{method:"POST",path:"/projects/{projectId}/keys/{keyId}/block",reason:"Mints or approves a credential. An agent must never be able to widen its own access \u2014 this is the escalation boundary that makes scoped agent connections meaningful."},{method:"POST",path:"/projects/{projectId}/keys/{keyId}/revoke",reason:"Mints or approves a credential. An agent must never be able to widen its own access \u2014 this is the escalation boundary that makes scoped agent connections meaningful."},{method:"POST",path:"/projects/{projectId}/keys/{keyId}/rotate",reason:"Mints or approves a credential. An agent must never be able to widen its own access \u2014 this is the escalation boundary that makes scoped agent connections meaningful."},{method:"POST",path:"/projects/{projectId}/keys/{keyId}/unblock",reason:"Mints or approves a credential. An agent must never be able to widen its own access \u2014 this is the escalation boundary that makes scoped agent connections meaningful."},{method:"GET",path:"/projects/{projectId}/members",reason:"Project membership is organization identity administration reserved for human operators."},{method:"POST",path:"/projects/{projectId}/members",reason:"Creates or changes project membership, an organization identity administration action reserved for human operators."},{method:"DELETE",path:"/projects/{projectId}/members/{userId}",reason:"Removes project membership, an organization identity administration action reserved for human operators."},{method:"POST",path:"/projects/{projectId}/policies/{policyId}/publish",reason:"Publishes or rolls back live traffic policy at S2/S3. Agents draft and experiment; a human promotes."},{method:"POST",path:"/projects/{projectId}/policies/{policyId}/rollback",reason:"Publishes or rolls back live traffic policy at S2/S3. Agents draft and experiment; a human promotes."},{method:"PATCH",path:"/projects/{projectId}/practice-rollup-consent",reason:"Records consent or a data-subject decision on behalf of the organization. Legal effect, so a human must be the actor."},{method:"PATCH",path:"/projects/{projectId}/router-learning-consent",reason:"Changes whether tenant traffic may train shared routing models. An optimizer cannot grant itself access to customer data; a human must make this legal and data-use decision."},{method:"POST",path:"/projects/{projectId}/scenario-connections",reason:"Sandbox credential management and recording rollout gate approval remain human-only."},{method:"POST",path:"/projects/{projectId}/scenario-runs/{runId}/gate",reason:"Sandbox credential management and recording rollout gate approval remain human-only."},{method:"PUT",path:"/projects/{projectId}/sql/tag-keys",reason:"Decides which tag values every metadata-only caller, agents included, may read. An access-control change, so a human owner or admin must be the actor."},{method:"GET",path:"/projects/{projectId}/traces/{traceId}/annotations",reason:"Human trace review notes can contain captured content. Reading them requires content access; agents cannot impersonate a human reviewer."},{method:"POST",path:"/projects/{projectId}/traces/{traceId}/annotations",reason:"Human trace review notes can contain captured content. Reading them requires content access; agents cannot impersonate a human reviewer."},{method:"PATCH",path:"/projects/{projectId}/traces/{traceId}/annotations/{annotationId}",reason:"Human trace review notes can contain captured content. Reading them requires content access; agents cannot impersonate a human reviewer."},{method:"DELETE",path:"/quality-monitors/{monitorId}",reason:"Quality monitors carry a caller-supplied grader egress URL that receives captured response payloads server-side. Creating or editing that target is human-only (ONBOARDING_V2_SPEC non-goal; caveman-cloud-project skill section 5)."},{method:"GET",path:"/router-learning/project-retirements/{requestId}",reason:"Reads the audit receipt of a project retirement from router learning. Audit-log state a human owner reviews, not project telemetry an agent needs."},{method:"POST",path:"/router-learning/subject-retirements",reason:"Retiring a data subject from router learning is an org-admin privacy action (member:manage). An agent must not be able to erase or alter the learning record on anyone's behalf."},{method:"GET",path:"/router-learning/subject-retirements/{requestId}",reason:"Reads the audit receipt of a subject retirement. It is audit-log state a human owner reviews, not project telemetry an agent needs."},{method:"POST",path:"/runtime/events",reason:"Client telemetry transport, not an MCP tool: a signed-in local runtime posts its own member's runtime/v1 events with the device-login session or the personal key it issued. It reads nothing and grants nothing."},{method:"GET",path:"/scm/instances",reason:"Lists installation-admitted SCM origins for the human connection ceremony."},{method:"GET",path:"/system/clickhouse-recovery-points",reason:"Not RBAC-guarded \u2014 part of the authentication or webhook plane. Agents authenticate through a scoped control-plane session and never touch these directly."},{method:"POST",path:"/system/clickhouse-recovery-points",reason:"Not RBAC-guarded \u2014 part of the authentication or webhook plane. Agents authenticate through a scoped control-plane session and never touch these directly."},{method:"GET",path:"/traces/{traceId}/payloads/{payloadType}",reason:"Reads raw request or response bodies. Every read is audited against a human actor, and exposing them to an agent turns project access into a prompt and PII exfiltration path."},{method:"POST",path:"/traces/export",reason:"Deletes, exports or changes the retention of tenant data. Irreversible or data-egress; requires a human actor in the audit trail."},{method:"POST",path:"/traces/views",reason:"A human decision on a saved view: created, renamed, shared or deleted with the actor in the audit trail."},{method:"DELETE",path:"/traces/views/{viewId}",reason:"A human decision on a saved view: created, renamed, shared or deleted with the actor in the audit trail."},{method:"PATCH",path:"/traces/views/{viewId}",reason:"A human decision on a saved view: created, renamed, shared or deleted with the actor in the audit trail."},{method:"POST",path:"/traces/views/{viewId}/evaluate",reason:"Checks the view's alert and fires its webhook, if it has one, when the threshold is met; an outbound side effect a human triggers or the scheduler owns."},{method:"POST",path:"/traces/views/{viewId}/share",reason:"Mints a read-only share link: data egress that needs a human actor in the audit trail."},{method:"POST",path:"/webhooks",reason:"Webhook targets are an egress channel; an agent that could add one could exfiltrate tenant events."},{method:"DELETE",path:"/webhooks/{webhookId}",reason:"Webhook targets are an egress channel; an agent that could add one could exfiltrate tenant events."},{method:"POST",path:"/webhooks/{webhookId}/test",reason:"Webhook targets are an egress channel; an agent that could add one could exfiltrate tenant events."},{method:"PATCH",path:"/workflow-fingerprints/{id}",reason:"Publishes or rolls back live traffic policy at S2/S3. Agents draft and experiment; a human promotes."},{method:"PUT",path:"/workflow-fingerprints/{id}/autopilot",reason:"Publishes or rolls back live traffic policy at S2/S3. Agents draft and experiment; a human promotes."}]}});function yd(e){if(e?.status!=="completed")return"incomplete";let t=e.document?.cases?.filter(n=>n.split===e.split),r=e.document?.variants,i=e.document?.trials;if(!t?.length||!r?.length||!Number.isSafeInteger(i)||i<1||!Array.isArray(e.trials))return"incomplete";let a=new Map;for(let n of t)for(let o of r)for(let p=0;p<i;p++){let c=JSON.stringify([n.id,o.id,p]);if(a.has(c)||!n.criteria?.length)return"incomplete";a.set(c,n)}if(e.trials.length!==a.size)return"incomplete";let s=!1;for(let n of e.trials){let o=JSON.stringify([n.case_id,n.variant_id,n.repeat]),p=a.get(o);if(!p||(a.delete(o),!["passed","failed"].includes(n.status)||!Array.isArray(n.verdicts)||n.verdicts.length!==p.criteria.length))return"incomplete";let c=new Set(p.criteria.map(u=>u.id));if(c.size!==p.criteria.length)return"incomplete";let d=!1;for(let u of n.verdicts){if(!c.delete(u.id)||!["passed","failed"].includes(u.status))return"incomplete";d||=u.status==="failed"}if(n.status==="failed"!==d)return"incomplete";s||=d}return s?"failed":"passed"}var md=Ze(()=>{});var hd={};Lt(hd,{cloudContext:()=>vf});import{readFile as lf,writeFile as yf,mkdir as mf,rename as _f}from"node:fs/promises";import{homedir as gf}from"node:os";import{join as _d,dirname as ff}from"node:path";import{randomUUID as hf}from"node:crypto";async function fd(e,t){try{return JSON.parse(await lf(e,"utf8"))}catch(r){if(r.code==="ENOENT")return t;throw new m("cave_context_invalid",`Invalid context file: ${e}`,2)}}async function Xr(e,t){await mf(ff(e),{recursive:!0});let r=e+"."+hf()+".tmp";await yf(r,JSON.stringify(t,null,2)+`
|
|
10
|
+
`,{mode:384,flag:"wx"}),await _f(r,e)}function zs(e){if(e!==void 0&&!bf.test(e))throw new m("cave_project_required","Project must be a UUID.",2);return e}function vf(e,{home:t=gf(),cwd:r=process.cwd(),env:i=process.env}={}){let a=_d(t,".caveman-cloud","profiles.json"),s=_d(r,".caveman-cloud.json");async function n(){let d=await fd(a,{schema_version:1,profiles:{}});if(d.schema_version!==1||!d.profiles||typeof d.profiles!="object"||Array.isArray(d.profiles))throw new m("cave_context_invalid","Unsupported Cloud profiles document.",2);return d}async function o({profile:d,projectId:u}={}){let f=await n();if(d=d??i.CAVE_CLOUD_PROFILE??f.selected??"default",!gd.test(d))throw new m("cave_profile_invalid","Invalid profile name.",2);let y=await fd(s,{});if(Object.keys(y).some(g=>!["schema_version","project_id"].includes(g))||y.schema_version!==void 0&&y.schema_version!==1)throw new m("cave_context_invalid","Repository binding accepts only schema_version and project_id.",2);let l;if(d==="default")l=await e();else{let g=f.profiles[d];if(!g)throw new m("cave_profile_missing",`Profile ${d} is not configured. Use context save.`,3);if(!/^[A-Z][A-Z0-9_]{0,127}$/.test(g.token_env??""))throw new m("cave_profile_invalid","Named profile needs a token environment variable.",2);if(l={baseURL:g.endpoint,token:i[g.token_env],projectId:g.project_id},!l.token)throw new m("cave_profile_credential_missing",`Set ${g.token_env} for profile ${d}. No default credential fallback.`,3)}let _=zs(u??i.CAVE_PROJECT_ID??y.project_id??(d==="default"?f.project_id:void 0)??l.projectId);return{...l,projectId:_,profile:d,projectSource:u?"flag":i.CAVE_PROJECT_ID?"environment":y.project_id?"repository":_?"saved":"unset"}}async function p(d,u,f,y){let l=await n();if(d==="list")return{schema_version:1,profiles:["default",...Object.keys(l.profiles)].map(g=>({id:g,selected:(l.selected??"default")===g,...g==="default"?{}:{endpoint:l.profiles[g].endpoint,project_id:l.profiles[g].project_id,token_env:l.profiles[g].token_env}}))};if(d==="save"){let g=f[0];if(f.length!==1||!gd.test(g)||g==="default"||!u.endpoint||!/^[A-Z][A-Z0-9_]{0,127}$/.test(u["token-env"]??""))throw new m("cave_usage","Use context save NAME --endpoint URL --token-env ENV_NAME [--project UUID]. Named profiles reference environment credentials; they never store tokens.",2);return new ae({baseURL:u.endpoint,token:"endpoint-validation"}),l.profiles[g]={endpoint:u.endpoint,token_env:u["token-env"],...u.project?{project_id:zs(u.project)}:{}},await Xr(a,l),{schema_version:1,ok:!0,profile:g}}if(d==="use"){let g=f[0];if(f.length!==1||g!=="default"&&!Object.hasOwn(l.profiles,g))throw new m("cave_profile_missing","Use context use NAME with an existing profile.",2);return l.selected=g,await Xr(a,l),{schema_version:1,ok:!0,profile:g}}let _=await o({profile:y,projectId:u.project});if(d==="bind"||d==="set"){let g=zs(u.project??f[0]);if(!g||f.length>1)throw new m("cave_usage","Select one project UUID.",2);return await new ae({..._,projectId:g}).execute("projects.get",{}),d==="bind"?await Xr(s,{schema_version:1,project_id:g}):(_.profile==="default"?l.project_id=g:l.profiles[_.profile].project_id=g,await Xr(a,l)),{schema_version:1,ok:!0,profile:_.profile,project_id:g,source:d==="bind"?"repository":"saved"}}if(d!=="show")throw new m("cave_usage","Use context show|list|save|use|set|bind.",2);if(f.length)throw new m("cave_usage","context show accepts no positional arguments.",2);return{schema_version:1,profile:_.profile,endpoint:_.baseURL,project_id:_.projectId??null,project_source:_.projectSource,credential_configured:!!_.token}}async function c(d){let u=await o(d),f=new ae(u),y=await f.discover();if(y.schema_version!==1||!Array.isArray(y.operations))throw new m("cave_contract_invalid","Server discovery document is invalid.",6);let l=y.contract_sha256===Ts;return{schema_version:1,ok:l,status:l?"completed":"incompatible",profile:u.profile,endpoint:u.baseURL,project_id:u.projectId??null,installed_contract:Ts,server_contract:y.contract_sha256,granted_operations:y.operations.map(_=>_.id),...l?{}:{next_action:"Update client or server to a matching contract."}}}return{resolve:o,command:p,doctor:c}}var bf,gd,bd=Ze(()=>{zt();bf=/^[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}$/i,gd=/^[a-z][a-z0-9_-]{0,63}$/});var kd={};Lt(kd,{csv:()=>Zs,grid:()=>Ls,renderQuery:()=>qd,renderSchema:()=>Pd,sqlCommand:()=>$f,sqlParams:()=>wd,sqlUsage:()=>Es});import{readFile as jf}from"node:fs/promises";import{parseArgs as wf}from"node:util";async function qf(){let e=[],t=0;for await(let r of process.stdin){if(t+=r.length,t>64*1024)throw new m("cave_input_too_large","SQL exceeds 64 KiB.",2);e.push(r)}return Buffer.concat(e).toString("utf8")}function wd(e=[],t=""){let r=Object.fromEntries([...t.matchAll(/\{\s*(\w+)\s*:\s*([^}]+?)\s*\}/g)].map(a=>[a[1],a[2].replace(/\s+/g,"")])),i={};for(let a of e){let s=a.indexOf("="),n=a.slice(0,s);if(s<1)throw new m("cave_usage","Use --param name=value.",2);if(Object.hasOwn(i,n))throw new m("cave_usage",`Parameter ${n} is given twice.`,2);let o=a.slice(s+1),p=r[n],c=o;if(p==="Float64")o.trim()!==""&&Number.isFinite(Number(o))&&(c=Number(o));else if(p==="Array(String)"||p===void 0)try{let d=JSON.parse(o),u=typeof d=="number"&&(Number.isSafeInteger(d)||!/^-?\d+$/.test(o.trim()));(Array.isArray(d)||p===void 0&&(typeof d=="string"||u))&&(c=d)}catch{}i[n]=c}return i}function Ls(e,t,r=[]){let i=e.map(vd),a=t.map(o=>o.map(p=>xf(vd(p)))),s=i.map((o,p)=>Math.max(ei(o),...a.map(c=>ei(c[p])))),n=o=>o.map((p,c)=>{let d=" ".repeat(s[c]-ei(p));return r[c]?d+p:p+d}).join(" | ").trimEnd();return[n(i),s.map(o=>"-".repeat(o)).join("-+-"),...a.map(n)].join(`
|
|
11
|
+
`)+`
|
|
12
|
+
`}function qd(e,t){let r=e.columns.map(s=>s.name),i=e.rows.map(s=>s.map(Pf));if(t==="json")return ot(e)+`
|
|
13
|
+
`;if(t==="jsonl")return e.rows.map(s=>ot(Object.fromEntries(r.map((n,o)=>[n,s[o]])))+`
|
|
14
|
+
`).join("");let a=e.columns.map(s=>kf(s.type));return t==="csv"?Zs(r,i,a):Ls(e.columns.map(Of),i,a)}function Pd(e,t){if(t==="json")return ot(e)+`
|
|
15
|
+
`;let r=e.columns!==void 0,i=r?["column","type","class","basis","description"]:["table","grain","time_column","join_keys"],a=r?e.columns.map(n=>[n.name,n.type,n.class,n.basis??"",(n.untrusted?"[untrusted] ":"")+n.description]):e.tables.map(n=>[n.name,n.grain,n.time_column,n.join_keys.join(", ")]);if(t==="jsonl")return a.map(n=>ot(Object.fromEntries(i.map((o,p)=>[o,n[p]])))+`
|
|
16
|
+
`).join("");if(t==="csv")return Zs(i,a);let s=Ls(i,a);if(r&&e.hidden.length&&(s+=`
|
|
17
|
+
hidden: `+e.hidden.map(n=>`${n.name} (needs ${n.requires})`).join(", ")+`
|
|
18
|
+
`),!r){let{window:n,limits:o,notes:p,unsupported:c}=e.rules;s+=`
|
|
19
|
+
window: ${n.form} (default ${n.default}, max ${n.max})
|
|
20
|
+
limits: ${o.default_rows} rows by default, at most ${o.max_rows} rows and ${o.max_result_bytes} bytes
|
|
21
|
+
`,s+=`
|
|
22
|
+
rules:
|
|
23
|
+
`+p.map(d=>" "+d).join(`
|
|
24
|
+
`)+`
|
|
25
|
+
|
|
26
|
+
`+c.split(`
|
|
27
|
+
`).map(d=>" "+d).join(`
|
|
28
|
+
`)+`
|
|
29
|
+
|
|
30
|
+
examples:
|
|
31
|
+
`+e.examples.map(d=>" "+d).join(`
|
|
32
|
+
`)+`
|
|
33
|
+
`}return s}async function $f(e,{connect:t,format:r}){let{values:i,positionals:a}=wf({args:e,allowPositionals:!0,strict:!0,options:{file:{type:"string",short:"f"},stdin:{type:"boolean"},window:{type:"string"},from:{type:"string"},to:{type:"string"},param:{type:"string",multiple:!0},format:{type:"string"},schema:{type:"boolean"},project:{type:"string"},timeout:{type:"string"},help:{type:"boolean",short:"h"}}});if(i.help)return process.stdout.write(Es+`
|
|
34
|
+
`),0;let s=i.format??r;if(!["table","csv","json","jsonl"].includes(s))throw new m("cave_usage","Format must be table, csv, json or jsonl.",2);let n=await t({projectId:i.project,timeout:Number(i.timeout??6e4)});if(i.schema){if(a.length>1||i.file||i.stdin||i.param||i.window||i.from||i.to)throw new m("cave_usage","Use --schema [TABLE] alone.",2);let d=await n.execute("sql.schema",a.length?{table:a[0]}:{});return process.stdout.write(Pd(d.data,s)),0}if([a.length>0,!!i.file,!!i.stdin].filter(Boolean).length!==1||a.length>1)throw new m("cave_usage",`Give the SQL once: ${Es}`,2);let o=a[0]??(i.file?await jf(i.file,"utf8"):await qf()),p={sql:o};i.param&&(p.params=wd(i.param,o));for(let d of["window","from","to"])i[d]!==void 0&&(p[d]=i[d]);let{data:c}=await n.execute("sql.query",p);if(process.stdout.write(qd(c,s)),s!=="json"){process.stderr.write(`${c.row_count} row${c.row_count===1?"":"s"} \xB7 ${c.window.from} to ${c.window.to} \xB7 ${c.elapsed_ms} ms \xB7 digest ${c.query_digest.slice(0,12)}
|
|
35
|
+
`);for(let d of c.notices)process.stderr.write(`note: ${d}
|
|
36
|
+
`)}return 0}var Es,Pf,kf,vd,Ss,ei,xf,jd,Zs,Of,xd=Ze(()=>{zt();Es='cvm sql "<SQL>" | -f FILE.sql | --stdin [--window 7d | --from T [--to T]] [--param name=value ...] [--format table|csv|json|jsonl] [--schema [TABLE]] [--project UUID]';Pf=e=>e==null?null:typeof e=="string"?e:JSON.stringify(e),kf=e=>/^(Nullable\()?(U?Int|Float|Decimal)/.test(e??""),vd=e=>(e??"NULL").replace(/[\p{Cc}\p{Cf}\u2028\u2029]/gu,t=>`
|
|
37
|
+
\r\u2028\u2029`.includes(t)?" ":"\uFFFD"),Ss=e=>new RegExp("\\p{Mn}","u").test(e)?0:/[\u1100-\u115f\u2e80-\u303e\u3041-\ua4cf\uac00-\ud7a3\uf900-\ufaff\ufe30-\ufe4f\uff00-\uff60\uffe0-\uffe6\u{1f300}-\u{1faff}\u{20000}-\u{3fffd}]/u.test(e)?2:1,ei=e=>{let t=0;for(let r of e)t+=Ss(r);return t},xf=e=>{if(ei(e)<=80)return e;let t="",r=0;for(let i of e){if(r+Ss(i)>79)break;t+=i,r+=Ss(i)}return t+"\u2026"};jd=(e,t)=>e===null?"":(e=e.replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f-\x9f\u061c\u200e\u200f\u202a-\u202e\u2066-\u2069]/g,"\uFFFD"),!t&&/^[=+\-@\t\r]/.test(e)&&(e="'"+e),/[",\r\n]/.test(e)?'"'+e.replaceAll('"','""')+'"':e),Zs=(e,t,r=[])=>[e.map(i=>jd(i,!1)),...t.map(i=>i.map((a,s)=>jd(a,r[s])))].map(i=>i.join(",")).join(`\r
|
|
38
|
+
`)+`\r
|
|
39
|
+
`,Of=e=>e.basis?.length?`${e.name} (${[...new Set(e.basis)].join(", ")})`:e.name});var Od={};Lt(Od,{datasetFromTraces:()=>If,scenarioFromTrace:()=>Af,traceTranscript:()=>Rs});async function Rs(e,t){be("traces.payload",{...t,kind:"request"});let r=[];for(let i of["request","response"])r.push((await e.execute("traces.payload",{...t,kind:i})).data);return{schema_version:1,trace_id:t.trace_id,request_id:t.request_id,coverage:"single_captured_request",complete_conversation:!1,captures:r,warnings:r.filter(i=>i.status!=="captured").map(i=>`${i.kind}: ${i.reason}`)}}async function If(e,t,{name:r="Trace regression",description:i=""}={}){if(!Array.isArray(t)||t.length<1||t.length>100)throw new m("cave_trace_selection_invalid","Select 1-100 captured requests with trace_id, request_id, from and to.",2);let a=[],s=new Set;for(let o of t){if(s.has(o.request_id))throw new m("cave_trace_selection_invalid","Duplicate request selection.",2);s.add(o.request_id);let p=await Rs(e,o),[c,d]=p.captures;if(c.status!=="captured")throw new m("cave_capture_unavailable",`Request capture is unavailable: ${c.reason}.`,6);a.push({row_key:o.request_id,values:{input:c.payload,...d.status==="captured"?{observed_output:d.payload}:{},source:{...o,request_sha256:c.payload_sha256,...d.status==="captured"?{response_sha256:d.payload_sha256}:{},coverage:p.coverage,missing_expectation:!0}}})}let n={schema_version:1,kind:"datasets",spec:{name:r,description:i,document:{schema_version:1,columns:[{key:"input",name:"Captured input",type:"json",role:"input"},{key:"observed_output",name:"Observed output",type:"json",role:"output"},{key:"source",name:"Trace provenance",type:"json",role:"metadata"}],rows:a}}};return be("datasets.create",n.spec),n}async function Af(e,t,{name:r="Trace regression scenario"}={}){let i=await Rs(e,t),a=i.captures.find(s=>s.kind==="request");if(!a||a.status!=="captured")throw new m("cave_capture_unavailable","Request capture is unavailable; cannot establish draft provenance.",6);return{schema_version:1,status:"draft",ready:!1,manifest:{schema_version:1,kind:"scenarios",spec:{schema_version:1,adapter:"python-module-task-v1",name:r,invariant:"",entrypoint:"",input:null,initial_state:{},tools:[],read_only_tools:[],assertions:[],historical:[],provenance:{evidence_digests:[...new Set(i.captures.filter(s=>s.status==="captured").map(s=>s.query_digest))],fixture_basis:"synthetic",fixture_rationale:""}}},source:{...t,request_sha256:a.payload_sha256,coverage:i.coverage,complete_conversation:!1},warnings:["Fill entrypoint, independent invariant and assertions; create synthetic inputs and ordered tool fixtures before validation. List in read_only_tools only tools whose calls change nothing.","Captured output is observed behavior, never an expected answer.","This draft cannot execute or certify a test.",...i.warnings]}}var $d=Ze(()=>{zt()});var ti={};Lt(ti,{manifestDiff:()=>Tf,manifestFamilies:()=>zf,parseRows:()=>Sf,pullManifest:()=>Id,pushBundle:()=>Ef,pushManifest:()=>Ad,validateBundle:()=>zd,validateManifest:()=>_r});import{createHash as Cs}from"node:crypto";function _r(e,t){if(!mr[t]||e?.schema_version!==1||e.kind!==t||Object.keys(e).some(r=>!["schema_version","kind","resource","spec"].includes(r)))throw new m("cave_manifest_invalid","Expected version 1 manifest with kind, optional resource, and spec.",2);if(be(`${t}.create`,e.spec),e.resource){if(Object.keys(e.resource).some(r=>!(t==="scenarios"?["id","revision","version"]:["id","revision"]).includes(r)))throw new m("cave_manifest_invalid","Resource identity accepts id and revision only.",2);if(be(`${t}.update`,{...t==="scenarios"?{definition:e.spec}:e.spec,[mr[t].id]:e.resource.id,revision:e.resource.revision}),t==="scenarios"&&(!Number.isSafeInteger(e.resource.version)||e.resource.version<1))throw new m("cave_manifest_invalid","Scenario resource requires an immutable version.",2)}return e}async function Id(e,t,r,i=1){let a=mr[t],s=await e.execute(`${t}.get`,{[a.id]:r,...t==="scenarios"?{version:i}:{}});if(t==="scenarios")return _r({schema_version:1,kind:t,resource:{id:s.data.dataset_id,revision:s.data.revision,version:s.data.version},spec:s.data.definition},t);let n=s.data[a.singular],o;return t==="datasets"?o={document:{schema_version:1,columns:n.columns,rows:s.data.rows.map(p=>({row_key:p.row_key,values:p.values,...p.tags?.length?{tags:p.tags}:{}}))}}:t==="evaluators"?o={config:{schema_version:1,grader_type:n.grader_type,options:n.options,input_mapping:n.input_mapping}}:o={document:n.document},_r({schema_version:1,kind:t,resource:{id:n.id,revision:n.revision},spec:{name:n.name,description:n.description,...o}},t)}function Tf(e,t){let r=[];function i(a,s,n){if(JSON.stringify(a)!==JSON.stringify(s))if(a&&s&&!Array.isArray(a)&&!Array.isArray(s)&&typeof a=="object"&&typeof s=="object")for(let o of new Set([...Object.keys(a),...Object.keys(s)]))i(a[o],s[o],n+"/"+o.replaceAll("~","~0").replaceAll("/","~1"));else r.push({path:n,change:a===void 0?"add":s===void 0?"remove":"replace"})}return i(e?.spec,t.spec,"/spec"),r}function gr(e){return Array.isArray(e)?e.map(gr):e&&typeof e=="object"?Object.fromEntries(Object.keys(e).sort().map(t=>[t,gr(e[t])])):e}async function Ad(e,t,{idempotencyKey:r}={}){let i=t.kind;_r(t,i);let a={...i==="scenarios"&&t.resource?{definition:t.spec}:t.spec,...t.resource?{[mr[i].id]:t.resource.id,revision:t.resource.revision}:{}},s=`${i}.${t.resource?"update":"create"}`,n=r??"manifest:"+Cs("sha256").update(JSON.stringify(gr({project:e.projectId,id:s,input:a}))).digest("hex"),o=await e.execute(s,a,{idempotencyKey:n}),p=o.data.id??o.data.dataset_id;return{...o,manifest:{...t,resource:{id:p,revision:o.data.revision,...i==="scenarios"?{version:o.data.version}:{}}},lock:{schema_version:1,kind:i,project_id:e.projectId,id:p,revision:o.data.revision,current_version:o.data.current_version??o.data.version??0,contract_sha256:o.contract_sha256,receipt_id:o.receipt_id,idempotency_key:n}}}function zd(e){if(e?.schema_version!==1||!Array.isArray(e.resources)||e.resources.length<1||e.resources.length>50||Object.keys(e).some(r=>!["schema_version","resources"].includes(r)))throw new m("cave_manifest_invalid","Bundle needs schema_version:1 and 1-50 named resources.",2);let t=new Set;for(let r of e.resources){if(!r||Object.keys(r).some(i=>!["name","manifest"].includes(i))||!/^[a-z][a-z0-9_-]{0,63}$/.test(r.name)||t.has(r.name))throw new m("cave_manifest_invalid","Bundle resource names must be unique lowercase identifiers.",2);t.add(r.name),_r(r.manifest,r.manifest?.kind)}return e}async function Ef(e,t,{lock:r,onReceipt:i}={}){if(zd(t),r&&(r.schema_version!==1||r.project_id!==e.projectId||!r.resources||typeof r.resources!="object"))throw new m("cave_lock_conflict","Lock belongs to another project or has an unsupported version.",4);r=structuredClone(r??{schema_version:1,project_id:e.projectId,resources:{}});let a=[];for(let{name:n,manifest:o}of t.resources)try{let p=Cs("sha256").update(JSON.stringify(gr(o.spec))).digest("hex"),c=r.resources[n],d=o;if(c){if(c.kind!==o.kind||o.resource&&o.resource.id!==c.id)throw new m("cave_lock_conflict",`Resource ${n} changed identity.`,4);if(c.spec_sha256===p){if((await Id(e,o.kind,c.id,c.current_version||1)).resource.revision!==c.revision)throw new m("cave_eval_revision_conflict",`Resource ${n} changed remotely. Pull and reconcile before retrying.`,4);a.push({name:n,status:"unchanged",receipt_id:c.receipt_id,resource_id:c.id});continue}d={...o,resource:{id:c.id,revision:c.revision,...o.kind==="scenarios"?{version:c.current_version}:{}}}}let u="bundle:"+Cs("sha256").update(JSON.stringify(gr({project:e.projectId,name:n,manifest:d}))).digest("hex"),f=await Ad(e,d,{idempotencyKey:u});r.resources[n]={...f.lock,spec_sha256:p},await i?.(r),a.push({name:n,status:"completed",receipt_id:f.receipt_id,resource_id:f.lock.id})}catch(p){a.push({name:n,status:"failed",error:{code:p.code??"cave_operation_failed",message:p.message,exit_code:p.exitCode??1}})}let s=a.filter(n=>n.status==="failed");return{schema_version:1,ok:s.length===0,status:s.length?"partial":"completed",atomic:!1,results:a,lock:r,exit_code:s[0]?.error.exit_code??0}}function Sf(e){if(Buffer.byteLength(e)>16*1024*1024)throw new m("cave_input_too_large","Rows exceed 16 MiB.",2);let t=[];for(let[r,i]of e.split(/\r?\n/).entries())if(i.trim())try{t.push(JSON.parse(i))}catch{throw new m("cave_invalid_jsonl",`Invalid JSON on row line ${r+1}.`,2)}return t}var mr,zf,ri=Ze(()=>{zt();mr={datasets:{singular:"dataset",id:"dataset_id"},evaluators:{singular:"evaluator",id:"evaluator_id"},evals:{singular:"workbench",id:"workbench_id"},scenarios:{singular:"scenario",id:"dataset_id"}},zf=Object.keys(mr)});var Td={};Lt(Td,{pullPromptManifest:()=>Zf,pushPromptManifest:()=>Rf,validatePromptManifest:()=>Ds});function Ds(e){if(!e||e.schema_version!==1||e.kind!=="prompts"||Object.keys(e).some(t=>!["schema_version","kind","resource","spec"].includes(t)))throw new m("cave_manifest_invalid","Expected a version 1 prompts manifest.",2);if(!e.spec||typeof e.spec!="object"||Array.isArray(e.spec)||Object.keys(e.spec).some(t=>![...Ns,...Object.hasOwn(e,"resource")?[]:["name","description"]].includes(t)))throw new m("cave_manifest_invalid","Prompt spec accepts content fields; identity and expected version belong in resource.",2);if(Object.hasOwn(e,"resource")&&(!e.resource||typeof e.resource!="object"||Array.isArray(e.resource)))throw new m("cave_manifest_invalid","Prompt resource must contain id and version.",2);if(e.resource){if(Object.keys(e.resource).some(t=>!["id","version"].includes(t))||!Number.isSafeInteger(e.resource.version)||e.resource.version<1)throw new m("cave_manifest_invalid","Prompt resource requires id and expected version.",2);be("prompts.add_version",{...e.spec,prompt_id:e.resource.id,expected_version:e.resource.version})}else be("prompts.create",e.spec);return e}async function Zf(e,t,r){let i=(await e.execute("prompts.get",{prompt_id:t})).data,a=r??i.prompt.latest_version,s=i.versions?.find(n=>n.version===a);if(!s)throw new m("cave_prompt_version_not_found","Requested prompt version was not found.",4);return Ds({schema_version:1,kind:"prompts",resource:{id:i.prompt.id,version:s.version},spec:Lf(s)})}async function Rf(e,t){Ds(t);let r=t.resource?await e.execute("prompts.add_version",{...t.spec,prompt_id:t.resource.id,expected_version:t.resource.version}):await e.execute("prompts.create",t.spec),i=t.resource?{id:t.resource.id,version:r.data.version}:{id:r.data.id,version:r.data.latest_version};return{...r,manifest:{schema_version:1,kind:"prompts",resource:i,spec:Object.fromEntries(Ns.filter(a=>Object.hasOwn(t.spec,a)).map(a=>[a,t.spec[a]]))},retry:"inspect_remote_before_retry"}}var Ns,Lf,Ed=Ze(()=>{zt();Ns=["system_text","user_text","variables","model_defaults","commit_message","tags"],Lf=e=>Object.fromEntries(Ns.map(t=>[t,e[t]]))});import{readFile as Gs,writeFile as Tt}from"node:fs/promises";import{parseArgs as He}from"node:util";import{setTimeout as ii}from"node:timers/promises";function Te(e){let t=ai.find(r=>r.id===e||r.aliases.includes(e));if(!t)throw new m("cave_unknown_operation",`Unknown operation ${e}. Run cvm tools list.`,2);return t}function Ms(e){if(!si.includes(e))return Te(e);let[t,r]=e.split("."),i={type:"string",format:"uuid"},a={type:"object",additionalProperties:!1,properties:{}},s=`cvm ${e.replaceAll("."," ")}`;if(["traces.transcript","datasets.from-traces","scenarios.from-trace"].includes(e)){let{kind:n,...o}=Te("traces.payload").input_schema.properties;a={type:"object",additionalProperties:!1,properties:o,required:Object.keys(o)},s+=" --file SELECTION.json [--out OUTPUT.json]"}else t==="targets"?(a=r==="validate"?Te("evals.create").input_schema.properties.document.properties.targets.items:{type:"object",additionalProperties:!1,properties:{workbench_id:i,...r==="get"?{target_key:{type:"string"}}:{}},required:["workbench_id",...r==="get"?["target_key"]:[]]},s+=r==="validate"?" --file TARGET.json":` WORKBENCH_ID${r==="get"?" TARGET_KEY":""}`):t==="prompts"&&["validate","diff","push"].includes(r)?(a={type:"object",required:["schema_version","kind","spec"],properties:{schema_version:{const:1},kind:{const:"prompts"},spec:{type:"object"},resource:{type:"object",required:["id","version"],properties:{id:i,version:{type:"integer",minimum:1}}}}},s+=" --file MANIFEST.json"):["datasets","evaluators","evals","scenarios"].includes(t)&&["validate","diff","push"].includes(r)?(a={type:"object",additionalProperties:!1,required:["schema_version","kind","spec"],properties:{schema_version:{const:1},kind:{const:t},spec:Te(t+".create").input_schema,resource:{type:"object",additionalProperties:!1,required:["id","revision",...t==="scenarios"?["version"]:[]],properties:{id:i,revision:{type:"integer",minimum:1},...t==="scenarios"?{version:{type:"integer",minimum:1}}:{}}}}},s+=" --file MANIFEST.json"):["pull","versions"].includes(r)?s+=" RESOURCE_ID [--out FILE]":r==="wait"?(a=Te(t==="runs"?"runs.get":t==="scenario-runs"?"scenario-runs.get":t==="experiments"?"experiments.get":"evals.result").input_schema,s+=t==="evals"?" WORKBENCH_ID RUN_ID [--wait-timeout MS]":t==="experiments"?" EXPERIMENT_ID [--wait-timeout MS] exit 0 verdict, 5 typed refusal, 6 failed/error/cancelled/rolled back, 7 wait timed out or interrupted":" RUN_ID [--wait-timeout MS]"):t==="manifests"?s+=" --file BUNDLE.json"+(r==="push"?" --lock LOCK.json":""):t==="context"&&(s+={save:" NAME --endpoint URL --token-env VARIABLE [--project UUID]",use:" NAME",set:" PROJECT_ID",bind:" PROJECT_ID",show:"",list:""}[r]);return{id:e,version:"1",execution:"client_workflow",summary:s,input_schema:a,usage:s}}function be(e,t){let r=Te(e);for(let a of[t?.parameters,t?.query,t?.body])if(a&&["projectId","orgId","project_id","organization_id"].some(s=>Object.hasOwn(a,s)))throw new m("cave_scope_argument_rejected","Scope comes from authenticated context and --project, not operation input.",2);St.has(r.id)||St.set(r.id,ni.compile(r.input_schema));let i=St.get(r.id);if(!i(t))throw new m("cave_operation_input_invalid",`Invalid input for ${r.id}.`,2,i.errors);return t}async function Et(e,t){if(e&&t)throw new m("cave_usage","Use either --file or --stdin.",2);let r="{}";if(e)r=await Gs(e,"utf8");else if(t){let i=[],a=0;for await(let s of process.stdin){if(a+=Buffer.byteLength(s),a>16*1024*1024)throw new m("cave_input_too_large","Input exceeds 16 MiB.",2);i.push(s)}r=Buffer.concat(i).toString("utf8")}if(Buffer.byteLength(r)>16*1024*1024)throw new m("cave_input_too_large","Input exceeds 16 MiB.",2);try{return JSON.parse(r)}catch{throw new m("cave_invalid_json","Input must be one JSON document.",2)}}function X(e,t){if(t==="json"||t==="jsonl"){process.stdout.write(ot(e)+`
|
|
40
|
+
`);return}if(Array.isArray(e)){for(let r of e)process.stdout.write(typeof r=="string"?r+`
|
|
41
|
+
`:`${r.id??r.operation??""} ${r.summary??r.status??""}
|
|
42
|
+
`);return}process.stdout.write(ot(e,2)+`
|
|
43
|
+
`)}async function Gb(e,{context:t,login:r}={}){let i=process.stdout.isTTY?"table":"json",a;try{let s;e=[...e];for(let v=0;v<e.length;v++)if(e[v]==="--profile"||e[v].startsWith("--profile=")){if(s!==void 0)throw new m("cave_usage","Supply --profile once.",2);let x=e[v].startsWith("--profile=");if(s=x?e[v].slice(10):e[v+1],!s||s.startsWith("--"))throw new m("cave_usage","--profile needs a name.",2);e.splice(v,x?1:2),v--}let{cloudContext:n}=await Promise.resolve().then(()=>(bd(),hd)),o=n(t??(async()=>({baseURL:process.env.CAVE_API_URL??"https://api.caveman.so",token:process.env.CAVE_TOKEN,projectId:process.env.CAVE_PROJECT_ID}))),p=(v={})=>o.resolve({profile:s,...v});e[0]==="evals"&&e[1]==="drafts"&&e.splice(0,2,"eval_drafts");let[c,d,...u]=e;if(si.includes(`${c}.${d}`)&&u.includes("--help"))return X(Ms(`${c}.${d}`),i),0;if(c==="doctor"||c==="auth"&&d==="status"||c==="context"&&["show","list","save","use","set","bind"].includes(d)){let{values:v,positionals:x}=He({args:c==="doctor"?e.slice(1):u,allowPositionals:!0,strict:!0,options:{format:{type:"string"},project:{type:"string"},...c==="context"&&d==="save"?{endpoint:{type:"string"},"token-env":{type:"string"}}:{}}});if(i=v.format??i,!["json","jsonl","table"].includes(i))throw new m("cave_usage","Format must be json, jsonl, or table.",2);let $;if(c==="context")$=await o.command(d,v,x,s);else{if(x.length)throw new m("cave_usage","Unexpected positional arguments.",2);$=c==="doctor"?await o.doctor({profile:s,projectId:v.project}):await new ae(await p()).execute("context.whoami",{})}return X($,i),$.ok===!1?4:0}if(c==="auth"&&d==="login"){if((await o.resolve({profile:s})).profile!=="default")throw new m("cave_usage","Named profiles use their configured token environment variable.",2);if(!process.stdin.isTTY)throw new m("cave_auth_required","For headless use, set CAVE_TOKEN or a named profile token environment variable.",3);if(!r)throw new m("cave_auth_required","Run caveman login.",3);return await r(u),0}if(!c||c==="--help"||c==="-h")return X({usage:"cvm <resource> <verb> [--file input.json | --stdin] [--project UUID] [--profile NAME]",context:"cvm context show|save|use|set|bind",diagnostics:"cvm doctor",auth:"cvm auth status|login",mcp:"cvm mcp",discover:"cvm tools list",schemas:"cvm tools describe datasets.create",formats:["json","jsonl","table"],write_retry:"Supply --idempotency-key; reuse for identical retries.",families:[...new Set([...ai.map(v=>v.id),...si].map(v=>v.split(".")[0]))].sort()},i),0;if(c==="sql"&&!["query","schema","tag_keys"].includes(d)){let{sqlCommand:v}=await Promise.resolve().then(()=>(xd(),kd));return await v(e.slice(1),{format:i,connect:async({projectId:x,timeout:$})=>{let T=await p({projectId:x});return new ae({...T,projectId:x??T.projectId,timeout:$})}})}if(c==="traces"&&d==="transcript"||c==="datasets"&&d==="from-traces"||c==="scenarios"&&d==="from-trace"){let{traceTranscript:v,datasetFromTraces:x,scenarioFromTrace:$}=await Promise.resolve().then(()=>($d(),Od)),{values:T,positionals:F}=He({args:u,allowPositionals:!0,strict:!0,options:{file:{type:"string"},stdin:{type:"boolean"},trace:{type:"string"},"request-id":{type:"string"},from:{type:"string"},to:{type:"string"},name:{type:"string"},out:{type:"string"},project:{type:"string"},format:{type:"string"}}});if(i=T.format??i,!["json","jsonl","table"].includes(i))throw new m("cave_usage","Format must be json, jsonl, or table.",2);if(F.length>1)throw new m("cave_usage","Supply one trace ID or a selection file.",2);let A=T.file||T.stdin?await Et(T.file,T.stdin):{trace_id:T.trace??F[0],request_id:T["request-id"],from:T.from,to:T.to},V=await p({projectId:T.project}),S=new ae({...V,projectId:T.project??V.projectId}),M=d==="transcript"?await v(S,A):d==="from-trace"?await $(S,A,{name:T.name}):await x(S,Array.isArray(A)?A:[A],{name:T.name});return T.out&&await Tt(T.out,JSON.stringify(M,null,2)+`
|
|
44
|
+
`,{flag:"wx",mode:384}),X(M,i),d==="transcript"&&M.warnings.length?6:0}if(c==="targets"&&["list","get","validate"].includes(d)){let{values:v,positionals:x}=He({args:u,allowPositionals:!0,strict:!0,options:{file:{type:"string"},stdin:{type:"boolean"},project:{type:"string"},format:{type:"string"}}});if(i=v.format??i,!["json","jsonl","table"].includes(i))throw new m("cave_usage","Format must be json, jsonl, or table.",2);let $=Te("evals.create").input_schema.properties.document.properties.targets.items;if(d==="validate"){if(x.length)throw new m("cave_usage","Use targets validate --file TARGET.json.",2);let S=ni.compile($),M=await Et(v.file,v.stdin);if(!S(M))throw new m("cave_target_invalid","Invalid target configuration.",2,S.errors);return X({schema_version:1,ok:!0,validation:"json_schema",models_invoked:0,limitations:["Server resolves references, provider access and execution policy when creating a run."]},i),0}if(v.file||v.stdin||x.length!==(d==="get"?2:1))throw new m("cave_usage","Use targets list WORKBENCH_ID or targets get WORKBENCH_ID TARGET_KEY.",2);let A=(await new ae(await p({projectId:v.project})).execute("evals.get",{workbench_id:x[0]})).data.workbench,V=A.document.targets.filter(S=>d==="list"||S.key===x[1]);if(d==="get"&&V.length!==1)throw new m("cave_target_not_found","Target not found in this workbench.",1);return X({schema_version:1,workbench_id:A.id,revision:A.revision,targets:V,limitations:["Configuration identity is recorded here. Run evidence establishes whether execution completed."]},i),0}if(c==="manifests"&&["validate","push"].includes(d)){let{validateBundle:v,pushBundle:x}=await Promise.resolve().then(()=>(ri(),ti)),{values:$,positionals:T}=He({args:u,allowPositionals:!0,strict:!0,options:{file:{type:"string"},stdin:{type:"boolean"},lock:{type:"string"},project:{type:"string"},format:{type:"string"}}});if(i=$.format??i,!["json","jsonl","table"].includes(i)||T.length)throw new m("cave_usage","Use manifests validate|push --file BUNDLE [--lock LOCK].",2);let F=v(await Et($.file,$.stdin));if(d==="validate")return X({schema_version:1,ok:!0,resources:F.resources.map(M=>M.name),validation:"json_schema",models_invoked:0},i),0;if(!$.lock)throw new m("cave_usage","Multi-resource push needs --lock FILE to preserve partial receipts.",2);let A;try{A=JSON.parse(await Gs($.lock,"utf8"))}catch(M){if(M.code!=="ENOENT")throw new m("cave_lock_invalid","Lock must be valid JSON.",2)}let V=await p({projectId:$.project}),S=await x(new ae(V),F,{lock:A,onReceipt:async M=>{let{rename:ve}=await import("node:fs/promises"),{randomUUID:dt}=await import("node:crypto"),xe=$.lock+"."+dt()+".tmp";await Tt(xe,JSON.stringify(M,null,2)+`
|
|
45
|
+
`,{mode:384,flag:"wx"}),await ve(xe,$.lock)}});return X(S,i),S.exit_code}if(c==="prompts"&&["validate","pull","diff","push","versions"].includes(d)){let{validatePromptManifest:v,pullPromptManifest:x,pushPromptManifest:$}=await Promise.resolve().then(()=>(Ed(),Td)),{manifestDiff:T}=await Promise.resolve().then(()=>(ri(),ti)),{values:F,positionals:A}=He({args:u,allowPositionals:!0,strict:!0,options:{file:{type:"string"},stdin:{type:"boolean"},out:{type:"string"},project:{type:"string"},format:{type:"string"},version:{type:"string"}}});if(i=F.format??i,!["json","jsonl","table"].includes(i))throw new m("cave_usage","Format must be json, jsonl, or table.",2);if(F.version!==void 0&&(!Number.isSafeInteger(Number(F.version))||Number(F.version)<1))throw new m("cave_usage","--version must be a positive integer.",2);let V=["validate","diff","push"].includes(d)?v(await Et(F.file,F.stdin)):void 0,S;if(d==="validate")S={schema_version:1,ok:!0,validation:"json_schema",kind:"prompts"};else{let M=new ae(await p({projectId:F.project}));if(["pull","versions"].includes(d)){if(A.length!==1)throw new m("cave_usage","Supply one prompt ID.",2);S=d==="pull"?await x(M,A[0],F.version===void 0?void 0:Number(F.version)):(await M.execute("prompts.get",{prompt_id:A[0]})).data.versions}else if(d==="diff"){let ve=V.resource?await x(M,V.resource.id):void 0;S={schema_version:1,ok:!0,version:ve?.resource.version??null,revision_conflict:!!ve&&ve.resource.version!==V.resource.version,changes:T(ve,V)}}else S=await $(M,V)}return F.out&&await Tt(F.out,JSON.stringify(S,null,2)+`
|
|
46
|
+
`,{flag:"wx",mode:384}),X(S,i),S.revision_conflict?4:0}if(["datasets","evaluators","evals","scenarios"].includes(c)&&["validate","pull","diff","push","versions"].includes(d)){let{validateManifest:v,pullManifest:x,manifestDiff:$,pushManifest:T,parseRows:F}=await Promise.resolve().then(()=>(ri(),ti)),{values:A,positionals:V}=He({args:u,allowPositionals:!0,strict:!0,options:{file:{type:"string"},stdin:{type:"boolean"},out:{type:"string"},project:{type:"string"},format:{type:"string"},...c==="scenarios"?{version:{type:"string"}}:{},...c==="datasets"?{rows:{type:"string"},"rows-out":{type:"string"}}:{},"idempotency-key":{type:"string"}}});if(i=A.format??i,!["json","jsonl","table"].includes(i))throw new m("cave_usage","Format must be json, jsonl, or table.",2);if(A["rows-out"]&&d!=="pull")throw new m("cave_usage","--rows-out requires datasets pull.",2);let S,M=["validate","diff","push"].includes(d)?await Et(A.file,A.stdin):void 0;if(A.rows){if(!M?.spec?.document||M.spec.document.rows?.length)throw new m("cave_usage","--rows requires a dataset manifest with empty document.rows.",2);M.spec.document.rows=F(await Gs(A.rows,"utf8"))}if(M&&(M=v(M,c)),d==="validate")S={schema_version:1,ok:!0,status:"completed",validation:"json_schema",kind:c,limitations:["Server checks resource references and domain constraints when applying. No write or model call performed."]};else{let ve=await p({projectId:A.project}),dt=new ae({...ve,projectId:A.project??ve.projectId});if(d==="pull"||d==="versions"){if(V.length!==1)throw new m("cave_usage",`${c} ${d} requires one resource ID.`,2);if(d==="pull")S=await x(dt,c,V[0],Number(A.version??1));else{let xe=Te(`${c==="scenarios"?"datasets":c}.get`);S=(await dt.execute(xe.id,{[Object.values(xe.binding.path_inputs)[0]]:V[0]})).data.versions}}else if(d==="diff"){let xe=M.resource?await x(dt,c,M.resource.id,M.resource.version):void 0;S={schema_version:1,ok:!0,status:"completed",revision:xe?.resource.revision??null,revision_conflict:!!xe&&xe.resource.revision!==M.resource.revision,changes:$(xe,M)}}else S=await T(dt,M,{idempotencyKey:A["idempotency-key"]})}if(A["rows-out"]){if(d!=="pull")throw new m("cave_usage","--rows-out requires datasets pull.",2);await Tt(A["rows-out"],S.spec.document.rows.map(ve=>JSON.stringify(ve)).join(`
|
|
47
|
+
`)+`
|
|
48
|
+
`,{flag:"wx",mode:384}),S.spec.document.rows=[]}return A.out&&await Tt(A.out,JSON.stringify(S,null,2)+`
|
|
49
|
+
`,{flag:"wx",mode:384}),X(S,i),S.revision_conflict?4:0}if(c==="experiments"&&d==="wait"){let{values:v,positionals:x}=He({args:u,allowPositionals:!0,strict:!0,options:{format:{type:"string"},project:{type:"string"},timeout:{type:"string"},"wait-timeout":{type:"string"}}});if(i=v.format??i,!["json","jsonl","table"].includes(i))throw new m("cave_usage","Format must be json, jsonl, or table.",2);if(x.length!==1)throw new m("cave_usage","Use experiments wait EXPERIMENT_ID [--wait-timeout MS].",2);let $=Number(v["wait-timeout"]??36e5);if(!Number.isSafeInteger($)||$<1||$>864e5)throw new m("cave_usage","--wait-timeout must be 1-86400000 ms; --timeout bounds each request.",2);be("experiments.get",{experiment_id:x[0]});let T=await p({projectId:v.project}),A=await new ae({...T,projectId:v.project??T.projectId,timeout:Number(v.timeout??3e4)}).waitExperiment(x[0],{deadline:Date.now()+$});X(A,i);let{state:V}=A.data;return["completed","passed"].includes(V)?A.data.results_json?.status==="refused"?5:0:6}let f=c==="tools",y=["evals","runs","scenario-runs"].includes(c)&&d==="wait",l=c==="runs"&&y,_=c==="scenario-runs"&&y,g=d==="show"&&["traces","experiments"].includes(c)?"get":d,b=f?void 0:Te(y?l?"runs.get":_?"scenario-runs.get":"evals.result":`${c}.${g}`),k=b?.input_schema.properties??{},q={format:{type:"string"},file:{type:"string"},stdin:{type:"boolean"},project:{type:"string"},timeout:{type:"string"},"idempotency-key":{type:"string"},out:{type:"string"},help:{type:"boolean"},remote:{type:"boolean"}};b?.async_kind&&(q.wait={type:"boolean"}),(y||b?.async_kind)&&(q["wait-timeout"]={type:"string"}),l&&(q.after={type:"string"}),b?.id==="traces.search"&&(q.limit={type:"string"}),b?.id==="autoclimb.exclude"&&(q.model={type:"string"}),c==="traces"&&d==="show"&&(q.spans={type:"boolean"});for(let[v,x]of Object.entries(k))v.replaceAll("_","-")in q||(q[v.replaceAll("_","-")]={type:x.type==="boolean"?"boolean":"string"});let{values:j,positionals:P}=He({args:u,options:q,allowPositionals:!0,strict:!0});if(i=j.format??i,!["json","jsonl","table"].includes(i))throw new m("cave_usage","Format must be json, jsonl, or table.",2);if(f){if(d==="list"){let x=j.remote?(await new ae({...await p(),timeout:Number(j.timeout??3e4)}).discover()).operations:[...ai,...si.filter($=>!ai.some(T=>T.id===$)).map(Ms)];return X(x.map(({id:$,version:T,summary:F,access:A})=>({id:$,version:T,summary:F,access:A})),i),0}if(!["describe","schema"].includes(d)||P.length!==1)throw new m("cave_usage","Use tools list or tools describe|schema OPERATION.",2);let v=Ms(P[0]);return X(d==="schema"?v.input_schema:v,i),0}if(j.help)return X(b,i),0;let D=await Et(j.file,j.stdin);if(!D||typeof D!="object"||Array.isArray(D))throw new m("cave_usage","Input must be a JSON object.",2);for(let[v,x]of Object.entries(k)){let $=v.replaceAll("_","-");if(j[$]===void 0)continue;if(Object.hasOwn(D,v))throw new m("cave_usage",`Input supplies ${v} twice.`,2);let T=j[$];D[v]=x.type==="object"||x.type==="array"?JSON.parse(T):x.type==="integer"||x.type==="number"?Number(T):T}if(b.id==="autoclimb.exclude"&&j.model!==void 0){if(D.candidate_model!==void 0)throw new m("cave_usage","Use either --model or --candidate-model.",2);D.candidate_model=j.model}if(b.id==="traces.search"&&j.limit!==void 0){if(D.page_size!==void 0)throw new m("cave_usage","Use either --limit or --page-size.",2);D.page_size=Number(j.limit)}if(c==="projects"&&["get","update"].includes(d)&&P.length){if(j.project!==void 0)throw new m("cave_usage","Supply the project once: positional ID or --project.",2);j.project=P.shift()}let le=b.binding.legacy?Object.keys(k.parameters?.properties??{}):[...Object.values(b.binding.path_inputs??{}),...(b.binding.query_inputs??[]).filter(v=>v.endsWith("_id"))];if(P.length>le.length)throw new m("cave_usage","Too many positional identifiers; inspect tools describe.",2);if(P.length){let v=b.binding.legacy?D.parameters??={}:D;for(let[x,$]of P.entries()){if(v[le[x]]!==void 0)throw new m("cave_usage","Duplicate resource identifier.",2);v[le[x]]=$}}be(b.id,D);let pt=await p({projectId:j.project}),ye=new ae({...pt,projectId:j.project??pt.projectId,timeout:Number(j.timeout??3e4)}),W;if(y||j.wait){let v=Number(j["wait-timeout"]??36e5);if(!Number.isSafeInteger(v)||v<1||v>864e5)throw new m("cave_usage","--wait-timeout must be 1-86400000 ms; --timeout bounds each request.",2);let x=Date.now()+v,$=new AbortController,T=()=>$.abort();process.once("SIGINT",T);try{let F=y?void 0:await ye.execute(b.id,D,{idempotencyKey:j["idempotency-key"],signal:$.signal}),A=l||b.async_kind==="agent"?"runs":_||b.async_kind==="simulation"?"scenario-runs":"evals",V=F?A==="evals"?F.data.run.id:F.data.id:D.run_id;a={run_id:V,...A==="evals"?{workbench_id:D.workbench_id}:{},project_id:ye.projectId,argv:["caveman","cloud",A,"wait",...A==="evals"?[D.workbench_id]:[],V,"--project",ye.projectId,...s?["--profile",s]:[]]},A==="runs"?W=await ye.waitRun(V,{signal:$.signal,deadline:x,after:Number(j.after??0),onEvent:i==="jsonl"?S=>X({schema_version:1,operation:"runs.events",event:S},"jsonl"):void 0,onProgress:i==="table"?S=>process.stderr.write(`${S.status}
|
|
50
|
+
`):void 0}):A==="scenario-runs"?W=await ye.waitScenario(V,{signal:$.signal,deadline:x}):W=await ye.waitEvaluation(D.workbench_id,V,{signal:$.signal,deadline:x,onProgress:i==="table"?S=>process.stderr.write(`${S.status}: ${S.completed}/${S.total}
|
|
51
|
+
`):void 0})}finally{process.removeListener("SIGINT",T)}}else W=await ye.execute(b.id,D,{idempotencyKey:j["idempotency-key"]});if(j.spans&&(W={trace:W,spans:await ye.execute("traces.spans",D)}),j.out&&await Tt(j.out,JSON.stringify(W,null,2)+`
|
|
52
|
+
`,{flag:"wx",mode:384}),X(W,i),_||j.wait&&b.async_kind==="simulation")return{passed:0,failed:5,incomplete:6}[yd(W.data)];if(l||j.wait&&b.async_kind==="agent")return W.operation==="runs.get"?6:0;let Ke=["evals.compare","scenarios.compare"].includes(b.id)?W.data.quality:y||j.wait?W.data.quality?.status:void 0;return Ke==="passed"||Ke===void 0&&!(y||j.wait)?0:Ke==="failed"?5:6}catch(s){let n=s instanceof m?s:new m("cave_usage",s.message??"Command failed.",2);return X({schema_version:1,ok:!1,status:"failed",error:{code:n.code,message:n.message,...n.details?{details:n.details}:{}},...a?{reconnect:a}:{}},i),n.exitCode}}var Sd,Ld,ni,St,ai,si,Ts,m,Cf,ae,ot,zt=Ze(()=>{Sd=Fs(Kp(),1),Ld=Fs(ud(),1);ld();md();ni=new Sd.default({strict:!1,allErrors:!0});(0,Ld.default)(ni);St=new Map,ai=As.operations,si=["auth.login","auth.status","context.show","context.list","context.save","context.use","context.set","context.bind","doctor","tools.list","tools.describe","tools.schema","traces.transcript","datasets.from-traces","scenarios.from-trace","targets.list","targets.get","targets.validate","manifests.validate","manifests.push",...["datasets","evaluators","evals","scenarios","prompts"].flatMap(e=>["validate","pull","diff","push","versions"].map(t=>e+"."+t)),"evals.wait","runs.wait","scenario-runs.wait","experiments.wait"],Ts=As.contract_sha256,m=class extends Error{constructor(t,r,i=1,a){super(r),this.code=t,this.exitCode=i,this.details=a}};Cf=e=>e===401||e===403?3:e===409?4:e===429?7:e===422||e===400?2:1,ae=class{constructor({baseURL:t,token:r,projectId:i,fetch:a=globalThis.fetch,timeout:s=3e4,allowPlainHTTP:n=!1}){let o=new URL(t);if(o.protocol!=="https:"&&!(o.protocol==="http:"&&(n===!0||["localhost","127.0.0.1","[::1]"].includes(o.hostname))))throw new m("cave_endpoint_invalid","Cloud endpoint must use HTTPS or loopback HTTP.",2);if(o.username||o.password||o.search||o.hash)throw new m("cave_endpoint_invalid","Cloud endpoint cannot contain credentials, query, or fragment.",2);if(!Number.isInteger(s)||s<100||s>12e4)throw new m("cave_timeout_invalid","Timeout must be 100-120000 ms.",2);this.baseURL=t.replace(/\/$/,""),this.token=r,this.projectId=i,this.fetch=a,this.timeout=s}async request(t,{body:r,headers:i={},signal:a}={}){if(!this.token)throw new m("cave_auth_required","Run caveman login or set CAVE_TOKEN for headless use.",3);let s=a?AbortSignal.any([a,AbortSignal.timeout(this.timeout)]):AbortSignal.timeout(this.timeout),n;try{n=await this.fetch(this.baseURL+t,{method:r===void 0?"GET":"POST",redirect:"error",signal:s,headers:{authorization:`Bearer ${this.token}`,...r===void 0?{}:{"content-type":"application/json"},...i},...r===void 0?{}:{body:JSON.stringify(r)}})}catch{throw new m(s.aborted?"cave_timeout":"cave_network_error",s.aborted?"Request timed out or wait was interrupted; remote work may continue.":"Cloud request failed. Inspect resource state; receipted writes can retry with the same idempotency key.",s.aborted?6:1)}if(Number(n.headers.get("content-length"))>16*1024*1024)throw new m("cave_result_too_large","Result exceeds 16 MiB; narrow the query.",6);let o=n.body?.getReader(),p=0,c=[];if(o)try{for(;;){let{done:u,value:f}=await o.read();if(u)break;if(p+=f.byteLength,p>16*1024*1024)throw await o.cancel(),new m("cave_result_too_large","Result exceeds 16 MiB; narrow the query.",6);c.push(f)}}finally{o.releaseLock()}let d;try{d=JSON.parse(Buffer.concat(c).toString("utf8"))}catch{throw new m("cave_invalid_response","Cloud returned an invalid JSON response.",6)}if(!n.ok){let u=d.error?.error??d.error??d,f=Number(n.headers.get("retry-after")),y=new m(u.code??"cave_request_failed",u.message??`Cloud request failed (${n.status}).`,Cf(n.status),f>0?{...d,retry_after_seconds:f}:d);throw y.httpStatus=n.status,y}return d}async discover(){return this.request("/api/v1/cloud/operations")}async waitScenario(t,{signal:r,deadline:i=Date.now()+36e5,pollMs:a=1e3}={}){if(!Number.isSafeInteger(i)||!Number.isSafeInteger(a)||a<1||a>3e4)throw new m("cave_usage","Invalid wait deadline or polling interval.",2);for(;Date.now()<i;){let s=await this.execute("scenario-runs.get",{run_id:t},{signal:r});if(s.data.id!==t)throw new m("cave_invalid_response","Run identity changed.",6);if(["completed","cancelled","interrupted","error"].includes(s.data.status))return s;if(!["queued","running"].includes(s.data.status))throw new m("cave_invalid_response","Unknown scenario run status.",6);try{await ii(Math.min(a,Math.max(1,i-Date.now())),void 0,{signal:r})}catch{throw new m("cave_wait_interrupted","Wait interrupted; durable run continues. Reconnect with scenario-runs wait.",6)}}throw new m("cave_wait_timeout","Wait expired; durable run continues. Reconnect with scenario-runs wait.",6)}async waitExperiment(t,{signal:r,deadline:i=Date.now()+36e5,pollMs:a=2e3}={}){if(!Number.isSafeInteger(i)||!Number.isSafeInteger(a)||a<1||a>3e4)throw new m("cave_usage","Invalid wait deadline or polling interval.",2);for(;Date.now()<i;){let s=await this.execute("experiments.get",{experiment_id:t},{signal:r});if(s.data.id!==t)throw new m("cave_invalid_response","Experiment identity changed.",6);if(["completed","passed","failed","error","cancelled","rolled_back"].includes(s.data.state))return s;try{await ii(Math.min(a,Math.max(1,i-Date.now())),void 0,{signal:r})}catch{throw new m("cave_wait_interrupted","Wait interrupted; the experiment continues. Reconnect with experiments wait.",7)}}throw new m("cave_wait_timeout","Wait expired; the experiment continues. Reconnect with experiments wait.",7)}async waitEvaluation(t,r,{signal:i,deadline:a=Date.now()+36e5,pollMs:s=1e3,onProgress:n}={}){if(!Number.isSafeInteger(a)||!Number.isSafeInteger(s)||s<1||s>3e4)throw new m("cave_usage","Invalid wait deadline or polling interval.",2);for(;Date.now()<a;){let o=await this.execute("evals.result",{workbench_id:t,run_id:r},{signal:i}),p=o.data.run;if(p?.id!==r||p?.workbench_id!==t)throw new m("cave_invalid_response","Evaluation run identity changed.",6);if(["completed","failed","error","cancelled"].includes(p?.status))return o;if(!["queued","running","cancelling"].includes(p?.status))throw new m("cave_invalid_response","Unknown evaluation run status.",6);n?.({run_id:r,status:p.status,completed:p.progress_completed,total:p.progress_total});try{await ii(Math.min(s,Math.max(1,a-Date.now())),void 0,{signal:i})}catch{throw new m("cave_wait_interrupted","Wait interrupted; durable run continues. Reconnect with evals wait.",6)}}throw new m("cave_wait_timeout","Wait expired; durable run continues. Reconnect with evals wait.",6)}async waitRun(t,{signal:r,deadline:i=Date.now()+36e5,pollMs:a=1e3,after:s=0,onEvent:n,onProgress:o}={}){if(!Number.isSafeInteger(i)||!Number.isSafeInteger(s)||s<0||!Number.isSafeInteger(a)||a<1||a>3e4)throw new m("cave_usage","Invalid event cursor or polling interval.",2);for(;Date.now()<i;){let p=await this.execute("runs.get",{run_id:t},{signal:r});if(p.data.id!==t)throw new m("cave_invalid_response","Run identity changed.",6);if(n){let c=["completed","incomplete","cancelled","stale"].includes(p.data.status);for(;;){let d=await this.execute("runs.events",{run_id:t,after:s},{signal:r});if(!Array.isArray(d.data.data)||!Number.isSafeInteger(d.data.next_cursor)||d.data.next_cursor<s)throw new m("cave_invalid_response","Invalid event cursor.",6);for(let u of d.data.data){if(!Number.isSafeInteger(u.sequence)||u.sequence<=s)throw new m("cave_invalid_response","Invalid event sequence.",6);n(u),s=u.sequence}if(d.data.next_cursor!==s)throw new m("cave_invalid_response","Event cursor does not match returned events.",6);if(!c||d.data.data.length===0)break;if(Date.now()>=i)throw new m("cave_wait_timeout","Wait expired; durable run continues. Reconnect with runs wait.",6)}}if(p.data.status==="completed"){let c=await this.execute("runs.result",{run_id:t},{signal:r});if(c.data.run_id!==t||c.data.result_ref!==p.data.result_ref)throw new m("cave_invalid_response","Result identity changed.",6);return c}if(["incomplete","cancelled","stale"].includes(p.data.status))return p;if(!["queued","running"].includes(p.data.status))throw new m("cave_invalid_response","Unknown run status.",6);o?.({run_id:t,status:p.data.status});try{await ii(Math.min(a,Math.max(1,i-Date.now())),void 0,{signal:r})}catch{throw new m("cave_wait_interrupted","Wait interrupted; durable run continues. Reconnect with runs wait.",6)}}throw new m("cave_wait_timeout","Wait expired; durable run continues. Reconnect with runs wait.",6)}async execute(t,r={},i={}){let a=Te(t);if(be(a.id,r),a.scope==="project"&&(!this.projectId||!/^[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}$/i.test(this.projectId)))throw new m("cave_project_required","Select a project with --project or saved context. Ambiguous project selection is not allowed.",2);if(a.transactional&&!i.idempotencyKey)throw new m("cave_idempotency_key_required","This write needs --idempotency-key; reuse it only for identical retries.",2);let s=await this.request(`/api/v1${a.scope==="project"?"/projects/"+this.projectId:""}/cloud/operations/${encodeURIComponent(a.id)}`,{body:r,headers:{"x-cave-operation-contract":a.contract_sha256,...i.idempotencyKey?{"idempotency-key":i.idempotencyKey}:{}},signal:i.signal});if(s.schema_version!==1||s.operation!==a.id||s.version!==a.version||s.contract_sha256!==a.contract_sha256||s.ok!==!0||!["completed","accepted"].includes(s.status))throw new m("cave_invalid_response","Cloud returned a mismatched operation result.",6);let n=a.id+":output";if(St.has(n)||St.set(n,ni.compile(a.output_schema)),!St.get(n)(s.data))throw new m("cave_invalid_response","Cloud result does not match its operation schema.",6);return s}};ot=(e,t)=>JSON.stringify(e,null,t).replace(/[\x7f-\x9f\p{Cf}\u2028\u2029]/gu,r=>r.split("").map(i=>"\\u"+i.charCodeAt(0).toString(16).padStart(4,"0")).join(""))});zt();export{ae as CloudClient,m as CloudError,Ts as contractSHA256,Ms as describeCommand,Te as describeOperation,ot as inertJSON,si as localCommands,ai as operations,Gb as runCloudCLI,be as validateOperation};
|