gemi 0.223.0 → 0.224.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/ai/index.js +1 -1
  2. package/dist/ai/providers/call.d.ts.map +1 -1
  3. package/dist/ai/testing/index.js +1 -1
  4. package/dist/bin/http-client/model.d.ts +1 -1
  5. package/dist/bin/http-client/model.d.ts.map +1 -1
  6. package/dist/bin/http-client/patch.d.ts +11 -0
  7. package/dist/bin/http-client/patch.d.ts.map +1 -0
  8. package/dist/bin/http-client/render.d.ts +3 -3
  9. package/dist/bin/http-client/render.d.ts.map +1 -1
  10. package/dist/{chunk-bs4p7dys.js → chunk-3k4p9agd.js} +22 -22
  11. package/dist/{chunk-bs4p7dys.js.map → chunk-3k4p9agd.js.map} +5 -5
  12. package/dist/{chunk-sqyf0gey.js → chunk-79v94sa6.js} +1 -1
  13. package/dist/{chunk-qvxs1vjh.js → chunk-8pz8yzax.js} +3 -3
  14. package/dist/{chunk-qvxs1vjh.js.map → chunk-8pz8yzax.js.map} +3 -3
  15. package/dist/{chunk-ke1q6hfm.js → chunk-99216y02.js} +1 -1
  16. package/dist/{chunk-9yascc81.js → chunk-dpmvvwts.js} +3 -3
  17. package/dist/{chunk-9yascc81.js.map → chunk-dpmvvwts.js.map} +3 -3
  18. package/dist/{chunk-qtczhd81.js → chunk-jyyrgb6j.js} +2 -2
  19. package/dist/{chunk-qtczhd81.js.map → chunk-jyyrgb6j.js.map} +1 -1
  20. package/dist/{chunk-fn166jp3.js → chunk-y8cj5cap.js} +1 -1
  21. package/dist/chunk-zcmz311y.js +8 -0
  22. package/dist/{chunk-8gnbc9dg.js.map → chunk-zcmz311y.js.map} +3 -3
  23. package/dist/facades/index.js +1 -1
  24. package/dist/http/index.js +1 -1
  25. package/dist/i18n/index.js +1 -1
  26. package/dist/kernel/index.js +1 -1
  27. package/dist/server/index.js +1 -1
  28. package/dist/services/file-storage/drivers/FileSystemDriver.d.ts +1 -0
  29. package/dist/services/file-storage/drivers/FileSystemDriver.d.ts.map +1 -1
  30. package/dist/services/index.js +1 -1
  31. package/dist/services/router/ApiRouteDispatcher.d.ts.map +1 -1
  32. package/dist/utils/apiUrl.d.ts +2 -0
  33. package/dist/utils/apiUrl.d.ts.map +1 -1
  34. package/package.json +1 -1
  35. package/dist/chunk-8gnbc9dg.js +0 -8
  36. /package/dist/{chunk-sqyf0gey.js.map → chunk-79v94sa6.js.map} +0 -0
  37. /package/dist/{chunk-ke1q6hfm.js.map → chunk-99216y02.js.map} +0 -0
  38. /package/dist/{chunk-fn166jp3.js.map → chunk-y8cj5cap.js.map} +0 -0
