vibe64 0.1.63 → 0.1.64

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 (70) hide show
  1. package/bin/upgrade-state.js +3581 -3575
  2. package/dist/assets/{GithubBrowserTabs-DEq5_tSs.js → GithubBrowserTabs-Cf6ce1lO.js} +1 -1
  3. package/dist/assets/{LocalDatabaseServer-CrQ9aolO.js → LocalDatabaseServer-0VGIcy5Q.js} +1 -1
  4. package/dist/assets/{Vibe64AuthSettingsButton-Bbgu_IRu.js → Vibe64AuthSettingsButton-BGtVvQq0.js} +1 -1
  5. package/dist/assets/{Vibe64ConversationLog-MGFaNVSu.js → Vibe64ConversationLog-Cv_BE9yH.js} +1 -1
  6. package/dist/assets/{Vibe64DashboardShell-i01oU7QS.js → Vibe64DashboardShell-B3TN3NBS.js} +1 -1
  7. package/dist/assets/{Vibe64DatabaseWorkspace-BqOIE7at.js → Vibe64DatabaseWorkspace-CU0jCfP_.js} +1 -1
  8. package/dist/assets/{Vibe64FileArea-B8_Tqtgv.js → Vibe64FileArea-BWl-q11N.js} +1 -1
  9. package/dist/assets/{Vibe64OutputControls-eaoCQsYn.js → Vibe64OutputControls-DnfGKZHs.js} +1 -1
  10. package/dist/assets/{Vibe64RepositoryWorkspace-CoSH_5qZ.js → Vibe64RepositoryWorkspace-3UKN_pPs.js} +1 -1
  11. package/dist/assets/{Vibe64SessionFiles-Dt1EY-Qo.js → Vibe64SessionFiles-B1U6XSWQ.js} +1 -1
  12. package/dist/assets/{Vibe64SessionSourceEditor-D5-abooo.js → Vibe64SessionSourceEditor-De1QyTOd.js} +1 -1
  13. package/dist/assets/{Vibe64UiStoryboardView-CyuufVBB.js → Vibe64UiStoryboardView-JRGcklim.js} +1 -1
  14. package/dist/assets/{Vibe64UnavailableSessions-CaLRMl-0.js → Vibe64UnavailableSessions-Bd_-gPuL.js} +1 -1
  15. package/dist/assets/{_pageId_-M5CNslNQ.js → _pageId_-DIPouI7Z.js} +1 -1
  16. package/dist/assets/{_sessionId_-jSlkZQLV.js → _sessionId_-qH7uIGNl.js} +1 -1
  17. package/dist/assets/{_slug_-ClQKNEA9.js → _slug_-CaHlSQ8I.js} +5 -5
  18. package/dist/assets/{access-BqnqYSZR.js → access-O4hOM9ov.js} +1 -1
  19. package/dist/assets/{app-D7V6OMMB.js → app-CXljwZ0u.js} +1 -1
  20. package/dist/assets/{changes-odK1bV6J.js → changes-C5gleyWS.js} +1 -1
  21. package/dist/assets/{client-P5LOKvwh.js → client-CI-o7ITq.js} +2 -2
  22. package/dist/assets/{client-rknXpZ1o.js → client-DMEf6RSZ.js} +1 -1
  23. package/dist/assets/{client-DwF9Q0VQ.js → client-Do8szX_w.js} +2 -2
  24. package/dist/assets/{client-BLY6SeL-.js → client-fF-hq8nJ.js} +1 -1
  25. package/dist/assets/contracts-CNUMi5L0.js +3 -0
  26. package/dist/assets/{conversation-BoB7Drme.js → conversation-DiL2PEct.js} +3 -3
  27. package/dist/assets/{conversation-BMyk8R_u.css → conversation-RscSzQxq.css} +1 -1
  28. package/dist/assets/{dashboard-D6JkBdZg.js → dashboard-BWlG0Nli.js} +1 -1
  29. package/dist/assets/{english-definitions-CwCZ8VJ-.js → english-definitions-DcuZfQ4p.js} +1 -1
  30. package/dist/assets/env-D3DVC-Gd.js +1 -0
  31. package/dist/assets/{env-CCUgAwiV.css → env-i_R_LXlE.css} +1 -1
  32. package/dist/assets/{history-IBqZqdSL.js → history-BrWT8DRp.js} +1 -1
  33. package/dist/assets/{index-DAareKn3.js → index-HrVsvggI.js} +2 -2
  34. package/dist/assets/{integrations-BBMdyyMq.js → integrations-C4p_QTuv.js} +1 -1
  35. package/dist/assets/{issues-DwUO1HjX.js → issues-KxOOLtSM.js} +1 -1
  36. package/dist/assets/{learning-DAIqaO0B.js → learning-BWqH7wag.js} +1 -1
  37. package/dist/assets/{pages-DoUMcieZ.js → pages-DcNh-g_z.js} +1 -1
  38. package/dist/assets/{project-files-DilujZdI.js → project-files-C3a_vnA4.js} +1 -1
  39. package/dist/assets/{publish-KZQ_gdoN.js → publish-B1f2baHh.js} +1 -1
  40. package/dist/assets/{pull-requests-BB3CAadu.js → pull-requests-BHq5Yafl.js} +1 -1
  41. package/dist/assets/{repository-B90tiuN6.js → repository-DMBew8kp.js} +1 -1
  42. package/dist/assets/{settings-DdbhtNHb.js → settings-DDpgGhWO.js} +1 -1
  43. package/dist/assets/{useArchivedVibe64Sessions-B_pM75gN.js → useArchivedVibe64Sessions-C5Qguyob.js} +1 -1
  44. package/dist/assets/useAssistantAttachments-DvEl7gX6.js +2 -0
  45. package/dist/assets/{useVibe64ConversationLog-Ch0ZbnCG.js → useVibe64ConversationLog-BZ5g9Jp7.js} +2 -2
  46. package/dist/assets/{useVibe64SessionData-COsXmbMm.js → useVibe64SessionData-D9d4NfDo.js} +1 -1
  47. package/dist/assets/{useVibe64SessionSelection-CKBC-ZJw.js → useVibe64SessionSelection-DT1rJVvx.js} +1 -1
  48. package/dist/assets/{vibe64RepositoryRealtime-BIXVm4u9.js → vibe64RepositoryRealtime-kSshUn2K.js} +1 -1
  49. package/dist/assets/{vibe64SavedEnvValues-CU_SdjKx.js → vibe64SavedEnvValues-CgfMvj_h.js} +1 -1
  50. package/dist/assets/{vibe64SessionFocus-C0LfHXbF.js → vibe64SessionFocus-CLtCTOxq.js} +1 -1
  51. package/dist/index.html +5 -5
  52. package/docs/colleague-usage/coding-agent-goal-pause.md +4 -3
  53. package/docs/colleague-usage/coding-agent-goals.md +26 -18
  54. package/docs/colleague-usage/development-env.md +37 -5
  55. package/node_modules/@jskit-ai/assistant-core/CHANGELOG.md +6 -1
  56. package/node_modules/@jskit-ai/assistant-core/locales/en.json +2 -1
  57. package/node_modules/@jskit-ai/assistant-core/package.json +1 -1
  58. package/node_modules/@jskit-ai/assistant-runtime/CHANGELOG.md +1 -0
  59. package/node_modules/@jskit-ai/assistant-runtime/package.json +1 -1
  60. package/node_modules/@jskit-ai/assistant-voice/package.json +1 -1
  61. package/node_modules/@local/vibe64-execution/src/host/execHelper.js +671 -572
  62. package/node_modules/@local/vibe64-genesis/bin/vibe64-genesis-host-context +480 -479
  63. package/node_modules/@local/vibe64-genesis/src/server/index.js +22 -21
  64. package/node_modules/@local/vibe64-genesis/src/server/promptContext.js +103 -102
  65. package/node_modules/@local/vibe64-runtime/src/server/codexAppServerProcess.js +790 -740
  66. package/package.json +4 -4
  67. package/server.bundle.mjs +37263 -37176
  68. package/dist/assets/contracts-CCZaLqSE.js +0 -1
  69. package/dist/assets/env-CIy7uwLb.js +0 -1
  70. package/dist/assets/useAssistantAttachments-BkYZckgz.js +0 -2
@@ -1,26 +1,26 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __vibe64CreateRequire } from 'node:module';const require=__vibe64CreateRequire(import.meta.url);
3
- var Xi=Object.create;var Zn=Object.defineProperty;var Yi=Object.getOwnPropertyDescriptor;var Zi=Object.getOwnPropertyNames;var Qi=Object.getPrototypeOf,ea=Object.prototype.hasOwnProperty;var M=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof require<"u"?require:e)[n]}):t)(function(t){
4
- if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var $=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(n){throw e=0,n}};var ta=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Zi(e))!ea.call(t,o)&&o!==n&&Zn(t,o,{get:()=>e[o],
5
- enumerable:!(r=Yi(e,o))||r.enumerable});return t};var ce=(t,e,n)=>(n=t!=null?Xi(Qi(t)):{},ta(e||!t||!t.__esModule?Zn(n,"default",{value:t,enumerable:!0}):n,t));var te=$((wm,so)=>{"use strict";var no=["nodebuffer","arraybuffer","fragments"],oo=typeof Blob<"u";oo&&no.push("blob");so.
3
+ var Yi=Object.create;var Zn=Object.defineProperty;var Zi=Object.getOwnPropertyDescriptor;var Qi=Object.getOwnPropertyNames;var ea=Object.getPrototypeOf,ta=Object.prototype.hasOwnProperty;var M=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof require<"u"?require:e)[n]}):t)(function(t){
4
+ if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var $=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(n){throw e=0,n}};var ra=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Qi(e))!ta.call(t,o)&&o!==n&&Zn(t,o,{get:()=>e[o],
5
+ enumerable:!(r=Zi(e,o))||r.enumerable});return t};var ce=(t,e,n)=>(n=t!=null?Yi(ea(t)):{},ra(e||!t||!t.__esModule?Zn(n,"default",{value:t,enumerable:!0}):n,t));var te=$((Im,so)=>{"use strict";var no=["nodebuffer","arraybuffer","fragments"],oo=typeof Blob<"u";oo&&no.push("blob");so.
6
6
  exports={BINARY_TYPES:no,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:oo,
7
7
  kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol(
8
- "websocket"),NOOP:()=>{}}});var Ye=$((ym,Ct)=>{"use strict";var{EMPTY_BUFFER:ga}=te(),gr=Buffer[Symbol.species];function va(t,e){if(t.length===0)return ga;
8
+ "websocket"),NOOP:()=>{}}});var Ye=$((Sm,_t)=>{"use strict";var{EMPTY_BUFFER:va}=te(),gr=Buffer[Symbol.species];function wa(t,e){if(t.length===0)return va;
9
9
  if(t.length===1)return t[0];let n=Buffer.allocUnsafe(e),r=0;for(let o=0;o<t.length;o++){let s=t[o];n.set(s,r),r+=s.length}
10
10
  return r<e?new gr(n.buffer,n.byteOffset,r):n}function io(t,e,n,r,o){for(let s=0;s<o;s++)n[r+s]=t[s]^e[s&3]}function ao(t,e){
11
- for(let n=0;n<t.length;n++)t[n]^=e[n&3]}function wa(t){return t.length===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,
11
+ for(let n=0;n<t.length;n++)t[n]^=e[n&3]}function ya(t){return t.length===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,
12
12
  t.byteOffset+t.length)}function vr(t){if(vr.readOnly=!0,Buffer.isBuffer(t))return t;let e;return t instanceof ArrayBuffer?
13
- e=new gr(t):ArrayBuffer.isView(t)?e=new gr(t.buffer,t.byteOffset,t.byteLength):(e=Buffer.from(t),vr.readOnly=!1),e}Ct.exports=
14
- {concat:va,mask:io,toArrayBuffer:wa,toBuffer:vr,unmask:ao};if(!process.env.WS_NO_BUFFER_UTIL)try{let t=M("bufferutil");Ct.
15
- exports.mask=function(e,n,r,o,s){s<48?io(e,n,r,o,s):t.mask(e,n,r,o,s)},Ct.exports.unmask=function(e,n){e.length<32?ao(e,
16
- n):t.unmask(e,n)}}catch{}});var lo=$((Im,uo)=>{"use strict";var co=Symbol("kDone"),wr=Symbol("kRun"),yr=class{constructor(e){this[co]=()=>{this.pending--,
13
+ e=new gr(t):ArrayBuffer.isView(t)?e=new gr(t.buffer,t.byteOffset,t.byteLength):(e=Buffer.from(t),vr.readOnly=!1),e}_t.exports=
14
+ {concat:wa,mask:io,toArrayBuffer:ya,toBuffer:vr,unmask:ao};if(!process.env.WS_NO_BUFFER_UTIL)try{let t=M("bufferutil");_t.
15
+ exports.mask=function(e,n,r,o,s){s<48?io(e,n,r,o,s):t.mask(e,n,r,o,s)},_t.exports.unmask=function(e,n){e.length<32?ao(e,
16
+ n):t.unmask(e,n)}}catch{}});var lo=$((xm,uo)=>{"use strict";var co=Symbol("kDone"),wr=Symbol("kRun"),yr=class{constructor(e){this[co]=()=>{this.pending--,
17
17
  this[wr]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[wr]()}[wr](){if(this.pending!==
18
- this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[co])}}};uo.exports=yr});var Re=$((Sm,ho)=>{"use strict";var Ze=M("zlib"),po=Ye(),ya=lo(),{kStatusCode:fo}=te(),Ia=Buffer[Symbol.species],Sa=Buffer.
18
+ this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[co])}}};uo.exports=yr});var Re=$((Tm,ho)=>{"use strict";var Ze=M("zlib"),po=Ye(),Ia=lo(),{kStatusCode:fo}=te(),Sa=Buffer[Symbol.species],xa=Buffer.
19
19
  from([0,0,255,255]),At=Symbol("permessage-deflate"),re=Symbol("total-length"),Ee=Symbol("callback"),ue=Symbol("buffers"),
20
- Oe=Symbol("error"),_t,Ir=class{constructor(e){if(this._options=e||{},this._threshold=this._options.threshold!==void 0?this.
20
+ Oe=Symbol("error"),Ct,Ir=class{constructor(e){if(this._options=e||{},this._threshold=this._options.threshold!==void 0?this.
21
21
  _options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=
22
- null,this._inflate=null,this.params=null,!_t){let n=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:
23
- 10;_t=new ya(n)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&
22
+ null,this._inflate=null,this.params=null,!Ct){let n=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:
23
+ 10;Ct=new Ia(n)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&
24
24
  (e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.
25
25
  serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=
26
26
  this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=!0),e}accept(e){return e=
@@ -44,40 +44,40 @@ y a single value`);if(o=o[0],r==="client_max_window_bits"){if(o!==!0){let s=+o;i
44
44
  "${r}": ${o}`)}else if(r==="server_max_window_bits"){let s=+o;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`I\
45
45
  nvalid value for parameter "${r}": ${o}`);o=s}else if(r==="client_no_context_takeover"||r==="server_no_context_takeover"){
46
46
  if(o!==!0)throw new TypeError(`Invalid value for parameter "${r}": ${o}`)}else throw new Error(`Unknown parameter "${r}"`);
47
- n[r]=o})}),e}decompress(e,n,r){_t.add(o=>{this._decompress(e,n,(s,i)=>{o(),r(s,i)})})}compress(e,n,r){_t.add(o=>{this._compress(
47
+ n[r]=o})}),e}decompress(e,n,r){Ct.add(o=>{this._decompress(e,n,(s,i)=>{o(),r(s,i)})})}compress(e,n,r){Ct.add(o=>{this._compress(
48
48
  e,n,(s,i)=>{o(),r(s,i)})})}_decompress(e,n,r){let o=this._isServer?"client":"server";if(!this._inflate){let s=`${o}_max_\
49
49
  window_bits`,i=typeof this.params[s]!="number"?Ze.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=Ze.createInflateRaw(
50
50
  {...this._options.zlibInflateOptions,windowBits:i}),this._inflate[At]=this,this._inflate[re]=0,this._inflate[ue]=[],this.
51
- _inflate.on("error",ba),this._inflate.on("data",mo)}this._inflate[Ee]=r,this._inflate.write(e),n&&this._inflate.write(Sa),
51
+ _inflate.on("error",ba),this._inflate.on("data",mo)}this._inflate[Ee]=r,this._inflate.write(e),n&&this._inflate.write(xa),
52
52
  this._inflate.flush(()=>{let s=this._inflate[Oe];if(s){this._inflate.close(),this._inflate=null,r(s);return}let i=po.concat(
53
53
  this._inflate[ue],this._inflate[re]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):
54
54
  (this._inflate[re]=0,this._inflate[ue]=[],n&&this.params[`${o}_no_context_takeover`]&&this._inflate.reset()),r(null,i)})}_compress(e,n,r){
55
55
  let o=this._isServer?"server":"client";if(!this._deflate){let s=`${o}_max_window_bits`,i=typeof this.params[s]!="number"?
56
56
  Ze.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=Ze.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:i}),
