@caveman-ai/cli 1.3.3 → 1.3.4
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/README.md +10 -1
- package/dist/agent-skills.generated.js +1 -1
- package/dist/agents.generated.js +1 -1
- package/dist/binaries.generated.js +1 -1
- package/dist/caveman-pi-extension.mjs +286 -104
- package/dist/cloud-client.mjs +22 -0
- package/dist/cloud-mcp.mjs +75 -0
- package/dist/index.js +455 -195
- package/dist/native-hook-fast.js +2 -2
- package/dist/openclaw-provider-compat.js +111 -0
- package/dist/provider-routing.js +140 -0
- package/dist/stats-cli.js +105 -0
- package/dist/surface.json +299 -0
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createRequire as __cloudRequire } from "node:module"; const require = __cloudRequire(import.meta.url);
|
|
2
|
+
var Jp=Object.create;var Br=Object.defineProperty;var Wp=Object.getOwnPropertyDescriptor;var Yp=Object.getOwnPropertyNames;var Qp=Object.getPrototypeOf,Xp=Object.prototype.hasOwnProperty;var qt=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(i){throw r=[i],i}};var b=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},Jr=(t,e)=>{for(var r in e)Br(t,r,{get:e[r],enumerable:!0})},ed=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Yp(e))!Xp.call(t,a)&&a!==r&&Br(t,a,{get:()=>e[a],enumerable:!(i=Wp(e,a))||i.enumerable});return t};var js=(t,e,r)=>(r=t!=null?Jp(Qp(t)):{},ed(e||!t||!t.__esModule?Br(r,"default",{value:t,enumerable:!0}):r,t));var xt=b(R=>{"use strict";Object.defineProperty(R,"__esModule",{value:!0});R.regexpCode=R.getEsmExportName=R.getProperty=R.safeStringify=R.stringify=R.strConcat=R.addCodeArg=R.str=R._=R.nil=R._Code=R.Name=R.IDENTIFIER=R._CodeOrName=void 0;var kt=class{};R._CodeOrName=kt;R.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var De=class extends kt{constructor(e){if(super(),!R.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};R.Name=De;var de=class extends kt{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,i)=>`${r}${i}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,i)=>(i instanceof De&&(r[i.str]=(r[i.str]||0)+1),r),{})}};R._Code=de;R.nil=new de("");function ws(t,...e){let r=[t[0]],i=0;for(;i<e.length;)Yr(r,e[i]),r.push(t[++i]);return new de(r)}R._=ws;var Wr=new de("+");function Ps(t,...e){let r=[$t(t[0])],i=0;for(;i<e.length;)r.push(Wr),Yr(r,e[i]),r.push(Wr,$t(t[++i]));return td(r),new de(r)}R.str=Ps;function Yr(t,e){e instanceof de?t.push(...e._items):e instanceof De?t.push(e):t.push(ad(e))}R.addCodeArg=Yr;function td(t){let e=1;for(;e<t.length-1;){if(t[e]===Wr){let r=rd(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function rd(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof De||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof De))return`"${t}${e.slice(1)}`}function id(t,e){return e.emptyStr()?t:t.emptyStr()?e:Ps`${t}${e}`}R.strConcat=id;function ad(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:$t(Array.isArray(t)?t.join(","):t)}function sd(t){return new de($t(t))}R.stringify=sd;function $t(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}R.safeStringify=$t;function nd(t){return typeof t=="string"&&R.IDENTIFIER.test(t)?new de(`.${t}`):ws`[${t}]`}R.getProperty=nd;function od(t){if(typeof t=="string"&&R.IDENTIFIER.test(t))return new de(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}R.getEsmExportName=od;function pd(t){return new de(t.toString())}R.regexpCode=pd});var ei=b(se=>{"use strict";Object.defineProperty(se,"__esModule",{value:!0});se.ValueScope=se.ValueScopeName=se.Scope=se.varKinds=se.UsedValueState=void 0;var ae=xt(),Qr=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},or;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(or||(se.UsedValueState=or={}));se.varKinds={const:new ae.Name("const"),let:new ae.Name("let"),var:new ae.Name("var")};var pr=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof ae.Name?e:this.name(e)}name(e){return new ae.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,i;if(!((i=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||i===void 0)&&i.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};se.Scope=pr;var dr=class extends ae.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:i}){this.value=e,this.scopePath=(0,ae._)`.${new ae.Name(r)}[${i}]`}};se.ValueScopeName=dr;var dd=(0,ae._)`\n`,Xr=class extends pr{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?dd:ae.nil}}get(){return this._scope}name(e){return new dr(e,this._newName(e))}value(e,r){var i;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let a=this.toName(e),{prefix:s}=a,n=(i=r.key)!==null&&i!==void 0?i:r.ref,o=this._values[s];if(o){let c=o.get(n);if(c)return c}else o=this._values[s]=new Map;o.set(n,a);let p=this._scope[s]||(this._scope[s]=[]),d=p.length;return p[d]=r.ref,a.setValue(r,{property:s,itemIndex:d}),a}getValue(e,r){let i=this._values[e];if(i)return i.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,i=>{if(i.scopePath===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return(0,ae._)`${e}${i.scopePath}`})}scopeCode(e=this._values,r,i){return this._reduceValues(e,a=>{if(a.value===void 0)throw new Error(`CodeGen: name "${a}" has no value`);return a.value.code},r,i)}_reduceValues(e,r,i={},a){let s=ae.nil;for(let n in e){let o=e[n];if(!o)continue;let p=i[n]=i[n]||new Map;o.forEach(d=>{if(p.has(d))return;p.set(d,or.Started);let c=r(d);if(c){let u=this.opts.es5?se.varKinds.var:se.varKinds.const;s=(0,ae._)`${s}${u} ${d} = ${c};${this.opts._n}`}else if(c=a?.(d))s=(0,ae._)`${s}${c}${this.opts._n}`;else throw new Qr(d);p.set(d,or.Completed)})}return s}};se.ValueScope=Xr});var k=b(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.or=O.and=O.not=O.CodeGen=O.operators=O.varKinds=O.ValueScopeName=O.ValueScope=O.Scope=O.Name=O.regexpCode=O.stringify=O.getProperty=O.nil=O.strConcat=O.str=O._=void 0;var T=xt(),_e=ei(),Ae=xt();Object.defineProperty(O,"_",{enumerable:!0,get:function(){return Ae._}});Object.defineProperty(O,"str",{enumerable:!0,get:function(){return Ae.str}});Object.defineProperty(O,"strConcat",{enumerable:!0,get:function(){return Ae.strConcat}});Object.defineProperty(O,"nil",{enumerable:!0,get:function(){return Ae.nil}});Object.defineProperty(O,"getProperty",{enumerable:!0,get:function(){return Ae.getProperty}});Object.defineProperty(O,"stringify",{enumerable:!0,get:function(){return Ae.stringify}});Object.defineProperty(O,"regexpCode",{enumerable:!0,get:function(){return Ae.regexpCode}});Object.defineProperty(O,"Name",{enumerable:!0,get:function(){return Ae.Name}});var yr=ei();Object.defineProperty(O,"Scope",{enumerable:!0,get:function(){return yr.Scope}});Object.defineProperty(O,"ValueScope",{enumerable:!0,get:function(){return yr.ValueScope}});Object.defineProperty(O,"ValueScopeName",{enumerable:!0,get:function(){return yr.ValueScopeName}});Object.defineProperty(O,"varKinds",{enumerable:!0,get:function(){return yr.varKinds}});O.operators={GT:new T._Code(">"),GTE:new T._Code(">="),LT:new T._Code("<"),LTE:new T._Code("<="),EQ:new T._Code("==="),NEQ:new T._Code("!=="),NOT:new T._Code("!"),OR:new T._Code("||"),AND:new T._Code("&&"),ADD:new T._Code("+")};var xe=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},ti=class extends xe{constructor(e,r,i){super(),this.varKind=e,this.name=r,this.rhs=i}render({es5:e,_n:r}){let i=e?_e.varKinds.var:this.varKind,a=this.rhs===void 0?"":` = ${this.rhs}`;return`${i} ${this.name}${a};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=rt(this.rhs,e,r)),this}get names(){return this.rhs instanceof T._CodeOrName?this.rhs.names:{}}},cr=class extends xe{constructor(e,r,i){super(),this.lhs=e,this.rhs=r,this.sideEffects=i}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof T.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=rt(this.rhs,e,r),this}get names(){let e=this.lhs instanceof T.Name?{}:{...this.lhs.names};return lr(e,this.rhs)}},ri=class extends cr{constructor(e,r,i,a){super(e,i,a),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},ii=class extends xe{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},ai=class extends xe{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},si=class extends xe{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},ni=class extends xe{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=rt(this.code,e,r),this}get names(){return this.code instanceof T._CodeOrName?this.code.names:{}}},zt=class extends xe{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,i)=>r+i.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let i=e[r].optimizeNodes();Array.isArray(i)?e.splice(r,1,...i):i?e[r]=i:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:i}=this,a=i.length;for(;a--;){let s=i[a];s.optimizeNames(e,r)||(cd(e,s.names),i.splice(a,1))}return i.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Ve(e,r.names),{})}},ze=class extends zt{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},oi=class extends zt{},tt=class extends ze{};tt.kind="else";var Ge=class t extends ze{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let i=r.optimizeNodes();r=this.else=Array.isArray(i)?new tt(i):i}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(qs(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var i;if(this.else=(i=this.else)===null||i===void 0?void 0:i.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=rt(this.condition,e,r),this}get names(){let e=super.names;return lr(e,this.condition),this.else&&Ve(e,this.else.names),e}};Ge.kind="if";var Ue=class extends ze{};Ue.kind="for";var pi=class extends Ue{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=rt(this.iteration,e,r),this}get names(){return Ve(super.names,this.iteration.names)}},di=class extends Ue{constructor(e,r,i,a){super(),this.varKind=e,this.name=r,this.from=i,this.to=a}render(e){let r=e.es5?_e.varKinds.var:this.varKind,{name:i,from:a,to:s}=this;return`for(${r} ${i}=${a}; ${i}<${s}; ${i}++)`+super.render(e)}get names(){let e=lr(super.names,this.from);return lr(e,this.to)}},ur=class extends Ue{constructor(e,r,i,a){super(),this.loop=e,this.varKind=r,this.name=i,this.iterable=a}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=rt(this.iterable,e,r),this}get names(){return Ve(super.names,this.iterable.names)}},Ot=class extends ze{constructor(e,r,i){super(),this.name=e,this.args=r,this.async=i}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Ot.kind="func";var At=class extends zt{render(e){return"return "+super.render(e)}};At.kind="return";var ci=class extends ze{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var i,a;return super.optimizeNames(e,r),(i=this.catch)===null||i===void 0||i.optimizeNames(e,r),(a=this.finally)===null||a===void 0||a.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&Ve(e,this.catch.names),this.finally&&Ve(e,this.finally.names),e}},It=class extends ze{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};It.kind="catch";var Et=class extends ze{render(e){return"finally"+super.render(e)}};Et.kind="finally";var ui=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
3
|
+
`:""},this._extScope=e,this._scope=new _e.Scope({parent:e}),this._nodes=[new oi]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let i=this._extScope.value(e,r);return(this._values[i.prefix]||(this._values[i.prefix]=new Set)).add(i),i}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,i,a){let s=this._scope.toName(r);return i!==void 0&&a&&(this._constants[s.str]=i),this._leafNode(new ti(e,s,i)),s}const(e,r,i){return this._def(_e.varKinds.const,e,r,i)}let(e,r,i){return this._def(_e.varKinds.let,e,r,i)}var(e,r,i){return this._def(_e.varKinds.var,e,r,i)}assign(e,r,i){return this._leafNode(new cr(e,r,i))}add(e,r){return this._leafNode(new ri(e,O.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==T.nil&&this._leafNode(new ni(e)),this}object(...e){let r=["{"];for(let[i,a]of e)r.length>1&&r.push(","),r.push(i),(i!==a||this.opts.es5)&&(r.push(":"),(0,T.addCodeArg)(r,a));return r.push("}"),new T._Code(r)}if(e,r,i){if(this._blockNode(new Ge(e)),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(e){return this._elseNode(new Ge(e))}else(){return this._elseNode(new tt)}endIf(){return this._endBlockNode(Ge,tt)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new pi(e),r)}forRange(e,r,i,a,s=this.opts.es5?_e.varKinds.var:_e.varKinds.let){let n=this._scope.toName(e);return this._for(new di(s,n,r,i),()=>a(n))}forOf(e,r,i,a=_e.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let n=r instanceof T.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,T._)`${n}.length`,o=>{this.var(s,(0,T._)`${n}[${o}]`),i(s)})}return this._for(new ur("of",a,s,r),()=>i(s))}forIn(e,r,i,a=this.opts.es5?_e.varKinds.var:_e.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,T._)`Object.keys(${r})`,i);let s=this._scope.toName(e);return this._for(new ur("in",a,s,r),()=>i(s))}endFor(){return this._endBlockNode(Ue)}label(e){return this._leafNode(new ii(e))}break(e){return this._leafNode(new ai(e))}return(e){let r=new At;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(At)}try(e,r,i){if(!r&&!i)throw new Error('CodeGen: "try" without "catch" and "finally"');let a=new ci;if(this._blockNode(a),this.code(e),r){let s=this.name("e");this._currNode=a.catch=new It(s),r(s)}return i&&(this._currNode=a.finally=new Et,this.code(i)),this._endBlockNode(It,Et)}throw(e){return this._leafNode(new si(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){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||e!==void 0&&i!==e)throw new Error(`CodeGen: wrong number of nodes: ${i} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=T.nil,i,a){return this._blockNode(new Ot(e,r,i)),a&&this.code(a).endFunc(),this}endFunc(){return this._endBlockNode(Ot)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let i=this._currNode;if(i instanceof e||r&&i instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof Ge))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};O.CodeGen=ui;function Ve(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function lr(t,e){return e instanceof T._CodeOrName?Ve(t,e.names):t}function rt(t,e,r){if(t instanceof T.Name)return i(t);if(!a(t))return t;return new T._Code(t._items.reduce((s,n)=>(n instanceof T.Name&&(n=i(n)),n instanceof T._Code?s.push(...n._items):s.push(n),s),[]));function i(s){let n=r[s.str];return n===void 0||e[s.str]!==1?s:(delete e[s.str],n)}function a(s){return s instanceof T._Code&&s._items.some(n=>n instanceof T.Name&&e[n.str]===1&&r[n.str]!==void 0)}}function cd(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function qs(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,T._)`!${li(t)}`}O.not=qs;var ud=ks(O.operators.AND);function ld(...t){return t.reduce(ud)}O.and=ld;var yd=ks(O.operators.OR);function md(...t){return t.reduce(yd)}O.or=md;function ks(t){return(e,r)=>e===T.nil?r:r===T.nil?e:(0,T._)`${li(e)} ${t} ${li(r)}`}function li(t){return t instanceof T.Name?t:(0,T._)`(${t})`}});var I=b(A=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0});A.checkStrictMode=A.getErrorPath=A.Type=A.useFunc=A.setEvaluated=A.evaluatedPropsToName=A.mergeEvaluated=A.eachItem=A.unescapeJsonPointer=A.escapeJsonPointer=A.escapeFragment=A.unescapeFragment=A.schemaRefOrVal=A.schemaHasRulesButRef=A.schemaHasRules=A.checkUnknownRules=A.alwaysValidSchema=A.toHash=void 0;var M=k(),_d=xt();function gd(t){let e={};for(let r of t)e[r]=!0;return e}A.toHash=gd;function fd(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(zs(t,e),!Os(e,t.self.RULES.all))}A.alwaysValidSchema=fd;function zs(t,e=t.schema){let{opts:r,self:i}=t;if(!r.strictSchema||typeof e=="boolean")return;let a=i.RULES.keywords;for(let s in e)a[s]||Es(t,`unknown keyword: "${s}"`)}A.checkUnknownRules=zs;function Os(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}A.schemaHasRules=Os;function hd(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}A.schemaHasRulesButRef=hd;function bd({topSchemaRef:t,schemaPath:e},r,i,a){if(!a){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,M._)`${r}`}return(0,M._)`${t}${e}${(0,M.getProperty)(i)}`}A.schemaRefOrVal=bd;function vd(t){return As(decodeURIComponent(t))}A.unescapeFragment=vd;function jd(t){return encodeURIComponent(mi(t))}A.escapeFragment=jd;function mi(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}A.escapeJsonPointer=mi;function As(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}A.unescapeJsonPointer=As;function wd(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}A.eachItem=wd;function $s({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:i}){return(a,s,n,o)=>{let p=n===void 0?s:n instanceof M.Name?(s instanceof M.Name?t(a,s,n):e(a,s,n),n):s instanceof M.Name?(e(a,n,s),s):r(s,n);return o===M.Name&&!(p instanceof M.Name)?i(a,p):p}}A.mergeEvaluated={props:$s({mergeNames:(t,e,r)=>t.if((0,M._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,M._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,M._)`${r} || {}`).code((0,M._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,M._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,M._)`${r} || {}`),_i(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:Is}),items:$s({mergeNames:(t,e,r)=>t.if((0,M._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,M._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,M._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,M._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function Is(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,M._)`{}`);return e!==void 0&&_i(t,r,e),r}A.evaluatedPropsToName=Is;function _i(t,e,r){Object.keys(r).forEach(i=>t.assign((0,M._)`${e}${(0,M.getProperty)(i)}`,!0))}A.setEvaluated=_i;var xs={};function Pd(t,e){return t.scopeValue("func",{ref:e,code:xs[e.code]||(xs[e.code]=new _d._Code(e.code))})}A.useFunc=Pd;var yi;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(yi||(A.Type=yi={}));function qd(t,e,r){if(t instanceof M.Name){let i=e===yi.Num;return r?i?(0,M._)`"[" + ${t} + "]"`:(0,M._)`"['" + ${t} + "']"`:i?(0,M._)`"/" + ${t}`:(0,M._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,M.getProperty)(t).toString():"/"+mi(t)}A.getErrorPath=qd;function Es(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}A.checkStrictMode=Es});var ce=b(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});var Y=k(),kd={data:new Y.Name("data"),valCxt:new Y.Name("valCxt"),instancePath:new Y.Name("instancePath"),parentData:new Y.Name("parentData"),parentDataProperty:new Y.Name("parentDataProperty"),rootData:new Y.Name("rootData"),dynamicAnchors:new Y.Name("dynamicAnchors"),vErrors:new Y.Name("vErrors"),errors:new Y.Name("errors"),this:new Y.Name("this"),self:new Y.Name("self"),scope:new Y.Name("scope"),json:new Y.Name("json"),jsonPos:new Y.Name("jsonPos"),jsonLen:new Y.Name("jsonLen"),jsonPart:new Y.Name("jsonPart")};gi.default=kd});var St=b(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.extendErrors=Q.resetErrorsCount=Q.reportExtraError=Q.reportError=Q.keyword$DataError=Q.keywordError=void 0;var N=k(),mr=I(),te=ce();Q.keywordError={message:({keyword:t})=>(0,N.str)`must pass "${t}" keyword validation`};Q.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,N.str)`"${t}" keyword must be ${e} ($data)`:(0,N.str)`"${t}" keyword is invalid ($data)`};function $d(t,e=Q.keywordError,r,i){let{it:a}=t,{gen:s,compositeRule:n,allErrors:o}=a,p=Zs(t,e,r);i??(n||o)?Ss(s,p):Ts(a,(0,N._)`[${p}]`)}Q.reportError=$d;function xd(t,e=Q.keywordError,r){let{it:i}=t,{gen:a,compositeRule:s,allErrors:n}=i,o=Zs(t,e,r);Ss(a,o),s||n||Ts(i,te.default.vErrors)}Q.reportExtraError=xd;function zd(t,e){t.assign(te.default.errors,e),t.if((0,N._)`${te.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,N._)`${te.default.vErrors}.length`,e),()=>t.assign(te.default.vErrors,null)))}Q.resetErrorsCount=zd;function Od({gen:t,keyword:e,schemaValue:r,data:i,errsCount:a,it:s}){if(a===void 0)throw new Error("ajv implementation error");let n=t.name("err");t.forRange("i",a,te.default.errors,o=>{t.const(n,(0,N._)`${te.default.vErrors}[${o}]`),t.if((0,N._)`${n}.instancePath === undefined`,()=>t.assign((0,N._)`${n}.instancePath`,(0,N.strConcat)(te.default.instancePath,s.errorPath))),t.assign((0,N._)`${n}.schemaPath`,(0,N.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,N._)`${n}.schema`,r),t.assign((0,N._)`${n}.data`,i))})}Q.extendErrors=Od;function Ss(t,e){let r=t.const("err",e);t.if((0,N._)`${te.default.vErrors} === null`,()=>t.assign(te.default.vErrors,(0,N._)`[${r}]`),(0,N._)`${te.default.vErrors}.push(${r})`),t.code((0,N._)`${te.default.errors}++`)}function Ts(t,e){let{gen:r,validateName:i,schemaEnv:a}=t;a.$async?r.throw((0,N._)`new ${t.ValidationError}(${e})`):(r.assign((0,N._)`${i}.errors`,e),r.return(!1))}var Fe={keyword:new N.Name("keyword"),schemaPath:new N.Name("schemaPath"),params:new N.Name("params"),propertyName:new N.Name("propertyName"),message:new N.Name("message"),schema:new N.Name("schema"),parentSchema:new N.Name("parentSchema")};function Zs(t,e,r){let{createErrors:i}=t.it;return i===!1?(0,N._)`{}`:Ad(t,e,r)}function Ad(t,e,r={}){let{gen:i,it:a}=t,s=[Id(a,r),Ed(t,r)];return Sd(t,e,s),i.object(...s)}function Id({errorPath:t},{instancePath:e}){let r=e?(0,N.str)`${t}${(0,mr.getErrorPath)(e,mr.Type.Str)}`:t;return[te.default.instancePath,(0,N.strConcat)(te.default.instancePath,r)]}function Ed({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:i}){let a=i?e:(0,N.str)`${e}/${t}`;return r&&(a=(0,N.str)`${a}${(0,mr.getErrorPath)(r,mr.Type.Str)}`),[Fe.schemaPath,a]}function Sd(t,{params:e,message:r},i){let{keyword:a,data:s,schemaValue:n,it:o}=t,{opts:p,propertyName:d,topSchemaRef:c,schemaPath:u}=o;i.push([Fe.keyword,a],[Fe.params,typeof e=="function"?e(t):e||(0,N._)`{}`]),p.messages&&i.push([Fe.message,typeof r=="function"?r(t):r]),p.verbose&&i.push([Fe.schema,n],[Fe.parentSchema,(0,N._)`${c}${u}`],[te.default.data,s]),d&&i.push([Fe.propertyName,d])}});var Rs=b(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.boolOrEmptySchema=it.topBoolOrEmptySchema=void 0;var Td=St(),Zd=k(),Nd=ce(),Rd={message:"boolean schema is false"};function Ld(t){let{gen:e,schema:r,validateName:i}=t;r===!1?Ns(t,!1):typeof r=="object"&&r.$async===!0?e.return(Nd.default.data):(e.assign((0,Zd._)`${i}.errors`,null),e.return(!0))}it.topBoolOrEmptySchema=Ld;function Cd(t,e){let{gen:r,schema:i}=t;i===!1?(r.var(e,!1),Ns(t)):r.var(e,!0)}it.boolOrEmptySchema=Cd;function Ns(t,e){let{gen:r,data:i}=t,a={gen:r,keyword:"false schema",data:i,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,Td.reportError)(a,Rd,void 0,e)}});var fi=b(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.getRules=at.isJSONType=void 0;var Md=["string","number","integer","boolean","null","object","array"],Dd=new Set(Md);function Gd(t){return typeof t=="string"&&Dd.has(t)}at.isJSONType=Gd;function Ud(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}at.getRules=Ud});var hi=b(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.shouldUseRule=Ie.shouldUseGroup=Ie.schemaHasRulesForType=void 0;function Vd({schema:t,self:e},r){let i=e.RULES.types[r];return i&&i!==!0&&Ls(t,i)}Ie.schemaHasRulesForType=Vd;function Ls(t,e){return e.rules.some(r=>Cs(t,r))}Ie.shouldUseGroup=Ls;function Cs(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(i=>t[i]!==void 0))}Ie.shouldUseRule=Cs});var Tt=b(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.reportTypeError=X.checkDataTypes=X.checkDataType=X.coerceAndCheckDataType=X.getJSONTypes=X.getSchemaTypes=X.DataType=void 0;var Fd=fi(),Kd=hi(),Hd=St(),x=k(),Ms=I(),st;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(st||(X.DataType=st={}));function Bd(t){let e=Ds(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}X.getSchemaTypes=Bd;function Ds(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(Fd.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}X.getJSONTypes=Ds;function Jd(t,e){let{gen:r,data:i,opts:a}=t,s=Wd(e,a.coerceTypes),n=e.length>0&&!(s.length===0&&e.length===1&&(0,Kd.schemaHasRulesForType)(t,e[0]));if(n){let o=vi(e,i,a.strictNumbers,st.Wrong);r.if(o,()=>{s.length?Yd(t,e,s):ji(t)})}return n}X.coerceAndCheckDataType=Jd;var Gs=new Set(["string","number","integer","boolean","null"]);function Wd(t,e){return e?t.filter(r=>Gs.has(r)||e==="array"&&r==="array"):[]}function Yd(t,e,r){let{gen:i,data:a,opts:s}=t,n=i.let("dataType",(0,x._)`typeof ${a}`),o=i.let("coerced",(0,x._)`undefined`);s.coerceTypes==="array"&&i.if((0,x._)`${n} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,()=>i.assign(a,(0,x._)`${a}[0]`).assign(n,(0,x._)`typeof ${a}`).if(vi(e,a,s.strictNumbers),()=>i.assign(o,a))),i.if((0,x._)`${o} !== undefined`);for(let d of r)(Gs.has(d)||d==="array"&&s.coerceTypes==="array")&&p(d);i.else(),ji(t),i.endIf(),i.if((0,x._)`${o} !== undefined`,()=>{i.assign(a,o),Qd(t,o)});function p(d){switch(d){case"string":i.elseIf((0,x._)`${n} == "number" || ${n} == "boolean"`).assign(o,(0,x._)`"" + ${a}`).elseIf((0,x._)`${a} === null`).assign(o,(0,x._)`""`);return;case"number":i.elseIf((0,x._)`${n} == "boolean" || ${a} === null
|
|
4
|
+
|| (${n} == "string" && ${a} && ${a} == +${a})`).assign(o,(0,x._)`+${a}`);return;case"integer":i.elseIf((0,x._)`${n} === "boolean" || ${a} === null
|
|
5
|
+
|| (${n} === "string" && ${a} && ${a} == +${a} && !(${a} % 1))`).assign(o,(0,x._)`+${a}`);return;case"boolean":i.elseIf((0,x._)`${a} === "false" || ${a} === 0 || ${a} === null`).assign(o,!1).elseIf((0,x._)`${a} === "true" || ${a} === 1`).assign(o,!0);return;case"null":i.elseIf((0,x._)`${a} === "" || ${a} === 0 || ${a} === false`),i.assign(o,null);return;case"array":i.elseIf((0,x._)`${n} === "string" || ${n} === "number"
|
|
6
|
+
|| ${n} === "boolean" || ${a} === null`).assign(o,(0,x._)`[${a}]`)}}}function Qd({gen:t,parentData:e,parentDataProperty:r},i){t.if((0,x._)`${e} !== undefined`,()=>t.assign((0,x._)`${e}[${r}]`,i))}function bi(t,e,r,i=st.Correct){let a=i===st.Correct?x.operators.EQ:x.operators.NEQ,s;switch(t){case"null":return(0,x._)`${e} ${a} null`;case"array":s=(0,x._)`Array.isArray(${e})`;break;case"object":s=(0,x._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=n((0,x._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=n();break;default:return(0,x._)`typeof ${e} ${a} ${t}`}return i===st.Correct?s:(0,x.not)(s);function n(o=x.nil){return(0,x.and)((0,x._)`typeof ${e} == "number"`,o,r?(0,x._)`isFinite(${e})`:x.nil)}}X.checkDataType=bi;function vi(t,e,r,i){if(t.length===1)return bi(t[0],e,r,i);let a,s=(0,Ms.toHash)(t);if(s.array&&s.object){let n=(0,x._)`typeof ${e} != "object"`;a=s.null?n:(0,x._)`!${e} || ${n}`,delete s.null,delete s.array,delete s.object}else a=x.nil;s.number&&delete s.integer;for(let n in s)a=(0,x.and)(a,bi(n,e,r,i));return a}X.checkDataTypes=vi;var Xd={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,x._)`{type: ${t}}`:(0,x._)`{type: ${e}}`};function ji(t){let e=ec(t);(0,Hd.reportError)(e,Xd)}X.reportTypeError=ji;function ec(t){let{gen:e,data:r,schema:i}=t,a=(0,Ms.schemaRefOrVal)(t,i,"type");return{gen:e,keyword:"type",data:r,schema:i.type,schemaCode:a,schemaValue:a,parentSchema:i,params:{},it:t}}});var Vs=b(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.assignDefaults=void 0;var nt=k(),tc=I();function rc(t,e){let{properties:r,items:i}=t.schema;if(e==="object"&&r)for(let a in r)Us(t,a,r[a].default);else e==="array"&&Array.isArray(i)&&i.forEach((a,s)=>Us(t,s,a.default))}_r.assignDefaults=rc;function Us(t,e,r){let{gen:i,compositeRule:a,data:s,opts:n}=t;if(r===void 0)return;let o=(0,nt._)`${s}${(0,nt.getProperty)(e)}`;if(a){(0,tc.checkStrictMode)(t,`default is ignored for: ${o}`);return}let p=(0,nt._)`${o} === undefined`;n.useDefaults==="empty"&&(p=(0,nt._)`${p} || ${o} === null || ${o} === ""`),i.if(p,(0,nt._)`${o} = ${(0,nt.stringify)(r)}`)}});var ue=b(C=>{"use strict";Object.defineProperty(C,"__esModule",{value:!0});C.validateUnion=C.validateArray=C.usePattern=C.callValidateCode=C.schemaProperties=C.allSchemaProperties=C.noPropertyInData=C.propertyInData=C.isOwnProperty=C.hasPropFunc=C.reportMissingProp=C.checkMissingProp=C.checkReportMissingProp=void 0;var D=k(),wi=I(),Ee=ce(),ic=I();function ac(t,e){let{gen:r,data:i,it:a}=t;r.if(qi(r,i,e,a.opts.ownProperties),()=>{t.setParams({missingProperty:(0,D._)`${e}`},!0),t.error()})}C.checkReportMissingProp=ac;function sc({gen:t,data:e,it:{opts:r}},i,a){return(0,D.or)(...i.map(s=>(0,D.and)(qi(t,e,s,r.ownProperties),(0,D._)`${a} = ${s}`)))}C.checkMissingProp=sc;function nc(t,e){t.setParams({missingProperty:e},!0),t.error()}C.reportMissingProp=nc;function Fs(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,D._)`Object.prototype.hasOwnProperty`})}C.hasPropFunc=Fs;function Pi(t,e,r){return(0,D._)`${Fs(t)}.call(${e}, ${r})`}C.isOwnProperty=Pi;function oc(t,e,r,i){let a=(0,D._)`${e}${(0,D.getProperty)(r)} !== undefined`;return i?(0,D._)`${a} && ${Pi(t,e,r)}`:a}C.propertyInData=oc;function qi(t,e,r,i){let a=(0,D._)`${e}${(0,D.getProperty)(r)} === undefined`;return i?(0,D.or)(a,(0,D.not)(Pi(t,e,r))):a}C.noPropertyInData=qi;function Ks(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}C.allSchemaProperties=Ks;function pc(t,e){return Ks(e).filter(r=>!(0,wi.alwaysValidSchema)(t,e[r]))}C.schemaProperties=pc;function dc({schemaCode:t,data:e,it:{gen:r,topSchemaRef:i,schemaPath:a,errorPath:s},it:n},o,p,d){let c=d?(0,D._)`${t}, ${e}, ${i}${a}`:e,u=[[Ee.default.instancePath,(0,D.strConcat)(Ee.default.instancePath,s)],[Ee.default.parentData,n.parentData],[Ee.default.parentDataProperty,n.parentDataProperty],[Ee.default.rootData,Ee.default.rootData]];n.opts.dynamicRef&&u.push([Ee.default.dynamicAnchors,Ee.default.dynamicAnchors]);let y=(0,D._)`${c}, ${r.object(...u)}`;return p!==D.nil?(0,D._)`${o}.call(${p}, ${y})`:(0,D._)`${o}(${y})`}C.callValidateCode=dc;var cc=(0,D._)`new RegExp`;function uc({gen:t,it:{opts:e}},r){let i=e.unicodeRegExp?"u":"",{regExp:a}=e.code,s=a(r,i);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,D._)`${a.code==="new RegExp"?cc:(0,ic.useFunc)(t,a)}(${r}, ${i})`})}C.usePattern=uc;function lc(t){let{gen:e,data:r,keyword:i,it:a}=t,s=e.name("valid");if(a.allErrors){let o=e.let("valid",!0);return n(()=>e.assign(o,!1)),o}return e.var(s,!0),n(()=>e.break()),s;function n(o){let p=e.const("len",(0,D._)`${r}.length`);e.forRange("i",0,p,d=>{t.subschema({keyword:i,dataProp:d,dataPropType:wi.Type.Num},s),e.if((0,D.not)(s),o)})}}C.validateArray=lc;function yc(t){let{gen:e,schema:r,keyword:i,it:a}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(p=>(0,wi.alwaysValidSchema)(a,p))&&!a.opts.unevaluated)return;let n=e.let("valid",!1),o=e.name("_valid");e.block(()=>r.forEach((p,d)=>{let c=t.subschema({keyword:i,schemaProp:d,compositeRule:!0},o);e.assign(n,(0,D._)`${n} || ${o}`),t.mergeValidEvaluated(c,o)||e.if((0,D.not)(n))})),t.result(n,()=>t.reset(),()=>t.error(!0))}C.validateUnion=yc});var Js=b(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.validateKeywordUsage=je.validSchemaType=je.funcKeywordCode=je.macroKeywordCode=void 0;var re=k(),Ke=ce(),mc=ue(),_c=St();function gc(t,e){let{gen:r,keyword:i,schema:a,parentSchema:s,it:n}=t,o=e.macro.call(n.self,a,s,n),p=Bs(r,i,o);n.opts.validateSchema!==!1&&n.self.validateSchema(o,!0);let d=r.name("valid");t.subschema({schema:o,schemaPath:re.nil,errSchemaPath:`${n.errSchemaPath}/${i}`,topSchemaRef:p,compositeRule:!0},d),t.pass(d,()=>t.error(!0))}je.macroKeywordCode=gc;function fc(t,e){var r;let{gen:i,keyword:a,schema:s,parentSchema:n,$data:o,it:p}=t;bc(p,e);let d=!o&&e.compile?e.compile.call(p.self,s,n,p):e.validate,c=Bs(i,a,d),u=i.let("valid");t.block$data(u,y),t.ok((r=e.valid)!==null&&r!==void 0?r:u);function y(){if(e.errors===!1)_(),e.modifying&&Hs(t),m(()=>t.error());else{let h=e.async?g():l();e.modifying&&Hs(t),m(()=>hc(t,h))}}function g(){let h=i.let("ruleErrs",null);return i.try(()=>_((0,re._)`await `),$=>i.assign(u,!1).if((0,re._)`${$} instanceof ${p.ValidationError}`,()=>i.assign(h,(0,re._)`${$}.errors`),()=>i.throw($))),h}function l(){let h=(0,re._)`${c}.errors`;return i.assign(h,null),_(re.nil),h}function _(h=e.async?(0,re._)`await `:re.nil){let $=p.opts.passContext?Ke.default.this:Ke.default.self,w=!("compile"in e&&!o||e.schema===!1);i.assign(u,(0,re._)`${h}${(0,mc.callValidateCode)(t,c,$,w)}`,e.modifying)}function m(h){var $;i.if((0,re.not)(($=e.valid)!==null&&$!==void 0?$:u),h)}}je.funcKeywordCode=fc;function Hs(t){let{gen:e,data:r,it:i}=t;e.if(i.parentData,()=>e.assign(r,(0,re._)`${i.parentData}[${i.parentDataProperty}]`))}function hc(t,e){let{gen:r}=t;r.if((0,re._)`Array.isArray(${e})`,()=>{r.assign(Ke.default.vErrors,(0,re._)`${Ke.default.vErrors} === null ? ${e} : ${Ke.default.vErrors}.concat(${e})`).assign(Ke.default.errors,(0,re._)`${Ke.default.vErrors}.length`),(0,_c.extendErrors)(t)},()=>t.error())}function bc({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function Bs(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,re.stringify)(r)})}function vc(t,e,r=!1){return!e.length||e.some(i=>i==="array"?Array.isArray(t):i==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==i||r&&typeof t>"u")}je.validSchemaType=vc;function jc({schema:t,opts:e,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(t,o)))throw new Error(`parent schema must have dependencies of ${s}: ${n.join(",")}`);if(a.validateSchema&&!a.validateSchema(t[s])){let p=`keyword "${s}" value is invalid at path "${i}": `+r.errorsText(a.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(p);else throw new Error(p)}}je.validateKeywordUsage=jc});var Ys=b(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.extendSubschemaMode=Se.extendSubschemaData=Se.getSubschema=void 0;var we=k(),Ws=I();function wc(t,{keyword:e,schemaProp:r,schema:i,schemaPath:a,errSchemaPath:s,topSchemaRef:n}){if(e!==void 0&&i!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let o=t.schema[e];return r===void 0?{schema:o,schemaPath:(0,we._)`${t.schemaPath}${(0,we.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:o[r],schemaPath:(0,we._)`${t.schemaPath}${(0,we.getProperty)(e)}${(0,we.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,Ws.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')}Se.getSubschema=wc;function Pc(t,e,{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}=e;if(r!==void 0){let{errorPath:d,dataPathArr:c,opts:u}=e,y=o.let("data",(0,we._)`${e.data}${(0,we.getProperty)(r)}`,!0);p(y),t.errorPath=(0,we.str)`${d}${(0,Ws.getErrorPath)(r,i,u.jsPropertySyntax)}`,t.parentDataProperty=(0,we._)`${r}`,t.dataPathArr=[...c,t.parentDataProperty]}if(a!==void 0){let d=a instanceof we.Name?a:o.let("data",a,!0);p(d),n!==void 0&&(t.propertyName=n)}s&&(t.dataTypes=s);function p(d){t.data=d,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,d]}}Se.extendSubschemaData=Pc;function qc(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:i,createErrors:a,allErrors:s}){i!==void 0&&(t.compositeRule=i),a!==void 0&&(t.createErrors=a),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}Se.extendSubschemaMode=qc});var ki=b((Jg,Qs)=>{"use strict";Qs.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var i,a,s;if(Array.isArray(e)){if(i=e.length,i!=r.length)return!1;for(a=i;a--!==0;)if(!t(e[a],r[a]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),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(!t(e[n],r[n]))return!1}return!0}return e!==e&&r!==r}});var en=b((Wg,Xs)=>{"use strict";var Te=Xs.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var i=typeof r=="function"?r:r.pre||function(){},a=r.post||function(){};gr(e,i,a,t,"",t)};Te.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Te.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Te.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Te.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 gr(t,e,r,i,a,s,n,o,p,d){if(i&&typeof i=="object"&&!Array.isArray(i)){e(i,a,s,n,o,p,d);for(var c in i){var u=i[c];if(Array.isArray(u)){if(c in Te.arrayKeywords)for(var y=0;y<u.length;y++)gr(t,e,r,u[y],a+"/"+c+"/"+y,s,a,c,i,y)}else if(c in Te.propsKeywords){if(u&&typeof u=="object")for(var g in u)gr(t,e,r,u[g],a+"/"+c+"/"+kc(g),s,a,c,i,g)}else(c in Te.keywords||t.allKeys&&!(c in Te.skipKeywords))&&gr(t,e,r,u,a+"/"+c,s,a,c,i)}r(i,a,s,n,o,p,d)}}function kc(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Zt=b(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.getSchemaRefs=ne.resolveUrl=ne.normalizeId=ne._getFullPath=ne.getFullPath=ne.inlineRef=void 0;var $c=I(),xc=ki(),zc=en(),Oc=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Ac(t,e=!0){return typeof t=="boolean"?!0:e===!0?!$i(t):e?tn(t)<=e:!1}ne.inlineRef=Ac;var Ic=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function $i(t){for(let e in t){if(Ic.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some($i)||typeof r=="object"&&$i(r))return!0}return!1}function tn(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!Oc.has(r)&&(typeof t[r]=="object"&&(0,$c.eachItem)(t[r],i=>e+=tn(i)),e===1/0))return 1/0}return e}function rn(t,e="",r){r!==!1&&(e=ot(e));let i=t.parse(e);return an(t,i)}ne.getFullPath=rn;function an(t,e){return t.serialize(e).split("#")[0]+"#"}ne._getFullPath=an;var Ec=/#\/?$/;function ot(t){return t?t.replace(Ec,""):""}ne.normalizeId=ot;function Sc(t,e,r){return r=ot(r),t.resolve(e,r)}ne.resolveUrl=Sc;var Tc=/^[a-z_][-a-z0-9._]*$/i;function Zc(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:i}=this.opts,a=ot(t[r]||e),s={"":a},n=rn(i,a,!1),o={},p=new Set;return zc(t,{allKeys:!0},(u,y,g,l)=>{if(l===void 0)return;let _=n+y,m=s[l];typeof u[r]=="string"&&(m=h.call(this,u[r])),$.call(this,u.$anchor),$.call(this,u.$dynamicAnchor),s[y]=m;function h(w){let L=this.opts.uriResolver.resolve;if(w=ot(m?L(m,w):w),p.has(w))throw c(w);p.add(w);let P=this.refs[w];return typeof P=="string"&&(P=this.refs[P]),typeof P=="object"?d(u,P.schema,w):w!==ot(_)&&(w[0]==="#"?(d(u,o[w],w),o[w]=u):this.refs[w]=_),w}function $(w){if(typeof w=="string"){if(!Tc.test(w))throw new Error(`invalid anchor "${w}"`);h.call(this,`#${w}`)}}}),o;function d(u,y,g){if(y!==void 0&&!xc(u,y))throw c(g)}function c(u){return new Error(`reference "${u}" resolves to more than one schema`)}}ne.getSchemaRefs=Zc});var pt=b(Ze=>{"use strict";Object.defineProperty(Ze,"__esModule",{value:!0});Ze.getData=Ze.KeywordCxt=Ze.validateFunctionCode=void 0;var dn=Rs(),sn=Tt(),zi=hi(),fr=Tt(),Nc=Vs(),Rt=Js(),xi=Ys(),j=k(),q=ce(),Rc=Zt(),Oe=I(),Nt=St();function Lc(t){if(ln(t)&&(yn(t),un(t))){Dc(t);return}cn(t,()=>(0,dn.topBoolOrEmptySchema)(t))}Ze.validateFunctionCode=Lc;function cn({gen:t,validateName:e,schema:r,schemaEnv:i,opts:a},s){a.code.es5?t.func(e,(0,j._)`${q.default.data}, ${q.default.valCxt}`,i.$async,()=>{t.code((0,j._)`"use strict"; ${nn(r,a)}`),Mc(t,a),t.code(s)}):t.func(e,(0,j._)`${q.default.data}, ${Cc(a)}`,i.$async,()=>t.code(nn(r,a)).code(s))}function Cc(t){return(0,j._)`{${q.default.instancePath}="", ${q.default.parentData}, ${q.default.parentDataProperty}, ${q.default.rootData}=${q.default.data}${t.dynamicRef?(0,j._)`, ${q.default.dynamicAnchors}={}`:j.nil}}={}`}function Mc(t,e){t.if(q.default.valCxt,()=>{t.var(q.default.instancePath,(0,j._)`${q.default.valCxt}.${q.default.instancePath}`),t.var(q.default.parentData,(0,j._)`${q.default.valCxt}.${q.default.parentData}`),t.var(q.default.parentDataProperty,(0,j._)`${q.default.valCxt}.${q.default.parentDataProperty}`),t.var(q.default.rootData,(0,j._)`${q.default.valCxt}.${q.default.rootData}`),e.dynamicRef&&t.var(q.default.dynamicAnchors,(0,j._)`${q.default.valCxt}.${q.default.dynamicAnchors}`)},()=>{t.var(q.default.instancePath,(0,j._)`""`),t.var(q.default.parentData,(0,j._)`undefined`),t.var(q.default.parentDataProperty,(0,j._)`undefined`),t.var(q.default.rootData,q.default.data),e.dynamicRef&&t.var(q.default.dynamicAnchors,(0,j._)`{}`)})}function Dc(t){let{schema:e,opts:r,gen:i}=t;cn(t,()=>{r.$comment&&e.$comment&&_n(t),Kc(t),i.let(q.default.vErrors,null),i.let(q.default.errors,0),r.unevaluated&&Gc(t),mn(t),Jc(t)})}function Gc(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,j._)`${r}.evaluated`),e.if((0,j._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,j._)`${t.evaluated}.props`,(0,j._)`undefined`)),e.if((0,j._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,j._)`${t.evaluated}.items`,(0,j._)`undefined`))}function nn(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,j._)`/*# sourceURL=${r} */`:j.nil}function Uc(t,e){if(ln(t)&&(yn(t),un(t))){Vc(t,e);return}(0,dn.boolOrEmptySchema)(t,e)}function un({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function ln(t){return typeof t.schema!="boolean"}function Vc(t,e){let{schema:r,gen:i,opts:a}=t;a.$comment&&r.$comment&&_n(t),Hc(t),Bc(t);let s=i.const("_errs",q.default.errors);mn(t,s),i.var(e,(0,j._)`${s} === ${q.default.errors}`)}function yn(t){(0,Oe.checkUnknownRules)(t),Fc(t)}function mn(t,e){if(t.opts.jtd)return on(t,[],!1,e);let r=(0,sn.getSchemaTypes)(t.schema),i=(0,sn.coerceAndCheckDataType)(t,r);on(t,r,!i,e)}function Fc(t){let{schema:e,errSchemaPath:r,opts:i,self:a}=t;e.$ref&&i.ignoreKeywordsWithRef&&(0,Oe.schemaHasRulesButRef)(e,a.RULES)&&a.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function Kc(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Oe.checkStrictMode)(t,"default is ignored in the schema root")}function Hc(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,Rc.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function Bc(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function _n({gen:t,schemaEnv:e,schema:r,errSchemaPath:i,opts:a}){let s=r.$comment;if(a.$comment===!0)t.code((0,j._)`${q.default.self}.logger.log(${s})`);else if(typeof a.$comment=="function"){let n=(0,j.str)`${i}/$comment`,o=t.scopeValue("root",{ref:e.root});t.code((0,j._)`${q.default.self}.opts.$comment(${s}, ${n}, ${o}.schema)`)}}function Jc(t){let{gen:e,schemaEnv:r,validateName:i,ValidationError:a,opts:s}=t;r.$async?e.if((0,j._)`${q.default.errors} === 0`,()=>e.return(q.default.data),()=>e.throw((0,j._)`new ${a}(${q.default.vErrors})`)):(e.assign((0,j._)`${i}.errors`,q.default.vErrors),s.unevaluated&&Wc(t),e.return((0,j._)`${q.default.errors} === 0`))}function Wc({gen:t,evaluated:e,props:r,items:i}){r instanceof j.Name&&t.assign((0,j._)`${e}.props`,r),i instanceof j.Name&&t.assign((0,j._)`${e}.items`,i)}function on(t,e,r,i){let{gen:a,schema:s,data:n,allErrors:o,opts:p,self:d}=t,{RULES:c}=d;if(s.$ref&&(p.ignoreKeywordsWithRef||!(0,Oe.schemaHasRulesButRef)(s,c))){a.block(()=>fn(t,"$ref",c.all.$ref.definition));return}p.jtd||Yc(t,e),a.block(()=>{for(let y of c.rules)u(y);u(c.post)});function u(y){(0,zi.shouldUseGroup)(s,y)&&(y.type?(a.if((0,fr.checkDataType)(y.type,n,p.strictNumbers)),pn(t,y),e.length===1&&e[0]===y.type&&r&&(a.else(),(0,fr.reportTypeError)(t)),a.endIf()):pn(t,y),o||a.if((0,j._)`${q.default.errors} === ${i||0}`))}}function pn(t,e){let{gen:r,schema:i,opts:{useDefaults:a}}=t;a&&(0,Nc.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,zi.shouldUseRule)(i,s)&&fn(t,s.keyword,s.definition,e.type)})}function Yc(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(Qc(t,e),t.opts.allowUnionTypes||Xc(t,e),eu(t,t.dataTypes))}function Qc(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{gn(t.dataTypes,r)||Oi(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),ru(t,e)}}function Xc(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Oi(t,"use allowUnionTypes to allow union type keyword")}function eu(t,e){let r=t.self.RULES.all;for(let i in r){let a=r[i];if(typeof a=="object"&&(0,zi.shouldUseRule)(t.schema,a)){let{type:s}=a.definition;s.length&&!s.some(n=>tu(e,n))&&Oi(t,`missing type "${s.join(",")}" for keyword "${i}"`)}}}function tu(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function gn(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function ru(t,e){let r=[];for(let i of t.dataTypes)gn(e,i)?r.push(i):e.includes("integer")&&i==="number"&&r.push("integer");t.dataTypes=r}function Oi(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Oe.checkStrictMode)(t,e,t.opts.strictTypes)}var hr=class{constructor(e,r,i){if((0,Rt.validateKeywordUsage)(e,r,i),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=i,this.data=e.data,this.schema=e.schema[i],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Oe.schemaRefOrVal)(e,this.schema,i,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",hn(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Rt.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=e.gen.const("_errs",q.default.errors))}result(e,r,i){this.failResult((0,j.not)(e),r,i)}failResult(e,r,i){this.gen.if(e),i?i():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,j.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,j._)`${r} !== undefined && (${(0,j.or)(this.invalid$data(),e)})`)}error(e,r,i){if(r){this.setParams(r),this._error(e,i),this.setParams({});return}this._error(e,i)}_error(e,r){(e?Nt.reportExtraError:Nt.reportError)(this,this.def.error,r)}$dataError(){(0,Nt.reportError)(this,this.def.$dataError||Nt.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Nt.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,i=j.nil){this.gen.block(()=>{this.check$data(e,i),r()})}check$data(e=j.nil,r=j.nil){if(!this.$data)return;let{gen:i,schemaCode:a,schemaType:s,def:n}=this;i.if((0,j.or)((0,j._)`${a} === undefined`,r)),e!==j.nil&&i.assign(e,!0),(s.length||n.validateSchema)&&(i.elseIf(this.invalid$data()),this.$dataError(),e!==j.nil&&i.assign(e,!1)),i.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:i,def:a,it:s}=this;return(0,j.or)(n(),o());function n(){if(i.length){if(!(r instanceof j.Name))throw new Error("ajv implementation error");let p=Array.isArray(i)?i:[i];return(0,j._)`${(0,fr.checkDataTypes)(p,r,s.opts.strictNumbers,fr.DataType.Wrong)}`}return j.nil}function o(){if(a.validateSchema){let p=e.scopeValue("validate$data",{ref:a.validateSchema});return(0,j._)`!${p}(${r})`}return j.nil}}subschema(e,r){let i=(0,xi.getSubschema)(this.it,e);(0,xi.extendSubschemaData)(i,this.it,e),(0,xi.extendSubschemaMode)(i,e);let a={...this.it,...i,items:void 0,props:void 0};return Uc(a,r),a}mergeEvaluated(e,r){let{it:i,gen:a}=this;i.opts.unevaluated&&(i.props!==!0&&e.props!==void 0&&(i.props=Oe.mergeEvaluated.props(a,e.props,i.props,r)),i.items!==!0&&e.items!==void 0&&(i.items=Oe.mergeEvaluated.items(a,e.items,i.items,r)))}mergeValidEvaluated(e,r){let{it:i,gen:a}=this;if(i.opts.unevaluated&&(i.props!==!0||i.items!==!0))return a.if(r,()=>this.mergeEvaluated(e,j.Name)),!0}};Ze.KeywordCxt=hr;function fn(t,e,r,i){let a=new hr(t,r,e);"code"in r?r.code(a,i):a.$data&&r.validate?(0,Rt.funcKeywordCode)(a,r):"macro"in r?(0,Rt.macroKeywordCode)(a,r):(r.compile||r.validate)&&(0,Rt.funcKeywordCode)(a,r)}var iu=/^\/(?:[^~]|~0|~1)*$/,au=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function hn(t,{dataLevel:e,dataNames:r,dataPathArr:i}){let a,s;if(t==="")return q.default.rootData;if(t[0]==="/"){if(!iu.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);a=t,s=q.default.rootData}else{let d=au.exec(t);if(!d)throw new Error(`Invalid JSON-pointer: ${t}`);let c=+d[1];if(a=d[2],a==="#"){if(c>=e)throw new Error(p("property/index",c));return i[e-c]}if(c>e)throw new Error(p("data",c));if(s=r[e-c],!a)return s}let n=s,o=a.split("/");for(let d of o)d&&(s=(0,j._)`${s}${(0,j.getProperty)((0,Oe.unescapeJsonPointer)(d))}`,n=(0,j._)`${n} && ${s}`);return n;function p(d,c){return`Cannot access ${d} ${c} levels up, current level is ${e}`}}Ze.getData=hn});var Lt=b(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});var Ai=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Ii.default=Ai});var dt=b(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});var Ei=Zt(),Si=class extends Error{constructor(e,r,i,a){super(a||`can't resolve reference ${i} from id ${r}`),this.missingRef=(0,Ei.resolveUrl)(e,r,i),this.missingSchema=(0,Ei.normalizeId)((0,Ei.getFullPath)(e,this.missingRef))}};Ti.default=Si});var Ct=b(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.resolveSchema=le.getCompilingSchema=le.resolveRef=le.compileSchema=le.SchemaEnv=void 0;var ge=k(),su=Lt(),He=ce(),fe=Zt(),bn=I(),nu=pt(),ct=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let i;typeof e.schema=="object"&&(i=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,fe.normalizeId)(i?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=i?.$async,this.refs={}}};le.SchemaEnv=ct;function Ni(t){let e=vn.call(this,t);if(e)return e;let r=(0,fe.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:i,lines:a}=this.opts.code,{ownProperties:s}=this.opts,n=new ge.CodeGen(this.scope,{es5:i,lines:a,ownProperties:s}),o;t.$async&&(o=n.scopeValue("Error",{ref:su.default,code:(0,ge._)`require("ajv/dist/runtime/validation_error").default`}));let p=n.scopeName("validate");t.validateName=p;let d={gen:n,allErrors:this.opts.allErrors,data:He.default.data,parentData:He.default.parentData,parentDataProperty:He.default.parentDataProperty,dataNames:[He.default.data],dataPathArr:[ge.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:n.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,ge.stringify)(t.schema)}:{ref:t.schema}),validateName:p,ValidationError:o,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:ge.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,ge._)`""`,opts:this.opts,self:this},c;try{this._compilations.add(t),(0,nu.validateFunctionCode)(d),n.optimize(this.opts.code.optimize);let u=n.toString();c=`${n.scopeRefs(He.default.scope)}return ${u}`,this.opts.code.process&&(c=this.opts.code.process(c,t));let g=new Function(`${He.default.self}`,`${He.default.scope}`,c)(this,this.scope.get());if(this.scope.value(p,{ref:g}),g.errors=null,g.schema=t.schema,g.schemaEnv=t,t.$async&&(g.$async=!0),this.opts.code.source===!0&&(g.source={validateName:p,validateCode:u,scopeValues:n._values}),this.opts.unevaluated){let{props:l,items:_}=d;g.evaluated={props:l instanceof ge.Name?void 0:l,items:_ instanceof ge.Name?void 0:_,dynamicProps:l instanceof ge.Name,dynamicItems:_ instanceof ge.Name},g.source&&(g.source.evaluated=(0,ge.stringify)(g.evaluated))}return t.validate=g,t}catch(u){throw delete t.validate,delete t.validateName,c&&this.logger.error("Error compiling schema, function code:",c),u}finally{this._compilations.delete(t)}}le.compileSchema=Ni;function ou(t,e,r){var i;r=(0,fe.resolveUrl)(this.opts.uriResolver,e,r);let a=t.refs[r];if(a)return a;let s=cu.call(this,t,r);if(s===void 0){let n=(i=t.localRefs)===null||i===void 0?void 0:i[r],{schemaId:o}=this.opts;n&&(s=new ct({schema:n,schemaId:o,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=pu.call(this,s)}le.resolveRef=ou;function pu(t){return(0,fe.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Ni.call(this,t)}function vn(t){for(let e of this._compilations)if(du(e,t))return e}le.getCompilingSchema=vn;function du(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function cu(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||br.call(this,t,e)}function br(t,e){let r=this.opts.uriResolver.parse(e),i=(0,fe._getFullPath)(this.opts.uriResolver,r),a=(0,fe.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&i===a)return Zi.call(this,r,t);let s=(0,fe.normalizeId)(i),n=this.refs[s]||this.schemas[s];if(typeof n=="string"){let o=br.call(this,t,n);return typeof o?.schema!="object"?void 0:Zi.call(this,r,o)}if(typeof n?.schema=="object"){if(n.validate||Ni.call(this,n),s===(0,fe.normalizeId)(e)){let{schema:o}=n,{schemaId:p}=this.opts,d=o[p];return d&&(a=(0,fe.resolveUrl)(this.opts.uriResolver,a,d)),new ct({schema:o,schemaId:p,root:t,baseId:a})}return Zi.call(this,r,n)}}le.resolveSchema=br;var uu=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Zi(t,{baseId:e,schema:r,root:i}){var a;if(((a=t.fragment)===null||a===void 0?void 0:a[0])!=="/")return;for(let o of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let p=r[(0,bn.unescapeFragment)(o)];if(p===void 0)return;r=p;let d=typeof r=="object"&&r[this.opts.schemaId];!uu.has(o)&&d&&(e=(0,fe.resolveUrl)(this.opts.uriResolver,e,d))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,bn.schemaHasRulesButRef)(r,this.RULES)){let o=(0,fe.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=br.call(this,i,o)}let{schemaId:n}=this.opts;if(s=s||new ct({schema:r,schemaId:n,root:i,baseId:e}),s.schema!==s.root.schema)return s}});var jn=b((rf,lu)=>{lu.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 Ci=b((af,xn)=>{"use strict";var yu=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Pn=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),Ri=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),qn=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),mu=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Li(t){let e="",r=0,i=0;for(i=0;i<t.length;i++)if(r=t[i].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[i];break}for(i+=1;i<t.length;i++){if(r=t[i].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[i]}return e}var _u=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function wn(t){return t.length=0,!0}function gu(t,e,r){if(t.length){let i=Li(t);if(i!=="")e.push(i);else return r.error=!0,!1;t.length=0}return!0}function fu(t){let e=0,r={error:!1,address:"",zone:""},i=[],a=[],s=!1,n=!1,o=gu;for(let p=0;p<t.length;p++){let d=t[p];if(!(d==="["||d==="]"))if(d===":"){if(s===!0&&(n=!0),!o(a,i,r))break;if(++e>7){r.error=!0;break}p>0&&t[p-1]===":"&&(s=!0),i.push(":");continue}else if(d==="%"){if(!o(a,i,r))break;o=wn}else{a.push(d);continue}}return a.length&&(o===wn?r.zone=a.join(""):n?i.push(a.join("")):i.push(Li(a))),r.address=i.join(""),r}function kn(t){if(hu(t,":")<2)return{host:t,isIPV6:!1};let e=fu(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,i=e.address;return e.zone&&(r+="%"+e.zone,i+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:i}}}function hu(t,e){let r=0;for(let i=0;i<t.length;i++)t[i]===e&&r++;return r}function bu(t){let e=t,r=[],i=-1,a=0;for(;a=e.length;){if(a===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(a===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(a===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((i=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,i)),e=e.slice(i)}return r.join("")}var vu={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},ju=/[@/?#:]/g,wu=/[@/?#]/g;function $n(t,e){let r=e?wu:ju;return r.lastIndex=0,t.replace(r,i=>vu[i])}function Pu(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let i=0;i<t.length;i++){if(t[i]==="%"&&i+2<t.length){let a=t.slice(i+1,i+3);if(Ri(a)){let s=a.toUpperCase(),n=String.fromCharCode(parseInt(s,16));e&&qn(n)?r+=n:r+="%"+s,i+=2;continue}}r+=t[i]}return r}function qu(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let i=t.slice(r+1,r+3);if(Ri(i)){let a=i.toUpperCase(),s=String.fromCharCode(parseInt(a,16));s!=="."&&qn(s)?e+=s:e+="%"+a,r+=2;continue}}mu(t[r])?e+=t[r]:e+=escape(t[r])}return e}function ku(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let i=t.slice(r+1,r+3);if(Ri(i)){e+="%"+i.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function $u(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!Pn(r)){let i=kn(r);i.isIPV6===!0?r=`[${i.escapedHost}]`:r=$n(r,!1)}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}xn.exports={nonSimpleDomain:_u,recomposeAuthority:$u,reescapeHostDelimiters:$n,normalizePercentEncoding:Pu,normalizePathEncoding:qu,escapePreservingEscapes:ku,removeDotSegments:bu,isIPv4:Pn,isUUID:yu,normalizeIPv6:kn,stringArrayToHexStripped:Li}});var En=b((sf,In)=>{"use strict";var{isUUID:xu}=Ci(),zu=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,Ou=["http","https","ws","wss","urn","urn:uuid"];function Au(t){return Ou.indexOf(t)!==-1}function Mi(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function zn(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function On(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function Iu(t){return t.secure=Mi(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function Eu(t){if((t.port===(Mi(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function Su(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(zu);if(r){let i=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let a=`${i}:${e.nid||t.nid}`,s=Di(a);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function Tu(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",i=t.nid.toLowerCase(),a=`${r}:${e.nid||i}`,s=Di(a);s&&(t=s.serialize(t,e));let n=t,o=t.nss;return n.path=`${i||e.nid}:${o}`,e.skipEscape=!0,n}function Zu(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!xu(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function Nu(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var An={scheme:"http",domainHost:!0,parse:zn,serialize:On},Ru={scheme:"https",domainHost:An.domainHost,parse:zn,serialize:On},vr={scheme:"ws",domainHost:!0,parse:Iu,serialize:Eu},Lu={scheme:"wss",domainHost:vr.domainHost,parse:vr.parse,serialize:vr.serialize},Cu={scheme:"urn",parse:Su,serialize:Tu,skipNormalize:!0},Mu={scheme:"urn:uuid",parse:Zu,serialize:Nu,skipNormalize:!0},jr={http:An,https:Ru,ws:vr,wss:Lu,urn:Cu,"urn:uuid":Mu};Object.setPrototypeOf(jr,null);function Di(t){return t&&(jr[t]||jr[t.toLowerCase()])||void 0}In.exports={wsIsSecure:Mi,SCHEMES:jr,isValidSchemeName:Au,getSchemeHandler:Di}});var Rn=b((nf,qr)=>{"use strict";var{normalizeIPv6:Du,removeDotSegments:Mt,recomposeAuthority:Gu,normalizePercentEncoding:Uu,normalizePathEncoding:Vu,escapePreservingEscapes:Fu,reescapeHostDelimiters:Ku,isIPv4:Hu,nonSimpleDomain:Bu}=Ci(),{SCHEMES:Ju,getSchemeHandler:Tn}=En();function Wu(t,e){return typeof t=="string"?t=il(t,e):typeof t=="object"&&(t=Pr(Be(t,e),e)),t}function Yu(t,e,r){let i=r?Object.assign({scheme:"null"},r):{scheme:"null"},{parsed:a,malformedAuthorityOrPort:s}=wr(t,i),{parsed:n,malformedAuthorityOrPort:o}=wr(e,i);if(s||o)throw new Error(a.error||n.error||"URI is malformed.");let p=Zn(a,n,i,!0);return i.skipEscape=!0,Be(p,i)}function Zn(t,e,r,i){let a={};return i||(t=Pr(Be(t,r),r),e=Pr(Be(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(a.scheme=e.scheme,a.userinfo=e.userinfo,a.host=e.host,a.port=e.port,a.path=Mt(e.path||""),a.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(a.userinfo=e.userinfo,a.host=e.host,a.port=e.port,a.path=Mt(e.path||""),a.query=e.query):(e.path?(e.path[0]==="/"?a.path=Mt(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?a.path="/"+e.path:t.path?a.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:a.path=e.path,a.path=Mt(a.path)),a.query=e.query):(a.path=t.path,e.query!==void 0?a.query=e.query:a.query=t.query),a.userinfo=t.userinfo,a.host=t.host,a.port=t.port),a.scheme=t.scheme),a.fragment=e.fragment,a}function Qu(t,e,r){let i=Sn(t,r),a=Sn(e,r);return i!==void 0&&a!==void 0&&i.toLowerCase()===a.toLowerCase()}function Be(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},i=Object.assign({},e),a=[],s=Tn(i.scheme||r.scheme);s&&s.serialize&&s.serialize(r,i),r.path!==void 0&&(i.skipEscape?r.path=Uu(r.path):(r.path=Fu(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),i.reference!=="suffix"&&r.scheme&&a.push(r.scheme,":");let n=Gu(r);if(n!==void 0&&(i.reference!=="suffix"&&a.push("//"),a.push(n),r.path&&r.path[0]!=="/"&&a.push("/")),r.path!==void 0){let o=r.path;!i.absolutePath&&(!s||!s.absolutePath)&&(o=Mt(o)),n===void 0&&o[0]==="/"&&o[1]==="/"&&(o="/%2F"+o.slice(2)),a.push(o)}return r.query!==void 0&&a.push("?",r.query),r.fragment!==void 0&&a.push("#",r.fragment),a.join("")}var Xu=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,el=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,tl=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function rl(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}function wr(t,e){let r=Object.assign({},e),i={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},a=!1,s=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let n=t.match(el);n!==null&&n[1].indexOf("\\")!==-1&&(i.error="URI authority must not contain a literal backslash.",a=!0);let o=t.match(tl);if(o!==null){let d=o[1],c=d.replace(/[\t\n\r]/g,"");c.length>=2&&(c.slice(0,2)!=="//"?(i.error=i.error||"URI authority must not contain a literal backslash.",a=!0):d.length!==c.length&&(i.error=i.error||"URI authority introducer must not contain whitespace.",a=!0))}let p=t.match(Xu);if(p){i.scheme=p[1],i.userinfo=p[3],i.host=p[4],i.port=parseInt(p[5],10),i.path=p[6]||"",i.query=p[7],i.fragment=p[8],isNaN(i.port)&&(i.port=p[5]);let d=rl(i,p);if(d!==void 0&&(i.error=i.error||d,a=!0),i.host)if(Hu(i.host)===!1){let y=Du(i.host);i.host=y.host.toLowerCase(),s=y.isIPV6}else s=!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 c=Tn(r.scheme||i.scheme);if(!r.unicodeSupport&&(!c||!c.unicodeSupport)&&i.host&&(r.domainHost||c&&c.domainHost)&&s===!1&&Bu(i.host))try{i.host=new URL("http://"+i.host).hostname}catch(u){i.error=i.error||"Host's domain name can not be converted to ASCII: "+u}if((!c||c&&!c.skipNormalize)&&(t.indexOf("%")!==-1&&(i.scheme!==void 0&&(i.scheme=unescape(i.scheme)),i.host!==void 0&&(i.host=Ku(unescape(i.host),s))),i.path&&(i.path=Vu(i.path)),i.fragment))try{i.fragment=encodeURI(decodeURIComponent(i.fragment))}catch{i.error=i.error||"URI malformed"}c&&c.parse&&c.parse(i,r)}else i.error=i.error||"URI can not be parsed.";return{parsed:i,malformedAuthorityOrPort:a}}function Pr(t,e){return wr(t,e).parsed}function il(t,e){return Nn(t,e).normalized}function Nn(t,e){let{parsed:r,malformedAuthorityOrPort:i}=wr(t,e);return{normalized:i?t:Be(r,e),malformedAuthorityOrPort:i}}function Sn(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:i}=Nn(t,e);return i?void 0:r}if(typeof t=="object")return Be(t,e)}var Gi={SCHEMES:Ju,normalize:Wu,resolve:Yu,resolveComponent:Zn,equal:Qu,serialize:Be,parse:Pr};qr.exports=Gi;qr.exports.default=Gi;qr.exports.fastUri=Gi});var Cn=b(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});var Ln=Rn();Ln.code='require("ajv/dist/runtime/uri").default';Ui.default=Ln});var Ki=b(B=>{"use strict";Object.defineProperty(B,"__esModule",{value:!0});B.CodeGen=B.Name=B.nil=B.stringify=B.str=B._=B.KeywordCxt=void 0;var al=pt();Object.defineProperty(B,"KeywordCxt",{enumerable:!0,get:function(){return al.KeywordCxt}});var ut=k();Object.defineProperty(B,"_",{enumerable:!0,get:function(){return ut._}});Object.defineProperty(B,"str",{enumerable:!0,get:function(){return ut.str}});Object.defineProperty(B,"stringify",{enumerable:!0,get:function(){return ut.stringify}});Object.defineProperty(B,"nil",{enumerable:!0,get:function(){return ut.nil}});Object.defineProperty(B,"Name",{enumerable:!0,get:function(){return ut.Name}});Object.defineProperty(B,"CodeGen",{enumerable:!0,get:function(){return ut.CodeGen}});var sl=Lt(),Vn=dt(),nl=fi(),Dt=Ct(),ol=k(),Gt=Zt(),kr=Tt(),Fi=I(),Mn=jn(),pl=Cn(),Fn=(t,e)=>new RegExp(t,e);Fn.code="new RegExp";var dl=["removeAdditional","useDefaults","coerceTypes"],cl=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),ul={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."},ll={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Dn=200;function yl(t){var e,r,i,a,s,n,o,p,d,c,u,y,g,l,_,m,h,$,w,L,P,ee,H,Me,v;let E=t.strict,S=(e=t.code)===null||e===void 0?void 0:e.optimize,Z=S===!0||S===void 0?1:S||0,W=(i=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&i!==void 0?i:Fn,z=(a=t.uriResolver)!==null&&a!==void 0?a:pl.default;return{strictSchema:(n=(s=t.strictSchema)!==null&&s!==void 0?s:E)!==null&&n!==void 0?n:!0,strictNumbers:(p=(o=t.strictNumbers)!==null&&o!==void 0?o:E)!==null&&p!==void 0?p:!0,strictTypes:(c=(d=t.strictTypes)!==null&&d!==void 0?d:E)!==null&&c!==void 0?c:"log",strictTuples:(y=(u=t.strictTuples)!==null&&u!==void 0?u:E)!==null&&y!==void 0?y:"log",strictRequired:(l=(g=t.strictRequired)!==null&&g!==void 0?g:E)!==null&&l!==void 0?l:!1,code:t.code?{...t.code,optimize:Z,regExp:W}:{optimize:Z,regExp:W},loopRequired:(_=t.loopRequired)!==null&&_!==void 0?_:Dn,loopEnum:(m=t.loopEnum)!==null&&m!==void 0?m:Dn,meta:(h=t.meta)!==null&&h!==void 0?h:!0,messages:($=t.messages)!==null&&$!==void 0?$:!0,inlineRefs:(w=t.inlineRefs)!==null&&w!==void 0?w:!0,schemaId:(L=t.schemaId)!==null&&L!==void 0?L:"$id",addUsedSchema:(P=t.addUsedSchema)!==null&&P!==void 0?P:!0,validateSchema:(ee=t.validateSchema)!==null&&ee!==void 0?ee:!0,validateFormats:(H=t.validateFormats)!==null&&H!==void 0?H:!0,unicodeRegExp:(Me=t.unicodeRegExp)!==null&&Me!==void 0?Me:!0,int32range:(v=t.int32range)!==null&&v!==void 0?v:!0,uriResolver:z}}var Ut=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...yl(e)};let{es5:r,lines:i}=this.opts.code;this.scope=new ol.ValueScope({scope:{},prefixes:cl,es5:r,lines:i}),this.logger=bl(e.logger);let a=e.validateFormats;e.validateFormats=!1,this.RULES=(0,nl.getRules)(),Gn.call(this,ul,e,"NOT SUPPORTED"),Gn.call(this,ll,e,"DEPRECATED","warn"),this._metaOpts=fl.call(this),e.formats&&_l.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&gl.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),ml.call(this),e.validateFormats=a}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:i}=this.opts,a=Mn;i==="id"&&(a={...Mn},a.id=a.$id,delete a.$id),r&&e&&this.addMetaSchema(a,a[i],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let i;if(typeof e=="string"){if(i=this.getSchema(e),!i)throw new Error(`no schema with key or ref "${e}"`)}else i=this.compile(e);let a=i(r);return"$async"in i||(this.errors=i.errors),a}compile(e,r){let i=this._addSchema(e,r);return i.validate||this._compileSchemaEnv(i)}compileAsync(e,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,e,r);async function a(c,u){await s.call(this,c.$schema);let y=this._addSchema(c,u);return y.validate||n.call(this,y)}async function s(c){c&&!this.getSchema(c)&&await a.call(this,{$ref:c},!0)}async function n(c){try{return this._compileSchemaEnv(c)}catch(u){if(!(u instanceof Vn.default))throw u;return o.call(this,u),await p.call(this,u.missingSchema),n.call(this,c)}}function o({missingSchema:c,missingRef:u}){if(this.refs[c])throw new Error(`AnySchema ${c} is loaded but ${u} cannot be resolved`)}async function p(c){let u=await d.call(this,c);this.refs[c]||await s.call(this,u.$schema),this.refs[c]||this.addSchema(u,c,r)}async function d(c){let u=this._loading[c];if(u)return u;try{return await(this._loading[c]=i(c))}finally{delete this._loading[c]}}}addSchema(e,r,i,a=this.opts.validateSchema){if(Array.isArray(e)){for(let n of e)this.addSchema(n,void 0,i,a);return this}let s;if(typeof e=="object"){let{schemaId:n}=this.opts;if(s=e[n],s!==void 0&&typeof s!="string")throw new Error(`schema ${n} must be string`)}return r=(0,Gt.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,i,r,a,!0),this}addMetaSchema(e,r,i=this.opts.validateSchema){return this.addSchema(e,r,!0,i),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let i;if(i=e.$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,e);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(e){let r;for(;typeof(r=Un.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:i}=this.opts,a=new Dt.SchemaEnv({schema:{},schemaId:i});if(r=Dt.resolveSchema.call(this,a,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=Un.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let i=e[this.opts.schemaId];return i&&(i=(0,Gt.normalizeId)(i),delete this.schemas[i],delete this.refs[i]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let i;if(typeof e=="string")i=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=i);else if(typeof e=="object"&&r===void 0){if(r=e,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(jl.call(this,i,r),!r)return(0,Fi.eachItem)(i,s=>Vi.call(this,s)),this;Pl.call(this,r);let a={...r,type:(0,kr.getJSONTypes)(r.type),schemaType:(0,kr.getJSONTypes)(r.schemaType)};return(0,Fi.eachItem)(i,a.type.length===0?s=>Vi.call(this,s,a):s=>a.type.forEach(n=>Vi.call(this,s,a,n))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let i of r.rules){let a=i.rules.findIndex(s=>s.keyword===e);a>=0&&i.rules.splice(a,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:i="data"}={}){return!e||e.length===0?"No errors":e.map(a=>`${i}${a.instancePath} ${a.message}`).reduce((a,s)=>a+r+s)}$dataMetaSchema(e,r){let i=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let a of r){let s=a.split("/").slice(1),n=e;for(let o of s)n=n[o];for(let o in i){let p=i[o];if(typeof p!="object")continue;let{$data:d}=p.definition,c=n[o];d&&c&&(n[o]=Kn(c))}}return e}_removeAllSchemas(e,r){for(let i in e){let a=e[i];(!r||r.test(i))&&(typeof a=="string"?delete e[i]:a&&!a.meta&&(this._cache.delete(a.schema),delete e[i]))}}_addSchema(e,r,i,a=this.opts.validateSchema,s=this.opts.addUsedSchema){let n,{schemaId:o}=this.opts;if(typeof e=="object")n=e[o];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let p=this._cache.get(e);if(p!==void 0)return p;i=(0,Gt.normalizeId)(n||i);let d=Gt.getSchemaRefs.call(this,e,i);return p=new Dt.SchemaEnv({schema:e,schemaId:o,meta:r,baseId:i,localRefs:d}),this._cache.set(p.schema,p),s&&!i.startsWith("#")&&(i&&this._checkUnique(i),this.refs[i]=p),a&&this.validateSchema(e,!0),p}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):Dt.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{Dt.compileSchema.call(this,e)}finally{this.opts=r}}};Ut.ValidationError=sl.default;Ut.MissingRefError=Vn.default;B.default=Ut;function Gn(t,e,r,i="error"){for(let a in t){let s=a;s in e&&this.logger[i](`${r}: option ${a}. ${t[s]}`)}}function Un(t){return t=(0,Gt.normalizeId)(t),this.schemas[t]||this.refs[t]}function ml(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function _l(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function gl(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function fl(){let t={...this.opts};for(let e of dl)delete t[e];return t}var hl={log(){},warn(){},error(){}};function bl(t){if(t===!1)return hl;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var vl=/^[a-z_$][a-z0-9_$:-]*$/i;function jl(t,e){let{RULES:r}=this;if((0,Fi.eachItem)(t,i=>{if(r.keywords[i])throw new Error(`Keyword ${i} is already defined`);if(!vl.test(i))throw new Error(`Keyword ${i} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function Vi(t,e,r){var i;let a=e?.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[t]=!0,!e)return;let o={keyword:t,definition:{...e,type:(0,kr.getJSONTypes)(e.type),schemaType:(0,kr.getJSONTypes)(e.schemaType)}};e.before?wl.call(this,n,o,e.before):n.rules.push(o),s.all[t]=o,(i=e.implements)===null||i===void 0||i.forEach(p=>this.addKeyword(p))}function wl(t,e,r){let i=t.rules.findIndex(a=>a.keyword===r);i>=0?t.rules.splice(i,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function Pl(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=Kn(e)),t.validateSchema=this.compile(e,!0))}var ql={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Kn(t){return{anyOf:[t,ql]}}});var Hn=b(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});var kl={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Hi.default=kl});var zr=b(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.callRef=Je.getValidate=void 0;var $l=dt(),Bn=ue(),oe=k(),lt=ce(),Jn=Ct(),$r=I(),xl={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:i}=t,{baseId:a,schemaEnv:s,validateName:n,opts:o,self:p}=i,{root:d}=s;if((r==="#"||r==="#/")&&a===d.baseId)return u();let c=Jn.resolveRef.call(p,d,a,r);if(c===void 0)throw new $l.default(i.opts.uriResolver,a,r);if(c instanceof Jn.SchemaEnv)return y(c);return g(c);function u(){if(s===d)return xr(t,n,s,s.$async);let l=e.scopeValue("root",{ref:d});return xr(t,(0,oe._)`${l}.validate`,d,d.$async)}function y(l){let _=Wn(t,l);xr(t,_,l,l.$async)}function g(l){let _=e.scopeValue("schema",o.code.source===!0?{ref:l,code:(0,oe.stringify)(l)}:{ref:l}),m=e.name("valid"),h=t.subschema({schema:l,dataTypes:[],schemaPath:oe.nil,topSchemaRef:_,errSchemaPath:r},m);t.mergeEvaluated(h),t.ok(m)}}};function Wn(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,oe._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Je.getValidate=Wn;function xr(t,e,r,i){let{gen:a,it:s}=t,{allErrors:n,schemaEnv:o,opts:p}=s,d=p.passContext?lt.default.this:oe.nil;i?c():u();function c(){if(!o.$async)throw new Error("async schema referenced by sync schema");let l=a.let("valid");a.try(()=>{a.code((0,oe._)`await ${(0,Bn.callValidateCode)(t,e,d)}`),g(e),n||a.assign(l,!0)},_=>{a.if((0,oe._)`!(${_} instanceof ${s.ValidationError})`,()=>a.throw(_)),y(_),n||a.assign(l,!1)}),t.ok(l)}function u(){t.result((0,Bn.callValidateCode)(t,e,d),()=>g(e),()=>y(e))}function y(l){let _=(0,oe._)`${l}.errors`;a.assign(lt.default.vErrors,(0,oe._)`${lt.default.vErrors} === null ? ${_} : ${lt.default.vErrors}.concat(${_})`),a.assign(lt.default.errors,(0,oe._)`${lt.default.vErrors}.length`)}function g(l){var _;if(!s.opts.unevaluated)return;let m=(_=r?.validate)===null||_===void 0?void 0:_.evaluated;if(s.props!==!0)if(m&&!m.dynamicProps)m.props!==void 0&&(s.props=$r.mergeEvaluated.props(a,m.props,s.props));else{let h=a.var("props",(0,oe._)`${l}.evaluated.props`);s.props=$r.mergeEvaluated.props(a,h,s.props,oe.Name)}if(s.items!==!0)if(m&&!m.dynamicItems)m.items!==void 0&&(s.items=$r.mergeEvaluated.items(a,m.items,s.items));else{let h=a.var("items",(0,oe._)`${l}.evaluated.items`);s.items=$r.mergeEvaluated.items(a,h,s.items,oe.Name)}}}Je.callRef=xr;Je.default=xl});var Ji=b(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});var zl=Hn(),Ol=zr(),Al=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",zl.default,Ol.default];Bi.default=Al});var Yn=b(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});var Or=k(),Ne=Or.operators,Ar={maximum:{okStr:"<=",ok:Ne.LTE,fail:Ne.GT},minimum:{okStr:">=",ok:Ne.GTE,fail:Ne.LT},exclusiveMaximum:{okStr:"<",ok:Ne.LT,fail:Ne.GTE},exclusiveMinimum:{okStr:">",ok:Ne.GT,fail:Ne.LTE}},Il={message:({keyword:t,schemaCode:e})=>(0,Or.str)`must be ${Ar[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Or._)`{comparison: ${Ar[t].okStr}, limit: ${e}}`},El={keyword:Object.keys(Ar),type:"number",schemaType:"number",$data:!0,error:Il,code(t){let{keyword:e,data:r,schemaCode:i}=t;t.fail$data((0,Or._)`${r} ${Ar[e].fail} ${i} || isNaN(${r})`)}};Wi.default=El});var Qn=b(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});var Vt=k(),Sl={message:({schemaCode:t})=>(0,Vt.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Vt._)`{multipleOf: ${t}}`},Tl={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:Sl,code(t){let{gen:e,data:r,schemaCode:i,it:a}=t,s=a.opts.multipleOfPrecision,n=e.let("res"),o=s?(0,Vt._)`Math.abs(Math.round(${n}) - ${n}) > 1e-${s}`:(0,Vt._)`${n} !== parseInt(${n})`;t.fail$data((0,Vt._)`(${i} === 0 || (${n} = ${r}/${i}, ${o}))`)}};Yi.default=Tl});var eo=b(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});function Xn(t){let e=t.length,r=0,i=0,a;for(;i<e;)r++,a=t.charCodeAt(i++),a>=55296&&a<=56319&&i<e&&(a=t.charCodeAt(i),(a&64512)===56320&&i++);return r}Qi.default=Xn;Xn.code='require("ajv/dist/runtime/ucs2length").default'});var to=b(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});var We=k(),Zl=I(),Nl=eo(),Rl={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,We.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,We._)`{limit: ${t}}`},Ll={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Rl,code(t){let{keyword:e,data:r,schemaCode:i,it:a}=t,s=e==="maxLength"?We.operators.GT:We.operators.LT,n=a.opts.unicode===!1?(0,We._)`${r}.length`:(0,We._)`${(0,Zl.useFunc)(t.gen,Nl.default)}(${r})`;t.fail$data((0,We._)`${n} ${s} ${i}`)}};Xi.default=Ll});var ro=b(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});var Cl=ue(),Ml=I(),yt=k(),Dl={message:({schemaCode:t})=>(0,yt.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,yt._)`{pattern: ${t}}`},Gl={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Dl,code(t){let{gen:e,data:r,$data:i,schema:a,schemaCode:s,it:n}=t,o=n.opts.unicodeRegExp?"u":"";if(i){let{regExp:p}=n.opts.code,d=p.code==="new RegExp"?(0,yt._)`new RegExp`:(0,Ml.useFunc)(e,p),c=e.let("valid");e.try(()=>e.assign(c,(0,yt._)`${d}(${s}, ${o}).test(${r})`),()=>e.assign(c,!1)),t.fail$data((0,yt._)`!${c}`)}else{let p=(0,Cl.usePattern)(t,a);t.fail$data((0,yt._)`!${p}.test(${r})`)}}};ea.default=Gl});var io=b(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});var Ft=k(),Ul={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,Ft.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,Ft._)`{limit: ${t}}`},Vl={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Ul,code(t){let{keyword:e,data:r,schemaCode:i}=t,a=e==="maxProperties"?Ft.operators.GT:Ft.operators.LT;t.fail$data((0,Ft._)`Object.keys(${r}).length ${a} ${i}`)}};ta.default=Vl});var ao=b(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});var Kt=ue(),Ht=k(),Fl=I(),Kl={message:({params:{missingProperty:t}})=>(0,Ht.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Ht._)`{missingProperty: ${t}}`},Hl={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Kl,code(t){let{gen:e,schema:r,schemaCode:i,data:a,$data:s,it:n}=t,{opts:o}=n;if(!s&&r.length===0)return;let p=r.length>=o.loopRequired;if(n.allErrors?d():c(),o.strictRequired){let g=t.parentSchema.properties,{definedProperties:l}=t.it;for(let _ of r)if(g?.[_]===void 0&&!l.has(_)){let m=n.schemaEnv.baseId+n.errSchemaPath,h=`required property "${_}" is not defined at "${m}" (strictRequired)`;(0,Fl.checkStrictMode)(n,h,n.opts.strictRequired)}}function d(){if(p||s)t.block$data(Ht.nil,u);else for(let g of r)(0,Kt.checkReportMissingProp)(t,g)}function c(){let g=e.let("missing");if(p||s){let l=e.let("valid",!0);t.block$data(l,()=>y(g,l)),t.ok(l)}else e.if((0,Kt.checkMissingProp)(t,r,g)),(0,Kt.reportMissingProp)(t,g),e.else()}function u(){e.forOf("prop",i,g=>{t.setParams({missingProperty:g}),e.if((0,Kt.noPropertyInData)(e,a,g,o.ownProperties),()=>t.error())})}function y(g,l){t.setParams({missingProperty:g}),e.forOf(g,i,()=>{e.assign(l,(0,Kt.propertyInData)(e,a,g,o.ownProperties)),e.if((0,Ht.not)(l),()=>{t.error(),e.break()})},Ht.nil)}}};ra.default=Hl});var so=b(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});var Bt=k(),Bl={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,Bt.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,Bt._)`{limit: ${t}}`},Jl={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Bl,code(t){let{keyword:e,data:r,schemaCode:i}=t,a=e==="maxItems"?Bt.operators.GT:Bt.operators.LT;t.fail$data((0,Bt._)`${r}.length ${a} ${i}`)}};ia.default=Jl});var Ir=b(aa=>{"use strict";Object.defineProperty(aa,"__esModule",{value:!0});var no=ki();no.code='require("ajv/dist/runtime/equal").default';aa.default=no});var oo=b(na=>{"use strict";Object.defineProperty(na,"__esModule",{value:!0});var sa=Tt(),J=k(),Wl=I(),Yl=Ir(),Ql={message:({params:{i:t,j:e}})=>(0,J.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,J._)`{i: ${t}, j: ${e}}`},Xl={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Ql,code(t){let{gen:e,data:r,$data:i,schema:a,parentSchema:s,schemaCode:n,it:o}=t;if(!i&&!a)return;let p=e.let("valid"),d=s.items?(0,sa.getSchemaTypes)(s.items):[];t.block$data(p,c,(0,J._)`${n} === false`),t.ok(p);function c(){let l=e.let("i",(0,J._)`${r}.length`),_=e.let("j");t.setParams({i:l,j:_}),e.assign(p,!0),e.if((0,J._)`${l} > 1`,()=>(u()?y:g)(l,_))}function u(){return d.length>0&&!d.some(l=>l==="object"||l==="array")}function y(l,_){let m=e.name("item"),h=(0,sa.checkDataTypes)(d,m,o.opts.strictNumbers,sa.DataType.Wrong),$=e.const("indices",(0,J._)`{}`);e.for((0,J._)`;${l}--;`,()=>{e.let(m,(0,J._)`${r}[${l}]`),e.if(h,(0,J._)`continue`),d.length>1&&e.if((0,J._)`typeof ${m} == "string"`,(0,J._)`${m} += "_"`),e.if((0,J._)`typeof ${$}[${m}] == "number"`,()=>{e.assign(_,(0,J._)`${$}[${m}]`),t.error(),e.assign(p,!1).break()}).code((0,J._)`${$}[${m}] = ${l}`)})}function g(l,_){let m=(0,Wl.useFunc)(e,Yl.default),h=e.name("outer");e.label(h).for((0,J._)`;${l}--;`,()=>e.for((0,J._)`${_} = ${l}; ${_}--;`,()=>e.if((0,J._)`${m}(${r}[${l}], ${r}[${_}])`,()=>{t.error(),e.assign(p,!1).break(h)})))}}};na.default=Xl});var po=b(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});var oa=k(),ey=I(),ty=Ir(),ry={message:"must be equal to constant",params:({schemaCode:t})=>(0,oa._)`{allowedValue: ${t}}`},iy={keyword:"const",$data:!0,error:ry,code(t){let{gen:e,data:r,$data:i,schemaCode:a,schema:s}=t;i||s&&typeof s=="object"?t.fail$data((0,oa._)`!${(0,ey.useFunc)(e,ty.default)}(${r}, ${a})`):t.fail((0,oa._)`${s} !== ${r}`)}};pa.default=iy});var co=b(da=>{"use strict";Object.defineProperty(da,"__esModule",{value:!0});var Jt=k(),ay=I(),sy=Ir(),ny={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,Jt._)`{allowedValues: ${t}}`},oy={keyword:"enum",schemaType:"array",$data:!0,error:ny,code(t){let{gen:e,data:r,$data:i,schema:a,schemaCode:s,it:n}=t;if(!i&&a.length===0)throw new Error("enum must have non-empty array");let o=a.length>=n.opts.loopEnum,p,d=()=>p??(p=(0,ay.useFunc)(e,sy.default)),c;if(o||i)c=e.let("valid"),t.block$data(c,u);else{if(!Array.isArray(a))throw new Error("ajv implementation error");let g=e.const("vSchema",s);c=(0,Jt.or)(...a.map((l,_)=>y(g,_)))}t.pass(c);function u(){e.assign(c,!1),e.forOf("v",s,g=>e.if((0,Jt._)`${d()}(${r}, ${g})`,()=>e.assign(c,!0).break()))}function y(g,l){let _=a[l];return typeof _=="object"&&_!==null?(0,Jt._)`${d()}(${r}, ${g}[${l}])`:(0,Jt._)`${r} === ${_}`}}};da.default=oy});var ua=b(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});var py=Yn(),dy=Qn(),cy=to(),uy=ro(),ly=io(),yy=ao(),my=so(),_y=oo(),gy=po(),fy=co(),hy=[py.default,dy.default,cy.default,uy.default,ly.default,yy.default,my.default,_y.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},gy.default,fy.default];ca.default=hy});var ya=b(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.validateAdditionalItems=void 0;var Ye=k(),la=I(),by={message:({params:{len:t}})=>(0,Ye.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Ye._)`{limit: ${t}}`},vy={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:by,code(t){let{parentSchema:e,it:r}=t,{items:i}=e;if(!Array.isArray(i)){(0,la.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}uo(t,i)}};function uo(t,e){let{gen:r,schema:i,data:a,keyword:s,it:n}=t;n.items=!0;let o=r.const("len",(0,Ye._)`${a}.length`);if(i===!1)t.setParams({len:e.length}),t.pass((0,Ye._)`${o} <= ${e.length}`);else if(typeof i=="object"&&!(0,la.alwaysValidSchema)(n,i)){let d=r.var("valid",(0,Ye._)`${o} <= ${e.length}`);r.if((0,Ye.not)(d),()=>p(d)),t.ok(d)}function p(d){r.forRange("i",e.length,o,c=>{t.subschema({keyword:s,dataProp:c,dataPropType:la.Type.Num},d),n.allErrors||r.if((0,Ye.not)(d),()=>r.break())})}}Wt.validateAdditionalItems=uo;Wt.default=vy});var ma=b(Yt=>{"use strict";Object.defineProperty(Yt,"__esModule",{value:!0});Yt.validateTuple=void 0;var lo=k(),Er=I(),jy=ue(),wy={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return yo(t,"additionalItems",e);r.items=!0,!(0,Er.alwaysValidSchema)(r,e)&&t.ok((0,jy.validateArray)(t))}};function yo(t,e,r=t.schema){let{gen:i,parentSchema:a,data:s,keyword:n,it:o}=t;c(a),o.opts.unevaluated&&r.length&&o.items!==!0&&(o.items=Er.mergeEvaluated.items(i,r.length,o.items));let p=i.name("valid"),d=i.const("len",(0,lo._)`${s}.length`);r.forEach((u,y)=>{(0,Er.alwaysValidSchema)(o,u)||(i.if((0,lo._)`${d} > ${y}`,()=>t.subschema({keyword:n,schemaProp:y,dataProp:y},p)),t.ok(p))});function c(u){let{opts:y,errSchemaPath:g}=o,l=r.length,_=l===u.minItems&&(l===u.maxItems||u[e]===!1);if(y.strictTuples&&!_){let m=`"${n}" is ${l}-tuple, but minItems or maxItems/${e} are not specified or different at path "${g}"`;(0,Er.checkStrictMode)(o,m,y.strictTuples)}}}Yt.validateTuple=yo;Yt.default=wy});var mo=b(_a=>{"use strict";Object.defineProperty(_a,"__esModule",{value:!0});var Py=ma(),qy={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,Py.validateTuple)(t,"items")};_a.default=qy});var go=b(ga=>{"use strict";Object.defineProperty(ga,"__esModule",{value:!0});var _o=k(),ky=I(),$y=ue(),xy=ya(),zy={message:({params:{len:t}})=>(0,_o.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,_o._)`{limit: ${t}}`},Oy={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:zy,code(t){let{schema:e,parentSchema:r,it:i}=t,{prefixItems:a}=r;i.items=!0,!(0,ky.alwaysValidSchema)(i,e)&&(a?(0,xy.validateAdditionalItems)(t,a):t.ok((0,$y.validateArray)(t)))}};ga.default=Oy});var fo=b(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});var ye=k(),Sr=I(),Ay={message:({params:{min:t,max:e}})=>e===void 0?(0,ye.str)`must contain at least ${t} valid item(s)`:(0,ye.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,ye._)`{minContains: ${t}}`:(0,ye._)`{minContains: ${t}, maxContains: ${e}}`},Iy={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:Ay,code(t){let{gen:e,schema:r,parentSchema:i,data:a,it:s}=t,n,o,{minContains:p,maxContains:d}=i;s.opts.next?(n=p===void 0?1:p,o=d):n=1;let c=e.const("len",(0,ye._)`${a}.length`);if(t.setParams({min:n,max:o}),o===void 0&&n===0){(0,Sr.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(o!==void 0&&n>o){(0,Sr.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,Sr.alwaysValidSchema)(s,r)){let _=(0,ye._)`${c} >= ${n}`;o!==void 0&&(_=(0,ye._)`${_} && ${c} <= ${o}`),t.pass(_);return}s.items=!0;let u=e.name("valid");o===void 0&&n===1?g(u,()=>e.if(u,()=>e.break())):n===0?(e.let(u,!0),o!==void 0&&e.if((0,ye._)`${a}.length > 0`,y)):(e.let(u,!1),y()),t.result(u,()=>t.reset());function y(){let _=e.name("_valid"),m=e.let("count",0);g(_,()=>e.if(_,()=>l(m)))}function g(_,m){e.forRange("i",0,c,h=>{t.subschema({keyword:"contains",dataProp:h,dataPropType:Sr.Type.Num,compositeRule:!0},_),m()})}function l(_){e.code((0,ye._)`${_}++`),o===void 0?e.if((0,ye._)`${_} >= ${n}`,()=>e.assign(u,!0).break()):(e.if((0,ye._)`${_} > ${o}`,()=>e.assign(u,!1).break()),n===1?e.assign(u,!0):e.if((0,ye._)`${_} >= ${n}`,()=>e.assign(u,!0)))}}};fa.default=Iy});var Tr=b(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});Pe.validateSchemaDeps=Pe.validatePropertyDeps=Pe.error=void 0;var ha=k(),Ey=I(),Qt=ue();Pe.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let i=e===1?"property":"properties";return(0,ha.str)`must have ${i} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:i}})=>(0,ha._)`{property: ${t},
|
|
7
|
+
missingProperty: ${i},
|
|
8
|
+
depsCount: ${e},
|
|
9
|
+
deps: ${r}}`};var Sy={keyword:"dependencies",type:"object",schemaType:"object",error:Pe.error,code(t){let[e,r]=Ty(t);ho(t,e),bo(t,r)}};function Ty({schema:t}){let e={},r={};for(let i in t){if(i==="__proto__")continue;let a=Array.isArray(t[i])?e:r;a[i]=t[i]}return[e,r]}function ho(t,e=t.schema){let{gen:r,data:i,it:a}=t;if(Object.keys(e).length===0)return;let s=r.let("missing");for(let n in e){let o=e[n];if(o.length===0)continue;let p=(0,Qt.propertyInData)(r,i,n,a.opts.ownProperties);t.setParams({property:n,depsCount:o.length,deps:o.join(", ")}),a.allErrors?r.if(p,()=>{for(let d of o)(0,Qt.checkReportMissingProp)(t,d)}):(r.if((0,ha._)`${p} && (${(0,Qt.checkMissingProp)(t,o,s)})`),(0,Qt.reportMissingProp)(t,s),r.else())}}Pe.validatePropertyDeps=ho;function bo(t,e=t.schema){let{gen:r,data:i,keyword:a,it:s}=t,n=r.name("valid");for(let o in e)(0,Ey.alwaysValidSchema)(s,e[o])||(r.if((0,Qt.propertyInData)(r,i,o,s.opts.ownProperties),()=>{let p=t.subschema({keyword:a,schemaProp:o},n);t.mergeValidEvaluated(p,n)},()=>r.var(n,!0)),t.ok(n))}Pe.validateSchemaDeps=bo;Pe.default=Sy});var jo=b(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});var vo=k(),Zy=I(),Ny={message:"property name must be valid",params:({params:t})=>(0,vo._)`{propertyName: ${t.propertyName}}`},Ry={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Ny,code(t){let{gen:e,schema:r,data:i,it:a}=t;if((0,Zy.alwaysValidSchema)(a,r))return;let s=e.name("valid");e.forIn("key",i,n=>{t.setParams({propertyName:n}),t.subschema({keyword:"propertyNames",data:n,dataTypes:["string"],propertyName:n,compositeRule:!0},s),e.if((0,vo.not)(s),()=>{t.error(!0),a.allErrors||e.break()})}),t.ok(s)}};ba.default=Ry});var ja=b(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});var Zr=ue(),he=k(),Ly=ce(),Nr=I(),Cy={message:"must NOT have additional properties",params:({params:t})=>(0,he._)`{additionalProperty: ${t.additionalProperty}}`},My={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Cy,code(t){let{gen:e,schema:r,parentSchema:i,data:a,errsCount:s,it:n}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:o,opts:p}=n;if(n.props=!0,p.removeAdditional!=="all"&&(0,Nr.alwaysValidSchema)(n,r))return;let d=(0,Zr.allSchemaProperties)(i.properties),c=(0,Zr.allSchemaProperties)(i.patternProperties);u(),t.ok((0,he._)`${s} === ${Ly.default.errors}`);function u(){e.forIn("key",a,m=>{!d.length&&!c.length?l(m):e.if(y(m),()=>l(m))})}function y(m){let h;if(d.length>8){let $=(0,Nr.schemaRefOrVal)(n,i.properties,"properties");h=(0,Zr.isOwnProperty)(e,$,m)}else d.length?h=(0,he.or)(...d.map($=>(0,he._)`${m} === ${$}`)):h=he.nil;return c.length&&(h=(0,he.or)(h,...c.map($=>(0,he._)`${(0,Zr.usePattern)(t,$)}.test(${m})`))),(0,he.not)(h)}function g(m){e.code((0,he._)`delete ${a}[${m}]`)}function l(m){if(p.removeAdditional==="all"||p.removeAdditional&&r===!1){g(m);return}if(r===!1){t.setParams({additionalProperty:m}),t.error(),o||e.break();return}if(typeof r=="object"&&!(0,Nr.alwaysValidSchema)(n,r)){let h=e.name("valid");p.removeAdditional==="failing"?(_(m,h,!1),e.if((0,he.not)(h),()=>{t.reset(),g(m)})):(_(m,h),o||e.if((0,he.not)(h),()=>e.break()))}}function _(m,h,$){let w={keyword:"additionalProperties",dataProp:m,dataPropType:Nr.Type.Str};$===!1&&Object.assign(w,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(w,h)}}};va.default=My});var qo=b(Pa=>{"use strict";Object.defineProperty(Pa,"__esModule",{value:!0});var Dy=pt(),wo=ue(),wa=I(),Po=ja(),Gy={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:i,data:a,it:s}=t;s.opts.removeAdditional==="all"&&i.additionalProperties===void 0&&Po.default.code(new Dy.KeywordCxt(s,Po.default,"additionalProperties"));let n=(0,wo.allSchemaProperties)(r);for(let u of n)s.definedProperties.add(u);s.opts.unevaluated&&n.length&&s.props!==!0&&(s.props=wa.mergeEvaluated.props(e,(0,wa.toHash)(n),s.props));let o=n.filter(u=>!(0,wa.alwaysValidSchema)(s,r[u]));if(o.length===0)return;let p=e.name("valid");for(let u of o)d(u)?c(u):(e.if((0,wo.propertyInData)(e,a,u,s.opts.ownProperties)),c(u),s.allErrors||e.else().var(p,!0),e.endIf()),t.it.definedProperties.add(u),t.ok(p);function d(u){return s.opts.useDefaults&&!s.compositeRule&&r[u].default!==void 0}function c(u){t.subschema({keyword:"properties",schemaProp:u,dataProp:u},p)}}};Pa.default=Gy});var zo=b(qa=>{"use strict";Object.defineProperty(qa,"__esModule",{value:!0});var ko=ue(),Rr=k(),$o=I(),xo=I(),Uy={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:i,parentSchema:a,it:s}=t,{opts:n}=s,o=(0,ko.allSchemaProperties)(r),p=o.filter(_=>(0,$o.alwaysValidSchema)(s,r[_]));if(o.length===0||p.length===o.length&&(!s.opts.unevaluated||s.props===!0))return;let d=n.strictSchema&&!n.allowMatchingProperties&&a.properties,c=e.name("valid");s.props!==!0&&!(s.props instanceof Rr.Name)&&(s.props=(0,xo.evaluatedPropsToName)(e,s.props));let{props:u}=s;y();function y(){for(let _ of o)d&&g(_),s.allErrors?l(_):(e.var(c,!0),l(_),e.if(c))}function g(_){for(let m in d)new RegExp(_).test(m)&&(0,$o.checkStrictMode)(s,`property ${m} matches pattern ${_} (use allowMatchingProperties)`)}function l(_){e.forIn("key",i,m=>{e.if((0,Rr._)`${(0,ko.usePattern)(t,_)}.test(${m})`,()=>{let h=p.includes(_);h||t.subschema({keyword:"patternProperties",schemaProp:_,dataProp:m,dataPropType:xo.Type.Str},c),s.opts.unevaluated&&u!==!0?e.assign((0,Rr._)`${u}[${m}]`,!0):!h&&!s.allErrors&&e.if((0,Rr.not)(c),()=>e.break())})})}}};qa.default=Uy});var Oo=b(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});var Vy=I(),Fy={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:i}=t;if((0,Vy.alwaysValidSchema)(i,r)){t.fail();return}let a=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},a),t.failResult(a,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};ka.default=Fy});var Ao=b($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});var Ky=ue(),Hy={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Ky.validateUnion,error:{message:"must match a schema in anyOf"}};$a.default=Hy});var Io=b(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});var Lr=k(),By=I(),Jy={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,Lr._)`{passingSchemas: ${t.passing}}`},Wy={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Jy,code(t){let{gen:e,schema:r,parentSchema:i,it:a}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(a.opts.discriminator&&i.discriminator)return;let s=r,n=e.let("valid",!1),o=e.let("passing",null),p=e.name("_valid");t.setParams({passing:o}),e.block(d),t.result(n,()=>t.reset(),()=>t.error(!0));function d(){s.forEach((c,u)=>{let y;(0,By.alwaysValidSchema)(a,c)?e.var(p,!0):y=t.subschema({keyword:"oneOf",schemaProp:u,compositeRule:!0},p),u>0&&e.if((0,Lr._)`${p} && ${n}`).assign(n,!1).assign(o,(0,Lr._)`[${o}, ${u}]`).else(),e.if(p,()=>{e.assign(n,!0),e.assign(o,u),y&&t.mergeEvaluated(y,Lr.Name)})})}}};xa.default=Wy});var Eo=b(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});var Yy=I(),Qy={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let a=e.name("valid");r.forEach((s,n)=>{if((0,Yy.alwaysValidSchema)(i,s))return;let o=t.subschema({keyword:"allOf",schemaProp:n},a);t.ok(a),t.mergeEvaluated(o)})}};za.default=Qy});var Zo=b(Oa=>{"use strict";Object.defineProperty(Oa,"__esModule",{value:!0});var Cr=k(),To=I(),Xy={message:({params:t})=>(0,Cr.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,Cr._)`{failingKeyword: ${t.ifClause}}`},em={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Xy,code(t){let{gen:e,parentSchema:r,it:i}=t;r.then===void 0&&r.else===void 0&&(0,To.checkStrictMode)(i,'"if" without "then" and "else" is ignored');let a=So(i,"then"),s=So(i,"else");if(!a&&!s)return;let n=e.let("valid",!0),o=e.name("_valid");if(p(),t.reset(),a&&s){let c=e.let("ifClause");t.setParams({ifClause:c}),e.if(o,d("then",c),d("else",c))}else a?e.if(o,d("then")):e.if((0,Cr.not)(o),d("else"));t.pass(n,()=>t.error(!0));function p(){let c=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},o);t.mergeEvaluated(c)}function d(c,u){return()=>{let y=t.subschema({keyword:c},o);e.assign(n,o),t.mergeValidEvaluated(y,n),u?e.assign(u,(0,Cr._)`${c}`):t.setParams({ifClause:c})}}}};function So(t,e){let r=t.schema[e];return r!==void 0&&!(0,To.alwaysValidSchema)(t,r)}Oa.default=em});var No=b(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});var tm=I(),rm={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,tm.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Aa.default=rm});var Ea=b(Ia=>{"use strict";Object.defineProperty(Ia,"__esModule",{value:!0});var im=ya(),am=mo(),sm=ma(),nm=go(),om=fo(),pm=Tr(),dm=jo(),cm=ja(),um=qo(),lm=zo(),ym=Oo(),mm=Ao(),_m=Io(),gm=Eo(),fm=Zo(),hm=No();function bm(t=!1){let e=[ym.default,mm.default,_m.default,gm.default,fm.default,hm.default,dm.default,cm.default,pm.default,um.default,lm.default];return t?e.push(am.default,nm.default):e.push(im.default,sm.default),e.push(om.default),e}Ia.default=bm});var Ta=b(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.dynamicAnchor=void 0;var Sa=k(),vm=ce(),Ro=Ct(),jm=zr(),wm={keyword:"$dynamicAnchor",schemaType:"string",code:t=>Lo(t,t.schema)};function Lo(t,e){let{gen:r,it:i}=t;i.schemaEnv.root.dynamicAnchors[e]=!0;let a=(0,Sa._)`${vm.default.dynamicAnchors}${(0,Sa.getProperty)(e)}`,s=i.errSchemaPath==="#"?i.validateName:Pm(t);r.if((0,Sa._)`!${a}`,()=>r.assign(a,s))}Xt.dynamicAnchor=Lo;function Pm(t){let{schemaEnv:e,schema:r,self:i}=t.it,{root:a,baseId:s,localRefs:n,meta:o}=e.root,{schemaId:p}=i.opts,d=new Ro.SchemaEnv({schema:r,schemaId:p,root:a,baseId:s,localRefs:n,meta:o});return Ro.compileSchema.call(i,d),(0,jm.getValidate)(t,d)}Xt.default=wm});var Za=b(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.dynamicRef=void 0;var Co=k(),qm=ce(),Mo=zr(),km={keyword:"$dynamicRef",schemaType:"string",code:t=>Do(t,t.schema)};function Do(t,e){let{gen:r,keyword:i,it:a}=t;if(e[0]!=="#")throw new Error(`"${i}" only supports hash fragment reference`);let s=e.slice(1);if(a.allErrors)n();else{let p=r.let("valid",!1);n(p),t.ok(p)}function n(p){if(a.schemaEnv.root.dynamicAnchors[s]){let d=r.let("_v",(0,Co._)`${qm.default.dynamicAnchors}${(0,Co.getProperty)(s)}`);r.if(d,o(d,p),o(a.validateName,p))}else o(a.validateName,p)()}function o(p,d){return d?()=>r.block(()=>{(0,Mo.callRef)(t,p),r.let(d,!0)}):()=>(0,Mo.callRef)(t,p)}}er.dynamicRef=Do;er.default=km});var Go=b(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});var $m=Ta(),xm=I(),zm={keyword:"$recursiveAnchor",schemaType:"boolean",code(t){t.schema?(0,$m.dynamicAnchor)(t,""):(0,xm.checkStrictMode)(t.it,"$recursiveAnchor: false is ignored")}};Na.default=zm});var Uo=b(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});var Om=Za(),Am={keyword:"$recursiveRef",schemaType:"string",code:t=>(0,Om.dynamicRef)(t,t.schema)};Ra.default=Am});var Vo=b(La=>{"use strict";Object.defineProperty(La,"__esModule",{value:!0});var Im=Ta(),Em=Za(),Sm=Go(),Tm=Uo(),Zm=[Im.default,Em.default,Sm.default,Tm.default];La.default=Zm});var Ko=b(Ca=>{"use strict";Object.defineProperty(Ca,"__esModule",{value:!0});var Fo=Tr(),Nm={keyword:"dependentRequired",type:"object",schemaType:"object",error:Fo.error,code:t=>(0,Fo.validatePropertyDeps)(t)};Ca.default=Nm});var Ho=b(Ma=>{"use strict";Object.defineProperty(Ma,"__esModule",{value:!0});var Rm=Tr(),Lm={keyword:"dependentSchemas",type:"object",schemaType:"object",code:t=>(0,Rm.validateSchemaDeps)(t)};Ma.default=Lm});var Bo=b(Da=>{"use strict";Object.defineProperty(Da,"__esModule",{value:!0});var Cm=I(),Mm={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:t,parentSchema:e,it:r}){e.contains===void 0&&(0,Cm.checkStrictMode)(r,`"${t}" without "contains" is ignored`)}};Da.default=Mm});var Jo=b(Ga=>{"use strict";Object.defineProperty(Ga,"__esModule",{value:!0});var Dm=Ko(),Gm=Ho(),Um=Bo(),Vm=[Dm.default,Gm.default,Um.default];Ga.default=Vm});var Yo=b(Ua=>{"use strict";Object.defineProperty(Ua,"__esModule",{value:!0});var Re=k(),Wo=I(),Fm=ce(),Km={message:"must NOT have unevaluated properties",params:({params:t})=>(0,Re._)`{unevaluatedProperty: ${t.unevaluatedProperty}}`},Hm={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:Km,code(t){let{gen:e,schema:r,data:i,errsCount:a,it:s}=t;if(!a)throw new Error("ajv implementation error");let{allErrors:n,props:o}=s;o instanceof Re.Name?e.if((0,Re._)`${o} !== true`,()=>e.forIn("key",i,u=>e.if(d(o,u),()=>p(u)))):o!==!0&&e.forIn("key",i,u=>o===void 0?p(u):e.if(c(o,u),()=>p(u))),s.props=!0,t.ok((0,Re._)`${a} === ${Fm.default.errors}`);function p(u){if(r===!1){t.setParams({unevaluatedProperty:u}),t.error(),n||e.break();return}if(!(0,Wo.alwaysValidSchema)(s,r)){let y=e.name("valid");t.subschema({keyword:"unevaluatedProperties",dataProp:u,dataPropType:Wo.Type.Str},y),n||e.if((0,Re.not)(y),()=>e.break())}}function d(u,y){return(0,Re._)`!${u} || !${u}[${y}]`}function c(u,y){let g=[];for(let l in u)u[l]===!0&&g.push((0,Re._)`${y} !== ${l}`);return(0,Re.and)(...g)}}};Ua.default=Hm});var Xo=b(Va=>{"use strict";Object.defineProperty(Va,"__esModule",{value:!0});var Qe=k(),Qo=I(),Bm={message:({params:{len:t}})=>(0,Qe.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Qe._)`{limit: ${t}}`},Jm={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:Bm,code(t){let{gen:e,schema:r,data:i,it:a}=t,s=a.items||0;if(s===!0)return;let n=e.const("len",(0,Qe._)`${i}.length`);if(r===!1)t.setParams({len:s}),t.fail((0,Qe._)`${n} > ${s}`);else if(typeof r=="object"&&!(0,Qo.alwaysValidSchema)(a,r)){let p=e.var("valid",(0,Qe._)`${n} <= ${s}`);e.if((0,Qe.not)(p),()=>o(p,s)),t.ok(p)}a.items=!0;function o(p,d){e.forRange("i",d,n,c=>{t.subschema({keyword:"unevaluatedItems",dataProp:c,dataPropType:Qo.Type.Num},p),a.allErrors||e.if((0,Qe.not)(p),()=>e.break())})}}};Va.default=Jm});var ep=b(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});var Wm=Yo(),Ym=Xo(),Qm=[Wm.default,Ym.default];Fa.default=Qm});var tp=b(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});var K=k(),Xm={message:({schemaCode:t})=>(0,K.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,K._)`{format: ${t}}`},e_={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Xm,code(t,e){let{gen:r,data:i,$data:a,schema:s,schemaCode:n,it:o}=t,{opts:p,errSchemaPath:d,schemaEnv:c,self:u}=o;if(!p.validateFormats)return;a?y():g();function y(){let l=r.scopeValue("formats",{ref:u.formats,code:p.code.formats}),_=r.const("fDef",(0,K._)`${l}[${n}]`),m=r.let("fType"),h=r.let("format");r.if((0,K._)`typeof ${_} == "object" && !(${_} instanceof RegExp)`,()=>r.assign(m,(0,K._)`${_}.type || "string"`).assign(h,(0,K._)`${_}.validate`),()=>r.assign(m,(0,K._)`"string"`).assign(h,_)),t.fail$data((0,K.or)($(),w()));function $(){return p.strictSchema===!1?K.nil:(0,K._)`${n} && !${h}`}function w(){let L=c.$async?(0,K._)`(${_}.async ? await ${h}(${i}) : ${h}(${i}))`:(0,K._)`${h}(${i})`,P=(0,K._)`(typeof ${h} == "function" ? ${L} : ${h}.test(${i}))`;return(0,K._)`${h} && ${h} !== true && ${m} === ${e} && !${P}`}}function g(){let l=u.formats[s];if(!l){$();return}if(l===!0)return;let[_,m,h]=w(l);_===e&&t.pass(L());function $(){if(p.strictSchema===!1){u.logger.warn(P());return}throw new Error(P());function P(){return`unknown format "${s}" ignored in schema at path "${d}"`}}function w(P){let ee=P instanceof RegExp?(0,K.regexpCode)(P):p.code.formats?(0,K._)`${p.code.formats}${(0,K.getProperty)(s)}`:void 0,H=r.scopeValue("formats",{key:s,ref:P,code:ee});return typeof P=="object"&&!(P instanceof RegExp)?[P.type||"string",P.validate,(0,K._)`${H}.validate`]:["string",P,H]}function L(){if(typeof l=="object"&&!(l instanceof RegExp)&&l.async){if(!c.$async)throw new Error("async format in sync schema");return(0,K._)`await ${h}(${i})`}return typeof m=="function"?(0,K._)`${h}(${i})`:(0,K._)`${h}.test(${i})`}}}};Ka.default=e_});var Ba=b(Ha=>{"use strict";Object.defineProperty(Ha,"__esModule",{value:!0});var t_=tp(),r_=[t_.default];Ha.default=r_});var Ja=b(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.contentVocabulary=mt.metadataVocabulary=void 0;mt.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];mt.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var ip=b(Wa=>{"use strict";Object.defineProperty(Wa,"__esModule",{value:!0});var i_=Ji(),a_=ua(),s_=Ea(),n_=Vo(),o_=Jo(),p_=ep(),d_=Ba(),rp=Ja(),c_=[n_.default,i_.default,a_.default,(0,s_.default)(!0),d_.default,rp.metadataVocabulary,rp.contentVocabulary,o_.default,p_.default];Wa.default=c_});var sp=b(Mr=>{"use strict";Object.defineProperty(Mr,"__esModule",{value:!0});Mr.DiscrError=void 0;var ap;(function(t){t.Tag="tag",t.Mapping="mapping"})(ap||(Mr.DiscrError=ap={}))});var Xa=b(Qa=>{"use strict";Object.defineProperty(Qa,"__esModule",{value:!0});var _t=k(),Ya=sp(),np=Ct(),u_=dt(),l_=I(),y_={message:({params:{discrError:t,tagName:e}})=>t===Ya.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,_t._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},m_={keyword:"discriminator",type:"object",schemaType:"object",error:y_,code(t){let{gen:e,data:r,schema:i,parentSchema:a,it:s}=t,{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=e.let("valid",!1),d=e.const("tag",(0,_t._)`${r}${(0,_t.getProperty)(o)}`);e.if((0,_t._)`typeof ${d} == "string"`,()=>c(),()=>t.error(!1,{discrError:Ya.DiscrError.Tag,tag:d,tagName:o})),t.ok(p);function c(){let g=y();e.if(!1);for(let l in g)e.elseIf((0,_t._)`${d} === ${l}`),e.assign(p,u(g[l]));e.else(),t.error(!1,{discrError:Ya.DiscrError.Mapping,tag:d,tagName:o}),e.endIf()}function u(g){let l=e.name("valid"),_=t.subschema({keyword:"oneOf",schemaProp:g},l);return t.mergeEvaluated(_,_t.Name),l}function y(){var g;let l={},_=h(a),m=!0;for(let L=0;L<n.length;L++){let P=n[L];if(P?.$ref&&!(0,l_.schemaHasRulesButRef)(P,s.self.RULES)){let H=P.$ref;if(P=np.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,H),P instanceof np.SchemaEnv&&(P=P.schema),P===void 0)throw new u_.default(s.opts.uriResolver,s.baseId,H)}let ee=(g=P?.properties)===null||g===void 0?void 0:g[o];if(typeof ee!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${o}"`);m=m&&(_||h(P)),$(ee,L)}if(!m)throw new Error(`discriminator: "${o}" must be required`);return l;function h({required:L}){return Array.isArray(L)&&L.includes(o)}function $(L,P){if(L.const)w(L.const,P);else if(L.enum)for(let ee of L.enum)w(ee,P);else throw new Error(`discriminator: "properties/${o}" must have "const" or "enum"`)}function w(L,P){if(typeof L!="string"||L in l)throw new Error(`discriminator: "${o}" values must be unique strings`);l[L]=P}}}};Qa.default=m_});var op=b((nh,__)=>{__.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 pp=b((oh,g_)=>{g_.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=b((ph,f_)=>{f_.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 cp=b((dh,h_)=>{h_.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 up=b((ch,b_)=>{b_.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 lp=b((uh,v_)=>{v_.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 yp=b((lh,j_)=>{j_.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 mp=b((yh,w_)=>{w_.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 _p=b(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});var P_=op(),q_=pp(),k_=dp(),$_=cp(),x_=up(),z_=lp(),O_=yp(),A_=mp(),I_=["/properties"];function E_(t){return[P_,q_,k_,$_,x_,e(this,z_),O_,e(this,A_)].forEach(r=>this.addMetaSchema(r,void 0,!1)),this;function e(r,i){return t?r.$dataMetaSchema(i,I_):i}}es.default=E_});var gp=b((G,rs)=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.MissingRefError=G.ValidationError=G.CodeGen=G.Name=G.nil=G.stringify=G.str=G._=G.KeywordCxt=G.Ajv2020=void 0;var S_=Ki(),T_=ip(),Z_=Xa(),N_=_p(),ts="https://json-schema.org/draft/2020-12/schema",gt=class extends S_.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),T_.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(Z_.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:r}=this.opts;r&&(N_.default.call(this,e),this.refs["http://json-schema.org/schema"]=ts)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(ts)?ts:void 0)}};G.Ajv2020=gt;rs.exports=G=gt;rs.exports.Ajv2020=gt;Object.defineProperty(G,"__esModule",{value:!0});G.default=gt;var R_=pt();Object.defineProperty(G,"KeywordCxt",{enumerable:!0,get:function(){return R_.KeywordCxt}});var ft=k();Object.defineProperty(G,"_",{enumerable:!0,get:function(){return ft._}});Object.defineProperty(G,"str",{enumerable:!0,get:function(){return ft.str}});Object.defineProperty(G,"stringify",{enumerable:!0,get:function(){return ft.stringify}});Object.defineProperty(G,"nil",{enumerable:!0,get:function(){return ft.nil}});Object.defineProperty(G,"Name",{enumerable:!0,get:function(){return ft.Name}});Object.defineProperty(G,"CodeGen",{enumerable:!0,get:function(){return ft.CodeGen}});var L_=Lt();Object.defineProperty(G,"ValidationError",{enumerable:!0,get:function(){return L_.default}});var C_=dt();Object.defineProperty(G,"MissingRefError",{enumerable:!0,get:function(){return C_.default}})});var qp=b(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.formatNames=ke.fastFormats=ke.fullFormats=void 0;function qe(t,e){return{validate:t,compare:e}}ke.fullFormats={date:qe(vp,ns),time:qe(as(!0),os),"date-time":qe(fp(!0),wp),"iso-time":qe(as(),jp),"iso-date-time":qe(fp(),Pp),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:F_,"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:Q_,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:K_,int32:{type:"number",validate:J_},int64:{type:"number",validate:W_},float:{type:"number",validate:bp},double:{type:"number",validate:bp},password:!0,binary:!0};ke.fastFormats={...ke.fullFormats,date:qe(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,ns),time:qe(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,os),"date-time":qe(/^\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,wp),"iso-time":qe(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,jp),"iso-date-time":qe(/^\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,Pp),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};ke.formatNames=Object.keys(ke.fullFormats);function M_(t){return t%4===0&&(t%100!==0||t%400===0)}var D_=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,G_=[0,31,28,31,30,31,30,31,31,30,31,30,31];function vp(t){let e=D_.exec(t);if(!e)return!1;let r=+e[1],i=+e[2],a=+e[3];return i>=1&&i<=12&&a>=1&&a<=(i===2&&M_(r)?29:G_[i])}function ns(t,e){if(t&&e)return t>e?1:t<e?-1:0}var is=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function as(t){return function(r){let i=is.exec(r);if(!i)return!1;let a=+i[1],s=+i[2],n=+i[3],o=i[4],p=i[5]==="-"?-1:1,d=+(i[6]||0),c=+(i[7]||0);if(d>23||c>59||t&&!o)return!1;if(a<=23&&s<=59&&n<60)return!0;let u=s-c*p,y=a-d*p-(u<0?1:0);return(y===23||y===-1)&&(u===59||u===-1)&&n<61}}function os(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),i=new Date("2020-01-01T"+e).valueOf();if(r&&i)return r-i}function jp(t,e){if(!(t&&e))return;let r=is.exec(t),i=is.exec(e);if(r&&i)return t=r[1]+r[2]+r[3],e=i[1]+i[2]+i[3],t>e?1:t<e?-1:0}var ss=/t|\s/i;function fp(t){let e=as(t);return function(i){let a=i.split(ss);return a.length===2&&vp(a[0])&&e(a[1])}}function wp(t,e){if(!(t&&e))return;let r=new Date(t).valueOf(),i=new Date(e).valueOf();if(r&&i)return r-i}function Pp(t,e){if(!(t&&e))return;let[r,i]=t.split(ss),[a,s]=e.split(ss),n=ns(r,a);if(n!==void 0)return n||os(i,s)}var U_=/\/|:/,V_=/^(?:[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 F_(t){return U_.test(t)&&V_.test(t)}var hp=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function K_(t){return hp.lastIndex=0,hp.test(t)}var H_=-(2**31),B_=2**31-1;function J_(t){return Number.isInteger(t)&&t<=B_&&t>=H_}function W_(t){return Number.isInteger(t)}function bp(){return!0}var Y_=/[^\\]\\Z/;function Q_(t){if(Y_.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var $p=b(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});var X_=Ji(),eg=ua(),tg=Ea(),rg=Ba(),kp=Ja(),ig=[X_.default,eg.default,(0,tg.default)(),rg.default,kp.metadataVocabulary,kp.contentVocabulary];ps.default=ig});var xp=b((fh,ag)=>{ag.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 Op=b((U,ds)=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0});U.MissingRefError=U.ValidationError=U.CodeGen=U.Name=U.nil=U.stringify=U.str=U._=U.KeywordCxt=U.Ajv=void 0;var sg=Ki(),ng=$p(),og=Xa(),zp=xp(),pg=["/properties"],Dr="http://json-schema.org/draft-07/schema",ht=class extends sg.default{_addVocabularies(){super._addVocabularies(),ng.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(og.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(zp,pg):zp;this.addMetaSchema(e,Dr,!1),this.refs["http://json-schema.org/schema"]=Dr}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Dr)?Dr:void 0)}};U.Ajv=ht;ds.exports=U=ht;ds.exports.Ajv=ht;Object.defineProperty(U,"__esModule",{value:!0});U.default=ht;var dg=pt();Object.defineProperty(U,"KeywordCxt",{enumerable:!0,get:function(){return dg.KeywordCxt}});var bt=k();Object.defineProperty(U,"_",{enumerable:!0,get:function(){return bt._}});Object.defineProperty(U,"str",{enumerable:!0,get:function(){return bt.str}});Object.defineProperty(U,"stringify",{enumerable:!0,get:function(){return bt.stringify}});Object.defineProperty(U,"nil",{enumerable:!0,get:function(){return bt.nil}});Object.defineProperty(U,"Name",{enumerable:!0,get:function(){return bt.Name}});Object.defineProperty(U,"CodeGen",{enumerable:!0,get:function(){return bt.CodeGen}});var cg=Lt();Object.defineProperty(U,"ValidationError",{enumerable:!0,get:function(){return cg.default}});var ug=dt();Object.defineProperty(U,"MissingRefError",{enumerable:!0,get:function(){return ug.default}})});var Ap=b(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.formatLimitDefinition=void 0;var lg=Op(),be=k(),Le=be.operators,Gr={formatMaximum:{okStr:"<=",ok:Le.LTE,fail:Le.GT},formatMinimum:{okStr:">=",ok:Le.GTE,fail:Le.LT},formatExclusiveMaximum:{okStr:"<",ok:Le.LT,fail:Le.GTE},formatExclusiveMinimum:{okStr:">",ok:Le.GT,fail:Le.LTE}},yg={message:({keyword:t,schemaCode:e})=>(0,be.str)`should be ${Gr[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,be._)`{comparison: ${Gr[t].okStr}, limit: ${e}}`};vt.formatLimitDefinition={keyword:Object.keys(Gr),type:"string",schemaType:"string",$data:!0,error:yg,code(t){let{gen:e,data:r,schemaCode:i,keyword:a,it:s}=t,{opts:n,self:o}=s;if(!n.validateFormats)return;let p=new lg.KeywordCxt(s,o.RULES.all.format.definition,"format");p.$data?d():c();function d(){let y=e.scopeValue("formats",{ref:o.formats,code:n.code.formats}),g=e.const("fmt",(0,be._)`${y}[${p.schemaCode}]`);t.fail$data((0,be.or)((0,be._)`typeof ${g} != "object"`,(0,be._)`${g} instanceof RegExp`,(0,be._)`typeof ${g}.compare != "function"`,u(g)))}function c(){let y=p.schema,g=o.formats[y];if(!g||g===!0)return;if(typeof g!="object"||g instanceof RegExp||typeof g.compare!="function")throw new Error(`"${a}": format "${y}" does not define "compare" function`);let l=e.scopeValue("formats",{key:y,ref:g,code:n.code.formats?(0,be._)`${n.code.formats}${(0,be.getProperty)(y)}`:void 0});t.fail$data(u(l))}function u(y){return(0,be._)`${y}.compare(${r}, ${i}) ${Gr[a].fail} 0`}},dependencies:["format"]};var mg=t=>(t.addKeyword(vt.formatLimitDefinition),t);vt.default=mg});var Tp=b((tr,Sp)=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});var jt=qp(),_g=Ap(),cs=k(),Ip=new cs.Name("fullFormats"),gg=new cs.Name("fastFormats"),us=(t,e={keywords:!0})=>{if(Array.isArray(e))return Ep(t,e,jt.fullFormats,Ip),t;let[r,i]=e.mode==="fast"?[jt.fastFormats,gg]:[jt.fullFormats,Ip],a=e.formats||jt.formatNames;return Ep(t,a,r,i),e.keywords&&(0,_g.default)(t),t};us.get=(t,e="full")=>{let i=(e==="fast"?jt.fastFormats:jt.fullFormats)[t];if(!i)throw new Error(`Unknown format "${t}"`);return i};function Ep(t,e,r,i){var a,s;(a=(s=t.opts.code).formats)!==null&&a!==void 0||(s.formats=(0,cs._)`require("ajv-formats/dist/formats").${i}`);for(let n of e)t.addFormat(n,r[n])}Sp.exports=tr=us;Object.defineProperty(tr,"__esModule",{value:!0});tr.default=us});var ls,Zp=qt(()=>{ls={schema_version:1,contract_sha256:"81c858ecc244c8dac63974e299a631071561f296494b9cad1cdad1a14706a741",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:{}},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:"null"}},required:["data","next_cursor"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"9299e44b8387869916b696d4d8463a94582f515c6365b34008b87d7e92cffd56"},{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"},scopes:{type:["array","null"],items:{type:"string"}}},required:["id","email","name","organization_id","role"]}},required:["user"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"483f6fbec44b769024402e1e3fe1d457b04d532165efbc4bd5176661087c7c98"},{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:"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"},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"]}}},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"}},mode_note:{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"},mode:{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","mode","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:"035ad7fa347f5456e21b5d3efa4ca51889007a51f195221503677c6d22648c2b"},{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:"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:{}},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"}},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:[],body_inputs:[]},contract_sha256:"983e2552e3a0683b70e5d5fec577295bc9dbc2c5263113974e61b43a0ba745a0"},{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"}},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:"2e2116144ecf06e6e6761886d6bdd195af6b897e5e07cdc90dd3d2ba1eb7d585"},{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"}},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:"be4f52fae34e71bfaae997e6ba56166827ddc565e9aa1fab7c7a8712fc29016f"},{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.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"},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"},session_linked_requests:{type:"integer"},branch_tagged_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","session_linked_requests","branch_tagged_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_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"},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"}},required:["join","cost","optimizer","attribution"]}},required:["window","scope","connected","repos","basis","totals","by_work_type","by_repo","prs","unlanded","optimizer_effects","truncated","basis_notes"]},binding:{path_inputs:{},query_inputs:["from","sample_data","to","window"],body_inputs:[]},contract_sha256:"a71b363cf7f9606f3cdd29cdf32e9428850822f2c61bd0035858124189b72370"},{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"},input_tokens:{type:"integer"},output_tokens:{type:"integer"},cached_input_tokens:{type:"integer"},verified_savings_usd:{type:"number"}},required:["spend_usd","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"}]}},required:["id","name","key_prefix","project_id","created_at","revoked_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:"59738c342cf6c27b68ffec457d4df33e7c153c56b32a8acda42027999a1e8e34"},{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"}},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:"b77df23f3ba5afd50a30387b6d3c58120f032b9964a0cc42331105ac01f13a22"},{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.create",version:"1",summary:"fixes: create_proposal",method:"POST",path:"/optimization-proposals",permissions:["proposal:draft"],scope:"project",access:"write",aliases:["caveman_fixes_write.create_proposal"],input_schema:{type:"object",additionalProperties:!1,properties:{branch:{type:"string"},cave_score_before:{type:"integer"},cave_score_target:{type:"integer"},engine_lossy:{type:"boolean"},family:{type:"string"},opportunity_id:{type:"string"},optimizer_id:{type:"string"},repo:{type:"string"},safety_class:{type:"string"},savings_usd_base:{type:"number"},savings_usd_high:{type:"number"},savings_usd_low:{type:"number"}}},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:{},query_inputs:[],body_inputs:["branch","cave_score_before","cave_score_target","engine_lossy","family","opportunity_id","optimizer_id","repo","safety_class","savings_usd_base","savings_usd_high","savings_usd_low"],body_project:!0},contract_sha256:"c57602f3fcf120a879ede3e85eef7f3f13727aa6d293e9e36c0e90e2f36fa211"},{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:"Writes the fix ladder from a bundle the caller authored about its own work. An agent that both implements the fix and posts the evidence is grading itself; the bundle is labeled self_reported for exactly that reason, and it stays a human-run `caveman agent submit`.",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:"2509d22817227864d302b249861b55f4b59b5f18684fa3ddf52872936e10cccd"},{id:"human.run_proposal",version:"1",summary:"human: run_proposal",method:"POST",path:"/optimization-proposals/{proposalId}/run",permissions:["proposal:draft"],scope:"project",access:"none",exclusion:"Dispatches the server-side Cave Agent to open a pull request in the customer's repository. Deferred until the cloud-agent lane is reviewed on its own terms.",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:"ae1bf7f81e494defed5a006541d4dc268131059031d86d9bd2dacabba8dd2ceb"},{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:"fixes.create_proposal_from_move",version:"1",summary:"fixes: create_proposal_from_move",method:"POST",path:"/optimization-proposals/from-move",permissions:["proposal:draft"],scope:"project",access:"write",aliases:["caveman_fixes_write.create_proposal_from_move"],input_schema:{type:"object",additionalProperties:!1,properties:{optimizer_id:{type:"string"}}},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:{},query_inputs:[],body_inputs:["optimizer_id"],body_project:!0},contract_sha256:"c1465cbfb23f29bc97a7a995f7318a5e1669eecee63d580ca7277ccc547019ca"},{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"},scopes:{type:["array","null"],items:{type:"string"}}},required:["id","email","name","organization_id","role"]},role:{type:"string"}},required:["id","user","role"]}},next_cursor:{type:"null"}},required:["data","next_cursor"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"f575ce58e7f3d0c83a225f9abc0b095f1d8e554aeb1e1332de7d71aab9f5d8a8"},{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:"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"},aggregate_retention_days:{type:"integer"},raw_payload_retention_days:{type:"integer"},artifact_retention_days:{type:"integer"},training_use_allowed:{type:"boolean"}},required:["id","organization_id","name","raw_payload_storage","metadata_storage","payload_hash_storage","artifact_storage","trace_retention_days","aggregate_retention_days","raw_payload_retention_days","artifact_retention_days","training_use_allowed"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"2f58915056ed566aea6d81fceaaecee2aa52582ab9c540f549d4f95f0151e747"},{id:"people.seats",version:"1",summary:"people: seats",method:"GET",path:"/org/seats",permissions:["org:read"],scope:"organization",access:"read",aliases:["caveman_people.seats"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{plan:{type:"string"},seats_limit:{type:"integer"},seats_used:{type:"integer"},members_limit:{type:"integer"},members_used:{type:"integer"},agents_limit:{type:"integer"},agents_used:{type:"integer"},members:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{user_id:{type:"string",format:"uuid"},email:{type:"string"},name:{type:"string"},devices:{type:"integer"},last_refreshed_at:{type:"string",format:"date-time"}},required:["user_id","email","name","devices","last_refreshed_at"]}}},required:["plan","seats_limit","seats_used","members_limit","members_used","agents_limit","agents_used","members"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"6dbd47de341d164b8671e738ca456a5f0e8f4a2e8e3765a4a6d95f773cd39b16"},{id:"human.autopilot_pause",version:"1",summary:"human: autopilot_pause",method:"GET",path:"/orgs/{orgId}/autopilot/pause",permissions:["settings:read"],scope:"organization",access:"none",exclusion:"Publishes or rolls back live traffic policy at S2/S3. Agents draft and experiment; a human promotes.",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:"4ee0472910d7ef3c39058c2c7874dd381e3582258670c936c0e820d2b9ec38be"},{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:"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:"agent.list",version:"1",summary:"agent list",method:"GET",path:"/projects/{projectId}/agent-configuration",permissions:["proposal:draft"],scope:"project",access:"read",aliases:["caveman_context.agent_definitions"],input_schema:{type:"object",additionalProperties:!1,properties:{after:{type:"string",format:"uuid"}}},output_schema:{type:"object",additionalProperties:!1,properties:{data:{type:"array",items:{type:"object",additionalProperties:!1,properties:{grant_id:{type:"string",format:"uuid"},revision:{type:"integer",minimum:1},expires_at:{type:"string",format:"date-time"},max_run_seconds:{type:"integer",minimum:1,maximum:86400},definitions:{type:"array",items:{type:"object",additionalProperties:!1,properties:{id:{type:"string",minLength:1,maxLength:100},version:{type:"string",minLength:1,maxLength:100},digest:{type:"string",pattern:"^[a-f0-9]{64}$"},capabilities:{type:"array",items:{type:"string",minLength:1,maxLength:150},minItems:0,maxItems:127},inputSchema:{type:["object","boolean"]}},required:["id","version","digest","capabilities","inputSchema"]},minItems:1,maxItems:128}},required:["grant_id","revision","expires_at","max_run_seconds","definitions"]},minItems:0,maxItems:50},next_cursor:{type:"string",description:"Grant UUID cursor, or empty when no next page."},server_time:{type:"string",format:"date-time"}},required:["data","next_cursor","server_time"]},binding:{query_inputs:["after"]},additional_permissions:["agent:execute"],contract_sha256:"722bd4cb67e145ab08a1034995c35e407c1845a1b41cbbfa7b37d78c87599003"},{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:"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:{request_id:{type:"string",format:"uuid"},grant_id:{type:"string",format:"uuid"},grant_revision:{type:"integer",minimum:1},deadline:{type:"string",format:"date-time"},definition:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},version:{type:"string"}},required:["id","version"]},input:{type:"object",additionalProperties:!0},parent_run_id:{type:"string",format:"uuid"}},required:["request_id","grant_id","grant_revision","deadline","definition","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",format:"uuid"},grant_revision:{type:"integer",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"]},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"}},required:["principal_id","result_ref","id","organization_id","project_id","case_id","generation","grant_id","grant_revision","definition_id","definition_version","definition_digest","origin","input_ref","budget_keys","status","reason","deadline"]},binding:{body_inputs:["request_id","grant_id","grant_revision","deadline","definition","input","parent_run_id"]},additional_permissions:["agent:execute"],async_kind:"agent",idempotency:"request_id",contract_sha256:"132ee34b2dc2593642b7f75ba748d9d6e794aa07e04a224fe151c19c438157bf"},{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",format:"uuid"},grant_revision:{type:"integer",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"]},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"}},required:["principal_id","result_ref","id","organization_id","project_id","case_id","generation","grant_id","grant_revision","definition_id","definition_version","definition_digest","origin","input_ref","budget_keys","status","reason","deadline"]},binding:{path_inputs:{runId:"run_id"}},contract_sha256:"53d4b547cd64d2b486b1ec7af716c5c51e957c756ea1e6a46b405391538db7d8"},{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:"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:"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:"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"}]},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"},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"]}}},required:["data"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"514aa556c8af7aff9fa1d5673aed2575a7ac73b4e830131fa73febbaef4f3359"},{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"}]},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:"d346c6d238bae1a8351b505841c0bb7a741d5e52b3dc49845d5c8f9f7fd7ea70"},{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:"context.get_capabilities",version:"1",summary:"context: get_capabilities",method:"GET",path:"/projects/{projectId}/capabilities",permissions:["org:read"],scope:"project",access:"read",aliases:["caveman_context.get_capabilities"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{observe_only:{type:"boolean"},compress:{type:"boolean"},cache_hints:{type:"boolean"},routing:{type:"boolean"},compress_unlocked:{type:"boolean"},compress_blocked_reason:{type:"string"},routing_blocked_reason:{type:"string"},pixel_density:{type:"string"},workflow_capabilities:{type:["object","null"],additionalProperties:{type:["object","null"],additionalProperties:{type:"boolean"}}}},required:["observe_only","compress","cache_hints","routing","compress_unlocked","workflow_capabilities"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"b0a232ee7c0266965504fb5a6a6726066c8b707c3ab8aa20516d37a46cdf23e6"},{id:"project_setup.set_capabilities",version:"1",summary:"project_setup: set_capabilities",method:"PUT",path:"/projects/{projectId}/capabilities",permissions:["policy:publish_s0_s1"],scope:"project",access:"write",aliases:["caveman_project_setup.set_capabilities"],input_schema:{type:"object",additionalProperties:!1,properties:{cache_hints:{type:"boolean"},compress:{type:"boolean"},observe_only:{type:"boolean"},routing:{type:"boolean"},workflow_capabilities:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"boolean"}}}},required:["observe_only","compress","cache_hints","routing"]},output_schema:{type:"object",additionalProperties:!1,properties:{observe_only:{type:"boolean"},compress:{type:"boolean"},cache_hints:{type:"boolean"},routing:{type:"boolean"},compress_unlocked:{type:"boolean"},compress_blocked_reason:{type:"string"},routing_blocked_reason:{type:"string"},pixel_density:{type:"string"},workflow_capabilities:{type:["object","null"],additionalProperties:{type:["object","null"],additionalProperties:{type:"boolean"}}}},required:["observe_only","compress","cache_hints","routing","compress_unlocked","workflow_capabilities"]},binding:{path_inputs:{},query_inputs:[],body_inputs:["cache_hints","compress","observe_only","routing","workflow_capabilities"]},contract_sha256:"b6321f765e609bc7d4b12871cdf8285bb57e3e5d01ee469d5d395d3a48542b8c"},{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"},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"]}}},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"}},mode_note:{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:"62e9e1f9e2835a4749c7787ecee63a4d2cd8badded32022f1dcf79fdf73e2106"},{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:"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"}},required:["id","organization_id","project_id","name","description","status","columns","revision","current_version","row_count","created_at","updated_at"]}},next_cursor:{type:"null"}},required:["data","next_cursor"]},binding:{},native_evaluation:!0,contract_sha256:"9d3a7c42bebe1ec1f7287e03bf15311b89aae23d036480335610a80677386f69"},{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"}},required:["id","organization_id","project_id","name","description","status","columns","revision","current_version","row_count","created_at","updated_at"]},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:"dcfac55f30b94dc2a8a8144ab5e08dcb1f1a9a3fbac34f4dc67344d98bf3c0d1"},{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:"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"}},required:["id","organization_id","project_id","name","description","grader_type","options","input_mapping","status","revision","current_version","config_sha256","created_at","updated_at"]}},next_cursor:{type:"null"}},required:["data","next_cursor"]},binding:{},native_evaluation:!0,contract_sha256:"2c5ca59c20cacee84ddbe106a74032e187f373889dab06eac01ac44268ece0b0"},{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"}},required:["id","organization_id","project_id","name","description","grader_type","options","input_mapping","status","revision","current_version","config_sha256","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"},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:"65a407f151b34c0c146d91d2673aa118498685d6434f9a3599faeb805339d174"},{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:"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"}},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"]},binding:{path_inputs:{qualificationId:"qualification_id"}},additional_permissions:["evaluator:activate"],contract_sha256:"da72d5a1259a112e5c884784fd2c89dca4e7eefc225169918996336964a5bc8c"},{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"],scope:"project",access:"write",aliases:["caveman_evals_write.create_scenario"],input_schema:{type:"object",additionalProperties:!1,required:["schema_version","adapter","name","invariant","entrypoint","input","initial_state","tools","assertions","historical","provenance"],properties:{schema_version:{const:1},adapter:{const:"python-module-task-v1"},name:{type:"string",minLength:1,maxLength:200},invariant:{type:"string",minLength:1,maxLength:4e3},entrypoint:{type:"string",pattern:"^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*:[A-Za-z_][A-Za-z0-9_]*$"},input:{},initial_state:{type:"object"},tools:{type:"array",maxItems:100,items:{type:"object",additionalProperties:!1,required:["name","arguments","result"],properties:{name:{type:"string"},arguments:{},result:{},error:{type:"string",maxLength:500}}}},assertions:{type:"array",minItems:1,maxItems:100,items:{type:"object",additionalProperties:!1,required:["subject","pointer","operator","value"],properties:{subject:{enum:["output","state"]},pointer:{type:"string"},operator:{const:"equals"},value:{}}}},historical:{type:"array",maxItems:20,items:{type:"object",additionalProperties:!1,required:["commit_sha","expected"],properties:{commit_sha:{type:"string",pattern:"^[a-f0-9]{40}$"},expected:{enum:["passed","failed"]}}}},provenance:{type:"object",additionalProperties:!1,required:["evidence_digests","fixture_basis","fixture_rationale"],properties:{evidence_digests:{type:"array",minItems:1,maxItems:24,uniqueItems:!0,items:{type:"string",pattern:"^[a-f0-9]{64}$"}},fixture_basis:{const:"synthetic"},fixture_rationale:{type:"string",minLength:1,maxLength:2e3}}}}},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","assertions","historical","provenance"]},transactional:!0,additional_permissions:["scenario:write"],contract_sha256:"a49dbe21bfd00077071db84c491e20d2530fbf2d4c8a2b5c91e753e41b4d3af4"},{id:"scenarios.update",version:"1",summary:"scenarios update",method:"PUT",path:"/projects/{projectId}/eval-scenarios/{datasetId}",permissions:["eval: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,required:["schema_version","adapter","name","invariant","entrypoint","input","initial_state","tools","assertions","historical","provenance"],properties:{schema_version:{const:1},adapter:{const:"python-module-task-v1"},name:{type:"string",minLength:1,maxLength:200},invariant:{type:"string",minLength:1,maxLength:4e3},entrypoint:{type:"string",pattern:"^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*:[A-Za-z_][A-Za-z0-9_]*$"},input:{},initial_state:{type:"object"},tools:{type:"array",maxItems:100,items:{type:"object",additionalProperties:!1,required:["name","arguments","result"],properties:{name:{type:"string"},arguments:{},result:{},error:{type:"string",maxLength:500}}}},assertions:{type:"array",minItems:1,maxItems:100,items:{type:"object",additionalProperties:!1,required:["subject","pointer","operator","value"],properties:{subject:{enum:["output","state"]},pointer:{type:"string"},operator:{const:"equals"},value:{}}}},historical:{type:"array",maxItems:20,items:{type:"object",additionalProperties:!1,required:["commit_sha","expected"],properties:{commit_sha:{type:"string",pattern:"^[a-f0-9]{40}$"},expected:{enum:["passed","failed"]}}}},provenance:{type:"object",additionalProperties:!1,required:["evidence_digests","fixture_basis","fixture_rationale"],properties:{evidence_digests:{type:"array",minItems:1,maxItems:24,uniqueItems:!0,items:{type:"string",pattern:"^[a-f0-9]{64}$"}},fixture_basis:{const:"synthetic"},fixture_rationale:{type:"string",minLength:1,maxLength:2e3}}}}}},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:"a541c9d4ed2b6f4ee0d45f332ac168ba4d1c97634734b42f21b99b6e121d4d89"},{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,required:["schema_version","adapter","name","invariant","entrypoint","input","initial_state","tools","assertions","historical","provenance"],properties:{schema_version:{const:1},adapter:{const:"python-module-task-v1"},name:{type:"string",minLength:1,maxLength:200},invariant:{type:"string",minLength:1,maxLength:4e3},entrypoint:{type:"string",pattern:"^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*:[A-Za-z_][A-Za-z0-9_]*$"},input:{},initial_state:{type:"object"},tools:{type:"array",maxItems:100,items:{type:"object",additionalProperties:!1,required:["name","arguments","result"],properties:{name:{type:"string"},arguments:{},result:{},error:{type:"string",maxLength:500}}}},assertions:{type:"array",minItems:1,maxItems:100,items:{type:"object",additionalProperties:!1,required:["subject","pointer","operator","value"],properties:{subject:{enum:["output","state"]},pointer:{type:"string"},operator:{const:"equals"},value:{}}}},historical:{type:"array",maxItems:20,items:{type:"object",additionalProperties:!1,required:["commit_sha","expected"],properties:{commit_sha:{type:"string",pattern:"^[a-f0-9]{40}$"},expected:{enum:["passed","failed"]}}}},provenance:{type:"object",additionalProperties:!1,required:["evidence_digests","fixture_basis","fixture_rationale"],properties:{evidence_digests:{type:"array",minItems:1,maxItems:24,uniqueItems:!0,items:{type:"string",pattern:"^[a-f0-9]{64}$"}},fixture_basis:{const:"synthetic"},fixture_rationale:{type:"string",minLength:1,maxLength:2e3}}}}},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:"bf7b2813bf3cd5f119101833245b1f12235929e283fb7fff018b6d50657669cd"},{id:"scenarios.run",version:"1",summary:"scenarios run",method:"POST",path:"/projects/{projectId}/eval-scenarios/{datasetId}/versions/{version}/runs",permissions:["eval:write"],scope:"project",access:"write",aliases:["caveman_evals_write.run_scenario"],input_schema:{type:"object",additionalProperties:!1,properties:{dataset_id:{type:"string",format:"uuid"},version:{type:"integer",minimum:1},request_id:{type:"string",format:"uuid"},grant_id:{type:"string",format:"uuid"},grant_revision:{type:"integer",minimum:1},deadline:{type:"string",format:"date-time"},repository_commit_sha:{type:"string",pattern:"^[a-f0-9]{40}$"},recipe_id:{type:"string",pattern:"^[a-z][a-z0-9-]{0,99}$"}},required:["dataset_id","version","request_id","grant_id","grant_revision","deadline","repository_commit_sha","recipe_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",format:"uuid"},grant_revision:{type:"integer",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"]},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"}},required:["principal_id","result_ref","id","organization_id","project_id","case_id","generation","grant_id","grant_revision","definition_id","definition_version","definition_digest","origin","input_ref","budget_keys","status","reason","deadline"]},binding:{path_inputs:{datasetId:"dataset_id",version:"version"},body_inputs:["request_id","grant_id","grant_revision","deadline","repository_commit_sha","recipe_id"]},additional_permissions:["agent:execute"],async_kind:"agent",idempotency:"request_id",contract_sha256:"f3aff82f48aec2fea63cd496ee5f06a69990a294f17d6b52c1f498a34481b949"},{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"},assertions_passed:{type:"integer"},assertions_total:{type:"integer"},tools_matched:{type:"boolean"},failed_assertions:{type:["array","null"],items:{type:"integer"}}},required:["status","assertions_passed","assertions_total","tools_matched","failed_assertions"]},candidate:{type:"object",additionalProperties:!1,properties:{status:{type:"string"},assertions_passed:{type:"integer"},assertions_total:{type:"integer"},tools_matched:{type:"boolean"},failed_assertions:{type:["array","null"],items:{type:"integer"}}},required:["status","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:"1626f67a8f0d11a0294ec2133e84b0dd86e253746b4c4c948a0aad4ff4afd75b"},{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","judge_order"],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:"0243d89c588121dfdb0a43def5b1c7e442ac35fb7ff88bfeabe3339039ab3b20"},{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","judge_order"],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:"d2d31b06eb39c068de34d3726e871297a5489decf856a0774204adc30bff87a5"},{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","judge_order"],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","judge_order"],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:"1c322e947465d3170a7d1b1c35737724ec0b0f5653b01caaea200866033c5676"},{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","judge_order"],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:"7b8f28341462fa4537e52da313c3403f7f9c1cdbc030be39f475fe3489ccf923"},{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.",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"}},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"]}},required:["run","cells","quality"]},binding:{path_inputs:{workbenchId:"workbench_id",runId:"run_id"}},native_evaluation:!0,contract_sha256:"d6b4ef4db4ac94e93ef1dbca5d4ae924f4cec416d9ac3b6a406c4a3fbde9af9c"},{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:"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:"context.get_mode",version:"1",summary:"context: get_mode",method:"GET",path:"/projects/{projectId}/mode",permissions:["org:read"],scope:"project",access:"read",aliases:["caveman_context.get_mode"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{mode:{type:"string"},compress_unlocked:{type:"boolean"},compress_missing:{type:["array","null"],items:{type:"string"}},pixel_density:{type:"string"},pixel_density_missing:{type:["array","null"],items:{type:"string"}},compress_blocked_reason:{type:"string"}},required:["mode","compress_unlocked"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"911cac6b7e8875c2f043d49403565bfcc36d6bd981a73997cf2fe0668709ddf2"},{id:"project_setup.set_mode",version:"1",summary:"project_setup: set_mode",method:"POST",path:"/projects/{projectId}/mode",permissions:["policy:publish_s0_s1"],scope:"project",access:"write",aliases:["caveman_project_setup.set_mode"],input_schema:{type:"object",additionalProperties:!1,properties:{mode:{enum:["record","active","compress"]}},required:["mode"]},output_schema:{type:"object",additionalProperties:!1,properties:{mode:{type:"string"},compress_unlocked:{type:"boolean"},compress_missing:{type:["array","null"],items:{type:"string"}},pixel_density:{type:"string"},pixel_density_missing:{type:["array","null"],items:{type:"string"}},compress_blocked_reason:{type:"string"}},required:["mode","compress_unlocked"]},binding:{path_inputs:{},query_inputs:[],body_inputs:["mode"]},contract_sha256:"8811b3527ab5284f1435059688c765e09c7f216c094739d6050c7dcb73500548"},{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:{mode:{type:"string"},compress_unlocked:{type:"boolean"},compress_missing:{type:["array","null"],items:{type:"string"}},pixel_density:{type:"string"},pixel_density_missing:{type:["array","null"],items:{type:"string"}},compress_blocked_reason:{type:"string"}},required:["mode","compress_unlocked"]},binding:{path_inputs:{},query_inputs:[],body_inputs:["level"]},contract_sha256:"1195aaecc061917de1e5db6fbb83213cbd8af939af6d9b7baca1e0269e282471"},{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:"reports.population_savings",version:"1",summary:"reports: population_savings",method:"GET",path:"/projects/{projectId}/population-savings",permissions:["billing:read"],scope:"project",access:"read",aliases:["caveman_reports.population_savings"],input_schema:{type:"object",additionalProperties:!1,properties:{}},output_schema:{type:"object",additionalProperties:!1,properties:{basis:{type:"string"},disclosure:{type:"string"},entries:{type:["array","null"],items:{type:"object",additionalProperties:!1,properties:{family:{type:"string"},day:{type:"string"},population_savings_usd:{type:"number"},ci_low_usd:{type:"number"},ci_high_usd:{type:"number"},interval_kind:{type:"string"},basis:{type:"string"},control_n:{type:"integer"},treatment_n:{type:"integer"},created_at:{type:"string",format:"date-time"}},required:["family","day","population_savings_usd","ci_low_usd","ci_high_usd","interval_kind","basis","control_n","treatment_n","created_at"]}}},required:["basis","disclosure","entries"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"30a104440638487da942ab2fc9fbd12ef81bd3a33f17e03d57c556ffbe785c8c"},{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_experiments",version:"1",summary:"prompts: list_experiments",method:"GET",path:"/projects/{projectId}/prompt-experiments",permissions:["prompt:read"],scope:"project",access:"read",aliases:["caveman_prompts.list_experiments"],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"},prompt_id:{type:"string"},name:{type:"string"},contenders:{},scenarios:{},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","prompt_id","name","contenders","scenarios","created_at","updated_at"]}},next_cursor:{type:"null"}},required:["data","next_cursor"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"8901586b407ee526f41b0e1a2662d9ab711b28696a332046f7e321b7c8534c77"},{id:"prompts.create_experiment",version:"1",summary:"prompts: create_experiment",method:"POST",path:"/projects/{projectId}/prompt-experiments",permissions:["prompt:write"],scope:"project",access:"write",aliases:["caveman_prompts_write.create_experiment"],input_schema:{type:"object",additionalProperties:!1,properties:{contenders:{},name:{type:"string"},prompt_id:{type:"string"},scenarios:{}},required:["name","prompt_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},prompt_id:{type:"string"},name:{type:"string"},contenders:{},scenarios:{},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","prompt_id","name","contenders","scenarios","created_at","updated_at"]},binding:{path_inputs:{},query_inputs:[],body_inputs:["contenders","name","prompt_id","scenarios"]},contract_sha256:"d86d8d439d1662b9b4a4e94eb7e771aa2419f4d4c90750f8edda8d42e848228c"},{id:"prompts.delete_experiment",version:"1",summary:"prompts: delete_experiment",method:"DELETE",path:"/projects/{projectId}/prompt-experiments/{experimentId}",permissions:["prompt:write"],scope:"project",access:"write",aliases:["caveman_prompts_write.delete_experiment"],input_schema:{type:"object",additionalProperties:!1,properties:{experiment_id:{type:"string",format:"uuid"}},required:["experiment_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{status:{const:"deleted"}},required:["status"]},binding:{path_inputs:{experimentId:"experiment_id"},query_inputs:[],body_inputs:[]},contract_sha256:"d216d2a6f66895177730b5ff8054f1b699513ea36f9039eb6a277930427d4330"},{id:"prompts.get_experiment",version:"1",summary:"prompts: get_experiment",method:"GET",path:"/projects/{projectId}/prompt-experiments/{experimentId}",permissions:["prompt:read"],scope:"project",access:"read",aliases:["caveman_prompts.get_experiment"],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"},organization_id:{type:"string"},project_id:{type:"string"},prompt_id:{type:"string"},name:{type:"string"},contenders:{},scenarios:{},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","prompt_id","name","contenders","scenarios","created_at","updated_at"]},binding:{path_inputs:{experimentId:"experiment_id"},query_inputs:[],body_inputs:[]},contract_sha256:"7241397c89828436636e6e3ffc5828853ded8008713a185483e70a69bd1e337b"},{id:"prompts.update_experiment",version:"1",summary:"prompts: update_experiment",method:"PATCH",path:"/projects/{projectId}/prompt-experiments/{experimentId}",permissions:["prompt:write"],scope:"project",access:"write",aliases:["caveman_prompts_write.update_experiment"],input_schema:{type:"object",additionalProperties:!1,properties:{contenders:{},name:{type:"string"},scenarios:{},experiment_id:{type:"string",format:"uuid"}},required:["experiment_id"]},output_schema:{type:"object",additionalProperties:!1,properties:{id:{type:"string"},organization_id:{type:"string"},project_id:{type:"string"},prompt_id:{type:"string"},name:{type:"string"},contenders:{},scenarios:{},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","prompt_id","name","contenders","scenarios","created_at","updated_at"]},binding:{path_inputs:{experimentId:"experiment_id"},query_inputs:[],body_inputs:["contenders","name","scenarios"]},contract_sha256:"57e20897e4e45b365652ccea2ab9dd0182b18aa9bacae8becaa25d5b7cadb145"},{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:{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:["commit_message","model_defaults","system_text","tags","user_text","variables"]},contract_sha256:"7a0edc50a814daafc81555cb7d9eca3ffcb0d66a43899811d62c2d1b3840eea9"},{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.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:"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"},aggregate_retention_days:{type:"integer"},raw_payload_retention_days:{type:"integer"},artifact_retention_days:{type:"integer"},training_use_allowed:{type:"boolean"}},required:["id","organization_id","name","raw_payload_storage","metadata_storage","payload_hash_storage","artifact_storage","trace_retention_days","aggregate_retention_days","raw_payload_retention_days","artifact_retention_days","training_use_allowed"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"72b0099eb5c7ff5d532bcba7b62f6dab876488415c042f47de267d883e2f7a46"},{id:"human.create_sample_data",version:"1",summary:"human: create_sample_data",method:"POST",path:"/projects/{projectId}/sample-data",permissions:["trace:read_metadata"],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:"4577bb223470ad467bb0e5439db802f6028dfefaddc8808560ad4c596a86d2eb"},{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"}},required:["configured"]},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"}},required:["required_judged","required_precision","window_days","judged","approved","precision","shadow_requests","would_hit_rate","met","blocked_reason"]},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"}},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"]},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"]}}},required:["mode","threshold","threshold_pinned","ttl_seconds","embedder_configured","embedder","judge","limits","plan_allows_serve","gate","window","by_agent","samples"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"281448805555bd68a0e63e023cde638f629a6e383465da96bb73a6b56418bac0"},{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","serve"]},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"}},required:["configured"]},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"}},required:["required_judged","required_precision","window_days","judged","approved","precision","shadow_requests","would_hit_rate","met","blocked_reason"]},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"}},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"]},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"]}}},required:["mode","threshold","threshold_pinned","ttl_seconds","embedder_configured","embedder","judge","limits","plan_allows_serve","gate","window","by_agent","samples"]},binding:{path_inputs:{},query_inputs:[],body_inputs:["mode","threshold","threshold_mode","ttl_seconds"]},contract_sha256:"cd4e344c769e1b6a49825d12323cccf5e90f7a56dd3c4e3efff8f3e961d770db"},{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"},to:{type:"string",format:"date-time"},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:"b7b00cbfb940a9894d532b5efcff05aadda48ca5ec1a0b489d9d2288ef78db9b"},{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"}},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"]}},next_cursor:{type:"null"}},required:["data","next_cursor"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"82b5436bad75d94ae3fda22774d1e631a8f063d082b2d477e01d42db09994aa0"},{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"}},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"]},binding:{path_inputs:{monitorId:"monitor_id"},query_inputs:[],body_inputs:[]},contract_sha256:"b21aafb5ca80911d6595f6095b6d85917cbeaf700d66daa8e8c780597e86ceaf"},{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"}},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"]},binding:{path_inputs:{monitorId:"monitor_id"},query_inputs:[],body_inputs:["status"]},contract_sha256:"f45f9ac23c07e9f3f4192d9d9c50be9e8a104b4114e69fe01a0dbb7b5835c14b"},{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"},savings:{type:"number"},basis:{type:"string"},token_count_basis:{type:"string"}},required:["compressor_id","requests_compressed","tokens_before","tokens_after","avg_ratio","savings","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:"efd9d3e94cf6efd99eabd180e0ca82c6d73fb707b39d0083c428bfd0360aad2c"},{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"}}},required:["cache_observed_usd","cache_requests","cache_basis","router_inferred_usd","router_baseline_usd","router_actual_usd","router_requests","router_basis","baseline_models"]},currency:{type:"string"},measured_spend:{type:"number"},imported_observed_spend:{type:"number"},verified_savings:{type:"number"},projected_available_savings:{type:"number"},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"}},required:["automatic_savings","currency","measured_spend","imported_observed_spend","verified_savings","projected_available_savings","series","pricing_accounting","imported_spend_basis"]},binding:{path_inputs:{},query_inputs:["from","sample_data","to","window"],body_inputs:[]},contract_sha256:"0395f9a63e64f24a4883f0e0efc994dca4e7d8935ca7d3663b726fb6471db1c6"},{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"},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"},session_linked_requests:{type:"integer"},branch_tagged_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","session_linked_requests","branch_tagged_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_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"},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"}},required:["join","cost","optimizer","attribution"]}},required:["window","scope","connected","repos","basis","totals","by_work_type","by_repo","prs","unlanded","optimizer_effects","truncated","basis_notes"]},binding:{path_inputs:{},query_inputs:["from","sample_data","to","window"],body_inputs:[]},contract_sha256:"b27f10cd4ca4da1de7d12ab33738f08120cdb8c5950bf0b4708861dc402e6aa1"},{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"},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:{developers:{type:"integer"},seat_holders:{type:"integer"},seats_limit:{anyOf:[{type:"integer"},{type:"null"}]},devices:{type:"integer"},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","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"},spend_usd:{type:"number"},developers:{type:"integer"},input_tokens:{type:"integer"},output_tokens:{type:"integer"}},required:["agent_slug","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"},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"]}},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","input_tokens","output_tokens","cached_input_tokens","spend_usd","verified_savings_usd","top_harnesses","top_models","spark","last_seen","devices","last_login"]}}},required:["totals","series","harnesses","models","developers"]},binding:{path_inputs:{},query_inputs:["from","sample_data","to","window"],body_inputs:[]},contract_sha256:"d9b0752ef9fff964cae4801fb5ba9e7dc54572884a9c4d0ebdeb92c5efbdce48"},{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"},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:{org_requests:{type:"integer"},attributed_requests:{type:"integer"},unattributed_requests:{type:"integer"},coverage:{type:"number"},seat_holders:{type:"integer"},devices:{type:"integer"}},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"},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:["totals","developers","workflows","basis_notes"]},binding:{path_inputs:{},query_inputs:["from","sample_data","to","window"],body_inputs:[]},contract_sha256:"c010b71bee175bee0fbd6bca7c8f63a2307938da44a9313677e746d6cabbf366"},{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"}}},required:["cache_observed_usd","cache_requests","cache_basis","router_inferred_usd","router_baseline_usd","router_actual_usd","router_requests","router_basis","baseline_models"]},measured_spend:{type:"number"},projected_month_end_spend:{type:"number"},verified_savings:{type:"number"},projected_available_savings:{type:"number"},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","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:"6b1f0054271b55bd2b29dfbed34e123000607c4bc9f07c474c3143c1efd7eb41"},{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"}},required:["provider","route_from","route_to","route_applied","spend","requests","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:"1262afd63ce7864385cf06b4a25505992c16d6e089bc66a8fca0fa69374d7148"},{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"}},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:"6a3e36366418e9d32b5083fcb4738455777bb03fee4e16f8e2e3452933dd771b"},{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:{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:["window_start","window_end","vector_space","coverage","clusters","history"]},binding:{path_inputs:{},query_inputs:["from","sample_data","to","window"],body_inputs:[]},contract_sha256:"71c54af399477a821329ff526b85fd24fcc9f869c504a5335336c99773b1e8de"},{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"},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","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:"f66d5fb22f7f011933299951f345c68b7239c3642abf58fc83c71fb2155c1e62"},{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"},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","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:"d3d0d225177580ea6b6a65af8fe8c17771e2851d00da08c65a03da4a7e057c2d"},{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"}},required:["totals","by_auth_mode","series","basis","wrap_token_savings_basis"]},binding:{path_inputs:{},query_inputs:["from","sample_data","to","window"],body_inputs:[]},contract_sha256:"3278c6e21fe2e696393ddc784a770c6b4b1387fc1f1bbfdbf6cbb07d014e6a58"},{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"},fusion_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"}}},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","fusion_routing","model_routing","provider","task_profile","workflow_slug"],body_project:!0},contract_sha256:"458db6fd8d5cbf6013ec9bc337a1b9f340c1bd2a384ae9fc85ab34c562620fcd"},{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"}},required:["version","axes","providers","stored_credentials_enabled"]},binding:{path_inputs:{},query_inputs:[],body_inputs:[]},contract_sha256:"9080c26c51c0fceddf89ea468a1d31615f81612fa6e5dec95a5a9be45e7a8392"},{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:"human.tool_catalogs",version:"1",summary:"human: tool_catalogs",method:"GET",path:"/tool-catalogs",permissions:["trace:read_metadata"],scope:"project",access:"none",exclusion:"Tool catalogs are a data-plane SDK concern, not an operator management surface.",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:"e11a1a4882735721edac274df7e391668bfe53fcbb714c27c9823fb5cc0c9205"},{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"},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","member_user_id","sample_data","to","window","workflow"],body_inputs:[]},contract_sha256:"317c8846c64c034e5496f6b60097b5de8218df738c3499aedab6ca1111a42c43"},{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"},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"},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:"05189b8ea1f42e86dd02e541369bca91180323994461675096f62d3f95922d09"},{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"},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"},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:"38a6157efbd80d6cb82a4f0f335b968ed038001023f2c6477fdbf94bf3919608"},{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"},to:{type:"string",format:"date-time"},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"},request_count:{type:"integer"},error_count:{type:"integer"},max_status_code:{type:"integer"},latency_ms:{type:"integer"},total_cost_usd:{type:"number"},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"},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"}},required:["trace_id","root_request_id","started_at","ended_at","provider","model","agent_slug","workflow_slug","request_count","error_count","max_status_code","latency_ms","total_cost_usd","input_tokens","output_tokens","cached_input_tokens","optimization_ids","compressed_requests","span_count","has_gateway_requests","source_kinds","source_systems","ingestion_ids","sort_value"]}},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"},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","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:"3b1ca41657b423fc02d8b4ee5907291241e904788a3de1df02e1a5745cb44577"},{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:"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:"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:"POST",path:"/auth/device/ack",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/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/switch-organization",reason:"Moves the caller across the organization boundary. A project-scoped agent session must never leave its tenant."},{method:"POST",path:"/billing/portal",reason:"Changes billing, spend ceilings, or the money contract. Human-only regardless of agent competence."},{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:"PATCH",path:"/factory/subjects/{subjectId}",reason:"Changes legacy Factory spending limits or pause state. Agents cannot change their own execution authority or budget."},{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:"/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:"/optimization-proposals/{proposalId}/packet",reason:"Issues the FixPacket a coding agent implements from, and mints a GitHub App token to resolve the base commit. The local fix lane is driven by `caveman agent pull` under a human's hands; handing an MCP agent its own work order is the same deferral as POST /run."},{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:"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/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:"PATCH",path:"/org/retention",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/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:"DELETE",path:"/orgs/{orgId}/autopilot/pause",reason:"Publishes or rolls back live traffic policy at S2/S3. Agents draft and experiment; a human promotes."},{method:"POST",path:"/orgs/{orgId}/autopilot/pause",reason:"Publishes or rolls back live traffic policy at S2/S3. Agents draft and experiment; a human promotes."},{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:"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:"GET",path:"/projects/{projectId}/agent-bugbot",reason:"Native user inbox of automatic work. Requires payload disclosure permission; never widens personal chat history."},{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:"PUT",path:"/projects/{projectId}/agent-grants/{grantId}",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-grants/{grantId}/revoke",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-repository-head",reason:"Resolves admitted repository identity under native user authority; workload callers cannot replace a pinned revision."},{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-sandbox",reason:"Native user execution setup. Workload callers cannot choose or widen execution recipes."},{method:"GET",path:"/projects/{projectId}/agent-setup",reason:"Native user configuration of shared execution authority; grants and provider bindings remain private."},{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:"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/connect-init",reason:"Repository binding is an OAuth trust relationship between two accounts. The human owns both sides of it."},{method:"POST",path:"/projects/{projectId}/github/select-repo",reason:"Repository binding is an OAuth trust relationship between two accounts. The human owns both sides of it."},{method:"PUT",path:"/projects/{projectId}/github/test-command",reason:"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."},{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:"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}/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:"POST",path:"/projects/{projectId}/providers",reason:"Handles provider credentials or their verification. Agents route traffic; they never hold or rotate the secrets that pay for it."},{method:"DELETE",path:"/projects/{projectId}/providers/{connectionId}",reason:"Handles provider credentials or their verification. Agents route traffic; they never hold or rotate the secrets that pay for it."},{method:"POST",path:"/projects/{projectId}/providers/{connectionId}/rotate-secret",reason:"Handles provider credentials or their verification. Agents route traffic; they never hold or rotate the secrets that pay for it."},{method:"PATCH",path:"/projects/{projectId}/replay-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:"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:"/reports/factory/subjects",reason:"Legacy Factory subject and rubric records remain native UI resources during migration; the shared agent surface does not expose this legacy execution system."},{method:"GET",path:"/reports/factory/subjects/{subjectId}",reason:"Legacy Factory subject and rubric records remain native UI resources during migration; the shared agent surface does not expose this legacy execution system."},{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:"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:"/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."}]}});var Cp={};Jr(Cp,{cloudContext:()=>$g});import{readFile as hg,writeFile as bg,mkdir as vg,rename as jg}from"node:fs/promises";import{homedir as wg}from"node:os";import{join as Np,dirname as Pg}from"node:path";import{randomUUID as qg}from"node:crypto";async function Lp(t,e){try{return JSON.parse(await hg(t,"utf8"))}catch(r){if(r.code==="ENOENT")return e;throw new f("cave_context_invalid",`Invalid context file: ${t}`,2)}}async function Ur(t,e){await vg(Pg(t),{recursive:!0});let r=t+"."+qg()+".tmp";await bg(r,JSON.stringify(e,null,2)+`
|
|
10
|
+
`,{mode:384,flag:"wx"}),await jg(r,t)}function ys(t){if(t!==void 0&&!kg.test(t))throw new f("cave_project_required","Project must be a UUID.",2);return t}function $g(t,{home:e=wg(),cwd:r=process.cwd(),env:i=process.env}={}){let a=Np(e,".caveman-cloud","profiles.json"),s=Np(r,".caveman-cloud.json");async function n(){let c=await Lp(a,{schema_version:1,profiles:{}});if(c.schema_version!==1||!c.profiles||typeof c.profiles!="object"||Array.isArray(c.profiles))throw new f("cave_context_invalid","Unsupported Cloud profiles document.",2);return c}async function o({profile:c,projectId:u}={}){let y=await n();if(c=c??i.CAVE_CLOUD_PROFILE??y.selected??"default",!Rp.test(c))throw new f("cave_profile_invalid","Invalid profile name.",2);let g=await Lp(s,{});if(Object.keys(g).some(m=>!["schema_version","project_id"].includes(m))||g.schema_version!==void 0&&g.schema_version!==1)throw new f("cave_context_invalid","Repository binding accepts only schema_version and project_id.",2);let l;if(c==="default")l=await t();else{let m=y.profiles[c];if(!m)throw new f("cave_profile_missing",`Profile ${c} is not configured. Use context save.`,3);if(!/^[A-Z][A-Z0-9_]{0,127}$/.test(m.token_env??""))throw new f("cave_profile_invalid","Named profile needs a token environment variable.",2);if(l={baseURL:m.endpoint,token:i[m.token_env],projectId:m.project_id},!l.token)throw new f("cave_profile_credential_missing",`Set ${m.token_env} for profile ${c}. No default credential fallback.`,3)}let _=ys(u??i.CAVE_PROJECT_ID??g.project_id??(c==="default"?y.project_id:void 0)??l.projectId);return{...l,projectId:_,profile:c,projectSource:u?"flag":i.CAVE_PROJECT_ID?"environment":g.project_id?"repository":_?"saved":"unset"}}async function p(c,u,y,g){let l=await n();if(c==="list")return{schema_version:1,profiles:["default",...Object.keys(l.profiles)].map(m=>({id:m,selected:(l.selected??"default")===m,...m==="default"?{}:{endpoint:l.profiles[m].endpoint,project_id:l.profiles[m].project_id,token_env:l.profiles[m].token_env}}))};if(c==="save"){let m=y[0];if(y.length!==1||!Rp.test(m)||m==="default"||!u.endpoint||!/^[A-Z][A-Z0-9_]{0,127}$/.test(u["token-env"]??""))throw new f("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 pe({baseURL:u.endpoint,token:"endpoint-validation"}),l.profiles[m]={endpoint:u.endpoint,token_env:u["token-env"],...u.project?{project_id:ys(u.project)}:{}},await Ur(a,l),{schema_version:1,ok:!0,profile:m}}if(c==="use"){let m=y[0];if(y.length!==1||m!=="default"&&!Object.hasOwn(l.profiles,m))throw new f("cave_profile_missing","Use context use NAME with an existing profile.",2);return l.selected=m,await Ur(a,l),{schema_version:1,ok:!0,profile:m}}let _=await o({profile:g,projectId:u.project});if(c==="bind"||c==="set"){let m=ys(u.project??y[0]);if(!m||y.length>1)throw new f("cave_usage","Select one project UUID.",2);return await new pe({..._,projectId:m}).execute("projects.get",{}),c==="bind"?await Ur(s,{schema_version:1,project_id:m}):(_.profile==="default"?l.project_id=m:l.profiles[_.profile].project_id=m,await Ur(a,l)),{schema_version:1,ok:!0,profile:_.profile,project_id:m,source:c==="bind"?"repository":"saved"}}if(c!=="show")throw new f("cave_usage","Use context show|list|save|use|set|bind.",2);if(y.length)throw new f("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 d(c){let u=await o(c),y=new pe(u),g=await y.discover();if(g.schema_version!==1||!Array.isArray(g.operations))throw new f("cave_contract_invalid","Server discovery document is invalid.",6);let l=g.contract_sha256===ms;return{schema_version:1,ok:l,status:l?"completed":"incompatible",profile:u.profile,endpoint:u.baseURL,project_id:u.projectId??null,installed_contract:ms,server_contract:g.contract_sha256,granted_operations:g.operations.map(_=>_.id),...l?{}:{next_action:"Update client or server to a matching contract."}}}return{resolve:o,command:p,doctor:d}}var kg,Rp,Mp=qt(()=>{Vr();kg=/^[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}$/i,Rp=/^[a-z][a-z0-9_-]{0,63}$/});var Dp={};Jr(Dp,{datasetFromTraces:()=>xg,scenarioFromTrace:()=>zg,traceTranscript:()=>_s});async function _s(t,e){Ce("traces.payload",{...e,kind:"request"});let r=[];for(let i of["request","response"])r.push((await t.execute("traces.payload",{...e,kind:i})).data);return{schema_version:1,trace_id:e.trace_id,request_id:e.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 xg(t,e,{name:r="Trace regression",description:i=""}={}){if(!Array.isArray(e)||e.length<1||e.length>100)throw new f("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 e){if(s.has(o.request_id))throw new f("cave_trace_selection_invalid","Duplicate request selection.",2);s.add(o.request_id);let p=await _s(t,o),[d,c]=p.captures;if(d.status!=="captured")throw new f("cave_capture_unavailable",`Request capture is unavailable: ${d.reason}.`,6);a.push({row_key:o.request_id,values:{input:d.payload,...c.status==="captured"?{observed_output:c.payload}:{},source:{...o,request_sha256:d.payload_sha256,...c.status==="captured"?{response_sha256:c.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 Ce("datasets.create",n.spec),n}async function zg(t,e,{name:r="Trace regression scenario"}={}){let i=await _s(t,e),a=i.captures.find(s=>s.kind==="request");if(!a||a.status!=="captured")throw new f("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:[],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:{...e,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.","Captured output is observed behavior, never an expected answer.","This draft cannot execute or certify a test.",...i.warnings]}}var Gp=qt(()=>{Vr()});var fs={};Jr(fs,{manifestDiff:()=>Ag,manifestFamilies:()=>Og,parseRows:()=>Eg,pullManifest:()=>Up,pushBundle:()=>Ig,pushManifest:()=>Vp,validateBundle:()=>Fp,validateManifest:()=>ir});import{createHash as gs}from"node:crypto";function ir(t,e){if(!rr[e]||t?.schema_version!==1||t.kind!==e||Object.keys(t).some(r=>!["schema_version","kind","resource","spec"].includes(r)))throw new f("cave_manifest_invalid","Expected version 1 manifest with kind, optional resource, and spec.",2);if(Ce(`${e}.create`,t.spec),t.resource){if(Object.keys(t.resource).some(r=>!(e==="scenarios"?["id","revision","version"]:["id","revision"]).includes(r)))throw new f("cave_manifest_invalid","Resource identity accepts id and revision only.",2);if(Ce(`${e}.update`,{...e==="scenarios"?{definition:t.spec}:t.spec,[rr[e].id]:t.resource.id,revision:t.resource.revision}),e==="scenarios"&&(!Number.isSafeInteger(t.resource.version)||t.resource.version<1))throw new f("cave_manifest_invalid","Scenario resource requires an immutable version.",2)}return t}async function Up(t,e,r,i=1){let a=rr[e],s=await t.execute(`${e}.get`,{[a.id]:r,...e==="scenarios"?{version:i}:{}});if(e==="scenarios")return ir({schema_version:1,kind:e,resource:{id:s.data.dataset_id,revision:s.data.revision,version:s.data.version},spec:s.data.definition},e);let n=s.data[a.singular],o;return e==="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}:{}}))}}:e==="evaluators"?o={config:{schema_version:1,grader_type:n.grader_type,options:n.options,input_mapping:n.input_mapping}}:o={document:n.document},ir({schema_version:1,kind:e,resource:{id:n.id,revision:n.revision},spec:{name:n.name,description:n.description,...o}},e)}function Ag(t,e){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(t?.spec,e.spec,"/spec"),r}function ar(t){return Array.isArray(t)?t.map(ar):t&&typeof t=="object"?Object.fromEntries(Object.keys(t).sort().map(e=>[e,ar(t[e])])):t}async function Vp(t,e,{idempotencyKey:r}={}){let i=e.kind;ir(e,i);let a={...i==="scenarios"&&e.resource?{definition:e.spec}:e.spec,...e.resource?{[rr[i].id]:e.resource.id,revision:e.resource.revision}:{}},s=`${i}.${e.resource?"update":"create"}`,n=r??"manifest:"+gs("sha256").update(JSON.stringify(ar({project:t.projectId,id:s,input:a}))).digest("hex"),o=await t.execute(s,a,{idempotencyKey:n}),p=o.data.id??o.data.dataset_id;return{...o,manifest:{...e,resource:{id:p,revision:o.data.revision,...i==="scenarios"?{version:o.data.version}:{}}},lock:{schema_version:1,kind:i,project_id:t.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 Fp(t){if(t?.schema_version!==1||!Array.isArray(t.resources)||t.resources.length<1||t.resources.length>50||Object.keys(t).some(r=>!["schema_version","resources"].includes(r)))throw new f("cave_manifest_invalid","Bundle needs schema_version:1 and 1-50 named resources.",2);let e=new Set;for(let r of t.resources){if(!r||Object.keys(r).some(i=>!["name","manifest"].includes(i))||!/^[a-z][a-z0-9_-]{0,63}$/.test(r.name)||e.has(r.name))throw new f("cave_manifest_invalid","Bundle resource names must be unique lowercase identifiers.",2);e.add(r.name),ir(r.manifest,r.manifest?.kind)}return t}async function Ig(t,e,{lock:r,onReceipt:i}={}){if(Fp(e),r&&(r.schema_version!==1||r.project_id!==t.projectId||!r.resources||typeof r.resources!="object"))throw new f("cave_lock_conflict","Lock belongs to another project or has an unsupported version.",4);r=structuredClone(r??{schema_version:1,project_id:t.projectId,resources:{}});let a=[];for(let{name:n,manifest:o}of e.resources)try{let p=gs("sha256").update(JSON.stringify(ar(o.spec))).digest("hex"),d=r.resources[n],c=o;if(d){if(d.kind!==o.kind||o.resource&&o.resource.id!==d.id)throw new f("cave_lock_conflict",`Resource ${n} changed identity.`,4);if(d.spec_sha256===p){if((await Up(t,o.kind,d.id,d.current_version||1)).resource.revision!==d.revision)throw new f("cave_eval_revision_conflict",`Resource ${n} changed remotely. Pull and reconcile before retrying.`,4);a.push({name:n,status:"unchanged",receipt_id:d.receipt_id,resource_id:d.id});continue}c={...o,resource:{id:d.id,revision:d.revision,...o.kind==="scenarios"?{version:d.current_version}:{}}}}let u="bundle:"+gs("sha256").update(JSON.stringify(ar({project:t.projectId,name:n,manifest:c}))).digest("hex"),y=await Vp(t,c,{idempotencyKey:u});r.resources[n]={...y.lock,spec_sha256:p},await i?.(r),a.push({name:n,status:"completed",receipt_id:y.receipt_id,resource_id:y.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 Eg(t){if(Buffer.byteLength(t)>16*1024*1024)throw new f("cave_input_too_large","Rows exceed 16 MiB.",2);let e=[];for(let[r,i]of t.split(/\r?\n/).entries())if(i.trim())try{e.push(JSON.parse(i))}catch{throw new f("cave_invalid_jsonl",`Invalid JSON on row line ${r+1}.`,2)}return e}var rr,Og,hs=qt(()=>{Vr();rr={datasets:{singular:"dataset",id:"dataset_id"},evaluators:{singular:"evaluator",id:"evaluator_id"},evals:{singular:"workbench",id:"workbench_id"},scenarios:{singular:"scenario",id:"dataset_id"}},Og=Object.keys(rr)});import{readFile as vs,writeFile as sr}from"node:fs/promises";import{parseArgs as wt}from"node:util";import{setTimeout as Kp}from"node:timers/promises";function $e(t){let e=Fr.find(r=>r.id===t||r.aliases.includes(t));if(!e)throw new f("cave_unknown_operation",`Unknown operation ${t}. Run caveman cloud tools list.`,2);return e}function bs(t){if(!Kr.includes(t))return $e(t);let[e,r]=t.split("."),i={type:"string",format:"uuid"},a={type:"object",additionalProperties:!1,properties:{}},s=`caveman cloud ${t.replaceAll("."," ")}`;if(["traces.transcript","datasets.from-traces","scenarios.from-trace"].includes(t)){let{kind:n,...o}=$e("traces.payload").input_schema.properties;a={type:"object",additionalProperties:!1,properties:o,required:Object.keys(o)},s+=" --file SELECTION.json [--out OUTPUT.json]"}else e==="targets"?(a=r==="validate"?$e("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":""}`):["datasets","evaluators","evals","scenarios"].includes(e)&&["validate","diff","push"].includes(r)?(a={type:"object",additionalProperties:!1,required:["schema_version","kind","spec"],properties:{schema_version:{const:1},kind:{const:e},spec:$e(e+".create").input_schema,resource:{type:"object",additionalProperties:!1,required:["id","revision",...e==="scenarios"?["version"]:[]],properties:{id:i,revision:{type:"integer",minimum:1},...e==="scenarios"?{version:{type:"integer",minimum:1}}:{}}}}},s+=" --file MANIFEST.json"):["pull","versions"].includes(r)?s+=" RESOURCE_ID [--out FILE]":r==="wait"?(a=$e(e==="runs"?"runs.get":"evals.result").input_schema,s+=e==="runs"?" RUN_ID [--after CURSOR] [--wait-timeout MS]":" WORKBENCH_ID RUN_ID [--wait-timeout MS]"):e==="manifests"?s+=" --file BUNDLE.json"+(r==="push"?" --lock LOCK.json":""):e==="context"&&(s+={save:" NAME --endpoint URL --token-env VARIABLE [--project UUID]",use:" NAME",set:" PROJECT_ID",bind:" PROJECT_ID",show:"",list:""}[r]);return{id:t,version:"1",execution:"client_workflow",summary:s,input_schema:a,usage:s}}function Ce(t,e){let r=$e(t);for(let a of[e?.parameters,e?.query,e?.body])if(a&&["projectId","orgId","project_id","organization_id"].some(s=>Object.hasOwn(a,s)))throw new f("cave_scope_argument_rejected","Scope comes from authenticated context and --project, not operation input.",2);Pt.has(r.id)||Pt.set(r.id,Hr.compile(r.input_schema));let i=Pt.get(r.id);if(!i(e))throw new f("cave_operation_input_invalid",`Invalid input for ${r.id}.`,2,i.errors);return e}async function nr(t,e){if(t&&e)throw new f("cave_usage","Use either --file or --stdin.",2);let r="{}";if(t)r=await vs(t,"utf8");else if(e){let i=[],a=0;for await(let s of process.stdin){if(a+=Buffer.byteLength(s),a>16*1024*1024)throw new f("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 f("cave_input_too_large","Input exceeds 16 MiB.",2);try{return JSON.parse(r)}catch{throw new f("cave_invalid_json","Input must be one JSON document.",2)}}function ie(t,e){if(e==="json"||e==="jsonl"){process.stdout.write(JSON.stringify(t)+`
|
|
11
|
+
`);return}if(Array.isArray(t)){for(let r of t)process.stdout.write(typeof r=="string"?r+`
|
|
12
|
+
`:`${r.id??r.operation??""} ${r.summary??r.status??""}
|
|
13
|
+
`);return}process.stdout.write(JSON.stringify(t,null,2)+`
|
|
14
|
+
`)}async function Eh(t,{context:e,login:r}={}){let i=process.stdout.isTTY?"table":"json";try{let a;t=[...t];for(let v=0;v<t.length;v++)if(t[v]==="--profile"||t[v].startsWith("--profile=")){if(a!==void 0)throw new f("cave_usage","Supply --profile once.",2);let E=t[v].startsWith("--profile=");if(a=E?t[v].slice(10):t[v+1],!a||a.startsWith("--"))throw new f("cave_usage","--profile needs a name.",2);t.splice(v,E?1:2),v--}let{cloudContext:s}=await Promise.resolve().then(()=>(Mp(),Cp)),n=s(e??(async()=>({baseURL:process.env.CAVE_API_URL??"https://api.caveman.so",token:process.env.CAVE_TOKEN,projectId:process.env.CAVE_PROJECT_ID}))),o=(v={})=>n.resolve({profile:a,...v}),[p,d,...c]=t;if(Kr.includes(`${p}.${d}`)&&c.includes("--help"))return ie(bs(`${p}.${d}`),i),0;if(p==="doctor"||p==="auth"&&d==="status"||p==="context"&&["show","list","save","use","set","bind"].includes(d)){let{values:v,positionals:E}=wt({args:p==="doctor"?t.slice(1):c,allowPositionals:!0,strict:!0,options:{format:{type:"string"},project:{type:"string"},...p==="context"&&d==="save"?{endpoint:{type:"string"},"token-env":{type:"string"}}:{}}});if(i=v.format??i,!["json","jsonl","table"].includes(i))throw new f("cave_usage","Format must be json, jsonl, or table.",2);let S;if(p==="context")S=await n.command(d,v,E,a);else{if(E.length)throw new f("cave_usage","Unexpected positional arguments.",2);S=p==="doctor"?await n.doctor({profile:a,projectId:v.project}):await new pe(await o()).execute("context.whoami",{})}return ie(S,i),S.ok===!1?4:0}if(p==="auth"&&d==="login"){if((await n.resolve({profile:a})).profile!=="default")throw new f("cave_usage","Named profiles use their configured token environment variable.",2);if(!process.stdin.isTTY)throw new f("cave_auth_required","For headless use, set CAVE_TOKEN or a named profile token environment variable.",3);if(!r)throw new f("cave_auth_required","Run caveman login.",3);return await r(c),0}if(!p||p==="--help"||p==="-h")return ie({usage:"caveman cloud <resource> <verb> [--file input.json | --stdin] [--project UUID] [--profile NAME]",context:"caveman cloud context show|save|use|set|bind",diagnostics:"caveman cloud doctor",auth:"caveman cloud auth status|login",discover:"caveman cloud tools list",schemas:"caveman cloud tools describe datasets.create",formats:["json","jsonl","table"],write_retry:"Supply --idempotency-key; reuse for identical retries.",families:[...new Set([...Fr.map(v=>v.id),...Kr].map(v=>v.split(".")[0]))].sort()},i),0;if(p==="traces"&&d==="transcript"||p==="datasets"&&d==="from-traces"||p==="scenarios"&&d==="from-trace"){let{traceTranscript:v,datasetFromTraces:E,scenarioFromTrace:S}=await Promise.resolve().then(()=>(Gp(),Dp)),{values:Z,positionals:W}=wt({args:c,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=Z.format??i,!["json","jsonl","table"].includes(i))throw new f("cave_usage","Format must be json, jsonl, or table.",2);if(W.length>1)throw new f("cave_usage","Supply one trace ID or a selection file.",2);let z=Z.file||Z.stdin?await nr(Z.file,Z.stdin):{trace_id:Z.trace??W[0],request_id:Z["request-id"],from:Z.from,to:Z.to},me=await o({projectId:Z.project}),F=new pe({...me,projectId:Z.project??me.projectId}),V=d==="transcript"?await v(F,z):d==="from-trace"?await S(F,z,{name:Z.name}):await E(F,Array.isArray(z)?z:[z],{name:Z.name});return Z.out&&await sr(Z.out,JSON.stringify(V,null,2)+`
|
|
15
|
+
`,{flag:"wx",mode:384}),ie(V,i),d==="transcript"&&V.warnings.length?6:0}if(p==="targets"&&["list","get","validate"].includes(d)){let{values:v,positionals:E}=wt({args:c,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 f("cave_usage","Format must be json, jsonl, or table.",2);let S=$e("evals.create").input_schema.properties.document.properties.targets.items;if(d==="validate"){if(E.length)throw new f("cave_usage","Use targets validate --file TARGET.json.",2);let F=Hr.compile(S),V=await nr(v.file,v.stdin);if(!F(V))throw new f("cave_target_invalid","Invalid target configuration.",2,F.errors);return ie({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||E.length!==(d==="get"?2:1))throw new f("cave_usage","Use targets list WORKBENCH_ID or targets get WORKBENCH_ID TARGET_KEY.",2);let z=(await new pe(await o({projectId:v.project})).execute("evals.get",{workbench_id:E[0]})).data.workbench,me=z.document.targets.filter(F=>d==="list"||F.key===E[1]);if(d==="get"&&me.length!==1)throw new f("cave_target_not_found","Target not found in this workbench.",1);return ie({schema_version:1,workbench_id:z.id,revision:z.revision,targets:me,limitations:["Configuration identity is recorded here. Run evidence establishes whether execution completed."]},i),0}if(p==="manifests"&&["validate","push"].includes(d)){let{validateBundle:v,pushBundle:E}=await Promise.resolve().then(()=>(hs(),fs)),{values:S,positionals:Z}=wt({args:c,allowPositionals:!0,strict:!0,options:{file:{type:"string"},stdin:{type:"boolean"},lock:{type:"string"},project:{type:"string"},format:{type:"string"}}});if(i=S.format??i,!["json","jsonl","table"].includes(i)||Z.length)throw new f("cave_usage","Use manifests validate|push --file BUNDLE [--lock LOCK].",2);let W=v(await nr(S.file,S.stdin));if(d==="validate")return ie({schema_version:1,ok:!0,resources:W.resources.map(V=>V.name),validation:"json_schema",models_invoked:0},i),0;if(!S.lock)throw new f("cave_usage","Multi-resource push needs --lock FILE to preserve partial receipts.",2);let z;try{z=JSON.parse(await vs(S.lock,"utf8"))}catch(V){if(V.code!=="ENOENT")throw new f("cave_lock_invalid","Lock must be valid JSON.",2)}let me=await o({projectId:S.project}),F=await E(new pe(me),W,{lock:z,onReceipt:async V=>{let{rename:Xe}=await import("node:fs/promises"),{randomUUID:et}=await import("node:crypto"),ve=S.lock+"."+et()+".tmp";await sr(ve,JSON.stringify(V,null,2)+`
|
|
16
|
+
`,{mode:384,flag:"wx"}),await Xe(ve,S.lock)}});return ie(F,i),F.exit_code}if(["datasets","evaluators","evals","scenarios"].includes(p)&&["validate","pull","diff","push","versions"].includes(d)){let{validateManifest:v,pullManifest:E,manifestDiff:S,pushManifest:Z,parseRows:W}=await Promise.resolve().then(()=>(hs(),fs)),{values:z,positionals:me}=wt({args:c,allowPositionals:!0,strict:!0,options:{file:{type:"string"},stdin:{type:"boolean"},out:{type:"string"},project:{type:"string"},format:{type:"string"},...p==="scenarios"?{version:{type:"string"}}:{},...p==="datasets"?{rows:{type:"string"},"rows-out":{type:"string"}}:{},"idempotency-key":{type:"string"}}});if(i=z.format??i,!["json","jsonl","table"].includes(i))throw new f("cave_usage","Format must be json, jsonl, or table.",2);if(z["rows-out"]&&d!=="pull")throw new f("cave_usage","--rows-out requires datasets pull.",2);let F,V=["validate","diff","push"].includes(d)?await nr(z.file,z.stdin):void 0;if(z.rows){if(!V?.spec?.document||V.spec.document.rows?.length)throw new f("cave_usage","--rows requires a dataset manifest with empty document.rows.",2);V.spec.document.rows=W(await vs(z.rows,"utf8"))}if(V&&(V=v(V,p)),d==="validate")F={schema_version:1,ok:!0,status:"completed",validation:"json_schema",kind:p,limitations:["Server checks resource references and domain constraints when applying. No write or model call performed."]};else{let Xe=await o({projectId:z.project}),et=new pe({...Xe,projectId:z.project??Xe.projectId});if(d==="pull"||d==="versions"){if(me.length!==1)throw new f("cave_usage",`${p} ${d} requires one resource ID.`,2);if(d==="pull")F=await E(et,p,me[0],Number(z.version??1));else{let ve=$e(`${p==="scenarios"?"datasets":p}.get`);F=(await et.execute(ve.id,{[Object.values(ve.binding.path_inputs)[0]]:me[0]})).data.versions}}else if(d==="diff"){let ve=V.resource?await E(et,p,V.resource.id,V.resource.version):void 0;F={schema_version:1,ok:!0,status:"completed",revision:ve?.resource.revision??null,revision_conflict:!!ve&&ve.resource.revision!==V.resource.revision,changes:S(ve,V)}}else F=await Z(et,V,{idempotencyKey:z["idempotency-key"]})}if(z["rows-out"]){if(d!=="pull")throw new f("cave_usage","--rows-out requires datasets pull.",2);await sr(z["rows-out"],F.spec.document.rows.map(Xe=>JSON.stringify(Xe)).join(`
|
|
17
|
+
`)+`
|
|
18
|
+
`,{flag:"wx",mode:384}),F.spec.document.rows=[]}return z.out&&await sr(z.out,JSON.stringify(F,null,2)+`
|
|
19
|
+
`,{flag:"wx",mode:384}),ie(F,i),F.revision_conflict?4:0}let u=p==="tools",y=["evals","runs"].includes(p)&&d==="wait",g=p==="runs"&&y,l=u?void 0:$e(y?g?"runs.get":"evals.result":`${p}.${d}`),_=l?.input_schema.properties??{},m={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"}};l?.async_kind&&(m.wait={type:"boolean"}),(y||l?.async_kind)&&(m["wait-timeout"]={type:"string"}),g&&(m.after={type:"string"}),l?.id==="traces.search"&&(m.limit={type:"string"});for(let[v,E]of Object.entries(_))v.replaceAll("_","-")in m||(m[v.replaceAll("_","-")]={type:E.type==="boolean"?"boolean":"string"});let{values:h,positionals:$}=wt({args:c,options:m,allowPositionals:!0,strict:!0});if(i=h.format??i,!["json","jsonl","table"].includes(i))throw new f("cave_usage","Format must be json, jsonl, or table.",2);if(u){if(d==="list"){let E=h.remote?(await new pe({...await o(),timeout:Number(h.timeout??3e4)}).discover()).operations:[...Fr,...Kr.filter(S=>!Fr.some(Z=>Z.id===S)).map(bs)];return ie(E.map(({id:S,version:Z,summary:W,access:z})=>({id:S,version:Z,summary:W,access:z})),i),0}if(!["describe","schema"].includes(d)||$.length!==1)throw new f("cave_usage","Use tools list or tools describe|schema OPERATION.",2);let v=bs($[0]);return ie(d==="schema"?v.input_schema:v,i),0}if(h.help)return ie(l,i),0;let w=await nr(h.file,h.stdin);if(!w||typeof w!="object"||Array.isArray(w))throw new f("cave_usage","Input must be a JSON object.",2);for(let[v,E]of Object.entries(_)){let S=v.replaceAll("_","-");if(h[S]===void 0)continue;if(Object.hasOwn(w,v))throw new f("cave_usage",`Input supplies ${v} twice.`,2);let Z=h[S];w[v]=E.type==="object"||E.type==="array"?JSON.parse(Z):E.type==="integer"||E.type==="number"?Number(Z):Z}if(l.id==="traces.search"&&h.limit!==void 0){if(w.page_size!==void 0)throw new f("cave_usage","Use either --limit or --page-size.",2);w.page_size=Number(h.limit)}if(p==="projects"&&["get","update"].includes(d)&&$.length){if(h.project!==void 0)throw new f("cave_usage","Supply the project once: positional ID or --project.",2);h.project=$.shift()}let L=[...Object.values(l.binding.path_inputs??{}),...(l.binding.query_inputs??[]).filter(v=>v.endsWith("_id"))];if($.length>L.length)throw new f("cave_usage","Too many positional identifiers; inspect tools describe.",2);for(let[v,E]of $.entries()){if(w[L[v]]!==void 0)throw new f("cave_usage","Duplicate resource identifier.",2);w[L[v]]=E}Ce(l.id,w);let P=await o({projectId:h.project}),ee=new pe({...P,projectId:h.project??P.projectId,timeout:Number(h.timeout??3e4)}),H;if(y||h.wait){let v=Number(h["wait-timeout"]??36e5);if(!Number.isSafeInteger(v)||v<1||v>864e5)throw new f("cave_usage","--wait-timeout must be 1-86400000 ms; --timeout bounds each request.",2);let E=Date.now()+v,S=new AbortController,Z=()=>S.abort();process.once("SIGINT",Z);try{let W=y?void 0:await ee.execute(l.id,w,{idempotencyKey:h["idempotency-key"],signal:S.signal});g||l.async_kind==="agent"?H=await ee.waitRun(W?.data.id??w.run_id,{signal:S.signal,deadline:E,after:Number(h.after??0),onEvent:i==="jsonl"?z=>ie({schema_version:1,operation:"runs.events",event:z},"jsonl"):void 0,onProgress:i==="table"?z=>process.stderr.write(`${z.status}
|
|
20
|
+
`):void 0}):H=await ee.waitEvaluation(w.workbench_id,W?.data.run.id??w.run_id,{signal:S.signal,deadline:E,onProgress:i==="table"?z=>process.stderr.write(`${z.status}: ${z.completed}/${z.total}
|
|
21
|
+
`):void 0})}finally{process.removeListener("SIGINT",Z)}}else H=await ee.execute(l.id,w,{idempotencyKey:h["idempotency-key"]});if(h.out&&await sr(h.out,JSON.stringify(H,null,2)+`
|
|
22
|
+
`,{flag:"wx",mode:384}),ie(H,i),g||h.wait&&l.async_kind==="agent"){let v=H.data.result;return H.operation==="runs.get"?6:v?.execution_status!==void 0?v.execution_status==="completed"?v.assessment?.status==="passed"?0:v.assessment?.status==="failed"?5:6:6:l.id==="scenarios.run"?6:0}let Me=["evals.compare","scenarios.compare"].includes(l.id)?H.data.quality:y||h.wait?H.data.quality?.status:void 0;return Me==="passed"||Me===void 0&&!(y||h.wait)?0:Me==="failed"?5:6}catch(a){let s=a instanceof f?a:new f("cave_usage",a.message??"Command failed.",2);return ie({schema_version:1,ok:!1,status:"failed",error:{code:s.code,message:s.message,...s.details?{details:s.details}:{}}},i),s.exitCode}}var Hp,Bp,Hr,Pt,Fr,Kr,ms,f,Sg,pe,Vr=qt(()=>{Hp=js(gp(),1),Bp=js(Tp(),1);Zp();Hr=new Hp.default({strict:!1,allErrors:!0});(0,Bp.default)(Hr);Pt=new Map,Fr=ls.operations,Kr=["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"].flatMap(t=>["validate","pull","diff","push","versions"].map(e=>t+"."+e)),"evals.wait","runs.wait"],ms=ls.contract_sha256,f=class extends Error{constructor(e,r,i=1,a){super(r),this.code=e,this.exitCode=i,this.details=a}};Sg=t=>t===401||t===403?3:t===409?4:t===429?7:t===422||t===400?2:1,pe=class{constructor({baseURL:e,token:r,projectId:i,fetch:a=globalThis.fetch,timeout:s=3e4}){let n=new URL(e);if(n.protocol!=="https:"&&!(n.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(n.hostname)))throw new f("cave_endpoint_invalid","Cloud endpoint must use HTTPS or loopback HTTP.",2);if(n.username||n.password||n.search||n.hash)throw new f("cave_endpoint_invalid","Cloud endpoint cannot contain credentials, query, or fragment.",2);if(!Number.isInteger(s)||s<100||s>12e4)throw new f("cave_timeout_invalid","Timeout must be 100-120000 ms.",2);this.baseURL=e.replace(/\/$/,""),this.token=r,this.projectId=i,this.fetch=a,this.timeout=s}async request(e,{body:r,headers:i={},signal:a}={}){if(!this.token)throw new f("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+e,{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 f(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 f("cave_result_too_large","Result exceeds 16 MiB; narrow the query.",6);let o=n.body?.getReader(),p=0,d=[];if(o)try{for(;;){let{done:u,value:y}=await o.read();if(u)break;if(p+=y.byteLength,p>16*1024*1024)throw await o.cancel(),new f("cave_result_too_large","Result exceeds 16 MiB; narrow the query.",6);d.push(y)}}finally{o.releaseLock()}let c;try{c=JSON.parse(Buffer.concat(d).toString("utf8"))}catch{throw new f("cave_invalid_response","Cloud returned an invalid JSON response.",6)}if(!n.ok){let u=c.error?.error??c.error??c;throw new f(u.code??"cave_request_failed",u.message??`Cloud request failed (${n.status}).`,Sg(n.status),c)}return c}async discover(){return this.request("/api/v1/cloud/operations")}async waitEvaluation(e,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 f("cave_usage","Invalid wait deadline or polling interval.",2);for(;Date.now()<a;){let o=await this.execute("evals.result",{workbench_id:e,run_id:r},{signal:i}),p=o.data.run;if(["completed","failed","error","cancelled"].includes(p?.status))return o;if(!["queued","running","cancelling"].includes(p?.status))throw new f("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 Kp(Math.min(s,Math.max(1,a-Date.now())),void 0,{signal:i})}catch{throw new f("cave_wait_interrupted","Wait interrupted; durable run continues. Reconnect with evals wait.",6)}}throw new f("cave_wait_timeout","Wait expired; durable run continues. Reconnect with evals wait.",6)}async waitRun(e,{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 f("cave_usage","Invalid event cursor or polling interval.",2);for(;Date.now()<i;){let p=await this.execute("runs.get",{run_id:e},{signal:r});if(p.data.id!==e)throw new f("cave_invalid_response","Run identity changed.",6);if(n){let d=await this.execute("runs.events",{run_id:e,after:s},{signal:r});if(!Array.isArray(d.data.data)||!Number.isSafeInteger(d.data.next_cursor)||d.data.next_cursor<s)throw new f("cave_invalid_response","Invalid event cursor.",6);for(let c of d.data.data){if(!Number.isSafeInteger(c.sequence)||c.sequence<=s)throw new f("cave_invalid_response","Invalid event sequence.",6);n(c),s=c.sequence}if(d.data.next_cursor<s)throw new f("cave_invalid_response","Event cursor moved behind returned events.",6);s=d.data.next_cursor}if(p.data.status==="completed"){let d=await this.execute("runs.result",{run_id:e},{signal:r});if(d.data.run_id!==e||d.data.result_ref!==p.data.result_ref)throw new f("cave_invalid_response","Result identity changed.",6);return d}if(["incomplete","cancelled","stale"].includes(p.data.status))return p;if(!["queued","running"].includes(p.data.status))throw new f("cave_invalid_response","Unknown run status.",6);o?.({run_id:e,status:p.data.status});try{await Kp(Math.min(a,Math.max(1,i-Date.now())),void 0,{signal:r})}catch{throw new f("cave_wait_interrupted","Wait interrupted; durable run continues. Reconnect with runs wait.",6)}}throw new f("cave_wait_timeout","Wait expired; durable run continues. Reconnect with runs wait.",6)}async execute(e,r={},i={}){let a=$e(e);if(Ce(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 f("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 f("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 f("cave_invalid_response","Cloud returned a mismatched operation result.",6);let n=a.id+":output";if(Pt.has(n)||Pt.set(n,Hr.compile(a.output_schema)),!Pt.get(n)(s.data))throw new f("cave_invalid_response","Cloud result does not match its operation schema.",6);return s}}});Vr();export{pe as CloudClient,f as CloudError,ms as contractSHA256,bs as describeCommand,$e as describeOperation,Kr as localCommands,Fr as operations,Eh as runCloudCLI,Ce as validateOperation};
|