package/dist/ai/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{ca as uQ,da as lQ,ea as iQ,fa as _6,ga as B6,ha as S6,ia as m$,ja as M6,ka as A6,la as P$,ma as R6,na as E6,oa as k6,pa as T6}from"../chunk-9yascc81.js";import{$c as X6,Ac as CZ,Bc as YQ,Dc as VQ,Ec as FQ,Fc as HQ,Gc as PQ,Hc as NQ,Ic as OQ,Jc as UQ,Kc as CQ,Lc as LQ,Mc as _Q,Nc as BQ,Oc as SQ,Qc as c$,Rc as a9,Sc as t9,Tc as r9,Uc as e9,Vc as J6,Wc as $6,Xc as Q6,Yc as Z6,Zc as W6,_c as K6,ad as DJ,bd as G6,cd as eZ,dd as Y6,ed as J8,fd as V6,gd as z6,hd as D6,ic as h$,id as kJ,jc as lZ,jd as K$,kc as iZ,kd as H6,lc as g$,ld as P6,md as $8,nd as N6,od as F6,pc as gQ,pd as O6,qc as fQ,qd as U6,rc as GJ,rd as C6,sc as s9,sd as L6,tc as b,td as Z$,uc as KQ,vc as XQ,xc as GQ,yc as g,zc as UZ}from"../chunk-qvxs1vjh.js";import{Gd as m,Hd as u$,Kd as dZ,Ld as nZ,Md as oZ,Nd as qJ,Od as sZ,Pd as mJ,Qd as vJ,Rd as w$,Sd as aZ,Td as tZ,Ud as pJ,Vd as rZ,_d as t,ae as a,xd as nQ,yd as A,zd as T}from"../chunk-kp7wcpx7.js";import{re as e$}from"../chunk-7xe5vd4w.js";import"../chunk-p1ern8r4.js";import{Ni as I,li as qZ,oi as hZ,uj as gZ,zj as S$}from"../chunk-8gnbc9dg.js";import{Aj as vZ,Cj as uJ,Dj as cJ}from"../chunk-h1wmpa03.js";import{Mj as c}from"../chunk-t586p2g2.js";import{Oj as d9,Pj as n9,Qj as o9}from"../chunk-qs2xvc8g.js";import"../chunk-anc5v266.js";import{Xk as uZ,Yk as cZ,Zk as mZ,_k as pZ}from"../chunk-tac25cnj.js";import"../chunk-0k2r6bep.js";import{el as o,fl as s,ul as AJ}from"../chunk-0av1gyns.js";import"../chunk-zmt5kdpb.js";import"../chunk-yj7pbbnm.js";import{lm as GZ}from"../chunk-37209psn.js";import"../chunk-fqhkkpq3.js";import"../chunk-6r7956dh.js";import{Im as nJ}from"../chunk-5mrtgr7q.js";import"../chunk-3dkv4989.js";import{existsSync as z8,readdirSync as x6,readFileSync as a$}from"fs";import{isAbsolute as D8,join as CJ,relative as H8,sep as P8}from"path";var t$="prompts.json",N8=/\{\{>\s*([\w./-]+)\s*\}\}/g,n$=/\{\{(\w+)\}\}/g,F8=/^[\w-]+(\/[\w-]+)*$/,o$={dir:"app/agents",shared:"prompts"},_J={},iJ=new Map,LJ;function O8(){if(LJ===void 0){let J=CJ(nJ(),"dist","server",t$);LJ=z8(J)?JSON.parse(a$(J,"utf8")):null}return LJ??null}function U8(J){return J.replace(/\r?\n$/,"")}function s$(){return _J.cache??Bun.env.NODE_ENV==="production"}function C8(J,$){if(!F8.test(J))throw Error(`"${J}" is not a prompt name. Use letters, digits, "-" and "_", with "/" between folders.`);let Q=$.dir??_J.dir??o$.dir,Z=D8(Q)?Q:CJ(process.cwd(),Q),W=J.includes("/")?`${J}.md`:CJ($.shared??_J.shared??o$.shared,`${J}.md`);return CJ(Z,W)}function L8(J,$){let Q=C8(J,$),Z=s$()?iJ.get(Q):void 0;if(Z!==void 0)return Z;let W=Bun.env.NODE_ENV==="production";if(W){let X=O8()?.[H8(nJ(),Q).split(P8).join("/")];if(X!==void 0)return X}let K;try{K=U8(a$(Q,"utf8"))}catch(X){if(X.code==="ENOENT"){let G=W?` or in dist/server/${t$}`:"";throw Error(`The prompt "${J}" does not exist (looked for ${Q}${G}).`)}throw X}if(s$())iJ.set(Q,K);return K}function dJ(J,$,Q){if($.includes(J))throw Error(`The prompt "${J}" includes itself: ${[...$,J].join(" > ")}.`);return L8(J,Q).replace(N8,(Z,W)=>dJ(W,[...$,J],Q))}class r${static configure(J){_J={...J},iJ.clear(),LJ=void 0}static render(J,$={},Q={}){return dJ(J,[],Q).replace(n$,(Z,W)=>{if(!Object.hasOwn($,W))throw Error(`The prompt "${J}" has no value for {{${W}}}.`);return String($[W])})}static placeholders(J,$={}){let Q=[...dJ(J,[],$).matchAll(n$)].map((Z)=>Z[1]);return[...new Set(Q)]}}class oJ extends e${name="AgentJobDeadlineSweep";cron="* * * * *";async callback(){while(await g.sweep({limit:100})===100);}}var SJ=20,_8=300,B8=200;function $Q(J,$){if($<=0||J.length===0)return null;let Q=(K,X)=>X.createdAt-K.createdAt||(K.id<X.id?1:-1);return["<jobs>","Background jobs that tools started in this conversation, running ones first. A running job's result replaces its tool result when it finishes. Do not start the same work again while a job for it is running.",...[...J.filter((K)=>!b(K.state)).sort(Q),...J.filter((K)=>b(K.state)).sort(Q)].slice(0,$).map((K)=>{let X=[`- ${K.id} (${K.toolName})`];if(K.state==="waiting")X.push(`waiting for ${(K.after??[]).join(", ")} since ${BJ(K.createdAt)}`);else if(K.state==="running")X.push(`running since ${BJ(K.createdAt)}`);else if(K.state==="ok")X.push(`finished at ${BJ(K.settledAt??K.updatedAt)}`);else{let G=K.error?`${K.error.code}: ${JQ(K.error.message,B8)}`:"failed";X.push(`failed at ${BJ(K.settledAt??K.updatedAt)} (${G})`)}if(K.summary!==void 0)X.push(`summary: ${JQ(JSON.stringify(K.summary),_8)}`);if(K.orphaned)X.push("its tool call was lost when the turn that started it was cut short");return X.join("; ")}),"</jobs>"].join(`
2
+ import{ca as uQ,da as lQ,ea as iQ,fa as _6,ga as B6,ha as S6,ia as m$,ja as M6,ka as A6,la as P$,ma as R6,na as E6,oa as k6,pa as T6}from"../chunk-dpmvvwts.js";import{$c as X6,Ac as CZ,Bc as YQ,Dc as VQ,Ec as FQ,Fc as HQ,Gc as PQ,Hc as NQ,Ic as OQ,Jc as UQ,Kc as CQ,Lc as LQ,Mc as _Q,Nc as BQ,Oc as SQ,Qc as c$,Rc as a9,Sc as t9,Tc as r9,Uc as e9,Vc as J6,Wc as $6,Xc as Q6,Yc as Z6,Zc as W6,_c as K6,ad as DJ,bd as G6,cd as eZ,dd as Y6,ed as J8,fd as V6,gd as z6,hd as D6,ic as h$,id as kJ,jc as lZ,jd as K$,kc as iZ,kd as H6,lc as g$,ld as P6,md as $8,nd as N6,od as F6,pc as gQ,pd as O6,qc as fQ,qd as U6,rc as GJ,rd as C6,sc as s9,sd as L6,tc as b,td as Z$,uc as KQ,vc as XQ,xc as GQ,yc as g,zc as UZ}from"../chunk-8pz8yzax.js";import{Gd as m,Hd as u$,Kd as dZ,Ld as nZ,Md as oZ,Nd as qJ,Od as sZ,Pd as mJ,Qd as vJ,Rd as w$,Sd as aZ,Td as tZ,Ud as pJ,Vd as rZ,_d as t,ae as a,xd as nQ,yd as A,zd as T}from"../chunk-kp7wcpx7.js";import{re as e$}from"../chunk-7xe5vd4w.js";import"../chunk-p1ern8r4.js";import{Ni as I,li as qZ,oi as hZ,uj as gZ,zj as S$}from"../chunk-zcmz311y.js";import{Aj as vZ,Cj as uJ,Dj as cJ}from"../chunk-h1wmpa03.js";import{Mj as c}from"../chunk-t586p2g2.js";import{Oj as d9,Pj as n9,Qj as o9}from"../chunk-qs2xvc8g.js";import"../chunk-anc5v266.js";import{Xk as uZ,Yk as cZ,Zk as mZ,_k as pZ}from"../chunk-tac25cnj.js";import"../chunk-0k2r6bep.js";import{el as o,fl as s,ul as AJ}from"../chunk-0av1gyns.js";import"../chunk-zmt5kdpb.js";import"../chunk-yj7pbbnm.js";import{lm as GZ}from"../chunk-37209psn.js";import"../chunk-fqhkkpq3.js";import"../chunk-6r7956dh.js";import{Im as nJ}from"../chunk-5mrtgr7q.js";import"../chunk-3dkv4989.js";import{existsSync as z8,readdirSync as x6,readFileSync as a$}from"fs";import{isAbsolute as D8,join as CJ,relative as H8,sep as P8}from"path";var t$="prompts.json",N8=/\{\{>\s*([\w./-]+)\s*\}\}/g,n$=/\{\{(\w+)\}\}/g,F8=/^[\w-]+(\/[\w-]+)*$/,o$={dir:"app/agents",shared:"prompts"},_J={},iJ=new Map,LJ;function O8(){if(LJ===void 0){let J=CJ(nJ(),"dist","server",t$);LJ=z8(J)?JSON.parse(a$(J,"utf8")):null}return LJ??null}function U8(J){return J.replace(/\r?\n$/,"")}function s$(){return _J.cache??Bun.env.NODE_ENV==="production"}function C8(J,$){if(!F8.test(J))throw Error(`"${J}" is not a prompt name. Use letters, digits, "-" and "_", with "/" between folders.`);let Q=$.dir??_J.dir??o$.dir,Z=D8(Q)?Q:CJ(process.cwd(),Q),W=J.includes("/")?`${J}.md`:CJ($.shared??_J.shared??o$.shared,`${J}.md`);return CJ(Z,W)}function L8(J,$){let Q=C8(J,$),Z=s$()?iJ.get(Q):void 0;if(Z!==void 0)return Z;let W=Bun.env.NODE_ENV==="production";if(W){let X=O8()?.[H8(nJ(),Q).split(P8).join("/")];if(X!==void 0)return X}let K;try{K=U8(a$(Q,"utf8"))}catch(X){if(X.code==="ENOENT"){let G=W?` or in dist/server/${t$}`:"";throw Error(`The prompt "${J}" does not exist (looked for ${Q}${G}).`)}throw X}if(s$())iJ.set(Q,K);return K}function dJ(J,$,Q){if($.includes(J))throw Error(`The prompt "${J}" includes itself: ${[...$,J].join(" > ")}.`);return L8(J,Q).replace(N8,(Z,W)=>dJ(W,[...$,J],Q))}class r${static configure(J){_J={...J},iJ.clear(),LJ=void 0}static render(J,$={},Q={}){return dJ(J,[],Q).replace(n$,(Z,W)=>{if(!Object.hasOwn($,W))throw Error(`The prompt "${J}" has no value for {{${W}}}.`);return String($[W])})}static placeholders(J,$={}){let Q=[...dJ(J,[],$).matchAll(n$)].map((Z)=>Z[1]);return[...new Set(Q)]}}class oJ extends e${name="AgentJobDeadlineSweep";cron="* * * * *";async callback(){while(await g.sweep({limit:100})===100);}}var SJ=20,_8=300,B8=200;function $Q(J,$){if($<=0||J.length===0)return null;let Q=(K,X)=>X.createdAt-K.createdAt||(K.id<X.id?1:-1);return["<jobs>","Background jobs that tools started in this conversation, running ones first. A running job's result replaces its tool result when it finishes. Do not start the same work again while a job for it is running.",...[...J.filter((K)=>!b(K.state)).sort(Q),...J.filter((K)=>b(K.state)).sort(Q)].slice(0,$).map((K)=>{let X=[`- ${K.id} (${K.toolName})`];if(K.state==="waiting")X.push(`waiting for ${(K.after??[]).join(", ")} since ${BJ(K.createdAt)}`);else if(K.state==="running")X.push(`running since ${BJ(K.createdAt)}`);else if(K.state==="ok")X.push(`finished at ${BJ(K.settledAt??K.updatedAt)}`);else{let G=K.error?`${K.error.code}: ${JQ(K.error.message,B8)}`:"failed";X.push(`failed at ${BJ(K.settledAt??K.updatedAt)} (${G})`)}if(K.summary!==void 0)X.push(`summary: ${JQ(JSON.stringify(K.summary),_8)}`);if(K.orphaned)X.push("its tool call was lost when the turn that started it was cut short");return X.join("; ")}),"</jobs>"].join(`
3
3
  `)}function BJ(J){return new Date(J).toISOString().replace(/\.\d{3}Z$/,"Z")}function JQ(J,$){return J.length<=$?J:`${J.slice(0,$-1)}\u2026`}var QQ=["after_jobs","batch_key","queued","inbox","job_checkpoint"],ZQ=20;class sJ{table;sql;dialect;connection;later;constructor(J,$={}){let Q=$.table??"gemi_agent_jobs";if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(Q))throw Error(`The agent jobs table name "${Q}" is not a plain identifier. Use letters, digits and underscores.`);this.table=Q,this.sql=J.sql,this.dialect=J.dialect,this.connection=J.name}async createTable(){for(let J of S8(this.dialect,this.table))await this.sql.unsafe(J)}async transaction(J){if(this.connection===void 0||this.joinable())return J();return AJ(this.sql,()=>J(),{connection:this.connection})}async create(J){let $=J.after!==void 0||J.batch!==void 0||J.queued!==void 0;if($)await this.requireLaterColumns("A job with `after` or `batch`");let Q=this.q(),Z=this.clock(Q),W=J.state??"running";if($)await Q`
4
4
  INSERT INTO ${this.name(Q)}
5
5
  (id, thread_id, run_id, tool_call_id, tool_name, owner, job, summary, state,
@@ -1 +1 @@
1
- {"version":3,"file":"call.d.ts","sourceRoot":"","sources":["../../../ai/providers/call.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAUlD,OAAO,EAIL,KAAK,QAAQ,EACd,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,cAAc,EAGnB,KAAK,mBAAmB,EACzB,MAAM,QAAQ,CAAC;AAChB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAIlD;;;;;;;;GAQG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB;2DACuD;IACvD,OAAO,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB,sEAAsE;IACtE,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,sEAAsE;IACtE,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,uEAAuE;IACvE,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;wDACoD;IACpD,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,cAAc,GAAG,iBAAiB,CAY3E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAuB,eAAe,CAAC,IAAI,SAAS,MAAM,GAAG,gBAAgB,EAC3E,QAAQ,EAAE,iBAAiB,EAC3B,IAAI,EAAE,IAAI,EACV,MAAM,EAAE;IACN,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,4DAA4D;IAC5D,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC;;2EAEuE;IACvE,KAAK,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC9B;;;;OAIG;IACH,KAAK,CAAC,EAAE,CACN,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,EAC7B,OAAO,EAAE;QAAE,gBAAgB,EAAE,OAAO,CAAA;KAAE,KACnC,aAAa,CAAC,aAAa,CAAC,CAAC;CACnC,GACA,cAAc,CAAC,aAAa,CAAC,CA8P/B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,YAAY,CAAC;AAEvD;;;;;GAKG;AACH,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,iBAAiB,EAC3B,IAAI,EAAE,IAAI;AACV,gEAAgE;AAChE,OAAO,GAAE,aAAa,GAAG,IAAkB,GAC1C,OAAO,CAAC,MAAM,CAAC,CAyBjB;AAED;;;;;;;;GAQG;AACH,wBAAsB,UAAU,CAAC,QAAQ,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAqB3F"}
1
+ {"version":3,"file":"call.d.ts","sourceRoot":"","sources":["../../../ai/providers/call.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAUlD,OAAO,EAIL,KAAK,QAAQ,EACd,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,cAAc,EAGnB,KAAK,mBAAmB,EACzB,MAAM,QAAQ,CAAC;AAChB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAIlD;;;;;;;;GAQG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB;2DACuD;IACvD,OAAO,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB,sEAAsE;IACtE,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,sEAAsE;IACtE,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,uEAAuE;IACvE,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;wDACoD;IACpD,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,cAAc,GAAG,iBAAiB,CAY3E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAuB,eAAe,CAAC,IAAI,SAAS,MAAM,GAAG,gBAAgB,EAC3E,QAAQ,EAAE,iBAAiB,EAC3B,IAAI,EAAE,IAAI,EACV,MAAM,EAAE;IACN,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,4DAA4D;IAC5D,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC;;2EAEuE;IACvE,KAAK,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC9B;;;;OAIG;IACH,KAAK,CAAC,EAAE,CACN,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,EAC7B,OAAO,EAAE;QAAE,gBAAgB,EAAE,OAAO,CAAA;KAAE,KACnC,aAAa,CAAC,aAAa,CAAC,CAAC;CACnC,GACA,cAAc,CAAC,aAAa,CAAC,CAiQ/B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,YAAY,CAAC;AAEvD;;;;;GAKG;AACH,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,iBAAiB,EAC3B,IAAI,EAAE,IAAI;AACV,gEAAgE;AAChE,OAAO,GAAE,aAAa,GAAG,IAAkB,GAC1C,OAAO,CAAC,MAAM,CAAC,CAyBjB;AAED;;;;;;;;GAQG;AACH,wBAAsB,UAAU,CAAC,QAAQ,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAqB3F"}
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{la as g}from"../../chunk-9yascc81.js";import"../../chunk-kp7wcpx7.js";import{Oj as v,Pj as m}from"../../chunk-qs2xvc8g.js";import"../../chunk-3dkv4989.js";import{createHash as s}from"crypto";import{createHash as S}from"crypto";import{existsSync as h,readdirSync as c,readFileSync as l,statSync as p}from"fs";import{join as q,relative as d,sep as i}from"path";var P="\u241F",F=6,n=/\{\{>\s*([^}\s]+)\s*\}\}/g,b=(D)=>D.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");function R(D){let $=D.filter((B)=>B.length>=F),z=D.filter((B)=>B.length<F);return(B)=>{let C=B;for(let G of $)if(C.includes(G))C=C.split(G).join(P);for(let G of z)C=C.replace(new RegExp(`${b(G)}\\s*${P}`,"g"),P).replace(new RegExp(`${P}\\s*${b(G)}`,"g"),P);return C.replace(new RegExp(`\\s*${P}[\\s${P}]*`,"g"),P)}}function y(D,$=[]){for(let z of c(D)){if(z==="node_modules")continue;let B=q(D,z);if(p(B).isDirectory())y(B,$);else if(z.endsWith(".md"))$.push(B)}return $}class W{data;root;options;constructor(D,$={}){this.data=D;this.options=$,this.root=$.root??process.cwd()}static blob(D){return S("sha1").update(`blob ${Buffer.byteLength(D)}\x00`).update(D).digest("hex")}static pieces(D){return D.split(/\{\{[^}]*\}\}/).map(($)=>$.trim()).filter(($)=>$.length>0)}static tool(D){return S("sha256").update(JSON.stringify({description:D.description,parameters:D.parameters})).digest("hex")}static prompts(D={}){let $=D.root??process.cwd(),z=new Map;for(let B of D.dirs??["app/agents"]){if(!h(q($,B)))continue;for(let C of y(q($,B)).sort())z.set(d($,C).split(i).join("/"),l(C,"utf8"))}return z}static of(D,$,z={}){let B=[...D].join(`
2
+ import{la as g}from"../../chunk-dpmvvwts.js";import"../../chunk-kp7wcpx7.js";import{Oj as v,Pj as m}from"../../chunk-qs2xvc8g.js";import"../../chunk-3dkv4989.js";import{createHash as s}from"crypto";import{createHash as S}from"crypto";import{existsSync as h,readdirSync as c,readFileSync as l,statSync as p}from"fs";import{join as q,relative as d,sep as i}from"path";var P="\u241F",F=6,n=/\{\{>\s*([^}\s]+)\s*\}\}/g,b=(D)=>D.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");function R(D){let $=D.filter((B)=>B.length>=F),z=D.filter((B)=>B.length<F);return(B)=>{let C=B;for(let G of $)if(C.includes(G))C=C.split(G).join(P);for(let G of z)C=C.replace(new RegExp(`${b(G)}\\s*${P}`,"g"),P).replace(new RegExp(`${P}\\s*${b(G)}`,"g"),P);return C.replace(new RegExp(`\\s*${P}[\\s${P}]*`,"g"),P)}}function y(D,$=[]){for(let z of c(D)){if(z==="node_modules")continue;let B=q(D,z);if(p(B).isDirectory())y(B,$);else if(z.endsWith(".md"))$.push(B)}return $}class W{data;root;options;constructor(D,$={}){this.data=D;this.options=$,this.root=$.root??process.cwd()}static blob(D){return S("sha1").update(`blob ${Buffer.byteLength(D)}\x00`).update(D).digest("hex")}static pieces(D){return D.split(/\{\{[^}]*\}\}/).map(($)=>$.trim()).filter(($)=>$.length>0)}static tool(D){return S("sha256").update(JSON.stringify({description:D.description,parameters:D.parameters})).digest("hex")}static prompts(D={}){let $=D.root??process.cwd(),z=new Map;for(let B of D.dirs??["app/agents"]){if(!h(q($,B)))continue;for(let C of y(q($,B)).sort())z.set(d($,C).split(i).join("/"),l(C,"utf8"))}return z}static of(D,$,z={}){let B=[...D].join(`
3
3
  \x00
4
4
  `),C={};for(let[Y,Q]of W.prompts(z))if(W.pieces(Q).filter((Z)=>Z.length>=12).sort((Z,L)=>L.length-Z.length).slice(0,3).some((Z)=>B.includes(Z)))C[Y]=W.blob(Q);let G=[...$.keys()].sort(),X=z.inputs?.(new Set(G));return new W({prompts:C,tools:Object.fromEntries(G.map((Y)=>[Y,[...$.get(Y)].sort()])),...X&&Object.keys(X).length>0?{inputs:a(X)}:{}},z)}same(D){let $=D instanceof W?D.data:D;return JSON.stringify(this.data)===JSON.stringify($)}changed(){let D=this.options.inputs?.(new Set(Object.keys(this.data.tools)))??{};return[...this.changedPrompts().map(([$])=>$),...Object.entries(this.data.inputs??{}).filter(([$,z])=>D[$]!==z).map(([$])=>`input ${$}`)]}cutters(){let D=W.prompts(this.options),$=this.changedPrompts(),z=new Map,B=new Map;for(let[C,G]of $){let X=this.readBlob(G);if(X===void 0)throw Error(`${C} changed since the recording, and the version it was recorded with (${G}) can't be read back from git`);if(z.set(C,X),D.has(C))B.set(C,D.get(C))}return{changed:$.map(([C])=>C),recorded:R(this.piecesWithPartials(z,(C)=>{let G=this.data.prompts[C];return G&&this.readBlob(G)||D.get(C)})),sent:R(this.piecesWithPartials(B,(C)=>D.get(C)))}}changedPrompts(){let D=W.prompts(this.options);return Object.entries(this.data.prompts).filter(([$,z])=>{let B=D.get($);return B===void 0||W.blob(B)!==z})}readBlob(D){if(this.options.readBlob)return this.options.readBlob(D);let $=Bun.spawnSync(["git","cat-file","blob",D],{cwd:this.root});return $.exitCode===0?$.stdout.toString():void 0}piecesWithPartials(D,$){let z=this.options.dirs??["app/agents"],B=this.options.shared??"prompts",C=[...D];while(C.length>0){let[G,X]=C.pop(),Y=z.find((Q)=>G.startsWith(`${Q}/`));if(Y===void 0)continue;for(let[,Q]of X.matchAll(n)){let V=`${Y}/${Q.includes("/")?Q:`${B}/${Q}`}.md`,Z=D.has(V)?void 0:$(V);if(Z===void 0)continue;D.set(V,Z),C.push([V,Z])}}return[...D.values()].flatMap((G)=>W.pieces(G)).sort((G,X)=>X.length-G.length)}}function a(D){return Object.fromEntries(Object.entries(D).sort(([$],[z])=>$.localeCompare(z)))}class H extends Error{constructor(D){super(`${D} Record again.`);this.name="RecordingMismatchError"}}var o=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/g;function T(D,$){if(typeof D==="string")return $(D);if(Array.isArray(D))return D.map((z)=>T(z,$));if(D&&typeof D==="object")return Object.fromEntries(Object.entries(D).map(([z,B])=>[z,T(B,$)]));return D}function f(D){return JSON.parse(JSON.stringify(D,function($,z){if($==="nested")return;if($==="output"&&this.type==="tool-result"&&"modelOutput"in this)return;return z}))}function u(){let D;return{promise:new Promise((z)=>D=z),resolve:D}}var r=(D)=>s("sha256").update(D).digest("hex"),E=(D)=>D.flatMap(($)=>("tools"in $)?$.tools:[$]);function x(D){return D.map(({role:$,content:z})=>({role:$,parts:(Array.isArray(z)?z:[]).flatMap((B)=>{if(B?.type==="tool-call")return[{call:B.name,input:B.input??B.args}];if(B?.type==="tool-result")return[{result:B.name,status:B.status}];if(B?.type==="file")return[{file:!0}];return[]})}))}class M extends g{live;model;capabilities;recordedAt;calls;recordedNested;children=new Map;parent;key;sent=[];uploads;uploadCount=0;read;shared;options;texts=new Set;toolHashes=new Map;toolLists=new Set;recorded;cuts;constructor(D,$,z,B){super();this.live=D;if(this.options={...z,match:z.match??"wording",ids:new RegExp(z.ids??o,"g"),waitMs:z.waitMs??60000},B){let{parent:C}=B;this.parent=C,this.key=B.key,this.model=C.model,this.capabilities=C.capabilities,this.recordedAt=C.recordedAt,this.calls=B.calls,this.recordedNested={},this.uploads=C.uploads,this.shared=C.shared;return}if(this.shared={ids:new Map,stale:new Set,staleCalls:0,started:0,moved:u()},this.uploads=new Map,D){this.model=D.model,this.capabilities=D.capabilities,this.recordedAt=new Date,this.calls=[],this.recordedNested={};return}if(!$||$.version!==1||!Array.isArray($.calls))throw Error("RecordingProvider.replay needs a recording made by RecordingProvider.");if(this.model=$.model,this.capabilities=$.capabilities,this.recordedAt=new Date($.recordedAt),this.calls=structuredClone($.calls),this.recordedNested=structuredClone($.nested??{}),$.fingerprints)this.recorded=new W($.fingerprints,z.fingerprints)}static record(D,$={}){return new M(D,void 0,$)}static replay(D,$={}){return new M(void 0,D,$)}get isRecording(){return this.live!==void 0}get stale(){return this.shared.stale}get staleCalls(){return this.shared.staleCalls}nested(D){if(this.parent)return this.parent.nested(D);let $=this.children.get(D);if(!$){let z=this.recordedNested[D];if(!this.live&&!z)throw new H(`The recording has no sub-run "${D}".`);$=new M(this.live,void 0,this.options,{parent:this,key:D,calls:z??[]}),this.children.set(D,$)}return $}recording(){if(this.parent)return this.parent.recording();if(!this.live)throw Error("Only a recording provider (`record`) has a recording to save.");return{version:1,model:this.model,capabilities:this.capabilities,recordedAt:this.recordedAt.toISOString(),calls:structuredClone(this.calls),...this.options.fingerprints?{fingerprints:this.fingerprints().data}:{},...this.children.size>0?{nested:Object.fromEntries([...this.children].map(([D,$])=>[D,structuredClone($.calls)]))}:{}}}fingerprints(){let D=this.parent??this;return W.of(D.texts,D.toolHashes,this.options.fingerprints)}static changedSince(D,$={}){return D.fingerprints?new W(D.fingerprints,$).changed():[]}replayedInFull(){let D=this.parent??this;return D.calls.length===0&&Object.entries(D.recordedNested).every(([$,z])=>(D.children.get($)?.calls??z).length===0)}async pin(D){if(this.live)return this.read=D,D;let $=this.calls[0]?.read;if($===void 0)return D;return await(this.parent??this).reach($,this.where()),$}async upload(D){let $=++this.uploadCount,z=this.key===void 0?`upload_${$}`:`upload_${this.key}_${$}`;if(this.live)this.uploads.set(z,await this.live.upload(D));return z}async deleteFile(D){let $=this.uploads.get(D);if(this.live&&$!==void 0){if(!this.live.deleteFile)throw Error(`${this.live.constructor.name} cannot delete provider files: it does not implement deleteFile().`);await this.live.deleteFile($),this.uploads.delete(D)}}normalizeError(D){return this.live?this.live.normalizeError(D):super.normalizeError(D)}async*stream(D){let $=this.requestOf(D);if(this.live){yield*this.recordCall(D,$);return}yield*this.replayCall(D,$)}async*recordCall(D,$){let z=this.parent??this,B=z.shared.started++,C=this.read;this.read=void 0;let G=[],X=D.messages.map((Q)=>({...Q,content:Q.content.map((V)=>V.type==="file"&&V.fileId&&this.uploads.has(V.fileId)?{...V,fileId:this.uploads.get(V.fileId)}:V)}));for await(let Q of this.live.stream({...D,messages:X})){let V=G.at(-1);if(Q.type==="tool-call-discard"){let Z=new Set(Q.toolCallIds),L=G.filter((I)=>I.type!=="tool-call-delta"||!Z.has(I.toolCallId));G.splice(0,G.length,...L)}else if(Q.type==="retry");else if(V&&(Q.type==="text-delta"||Q.type==="output-delta")&&V.type===Q.type)V.delta+=Q.delta;else if(V?.type==="tool-call-delta"&&Q.type==="tool-call-delta"&&V.toolCallId===Q.toolCallId)V.argsDelta+=Q.argsDelta;else G.push({...Q});yield Q}let Y=this.options.position?await this.options.position():void 0;this.calls.push({request:$,events:G,at:B,...C!==void 0?{read:C}:{},...Y!==void 0?{ended:Y}:{}})}async*replayCall(D,$){let z=this.parent??this,B=this.where(),C=this.calls[0];if(this.options.ordered&&C?.at!==void 0)await z.turn(C.at,B);let G=this.calls.shift();if(!G)throw new H(`${B}: call ${this.sentCalls} was not recorded (the recording has no more calls).`);let{promptCacheKey:X,...Y}=G.request;if(!z.matches(JSON.stringify(Y),$))z.tolerate(B,{...G,request:Y},$,D.tools??[]);if(G.ended!==void 0)await z.reach(G.ended,B);let Q=z.shared.ids;for(let V of G.events)yield JSON.parse(JSON.stringify(V).replace(this.options.ids,(Z)=>Q.get(Z)??Z))}where(){return this.key===void 0?"the recording":`sub-run "${this.key}"`}sentCalls=0;requestOf(D){this.sentCalls++;let{signal:$,promptCacheKey:z,messages:B,tools:C,...G}=D,X=B.map(({role:L,content:I})=>({role:L,content:f(I)})),Y=this.sent.length>0&&this.sent.length<=X.length&&JSON.stringify(X.slice(0,this.sent.length))===JSON.stringify(this.sent)?this.sent.length:0;this.sent=X;let Q=C&&C.length>0?JSON.stringify(C):void 0,V=this.parent??this,Z=(L)=>{return V.texts.add(L),L};if(T([G,X.slice(Y)],Z),Q&&!V.toolLists.has(Q)){V.toolLists.add(Q);for(let L of E(C)){T(L,Z);let I=V.toolHashes.get(L.name)??new Set;I.add(W.tool(L)),V.toolHashes.set(L.name,I)}}return{...f(G),...Q?{tools:`sha256:${r(Q)}`,toolNames:E(C).map((L)=>L.name).sort()}:{},...Y>0?{after:Y}:{},messages:X.slice(Y)}}matches(D,$){let z=this.options.ids,B=JSON.stringify($),C=D.match(z)??[],G=B.match(z)??[];if(C.length!==G.length)return!1;let X=new Map(this.shared.ids);for(let[Y,Q]of C.entries()){let V=X.get(Q)??G[Y];if(V!==G[Y])return!1;X.set(Q,V)}if(D.replace(z,(Y)=>X.get(Y))!==B)return!1;for(let[Y,Q]of X)this.shared.ids.set(Y,Q);return!0}tolerate(D,$,z,B){let C=this.options.ids,G=this.options.match,X=$.request,Y=(A,K,J)=>{let N=JSON.stringify(A).replace(C,"<id>"),j=JSON.stringify(K).replace(C,"<id>"),_=0;while(_<N.length&&N[_]===j[_])_++;throw new H(`${D}: the request differs from the recorded one${J}. Recorded: \u2026${N.slice(Math.max(0,_-80),_+120)}\u2026 Sent: \u2026${j.slice(Math.max(0,_-80),_+120)}\u2026`)};if(G==="exact")Y(X,z,"");let{tools:Q,toolNames:V,...Z}=X,{tools:L,toolNames:I,...k}=z,w=[];if(!this.matches(JSON.stringify(Z),k))if(G==="wording"){if(!this.recorded)Y(Z,k,", and the recording has no fingerprints to tell a reworded prompt by");try{this.cuts??=this.recorded.cutters()}catch(J){throw new H(`${D}: ${J.message}.`)}let A=T(Z,this.cuts.recorded),K=T(k,this.cuts.sent);if(this.cuts.changed.length===0||!this.matches(JSON.stringify(A),K))Y(A,K,this.cuts.changed.length>0?", beyond the wording of the prompts changed since":"");w.push(...this.cuts.changed.map((J)=>`${J} changed`))}else{if(!((X.after??0)===(z.after??0)&&this.matches(JSON.stringify(x(X.messages)),x(z.messages))))Y(Z,k," in the conversation itself");let{messages:K,...J}=Z,{messages:N,...j}=k;if(!this.matches(JSON.stringify(K),N))w.push("message text changed");let _=new Set([...Object.keys(J),...Object.keys(j)]);for(let U of[..._].sort()){let O=JSON.stringify(J[U]??null);if(!this.matches(O,j[U]??null))w.push(`${U} changed`)}}if(Q!==L){let A=E(B);for(let K of $.events){if(K.type!=="tool-call")continue;let J=A.find((O)=>O.name===K.name);if(!J)throw new H(`${D}: the recorded answer calls ${K.name}, which is not offered any more.`);let N=Object.fromEntries([...JSON.stringify(J.parameters).matchAll(/"format":"([^"]+)"/g)].map(([,O])=>[O,!0])),j;try{j=JSON.parse(K.args||"{}")}catch{j=void 0}let _;try{_=m.fromJSONSchema(J.parameters,{unknownKeys:"error",formats:N})}catch(O){if(!(O instanceof v))throw O}let U=_?.safeParse(j);if(U&&U.ok===!1)throw new H(`${D}: the recorded call of ${K.name} does not fit its schema any more (${U.errors.join("; ")}).`)}if(this.recorded){let K=A.filter((J)=>!this.recorded.data.tools[J.name]?.includes(W.tool(J))).map((J)=>J.name).sort();w.push(K.length>0?`tools changed: ${K.join(", ")}`:"the tools offered changed")}else{let K=new Set(V??[]),J=new Set(I??[]),N=[...J].filter((_)=>!K.has(_)),j=[...K].filter((_)=>!J.has(_));w.push(N.length>0||j.length>0?`tools offered changed (${[...N.map((_)=>`+${_}`),...j.map((_)=>`-${_}`)].join(", ")})`:"the tools offered changed")}}this.shared.staleCalls++;for(let A of w)this.shared.stale.add(A)}async turn(D,$){let z=this.shared;z.pending??=[...this.calls,...Object.values(this.recordedNested).flat()].map((B)=>B.at).filter((B)=>B!==void 0).sort((B,C)=>B-C);while(z.pending[0]!==void 0&&z.pending[0]<D){let B=z.moved.promise;if(!await Promise.race([B.then(()=>!0),new Promise((G)=>setTimeout(()=>G(!1),this.options.waitMs))]))throw new H(`${$}: call ${D} waits for call ${z.pending[0]}, which the replay does not make.`)}z.pending=z.pending.filter((B)=>B!==D),z.moved.resolve(),z.moved=u()}async reach(D,$){let z=this.options.position;if(!z)return;let B=await z(),C=0;while(B<D){await new Promise((X)=>setTimeout(X,25));let G=await z();if(C=G===B?C+25:0,B=G,C>=this.options.waitMs)throw new H(`${$}: a call waits for the app to reach ${D}; it stays at ${B}.`)}}}function t(D){let $=globalThis.Date,z=new $(D).getTime()-$.now();if(!Number.isFinite(z))throw Error(`pinClock: ${String(D)} is not a date.`);class B extends ${constructor(...C){if(C.length===0)super($.now()+z);else super(...C)}static now(){return $.now()+z}}return globalThis.Date=B,()=>{if(globalThis.Date===B)globalThis.Date=$}}export{t as pinClock,M as RecordingProvider,H as RecordingMismatchError,W as Fingerprints};
5
5
 
@@ -1,6 +1,6 @@
1
1
  import type { HttpMethod } from "../../http/ApiRouter";
2
2
  import type { NamedType, TypeRef } from "../ai-client/model";
3
- /** Internal foundation only: no transport, auth or native rendering contract. */
3
+ /** Language-neutral description shared by the native HTTP renderers. */
4
4
  export type HttpRouteModel = {
5
5
  /** The exact CreateRPC key, with groups removed by the framework. */
6
6
  key: string;
@@ -1 +1 @@
1
- {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../bin/http-client/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7D,iFAAiF;AACjF,MAAM,MAAM,cAAc,GAAG;IAC3B,qEAAqE;IACrE,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,gFAAgF;IAChF,cAAc,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,EAAE,CAAC;IACzE,uEAAuE;IACvE,MAAM,EAAE,OAAO,GAAG;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,KAAK,EAAE;QAAE,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC;QAAC,IAAI,EAAE,OAAO,GAAG;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;IACxE,QAAQ,EAAE,OAAO,GAAG;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACxD,+EAA+E;IAC/E,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;IAC5B,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC"}
1
+ {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../bin/http-client/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7D,wEAAwE;AACxE,MAAM,MAAM,cAAc,GAAG;IAC3B,qEAAqE;IACrE,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,gFAAgF;IAChF,cAAc,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,EAAE,CAAC;IACzE,uEAAuE;IACvE,MAAM,EAAE,OAAO,GAAG;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,KAAK,EAAE;QAAE,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC;QAAC,IAAI,EAAE,OAAO,GAAG;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;IACxE,QAAQ,EAAE,OAAO,GAAG;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACxD,+EAA+E;IAC/E,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;IAC5B,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { HttpApiModel } from "./model";
2
+ /** Select one JSON PATCH with a trailing string ID and a single typed rejection. */
3
+ export declare function patchCall(api: HttpApiModel, key: string): {
4
+ name: string;
5
+ segments: string[];
6
+ body: string;
7
+ output: string;
8
+ error: string;
9
+ status: number;
10
+ };
11
+ //# sourceMappingURL=patch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patch.d.ts","sourceRoot":"","sources":["../../../bin/http-client/patch.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,oFAAoF;AACpF,wBAAgB,SAAS,CAAC,GAAG,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM;;;;;;;EAuCvD"}
@@ -1,5 +1,5 @@
1
1
  import type { HttpApiModel } from "./model";
2
- /** Internal data models. Transport and route methods consume these in a later step. */
3
- export declare function renderHttpSwift(api: HttpApiModel): string;
4
- export declare function renderHttpKotlin(api: HttpApiModel, packageName: string): string;
2
+ /** Models for the whole API, optionally with a callable PATCH route. */
3
+ export declare function renderHttpSwift(api: HttpApiModel, patchKey?: string): string;
4
+ export declare function renderHttpKotlin(api: HttpApiModel, packageName: string, patchKey?: string): string;
5
5
  //# sourceMappingURL=render.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../bin/http-client/render.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAmG5C,uFAAuF;AACvF,wBAAgB,eAAe,CAAC,GAAG,EAAE,YAAY,GAAG,MAAM,CA8BzD;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CA0D/E"}
1
+ {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../bin/http-client/render.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAoG5C,wEAAwE;AACxE,wBAAgB,eAAe,CAAC,GAAG,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CA+C5E;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CA2ElG"}