vibe64 0.1.65 → 0.1.66
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 +823 -820
- package/bin/server.js +200 -197
- package/bin/upgrade-state.js +4181 -4054
- package/dist/assets/{GithubBrowserTabs-D21Nl3QI.js → GithubBrowserTabs-Bf5z_PiF.js} +1 -1
- package/dist/assets/{LocalDatabaseServer-POxY1K1U.js → LocalDatabaseServer-CcfGbn7H.js} +1 -1
- package/dist/assets/{SelectField-Dezd0B3y.js → SelectField-Df50ZFLj.js} +1 -1
- package/dist/assets/{ShellOutlet-DfF9vsWA.js → ShellOutlet-DPyl05um.js} +1 -1
- package/dist/assets/{Vibe64AuthSettingsButton-I3ufyScN.js → Vibe64AuthSettingsButton-CxJoeOhz.js} +1 -1
- package/dist/assets/{Vibe64ConversationLog-C04oOQ2g.js → Vibe64ConversationLog-jDb_ZvIF.js} +1 -1
- package/dist/assets/{Vibe64DashboardShell-BbrOUmRD.js → Vibe64DashboardShell-Ce1PNB37.js} +1 -1
- package/dist/assets/{Vibe64DatabaseWorkspace-VPEM2o1v.js → Vibe64DatabaseWorkspace-DiZDKEpx.js} +1 -1
- package/dist/assets/{Vibe64FileArea-C_nC2bPk.js → Vibe64FileArea-uRnIJ0Vp.js} +1 -1
- package/dist/assets/{Vibe64OutputControls-DTO3Fw3x.js → Vibe64OutputControls-BF5kh2_h.js} +1 -1
- package/dist/assets/{Vibe64RepositoryWorkspace-B8xcCOvL.js → Vibe64RepositoryWorkspace-D6uJCype.js} +1 -1
- package/dist/assets/{Vibe64SessionFiles-Cb9Mxsyq.js → Vibe64SessionFiles-CxgPB8RR.js} +1 -1
- package/dist/assets/{Vibe64SessionSourceEditor-CVQ3NRjh.js → Vibe64SessionSourceEditor-yaVu279S.js} +1 -1
- package/dist/assets/{Vibe64UiStoryboardView-BV4JFgcZ.js → Vibe64UiStoryboardView-DhbHkz8K.js} +1 -1
- package/dist/assets/{Vibe64UnavailableSessions-DGQAxYE-.js → Vibe64UnavailableSessions-MmPF-Db1.js} +1 -1
- package/dist/assets/{_pageId_-CkG15vv4.js → _pageId_-Zif-veil.js} +1 -1
- package/dist/assets/{_sessionId_-Bka3RUmK.js → _sessionId_-DOge-7SB.js} +1 -1
- package/dist/assets/_slug_-C71iAiR0.js +14 -0
- package/dist/assets/_slug_-CF1TPDUv.css +1 -0
- package/dist/assets/{access-Xo3unxGO.js → access-DQcblrWN.js} +1 -1
- package/dist/assets/{app-B0spNegd.js → app-CzApKPmq.js} +1 -1
- package/dist/assets/assistantRouting-CqIiQy21.js +3 -0
- package/dist/assets/{changes-DFv4tuoO.js → changes-cmlEyHug.js} +1 -1
- package/dist/assets/{client-CVuXqm4b.js → client-13v_yX07.js} +1 -1
- package/dist/assets/{client-BjMjS6lX.js → client-5JUUGxRd.js} +2 -2
- package/dist/assets/{client-4uCr4dYG.js → client-BJBzomgt.js} +1 -1
- package/dist/assets/{client-DR0w56e8.js → client-C8ZjqGdQ.js} +2 -2
- package/dist/assets/{client-Dlg1kjjO.js → client-Dl6I6IVb.js} +1 -1
- package/dist/assets/{client-CevjVK2b.js → client-Dv4scw6i.js} +1 -1
- package/dist/assets/{conversation-OkWbkHjm.js → conversation-CFJRkeTj.js} +3 -3
- package/dist/assets/{conversation-DReMq0MF.css → conversation-COcuIkcD.css} +1 -1
- package/dist/assets/conversation-CexAK3Qk.js +1 -0
- package/dist/assets/{dashboard-CAca9MQn.js → dashboard-Dm_xwwqU.js} +1 -1
- package/dist/assets/{english-definitions-BtX8KA5g.js → english-definitions-DwTf_alg.js} +1 -1
- package/dist/assets/{env-DrNyBVkB.js → env-B7wB5nBn.js} +1 -1
- package/dist/assets/{error-BQ7r64JO.js → error-CtOws2EC.js} +1 -1
- package/dist/assets/{error-BqMxhgpB.js → error-HfzrYwkQ.js} +1 -1
- package/dist/assets/{errorMessageHelpers-B49LyMJi.js → errorMessageHelpers-G32Hjqfm.js} +1 -1
- package/dist/assets/{health-B5yTW5Tt.js → health-DIkOkzPe.js} +1 -1
- package/dist/assets/{history-S3anp6xg.js → history-Ch597NiY.js} +1 -1
- package/dist/assets/{httpClient-Bwitq9Xf.js → httpClient-C71X5grL.js} +1 -1
- package/dist/assets/{i18n-BuXRXGaO.js → i18n-5EHeMSvt.js} +1 -1
- package/dist/assets/{i18n-DQPYjuW7.js → i18n-BSfPKqM3.js} +1 -1
- package/dist/assets/{i18n-Dm74yE_M.js → i18n-DcNQE3tT.js} +1 -1
- package/dist/assets/index-C-6c5Af1.css +1 -0
- package/dist/assets/{index-JBqyg0mr.js → index-DcKFCaBZ.js} +4 -4
- package/dist/assets/{integrations-C7dj7el_.js → integrations-CoNhnGvq.js} +1 -1
- package/dist/assets/{issues-OkV4v4GX.js → issues-Cem4Yt47.js} +1 -1
- package/dist/assets/{learning-lW9nBGjT.js → learning-CU2QyHrj.js} +1 -1
- package/dist/assets/{pages-shOT9IVe.js → pages-BzA58NoR.js} +1 -1
- package/dist/assets/{project-files-D_K1N0JF.js → project-files-BBKjl3wZ.js} +1 -1
- package/dist/assets/{publish-Bxe4ZCqe.js → publish-UFjblZA3.js} +1 -1
- package/dist/assets/{pull-requests-CQvk0TeH.js → pull-requests-DibGk1GB.js} +1 -1
- package/dist/assets/{repository-CI2CqDwF.js → repository-0EKOcyTL.js} +1 -1
- package/dist/assets/{settings-DIVrFrs4.js → settings-BjOnPYwD.js} +1 -1
- package/dist/assets/{studioGateApi-UqmdV50W.js → studioGateApi-B9EUTtMx.js} +1 -1
- package/dist/assets/{studioUrls-k_pQIuPs.js → studioUrls-BR4ZL-TN.js} +1 -1
- package/dist/assets/{useArchivedVibe64Sessions-BkWrTOzg.js → useArchivedVibe64Sessions-CXKRFR2f.js} +1 -1
- package/dist/assets/useAssistantAttachments-C9kAnWqw.js +2 -0
- package/dist/assets/useCommand-yOr3U8KF.js +1 -0
- package/dist/assets/{useEndpointResource-DZTjr9gg.js → useEndpointResource-BwGXpV2u.js} +1 -1
- package/dist/assets/{useUiFeedback-BU4NyMq8.js → useUiFeedback--0dLsslR.js} +1 -1
- package/dist/assets/{useVibe64ConversationLog-BADhWyNY.js → useVibe64ConversationLog-BB5tVtkt.js} +2 -2
- package/dist/assets/{useVibe64Learning-CbsI-XHB.js → useVibe64Learning-iAAH83uG.js} +1 -1
- package/dist/assets/{useVibe64SessionData-DvFvAJC-.js → useVibe64SessionData-BSYF_TgH.js} +1 -1
- package/dist/assets/{useVibe64SessionSelection-BukDTAxb.js → useVibe64SessionSelection-CxZ3uEAf.js} +1 -1
- package/dist/assets/{vibe64FileUpload-BDkcaUyk.js → vibe64FileUpload-D_rOa1R8.js} +1 -1
- package/dist/assets/{vibe64RepositoryRealtime-DX2DEqIz.js → vibe64RepositoryRealtime-CVGNqwxz.js} +1 -1
- package/dist/assets/{vibe64SessionFocus-CzuP3qPT.js → vibe64SessionFocus-DGSVXipO.js} +1 -1
- package/dist/index.html +23 -23
- package/docs/colleague-usage/ai-tasks.md +2 -1
- package/docs/colleague-usage/auto-workflow.md +6 -3
- package/docs/colleague-usage/coding-agent-goal-pause.md +34 -12
- package/docs/colleague-usage/coding-agent-goals.md +33 -16
- package/docs/colleague-usage/coding-agent-questions.md +7 -0
- package/docs/colleague-usage/connected-repositories.md +4 -1
- package/docs/colleague-usage/github-work.md +36 -3
- package/docs/colleague-usage/passes.md +86 -0
- package/docs/colleague-usage/ui-pass.md +4 -0
- package/docs/colleague-usage/workspace-preparation.md +51 -0
- package/node_modules/@jskit-ai/assistant-core/CHANGELOG.md +8 -0
- package/node_modules/@jskit-ai/assistant-core/locales/en.json +2 -0
- package/node_modules/@jskit-ai/assistant-core/package.json +1 -1
- package/node_modules/@jskit-ai/assistant-runtime/CHANGELOG.md +2 -0
- 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/@jskit-ai/connector-google-calendar/package.json +1 -1
- package/node_modules/@jskit-ai/connectors-catalog/package.json +1 -1
- package/node_modules/@jskit-ai/connectors-core/package.json +1 -1
- package/node_modules/@jskit-ai/http-runtime/CHANGELOG.md +1 -0
- package/node_modules/@jskit-ai/http-runtime/package.json +1 -1
- package/node_modules/@jskit-ai/kernel/CHANGELOG.md +5 -0
- package/node_modules/@jskit-ai/kernel/package.json +1 -1
- package/node_modules/@jskit-ai/payments-core/package.json +1 -1
- package/node_modules/@jskit-ai/realtime/package.json +1 -1
- package/node_modules/@jskit-ai/resource-core/package.json +1 -1
- package/node_modules/@jskit-ai/uploads-runtime/package.json +1 -1
- package/node_modules/@local/vibe64-genesis/bin/vibe64-genesis-host-context +914 -773
- package/node_modules/@local/vibe64-genesis/src/server/agentSpecs.js +69 -63
- package/node_modules/@local/vibe64-genesis/src/server/index.js +450 -440
- package/node_modules/@local/vibe64-genesis/src/server/packaging.js +27 -28
- package/node_modules/@local/vibe64-genesis/src/server/promptContext.js +63 -55
- package/node_modules/@local/vibe64-runtime/src/server/codexAppServerProcess.js +1044 -901
- package/node_modules/@local/vibe64-terminals/src/server/opencodeSessionEnvironmentPlugin.js +560 -420
- package/node_modules/@local/vibe64-terminals/src/server/sessionWorkOperationCommand.js +453 -450
- package/package.json +15 -15
- package/server.bundle.mjs +42018 -41710
- package/dist/assets/_slug_-7Oo7pGKn.js +0 -14
- package/dist/assets/_slug_-BaxjtsgP.css +0 -1
- package/dist/assets/assistantRouting-B9cub38g.js +0 -3
- package/dist/assets/conversation-D7T_us2O.js +0 -1
- package/dist/assets/index-DSyb-mRJ.css +0 -1
- package/dist/assets/useAssistantAttachments-DqlNFiha.js +0 -2
- package/dist/assets/useCommand-D-MIMmhp.js +0 -1
package/bin/server.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __vibe64CreateRequire } from 'node:module';const require=__vibe64CreateRequire(import.meta.url);
|
|
3
|
-
import{existsSync as
|
|
4
|
-
import Sn,{constants as vn}from"node:fs/promises";import zo from"node:path";import{promisify as Vo}from"node:util";import Ho from"node:child_process";import
|
|
5
|
-
return Dt.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function Be(){return
|
|
6
|
-
(
|
|
7
|
-
Be()),
|
|
8
|
-
"/proc/version","utf8").toLowerCase().includes("microsoft"))return!C()}catch{}return
|
|
9
|
-
misc/WSLInterop")||
|
|
10
|
-
.0\\powershell.exe`;var x=async(e,t={})=>{let{powerShellPath:o,...r}=t,n=x.encodeCommand(e);return Go(o??
|
|
3
|
+
import{existsSync as Ca}from"node:fs";import{mkdir as xa}from"node:fs/promises";import Co from"node:os";import ae from"node:path";import sr from"node:process";import et from"node:path";import{fileURLToPath as bn}from"node:url";import En from"node:child_process";
|
|
4
|
+
import Sn,{constants as vn}from"node:fs/promises";import zo from"node:path";import{promisify as Vo}from"node:util";import Ho from"node:child_process";import Ve,{constants as Vt}from"node:fs/promises";import Bt from"node:process";import Do from"node:os";import Ge from"node:fs";import Mo from"node:fs";import Dt from"node:fs";var Ue;function ko(){try{return Dt.statSync("/.dockerenv"),!0}catch{return!1}}function $o(){try{
|
|
5
|
+
return Dt.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function Be(){return Ue===void 0&&
|
|
6
|
+
(Ue=ko()||$o()),Ue}var Fe,Lo=()=>{try{return Mo.statSync("/run/.containerenv"),!0}catch{return!1}};function C(){return Fe===void 0&&(Fe=Lo()||
|
|
7
|
+
Be()),Fe}var Ut=()=>{if(Bt.platform!=="linux")return!1;if(Do.release().toLowerCase().includes("microsoft"))return!C();try{if(Ge.readFileSync(
|
|
8
|
+
"/proc/version","utf8").toLowerCase().includes("microsoft"))return!C()}catch{}return Ge.existsSync("/proc/sys/fs/binfmt_\
|
|
9
|
+
misc/WSLInterop")||Ge.existsSync("/run/WSL")?!C():!1},S=Bt.env.__IS_WSL_TEST__?Ut:Ut();import Ft from"node:process";import{Buffer as Uo}from"node:buffer";import{promisify as Bo}from"node:util";import Fo from"node:child_process";var Go=Bo(Fo.execFile),ze=()=>`${Ft.env.SYSTEMROOT||Ft.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1\
|
|
10
|
+
.0\\powershell.exe`;var x=async(e,t={})=>{let{powerShellPath:o,...r}=t,n=x.encodeCommand(e);return Go(o??ze(),[...x.argumentsPrefix,n],{encoding:"\
|
|
11
11
|
utf8",...r})};x.argumentsPrefix=["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"];x.encodeCommand=
|
|
12
|
-
e=>
|
|
12
|
+
e=>Uo.from(e,"utf16le").toString("base64");x.escapeArgument=e=>`'${String(e).replaceAll("'","''")}'`;function Gt(e){for(let t of e.split(`
|
|
13
13
|
`)){if(/^\s*#/.test(t))continue;let o=/^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec(t);if(o)return o.groups.
|
|
14
|
-
mountPoint.trim().replaceAll(/^["']|["']$/g,"")}}var Wo=Vo(Ho.execFile),qo=(()=>{let e="/mnt/",t;return async function(){if(t)return t;let o="/etc/wsl.conf",r=!1;try{await
|
|
15
|
-
access(o,Vt.F_OK),r=!0}catch{}if(!r)return e;let n=await
|
|
14
|
+
mountPoint.trim().replaceAll(/^["']|["']$/g,"")}}var Wo=Vo(Ho.execFile),qo=(()=>{let e="/mnt/",t;return async function(){if(t)return t;let o="/etc/wsl.conf",r=!1;try{await Ve.
|
|
15
|
+
access(o,Vt.F_OK),r=!0}catch{}if(!r)return e;let n=await Ve.readFile(o,{encoding:"utf8"}),i=Gt(n);return i===void 0?e:(t=
|
|
16
16
|
i,t=t.endsWith("/")?t:`${t}/`,t)}})(),Yo=async()=>`${await qo()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`,
|
|
17
|
-
ue=S?Yo:
|
|
17
|
+
ue=S?Yo:ze,zt,Ht=async()=>(zt??=(async()=>{try{let e=await ue();return await Ve.access(e,Vt.X_OK),!0}catch{return!1}})(),
|
|
18
18
|
zt),Wt=async()=>{let e=await ue(),t=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,
|
|
19
19
|
{stdout:o}=await x(t,{powerShellPath:e,cwd:zo.dirname(e)});return o.trim()},Jo=e=>/^[a-z]+:\/\//i.test(e),qt=async e=>{let t=Array.
|
|
20
20
|
isArray(e),o=t?e:[e],r=[],n=[];for(let[s,a]of o.entries())Jo(a)||(r.push(s),n.push(a));let i=[...o];if(n.length>0)try{let{
|
|
@@ -24,12 +24,12 @@ i[u]=a[c]??o[u]}catch{}return t?i:i[0]};import Yt from"node:process";import{Buff
|
|
|
24
24
|
"base64"),tn=e=>`'${String(e).replaceAll(/['‘’‚‛]/g,t=>t+t)}'`,Xt=e=>[...Jt,Kt(e)],rn=e=>({encoding:"utf8",...e,
|
|
25
25
|
shell:!1}),v=async(e,t={})=>{let{powerShellPath:o,...r}=t;return Qo(o??en(),Xt(e),rn(r))};v.argumentsPrefix=Jt;v.encodeCommand=
|
|
26
26
|
Kt;v.escapeArgument=tn;v.createArguments=Xt;function N(e,t,o){let r=n=>Object.defineProperty(e,t,{value:n,enumerable:!0,writable:!0});return Object.defineProperty(e,
|
|
27
|
-
t,{configurable:!0,enumerable:!0,get(){let n=o();return r(n),n},set(n){r(n)}}),e}import{promisify as hn}from"node:util";import
|
|
28
|
-
sn);async function
|
|
27
|
+
t,{configurable:!0,enumerable:!0,get(){let n=o();return r(n),n},set(n){r(n)}}),e}import{promisify as hn}from"node:util";import Ke from"node:process";import{execFile as gn}from"node:child_process";import{promisify as on}from"node:util";import nn from"node:process";import{execFile as sn}from"node:child_process";var an=on(
|
|
28
|
+
sn);async function He(){if(nn.platform!=="darwin")throw new Error("macOS only");let{stdout:e}=await an("defaults",["read",
|
|
29
29
|
"com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]),o=/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.
|
|
30
|
-
exec(e)?.groups.id??"com.apple.Safari";return o==="com.apple.safari"?"com.apple.Safari":o}import cn from"node:process";import{promisify as un}from"node:util";import{execFile as ln,execFileSync as
|
|
30
|
+
exec(e)?.groups.id??"com.apple.Safari";return o==="com.apple.safari"?"com.apple.Safari":o}import cn from"node:process";import{promisify as un}from"node:util";import{execFile as ln,execFileSync as Nc}from"node:child_process";
|
|
31
31
|
var dn=un(ln);async function Zt(e,{humanReadableOutput:t=!0,signal:o}={}){if(cn.platform!=="darwin")throw new Error("mac\
|
|
32
|
-
OS only");let r=t?[]:["-ss"],n={};o&&(n.signal=o);let{stdout:i}=await dn("osascript",["-e",e,r],n);return i.trim()}async function
|
|
32
|
+
OS only");let r=t?[]:["-ss"],n={};o&&(n.signal=o);let{stdout:i}=await dn("osascript",["-e",e,r],n);return i.trim()}async function We(e){return Zt(`tell application "Finder" to set app_path to application file id "${e}" as string
|
|
33
33
|
tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":C\
|
|
34
34
|
ontents:Info.plist")`)}import Qt from"node:process";import{promisify as pn}from"node:util";import{execFile as mn}from"node:child_process";var fn=pn(
|
|
35
35
|
mn),le={MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},MSEdgeBHTML:{name:"Edge Beta",id:"com.microsoft.edge.beta"},MSEdgeDHTML:{
|
|
@@ -39,16 +39,16 @@ name:"Chrome Dev",id:"com.google.chrome.dev"},ChromiumHTM:{name:"Chromium",id:"o
|
|
|
39
39
|
Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveDHTML:{name:"Brave Dev",id:"\
|
|
40
40
|
com.brave.Browser.dev"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"},FirefoxURL:{name:"Firefox",id:"\
|
|
41
41
|
org.mozilla.firefox"},OperaStable:{name:"Opera",id:"com.operasoftware.Opera"},VivaldiHTM:{name:"Vivaldi",id:"com.vivaldi\
|
|
42
|
-
.Vivaldi"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"}},
|
|
43
|
-
async function
|
|
42
|
+
.Vivaldi"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"}},Ye=new Map(Object.entries(le)),qe=class extends Error{};
|
|
43
|
+
async function Je(e=fn){let t=`${Qt.env.SYSTEMROOT??Qt.env.windir??"C:\\Windows"}\\System32\\reg.exe`,{stdout:o}=await e(
|
|
44
44
|
t,["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/\
|
|
45
|
-
v","ProgId"]),r=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(o);if(!r)throw new
|
|
45
|
+
v","ProgId"]),r=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(o);if(!r)throw new qe(`Cannot find Windows browser in stdout: ${JSON.
|
|
46
46
|
stringify(o)}`);let{id:n}=r.groups,i=n.lastIndexOf("."),s=n.lastIndexOf("-"),a=i===-1?void 0:n.slice(0,i),c=s===-1?void 0:
|
|
47
|
-
n.slice(0,s);return le[n]??le[a]??le[c]??{name:n,id:n}}var wn=hn(gn),
|
|
48
|
-
"darwin"){let e=await
|
|
49
|
-
uery","default","x-scheme-handler/http"]),t=e.trim();return{name:
|
|
50
|
-
platform==="win32")return
|
|
51
|
-
tr)):"",rr=
|
|
47
|
+
n.slice(0,s);return le[n]??le[a]??le[c]??{name:n,id:n}}var wn=hn(gn),_n=e=>e.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,t=>t.toUpperCase());async function Xe(){if(Ke.platform===
|
|
48
|
+
"darwin"){let e=await He();return{name:await We(e),id:e}}if(Ke.platform==="linux"){let{stdout:e}=await wn("xdg-mime",["q\
|
|
49
|
+
uery","default","x-scheme-handler/http"]),t=e.trim();return{name:_n(t.replace(/.desktop$/,"").replace("-"," ")),id:t}}if(Ke.
|
|
50
|
+
platform==="win32")return Je();throw new Error("Only macOS, Linux, and Windows are supported")}import Ze from"node:process";var yn=!!(Ze.env.SSH_CONNECTION||Ze.env.SSH_CLIENT||Ze.env.SSH_TTY),er=yn;var tr=new URL("./../node_modules/open/index.js",import.meta.url).href,de=Symbol("fallbackAttempt"),Qe=tr?et.dirname(bn(
|
|
51
|
+
tr)):"",rr=et.join(Qe,"xdg-open"),{platform:j,arch:or}=sr,nr=async(e,t)=>{if(e.length===0)return;let o=[];for(let r of e)
|
|
52
52
|
try{return await t(r)}catch(n){o.push(n)}throw new AggregateError(o,"Failed to open in all supported apps")},pe=async e=>{
|
|
53
53
|
e={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...e};let t=e[de]===!0;if(delete e[de],Array.isArray(e.app))
|
|
54
54
|
return nr(e.app,u=>pe({...e,app:u,[de]:!0}));let{name:o,arguments:r=[]}=e.app??{};if(r=[...r],Array.isArray(o))return nr(
|
|
@@ -56,7 +56,7 @@ o,u=>pe({...e,app:{name:u,arguments:r},[de]:!0}));if(o==="browser"||o==="browser
|
|
|
56
56
|
rome","google-chrome.desktop":"chrome","com.brave.browser":"brave","org.mozilla.firefox":"firefox","firefox.desktop":"fi\
|
|
57
57
|
refox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","com.microsoft.edgemac":"edge","microsoft-edge.desktop":"\
|
|
58
58
|
edge","com.apple.safari":"safari"},l={chrome:"--incognito",brave:"--incognito",firefox:"--private-window",edge:"--inPriv\
|
|
59
|
-
ate"},d;if(S){let f=await Wt();d=
|
|
59
|
+
ate"},d;if(S){let f=await Wt();d=Ye.get(f)??{}}else d=await Xe();let m=d.id?.toLowerCase();if(Object.hasOwn(u,m)){let f=u[m];
|
|
60
60
|
if(o==="browserPrivate"){if(f==="safari")throw new Error("Safari doesn't support opening in private mode via command lin\
|
|
61
61
|
e");r.push(l[f])}return pe({...e,app:{name:P[f],arguments:r}})}throw new Error(`${d.name} is not supported as a default \
|
|
62
62
|
browser`)}let n,i=[],s={},a=!1;if(S&&!C()&&!er&&!o&&(a=await Ht()),j==="darwin")n="open",e.wait&&i.push("--wait-apps"),e.
|
|
@@ -64,8 +64,8 @@ background&&i.push("--background"),e.newInstance&&i.push("--new"),o&&i.push("-a"
|
|
|
64
64
|
i.push(...v.argumentsPrefix),S||(s.windowsVerbatimArguments=!0),S&&e.target&&(e.target=await qt(e.target));let u=["$Prog\
|
|
65
65
|
ressPreference = 'SilentlyContinue';","Start"];e.wait&&u.push("-Wait"),o?(u.push(v.escapeArgument(o)),e.target&&r.push(e.
|
|
66
66
|
target)):e.target&&u.push(v.escapeArgument(e.target)),r.length>0&&(r=r.map(l=>v.escapeArgument(l)),u.push("-ArgumentList",
|
|
67
|
-
r.join(","))),e.target=v.encodeCommand(u.join(" ")),e.wait||(s.stdio="ignore"),S&&(s.cwd=
|
|
68
|
-
let u=!
|
|
67
|
+
r.join(","))),e.target=v.encodeCommand(u.join(" ")),e.wait||(s.stdio="ignore"),S&&(s.cwd=et.dirname(n))}else{if(o)n=o;else{
|
|
68
|
+
let u=!Qe||Qe==="/",l=!1;try{await Sn.access(rr,vn.X_OK),l=!0}catch{}n=sr.versions.electron??(j==="android"||u||!l)?"xdg\
|
|
69
69
|
-open":rr}r.length>0&&i.push(...r),e.wait||(s.stdio="ignore",s.detached=!0)}j==="darwin"&&r.length>0&&i.push("--args",...r),
|
|
70
70
|
e.target&&i.push(e.target);let c=En.spawn(n,i,s);return e.wait?new Promise((u,l)=>{c.once("error",l),c.once("close",d=>{
|
|
71
71
|
if(!e.allowNonzeroExitCode&&d!==0){l(new Error(`Exited with code ${d}`));return}u(c)})}):t||j==="win32"||a?new Promise((u,l)=>{
|
|
@@ -82,50 +82,50 @@ ram Files/BraveSoftware/Brave-Browser/Application/brave.exe","/mnt/c/Program Fil
|
|
|
82
82
|
lication/brave.exe"]}}));N(P,"firefox",()=>W({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,
|
|
83
83
|
linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));N(P,"edge",()=>W({darwin:"microsoft edge",win32:"\
|
|
84
84
|
msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedg\
|
|
85
|
-
e.exe"}));N(P,"safari",()=>W({darwin:"Safari"}));var
|
|
86
|
-
Pn(t)}function Pn(e){return e!==null&&typeof e=="object"&&Object.getPrototypeOf(e)===null&&Reflect.ownKeys(e).length===0}function
|
|
85
|
+
e.exe"}));N(P,"safari",()=>W({darwin:"Safari"}));var tt=Tn;import _ from"node:process";import{fileURLToPath as Na}from"node:url";var cu=Object.freeze(["none","pending","committed","rolledBack","unknown"]);function T(e,{fallback:t=""}={}){return String(e||"").trim()||t}function L(e){return String(e??"").trim()}function y(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function g(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||
|
|
86
|
+
Pn(t)}function Pn(e){return e!==null&&typeof e=="object"&&Object.getPrototypeOf(e)===null&&Reflect.ownKeys(e).length===0}function rt(e){return e!==null&&typeof e=="object"&&g(e.structure)&&g(e.operations)&&typeof e.validateWith=="function"&&
|
|
87
87
|
typeof e.toJsonSchema=="function"&&typeof e.cleanup=="function"}function me(e,t){if(!Object.hasOwn(t,"items"))return null;
|
|
88
|
-
let{items:o}=t;if(
|
|
88
|
+
let{items:o}=t;if(rt(o))return{kind:"schema",schema:o};if(!g(o)||typeof o.type!="string")throw new Error(`Array field "${e}\
|
|
89
89
|
" must define items as either a Schema instance or a field definition object.`);return{kind:"definition",definition:o}}function q(e,t){
|
|
90
|
-
if(!Object.hasOwn(t,"values"))return null;let{values:o}=t;if(
|
|
90
|
+
if(!Object.hasOwn(t,"values"))return null;let{values:o}=t;if(rt(o))return{kind:"schema",schema:o};if(!g(o)||typeof o.type!=
|
|
91
91
|
"string")throw new Error(`Object field "${e}" must define values as either a Schema instance or a field definition objec\
|
|
92
92
|
t.`);return{kind:"definition",definition:o}}function fe(e,t){let o=Object.hasOwn(t,"schema"),r=Object.hasOwn(t,"values"),
|
|
93
93
|
n=Object.hasOwn(t,"additionalProperties");if(o&&r)throw new Error(`Object field "${e}" cannot define both schema and val\
|
|
94
94
|
ues.`);if(n&&t.additionalProperties!==!0)throw new Error(`Object field "${e}" only supports additionalProperties: true.`);
|
|
95
95
|
if(r&&t.additionalProperties===!0)throw new Error(`Object field "${e}" cannot define both values and additionalPropertie\
|
|
96
|
-
s: true.`);if(o){if(!
|
|
96
|
+
s: true.`);if(o){if(!rt(t.schema))throw new Error(`Object field "${e}" must define schema as a Schema instance.`);return{
|
|
97
97
|
kind:"nested",schema:t.schema,allowAdditionalProperties:t.additionalProperties===!0}}return r?{kind:"map",valuesConfig:q(
|
|
98
|
-
e,t)}:t.additionalProperties===!0?{kind:"opaque"}:{kind:"plain"}}function D(e){return e?.type==="number"||e?.type==="integer"||e?.type==="epochMilliseconds"||e?.type==="epochSeconds"}function
|
|
98
|
+
e,t)}:t.additionalProperties===!0?{kind:"opaque"}:{kind:"plain"}}function D(e){return e?.type==="number"||e?.type==="integer"||e?.type==="epochMilliseconds"||e?.type==="epochSeconds"}function ot(e,t=""){
|
|
99
99
|
if(g(e))for(let[o,r]of Object.entries(e)){if(!g(r))continue;let n=t?`${t}.${o}`:o;for(let i of["minItems","maxItems"]){if(!Object.
|
|
100
100
|
hasOwn(r,i))continue;let s=r[i];if(r.type!=="array"||!Number.isInteger(s)||s<0)throw new Error(`Field "${n}" ${i} must b\
|
|
101
101
|
e a non-negative integer on an array field.`)}if(r.minItems>r.maxItems)throw new Error(`Field "${n}" minItems (${r.minItems}\
|
|
102
|
-
) is above its maxItems (${r.maxItems}).`);r.type==="array"&&g(r.items)&&typeof r.items.type=="string"&&
|
|
103
|
-
n)}}var
|
|
104
|
-
(?:${lr}):${
|
|
105
|
-
`^${pr}$`),An=new RegExp(`^${he}(?::${
|
|
106
|
-
|
|
102
|
+
) is above its maxItems (${r.maxItems}).`);r.type==="array"&&g(r.items)&&typeof r.items.type=="string"&&ot({"[]":r.items},
|
|
103
|
+
n)}}var nt="^(?:0|-?[1-9]\\d*)$",ar="\\d{4}",cr="0[1-9]|1[0-2]",ur="0[1-9]|[12]\\d|3[01]",lr="[01]\\d|2[0-3]",U="[0-5]\\d",he=`\
|
|
104
|
+
(?:${lr}):${U}`,dr=`(?:Z|[+-](?:${lr}):${U})`,pr=`(${ar})-(${cr})-(${ur})`,mr=`${ar}-(?:${cr})-(?:${ur})`,fr=`^${mr}$`,Rn=new RegExp(
|
|
105
|
+
`^${pr}$`),An=new RegExp(`^${he}(?::${U}(?:\\.(\\d+))?)?$`),In=new RegExp(`^${pr}T${he}:${U}(?:\\.(\\d+))?${dr}$`),Cn=new RegExp(
|
|
106
|
+
nt),xn=[31,28,31,30,31,30,31,31,30,31,30,31];function Nn(e){return e%4===0&&(e%100!==0||e%400===0)}function jn(e,t){return t===
|
|
107
107
|
2?Nn(e)?29:28:xn[t-1]}function hr(e,t,o){let r=Number(e),n=Number(t),i=Number(o);return n>=1&&n<=12&&i>=1&&i<=jn(r,n)}function Y(e,t){
|
|
108
108
|
let o=e.temporalPrecision;if(o!==void 0){if(!Number.isInteger(o)||o<0)throw new Error(`temporalPrecision for "${t}" must\
|
|
109
109
|
be a non-negative integer.`);return o}}function gr(e,t){return e===void 0?!0:t===void 0||e.length<=t}function wr(e){if(typeof e!=
|
|
110
|
-
"string")return!1;let t=Rn.exec(e);return t!==null&&hr(t[1],t[2],t[3])}function
|
|
111
|
-
exec(e);return o!==null&&gr(o[1],t)}function
|
|
110
|
+
"string")return!1;let t=Rn.exec(e);return t!==null&&hr(t[1],t[2],t[3])}function _r(e,t){if(typeof e!="string")return!1;let o=An.
|
|
111
|
+
exec(e);return o!==null&&gr(o[1],t)}function yr(e,t){if(typeof e!="string")return!1;let o=In.exec(e);return o===null?!1:
|
|
112
112
|
hr(o[1],o[2],o[3])&&gr(o[4],t)}function br(e){return e===void 0?"(?:\\.\\d+)?":e===0?"":`(?:\\.\\d{1,${e}})?`}function Er(e,t){
|
|
113
|
-
let o=Y(e,t);return`^${he}(?::${
|
|
113
|
+
let o=Y(e,t);return`^${he}(?::${U}${br(o)})?$`}function Sr(e,t){let o=Y(e,t);return`^${mr}T${he}:${U}${br(o)}${dr}$`}function it(e,t){
|
|
114
114
|
let o;if(typeof e=="number")o=e;else if(typeof e=="string"&&Cn.test(e))o=Number(e);else return null;return!Number.isSafeInteger(
|
|
115
115
|
o)||o<-t||o>t?null:o===0?0:o}var kn=new Set(["__proto__","prototype","constructor"]);function p(e,t,o){Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0})}function $n(e,t){if(kn.
|
|
116
116
|
has(e))throw new Error(`${t}() received unsafe path segment "${e}".`)}function Mn(e){return typeof e!="string"?e:e.replace(
|
|
117
|
-
/\[(.+?)\]/g,".$1").replace(/^\.+/,"").replace(/\.+/g,".").replace(/\.$/,"")}function
|
|
117
|
+
/\[(.+?)\]/g,".$1").replace(/^\.+/,"").replace(/\.+/g,".").replace(/\.$/,"")}function st(e,t,{normalize:o=!1,allowEmpty:r=!1}={}){
|
|
118
118
|
let n=o?Mn(e):e;if(typeof n!="string"||n.trim()===""){if(r&&n==="")return[];throw new Error(`${t}() expects a non-empty \
|
|
119
119
|
dotted path string.`)}let i=n.split(".");if(i.some(s=>s===""))throw new Error(`${t}() received an invalid path "${n}".`);
|
|
120
|
-
for(let s of i)$n(s,t);return i}var Ln="http://json-schema.org/draft-07/schema#",R="x-json-rest-schema",
|
|
121
|
-
|
|
122
|
-
return{anyOf:[{type:"integer",minimum:-e,maximum:e},{type:"string",pattern:
|
|
123
|
-
none:()=>({type:
|
|
120
|
+
for(let s of i)$n(s,t);return i}var Ln="http://json-schema.org/draft-07/schema#",R="x-json-rest-schema",at=["object","array","string","number","boolean"],
|
|
121
|
+
ct=Symbol("json-rest-schema.exportContext"),Dn=["true","1","yes","y","on"],Un=["false","0","no","n","off"];function vr(e){
|
|
122
|
+
return{anyOf:[{type:"integer",minimum:-e,maximum:e},{type:"string",pattern:nt}]}}function k(e,t){return{[R]:{[e]:t}}}var Bn={
|
|
123
|
+
none:()=>({type:at}),blob:()=>({type:at}),serialize:()=>({type:at}),object:()=>({type:"object"}),array:()=>({type:"array"}),
|
|
124
124
|
file:()=>({type:"string"}),string:()=>({type:"string"}),number:()=>({type:["number","string"]}),integer:()=>({type:["int\
|
|
125
125
|
eger","string"]}),epochMilliseconds:()=>vr(864e13),epochSeconds:()=>vr(864e10),dateTime:({definition:e,fieldName:t})=>({
|
|
126
126
|
type:"string",format:"date-time",pattern:Sr(e,t)}),date:()=>({type:"string",format:"date",pattern:fr}),time:({definition:e,
|
|
127
127
|
fieldName:t})=>({type:"string",pattern:Er(e,t)}),boolean:({definition:e})=>{if(e.strictBoolean===!0)return{type:"boolean"};
|
|
128
|
-
let t=new Set([...Dn,String(e.stringTrueWhen||"true").trim().toLowerCase()]),o=new Set([...
|
|
128
|
+
let t=new Set([...Dn,String(e.stringTrueWhen||"true").trim().toLowerCase()]),o=new Set([...Un,String(e.stringFalseWhen||
|
|
129
129
|
"false").trim().toLowerCase()]);return{anyOf:[{type:"boolean"},{type:"number",enum:[0,1]},{type:"string",enum:[...o,...t]}]}},
|
|
130
130
|
id:()=>({type:["integer","string"],minimum:1,pattern:"^[1-9][0-9]*$"})},Fn={minLength:({definition:e,parameterValue:t})=>e.
|
|
131
131
|
type==="string"?{minLength:t}:null,maxLength:({definition:e,parameterValue:t})=>e.type==="string"?{maxLength:t}:null,min:({
|
|
@@ -137,13 +137,13 @@ parameterValue:e})=>e?k("transforms",{uppercase:!0}):null,lowercase:({parameterV
|
|
|
137
137
|
null,length:({parameterValue:e})=>k("transforms",{length:e}),unsigned:({parameterValue:e})=>e?k("metadata",{unsigned:!0}):
|
|
138
138
|
null,precision:({parameterValue:e})=>k("metadata",{precision:e}),scale:({parameterValue:e})=>k("metadata",{scale:e}),temporalPrecision:({
|
|
139
139
|
parameterValue:e})=>k("metadata",{temporalPrecision:e}),strictBoolean:()=>null,required:()=>null,nullable:()=>null,nullOnEmpty:()=>null,
|
|
140
|
-
defaultTo:()=>null};function
|
|
141
|
-
"object"&&!Array.isArray(r)&&!Array.isArray(n)){
|
|
140
|
+
defaultTo:()=>null};function pt(e,t){for(let o of Object.keys(t)){let r=t[o],n=e[o];if(r&&n&&typeof r=="object"&&typeof n==
|
|
141
|
+
"object"&&!Array.isArray(r)&&!Array.isArray(n)){pt(n,r);continue}e[o]=r}}function Gn(e,t){if(!t||typeof t!="object"||Array.
|
|
142
142
|
isArray(t))throw new Error("JSON Schema export hooks must return an object or null.");for(let o of Object.keys(t)){if(o===
|
|
143
|
-
R&&e[o]&&typeof e[o]=="object"&&typeof t[o]=="object"&&!Array.isArray(e[o])&&!Array.isArray(t[o])){
|
|
143
|
+
R&&e[o]&&typeof e[o]=="object"&&typeof t[o]=="object"&&!Array.isArray(e[o])&&!Array.isArray(t[o])){pt(e[o],t[o]);continue}
|
|
144
144
|
e[o]=t[o]}}function zn(e,t){let r=[...Array.isArray(e.anyOf)&&Object.keys(e).length===1?e.anyOf:[e],...t];return r.length===
|
|
145
145
|
1?e:{anyOf:r}}function Vn(e,t){if(!Object.hasOwn(e.types,t.type))throw new Error(`No casting function for type: ${t.type}`);
|
|
146
|
-
let o=e.types[t.type];if(typeof o.toJsonSchema=="function")return o.toJsonSchema;let r=
|
|
146
|
+
let o=e.types[t.type];if(typeof o.toJsonSchema=="function")return o.toJsonSchema;let r=Bn[t.type];if(!r)throw new Error(
|
|
147
147
|
`Type '${t.type}' cannot be exported to JSON Schema without a toJsonSchema hook.`);return r}function Hn(e,t,o){if(!Object.
|
|
148
148
|
hasOwn(e.validators,t))return null;let r=e.validators[t];if(typeof r.toJsonSchema=="function")return r.toJsonSchema;let n=Fn[t];
|
|
149
149
|
if(n)return n;throw new Error(`Validator '${t}' on field '${o}' cannot be exported to JSON Schema without a toJsonSchema\
|
|
@@ -154,57 +154,57 @@ s: mode '${o}' does not match operation '${t.operation}'.`)}if(t.operation!==voi
|
|
|
154
154
|
throw new Error(`Unknown JSON Schema export operation '${t.operation}'.`);return t.operation}return Tr(t.mode)}function qn(e,t={}){
|
|
155
155
|
if(t.operationName!==void 0&&t.operationDescriptor!==void 0)return{operationName:t.operationName,operation:t.operationDescriptor};
|
|
156
156
|
let o=Wn(e,t);return{operationName:o,operation:e.operations[o]}}function Yn(e={}){let t={...e};return Object.defineProperty(
|
|
157
|
-
t,
|
|
158
|
-
e[
|
|
159
|
-
"_").replace(/^_+|_+$/g,"")||"operation"}function
|
|
160
|
-
function ge(e){return
|
|
157
|
+
t,ct,{value:{definitions:{},nodes:[],nextDefinitionId:1,rootNode:null},enumerable:!1}),t}function we(e={}){return e[ct]?
|
|
158
|
+
e[ct]:{definitions:{},nodes:[],nextDefinitionId:1,rootNode:null}}function Jn(e){return String(e).replace(/[^a-zA-Z0-9]+/g,
|
|
159
|
+
"_").replace(/^_+|_+$/g,"")||"operation"}function ut(e){return g(e)&&Object.keys(e).length===1&&typeof e.$ref=="string"}
|
|
160
|
+
function ge(e){return ut(e)?{allOf:[e]}:e}function Kn(e,t,o,r,n){return e.nodes.find(i=>i.schema===t&&i.operationName===
|
|
161
161
|
o&&i.operation===r&&i.additionalProperties===n)||null}function Xn(e,t){let o=Jn(t),r=`SchemaNode_${e.nextDefinitionId}_${o}`;
|
|
162
162
|
return e.nextDefinitionId+=1,r}function Or(e,t,o,r,n,{root:i=!1}={}){let s=we(t),a=Kn(s,e,o,r,n);if(a)return i&&(a.pointer=
|
|
163
163
|
"#",s.rootNode=a),a;let c={schema:e,operationName:o,operation:r,additionalProperties:n,status:"new",definitionName:i?null:
|
|
164
164
|
Xn(s,o),pointer:i?"#":null};return i?s.rootNode=c:c.pointer=`#/definitions/${c.definitionName}`,s.nodes.push(c),c}function Pr(e,t){
|
|
165
165
|
if(e.status==="built")return{$ref:e.pointer};if(e.status==="building")return{$ref:e.pointer};let o=we(t);e.status="build\
|
|
166
166
|
ing",e.pointer!=="#"&&(o.definitions[e.definitionName]={});let r=Zn(e.schema,t,e.operationName,e.operation,e.additionalProperties);
|
|
167
|
-
return e.status="built",e.pointer==="#"?r:(o.definitions[e.definitionName]=r,{$ref:e.pointer})}function
|
|
167
|
+
return e.status="built",e.pointer==="#"?r:(o.definitions[e.definitionName]=r,{$ref:e.pointer})}function mt(e,t,o,r,n=!1){
|
|
168
168
|
let i=we(t),s=Or(e,t,o,r,n);return i.rootNode===s?{$ref:"#"}:Pr(s,t)}function J(e,{referenceBacked:t=!1}={}){return{schema:e,
|
|
169
|
-
referenceBacked:t}}function Zn(e,t,o,r,n=!1){let i={},s=[];for(let[c,u]of Object.entries(e.structure))p(i,c,
|
|
169
|
+
referenceBacked:t}}function Zn(e,t,o,r,n=!1){let i={},s=[];for(let[c,u]of Object.entries(e.structure))p(i,c,ft(e,c,u,t,o,
|
|
170
170
|
r)),r.enforceRequired&&u.required===!0&&s.push(c);let a={type:"object",properties:i,additionalProperties:n};return s.length>
|
|
171
|
-
0&&(a.required=s),a}function Qn(e,t,o,r,n,i){let s=me(t,o);if(!s)return null;if(s.kind==="schema")return{...ge(
|
|
171
|
+
0&&(a.required=s),a}function Qn(e,t,o,r,n,i){let s=me(t,o);if(!s)return null;if(s.kind==="schema")return{...ge(mt(s.schema,
|
|
172
172
|
r,"replace",s.schema.operations.replace,!1)),[R]:{castType:"object"}};let a=o.items.type==="object"&&Object.hasOwn(o.items,
|
|
173
|
-
"schema")?"replace":n,c=a==="replace"?e.operations.replace:i;return
|
|
174
|
-
let s=q(t,o);if(!s)return null;if(s.kind==="schema")return{...ge(
|
|
173
|
+
"schema")?"replace":n,c=a==="replace"?e.operations.replace:i;return ft(e,`${t}[]`,o.items,r,a,c)}function ei(e,t,o,r,n,i){
|
|
174
|
+
let s=q(t,o);if(!s)return null;if(s.kind==="schema")return{...ge(mt(s.schema,r,"replace",s.schema.operations.replace,!1)),
|
|
175
175
|
[R]:{castType:"object"}};let a=s.definition.type==="object"&&Object.hasOwn(s.definition,"schema")?"replace":n,c=a==="rep\
|
|
176
|
-
lace"?e.operations.replace:i;return
|
|
177
|
-
t,o);if(a.kind==="nested")return J(
|
|
176
|
+
lace"?e.operations.replace:i;return ft(e,`${t}.*`,s.definition,r,a,c)}function ti(e,t,o,r,n,i){if(o.type==="object"){let a=fe(
|
|
177
|
+
t,o);if(a.kind==="nested")return J(mt(a.schema,r,n,i,a.allowAdditionalProperties===!0),{referenceBacked:!0});if(a.kind===
|
|
178
178
|
"opaque")return J({type:"object",additionalProperties:!0});if(a.kind==="map")return J({type:"object",additionalProperties:ei(
|
|
179
179
|
e,t,o,r,n,i)})}let s=Vn(e,o)({schema:e,fieldName:t,definition:o,operation:n,mode:n,options:r});if(!s||typeof s!="object"||
|
|
180
180
|
Array.isArray(s))throw new Error(`Type '${o.type}' on field '${t}' returned an invalid JSON Schema fragment.`);if(o.type===
|
|
181
|
-
"array"){let a=Qn(e,t,o,r,n,i);if(a)return J({...s,items:a},{referenceBacked:
|
|
182
|
-
function
|
|
181
|
+
"array"){let a=Qn(e,t,o,r,n,i);if(a)return J({...s,items:a},{referenceBacked:ut(s)})}return J(s,{referenceBacked:ut(s)})}
|
|
182
|
+
function ft(e,t,o,r,n,i){let s={schema:e,fieldName:t,definition:o,operation:n,mode:n,options:r},a=ti(e,t,o,r,n,i),c=a.referenceBacked?
|
|
183
183
|
ge(a.schema):{...a.schema},u={castType:o.type};for(let m of Object.keys(o)){if(m==="type"||!Object.hasOwn(e.validators,m))
|
|
184
184
|
continue;let f=Hn(e,m,t);if(!f)continue;let h=f({...s,parameterName:m,parameterValue:o[m],fieldSchema:{...c}});h&&Gn(c,h)}
|
|
185
|
-
c[R]&&(
|
|
185
|
+
c[R]&&(pt(u,c[R]),delete c[R]);let l=[];o.nullable===!0&&l.push({type:"null"}),o.nullOnEmpty===!0&&l.push({const:""});let d=ge(
|
|
186
186
|
zn(c,l));if(o.defaultTo!==void 0&&i.applyDefaults)if(typeof o.defaultTo!="function"){let m=e._normalizeDefault(o,o.defaultTo,
|
|
187
187
|
{fieldPath:t,currentObject:{},containerKey:t,objectBeforeCast:{},options:{},settings:e._buildOperationSettings(n,i,{})});
|
|
188
188
|
if(Object.keys(m.errors).length>0){let f=Object.values(m.errors)[0];throw new Error(`defaultTo for "${t}" is invalid (${f.
|
|
189
189
|
code}).`)}d.default=m.value}else u.defaults={providedByFunction:!0};return d[R]=u,d}function Rr(e,t={}){let o=Yn(t),{operationName:r,
|
|
190
190
|
operation:n}=qn(e,o),i=o.additionalProperties===void 0?!1:o.additionalProperties,s=we(o),a=Or(e,o,r,n,i,{root:!0}),c={$schema:Ln,
|
|
191
|
-
...Pr(a,o)};return Object.keys(s.definitions).length>0&&(c.definitions=s.definitions),c}function Ar(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function
|
|
191
|
+
...Pr(a,o)};return Object.keys(s.definitions).length>0&&(c.definitions=s.definitions),c}function Ar(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function bt(e){return e instanceof
|
|
192
192
|
G}function ri(){return{self:!1,children:{}}}function Ir(e){return Object.keys(e.children).length>0}function $(e,t){return`${e}\
|
|
193
193
|
.${String(t)}`}function $r(e,t){return e===""?String(t):$(e,t)}function Cr(e,t){if(e===t)return"";let o=`${t}.`;return e.
|
|
194
|
-
startsWith(o)?e.slice(o.length):null}function
|
|
195
|
-
field:n})}return o}function
|
|
194
|
+
startsWith(o)?e.slice(o.length):null}function B(e,t){let o={};for(let r of Object.values(e)){let n=$(t,r.field);p(o,n,{...r,
|
|
195
|
+
field:n})}return o}function _t(e){return st(e,"validatePath")}function xr(e){let t={};for(let o of e){let r=_t(o),n=t;for(let i=0;i<
|
|
196
196
|
r.length;i++){let s=r[i];Object.hasOwn(n,s)||p(n,s,ri()),i===r.length-1&&(n[s].self=!0),n=n[s].children}}return t}function oi(e,t){
|
|
197
|
-
let o=e;for(let r of t){if(o==null||typeof o!="object"||!Object.hasOwn(o,r))return;o=o[r]}return o}function
|
|
197
|
+
let o=e;for(let r of t){if(o==null||typeof o!="object"||!Object.hasOwn(o,r))return;o=o[r]}return o}function _e(e){return e===
|
|
198
198
|
null?!0:Array.isArray(e)||g(e)?Object.keys(e).length>0:e!==void 0}function Nr(e){return[...e].sort((t,o)=>{let r=/^[0-9]+$/.
|
|
199
199
|
test(t),n=/^[0-9]+$/.test(o);return r&&n?Number(t)-Number(o):r?-1:n?1:t.localeCompare(o)})}function ni(e){return/^[0-9]+$/.
|
|
200
200
|
test(e)}function ii(e,t=new WeakMap){if(t.has(e))return t.get(e);let o=Object.create(G.prototype);return t.set(e,o),o.structure=
|
|
201
|
-
null,o.types=e.types,o.validators=e.validators,o.operations=e.operations,o.structure=be(
|
|
202
|
-
Object.freeze(o)}function
|
|
201
|
+
null,o.types=e.types,o.validators=e.validators,o.operations=e.operations,o.structure=be(ye(e.structure,t)),o._installOperationMethods(),
|
|
202
|
+
Object.freeze(o)}function ye(e,t=new WeakMap){if(e===null||typeof e!="object")return e;if(bt(e))return ii(e,t);if(e instanceof
|
|
203
203
|
Date)return new Date(e.getTime());if(e instanceof RegExp){let r=new RegExp(e.source,e.flags);return r.lastIndex=e.lastIndex,
|
|
204
|
-
r}if(t.has(e))return t.get(e);if(Array.isArray(e)){let r=[];t.set(e,r);for(let n of e)r.push(
|
|
205
|
-
return e;let o={};t.set(e,o);for(let[r,n]of Object.entries(e))p(o,r,
|
|
206
|
-
null||typeof e!="object"||t.has(e)||
|
|
207
|
-
ownKeys(e))be(e[o],t);return Object.freeze(e)}function
|
|
204
|
+
r}if(t.has(e))return t.get(e);if(Array.isArray(e)){let r=[];t.set(e,r);for(let n of e)r.push(ye(n,t));return r}if(!g(e))
|
|
205
|
+
return e;let o={};t.set(e,o);for(let[r,n]of Object.entries(e))p(o,r,ye(n,t));return o}function be(e,t=new WeakSet){if(e===
|
|
206
|
+
null||typeof e!="object"||t.has(e)||bt(e))return e;if(t.add(e),Array.isArray(e))for(let o of e)be(o,t);else for(let o of Reflect.
|
|
207
|
+
ownKeys(e))be(e[o],t);return Object.freeze(e)}function ht(e){return be(ye(e))}var gt=new WeakMap;function yt(e,t,o=""){if(!bt(
|
|
208
208
|
e)||!Array.isArray(t)||t.length<1)return null;let[r,...n]=t;if(!Object.hasOwn(e.structure,r))return null;let i=e.structure[r];
|
|
209
209
|
if(n.length<1)return i;let s=$r(o,r);return Mr(e,i,n,s)}function Mr(e,t,o,r){if(t?.type==="object"){let n=e._resolveObjectFieldMode(
|
|
210
210
|
r,t);return n.kind!=="nested"?null:yt(n.schema,o,r)}if(t?.type==="array"){let n=e._resolveArrayItemsConfig(r,t);if(!n||o.
|
|
@@ -216,16 +216,16 @@ skipParams=r:delete o.skipParams}return o}var si=Object.freeze({create:Object.fr
|
|
|
216
216
|
applyDefaults:!0,outputFields:"validated",rejectExplicitUndefined:!0}),replace:Object.freeze({targetFields:"schema",enforceRequired:!0,
|
|
217
217
|
applyDefaults:!0,outputFields:"validated",rejectExplicitUndefined:!0}),patch:Object.freeze({targetFields:"input",enforceRequired:!1,
|
|
218
218
|
applyDefaults:!1,outputFields:"input",rejectExplicitUndefined:!0})});function jr(e,t,o,r){let n=t[o];if(!r.includes(n))throw new Error(
|
|
219
|
-
`Operation "${e}" must define ${o} as one of: ${r.join(", ")}.`)}function
|
|
219
|
+
`Operation "${e}" must define ${o} as one of: ${r.join(", ")}.`)}function wt(e,t,o,r=!0){let n=t[o];if(!(n===void 0&&!r)&&
|
|
220
220
|
typeof n!="boolean")throw new Error(`Operation "${e}" must define ${o} as a boolean.`)}function ai(e,t){if(typeof t!="ob\
|
|
221
221
|
ject"||t===null||Array.isArray(t))throw new Error(`Operation "${e}" must be an object.`);return jr(e,t,"targetFields",["\
|
|
222
|
-
schema","input"]),
|
|
222
|
+
schema","input"]),wt(e,t,"enforceRequired"),wt(e,t,"applyDefaults"),jr(e,t,"outputFields",["validated","input"]),wt(e,t,
|
|
223
223
|
"rejectExplicitUndefined",!1),Object.freeze({targetFields:t.targetFields,enforceRequired:t.enforceRequired,applyDefaults:t.
|
|
224
224
|
applyDefaults,outputFields:t.outputFields,rejectExplicitUndefined:t.rejectExplicitUndefined===void 0?!0:t.rejectExplicitUndefined})}
|
|
225
225
|
function ci(e={}){if(typeof e!="object"||e===null||Array.isArray(e))throw new Error("Schema operations must be an object\
|
|
226
226
|
.");let t=Object.create(null);for(let[o,r]of Object.entries(si))p(t,o,r);for(let[o,r]of Object.entries(e))p(t,o,ai(o,r));
|
|
227
227
|
return Object.freeze(t)}function kr(e){let t=Object.create(null);for(let[o,r]of Object.entries(e))p(t,o,r);return Object.
|
|
228
|
-
freeze(t)}function ui(e){let t={...e};return delete t.operation,delete t.mode,t}var G=class{constructor(t,o,r,n={}){
|
|
228
|
+
freeze(t)}function ui(e){let t={...e};return delete t.operation,delete t.mode,t}var G=class{constructor(t,o,r,n={}){ot(t),
|
|
229
229
|
this.structure=t,this.types=kr(o),this.validators=kr(r),this.operations=ci(n),this._installOperationMethods()}_typeError(t){
|
|
230
230
|
return this._paramError(t,"TYPE_CAST_FAILED","Value could not be cast to the required type.")}_paramError(t,o,r,n={}){let i=new Error(
|
|
231
231
|
r);return i.errorObject={field:t,code:o,message:r,params:n},i}_paramToBeSkipped(t,o,r){return typeof o!="object"||o===null?
|
|
@@ -267,18 +267,18 @@ c,o,r,n,i,s):c.kind==="map"?this._validateObjectValues(o,r,n,c.valuesConfig,i,s)
|
|
|
267
267
|
_resolveArrayItemsConfig(o,t);return a?this._validateArrayItems(o,r,n,a,i,s):{}}_validateNestedObjectSchema(t,o,r,n,i,s){
|
|
268
268
|
let a=r[n],c=t.allowAdditionalProperties?this._extractKnownObjectFields(a,t.schema):a,u=t.schema._validateWithOperation(
|
|
269
269
|
s.operationName,s.operation,c,F(i,o));return p(r,n,t.allowAdditionalProperties?this._mergeKnownAndPassthroughObjectFields(
|
|
270
|
-
a,t.schema,u.validatedObject):u.validatedObject),
|
|
270
|
+
a,t.schema,u.validatedObject):u.validatedObject),B(u.errors,o)}_extractKnownObjectFields(t,o){let r={};for(let[n,i]of Object.
|
|
271
271
|
entries(t))Object.hasOwn(o.structure,n)&&p(r,n,i);return r}_mergeKnownAndPassthroughObjectFields(t,o,r){let n={};for(let i of Object.
|
|
272
272
|
keys(t)){if(!Object.hasOwn(o.structure,i)){p(n,i,t[i]);continue}Object.hasOwn(r,i)&&p(n,i,r[i])}for(let[i,s]of Object.entries(
|
|
273
273
|
r))Object.hasOwn(n,i)||p(n,i,s);return n}_validateObjectValues(t,o,r,n,i,s){let a=o[r],c={...a},u={};p(o,r,c);for(let l of Object.
|
|
274
274
|
keys(a)){let d=$(t,l);if(this._fieldToBeSkipped(d,i))continue;let m=c[l];if(m===void 0){s.rejectExplicitUndefined?this._mergeErrors(
|
|
275
275
|
u,this._singleErrorMap(this._typeError(d).errorObject)):delete c[l];continue}if(n.kind==="schema"){let h=n.schema._validateWithOperation(
|
|
276
|
-
"replace",n.schema.operations.replace,m,F(i,d));p(c,l,h.validatedObject),this._mergeErrors(u,
|
|
276
|
+
"replace",n.schema.operations.replace,m,F(i,d));p(c,l,h.validatedObject),this._mergeErrors(u,B(h.errors,d));continue}let f=this.
|
|
277
277
|
_normalizeAndValidateValue(n.definition,m,d,c,l,a,i,this._buildArrayItemSettings(n.definition,s));this._mergeErrors(u,f)}
|
|
278
278
|
return u}_validateArrayItems(t,o,r,n,i,s){let a=o[r],c=a.slice(),u={};p(o,r,c);for(let l=0;l<c.length;l++){let d=$(t,l);
|
|
279
279
|
if(this._fieldToBeSkipped(d,i))continue;if(!Object.hasOwn(a,l)||c[l]===void 0){s.rejectExplicitUndefined?this._mergeErrors(
|
|
280
280
|
u,this._singleErrorMap(this._typeError(d).errorObject)):delete c[l];continue}if(n.kind==="schema"){let f=n.schema._validateWithOperation(
|
|
281
|
-
"replace",n.schema.operations.replace,c[l],F(i,d));p(c,l,f.validatedObject),this._mergeErrors(u,
|
|
281
|
+
"replace",n.schema.operations.replace,c[l],F(i,d));p(c,l,f.validatedObject),this._mergeErrors(u,B(f.errors,d));continue}
|
|
282
282
|
let m=this._normalizeAndValidateValue(n.definition,c[l],d,c,l,a,i,this._buildArrayItemSettings(n.definition,s));this._mergeErrors(
|
|
283
283
|
u,m)}return u}_validateField(t,o,r,n,i){if(!Object.hasOwn(this.structure,t))return{};let s=this.structure[t];if(this._fieldToBeSkipped(
|
|
284
284
|
t,n))return{};let a=i.isFieldPresent(t),c=o[t],u=c===void 0;return i.enforceRequired&&s.required&&(!a||u)&&!this._paramToBeSkipped(
|
|
@@ -302,58 +302,58 @@ Object.keys(I.errors).length===0&&p(n,t,I.value)}return f}if(m===void 0)return u
|
|
|
302
302
|
this._typeError(a).errorObject):{};let h={[t]:m};if(u){let E=this._normalizeAndValidateValue(c,m,a,h,t,r,i,s);return Object.
|
|
303
303
|
hasOwn(h,t)&&h[t]!==void 0?p(n,t,h[t]):h[t]===null&&p(n,t,null),E}if(!l)return{};let b=this._castValue(c,m,a,h,t,r,i,s);
|
|
304
304
|
if(Object.keys(b.errors).length>0)return b.errors;if(!b.shouldContinue)return{};let ce=this._validateSelectedDescendants(
|
|
305
|
-
c,o.children,a,h,t,i,s);return
|
|
305
|
+
c,o.children,a,h,t,i,s);return _e(h[t])&&p(n,t,h[t]),ce}_validateSelectedDescendants(t,o,r,n,i,s,a){if(t.type==="object"){
|
|
306
306
|
let c=this._resolveObjectFieldMode(r,t);if(c.kind!=="nested")throw new Error(`Schema path "${r}" does not support nested\
|
|
307
307
|
field selection.`);let u=n[i];if(!g(u))return{};let l=c.schema._validateSelectedTree(o,u,F(s,r),{...a,defaultedFields:new Set});
|
|
308
|
-
return p(n,i,l.validatedObject),
|
|
308
|
+
return p(n,i,l.validatedObject),B(l.errors,r)}if(t.type==="array"){let c=this._resolveArrayItemsConfig(r,t);if(!c)throw new Error(
|
|
309
309
|
`Schema path "${r}" does not define array items for nested selection.`);return this._validateSelectedArrayItems(r,n,i,c,
|
|
310
310
|
o,s,a)}throw new Error(`Schema path "${r}" does not support nested field selection.`)}_validateSelectedArrayItems(t,o,r,n,i,s,a){
|
|
311
311
|
let c=[],u=o[r],l={};p(o,r,c);for(let d of Nr(Object.keys(i))){if(!/^[0-9]+$/.test(d))throw new Error(`Schema path "${$(
|
|
312
312
|
t,d)}" is invalid because array segments must use numeric indexes.`);let m=Number(d),f=$(t,m),h=i[d],b=h.self===!0,ce=Ir(
|
|
313
313
|
h);if(this._fieldToBeSkipped(f,s))continue;if(!Object.hasOwn(u,m)){b&&a.rejectExplicitUndefined&&p(l,f,this._typeError(f).
|
|
314
314
|
errorObject);continue}let E=u[m];if(E===void 0){b&&a.rejectExplicitUndefined&&p(l,f,this._typeError(f).errorObject);continue}
|
|
315
|
-
if(n.kind==="schema"){if(b){let
|
|
316
|
-
validatedObject)&&p(c,m,
|
|
315
|
+
if(n.kind==="schema"){if(b){let De=n.schema._validateWithOperation("replace",n.schema.operations.replace,E,F(s,f));_e(De.
|
|
316
|
+
validatedObject)&&p(c,m,De.validatedObject),this._mergeErrors(l,B(De.errors,f));continue}if(!ce)continue;let H=n.schema.
|
|
317
317
|
_validateSelectedTree(h.children,E,F(s,f),{...a,operationName:"replace",operation:n.schema.operations.replace,defaultedFields:new Set});
|
|
318
|
-
|
|
318
|
+
_e(H.validatedObject)&&p(c,m,H.validatedObject),this._mergeErrors(l,B(H.errors,f));continue}let I=this._buildArrayItemSettings(
|
|
319
319
|
n.definition,a),O=[E];if(b){let H=this._normalizeAndValidateValue(n.definition,E,f,O,0,u,s,I);Object.hasOwn(O,0)&&O[0]!==
|
|
320
|
-
void 0?p(c,m,O[0]):O[0]===null&&p(c,m,null),this._mergeErrors(l,H);continue}if(!ce)continue;let
|
|
321
|
-
E,f,O,0,u,s,I);if(Object.keys(
|
|
322
|
-
let jo=this._validateSelectedDescendants(n.definition,h.children,f,O,0,s,I);
|
|
320
|
+
void 0?p(c,m,O[0]):O[0]===null&&p(c,m,null),this._mergeErrors(l,H);continue}if(!ce)continue;let Le=this._castValue(n.definition,
|
|
321
|
+
E,f,O,0,u,s,I);if(Object.keys(Le.errors).length>0){this._mergeErrors(l,Le.errors);continue}if(!Le.shouldContinue)continue;
|
|
322
|
+
let jo=this._validateSelectedDescendants(n.definition,h.children,f,O,0,s,I);_e(O[0])&&p(c,m,O[0]),this._mergeErrors(l,jo)}
|
|
323
323
|
return l}validateWith(t,o,r={}){if(!Object.hasOwn(this.operations,t))throw new Error(`Unknown operation "${t}".`);let n=this.
|
|
324
324
|
operations[t];return this._assertPlainObjectInput(t,o),this._validateWithOperation(t,n,o,r)}validateAt(t,o,r={}){this._assertPlainObjectInput(
|
|
325
|
-
"validateAt",o);let n=
|
|
325
|
+
"validateAt",o);let n=_t(t),{operationName:i,operation:s,validationOptions:a}=this._resolvePathValidationRequest(r),c=this.
|
|
326
326
|
_validateSelectedTree(xr([t]),o,a,this._buildOperationSettings(i,s,o));return{validatedValue:oi(c.validatedObject,n),errors:c.
|
|
327
327
|
errors}}validatePaths(t,o,r={}){if(this._assertPlainObjectInput("validatePaths",o),!Array.isArray(t)||t.length===0)throw new Error(
|
|
328
328
|
"validatePaths() expects a non-empty array of schema paths.");let{operationName:n,operation:i,validationOptions:s}=this.
|
|
329
329
|
_resolvePathValidationRequest(r);return this._validateSelectedTree(xr(t),o,s,this._buildOperationSettings(n,i,o))}_installOperationMethods(){
|
|
330
330
|
for(let t of Object.keys(this.operations)){if(t in this)throw new Error(`Operation name "${t}" is reserved and cannot be\
|
|
331
331
|
used as a schema method.`);this[t]=(o,r={})=>this.validateWith(t,o,r)}}toJsonSchema(t={}){return Rr(this,t)}getFieldDefinitions(){
|
|
332
|
-
return
|
|
333
|
-
"")throw new Error("Field path must be a non-empty string.");let o=yt(this,
|
|
334
|
-
let o=this.getFieldDefinition(t);return!o||typeof o.messages!="object"||o.messages===null?Object.freeze({}):
|
|
335
|
-
let r={};for(let n of Object.keys(t))Object.hasOwn(this.structure,n)&&this.structure[n][o]&&p(r,n,t[n]);return r}};var{parse:
|
|
332
|
+
return gt.has(this)||gt.set(this,ht(this.structure)),gt.get(this)}getFieldDefinition(t){if(typeof t!="string"||t.trim()===
|
|
333
|
+
"")throw new Error("Field path must be a non-empty string.");let o=yt(this,_t(t.trim()));return o===null?null:ht(o)}getFieldMessages(t){
|
|
334
|
+
let o=this.getFieldDefinition(t);return!o||typeof o.messages!="object"||o.messages===null?Object.freeze({}):ht(o.messages)}cleanup(t,o){
|
|
335
|
+
let r={};for(let n of Object.keys(t))Object.hasOwn(this.structure,n)&&this.structure[n][o]&&p(r,n,t[n]);return r}};var{parse:Du,stringify:li}=JSON,{keys:Uu}=Object,di=String,pi="string";var Lr="object",mi=(e,t)=>t;var Dr=(e,t,o)=>{let r=di(t.push(o)-1);return e.set(o,r),r};var Ur=(e,t,o)=>{let r=t&&typeof t===Lr?(l,d)=>l===""||-1<t.indexOf(l)?d:void 0:t||mi,n=new Map,i=[],s=[],a=+Dr(n,i,r.call(
|
|
336
336
|
{"":e},"",e)),c=!a;for(;a<i.length;)c=!0,s[a]=li(i[a++],u,o);return"["+s.join(",")+"]";function u(l,d){if(c)return c=!c,
|
|
337
337
|
d;let m=r.call(this,l,d);switch(typeof m){case Lr:if(m===null)return m;case pi:return n.get(m)||Dr(n,i,m)}return m}};var hi=new Set(["true","1","yes","y","on"]),gi=new Set(["false","0","no","n","off"]);function wi(e){return e!==null&&(typeof e==
|
|
338
|
-
"object"||typeof e=="function")&&typeof e.then=="function"}function
|
|
338
|
+
"object"||typeof e=="function")&&typeof e.then=="function"}function Br(e){if(typeof e=="number")return Number.isFinite(e)?
|
|
339
339
|
e:null;if(typeof e=="bigint"){let t=Number(e);return Number.isSafeInteger(t)?t:null}if(typeof e=="string"){let t=e.trim();
|
|
340
|
-
if(t==="")return null;let o=Number(t);return Number.isFinite(o)?o:null}return null}function
|
|
340
|
+
if(t==="")return null;let o=Number(t);return Number.isFinite(o)?o:null}return null}function Et(e,t){if(Object.is(e,t))return!0;
|
|
341
341
|
if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp&&t instanceof RegExp)return e.
|
|
342
342
|
source===t.source&&e.flags===t.flags;if(Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==
|
|
343
|
-
t.length)return!1;for(let n=0;n<e.length;n++)if(!
|
|
343
|
+
t.length)return!1;for(let n=0;n<e.length;n++)if(!Et(e[n],t[n]))return!1;return!0}if(e===null||t===null||typeof e!="objec\
|
|
344
344
|
t"||typeof t!="object"||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;let o=Object.keys(e),r=Object.keys(
|
|
345
|
-
t);if(o.length!==r.length)return!1;for(let n of o)if(!Object.hasOwn(t,n)||!
|
|
345
|
+
t);if(o.length!==r.length)return!1;for(let n of o)if(!Object.hasOwn(t,n)||!Et(e[n],t[n]))return!1;return!0}var _i={install(e){
|
|
346
346
|
let{addType:t,addValidator:o}=e;t("none",r=>r.value),t("file",r=>{let n=r.value;n==null&&r.throwTypeError();let i=typeof n;
|
|
347
347
|
if(i==="string"||i==="number"||i==="boolean"){let s=n.toString();return r.definition.noTrim?s:s.trim()}r.throwTypeError()}),
|
|
348
348
|
t("string",r=>{let n=r.value;if(n==null)return"";let i=typeof n;if(i==="string"||i==="number"||i==="boolean"){let s=n.toString();
|
|
349
|
-
return r.definition.noTrim?s:s.trim()}r.throwTypeError()}),t("blob",r=>r.value),t("number",r=>{let n=
|
|
350
|
-
null&&r.throwTypeError(),n}),t("integer",r=>{let n=
|
|
351
|
-
n}),t("epochMilliseconds",r=>{let n=
|
|
352
|
-
r.value,864e10);return n===null&&r.throwTypeError(),n}),t("dateTime",r=>{let n=Y(r.definition,r.fieldName);return
|
|
349
|
+
return r.definition.noTrim?s:s.trim()}r.throwTypeError()}),t("blob",r=>r.value),t("number",r=>{let n=Br(r.value);return n===
|
|
350
|
+
null&&r.throwTypeError(),n}),t("integer",r=>{let n=Br(r.value);return(n===null||!Number.isInteger(n))&&r.throwTypeError(),
|
|
351
|
+
n}),t("epochMilliseconds",r=>{let n=it(r.value,864e13);return n===null&&r.throwTypeError(),n}),t("epochSeconds",r=>{let n=it(
|
|
352
|
+
r.value,864e10);return n===null&&r.throwTypeError(),n}),t("dateTime",r=>{let n=Y(r.definition,r.fieldName);return yr(r.value,
|
|
353
353
|
n)||r.throwTypeError(),r.value}),t("date",r=>(wr(r.value)||r.throwTypeError(),r.value)),t("time",r=>{let n=Y(r.definition,
|
|
354
|
-
r.fieldName);return
|
|
354
|
+
r.fieldName);return _r(r.value,n)||r.throwTypeError(),r.value}),t("array",r=>r.definition.type==="array"&&!Array.isArray(
|
|
355
355
|
r.value)?[r.value]:r.value),t("object",r=>(g(r.value)||r.throwTypeError(),r.value)),t("serialize",r=>{try{return JSON.stringify(
|
|
356
|
-
r.value)}catch{try{return
|
|
356
|
+
r.value)}catch{try{return Ur(r.value)}catch{r.throwTypeError()}}}),t("boolean",r=>{if(typeof r.value=="boolean")return r.
|
|
357
357
|
value;if(typeof r.value=="number"){if(r.value===1)return!0;if(r.value===0)return!1;r.throwTypeError()}if(typeof r.value==
|
|
358
358
|
"bigint"){if(r.value===1n)return!0;if(r.value===0n)return!1;r.throwTypeError()}if(typeof r.value=="string"){let n=String(
|
|
359
359
|
r.definition.stringFalseWhen||"false").trim().toLowerCase(),i=String(r.definition.stringTrueWhen||"true").trim().toLowerCase(),
|
|
@@ -370,7 +370,7 @@ r.value.toString().length>r.parameterValue&&r.throwParamError("MAX_LENGTH",`Leng
|
|
|
370
370
|
characters.`,{max:r.parameterValue,actual:r.value.toString().length})}),o("max",r=>{r.value!==void 0&&D(r.definition)&&
|
|
371
371
|
typeof r.value=="number"&&r.value>r.parameterValue&&r.throwParamError("MAX_VALUE",`Value must be no more than ${r.parameterValue}\
|
|
372
372
|
.`,{max:r.parameterValue,actual:r.value})}),o("enum",r=>{if(!Array.isArray(r.parameterValue))throw new Error(`Enum for ${r.
|
|
373
|
-
fieldName} must be an array.`);r.parameterValue.some(i=>
|
|
373
|
+
fieldName} must be an array.`);r.parameterValue.some(i=>Et(i,r.value))||r.throwParamError("ENUM_VALUE","Value must match\
|
|
374
374
|
one of the allowed enum values.",{allowed:r.parameterValue})}),o("pattern",r=>{if(r.value===void 0||r.definition.type!==
|
|
375
375
|
"string"||typeof r.value!="string")return;let n=r.parameterValue,i=n instanceof RegExp?new RegExp(n.source,n.flags):typeof n==
|
|
376
376
|
"string"?new RegExp(n):null;if(!i)throw new Error(`Pattern for ${r.fieldName} must be a string or RegExp.`);i.test(r.value)||
|
|
@@ -390,7 +390,7 @@ r.throwParamError("MAX_ITEMS",`Must have no more than ${r.parameterValue} items.
|
|
|
390
390
|
o("notEmpty",r=>{r.parameterValue&&typeof r.value=="string"&&r.value===""&&r.throwParamError("NOT_EMPTY","Field cannot b\
|
|
391
391
|
e empty.")}),o("required",()=>{}),o("unsigned",()=>{}),o("precision",()=>{}),o("scale",()=>{}),o("temporalPrecision",r=>{
|
|
392
392
|
if(r.definition.type!=="time"&&r.definition.type!=="dateTime")throw new Error(`temporalPrecision can only be used on tim\
|
|
393
|
-
e or dateTime fields (${r.fieldName}).`)}),o("nullable",()=>{}),o("nullOnEmpty",()=>{}),o("defaultTo",()=>{})}},Fr=
|
|
393
|
+
e or dateTime fields (${r.fieldName}).`)}),o("nullable",()=>{}),o("nullOnEmpty",()=>{}),o("defaultTo",()=>{})}},Fr=_i;var Hr=new WeakMap,Wr=new WeakMap,qr=Symbol.for("json-rest-schema.registry-metadata"),Ee=new WeakSet;function yi(e,t,o){
|
|
394
394
|
if(typeof o!="function")throw new Error(`Type handler for '${t}' must be a function.`);p(e,t,o)}function bi(e,t,o){if(typeof o!=
|
|
395
395
|
"function")throw new Error(`Validator handler for '${t}' must be a function.`);p(e,t,o)}function Se(e={}){let t=Object.create(
|
|
396
396
|
null);for(let[o,r]of Object.entries(e))p(t,o,r);return t}function Gr(e,t){if(typeof e.install!="function")throw new Error(
|
|
@@ -406,58 +406,61 @@ entries(t)){if(Object.hasOwn(e,r)&&e[r]!==n){if(Ee.has(n))continue;if(!Ee.has(e[
|
|
|
406
406
|
types:Se(e),validators:Se(t)};let n=Object.create(null),i=Object.create(null);for(let s of r){let a=Ei(s);if(!a)throw new Error(
|
|
407
407
|
"Factory sources must be schema instances or schema factories created by json-rest-schema.");Vr(n,a.types,"type"),Vr(i,a.
|
|
408
408
|
validators,"validator")}return{types:n,validators:i}}function Yr({types:e={},validators:t={},installCore:o=!0}={}){let r=Se(
|
|
409
|
-
e),n=Se(t),i=(s,a={})=>{let c=new G(s,r,n,a.operations);return zr(c,r,n),c};return zr(i,r,n),i.addType=(s,a)=>{
|
|
409
|
+
e),n=Se(t),i=(s,a={})=>{let c=new G(s,r,n,a.operations);return zr(c,r,n),c};return zr(i,r,n),i.addType=(s,a)=>{yi(r,s,a)},
|
|
410
410
|
i.addValidator=(s,a)=>{bi(n,s,a)},i.use=s=>{Gr(s,{addType:i.addType,addValidator:i.addValidator})},i.createFactory=(...s)=>{
|
|
411
411
|
let a=vi(r,n,s);return Yr({types:a.types,validators:a.validators,installCore:!1})},o&&Gr(Fr,{addType:(s,a)=>{Ee.add(a),i.
|
|
412
|
-
addType(s,a)},addValidator:(s,a)=>{Ee.add(a),i.addValidator(s,a)}}),i}var Jr=Yr({installCore:!0});var
|
|
413
|
-
function vt(e,t){let o=Pi(e);if(!Kr.test(o))throw new TypeError(`${t} must match ${Kr.toString()}.`);return o}function
|
|
414
|
-
if(e==null)return Object.freeze({});if(!
|
|
412
|
+
addType(s,a)},addValidator:(s,a)=>{Ee.add(a),i.addValidator(s,a)}}),i}var Jr=Yr({installCore:!0});var sl=Object.freeze({schema:Jr({}),mode:"replace"});var Kr=/^[a-z][a-z0-9_.-]*$/u,Oi=/^[A-Za-z_$][A-Za-z0-9_$]*$/u;function Pi(e){return String(e||"").trim().toLowerCase()}
|
|
413
|
+
function vt(e,t){let o=Pi(e);if(!Kr.test(o))throw new TypeError(`${t} must match ${Kr.toString()}.`);return o}function Te(e,t){
|
|
414
|
+
if(e==null)return Object.freeze({});if(!y(e))throw new TypeError(`${t} must be an object mapping local names to capabili\
|
|
415
415
|
ty ids.`);let o={},r=new Set;for(let[n,i]of Object.entries(e)){let s=String(n||"").trim();if(!Oi.test(s))throw new TypeError(
|
|
416
416
|
`${t} local name "${s}" must be a JavaScript identifier.`);let a=vt(i,`${t}.${s}`);if(r.has(a))throw new TypeError(`${t}\
|
|
417
417
|
declares capability "${a}" more than once.`);r.add(a),o[s]=a}return Object.freeze(o)}function Ri(e,t,o){if(e==null)return Object.
|
|
418
|
-
freeze({});if(!
|
|
418
|
+
freeze({});if(!y(e))throw new TypeError(`${o}.hints must be an object mapping required capability ids to what to registe\
|
|
419
419
|
r.`);let r=new Set(Object.values(t)),n={};for(let[i,s]of Object.entries(e)){let a=vt(i,`${o}.hints key`);if(!r.has(a))throw new TypeError(
|
|
420
420
|
`${o}.hints names "${a}", which the provider does not require.`);if(typeof s!="string"||!s.trim())throw new TypeError(`${o}\
|
|
421
421
|
.hints["${a}"] must be the text that says what to register.`);n[a]=s.trim()}return Object.freeze(n)}function Ai(e){let t=new Map;
|
|
422
422
|
for(let[o,r]of Object.entries(e))for(let n of Object.keys(r)){if(t.has(n))throw new TypeError(`Provider local name "${n}\
|
|
423
|
-
" is declared by both ${t.get(n)} and ${o}.`);t.set(n,o)}}function
|
|
424
|
-
throw new TypeError(
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
423
|
+
" is declared by both ${t.get(n)} and ${o}.`);t.set(n,o)}}function Ii(e,t,o){for(let r of Object.values(t))for(let[n,i]of Object.
|
|
424
|
+
entries(o))if(Object.values(i).includes(r))throw new TypeError(n==="provides"?`Provider "${e}" cannot late-require capab\
|
|
425
|
+
ility "${r}" that it provides.`:`Provider "${e}" names capability "${r}" under both late and ${n}.`)}function St(e,t){if(e==
|
|
426
|
+
null)return null;if(typeof e!="function")throw new TypeError(`${t} must be a function when provided.`);return e}function Oe({
|
|
427
|
+
id:e,requires:t={},optional:o={},late:r={},provides:n={},hints:i={},setup:s,boot:a=null,shutdown:c=null}={}){let u=vt(e,
|
|
428
|
+
"Provider id"),l=Te(t,`${u}.requires`),d=Te(o,`${u}.optional`),m=Te(r,`${u}.late`),f=Te(n,`${u}.provides`);Ai({requires:l,
|
|
429
|
+
optional:d,late:m,provides:f}),Ii(u,m,{provides:f,requires:l,optional:d});let h=St(s,`${u}.setup`);if(!h)throw new TypeError(
|
|
430
|
+
`${u}.setup is required.`);return Object.freeze({id:u,requires:l,optional:d,late:m,provides:f,hints:Ri(i,{...l,...m},u),
|
|
431
|
+
setup:h,boot:St(a,`${u}.boot`),shutdown:St(c,`${u}.shutdown`)})}var Xr="public";var Ci="/api",Qr=`${Ci}/bootstrap`;function Tt(){let e=[],t=new Set,o=!1;function r({id:a,order:c=0,contribute:u}={}){if(o)throw new Error("Bootstrap regis\
|
|
429
432
|
tration is closed after the first payload is resolved.");let l=T(a);if(!l)throw new TypeError("Bootstrap contributor id \
|
|
430
433
|
is required.");if(typeof u!="function")throw new TypeError(`Bootstrap contributor "${l}" requires contribute().`);if(t.has(
|
|
431
434
|
l))throw new Error(`Bootstrap contributor "${l}" is duplicated.`);return t.add(l),e.push(Object.freeze({id:l,order:Number.
|
|
432
435
|
isFinite(c)?Number(c):0,contribute:u})),s}async function n(a={}){o=!0;let c={},u=e.map((l,d)=>({entry:l,index:d})).sort(
|
|
433
436
|
(l,d)=>l.entry.order-d.entry.order||l.index-d.index).map(({entry:l})=>l);for(let l of u){let d=await l.contribute(Object.
|
|
434
|
-
freeze({...
|
|
437
|
+
freeze({...y(a)?a:{},payload:Object.freeze({...c})}));c={...c,...y(d)?d:{}}}return Object.freeze(c)}function i(){return Object.
|
|
435
438
|
freeze({sealed:o,contributorIds:Object.freeze(e.map(a=>a.id).sort())})}let s=Object.freeze({register:r,resolve:n,diagnostics:i});
|
|
436
|
-
return s}var
|
|
439
|
+
return s}var xi=Oe({id:"runtime.bootstrap",requires:{http:"runtime.http"},provides:{bootstrap:"runtime.bootstrap"},setup({http:e}){
|
|
437
440
|
let t=Tt();return e.router.register("GET",Qr,{auth:Xr,meta:{tags:["bootstrap"],summary:"Resolve app bootstrap payload"}},
|
|
438
|
-
async(o,r)=>{r.code(200).send(await t.resolve({request:o,reply:r,query:o.query||{}}))}),{bootstrap:t}}});function
|
|
441
|
+
async(o,r)=>{r.code(200).send(await t.resolve({request:o,reply:r,query:o.query||{}}))}),{bootstrap:t}}});function Ni(e){if(!y(e))throw new TypeError("Event listener must be an object.");let t=String(e.id||"").trim();if(!t)throw new TypeError(
|
|
439
442
|
"Event listener id is required.");if(typeof e.handle!="function")throw new TypeError(`Event listener "${t}" requires han\
|
|
440
443
|
dle().`);if(e.matches!=null&&typeof e.matches!="function")throw new TypeError(`Event listener "${t}" matches must be a f\
|
|
441
|
-
unction when provided.`);return Object.freeze({id:t,handle:e.handle,matches:e.matches??null})}function
|
|
444
|
+
unction when provided.`);return Object.freeze({id:t,handle:e.handle,matches:e.matches??null})}function ji(e){if(!y(e))throw new TypeError(
|
|
442
445
|
"Published event must be an object.");let t=String(e.type||"").trim();if(!t)throw new TypeError("Published event type is\
|
|
443
|
-
required.");return Object.freeze({...e,type:t})}function Ot(){let e=[],t=new Set;function o(s){let a=
|
|
444
|
-
throw new Error(`Event listener "${a.id}" is duplicated.`);return t.add(a.id),e.push(a),i}async function r(s){let a=
|
|
446
|
+
required.");return Object.freeze({...e,type:t})}function Ot(){let e=[],t=new Set;function o(s){let a=Ni(s);if(t.has(a.id))
|
|
447
|
+
throw new Error(`Event listener "${a.id}" is duplicated.`);return t.add(a.id),e.push(a),i}async function r(s){let a=ji(s);
|
|
445
448
|
for(let c of e)c.matches&&c.matches(a)!==!0||await c.handle(a);return a}function n(){return Object.freeze({listenerIds:Object.
|
|
446
|
-
freeze(e.map(s=>s.id))})}let i=Object.freeze({register:o,publish:r,diagnostics:n});return i}var
|
|
447
|
-
ibrary","Application Support","Vibe64"));let n=String(e.XDG_STATE_HOME||"").trim();return eo(
|
|
448
|
-
l","state"),"vibe64"))}var
|
|
449
|
+
freeze(e.map(s=>s.id))})}let i=Object.freeze({register:o,publish:r,diagnostics:n});return i}var ki=Oe({id:"runtime.events",provides:{events:"runtime.events"},setup(){return{events:Ot()}}});import{AsyncLocalStorage as $i}from"node:async_hooks";var sd=new $i;import Pe from"node:path";import Pt from"node:process";import Mi from"node:os";var Rt="VIBE64_SYSTEM_ROOT";function eo(e,t){let o=String(e||"").trim();return Pe.resolve(o||t||Pt.cwd())}function Re({env:e,home:t=Mi.homedir(),platform:o=Pt.platform}){let r=t||Pt.cwd();if(o==="darwin")return eo(Pe.join(r,"L\
|
|
450
|
+
ibrary","Application Support","Vibe64"));let n=String(e.XDG_STATE_HOME||"").trim();return eo(Pe.join(n||Pe.join(r,".loca\
|
|
451
|
+
l","state"),"vibe64"))}var Id=Object.freeze({runtimePackRoot:"",sharedCacheRoot:"",execHelperPath:"",sharedGroupAccess:!1});var Fd=Object.freeze(["repository","branch","path","baseCommit","canonicalCommit"]);import{execFile as Ui}from"node:child_process";import{promisify as Bi}from"node:util";var Wd=Bi(Ui);function Fi([e,t,o,r,n,i]=[]){if(!/^\d+$/u.test(t)||!/^\d+$/u.test(o))return null;let s=Number(t),a=Number(o);return!Number.
|
|
449
452
|
isSafeInteger(s)||!Number.isSafeInteger(a)?null:{displayName:String(r||"").split(",")[0],gid:a,home:String(n||""),shell:String(
|
|
450
|
-
i||""),uid:s,username:String(e||"")}}function
|
|
451
|
-
t[0],t[2],t[3],t[4],t[5],t[6]])}var
|
|
453
|
+
i||""),uid:s,username:String(e||"")}}function Gi(e=""){let t=String(e||"").trim().split(":");return t.length<7?null:Fi([
|
|
454
|
+
t[0],t[2],t[3],t[4],t[5],t[6]])}var qd=Object.freeze({parsePasswdLine:Gi});function w(e=""){return String(e??"").trim()}function Z(e={}){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}var ip=Object.freeze({SIGABRT:"Aborted",SIGALRM:"Timeout or timer",SIGHUP:"Terminal closed",SIGINT:"User interruption wi\
|
|
452
455
|
th CTRL-C",SIGKILL:"Forced termination",SIGPIPE:"Broken pipe or socket",SIGQUIT:"User interruption with CTRL-\\",SIGSEGV:"\
|
|
453
|
-
Segmentation fault",SIGTERM:"Termination",SIGUSR1:"Application-specific signal",SIGUSR2:"Application-specific signal"});var
|
|
454
|
-
" ":"\\t"});import{fileURLToPath as
|
|
455
|
-
in",customScheme:"",appLinkDomains:Object.freeze([])}),
|
|
456
|
-
versionName:"1.0.0"});var
|
|
457
|
-
"metadata","migrations","runtime","vite"]);import
|
|
456
|
+
Segmentation fault",SIGTERM:"Termination",SIGUSR1:"Application-specific signal",SIGUSR2:"Application-specific signal"});var sp=new RegExp("\\p{Separator}|\\p{Other}","gu"),ap=Object.freeze({" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r",
|
|
457
|
+
" ":"\\t"});import{fileURLToPath as Hi}from"node:url";var Vi=new URL("./../node_modules/@local/vibe64-execution/src/server/engines/detached.js",import.meta.url).href;var dp=Hi(new URL("./detachedReaper.js",Vi));import{createRequire as Yi}from"node:module";var qi=new URL("./../node_modules/@jskit-ai/kernel/server/support/symlinkSafeRequire.js",import.meta.url).href;var vp=Yi(qi);var Ip=Object.freeze(["bundled","dev_server"]),Cp=Object.freeze(["capacitor"]),xp=Object.freeze({callbackPath:"/auth/log\
|
|
458
|
+
in",customScheme:"",appLinkDomains:Object.freeze([])}),Np=Object.freeze({packageName:"",minSdk:26,targetSdk:35,versionCode:1,
|
|
459
|
+
versionName:"1.0.0"});var Qp=Object.freeze(["dependencies","optionalDependencies","peerDependencies"]),em=Object.freeze(["capabilities","kind",
|
|
460
|
+
"metadata","migrations","runtime","vite"]);import Qi from"node:path";var Xi="jskit-client-build",im=new RegExp(`<meta name="${Xi}" content="([0-9a-f]+)"`,"u");var dm=Qi.join("dist","index.html");var Ie=Object.freeze(["DATABASE_URL","DB_CLIENT","DB_DATABASE","DB_HOST","DB_NAME","DB_PASSWORD","DB_PORT","DB_USER","DB\
|
|
458
461
|
_USERNAME","MYSQL_DATABASE","MYSQL_HOST","MYSQL_PWD","MYSQL_TCP_PORT","PGDATABASE","PGHOST","PGPASSWORD","PGPORT","PGUSE\
|
|
459
|
-
R","VIBE64_MYSQL_USER"]);var te="GIT_AUTHOR_NAME",re="GIT_AUTHOR_EMAIL",oe="GIT_COMMITTER_NAME",ne="GIT_COMMITTER_EMAIL";var
|
|
460
|
-
`);var
|
|
462
|
+
R","VIBE64_MYSQL_USER"]);var te="GIT_AUTHOR_NAME",re="GIT_AUTHOR_EMAIL",oe="GIT_COMMITTER_NAME",ne="GIT_COMMITTER_EMAIL";var os=['git config --global user.name "Your Name"','git config --global user.email "you@example.com"'].join(`
|
|
463
|
+
`);var Ce=Object.freeze({awsebcli:{binDirs:["awsebcli/bin"],managedCommands:["eb"]},bubblewrap:{binDirs:["bubblewrap/bin"],
|
|
461
464
|
managedCommands:[]},bun:{binDirs:["bun/bin"],dependencyFiles:["package.json","bun.lock","bun.lockb","package-lock.json"],
|
|
462
465
|
managedCommands:["bun"]},composer:{binDirs:["composer/bin"],dependencyFiles:["composer.json","composer.lock"],managedCommands:[
|
|
463
466
|
"composer"]},cpp:{binDirs:["cpp/bin"],dependencyFiles:["CMakeLists.txt","vcpkg.json","vcpkg-configuration.json","conanfi\
|
|
@@ -487,27 +490,27 @@ playwright:{binDirs:["playwright/bin"],identityPaths:["playwright/runtime.env","
|
|
|
487
490
|
playwright"]},postgresql:{binDirs:["postgresql/bin"],managedCommands:["initdb","pg_ctl","pg_isready","postgres","psql"]},
|
|
488
491
|
ripgrep:{binDirs:["ripgrep/bin"],managedCommands:[]},sqlite:{binDirs:["sqlite/bin"],managedCommands:["sqlite3"]}}),no=Object.
|
|
489
492
|
freeze(["operator-clis","node26","git","gh","mysql","mariadb","postgresql","sqlite","ripgrep","bubblewrap","bun","php","\
|
|
490
|
-
composer","awsebcli","cpp","python","ruby","go","java","kotlin","csharp","rust","playwright"]);function
|
|
491
|
-
GHT_VERSION";var
|
|
492
|
-
steadOf",value:"ssh://git@github.com/"}]),
|
|
493
|
-
/env gh auth git-credential"}]),
|
|
494
|
-
get) printf '%s\\n' username=x-access-token "password=\${VIBE64_GIT_AUTH_TOKEN}" ;; esac; }; f`}]);function
|
|
493
|
+
composer","awsebcli","cpp","python","ruby","go","java","kotlin","csharp","rust","playwright"]);function ns(e=""){let t=w(e);return[...Ce[t]?.managedCommands||[]]}var Km=Object.freeze({runtimePackManagedCommands:ns});var It="VIBE64_SHARED_CACHE_ROOT",xe="PLAYWRIGHT_BROWSERS_PATH",io="PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD",so="VIBE64_PLAYWRI\
|
|
494
|
+
GHT_VERSION";var af=new Set([...Ie,re,te,ne,oe,xe,io,so,It]);import co from"node:path";var ss=Object.freeze([{key:"url.https://github.com/.insteadOf",value:"git@github.com:"},{key:"url.https://github.com/.in\
|
|
495
|
+
steadOf",value:"ssh://git@github.com/"}]),ff=Object.freeze([{key:"credential.https://github.com.helper",value:"!/usr/bin\
|
|
496
|
+
/env gh auth git-credential"}]),hf=Object.freeze([{key:"credential.https://github.com.helper",value:`!f() { case "$1" in\
|
|
497
|
+
get) printf '%s\\n' username=x-access-token "password=\${VIBE64_GIT_AUTH_TOKEN}" ;; esac; }; f`}]);function as(e=[]){let t=new Set,
|
|
495
498
|
o=[];for(let r of Array.isArray(e)?e:[e]){let n=w(r);if(!n||!co.isAbsolute(n))continue;let i=co.resolve(n);t.has(i)||(t.
|
|
496
499
|
add(i),o.push(i))}return o}function uo(e={},t=[]){let o={...e&&typeof e=="object"&&!Array.isArray(e)?e:{}},r=Number.parseInt(
|
|
497
500
|
String(o.GIT_CONFIG_COUNT||"0"),10),n=Number.isSafeInteger(r)&&r>=0?r:0;for(let i of Array.isArray(t)?t:[]){let s=w(i?.key);
|
|
498
501
|
s&&(o[`GIT_CONFIG_KEY_${n}`]=s,o[`GIT_CONFIG_VALUE_${n}`]=String(i?.value??""),n+=1)}return o.GIT_CONFIG_COUNT=String(n),
|
|
499
|
-
o}function
|
|
500
|
-
_RUNTIME_DIR"]);import{createRequire as
|
|
501
|
-
"deployment","health","workspace-cache","source"]),
|
|
502
|
-
8","base64"]),
|
|
503
|
-
ps","github-token"]),
|
|
504
|
-
freeze(["finite","interactive","service"]),
|
|
502
|
+
o}function cs(e=[]){return as(e).map(t=>({key:"safe.directory",value:t}))}function us(e=[]){return cs(e).flatMap(t=>["-c",`${t.key}=${t.value}`])}function ls(e={}){return uo(e,ss)}var gf=Object.freeze({applyGitConfigEntriesToEnv:uo,githubSshToHttpsGitEnv:ls,gitSafeDirectoryArgs:us});var xt="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin";var Qf=new Set([...Ie,re,te,ne,oe,"HOME","LOGNAME","PATH","USER","XDG_CACHE_HOME","XDG_CONFIG_HOME","XDG_DATA_HOME","XDG\
|
|
503
|
+
_RUNTIME_DIR"]);import{createRequire as Rs}from"node:module";var rh=256*1024;var oh=600*1e3,nh=1440*60*1e3,ih=Object.freeze({"ctrl-c":"",enter:"\r",escape:"\x1B",tab:" "});var Ps=new URL("./../node_modules/@local/vibe64-execution/src/server/engines/terminalSessions.js",import.meta.url).href;var ag=Rs(Ps);import{randomUUID as Cs}from"node:crypto";var Tg=Object.freeze(["daemon","owner-user","named-user","app"]);var Og=Object.freeze(["account","assistant","terminal","codex","github","github-api","source-editor","preview","output",
|
|
504
|
+
"deployment","health","workspace-cache","source"]),Pg=Object.freeze(["capture","pty","detached"]),Rg=Object.freeze(["utf\
|
|
505
|
+
8","base64"]),Ag=Object.freeze(["session","project","preview","auth","deployment"]),Ig=Object.freeze(["none","github-htt\
|
|
506
|
+
ps","github-token"]),xs=Object.freeze(["assistant","browser","control","job","preview","service","terminal"]),Ns=Object.
|
|
507
|
+
freeze(["finite","interactive","service"]),Cg=1e3*1e3*100;function V(e="",t="vibe64_command_request_invalid"){let o=new Error(e||"Invalid Vibe64 command request.");return o.code=
|
|
505
508
|
t,o}function fo(e="",t=[],o="",r="value"){let n=w(e)||o;if(!t.includes(n))throw V(`Unsupported Vibe64 command ${r}: ${n||
|
|
506
|
-
"(empty)"}.`,`vibe64_command_${r}_unsupported`);return n}function
|
|
509
|
+
"(empty)"}.`,`vibe64_command_${r}_unsupported`);return n}function js(e="capture"){return e==="detached"?"service":e==="pty"?"interactive":"finite"}function ks({mode:e="capture",
|
|
507
510
|
purpose:t="terminal"}={}){return t==="preview"?"preview":e==="pty"?"terminal":"job"}function z(e=""){let t=w(e);if(!t)return"";
|
|
508
511
|
if(!/^[A-Za-z0-9](?:[A-Za-z0-9._:-]{0,254}[A-Za-z0-9])?$/u.test(t))throw V(`Invalid Vibe64 execution identifier: ${t}.`,
|
|
509
|
-
"vibe64_execution_identifier_invalid");return t}function
|
|
510
|
-
inal",session:i={}}=t,s=Z(e),a=fo(s.kind,
|
|
512
|
+
"vibe64_execution_identifier_invalid");return t}function $s(e={},t={}){let{mode:o="capture",project:r={},purpose:n="term\
|
|
513
|
+
inal",session:i={}}=t,s=Z(e),a=fo(s.kind,xs,ks({mode:o,purpose:n}),"execution_kind"),c=fo(s.lifecycle,Ns,js(o),"executio\
|
|
511
514
|
n_lifecycle");if(o==="detached"&&c!=="service"||o==="pty"&&c!=="interactive"||o==="capture"&&c!=="finite")throw V(`Execu\
|
|
512
515
|
tion lifecycle ${c} is incompatible with command mode ${o}.`,"vibe64_execution_lifecycle_incompatible");let u=z(s.ownerId||
|
|
513
516
|
i.sessionId);if(c==="service"&&!u)throw V("Service execution requires a durable owner id.","vibe64_execution_owner_requi\
|
|
@@ -515,13 +518,13 @@ red");let l=s.resourceProfile;if(l!=null&&(!l||typeof l!="object"||Object.keys(l
|
|
|
515
518
|
vironment"].includes(d))||!/^[a-z0-9][a-z0-9_-]{0,127}$/u.test(l.key||"")||!/^[a-f0-9]{64}$/u.test(l.compatibilityKey||"")||
|
|
516
519
|
!["development","test","production"].includes(l.environment)))throw V("Invalid activity resource profile identity.","vib\
|
|
517
520
|
e64_resource_profile_invalid");return Object.freeze({...l?{resourceProfile:Object.freeze({...l})}:{},controlGenerationId:z(
|
|
518
|
-
s.controlGenerationId),...s.workflowId===void 0||s.workflowId===null||s.workflowId===""?{}:{workflowId
|
|
519
|
-
id:
|
|
520
|
-
projectSlug:z(s.projectSlug||r.slug||r.projectSlug),sessionId:z(s.sessionId||i.sessionId)})}function
|
|
521
|
+
s.controlGenerationId),...s.workflowId===void 0||s.workflowId===null||s.workflowId===""?{}:{workflowId:Ms(s.workflowId)},
|
|
522
|
+
id:Cs(),kind:a,label:w(s.label),lifecycle:c,operationId:z(s.operationId),ownerId:u,parentExecutionId:z(s.parentExecutionId),
|
|
523
|
+
projectSlug:z(s.projectSlug||r.slug||r.projectSlug),sessionId:z(s.sessionId||i.sessionId)})}function Ms(e){if(typeof e!=
|
|
521
524
|
"string"||!/^[a-f0-9]{8}-[a-f0-9]{4}-[1-8][a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$/iu.test(e))throw V("Execution requ\
|
|
522
|
-
ires a valid managed workflow id.","vibe64_workflow_id_invalid");return e.toLowerCase()}var
|
|
523
|
-
|
|
524
|
-
https://github.com/mobily-enterprises/vibe64/blob/main/docs/colleague-usage/set-up-macos.md"}),
|
|
525
|
+
ires a valid managed workflow id.","vibe64_workflow_id_invalid");return e.toLowerCase()}var xg=Object.freeze({normalizeExecutionDescriptor:$s});var Gg=new URL("./../node_modules/@local/vibe64-execution/src/server/usageRecordingPreload.js",import.meta.url).href;import{fileURLToPath as Gs}from"node:url";var Fs=new URL("./../node_modules/@local/vibe64-execution/src/server/gitTurnCheckpoint.js",import.meta.url).href;var gw=Gs(new URL("./gitTurnCheckpointCommand.js",Fs)),ww=15*6e4,_w=512*1024*1024,yw=1024*1024*1024;var Sw=Object.freeze(["LANG","LC_ALL","NO_PROXY","PATH","SSL_CERT_DIR","SSL_CERT_FILE","TZ"]);import{existsSync as zs}from"node:fs";import Ne from"node:path";import ho from"node:process";var go="You'll be asked for your computer password. Nothing shows while you type.",Vs="curl -fsSL https://mise.run | sh",
|
|
526
|
+
Iw=Object.freeze({linux:"https://github.com/mobily-enterprises/vibe64/blob/main/docs/colleague-usage/set-up-linux.md",darwin:"\
|
|
527
|
+
https://github.com/mobily-enterprises/vibe64/blob/main/docs/colleague-usage/set-up-macos.md"}),je=Object.freeze({claude:{
|
|
525
528
|
name:"Claude Code",run:[["claude"]],guideUrl:"https://code.claude.com/docs/en/setup",any:"curl -fsSL https://claude.ai/i\
|
|
526
529
|
nstall.sh | bash"},codex:{name:"Codex",run:[["codex"]],guideUrl:"https://github.com/openai/codex",any:"curl -fsSL https:\
|
|
527
530
|
//chatgpt.com/codex/install.sh | sh"},opencode:{name:"opencode",run:[["opencode"]],guideUrl:"https://opencode.ai/docs/",
|
|
@@ -545,23 +548,23 @@ rl -fsSL https://php.new/install/linux)"',brew:'/bin/bash -c "$(curl -fsSL https
|
|
|
545
548
|
ild tools",setup:"build-tools",run:[["cc","gcc","clang"],["make"]],guideUrl:"https://guides.rubyonrails.org/install_ruby\
|
|
546
549
|
_on_rails.html",detail:"Some packages compile native code, so they need a compiler and a few libraries.",apt:"sudo apt i\
|
|
547
550
|
nstall build-essential pkg-config libyaml-dev libssl-dev zlib1g-dev libpq-dev default-libmysqlclient-dev libgmp-dev",brew:"\
|
|
548
|
-
brew install pkg-config libyaml openssl@3 gmp"}}),
|
|
549
|
-
trim();return
|
|
550
|
-
return[...String(e.PATH||"").split(
|
|
551
|
-
o,"apt-get")))}function
|
|
552
|
-
o)})}function
|
|
551
|
+
brew install pkg-config libyaml openssl@3 gmp"}}),Hs=Object.freeze({composer:"php"});function Nt(e=""){let t=String(e||"").
|
|
552
|
+
trim();return Hs[t]||t}function wo({platform:e=ho.platform,aptGet:t=!1}={}){return e==="darwin"?"brew":t?"apt":""}function Ws(e,t=xt){
|
|
553
|
+
return[...String(e.PATH||"").split(Ne.delimiter),...String(t||"").split(Ne.delimiter)].some(o=>Ne.isAbsolute(o)&&zs(Ne.join(
|
|
554
|
+
o,"apt-get")))}function ke({env:e,platform:t=ho.platform,systemPath:o}){return wo({platform:t,aptGet:t!=="darwin"&&Ws(e,
|
|
555
|
+
o)})}function $e(e="",t={}){let{family:o="",mise:r=!1,xcode:n=!0}=t,i=je[Nt(e)];if(!i)return null;if(o==="brew"&&!n&&["g\
|
|
553
556
|
it","cpp"].includes(Nt(e)))return{command:"xcode-select --install",sudo:!1,note:""};let s=i.any||i[o]||"";if(!s&&i.mise&&
|
|
554
|
-
(s=r?`mise use -g ${i.mise}`:`${
|
|
555
|
-
o==="apt"&&s.includes("--with-deps");return{command:s,sudo:a,note:a?go:""}}var
|
|
556
|
-
function
|
|
557
|
-
`)}function
|
|
557
|
+
(s=r?`mise use -g ${i.mise}`:`${Vs} && ~/.local/bin/mise use -g ${i.mise}`),!s)return null;let a=s.startsWith("sudo ")||
|
|
558
|
+
o==="apt"&&s.includes("--with-deps");return{command:s,sudo:a,note:a?go:""}}var Cw=Object.freeze({SUDO_NOTE:go,localToolFamily:wo});function _o({env:e,platform:t,systemPath:o}){return $e("git",{family:ke({env:e,platform:t,systemPath:o})})?.command||""}
|
|
559
|
+
function qs(e={}){return[e.error,e.stderr,e.output].filter(Boolean).join(`
|
|
560
|
+
`)}function Ys(e,t){let o=qs(e);if(/spawn(?:Sync)? git ENOENT|(?:^|\s)git: (?:command )?not found/mu.test(o)){let r=_o(t);
|
|
558
561
|
return{code:"vibe64_git_missing",installCommand:r,message:r?`Git isn't installed on this computer. Install it with: ${r}`:
|
|
559
562
|
"Git isn't installed on this computer. Install Git, then try again."}}return/unknown option [`']initial-branch/u.test(o)?
|
|
560
|
-
{code:"vibe64_git_too_old",installCommand:
|
|
563
|
+
{code:"vibe64_git_too_old",installCommand:_o(t),message:"This Git is too old for Vibe64. Update Git to version 2.28 or n\
|
|
561
564
|
ewer, then try again."}:/gpg failed to sign|failed to sign the data|signing failed|couldn't (?:load|find) (?:public )?key|incorrect passphrase/iu.
|
|
562
565
|
test(o)?{code:"vibe64_git_signing_failed",installCommand:"",message:"Your Git is set to sign every commit, and signing d\
|
|
563
566
|
idn't work here. Vibe64 can't type a key passphrase for you. Make one signed commit in a terminal to check your key work\
|
|
564
|
-
s and is unlocked, then try again."}:null}var
|
|
567
|
+
s and is unlocked, then try again."}:null}var jw=Object.freeze({describeGitFailure:Ys});function ie(e){let t=String(e);return/^[A-Za-z0-9_./:=@,+-]+$/u.test(t)?t:`'${t.replaceAll("'","'\\''")}'`}import yo from"node:path";var bo="backups.git",Eo="vibe64-atomic",Js=`backup_canonical_ref() {
|
|
565
568
|
vibe64_backup_repository="$1"
|
|
566
569
|
vibe64_source_repository="$2"
|
|
567
570
|
vibe64_source_ref="$3"
|
|
@@ -579,7 +582,7 @@ r "$vibe64_backup_repository" rev-parse --verify "$vibe64_backup_ref"
|
|
|
579
582
|
' "$vibe64_source_ref" >&2
|
|
580
583
|
return 1
|
|
581
584
|
fi
|
|
582
|
-
}`,
|
|
585
|
+
}`,Dw=`#!/bin/sh
|
|
583
586
|
set -eu
|
|
584
587
|
|
|
585
588
|
zero_object=0000000000000000000000000000000000000000
|
|
@@ -605,7 +608,7 @@ if [ "$(git --git-dir "$backup_repository" rev-parse --is-bare-repository 2>/dev
|
|
|
605
608
|
exit 1
|
|
606
609
|
fi
|
|
607
610
|
|
|
608
|
-
${
|
|
611
|
+
${Js}
|
|
609
612
|
|
|
610
613
|
updates_file="$(mktemp "$repository_root/.pre-receive.XXXXXX")"
|
|
611
614
|
cleanup_updates_file() {
|
|
@@ -653,8 +656,8 @@ while read -r old_object _new_object ref_name; do
|
|
|
653
656
|
backup_canonical_ref "$backup_repository" "$git_dir" "$ref_name" "$old_object" "$backup_ref"
|
|
654
657
|
fi
|
|
655
658
|
done <"$updates_file"
|
|
656
|
-
`;function
|
|
657
|
-
url).href;var
|
|
659
|
+
`;function Ks(e=""){return e?yo.join(yo.dirname(e),bo):""}var Uw=Object.freeze({CANONICAL_REPOSITORY_PUSH_OPTION:Eo,canonicalRepositoryBackupPath:Ks});var Kw=new URL("./../node_modules/@local/vibe64-execution/src/server/runtime/agentPreviewBrowserWorkerSource.js",import.meta.
|
|
660
|
+
url).href;var Zs=["Usage:"," vibe64-helper preview ensure [--target <target-id>] [--wait] [--json] [--timeout-ms <ms>]"," vibe64\
|
|
658
661
|
-helper preview targets [--json]"," vibe64-helper preview status [--json]"," vibe64-helper preview stop [--json]"," v\
|
|
659
662
|
ibe64-helper preview open <path> [--json]"," vibe64-helper preview inspect-url"," vibe64-helper preview screenshot [--\
|
|
660
663
|
output <path>]"," vibe64-helper preview browser ensure"," vibe64-helper preview browser eval < playwright-code.js"," \
|
|
@@ -697,37 +700,37 @@ server for the configured primary application.","Do not start a duplicate copy o
|
|
|
697
700
|
distinct secondary application explicitly requested by the user, such as a reference app, may run separately without rep\
|
|
698
701
|
lacing this preview."].join(`
|
|
699
702
|
`)+`
|
|
700
|
-
`;import{fileURLToPath as
|
|
701
|
-
new URL("./engines/stdioBridge.js",
|
|
703
|
+
`;import{fileURLToPath as oa}from"node:url";var ra=new URL("./../node_modules/@local/vibe64-execution/src/server/conversationExecution.js",import.meta.url).href,a_=oa(
|
|
704
|
+
new URL("./engines/stdioBridge.js",ra));var m_=["skip=$1; version=$2; shift 2",'for name in "$@"; do',' found=$(command -v -- "$name" 2>/dev/null) || continue',
|
|
702
705
|
" case $found in /*) ;; *) continue ;; esac",' if [ -n "$skip" ]; then case $found in /usr/bin/*) continue ;; esac; fi',
|
|
703
706
|
` printf '%s\\n' "$found"`,' exec "$found" $version 2>&1',"done","exit 127"].join(`
|
|
704
|
-
`);var
|
|
705
|
-
e,Object.freeze({name:t,guideUrl:o,install:r})]})));import{execFile as
|
|
706
|
-
resolve(String(e||""));try{return t(o)}catch{return o}}function Ao({entrypointPath:e,argv:t=
|
|
707
|
-
return r?Ro(r,o)===Ro(e,o):!1}var Mt="__local__",Lt="VIBE64_RUNTIME_NAMESPACE";var Io="local";var
|
|
707
|
+
`);var na=Object.freeze(Object.fromEntries(["claude","codex","opencode"].map(e=>{let{name:t,guideUrl:o,any:r}=je[e];return[
|
|
708
|
+
e,Object.freeze({name:t,guideUrl:o,install:r})]})));import{execFile as ia}from"node:child_process";import{promisify as sa}from"node:util";var b_=sa(ia);import So from"node:path";var ca="runtime",ua="open.json";function la(e=""){let t=L(e);return t?So.join(So.resolve(t),ca,ua):""}var _b=Object.freeze({projectRuntimeOpenStatePath:la});function $t(e=""){return String(e||"").trim().toLowerCase().replace(/[^a-z0-9_-]+/gu,"-").replace(/^-+|-+$/gu,"")}import{startServer as ja}from"../server.bundle.mjs";import{realpathSync as Pa}from"node:fs";import Ra from"node:path";import Aa from"node:process";function Ro(e,t){let o=Ra.
|
|
709
|
+
resolve(String(e||""));try{return t(o)}catch{return o}}function Ao({entrypointPath:e,argv:t=Aa.argv,realpath:o=Pa}){let r=t[1];
|
|
710
|
+
return r?Ro(r,o)===Ro(e,o):!1}var Mt="__local__",Lt="VIBE64_RUNTIME_NAMESPACE";var Io="local";var Ia=new URL("./server.js",import.meta.url).href,ka=Na(Ia),$a=3001,xo=new Map([["--open",!0],["--open=true",!0],["--op\
|
|
708
711
|
en=1",!0],["--no-open",!1],["--open=false",!1],["--open=0",!1]]);function No(e,t){return e.some(o=>xo.get(String(o||"").
|
|
709
|
-
trim().toLowerCase())===t)}function
|
|
710
|
-
function
|
|
711
|
-
rted Vibe64 startup argument: ${String(e||"").trim()}`);return t.code="vibe64_invalid_startup_argument",t}function
|
|
712
|
-
let r=String(e[t+1]||"").trim();if(!r)throw se(o);return r}function Ba(e=
|
|
713
|
-
length;r+=1){let n=String(e[r]||"").trim();if(!n)continue;let i=n.toLowerCase();if(!xo.has(i)){if(i==="--project"){let s=
|
|
714
|
-
e,r,n);if(t||o)throw se(s);o=ae.resolve(s),t
|
|
715
|
-
if(!s||t||o)throw se(n);o=ae.resolve(s),t
|
|
716
|
-
return!t&&!o&&(o=
|
|
717
|
-
2),{targetRoot:t=""}={}){return
|
|
718
|
-
e)))||"local-project"}async function
|
|
719
|
-
e)}catch(t){console.warn(`Could not open browser automatically: ${t.message}`)}}}function
|
|
712
|
+
trim().toLowerCase())===t)}function Ma(e=_.argv.slice(2)){return No(e,!0)}function La(e=_.argv.slice(2)){return No(e,!1)}
|
|
713
|
+
function Da({entrypointPath:e=ka,...t}={}){return Ao({entrypointPath:e,...t})}function se(e=""){let t=new Error(`Unsuppo\
|
|
714
|
+
rted Vibe64 startup argument: ${String(e||"").trim()}`);return t.code="vibe64_invalid_startup_argument",t}function Ua(e,t,o){
|
|
715
|
+
let r=String(e[t+1]||"").trim();if(!r)throw se(o);return r}function Ba(e=_.argv.slice(2)){let t="",o="";for(let r=0;r<e.
|
|
716
|
+
length;r+=1){let n=String(e[r]||"").trim();if(!n)continue;let i=n.toLowerCase();if(!xo.has(i)){if(i==="--project"){let s=Ua(
|
|
717
|
+
e,r,n);if(t||o)throw se(s);o=ae.resolve(s),t=Me(o),r+=1;continue}if(i.startsWith("--project=")){let s=n.slice(10).trim();
|
|
718
|
+
if(!s||t||o)throw se(n);o=ae.resolve(s),t=Me(o);continue}if(n.startsWith("-")||t||o)throw se(n);o=ae.resolve(n),t=Me(o)}}
|
|
719
|
+
return!t&&!o&&(o=_.cwd(),t=Me(o)),{openOnStart:Fa(e,{targetRoot:o}),startupSlug:t,targetRoot:o}}function Fa(e=_.argv.slice(
|
|
720
|
+
2),{targetRoot:t=""}={}){return La(e)?!1:Ma(e)?!0:!!String(t||"").trim()}function Me(e=""){return $t(ae.basename(ae.resolve(
|
|
721
|
+
e)))||"local-project"}async function Ga(e){try{await tt(e,{app:{name:P.browser,arguments:["--new-window"]}})}catch{try{await tt(
|
|
722
|
+
e)}catch(t){console.warn(`Could not open browser automatically: ${t.message}`)}}}function za({env:e=_.env,openOnStart:t=!1,
|
|
720
723
|
startupSlug:o="",targetRoot:r=""}={}){let n=!!String(e.PORT||"").trim();return{browserLifecycleShutdown:!0,port:t===!0&&
|
|
721
|
-
!n
|
|
722
|
-
trim();return t||(e[Lt]=Mt,Mt)}function
|
|
723
|
-
"darwin"||String(e[Rt]||"").trim())return"";let n=
|
|
724
|
+
!n?$a:void 0,runtimeMode:Io,strictPort:n,startupSlug:o,targetRoot:r}}function Va({env:e=_.env}={}){let t=String(e[Lt]||"").
|
|
725
|
+
trim();return t||(e[Lt]=Mt,Mt)}function Ha({env:e=_.env,exists:t=Ca,home:o=Co.homedir(),platform:r=_.platform}={}){if(r!==
|
|
726
|
+
"darwin"||String(e[Rt]||"").trim())return"";let n=Re({env:e,home:o,platform:"darwin"}),i=Re({env:e,home:o,platform:"linu\
|
|
724
727
|
x"});return t(n)||!t(i)?"":[`Vibe64 now keeps its data in ${n}.`,"Move your existing data there, then start Vibe64 again\
|
|
725
728
|
:",` mv ${ie(i)} ${ie(n)}`].join(`
|
|
726
|
-
`)}async function
|
|
727
|
-
trim())return"";let n=
|
|
728
|
-
if(e){console.error(e),
|
|
729
|
-
|
|
729
|
+
`)}async function Wa({env:e=_.env,home:t=Co.homedir(),makeDirectory:o=xa,platform:r=_.platform}={}){if(String(e[Rt]||"").
|
|
730
|
+
trim())return"";let n=Re({env:e,home:t,platform:r});return await o(n,{recursive:!0,mode:448}),n}async function qa(){let e=Ha();
|
|
731
|
+
if(e){console.error(e),_.exitCode=1;return}let{openOnStart:t,startupSlug:o,targetRoot:r}=Ba();Va(),await Wa();let n=await ja(
|
|
732
|
+
za({openOnStart:t,startupSlug:o,targetRoot:r})),i=n.vibe64Url;if(i){console.log(`Vibe64 is running at ${i}`),t&&await Ga(
|
|
730
733
|
i);return}n.vibe64Listen?.transport==="socket"&&(console.log(`Vibe64 is listening on Unix socket ${n.vibe64Listen.socketPath}`),
|
|
731
|
-
t&&console.warn("Cannot open a browser for a Unix socket listener. Set VIBE64_PUBLIC_ORIGIN or PORT."))}
|
|
732
|
-
e=>{console.error("Failed to start Vibe64 server:",e),
|
|
733
|
-
|
|
734
|
+
t&&console.warn("Cannot open a browser for a Unix socket listener. Set VIBE64_PUBLIC_ORIGIN or PORT."))}Da()&&qa().catch(
|
|
735
|
+
e=>{console.error("Failed to start Vibe64 server:",e),_.exitCode=1});export{Va as applyLocalCliRuntimeNamespace,Da as isDirectServerExecution,Ha as macosDataMoveMessage,Ba as parseStartupArgs,
|
|
736
|
+
Wa as prepareLocalSystemRoot,za as serverStartOptions,Ma as shouldOpenBrowser};
|