57
- this._deflate[re]=0,this._deflate[ue]=[],this._deflate.on("data",xa)}this._deflate[Ee]=r,this._deflate.write(e),this._deflate.
58
- flush(Ze.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=po.concat(this._deflate[ue],this._deflate[re]);n&&(s=new Ia(s.
57
+ this._deflate[re]=0,this._deflate[ue]=[],this._deflate.on("data",Ta)}this._deflate[Ee]=r,this._deflate.write(e),this._deflate.
58
+ flush(Ze.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=po.concat(this._deflate[ue],this._deflate[re]);n&&(s=new Sa(s.
59
59
  buffer,s.byteOffset,s.length-4)),this._deflate[Ee]=null,this._deflate[re]=0,this._deflate[ue]=[],n&&this.params[`${o}_no\
60
- _context_takeover`]&&this._deflate.reset(),r(null,s)})}};ho.exports=Ir;function xa(t){this[ue].push(t),this[re]+=t.length}
60
+ _context_takeover`]&&this._deflate.reset(),r(null,s)})}};ho.exports=Ir;function Ta(t){this[ue].push(t),this[re]+=t.length}
61
61
  function mo(t){if(this[re]+=t.length,this[At]._maxPayload<1||this[re]<=this[At]._maxPayload){this[ue].push(t);return}this[Oe]=
62
62
  new RangeError("Max payload size exceeded"),this[Oe].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Oe][fo]=1009,this.removeListener(
63
63
  "data",mo),this.reset()}function ba(t){if(this[At]._inflate=null,this[Oe]){this[Ee](this[Oe]);return}t[fo]=1007,this[Ee](
64
- t)}});var Pe=$((xm,Et)=>{"use strict";var{isUtf8:go}=M("buffer"),{hasBlob:Ta}=te(),Ca=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
64
+ t)}});var Pe=$((bm,Et)=>{"use strict";var{isUtf8:go}=M("buffer"),{hasBlob:_a}=te(),Ca=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
65
65
  0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
66
- 1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function _a(t){return t>=
66
+ 1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function Aa(t){return t>=
67
67
  1e3&&t<=1014&&t!==1004&&t!==1005&&t!==1006||t>=3e3&&t<=4999}function Sr(t){let e=t.length,n=0;for(;n<e;)if((t[n]&128)===
68
68
  0)n++;else if((t[n]&224)===192){if(n+1===e||(t[n+1]&192)!==128||(t[n]&254)===192)return!1;n+=2}else if((t[n]&240)===224){
69
69
  if(n+2>=e||(t[n+1]&192)!==128||(t[n+2]&192)!==128||t[n]===224&&(t[n+1]&224)===128||t[n]===237&&(t[n+1]&224)===160)return!1;
70
70
  n+=3}else if((t[n]&248)===240){if(n+3>=e||(t[n+1]&192)!==128||(t[n+2]&192)!==128||(t[n+3]&192)!==128||t[n]===240&&(t[n+1]&
71
- 240)===128||t[n]===244&&t[n+1]>143||t[n]>244)return!1;n+=4}else return!1;return!0}function Aa(t){return Ta&&typeof t=="o\
71
+ 240)===128||t[n]===244&&t[n+1]>143||t[n]>244)return!1;n+=4}else return!1;return!0}function Ea(t){return _a&&typeof t=="o\
72
72
  bject"&&typeof t.arrayBuffer=="function"&&typeof t.type=="string"&&typeof t.stream=="function"&&(t[Symbol.toStringTag]===
73
- "Blob"||t[Symbol.toStringTag]==="File")}Et.exports={isBlob:Aa,isValidStatusCode:_a,isValidUTF8:Sr,tokenChars:Ca};if(go)Et.
73
+ "Blob"||t[Symbol.toStringTag]==="File")}Et.exports={isBlob:Ea,isValidStatusCode:Aa,isValidUTF8:Sr,tokenChars:Ca};if(go)Et.
74
74
  exports.isValidUTF8=function(t){return t.length<24?Sr(t):go(t)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let t=M("utf-8-validate");
75
- Et.exports.isValidUTF8=function(e){return e.length<32?Sr(e):t(e)}}catch{}});var _r=$((bm,bo)=>{"use strict";var{Writable:Ea}=M("stream"),vo=Re(),{BINARY_TYPES:Oa,EMPTY_BUFFER:wo,kStatusCode:Ra,kWebSocket:Pa}=te(),
76
- {concat:xr,toArrayBuffer:ka,unmask:Ma}=Ye(),{isValidStatusCode:Na,isValidUTF8:yo}=Pe(),Ot=Buffer[Symbol.species],G=0,Io=1,
77
- So=2,xo=3,br=4,Tr=5,Rt=6,Cr=class extends Ea{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==
78
- void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||Oa[0],this._extensions=e.extensions||{},this._isServer=
75
+ Et.exports.isValidUTF8=function(e){return e.length<32?Sr(e):t(e)}}catch{}});var Cr=$((_m,To)=>{"use strict";var{Writable:Oa}=M("stream"),vo=Re(),{BINARY_TYPES:Ra,EMPTY_BUFFER:wo,kStatusCode:Pa,kWebSocket:ka}=te(),
76
+ {concat:xr,toArrayBuffer:Ma,unmask:Na}=Ye(),{isValidStatusCode:ja,isValidUTF8:yo}=Pe(),Ot=Buffer[Symbol.species],G=0,Io=1,
77
+ So=2,xo=3,Tr=4,br=5,Rt=6,_r=class extends Oa{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==
78
+ void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||Ra[0],this._extensions=e.extensions||{},this._isServer=
79
79
  !!e.isServer,this._maxBufferedChunks=e.maxBufferedChunks|0,this._maxFragments=e.maxFragments|0,this._maxPayload=e.maxPayload|
80
- 0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[Pa]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=
80
+ 0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[ka]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=
81
81
  !1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=
82
82
  0,this._messageLength=0,this._numFragments=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=G}_write(e,n,r){
83
83
  if(this._opcode===8&&this._state==G)return r();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks){
@@ -87,8 +87,8 @@ _buffers.shift();if(e<this._buffers[0].length){let r=this._buffers[0];return thi
87
87
  e,r.length-e),new Ot(r.buffer,r.byteOffset,e)}let n=Buffer.allocUnsafe(e);do{let r=this._buffers[0],o=n.length-e;e>=r.length?
88
88
  n.set(this._buffers.shift(),o):(n.set(new Uint8Array(r.buffer,r.byteOffset,e),o),this._buffers[0]=new Ot(r.buffer,r.byteOffset+
89
89
  e,r.length-e)),e-=r.length}while(e>0);return n}startLoop(e){this._loop=!0;do switch(this._state){case G:this.getInfo(e);
90
- break;case Io:this.getPayloadLength16(e);break;case So:this.getPayloadLength64(e);break;case xo:this.getMask();break;case br:
91
- this.getData(e);break;case Tr:case Rt:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<
90
+ break;case Io:this.getPayloadLength16(e);break;case So:this.getPayloadLength64(e);break;case xo:this.getMask();break;case Tr:
91
+ this.getData(e);break;case br:case Rt:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<
92
92
  2){this._loop=!1;return}let n=this.consume(2);if((n[0]&48)!==0){let o=this.createError(RangeError,"RSV2 and RSV3 must be\
93
93
  clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(o);return}let r=(n[0]&64)===64;if(r&&!this._extensions[vo.extensionName]){
94
94
  let o=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(o);return}if(this._fin=(n[0]&
@@ -111,44 +111,44 @@ createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",
111
111
  _LENGTH");e(o);return}this._payloadLength=r*Math.pow(2,32)+n.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&
112
112
  this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>
113
113
  0)){let n=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(n);return}
114
- this._masked?this._state=xo:this._state=br}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(
115
- 4),this._state=br}getData(e){let n=wo;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;
114
+ this._masked?this._state=xo:this._state=Tr}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(
115
+ 4),this._state=Tr}getData(e){let n=wo;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;
116
116
  return}n=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&
117
- Ma(n,this._mask)}if(this._opcode>7){this.controlMessage(n,e);return}if(this._maxFragments>0&&++this._numFragments>this._maxFragments){
117
+ Na(n,this._mask)}if(this._opcode>7){this.controlMessage(n,e);return}if(this._maxFragments>0&&++this._numFragments>this._maxFragments){
118
118
  let r=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");e(r);return}if(this.
119
- _compressed){this._state=Tr,this.decompress(n,e);return}n.length&&(this._messageLength=this._totalPayloadLength,this._fragments.
119
+ _compressed){this._state=br,this.decompress(n,e);return}n.length&&(this._messageLength=this._totalPayloadLength,this._fragments.
120
120
  push(n)),this.dataMessage(e)}decompress(e,n){this._extensions[vo.extensionName].decompress(e,this._fin,(o,s)=>{if(o)return n(
121
121
  o);if(s.length){if(this._messageLength+=s.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let i=this.createError(
122
122
  RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");n(i);return}this._fragments.push(s)}
123
123
  this.dataMessage(n),this._state===G&&this.startLoop(n)})}dataMessage(e){if(!this._fin){this._state=G;return}let n=this._messageLength,
124
124
  r=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._numFragments=0,this._fragments=
125
- [],this._opcode===2){let o;this._binaryType==="nodebuffer"?o=xr(r,n):this._binaryType==="arraybuffer"?o=ka(xr(r,n)):this.
125
+ [],this._opcode===2){let o;this._binaryType==="nodebuffer"?o=xr(r,n):this._binaryType==="arraybuffer"?o=Ma(xr(r,n)):this.
126
126
  _binaryType==="blob"?o=new Blob(r):o=r,this._allowSynchronousEvents?(this.emit("message",o,!0),this._state=G):(this._state=
127
127
  Rt,setImmediate(()=>{this.emit("message",o,!0),this._state=G,this.startLoop(e)}))}else{let o=xr(r,n);if(!this._skipUTF8Validation&&
128
- !yo(o)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(s);return}this._state===Tr||
128
+ !yo(o)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(s);return}this._state===br||
129
129
  this._allowSynchronousEvents?(this.emit("message",o,!1),this._state=G):(this._state=Rt,setImmediate(()=>{this.emit("mess\
130
130
  age",o,!1),this._state=G,this.startLoop(e)}))}}controlMessage(e,n){if(this._opcode===8){if(e.length===0)this._loop=!1,this.
131
- emit("conclude",1005,wo),this.end();else{let r=e.readUInt16BE(0);if(!Na(r)){let s=this.createError(RangeError,`invalid s\
131
+ emit("conclude",1005,wo),this.end();else{let r=e.readUInt16BE(0);if(!ja(r)){let s=this.createError(RangeError,`invalid s\
132
132
  tatus code ${r}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");n(s);return}let o=new Ot(e.buffer,e.byteOffset+2,e.length-2);if(!this.
133
133
  _skipUTF8Validation&&!yo(o)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");n(s);return}
134
134
  this._loop=!1,this.emit("conclude",r,o),this.end()}this._state=G;return}this._allowSynchronousEvents?(this.emit(this._opcode===
135
135
  9?"ping":"pong",e),this._state=G):(this._state=Rt,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=
136
136
  G,this.startLoop(n)}))}createError(e,n,r,o,s){this._loop=!1,this._errored=!0;let i=new e(r?`Invalid WebSocket frame: ${n}`:
137
- n);return Error.captureStackTrace(i,this.createError),i.code=s,i[Ra]=o,i}};bo.exports=Cr});var Or=$((Cm,_o)=>{"use strict";var{Duplex:Tm}=M("stream"),{randomFillSync:ja}=M("crypto"),{types:{isUint8Array:Da}}=M("util"),
138
- To=Re(),{EMPTY_BUFFER:za,kWebSocket:La,NOOP:Ua}=te(),{isBlob:ke,isValidStatusCode:Fa}=Pe(),{mask:Co,toBuffer:ve}=Ye(),W=Symbol(
139
- "kByteLength"),qa=Buffer.alloc(4),Pt=8*1024,we,Me=Pt,Z=0,$a=1,Ba=2,Ar=class t{constructor(e,n,r){this._extensions=n||{},
137
+ n);return Error.captureStackTrace(i,this.createError),i.code=s,i[Pa]=o,i}};To.exports=_r});var Or=$((Am,Co)=>{"use strict";var{Duplex:Cm}=M("stream"),{randomFillSync:Da}=M("crypto"),{types:{isUint8Array:za}}=M("util"),
138
+ bo=Re(),{EMPTY_BUFFER:La,kWebSocket:Ua,NOOP:Fa}=te(),{isBlob:ke,isValidStatusCode:qa}=Pe(),{mask:_o,toBuffer:ve}=Ye(),W=Symbol(
139
+ "kByteLength"),$a=Buffer.alloc(4),Pt=8*1024,we,Me=Pt,Z=0,Ba=1,Ha=2,Ar=class t{constructor(e,n,r){this._extensions=n||{},
140
140
  r&&(this._generateMask=r,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this.
141
- _bufferedBytes=0,this._queue=[],this._state=Z,this.onerror=Ua,this[La]=void 0}static frame(e,n){let r,o=!1,s=2,i=!1;n.mask&&
142
- (r=n.maskBuffer||qa,n.generateMask?n.generateMask(r):(Me===Pt&&(we===void 0&&(we=Buffer.alloc(Pt)),ja(we,0,Pt),Me=0),r[0]=
141
+ _bufferedBytes=0,this._queue=[],this._state=Z,this.onerror=Fa,this[Ua]=void 0}static frame(e,n){let r,o=!1,s=2,i=!1;n.mask&&
142
+ (r=n.maskBuffer||$a,n.generateMask?n.generateMask(r):(Me===Pt&&(we===void 0&&(we=Buffer.alloc(Pt)),Da(we,0,Pt),Me=0),r[0]=
143
143
  we[Me++],r[1]=we[Me++],r[2]=we[Me++],r[3]=we[Me++]),i=(r[0]|r[1]|r[2]|r[3])===0,s=6);let a;typeof e=="string"?(!n.mask||
144
144
  i)&&n[W]!==void 0?a=n[W]:(e=Buffer.from(e),a=e.length):(a=e.length,o=n.mask&&n.readOnly&&!i);let c=a;a>=65536?(s+=8,c=127):
145
145
  a>125&&(s+=2,c=126);let d=Buffer.allocUnsafe(o?a+s:s);return d[0]=n.fin?n.opcode|128:n.opcode,n.rsv1&&(d[0]|=64),d[1]=c,
146
146
  c===126?d.writeUInt16BE(a,2):c===127&&(d[2]=d[3]=0,d.writeUIntBE(a,4,6)),n.mask?(d[1]|=128,d[s-4]=r[0],d[s-3]=r[1],d[s-2]=
147
- r[2],d[s-1]=r[3],i?[d,e]:o?(Co(e,r,d,s,a),[d]):(Co(e,r,e,0,a),[d,e])):[d,e]}close(e,n,r,o){let s;if(e===void 0)s=za;else{
148
- if(typeof e!="number"||!Fa(e))throw new TypeError("First argument must be a valid error code number");if(n===void 0||!n.
147
+ r[2],d[s-1]=r[3],i?[d,e]:o?(_o(e,r,d,s,a),[d]):(_o(e,r,e,0,a),[d,e])):[d,e]}close(e,n,r,o){let s;if(e===void 0)s=La;else{
148
+ if(typeof e!="number"||!qa(e))throw new TypeError("First argument must be a valid error code number");if(n===void 0||!n.
149
149
  length)s=Buffer.allocUnsafe(2),s.writeUInt16BE(e,0);else{let a=Buffer.byteLength(n);if(a>123)throw new RangeError("The m\
150
150
  essage must not be greater than 123 bytes");if(s=Buffer.allocUnsafe(2+a),s.writeUInt16BE(e,0),typeof n=="string")s.write(
151
- n,2);else if(Da(n))s.set(n,2);else throw new TypeError("Second argument must be a string or a Uint8Array")}}let i={[W]:s.
151
+ n,2);else if(za(n))s.set(n,2);else throw new TypeError("Second argument must be a string or a Uint8Array")}}let i={[W]:s.
152
152
  length,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==
153
153
  Z?this.enqueue([this.dispatch,s,!1,i,o]):this.sendFrame(t.frame(s,i),o)}ping(e,n,r){let o,s;if(typeof e=="string"?(o=Buffer.
154
154
  byteLength(e),s=!1):ke(e)?(o=e.size,s=!1):(e=ve(e),o=e.length,s=ve.readOnly),o>125)throw new RangeError("The data size m\
@@ -158,24 +158,24 @@ this._state!==Z?this.enqueue([this.dispatch,e,!1,i,r]):this.sendFrame(t.frame(e,
158
158
  string"?(o=Buffer.byteLength(e),s=!1):ke(e)?(o=e.size,s=!1):(e=ve(e),o=e.length,s=ve.readOnly),o>125)throw new RangeError(
159
159
  "The data size must not be greater than 125 bytes");let i={[W]:o,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this.
160
160
  _maskBuffer,opcode:10,readOnly:s,rsv1:!1};ke(e)?this._state!==Z?this.enqueue([this.getBlobData,e,!1,i,r]):this.getBlobData(
161
- e,!1,i,r):this._state!==Z?this.enqueue([this.dispatch,e,!1,i,r]):this.sendFrame(t.frame(e,i),r)}send(e,n,r){let o=this._extensions[To.
161
+ e,!1,i,r):this._state!==Z?this.enqueue([this.dispatch,e,!1,i,r]):this.sendFrame(t.frame(e,i),r)}send(e,n,r){let o=this._extensions[bo.
162
162
  extensionName],s=n.binary?2:1,i=n.compress,a,c;typeof e=="string"?(a=Buffer.byteLength(e),c=!1):ke(e)?(a=e.size,c=!1):(e=
163
163
  ve(e),a=e.length,c=ve.readOnly),this._firstFragment?(this._firstFragment=!1,i&&o&&o.params[o._isServer?"server_no_contex\
164
164
  t_takeover":"client_no_context_takeover"]&&(i=a>=o._threshold),this._compress=i):(i=!1,s=0),n.fin&&(this._firstFragment=
165
165
  !0);let d={[W]:a,fin:n.fin,generateMask:this._generateMask,mask:n.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:c,rsv1:i};
166
166
  ke(e)?this._state!==Z?this.enqueue([this.getBlobData,e,this._compress,d,r]):this.getBlobData(e,this._compress,d,r):this.
167
167
  _state!==Z?this.enqueue([this.dispatch,e,this._compress,d,r]):this.dispatch(e,this._compress,d,r)}getBlobData(e,n,r,o){this.
168
- _bufferedBytes+=r[W],this._state=Ba,e.arrayBuffer().then(s=>{if(this._socket.destroyed){let a=new Error("The socket was \
168
+ _bufferedBytes+=r[W],this._state=Ha,e.arrayBuffer().then(s=>{if(this._socket.destroyed){let a=new Error("The socket was \
169
169
  closed while the blob was being read");process.nextTick(Er,this,a,o);return}this._bufferedBytes-=r[W];let i=ve(s);n?this.
170
- dispatch(i,n,r,o):(this._state=Z,this.sendFrame(t.frame(i,r),o),this.dequeue())}).catch(s=>{process.nextTick(Ha,this,s,o)})}dispatch(e,n,r,o){
171
- if(!n){this.sendFrame(t.frame(e,r),o);return}let s=this._extensions[To.extensionName];this._bufferedBytes+=r[W],this._state=
172
- $a,s.compress(e,r.fin,(i,a)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being com\
170
+ dispatch(i,n,r,o):(this._state=Z,this.sendFrame(t.frame(i,r),o),this.dequeue())}).catch(s=>{process.nextTick(Va,this,s,o)})}dispatch(e,n,r,o){
171
+ if(!n){this.sendFrame(t.frame(e,r),o);return}let s=this._extensions[bo.extensionName];this._bufferedBytes+=r[W],this._state=
172
+ Ba,s.compress(e,r.fin,(i,a)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being com\
173
173
  pressed");Er(this,c,o);return}this._bufferedBytes-=r[W],this._state=Z,r.readOnly=!1,this.sendFrame(t.frame(a,r),o),this.
174
174
  dequeue()})}dequeue(){for(;this._state===Z&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][W],
175
175
  Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][W],this._queue.push(e)}sendFrame(e,n){e.length===
176
176
  2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],n),this._socket.uncork()):this._socket.write(e[0],
177
- n)}};_o.exports=Ar;function Er(t,e,n){typeof n=="function"&&n(e);for(let r=0;r<t._queue.length;r++){let o=t._queue[r],s=o[o.
178
- length-1];typeof s=="function"&&s(e)}}function Ha(t,e,n){Er(t,e,n),t.onerror(e)}});var jo=$((_m,No)=>{"use strict";var{kForOnEventAttribute:Qe,kListener:Rr}=te(),Ao=Symbol("kCode"),Eo=Symbol("kData"),Oo=Symbol(
177
+ n)}};Co.exports=Ar;function Er(t,e,n){typeof n=="function"&&n(e);for(let r=0;r<t._queue.length;r++){let o=t._queue[r],s=o[o.
178
+ length-1];typeof s=="function"&&s(e)}}function Va(t,e,n){Er(t,e,n),t.onerror(e)}});var jo=$((Em,No)=>{"use strict";var{kForOnEventAttribute:Qe,kListener:Rr}=te(),Ao=Symbol("kCode"),Eo=Symbol("kData"),Oo=Symbol(
179
179
  "kError"),Ro=Symbol("kMessage"),Po=Symbol("kReason"),Ne=Symbol("kTarget"),ko=Symbol("kType"),Mo=Symbol("kWasClean"),ne=class{constructor(e){
180
180
  this[Ne]=null,this[ko]=e}get target(){return this[Ne]}get type(){return this[ko]}};Object.defineProperty(ne.prototype,"t\
181
181
  arget",{enumerable:!0});Object.defineProperty(ne.prototype,"type",{enumerable:!0});var ye=class extends ne{constructor(e,n={}){
@@ -186,14 +186,14 @@ an",{enumerable:!0});var je=class extends ne{constructor(e,n={}){super(e),this[O
186
186
  n.message===void 0?"":n.message}get error(){return this[Oo]}get message(){return this[Ro]}};Object.defineProperty(je.prototype,
187
187
  "error",{enumerable:!0});Object.defineProperty(je.prototype,"message",{enumerable:!0});var et=class extends ne{constructor(e,n={}){
188
188
  super(e),this[Eo]=n.data===void 0?null:n.data}get data(){return this[Eo]}};Object.defineProperty(et.prototype,"data",{enumerable:!0});
189
- var Va={addEventListener(t,e,n={}){for(let o of this.listeners(t))if(!n[Qe]&&o[Rr]===e&&!o[Qe])return;let r;if(t==="mess\
189
+ var Ga={addEventListener(t,e,n={}){for(let o of this.listeners(t))if(!n[Qe]&&o[Rr]===e&&!o[Qe])return;let r;if(t==="mess\
190
190
  age")r=function(s,i){let a=new et("message",{data:i?s:s.toString()});a[Ne]=this,kt(e,this,a)};else if(t==="close")r=function(s,i){
191
191
  let a=new ye("close",{code:s,reason:i.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[Ne]=this,kt(
192
192
  e,this,a)};else if(t==="error")r=function(s){let i=new je("error",{error:s,message:s.message});i[Ne]=this,kt(e,this,i)};else if(t===
193
193
  "open")r=function(){let s=new ne("open");s[Ne]=this,kt(e,this,s)};else return;r[Qe]=!!n[Qe],r[Rr]=e,n.once?this.once(t,r):
194
194
  this.on(t,r)},removeEventListener(t,e){for(let n of this.listeners(t))if(n[Rr]===e&&!n[Qe]){this.removeListener(t,n);break}}};
195
- No.exports={CloseEvent:ye,ErrorEvent:je,Event:ne,EventTarget:Va,MessageEvent:et};function kt(t,e,n){typeof t=="object"&&
196
- t.handleEvent?t.handleEvent.call(t,n):t.call(e,n)}});var Mt=$((Am,Do)=>{"use strict";var{tokenChars:tt}=Pe();function ee(t,e,n){t[e]===void 0?t[e]=[n]:t[e].push(n)}function Ga(t){
195
+ No.exports={CloseEvent:ye,ErrorEvent:je,Event:ne,EventTarget:Ga,MessageEvent:et};function kt(t,e,n){typeof t=="object"&&
196
+ t.handleEvent?t.handleEvent.call(t,n):t.call(e,n)}});var Mt=$((Om,Do)=>{"use strict";var{tokenChars:tt}=Pe();function ee(t,e,n){t[e]===void 0?t[e]=[n]:t[e].push(n)}function Wa(t){
197
197
  let e=Object.create(null),n=Object.create(null),r=!1,o=!1,s=!1,i,a,c=-1,d=-1,p=-1,m=0;for(;m<t.length;m++)if(d=t.charCodeAt(
198
198
  m),i===void 0)if(p===-1&&tt[d]===1)c===-1&&(c=m);else if(m!==0&&(d===32||d===9))p===-1&&c!==-1&&(p=m);else if(d===59||d===
199
199
  44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${m}`);p===-1&&(p=m);let v=t.slice(c,p);d===44?(ee(e,
@@ -208,13 +208,13 @@ d===9))p===-1&&(p=m);else if(d===59||d===44){if(c===-1)throw new SyntaxError(`Un
208
208
  (p=m);let v=t.slice(c,p);r&&(v=v.replace(/\\/g,""),r=!1),ee(n,a,v),d===44&&(ee(e,i,n),n=Object.create(null),i=void 0),a=
209
209
  void 0,c=p=-1}else throw new SyntaxError(`Unexpected character at index ${m}`);if(c===-1||s||d===32||d===9)throw new SyntaxError(
210
210
  "Unexpected end of input");p===-1&&(p=m);let l=t.slice(c,p);return i===void 0?ee(e,l,n):(a===void 0?ee(n,l,!0):r?ee(n,a,
211
- l.replace(/\\/g,"")):ee(n,a,l),ee(e,i,n)),e}function Wa(t){return Object.keys(t).map(e=>{let n=t[e];return Array.isArray(
211
+ l.replace(/\\/g,"")):ee(n,a,l),ee(e,i,n)),e}function Ka(t){return Object.keys(t).map(e=>{let n=t[e];return Array.isArray(
212
212
  n)||(n=[n]),n.map(r=>[e].concat(Object.keys(r).map(o=>{let s=r[o];return Array.isArray(s)||(s=[s]),s.map(i=>i===!0?o:`${o}\
213
- =${i}`).join("; ")})).join("; ")).join(", ")}).join(", ")}Do.exports={format:Wa,parse:Ga}});var zt=$((Rm,Ko)=>{"use strict";var Ka=M("events"),Ja=M("https"),Xa=M("http"),Uo=M("net"),Ya=M("tls"),{randomBytes:Za,createHash:Qa}=M("crypto"),
214
- {Duplex:Em,Readable:Om}=M("stream"),{URL:Pr}=M("url"),le=Re(),ec=_r(),tc=Or(),{isBlob:rc}=Pe(),{BINARY_TYPES:zo,CLOSE_TIMEOUT:nc,
215
- EMPTY_BUFFER:Nt,GUID:oc,kForOnEventAttribute:kr,kListener:sc,kStatusCode:ic,kWebSocket:L,NOOP:Fo}=te(),{EventTarget:{addEventListener:ac,
216
- removeEventListener:cc}}=jo(),{format:dc,parse:uc}=Mt(),{toBuffer:lc}=Ye(),qo=Symbol("kAborted"),Mr=[8,13],oe=["CONNECTI\
217
- NG","OPEN","CLOSING","CLOSED"],pc=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,k=class t extends Ka{constructor(e,n,r){super(),this.
213
+ =${i}`).join("; ")})).join("; ")).join(", ")}).join(", ")}Do.exports={format:Ka,parse:Wa}});var zt=$((km,Ko)=>{"use strict";var Ja=M("events"),Xa=M("https"),Ya=M("http"),Uo=M("net"),Za=M("tls"),{randomBytes:Qa,createHash:ec}=M("crypto"),
214
+ {Duplex:Rm,Readable:Pm}=M("stream"),{URL:Pr}=M("url"),le=Re(),tc=Cr(),rc=Or(),{isBlob:nc}=Pe(),{BINARY_TYPES:zo,CLOSE_TIMEOUT:oc,
215
+ EMPTY_BUFFER:Nt,GUID:sc,kForOnEventAttribute:kr,kListener:ic,kStatusCode:ac,kWebSocket:L,NOOP:Fo}=te(),{EventTarget:{addEventListener:cc,
216
+ removeEventListener:dc}}=jo(),{format:uc,parse:lc}=Mt(),{toBuffer:pc}=Ye(),qo=Symbol("kAborted"),Mr=[8,13],oe=["CONNECTI\
217
+ NG","OPEN","CLOSING","CLOSED"],fc=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,k=class t extends Ja{constructor(e,n,r){super(),this.
218
218
  _binaryType=zo[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Nt,this._closeTimer=
219
219
  null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=t.CONNECTING,this._receiver=
220
220
  null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,n===void 0?
@@ -223,11 +223,11 @@ r.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set b
223
223
  e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+
224
224
  this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){
225
225
  return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){
226
- return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,n,r){let o=new ec(
226
+ return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,n,r){let o=new tc(
227
227
  {allowSynchronousEvents:r.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,
228
228
  maxBufferedChunks:r.maxBufferedChunks,maxFragments:r.maxFragments,maxPayload:r.maxPayload,skipUTF8Validation:r.skipUTF8Validation}),
229
- s=new tc(e,this._extensions,r.generateMask);this._receiver=o,this._sender=s,this._socket=e,o[L]=this,s[L]=this,e[L]=this,
230
- o.on("conclude",hc),o.on("drain",gc),o.on("error",vc),o.on("message",wc),o.on("ping",yc),o.on("pong",Ic),s.onerror=Sc,e.
229
+ s=new rc(e,this._extensions,r.generateMask);this._receiver=o,this._sender=s,this._socket=e,o[L]=this,s[L]=this,e[L]=this,
230
+ o.on("conclude",gc),o.on("drain",vc),o.on("error",wc),o.on("message",yc),o.on("ping",Ic),o.on("pong",Sc),s.onerror=xc,e.
231
231
  setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),n.length>0&&e.unshift(n),e.on("close",Vo),e.on("data",Dt),e.on(
232
232
  "end",Go),e.on("error",Wo),this._readyState=t.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=t.CLOSED,
233
233
  this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[le.extensionName]&&this._extensions[le.extensionName].
@@ -256,59 +256,59 @@ k.prototype,"OPEN",{enumerable:!0,value:oe.indexOf("OPEN")});Object.defineProper
256
256
  k,"CLOSED",{enumerable:!0,value:oe.indexOf("CLOSED")});Object.defineProperty(k.prototype,"CLOSED",{enumerable:!0,value:oe.
257
257
  indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(t=>{Object.
258
258
  defineProperty(k.prototype,t,{enumerable:!0})});["open","error","close","message"].forEach(t=>{Object.defineProperty(k.prototype,
259
- `on${t}`,{enumerable:!0,get(){for(let e of this.listeners(t))if(e[kr])return e[sc];return null},set(e){for(let n of this.
259
+ `on${t}`,{enumerable:!0,get(){for(let e of this.listeners(t))if(e[kr])return e[ic];return null},set(e){for(let n of this.
260
260
  listeners(t))if(n[kr]){this.removeListener(t,n);break}typeof e=="function"&&this.addEventListener(t,e,{[kr]:!0})}})});k.
261
- prototype.addEventListener=ac;k.prototype.removeEventListener=cc;Ko.exports=k;function $o(t,e,n,r){let o={allowSynchronousEvents:!0,
262
- autoPong:!0,closeTimeout:nc,protocolVersion:Mr[1],maxBufferedChunks:262144,maxFragments:16384,maxPayload:104857600,skipUTF8Validation:!1,
261
+ prototype.addEventListener=cc;k.prototype.removeEventListener=dc;Ko.exports=k;function $o(t,e,n,r){let o={allowSynchronousEvents:!0,
262
+ autoPong:!0,closeTimeout:oc,protocolVersion:Mr[1],maxBufferedChunks:262144,maxFragments:16384,maxPayload:104857600,skipUTF8Validation:!1,
263
263
  perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...r,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,
264
264
  method:"GET",host:void 0,path:void 0,port:void 0};if(t._autoPong=o.autoPong,t._closeTimeout=o.closeTimeout,!Mr.includes(
265
265
  o.protocolVersion))throw new RangeError(`Unsupported protocol version: ${o.protocolVersion} (supported versions: ${Mr.join(
266
266
  ", ")})`);let s;if(e instanceof Pr)s=e;else try{s=new Pr(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}s.protocol===
267
267
  "http:"?s.protocol="ws:":s.protocol==="https:"&&(s.protocol="wss:"),t._url=s.href;let i=s.protocol==="wss:",a=s.protocol===
268
268
  "ws+unix:",c;if(s.protocol!=="ws:"&&!i&&!a?c=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws\
269
- +unix:"`:a&&!s.pathname?c="The URL's pathname is empty":s.hash&&(c="The URL contains a fragment identifier"),c){let b=new SyntaxError(
270
- c);if(t._redirects===0)throw b;jt(t,b);return}let d=i?443:80,p=Za(16).toString("base64"),m=i?Ja.request:Xa.request,l=new Set,
271
- v;if(o.createConnection=o.createConnection||(i?mc:fc),o.defaultPort=o.defaultPort||d,o.port=s.port||d,o.host=s.hostname.
269
+ +unix:"`:a&&!s.pathname?c="The URL's pathname is empty":s.hash&&(c="The URL contains a fragment identifier"),c){let T=new SyntaxError(
270
+ c);if(t._redirects===0)throw T;jt(t,T);return}let d=i?443:80,p=Qa(16).toString("base64"),m=i?Xa.request:Ya.request,l=new Set,
271
+ v;if(o.createConnection=o.createConnection||(i?hc:mc),o.defaultPort=o.defaultPort||d,o.port=s.port||d,o.host=s.hostname.
272
272
  startsWith("[")?s.hostname.slice(1,-1):s.hostname,o.headers={...o.headers,"Sec-WebSocket-Version":o.protocolVersion,"Sec\
273
273
  -WebSocket-Key":p,Connection:"Upgrade",Upgrade:"websocket"},o.path=s.pathname+s.search,o.timeout=o.handshakeTimeout,o.perMessageDeflate&&
274
- (v=new le({...o.perMessageDeflate,isServer:!1,maxPayload:o.maxPayload}),o.headers["Sec-WebSocket-Extensions"]=dc({[le.extensionName]:v.
275
- offer()})),n.length){for(let b of n){if(typeof b!="string"||!pc.test(b)||l.has(b))throw new SyntaxError("An invalid or d\
276
- uplicated subprotocol was specified");l.add(b)}o.headers["Sec-WebSocket-Protocol"]=n.join(",")}if(o.origin&&(o.protocolVersion<
274
+ (v=new le({...o.perMessageDeflate,isServer:!1,maxPayload:o.maxPayload}),o.headers["Sec-WebSocket-Extensions"]=uc({[le.extensionName]:v.
275
+ offer()})),n.length){for(let T of n){if(typeof T!="string"||!fc.test(T)||l.has(T))throw new SyntaxError("An invalid or d\
276
+ uplicated subprotocol was specified");l.add(T)}o.headers["Sec-WebSocket-Protocol"]=n.join(",")}if(o.origin&&(o.protocolVersion<
277
277
  13?o.headers["Sec-WebSocket-Origin"]=o.origin:o.headers.Origin=o.origin),(s.username||s.password)&&(o.auth=`${s.username}\
278
- :${s.password}`),a){let b=o.path.split(":");o.socketPath=b[0],o.path=b[1]}let x;if(o.followRedirects){if(t._redirects===
279
- 0){t._originalIpc=a,t._originalSecure=i,t._originalHostOrSocketPath=a?o.socketPath:s.host;let b=r&&r.headers;if(r={...r,
280
- headers:{}},b)for(let[O,P]of Object.entries(b))r.headers[O.toLowerCase()]=P}else if(t.listenerCount("redirect")===0){let b=a?
281
- t._originalIpc?o.socketPath===t._originalHostOrSocketPath:!1:t._originalIpc?!1:s.host===t._originalHostOrSocketPath;(!b||
282
- t._originalSecure&&!i)&&(delete o.headers.authorization,delete o.headers.cookie,b||delete o.headers.host,o.auth=void 0)}
278
+ :${s.password}`),a){let T=o.path.split(":");o.socketPath=T[0],o.path=T[1]}let x;if(o.followRedirects){if(t._redirects===
279
+ 0){t._originalIpc=a,t._originalSecure=i,t._originalHostOrSocketPath=a?o.socketPath:s.host;let T=r&&r.headers;if(r={...r,
280
+ headers:{}},T)for(let[O,P]of Object.entries(T))r.headers[O.toLowerCase()]=P}else if(t.listenerCount("redirect")===0){let T=a?
281
+ t._originalIpc?o.socketPath===t._originalHostOrSocketPath:!1:t._originalIpc?!1:s.host===t._originalHostOrSocketPath;(!T||
282
+ t._originalSecure&&!i)&&(delete o.headers.authorization,delete o.headers.cookie,T||delete o.headers.host,o.auth=void 0)}
283
283
  o.auth&&!r.headers.authorization&&(r.headers.authorization="Basic "+Buffer.from(o.auth).toString("base64")),x=t._req=m(o),
284
284
  t._redirects&&t.emit("redirect",t.url,x)}else x=t._req=m(o);o.timeout&&x.on("timeout",()=>{B(t,x,"Opening handshake has \
285
- timed out")}),x.on("error",b=>{x===null||x[qo]||(x=t._req=null,jt(t,b))}),x.on("response",b=>{let O=b.headers.location,P=b.
285
+ timed out")}),x.on("error",T=>{x===null||x[qo]||(x=t._req=null,jt(t,T))}),x.on("response",T=>{let O=T.headers.location,P=T.
286
286
  statusCode;if(O&&o.followRedirects&&P>=300&&P<400){if(++t._redirects>o.maxRedirects){B(t,x,"Maximum redirects exceeded");
287
287
  return}x.abort();let j;try{j=new Pr(O,e)}catch{let U=new SyntaxError(`Invalid URL: ${O}`);jt(t,U);return}$o(t,j,n,r)}else
288
- t.emit("unexpected-response",x,b)||B(t,x,`Unexpected server response: ${b.statusCode}`)}),x.on("upgrade",(b,O,P)=>{if(t.
289
- emit("upgrade",b),t.readyState!==k.CONNECTING)return;x=t._req=null;let j=b.headers.upgrade;if(j===void 0||j.toLowerCase()!==
290
- "websocket"){B(t,O,"Invalid Upgrade header");return}let D=Qa("sha1").update(p+oc).digest("base64");if(b.headers["sec-web\
291
- socket-accept"]!==D){B(t,O,"Invalid Sec-WebSocket-Accept header");return}let U=b.headers["sec-websocket-protocol"],J;if(U!==
288
+ t.emit("unexpected-response",x,T)||B(t,x,`Unexpected server response: ${T.statusCode}`)}),x.on("upgrade",(T,O,P)=>{if(t.
289
+ emit("upgrade",T),t.readyState!==k.CONNECTING)return;x=t._req=null;let j=T.headers.upgrade;if(j===void 0||j.toLowerCase()!==
290
+ "websocket"){B(t,O,"Invalid Upgrade header");return}let D=ec("sha1").update(p+sc).digest("base64");if(T.headers["sec-web\
291
+ socket-accept"]!==D){B(t,O,"Invalid Sec-WebSocket-Accept header");return}let U=T.headers["sec-websocket-protocol"],J;if(U!==
292
292
  void 0?l.size?l.has(U)||(J="Server sent an invalid subprotocol"):J="Server sent a subprotocol but none was requested":l.
293
- size&&(J="Server sent no subprotocol"),J){B(t,O,J);return}U&&(t._protocol=U);let H=b.headers["sec-websocket-extensions"];
293
+ size&&(J="Server sent no subprotocol"),J){B(t,O,J);return}U&&(t._protocol=U);let H=T.headers["sec-websocket-extensions"];
294
294
  if(H!==void 0){if(!v){B(t,O,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let q;
295
- try{q=uc(H)}catch{B(t,O,"Invalid Sec-WebSocket-Extensions header");return}let ae=Object.keys(q);if(ae.length!==1||ae[0]!==
295
+ try{q=lc(H)}catch{B(t,O,"Invalid Sec-WebSocket-Extensions header");return}let ae=Object.keys(q);if(ae.length!==1||ae[0]!==
296
296
  le.extensionName){B(t,O,"Server indicated an extension that was not requested");return}try{v.accept(q[le.extensionName])}catch{
297
297
  B(t,O,"Invalid Sec-WebSocket-Extensions header");return}t._extensions[le.extensionName]=v}t.setSocket(O,P,{allowSynchronousEvents:o.
298
298
  allowSynchronousEvents,generateMask:o.generateMask,maxBufferedChunks:o.maxBufferedChunks,maxFragments:o.maxFragments,maxPayload:o.
299
299
  maxPayload,skipUTF8Validation:o.skipUTF8Validation})}),o.finishRequest?o.finishRequest(x,t):x.end()}function jt(t,e){t._readyState=
300
- k.CLOSING,t._errorEmitted=!0,t.emit("error",e),t.emitClose()}function fc(t){return t.path=t.socketPath,Uo.connect(t)}function mc(t){
301
- return t.path=void 0,!t.servername&&t.servername!==""&&(t.servername=Uo.isIP(t.host)?"":t.host),Ya.connect(t)}function B(t,e,n){
300
+ k.CLOSING,t._errorEmitted=!0,t.emit("error",e),t.emitClose()}function mc(t){return t.path=t.socketPath,Uo.connect(t)}function hc(t){
301
+ return t.path=void 0,!t.servername&&t.servername!==""&&(t.servername=Uo.isIP(t.host)?"":t.host),Za.connect(t)}function B(t,e,n){
302
302
  t._readyState=k.CLOSING;let r=new Error(n);Error.captureStackTrace(r,B),e.setHeader?(e[qo]=!0,e.abort(),e.socket&&!e.socket.
303
303
  destroyed&&e.socket.destroy(),process.nextTick(jt,t,r)):(e.destroy(r),e.once("error",t.emit.bind(t,"error")),e.once("clo\
304
- se",t.emitClose.bind(t)))}function Nr(t,e,n){if(e){let r=rc(e)?e.size:lc(e).length;t._socket?t._sender._bufferedBytes+=r:
304
+ se",t.emitClose.bind(t)))}function Nr(t,e,n){if(e){let r=nc(e)?e.size:pc(e).length;t._socket?t._sender._bufferedBytes+=r:
305
305
  t._bufferedAmount+=r}if(n){let r=new Error(`WebSocket is not open: readyState ${t.readyState} (${oe[t.readyState]})`);process.
306
- nextTick(n,r)}}function hc(t,e){let n=this[L];n._closeFrameReceived=!0,n._closeMessage=e,n._closeCode=t,n._socket[L]!==void 0&&
307
- (n._socket.removeListener("data",Dt),process.nextTick(Bo,n._socket),t===1005?n.close():n.close(t,e))}function gc(){let t=this[L];
308
- t.isPaused||t._socket.resume()}function vc(t){let e=this[L];e._socket[L]!==void 0&&(e._socket.removeListener("data",Dt),
309
- process.nextTick(Bo,e._socket),e.close(t[ic])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",t))}function Lo(){this[L].
310
- emitClose()}function wc(t,e){this[L].emit("message",t,e)}function yc(t){let e=this[L];e._autoPong&&e.pong(t,!this._isServer,
311
- Fo),e.emit("ping",t)}function Ic(t){this[L].emit("pong",t)}function Bo(t){t.resume()}function Sc(t){let e=this[L];e.readyState!==
306
+ nextTick(n,r)}}function gc(t,e){let n=this[L];n._closeFrameReceived=!0,n._closeMessage=e,n._closeCode=t,n._socket[L]!==void 0&&
307
+ (n._socket.removeListener("data",Dt),process.nextTick(Bo,n._socket),t===1005?n.close():n.close(t,e))}function vc(){let t=this[L];
308
+ t.isPaused||t._socket.resume()}function wc(t){let e=this[L];e._socket[L]!==void 0&&(e._socket.removeListener("data",Dt),
309
+ process.nextTick(Bo,e._socket),e.close(t[ac])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",t))}function Lo(){this[L].
310
+ emitClose()}function yc(t,e){this[L].emit("message",t,e)}function Ic(t){let e=this[L];e._autoPong&&e.pong(t,!this._isServer,
311
+ Fo),e.emit("ping",t)}function Sc(t){this[L].emit("pong",t)}function Bo(t){t.resume()}function xc(t){let e=this[L];e.readyState!==
312
312
  k.CLOSED&&(e.readyState===k.OPEN&&(e._readyState=k.CLOSING,Ho(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,
313
313
  e.emit("error",t)))}function Ho(t){t._closeTimer=setTimeout(t._socket.destroy.bind(t._socket),t._closeTimeout)}function Vo(){
314
314
  let t=this[L];if(this.removeListener("close",Vo),this.removeListener("data",Dt),this.removeListener("end",Go),t._readyState=
@@ -317,9 +317,9 @@ length!==0){let e=this.read(this._readableState.length);t._receiver.write(e)}t._
317
317
  t._closeTimer),t._receiver._writableState.finished||t._receiver._writableState.errorEmitted?t.emitClose():(t._receiver.on(
318
318
  "error",Lo),t._receiver.on("finish",Lo))}function Dt(t){this[L]._receiver.write(t)||this.pause()}function Go(){let t=this[L];
319
319
  t._readyState=k.CLOSING,t._receiver.end(),this.end()}function Wo(){let t=this[L];this.removeListener("error",Wo),this.on(
320
- "error",Fo),t&&(t._readyState=k.CLOSING,this.destroy())}});var Zo=$((km,Yo)=>{"use strict";var Pm=zt(),{Duplex:xc}=M("stream");function Jo(t){t.emit("close")}function bc(){!this.destroyed&&
320
+ "error",Fo),t&&(t._readyState=k.CLOSING,this.destroy())}});var Zo=$((Nm,Yo)=>{"use strict";var Mm=zt(),{Duplex:Tc}=M("stream");function Jo(t){t.emit("close")}function bc(){!this.destroyed&&
321
321
  this._writableState.finished&&this.destroy()}function Xo(t){this.removeListener("error",Xo),this.destroy(),this.listenerCount(
322
- "error")===0&&this.emit("error",t)}function Tc(t,e){let n=!0,r=new xc({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});
322
+ "error")===0&&this.emit("error",t)}function _c(t,e){let n=!0,r=new Tc({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});
323
323
  return t.on("message",function(s,i){let a=!i&&r._readableState.objectMode?s.toString():s;r.push(a)||t.pause()}),t.once("\
324
324
  error",function(s){r.destroyed||(n=!1,r.destroy(s))}),t.once("close",function(){r.destroyed||r.push(null)}),r._destroy=function(o,s){
325
325
  if(t.readyState===t.CLOSED){s(o),process.nextTick(Jo,r);return}let i=!1;t.once("error",function(c){i=!0,s(c)}),t.once("c\
@@ -327,21 +327,21 @@ lose",function(){i||s(o),process.nextTick(Jo,r)}),n&&t.terminate()},r._final=fun
327
327
  t.once("open",function(){r._final(o)});return}t._socket!==null&&(t._socket._writableState.finished?(o(),r._readableState.
328
328
  endEmitted&&r.destroy()):(t._socket.once("finish",function(){o()}),t.close()))},r._read=function(){t.isPaused&&t.resume()},
329
329
  r._write=function(o,s,i){if(t.readyState===t.CONNECTING){t.once("open",function(){r._write(o,s,i)});return}t.send(o,i)},
330
- r.on("end",bc),r.on("error",Xo),r}Yo.exports=Tc});var jr=$((Mm,Qo)=>{"use strict";var{tokenChars:Cc}=Pe();function _c(t){let e=new Set,n=-1,r=-1,o=0;for(o;o<t.length;o++){
330
+ r.on("end",bc),r.on("error",Xo),r}Yo.exports=_c});var jr=$((jm,Qo)=>{"use strict";var{tokenChars:Cc}=Pe();function Ac(t){let e=new Set,n=-1,r=-1,o=0;for(o;o<t.length;o++){
331
331
  let i=t.charCodeAt(o);if(r===-1&&Cc[i]===1)n===-1&&(n=o);else if(o!==0&&(i===32||i===9))r===-1&&n!==-1&&(r=o);else if(i===
332
332
  44){if(n===-1)throw new SyntaxError(`Unexpected character at index ${o}`);r===-1&&(r=o);let a=t.slice(n,r);if(e.has(a))throw new SyntaxError(
333
333
  `The "${a}" subprotocol is duplicated`);e.add(a),n=r=-1}else throw new SyntaxError(`Unexpected character at index ${o}`)}
334
334
  if(n===-1||r!==-1)throw new SyntaxError("Unexpected end of input");let s=t.slice(n,o);if(e.has(s))throw new SyntaxError(
335
- `The "${s}" subprotocol is duplicated`);return e.add(s),e}Qo.exports={parse:_c}});var is=$((jm,ss)=>{"use strict";var Ac=M("events"),Lt=M("http"),{Duplex:Nm}=M("stream"),{createHash:Ec}=M("crypto"),es=Mt(),
336
- Ie=Re(),Oc=jr(),Rc=zt(),{CLOSE_TIMEOUT:Pc,GUID:kc,kWebSocket:Mc}=te(),Nc=/^[+/0-9A-Za-z]{22}==$/,ts=0,rs=1,os=2,Dr=class extends Ac{constructor(e,n){
335
+ `The "${s}" subprotocol is duplicated`);return e.add(s),e}Qo.exports={parse:Ac}});var is=$((zm,ss)=>{"use strict";var Ec=M("events"),Lt=M("http"),{Duplex:Dm}=M("stream"),{createHash:Oc}=M("crypto"),es=Mt(),
336
+ Ie=Re(),Rc=jr(),Pc=zt(),{CLOSE_TIMEOUT:kc,GUID:Mc,kWebSocket:Nc}=te(),jc=/^[+/0-9A-Za-z]{22}==$/,ts=0,rs=1,os=2,Dr=class extends Ec{constructor(e,n){
337
337
  if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxBufferedChunks:256*1024,maxFragments:16*1024,maxPayload:100*1024*
338
- 1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:Pc,verifyClient:null,
339
- noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:Rc,...e},e.port==null&&!e.server&&!e.noServer||
338
+ 1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:kc,verifyClient:null,
339
+ noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:Pc,...e},e.port==null&&!e.server&&!e.noServer||
340
340
  e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server"\
341
341
  , or "noServer" options must be specified');if(e.port!=null?(this._server=Lt.createServer((r,o)=>{let s=Lt.STATUS_CODES[426];
342
342
  o.writeHead(426,{"Content-Length":s.length,"Content-Type":"text/plain"}),o.end(s)}),this._server.listen(e.port,e.host,e.
343
343
  backlog,n)):e.server&&(this._server=e.server),this._server){let r=this.emit.bind(this,"connection");this._removeListeners=
344
- jc(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(o,s,i)=>{this.handleUpgrade(
344
+ Dc(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(o,s,i)=>{this.handleUpgrade(
345
345
  o,s,i,r)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=
346
346
  !1),this.options=e,this._state=ts}address(){if(this.options.noServer)throw new Error('The server is operating in "noServ\
347
347
  er" mode');return this._server?this._server.address():null}close(e){if(this._state===os){e&&this.once("close",()=>{e(new Error(
@@ -352,19 +352,19 @@ _server;this._removeListeners(),this._removeListeners=this._server=null,n.close(
352
352
  options.path){let n=e.url.indexOf("?");if((n!==-1?e.url.slice(0,n):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,n,r,o){
353
353
  n.on("error",ns);let s=e.headers["sec-websocket-key"],i=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!==
354
354
  "GET"){Se(this,e,n,405,"Invalid HTTP method");return}if(i===void 0||i.toLowerCase()!=="websocket"){Se(this,e,n,400,"Inva\
355
- lid Upgrade header");return}if(s===void 0||!Nc.test(s)){Se(this,e,n,400,"Missing or invalid Sec-WebSocket-Key header");return}
355
+ lid Upgrade header");return}if(s===void 0||!jc.test(s)){Se(this,e,n,400,"Missing or invalid Sec-WebSocket-Key header");return}
356
356
  if(a!==13&&a!==8){Se(this,e,n,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}
357
- if(!this.shouldHandle(e)){nt(n,400);return}let c=e.headers["sec-websocket-protocol"],d=new Set;if(c!==void 0)try{d=Oc.parse(
357
+ if(!this.shouldHandle(e)){nt(n,400);return}let c=e.headers["sec-websocket-protocol"],d=new Set;if(c!==void 0)try{d=Rc.parse(
358
358
  c)}catch{Se(this,e,n,400,"Invalid Sec-WebSocket-Protocol header");return}let p=e.headers["sec-websocket-extensions"],m={};
359
359
  if(this.options.perMessageDeflate&&p!==void 0){let l=new Ie({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.
360
360
  options.maxPayload});try{let v=es.parse(p);v[Ie.extensionName]&&(l.accept(v[Ie.extensionName]),m[Ie.extensionName]=l)}catch{
361
361
  Se(this,e,n,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let l={
362
362
  origin:e.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.
363
- options.verifyClient.length===2){this.options.verifyClient(l,(v,x,b,O)=>{if(!v)return nt(n,x||401,b,O);this.completeUpgrade(
363
+ options.verifyClient.length===2){this.options.verifyClient(l,(v,x,T,O)=>{if(!v)return nt(n,x||401,T,O);this.completeUpgrade(
364
364
  m,s,d,e,n,r,o)});return}if(!this.options.verifyClient(l))return nt(n,401)}this.completeUpgrade(m,s,d,e,n,r,o)}completeUpgrade(e,n,r,o,s,i,a){
365
- if(!s.readable||!s.writable)return s.destroy();if(s[Mc])throw new Error("server.handleUpgrade() was called more than onc\
365
+ if(!s.readable||!s.writable)return s.destroy();if(s[Nc])throw new Error("server.handleUpgrade() was called more than onc\
366
366
  e with the same socket, possibly due to a misconfiguration");if(this._state>ts)return nt(s,503);let d=["HTTP/1.1 101 Swi\
367
- tching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${Ec("sha1").update(n+kc).digest("ba\
367
+ tching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${Oc("sha1").update(n+Mc).digest("ba\
368
368
  se64")}`],p=new this.options.WebSocket(null,void 0,this.options);if(r.size){let m=this.options.handleProtocols?this.options.
369
369
  handleProtocols(r,o):r.values().next().value;m&&(d.push(`Sec-WebSocket-Protocol: ${m}`),p._protocol=m)}if(e[Ie.extensionName]){
370
370
  let m=e[Ie.extensionName].params,l=es.format({[Ie.extensionName]:[m]});d.push(`Sec-WebSocket-Extensions: ${l}`),p._extensions=
@@ -373,7 +373,7 @@ e}this.emit("headers",d,o),s.write(d.concat(`\r
373
373
  `)),s.removeListener("error",ns),p.setSocket(s,i,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxBufferedChunks:this.
374
374
  options.maxBufferedChunks,maxFragments:this.options.maxFragments,maxPayload:this.options.maxPayload,skipUTF8Validation:this.
375
375
  options.skipUTF8Validation}),this.clients&&(this.clients.add(p),p.on("close",()=>{this.clients.delete(p),this._shouldEmitClose&&
376
- !this.clients.size&&process.nextTick(rt,this)})),a(p,o)}};ss.exports=Dr;function jc(t,e){for(let n of Object.keys(e))t.on(
376
+ !this.clients.size&&process.nextTick(rt,this)})),a(p,o)}};ss.exports=Dr;function Dc(t,e){for(let n of Object.keys(e))t.on(
377
377
  n,e[n]);return function(){for(let r of Object.keys(e))t.removeListener(r,e[r])}}function rt(t){t._state=os,t.emit("close")}
378
378
  function ns(){this.destroy()}function nt(t,e,n,r){n=n||Lt.STATUS_CODES[e],r={Connection:"close","Content-Type":"text/htm\
379
379
  l","Content-Length":Buffer.byteLength(n),...r},t.once("finish",t.destroy),t.end(`HTTP/1.1 ${e} ${Lt.STATUS_CODES[e]}\r
@@ -382,114 +382,114 @@ l","Content-Length":Buffer.byteLength(n),...r},t.once("finish",t.destroy),t.end(
382
382
  \r
383
383
  `+n)}function Se(t,e,n,r,o,s){if(t.listenerCount("wsClientError")){let i=new Error(o);Error.captureStackTrace(i,Se),t.emit(
384
384
  "wsClientError",i,n,e)}else nt(n,r,o,s)}});function I(t){return String(t??"").trim()}function yt(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=Object.getPrototypeOf(t);return e===Object.prototype||
385
- e===null}var Bp=Object.freeze(["none","pending","committed","rolledBack","unknown"]);function _(t,{fallback:e=""}={}){return String(t||"").trim()||e}function A(t){return!!(t&&typeof t=="object"&&!Array.isArray(t))}function V(t,{fallback:e=0}={}){let n=Number(t);return!Number.isInteger(n)||n<1?e:n}var Vp=Object.freeze({interrupted:Object.freeze({text:"Stopped.",messageCode:"assistant.turn.stopped"}),failed:Object.freeze(
385
+ e===null}var Vp=Object.freeze(["none","pending","committed","rolledBack","unknown"]);function C(t,{fallback:e=""}={}){return String(t||"").trim()||e}function A(t){return!!(t&&typeof t=="object"&&!Array.isArray(t))}function V(t,{fallback:e=0}={}){let n=Number(t);return!Number.isInteger(n)||n<1?e:n}var Wp=Object.freeze({interrupted:Object.freeze({text:"Stopped.",messageCode:"assistant.turn.stopped"}),failed:Object.freeze(
386
386
  {text:"Assistant stopped with an error.",messageCode:"assistant.turn.failed"})});function It(t){return A(t)?{...t}:{}}var N=class extends Error{constructor(e,n,r={}){super(n,r.cause===void 0?void 0:{cause:r.cause}),this.name="AppError",this.
387
387
  status=Number(e)||500,this.statusCode=this.status,this.code=r.code||"APP_ERROR",this.params=It(r.params),r.messageCode&&
388
388
  (this.messageCode=String(r.messageCode),this.messageParams=It(r.messageParams)),this.details=r.details,this.headers=r.headers||
389
- {}}};var Sf=new Set(["contextcompaction",...["context","thread","conversation"].flatMap(t=>["compact","compacted","compaction",
389
+ {}}};var Tf=new Set(["contextcompaction",...["context","thread","conversation"].flatMap(t=>["compact","compacted","compaction",
390
390
  "truncate","truncated","truncation"].flatMap(e=>[`${t}_${e}`,`${e}_${t}`]))]);var F=Object.freeze({ACTIVE:"active",CANCELLED:"cancelled",COMPLETED:"completed",FAILED:"failed",FINALIZING:"finalizing",
391
- INTERRUPTED:"interrupted",STARTING:"starting",TIMED_OUT:"timed_out"}),Ef=new Set(Object.values(F)),Of=new Set([F.CANCELLED,
392
- F.COMPLETED,F.FAILED,F.INTERRUPTED,F.TIMED_OUT]),Rf=new Set([F.ACTIVE,F.FINALIZING,F.STARTING]);import{execFile as na}from"node:child_process";import{readFile as fr,readdir as oa}from"node:fs/promises";import{setTimeout as eo}from"node:timers/promises";import{promisify as sa}from"node:util";var ia=sa(na);async function aa(t){
393
- let{stdout:e}=await ia("ps",t,{env:{...process.env,LC_ALL:"C",TZ:"UTC"},maxBuffer:67108864});return e}function bt({runtimeTokenEnvironmentName:t="\
391
+ INTERRUPTED:"interrupted",STARTING:"starting",TIMED_OUT:"timed_out"}),Rf=new Set(Object.values(F)),Pf=new Set([F.CANCELLED,
392
+ F.COMPLETED,F.FAILED,F.INTERRUPTED,F.TIMED_OUT]),kf=new Set([F.ACTIVE,F.FINALIZING,F.STARTING]);import{execFile as oa}from"node:child_process";import{readFile as fr,readdir as sa}from"node:fs/promises";import{setTimeout as eo}from"node:timers/promises";import{promisify as ia}from"node:util";var aa=ia(oa);async function ca(t){
393
+ let{stdout:e}=await aa("ps",t,{env:{...process.env,LC_ALL:"C",TZ:"UTC"},maxBuffer:67108864});return e}function Tt({runtimeTokenEnvironmentName:t="\
394
394
  JSKIT_EXECUTION_RUNTIME_TOKEN",commandHashEnvironmentName:e="JSKIT_EXECUTION_COMMAND_HASH",label:n="Native",unavailableCode:r="\
395
- native_process_identity_unavailable",platform:o=process.platform,ps:s=aa}={}){let a=o==="darwin"?100:25,c=1,d=Object.freeze(
395
+ native_process_identity_unavailable",platform:o=process.platform,ps:s=ca}={}){let a=o==="darwin"?100:25,c=1,d=Object.freeze(
396
396
  {linux:"linux-proc",darwin:"darwin"}),p=d[o]||"",m=Object.freeze({RUNNING:"running",STOPPED:"stopped"}),l=Object.freeze(
397
397
  {ABSENT:"absent",AMBIGUOUS:"ambiguous",EXACT:"exact",INVALID:"invalid",MISMATCH:"mismatch"});function v(w={}){return!!(Number.
398
398
  isSafeInteger(Number(w.pid))&&Number(w.pid)>0&&D(w.processIdentity)&&[m.RUNNING,m.STOPPED].includes(w.processState))}function x(w){
399
- let u=Number(w);if(!Number.isSafeInteger(u)||u<=0)return!1;try{return process.kill(u,0),!0}catch{return!1}}function b(w){
399
+ let u=Number(w);if(!Number.isSafeInteger(u)||u<=0)return!1;try{return process.kill(u,0),!0}catch{return!1}}function T(w){
400
400
  let u=Number(w);if(!Number.isSafeInteger(u)||u<=0)return!1;if(process.platform==="win32")return x(u);try{return process.
401
401
  kill(-u,0),!0}catch{return!1}}function O(w,u){let f=Number(w),h=process.platform==="win32"?f:-f;try{return process.kill(
402
402
  h,u),!0}catch(g){if(!["ESRCH","EPERM"].includes(String(g?.code||"")))throw g;return!1}}function P(w=""){let u=String(w||
403
403
  ""),f=u.lastIndexOf(")");if(f<0)return null;let h=u.slice(f+1).trim().split(/\s+/u),g=String(h[0]||""),y=Number(h[1]),S=Number(
404
- h[2]),T=String(h[19]||"");return!/^[A-Z]$/u.test(g)||!Number.isSafeInteger(y)||y<0||!Number.isSafeInteger(S)||S<=0||!/^\d+$/u.
405
- test(T)?null:{parentPid:y,processGroupId:S,startTimeTicks:T,state:g}}function j(w={}){let u=A(w)?w:{};return{commandHash:I(
404
+ h[2]),b=String(h[19]||"");return!/^[A-Z]$/u.test(g)||!Number.isSafeInteger(y)||y<0||!Number.isSafeInteger(S)||S<=0||!/^\d+$/u.
405
+ test(b)?null:{parentPid:y,processGroupId:S,startTimeTicks:b,state:g}}function j(w={}){let u=A(w)?w:{};return{commandHash:I(
406
406
  u.commandHash),platform:I(u.platform),runtimeToken:I(u.runtimeToken),startTimeTicks:I(u.startTimeTicks),version:Number(u.
407
407
  version||0)}}function D(w={}){let u=j(w);return!!(u.version===c&&Object.values(d).includes(u.platform)&&/^[a-f0-9]{12}$/u.
408
408
  test(u.commandHash)&&/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu.test(u.runtimeToken)&&/^\d+$/u.
409
409
  test(u.startTimeTicks))}function U(w=[],u=""){let f=w.find(h=>h.startsWith(`${u}=`));return f?f.slice(u.length+1):""}async function J(){
410
- let w=[],u=await oa("/proc",{withFileTypes:!0}).catch(()=>[]);for(let f of u){if(!f.isDirectory()||!/^\d+$/u.test(f.name))
410
+ let w=[],u=await sa("/proc",{withFileTypes:!0}).catch(()=>[]);for(let f of u){if(!f.isDirectory()||!/^\d+$/u.test(f.name))
411
411
  continue;let h=Number(f.name),g=await fr(`/proc/${f.name}/stat`,"utf8").catch(()=>""),y=P(g);if(!y||y.state==="Z")continue;
412
- let S=null,T=!0;try{S=await fr(`/proc/${f.name}/environ`)}catch(E){if(String(E?.code||"")==="ENOENT")continue;T=!1}let R=T?
413
- S.toString("utf8").split("\0"):[];w.push({...y,commandHash:U(R,e),environmentReadable:T,pid:h,runtimeToken:U(R,t)})}return w}
412
+ let S=null,b=!0;try{S=await fr(`/proc/${f.name}/environ`)}catch(E){if(String(E?.code||"")==="ENOENT")continue;b=!1}let R=b?
413
+ S.toString("utf8").split("\0"):[];w.push({...y,commandHash:U(R,e),environmentReadable:b,pid:h,runtimeToken:U(R,t)})}return w}
414
414
  let H=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function q(w=""){let u=/^\w{3}\s+(\w{3})\s+(\d{1,2})\s+(\d{2}):(\d{2}):(\d{2})\s+(\d{4})$/u.
415
- exec(String(w).trim()),f=u?H.indexOf(u[1]):-1;if(f<0)return"";let[,,h,g,y,S,T]=u.map(Number);return String(Date.UTC(T,f,
415
+ exec(String(w).trim()),f=u?H.indexOf(u[1]):-1;if(f<0)return"";let[,,h,g,y,S,b]=u.map(Number);return String(Date.UTC(b,f,
416
416
  h,g,y,S)/1e3)}function ae(w=""){let u=new Map;for(let f of String(w).split(`
417
417
  `)){let h=/^\s*(\d+) (.*)$/u.exec(f);h&&u.set(Number(h[1]),h[2])}return u}function me(w,u){if(w===void 0||!u?.startsWith(
418
418
  w))return null;let f=u.slice(w.length).split(/\s+/u).filter(h=>/^[^=\s]+=/u.test(h));return f.length?f:null}async function We(){
419
419
  let w=process.getuid(),u=["-x","-U",String(w),"-ww","-o","pid=,command="],[f,h,g]=await Promise.all([s(["-ax","-o","pid=\
420
- ,pgid=,uid=,stat=,lstart="]),s(u),s(["-E",...u])]),y=ae(h),S=ae(g),T=[];for(let R of String(f).split(`
420
+ ,pgid=,uid=,stat=,lstart="]),s(u),s(["-E",...u])]),y=ae(h),S=ae(g),b=[];for(let R of String(f).split(`
421
421
  `)){let E=/^\s*(\d+)\s+(\d+)\s+(\d+)\s+(\S+)\s+(\w{3}\s+\w{3}\s+\d{1,2}\s+[\d:]{8}\s+\d{4})\s*$/u.exec(R);if(!E||E[4].startsWith(
422
- "Z"))continue;let X=Number(E[1]),Y=Number(E[3])===w?me(y.get(X),S.get(X)):null;T.push({commandHash:U(Y||[],e),environmentReadable:!!Y,
423
- pid:X,processGroupId:Number(E[2]),runtimeToken:U(Y||[],t),startTimeTicks:q(E[5])})}return T}function ht(w){let u=Object.
422
+ "Z"))continue;let X=Number(E[1]),Y=Number(E[3])===w?me(y.get(X),S.get(X)):null;b.push({commandHash:U(Y||[],e),environmentReadable:!!Y,
423
+ pid:X,processGroupId:Number(E[2]),runtimeToken:U(Y||[],t),startTimeTicks:q(E[5])})}return b}function ht(w){let u=Object.
424
424
  values(l).includes(w?.status)?w.status:l.AMBIGUOUS;return{processGroupIds:[...new Set((Array.isArray(w?.processGroupIds)?
425
425
  w.processGroupIds:[]).map(Number).filter(f=>Number.isSafeInteger(f)&&f>0))],status:u}}async function gt(w={}){if(!v(w))return{
426
426
  processGroupIds:[],status:l.INVALID};if(w.processState===m.STOPPED)return{processGroupIds:[],status:l.ABSENT};let u=w.processIdentity,
427
427
  f=u.platform!==p?null:o==="darwin"?await We().catch(()=>null):await J();if(!f)return{processGroupIds:[],status:l.AMBIGUOUS};
428
428
  let h=Number(w.pid),g=f.filter(({processGroupId:E})=>E===h),y=[],S=g.some(({environmentReadable:E})=>!E);for(let E of f)
429
- E.environmentReadable&&E.runtimeToken===u.runtimeToken&&E.commandHash===u.commandHash&&y.push(E);let T=y.find(({pid:E})=>E===
430
- h);if(T&&T.startTimeTicks!==u.startTimeTicks)return{processGroupIds:[],status:l.AMBIGUOUS};if(y.length===0)return S?{processGroupIds:[],
431
- status:l.AMBIGUOUS}:{processGroupIds:[],status:g.length>0||b(h)?l.MISMATCH:l.ABSENT};let R=[...new Set(y.map(({processGroupId:E})=>E))];
432
- for(let E of R)if(f.filter(Y=>Y.processGroupId===E).some(Y=>!Y.environmentReadable||!y.some(({pid:Ji})=>Ji===Y.pid)))return{
429
+ E.environmentReadable&&E.runtimeToken===u.runtimeToken&&E.commandHash===u.commandHash&&y.push(E);let b=y.find(({pid:E})=>E===
430
+ h);if(b&&b.startTimeTicks!==u.startTimeTicks)return{processGroupIds:[],status:l.AMBIGUOUS};if(y.length===0)return S?{processGroupIds:[],
431
+ status:l.AMBIGUOUS}:{processGroupIds:[],status:g.length>0||T(h)?l.MISMATCH:l.ABSENT};let R=[...new Set(y.map(({processGroupId:E})=>E))];
432
+ for(let E of R)if(f.filter(Y=>Y.processGroupId===E).some(Y=>!Y.environmentReadable||!y.some(({pid:Xi})=>Xi===Y.pid)))return{
433
433
  processGroupIds:[],status:l.AMBIGUOUS};return g.some(E=>!y.some(({pid:X})=>X===E.pid))?{processGroupIds:[],status:l.AMBIGUOUS}:
434
434
  {processGroupIds:R,status:l.EXACT}}async function he(w={},u={}){let f=u.processIdentityInspector??gt;return ht(await f(w))}
435
435
  async function vt(w={},u={},f=0){let h=Date.now()+f,g=await he(w,u);for(;Date.now()<h&&g.status===l.EXACT;)await eo(100),
436
- g=await he(w,u);return g}async function _e(w={},u={}){let f=V(u.processIdentitySettleTimeoutMs,{fallback:1e3}),h=V(u.processIdentitySettlePollMs,
436
+ g=await he(w,u);return g}async function Ce(w={},u={}){let f=V(u.processIdentitySettleTimeoutMs,{fallback:1e3}),h=V(u.processIdentitySettlePollMs,
437
437
  {fallback:a}),g=Date.now()+f,y=await he(w,u);for(;y.status===l.AMBIGUOUS&&Date.now()<g;)await eo(Math.min(h,Math.max(1,g-
438
- Date.now()))),y=await he(w,u);return y}async function wt(w={},u="SIGTERM",f={}){let h=f.signalProcessGroup??O,g=await _e(
438
+ Date.now()))),y=await he(w,u);return y}async function wt(w={},u="SIGTERM",f={}){let h=f.signalProcessGroup??O,g=await Ce(
439
439
  w,f);if(g.status!==l.EXACT)return{inspection:g,signaledProcessGroups:[]};let y=Number(w.pid),S=[...g.processGroupIds.filter(
440
- R=>R!==y),...g.processGroupIds.filter(R=>R===y)],T=[];for(let R of S){let E=await _e(w,f);if(E.status===l.ABSENT||E.status===
441
- l.MISMATCH)return{inspection:E,signaledProcessGroups:T};if(E.status!==l.EXACT)return{inspection:E,signaledProcessGroups:T};
442
- E.processGroupIds.includes(R)&&(h(R,u),T.push(R))}return{inspection:await _e(w,f),signaledProcessGroups:T}}async function ar(w={},u={}){
440
+ R=>R!==y),...g.processGroupIds.filter(R=>R===y)],b=[];for(let R of S){let E=await Ce(w,f);if(E.status===l.ABSENT||E.status===
441
+ l.MISMATCH)return{inspection:E,signaledProcessGroups:b};if(E.status!==l.EXACT)return{inspection:E,signaledProcessGroups:b};
442
+ E.processGroupIds.includes(R)&&(h(R,u),b.push(R))}return{inspection:await Ce(w,f),signaledProcessGroups:b}}async function ar(w={},u={}){
443
443
  if(!v(w))return{identityStatus:l.INVALID,processExitVerified:!1,stopped:!1};if(w.processState===m.STOPPED&&w.processExitVerifiedAt)
444
- return{alreadyStopped:!0,identityStatus:l.ABSENT,processExitVerified:!0,stopped:!1};let f=await _e(w,u);if(f.status===l.
444
+ return{alreadyStopped:!0,identityStatus:l.ABSENT,processExitVerified:!0,stopped:!1};let f=await Ce(w,u);if(f.status===l.
445
445
  ABSENT||f.status===l.MISMATCH)return{identityStatus:f.status,processExitVerified:!0,stopped:!1};if(f.status!==l.EXACT)return{
446
446
  identityStatus:f.status,processExitVerified:!1,stopped:!1};let h=await wt(w,"SIGTERM",u);if(h.inspection.status===l.AMBIGUOUS)
447
447
  return{identityStatus:h.inspection.status,processExitVerified:!1,signaledProcessGroups:h.signaledProcessGroups,stopped:!1};
448
- let g=await vt(w,u,V(u.termTimeoutMs,{fallback:3e3})),y=[...h.signaledProcessGroups];if(g.status===l.EXACT){let T=await wt(
449
- w,"SIGKILL",u);if(y=[...new Set([...y,...T.signaledProcessGroups])],T.inspection.status===l.AMBIGUOUS)return{identityStatus:T.
448
+ let g=await vt(w,u,V(u.termTimeoutMs,{fallback:3e3})),y=[...h.signaledProcessGroups];if(g.status===l.EXACT){let b=await wt(
449
+ w,"SIGKILL",u);if(y=[...new Set([...y,...b.signaledProcessGroups])],b.inspection.status===l.AMBIGUOUS)return{identityStatus:b.
450
450
  inspection.status,processExitVerified:!1,signaledProcessGroups:y,stopped:!1};g=await vt(w,u,V(u.killTimeoutMs,{fallback:1e3}))}
451
- let S=[l.ABSENT,l.MISMATCH].includes(g.status);return{descendantProcessGroups:y.filter(T=>T!==Number(w.pid)),identityStatus:g.
451
+ let S=[l.ABSENT,l.MISMATCH].includes(g.status);return{descendantProcessGroups:y.filter(b=>b!==Number(w.pid)),identityStatus:g.
452
452
  status,pid:Number(w.pid),processExitVerified:S,signaledProcessGroups:y,stopped:S&&y.length>0}}async function cr(w){if(o!==
453
453
  "darwin")return P(await fr(`/proc/${w}/stat`,"utf8").catch(()=>""));let u=String(await s(["-o","pgid=,lstart=","-p",String(
454
454
  w)]).catch(()=>"")),f=/^\s*(\d+)\s+(.+?)\s*$/u.exec(u);return f?{processGroupId:Number(f[1]),startTimeTicks:q(f[2])}:null}
455
455
  async function dr({commandHash:w="",pid:u=null,reportedIdentity:f=null,runtimeToken:h=""}={}){let g=I(w),y=I(h),S=j(f);if(D(
456
- S)&&S.commandHash===g&&S.runtimeToken===y)return S;let T=Number(u),R=p&&Number.isSafeInteger(T)&&T>0?await cr(T):null;if(!R?.
457
- startTimeTicks||R.processGroupId!==T){let E=new Error(`${n} process identity could not be captured.`);throw E.code=r,E}return{
456
+ S)&&S.commandHash===g&&S.runtimeToken===y)return S;let b=Number(u),R=p&&Number.isSafeInteger(b)&&b>0?await cr(b):null;if(!R?.
457
+ startTimeTicks||R.processGroupId!==b){let E=new Error(`${n} process identity could not be captured.`);throw E.code=r,E}return{
458
458
  commandHash:g,platform:p,runtimeToken:y,startTimeTicks:R.startTimeTicks,version:c}}return Object.freeze({normalize:j,isValid:D,
459
- normalizeInspection:ht,capture:dr,inspect:he,stop:ar,isProcessAlive:x})}import{execFile as da}from"node:child_process";import{promisify as ua}from"node:util";var Gf=Object.freeze(["plugins","apps","daemon_auto_start"]);var Wf=Object.freeze([[".tmp",/^(?:plugins(?:$|[.-])|git-|bundled-marketplaces$)/u],["cache",/^(?:remote_plugin_catalog|codex_apps_tools|codex_apps_server_info|codex_app_directory|bundled_plugin_exclusions)$/u]]);var Qf=ua(da);function ge(t=""){return Array.from(String(t)).some(e=>{let n=e.codePointAt(0);return n<=31||n===127})}var Tt=(t,e,n,r={})=>Object.freeze({id:t,contextWindow:e,variants:Object.freeze(n),...r}),la=Object.freeze([Object.freeze(
459
+ normalizeInspection:ht,capture:dr,inspect:he,stop:ar,isProcessAlive:x})}import{execFile as ua}from"node:child_process";import{promisify as la}from"node:util";var Kf=Object.freeze(["plugins","apps","daemon_auto_start"]);var Jf=Object.freeze([[".tmp",/^(?:plugins(?:$|[.-])|git-|bundled-marketplaces$)/u],["cache",/^(?:remote_plugin_catalog|codex_apps_tools|codex_apps_server_info|codex_app_directory|bundled_plugin_exclusions)$/u]]);var tm=la(ua);function ge(t=""){return Array.from(String(t)).some(e=>{let n=e.codePointAt(0);return n<=31||n===127})}var bt=(t,e,n,r={})=>Object.freeze({id:t,contextWindow:e,variants:Object.freeze(n),...r}),pa=Object.freeze([Object.freeze(
460
460
  {id:"deepseek",baseUrl:"https://api.deepseek.com/",claudeBaseUrl:"https://api.deepseek.com/anthropic",claudeAutoCompactWindow:786432,
461
- webSearch:!1,models:Object.freeze([Tt("deepseek-flash",1048576,["low","high","max"],{images:!0,freeformPatch:!0,codexHistoryRouting:!0}),
462
- Tt("deepseek-v4-pro",1048576,["low","high","max"],{freeformPatch:!0,codexHistoryRouting:!0})])}),Object.freeze({id:"zai-\
461
+ webSearch:!1,models:Object.freeze([bt("deepseek-flash",1048576,["low","high","max"],{images:!0,freeformPatch:!0,codexHistoryRouting:!0}),
462
+ bt("deepseek-v4-pro",1048576,["low","high","max"],{freeformPatch:!0,codexHistoryRouting:!0})])}),Object.freeze({id:"zai-\
463
463
  coding-plan",baseUrl:"https://api.z.ai/api/v1",claudeBaseUrl:"https://api.z.ai/api/anthropic",claudeAutoCompactWindow:1e6,
464
- webSearch:!1,models:Object.freeze([Tt("glm-5.3",1048576,["low","high","max"],{freeformPatch:!0,codexHistoryRouting:!0})])}),
464
+ webSearch:!1,models:Object.freeze([bt("glm-5.3",1048576,["low","high","max"],{freeformPatch:!0,codexHistoryRouting:!0})])}),
465
465
  Object.freeze({id:"zai",baseUrl:"https://api.z.ai/api/v1",claudeBaseUrl:"https://api.z.ai/api/anthropic",claudeAutoCompactWindow:1e6,
466
- webSearch:!1,models:Object.freeze([Tt("glm-5.3",1048576,["low","high","max"],{freeformPatch:!0,codexHistoryRouting:!0})])})]);function Je(t){return la.find(e=>e.id===t)||null}var sm=32*1024*1024,im=Object.freeze({chatgpt:"https://chatgpt.com/backend-api/codex",apiKey:"https://api.openai.com/v1",
467
- deepseek:Je("deepseek").baseUrl.replace(/\/$/u,""),"zai-coding-plan":Je("zai-coding-plan").baseUrl,zai:Je("zai").baseUrl});var mr=Object.freeze({HELPER:"helper",INTERACTIVE:"interactive"}),gm=bt();var hr=Object.freeze({UNIX:"unix"});var fa=process.platform==="linux"?107:103,to=Object.freeze({MISSING:"missing",RESPONSIVE:"responsive",TIMEOUT:"timeout",
468
- UNREACHABLE:"unreachable"}),ma=Object.freeze({EXITED:"exited",INCOMPATIBLE:"incompatible",LIVE:"live",MISSING:"missing",
466
+ webSearch:!1,models:Object.freeze([bt("glm-5.3",1048576,["low","high","max"],{freeformPatch:!0,codexHistoryRouting:!0})])})]);function Je(t){return pa.find(e=>e.id===t)||null}var am=32*1024*1024,cm=Object.freeze({chatgpt:"https://chatgpt.com/backend-api/codex",apiKey:"https://api.openai.com/v1",
467
+ deepseek:Je("deepseek").baseUrl.replace(/\/$/u,""),"zai-coding-plan":Je("zai-coding-plan").baseUrl,zai:Je("zai").baseUrl});var mr=Object.freeze({HELPER:"helper",INTERACTIVE:"interactive"}),wm=Tt();var hr=Object.freeze({UNIX:"unix"});var ma=process.platform==="linux"?107:103,to=Object.freeze({MISSING:"missing",RESPONSIVE:"responsive",TIMEOUT:"timeout",
468
+ UNREACHABLE:"unreachable"}),ha=Object.freeze({EXITED:"exited",INCOMPATIBLE:"incompatible",LIVE:"live",MISSING:"missing",
469
469
  SUSPECT:"suspect"}),Xe=Object.freeze({RUNNING:"running",STOPPED:"stopped"}),ro=Object.freeze({ABSENT:"absent",AMBIGUOUS:"\
470
- ambiguous",EXACT:"exact",INVALID:"invalid",MISMATCH:"mismatch"});var ha=Object.freeze({runtimeToken:"JSKIT_EXECUTION_RUNTIME_TOKEN",modelCatalogSource:"JSKIT_CODEX_MODEL_CATALOG_SOURCE",
471
- commandHash:"JSKIT_EXECUTION_COMMAND_HASH"});var Dc=ce(Zo(),1),zc=ce(Mt(),1),Lc=ce(Re(),1),Uc=ce(_r(),1),Fc=ce(Or(),1),qc=ce(jr(),1),$c=ce(zt(),1),Bc=ce(is(),1);var Dg=32*1024,zg=2*1024*1024;var Gt=Object.freeze({ACTIVE:"active",CLEANUP_REQUIRED:"cleanup_required",READY:"ready",STARTING_TURN:"starting_turn"}),
472
- sv=new Set(Object.values(Gt)),iv=Object.freeze(["createdAt","executionProfile","identity","lifecycle","ownershipId","pro\
470
+ ambiguous",EXACT:"exact",INVALID:"invalid",MISMATCH:"mismatch"});var ga=Object.freeze({runtimeToken:"JSKIT_EXECUTION_RUNTIME_TOKEN",modelCatalogSource:"JSKIT_CODEX_MODEL_CATALOG_SOURCE",
471
+ commandHash:"JSKIT_EXECUTION_COMMAND_HASH"});var zc=ce(Zo(),1),Lc=ce(Mt(),1),Uc=ce(Re(),1),Fc=ce(Cr(),1),qc=ce(Or(),1),$c=ce(jr(),1),Bc=ce(zt(),1),Hc=ce(is(),1);var Lg=32*1024,Ug=2*1024*1024;var Gt=Object.freeze({ACTIVE:"active",CLEANUP_REQUIRED:"cleanup_required",READY:"ready",STARTING_TURN:"starting_turn"}),
472
+ av=new Set(Object.values(Gt)),cv=Object.freeze(["createdAt","executionProfile","identity","lifecycle","ownershipId","pro\
473
473
  jectContextRoot","projectRuntimeRoot","revision","schemaVersion","sessionId","threadId","turnId","updatedAt","workdir"]),
474
- av=Object.freeze(["providerId","providerKeyFingerprint","runtime","server","transportId"]),cv=Object.freeze(["accountIde\
474
+ dv=Object.freeze(["providerId","providerKeyFingerprint","runtime","server","transportId"]),uv=Object.freeze(["accountIde\
475
475
  ntitySignature","authStateSignature","endpoint","executionMode","executionContextHash","provider","runtimeDir","runtimes\
476
- Hash","terminalEnvHash","toolHomeSource","transport"]),dv=Object.freeze(["userAgent"]);import md from"node:path";var hd=Object.freeze(["apps","artifact","browser_use","browser_use_external","browser_use_full_cdp_access","code_mode","\
476
+ Hash","terminalEnvHash","toolHomeSource","transport"]),lv=Object.freeze(["userAgent"]);import hd from"node:path";var gd=Object.freeze(["apps","artifact","browser_use","browser_use_external","browser_use_full_cdp_access","code_mode","\
477
477
  code_mode_host","computer_use","default_mode_request_user_input","deferred_executor","goals","hooks","image_generation",
478
478
  "in_app_browser","memories","multi_agent","multi_agent_v2","plugins","psp","recommended_plugins","request_permissions_to\
479
479
  ol","shell_tool","skill_mcp_dependency_install","skill_search","tool_call_mcp_elicitation","tool_suggest","unified_exec",
480
- "unified_exec_zsh_fork","view_image"]);function Cs(t){if(!t||typeof t!="object"||Object.isFrozen(t))return t;for(let e of Object.
481
- values(t))Cs(e);return Object.freeze(t)}function gd(t="",e={}){let n=new Error(I(t)||"Codex cannot prove the helper exec\
480
+ "unified_exec_zsh_fork","view_image"]);function _s(t){if(!t||typeof t!="object"||Object.isFrozen(t))return t;for(let e of Object.
481
+ values(t))_s(e);return Object.freeze(t)}function vd(t="",e={}){let n=new Error(I(t)||"Codex cannot prove the helper exec\
482
482
  ution policy.");n.code="codex_policy_unenforceable",n.details=Object.freeze({...e});for(let[r,o]of Object.entries(n.details))
483
- ["code","details","message","name"].includes(r)||(n[r]=o);return n}function vd({clientName:t="jskit",minimumVersion:e="0\
484
- .151.0",disabledFeatures:n=hd,limits:{userAgentMaxLength:r=512,mcpServerMaxCount:o=128,mcpServerNameMaxLength:s=256,configResponseMaxBytes:i=256*
483
+ ["code","details","message","name"].includes(r)||(n[r]=o);return n}function wd({clientName:t="jskit",minimumVersion:e="0\
484
+ .151.0",disabledFeatures:n=gd,limits:{userAgentMaxLength:r=512,mcpServerMaxCount:o=128,mcpServerNameMaxLength:s=256,configResponseMaxBytes:i=256*
485
485
  1024,hookMaxCount:a=256,hookErrorMaxCount:c=256,hookFieldMaxLength:d=2048,hookFingerprintMaxLength:p=256*1024,hookResponseMaxBytes:m=512*
486
- 1024}={},createError:l=gd}={}){let v=new WeakSet;function x(u,f,h){let g=0;try{g=Buffer.byteLength(JSON.stringify(u),"ut\
486
+ 1024}={},createError:l=vd}={}){let v=new WeakSet;function x(u,f,h){let g=0;try{g=Buffer.byteLength(JSON.stringify(u),"ut\
487
487
  f8")}catch{throw l(`Codex helper execution received an invalid ${h}.`)}if(g>f)throw l(`Codex helper execution received a\
488
- n oversized ${h}.`)}function b(u){if(typeof u?.currentConnectionGeneration!="function")throw l("Codex helper execution c\
488
+ n oversized ${h}.`)}function T(u){if(typeof u?.currentConnectionGeneration!="function")throw l("Codex helper execution c\
489
489
  annot verify the app-server connection generation.");let f=u.currentConnectionGeneration();if(!Number.isSafeInteger(f)||
490
490
  f<=0)throw l("Codex helper execution found no active app-server connection.");return f}async function O(u){if(typeof u?.
491
491
  currentHelperExecutionContext!="function")throw l("Codex helper execution requires its dedicated isolated provider.");let f=await u.
492
- currentHelperExecutionContext(),h=I(f?.cwd),g=I(f?.accountIdentitySignature);if(f?.executionMode!=="helper"||!h||!md.isAbsolute(
492
+ currentHelperExecutionContext(),h=I(f?.cwd),g=I(f?.accountIdentitySignature);if(f?.executionMode!=="helper"||!h||!hd.isAbsolute(
493
493
  h)||!/^sha256:[a-f0-9]{64}$/u.test(g))throw l("Codex helper runtime isolation could not be verified.");return Object.freeze(
494
494
  {accountIdentitySignature:g,cwd:h,executionMode:"helper"})}function P(u=""){let f=I(u).match(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/u);
495
495
  if(!f)return null;let h=f.slice(1).map(g=>Number.parseInt(g,10));return h.every(Number.isSafeInteger)?h:null}function j(u=""){
@@ -497,7 +497,7 @@ let f=I(u);if(!f||f.length>r||ge(f))return null;let h=`${t}/`;if(!f.startsWith(h
497
497
  /^((?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*))(?:$|[ \t].*$)/u);return g?P(g[1]):null}function D(u){if(typeof u?.currentServerInfo!=
498
498
  "function")throw l("Codex helper execution cannot verify the app-server version. Update Codex and retry.",{minimumVersion:e});
499
499
  let f=I(u.currentServerInfo()?.userAgent),h=j(f);if(!h)throw l("Codex helper execution received an unrecognised app-serv\
500
- er version. Update Codex and retry.",{minimumVersion:e});let g=h.join("."),y=P(e),S=h.findIndex((T,R)=>T!==y[R]);if(S!==
500
+ er version. Update Codex and retry.",{minimumVersion:e});let g=h.join("."),y=P(e),S=h.findIndex((b,R)=>b!==y[R]);if(S!==
501
501
  -1&&h[S]<y[S])throw l(`Codex helper execution requires app-server ${e} or newer; current version is ${g}. Update Codex a\
502
502
  nd retry.`,{actualVersion:g,minimumVersion:e});return Object.freeze({minimumVersion:e,version:g})}function U(u=null){if(!yt(
503
503
  u?.config))throw l("Codex helper execution could not read the effective app-server configuration.");let f=u.config.mcp_servers;
@@ -508,24 +508,24 @@ ceived an oversized or invalid MCP server inventory.");return h.sort()}function
508
508
  "Codex helper execution received an unexpected hook inventory.");let h=u.data[0];if(I(h?.cwd)!==f||I(h?.cwd).length>d||!Array.
509
509
  isArray(h.hooks)||!Array.isArray(h.errors)||h.hooks.length>a||h.errors.length>c)throw l("Codex helper execution received\
510
510
  an incomplete hook inventory.");if(h.errors.length>0)throw l("Codex helper execution cannot continue while hook discove\
511
- ry has errors.",{hookErrorCount:h.errors.length});let g=h.hooks.map(S=>{let T=I(S?.key),R=I(S?.currentHash),E=I(S?.handlerType),
512
- X=I(S?.sourcePath);if(!T||[T,R,E,X].some(Y=>Y.length>d||ge(Y)))throw l("Codex helper execution found an invalid hook inv\
511
+ ry has errors.",{hookErrorCount:h.errors.length});let g=h.hooks.map(S=>{let b=I(S?.key),R=I(S?.currentHash),E=I(S?.handlerType),
512
+ X=I(S?.sourcePath);if(!b||[b,R,E,X].some(Y=>Y.length>d||ge(Y)))throw l("Codex helper execution found an invalid hook inv\
513
513
  entory entry.");if(S?.isManaged===!0&&S?.enabled===!0)throw l("Codex helper execution cannot disable a managed hook.");return{
514
- currentHash:R,enabled:S?.enabled===!0,handlerType:E,isManaged:S?.isManaged===!0,key:T,sourcePath:X}}).sort((S,T)=>S.key.
515
- localeCompare(T.key)),y=JSON.stringify(g);if(y.length>p)throw l("Codex helper execution received an oversized hook inven\
514
+ currentHash:R,enabled:S?.enabled===!0,handlerType:E,isManaged:S?.isManaged===!0,key:b,sourcePath:X}}).sort((S,b)=>S.key.
515
+ localeCompare(b.key)),y=JSON.stringify(g);if(y.length>p)throw l("Codex helper execution received an oversized hook inven\
516
516
  tory.");return{fingerprint:y,hookKeys:g.filter(S=>!S.isManaged).map(S=>S.key)}}function H({effort:u="",summary:f="",hookKeys:h=[],
517
- mcpServerNames:g=[]}={}){let y={features:Object.fromEntries(n.map(T=>[T,!1])),hooks:{state:Object.fromEntries(h.map(T=>[
518
- T,{enabled:!1}]))},include_apps_instructions:!1,include_collaboration_mode_instructions:!1,include_environment_context:!1,
517
+ mcpServerNames:g=[]}={}){let y={features:Object.fromEntries(n.map(b=>[b,!1])),hooks:{state:Object.fromEntries(h.map(b=>[
518
+ b,{enabled:!1}]))},include_apps_instructions:!1,include_collaboration_mode_instructions:!1,include_environment_context:!1,
519
519
  include_permissions_instructions:!1,...u?{model_reasoning_effort:u}:{},...f?{model_reasoning_summary:f}:{},mcp_servers:Object.
520
- fromEntries(g.map(T=>[T,{enabled:!1}])),memories:{dedicated_tools:!1,generate_memories:!1,use_memories:!1},notify:[],orchestrator:{
520
+ fromEntries(g.map(b=>[b,{enabled:!1}])),memories:{dedicated_tools:!1,generate_memories:!1,use_memories:!1},notify:[],orchestrator:{
521
521
  mcp:{enabled:!1},skills:{enabled:!1}},project_doc_max_bytes:0,shell_environment_policy:{inherit:"none",set:{}},skills:{include_instructions:!1},
522
- tools:{experimental_request_user_input:{enabled:!1},update_plan:{enabled:!1}},web_search:"disabled"},S=Cs(y);return v.add(
523
- S),S}function q(u,f,h,{effort:g="",summary:y=""}={}){let S=U(u),T=J(f,h);return{mcpServerNames:S,hookState:T,config:H({effort:g,
524
- summary:y,hookKeys:T.hookKeys,mcpServerNames:S})}}async function ae(u,{effort:f="",summary:h=""}={}){if(D(u),typeof u?.readConfig!=
522
+ tools:{experimental_request_user_input:{enabled:!1},update_plan:{enabled:!1}},web_search:"disabled"},S=_s(y);return v.add(
523
+ S),S}function q(u,f,h,{effort:g="",summary:y=""}={}){let S=U(u),b=J(f,h);return{mcpServerNames:S,hookState:b,config:H({effort:g,
524
+ summary:y,hookKeys:b.hookKeys,mcpServerNames:S})}}async function ae(u,{effort:f="",summary:h=""}={}){if(D(u),typeof u?.readConfig!=
525
525
  "function"||typeof u?.listHooks!="function")throw l("Codex helper execution cannot inventory configuration and hooks.");
526
- let g=await O(u),y=b(u),S=await u.readConfig({cwd:g.cwd,includeLayers:!1});if(b(u)!==y)throw l("Codex app-server reconne\
527
- cted during helper policy verification.");let T=await u.listHooks([g.cwd]);if(b(u)!==y)throw l("Codex app-server reconne\
528
- cted during helper policy verification.");let{mcpServerNames:R,hookState:E,config:X}=q(S,T,g.cwd,{effort:f,summary:h});return Object.
526
+ let g=await O(u),y=T(u),S=await u.readConfig({cwd:g.cwd,includeLayers:!1});if(T(u)!==y)throw l("Codex app-server reconne\
527
+ cted during helper policy verification.");let b=await u.listHooks([g.cwd]);if(T(u)!==y)throw l("Codex app-server reconne\
528
+ cted during helper policy verification.");let{mcpServerNames:R,hookState:E,config:X}=q(S,b,g.cwd,{effort:f,summary:h});return Object.
529
529
  freeze({accountIdentitySignature:g.accountIdentitySignature,config:X,connectionGeneration:y,executionCwd:g.cwd,hookFingerprint:E.
530
530
  fingerprint,hookKeys:Object.freeze([...E.hookKeys]),mcpServerNames:Object.freeze([...R])})}function me(u=null,f=null){return u?.
531
531
  accountIdentitySignature===f?.accountIdentitySignature&&u?.connectionGeneration===f?.connectionGeneration&&u?.executionCwd===
@@ -541,212 +541,182 @@ await ht({error:S,provider:u,threadId:g})}}async function he(u,f){if(typeof u?.s
541
541
  h.settings),y=I(g?.id);if(!y)throw l("Codex app-server did not return a helper thread id.");return gt(u,h.enforcement,g,
542
542
  y,"starting")}async function vt(u,f,h){if(typeof u?.resumeThread!="function"||typeof u?.deleteThread!="function")throw l(
543
543
  "Codex helper execution cannot safely resume and clean up its app-server thread.");let g=I(f);if(!g)throw l("Codex helpe\
544
- r resume requires a controller-owned thread id.");let y=await h(),S=y.enforcement,T=await u.resumeThread(g,y.settings);return gt(
545
- u,S,T,g,"resuming")}function _e(u){return v.has(u)}function wt({configResult:u,hookResult:f,workdir:h,effort:g="",summary:y=""}){
544
+ r resume requires a controller-owned thread id.");let y=await h(),S=y.enforcement,b=await u.resumeThread(g,y.settings);return gt(
545
+ u,S,b,g,"resuming")}function Ce(u){return v.has(u)}function wt({configResult:u,hookResult:f,workdir:h,effort:g="",summary:y=""}){
546
546
  return q(u,f,h,{effort:g,summary:y}).config}function ar({approvalPolicy:u,baseInstructions:f,config:h,cwd:g,effectiveSettings:y,
547
- sandbox:S,systemPrompt:T}){return{allowProviderModelFallback:!1,approvalPolicy:u,baseInstructions:f,config:h,cwd:g,systemPrompt:T||
547
+ sandbox:S,systemPrompt:b}){return{allowProviderModelFallback:!1,approvalPolicy:u,baseInstructions:f,config:h,cwd:g,systemPrompt:b||
548
548
  null,dynamicTools:[],environments:[],model:y.model,runtimeWorkspaceRoots:[],sandbox:S,selectedCapabilityRoots:[]}}function cr(u,f){
549
549
  return{...u,sessionStartSource:"startup",threadSource:f}}function dr(u){return{approvalPolicy:u.approvalPolicy,baseInstructions:u.
550
550
  baseInstructions,config:u.config,cwd:u.cwd,systemPrompt:u.systemPrompt,model:u.model,runtimeWorkspaceRoots:u.runtimeWorkspaceRoots,
551
551
  sandbox:u.sandbox}}function w({approvalPolicy:u,cwd:f,effectiveSettings:h,outputSchema:g}){let y={approvalPolicy:u,cwd:f,
552
552
  environments:[],model:h.model,outputSchema:g,runtimeWorkspaceRoots:[],sandboxPolicy:{networkAccess:!1,type:"readOnly"},summary:"\
553
553
  none"};return h.request.reasoning&&(y.effort=h.thinking),y}return Object.freeze({assertCompatibility:D,executionContext:O,
554
- inspect:ae,configuration:wt,hasConfiguration:_e,threadSettings:ar,threadStartSettings:cr,threadResumeSettings:dr,turnSettings:w,
555
- start:he,resume:vt})}var kv=vd();var eI=Object.freeze({PROVIDER_FAILURE:"provider_failure",RESPONSE_DELIVERY_FAILURE:"response_delivery_failure",SERVICE_RESTART:"\
554
+ inspect:ae,configuration:wt,hasConfiguration:Ce,threadSettings:ar,threadStartSettings:cr,threadResumeSettings:dr,turnSettings:w,
555
+ start:he,resume:vt})}var Nv=wd();var rI=Object.freeze({PROVIDER_FAILURE:"provider_failure",RESPONSE_DELIVERY_FAILURE:"response_delivery_failure",SERVICE_RESTART:"\
556
556
  service_restart",USER_CANCELLED:"user_cancelled",CONTROL_RECONFIGURATION:"control_reconfiguration",INTERRUPTED:"interrup\
557
- ted"});var hI=Number.MAX_SAFE_INTEGER;var Dd=(Number(process.env.AGENT_REPLY_MINUTES)||15)*60*1e3;function en(t){return{stoppedShort:`(Check from ${t}: your reply ended by saying what you'd do next, and then stopped, s\
557
+ ted"});var vI=Number.MAX_SAFE_INTEGER;var zd=(Number(process.env.AGENT_REPLY_MINUTES)||15)*60*1e3;function en(t){return{stoppedShort:`(Check from ${t}: your reply ended by saying what you'd do next, and then stopped, s\
558
558
  o the person is left waiting. Carry on now with your tools and finish the job, then reply with the result. If you can't,\
559
559
  say plainly why.)`,markup:`(Check from ${t}: your last message contained raw markup, such as a tool call written out as\
560
560
  text or special tokens, so nothing in it ran and the person can't read it. Carry on now: call the tools properly to do \
561
561
  what's left, then reply in plain words.)`,unsupported:e=>`(Check from ${t}: your reply says ${e.map(n=>`"${n}"`).join(",\
562
562
  ")}, but no tool in this reply did that, so it hasn't happened. Do it now with the right tool, or answer again without \
563
563
  saying it's done.)`,resumed:"(This reply was interrupted part-way, when the server running it stopped. Your steps so far\
564
- are above and what they did stays done. Carry on from where you got to, without redoing them, and finish the job.)"}}var zI=["You check an assistant's reply against a record of what its tools did while writing that reply.","List each sta\
564
+ are above and what they did stays done. Carry on from where you got to, without redoing them, and finish the job.)"}}var UI=["You check an assistant's reply against a record of what its tools did while writing that reply.","List each sta\
565
565
  tement in the reply that says something was done in this reply (made, saved, sent, attached, added, changed, deleted, bo\
566
566
  oked, set up, fixed, run, tested) that the record doesn't support.","A claim is supported if a tool call and its answer \
567
567
  in the record show it happened. Ignore plans, offers, questions, advice, facts about the person, things said to have hap\
568
568
  pened earlier in the conversation, and descriptions of what a file or app contains.",'Reply with JSON only: {"unsupporte\
569
569
  d": ["short quote of each unsupported claim"]}, with [] when every claim is supported.'].join(`
570
- `);var dS=64*1024;var Zd="the app",gS=en(Zd);var wS=16*1024*1024;var xS=new URL("./../../../@jskit-ai/assistant-core/src/server/conversation/commandWrapper.js",import.meta.url).href;var su=Object.freeze({streaming:!1,instructions:!1,configuration:!1,goals:!1,goalBudgets:!1,goalCommands:Object.freeze({}),
571
- attachments:!1,tools:!1,nativeTools:!1});var Qx=Object.freeze({goals:!0,goalBudgets:!1,goalCommands:Object.freeze({set:Object.freeze({delivery:"message",interruptsTurn:!1}),
572
- resume:Object.freeze({delivery:"message",interruptsTurn:!1}),pause:Object.freeze({delivery:"control",interruptsTurn:!0}),
573
- cancel:Object.freeze({delivery:"message",interruptsTurn:!0})})}),eb=Object.freeze({});var Ob=new URL("./../../../@jskit-ai/assistant-core/src/server/conversation/codexRuntime.js",import.meta.url).href;import{createHash as Us}from"node:crypto";import{open as Tu}from"node:fs/promises";import Fs from"node:path";var cn=1024*1024,Cu=256*1024,qs=512,_u=128,Au=16*1024;function dn({errorPrefix:t="",identityNamespace:e="codex-account-v\
574
- 1",secretNamespace:n="codex-auth-secret-v1"}={}){function r(d="",p="",{messageCode:m}={}){let l=new Error(I(p)||"Codex h\
575
- elper authentication is unavailable. Reconnect Codex and retry.");return l.code=I(d)||`${t}codex_helper_auth_unavailable`,
576
- I(p)?m&&(l.messageCode=m):l.messageCode="assistant.codex.helperAuthUnavailable",l.messageCode&&(l.messageParams={}),l}function o(d,{
577
- label:p="Codex authentication value",maxLength:m=0}={}){if(typeof d!="string"||d.length===0||d.length>m)throw r(`${t}cod\
578
- ex_helper_auth_invalid`,`${p} is missing or invalid. Reconnect Codex and retry.`);return d}function s(d="",p=""){return`\
579
- sha256:${Us("sha256").update(`${e}\0`,"utf8").update(I(d),"utf8").update("\0","utf8").update(String(p||""),"utf8").digest(
580
- "hex")}`}function i(d=""){return Us("sha256").update(`${n}\0`,"utf8").update(String(d||""),"utf8").digest("hex")}async function a(d=""){
581
- let p=null;try{p=await Tu(d,"r");let m=await p.stat();if(!m.isFile()||m.size>cn)throw r(`${t}codex_helper_auth_invalid`,
582
- "The selected Codex authentication record is invalid. Reconnect Codex and retry.",{messageCode:"assistant.codex.authReco\
583
- rdInvalid"});let l=Buffer.alloc(cn+1),v=0;for(;v<l.length;){let{bytesRead:b}=await p.read(l,v,l.length-v,null);if(b===0)
584
- break;v+=b}if(v>cn)throw r(`${t}codex_helper_auth_invalid`,"The selected Codex authentication record is too large. Recon\
585
- nect Codex and retry.",{messageCode:"assistant.codex.authRecordTooLarge"});let x=JSON.parse(l.subarray(0,v).toString("ut\
586
- f8"));if(!A(x))throw new Error("invalid authentication record");return x}catch(m){throw m?.code?.startsWith?.(`${t}codex\
587
- _helper_auth_`)?m:r(`${t}codex_helper_auth_unavailable`,"The selected Codex authentication record could not be read. Rec\
588
- onnect Codex and retry.",{messageCode:"assistant.codex.authRecordUnreadable"})}finally{await p?.close().catch(()=>null)}}
589
- async function c(d={}){let p=I(d.toolHomeSource);if(!p||!Fs.isAbsolute(p))throw r(`${t}codex_helper_auth_unavailable`,"T\
590
- he selected Codex account is unavailable. Reconnect Codex and retry.",{messageCode:"assistant.codex.accountUnavailable"});
591
- let m=await a(Fs.join(p,".codex","auth.json")),l=I(m.auth_mode).toLowerCase();if(l==="chatgpt"){let v=A(m.tokens)?m.tokens:
592
- {},x=o(v.account_id,{label:"Codex account identity",maxLength:qs}),b=o(v.access_token,{label:"Codex access token",maxLength:Cu}),
593
- O=v.chatgpt_plan_type??v.plan_type,P=O==null||O===""?"":o(O,{label:"Codex plan type",maxLength:_u});return Object.freeze(
594
- {accessToken:b,accountId:x,authMode:"chatgpt",identitySignature:s("chatgpt",x),planType:P,secretSignature:i(b)})}if(["ap\
595
- ikey","api_key"].includes(l)){let v=o(m.OPENAI_API_KEY,{label:"Codex API key",maxLength:Au});return Object.freeze({apiKey:v,
596
- authMode:"apiKey",identitySignature:s("apiKey",v),secretSignature:i(v)})}throw r(`${t}codex_helper_auth_invalid`,"The se\
597
- lected Codex authentication mode is unsupported. Reconnect Codex and retry.",{messageCode:"assistant.codex.authModeUnsup\
598
- ported"})}return Object.freeze({error:r,identitySignature:s,readRecord:a,readSelected:c})}var Xb=Object.freeze({label:"Checking the Codex sign-in",operationId:"codex-auth-preflight"});var nT=dn().error;var AT=4*1024*1024;var zC=Object.freeze({goals:!0,goalBudgets:!0,goalCommands:Object.freeze({set:Object.freeze({delivery:"control",interruptsTurn:!1}),
599
- resume:Object.freeze({delivery:"control",interruptsTurn:!1}),pause:Object.freeze({delivery:"control",interruptsTurn:!0}),
600
- cancel:Object.freeze({delivery:"control",interruptsTurn:!1})})});var BC=2*1024*1024,HC=32*1024*1024,VC=2*1024*1024;function z(t){if(t===null||typeof t!="object")return!1;let e=Object.getPrototypeOf(t);return e===Object.prototype||e===null||
601
- zu(e)}function zu(t){return t!==null&&typeof t=="object"&&Object.getPrototypeOf(t)===null&&Reflect.ownKeys(t).length===0}function pn(t){return t!==null&&typeof t=="object"&&z(t.structure)&&z(t.operations)&&typeof t.validateWith=="function"&&
602
- typeof t.toJsonSchema=="function"&&typeof t.cleanup=="function"}function Kt(t,e){if(!Object.hasOwn(e,"items"))return null;
603
- let{items:n}=e;if(pn(n))return{kind:"schema",schema:n};if(!z(n)||typeof n.type!="string")throw new Error(`Array field "${t}\
604
- " must define items as either a Schema instance or a field definition object.`);return{kind:"definition",definition:n}}function lt(t,e){
605
- if(!Object.hasOwn(e,"values"))return null;let{values:n}=e;if(pn(n))return{kind:"schema",schema:n};if(!z(n)||typeof n.type!=
570
+ `);var lS=64*1024;var Qd="the app",wS=en(Qd);var IS=16*1024*1024;function z(t){if(t===null||typeof t!="object")return!1;let e=Object.getPrototypeOf(t);return e===Object.prototype||e===null||
571
+ eu(e)}function eu(t){return t!==null&&typeof t=="object"&&Object.getPrototypeOf(t)===null&&Reflect.ownKeys(t).length===0}function on(t){return t!==null&&typeof t=="object"&&z(t.structure)&&z(t.operations)&&typeof t.validateWith=="function"&&
572
+ typeof t.toJsonSchema=="function"&&typeof t.cleanup=="function"}function Wt(t,e){if(!Object.hasOwn(e,"items"))return null;
573
+ let{items:n}=e;if(on(n))return{kind:"schema",schema:n};if(!z(n)||typeof n.type!="string")throw new Error(`Array field "${t}\
574
+ " must define items as either a Schema instance or a field definition object.`);return{kind:"definition",definition:n}}function dt(t,e){
575
+ if(!Object.hasOwn(e,"values"))return null;let{values:n}=e;if(on(n))return{kind:"schema",schema:n};if(!z(n)||typeof n.type!=
606
576
  "string")throw new Error(`Object field "${t}" must define values as either a Schema instance or a field definition objec\
607
- t.`);return{kind:"definition",definition:n}}function Jt(t,e){let n=Object.hasOwn(e,"schema"),r=Object.hasOwn(e,"values"),
577
+ t.`);return{kind:"definition",definition:n}}function Kt(t,e){let n=Object.hasOwn(e,"schema"),r=Object.hasOwn(e,"values"),
608
578
  o=Object.hasOwn(e,"additionalProperties");if(n&&r)throw new Error(`Object field "${t}" cannot define both schema and val\
609
579
  ues.`);if(o&&e.additionalProperties!==!0)throw new Error(`Object field "${t}" only supports additionalProperties: true.`);
610
580
  if(r&&e.additionalProperties===!0)throw new Error(`Object field "${t}" cannot define both values and additionalPropertie\
611
- s: true.`);if(n){if(!pn(e.schema))throw new Error(`Object field "${t}" must define schema as a Schema instance.`);return{
612
- kind:"nested",schema:e.schema,allowAdditionalProperties:e.additionalProperties===!0}}return r?{kind:"map",valuesConfig:lt(
613
- t,e)}:e.additionalProperties===!0?{kind:"opaque"}:{kind:"plain"}}function Ue(t){return t?.type==="number"||t?.type==="integer"||t?.type==="epochMilliseconds"||t?.type==="epochSeconds"}function fn(t,e=""){
581
+ s: true.`);if(n){if(!on(e.schema))throw new Error(`Object field "${t}" must define schema as a Schema instance.`);return{
582
+ kind:"nested",schema:e.schema,allowAdditionalProperties:e.additionalProperties===!0}}return r?{kind:"map",valuesConfig:dt(
583
+ t,e)}:e.additionalProperties===!0?{kind:"opaque"}:{kind:"plain"}}function Ue(t){return t?.type==="number"||t?.type==="integer"||t?.type==="epochMilliseconds"||t?.type==="epochSeconds"}function sn(t,e=""){
614
584
  if(z(t))for(let[n,r]of Object.entries(t)){if(!z(r))continue;let o=e?`${e}.${n}`:n;for(let s of["minItems","maxItems"]){if(!Object.
615
585
  hasOwn(r,s))continue;let i=r[s];if(r.type!=="array"||!Number.isInteger(i)||i<0)throw new Error(`Field "${o}" ${s} must b\
616
586
  e a non-negative integer on an array field.`)}if(r.minItems>r.maxItems)throw new Error(`Field "${o}" minItems (${r.minItems}\
617
- ) is above its maxItems (${r.maxItems}).`);r.type==="array"&&z(r.items)&&typeof r.items.type=="string"&&fn({"[]":r.items},
618
- o)}}var mn="^(?:0|-?[1-9]\\d*)$",$s="\\d{4}",Bs="0[1-9]|1[0-2]",Hs="0[1-9]|[12]\\d|3[01]",Vs="[01]\\d|2[0-3]",Fe="[0-5]\\d",
619
- Xt=`(?:${Vs}):${Fe}`,Gs=`(?:Z|[+-](?:${Vs}):${Fe})`,Ws=`(${$s})-(${Bs})-(${Hs})`,Ks=`${$s}-(?:${Bs})-(?:${Hs})`,Js=`^${Ks}\
620
- $`,Lu=new RegExp(`^${Ws}$`),Uu=new RegExp(`^${Xt}(?::${Fe}(?:\\.(\\d+))?)?$`),Fu=new RegExp(`^${Ws}T${Xt}:${Fe}(?:\\.(\\d+\
621
- ))?${Gs}$`),qu=new RegExp(mn),$u=[31,28,31,30,31,30,31,31,30,31,30,31];function Bu(t){return t%4===0&&(t%100!==0||t%400===
622
- 0)}function Hu(t,e){return e===2?Bu(t)?29:28:$u[e-1]}function Xs(t,e,n){let r=Number(t),o=Number(e),s=Number(n);return o>=
623
- 1&&o<=12&&s>=1&&s<=Hu(r,o)}function pt(t,e){let n=t.temporalPrecision;if(n!==void 0){if(!Number.isInteger(n)||n<0)throw new Error(
624
- `temporalPrecision for "${e}" must be a non-negative integer.`);return n}}function Ys(t,e){return t===void 0?!0:e===void 0||
625
- t.length<=e}function Zs(t){if(typeof t!="string")return!1;let e=Lu.exec(t);return e!==null&&Xs(e[1],e[2],e[3])}function Qs(t,e){
626
- if(typeof t!="string")return!1;let n=Uu.exec(t);return n!==null&&Ys(n[1],e)}function ei(t,e){if(typeof t!="string")return!1;
627
- let n=Fu.exec(t);return n===null?!1:Xs(n[1],n[2],n[3])&&Ys(n[4],e)}function ti(t){return t===void 0?"(?:\\.\\d+)?":t===0?
628
- "":`(?:\\.\\d{1,${t}})?`}function ri(t,e){let n=pt(t,e);return`^${Xt}(?::${Fe}${ti(n)})?$`}function ni(t,e){let n=pt(t,e);
629
- return`^${Ks}T${Xt}:${Fe}${ti(n)}${Gs}$`}function hn(t,e){let n;if(typeof t=="number")n=t;else if(typeof t=="string"&&qu.
630
- test(t))n=Number(t);else return null;return!Number.isSafeInteger(n)||n<-e||n>e?null:n===0?0:n}var Vu=new Set(["__proto__","prototype","constructor"]);function C(t,e,n){Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0})}function Gu(t,e){if(Vu.
631
- has(t))throw new Error(`${e}() received unsafe path segment "${t}".`)}function Wu(t){return typeof t!="string"?t:t.replace(
632
- /\[(.+?)\]/g,".$1").replace(/^\.+/,"").replace(/\.+/g,".").replace(/\.$/,"")}function gn(t,e,{normalize:n=!1,allowEmpty:r=!1}={}){
633
- let o=n?Wu(t):t;if(typeof o!="string"||o.trim()===""){if(r&&o==="")return[];throw new Error(`${e}() expects a non-empty \
587
+ ) is above its maxItems (${r.maxItems}).`);r.type==="array"&&z(r.items)&&typeof r.items.type=="string"&&sn({"[]":r.items},
588
+ o)}}var an="^(?:0|-?[1-9]\\d*)$",Ms="\\d{4}",Ns="0[1-9]|1[0-2]",js="0[1-9]|[12]\\d|3[01]",Ds="[01]\\d|2[0-3]",Fe="[0-5]\\d",
589
+ Jt=`(?:${Ds}):${Fe}`,zs=`(?:Z|[+-](?:${Ds}):${Fe})`,Ls=`(${Ms})-(${Ns})-(${js})`,Us=`${Ms}-(?:${Ns})-(?:${js})`,Fs=`^${Us}\
590
+ $`,tu=new RegExp(`^${Ls}$`),ru=new RegExp(`^${Jt}(?::${Fe}(?:\\.(\\d+))?)?$`),nu=new RegExp(`^${Ls}T${Jt}:${Fe}(?:\\.(\\d+\
591
+ ))?${zs}$`),ou=new RegExp(an),su=[31,28,31,30,31,30,31,31,30,31,30,31];function iu(t){return t%4===0&&(t%100!==0||t%400===
592
+ 0)}function au(t,e){return e===2?iu(t)?29:28:su[e-1]}function qs(t,e,n){let r=Number(t),o=Number(e),s=Number(n);return o>=
593
+ 1&&o<=12&&s>=1&&s<=au(r,o)}function ut(t,e){let n=t.temporalPrecision;if(n!==void 0){if(!Number.isInteger(n)||n<0)throw new Error(
594
+ `temporalPrecision for "${e}" must be a non-negative integer.`);return n}}function $s(t,e){return t===void 0?!0:e===void 0||
595
+ t.length<=e}function Bs(t){if(typeof t!="string")return!1;let e=tu.exec(t);return e!==null&&qs(e[1],e[2],e[3])}function Hs(t,e){
596
+ if(typeof t!="string")return!1;let n=ru.exec(t);return n!==null&&$s(n[1],e)}function Vs(t,e){if(typeof t!="string")return!1;
597
+ let n=nu.exec(t);return n===null?!1:qs(n[1],n[2],n[3])&&$s(n[4],e)}function Gs(t){return t===void 0?"(?:\\.\\d+)?":t===0?
598
+ "":`(?:\\.\\d{1,${t}})?`}function Ws(t,e){let n=ut(t,e);return`^${Jt}(?::${Fe}${Gs(n)})?$`}function Ks(t,e){let n=ut(t,e);
599
+ return`^${Us}T${Jt}:${Fe}${Gs(n)}${zs}$`}function cn(t,e){let n;if(typeof t=="number")n=t;else if(typeof t=="string"&&ou.
600
+ test(t))n=Number(t);else return null;return!Number.isSafeInteger(n)||n<-e||n>e?null:n===0?0:n}var cu=new Set(["__proto__","prototype","constructor"]);function _(t,e,n){Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0})}function du(t,e){if(cu.
601
+ has(t))throw new Error(`${e}() received unsafe path segment "${t}".`)}function uu(t){return typeof t!="string"?t:t.replace(
602
+ /\[(.+?)\]/g,".$1").replace(/^\.+/,"").replace(/\.+/g,".").replace(/\.$/,"")}function dn(t,e,{normalize:n=!1,allowEmpty:r=!1}={}){
603
+ let o=n?uu(t):t;if(typeof o!="string"||o.trim()===""){if(r&&o==="")return[];throw new Error(`${e}() expects a non-empty \
634
604
  dotted path string.`)}let s=o.split(".");if(s.some(i=>i===""))throw new Error(`${e}() received an invalid path "${o}".`);
635
- for(let i of s)Gu(i,e);return s}var Ku="http://json-schema.org/draft-07/schema#",fe="x-json-rest-schema",vn=["object","array","string","number","boolean"],
636
- wn=Symbol("json-rest-schema.exportContext"),Ju=["true","1","yes","y","on"],Xu=["false","0","no","n","off"];function oi(t){
637
- return{anyOf:[{type:"integer",minimum:-t,maximum:t},{type:"string",pattern:mn}]}}function be(t,e){return{[fe]:{[t]:e}}}var Yu={
638
- none:()=>({type:vn}),blob:()=>({type:vn}),serialize:()=>({type:vn}),object:()=>({type:"object"}),array:()=>({type:"array"}),
605
+ for(let i of s)du(i,e);return s}var lu="http://json-schema.org/draft-07/schema#",fe="x-json-rest-schema",un=["object","array","string","number","boolean"],
606
+ ln=Symbol("json-rest-schema.exportContext"),pu=["true","1","yes","y","on"],fu=["false","0","no","n","off"];function Js(t){
607
+ return{anyOf:[{type:"integer",minimum:-t,maximum:t},{type:"string",pattern:an}]}}function Te(t,e){return{[fe]:{[t]:e}}}var mu={
608
+ none:()=>({type:un}),blob:()=>({type:un}),serialize:()=>({type:un}),object:()=>({type:"object"}),array:()=>({type:"array"}),
639
609
  file:()=>({type:"string"}),string:()=>({type:"string"}),number:()=>({type:["number","string"]}),integer:()=>({type:["int\
640
- eger","string"]}),epochMilliseconds:()=>oi(864e13),epochSeconds:()=>oi(864e10),dateTime:({definition:t,fieldName:e})=>({
641
- type:"string",format:"date-time",pattern:ni(t,e)}),date:()=>({type:"string",format:"date",pattern:Js}),time:({definition:t,
642
- fieldName:e})=>({type:"string",pattern:ri(t,e)}),boolean:({definition:t})=>{if(t.strictBoolean===!0)return{type:"boolean"};
643
- let e=new Set([...Ju,String(t.stringTrueWhen||"true").trim().toLowerCase()]),n=new Set([...Xu,String(t.stringFalseWhen||
610
+ eger","string"]}),epochMilliseconds:()=>Js(864e13),epochSeconds:()=>Js(864e10),dateTime:({definition:t,fieldName:e})=>({
611
+ type:"string",format:"date-time",pattern:Ks(t,e)}),date:()=>({type:"string",format:"date",pattern:Fs}),time:({definition:t,
612
+ fieldName:e})=>({type:"string",pattern:Ws(t,e)}),boolean:({definition:t})=>{if(t.strictBoolean===!0)return{type:"boolean"};
613
+ let e=new Set([...pu,String(t.stringTrueWhen||"true").trim().toLowerCase()]),n=new Set([...fu,String(t.stringFalseWhen||
644
614
  "false").trim().toLowerCase()]);return{anyOf:[{type:"boolean"},{type:"number",enum:[0,1]},{type:"string",enum:[...n,...e]}]}},
645
- id:()=>({type:["integer","string"],minimum:1,pattern:"^[1-9][0-9]*$"})},Zu={minLength:({definition:t,parameterValue:e})=>t.
615
+ id:()=>({type:["integer","string"],minimum:1,pattern:"^[1-9][0-9]*$"})},hu={minLength:({definition:t,parameterValue:e})=>t.
646
616
  type==="string"?{minLength:e}:null,maxLength:({definition:t,parameterValue:e})=>t.type==="string"?{maxLength:e}:null,min:({
647
617
  definition:t,parameterValue:e})=>Ue(t)?{minimum:e}:null,max:({definition:t,parameterValue:e})=>Ue(t)?{maximum:e}:null,pattern:({
648
618
  definition:t,parameterValue:e})=>t.type==="string"?{pattern:e instanceof RegExp?e.source:e}:null,enum:({parameterValue:t})=>({
649
619
  enum:t}),minItems:({definition:t,parameterValue:e})=>t.type==="array"?{minItems:e}:null,maxItems:({definition:t,parameterValue:e})=>t.
650
620
  type==="array"?{maxItems:e}:null,notEmpty:({parameterValue:t,definition:e})=>!t||e.type==="array"?null:{minLength:1},uppercase:({
651
- parameterValue:t})=>t?be("transforms",{uppercase:!0}):null,lowercase:({parameterValue:t})=>t?be("transforms",{lowercase:!0}):
652
- null,length:({parameterValue:t})=>be("transforms",{length:t}),unsigned:({parameterValue:t})=>t?be("metadata",{unsigned:!0}):
653
- null,precision:({parameterValue:t})=>be("metadata",{precision:t}),scale:({parameterValue:t})=>be("metadata",{scale:t}),temporalPrecision:({
654
- parameterValue:t})=>be("metadata",{temporalPrecision:t}),strictBoolean:()=>null,required:()=>null,nullable:()=>null,nullOnEmpty:()=>null,
655
- defaultTo:()=>null};function xn(t,e){for(let n of Object.keys(e)){let r=e[n],o=t[n];if(r&&o&&typeof r=="object"&&typeof o==
656
- "object"&&!Array.isArray(r)&&!Array.isArray(o)){xn(o,r);continue}t[n]=r}}function Qu(t,e){if(!e||typeof e!="object"||Array.
621
+ parameterValue:t})=>t?Te("transforms",{uppercase:!0}):null,lowercase:({parameterValue:t})=>t?Te("transforms",{lowercase:!0}):
622
+ null,length:({parameterValue:t})=>Te("transforms",{length:t}),unsigned:({parameterValue:t})=>t?Te("metadata",{unsigned:!0}):
623
+ null,precision:({parameterValue:t})=>Te("metadata",{precision:t}),scale:({parameterValue:t})=>Te("metadata",{scale:t}),temporalPrecision:({
624
+ parameterValue:t})=>Te("metadata",{temporalPrecision:t}),strictBoolean:()=>null,required:()=>null,nullable:()=>null,nullOnEmpty:()=>null,
625
+ defaultTo:()=>null};function hn(t,e){for(let n of Object.keys(e)){let r=e[n],o=t[n];if(r&&o&&typeof r=="object"&&typeof o==
626
+ "object"&&!Array.isArray(r)&&!Array.isArray(o)){hn(o,r);continue}t[n]=r}}function gu(t,e){if(!e||typeof e!="object"||Array.
657
627
  isArray(e))throw new Error("JSON Schema export hooks must return an object or null.");for(let n of Object.keys(e)){if(n===
658
- fe&&t[n]&&typeof t[n]=="object"&&typeof e[n]=="object"&&!Array.isArray(t[n])&&!Array.isArray(e[n])){xn(t[n],e[n]);continue}
659
- t[n]=e[n]}}function el(t,e){let r=[...Array.isArray(t.anyOf)&&Object.keys(t).length===1?t.anyOf:[t],...e];return r.length===
660
- 1?t:{anyOf:r}}function tl(t,e){if(!Object.hasOwn(t.types,e.type))throw new Error(`No casting function for type: ${e.type}`);
661
- let n=t.types[e.type];if(typeof n.toJsonSchema=="function")return n.toJsonSchema;let r=Yu[e.type];if(!r)throw new Error(
662
- `Type '${e.type}' cannot be exported to JSON Schema without a toJsonSchema hook.`);return r}function rl(t,e,n){if(!Object.
663
- hasOwn(t.validators,e))return null;let r=t.validators[e];if(typeof r.toJsonSchema=="function")return r.toJsonSchema;let o=Zu[e];
628
+ fe&&t[n]&&typeof t[n]=="object"&&typeof e[n]=="object"&&!Array.isArray(t[n])&&!Array.isArray(e[n])){hn(t[n],e[n]);continue}
629
+ t[n]=e[n]}}function vu(t,e){let r=[...Array.isArray(t.anyOf)&&Object.keys(t).length===1?t.anyOf:[t],...e];return r.length===
630
+ 1?t:{anyOf:r}}function wu(t,e){if(!Object.hasOwn(t.types,e.type))throw new Error(`No casting function for type: ${e.type}`);
631
+ let n=t.types[e.type];if(typeof n.toJsonSchema=="function")return n.toJsonSchema;let r=mu[e.type];if(!r)throw new Error(
632
+ `Type '${e.type}' cannot be exported to JSON Schema without a toJsonSchema hook.`);return r}function yu(t,e,n){if(!Object.
633
+ hasOwn(t.validators,e))return null;let r=t.validators[e];if(typeof r.toJsonSchema=="function")return r.toJsonSchema;let o=hu[e];
664
634
  if(o)return o;throw new Error(`Validator '${e}' on field '${n}' cannot be exported to JSON Schema without a toJsonSchema\
665
- hook.`)}function si(t){if(t===void 0)return"create";if(["create","replace","patch"].includes(t))return t;throw new Error(
666
- `Unsupported JSON Schema export mode '${t}'. Expected 'create', 'replace', or 'patch'.`)}function nl(t,e={}){if(e.mode!==
667
- void 0&&e.operation!==void 0){let n=si(e.mode);if(n!==e.operation)throw new Error(`Conflicting JSON Schema export option\
635
+ hook.`)}function Xs(t){if(t===void 0)return"create";if(["create","replace","patch"].includes(t))return t;throw new Error(
636
+ `Unsupported JSON Schema export mode '${t}'. Expected 'create', 'replace', or 'patch'.`)}function Iu(t,e={}){if(e.mode!==
637
+ void 0&&e.operation!==void 0){let n=Xs(e.mode);if(n!==e.operation)throw new Error(`Conflicting JSON Schema export option\
668
638
  s: mode '${n}' does not match operation '${e.operation}'.`)}if(e.operation!==void 0){if(!Object.hasOwn(t.operations,e.operation))
669
- throw new Error(`Unknown JSON Schema export operation '${e.operation}'.`);return e.operation}return si(e.mode)}function ol(t,e={}){
639
+ throw new Error(`Unknown JSON Schema export operation '${e.operation}'.`);return e.operation}return Xs(e.mode)}function Su(t,e={}){
670
640
  if(e.operationName!==void 0&&e.operationDescriptor!==void 0)return{operationName:e.operationName,operation:e.operationDescriptor};
671
- let n=nl(t,e);return{operationName:n,operation:t.operations[n]}}function sl(t={}){let e={...t};return Object.defineProperty(
672
- e,wn,{value:{definitions:{},nodes:[],nextDefinitionId:1,rootNode:null},enumerable:!1}),e}function Zt(t={}){return t[wn]?
673
- t[wn]:{definitions:{},nodes:[],nextDefinitionId:1,rootNode:null}}function il(t){return String(t).replace(/[^a-zA-Z0-9]+/g,
674
- "_").replace(/^_+|_+$/g,"")||"operation"}function yn(t){return z(t)&&Object.keys(t).length===1&&typeof t.$ref=="string"}
675
- function Yt(t){return yn(t)?{allOf:[t]}:t}function al(t,e,n,r,o){return t.nodes.find(s=>s.schema===e&&s.operationName===
676
- n&&s.operation===r&&s.additionalProperties===o)||null}function cl(t,e){let n=il(e),r=`SchemaNode_${t.nextDefinitionId}_${n}`;
677
- return t.nextDefinitionId+=1,r}function ii(t,e,n,r,o,{root:s=!1}={}){let i=Zt(e),a=al(i,t,n,r,o);if(a)return s&&(a.pointer=
641
+ let n=Iu(t,e);return{operationName:n,operation:t.operations[n]}}function xu(t={}){let e={...t};return Object.defineProperty(
642
+ e,ln,{value:{definitions:{},nodes:[],nextDefinitionId:1,rootNode:null},enumerable:!1}),e}function Yt(t={}){return t[ln]?
643
+ t[ln]:{definitions:{},nodes:[],nextDefinitionId:1,rootNode:null}}function Tu(t){return String(t).replace(/[^a-zA-Z0-9]+/g,
644
+ "_").replace(/^_+|_+$/g,"")||"operation"}function pn(t){return z(t)&&Object.keys(t).length===1&&typeof t.$ref=="string"}
645
+ function Xt(t){return pn(t)?{allOf:[t]}:t}function bu(t,e,n,r,o){return t.nodes.find(s=>s.schema===e&&s.operationName===
646
+ n&&s.operation===r&&s.additionalProperties===o)||null}function _u(t,e){let n=Tu(e),r=`SchemaNode_${t.nextDefinitionId}_${n}`;
647
+ return t.nextDefinitionId+=1,r}function Ys(t,e,n,r,o,{root:s=!1}={}){let i=Yt(e),a=bu(i,t,n,r,o);if(a)return s&&(a.pointer=
678
648
  "#",i.rootNode=a),a;let c={schema:t,operationName:n,operation:r,additionalProperties:o,status:"new",definitionName:s?null:
679
- cl(i,n),pointer:s?"#":null};return s?i.rootNode=c:c.pointer=`#/definitions/${c.definitionName}`,i.nodes.push(c),c}function ai(t,e){
680
- if(t.status==="built")return{$ref:t.pointer};if(t.status==="building")return{$ref:t.pointer};let n=Zt(e);t.status="build\
681
- ing",t.pointer!=="#"&&(n.definitions[t.definitionName]={});let r=dl(t.schema,e,t.operationName,t.operation,t.additionalProperties);
682
- return t.status="built",t.pointer==="#"?r:(n.definitions[t.definitionName]=r,{$ref:t.pointer})}function bn(t,e,n,r,o=!1){
683
- let s=Zt(e),i=ii(t,e,n,r,o);return s.rootNode===i?{$ref:"#"}:ai(i,e)}function ft(t,{referenceBacked:e=!1}={}){return{schema:t,
684
- referenceBacked:e}}function dl(t,e,n,r,o=!1){let s={},i=[];for(let[c,d]of Object.entries(t.structure))C(s,c,Tn(t,c,d,e,n,
649
+ _u(i,n),pointer:s?"#":null};return s?i.rootNode=c:c.pointer=`#/definitions/${c.definitionName}`,i.nodes.push(c),c}function Zs(t,e){
650
+ if(t.status==="built")return{$ref:t.pointer};if(t.status==="building")return{$ref:t.pointer};let n=Yt(e);t.status="build\
651
+ ing",t.pointer!=="#"&&(n.definitions[t.definitionName]={});let r=Cu(t.schema,e,t.operationName,t.operation,t.additionalProperties);
652
+ return t.status="built",t.pointer==="#"?r:(n.definitions[t.definitionName]=r,{$ref:t.pointer})}function gn(t,e,n,r,o=!1){
653
+ let s=Yt(e),i=Ys(t,e,n,r,o);return s.rootNode===i?{$ref:"#"}:Zs(i,e)}function lt(t,{referenceBacked:e=!1}={}){return{schema:t,
654
+ referenceBacked:e}}function Cu(t,e,n,r,o=!1){let s={},i=[];for(let[c,d]of Object.entries(t.structure))_(s,c,vn(t,c,d,e,n,
685
655
  r)),r.enforceRequired&&d.required===!0&&i.push(c);let a={type:"object",properties:s,additionalProperties:o};return i.length>
686
- 0&&(a.required=i),a}function ul(t,e,n,r,o,s){let i=Kt(e,n);if(!i)return null;if(i.kind==="schema")return{...Yt(bn(i.schema,
656
+ 0&&(a.required=i),a}function Au(t,e,n,r,o,s){let i=Wt(e,n);if(!i)return null;if(i.kind==="schema")return{...Xt(gn(i.schema,
687
657
  r,"replace",i.schema.operations.replace,!1)),[fe]:{castType:"object"}};let a=n.items.type==="object"&&Object.hasOwn(n.items,
688
- "schema")?"replace":o,c=a==="replace"?t.operations.replace:s;return Tn(t,`${e}[]`,n.items,r,a,c)}function ll(t,e,n,r,o,s){
689
- let i=lt(e,n);if(!i)return null;if(i.kind==="schema")return{...Yt(bn(i.schema,r,"replace",i.schema.operations.replace,!1)),
658
+ "schema")?"replace":o,c=a==="replace"?t.operations.replace:s;return vn(t,`${e}[]`,n.items,r,a,c)}function Eu(t,e,n,r,o,s){
659
+ let i=dt(e,n);if(!i)return null;if(i.kind==="schema")return{...Xt(gn(i.schema,r,"replace",i.schema.operations.replace,!1)),
690
660
  [fe]:{castType:"object"}};let a=i.definition.type==="object"&&Object.hasOwn(i.definition,"schema")?"replace":o,c=a==="re\
691
- place"?t.operations.replace:s;return Tn(t,`${e}.*`,i.definition,r,a,c)}function pl(t,e,n,r,o,s){if(n.type==="object"){let a=Jt(
692
- e,n);if(a.kind==="nested")return ft(bn(a.schema,r,o,s,a.allowAdditionalProperties===!0),{referenceBacked:!0});if(a.kind===
693
- "opaque")return ft({type:"object",additionalProperties:!0});if(a.kind==="map")return ft({type:"object",additionalProperties:ll(
694
- t,e,n,r,o,s)})}let i=tl(t,n)({schema:t,fieldName:e,definition:n,operation:o,mode:o,options:r});if(!i||typeof i!="object"||
661
+ place"?t.operations.replace:s;return vn(t,`${e}.*`,i.definition,r,a,c)}function Ou(t,e,n,r,o,s){if(n.type==="object"){let a=Kt(
662
+ e,n);if(a.kind==="nested")return lt(gn(a.schema,r,o,s,a.allowAdditionalProperties===!0),{referenceBacked:!0});if(a.kind===
663
+ "opaque")return lt({type:"object",additionalProperties:!0});if(a.kind==="map")return lt({type:"object",additionalProperties:Eu(
664
+ t,e,n,r,o,s)})}let i=wu(t,n)({schema:t,fieldName:e,definition:n,operation:o,mode:o,options:r});if(!i||typeof i!="object"||
695
665
  Array.isArray(i))throw new Error(`Type '${n.type}' on field '${e}' returned an invalid JSON Schema fragment.`);if(n.type===
696
- "array"){let a=ul(t,e,n,r,o,s);if(a)return ft({...i,items:a},{referenceBacked:yn(i)})}return ft(i,{referenceBacked:yn(i)})}
697
- function Tn(t,e,n,r,o,s){let i={schema:t,fieldName:e,definition:n,operation:o,mode:o,options:r},a=pl(t,e,n,r,o,s),c=a.referenceBacked?
698
- Yt(a.schema):{...a.schema},d={castType:n.type};for(let l of Object.keys(n)){if(l==="type"||!Object.hasOwn(t.validators,l))
699
- continue;let v=rl(t,l,e);if(!v)continue;let x=v({...i,parameterName:l,parameterValue:n[l],fieldSchema:{...c}});x&&Qu(c,x)}
700
- c[fe]&&(xn(d,c[fe]),delete c[fe]);let p=[];n.nullable===!0&&p.push({type:"null"}),n.nullOnEmpty===!0&&p.push({const:""});
701
- let m=Yt(el(c,p));if(n.defaultTo!==void 0&&s.applyDefaults)if(typeof n.defaultTo!="function"){let l=t._normalizeDefault(
666
+ "array"){let a=Au(t,e,n,r,o,s);if(a)return lt({...i,items:a},{referenceBacked:pn(i)})}return lt(i,{referenceBacked:pn(i)})}
667
+ function vn(t,e,n,r,o,s){let i={schema:t,fieldName:e,definition:n,operation:o,mode:o,options:r},a=Ou(t,e,n,r,o,s),c=a.referenceBacked?
668
+ Xt(a.schema):{...a.schema},d={castType:n.type};for(let l of Object.keys(n)){if(l==="type"||!Object.hasOwn(t.validators,l))
669
+ continue;let v=yu(t,l,e);if(!v)continue;let x=v({...i,parameterName:l,parameterValue:n[l],fieldSchema:{...c}});x&&gu(c,x)}
670
+ c[fe]&&(hn(d,c[fe]),delete c[fe]);let p=[];n.nullable===!0&&p.push({type:"null"}),n.nullOnEmpty===!0&&p.push({const:""});
671
+ let m=Xt(vu(c,p));if(n.defaultTo!==void 0&&s.applyDefaults)if(typeof n.defaultTo!="function"){let l=t._normalizeDefault(
702
672
  n,n.defaultTo,{fieldPath:e,currentObject:{},containerKey:e,objectBeforeCast:{},options:{},settings:t._buildOperationSettings(
703
673
  o,s,{})});if(Object.keys(l.errors).length>0){let v=Object.values(l.errors)[0];throw new Error(`defaultTo for "${e}" is i\
704
- nvalid (${v.code}).`)}m.default=l.value}else d.defaults={providedByFunction:!0};return m[fe]=d,m}function ci(t,e={}){let n=sl(
705
- e),{operationName:r,operation:o}=ol(t,n),s=n.additionalProperties===void 0?!1:n.additionalProperties,i=Zt(n),a=ii(t,n,r,
706
- o,s,{root:!0}),c={$schema:Ku,...ai(a,n)};return Object.keys(i.definitions).length>0&&(c.definitions=i.definitions),c}function di(t){return t!==null&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"}function Rn(t){return t instanceof
707
- Be}function fl(){return{self:!1,children:{}}}function ui(t){return Object.keys(t.children).length>0}function Te(t,e){return`${t}\
708
- .${String(e)}`}function gi(t,e){return t===""?String(e):Te(t,e)}function li(t,e){if(t===e)return"";let n=`${e}.`;return t.
709
- startsWith(n)?t.slice(n.length):null}function qe(t,e){let n={};for(let r of Object.values(t)){let o=Te(e,r.field);C(n,o,
710
- {...r,field:o})}return n}function En(t){return gn(t,"validatePath")}function pi(t){let e={};for(let n of t){let r=En(n),
711
- o=e;for(let s=0;s<r.length;s++){let i=r[s];Object.hasOwn(o,i)||C(o,i,fl()),s===r.length-1&&(o[i].self=!0),o=o[i].children}}
712
- return e}function ml(t,e){let n=t;for(let r of e){if(n==null||typeof n!="object"||!Object.hasOwn(n,r))return;n=n[r]}return n}
713
- function Qt(t){return t===null?!0:Array.isArray(t)||z(t)?Object.keys(t).length>0:t!==void 0}function fi(t){return[...t].
674
+ nvalid (${v.code}).`)}m.default=l.value}else d.defaults={providedByFunction:!0};return m[fe]=d,m}function Qs(t,e={}){let n=xu(
675
+ e),{operationName:r,operation:o}=Su(t,n),s=n.additionalProperties===void 0?!1:n.additionalProperties,i=Yt(n),a=Ys(t,n,r,
676
+ o,s,{root:!0}),c={$schema:lu,...Zs(a,n)};return Object.keys(i.definitions).length>0&&(c.definitions=i.definitions),c}function ei(t){return t!==null&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"}function Tn(t){return t instanceof
677
+ Be}function Ru(){return{self:!1,children:{}}}function ti(t){return Object.keys(t.children).length>0}function be(t,e){return`${t}\
678
+ .${String(e)}`}function ai(t,e){return t===""?String(e):be(t,e)}function ri(t,e){if(t===e)return"";let n=`${e}.`;return t.
679
+ startsWith(n)?t.slice(n.length):null}function qe(t,e){let n={};for(let r of Object.values(t)){let o=be(e,r.field);_(n,o,
680
+ {...r,field:o})}return n}function Sn(t){return dn(t,"validatePath")}function ni(t){let e={};for(let n of t){let r=Sn(n),
681
+ o=e;for(let s=0;s<r.length;s++){let i=r[s];Object.hasOwn(o,i)||_(o,i,Ru()),s===r.length-1&&(o[i].self=!0),o=o[i].children}}
682
+ return e}function Pu(t,e){let n=t;for(let r of e){if(n==null||typeof n!="object"||!Object.hasOwn(n,r))return;n=n[r]}return n}
683
+ function Zt(t){return t===null?!0:Array.isArray(t)||z(t)?Object.keys(t).length>0:t!==void 0}function oi(t){return[...t].
714
684
  sort((e,n)=>{let r=/^[0-9]+$/.test(e),o=/^[0-9]+$/.test(n);return r&&o?Number(e)-Number(n):r?-1:o?1:e.localeCompare(n)})}
715
- function hl(t){return/^[0-9]+$/.test(t)}function gl(t,e=new WeakMap){if(e.has(t))return e.get(t);let n=Object.create(Be.
685
+ function ku(t){return/^[0-9]+$/.test(t)}function Mu(t,e=new WeakMap){if(e.has(t))return e.get(t);let n=Object.create(Be.
716
686
  prototype);return e.set(t,n),n.structure=null,n.types=t.types,n.validators=t.validators,n.operations=t.operations,n.structure=
717
- tr(er(t.structure,e)),n._installOperationMethods(),Object.freeze(n)}function er(t,e=new WeakMap){if(t===null||typeof t!=
718
- "object")return t;if(Rn(t))return gl(t,e);if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){let r=new RegExp(
687
+ er(Qt(t.structure,e)),n._installOperationMethods(),Object.freeze(n)}function Qt(t,e=new WeakMap){if(t===null||typeof t!=
688
+ "object")return t;if(Tn(t))return Mu(t,e);if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){let r=new RegExp(
719
689
  t.source,t.flags);return r.lastIndex=t.lastIndex,r}if(e.has(t))return e.get(t);if(Array.isArray(t)){let r=[];e.set(t,r);
720
- for(let o of t)r.push(er(o,e));return r}if(!z(t))return t;let n={};e.set(t,n);for(let[r,o]of Object.entries(t))C(n,r,er(
721
- o,e));return n}function tr(t,e=new WeakSet){if(t===null||typeof t!="object"||e.has(t)||Rn(t))return t;if(e.add(t),Array.
722
- isArray(t))for(let n of t)tr(n,e);else for(let n of Reflect.ownKeys(t))tr(t[n],e);return Object.freeze(t)}function Cn(t){
723
- return tr(er(t))}var _n=new WeakMap;function On(t,e,n=""){if(!Rn(t)||!Array.isArray(e)||e.length<1)return null;let[r,...o]=e;
724
- if(!Object.hasOwn(t.structure,r))return null;let s=t.structure[r];if(o.length<1)return s;let i=gi(n,r);return vi(t,s,o,i)}
725
- function vi(t,e,n,r){if(e?.type==="object"){let o=t._resolveObjectFieldMode(r,e);return o.kind!=="nested"?null:On(o.schema,
726
- n,r)}if(e?.type==="array"){let o=t._resolveArrayItemsConfig(r,e);if(!o||n.length<1)return null;let[s,...i]=n;if(!hl(s))return null;
727
- let a=Te(r,s);return o.kind==="schema"?i.length<1?null:On(o.schema,i,a):i.length<1?o.definition:vi(t,o.definition,i,a)}return null}
728
- function $e(t,e){let n={...t};if(Array.isArray(t.skipFields)){let r=t.skipFields.map(o=>li(o,e)).filter(o=>o!==null&&o!==
690
+ for(let o of t)r.push(Qt(o,e));return r}if(!z(t))return t;let n={};e.set(t,n);for(let[r,o]of Object.entries(t))_(n,r,Qt(
691
+ o,e));return n}function er(t,e=new WeakSet){if(t===null||typeof t!="object"||e.has(t)||Tn(t))return t;if(e.add(t),Array.
692
+ isArray(t))for(let n of t)er(n,e);else for(let n of Reflect.ownKeys(t))er(t[n],e);return Object.freeze(t)}function wn(t){
693
+ return er(Qt(t))}var yn=new WeakMap;function xn(t,e,n=""){if(!Tn(t)||!Array.isArray(e)||e.length<1)return null;let[r,...o]=e;
694
+ if(!Object.hasOwn(t.structure,r))return null;let s=t.structure[r];if(o.length<1)return s;let i=ai(n,r);return ci(t,s,o,i)}
695
+ function ci(t,e,n,r){if(e?.type==="object"){let o=t._resolveObjectFieldMode(r,e);return o.kind!=="nested"?null:xn(o.schema,
696
+ n,r)}if(e?.type==="array"){let o=t._resolveArrayItemsConfig(r,e);if(!o||n.length<1)return null;let[s,...i]=n;if(!ku(s))return null;
697
+ let a=be(r,s);return o.kind==="schema"?i.length<1?null:xn(o.schema,i,a):i.length<1?o.definition:ci(t,o.definition,i,a)}return null}
698
+ function $e(t,e){let n={...t};if(Array.isArray(t.skipFields)){let r=t.skipFields.map(o=>ri(o,e)).filter(o=>o!==null&&o!==
729
699
  "");r.length>0?n.skipFields=r:delete n.skipFields}if(z(t.skipParams)){let r={};for(let[o,s]of Object.entries(t.skipParams)){
730
- let i=li(o,e);i===null||i===""||C(r,i,s)}Object.keys(r).length>0?n.skipParams=r:delete n.skipParams}return n}var vl=Object.
700
+ let i=ri(o,e);i===null||i===""||_(r,i,s)}Object.keys(r).length>0?n.skipParams=r:delete n.skipParams}return n}var Nu=Object.
731
701
  freeze({create:Object.freeze({targetFields:"schema",enforceRequired:!0,applyDefaults:!0,outputFields:"validated",rejectExplicitUndefined:!0}),
732
702
  replace:Object.freeze({targetFields:"schema",enforceRequired:!0,applyDefaults:!0,outputFields:"validated",rejectExplicitUndefined:!0}),
733
703
  patch:Object.freeze({targetFields:"input",enforceRequired:!1,applyDefaults:!1,outputFields:"input",rejectExplicitUndefined:!0})});
734
- function mi(t,e,n,r){let o=e[n];if(!r.includes(o))throw new Error(`Operation "${t}" must define ${n} as one of: ${r.join(
735
- ", ")}.`)}function An(t,e,n,r=!0){let o=e[n];if(!(o===void 0&&!r)&&typeof o!="boolean")throw new Error(`Operation "${t}"\
736
- must define ${n} as a boolean.`)}function wl(t,e){if(typeof e!="object"||e===null||Array.isArray(e))throw new Error(`Op\
737
- eration "${t}" must be an object.`);return mi(t,e,"targetFields",["schema","input"]),An(t,e,"enforceRequired"),An(t,e,"a\
738
- pplyDefaults"),mi(t,e,"outputFields",["validated","input"]),An(t,e,"rejectExplicitUndefined",!1),Object.freeze({targetFields:e.
704
+ function si(t,e,n,r){let o=e[n];if(!r.includes(o))throw new Error(`Operation "${t}" must define ${n} as one of: ${r.join(
705
+ ", ")}.`)}function In(t,e,n,r=!0){let o=e[n];if(!(o===void 0&&!r)&&typeof o!="boolean")throw new Error(`Operation "${t}"\
706
+ must define ${n} as a boolean.`)}function ju(t,e){if(typeof e!="object"||e===null||Array.isArray(e))throw new Error(`Op\
707
+ eration "${t}" must be an object.`);return si(t,e,"targetFields",["schema","input"]),In(t,e,"enforceRequired"),In(t,e,"a\
708
+ pplyDefaults"),si(t,e,"outputFields",["validated","input"]),In(t,e,"rejectExplicitUndefined",!1),Object.freeze({targetFields:e.
739
709
  targetFields,enforceRequired:e.enforceRequired,applyDefaults:e.applyDefaults,outputFields:e.outputFields,rejectExplicitUndefined:e.
740
- rejectExplicitUndefined===void 0?!0:e.rejectExplicitUndefined})}function yl(t={}){if(typeof t!="object"||t===null||Array.
710
+ rejectExplicitUndefined===void 0?!0:e.rejectExplicitUndefined})}function Du(t={}){if(typeof t!="object"||t===null||Array.
741
711
  isArray(t))throw new Error("Schema operations must be an object.");let e=Object.create(null);for(let[n,r]of Object.entries(
742
- vl))C(e,n,r);for(let[n,r]of Object.entries(t))C(e,n,wl(n,r));return Object.freeze(e)}function hi(t){let e=Object.create(
743
- null);for(let[n,r]of Object.entries(t))C(e,n,r);return Object.freeze(e)}function Il(t){let e={...t};return delete e.operation,
744
- delete e.mode,e}var Be=class{constructor(e,n,r,o={}){fn(e),this.structure=e,this.types=hi(n),this.validators=hi(r),this.
745
- operations=yl(o),this._installOperationMethods()}_typeError(e){return this._paramError(e,"TYPE_CAST_FAILED","Value could\
712
+ Nu))_(e,n,r);for(let[n,r]of Object.entries(t))_(e,n,ju(n,r));return Object.freeze(e)}function ii(t){let e=Object.create(
713
+ null);for(let[n,r]of Object.entries(t))_(e,n,r);return Object.freeze(e)}function zu(t){let e={...t};return delete e.operation,
714
+ delete e.mode,e}var Be=class{constructor(e,n,r,o={}){sn(e),this.structure=e,this.types=ii(n),this.validators=ii(r),this.
715
+ operations=Du(o),this._installOperationMethods()}_typeError(e){return this._paramError(e,"TYPE_CAST_FAILED","Value could\
746
716
  not be cast to the required type.")}_paramError(e,n,r,o={}){let s=new Error(r);return s.errorObject={field:e,code:n,message:r,
747
717
  params:o},s}_paramToBeSkipped(e,n,r){return typeof n!="object"||n===null?!1:!!(Array.isArray(n[r])&&n[r].includes(e))}_fieldToBeSkipped(e,n){
748
- return Array.isArray(n.skipFields)&&n.skipFields.includes(e)}_mergeErrors(e,n){for(let[r,o]of Object.entries(n))C(e,r,o)}_singleErrorMap(e){
749
- let n={};return C(n,e.field,e),n}_assertSupportedOptions(e={}){if(Object.hasOwn(e,"onlyObjectValues"))throw new Error("U\
718
+ return Array.isArray(n.skipFields)&&n.skipFields.includes(e)}_mergeErrors(e,n){for(let[r,o]of Object.entries(n))_(e,r,o)}_singleErrorMap(e){
719
+ let n={};return _(n,e.field,e),n}_assertSupportedOptions(e={}){if(Object.hasOwn(e,"onlyObjectValues"))throw new Error("U\
750
720
  nsupported validation option `onlyObjectValues`. Call `patch()` directly.");if(Object.hasOwn(e,"mode"))throw new Error("\
751
721
  Unsupported validation option `mode`. Call `validateWith()` or an operation method directly.");if(Object.hasOwn(e,"opera\
752
722
  tion"))throw new Error("Unsupported validation option `operation`. Call `validateWith()` or an operation method directly\
@@ -757,124 +727,124 @@ isFieldPresent:o=>Object.hasOwn(r,o)}}_assertPlainObjectInput(e,n){if(!z(n))thro
757
727
  ct input.`)}_resolvePathValidationRequest(e={}){let n=e.operation??e.mode??"patch";if(Object.hasOwn(e,"operation")&&Object.
758
728
  hasOwn(e,"mode")&&e.operation!==e.mode)throw new Error("Path validation options `operation` and `mode` must match when b\
759
729
  oth are provided.");if(!Object.hasOwn(this.operations,n))throw new Error(`Unknown operation "${n}".`);let r=this.operations[n];
760
- return{operationName:n,operation:r,validationOptions:Il(e)}}_buildOperationResult(e,n,r){let o={};for(let s of r.outputFieldNames){
730
+ return{operationName:n,operation:r,validationOptions:zu(e)}}_buildOperationResult(e,n,r){let o={};for(let s of r.outputFieldNames){
761
731
  if(!Object.hasOwn(this.structure,s))continue;let i=r.isFieldPresent(s);(n[s]!==void 0||i&&e[s]===null||r.defaultedFields.
762
- has(s))&&(!i&&!r.defaultedFields.has(s)||C(o,s,n[s]))}return o}_resolveObjectFieldMode(e,n){return Jt(e,n)}_resolveArrayItemsConfig(e,n){
763
- return Kt(e,n)}_resolveObjectValuesConfig(e,n){return lt(e,n)}_buildArrayItemSettings(e,n){return e.type==="object"&&Object.
732
+ has(s))&&(!i&&!r.defaultedFields.has(s)||_(o,s,n[s]))}return o}_resolveObjectFieldMode(e,n){return Kt(e,n)}_resolveArrayItemsConfig(e,n){
733
+ return Wt(e,n)}_resolveObjectValuesConfig(e,n){return dt(e,n)}_buildArrayItemSettings(e,n){return e.type==="object"&&Object.
764
734
  hasOwn(e,"schema")?{...n,operationName:"replace",operation:this.operations.replace}:n}_castValue(e,n,r,o,s,i,a,c){let d=e.
765
735
  nullable===!0||a.nullable===!0,p=e.nullOnEmpty===!0||a.nullOnEmpty===!0;if(!Object.hasOwn(this.types,e.type))throw new Error(
766
- `No casting function for type: ${e.type}`);let m=this.types[e.type];if(n===null)return d?(C(o,s,null),{errors:{},shouldContinue:!1}):
736
+ `No casting function for type: ${e.type}`);let m=this.types[e.type];if(n===null)return d?(_(o,s,null),{errors:{},shouldContinue:!1}):
767
737
  {errors:this._singleErrorMap({field:r,code:"NOT_NULLABLE",message:"Field cannot be null",params:{}}),shouldContinue:!1};
768
- if(n===""&&p)return C(o,s,null),{errors:{},shouldContinue:!1};let l={schema:this,definition:e,value:n,fieldName:r,object:o,
738
+ if(n===""&&p)return _(o,s,null),{errors:{},shouldContinue:!1};let l={schema:this,definition:e,value:n,fieldName:r,object:o,
769
739
  objectBeforeCast:i,valueBeforeCast:n,options:a,mode:c.operationName,operation:c.operationName,fieldPresent:!0,computedOptions:{
770
- nullable:d||p,nullOnEmpty:p},throwTypeError:()=>{throw this._typeError(r)},throwParamError:(v,x,b)=>{throw this._paramError(
771
- r,v,x,b)}};try{let v=m(l);if(di(v))throw new Error(`Type handler for "${e.type}" must be synchronous.`);v!==void 0&&(C(o,
740
+ nullable:d||p,nullOnEmpty:p},throwTypeError:()=>{throw this._typeError(r)},throwParamError:(v,x,T)=>{throw this._paramError(
741
+ r,v,x,T)}};try{let v=m(l);if(ei(v))throw new Error(`Type handler for "${e.type}" must be synchronous.`);v!==void 0&&(_(o,
772
742
  s,v),l.value=v)}catch(v){if(v.errorObject)return{errors:this._singleErrorMap(v.errorObject),shouldContinue:!1};throw v}return{
773
743
  errors:{},context:l,shouldContinue:!0}}_runFieldValidators(e,n,r,o,s,i){for(let a of Object.keys(e)){if(a==="type"||this.
774
744
  _paramToBeSkipped(a,i.skipParams,n)||!Object.hasOwn(this.validators,a))continue;let c=this.validators[a];try{s.parameterName=
775
- a,s.parameterValue=e[a];let d=c(s);if(di(d))throw new Error(`Validator handler for "${a}" must be synchronous.`);d!==void 0&&
776
- (C(r,o,d),s.value=d)}catch(d){if(d.errorObject)return this._singleErrorMap(d.errorObject);throw d}}return{}}_normalizeAndValidateValue(e,n,r,o,s,i,a,c){
745
+ a,s.parameterValue=e[a];let d=c(s);if(ei(d))throw new Error(`Validator handler for "${a}" must be synchronous.`);d!==void 0&&
746
+ (_(r,o,d),s.value=d)}catch(d){if(d.errorObject)return this._singleErrorMap(d.errorObject);throw d}}return{}}_normalizeAndValidateValue(e,n,r,o,s,i,a,c){
777
747
  let d=this._castValue(e,n,r,o,s,i,a,c);if(Object.keys(d.errors).length>0)return d.errors;if(!d.shouldContinue)return{};let{
778
748
  context:p}=d,m=this._validateNestedValue(e,r,o,s,a,c);return Object.keys(m).length>0?m:(p.value=o[s],this._runFieldValidators(
779
749
  e,r,o,s,p,a))}_normalizeDefault(e,n,{fieldPath:r,currentObject:o,containerKey:s,objectBeforeCast:i,options:a,settings:c}){
780
- let d={...o};return C(d,s,n),{errors:this._normalizeAndValidateValue(e,n,r,d,s,i,a,c),value:d[s]}}_validateNestedValue(e,n,r,o,s,i){
750
+ let d={...o};return _(d,s,n),{errors:this._normalizeAndValidateValue(e,n,r,d,s,i,a,c),value:d[s]}}_validateNestedValue(e,n,r,o,s,i){
781
751
  if(e.type==="object"){let c=this._resolveObjectFieldMode(n,e);return c.kind==="nested"?this._validateNestedObjectSchema(
782
752
  c,n,r,o,s,i):c.kind==="map"?this._validateObjectValues(n,r,o,c.valuesConfig,s,i):{}}if(e.type!=="array")return{};let a=this.
783
753
  _resolveArrayItemsConfig(n,e);return a?this._validateArrayItems(n,r,o,a,s,i):{}}_validateNestedObjectSchema(e,n,r,o,s,i){
784
754
  let a=r[o],c=e.allowAdditionalProperties?this._extractKnownObjectFields(a,e.schema):a,d=e.schema._validateWithOperation(
785
- i.operationName,i.operation,c,$e(s,n));return C(r,o,e.allowAdditionalProperties?this._mergeKnownAndPassthroughObjectFields(
755
+ i.operationName,i.operation,c,$e(s,n));return _(r,o,e.allowAdditionalProperties?this._mergeKnownAndPassthroughObjectFields(
786
756
  a,e.schema,d.validatedObject):d.validatedObject),qe(d.errors,n)}_extractKnownObjectFields(e,n){let r={};for(let[o,s]of Object.
787
- entries(e))Object.hasOwn(n.structure,o)&&C(r,o,s);return r}_mergeKnownAndPassthroughObjectFields(e,n,r){let o={};for(let s of Object.
788
- keys(e)){if(!Object.hasOwn(n.structure,s)){C(o,s,e[s]);continue}Object.hasOwn(r,s)&&C(o,s,r[s])}for(let[s,i]of Object.entries(
789
- r))Object.hasOwn(o,s)||C(o,s,i);return o}_validateObjectValues(e,n,r,o,s,i){let a=n[r],c={...a},d={};C(n,r,c);for(let p of Object.
790
- keys(a)){let m=Te(e,p);if(this._fieldToBeSkipped(m,s))continue;let l=c[p];if(l===void 0){i.rejectExplicitUndefined?this.
757
+ entries(e))Object.hasOwn(n.structure,o)&&_(r,o,s);return r}_mergeKnownAndPassthroughObjectFields(e,n,r){let o={};for(let s of Object.
758
+ keys(e)){if(!Object.hasOwn(n.structure,s)){_(o,s,e[s]);continue}Object.hasOwn(r,s)&&_(o,s,r[s])}for(let[s,i]of Object.entries(
759
+ r))Object.hasOwn(o,s)||_(o,s,i);return o}_validateObjectValues(e,n,r,o,s,i){let a=n[r],c={...a},d={};_(n,r,c);for(let p of Object.
760
+ keys(a)){let m=be(e,p);if(this._fieldToBeSkipped(m,s))continue;let l=c[p];if(l===void 0){i.rejectExplicitUndefined?this.
791
761
  _mergeErrors(d,this._singleErrorMap(this._typeError(m).errorObject)):delete c[p];continue}if(o.kind==="schema"){let x=o.
792
- schema._validateWithOperation("replace",o.schema.operations.replace,l,$e(s,m));C(c,p,x.validatedObject),this._mergeErrors(
762
+ schema._validateWithOperation("replace",o.schema.operations.replace,l,$e(s,m));_(c,p,x.validatedObject),this._mergeErrors(
793
763
  d,qe(x.errors,m));continue}let v=this._normalizeAndValidateValue(o.definition,l,m,c,p,a,s,this._buildArrayItemSettings(o.
794
- definition,i));this._mergeErrors(d,v)}return d}_validateArrayItems(e,n,r,o,s,i){let a=n[r],c=a.slice(),d={};C(n,r,c);for(let p=0;p<
795
- c.length;p++){let m=Te(e,p);if(this._fieldToBeSkipped(m,s))continue;if(!Object.hasOwn(a,p)||c[p]===void 0){i.rejectExplicitUndefined?
764
+ definition,i));this._mergeErrors(d,v)}return d}_validateArrayItems(e,n,r,o,s,i){let a=n[r],c=a.slice(),d={};_(n,r,c);for(let p=0;p<
765
+ c.length;p++){let m=be(e,p);if(this._fieldToBeSkipped(m,s))continue;if(!Object.hasOwn(a,p)||c[p]===void 0){i.rejectExplicitUndefined?
796
766
  this._mergeErrors(d,this._singleErrorMap(this._typeError(m).errorObject)):delete c[p];continue}if(o.kind==="schema"){let v=o.
797
- schema._validateWithOperation("replace",o.schema.operations.replace,c[p],$e(s,m));C(c,p,v.validatedObject),this._mergeErrors(
767
+ schema._validateWithOperation("replace",o.schema.operations.replace,c[p],$e(s,m));_(c,p,v.validatedObject),this._mergeErrors(
798
768
  d,qe(v.errors,m));continue}let l=this._normalizeAndValidateValue(o.definition,c[p],m,c,p,a,s,this._buildArrayItemSettings(
799
769
  o.definition,i));this._mergeErrors(d,l)}return d}_validateField(e,n,r,o,s){if(!Object.hasOwn(this.structure,e))return{};
800
770
  let i=this.structure[e];if(this._fieldToBeSkipped(e,o))return{};let a=s.isFieldPresent(e),c=n[e],d=c===void 0;return s.enforceRequired&&
801
771
  i.required&&(!a||d)&&!this._paramToBeSkipped("required",o.skipParams,e)?this._singleErrorMap({field:e,code:"REQUIRED",message:"\
802
772
  Field is required",params:{}}):a?d?s.rejectExplicitUndefined?this._singleErrorMap(this._typeError(e).errorObject):{}:this.
803
773
  _normalizeAndValidateValue(i,c,e,r,e,n,o,s):{}}_validateWithOperation(e,n,r,o){this._assertSupportedOptions(o);let s={},
804
- i={...r},a=this._buildOperationSettings(e,n,r);for(let c of Object.keys(r))Object.hasOwn(this.structure,c)||C(s,c,{field:c,
774
+ i={...r},a=this._buildOperationSettings(e,n,r);for(let c of Object.keys(r))Object.hasOwn(this.structure,c)||_(s,c,{field:c,
805
775
  code:"FIELD_NOT_ALLOWED",message:"Field not allowed",params:{}});for(let c of a.targetFieldNames){let d=this._validateField(
806
776
  c,r,i,o,a);this._mergeErrors(s,d)}if(a.applyDefaults){for(let c of Object.keys(this.structure))if(!a.isFieldPresent(c)&&
807
777
  this.structure[c].defaultTo!==void 0){let d=this.structure[c],p=typeof d.defaultTo=="function"?d.defaultTo():d.defaultTo,
808
778
  m=this._normalizeDefault(d,p,{fieldPath:c,currentObject:i,containerKey:c,objectBeforeCast:r,options:o,settings:a});if(this.
809
- _mergeErrors(s,m.errors),Object.keys(m.errors).length>0)continue;C(i,c,m.value),a.defaultedFields.add(c)}}return{validatedObject:this.
810
- _buildOperationResult(r,i,a),errors:s}}_validateSelectedTree(e,n,r,o,s=""){let i={},a={};for(let c of fi(Object.keys(e))){
811
- let d=gi(s,c);if(!Object.hasOwn(this.structure,c))throw new Error(`Unknown schema path "${d}".`);let p=this._validateSelectedField(
779
+ _mergeErrors(s,m.errors),Object.keys(m.errors).length>0)continue;_(i,c,m.value),a.defaultedFields.add(c)}}return{validatedObject:this.
780
+ _buildOperationResult(r,i,a),errors:s}}_validateSelectedTree(e,n,r,o,s=""){let i={},a={};for(let c of oi(Object.keys(e))){
781
+ let d=ai(s,c);if(!Object.hasOwn(this.structure,c))throw new Error(`Unknown schema path "${d}".`);let p=this._validateSelectedField(
812
782
  c,e[c],n,a,r,o,d);this._mergeErrors(i,p)}return{validatedObject:a,errors:i}}_validateSelectedField(e,n,r,o,s,i,a){if(!Object.
813
- hasOwn(this.structure,e))return{};let c=this.structure[e],d=n.self===!0,p=ui(n);if(this._fieldToBeSkipped(a,s))return{};
783
+ hasOwn(this.structure,e))return{};let c=this.structure[e],d=n.self===!0,p=ti(n);if(this._fieldToBeSkipped(a,s))return{};
814
784
  let m=Object.hasOwn(r,e),l=r[e],v={};if(!m){if(d&&i.enforceRequired&&c.required&&!this._paramToBeSkipped("required",s.skipParams,
815
785
  a)&&this._mergeErrors(v,this._singleErrorMap({field:a,code:"REQUIRED",message:"Field is required",params:{}})),d&&i.applyDefaults&&
816
786
  c.defaultTo!==void 0){let P=typeof c.defaultTo=="function"?c.defaultTo():c.defaultTo,j=this._normalizeDefault(c,P,{fieldPath:a,
817
787
  currentObject:o,containerKey:e,objectBeforeCast:r,options:s,settings:i});this._mergeErrors(v,j.errors),Object.keys(j.errors).
818
- length===0&&C(o,e,j.value)}return v}if(l===void 0)return d&&i.rejectExplicitUndefined?this._singleErrorMap(this._typeError(
788
+ length===0&&_(o,e,j.value)}return v}if(l===void 0)return d&&i.rejectExplicitUndefined?this._singleErrorMap(this._typeError(
819
789
  a).errorObject):{};let x={[e]:l};if(d){let P=this._normalizeAndValidateValue(c,l,a,x,e,r,s,i);return Object.hasOwn(x,e)&&
820
- x[e]!==void 0?C(o,e,x[e]):x[e]===null&&C(o,e,null),P}if(!p)return{};let b=this._castValue(c,l,a,x,e,r,s,i);if(Object.keys(
821
- b.errors).length>0)return b.errors;if(!b.shouldContinue)return{};let O=this._validateSelectedDescendants(c,n.children,a,
822
- x,e,s,i);return Qt(x[e])&&C(o,e,x[e]),O}_validateSelectedDescendants(e,n,r,o,s,i,a){if(e.type==="object"){let c=this._resolveObjectFieldMode(
790
+ x[e]!==void 0?_(o,e,x[e]):x[e]===null&&_(o,e,null),P}if(!p)return{};let T=this._castValue(c,l,a,x,e,r,s,i);if(Object.keys(
791
+ T.errors).length>0)return T.errors;if(!T.shouldContinue)return{};let O=this._validateSelectedDescendants(c,n.children,a,
792
+ x,e,s,i);return Zt(x[e])&&_(o,e,x[e]),O}_validateSelectedDescendants(e,n,r,o,s,i,a){if(e.type==="object"){let c=this._resolveObjectFieldMode(
823
793
  r,e);if(c.kind!=="nested")throw new Error(`Schema path "${r}" does not support nested field selection.`);let d=o[s];if(!z(
824
- d))return{};let p=c.schema._validateSelectedTree(n,d,$e(i,r),{...a,defaultedFields:new Set});return C(o,s,p.validatedObject),
794
+ d))return{};let p=c.schema._validateSelectedTree(n,d,$e(i,r),{...a,defaultedFields:new Set});return _(o,s,p.validatedObject),
825
795
  qe(p.errors,r)}if(e.type==="array"){let c=this._resolveArrayItemsConfig(r,e);if(!c)throw new Error(`Schema path "${r}" d\
826
796
  oes not define array items for nested selection.`);return this._validateSelectedArrayItems(r,o,s,c,n,i,a)}throw new Error(
827
797
  `Schema path "${r}" does not support nested field selection.`)}_validateSelectedArrayItems(e,n,r,o,s,i,a){let c=[],d=n[r],
828
- p={};C(n,r,c);for(let m of fi(Object.keys(s))){if(!/^[0-9]+$/.test(m))throw new Error(`Schema path "${Te(e,m)}" is inval\
829
- id because array segments must use numeric indexes.`);let l=Number(m),v=Te(e,l),x=s[m],b=x.self===!0,O=ui(x);if(this._fieldToBeSkipped(
830
- v,i))continue;if(!Object.hasOwn(d,l)){b&&a.rejectExplicitUndefined&&C(p,v,this._typeError(v).errorObject);continue}let P=d[l];
831
- if(P===void 0){b&&a.rejectExplicitUndefined&&C(p,v,this._typeError(v).errorObject);continue}if(o.kind==="schema"){if(b){
832
- let q=o.schema._validateWithOperation("replace",o.schema.operations.replace,P,$e(i,v));Qt(q.validatedObject)&&C(c,l,q.validatedObject),
798
+ p={};_(n,r,c);for(let m of oi(Object.keys(s))){if(!/^[0-9]+$/.test(m))throw new Error(`Schema path "${be(e,m)}" is inval\
799
+ id because array segments must use numeric indexes.`);let l=Number(m),v=be(e,l),x=s[m],T=x.self===!0,O=ti(x);if(this._fieldToBeSkipped(
800
+ v,i))continue;if(!Object.hasOwn(d,l)){T&&a.rejectExplicitUndefined&&_(p,v,this._typeError(v).errorObject);continue}let P=d[l];
801
+ if(P===void 0){T&&a.rejectExplicitUndefined&&_(p,v,this._typeError(v).errorObject);continue}if(o.kind==="schema"){if(T){
802
+ let q=o.schema._validateWithOperation("replace",o.schema.operations.replace,P,$e(i,v));Zt(q.validatedObject)&&_(c,l,q.validatedObject),
833
803
  this._mergeErrors(p,qe(q.errors,v));continue}if(!O)continue;let H=o.schema._validateSelectedTree(x.children,P,$e(i,v),{...a,
834
- operationName:"replace",operation:o.schema.operations.replace,defaultedFields:new Set});Qt(H.validatedObject)&&C(c,l,H.validatedObject),
835
- this._mergeErrors(p,qe(H.errors,v));continue}let j=this._buildArrayItemSettings(o.definition,a),D=[P];if(b){let H=this._normalizeAndValidateValue(
836
- o.definition,P,v,D,0,d,i,j);Object.hasOwn(D,0)&&D[0]!==void 0?C(c,l,D[0]):D[0]===null&&C(c,l,null),this._mergeErrors(p,H);
804
+ operationName:"replace",operation:o.schema.operations.replace,defaultedFields:new Set});Zt(H.validatedObject)&&_(c,l,H.validatedObject),
805
+ this._mergeErrors(p,qe(H.errors,v));continue}let j=this._buildArrayItemSettings(o.definition,a),D=[P];if(T){let H=this._normalizeAndValidateValue(
806
+ o.definition,P,v,D,0,d,i,j);Object.hasOwn(D,0)&&D[0]!==void 0?_(c,l,D[0]):D[0]===null&&_(c,l,null),this._mergeErrors(p,H);
837
807
  continue}if(!O)continue;let U=this._castValue(o.definition,P,v,D,0,d,i,j);if(Object.keys(U.errors).length>0){this._mergeErrors(
838
808
  p,U.errors);continue}if(!U.shouldContinue)continue;let J=this._validateSelectedDescendants(o.definition,x.children,v,D,0,
839
- i,j);Qt(D[0])&&C(c,l,D[0]),this._mergeErrors(p,J)}return p}validateWith(e,n,r={}){if(!Object.hasOwn(this.operations,e))throw new Error(
809
+ i,j);Zt(D[0])&&_(c,l,D[0]),this._mergeErrors(p,J)}return p}validateWith(e,n,r={}){if(!Object.hasOwn(this.operations,e))throw new Error(
840
810
  `Unknown operation "${e}".`);let o=this.operations[e];return this._assertPlainObjectInput(e,n),this._validateWithOperation(
841
- e,o,n,r)}validateAt(e,n,r={}){this._assertPlainObjectInput("validateAt",n);let o=En(e),{operationName:s,operation:i,validationOptions:a}=this.
842
- _resolvePathValidationRequest(r),c=this._validateSelectedTree(pi([e]),n,a,this._buildOperationSettings(s,i,n));return{validatedValue:ml(
811
+ e,o,n,r)}validateAt(e,n,r={}){this._assertPlainObjectInput("validateAt",n);let o=Sn(e),{operationName:s,operation:i,validationOptions:a}=this.
812
+ _resolvePathValidationRequest(r),c=this._validateSelectedTree(ni([e]),n,a,this._buildOperationSettings(s,i,n));return{validatedValue:Pu(
843
813
  c.validatedObject,o),errors:c.errors}}validatePaths(e,n,r={}){if(this._assertPlainObjectInput("validatePaths",n),!Array.
844
814
  isArray(e)||e.length===0)throw new Error("validatePaths() expects a non-empty array of schema paths.");let{operationName:o,
845
- operation:s,validationOptions:i}=this._resolvePathValidationRequest(r);return this._validateSelectedTree(pi(e),n,i,this.
815
+ operation:s,validationOptions:i}=this._resolvePathValidationRequest(r);return this._validateSelectedTree(ni(e),n,i,this.
846
816
  _buildOperationSettings(o,s,n))}_installOperationMethods(){for(let e of Object.keys(this.operations)){if(e in this)throw new Error(
847
817
  `Operation name "${e}" is reserved and cannot be used as a schema method.`);this[e]=(n,r={})=>this.validateWith(e,n,r)}}toJsonSchema(e={}){
848
- return ci(this,e)}getFieldDefinitions(){return _n.has(this)||_n.set(this,Cn(this.structure)),_n.get(this)}getFieldDefinition(e){
849
- if(typeof e!="string"||e.trim()==="")throw new Error("Field path must be a non-empty string.");let n=On(this,En(e.trim()));
850
- return n===null?null:Cn(n)}getFieldMessages(e){let n=this.getFieldDefinition(e);return!n||typeof n.messages!="object"||n.
851
- messages===null?Object.freeze({}):Cn(n.messages)}cleanup(e,n){let r={};for(let o of Object.keys(e))Object.hasOwn(this.structure,
852
- o)&&this.structure[o][n]&&C(r,o,e[o]);return r}};var{parse:__,stringify:Sl}=JSON,{keys:A_}=Object,xl=String,bl="string";var wi="object",Tl=(t,e)=>e;var yi=(t,e,n)=>{let r=xl(e.push(n)-1);return t.set(n,r),r};var Ii=(t,e,n)=>{let r=e&&typeof e===wi?(p,m)=>p===""||-1<e.indexOf(p)?m:void 0:e||Tl,o=new Map,s=[],i=[],a=+yi(o,s,r.call(
853
- {"":t},"",t)),c=!a;for(;a<s.length;)c=!0,i[a]=Sl(s[a++],d,n);return"["+i.join(",")+"]";function d(p,m){if(c)return c=!c,
854
- m;let l=r.call(this,p,m);switch(typeof l){case wi:if(l===null)return l;case bl:return o.get(l)||yi(o,s,l)}return l}};var _l=new Set(["true","1","yes","y","on"]),Al=new Set(["false","0","no","n","off"]);function El(t){return t!==null&&(typeof t==
855
- "object"||typeof t=="function")&&typeof t.then=="function"}function Si(t){if(typeof t=="number")return Number.isFinite(t)?
818
+ return Qs(this,e)}getFieldDefinitions(){return yn.has(this)||yn.set(this,wn(this.structure)),yn.get(this)}getFieldDefinition(e){
819
+ if(typeof e!="string"||e.trim()==="")throw new Error("Field path must be a non-empty string.");let n=xn(this,Sn(e.trim()));
820
+ return n===null?null:wn(n)}getFieldMessages(e){let n=this.getFieldDefinition(e);return!n||typeof n.messages!="object"||n.
821
+ messages===null?Object.freeze({}):wn(n.messages)}cleanup(e,n){let r={};for(let o of Object.keys(e))Object.hasOwn(this.structure,
822
+ o)&&this.structure[o][n]&&_(r,o,e[o]);return r}};var{parse:GS,stringify:Lu}=JSON,{keys:WS}=Object,Uu=String,Fu="string";var di="object",qu=(t,e)=>e;var ui=(t,e,n)=>{let r=Uu(e.push(n)-1);return t.set(n,r),r};var li=(t,e,n)=>{let r=e&&typeof e===di?(p,m)=>p===""||-1<e.indexOf(p)?m:void 0:e||qu,o=new Map,s=[],i=[],a=+ui(o,s,r.call(
823
+ {"":t},"",t)),c=!a;for(;a<s.length;)c=!0,i[a]=Lu(s[a++],d,n);return"["+i.join(",")+"]";function d(p,m){if(c)return c=!c,
824
+ m;let l=r.call(this,p,m);switch(typeof l){case di:if(l===null)return l;case Fu:return o.get(l)||ui(o,s,l)}return l}};var Bu=new Set(["true","1","yes","y","on"]),Hu=new Set(["false","0","no","n","off"]);function Vu(t){return t!==null&&(typeof t==
825
+ "object"||typeof t=="function")&&typeof t.then=="function"}function pi(t){if(typeof t=="number")return Number.isFinite(t)?
856
826
  t:null;if(typeof t=="bigint"){let e=Number(t);return Number.isSafeInteger(e)?e:null}if(typeof t=="string"){let e=t.trim();
857
- if(e==="")return null;let n=Number(e);return Number.isFinite(n)?n:null}return null}function Pn(t,e){if(Object.is(t,e))return!0;
827
+ if(e==="")return null;let n=Number(e);return Number.isFinite(n)?n:null}return null}function bn(t,e){if(Object.is(t,e))return!0;
858
828
  if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();if(t instanceof RegExp&&e instanceof RegExp)return t.
859
829
  source===e.source&&t.flags===e.flags;if(Array.isArray(t)||Array.isArray(e)){if(!Array.isArray(t)||!Array.isArray(e)||t.length!==
860
- e.length)return!1;for(let o=0;o<t.length;o++)if(!Pn(t[o],e[o]))return!1;return!0}if(t===null||e===null||typeof t!="objec\
830
+ e.length)return!1;for(let o=0;o<t.length;o++)if(!bn(t[o],e[o]))return!1;return!0}if(t===null||e===null||typeof t!="objec\
861
831
  t"||typeof e!="object"||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;let n=Object.keys(t),r=Object.keys(
862
- e);if(n.length!==r.length)return!1;for(let o of n)if(!Object.hasOwn(e,o)||!Pn(t[o],e[o]))return!1;return!0}var Ol={install(t){
832
+ e);if(n.length!==r.length)return!1;for(let o of n)if(!Object.hasOwn(e,o)||!bn(t[o],e[o]))return!1;return!0}var Gu={install(t){
863
833
  let{addType:e,addValidator:n}=t;e("none",r=>r.value),e("file",r=>{let o=r.value;o==null&&r.throwTypeError();let s=typeof o;
864
834
  if(s==="string"||s==="number"||s==="boolean"){let i=o.toString();return r.definition.noTrim?i:i.trim()}r.throwTypeError()}),
865
835
  e("string",r=>{let o=r.value;if(o==null)return"";let s=typeof o;if(s==="string"||s==="number"||s==="boolean"){let i=o.toString();
866
- return r.definition.noTrim?i:i.trim()}r.throwTypeError()}),e("blob",r=>r.value),e("number",r=>{let o=Si(r.value);return o===
867
- null&&r.throwTypeError(),o}),e("integer",r=>{let o=Si(r.value);return(o===null||!Number.isInteger(o))&&r.throwTypeError(),
868
- o}),e("epochMilliseconds",r=>{let o=hn(r.value,864e13);return o===null&&r.throwTypeError(),o}),e("epochSeconds",r=>{let o=hn(
869
- r.value,864e10);return o===null&&r.throwTypeError(),o}),e("dateTime",r=>{let o=pt(r.definition,r.fieldName);return ei(r.
870
- value,o)||r.throwTypeError(),r.value}),e("date",r=>(Zs(r.value)||r.throwTypeError(),r.value)),e("time",r=>{let o=pt(r.definition,
871
- r.fieldName);return Qs(r.value,o)||r.throwTypeError(),r.value}),e("array",r=>r.definition.type==="array"&&!Array.isArray(
836
+ return r.definition.noTrim?i:i.trim()}r.throwTypeError()}),e("blob",r=>r.value),e("number",r=>{let o=pi(r.value);return o===
837
+ null&&r.throwTypeError(),o}),e("integer",r=>{let o=pi(r.value);return(o===null||!Number.isInteger(o))&&r.throwTypeError(),
838
+ o}),e("epochMilliseconds",r=>{let o=cn(r.value,864e13);return o===null&&r.throwTypeError(),o}),e("epochSeconds",r=>{let o=cn(
839
+ r.value,864e10);return o===null&&r.throwTypeError(),o}),e("dateTime",r=>{let o=ut(r.definition,r.fieldName);return Vs(r.
840
+ value,o)||r.throwTypeError(),r.value}),e("date",r=>(Bs(r.value)||r.throwTypeError(),r.value)),e("time",r=>{let o=ut(r.definition,
841
+ r.fieldName);return Hs(r.value,o)||r.throwTypeError(),r.value}),e("array",r=>r.definition.type==="array"&&!Array.isArray(
872
842
  r.value)?[r.value]:r.value),e("object",r=>(z(r.value)||r.throwTypeError(),r.value)),e("serialize",r=>{try{return JSON.stringify(
873
- r.value)}catch{try{return Ii(r.value)}catch{r.throwTypeError()}}}),e("boolean",r=>{if(typeof r.value=="boolean")return r.
843
+ r.value)}catch{try{return li(r.value)}catch{r.throwTypeError()}}}),e("boolean",r=>{if(typeof r.value=="boolean")return r.
874
844
  value;if(typeof r.value=="number"){if(r.value===1)return!0;if(r.value===0)return!1;r.throwTypeError()}if(typeof r.value==
875
845
  "bigint"){if(r.value===1n)return!0;if(r.value===0n)return!1;r.throwTypeError()}if(typeof r.value=="string"){let o=String(
876
846
  r.definition.stringFalseWhen||"false").trim().toLowerCase(),s=String(r.definition.stringTrueWhen||"true").trim().toLowerCase(),
877
- i=r.value.trim().toLowerCase(),a=new Set([...Al,o]),c=new Set([..._l,s]);if(a.has(i))return!1;if(c.has(i))return!0}r.throwTypeError()}),
847
+ i=r.value.trim().toLowerCase(),a=new Set([...Hu,o]),c=new Set([...Bu,s]);if(a.has(i))return!1;if(c.has(i))return!0}r.throwTypeError()}),
878
848
  e("id",r=>{if(typeof r.value=="number"){if(Number.isSafeInteger(r.value)&&r.value>0)return r.value;r.throwTypeError()}if(typeof r.
879
849
  value=="bigint"){if(r.value>0n&&r.value<=BigInt(Number.MAX_SAFE_INTEGER))return Number(r.value);r.throwTypeError()}if(typeof r.
880
850
  value=="string"){let o=r.value.trim();/^[1-9][0-9]*$/.test(o)||r.throwTypeError();let s=Number(o);return Number.isSafeInteger(
@@ -887,7 +857,7 @@ r.value.toString().length>r.parameterValue&&r.throwParamError("MAX_LENGTH",`Leng
887
857
  characters.`,{max:r.parameterValue,actual:r.value.toString().length})}),n("max",r=>{r.value!==void 0&&Ue(r.definition)&&
888
858
  typeof r.value=="number"&&r.value>r.parameterValue&&r.throwParamError("MAX_VALUE",`Value must be no more than ${r.parameterValue}\
889
859
  .`,{max:r.parameterValue,actual:r.value})}),n("enum",r=>{if(!Array.isArray(r.parameterValue))throw new Error(`Enum for ${r.
890
- fieldName} must be an array.`);r.parameterValue.some(s=>Pn(s,r.value))||r.throwParamError("ENUM_VALUE","Value must match\
860
+ fieldName} must be an array.`);r.parameterValue.some(s=>bn(s,r.value))||r.throwParamError("ENUM_VALUE","Value must match\
891
861
  one of the allowed enum values.",{allowed:r.parameterValue})}),n("pattern",r=>{if(r.value===void 0||r.definition.type!==
892
862
  "string"||typeof r.value!="string")return;let o=r.parameterValue,s=o instanceof RegExp?new RegExp(o.source,o.flags):typeof o==
893
863
  "string"?new RegExp(o):null;if(!s)throw new Error(`Pattern for ${r.fieldName} must be a string or RegExp.`);s.test(r.value)||
@@ -895,7 +865,7 @@ r.throwParamError("PATTERN","Value does not match the required pattern.",{patter
895
865
  parameterValue){if(r.definition.type!=="boolean")throw new Error(`strictBoolean can only be used on boolean fields (${r.
896
866
  fieldName}).`);typeof r.valueBeforeCast!="boolean"&&r.throwParamError("STRICT_BOOLEAN","Value must be a boolean.")}}),n(
897
867
  "validator",r=>{if(typeof r.parameterValue!="function")throw new Error(`Validator for ${r.fieldName} must be a function.`);
898
- let o=r.parameterValue(r.value,r.object,r);if(El(o))throw new Error(`Custom validator for "${r.fieldName}" must be synch\
868
+ let o=r.parameterValue(r.value,r.object,r);if(Vu(o))throw new Error(`Custom validator for "${r.fieldName}" must be synch\
899
869
  ronous.`);typeof o=="string"&&r.throwParamError("CUSTOM_VALIDATOR_FAILED",o)}),n("uppercase",r=>{if(typeof r.value=="str\
900
870
  ing")return r.value.toUpperCase()}),n("lowercase",r=>{if(typeof r.value=="string")return r.value.toLowerCase()}),n("leng\
901
871
  th",r=>{if(typeof r.value=="string")return r.value.substr(0,r.parameterValue);Number.isInteger(Number(r.valueBeforeCast))&&
@@ -907,61 +877,61 @@ r.throwParamError("MAX_ITEMS",`Must have no more than ${r.parameterValue} items.
907
877
  n("notEmpty",r=>{r.parameterValue&&typeof r.value=="string"&&r.value===""&&r.throwParamError("NOT_EMPTY","Field cannot b\
908
878
  e empty.")}),n("required",()=>{}),n("unsigned",()=>{}),n("precision",()=>{}),n("scale",()=>{}),n("temporalPrecision",r=>{
909
879
  if(r.definition.type!=="time"&&r.definition.type!=="dateTime")throw new Error(`temporalPrecision can only be used on tim\
910
- e or dateTime fields (${r.fieldName}).`)}),n("nullable",()=>{}),n("nullOnEmpty",()=>{}),n("defaultTo",()=>{})}},xi=Ol;var _i=new WeakMap,Ai=new WeakMap,Ei=Symbol.for("json-rest-schema.registry-metadata"),rr=new WeakSet;function Rl(t,e,n){
911
- if(typeof n!="function")throw new Error(`Type handler for '${e}' must be a function.`);C(t,e,n)}function Pl(t,e,n){if(typeof n!=
912
- "function")throw new Error(`Validator handler for '${e}' must be a function.`);C(t,e,n)}function nr(t={}){let e=Object.create(
913
- null);for(let[n,r]of Object.entries(t))C(e,n,r);return e}function bi(t,e){if(typeof t.install!="function")throw new Error(
914
- "Plugin must have an install method.");t.install(e)}function Ti(t,e,n){_i.set(t,e),Ai.set(t,n),Object.defineProperty(t,Ei,
915
- {value:Object.freeze({getTypes:()=>e,getValidators:()=>n}),enumerable:!1,configurable:!1,writable:!1})}function kl(t){if(!t||
916
- typeof t!="object"&&typeof t!="function")return null;let e=_i.get(t),n=Ai.get(t);if(e&&n)return{types:e,validators:n};let r=t[Ei];
880
+ e or dateTime fields (${r.fieldName}).`)}),n("nullable",()=>{}),n("nullOnEmpty",()=>{}),n("defaultTo",()=>{})}},fi=Gu;var vi=new WeakMap,wi=new WeakMap,yi=Symbol.for("json-rest-schema.registry-metadata"),tr=new WeakSet;function Wu(t,e,n){
881
+ if(typeof n!="function")throw new Error(`Type handler for '${e}' must be a function.`);_(t,e,n)}function Ku(t,e,n){if(typeof n!=
882
+ "function")throw new Error(`Validator handler for '${e}' must be a function.`);_(t,e,n)}function rr(t={}){let e=Object.create(
883
+ null);for(let[n,r]of Object.entries(t))_(e,n,r);return e}function mi(t,e){if(typeof t.install!="function")throw new Error(
884
+ "Plugin must have an install method.");t.install(e)}function hi(t,e,n){vi.set(t,e),wi.set(t,n),Object.defineProperty(t,yi,
885
+ {value:Object.freeze({getTypes:()=>e,getValidators:()=>n}),enumerable:!1,configurable:!1,writable:!1})}function Ju(t){if(!t||
886
+ typeof t!="object"&&typeof t!="function")return null;let e=vi.get(t),n=wi.get(t);if(e&&n)return{types:e,validators:n};let r=t[yi];
917
887
  return r&&typeof r.getTypes=="function"&&typeof r.getValidators=="function"?{types:r.getTypes(),validators:r.getValidators()}:
918
888
  typeof t=="object"&&t.types&&typeof t.types=="object"&&t.validators&&typeof t.validators=="object"&&typeof t.create=="fu\
919
889
  nction"&&typeof t.replace=="function"&&typeof t.patch=="function"&&typeof t.toJsonSchema=="function"?{types:t.types,validators:t.
920
- validators}:null}function Ml(t){return t.length===1&&Array.isArray(t[0])?t[0]:t}function Ci(t,e,n){for(let[r,o]of Object.
921
- entries(e)){if(Object.hasOwn(t,r)&&t[r]!==o){if(rr.has(o))continue;if(!rr.has(t[r]))throw new Error(`Cannot merge schema\
922
- factories with conflicting ${n} "${r}".`)}C(t,r,o)}}function Nl(t,e,n){let r=Ml(n).filter(Boolean);if(r.length<1)return{
923
- types:nr(t),validators:nr(e)};let o=Object.create(null),s=Object.create(null);for(let i of r){let a=kl(i);if(!a)throw new Error(
924
- "Factory sources must be schema instances or schema factories created by json-rest-schema.");Ci(o,a.types,"type"),Ci(s,a.
925
- validators,"validator")}return{types:o,validators:s}}function Oi({types:t={},validators:e={},installCore:n=!0}={}){let r=nr(
926
- t),o=nr(e),s=(i,a={})=>{let c=new Be(i,r,o,a.operations);return Ti(c,r,o),c};return Ti(s,r,o),s.addType=(i,a)=>{Rl(r,i,a)},
927
- s.addValidator=(i,a)=>{Pl(o,i,a)},s.use=i=>{bi(i,{addType:s.addType,addValidator:s.addValidator})},s.createFactory=(...i)=>{
928
- let a=Nl(r,o,i);return Oi({types:a.types,validators:a.validators,installCore:!1})},n&&bi(xi,{addType:(i,a)=>{rr.add(a),s.
929
- addType(i,a)},addValidator:(i,a)=>{rr.add(a),s.addValidator(i,a)}}),s}var Q=Oi({installCore:!0});var K_=Object.freeze({schema:Q({}),mode:"replace"});var Ri=/^[a-z][a-z0-9_.-]*$/u,Dl=/^[A-Za-z_$][A-Za-z0-9_$]*$/u;function zl(t){return String(t||"").trim().toLowerCase()}
930
- function Nn(t,e){let n=zl(t);if(!Ri.test(n))throw new TypeError(`${e} must match ${Ri.toString()}.`);return n}function kn(t,e){
890
+ validators}:null}function Xu(t){return t.length===1&&Array.isArray(t[0])?t[0]:t}function gi(t,e,n){for(let[r,o]of Object.
891
+ entries(e)){if(Object.hasOwn(t,r)&&t[r]!==o){if(tr.has(o))continue;if(!tr.has(t[r]))throw new Error(`Cannot merge schema\
892
+ factories with conflicting ${n} "${r}".`)}_(t,r,o)}}function Yu(t,e,n){let r=Xu(n).filter(Boolean);if(r.length<1)return{
893
+ types:rr(t),validators:rr(e)};let o=Object.create(null),s=Object.create(null);for(let i of r){let a=Ju(i);if(!a)throw new Error(
894
+ "Factory sources must be schema instances or schema factories created by json-rest-schema.");gi(o,a.types,"type"),gi(s,a.
895
+ validators,"validator")}return{types:o,validators:s}}function Ii({types:t={},validators:e={},installCore:n=!0}={}){let r=rr(
896
+ t),o=rr(e),s=(i,a={})=>{let c=new Be(i,r,o,a.operations);return hi(c,r,o),c};return hi(s,r,o),s.addType=(i,a)=>{Wu(r,i,a)},
897
+ s.addValidator=(i,a)=>{Ku(o,i,a)},s.use=i=>{mi(i,{addType:s.addType,addValidator:s.addValidator})},s.createFactory=(...i)=>{
898
+ let a=Yu(r,o,i);return Ii({types:a.types,validators:a.validators,installCore:!1})},n&&mi(fi,{addType:(i,a)=>{tr.add(a),s.
899
+ addType(i,a)},addValidator:(i,a)=>{tr.add(a),s.addValidator(i,a)}}),s}var Q=Ii({installCore:!0});var mx=Object.freeze({schema:Q({}),mode:"replace"});var Si=/^[a-z][a-z0-9_.-]*$/u,Qu=/^[A-Za-z_$][A-Za-z0-9_$]*$/u;function el(t){return String(t||"").trim().toLowerCase()}
900
+ function An(t,e){let n=el(t);if(!Si.test(n))throw new TypeError(`${e} must match ${Si.toString()}.`);return n}function _n(t,e){
931
901
  if(t==null)return Object.freeze({});if(!A(t))throw new TypeError(`${e} must be an object mapping local names to capabili\
932
- ty ids.`);let n={},r=new Set;for(let[o,s]of Object.entries(t)){let i=String(o||"").trim();if(!Dl.test(i))throw new TypeError(
933
- `${e} local name "${i}" must be a JavaScript identifier.`);let a=Nn(s,`${e}.${i}`);if(r.has(a))throw new TypeError(`${e}\
934
- declares capability "${a}" more than once.`);r.add(a),n[i]=a}return Object.freeze(n)}function Ll(t,e,n){if(t==null)return Object.
902
+ ty ids.`);let n={},r=new Set;for(let[o,s]of Object.entries(t)){let i=String(o||"").trim();if(!Qu.test(i))throw new TypeError(
903
+ `${e} local name "${i}" must be a JavaScript identifier.`);let a=An(s,`${e}.${i}`);if(r.has(a))throw new TypeError(`${e}\
904
+ declares capability "${a}" more than once.`);r.add(a),n[i]=a}return Object.freeze(n)}function tl(t,e,n){if(t==null)return Object.
935
905
  freeze({});if(!A(t))throw new TypeError(`${n}.hints must be an object mapping required capability ids to what to registe\
936
- r.`);let r=new Set(Object.values(e)),o={};for(let[s,i]of Object.entries(t)){let a=Nn(s,`${n}.hints key`);if(!r.has(a))throw new TypeError(
906
+ r.`);let r=new Set(Object.values(e)),o={};for(let[s,i]of Object.entries(t)){let a=An(s,`${n}.hints key`);if(!r.has(a))throw new TypeError(
937
907
  `${n}.hints names "${a}", which the provider does not require.`);if(typeof i!="string"||!i.trim())throw new TypeError(`${n}\
938
- .hints["${a}"] must be the text that says what to register.`);o[a]=i.trim()}return Object.freeze(o)}function Ul(t){let e=new Map;
908
+ .hints["${a}"] must be the text that says what to register.`);o[a]=i.trim()}return Object.freeze(o)}function rl(t){let e=new Map;
939
909
  for(let[n,r]of Object.entries(t))for(let o of Object.keys(r)){if(e.has(o))throw new TypeError(`Provider local name "${o}\
940
- " is declared by both ${e.get(o)} and ${n}.`);e.set(o,n)}}function Mn(t,e){if(t==null)return null;if(typeof t!="function")
941
- throw new TypeError(`${e} must be a function when provided.`);return t}function or({id:t,requires:e={},optional:n={},provides:r={},
942
- hints:o={},setup:s,boot:i=null,shutdown:a=null}={}){let c=Nn(t,"Provider id"),d=kn(e,`${c}.requires`),p=kn(n,`${c}.optio\
943
- nal`),m=kn(r,`${c}.provides`);Ul({requires:d,optional:p,provides:m});let l=Mn(s,`${c}.setup`);if(!l)throw new TypeError(
944
- `${c}.setup is required.`);return Object.freeze({id:c,requires:d,optional:p,provides:m,hints:Ll(o,d,c),setup:l,boot:Mn(i,
945
- `${c}.boot`),shutdown:Mn(a,`${c}.shutdown`)})}var Pi="public";var Fl="/api",ki=`${Fl}/bootstrap`;function Dn(){let t=[],e=new Set,n=!1;function r({id:a,order:c=0,contribute:d}={}){if(n)throw new Error("Bootstrap regis\
946
- tration is closed after the first payload is resolved.");let p=_(a);if(!p)throw new TypeError("Bootstrap contributor id \
910
+ " is declared by both ${e.get(o)} and ${n}.`);e.set(o,n)}}function Cn(t,e){if(t==null)return null;if(typeof t!="function")
911
+ throw new TypeError(`${e} must be a function when provided.`);return t}function nr({id:t,requires:e={},optional:n={},provides:r={},
912
+ hints:o={},setup:s,boot:i=null,shutdown:a=null}={}){let c=An(t,"Provider id"),d=_n(e,`${c}.requires`),p=_n(n,`${c}.optio\
913
+ nal`),m=_n(r,`${c}.provides`);rl({requires:d,optional:p,provides:m});let l=Cn(s,`${c}.setup`);if(!l)throw new TypeError(
914
+ `${c}.setup is required.`);return Object.freeze({id:c,requires:d,optional:p,provides:m,hints:tl(o,d,c),setup:l,boot:Cn(i,
915
+ `${c}.boot`),shutdown:Cn(a,`${c}.shutdown`)})}var xi="public";var nl="/api",Ti=`${nl}/bootstrap`;function On(){let t=[],e=new Set,n=!1;function r({id:a,order:c=0,contribute:d}={}){if(n)throw new Error("Bootstrap regis\
916
+ tration is closed after the first payload is resolved.");let p=C(a);if(!p)throw new TypeError("Bootstrap contributor id \
947
917
  is required.");if(typeof d!="function")throw new TypeError(`Bootstrap contributor "${p}" requires contribute().`);if(e.has(
948
918
  p))throw new Error(`Bootstrap contributor "${p}" is duplicated.`);return e.add(p),t.push(Object.freeze({id:p,order:Number.
949
919
  isFinite(c)?Number(c):0,contribute:d})),i}async function o(a={}){n=!0;let c={},d=t.map((p,m)=>({entry:p,index:m})).sort(
950
920
  (p,m)=>p.entry.order-m.entry.order||p.index-m.index).map(({entry:p})=>p);for(let p of d){let m=await p.contribute(Object.
951
921
  freeze({...A(a)?a:{},payload:Object.freeze({...c})}));c={...c,...A(m)?m:{}}}return Object.freeze(c)}function s(){return Object.
952
922
  freeze({sealed:n,contributorIds:Object.freeze(t.map(a=>a.id).sort())})}let i=Object.freeze({register:r,resolve:o,diagnostics:s});
953
- return i}var ql=or({id:"runtime.bootstrap",requires:{http:"runtime.http"},provides:{bootstrap:"runtime.bootstrap"},setup({http:t}){
954
- let e=Dn();return t.router.register("GET",ki,{auth:Pi,meta:{tags:["bootstrap"],summary:"Resolve app bootstrap payload"}},
955
- async(n,r)=>{r.code(200).send(await e.resolve({request:n,reply:r,query:n.query||{}}))}),{bootstrap:e}}});function $l(t){if(!A(t))throw new TypeError("Event listener must be an object.");let e=String(t.id||"").trim();if(!e)throw new TypeError(
923
+ return i}var ol=nr({id:"runtime.bootstrap",requires:{http:"runtime.http"},provides:{bootstrap:"runtime.bootstrap"},setup({http:t}){
924
+ let e=On();return t.router.register("GET",Ti,{auth:xi,meta:{tags:["bootstrap"],summary:"Resolve app bootstrap payload"}},
925
+ async(n,r)=>{r.code(200).send(await e.resolve({request:n,reply:r,query:n.query||{}}))}),{bootstrap:e}}});function sl(t){if(!A(t))throw new TypeError("Event listener must be an object.");let e=String(t.id||"").trim();if(!e)throw new TypeError(
956
926
  "Event listener id is required.");if(typeof t.handle!="function")throw new TypeError(`Event listener "${e}" requires han\
957
927
  dle().`);if(t.matches!=null&&typeof t.matches!="function")throw new TypeError(`Event listener "${e}" matches must be a f\
958
- unction when provided.`);return Object.freeze({id:e,handle:t.handle,matches:t.matches??null})}function Bl(t){if(!A(t))throw new TypeError(
928
+ unction when provided.`);return Object.freeze({id:e,handle:t.handle,matches:t.matches??null})}function il(t){if(!A(t))throw new TypeError(
959
929
  "Published event must be an object.");let e=String(t.type||"").trim();if(!e)throw new TypeError("Published event type is\
960
- required.");return Object.freeze({...t,type:e})}function zn(){let t=[],e=new Set;function n(i){let a=$l(i);if(e.has(a.id))
961
- throw new Error(`Event listener "${a.id}" is duplicated.`);return e.add(a.id),t.push(a),s}async function r(i){let a=Bl(i);
930
+ required.");return Object.freeze({...t,type:e})}function Rn(){let t=[],e=new Set;function n(i){let a=sl(i);if(e.has(a.id))
931
+ throw new Error(`Event listener "${a.id}" is duplicated.`);return e.add(a.id),t.push(a),s}async function r(i){let a=il(i);
962
932
  for(let c of t)c.matches&&c.matches(a)!==!0||await c.handle(a);return a}function o(){return Object.freeze({listenerIds:Object.
963
- freeze(t.map(i=>i.id))})}let s=Object.freeze({register:n,publish:r,diagnostics:o});return s}var Hl=or({id:"runtime.events",provides:{events:"runtime.events"},setup(){return{events:zn()}}});function Ce(t,e=new WeakSet){if(!t||typeof t!="object"||e.has(t))return t;e.add(t);for(let n of Object.getOwnPropertyNames(
964
- t))Ce(t[n],e);return Object.freeze(t)}var UA=Object.freeze({REQUIRED:{messageKey:"required",code:"kernel.validation.field.required"},TYPE_CAST_FAILED:{messageKey:"\
933
+ freeze(t.map(i=>i.id))})}let s=Object.freeze({register:n,publish:r,diagnostics:o});return s}var al=nr({id:"runtime.events",provides:{events:"runtime.events"},setup(){return{events:Rn()}}});function _e(t,e=new WeakSet){if(!t||typeof t!="object"||e.has(t))return t;e.add(t);for(let n of Object.getOwnPropertyNames(
934
+ t))_e(t[n],e);return Object.freeze(t)}var sT=Object.freeze({REQUIRED:{messageKey:"required",code:"kernel.validation.field.required"},TYPE_CAST_FAILED:{messageKey:"\
965
935
  default",code:"kernel.validation.field.typeCastFailed"},NOT_NULLABLE:{messageKey:"default",code:"kernel.validation.field\
966
936
  .notNullable"},MIN_LENGTH:{messageKey:"minLength",code:"kernel.validation.field.minLength"},MAX_LENGTH:{messageKey:"maxL\
967
937
  ength",code:"kernel.validation.field.maxLength"},MIN_ITEMS:{messageKey:"minItems",code:"kernel.validation.field.minItems"},
@@ -971,10 +941,10 @@ code:"kernel.validation.field.pattern"},ENUM_VALUE:{messageKey:"enum",code:"kern
971
941
  messageKey:"additionalProperties",code:"kernel.validation.field.notAllowed"},CUSTOM_VALIDATOR_FAILED:{messageKey:"valida\
972
942
  tor",code:""},STRICT_BOOLEAN:{messageKey:"default",code:"kernel.validation.field.strictBoolean"},RANGE_EXCEEDED:{messageKey:"\
973
943
  default",code:"kernel.validation.field.rangeExceeded"},NOT_EMPTY:{messageKey:"default",code:"kernel.validation.field.not\
974
- Empty"}}),FA=Object.freeze({code:"kernel.validation.invalid",message:"Invalid value."}),qA=Object.freeze(["create","repl\
975
- ace","patch","toJsonSchema"]);var Kl=Q({cursor:{type:"id",required:!1},limit:{type:"number",required:!1,min:1,unsigned:!0}}),Jl=Object.freeze({schema:Kl,
976
- mode:"patch"});var Ni=Object.freeze({type:"string",pattern:"^(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d)?$",minLength:5}),Xl=Object.freeze(
977
- {...Ni,nullable:!0});var pE=new Map([{keyword:"required",code:"kernel.validation.required"},{keyword:"type",code:"kernel.validation.type"},{keyword:"\
944
+ Empty"}}),iT=Object.freeze({code:"kernel.validation.invalid",message:"Invalid value."}),aT=Object.freeze(["create","repl\
945
+ ace","patch","toJsonSchema"]);var ll=Q({cursor:{type:"id",required:!1},limit:{type:"number",required:!1,min:1,unsigned:!0}}),pl=Object.freeze({schema:ll,
946
+ mode:"patch"});var _i=Object.freeze({type:"string",pattern:"^(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d)?$",minLength:5}),fl=Object.freeze(
947
+ {..._i,nullable:!0});var kT=new Map([{keyword:"required",code:"kernel.validation.required"},{keyword:"type",code:"kernel.validation.type"},{keyword:"\
978
948
  minLength",code:"kernel.validation.minLength"},{keyword:"maxLength",code:"kernel.validation.maxLength"},{keyword:"minimu\
979
949
  m",code:"kernel.validation.minimum"},{keyword:"maximum",code:"kernel.validation.maximum"},{keyword:"exclusiveMinimum",code:"\
980
950
  kernel.validation.exclusiveMinimum"},{keyword:"exclusiveMaximum",code:"kernel.validation.exclusiveMaximum"},{keyword:"mu\
@@ -986,32 +956,62 @@ additionalItems",code:"kernel.validation.additionalItems"},{keyword:"uniqueItems
986
956
  perties"},{keyword:"additionalProperties",code:"kernel.validation.additionalProperties"},{keyword:"propertyNames",code:"\
987
957
  kernel.validation.propertyNames"},{keyword:"oneOf",code:"kernel.validation.oneOf"},{keyword:"anyOf",code:"kernel.validat\
988
958
  ion.anyOf"},{keyword:"not",code:"kernel.validation.not"},{keyword:"if",code:"kernel.validation.if"}].map(({keyword:t,code:e})=>[
989
- t,e]));var ji="^[1-9][0-9]*$",Ln=Ce({type:"string",minLength:1,pattern:ji}),Zl=Ce({...Ln,nullable:!0}),Ql=Ce({schema:Q({recordId:{
990
- ...Ln,required:!0,messages:{pattern:{code:"kernel.validation.recordIdInvalid",message:"Record id must be a canonical pos\
991
- itive integer string."}}}}),mode:"patch"});var Di=20,aO=32*1024,cO=48*1024,Un=Object.freeze({search:"assistant_action_search",contract:"assistant_action_contract",
992
- execute:"assistant_action_execute"}),Fn=Object.freeze({type:"object",additionalProperties:!0}),rp=Object.freeze({type:"o\
959
+ t,e]));var Ci="^[1-9][0-9]*$",Pn=_e({type:"string",minLength:1,pattern:Ci}),hl=_e({...Pn,nullable:!0}),gl=_e({schema:Q({recordId:{
960
+ ...Pn,required:!0,messages:{pattern:{code:"kernel.validation.recordIdInvalid",message:"Record id must be a canonical pos\
961
+ itive integer string."}}}}),mode:"patch"});var Ai=20,yl=32*1024,Ei=48*1024,kn=Object.freeze({search:"assistant_action_search",contract:"assistant_action_contract",
962
+ execute:"assistant_action_execute"}),Mn=Object.freeze({type:"object",additionalProperties:!0}),Il=Object.freeze({type:"o\
993
963
  bject",additionalProperties:!1,properties:{query:{type:"string",maxLength:200,description:"Optional literal words or act\
994
964
  ion-id fragments; every word must match. Use short resource or operation terms such as list. Omit query to browse all av\
995
965
  ailable actions."},cursor:{type:"string",maxLength:1e3,description:"Opaque cursor returned by the previous search page."},
996
- limit:{type:"integer",minimum:1,maximum:Di,description:"Maximum compact matches to return."}}}),np=Object.freeze({type:"\
997
- object",additionalProperties:!1,required:["items","nextCursor","total"],properties:{items:{type:"array",maxItems:Di,items:{
966
+ limit:{type:"integer",minimum:1,maximum:Ai,description:"Maximum compact matches to return."}}}),Sl=Object.freeze({type:"\
967
+ object",additionalProperties:!1,required:["items","nextCursor","total"],properties:{items:{type:"array",maxItems:Ai,items:{
998
968
  type:"object",additionalProperties:!1,required:["actionId","version","kind","description"],properties:{actionId:{type:"s\
999
969
  tring"},version:{type:"integer",minimum:1},kind:{type:"string"},description:{type:"string"}}}},nextCursor:{anyOf:[{type:"\
1000
- string"},{type:"null"}]},total:{type:"integer",minimum:0}}}),op=Object.freeze({type:"object",additionalProperties:!1,required:[
1001
- "actionId"],properties:{actionId:{type:"string",minLength:1,maxLength:300},version:{type:"integer",minimum:1}}}),sp=Object.
970
+ string"},{type:"null"}]},total:{type:"integer",minimum:0}}}),xl=Object.freeze({type:"object",additionalProperties:!1,required:[
971
+ "actionId"],properties:{actionId:{type:"string",minLength:1,maxLength:300},version:{type:"integer",minimum:1}}}),Tl=Object.
1002
972
  freeze({type:"object",additionalProperties:!1,required:["actionId","version","kind","description","inputSchema","outputS\
1003
973
  chema"],properties:{actionId:{type:"string"},version:{type:"integer",minimum:1},kind:{type:"string"},description:{type:"\
1004
- string"},inputSchema:Fn,outputSchema:Fn}}),ip=Object.freeze({type:"object",additionalProperties:!1,required:["actionId",
1005
- "input"],properties:{actionId:{type:"string",minLength:1,maxLength:300},version:{type:"integer",minimum:1},input:Fn}}),ap=Object.
974
+ string"},inputSchema:Mn,outputSchema:Mn}}),bl=Object.freeze({type:"object",additionalProperties:!1,required:["actionId",
975
+ "input"],properties:{actionId:{type:"string",minLength:1,maxLength:300},version:{type:"integer",minimum:1},input:Mn}}),_l=Object.
1006
976
  freeze({type:"object",additionalProperties:!1,required:["actionId","version","result"],properties:{actionId:{type:"strin\
1007
- g"},version:{type:"integer",minimum:1},result:{}}}),zi=Object.freeze([Object.freeze({name:Un.search,description:"Discove\
977
+ g"},version:{type:"integer",minimum:1},result:{}}}),Oi=Object.freeze([Object.freeze({name:kn.search,description:"Discove\
1008
978
  r application actions available to the current user and surface, including list, search, and query operations for multip\
1009
979
  le records. Search before claiming a capability is unavailable. If terminology does not match, use broader terms or omit\
1010
- query to browse. Returns compact paged matches without schemas; follow nextCursor when more discovery is needed.",parameters:rp,
1011
- outputSchema:np}),Object.freeze({name:Un.contract,description:"Load the exact input and output contract for one availabl\
1012
- e action before executing it.",parameters:op,outputSchema:sp}),Object.freeze({name:Un.execute,description:"Execute one a\
1013
- vailable action after loading its exact contract in this turn. The action result is returned in result.",parameters:ip,outputSchema:ap})]);var mR=new URL("./../../../@jskit-ai/assistant-core/src/server/conversation/openCodeProcess.js",import.meta.url).href;var IR=256*1024;var SR=2*1024*1024;var xR=zi.map(({name:t,description:e,parameters:n})=>({type:"function",function:{name:t,description:e,parameters:n}}));var ZR=Object.freeze({});var uP=Object.freeze([]);var Tp=Object.freeze({resolve(){throw new N(400,"File attachments are not configured for this conversation.",{code:"conv\
1014
- ersation_attachments_not_configured",messageCode:"assistant.conversation.attachmentsNotConfigured"})}});var yP=Object.freeze([{message:"This conversation exceeds the configured API history limit. Start another conversation o\
980
+ query to browse. Returns compact paged matches without schemas; follow nextCursor when more discovery is needed.",parameters:Il,
981
+ outputSchema:Sl}),Object.freeze({name:kn.contract,description:"Load the exact input and output contract for one availabl\
982
+ e action before executing it.",parameters:xl,outputSchema:Tl}),Object.freeze({name:kn.execute,description:"Execute one a\
983
+ vailable action after loading its exact contract in this turn. The action result is returned in result.",parameters:bl,outputSchema:_l})]);var Rb=new URL("./../../../@jskit-ai/assistant-core/src/server/conversation/commandWrapper.js",import.meta.url).href;var kl=Object.freeze({streaming:!1,instructions:!1,configuration:!1,goals:!1,goalBudgets:!1,goalCommands:Object.freeze({}),
984
+ attachments:!1,tools:!1,nativeTools:!1});var cC=Object.freeze({goals:!0,goalBudgets:!1,goalCommands:Object.freeze({set:Object.freeze({delivery:"message",interruptsTurn:!1}),
985
+ resume:Object.freeze({delivery:"message",interruptsTurn:!1}),pause:Object.freeze({delivery:"control",interruptsTurn:!0}),
986
+ cancel:Object.freeze({delivery:"message",interruptsTurn:!0})})}),dC=Object.freeze({});var LC=new URL("./../../../@jskit-ai/assistant-core/src/server/conversation/codexRuntime.js",import.meta.url).href;import{createHash as Di}from"node:crypto";import{open as Yl}from"node:fs/promises";import zi from"node:path";var zn=1024*1024,Zl=256*1024,Li=512,Ql=128,ep=16*1024;function Ln({errorPrefix:t="",identityNamespace:e="codex-account-v\
987
+ 1",secretNamespace:n="codex-auth-secret-v1"}={}){function r(d="",p="",{messageCode:m}={}){let l=new Error(I(p)||"Codex h\
988
+ elper authentication is unavailable. Reconnect Codex and retry.");return l.code=I(d)||`${t}codex_helper_auth_unavailable`,
989
+ I(p)?m&&(l.messageCode=m):l.messageCode="assistant.codex.helperAuthUnavailable",l.messageCode&&(l.messageParams={}),l}function o(d,{
990
+ label:p="Codex authentication value",maxLength:m=0}={}){if(typeof d!="string"||d.length===0||d.length>m)throw r(`${t}cod\
991
+ ex_helper_auth_invalid`,`${p} is missing or invalid. Reconnect Codex and retry.`);return d}function s(d="",p=""){return`\
992
+ sha256:${Di("sha256").update(`${e}\0`,"utf8").update(I(d),"utf8").update("\0","utf8").update(String(p||""),"utf8").digest(
993
+ "hex")}`}function i(d=""){return Di("sha256").update(`${n}\0`,"utf8").update(String(d||""),"utf8").digest("hex")}async function a(d=""){
994
+ let p=null;try{p=await Yl(d,"r");let m=await p.stat();if(!m.isFile()||m.size>zn)throw r(`${t}codex_helper_auth_invalid`,
995
+ "The selected Codex authentication record is invalid. Reconnect Codex and retry.",{messageCode:"assistant.codex.authReco\
996
+ rdInvalid"});let l=Buffer.alloc(zn+1),v=0;for(;v<l.length;){let{bytesRead:T}=await p.read(l,v,l.length-v,null);if(T===0)
997
+ break;v+=T}if(v>zn)throw r(`${t}codex_helper_auth_invalid`,"The selected Codex authentication record is too large. Recon\
998
+ nect Codex and retry.",{messageCode:"assistant.codex.authRecordTooLarge"});let x=JSON.parse(l.subarray(0,v).toString("ut\
999
+ f8"));if(!A(x))throw new Error("invalid authentication record");return x}catch(m){throw m?.code?.startsWith?.(`${t}codex\
1000
+ _helper_auth_`)?m:r(`${t}codex_helper_auth_unavailable`,"The selected Codex authentication record could not be read. Rec\
1001
+ onnect Codex and retry.",{messageCode:"assistant.codex.authRecordUnreadable"})}finally{await p?.close().catch(()=>null)}}
1002
+ async function c(d={}){let p=I(d.toolHomeSource);if(!p||!zi.isAbsolute(p))throw r(`${t}codex_helper_auth_unavailable`,"T\
1003
+ he selected Codex account is unavailable. Reconnect Codex and retry.",{messageCode:"assistant.codex.accountUnavailable"});
1004
+ let m=await a(zi.join(p,".codex","auth.json")),l=I(m.auth_mode).toLowerCase();if(l==="chatgpt"){let v=A(m.tokens)?m.tokens:
1005
+ {},x=o(v.account_id,{label:"Codex account identity",maxLength:Li}),T=o(v.access_token,{label:"Codex access token",maxLength:Zl}),
1006
+ O=v.chatgpt_plan_type??v.plan_type,P=O==null||O===""?"":o(O,{label:"Codex plan type",maxLength:Ql});return Object.freeze(
1007
+ {accessToken:T,accountId:x,authMode:"chatgpt",identitySignature:s("chatgpt",x),planType:P,secretSignature:i(T)})}if(["ap\
1008
+ ikey","api_key"].includes(l)){let v=o(m.OPENAI_API_KEY,{label:"Codex API key",maxLength:ep});return Object.freeze({apiKey:v,
1009
+ authMode:"apiKey",identitySignature:s("apiKey",v),secretSignature:i(v)})}throw r(`${t}codex_helper_auth_invalid`,"The se\
1010
+ lected Codex authentication mode is unsupported. Reconnect Codex and retry.",{messageCode:"assistant.codex.authModeUnsup\
1011
+ ported"})}return Object.freeze({error:r,identitySignature:s,readRecord:a,readSelected:c})}var sA=Object.freeze({label:"Checking the Codex sign-in",operationId:"codex-auth-preflight"});var pA=Ln().error;var DA=4*1024*1024;var GE=Object.freeze({goals:!0,goalBudgets:!0,goalCommands:Object.freeze({set:Object.freeze({delivery:"control",interruptsTurn:!1}),
1012
+ resume:Object.freeze({delivery:"control",interruptsTurn:!1}),pause:Object.freeze({delivery:"control",interruptsTurn:!0}),
1013
+ cancel:Object.freeze({delivery:"control",interruptsTurn:!1})})});var ZE=2*1024*1024,QE=32*1024*1024,eO=2*1024*1024;var gR=new URL("./../../../@jskit-ai/assistant-core/src/server/conversation/openCodeProcess.js",import.meta.url).href;var xR=256*1024;var TR=2*1024*1024;var bR=Oi.map(({name:t,description:e,parameters:n})=>({type:"function",function:{name:t,description:e,parameters:n}}));var eP=Object.freeze({});var pP=Object.freeze([]);var Cp=Object.freeze({resolve(){throw new N(400,"File attachments are not configured for this conversation.",{code:"conv\
1014
+ ersation_attachments_not_configured",messageCode:"assistant.conversation.attachmentsNotConfigured"})}});var SP=Object.freeze([{message:"This conversation exceeds the configured API history limit. Start another conversation o\
1015
1015
  r increase the limit.",messageCode:"assistant.conversation.apiHistoryLimit"},{message:"The model reached its output toke\
1016
1016
  n limit before completing the answer. Increase maxOutputTokens in the conversation limits.",messageCode:"assistant.conve\
1017
1017
  rsation.outputTokenLimit"},{message:"The model stream ended without confirming its application tool calls.",messageCode:"\
@@ -1030,21 +1030,21 @@ t be saved. Restore storage access and retry saving.",messageCode:"assistant.con
1030
1030
  Conversation progress could not be saved. Restore access to its storage before continuing.",messageCode:"assistant.conve\
1031
1031
  rsation.progressUnsaved"},{message:"The conversation request exceeded its time limit.",messageCode:"assistant.conversati\
1032
1032
  on.requestTimedOut"},{message:"Work stopped.",messageCode:"assistant.conversation.workStopped"},{message:"Stopped by use\
1033
- r.",messageCode:"assistant.conversation.stoppedByUser"}]);var Ve=Object.freeze({text:16e3,toolName:256,arguments:256*1024,toolProgress:280});var ok=Q({kind:{type:"string",enum:["reply","tool"],required:!0},text:{type:"string",maxLength:Ve.text,required:!1},toolName:{
1034
- type:"string",maxLength:Ve.toolName,required:!1},arguments:{type:"string",maxLength:Ve.arguments,required:!1}}),sk={type:"\
1033
+ r.",messageCode:"assistant.conversation.stoppedByUser"}]);var Ve=Object.freeze({text:16e3,toolName:256,arguments:256*1024,toolProgress:280});var ak=Q({kind:{type:"string",enum:["reply","tool"],required:!0},text:{type:"string",maxLength:Ve.text,required:!1},toolName:{
1034
+ type:"string",maxLength:Ve.toolName,required:!1},arguments:{type:"string",maxLength:Ve.arguments,required:!1}}),ck={type:"\
1035
1035
  object",additionalProperties:!1,required:["kind","text","toolName","arguments"],properties:{kind:{type:"string",enum:["r\
1036
1036
  eply","tool"]},text:{type:"string",maxLength:Ve.text,description:"The final reply, or a brief progress sentence for the \
1037
1037
  first tool request; empty for subsequent tool requests."},toolName:{type:"string",maxLength:Ve.toolName},arguments:{type:"\
1038
- string",maxLength:Ve.arguments}}};var sM=Object.freeze({});function Np(){throw new TypeError("Hook delivery requires an instruction resolver.")}function Kn({resolveConversation:t,
1039
- readInstructions:e=Np}){if(typeof t!="function")throw new TypeError("Conversation hook delivery requires a binding resol\
1038
+ string",maxLength:Ve.arguments}}};var cM=Object.freeze({});function Dp(){throw new TypeError("Hook delivery requires an instruction resolver.")}function Kn({resolveConversation:t,
1039
+ readInstructions:e=Dp}){if(typeof t!="function")throw new TypeError("Conversation hook delivery requires a binding resol\
1040
1040
  ver.");return async function(r){if(r.scope!=="session")return{kind:"unclaimed"};let o=await t(r);if(!o)return{kind:"uncl\
1041
1041
  aimed"};if(o.delivery==="native")return{kind:"delivery",text:""};if(o.delivery!=="hook")throw new TypeError("Unknown con\
1042
1042
  versation instruction delivery mode.");let s=await e(o,r);if(typeof s!="string"||!s.trim())throw new TypeError("Managed \
1043
- conversation instructions are unavailable.");return{kind:"delivery",text:s}}}var cM=Object.freeze({codex:Object.freeze({requiresWriterExclusion:!1}),claude:Object.freeze({requiresWriterExclusion:!0,
1043
+ conversation instructions are unavailable.");return{kind:"delivery",text:s}}}var lM=Object.freeze({codex:Object.freeze({requiresWriterExclusion:!1}),claude:Object.freeze({requiresWriterExclusion:!0,
1044
1044
  allowsManagedServer:!1,matchesProcess:({executable:t,commandLine:e})=>/(?:^|[\0/])claude(?:\0|$)|@anthropic-ai\/claude-code\//u.
1045
1045
  test(`${t||""}\0${e}`)}),opencode:Object.freeze({requiresWriterExclusion:!0,allowsManagedServer:!0,matchesProcess:({executable:t,
1046
- commandLine:e})=>/(?:^|[\0/])opencode(?:\0|$)/u.test(`${t||""}\0${e}`)})});import{readFile as jp}from"node:fs/promises";import Jn from"node:path";function ir(t){return String(t||"").trim()}var Dp=Object.freeze(["main","temporary"]),Vi=Object.freeze(["managedDatabaseRefresh","managedEnvironment","managedGit",
1047
- "managedPreview"]),Gi=Object.freeze(["managedPages"]),zp=64*1024,FM=Object.freeze(["When user input is necessary, ask no\
1046
+ commandLine:e})=>/(?:^|[\0/])opencode(?:\0|$)/u.test(`${t||""}\0${e}`)})});import{readFile as zp}from"node:fs/promises";import Jn from"node:path";function ir(t){return String(t||"").trim()}var Lp=Object.freeze(["main","temporary"]),Gi=Object.freeze(["managedDatabaseRefresh","managedEnvironment","managedGit",
1047
+ "managedPreview"]),Wi=Object.freeze(["managedPages"]),Up=64*1024,BM=Object.freeze(["When user input is necessary, ask no\
1048
1048
  more than three concise, high-impact questions at once.","Put multiple questions on separate lines as `[1] Question`, `\
1049
1049
  [2] Question`, and so on.","For a small fixed set of useful choices, put `Possible answers:` and a short bullet list dir\
1050
1050
  ectly beneath its own question, before the next one; never collect several questions' answers into one trailing list.","\
@@ -1057,7 +1057,7 @@ Possible answers:
1057
1057
  [2] Tell the main agent before changes?
1058
1058
  Possible answers:
1059
1059
  - Yes, tell main first
1060
- - No, proceed independently`]),qM=Object.freeze(["The Vibe64-managed preview is the canonical application server; never \
1060
+ - No, proceed independently`]),HM=Object.freeze(["The Vibe64-managed preview is the canonical application server; never \
1061
1061
  start a duplicate or replacement server. If it is unavailable, report that blocker. Describe only rendered browser evide\
1062
1062
  nce.","When adopting an authenticated app, or when its login blocks Preview inspection, inspect identity support/names w\
1063
1063
  ith `vibe64-helper preview status`; prefer `vibe64-helper preview browser identity <configured-name>` to requesting pass\
@@ -1117,7 +1117,7 @@ waits for cleanup/restoration; retry if cleanup needs attention. Never kill test
1117
1117
  exit alone does not prove tests stopped. Recheck status before reporting a busy blocker.","If a managed command reports \
1118
1118
  kernel task denials or a resource incident, report the blocker with its diagnostic and incident ID and ask the platform \
1119
1119
  operator to inspect that evidence before retrying; never raise test timeouts or weaken assertions to work around a proce\
1120
- ss/thread limit. A generic browser timeout without resource evidence does not establish a platform cause."]),$M=Object.freeze(
1120
+ ss/thread limit. A generic browser timeout without resource evidence does not establish a platform cause."]),VM=Object.freeze(
1121
1121
  ['Pages: `vibe64-helper pages publish <file.html|folder> [--title "Title"]` publishes an HTML page (one file, or a folde\
1122
1122
  r with index.html and its own scripts, styles, data and images) that everyone with access to this project can open from \
1123
1123
  Vibe64\'s Pages list; `vibe64-helper pages update <page-id> <file.html|folder>` gives a page a new version under the same\
@@ -1139,34 +1139,35 @@ e data; use --prompt only when gathering it needs judgement.","Before making a p
1139
1139
  hen a page about the same subject already exists, update it instead of making a new one.","Do not offer pages for quick \
1140
1140
  answers, code changes, or documents that belong in the repository. Offer at most once per topic; do not nag.","Everyone \
1141
1141
  with access to the project can open a page: never put secrets in one, or anything not every project member should see."]),
1142
- BM=Object.freeze(["Each managed shell command receives current development Env from Vibe64, including declared resource \
1142
+ GM=Object.freeze(["Each managed shell command receives current development Env from Vibe64, including declared resource \
1143
1143
  bindings; use them in ordinary commands. Do not build environment injection or copy managed credentials into source. Res\
1144
1144
  ource provisioning and application migrations remain separate preparation steps.","Use `vibe64-helper env status [develo\
1145
1145
  pment|production|all]` to inspect configured key names without revealing values.","Pipe an available value to `vibe64-he\
1146
- lper env set <development|production> <KEY> [--secret]`; never put values in arguments, logs, or repository files. Use e\
1147
- mpty stdin only when the user requested an empty value. The host decides whose session may change production values; whe\
1148
- n it refuses, report its message instead of retrying.","When the person refers to a saved key, account or accounts hub, \
1149
- run `vibe64-helper env saved` (names, descriptions and fields, never values) and link the matching field to the variable\
1150
- the application reads with `vibe64-helper env link <development|production> <KEY> <saved-id> <field-id>` instead of ask\
1151
- ing for the value.","Keep development and production values separate. Never invent credentials, copy a value between sco\
1152
- pes without explicit direction, or edit Vibe64 runtime/session storage.","After an Env mutation, report only the affecte\
1153
- d scope and key names, never their values, and claim success only when the command succeeded.","Store a secret the appli\
1154
- cation needs generated (such as an application key) by generating it with the framework's own generator and piping it to\
1155
- `vibe64-helper env set <scope> <KEY> --secret`. Never write it into a generated `.env` file: Vibe64 regenerates that fi\
1156
- le from Env."]);function Xn(t,e){if(!t||typeof t!="object"||Array.isArray(t))throw new TypeError(`${e} must be an object\
1157
- .`);return t}function mt(t,e,n){let r=new Set(e),o=Object.keys(t).filter(s=>!r.has(s));if(o.length>0)throw new TypeError(
1158
- `${n} contains unsupported fields: ${o.join(", ")}.`)}function Lp(t){if(mt(t,["conversationKind","scope","session","host\
1159
- Guidance"],"Vibe64 session context"),t.hostGuidance!==void 0&&(typeof t.hostGuidance!="string"||Buffer.byteLength(t.hostGuidance,
1160
- "utf8")>1024))throw new TypeError("Vibe64 host guidance must be bounded text supplied by the host.");if(!Dp.includes(t.conversationKind))
1161
- throw new TypeError("Vibe64 session context has an unknown conversationKind.");let e=Xn(t.session,"Vibe64 session capabi\
1162
- lities");mt(e,[...Vi,...Gi],"Vibe64 session capabilities");let n=Object.fromEntries(Vi.map(r=>{if(typeof e[r]!="boolean")
1163
- throw new TypeError(`Vibe64 session capability ${r} must be boolean.`);return[r,e[r]]}));for(let r of Gi){if(e[r]!==void 0&&
1164
- typeof e[r]!="boolean")throw new TypeError(`Vibe64 session capability ${r} must be boolean.`);e[r]===!0&&(n[r]=!0)}return{
1165
- conversationKind:t.conversationKind,scope:"session",...t.hostGuidance?{hostGuidance:t.hostGuidance}:{},session:n}}function Up(t){
1166
- mt(t,["scope","stableContext"],"Vibe64 ephemeral context");let e=String(t.stableContext||"").trim();if(!e||e.length>zp)throw new TypeError(
1167
- "Vibe64 ephemeral context requires bounded stableContext.");return{scope:"ephemeral",stableContext:e}}function Fp(t){if(t.
1168
- scope==="session")return Lp(t);if(t.scope==="ephemeral")return Up(t);throw new TypeError("The Vibe64 driver supports ses\
1169
- sion and ephemeral scopes only.")}async function Wi(t={},{readRegistry:e=jp,workdir:n=""}={}){let r=Xn(t,"Vibe64 host resolver request");if(mt(r,["data","\
1146
+ lper env set <development|production> <KEY> [--secret]`; it drops the one final newline that `echo` or a generator print\
1147
+ s and stores every other character exactly. Never put values in arguments, logs, or repository files. Use empty stdin on\
1148
+ ly when the user requested an empty value. The host decides whose session may change production values; when it refuses,\
1149
+ report its message instead of retrying.","When the person refers to a saved key, account or accounts hub, run `vibe64-h\
1150
+ elper env saved` (names, descriptions and fields, never values) and link the matching field to the variable the applicat\
1151
+ ion reads with `vibe64-helper env link <development|production> <KEY> <saved-id> <field-id>` instead of asking for the v\
1152
+ alue.","Keep development and production values separate. Never invent credentials, copy a value between scopes without e\
1153
+ xplicit direction, or edit Vibe64 runtime/session storage.","After an Env mutation, report only the affected scope and k\
1154
+ ey names, never their values, and claim success only when the command succeeded.","Store a secret the application needs \
1155
+ generated (such as an application key) by generating it with the framework's own generator and piping it to `vibe64-help\
1156
+ er env set <scope> <KEY> --secret`. Never write it into a generated `.env` file: Vibe64 regenerates that file from Env."]);
1157
+ function Xn(t,e){if(!t||typeof t!="object"||Array.isArray(t))throw new TypeError(`${e} must be an object.`);return t}function mt(t,e,n){
1158
+ let r=new Set(e),o=Object.keys(t).filter(s=>!r.has(s));if(o.length>0)throw new TypeError(`${n} contains unsupported fiel\
1159
+ ds: ${o.join(", ")}.`)}function Fp(t){if(mt(t,["conversationKind","scope","session","hostGuidance"],"Vibe64 session cont\
1160
+ ext"),t.hostGuidance!==void 0&&(typeof t.hostGuidance!="string"||Buffer.byteLength(t.hostGuidance,"utf8")>1024))throw new TypeError(
1161
+ "Vibe64 host guidance must be bounded text supplied by the host.");if(!Lp.includes(t.conversationKind))throw new TypeError(
1162
+ "Vibe64 session context has an unknown conversationKind.");let e=Xn(t.session,"Vibe64 session capabilities");mt(e,[...Gi,
1163
+ ...Wi],"Vibe64 session capabilities");let n=Object.fromEntries(Gi.map(r=>{if(typeof e[r]!="boolean")throw new TypeError(
1164
+ `Vibe64 session capability ${r} must be boolean.`);return[r,e[r]]}));for(let r of Wi){if(e[r]!==void 0&&typeof e[r]!="bo\
1165
+ olean")throw new TypeError(`Vibe64 session capability ${r} must be boolean.`);e[r]===!0&&(n[r]=!0)}return{conversationKind:t.
1166
+ conversationKind,scope:"session",...t.hostGuidance?{hostGuidance:t.hostGuidance}:{},session:n}}function qp(t){mt(t,["sco\
1167
+ pe","stableContext"],"Vibe64 ephemeral context");let e=String(t.stableContext||"").trim();if(!e||e.length>Up)throw new TypeError(
1168
+ "Vibe64 ephemeral context requires bounded stableContext.");return{scope:"ephemeral",stableContext:e}}function $p(t){if(t.
1169
+ scope==="session")return Fp(t);if(t.scope==="ephemeral")return qp(t);throw new TypeError("The Vibe64 driver supports ses\
1170
+ sion and ephemeral scopes only.")}async function Ki(t={},{readRegistry:e=zp,workdir:n=""}={}){let r=Xn(t,"Vibe64 host resolver request");if(mt(r,["data","\
1170
1171
  providerSessionId","parentSessionIds","scope"],"Vibe64 host resolver request"),!["session","turn"].includes(r.scope))throw new TypeError(
1171
1172
  "The Vibe64 host resolver scope must be session or turn.");if(r.scope==="turn")return null;let o=Xn(r.data,"Vibe64 host \
1172
1173
  resolver data");mt(o,["registryPath"],"Vibe64 host resolver data");let s=ir(o.registryPath);if(!Jn.isAbsolute(s))throw new TypeError(
@@ -1176,7 +1177,7 @@ if(r.parentSessionIds!==void 0&&(!Array.isArray(r.parentSessionIds)||r.parentSes
1176
1177
  l=>typeof l!="string"||!l.trim())))throw new TypeError("Invalid native conversation ancestry.");let p=[c,...r.parentSessionIds||
1177
1178
  []].filter(Boolean).map(l=>a.find(v=>ir(v?.upstreamSessionId)===l)).find(Boolean),m=p?.promptContext;if(!m)return null;if(n&&
1178
1179
  p.workdir&&Jn.resolve(n)!==Jn.resolve(p.workdir))throw new Error("The managed conversation belongs to a different projec\
1179
- t directory.");return Fp(m)}var Yn="";for await(let t of process.stdin)if(Yn+=t,Buffer.byteLength(Yn)>256*1024)throw new Error("Conversation instruc\
1180
- tion input exceeds 256 KiB.");var Ki=JSON.parse(Yn);if(process.argv[2]==="--instructions"){let{vibe64ConversationInstructions:t}=await import("@local/vibe64-genesis/server");
1181
- process.stdout.write(await t(Ki))}else{let t=Kn({resolveConversation:async e=>await Wi(e,{workdir:process.cwd()})?{delivery:"\
1182
- native"}:null});process.stdout.write(JSON.stringify(await t(Ki)))}
1180
+ t directory.");return $p(m)}var Yn="";for await(let t of process.stdin)if(Yn+=t,Buffer.byteLength(Yn)>256*1024)throw new Error("Conversation instruc\
1181
+ tion input exceeds 256 KiB.");var Ji=JSON.parse(Yn);if(process.argv[2]==="--instructions"){let{vibe64ConversationInstructions:t}=await import("@local/vibe64-genesis/server");
1182
+ process.stdout.write(await t(Ji))}else{let t=Kn({resolveConversation:async e=>await Ki(e,{workdir:process.cwd()})?{delivery:"\
1183
+ native"}:null});process.stdout.write(JSON.stringify(await t(Ji)))}