vibe64 0.1.48 → 0.1.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/run.js +1746 -1725
- package/bin/server.js +75 -75
- package/bin/upgrade-state.js +4275 -4254
- package/dist/assets/GithubBrowserTabs-BwpiRS2u.js +1 -0
- package/dist/assets/{LocalDatabaseServer-ih_gadbx.js → LocalDatabaseServer-u_Ky7bNS.js} +1 -1
- package/dist/assets/{Vibe64AuthSettingsButton-BZsCIA2Z.js → Vibe64AuthSettingsButton-BCwswT1G.js} +1 -1
- package/dist/assets/{Vibe64DashboardShell-DFE-2tFZ.js → Vibe64DashboardShell-CWlgrR2B.js} +1 -1
- package/dist/assets/{Vibe64DatabaseWorkspace-BdvxuFPT.js → Vibe64DatabaseWorkspace-Dhs8_H0P.js} +1 -1
- package/dist/assets/Vibe64OutputControls-Dn548CZa.js +8 -0
- package/dist/assets/{Vibe64RepositoryWorkspace-CVN2HKCB.js → Vibe64RepositoryWorkspace-C-8S4JUF.js} +1 -1
- package/dist/assets/{Vibe64SessionFiles-DKo5wd8-.js → Vibe64SessionFiles-Cx6J7DDN.js} +1 -1
- package/dist/assets/{Vibe64UiStoryboardView-BYqVdBAt.js → Vibe64UiStoryboardView-DHyhJiWS.js} +1 -1
- package/dist/assets/{Vibe64UnavailableSessions-CQjgoaS0.js → Vibe64UnavailableSessions-Da4RxIhA.js} +1 -1
- package/dist/assets/{_sessionId_-ByUkrRd7.js → _sessionId_-DCpgDPSI.js} +1 -1
- package/dist/assets/_slug_-BbEWp01a.js +25 -0
- package/dist/assets/{_slug_-B16mTWjj.css → _slug_-DerKOisL.css} +1 -1
- package/dist/assets/{access-CWZMu-ND.js → access-D4di2sCr.js} +1 -1
- package/dist/assets/{app-D_itm2S5.js → app-Adr9Iz8p.js} +1 -1
- package/dist/assets/{changes-BYuFfnEm.js → changes-3Dd1O8Lu.js} +1 -1
- package/dist/assets/{client-CP2EwnrY.js → client-BAXHGUOC.js} +1 -1
- package/dist/assets/{client-B88Jggew.js → client-CCZIu6yc.js} +1 -1
- package/dist/assets/{conversation-DL4AODd9.js → conversation-ErAO1CmH.js} +1 -1
- package/dist/assets/{dashboard-R4qgYv8O.js → dashboard-0tCzDYCX.js} +1 -1
- package/dist/assets/{english-definitions-CdIGswXU.js → english-definitions-DeiQ-jTT.js} +1 -1
- package/dist/assets/env-DsyQ2MFX.js +1 -0
- package/dist/assets/{health-Ut9eZrbK.js → health-DyTXU-nb.js} +1 -1
- package/dist/assets/{history-BrmvkGgi.js → history-BXGAdPMI.js} +1 -1
- package/dist/assets/{incoming-CicEs40v.js → incoming-yajkdGBY.js} +1 -1
- package/dist/assets/{index-DZgCwvFD.js → index-CGz4Yow6.js} +4 -4
- package/dist/assets/{integrations-QHeHC-C9.js → integrations-BMrXET36.js} +1 -1
- package/dist/assets/{issues-Ds7iAQFQ.js → issues-kc1XBZCK.js} +1 -1
- package/dist/assets/{learning-Dq0xbg3x.js → learning-CIE5ghYv.js} +1 -1
- package/dist/assets/publish-DTh6amqi.js +3 -0
- package/dist/assets/{pull-requests-DHLK83qZ.js → pull-requests-CbfGSSIh.js} +1 -1
- package/dist/assets/{repository-DWw1VFIQ.js → repository-BstMh-bG.js} +1 -1
- package/dist/assets/settings-Bf8C6dls.js +1 -0
- package/dist/assets/useArchivedVibe64Sessions-DIOpfUxD.js +1 -0
- package/dist/assets/{useCommand-DhwB5k1w.js → useCommand-CVuya6vG.js} +1 -1
- package/dist/assets/{useEndpointResource-tVvsJvd4.js → useEndpointResource-7-YDfAxX.js} +1 -1
- package/dist/assets/{useUiFeedback-DLUToc5y.js → useUiFeedback-Bd3rao6E.js} +1 -1
- package/dist/assets/useVibe64ConversationLog-ChJOU2SD.js +1 -0
- package/dist/assets/{useVibe64DatabaseTools-Cac_aZnv.js → useVibe64DatabaseTools-DKV-TeNJ.js} +1 -1
- package/dist/assets/useVibe64SessionData-BkIHUrP5.js +1 -0
- package/dist/assets/useVibe64SessionSelection-N8wX5oqo.js +1 -0
- package/dist/assets/{useVibe64SystemGraph-idV9zXa9.js → useVibe64SystemGraph-Db_eD-X8.js} +1 -1
- package/dist/assets/vibe64RepositoryRealtime-CHT4-6VN.js +1 -0
- package/dist/assets/vibe64SessionFocus-CS6Ex53G.js +1 -0
- package/dist/assets/vibe64SessionFocus-CSm4YJQD.css +1 -0
- package/dist/assets/vibe64SessionRequestConfig-xIx-5jxQ.js +1 -0
- package/dist/index.html +10 -9
- package/docs/colleague-usage/ai-accounts.md +6 -2
- package/docs/colleague-usage/ai-balance-and-allowance.md +15 -2
- package/docs/colleague-usage/coding-agent-failures.md +2 -1
- package/docs/colleague-usage/coding-agent-goals.md +8 -3
- package/docs/colleague-usage/coding-agents.md +16 -0
- package/docs/colleague-usage/github-work.md +14 -0
- package/docs/colleague-usage/project-setup.md +6 -3
- package/docs/colleague-usage/running-vibe64-on-your-computer.md +3 -1
- package/docs/colleague-usage/sessions.md +35 -7
- package/docs/colleague-usage/starter-apps.md +3 -0
- package/docs/colleague-usage/temporary-chat-context.md +2 -1
- package/docs/colleague-usage/temporary-chats.md +17 -5
- package/node_modules/@jskit-ai/assistant-core/package.json +1 -1
- package/node_modules/@jskit-ai/assistant-runtime/README.md +2 -1
- package/node_modules/@jskit-ai/assistant-runtime/locales/en.json +2 -1
- package/node_modules/@jskit-ai/assistant-runtime/package.json +1 -1
- package/node_modules/@jskit-ai/assistant-voice/package.json +1 -1
- package/node_modules/@local/vibe64-execution/src/host/execHelper.js +34 -34
- package/node_modules/@local/vibe64-execution/src/server/gitTurnCheckpointCommand.js +1327 -0
- package/node_modules/@local/vibe64-genesis/bin/vibe64-genesis-host-context +120 -120
- package/node_modules/@local/vibe64-runtime/src/server/codexAppServerProcess.js +143 -143
- package/node_modules/@local/vibe64-sessions/package.json +2 -1
- package/node_modules/@local/vibe64-terminals/src/server/sessionWorkOperationCommand.js +1385 -1362
- package/package.json +5 -5
- package/server.bundle.mjs +38576 -38459
- package/dist/assets/GithubBrowserTabs-_l6htLOV.js +0 -1
- package/dist/assets/Vibe64OutputControls-DsCbasR0.js +0 -8
- package/dist/assets/_slug_-hep_be7Z.js +0 -24
- package/dist/assets/env-DtkytCtq.js +0 -1
- package/dist/assets/publish-eErG67LW.js +0 -3
- package/dist/assets/settings-QkwnoNn3.js +0 -1
- package/dist/assets/useArchivedVibe64Sessions-Biy_4sxD.js +0 -1
- package/dist/assets/useVibe64ConversationLog-jM3KOvN7.js +0 -1
- package/dist/assets/useVibe64SessionData-FGnNvFfK.js +0 -1
- package/dist/assets/useVibe64SessionSelection-Bgsif-tm.js +0 -1
- package/dist/assets/vibe64RepositoryRealtime-C-J0I5jY.js +0 -1
- package/dist/assets/vibe64SessionFocus-CDIB5Gpr.js +0 -1
- package/dist/assets/vibe64SessionFocus-DSW5Irm6.css +0 -1
|
@@ -71,7 +71,7 @@ r+=3}else if((t[r]&248)===240){if(r+3>=e||(t[r+1]&192)!==128||(t[r+2]&192)!==128
|
|
|
71
71
|
bject"&&typeof t.arrayBuffer=="function"&&typeof t.type=="string"&&typeof t.stream=="function"&&(t[Symbol.toStringTag]===
|
|
72
72
|
"Blob"||t[Symbol.toStringTag]==="File")}lt.exports={isBlob:ui,isValidStatusCode:di,isValidUTF8:Yt,tokenChars:ci};if(In)lt.
|
|
73
73
|
exports.isValidUTF8=function(t){return t.length<24?Yt(t):In(t)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let t=k("utf-8-validate");
|
|
74
|
-
lt.exports.isValidUTF8=function(e){return e.length<32?Yt(e):t(e)}}catch{}});var rr=$((Rl,An)=>{"use strict";var{Writable:li}=k("stream"),
|
|
74
|
+
lt.exports.isValidUTF8=function(e){return e.length<32?Yt(e):t(e)}}catch{}});var rr=$((Rl,An)=>{"use strict";var{Writable:li}=k("stream"),Sn=_e(),{BINARY_TYPES:pi,EMPTY_BUFFER:xn,kStatusCode:fi,kWebSocket:mi}=Q(),
|
|
75
75
|
{concat:Qt,toArrayBuffer:hi,unmask:vi}=qe(),{isValidStatusCode:gi,isValidUTF8:Tn}=Ae(),pt=Buffer[Symbol.species],G=0,bn=1,
|
|
76
76
|
Cn=2,_n=3,Zt=4,er=5,ft=6,tr=class extends li{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==
|
|
77
77
|
void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||pi[0],this._extensions=e.extensions||{},this._isServer=
|
|
@@ -89,7 +89,7 @@ e,n.length-e)),e-=n.length}while(e>0);return r}startLoop(e){this._loop=!0;do swi
|
|
|
89
89
|
break;case bn:this.getPayloadLength16(e);break;case Cn:this.getPayloadLength64(e);break;case _n:this.getMask();break;case Zt:
|
|
90
90
|
this.getData(e);break;case er:case ft:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<
|
|
91
91
|
2){this._loop=!1;return}let r=this.consume(2);if((r[0]&48)!==0){let o=this.createError(RangeError,"RSV2 and RSV3 must be\
|
|
92
|
-
clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(o);return}let n=(r[0]&64)===64;if(n&&!this._extensions[
|
|
92
|
+
clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(o);return}let n=(r[0]&64)===64;if(n&&!this._extensions[Sn.extensionName]){
|
|
93
93
|
let o=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(o);return}if(this._fin=(r[0]&
|
|
94
94
|
128)===128,this._opcode=r[0]&15,this._payloadLength=r[1]&127,this._opcode===0){if(n){let o=this.createError(RangeError,"\
|
|
95
95
|
RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(o);return}if(!this._fragmented){let o=this.createError(RangeError,
|
|
@@ -111,12 +111,12 @@ _LENGTH");e(o);return}this._payloadLength=n*Math.pow(2,32)+r.readUInt32BE(4),thi
|
|
|
111
111
|
this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>
|
|
112
112
|
0)){let r=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(r);return}
|
|
113
113
|
this._masked?this._state=_n:this._state=Zt}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(
|
|
114
|
-
4),this._state=Zt}getData(e){let r=
|
|
114
|
+
4),this._state=Zt}getData(e){let r=xn;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;
|
|
115
115
|
return}r=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&
|
|
116
116
|
vi(r,this._mask)}if(this._opcode>7){this.controlMessage(r,e);return}if(this._maxFragments>0&&++this._numFragments>this._maxFragments){
|
|
117
117
|
let n=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");e(n);return}if(this.
|
|
118
118
|
_compressed){this._state=er,this.decompress(r,e);return}r.length&&(this._messageLength=this._totalPayloadLength,this._fragments.
|
|
119
|
-
push(r)),this.dataMessage(e)}decompress(e,r){this._extensions[
|
|
119
|
+
push(r)),this.dataMessage(e)}decompress(e,r){this._extensions[Sn.extensionName].decompress(e,this._fin,(o,s)=>{if(o)return r(
|
|
120
120
|
o);if(s.length){if(this._messageLength+=s.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let i=this.createError(
|
|
121
121
|
RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");r(i);return}this._fragments.push(s)}
|
|
122
122
|
this.dataMessage(r),this._state===G&&this.startLoop(r)})}dataMessage(e){if(!this._fin){this._state=G;return}let r=this._messageLength,
|
|
@@ -127,17 +127,17 @@ ft,setImmediate(()=>{this.emit("message",o,!0),this._state=G,this.startLoop(e)})
|
|
|
127
127
|
!Tn(o)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(s);return}this._state===er||
|
|
128
128
|
this._allowSynchronousEvents?(this.emit("message",o,!1),this._state=G):(this._state=ft,setImmediate(()=>{this.emit("mess\
|
|
129
129
|
age",o,!1),this._state=G,this.startLoop(e)}))}}controlMessage(e,r){if(this._opcode===8){if(e.length===0)this._loop=!1,this.
|
|
130
|
-
emit("conclude",1005,
|
|
130
|
+
emit("conclude",1005,xn),this.end();else{let n=e.readUInt16BE(0);if(!gi(n)){let s=this.createError(RangeError,`invalid s\
|
|
131
131
|
tatus code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(s);return}let o=new pt(e.buffer,e.byteOffset+2,e.length-2);if(!this.
|
|
132
132
|
_skipUTF8Validation&&!Tn(o)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");r(s);return}
|
|
133
133
|
this._loop=!1,this.emit("conclude",n,o),this.end()}this._state=G;return}this._allowSynchronousEvents?(this.emit(this._opcode===
|
|
134
134
|
9?"ping":"pong",e),this._state=G):(this._state=ft,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=
|
|
135
135
|
G,this.startLoop(r)}))}createError(e,r,n,o,s){this._loop=!1,this._errored=!0;let i=new e(n?`Invalid WebSocket frame: ${r}`:
|
|
136
136
|
r);return Error.captureStackTrace(i,this.createError),i.code=s,i[fi]=o,i}};An.exports=tr});var sr=$((kl,Rn)=>{"use strict";var{Duplex:Pl}=k("stream"),{randomFillSync:wi}=k("crypto"),{types:{isUint8Array:yi}}=k("util"),
|
|
137
|
-
En=_e(),{EMPTY_BUFFER:Ii,kWebSocket:
|
|
137
|
+
En=_e(),{EMPTY_BUFFER:Ii,kWebSocket:Si,NOOP:xi}=Q(),{isBlob:Ee,isValidStatusCode:Ti}=Ae(),{mask:On,toBuffer:fe}=qe(),W=Symbol(
|
|
138
138
|
"kByteLength"),bi=Buffer.alloc(4),mt=8*1024,me,Oe=mt,J=0,Ci=1,_i=2,nr=class t{constructor(e,r,n){this._extensions=r||{},
|
|
139
139
|
n&&(this._generateMask=n,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this.
|
|
140
|
-
_bufferedBytes=0,this._queue=[],this._state=J,this.onerror=
|
|
140
|
+
_bufferedBytes=0,this._queue=[],this._state=J,this.onerror=xi,this[Si]=void 0}static frame(e,r){let n,o=!1,s=2,i=!1;r.mask&&
|
|
141
141
|
(n=r.maskBuffer||bi,r.generateMask?r.generateMask(n):(Oe===mt&&(me===void 0&&(me=Buffer.alloc(mt)),wi(me,0,mt),Oe=0),n[0]=
|
|
142
142
|
me[Oe++],n[1]=me[Oe++],n[2]=me[Oe++],n[3]=me[Oe++]),i=(n[0]|n[1]|n[2]|n[3])===0,s=6);let a;typeof e=="string"?(!r.mask||
|
|
143
143
|
i)&&r[W]!==void 0?a=r[W]:(e=Buffer.from(e),a=e.length):(a=e.length,o=r.mask&&r.readOnly&&!i);let c=a;a>=65536?(s+=8,c=127):
|
|
@@ -265,31 +265,31 @@ o.protocolVersion))throw new RangeError(`Unsupported protocol version: ${o.proto
|
|
|
265
265
|
", ")})`);let s;if(e instanceof ar)s=e;else try{s=new ar(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}s.protocol===
|
|
266
266
|
"http:"?s.protocol="ws:":s.protocol==="https:"&&(s.protocol="wss:"),t._url=s.href;let i=s.protocol==="wss:",a=s.protocol===
|
|
267
267
|
"ws+unix:",c;if(s.protocol!=="ws:"&&!i&&!a?c=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws\
|
|
268
|
-
+unix:"`:a&&!s.pathname?c="The URL's pathname is empty":s.hash&&(c="The URL contains a fragment identifier"),c){let
|
|
269
|
-
c);if(t._redirects===0)throw
|
|
268
|
+
+unix:"`:a&&!s.pathname?c="The URL's pathname is empty":s.hash&&(c="The URL contains a fragment identifier"),c){let S=new SyntaxError(
|
|
269
|
+
c);if(t._redirects===0)throw S;wt(t,S);return}let d=i?443:80,l=ji(16).toString("base64"),m=i?ki.request:Mi.request,f=new Set,
|
|
270
270
|
g;if(o.createConnection=o.createConnection||(i?Yi:Xi),o.defaultPort=o.defaultPort||d,o.port=s.port||d,o.host=s.hostname.
|
|
271
271
|
startsWith("[")?s.hostname.slice(1,-1):s.hostname,o.headers={...o.headers,"Sec-WebSocket-Version":o.protocolVersion,"Sec\
|
|
272
272
|
-WebSocket-Key":l,Connection:"Upgrade",Upgrade:"websocket"},o.path=s.pathname+s.search,o.timeout=o.handshakeTimeout,o.perMessageDeflate&&
|
|
273
273
|
(g=new ae({...o.perMessageDeflate,isServer:!1,maxPayload:o.maxPayload}),o.headers["Sec-WebSocket-Extensions"]=Gi({[ae.extensionName]:g.
|
|
274
|
-
offer()})),r.length){for(let
|
|
275
|
-
uplicated subprotocol was specified");f.add(
|
|
274
|
+
offer()})),r.length){for(let S of r){if(typeof S!="string"||!Ji.test(S)||f.has(S))throw new SyntaxError("An invalid or d\
|
|
275
|
+
uplicated subprotocol was specified");f.add(S)}o.headers["Sec-WebSocket-Protocol"]=r.join(",")}if(o.origin&&(o.protocolVersion<
|
|
276
276
|
13?o.headers["Sec-WebSocket-Origin"]=o.origin:o.headers.Origin=o.origin),(s.username||s.password)&&(o.auth=`${s.username}\
|
|
277
|
-
:${s.password}`),a){let
|
|
278
|
-
0){t._originalIpc=a,t._originalSecure=i,t._originalHostOrSocketPath=a?o.socketPath:s.host;let
|
|
279
|
-
headers:{}},
|
|
280
|
-
t._originalIpc?o.socketPath===t._originalHostOrSocketPath:!1:t._originalIpc?!1:s.host===t._originalHostOrSocketPath;(!
|
|
281
|
-
t._originalSecure&&!i)&&(delete o.headers.authorization,delete o.headers.cookie,
|
|
277
|
+
:${s.password}`),a){let S=o.path.split(":");o.socketPath=S[0],o.path=S[1]}let I;if(o.followRedirects){if(t._redirects===
|
|
278
|
+
0){t._originalIpc=a,t._originalSecure=i,t._originalHostOrSocketPath=a?o.socketPath:s.host;let S=n&&n.headers;if(n={...n,
|
|
279
|
+
headers:{}},S)for(let[A,O]of Object.entries(S))n.headers[A.toLowerCase()]=O}else if(t.listenerCount("redirect")===0){let S=a?
|
|
280
|
+
t._originalIpc?o.socketPath===t._originalHostOrSocketPath:!1:t._originalIpc?!1:s.host===t._originalHostOrSocketPath;(!S||
|
|
281
|
+
t._originalSecure&&!i)&&(delete o.headers.authorization,delete o.headers.cookie,S||delete o.headers.host,o.auth=void 0)}
|
|
282
282
|
o.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(o.auth).toString("base64")),I=t._req=m(o),
|
|
283
283
|
t._redirects&&t.emit("redirect",t.url,I)}else I=t._req=m(o);o.timeout&&I.on("timeout",()=>{B(t,I,"Opening handshake has \
|
|
284
|
-
timed out")}),I.on("error",
|
|
284
|
+
timed out")}),I.on("error",S=>{I===null||I[Vn]||(I=t._req=null,wt(t,S))}),I.on("response",S=>{let A=S.headers.location,O=S.
|
|
285
285
|
statusCode;if(A&&o.followRedirects&&O>=300&&O<400){if(++t._redirects>o.maxRedirects){B(t,I,"Maximum redirects exceeded");
|
|
286
286
|
return}I.abort();let N;try{N=new ar(A,e)}catch{let z=new SyntaxError(`Invalid URL: ${A}`);wt(t,z);return}Gn(t,N,r,n)}else
|
|
287
|
-
t.emit("unexpected-response",I,
|
|
288
|
-
emit("upgrade",
|
|
289
|
-
"websocket"){B(t,A,"Invalid Upgrade header");return}let j=Di("sha1").update(l+qi).digest("base64");if(
|
|
290
|
-
socket-accept"]!==j){B(t,A,"Invalid Sec-WebSocket-Accept header");return}let z=
|
|
287
|
+
t.emit("unexpected-response",I,S)||B(t,I,`Unexpected server response: ${S.statusCode}`)}),I.on("upgrade",(S,A,O)=>{if(t.
|
|
288
|
+
emit("upgrade",S),t.readyState!==P.CONNECTING)return;I=t._req=null;let N=S.headers.upgrade;if(N===void 0||N.toLowerCase()!==
|
|
289
|
+
"websocket"){B(t,A,"Invalid Upgrade header");return}let j=Di("sha1").update(l+qi).digest("base64");if(S.headers["sec-web\
|
|
290
|
+
socket-accept"]!==j){B(t,A,"Invalid Sec-WebSocket-Accept header");return}let z=S.headers["sec-websocket-protocol"],K;if(z!==
|
|
291
291
|
void 0?f.size?f.has(z)||(K="Server sent an invalid subprotocol"):K="Server sent a subprotocol but none was requested":f.
|
|
292
|
-
size&&(K="Server sent no subprotocol"),K){B(t,A,K);return}z&&(t._protocol=z);let H=
|
|
292
|
+
size&&(K="Server sent no subprotocol"),K){B(t,A,K);return}z&&(t._protocol=z);let H=S.headers["sec-websocket-extensions"];
|
|
293
293
|
if(H!==void 0){if(!g){B(t,A,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let q;
|
|
294
294
|
try{q=Wi(H)}catch{B(t,A,"Invalid Sec-WebSocket-Extensions header");return}let ne=Object.keys(q);if(ne.length!==1||ne[0]!==
|
|
295
295
|
ae.extensionName){B(t,A,"Server indicated an extension that was not requested");return}try{g.accept(q[ae.extensionName])}catch{
|
|
@@ -331,13 +331,13 @@ let i=t.charCodeAt(o);if(n===-1&&ca[i]===1)r===-1&&(r=o);else if(o!==0&&(i===32|
|
|
|
331
331
|
44){if(r===-1)throw new SyntaxError(`Unexpected character at index ${o}`);n===-1&&(n=o);let a=t.slice(r,n);if(e.has(a))throw new SyntaxError(
|
|
332
332
|
`The "${a}" subprotocol is duplicated`);e.add(a),r=n=-1}else throw new SyntaxError(`Unexpected character at index ${o}`)}
|
|
333
333
|
if(r===-1||n!==-1)throw new SyntaxError("Unexpected end of input");let s=t.slice(r,o);if(e.has(s))throw new SyntaxError(
|
|
334
|
-
`The "${s}" subprotocol is duplicated`);return e.add(s),e}no.exports={parse:da}});var lo=$(($l,uo)=>{"use strict";var ua=k("events"),
|
|
334
|
+
`The "${s}" subprotocol is duplicated`);return e.add(s),e}no.exports={parse:da}});var lo=$(($l,uo)=>{"use strict";var ua=k("events"),St=k("http"),{Duplex:ql}=k("stream"),{createHash:la}=k("crypto"),oo=vt(),
|
|
335
335
|
ve=_e(),pa=lr(),fa=It(),{CLOSE_TIMEOUT:ma,GUID:ha,kWebSocket:va}=Q(),ga=/^[+/0-9A-Za-z]{22}==$/,so=0,io=1,co=2,pr=class extends ua{constructor(e,r){
|
|
336
336
|
if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxBufferedChunks:256*1024,maxFragments:16*1024,maxPayload:100*1024*
|
|
337
337
|
1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:ma,verifyClient:null,
|
|
338
338
|
noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:fa,...e},e.port==null&&!e.server&&!e.noServer||
|
|
339
339
|
e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server"\
|
|
340
|
-
, or "noServer" options must be specified');if(e.port!=null?(this._server=
|
|
340
|
+
, or "noServer" options must be specified');if(e.port!=null?(this._server=St.createServer((n,o)=>{let s=St.STATUS_CODES[426];
|
|
341
341
|
o.writeHead(426,{"Content-Length":s.length,"Content-Type":"text/plain"}),o.end(s)}),this._server.listen(e.port,e.host,e.
|
|
342
342
|
backlog,r)):e.server&&(this._server=e.server),this._server){let n=this.emit.bind(this,"connection");this._removeListeners=
|
|
343
343
|
wa(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(o,s,i)=>{this.handleUpgrade(
|
|
@@ -359,7 +359,7 @@ if(this.options.perMessageDeflate&&l!==void 0){let f=new ve({...this.options.per
|
|
|
359
359
|
options.maxPayload});try{let g=oo.parse(l);g[ve.extensionName]&&(f.accept(g[ve.extensionName]),m[ve.extensionName]=f)}catch{
|
|
360
360
|
ge(this,e,r,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let f={
|
|
361
361
|
origin:e.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.
|
|
362
|
-
options.verifyClient.length===2){this.options.verifyClient(f,(g,I,
|
|
362
|
+
options.verifyClient.length===2){this.options.verifyClient(f,(g,I,S,A)=>{if(!g)return We(r,I||401,S,A);this.completeUpgrade(
|
|
363
363
|
m,s,d,e,r,n,o)});return}if(!this.options.verifyClient(f))return We(r,401)}this.completeUpgrade(m,s,d,e,r,n,o)}completeUpgrade(e,r,n,o,s,i,a){
|
|
364
364
|
if(!s.readable||!s.writable)return s.destroy();if(s[va])throw new Error("server.handleUpgrade() was called more than onc\
|
|
365
365
|
e with the same socket, possibly due to a misconfiguration");if(this._state>so)return We(s,503);let d=["HTTP/1.1 101 Swi\
|
|
@@ -374,8 +374,8 @@ options.maxBufferedChunks,maxFragments:this.options.maxFragments,maxPayload:this
|
|
|
374
374
|
options.skipUTF8Validation}),this.clients&&(this.clients.add(l),l.on("close",()=>{this.clients.delete(l),this._shouldEmitClose&&
|
|
375
375
|
!this.clients.size&&process.nextTick(Ge,this)})),a(l,o)}};uo.exports=pr;function wa(t,e){for(let r of Object.keys(e))t.on(
|
|
376
376
|
r,e[r]);return function(){for(let n of Object.keys(e))t.removeListener(n,e[n])}}function Ge(t){t._state=co,t.emit("close")}
|
|
377
|
-
function ao(){this.destroy()}function We(t,e,r,n){r=r||
|
|
378
|
-
l","Content-Length":Buffer.byteLength(r),...n},t.once("finish",t.destroy),t.end(`HTTP/1.1 ${e} ${
|
|
377
|
+
function ao(){this.destroy()}function We(t,e,r,n){r=r||St.STATUS_CODES[e],n={Connection:"close","Content-Type":"text/htm\
|
|
378
|
+
l","Content-Length":Buffer.byteLength(r),...n},t.once("finish",t.destroy),t.end(`HTTP/1.1 ${e} ${St.STATUS_CODES[e]}\r
|
|
379
379
|
`+Object.keys(n).map(o=>`${o}: ${n[o]}`).join(`\r
|
|
380
380
|
`)+`\r
|
|
381
381
|
\r
|
|
@@ -384,7 +384,7 @@ l","Content-Length":Buffer.byteLength(r),...n},t.once("finish",t.destroy),t.end(
|
|
|
384
384
|
{text:"Assistant stopped with an error.",messageCode:"assistant.turn.failed"})});var dl=new Set(["contextcompaction",...["context","thread","conversation"].flatMap(t=>["compact","compacted","compaction",
|
|
385
385
|
"truncate","truncated","truncation"].flatMap(e=>[`${t}_${e}`,`${e}_${t}`]))]);var F=Object.freeze({ACTIVE:"active",CANCELLED:"cancelled",COMPLETED:"completed",FAILED:"failed",FINALIZING:"finalizing",
|
|
386
386
|
INTERRUPTED:"interrupted",STARTING:"starting",TIMED_OUT:"timed_out"}),ml=new Set(Object.values(F)),hl=new Set([F.CANCELLED,
|
|
387
|
-
F.COMPLETED,F.FAILED,F.INTERRUPTED,F.TIMED_OUT]),vl=new Set([F.ACTIVE,F.FINALIZING,F.STARTING]);var ya=se(ro(),1),Ia=se(vt(),1),
|
|
387
|
+
F.COMPLETED,F.FAILED,F.INTERRUPTED,F.TIMED_OUT]),vl=new Set([F.ACTIVE,F.FINALIZING,F.STARTING]);var ya=se(ro(),1),Ia=se(vt(),1),Sa=se(_e(),1),xa=se(rr(),1),Ta=se(sr(),1),ba=se(lr(),1),Ca=se(It(),1),_a=se(lo(),1);import{createHash as po}from"node:crypto";import{execFile as Ea}from"node:child_process";import{open as Oa,readFile as Yl,
|
|
388
388
|
rename as Ql,rm as Zl,writeFile as ep}from"node:fs/promises";import mr from"node:path";import{promisify as Ra}from"node:util";var sp=Ra(Ea);var Pa=Object.freeze(["apps","artifact","browser_use","browser_use_external","browser_use_full_cdp_access","code_mode","\
|
|
389
389
|
code_mode_host","computer_use","default_mode_request_user_input","deferred_executor","goals","hooks","image_generation",
|
|
390
390
|
"in_app_browser","memories","multi_agent","multi_agent_v2","plugins","psp","recommended_plugins","request_permissions_to\
|
|
@@ -399,7 +399,7 @@ code","details","message","name"].includes(n)||(r[n]=o);return r}function Ma({cl
|
|
|
399
399
|
1024,hookMaxCount:a=256,hookErrorMaxCount:c=256,hookFieldMaxLength:d=2048,hookFingerprintMaxLength:l=256*1024,hookResponseMaxBytes:m=512*
|
|
400
400
|
1024}={},createError:f=ka}={}){let g=new WeakSet;function I(u,p,h){let v=0;try{v=Buffer.byteLength(JSON.stringify(u),"ut\
|
|
401
401
|
f8")}catch{throw f(`Codex helper execution received an invalid ${h}.`)}if(v>p)throw f(`Codex helper execution received a\
|
|
402
|
-
n oversized ${h}.`)}function
|
|
402
|
+
n oversized ${h}.`)}function S(u){if(typeof u?.currentConnectionGeneration!="function")throw f("Codex helper execution c\
|
|
403
403
|
annot verify the app-server connection generation.");let p=u.currentConnectionGeneration();if(!Number.isSafeInteger(p)||
|
|
404
404
|
p<=0)throw f("Codex helper execution found no active app-server connection.");return p}async function A(u){if(typeof u?.
|
|
405
405
|
currentHelperExecutionContext!="function")throw f("Codex helper execution requires its dedicated isolated provider.");let p=await u.
|
|
@@ -437,8 +437,8 @@ tools:{experimental_request_user_input:{enabled:!1},update_plan:{enabled:!1}},we
|
|
|
437
437
|
w),w}function q(u,p,h,{effort:v="",summary:y=""}={}){let w=z(u),b=K(p,h);return{mcpServerNames:w,hookState:b,config:H({effort:v,
|
|
438
438
|
summary:y,hookKeys:b.hookKeys,mcpServerNames:w})}}async function ne(u,{effort:p="",summary:h=""}={}){if(j(u),typeof u?.readConfig!=
|
|
439
439
|
"function"||typeof u?.listHooks!="function")throw f("Codex helper execution cannot inventory configuration and hooks.");
|
|
440
|
-
let v=await A(u),y=
|
|
441
|
-
cted during helper policy verification.");let b=await u.listHooks([v.cwd]);if(
|
|
440
|
+
let v=await A(u),y=S(u),w=await u.readConfig({cwd:v.cwd,includeLayers:!1});if(S(u)!==y)throw f("Codex app-server reconne\
|
|
441
|
+
cted during helper policy verification.");let b=await u.listHooks([v.cwd]);if(S(u)!==y)throw f("Codex app-server reconne\
|
|
442
442
|
cted during helper policy verification.");let{mcpServerNames:_,hookState:R,config:C}=q(w,b,v.cwd,{effort:p,summary:h});return Object.
|
|
443
443
|
freeze({accountIdentitySignature:v.accountIdentitySignature,config:C,connectionGeneration:y,executionCwd:v.cwd,hookFingerprint:R.
|
|
444
444
|
fingerprint,hookKeys:Object.freeze([...R.hookKeys]),mcpServerNames:Object.freeze([..._])})}function le(u=null,p=null){return u?.
|
|
@@ -456,7 +456,7 @@ h.settings),y=T(v?.id);if(!y)throw f("Codex app-server did not return a helper t
|
|
|
456
456
|
y,"starting")}async function st(u,p,h){if(typeof u?.resumeThread!="function"||typeof u?.deleteThread!="function")throw f(
|
|
457
457
|
"Codex helper execution cannot safely resume and clean up its app-server thread.");let v=T(p);if(!v)throw f("Codex helpe\
|
|
458
458
|
r resume requires a controller-owned thread id.");let y=await h(),w=y.enforcement,b=await u.resumeThread(v,y.settings);return ot(
|
|
459
|
-
u,w,b,v,"resuming")}function
|
|
459
|
+
u,w,b,v,"resuming")}function xe({configResult:u,hookResult:p,workdir:h,effort:v="",summary:y=""}){return q(u,p,h,{effort:v,
|
|
460
460
|
summary:y}).config}function it({approvalPolicy:u,baseInstructions:p,config:h,cwd:v,effectiveSettings:y,sandbox:w,systemPrompt:b}){
|
|
461
461
|
return{allowProviderModelFallback:!1,approvalPolicy:u,baseInstructions:p,config:h,cwd:v,systemPrompt:b||null,dynamicTools:[],
|
|
462
462
|
environments:[],model:y.model,runtimeWorkspaceRoots:[],sandbox:w,selectedCapabilityRoots:[]}}function $t(u,p){return{...u,
|
|
@@ -464,7 +464,7 @@ sessionStartSource:"startup",threadSource:p}}function Bt(u){return{approvalPolic
|
|
|
464
464
|
config:u.config,cwd:u.cwd,systemPrompt:u.systemPrompt,model:u.model,runtimeWorkspaceRoots:u.runtimeWorkspaceRoots,sandbox:u.
|
|
465
465
|
sandbox}}function Ht({approvalPolicy:u,cwd:p,effectiveSettings:h,outputSchema:v}){let y={approvalPolicy:u,cwd:p,environments:[],
|
|
466
466
|
model:h.model,outputSchema:v,runtimeWorkspaceRoots:[],sandboxPolicy:{networkAccess:!1,type:"readOnly"},summary:"none"};return h.
|
|
467
|
-
request.reasoning&&(y.effort=h.thinking),y}return Object.freeze({assertCompatibility:j,executionContext:A,inspect:ne,configuration:
|
|
467
|
+
request.reasoning&&(y.effort=h.thinking),y}return Object.freeze({assertCompatibility:j,executionContext:A,inspect:ne,configuration:xe,
|
|
468
468
|
hasConfiguration:u=>g.has(u),threadSettings:it,threadStartSettings:$t,threadResumeSettings:Bt,turnSettings:Ht,start:pe,resume:st})}
|
|
469
469
|
var ip=Ma();var fr=1024*1024,Na=256*1024,ho=512,ja=128,Da=16*1024;function vo({errorPrefix:t="",identityNamespace:e="codex-account-v\
|
|
470
470
|
1",secretNamespace:r="codex-auth-secret-v1"}={}){function n(d="",l=""){let m=new Error(T(l)||"Codex helper authenticatio\
|
|
@@ -475,17 +475,17 @@ _auth_invalid`,`${l} is missing or invalid. Reconnect Codex and retry.`);return
|
|
|
475
475
|
return po("sha256").update(`${r}\0`,"utf8").update(String(d||""),"utf8").digest("hex")}async function a(d=""){let l=null;
|
|
476
476
|
try{l=await Oa(d,"r");let m=await l.stat();if(!m.isFile()||m.size>fr)throw n(`${t}codex_helper_auth_invalid`,"The select\
|
|
477
477
|
ed Codex authentication record is invalid. Reconnect Codex and retry.");let f=Buffer.alloc(fr+1),g=0;for(;g<f.length;){let{
|
|
478
|
-
bytesRead:
|
|
478
|
+
bytesRead:S}=await l.read(f,g,f.length-g,null);if(S===0)break;g+=S}if(g>fr)throw n(`${t}codex_helper_auth_invalid`,"The \
|
|
479
479
|
selected Codex authentication record is too large. Reconnect Codex and retry.");let I=JSON.parse(f.subarray(0,g).toString(
|
|
480
480
|
"utf8"));if(!E(I))throw new Error("invalid authentication record");return I}catch(m){throw m?.code?.startsWith?.(`${t}co\
|
|
481
481
|
dex_helper_auth_`)?m:n(`${t}codex_helper_auth_unavailable`,"The selected Codex authentication record could not be read. \
|
|
482
482
|
Reconnect Codex and retry.")}finally{await l?.close?.().catch(()=>null)}}async function c(d={}){let l=T(d.toolHomeSource);
|
|
483
483
|
if(!l||!mr.isAbsolute(l))throw n(`${t}codex_helper_auth_unavailable`,"The selected Codex account is unavailable. Reconne\
|
|
484
484
|
ct Codex and retry.");let m=await a(mr.join(l,".codex","auth.json")),f=T(m.auth_mode).toLowerCase();if(f==="chatgpt"){let g=E(
|
|
485
|
-
m.tokens)?m.tokens:{},I=o(g.account_id,{label:"Codex account identity",maxLength:ho}),
|
|
485
|
+
m.tokens)?m.tokens:{},I=o(g.account_id,{label:"Codex account identity",maxLength:ho}),S=o(g.access_token,{label:"Codex a\
|
|
486
486
|
ccess token",maxLength:Na}),A=g.chatgpt_plan_type??g.plan_type,O=A==null||A===""?"":o(A,{label:"Codex plan type",maxLength:ja});
|
|
487
|
-
return Object.freeze({accessToken:
|
|
488
|
-
|
|
487
|
+
return Object.freeze({accessToken:S,accountId:I,authMode:"chatgpt",identitySignature:s("chatgpt",I),planType:O,secretSignature:i(
|
|
488
|
+
S)})}if(["apikey","api_key"].includes(f)){let g=o(m.OPENAI_API_KEY,{label:"Codex API key",maxLength:Da});return Object.freeze(
|
|
489
489
|
{apiKey:g,authMode:"apiKey",identitySignature:s("apiKey",g),secretSignature:i(g)})}throw n(`${t}codex_helper_auth_invali\
|
|
490
490
|
d`,"The selected Codex authentication mode is unsupported. Reconnect Codex and retry.")}return{error:n,identitySignature:s,
|
|
491
491
|
readRecord:a,readSelected:c}}import{execFile as za,spawn as dp}from"node:child_process";import{mkdtemp as lp,open as pp,readFile as hr,readdir as La,rm as fp}from"node:fs/promises";import{setTimeout as go}from"node:timers/promises";import{promisify as Fa}from"node:util";var Ua=Fa(za);async function qa(t){
|
|
@@ -495,7 +495,7 @@ let a=o==="darwin"?100:25,c=1,d=Object.freeze({linux:"linux-proc",darwin:"darwin
|
|
|
495
495
|
running",STOPPED:"stopped"}),f=Object.freeze({ABSENT:"absent",AMBIGUOUS:"ambiguous",EXACT:"exact",INVALID:"invalid",MISMATCH:"\
|
|
496
496
|
mismatch"});function g(u={}){return!!(Number.isSafeInteger(Number(u.pid))&&Number(u.pid)>0&&j(u.processIdentity)&&[m.RUNNING,
|
|
497
497
|
m.STOPPED].includes(u.processState))}function I(u){let p=Number(u);if(!Number.isSafeInteger(p)||p<=0)return!1;try{return process.
|
|
498
|
-
kill(p,0),!0}catch{return!1}}function
|
|
498
|
+
kill(p,0),!0}catch{return!1}}function S(u){let p=Number(u);if(!Number.isSafeInteger(p)||p<=0)return!1;if(process.platform===
|
|
499
499
|
"win32")return I(p);try{return process.kill(-p,0),!0}catch{return!1}}function A(u,p){let h=Number(u),v=process.platform===
|
|
500
500
|
"win32"?h:-h;try{return process.kill(v,p),!0}catch(y){if(!["ESRCH","EPERM"].includes(String(y?.code||"")))throw y;return!1}}
|
|
501
501
|
function O(u=""){let p=String(u||""),h=p.lastIndexOf(")");if(h<0)return null;let v=p.slice(h+1).trim().split(/\s+/u),y=String(
|
|
@@ -527,21 +527,21 @@ h=p.platform!==l?null:o==="darwin"?await Ue().catch(()=>null):await K();if(!h)re
|
|
|
527
527
|
let v=Number(u.pid),y=h.filter(({processGroupId:C})=>C===v),w=[],b=y.some(({environmentReadable:C})=>!C);for(let C of h)
|
|
528
528
|
C.environmentReadable&&C.runtimeToken===p.runtimeToken&&C.commandHash===p.commandHash&&w.push(C);let _=w.find(({pid:C})=>C===
|
|
529
529
|
v);if(_&&_.startTimeTicks!==p.startTimeTicks)return{processGroupIds:[],status:f.AMBIGUOUS};if(w.length===0)return b?{processGroupIds:[],
|
|
530
|
-
status:f.AMBIGUOUS}:{processGroupIds:[],status:y.length>0||
|
|
530
|
+
status:f.AMBIGUOUS}:{processGroupIds:[],status:y.length>0||S(v)?f.MISMATCH:f.ABSENT};let R=[...new Set(w.map(({processGroupId:C})=>C))];
|
|
531
531
|
for(let C of R)if(h.filter(oe=>oe.processGroupId===C).some(oe=>!oe.environmentReadable||!w.some(({pid:Gs})=>Gs===oe.pid)))
|
|
532
532
|
return{processGroupIds:[],status:f.AMBIGUOUS};return y.some(C=>!w.some(({pid:Y})=>Y===C.pid))?{processGroupIds:[],status:f.
|
|
533
533
|
AMBIGUOUS}:{processGroupIds:R,status:f.EXACT}}async function pe(u={},p={}){let h=typeof p.processIdentityInspector=="fun\
|
|
534
534
|
ction"?p.processIdentityInspector:ot;return nt(await h(u))}async function st(u={},p={},h=0){let v=Date.now()+h,y=await pe(
|
|
535
|
-
u,p);for(;Date.now()<v&&y.status===f.EXACT;)await go(100),y=await pe(u,p);return y}async function
|
|
535
|
+
u,p);for(;Date.now()<v&&y.status===f.EXACT;)await go(100),y=await pe(u,p);return y}async function xe(u={},p={}){let h=V(
|
|
536
536
|
p.processIdentitySettleTimeoutMs,{fallback:1e3}),v=V(p.processIdentitySettlePollMs,{fallback:a}),y=Date.now()+h,w=await pe(
|
|
537
537
|
u,p);for(;w.status===f.AMBIGUOUS&&Date.now()<y;)await go(Math.min(v,Math.max(1,y-Date.now()))),w=await pe(u,p);return w}
|
|
538
|
-
async function it(u={},p="SIGTERM",h={}){let v=typeof h.signalProcessGroup=="function"?h.signalProcessGroup:A,y=await
|
|
538
|
+
async function it(u={},p="SIGTERM",h={}){let v=typeof h.signalProcessGroup=="function"?h.signalProcessGroup:A,y=await xe(
|
|
539
539
|
u,h);if(y.status!==f.EXACT)return{inspection:y,signaledProcessGroups:[]};let w=Number(u.pid),b=[...y.processGroupIds.filter(
|
|
540
|
-
R=>R!==w),...y.processGroupIds.filter(R=>R===w)],_=[];for(let R of b){let C=await
|
|
540
|
+
R=>R!==w),...y.processGroupIds.filter(R=>R===w)],_=[];for(let R of b){let C=await xe(u,h);if(C.status===f.ABSENT||C.status===
|
|
541
541
|
f.MISMATCH)return{inspection:C,signaledProcessGroups:_};if(C.status!==f.EXACT)return{inspection:C,signaledProcessGroups:_};
|
|
542
|
-
C.processGroupIds.includes(R)&&(v(R,p),_.push(R))}return{inspection:await
|
|
542
|
+
C.processGroupIds.includes(R)&&(v(R,p),_.push(R))}return{inspection:await xe(u,h),signaledProcessGroups:_}}async function $t(u={},p={}){
|
|
543
543
|
if(!g(u))return{identityStatus:f.INVALID,processExitVerified:!1,stopped:!1};if(u.processState===m.STOPPED&&u.processExitVerifiedAt)
|
|
544
|
-
return{alreadyStopped:!0,identityStatus:f.ABSENT,processExitVerified:!0,stopped:!1};let h=await
|
|
544
|
+
return{alreadyStopped:!0,identityStatus:f.ABSENT,processExitVerified:!0,stopped:!1};let h=await xe(u,p);if(h.status===f.
|
|
545
545
|
ABSENT||h.status===f.MISMATCH)return{identityStatus:h.status,processExitVerified:!0,stopped:!1};if(h.status!==f.EXACT)return{
|
|
546
546
|
identityStatus:h.status,processExitVerified:!1,stopped:!1};let v=await it(u,"SIGTERM",p);if(v.inspection.status===f.AMBIGUOUS)
|
|
547
547
|
return{identityStatus:v.inspection.status,processExitVerified:!1,signaledProcessGroups:v.signaledProcessGroups,stopped:!1};
|
|
@@ -556,15 +556,15 @@ async function Ht({commandHash:u="",pid:p=null,reportedIdentity:h=null,runtimeTo
|
|
|
556
556
|
b)&&b.commandHash===y&&b.runtimeToken===w)return b;let _=Number(p),R=l&&Number.isSafeInteger(_)&&_>0?await Bt(_):null;if(!R?.
|
|
557
557
|
startTimeTicks||R.processGroupId!==_){let C=new Error(`${r} process identity could not be captured.`);throw C.code=n,C}return{
|
|
558
558
|
commandHash:y,platform:l,runtimeToken:w,startTimeTicks:R.startTimeTicks,version:c}}return Object.freeze({normalize:N,isValid:j,
|
|
559
|
-
normalizeInspection:nt,capture:Ht,inspect:pe,stop:$t,isProcessAlive:I})}var
|
|
559
|
+
normalizeInspection:nt,capture:Ht,inspect:pe,stop:$t,isProcessAlive:I})}var xt=(t,e,r,n={})=>Object.freeze({id:t,contextWindow:e,variants:Object.freeze(r),...n}),$a=Object.freeze([Object.freeze(
|
|
560
560
|
{id:"deepseek",baseUrl:"https://api.deepseek.com/",claudeBaseUrl:"https://api.deepseek.com/anthropic",claudeAutoCompactWindow:786432,
|
|
561
|
-
webSearch:!1,models:Object.freeze([
|
|
562
|
-
|
|
561
|
+
webSearch:!1,models:Object.freeze([xt("deepseek-flash",1048576,["low","high","max"],{images:!0,freeformPatch:!0,codexHistoryRouting:!0}),
|
|
562
|
+
xt("deepseek-v4-pro",1048576,["low","high","max"],{freeformPatch:!0,codexHistoryRouting:!0})])}),Object.freeze({id:"zai-\
|
|
563
563
|
coding-plan",baseUrl:"https://api.z.ai/api/v1",claudeBaseUrl:"https://api.z.ai/api/anthropic",claudeAutoCompactWindow:1e6,
|
|
564
|
-
webSearch:!1,models:Object.freeze([
|
|
564
|
+
webSearch:!1,models:Object.freeze([xt("glm-5.3",1048576,["low","high","max"],{freeformPatch:!0,codexHistoryRouting:!0})])}),
|
|
565
565
|
Object.freeze({id:"zai",baseUrl:"https://api.z.ai/api/v1",claudeBaseUrl:"https://api.z.ai/api/anthropic",claudeAutoCompactWindow:1e6,
|
|
566
|
-
webSearch:!1,models:Object.freeze([
|
|
567
|
-
function we(t){return $a.find(e=>e.id===t)||null}var
|
|
566
|
+
webSearch:!1,models:Object.freeze([xt("glm-5.3",1048576,["low","high","max"],{freeformPatch:!0,codexHistoryRouting:!0})])})]);
|
|
567
|
+
function we(t){return $a.find(e=>e.id===t)||null}var Sp=32*1024*1024,xp=Object.freeze({chatgpt:"https://chatgpt.com/backend-api/codex",apiKey:"https://api.openai.com/v1",
|
|
568
568
|
deepseek:we("deepseek").baseUrl.replace(/\/$/u,""),"zai-coding-plan":we("zai-coding-plan").baseUrl,zai:we("zai").baseUrl});var Ep=new URL("./../../../@jskit-ai/assistant-core/src/server/conversation/codexProcess.js",import.meta.url).href;var Dp=Object.freeze({HELPER:"helper",INTERACTIVE:"interactive"}),zp=vr();var Ha=Object.freeze({UNIX:"unix"});var Lp=process.platform==="linux"?107:103,Fp=Object.freeze({MISSING:"missing",RESPONSIVE:"responsive",TIMEOUT:"timeout",
|
|
569
569
|
UNREACHABLE:"unreachable"}),Up=Object.freeze({EXITED:"exited",INCOMPATIBLE:"incompatible",LIVE:"live",MISSING:"missing",
|
|
570
570
|
SUSPECT:"suspect"}),Va=Object.freeze({RUNNING:"running",STOPPED:"stopped"}),qp=Object.freeze({ABSENT:"absent",AMBIGUOUS:"\
|
|
@@ -577,14 +577,14 @@ cv=new Set(Object.values(Rt)),dv=Object.freeze(["createdAt","executionProfile","
|
|
|
577
577
|
jectContextRoot","projectRuntimeRoot","revision","schemaVersion","sessionId","threadId","turnId","updatedAt","workdir"]),
|
|
578
578
|
uv=Object.freeze(["providerId","providerKeyFingerprint","runtime","server","transportId"]),lv=Object.freeze(["accountIde\
|
|
579
579
|
ntitySignature","authStateSignature","endpoint","executionMode","executionContextHash","provider","runtimeDir","runtimes\
|
|
580
|
-
Hash","terminalEnvHash","toolHomeSource","transport"]),pv=Object.freeze(["userAgent"]);var
|
|
580
|
+
Hash","terminalEnvHash","toolHomeSource","transport"]),pv=Object.freeze(["userAgent"]);var xw=Object.freeze([/^(?:let me|i(?:'|’)ll|i will|i(?:'|’)m going to|i am going to)\s+(?:(?:first|now|quickly)\s+)*(?:analy[sz]e|call|check|confirm|do|execute|fetch|find|inspect|investigate|load|look up|open|prepare|query|read|retrieve|review|run|search|summarize|test|try|use|verify)\b/iu,
|
|
581
581
|
/^(?:analy[sz]ing|calling|checking|confirming|executing|fetching|finding|inspecting|investigating|loading|looking up|opening|preparing|querying|reading|retrieving|reviewing|running|searching|summarizing|testing|trying|using|verifying)\b/iu,
|
|
582
|
-
/^(?:one moment|please wait)\b/iu]);var Dw=16*1024*1024;var Fw=new URL("./../../../@jskit-ai/assistant-core/src/server/conversation/commandWrapper.js",import.meta.url).href;var Fc=Object.freeze({streaming:!1,instructions:!1,configuration:!1,goals:!1,goalBudgets:!1,goalCommands:Object.freeze({}),
|
|
583
|
-
attachments:!1,tools:!1,nativeTools:!1});var
|
|
582
|
+
/^(?:one moment|please wait)\b/iu]);var Dw=16*1024*1024;var Fw=new URL("./../../../@jskit-ai/assistant-core/src/server/conversation/commandWrapper.js",import.meta.url).href;var Jw=5*6e4;var Fc=Object.freeze({streaming:!1,instructions:!1,configuration:!1,goals:!1,goalBudgets:!1,goalCommands:Object.freeze({}),
|
|
583
|
+
attachments:!1,tools:!1,nativeTools:!1});var Uy=Object.freeze({goals:!0,goalBudgets:!1,goalCommands:Object.freeze({set:Object.freeze({delivery:"message",interruptsTurn:!1}),
|
|
584
584
|
resume:Object.freeze({delivery:"message",interruptsTurn:!1}),pause:Object.freeze({delivery:"control",interruptsTurn:!0}),
|
|
585
|
-
cancel:Object.freeze({delivery:"message",interruptsTurn:!0})})});var
|
|
585
|
+
cancel:Object.freeze({delivery:"message",interruptsTurn:!0})})});var hI=Object.freeze({goals:!0,goalBudgets:!0,goalCommands:Object.freeze({set:Object.freeze({delivery:"control",interruptsTurn:!1}),
|
|
586
586
|
resume:Object.freeze({delivery:"control",interruptsTurn:!1}),pause:Object.freeze({delivery:"control",interruptsTurn:!0}),
|
|
587
|
-
cancel:Object.freeze({delivery:"control",interruptsTurn:!1})})});var
|
|
587
|
+
cancel:Object.freeze({delivery:"control",interruptsTurn:!1})})});var II=2*1024*1024,SI=32*1024*1024,xI=2*1024*1024;var Ho=/^[a-z][a-z0-9_.-]*$/u,Bc=/^[A-Za-z_$][A-Za-z0-9_$]*$/u;function Vo(t,e){let r=String(t||"").trim().toLowerCase();
|
|
588
588
|
if(!Ho.test(r))throw new TypeError(`${e} must match ${Ho.toString()}.`);return r}function Rr(t,e){if(t==null)return Object.
|
|
589
589
|
freeze({});if(!E(t))throw new TypeError(`${e} must be an object mapping local names to capability ids.`);let r={},n=new Set;
|
|
590
590
|
for(let[o,s]of Object.entries(t)){let i=String(o||"").trim();if(!Bc.test(i))throw new TypeError(`${e} local name "${i}" \
|
|
@@ -640,7 +640,7 @@ if(typeof t!="string")return!1;let r=Qc.exec(t);return r!==null&&os(r[1],e)}func
|
|
|
640
640
|
let r=Zc.exec(t);return r===null?!1:ns(r[1],r[2],r[3])&&os(r[4],e)}function cs(t){return t===void 0?"(?:\\.\\d+)?":t===0?
|
|
641
641
|
"":`(?:\\.\\d{1,${t}})?`}function ds(t,e){let r=et(t,e);return`^${jt}(?::${je}${cs(r)})?$`}function us(t,e){let r=et(t,e);
|
|
642
642
|
return`^${ts}T${jt}:${je}${cs(r)}${Zo}$`}function Nr(t,e){let r;if(typeof t=="number")r=t;else if(typeof t=="string"&&ed.
|
|
643
|
-
test(t))r=Number(t);else return null;return!Number.isSafeInteger(r)||r<-e||r>e?null:r===0?0:r}var od=new Set(["__proto__","prototype","constructor"]);function
|
|
643
|
+
test(t))r=Number(t);else return null;return!Number.isSafeInteger(r)||r<-e||r>e?null:r===0?0:r}var od=new Set(["__proto__","prototype","constructor"]);function x(t,e,r){Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0})}function sd(t,e){if(od.
|
|
644
644
|
has(t))throw new Error(`${e}() received unsafe path segment "${t}".`)}function id(t){return typeof t!="string"?t:t.replace(
|
|
645
645
|
/\[(.+?)\]/g,".$1").replace(/^\.+/,"").replace(/\.+/g,".").replace(/\.$/,"")}function jr(t,e,{normalize:r=!1,allowEmpty:n=!1}={}){
|
|
646
646
|
let o=r?id(t):t;if(typeof o!="string"||o.trim()===""){if(n&&o==="")return[];throw new Error(`${e}() expects a non-empty \
|
|
@@ -685,15 +685,15 @@ definitions:{},nodes:[],nextDefinitionId:1,rootNode:null},enumerable:!1}),e}func
|
|
|
685
685
|
nodes:[],nextDefinitionId:1,rootNode:null}}function yd(t){return String(t).replace(/[^a-zA-Z0-9]+/g,"_").replace(/^_+|_+$/g,
|
|
686
686
|
"")||"operation"}function Lr(t){return U(t)&&Object.keys(t).length===1&&typeof t.$ref=="string"}function Dt(t){return Lr(
|
|
687
687
|
t)?{allOf:[t]}:t}function Id(t,e,r,n,o){return t.nodes.find(s=>s.schema===e&&s.operationName===r&&s.operation===n&&s.additionalProperties===
|
|
688
|
-
o)||null}function
|
|
688
|
+
o)||null}function Sd(t,e){let r=yd(e),n=`SchemaNode_${t.nextDefinitionId}_${r}`;return t.nextDefinitionId+=1,n}function fs(t,e,r,n,o,{
|
|
689
689
|
root:s=!1}={}){let i=zt(e),a=Id(i,t,r,n,o);if(a)return s&&(a.pointer="#",i.rootNode=a),a;let c={schema:t,operationName:r,
|
|
690
|
-
operation:n,additionalProperties:o,status:"new",definitionName:s?null:
|
|
690
|
+
operation:n,additionalProperties:o,status:"new",definitionName:s?null:Sd(i,r),pointer:s?"#":null};return s?i.rootNode=c:
|
|
691
691
|
c.pointer=`#/definitions/${c.definitionName}`,i.nodes.push(c),c}function ms(t,e){if(t.status==="built")return{$ref:t.pointer};
|
|
692
692
|
if(t.status==="building")return{$ref:t.pointer};let r=zt(e);t.status="building",t.pointer!=="#"&&(r.definitions[t.definitionName]=
|
|
693
|
-
{});let n=
|
|
693
|
+
{});let n=xd(t.schema,e,t.operationName,t.operation,t.additionalProperties);return t.status="built",t.pointer==="#"?n:(r.
|
|
694
694
|
definitions[t.definitionName]=n,{$ref:t.pointer})}function $r(t,e,r,n,o=!1){let s=zt(e),i=fs(t,e,r,n,o);return s.rootNode===
|
|
695
|
-
i?{$ref:"#"}:ms(i,e)}function tt(t,{referenceBacked:e=!1}={}){return{schema:t,referenceBacked:e}}function
|
|
696
|
-
let s={},i=[];for(let[c,d]of Object.entries(t.structure))
|
|
695
|
+
i?{$ref:"#"}:ms(i,e)}function tt(t,{referenceBacked:e=!1}={}){return{schema:t,referenceBacked:e}}function xd(t,e,r,n,o=!1){
|
|
696
|
+
let s={},i=[];for(let[c,d]of Object.entries(t.structure))x(s,c,Br(t,c,d,e,r,n)),n.enforceRequired&&d.required===!0&&i.push(
|
|
697
697
|
c);let a={type:"object",properties:s,additionalProperties:o};return i.length>0&&(a.required=i),a}function Td(t,e,r,n,o,s){
|
|
698
698
|
let i=Mt(e,r);if(!i)return null;if(i.kind==="schema")return{...Dt($r(i.schema,n,"replace",i.schema.operations.replace,!1)),
|
|
699
699
|
[ue]:{castType:"object"}};let a=r.items.type==="object"&&Object.hasOwn(r.items,"schema")?"replace":o,c=a==="replace"?t.operations.
|
|
@@ -718,9 +718,9 @@ return m[ue]=d,m}function hs(t,e={}){let r=wd(e),{operationName:n,operation:o}=g
|
|
|
718
718
|
length>0&&(c.definitions=i.definitions),c}function vs(t){return t!==null&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"}function Kr(t){return t instanceof
|
|
719
719
|
Le}function _d(){return{self:!1,children:{}}}function gs(t){return Object.keys(t.children).length>0}function Ie(t,e){return`${t}\
|
|
720
720
|
.${String(e)}`}function Ts(t,e){return t===""?String(e):Ie(t,e)}function ws(t,e){if(t===e)return"";let r=`${e}.`;return t.
|
|
721
|
-
startsWith(r)?t.slice(r.length):null}function De(t,e){let r={};for(let n of Object.values(t)){let o=Ie(e,n.field);
|
|
721
|
+
startsWith(r)?t.slice(r.length):null}function De(t,e){let r={};for(let n of Object.values(t)){let o=Ie(e,n.field);x(r,o,
|
|
722
722
|
{...n,field:o})}return r}function Gr(t){return jr(t,"validatePath")}function ys(t){let e={};for(let r of t){let n=Gr(r),
|
|
723
|
-
o=e;for(let s=0;s<n.length;s++){let i=n[s];Object.hasOwn(o,i)||
|
|
723
|
+
o=e;for(let s=0;s<n.length;s++){let i=n[s];Object.hasOwn(o,i)||x(o,i,_d()),s===n.length-1&&(o[i].self=!0),o=o[i].children}}
|
|
724
724
|
return e}function Ad(t,e){let r=t;for(let n of e){if(r==null||typeof r!="object"||!Object.hasOwn(r,n))return;r=r[n]}return r}
|
|
725
725
|
function Lt(t){return t===null?!0:Array.isArray(t)||U(t)?Object.keys(t).length>0:t!==void 0}function Is(t){return[...t].
|
|
726
726
|
sort((e,r)=>{let n=/^[0-9]+$/.test(e),o=/^[0-9]+$/.test(r);return n&&o?Number(e)-Number(r):n?-1:o?1:e.localeCompare(r)})}
|
|
@@ -729,7 +729,7 @@ prototype);return e.set(t,r),r.structure=null,r.types=t.types,r.validators=t.val
|
|
|
729
729
|
Ut(Ft(t.structure,e)),r._installOperationMethods(),Object.freeze(r)}function Ft(t,e=new WeakMap){if(t===null||typeof t!=
|
|
730
730
|
"object")return t;if(Kr(t))return Od(t,e);if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){let n=new RegExp(
|
|
731
731
|
t.source,t.flags);return n.lastIndex=t.lastIndex,n}if(e.has(t))return e.get(t);if(Array.isArray(t)){let n=[];e.set(t,n);
|
|
732
|
-
for(let o of t)n.push(Ft(o,e));return n}if(!U(t))return t;let r={};e.set(t,r);for(let[n,o]of Object.entries(t))
|
|
732
|
+
for(let o of t)n.push(Ft(o,e));return n}if(!U(t))return t;let r={};e.set(t,r);for(let[n,o]of Object.entries(t))x(r,n,Ft(
|
|
733
733
|
o,e));return r}function Ut(t,e=new WeakSet){if(t===null||typeof t!="object"||e.has(t)||Kr(t))return t;if(e.add(t),Array.
|
|
734
734
|
isArray(t))for(let r of t)Ut(r,e);else for(let r of Reflect.ownKeys(t))Ut(t[r],e);return Object.freeze(t)}function Hr(t){
|
|
735
735
|
return Ut(Ft(t))}function Wr(t,e,r=""){if(!Kr(t)||!Array.isArray(e)||e.length<1)return null;let[n,...o]=e;if(!Object.hasOwn(
|
|
@@ -739,26 +739,26 @@ if(e?.type==="object"){let o=t._resolveObjectFieldMode(n,e);return o.kind!=="nes
|
|
|
739
739
|
n,s);return o.kind==="schema"?i.length<1?null:Wr(o.schema,i,a):i.length<1?o.definition:bs(t,o.definition,i,a)}return null}
|
|
740
740
|
function ze(t,e){let r={...t};if(Array.isArray(t.skipFields)){let n=t.skipFields.map(o=>ws(o,e)).filter(o=>o!==null&&o!==
|
|
741
741
|
"");n.length>0?r.skipFields=n:delete r.skipFields}if(U(t.skipParams)){let n={};for(let[o,s]of Object.entries(t.skipParams)){
|
|
742
|
-
let i=ws(o,e);i===null||i===""||
|
|
742
|
+
let i=ws(o,e);i===null||i===""||x(n,i,s)}Object.keys(n).length>0?r.skipParams=n:delete r.skipParams}return r}var Rd=Object.
|
|
743
743
|
freeze({create:Object.freeze({targetFields:"schema",enforceRequired:!0,applyDefaults:!0,outputFields:"validated",rejectExplicitUndefined:!0}),
|
|
744
744
|
replace:Object.freeze({targetFields:"schema",enforceRequired:!0,applyDefaults:!0,outputFields:"validated",rejectExplicitUndefined:!0}),
|
|
745
745
|
patch:Object.freeze({targetFields:"input",enforceRequired:!1,applyDefaults:!1,outputFields:"input",rejectExplicitUndefined:!0})});
|
|
746
|
-
function
|
|
746
|
+
function Ss(t,e,r,n){let o=e[r];if(!n.includes(o))throw new Error(`Operation "${t}" must define ${r} as one of: ${n.join(
|
|
747
747
|
", ")}.`)}function Vr(t,e,r,n=!0){let o=e[r];if(!(o===void 0&&!n)&&typeof o!="boolean")throw new Error(`Operation "${t}"\
|
|
748
748
|
must define ${r} as a boolean.`)}function Pd(t,e){if(typeof e!="object"||e===null||Array.isArray(e))throw new Error(`Op\
|
|
749
|
-
eration "${t}" must be an object.`);return
|
|
750
|
-
pplyDefaults"),
|
|
749
|
+
eration "${t}" must be an object.`);return Ss(t,e,"targetFields",["schema","input"]),Vr(t,e,"enforceRequired"),Vr(t,e,"a\
|
|
750
|
+
pplyDefaults"),Ss(t,e,"outputFields",["validated","input"]),Vr(t,e,"rejectExplicitUndefined",!1),Object.freeze({targetFields:e.
|
|
751
751
|
targetFields,enforceRequired:e.enforceRequired,applyDefaults:e.applyDefaults,outputFields:e.outputFields,rejectExplicitUndefined:e.
|
|
752
752
|
rejectExplicitUndefined===void 0?!0:e.rejectExplicitUndefined})}function kd(t={}){if(typeof t!="object"||t===null||Array.
|
|
753
753
|
isArray(t))throw new Error("Schema operations must be an object.");let e=Object.create(null);for(let[r,n]of Object.entries(
|
|
754
|
-
Rd))
|
|
755
|
-
null);for(let[r,n]of Object.entries(t))
|
|
756
|
-
delete e.mode,e}var Le=class{constructor(e,r,n,o={}){this.structure=e,this.types=
|
|
754
|
+
Rd))x(e,r,n);for(let[r,n]of Object.entries(t))x(e,r,Pd(r,n));return Object.freeze(e)}function xs(t){let e=Object.create(
|
|
755
|
+
null);for(let[r,n]of Object.entries(t))x(e,r,n);return Object.freeze(e)}function Md(t){let e={...t};return delete e.operation,
|
|
756
|
+
delete e.mode,e}var Le=class{constructor(e,r,n,o={}){this.structure=e,this.types=xs(r),this.validators=xs(n),this.operations=
|
|
757
757
|
kd(o),this._installOperationMethods()}_typeError(e){return this._paramError(e,"TYPE_CAST_FAILED","Value could not be cas\
|
|
758
758
|
t to the required type.")}_paramError(e,r,n,o={}){let s=new Error(n);return s.errorObject={field:e,code:r,message:n,params:o},
|
|
759
759
|
s}_paramToBeSkipped(e,r,n){return typeof r!="object"||r===null?!1:!!(Array.isArray(r[n])&&r[n].includes(e))}_fieldToBeSkipped(e,r){
|
|
760
|
-
return Array.isArray(r.skipFields)&&r.skipFields.includes(e)}_mergeErrors(e,r){for(let[n,o]of Object.entries(r))
|
|
761
|
-
let r={};return
|
|
760
|
+
return Array.isArray(r.skipFields)&&r.skipFields.includes(e)}_mergeErrors(e,r){for(let[n,o]of Object.entries(r))x(e,n,o)}_singleErrorMap(e){
|
|
761
|
+
let r={};return x(r,e.field,e),r}_assertSupportedOptions(e={}){if(Object.hasOwn(e,"onlyObjectValues"))throw new Error("U\
|
|
762
762
|
nsupported validation option `onlyObjectValues`. Call `patch()` directly.");if(Object.hasOwn(e,"mode"))throw new Error("\
|
|
763
763
|
Unsupported validation option `mode`. Call `validateWith()` or an operation method directly.");if(Object.hasOwn(e,"opera\
|
|
764
764
|
tion"))throw new Error("Unsupported validation option `operation`. Call `validateWith()` or an operation method directly\
|
|
@@ -771,54 +771,54 @@ hasOwn(e,"mode")&&e.operation!==e.mode)throw new Error("Path validation options
|
|
|
771
771
|
oth are provided.");if(!Object.hasOwn(this.operations,r))throw new Error(`Unknown operation "${r}".`);let n=this.operations[r];
|
|
772
772
|
return{operationName:r,operation:n,validationOptions:Md(e)}}_buildOperationResult(e,r,n){let o={};for(let s of n.outputFieldNames){
|
|
773
773
|
if(!Object.hasOwn(this.structure,s))continue;let i=n.isFieldPresent(s);(r[s]!==void 0||i&&e[s]===null||n.defaultedFields.
|
|
774
|
-
has(s))&&(!i&&!n.defaultedFields.has(s)||
|
|
774
|
+
has(s))&&(!i&&!n.defaultedFields.has(s)||x(o,s,r[s]))}return o}_resolveObjectFieldMode(e,r){return Nt(e,r)}_resolveArrayItemsConfig(e,r){
|
|
775
775
|
return Mt(e,r)}_resolveObjectValuesConfig(e,r){return Ze(e,r)}_buildArrayItemSettings(e,r){return e.type==="object"&&Object.
|
|
776
776
|
hasOwn(e,"schema")?{...r,operationName:"replace",operation:this.operations.replace}:r}_castValue(e,r,n,o,s,i,a,c){let d=e.
|
|
777
777
|
nullable===!0||a.nullable===!0,l=e.nullOnEmpty===!0||a.nullOnEmpty===!0;if(!Object.hasOwn(this.types,e.type))throw new Error(
|
|
778
|
-
`No casting function for type: ${e.type}`);let m=this.types[e.type];if(r===null)return d?(
|
|
778
|
+
`No casting function for type: ${e.type}`);let m=this.types[e.type];if(r===null)return d?(x(o,s,null),{errors:{},shouldContinue:!1}):
|
|
779
779
|
{errors:this._singleErrorMap({field:n,code:"NOT_NULLABLE",message:"Field cannot be null",params:{}}),shouldContinue:!1};
|
|
780
|
-
if(r===""&&l)return
|
|
780
|
+
if(r===""&&l)return x(o,s,null),{errors:{},shouldContinue:!1};let f={schema:this,definition:e,value:r,fieldName:n,object:o,
|
|
781
781
|
objectBeforeCast:i,valueBeforeCast:r,options:a,mode:c.operationName,operation:c.operationName,fieldPresent:!0,computedOptions:{
|
|
782
|
-
nullable:d||l,nullOnEmpty:l},throwTypeError:()=>{throw this._typeError(n)},throwParamError:(g,I,
|
|
783
|
-
n,g,I,
|
|
782
|
+
nullable:d||l,nullOnEmpty:l},throwTypeError:()=>{throw this._typeError(n)},throwParamError:(g,I,S)=>{throw this._paramError(
|
|
783
|
+
n,g,I,S)}};try{let g=m(f);if(vs(g))throw new Error(`Type handler for "${e.type}" must be synchronous.`);g!==void 0&&(x(o,
|
|
784
784
|
s,g),f.value=g)}catch(g){if(g.errorObject)return{errors:this._singleErrorMap(g.errorObject),shouldContinue:!1};throw g}return{
|
|
785
785
|
errors:{},context:f,shouldContinue:!0}}_runFieldValidators(e,r,n,o,s,i){for(let a of Object.keys(e)){if(a==="type"||this.
|
|
786
786
|
_paramToBeSkipped(a,i.skipParams,r)||!Object.hasOwn(this.validators,a))continue;let c=this.validators[a];try{s.parameterName=
|
|
787
787
|
a,s.parameterValue=e[a];let d=c(s);if(vs(d))throw new Error(`Validator handler for "${a}" must be synchronous.`);d!==void 0&&
|
|
788
|
-
(
|
|
788
|
+
(x(n,o,d),s.value=d)}catch(d){if(d.errorObject)return this._singleErrorMap(d.errorObject);throw d}}return{}}_normalizeAndValidateValue(e,r,n,o,s,i,a,c){
|
|
789
789
|
let d=this._castValue(e,r,n,o,s,i,a,c);if(Object.keys(d.errors).length>0)return d.errors;if(!d.shouldContinue)return{};let{
|
|
790
790
|
context:l}=d,m=this._validateNestedValue(e,n,o,s,a,c);return Object.keys(m).length>0?m:(l.value=o[s],this._runFieldValidators(
|
|
791
791
|
e,n,o,s,l,a))}_normalizeDefault(e,r,{fieldPath:n,currentObject:o,containerKey:s,objectBeforeCast:i,options:a,settings:c}){
|
|
792
|
-
let d={...o};return
|
|
792
|
+
let d={...o};return x(d,s,r),{errors:this._normalizeAndValidateValue(e,r,n,d,s,i,a,c),value:d[s]}}_validateNestedValue(e,r,n,o,s,i){
|
|
793
793
|
if(e.type==="object"){let c=this._resolveObjectFieldMode(r,e);return c.kind==="nested"?this._validateNestedObjectSchema(
|
|
794
794
|
c,r,n,o,s,i):c.kind==="map"?this._validateObjectValues(r,n,o,c.valuesConfig,s,i):{}}if(e.type!=="array")return{};let a=this.
|
|
795
795
|
_resolveArrayItemsConfig(r,e);return a?this._validateArrayItems(r,n,o,a,s,i):{}}_validateNestedObjectSchema(e,r,n,o,s,i){
|
|
796
796
|
let a=n[o],c=e.allowAdditionalProperties?this._extractKnownObjectFields(a,e.schema):a,d=e.schema._validateWithOperation(
|
|
797
|
-
i.operationName,i.operation,c,ze(s,r));return
|
|
797
|
+
i.operationName,i.operation,c,ze(s,r));return x(n,o,e.allowAdditionalProperties?this._mergeKnownAndPassthroughObjectFields(
|
|
798
798
|
a,e.schema,d.validatedObject):d.validatedObject),De(d.errors,r)}_extractKnownObjectFields(e,r){let n={};for(let[o,s]of Object.
|
|
799
|
-
entries(e))Object.hasOwn(r.structure,o)&&
|
|
800
|
-
keys(e)){if(!Object.hasOwn(r.structure,s)){
|
|
801
|
-
n))Object.hasOwn(o,s)||
|
|
799
|
+
entries(e))Object.hasOwn(r.structure,o)&&x(n,o,s);return n}_mergeKnownAndPassthroughObjectFields(e,r,n){let o={};for(let s of Object.
|
|
800
|
+
keys(e)){if(!Object.hasOwn(r.structure,s)){x(o,s,e[s]);continue}Object.hasOwn(n,s)&&x(o,s,n[s])}for(let[s,i]of Object.entries(
|
|
801
|
+
n))Object.hasOwn(o,s)||x(o,s,i);return o}_validateObjectValues(e,r,n,o,s,i){let a=r[n],c={...a},d={};x(r,n,c);for(let l of Object.
|
|
802
802
|
keys(a)){let m=Ie(e,l);if(this._fieldToBeSkipped(m,s))continue;let f=c[l];if(f===void 0){i.rejectExplicitUndefined?this.
|
|
803
803
|
_mergeErrors(d,this._singleErrorMap(this._typeError(m).errorObject)):delete c[l];continue}if(o.kind==="schema"){let I=o.
|
|
804
|
-
schema._validateWithOperation("replace",o.schema.operations.replace,f,ze(s,m));
|
|
804
|
+
schema._validateWithOperation("replace",o.schema.operations.replace,f,ze(s,m));x(c,l,I.validatedObject),this._mergeErrors(
|
|
805
805
|
d,De(I.errors,m));continue}let g=this._normalizeAndValidateValue(o.definition,f,m,c,l,a,s,this._buildArrayItemSettings(o.
|
|
806
|
-
definition,i));this._mergeErrors(d,g)}return d}_validateArrayItems(e,r,n,o,s,i){let a=r[n],c=a.slice(),d={};
|
|
806
|
+
definition,i));this._mergeErrors(d,g)}return d}_validateArrayItems(e,r,n,o,s,i){let a=r[n],c=a.slice(),d={};x(r,n,c);for(let l=0;l<
|
|
807
807
|
c.length;l++){let m=Ie(e,l);if(this._fieldToBeSkipped(m,s))continue;if(!Object.hasOwn(a,l)||c[l]===void 0){i.rejectExplicitUndefined?
|
|
808
808
|
this._mergeErrors(d,this._singleErrorMap(this._typeError(m).errorObject)):delete c[l];continue}if(o.kind==="schema"){let g=o.
|
|
809
|
-
schema._validateWithOperation("replace",o.schema.operations.replace,c[l],ze(s,m));
|
|
809
|
+
schema._validateWithOperation("replace",o.schema.operations.replace,c[l],ze(s,m));x(c,l,g.validatedObject),this._mergeErrors(
|
|
810
810
|
d,De(g.errors,m));continue}let f=this._normalizeAndValidateValue(o.definition,c[l],m,c,l,a,s,this._buildArrayItemSettings(
|
|
811
811
|
o.definition,i));this._mergeErrors(d,f)}return d}_validateField(e,r,n,o,s){if(!Object.hasOwn(this.structure,e))return{};
|
|
812
812
|
let i=this.structure[e];if(this._fieldToBeSkipped(e,o))return{};let a=s.isFieldPresent(e),c=r[e],d=c===void 0;return s.enforceRequired&&
|
|
813
813
|
i.required&&(!a||d)&&!this._paramToBeSkipped("required",o.skipParams,e)?this._singleErrorMap({field:e,code:"REQUIRED",message:"\
|
|
814
814
|
Field is required",params:{}}):a?d?s.rejectExplicitUndefined?this._singleErrorMap(this._typeError(e).errorObject):{}:this.
|
|
815
815
|
_normalizeAndValidateValue(i,c,e,n,e,r,o,s):{}}_validateWithOperation(e,r,n,o){this._assertSupportedOptions(o);let s={},
|
|
816
|
-
i={...n},a=this._buildOperationSettings(e,r,n);for(let c of Object.keys(n))Object.hasOwn(this.structure,c)||
|
|
816
|
+
i={...n},a=this._buildOperationSettings(e,r,n);for(let c of Object.keys(n))Object.hasOwn(this.structure,c)||x(s,c,{field:c,
|
|
817
817
|
code:"FIELD_NOT_ALLOWED",message:"Field not allowed",params:{}});for(let c of a.targetFieldNames){let d=this._validateField(
|
|
818
818
|
c,n,i,o,a);this._mergeErrors(s,d)}if(a.applyDefaults){for(let c of Object.keys(this.structure))if(!a.isFieldPresent(c)&&
|
|
819
819
|
this.structure[c].defaultTo!==void 0){let d=this.structure[c],l=typeof d.defaultTo=="function"?d.defaultTo():d.defaultTo,
|
|
820
820
|
m=this._normalizeDefault(d,l,{fieldPath:c,currentObject:i,containerKey:c,objectBeforeCast:n,options:o,settings:a});if(this.
|
|
821
|
-
_mergeErrors(s,m.errors),Object.keys(m.errors).length>0)continue;
|
|
821
|
+
_mergeErrors(s,m.errors),Object.keys(m.errors).length>0)continue;x(i,c,m.value),a.defaultedFields.add(c)}}return{validatedObject:this.
|
|
822
822
|
_buildOperationResult(n,i,a),errors:s}}_validateSelectedTree(e,r,n,o,s=""){let i={},a={};for(let c of Is(Object.keys(e))){
|
|
823
823
|
let d=Ts(s,c);if(!Object.hasOwn(this.structure,c))throw new Error(`Unknown schema path "${d}".`);let l=this._validateSelectedField(
|
|
824
824
|
c,e[c],r,a,n,o,d);this._mergeErrors(i,l)}return{validatedObject:a,errors:i}}_validateSelectedField(e,r,n,o,s,i,a){if(!Object.
|
|
@@ -827,28 +827,28 @@ let m=Object.hasOwn(n,e),f=n[e],g={};if(!m){if(d&&i.enforceRequired&&c.required&
|
|
|
827
827
|
a)&&this._mergeErrors(g,this._singleErrorMap({field:a,code:"REQUIRED",message:"Field is required",params:{}})),d&&i.applyDefaults&&
|
|
828
828
|
c.defaultTo!==void 0){let O=typeof c.defaultTo=="function"?c.defaultTo():c.defaultTo,N=this._normalizeDefault(c,O,{fieldPath:a,
|
|
829
829
|
currentObject:o,containerKey:e,objectBeforeCast:n,options:s,settings:i});this._mergeErrors(g,N.errors),Object.keys(N.errors).
|
|
830
|
-
length===0&&
|
|
830
|
+
length===0&&x(o,e,N.value)}return g}if(f===void 0)return d&&i.rejectExplicitUndefined?this._singleErrorMap(this._typeError(
|
|
831
831
|
a).errorObject):{};let I={[e]:f};if(d){let O=this._normalizeAndValidateValue(c,f,a,I,e,n,s,i);return Object.hasOwn(I,e)&&
|
|
832
|
-
I[e]!==void 0?
|
|
833
|
-
|
|
834
|
-
I,e,s,i);return Lt(I[e])&&
|
|
832
|
+
I[e]!==void 0?x(o,e,I[e]):I[e]===null&&x(o,e,null),O}if(!l)return{};let S=this._castValue(c,f,a,I,e,n,s,i);if(Object.keys(
|
|
833
|
+
S.errors).length>0)return S.errors;if(!S.shouldContinue)return{};let A=this._validateSelectedDescendants(c,r.children,a,
|
|
834
|
+
I,e,s,i);return Lt(I[e])&&x(o,e,I[e]),A}_validateSelectedDescendants(e,r,n,o,s,i,a){if(e.type==="object"){let c=this._resolveObjectFieldMode(
|
|
835
835
|
n,e);if(c.kind!=="nested")throw new Error(`Schema path "${n}" does not support nested field selection.`);let d=o[s];if(!U(
|
|
836
|
-
d))return{};let l=c.schema._validateSelectedTree(r,d,ze(i,n),{...a,defaultedFields:new Set});return
|
|
836
|
+
d))return{};let l=c.schema._validateSelectedTree(r,d,ze(i,n),{...a,defaultedFields:new Set});return x(o,s,l.validatedObject),
|
|
837
837
|
De(l.errors,n)}if(e.type==="array"){let c=this._resolveArrayItemsConfig(n,e);if(!c)throw new Error(`Schema path "${n}" d\
|
|
838
838
|
oes not define array items for nested selection.`);return this._validateSelectedArrayItems(n,o,s,c,r,i,a)}throw new Error(
|
|
839
839
|
`Schema path "${n}" does not support nested field selection.`)}_validateSelectedArrayItems(e,r,n,o,s,i,a){let c=[],d=r[n],
|
|
840
|
-
l={};
|
|
841
|
-
id because array segments must use numeric indexes.`);let f=Number(m),g=Ie(e,f),I=s[m],
|
|
842
|
-
g,i))continue;if(!Object.hasOwn(d,f)){
|
|
843
|
-
if(O===void 0){
|
|
844
|
-
let q=o.schema._validateWithOperation("replace",o.schema.operations.replace,O,ze(i,g));Lt(q.validatedObject)&&
|
|
840
|
+
l={};x(r,n,c);for(let m of Is(Object.keys(s))){if(!/^[0-9]+$/.test(m))throw new Error(`Schema path "${Ie(e,m)}" is inval\
|
|
841
|
+
id because array segments must use numeric indexes.`);let f=Number(m),g=Ie(e,f),I=s[m],S=I.self===!0,A=gs(I);if(this._fieldToBeSkipped(
|
|
842
|
+
g,i))continue;if(!Object.hasOwn(d,f)){S&&a.rejectExplicitUndefined&&x(l,g,this._typeError(g).errorObject);continue}let O=d[f];
|
|
843
|
+
if(O===void 0){S&&a.rejectExplicitUndefined&&x(l,g,this._typeError(g).errorObject);continue}if(o.kind==="schema"){if(S){
|
|
844
|
+
let q=o.schema._validateWithOperation("replace",o.schema.operations.replace,O,ze(i,g));Lt(q.validatedObject)&&x(c,f,q.validatedObject),
|
|
845
845
|
this._mergeErrors(l,De(q.errors,g));continue}if(!A)continue;let H=o.schema._validateSelectedTree(I.children,O,ze(i,g),{...a,
|
|
846
|
-
operationName:"replace",operation:o.schema.operations.replace,defaultedFields:new Set});Lt(H.validatedObject)&&
|
|
847
|
-
this._mergeErrors(l,De(H.errors,g));continue}let N=this._buildArrayItemSettings(o.definition,a),j=[O];if(
|
|
848
|
-
o.definition,O,g,j,0,d,i,N);Object.hasOwn(j,0)&&j[0]!==void 0?
|
|
846
|
+
operationName:"replace",operation:o.schema.operations.replace,defaultedFields:new Set});Lt(H.validatedObject)&&x(c,f,H.validatedObject),
|
|
847
|
+
this._mergeErrors(l,De(H.errors,g));continue}let N=this._buildArrayItemSettings(o.definition,a),j=[O];if(S){let H=this._normalizeAndValidateValue(
|
|
848
|
+
o.definition,O,g,j,0,d,i,N);Object.hasOwn(j,0)&&j[0]!==void 0?x(c,f,j[0]):j[0]===null&&x(c,f,null),this._mergeErrors(l,H);
|
|
849
849
|
continue}if(!A)continue;let z=this._castValue(o.definition,O,g,j,0,d,i,N);if(Object.keys(z.errors).length>0){this._mergeErrors(
|
|
850
850
|
l,z.errors);continue}if(!z.shouldContinue)continue;let K=this._validateSelectedDescendants(o.definition,I.children,g,j,0,
|
|
851
|
-
i,N);Lt(j[0])&&
|
|
851
|
+
i,N);Lt(j[0])&&x(c,f,j[0]),this._mergeErrors(l,K)}return l}validateWith(e,r,n={}){if(!Object.hasOwn(this.operations,e))throw new Error(
|
|
852
852
|
`Unknown operation "${e}".`);let o=this.operations[e];return this._assertPlainObjectInput(e,r),this._validateWithOperation(
|
|
853
853
|
e,o,r,n)}validateAt(e,r,n={}){this._assertPlainObjectInput("validateAt",r);let o=Gr(e),{operationName:s,operation:i,validationOptions:a}=this.
|
|
854
854
|
_resolvePathValidationRequest(n),c=this._validateSelectedTree(ys([e]),r,a,this._buildOperationSettings(s,i,r));return{validatedValue:Ad(
|
|
@@ -860,7 +860,7 @@ _buildOperationSettings(o,s,r))}_installOperationMethods(){for(let e of Object.k
|
|
|
860
860
|
return hs(this,e)}getFieldDefinitions(){return Hr(this.structure)}getFieldDefinition(e){if(typeof e!="string"||e.trim()===
|
|
861
861
|
"")throw new Error("Field path must be a non-empty string.");let r=Wr(this,Gr(e.trim()));return r===null?null:Hr(r)}getFieldMessages(e){
|
|
862
862
|
let r=this.getFieldDefinition(e);return!r||typeof r.messages!="object"||r.messages===null?Object.freeze({}):Hr(r.messages)}cleanup(e,r){
|
|
863
|
-
let n={};for(let o of Object.keys(e))Object.hasOwn(this.structure,o)&&this.structure[o][r]&&
|
|
863
|
+
let n={};for(let o of Object.keys(e))Object.hasOwn(this.structure,o)&&this.structure[o][r]&&x(n,o,e[o]);return n}};var{parse:vS,stringify:Nd}=JSON,{keys:gS}=Object,jd=String,Dd="string";var Cs="object",zd=(t,e)=>e;var _s=(t,e,r)=>{let n=jd(e.push(r)-1);return t.set(r,n),n};var As=(t,e,r)=>{let n=e&&typeof e===Cs?(l,m)=>l===""||-1<e.indexOf(l)?m:void 0:e||zd,o=new Map,s=[],i=[],a=+_s(o,s,n.call(
|
|
864
864
|
{"":t},"",t)),c=!a;for(;a<s.length;)c=!0,i[a]=Nd(s[a++],d,r);return"["+i.join(",")+"]";function d(l,m){if(c)return c=!c,
|
|
865
865
|
m;let f=n.call(this,l,m);switch(typeof f){case Cs:if(f===null)return f;case Dd:return o.get(f)||_s(o,s,f)}return f}};var Fd=new Set(["true","1","yes","y","on"]),Ud=new Set(["false","0","no","n","off"]);function qd(t){return t!==null&&(typeof t==
|
|
866
866
|
"object"||typeof t=="function")&&typeof t.then=="function"}function Es(t){if(typeof t=="number")return Number.isFinite(t)?
|
|
@@ -916,9 +916,9 @@ typeof n.value=="string"&&n.value===""&&n.throwParamError("NOT_EMPTY","Field can
|
|
|
916
916
|
"unsigned",()=>{}),r("precision",()=>{}),r("scale",()=>{}),r("temporalPrecision",n=>{if(n.definition.type!=="time"&&n.definition.
|
|
917
917
|
type!=="dateTime")throw new Error(`temporalPrecision can only be used on time or dateTime fields (${n.fieldName}).`)}),r(
|
|
918
918
|
"nullable",()=>{}),r("nullOnEmpty",()=>{}),r("defaultTo",()=>{})}},Os=$d;var ks=new WeakMap,Ms=new WeakMap,Ns=Symbol.for("json-rest-schema.registry-metadata");function Bd(t,e,r){if(typeof r!="f\
|
|
919
|
-
unction")throw new Error(`Type handler for '${e}' must be a function.`);
|
|
920
|
-
on")throw new Error(`Validator handler for '${e}' must be a function.`);
|
|
921
|
-
for(let[r,n]of Object.entries(t))
|
|
919
|
+
unction")throw new Error(`Type handler for '${e}' must be a function.`);x(t,e,r)}function Hd(t,e,r){if(typeof r!="functi\
|
|
920
|
+
on")throw new Error(`Validator handler for '${e}' must be a function.`);x(t,e,r)}function qt(t={}){let e=Object.create(null);
|
|
921
|
+
for(let[r,n]of Object.entries(t))x(e,r,n);return e}function Vd(t,e){if(typeof t.install!="function")throw new Error("Plu\
|
|
922
922
|
gin must have an install method.");t.install(e)}function Rs(t,e,r){ks.set(t,e),Ms.set(t,r),Object.defineProperty(t,Ns,{value:Object.
|
|
923
923
|
freeze({getTypes:()=>e,getValidators:()=>r}),enumerable:!1,configurable:!1,writable:!1})}function Gd(t){if(!t||typeof t!=
|
|
924
924
|
"object"&&typeof t!="function")return null;let e=ks.get(t),r=Ms.get(t);if(e&&r)return{types:e,validators:r};let n=t[Ns];
|
|
@@ -927,14 +927,14 @@ typeof t=="object"&&t.types&&typeof t.types=="object"&&t.validators&&typeof t.va
|
|
|
927
927
|
nction"&&typeof t.replace=="function"&&typeof t.patch=="function"&&typeof t.toJsonSchema=="function"?{types:t.types,validators:t.
|
|
928
928
|
validators}:null}function Wd(t){return t.length===1&&Array.isArray(t[0])?t[0]:t}function Kd(t,e){return t===e}function Ps(t,e,r){
|
|
929
929
|
for(let[n,o]of Object.entries(e)){if(Object.hasOwn(t,n)&&!Kd(t[n],o))throw new Error(`Cannot merge schema factories with\
|
|
930
|
-
conflicting ${r} "${n}".`);
|
|
930
|
+
conflicting ${r} "${n}".`);x(t,n,o)}}function Jd(t,e,r){let n=Wd(r).filter(Boolean);if(n.length<1)return{types:qt(t),validators:qt(
|
|
931
931
|
e)};let o=Object.create(null),s=Object.create(null);for(let i of n){let a=Gd(i);if(!a)throw new Error("Factory sources m\
|
|
932
932
|
ust be schema instances or schema factories created by json-rest-schema.");Ps(o,a.types,"type"),Ps(s,a.validators,"valid\
|
|
933
933
|
ator")}return{types:o,validators:s}}function js({types:t={},validators:e={},installCore:r=!0}={}){let n=qt(t),o=qt(e),s=(i,a={})=>{
|
|
934
934
|
let c=new Le(i,n,o,a.operations);return Rs(c,n,o),c};return Rs(s,n,o),s.addType=(i,a)=>{Bd(n,i,a)},s.addValidator=(i,a)=>{
|
|
935
935
|
Hd(o,i,a)},s.use=i=>{Vd(i,{addType:s.addType,addValidator:s.addValidator})},s.createFactory=(...i)=>{let a=Jd(n,o,i);return js(
|
|
936
|
-
{types:a.types,validators:a.validators,installCore:!1})},r&&s.use(Os),s}var re=js({installCore:!0});function
|
|
937
|
-
t))
|
|
936
|
+
{types:a.types,validators:a.validators,installCore:!1})},r&&s.use(Os),s}var re=js({installCore:!0});function Se(t,e=new WeakSet){if(!t||typeof t!="object"||e.has(t))return t;e.add(t);for(let r of Object.getOwnPropertyNames(
|
|
937
|
+
t))Se(t[r],e);return Object.freeze(t)}var FS=Object.freeze({REQUIRED:{messageKey:"required",code:"kernel.validation.field.required"},TYPE_CAST_FAILED:{messageKey:"\
|
|
938
938
|
default",code:"kernel.validation.field.typeCastFailed"},NOT_NULLABLE:{messageKey:"default",code:"kernel.validation.field\
|
|
939
939
|
.notNullable"},MIN_LENGTH:{messageKey:"minLength",code:"kernel.validation.field.minLength"},MAX_LENGTH:{messageKey:"maxL\
|
|
940
940
|
ength",code:"kernel.validation.field.maxLength"},MIN_VALUE:{messageKey:"min",code:"kernel.validation.field.minValue"},MAX_VALUE:{
|
|
@@ -942,10 +942,10 @@ messageKey:"max",code:"kernel.validation.field.maxValue"},PATTERN:{messageKey:"p
|
|
|
942
942
|
ttern"},ENUM_VALUE:{messageKey:"enum",code:"kernel.validation.field.enumValue"},FIELD_NOT_ALLOWED:{messageKey:"additiona\
|
|
943
943
|
lProperties",code:"kernel.validation.field.notAllowed"},CUSTOM_VALIDATOR_FAILED:{messageKey:"validator",code:""},STRICT_BOOLEAN:{
|
|
944
944
|
messageKey:"default",code:"kernel.validation.field.strictBoolean"},RANGE_EXCEEDED:{messageKey:"default",code:"kernel.val\
|
|
945
|
-
idation.field.rangeExceeded"},NOT_EMPTY:{messageKey:"default",code:"kernel.validation.field.notEmpty"}}),
|
|
945
|
+
idation.field.rangeExceeded"},NOT_EMPTY:{messageKey:"default",code:"kernel.validation.field.notEmpty"}}),US=Object.freeze(
|
|
946
946
|
{code:"kernel.validation.invalid",message:"Invalid value."});var Qd=re({cursor:{type:"id",required:!1},limit:{type:"number",required:!1,min:1,unsigned:!0}}),Zd=Object.freeze({schema:Qd,
|
|
947
947
|
mode:"patch"});var zs=Object.freeze({type:"string",pattern:"^(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d)?$",minLength:5}),eu=Object.freeze(
|
|
948
|
-
{...zs,nullable:!0});var
|
|
948
|
+
{...zs,nullable:!0});var ux=new Map([{keyword:"required",code:"kernel.validation.required"},{keyword:"type",code:"kernel.validation.type"},{keyword:"\
|
|
949
949
|
minLength",code:"kernel.validation.minLength"},{keyword:"maxLength",code:"kernel.validation.maxLength"},{keyword:"minimu\
|
|
950
950
|
m",code:"kernel.validation.minimum"},{keyword:"maximum",code:"kernel.validation.maximum"},{keyword:"exclusiveMinimum",code:"\
|
|
951
951
|
kernel.validation.exclusiveMinimum"},{keyword:"exclusiveMaximum",code:"kernel.validation.exclusiveMaximum"},{keyword:"mu\
|
|
@@ -957,9 +957,9 @@ additionalItems",code:"kernel.validation.additionalItems"},{keyword:"uniqueItems
|
|
|
957
957
|
perties"},{keyword:"additionalProperties",code:"kernel.validation.additionalProperties"},{keyword:"propertyNames",code:"\
|
|
958
958
|
kernel.validation.propertyNames"},{keyword:"oneOf",code:"kernel.validation.oneOf"},{keyword:"anyOf",code:"kernel.validat\
|
|
959
959
|
ion.anyOf"},{keyword:"not",code:"kernel.validation.not"},{keyword:"if",code:"kernel.validation.if"}].map(({keyword:t,code:e})=>[
|
|
960
|
-
t,e]));var Ls="^[1-9][0-9]*$",Xr=
|
|
960
|
+
t,e]));var Ls="^[1-9][0-9]*$",Xr=Se({type:"string",minLength:1,pattern:Ls}),ru=Se({...Xr,nullable:!0}),nu=Se({schema:re({recordId:{
|
|
961
961
|
...Xr,required:!0,messages:{pattern:{code:"kernel.validation.recordIdInvalid",message:"Record id must be a canonical pos\
|
|
962
|
-
itive integer string."}}}}),mode:"patch"});var Fs=20,
|
|
962
|
+
itive integer string."}}}}),mode:"patch"});var Fs=20,Jx=32*1024,Xx=48*1024,Yr=Object.freeze({search:"assistant_action_search",contract:"assistant_action_contract",
|
|
963
963
|
execute:"assistant_action_execute"}),Qr=Object.freeze({type:"object",additionalProperties:!0}),iu=Object.freeze({type:"o\
|
|
964
964
|
bject",additionalProperties:!1,properties:{query:{type:"string",maxLength:200,description:"Optional literal words or act\
|
|
965
965
|
ion-id fragments; every word must match. Use short resource or operation terms such as list. Omit query to browse all av\
|
|
@@ -981,8 +981,8 @@ le records. Search before claiming a capability is unavailable. If terminology d
|
|
|
981
981
|
query to browse. Returns compact paged matches without schemas; follow nextCursor when more discovery is needed.",parameters:iu,
|
|
982
982
|
outputSchema:au}),Object.freeze({name:Yr.contract,description:"Load the exact input and output contract for one availabl\
|
|
983
983
|
e action before executing it.",parameters:cu,outputSchema:du}),Object.freeze({name:Yr.execute,description:"Execute one a\
|
|
984
|
-
vailable action after loading its exact contract in this turn. The action result is returned in result.",parameters:uu,outputSchema:lu})]);var
|
|
985
|
-
type:"string",maxLength:Fe.toolName,required:!1},arguments:{type:"string",maxLength:Fe.arguments,required:!1}}),
|
|
984
|
+
vailable action after loading its exact contract in this turn. The action result is returned in result.",parameters:uu,outputSchema:lu})]);var kT=new URL("./../../../@jskit-ai/assistant-core/src/server/conversation/openCodeProcess.js",import.meta.url).href;var zT=256*1024;var LT=2*1024*1024;var FT=Us.map(({name:t,description:e,parameters:r})=>({type:"function",function:{name:t,description:e,parameters:r}}));var Fe=Object.freeze({text:16e3,toolName:256,arguments:256*1024,toolProgress:280});var Eb=re({kind:{type:"string",enum:["reply","tool"],required:!0},text:{type:"string",maxLength:Fe.text,required:!1},toolName:{
|
|
985
|
+
type:"string",maxLength:Fe.toolName,required:!1},arguments:{type:"string",maxLength:Fe.arguments,required:!1}}),Ob={type:"\
|
|
986
986
|
object",additionalProperties:!1,required:["kind","text","toolName","arguments"],properties:{kind:{type:"string",enum:["r\
|
|
987
987
|
eply","tool"]},text:{type:"string",maxLength:Fe.text,description:"The final reply, or a brief progress sentence for the \
|
|
988
988
|
first tool request; empty for subsequent tool requests."},toolName:{type:"string",maxLength:Fe.toolName},arguments:{type:"\
|
|
@@ -1010,11 +1010,11 @@ k delivery requires a binding resolver.");return async function(n){if(n.scope!==
|
|
|
1010
1010
|
n);if(!o)return{kind:"unclaimed"};if(o.delivery==="native")return{kind:"delivery",text:""};if(o.delivery!=="hook")throw new TypeError(
|
|
1011
1011
|
"Unknown conversation instruction delivery mode.");if(typeof e!="function")throw new TypeError("Hook delivery requires a\
|
|
1012
1012
|
n instruction resolver.");let s=await e(o,n);if(typeof s!="string"||!s.trim())throw new TypeError("Managed conversation \
|
|
1013
|
-
instructions are unavailable.");return{kind:"delivery",text:s}}}var
|
|
1013
|
+
instructions are unavailable.");return{kind:"delivery",text:s}}}var CC=Object.freeze({codex:Object.freeze({requiresWriterExclusion:!1}),claude:Object.freeze({requiresWriterExclusion:!0,
|
|
1014
1014
|
allowsManagedServer:!1,matchesProcess:({executable:t,commandLine:e})=>/(?:^|[\0/])claude(?:\0|$)|@anthropic-ai\/claude-code\//u.
|
|
1015
1015
|
test(`${t||""}\0${e}`)}),opencode:Object.freeze({requiresWriterExclusion:!0,allowsManagedServer:!0,matchesProcess:({executable:t,
|
|
1016
1016
|
commandLine:e})=>/(?:^|[\0/])opencode(?:\0|$)/u.test(`${t||""}\0${e}`)})});import{readFile as Du}from"node:fs/promises";import en from"node:path";var zu=Object.freeze(["main","temporary"]),Bs=Object.
|
|
1017
|
-
freeze(["managedDatabaseRefresh","managedEnvironment","managedGit","managedPreview"]),Lu=64*1024,
|
|
1017
|
+
freeze(["managedDatabaseRefresh","managedEnvironment","managedGit","managedPreview"]),Lu=64*1024,t_=Object.freeze(["When\
|
|
1018
1018
|
user input is necessary, ask no more than three concise, high-impact questions at once.","Put multiple questions on sep\
|
|
1019
1019
|
arate lines as `[1] Question`, `[2] Question`, and so on.","For a small fixed set of useful choices, put `Possible answe\
|
|
1020
1020
|
rs:` and a short bullet list directly beneath its own question, before the next one; never collect several questions' an\
|
|
@@ -1028,7 +1028,7 @@ Possible answers:
|
|
|
1028
1028
|
[2] Tell the main agent before changes?
|
|
1029
1029
|
Possible answers:
|
|
1030
1030
|
- Yes, tell main first
|
|
1031
|
-
- No, proceed independently`]),
|
|
1031
|
+
- No, proceed independently`]),r_=Object.freeze(["The Vibe64-managed preview is the canonical application server; never \
|
|
1032
1032
|
start a duplicate or replacement server. If it is unavailable, report that blocker. Describe only rendered browser evide\
|
|
1033
1033
|
nce.","When adopting an authenticated app, or when its login blocks Preview inspection, inspect identity support/names w\
|
|
1034
1034
|
ith `vibe64-helper preview status`; prefer `vibe64-helper preview browser identity <configured-name>` to requesting pass\
|
|
@@ -1082,7 +1082,7 @@ tatus` is ready on the restored target. To stop, run `vibe64-helper playwright c
|
|
|
1082
1082
|
ot prove tests stopped. Recheck status before reporting a busy blocker.","If a managed command reports kernel task denia\
|
|
1083
1083
|
ls or a resource incident, report the blocker with its diagnostic and incident ID and ask the platform operator to inspe\
|
|
1084
1084
|
ct that evidence before retrying; never raise test timeouts or weaken assertions to work around a process/thread limit. \
|
|
1085
|
-
A generic browser timeout without resource evidence does not establish a platform cause."]),
|
|
1085
|
+
A generic browser timeout without resource evidence does not establish a platform cause."]),n_=Object.freeze(["Each mana\
|
|
1086
1086
|
ged shell command receives current development Env from Vibe64, including declared resource bindings; use them in ordina\
|
|
1087
1087
|
ry commands. Do not build environment injection or copy managed credentials into source. Resource provisioning and appli\
|
|
1088
1088
|
cation migrations remain separate preparation steps.","Use `vibe64-helper env status [development|production|all]` to in\
|