wiki-viewer 2.16.0 → 2.17.0
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/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-path-routes-manifest.json +3 -0
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/required-server-files.json +1 -1
- package/.next/standalone/.next/routes-manifest.json +23 -0
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/agent/activity/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/events/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/files/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/fs/file/[...path]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/agent/fs/file/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/fs/ls/[[...path]]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/fs/move/route.js +1 -1
- package/.next/standalone/.next/server/app/api/agent/fs/move/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/fs/search/route.js +1 -1
- package/.next/standalone/.next/server/app/api/agent/fs/search/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/settings/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/sidecar/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/app-proxy/[...path]/route.js +11 -9
- package/.next/standalone/.next/server/app/api/app-proxy/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/assets/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/pdf/save/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/share/[token]/asset/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/share/[token]/route.js +4 -3
- package/.next/standalone/.next/server/app/api/share/[token]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/share/route.js +1 -1
- package/.next/standalone/.next/server/app/api/share/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/browse/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/reveal/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/workspaces/[id]/branch/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/workspaces/[id]/open/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/workspaces/[id]/refresh/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/workspaces/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/workspaces/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/upload/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/app/route.js +8 -6
- package/.next/standalone/.next/server/app/api/wiki/app/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/backlinks/route.js +1 -1
- package/.next/standalone/.next/server/app/api/wiki/backlinks/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/content/route.js +1 -1
- package/.next/standalone/.next/server/app/api/wiki/content/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/download/route.js +1 -1
- package/.next/standalone/.next/server/app/api/wiki/download/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/folder/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/git-branches/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/git-checkout/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/git-diff/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/git-file-info/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/git-history/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/git-pull/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/hosted-apps/[slug]/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/wiki/hosted-apps/[slug]/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/api/wiki/hosted-apps/[slug]/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/wiki/hosted-apps/[slug]/route.js +17 -0
- package/.next/standalone/.next/server/app/api/wiki/hosted-apps/[slug]/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/wiki/hosted-apps/[slug]/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/wiki/hosted-apps/[slug]/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/wiki/hosted-apps/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/wiki/hosted-apps/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/api/wiki/hosted-apps/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/wiki/hosted-apps/route.js +18 -0
- package/.next/standalone/.next/server/app/api/wiki/hosted-apps/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/wiki/hosted-apps/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/wiki/hosted-apps/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/wiki/move/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/new-file/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/outlinks/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/page/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/presence/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/scratch/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/search/route.js +1 -1
- package/.next/standalone/.next/server/app/api/wiki/search/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/slugs/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/upload/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/watch/route.js +8 -7
- package/.next/standalone/.next/server/app/api/wiki/watch/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/app/[slug]/[[...rest]]/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/app/[slug]/[[...rest]]/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/app/[slug]/[[...rest]]/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/app/[slug]/[[...rest]]/route.js +18 -0
- package/.next/standalone/.next/server/app/app/[slug]/[[...rest]]/route.js.map +5 -0
- package/.next/standalone/.next/server/app/app/[slug]/[[...rest]]/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/app/[slug]/[[...rest]]/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/page/react-loadable-manifest.json +3 -4
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/s/[token]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/s/[token]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/signin/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/chunks/0.u4_next_dist_esm_build_templates_app-route_0kj1.1o.js +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__09vw_yd._.js +4 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ah~dki._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__092dqjh._.js → [root-of-the-server]__0b7h2ot._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__02fa11p._.js → [root-of-the-server]__0bzyv11._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0sylq_1._.js → [root-of-the-server]__0ian9~8._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__112h-ck._.js → [root-of-the-server]__0jsp839._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0bfh5vs._.js → [root-of-the-server]__0khd8u0._.js} +20 -20
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ltsov-._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0pftyle._.js +4 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__03q4s.e._.js → [root-of-the-server]__0pru66p._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0qicj__._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0qwikxp._.js +4 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0_beprj._.js → [root-of-the-server]__0tl7-s6._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__028nij-._.js → [root-of-the-server]__0veby1x._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0yqf3ec._.js +4 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0~q~4xc._.js +4 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0_tk-41._.js → [root-of-the-server]__101dr96._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0c2x-~s._.js → [root-of-the-server]__10i6erq._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__11ltgmp._.js +20 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_wiki_hosted-apps_[slug]_route_actions_11v9hxc.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_wiki_hosted-apps_route_actions_0v234uk.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_app_[slug]_[[___rest]]_route_actions_0w2a.9t.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{0~w0_katex_dist_katex_mjs_0xzjko-._.js → 0~w0_katex_dist_katex_mjs_0xy09r4._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0tzc7v8._.js → [root-of-the-server]__0hs37r-._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0_0pyx2._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0k6g8yo._.js +18 -18
- package/.next/standalone/.next/server/chunks/ssr/_0q~d8b~._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0sr4wj.._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0bu2dgl._.js → node_modules__pnpm_0.0y8dg._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0a5sxi_._.js → node_modules__pnpm_03rdaxh._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0hzuxm7._.js → node_modules__pnpm_042hoyi._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0fhf5x4._.js → node_modules__pnpm_04nkgqx._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_060xsml._.js → node_modules__pnpm_07z6xgj._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_00~a731._.js → node_modules__pnpm_0883dhq._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_00~jzwc._.js → node_modules__pnpm_08qpul6._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0pe1~kx._.js → node_modules__pnpm_09g45.a._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0qix0pb._.js → node_modules__pnpm_09nd60w._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0kcg69-._.js → node_modules__pnpm_0_dnupf._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0~s_k7m._.js → node_modules__pnpm_0asm~29._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0l7d83j._.js → node_modules__pnpm_0cgmua_._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0~ej02a._.js → node_modules__pnpm_0e09a-z._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_09al-ho._.js → node_modules__pnpm_0fby.xx._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_001.y5w._.js → node_modules__pnpm_0hn06p6._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_11jj9fz._.js → node_modules__pnpm_0izpuu-._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0_q.~_7._.js → node_modules__pnpm_0k3~.84._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0gn2-4t._.js → node_modules__pnpm_0o~aj4l._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0y.f9wx._.js → node_modules__pnpm_0r.hmrh._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_00vy.j_._.js → node_modules__pnpm_0sa2k.e._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0jf-4l.._.js → node_modules__pnpm_0sq.-3j._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0z-f4u~._.js → node_modules__pnpm_0sz5dcp._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0z5~pmj._.js → node_modules__pnpm_0x-5nk_._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0ov77qd._.js → node_modules__pnpm_10f188s._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0ekyo6p._.js → node_modules__pnpm_12sg_v9._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0-n2gwk._.js → node_modules__pnpm_133r6o8._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_016a47p._.js → node_modules__pnpm_13hc3_.._.js} +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/static/chunks/02d_ok-cqd.4a.js +1 -0
- package/.next/standalone/.next/static/chunks/{0tjcc1wg-57l1.js → 065s1_n.1k11t.js} +1 -1
- package/.next/standalone/.next/static/chunks/09r.txqh5meou.js +1 -0
- package/.next/standalone/.next/static/chunks/{0y~5s_skz1l9a.js → 0ccw-uc_3ao.w.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0ii.akeq7k4pf.js → 0f8kfd9d6kq0b.js} +1 -1
- package/.next/standalone/.next/static/chunks/0k-oaty6nz49y.js +1 -0
- package/.next/standalone/.next/static/chunks/0lsw6lsaj7lby.js +1 -0
- package/.next/standalone/.next/static/chunks/0n~dazst~sc7s.js +12 -0
- package/.next/standalone/.next/static/chunks/0v32snen~_e9n.css +1 -0
- package/.next/standalone/.next/static/chunks/{0enm-3xy21jcx.js → 17bpqqaflajl~.js} +24 -24
- package/.next/standalone/.next/static/chunks/17rekydn5fgy4.js +12 -0
- package/.next/standalone/.test-floor +1 -1
- package/.next/standalone/isometric-codebase-map.html +4 -1
- package/.next/standalone/isometric-codebase-map.json +4 -1
- package/.next/standalone/package.json +1 -1
- package/.next/standalone/server.js +1 -1
- package/package.json +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__05qoy-2._.js +0 -20
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0h.0l-2._.js +0 -4
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ou7hai._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__12x8v2r._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/_01eqklo._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0858xdh._.js +0 -3
- package/.next/standalone/.next/static/chunks/02t77azzz-jp-.js +0 -1
- package/.next/standalone/.next/static/chunks/04jvwlttwa_sw.js +0 -12
- package/.next/standalone/.next/static/chunks/0_j_xobbe4f4t.css +0 -1
- package/.next/standalone/.next/static/chunks/0d_~.9eee~ebo.js +0 -1
- package/.next/standalone/.next/static/chunks/161kgz.8h.3iq.js +0 -1
- package/.next/standalone/.next/static/chunks/16kzqur8~yg6b.js +0 -12
- /package/.next/standalone/.next/static/{7EbGXTo8ObPhr7UobKARQ → KRKPuzz8vrMWZ0HNKmF4W}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{7EbGXTo8ObPhr7UobKARQ → KRKPuzz8vrMWZ0HNKmF4W}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{7EbGXTo8ObPhr7UobKARQ → KRKPuzz8vrMWZ0HNKmF4W}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,294598,e=>{"use strict";var t=Object.defineProperty,o=e.z;e.s(["a",0,o,"b",0,e=>t=>{var o=e[t];if(o)return o();throw Error("Module not found in bundle: "+t)},"c",0,(e,o)=>{for(var a in o)t(e,a,{get:o[a],enumerable:!0})},"d",0,(e,o,a)=>{let r;return(r="symbol"!=typeof o?o+"":o)in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[r]=a,a}])},139825,e=>{"use strict";e.s(["a",0,100,"b",0,36,"c",0,{"ar-SA":94,"az-AZ":17,"bg-BG":71,"bn-BD":52,"ca-ES":83,"cs-CZ":86,"da-DK":61,"de-DE":100,"el-GR":80,en:100,"es-ES":96,"eu-ES":97,"fa-IR":84,"fi-FI":76,"fr-FR":99,"gl-ES":86,"he-IL":77,"hi-IN":76,"hu-HU":76,"id-ID":91,"it-IT":98,"ja-JP":90,kaa:36,"kab-KAB":76,"kk-KZ":18,"km-KH":83,"ko-KR":100,"ku-TR":87,"lt-LT":48,"lv-LV":77,"mr-IN":98,"my-MM":35,"nb-NO":93,"nl-NL":75,"nn-NO":67,"oc-FR":92,"pa-IN":78,"pl-PL":99,"pt-BR":91,"pt-PT":83,"ro-RO":99,"ru-RU":92,"si-LK":7,"sk-SK":100,"sl-SI":100,"sv-SE":100,"ta-IN":81,"th-TH":44,"tr-TR":87,"uk-UA":93,"vi-VN":49,"zh-CN":100,"zh-HK":22,"zh-TW":100}])},238533,e=>{"use strict";var t={paste:"Paste",pasteAsPlaintext:"Paste as plaintext",pasteCharts:"Paste charts",selectAll:"Select all",multiSelect:"Add element to selection",moveCanvas:"Move canvas",cut:"Cut",copy:"Copy",copyAsPng:"Copy to clipboard as PNG",copyAsSvg:"Copy to clipboard as SVG",copyText:"Copy to clipboard as text",copySource:"Copy source to clipboard",convertToCode:"Convert to code",bringForward:"Bring forward",sendToBack:"Send to back",bringToFront:"Bring to front",sendBackward:"Send backward",delete:"Delete",copyStyles:"Copy styles",pasteStyles:"Paste styles",stroke:"Stroke",changeStroke:"Change stroke color",background:"Background",changeBackground:"Change background color",fill:"Fill",strokeWidth:"Stroke width",strokeStyle:"Stroke style",strokeStyle_solid:"Solid",strokeStyle_dashed:"Dashed",strokeStyle_dotted:"Dotted",sloppiness:"Sloppiness",opacity:"Opacity",textAlign:"Text align",edges:"Edges",sharp:"Sharp",round:"Round",arrowheads:"Arrowheads",arrowhead_none:"None",arrowhead_arrow:"Arrow",arrowhead_bar:"Bar",arrowhead_circle:"Circle",arrowhead_circle_outline:"Circle (outline)",arrowhead_triangle:"Triangle",arrowhead_triangle_outline:"Triangle (outline)",arrowhead_diamond:"Diamond",arrowhead_diamond_outline:"Diamond (outline)",arrowhead_crowfoot_many:"Crow's foot (many)",arrowhead_crowfoot_one:"Crow's foot (one)",arrowhead_crowfoot_one_or_many:"Crow's foot (one or many)",more_options:"More options",arrowtypes:"Arrow type",arrowtype_sharp:"Sharp arrow",arrowtype_round:"Curved arrow",arrowtype_elbowed:"Elbow arrow",fontSize:"Font size",fontFamily:"Font family",addWatermark:'Add "Made with Excalidraw"',handDrawn:"Hand-drawn",normal:"Normal",code:"Code",small:"Small",medium:"Medium",large:"Large",veryLarge:"Very large",solid:"Solid",hachure:"Hachure",zigzag:"Zigzag",crossHatch:"Cross-hatch",thin:"Thin",bold:"Bold",left:"Left",center:"Center",right:"Right",extraBold:"Extra bold",architect:"Architect",artist:"Artist",cartoonist:"Cartoonist",fileTitle:"File name",colorPicker:"Color picker",canvasColors:"Used on canvas",canvasBackground:"Canvas background",drawingCanvas:"Drawing canvas",clearCanvas:"Clear canvas",layers:"Layers",actions:"Actions",language:"Language",liveCollaboration:"Live collaboration...",duplicateSelection:"Duplicate",untitled:"Untitled",name:"Name",yourName:"Your name",madeWithExcalidraw:"Made with Excalidraw",group:"Group selection",ungroup:"Ungroup selection",collaborators:"Collaborators",toggleGrid:"Toggle grid",addToLibrary:"Add to library",removeFromLibrary:"Remove from library",libraryLoadingMessage:"Loading library…",libraries:"Browse libraries",loadingScene:"Loading scene…",loadScene:"Load scene from file",align:"Align",alignTop:"Align top",alignBottom:"Align bottom",alignLeft:"Align left",alignRight:"Align right",centerVertically:"Center vertically",centerHorizontally:"Center horizontally",distributeHorizontally:"Distribute horizontally",distributeVertically:"Distribute vertically",flipHorizontal:"Flip horizontal",flipVertical:"Flip vertical",viewMode:"View mode",share:"Share",showStroke:"Show stroke color picker",showBackground:"Show background color picker",showFonts:"Show font picker",toggleTheme:"Toggle light/dark theme",theme:"Theme",personalLib:"Personal Library",excalidrawLib:"Excalidraw Library",decreaseFontSize:"Decrease font size",increaseFontSize:"Increase font size",unbindText:"Unbind text",bindText:"Bind text to the container",createContainerFromText:"Wrap text in a container",link:{edit:"Edit link",editEmbed:"Edit embeddable link",create:"Add link",label:"Link",labelEmbed:"Link & embed",empty:"No link is set",hint:"Type or paste your link here",goToElement:"Go to target element"},lineEditor:{edit:"Edit line",editArrow:"Edit arrow"},elementLock:{lock:"Lock",unlock:"Unlock",lockAll:"Lock all",unlockAll:"Unlock all"},statusPublished:"Published",sidebarLock:"Keep sidebar open",selectAllElementsInFrame:"Select all elements in frame",removeAllElementsFromFrame:"Remove all elements from frame",eyeDropper:"Pick color from canvas",textToDiagram:"Text to diagram",prompt:"Prompt",followUs:"Follow us",discordChat:"Discord chat",zoomToFitViewport:"Zoom to fit in viewport",zoomToFitSelection:"Zoom to fit selection",zoomToFit:"Zoom to fit all elements",installPWA:"Install Excalidraw locally (PWA)",autoResize:"Enable text auto-resizing",imageCropping:"Image cropping",unCroppedDimension:"Uncropped dimension",copyElementLink:"Copy link to object",linkToElement:"Link to object",wrapSelectionInFrame:"Wrap selection in frame"},o={title:"Link to object",desc:"Click on a shape on canvas or paste a link.",notFound:"Linked object wasn't found on canvas."},a={noItems:"No items added yet...",hint_emptyLibrary:"Select an item on canvas to add it here, or install a library from the public repository, below.",hint_emptyPrivateLibrary:"Select an item on canvas to add it here."},r={title:"Find on canvas",noMatch:"No matches found...",singleResult:"result",multipleResults:"results",placeholder:"Find text on canvas..."},i={clearReset:"Reset the canvas",exportJSON:"Export to file",exportImage:"Export image...",export:"Save to...",copyToClipboard:"Copy to clipboard",copyLink:"Copy link",save:"Save to current file",saveAs:"Save as",load:"Open",getShareableLink:"Get shareable link",close:"Close",selectLanguage:"Select language",scrollBackToContent:"Scroll back to content",zoomIn:"Zoom in",zoomOut:"Zoom out",resetZoom:"Reset zoom",menu:"Menu",done:"Done",edit:"Edit",undo:"Undo",redo:"Redo",resetLibrary:"Reset library",createNewRoom:"Create new room",fullScreen:"Full screen",darkMode:"Dark mode",lightMode:"Light mode",systemMode:"System mode",zenMode:"Zen mode",objectsSnapMode:"Snap to objects",exitZenMode:"Exit zen mode",cancel:"Cancel",clear:"Clear",remove:"Remove",embed:"Toggle embedding",publishLibrary:"Publish",submit:"Submit",confirm:"Confirm",embeddableInteractionButton:"Click to interact"},l={clearReset:"This will clear the whole canvas. Are you sure?",couldNotCreateShareableLink:"Couldn't create shareable link.",couldNotCreateShareableLinkTooBig:"Couldn't create shareable link: the scene is too big",couldNotLoadInvalidFile:"Couldn't load invalid file",importBackendFailed:"Importing from backend failed.",cannotExportEmptyCanvas:"Cannot export empty canvas.",couldNotCopyToClipboard:"Couldn't copy to clipboard.",decryptFailed:"Couldn't decrypt data.",uploadedSecurly:"The upload has been secured with end-to-end encryption, which means that Excalidraw server and third parties can't read the content.",loadSceneOverridePrompt:"Loading external drawing will replace your existing content. Do you wish to continue?",collabStopOverridePrompt:`Stopping the session will overwrite your previous, locally stored drawing. Are you sure?
|
|
2
|
+
|
|
3
|
+
(If you want to keep your local drawing, simply close the browser tab instead.)`,errorAddingToLibrary:"Couldn't add item to the library",errorRemovingFromLibrary:"Couldn't remove item from the library",confirmAddLibrary:"This will add {{numShapes}} shape(s) to your library. Are you sure?",imageDoesNotContainScene:"This image does not seem to contain any scene data. Have you enabled scene embedding during export?",cannotRestoreFromImage:"Scene couldn't be restored from this image file",invalidSceneUrl:"Couldn't import scene from the supplied URL. It's either malformed, or doesn't contain valid Excalidraw JSON data.",resetLibrary:"This will clear your library. Are you sure?",removeItemsFromsLibrary:"Delete {{count}} item(s) from library?",invalidEncryptionKey:"Encryption key must be of 22 characters. Live collaboration is disabled.",collabOfflineWarning:`No internet connection available.
|
|
4
|
+
Your changes will not be saved!`},n={unsupportedFileType:"Unsupported file type.",imageInsertError:"Couldn't insert image. Try again later...",fileTooBig:"File is too big. Maximum allowed size is {{maxSize}}.",svgImageInsertError:"Couldn't insert SVG image. The SVG markup looks invalid.",failedToFetchImage:"Failed to fetch image.",cannotResolveCollabServer:"Couldn't connect to the collab server. Please reload the page and try again.",importLibraryError:"Couldn't load library",saveLibraryError:"Couldn't save library to storage. Please save your library to a file locally to make sure you don't lose changes.",collabSaveFailed:"Couldn't save to the backend database. If problems persist, you should save your file locally to ensure you don't lose your work.",collabSaveFailed_sizeExceeded:"Couldn't save to the backend database, the canvas seems to be too big. You should save the file locally to ensure you don't lose your work.",imageToolNotSupported:"Images are disabled.",brave_measure_text_error:{line1:"Looks like you are using Brave browser with the <bold>Aggressively Block Fingerprinting</bold> setting enabled.",line2:"This could result in breaking the <bold>Text Elements</bold> in your drawings.",line3:"We strongly recommend disabling this setting. You can follow <link>these steps</link> on how to do so.",line4:"If disabling this setting doesn't fix the display of text elements, please open an <issueLink>issue</issueLink> on our GitHub, or write us on <discordLink>Discord</discordLink>"},libraryElementTypeError:{embeddable:"Embeddable elements cannot be added to the library.",iframe:"IFrame elements cannot be added to the library.",image:"Support for adding images to the library coming soon!"},asyncPasteFailedOnRead:"Couldn't paste (couldn't read from system clipboard).",asyncPasteFailedOnParse:"Couldn't paste.",copyToSystemClipboardFailed:"Couldn't copy to clipboard."},s={selection:"Selection",image:"Insert image",rectangle:"Rectangle",diamond:"Diamond",ellipse:"Ellipse",arrow:"Arrow",line:"Line",freedraw:"Draw",text:"Text",library:"Library",lock:"Keep selected tool active after drawing",penMode:"Pen mode - prevent touch",link:"Add / Update link for a selected shape",eraser:"Eraser",frame:"Frame tool",magicframe:"Wireframe to code",embeddable:"Web Embed",laser:"Laser pointer",hand:"Hand (panning tool)",extraTools:"More tools",mermaidToExcalidraw:"Mermaid to Excalidraw"},c={rectangle:"Rectangle",diamond:"Diamond",ellipse:"Ellipse",arrow:"Arrow",line:"Line",freedraw:"Freedraw",text:"Text",image:"Image",group:"Group",frame:"Frame",magicframe:"Wireframe to code",embeddable:"Web Embed",selection:"Selection",iframe:"IFrame"},d={canvasActions:"Canvas actions",selectedShapeActions:"Selected shape actions",shapes:"Shapes"},m={dismissSearch:"Escape to dismiss search",canvasPanning:"To move canvas, hold mouse wheel or spacebar while dragging, or use the hand tool",linearElement:"Click to start multiple points, drag for single line",arrowTool:"Click to start multiple points, drag for single line. Press {{arrowShortcut}} again to change arrow type.",freeDraw:"Click and drag, release when you're finished",text:"Tip: you can also add text by double-clicking anywhere with the selection tool",embeddable:"Click-drag to create a website embed",text_selected:"Double-click or press ENTER to edit text",text_editing:"Press Escape or CtrlOrCmd+ENTER to finish editing",linearElementMulti:"Click on last point or press Escape or Enter to finish",lockAngle:"You can constrain angle by holding SHIFT",resize:`You can constrain proportions by holding SHIFT while resizing,
|
|
5
|
+
hold ALT to resize from the center`,resizeImage:`You can resize freely by holding SHIFT,
|
|
6
|
+
hold ALT to resize from the center`,rotate:"You can constrain angles by holding SHIFT while rotating",lineEditor_info:"Hold CtrlOrCmd and Double-click or press CtrlOrCmd + Enter to edit points",lineEditor_pointSelected:`Press Delete to remove point(s),
|
|
7
|
+
CtrlOrCmd+D to duplicate, or drag to move`,lineEditor_nothingSelected:`Select a point to edit (hold SHIFT to select multiple),
|
|
8
|
+
or hold Alt and click to add new points`,placeImage:"Click to place the image, or click and drag to set its size manually",publishLibrary:"Publish your own library",bindTextToElement:"Press enter to add text",createFlowchart:"Hold CtrlOrCmd and Arrow key to create a flowchart",deepBoxSelect:"Hold CtrlOrCmd to deep select, and to prevent dragging",eraserRevert:"Hold Alt to revert the elements marked for deletion",firefox_clipboard_write:'This feature can likely be enabled by setting the "dom.events.asyncClipboard.clipboardItem" flag to "true". To change the browser flags in Firefox, visit the "about:config" page.',disableSnapping:"Hold CtrlOrCmd to disable snapping",enterCropEditor:"Double click the image or press ENTER to crop the image",leaveCropEditor:"Click outside the image or press ENTER or ESCAPE to finish cropping"},u={cannotShowPreview:"Cannot show preview",canvasTooBig:"The canvas may be too big.",canvasTooBigTip:"Tip: try moving the farthest elements a bit closer together."},h={headingMain:"Encountered an error. Try <button>reloading the page</button>.",clearCanvasMessage:"If reloading doesn't work, try <button>clearing the canvas</button>.",clearCanvasCaveat:" This will result in loss of work ",trackedToSentry:"The error with identifier {{eventId}} was tracked on our system.",openIssueMessage:"We were very cautious not to include your scene information on the error. If your scene is not private, please consider following up on our <button>bug tracker</button>. Please include information below by copying and pasting into the GitHub issue.",sceneContent:"Scene content:"},p={or:"Or"},b={desc_intro:"Invite people to collaborate on your drawing.",desc_privacy:"Don't worry, the session is end-to-end encrypted, and fully private. Not even our server can see what you draw.",button_startSession:"Start session",button_stopSession:"Stop session",desc_inProgressIntro:"Live-collaboration session is now in progress.",desc_shareLink:"Share this link with anyone you want to collaborate with:",desc_exitSession:"Stopping the session will disconnect you from the room, but you'll be able to continue working with the scene, locally. Note that this won't affect other people, and they'll still be able to collaborate on their version.",shareTitle:"Join a live collaboration session on Excalidraw"},g={title:"Error"},y={disk_title:"Save to disk",disk_details:"Export the scene data to a file from which you can import later.",disk_button:"Save to file",link_title:"Shareable link",link_details:"Export as a read-only link.",link_button:"Export to Link",excalidrawplus_description:"Save the scene to your Excalidraw+ workspace.",excalidrawplus_button:"Export",excalidrawplus_exportError:"Couldn't export to Excalidraw+ at this moment..."},k={blog:"Read our blog",click:"click",deepSelect:"Deep select",deepBoxSelect:"Deep select within box, and prevent dragging",createFlowchart:"Create a flowchart from a generic element",navigateFlowchart:"Navigate a flowchart",curvedArrow:"Curved arrow",curvedLine:"Curved line",documentation:"Documentation",doubleClick:"double-click",drag:"drag",editor:"Editor",editLineArrowPoints:"Edit line/arrow points",editText:"Edit text / add label",github:"Found an issue? Submit",howto:"Follow our guides",or:"or",preventBinding:"Prevent arrow binding",tools:"Tools",shortcuts:"Keyboard shortcuts",textFinish:"Finish editing (text editor)",textNewLine:"Add new line (text editor)",title:"Help",view:"View",zoomToFit:"Zoom to fit all elements",zoomToSelection:"Zoom to selection",toggleElementLock:"Lock/unlock selection",movePageUpDown:"Move page up/down",movePageLeftRight:"Move page left/right",cropStart:"Crop image",cropFinish:"Finish image cropping"},v={title:"Clear canvas"},w={title:"Publish library",itemName:"Item name",authorName:"Author name",githubUsername:"GitHub username",twitterUsername:"Twitter username",libraryName:"Library name",libraryDesc:"Library description",website:"Website",placeholder:{authorName:"Your name or username",libraryName:"Name of your library",libraryDesc:"Description of your library to help people understand its usage",githubHandle:"GitHub handle (optional), so you can edit the library once submitted for review",twitterHandle:"Twitter username (optional), so we know who to credit when promoting over Twitter",website:"Link to your personal website or elsewhere (optional)"},errors:{required:"Required",website:"Enter a valid URL"},noteDescription:"Submit your library to be included in the <link>public library repository</link> for other people to use in their drawings.",noteGuidelines:"The library needs to be manually approved first. Please read the <link>guidelines</link> before submitting. You will need a GitHub account to communicate and make changes if requested, but it is not strictly required.",noteLicense:"By submitting, you agree the library will be published under the <link>MIT License</link>, which in short means anyone can use them without restrictions.",noteItems:"Each library item must have its own name so it's filterable. The following library items will be included:",atleastOneLibItem:"Please select at least one library item to get started",republishWarning:"Note: some of the selected items are marked as already published/submitted. You should only resubmit items when updating an existing library or submission."},f={title:"Library submitted",content:"Thank you {{authorName}}. Your library has been submitted for review. You can track the status <link>here</link>"},S={resetLibrary:"Reset library",removeItemsFromLib:"Remove selected items from library"},x={header:"Export image",label:{withBackground:"Background",onlySelected:"Only selected",darkMode:"Dark mode",embedScene:"Embed scene",scale:"Scale",padding:"Padding"},tooltip:{embedScene:`Scene data will be saved into the exported PNG/SVG file so that the scene can be restored from it.
|
|
9
|
+
Will increase exported file size.`},title:{exportToPng:"Export to PNG",exportToSvg:"Export to SVG",copyPngToClipboard:"Copy PNG to clipboard"},button:{exportToPng:"PNG",exportToSvg:"SVG",copyPngToClipboard:"Copy to clipboard"}},C={tooltip:"Your drawings are end-to-end encrypted so Excalidraw's servers will never see them.",link:"Blog post on end-to-end encryption in Excalidraw"},P={angle:"Angle",shapes:"Shapes",height:"Height",scene:"Scene",selected:"Selected",storage:"Storage",fullTitle:"Canvas & Shape properties",title:"Properties",generalStats:"General",elementProperties:"Shape properties",total:"Total",version:"Version",versionCopy:"Click to copy",versionNotAvailable:"Version not available",width:"Width"},E={addedToLibrary:"Added to library",copyStyles:"Copied styles.",copyToClipboard:"Copied to clipboard.",copyToClipboardAsPng:`Copied {{exportSelection}} to clipboard as PNG
|
|
10
|
+
({{exportColorScheme}})`,copyToClipboardAsSvg:`Copied {{exportSelection}} to clipboard as SVG
|
|
11
|
+
({{exportColorScheme}})`,fileSaved:"File saved.",fileSavedToFilename:"Saved to {filename}",canvas:"canvas",selection:"selection",pasteAsSingleElement:`Use {{shortcut}} to paste as a single element,
|
|
12
|
+
or paste into an existing text editor`,unableToEmbed:"Embedding this url is currently not allowed. Raise an issue on GitHub to request the url whitelisted",unrecognizedLinkFormat:"The link you embedded does not match the expected format. Please try to paste the 'embed' string provided by the source site",elementLinkCopied:"Link copied to clipboard"},j={transparent:"Transparent",black:"Black",white:"White",red:"Red",pink:"Pink",grape:"Grape",violet:"Violet",gray:"Gray",blue:"Blue",cyan:"Cyan",teal:"Teal",green:"Green",yellow:"Yellow",orange:"Orange",bronze:"Bronze"},T={app:{center_heading:"All your data is saved locally in your browser.",center_heading_plus:"Did you want to go to the Excalidraw+ instead?",menuHint:"Export, preferences, languages, ..."},defaults:{menuHint:"Export, preferences, and more...",center_heading:"Diagrams. Made. Simple.",toolbarHint:"Pick a tool & Start drawing!",helpHint:"Shortcuts & help"}},L={mostUsedCustomColors:"Most used custom colors",colors:"Colors",shades:"Shades",hexCode:"Hex code",noShades:"No shades available for this color"},_={action:{exportToImage:{title:"Export as image",button:"Export as image",description:"Export the scene data as an image from which you can import later."},saveToDisk:{title:"Save to disk",button:"Save to disk",description:"Export the scene data to a file from which you can import later."},excalidrawPlus:{title:"Excalidraw+",button:"Export to Excalidraw+",description:"Save the scene to your Excalidraw+ workspace."}},modal:{loadFromFile:{title:"Load from file",button:"Load from file",description:"Loading from a file will <bold>replace your existing content</bold>.<br></br>You can back up your drawing first using one of the options below."},shareableLink:{title:"Load from link",button:"Replace my content",description:"Loading external drawing will <bold>replace your existing content</bold>.<br></br>You can back up your drawing first by using one of the options below."}}},F={title:"Mermaid to Excalidraw",button:"Insert",description:"Currently only <flowchartLink>Flowchart</flowchartLink>,<sequenceLink> Sequence, </sequenceLink> and <classLink>Class </classLink>Diagrams are supported. The other types will be rendered as image in Excalidraw.",syntax:"Mermaid Syntax",preview:"Preview"},A={placeholder:"Quick search"},z={badge:{old:"old"},sceneFonts:"In this scene",availableFonts:"Available fonts",empty:"No fonts found"},N={empty:"No users found",hint:{text:"Click on user to follow",followStatus:"You're currently following this user",inCall:"User is in a voice call",micMuted:"User's microphone is muted",isSpeaking:"User is speaking"}},I={title:"Command palette",shortcuts:{select:"Select",confirm:"Confirm",close:"Close"},recents:"Recently used",search:{placeholder:"Search menus, commands, and discover hidden gems",noMatch:"No matching commands..."},itemNotAvailable:"Command is not available...",shortcutHint:"For Command palette, use {{shortcut}}"};e.s(["A",0,j,"B",0,T,"C",0,L,"D",0,_,"E",0,F,"F",0,A,"G",0,z,"H",0,N,"I",0,I,"J",0,{labels:t,elementLink:o,library:a,search:r,buttons:i,alerts:l,errors:n,toolBar:s,element:c,headings:d,hints:m,canvasError:u,errorSplash:h,shareDialog:p,roomDialog:b,errorDialog:g,exportDialog:y,helpDialog:k,clearCanvasDialog:v,publishDialog:w,publishSuccessDialog:f,confirmDialog:S,imageExportDialog:x,encrypted:C,stats:P,toast:E,colors:j,welcomeScreen:T,colorPicker:L,overwriteConfirm:_,mermaid:F,quickSearch:A,fontList:z,userList:N,commandPalette:I},"a",0,t,"b",0,o,"c",0,a,"d",0,r,"e",0,i,"f",0,l,"g",0,n,"h",0,s,"i",0,c,"j",0,d,"k",0,m,"l",0,u,"m",0,h,"n",0,p,"o",0,b,"p",0,g,"q",0,y,"r",0,k,"s",0,v,"t",0,w,"u",0,f,"v",0,S,"w",0,x,"x",0,C,"y",0,P,"z",0,E])},793513,e=>{"use strict";var t=e.i(468317),o=e.i(905381),a=e.i(59805),r=e.i(736099);e.i(308798);var i=e.i(898862),i=i,l=e.i(61086),n=e.i(519455),s=e.i(671485);window.EXCALIDRAW_ASSET_PATH="/excalidraw-assets/";let c=(0,o.default)(()=>e.A(986841).then(e=>e.Excalidraw),{loadableGenerated:{modules:[743771]},ssr:!1,loading:()=>(0,t.jsx)("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"Loading canvas…"})});function d(e){if(null===e)throw Error("Canvas file could not be loaded.");if(""===e.trim())return{elements:[]};let t=JSON.parse(e);if(!t||"object"!=typeof t||!Array.isArray(t.elements))throw Error("Canvas JSON must contain an elements array.");return t}function m(e){let t={...e};return delete t.theme,delete t.scrollX,delete t.scrollY,delete t.zoom,delete t.selectedElementIds,delete t.editingElement,delete t.resizingElement,delete t.newElement,delete t.multiElement,delete t.selectionElement,t}function u(e){let t=JSON.parse((0,i.Jh)(e.elements,e.appState??{},e.files??{},"database"));return t.appState&&(t.appState=m(t.appState)),e.files&&Object.keys(e.files).length>0&&(t.files=e.files),JSON.stringify(t,null,2)}e.s(["CanvasViewer",0,function({content:e,initialSha:o,path:h,title:p,readOnly:b=!1}){let g="u">typeof document&&document.documentElement.classList.contains("dark")?"dark":"light",y=(0,a.useMemo)(()=>{try{let t=d(e);return{value:t,normalized:u(t),error:null}}catch(e){return{value:null,normalized:"",error:e instanceof Error?e.message:"Invalid canvas JSON."}}},[e]),[k,v]=(0,a.useState)(null),w=(0,a.useRef)(null),[f,S]=(0,a.useState)(y.normalized),x=(0,a.useRef)(y.normalized),[C,P]=(0,a.useState)(o),E=(0,a.useRef)(o),[j,T]=(0,a.useState)(null),[L,_]=(0,a.useState)(null),F=(0,a.useRef)(null),A=(0,a.useRef)(!1),z=(0,a.useRef)(!1),N=(0,a.useRef)(()=>{});(0,a.useEffect)(()=>{S(y.normalized),x.current=y.normalized,P(o),E.current=o},[o,y.normalized]);let I=(0,a.useCallback)(async()=>{let e=w.current;if(e){if(A.current){z.current=!0;return}A.current=!0,T("saving"),_(null);try{let t=(0,i.Jh)(e.getSceneElements(),e.getAppState(),e.getFiles(),"database"),o=JSON.parse(t);o.appState&&(o.appState=m(o.appState));let a=e.getFiles();Object.keys(a).length>0&&(o.files=a);let r=JSON.stringify(o,null,2);if(r===x.current)return void T("saved");let l=await (0,s.wsFetch)("/api/wiki/content",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:h,content:r,baseSha:E.current})});if(l.ok){let e=await l.json();x.current=r,S(r),E.current=e.sha??E.current,P(E.current),T("saved");return}let n=await l.json();if(409===l.status&&"STALE_SHA"===n.error){let t=await (0,s.wsFetch)(`/api/wiki/content?path=${encodeURIComponent(h)}`);if(!t.ok)throw Error("Could not reload canvas after conflict.");let o=await t.json(),a=d(o.content),r=u(a);e.updateScene({elements:a.elements,appState:m(a.appState??{})}),a.files&&e.addFiles(Object.values(a.files)),x.current=r,S(r),E.current=t.headers.get("X-Wiki-Sha256"),P(E.current),T("reloaded");return}throw Error(n.error??"Save failed")}catch(e){_(e instanceof Error?e.message:"Save failed"),T("error")}finally{A.current=!1,z.current&&(z.current=!1,F.current=setTimeout(()=>{F.current=null,N.current()},800))}}},[h]);N.current=I;let R=(0,a.useCallback)(()=>{F.current&&clearTimeout(F.current),F.current=setTimeout(()=>{F.current=null,I()},800)},[I]);return(0,a.useEffect)(()=>()=>{F.current&&(clearTimeout(F.current),F.current=null,N.current())},[]),(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[(0,t.jsx)(l.ViewerToolbar,{path:h,badge:"CANVAS",children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[(0,t.jsx)(r.PencilRuler,{className:"h-3.5 w-3.5 text-violet-500"}),b?"Read-only":"saving"===j?"Saving…":"saved"===j?"Saved":"reloaded"===j?"Reloaded":"Editable"]})}),y.error?(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-3 p-8 text-center",children:[(0,t.jsx)(r.PencilRuler,{className:"h-10 w-10 text-destructive"}),(0,t.jsx)("p",{className:"font-medium text-destructive",children:"Could not render canvas"}),(0,t.jsx)("p",{className:"max-w-lg text-sm text-muted-foreground",children:y.error}),(0,t.jsx)(n.Button,{variant:"outline",size:"sm",onClick:()=>window.location.reload(),children:"Reload"})]}):(0,t.jsxs)("div",{className:"min-h-0 flex-1 bg-background",children:[(0,t.jsx)(c,{initialData:y.value,excalidrawAPI:e=>{w.current=e,v(e)},onChange:()=>{!b&&k&&R()},viewModeEnabled:b,theme:g,name:p,autoFocus:!1}),L&&(0,t.jsx)("p",{className:"px-3 py-1 text-xs text-destructive",children:L})]})]})}],793513)},561021,e=>{e.n(e.i(793513))},251445,e=>{e.v(t=>Promise.all(["static/chunks/02dxg-hhy_wc1.js"].map(t=>e.l(t))).then(()=>t(257117)))},573621,e=>{e.v(t=>Promise.all(["static/chunks/0e0n5bezlmnws.js"].map(t=>e.l(t))).then(()=>t(817814)))},721212,e=>{e.v(t=>Promise.all(["static/chunks/0z7nv2~tcg._e.js"].map(t=>e.l(t))).then(()=>t(837574)))},301278,e=>{e.v(t=>Promise.all(["static/chunks/0l-~4w6i7k.y0.js"].map(t=>e.l(t))).then(()=>t(336282)))},274562,e=>{e.v(t=>Promise.all(["static/chunks/0dm8chiy87kdy.js"].map(t=>e.l(t))).then(()=>t(140860)))},878933,e=>{e.v(t=>Promise.all(["static/chunks/0l3l_yh6z.al~.js"].map(t=>e.l(t))).then(()=>t(463083)))},381736,e=>{e.v(t=>Promise.all(["static/chunks/0dgd-m3hj_-z1.js"].map(t=>e.l(t))).then(()=>t(623810)))},887533,e=>{e.v(t=>Promise.all(["static/chunks/0lv402d9xebjg.js"].map(t=>e.l(t))).then(()=>t(349535)))},894072,e=>{e.v(t=>Promise.all(["static/chunks/05q_8y34swg_c.js"].map(t=>e.l(t))).then(()=>t(145013)))},774629,e=>{e.v(t=>Promise.all(["static/chunks/0l-u.f3bblq8e.js","static/chunks/0-x1o2hyxthri.js"].map(t=>e.l(t))).then(()=>t(116853)))},462714,e=>{e.v(t=>Promise.all(["static/chunks/12utbyg~_l5bn.js","static/chunks/0-x1o2hyxthri.js"].map(t=>e.l(t))).then(()=>t(545761)))},214499,e=>{e.v(t=>Promise.all(["static/chunks/0qbipwbvdnj1f.js","static/chunks/0l4qtf8hgz.11.js","static/chunks/17bs24a7sa-tp.js","static/chunks/1674m~gp3w-8h.js","static/chunks/0~ikzdp3hga8n.js","static/chunks/0rldt2m_ic3fr.js","static/chunks/0q_xpywc4mr6r.js","static/chunks/0~fvcxnmv6g_x.js","static/chunks/105.j2~dvdym3.js","static/chunks/0q0.5-57agpll.js"].map(t=>e.l(t))).then(()=>t(304733)))},291174,e=>{e.v(t=>Promise.all(["static/chunks/0~snwj8vud1e9.js"].map(t=>e.l(t))).then(()=>t(113054)))},534089,e=>{e.v(t=>Promise.all(["static/chunks/03kndvtgz7df6.js"].map(t=>e.l(t))).then(()=>t(691475)))},538212,e=>{e.v(t=>Promise.all(["static/chunks/0wlcao7hskwbe.js"].map(t=>e.l(t))).then(()=>t(659877)))},903780,e=>{e.v(t=>Promise.all(["static/chunks/0iuutn3t~grg~.js"].map(t=>e.l(t))).then(()=>t(742216)))},93831,e=>{e.v(t=>Promise.all(["static/chunks/0wk.rl6_wf28q.js"].map(t=>e.l(t))).then(()=>t(706699)))},387916,e=>{e.v(t=>Promise.all(["static/chunks/14z5yndbt6l-5.js"].map(t=>e.l(t))).then(()=>t(240891)))},625768,e=>{e.v(t=>Promise.all(["static/chunks/0thi-a_xcuffh.js"].map(t=>e.l(t))).then(()=>t(69714)))},819245,e=>{e.v(t=>Promise.all(["static/chunks/0-ddysmepid49.js"].map(t=>e.l(t))).then(()=>t(117012)))},19924,e=>{e.v(t=>Promise.all(["static/chunks/0u4j4xb36_eu1.js"].map(t=>e.l(t))).then(()=>t(486952)))},955200,e=>{e.v(t=>Promise.all(["static/chunks/0r7d-1tq61fa1.js"].map(t=>e.l(t))).then(()=>t(538920)))},977404,e=>{e.v(t=>Promise.all(["static/chunks/0px-hy~y0644d.js"].map(t=>e.l(t))).then(()=>t(273253)))},710563,e=>{e.v(t=>Promise.all(["static/chunks/0ht1k40cd5q1n.js"].map(t=>e.l(t))).then(()=>t(404992)))},368593,e=>{e.v(t=>Promise.all(["static/chunks/0qt3_7k1ycaci.js"].map(t=>e.l(t))).then(()=>t(713784)))},908401,e=>{e.v(t=>Promise.all(["static/chunks/0dwbkzy._45vy.js"].map(t=>e.l(t))).then(()=>t(888814)))},269e3,e=>{e.v(t=>Promise.all(["static/chunks/0qz2mqqigsrbg.js"].map(t=>e.l(t))).then(()=>t(700967)))},117776,e=>{e.v(t=>Promise.all(["static/chunks/0fxah9k~fcqct.js"].map(t=>e.l(t))).then(()=>t(220577)))},177455,e=>{e.v(t=>Promise.all(["static/chunks/16_~4tr.~curs.js"].map(t=>e.l(t))).then(()=>t(157880)))},686382,e=>{e.v(t=>Promise.all(["static/chunks/0xe--m_1x.lcb.js"].map(t=>e.l(t))).then(()=>t(695244)))},500965,e=>{e.v(t=>Promise.all(["static/chunks/0ca5_r07.asq1.js"].map(t=>e.l(t))).then(()=>t(174104)))},576494,e=>{e.v(t=>Promise.all(["static/chunks/0lr13ke45qhib.js"].map(t=>e.l(t))).then(()=>t(566017)))},220389,e=>{e.v(t=>Promise.all(["static/chunks/0zhfmw6woi7wb.js"].map(t=>e.l(t))).then(()=>t(228008)))},301646,e=>{e.v(t=>Promise.all(["static/chunks/0doj4__hv87-0.js"].map(t=>e.l(t))).then(()=>t(885925)))},476523,e=>{e.v(t=>Promise.all(["static/chunks/0qftmjb-ya14p.js"].map(t=>e.l(t))).then(()=>t(109749)))},769293,e=>{e.v(t=>Promise.all(["static/chunks/07qiyns883j.b.js"].map(t=>e.l(t))).then(()=>t(621733)))},999959,e=>{e.v(t=>Promise.all(["static/chunks/0j9z0xbs.n01h.js"].map(t=>e.l(t))).then(()=>t(451812)))},16794,e=>{e.v(t=>Promise.all(["static/chunks/0_5a8_n~bzs11.js"].map(t=>e.l(t))).then(()=>t(776376)))},198070,e=>{e.v(t=>Promise.all(["static/chunks/17ejw52en9.xq.js"].map(t=>e.l(t))).then(()=>t(662657)))},118631,e=>{e.v(t=>Promise.all(["static/chunks/0ipunyddk-t_8.js"].map(t=>e.l(t))).then(()=>t(748683)))},737788,e=>{e.v(t=>Promise.all(["static/chunks/07hxh_~ssmy1~.js"].map(t=>e.l(t))).then(()=>t(606291)))},670179,e=>{e.v(t=>Promise.all(["static/chunks/0g2qawqgg~3i9.js"].map(t=>e.l(t))).then(()=>t(517044)))},523015,e=>{e.v(t=>Promise.all(["static/chunks/0vnkqj.wmi635.js"].map(t=>e.l(t))).then(()=>t(446117)))},972190,e=>{e.v(t=>Promise.all(["static/chunks/161-vxg65snpt.js"].map(t=>e.l(t))).then(()=>t(266454)))},905694,e=>{e.v(t=>Promise.all(["static/chunks/180yj~97z12l..js"].map(t=>e.l(t))).then(()=>t(293015)))},745541,e=>{e.v(t=>Promise.all(["static/chunks/0w-~49cmz_0d3.js"].map(t=>e.l(t))).then(()=>t(576097)))},700499,e=>{e.v(t=>Promise.all(["static/chunks/0cbn4fn-ce2oo.js"].map(t=>e.l(t))).then(()=>t(596052)))},282365,e=>{e.v(t=>Promise.all(["static/chunks/10y9usx3.0~e1.js"].map(t=>e.l(t))).then(()=>t(865138)))},129500,e=>{e.v(t=>Promise.all(["static/chunks/0bpxmmilieaj7.js"].map(t=>e.l(t))).then(()=>t(995957)))},709338,e=>{e.v(t=>Promise.all(["static/chunks/11r4v51ax3cuk.js"].map(t=>e.l(t))).then(()=>t(394456)))},261853,e=>{e.v(t=>Promise.all(["static/chunks/03f5~5haag-5j.js"].map(t=>e.l(t))).then(()=>t(388511)))},777246,e=>{e.v(t=>Promise.all(["static/chunks/048..g2.nyph1.js"].map(t=>e.l(t))).then(()=>t(376221)))},72384,e=>{e.v(t=>Promise.all(["static/chunks/0a80r~16ddp48.js"].map(t=>e.l(t))).then(()=>t(238211)))},815162,e=>{e.v(t=>Promise.all(["static/chunks/0jjo24odlg~rk.js"].map(t=>e.l(t))).then(()=>t(750568)))},927555,e=>{e.v(t=>Promise.all(["static/chunks/07~-03k35a8k_.js"].map(t=>e.l(t))).then(()=>t(672386)))},724399,e=>{e.v(t=>Promise.all(["static/chunks/0qouyihzczxkx.js"].map(t=>e.l(t))).then(()=>t(341209)))},973071,e=>{e.v(t=>Promise.all(["static/chunks/0ws0keab8s-sp.js"].map(t=>e.l(t))).then(()=>t(940769)))},400482,e=>{e.v(t=>Promise.all(["static/chunks/0cf4laa~lb8te.js"].map(t=>e.l(t))).then(()=>t(122110)))},895893,e=>{e.v(t=>Promise.all(["static/chunks/0kidua.g3mc1m.js"].map(t=>e.l(t))).then(()=>t(871650)))},923842,e=>{e.v(t=>Promise.all(["static/chunks/0nzspv~qn9pt6.js"].map(t=>e.l(t))).then(()=>t(66359)))},360387,e=>{e.v(t=>Promise.all(["static/chunks/10rwkbqojevd_.js"].map(t=>e.l(t))).then(()=>t(86853)))},549750,e=>{e.v(t=>Promise.all(["static/chunks/0~l1u8c5kvhsp.js"].map(t=>e.l(t))).then(()=>t(628282)))},719595,e=>{e.v(t=>Promise.all(["static/chunks/0of2m13~g4-wt.js"].map(t=>e.l(t))).then(()=>t(511136)))},106407,e=>{e.v(t=>Promise.all(["static/chunks/0n7mncqbi12l-.js"].map(t=>e.l(t))).then(()=>t(378467)))},268423,e=>{e.v(t=>Promise.all(["static/chunks/0pd2jpq09qwjm.js"].map(t=>e.l(t))).then(()=>t(445932)))},100220,e=>{e.v(t=>Promise.all(["static/chunks/0gvtzau8.73c3.js"].map(t=>e.l(t))).then(()=>t(483233)))},793386,e=>{e.v(t=>Promise.all(["static/chunks/0.v.kwrcv0353.js"].map(t=>e.l(t))).then(()=>t(386582)))},483897,e=>{e.v(t=>Promise.all(["static/chunks/05ult4~0iitco.js"].map(t=>e.l(t))).then(()=>t(779772)))},986841,e=>{e.v(t=>Promise.all(["static/chunks/02tjfml726a-p.js"].map(t=>e.l(t))).then(()=>t(743771)))}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
697
|
|
@@ -863,9 +863,10 @@
|
|
|
863
863
|
{ id: "system-api", code: "SY", name: "System config API", group: "entry", loc: "902 LOC", gx: 3, gy: 7, w: 2, d: 2, h: 4, what: "Changes workspaces, users, administrators, pins, and local settings.", how: "14 route handlers use session and origin checks before mutating persisted configuration.", talks: ["auth", "workspace", "auth-store"] },
|
|
864
864
|
{ id: "share-api", code: "SH", name: "Shared documents", group: "entry", loc: "817 LOC", gx: 6, gy: 7, w: 3, d: 2, h: 4, what: "Publishes read-only document links with optional unlock and expiry controls.", how: "Share routes and shared-docs modules create opaque grants, validate unlocks, and render sanitized content.", talks: ["auth", "share-store", "markdown"] },
|
|
865
865
|
{ id: "mcp", code: "MC", name: "MCP adapter", group: "compute", loc: "2,911 LOC", gx: 10, gy: 7, w: 3, d: 2, h: 6, what: "Lets MCP clients use the agent contract through a separate npm package.", how: "packages/wiki-viewer-mcp defines 13 Zod-backed tools and a typed HTTP client with revision and scope errors.", talks: ["agent-api", "proof"] },
|
|
866
|
-
{ id: "app-runner", code: "AR", name: "Node app runner", group: "compute", loc: "738 LOC", gx: 14, gy: 7, w: 3, d: 2, h: 5, what: "Runs trusted node-app folders and proxies their local web surface.", how: "app-runner.ts manages child processes, readiness probes, ports, logs,
|
|
866
|
+
{ id: "app-runner", code: "AR", name: "Node app runner", group: "compute", loc: "738 LOC", gx: 14, gy: 7, w: 3, d: 2, h: 5, what: "Runs trusted node-app folders and proxies their local web surface.", how: "app-runner.ts manages child processes, readiness probes, ports, logs, access-checked forwarding, pinned boot restore, crash caps, and file-change supervision.", talks: ["wiki-api", "path", "web-shell"] },
|
|
867
867
|
{ id: "git", code: "GT", name: "Git integration", group: "domain", loc: "871 LOC", gx: 18, gy: 7, w: 2, d: 2, h: 5, what: "Shows repository history and supports safe branch-oriented workspace actions.", how: "git.ts wraps the system binary, scans for leaked credentials, and backs history, diff, branch, and clone routes.", talks: ["wiki-api", "path", "workspace"] },
|
|
868
868
|
{ id: "sshfs", code: "SF", name: "SSHFS remotes", group: "domain", loc: "464 LOC", gx: 21, gy: 7, w: 2, d: 2, h: 4, what: "Makes remote folders appear as workspaces through a local mount boundary.", how: "sshfs.ts and mount helpers manage remote lifecycle, reconnects, and mount hazards.", talks: ["workspace", "path", "cli"] },
|
|
869
|
+
{ id: "hosted-apps", code: "HA", name: "Hosted apps", group: "compute", loc: "560 LOC", gx: 24, gy: 7, w: 2, d: 2, h: 4, what: "Maps short user-chosen slugs to HTML directories or running node apps reachable at /app/<slug>.", how: "hosted-apps.ts persists the slug registry (~/.wiki-viewer/hosted-apps.json); /api/wiki/hosted-apps manages entries, pinning, and derived node status; the sidebar sorts pinned apps first and exposes status/error popovers with restart-now; app-proxy-core.ts forwards existing and slug-routed node traffic while the /app/<slug> route serves HTML dirs dir-aware or proxies each request to the live child port.", talks: ["wiki-api", "path", "workspace", "app-runner", "web-shell"] },
|
|
869
870
|
|
|
870
871
|
{ id: "proof", code: "PR", name: "Proof core", group: "domain", loc: "1,397 LOC", gx: 1, gy: 10, w: 4, d: 3, h: 10, what: "Applies structured Markdown edits while preserving revisions, references, comments, and suggestions.", how: "ops-applier.ts parses blocks, checks base revisions, applies operations, writes atomically, and updates sidecar metadata.", talks: ["safety", "markdown", "auth-store", "audit-store"], children: [
|
|
871
872
|
{ code: "OP", name: "Block operations", h: 9, what: "Apply insert, replace, delete, and annotation operations.", how: "ops-applier.ts applies insert, replace, delete, and annotation operations against parsed blocks." },
|
|
@@ -927,6 +928,8 @@
|
|
|
927
928
|
{ f: "wiki-api", t: "scratch", flow: 1, pay: "Quick capture" },
|
|
928
929
|
{ f: "wiki-api", t: "app-runner", flow: 1, pay: "Trusted app launch" },
|
|
929
930
|
{ f: "app-runner", t: "web-shell", flow: 1, pay: "Proxied preview" },
|
|
931
|
+
{ f: "wiki-api", t: "hosted-apps", flow: 1, pay: "Hosted app registry" },
|
|
932
|
+
{ f: "hosted-apps", t: "web-shell", flow: 1, pay: "Slug-served app" },
|
|
930
933
|
{ f: "mcp", t: "agent-api", flow: 1, pay: "MCP tool call" },
|
|
931
934
|
{ f: "ai-panel", t: "agent-api", flow: 1, pay: "Agent management" },
|
|
932
935
|
{ f: "state", t: "editor", flow: 1, pay: "Page state" },
|
|
@@ -72,9 +72,10 @@
|
|
|
72
72
|
{ "id": "system-api", "code": "SY", "name": "System config API", "group": "entry", "loc": "902 LOC", "gx": 3, "gy": 7, "w": 2, "d": 2, "h": 4, "what": "Changes workspaces, users, administrators, pins, and local settings.", "how": "14 route handlers use session and origin checks before mutating persisted configuration.", "talks": ["auth", "workspace", "auth-store"] },
|
|
73
73
|
{ "id": "share-api", "code": "SH", "name": "Shared documents", "group": "entry", "loc": "817 LOC", "gx": 6, "gy": 7, "w": 3, "d": 2, "h": 4, "what": "Publishes read-only document links with optional unlock and expiry controls.", "how": "Share routes and shared-docs modules create opaque grants, validate unlocks, and render sanitized content.", "talks": ["auth", "share-store", "markdown"] },
|
|
74
74
|
{ "id": "mcp", "code": "MC", "name": "MCP adapter", "group": "compute", "loc": "2,911 LOC", "gx": 10, "gy": 7, "w": 3, "d": 2, "h": 6, "what": "Lets MCP clients use the agent contract through a separate npm package.", "how": "packages/wiki-viewer-mcp defines 13 Zod-backed tools and a typed HTTP client with revision and scope errors.", "talks": ["agent-api", "proof"] },
|
|
75
|
-
{ "id": "app-runner", "code": "AR", "name": "Node app runner", "group": "compute", "loc": "738 LOC", "gx": 14, "gy": 7, "w": 3, "d": 2, "h": 5, "what": "Runs trusted node-app folders and proxies their local web surface.", "how": "app-runner.ts manages child processes, readiness probes, ports, logs,
|
|
75
|
+
{ "id": "app-runner", "code": "AR", "name": "Node app runner", "group": "compute", "loc": "738 LOC", "gx": 14, "gy": 7, "w": 3, "d": 2, "h": 5, "what": "Runs trusted node-app folders and proxies their local web surface.", "how": "app-runner.ts manages child processes, readiness probes, ports, logs, access-checked forwarding, pinned boot restore, crash caps, and file-change supervision.", "talks": ["wiki-api", "path", "web-shell"] },
|
|
76
76
|
{ "id": "git", "code": "GT", "name": "Git integration", "group": "domain", "loc": "871 LOC", "gx": 18, "gy": 7, "w": 2, "d": 2, "h": 5, "what": "Shows repository history and supports safe branch-oriented workspace actions.", "how": "git.ts wraps the system binary, scans for leaked credentials, and backs history, diff, branch, and clone routes.", "talks": ["wiki-api", "path", "workspace"] },
|
|
77
77
|
{ "id": "sshfs", "code": "SF", "name": "SSHFS remotes", "group": "domain", "loc": "464 LOC", "gx": 21, "gy": 7, "w": 2, "d": 2, "h": 4, "what": "Makes remote folders appear as workspaces through a local mount boundary.", "how": "sshfs.ts and mount helpers manage remote lifecycle, reconnects, and mount hazards.", "talks": ["workspace", "path", "cli"] },
|
|
78
|
+
{ "id": "hosted-apps", "code": "HA", "name": "Hosted apps", "group": "compute", "loc": "560 LOC", "gx": 24, "gy": 7, "w": 2, "d": 2, "h": 4, "what": "Maps short user-chosen slugs to HTML directories or running node apps reachable at /app/<slug>.", "how": "hosted-apps.ts persists the slug registry (~/.wiki-viewer/hosted-apps.json); /api/wiki/hosted-apps manages entries, pinning, and derived node status; the sidebar sorts pinned apps first and exposes status/error popovers with restart-now; app-proxy-core.ts forwards existing and slug-routed node traffic while the /app/<slug> route serves HTML dirs dir-aware or proxies each request to the live child port.", "talks": ["wiki-api", "path", "workspace", "app-runner", "web-shell"] },
|
|
78
79
|
{ "id": "proof", "code": "PR", "name": "Proof core", "group": "domain", "loc": "1,397 LOC", "gx": 1, "gy": 10, "w": 4, "d": 3, "h": 10, "what": "Applies structured Markdown edits while preserving revisions, references, comments, and suggestions.", "how": "ops-applier.ts parses blocks, checks base revisions, applies operations, writes atomically, and updates sidecar metadata.", "talks": ["safety", "markdown", "auth-store", "audit-store"], "children": [
|
|
79
80
|
{ "code": "OP", "name": "Block operations", "h": 9, "what": "Apply insert, replace, delete, and annotation operations.", "how": "ops-applier.ts applies insert, replace, delete, and annotation operations against parsed blocks." },
|
|
80
81
|
{ "code": "RF", "name": "Reference map", "h": 5, "what": "Keeps stable block references across edits.", "how": "block-refs.ts keeps stable block references valid across edits." },
|
|
@@ -132,6 +133,8 @@
|
|
|
132
133
|
{ "f": "wiki-api", "t": "scratch", "flow": 1, "pay": "Quick capture" },
|
|
133
134
|
{ "f": "wiki-api", "t": "app-runner", "flow": 1, "pay": "Trusted app launch" },
|
|
134
135
|
{ "f": "app-runner", "t": "web-shell", "flow": 1, "pay": "Proxied preview" },
|
|
136
|
+
{ "f": "wiki-api", "t": "hosted-apps", "flow": 1, "pay": "Hosted app registry" },
|
|
137
|
+
{ "f": "hosted-apps", "t": "web-shell", "flow": 1, "pay": "Slug-served app" },
|
|
135
138
|
{ "f": "mcp", "t": "agent-api", "flow": 1, "pay": "MCP tool call" },
|
|
136
139
|
{ "f": "ai-panel", "t": "agent-api", "flow": 1, "pay": "Agent management" },
|
|
137
140
|
{ "f": "state", "t": "editor", "flow": 1, "pay": "Page state" },
|
|
@@ -15,7 +15,7 @@ const currentPort = parseInt(process.env.PORT, 10) || 3000
|
|
|
15
15
|
const hostname = process.env.HOSTNAME || '0.0.0.0'
|
|
16
16
|
|
|
17
17
|
let keepAliveTimeout = parseInt(process.env.KEEP_ALIVE_TIMEOUT, 10)
|
|
18
|
-
const nextConfig = {"env":{"NEXT_PUBLIC_APP_VERSION":"2.
|
|
18
|
+
const nextConfig = {"env":{"NEXT_PUBLIC_APP_VERSION":"2.17.0"},"webpack":null,"typescript":{"ignoreBuildErrors":false},"typedRoutes":false,"distDir":"./.next","cleanDistDir":true,"assetPrefix":"","cacheMaxMemorySize":52428800,"configOrigin":"next.config.ts","useFileSystemPublicRoutes":true,"generateEtags":true,"pageExtensions":["tsx","ts","jsx","js"],"poweredByHeader":true,"compress":true,"images":{"deviceSizes":[640,750,828,1080,1200,1920,2048,3840],"imageSizes":[32,48,64,96,128,256,384],"path":"/_next/image","loader":"default","loaderFile":"","domains":[],"disableStaticImages":false,"minimumCacheTTL":14400,"formats":["image/webp"],"maximumRedirects":3,"maximumResponseBody":50000000,"dangerouslyAllowLocalIP":false,"dangerouslyAllowSVG":false,"contentSecurityPolicy":"script-src 'none'; frame-src 'none'; sandbox;","contentDispositionType":"attachment","localPatterns":[{"pathname":"**","search":""}],"remotePatterns":[],"qualities":[75],"unoptimized":true,"customCacheHandler":false},"devIndicators":{"position":"bottom-left"},"onDemandEntries":{"maxInactiveAge":60000,"pagesBufferLength":5},"basePath":"","sassOptions":{},"trailingSlash":false,"i18n":null,"productionBrowserSourceMaps":false,"excludeDefaultMomentLocales":true,"reactProductionProfiling":false,"reactStrictMode":null,"reactMaxHeadersLength":6000,"httpAgentOptions":{"keepAlive":true},"logging":{"serverFunctions":true,"browserToTerminal":"warn"},"compiler":{},"expireTime":31536000,"staticPageGenerationTimeout":60,"output":"standalone","modularizeImports":{"@mui/icons-material":{"transform":"@mui/icons-material/{{member}}"},"lodash":{"transform":"lodash/{{member}}"}},"outputFileTracingRoot":"/home/runner/work/wiki-viewer/wiki-viewer","allowedDevOrigins":["localhost"],"cacheComponents":false,"cacheLife":{"default":{"stale":300,"revalidate":900,"expire":4294967294},"seconds":{"stale":30,"revalidate":1,"expire":60},"minutes":{"stale":300,"revalidate":60,"expire":3600},"hours":{"stale":300,"revalidate":3600,"expire":86400},"days":{"stale":300,"revalidate":86400,"expire":604800},"weeks":{"stale":300,"revalidate":604800,"expire":2592000},"max":{"stale":300,"revalidate":2592000,"expire":31536000}},"cacheHandlers":{},"experimental":{"appNewScrollHandler":false,"useSkewCookie":false,"cssChunking":true,"multiZoneDraftMode":false,"appNavFailHandling":false,"prerenderEarlyExit":true,"serverMinification":true,"linkNoTouchStart":false,"caseSensitiveRoutes":false,"cachedNavigations":false,"partialFallbacks":false,"dynamicOnHover":false,"varyParams":false,"prefetchInlining":false,"preloadEntriesOnStart":true,"clientRouterFilter":true,"clientRouterFilterRedirects":false,"fetchCacheKeyPrefix":"","proxyPrefetch":"flexible","optimisticClientCache":true,"manualClientBasePath":false,"cpus":3,"memoryBasedWorkersCount":false,"imgOptConcurrency":null,"imgOptTimeoutInSeconds":7,"imgOptMaxInputPixels":268402689,"imgOptSequentialRead":null,"imgOptSkipMetadata":null,"isrFlushToDisk":true,"workerThreads":false,"optimizeCss":false,"nextScriptWorkers":false,"scrollRestoration":false,"externalDir":false,"disableOptimizedLoading":false,"gzipSize":true,"craCompat":false,"esmExternals":true,"fullySpecified":false,"swcTraceProfiling":false,"forceSwcTransforms":false,"largePageDataBytes":128000,"typedEnv":false,"parallelServerCompiles":false,"parallelServerBuildTraces":false,"ppr":false,"authInterrupts":false,"webpackMemoryOptimizations":false,"optimizeServerReact":true,"strictRouteTypes":false,"viewTransition":false,"removeUncaughtErrorAndRejectionListeners":false,"validateRSCRequestHeaders":false,"staleTimes":{"dynamic":0,"static":300},"reactDebugChannel":true,"serverComponentsHmrCache":true,"staticGenerationMaxConcurrency":8,"staticGenerationMinPagesPerWorker":25,"transitionIndicator":false,"gestureTransition":false,"inlineCss":false,"useCache":false,"globalNotFound":false,"browserDebugInfoInTerminal":"warn","lockDistDir":true,"proxyClientMaxBodySize":10485760,"hideLogsAfterAbort":false,"mcpServer":true,"turbopackFileSystemCacheForDev":true,"turbopackFileSystemCacheForBuild":false,"turbopackInferModuleSideEffects":true,"turbopackPluginRuntimeStrategy":"childProcesses","optimizePackageImports":["lucide-react","date-fns","lodash-es","ramda","antd","react-bootstrap","ahooks","@ant-design/icons","@headlessui/react","@headlessui-float/react","@heroicons/react/20/solid","@heroicons/react/24/solid","@heroicons/react/24/outline","@visx/visx","@tremor/react","rxjs","@mui/material","@mui/icons-material","recharts","react-use","effect","@effect/schema","@effect/platform","@effect/platform-node","@effect/platform-browser","@effect/platform-bun","@effect/sql","@effect/sql-mssql","@effect/sql-mysql2","@effect/sql-pg","@effect/sql-sqlite-node","@effect/sql-sqlite-bun","@effect/sql-sqlite-wasm","@effect/sql-sqlite-react-native","@effect/rpc","@effect/rpc-http","@effect/typeclass","@effect/experimental","@effect/opentelemetry","@material-ui/core","@material-ui/icons","@tabler/icons-react","mui-core","react-icons/ai","react-icons/bi","react-icons/bs","react-icons/cg","react-icons/ci","react-icons/di","react-icons/fa","react-icons/fa6","react-icons/fc","react-icons/fi","react-icons/gi","react-icons/go","react-icons/gr","react-icons/hi","react-icons/hi2","react-icons/im","react-icons/io","react-icons/io5","react-icons/lia","react-icons/lib","react-icons/lu","react-icons/md","react-icons/pi","react-icons/ri","react-icons/rx","react-icons/si","react-icons/sl","react-icons/tb","react-icons/tfi","react-icons/ti","react-icons/vsc","react-icons/wi"],"trustHostHeader":false,"isExperimentalCompile":false},"htmlLimitedBots":"[\\w-]+-Google|Google-[\\w-]+|Chrome-Lighthouse|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|Yeti|googleweblight","bundlePagesRouterDependencies":false,"configFileName":"next.config.ts","turbopack":{"root":"/home/runner/work/wiki-viewer/wiki-viewer"},"distDirRoot":".next"}
|
|
19
19
|
|
|
20
20
|
process.env.__NEXT_PRIVATE_STANDALONE_CONFIG = JSON.stringify(nextConfig)
|
|
21
21
|
|
package/package.json
CHANGED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
module.exports=[874533,(e,t,r)=>{t.exports=e.x("node:child_process",()=>require("node:child_process"))},812057,(e,t,r)=>{t.exports=e.x("node:util",()=>require("node:util"))},256294,296555,e=>{"use strict";let t;var r=e.i(874533),s=e.i(812057),a=e.i(912714),n=e.i(750227),i=e.i(660526);e.i(902157);let o=RegExp("[;|&$`<>(){}\\n\\r\\0]");function l(e){let{target:t,mountpoint:r,port:s}=e,a=t.user?`${t.user}@`:"",n=[`${a}${t.host}:${t.remotePath}`,r];s&&Number.isInteger(Number(s))&&Number(s)>0&&65536>Number(s)&&n.push("-p",String(s));let i=e.authMethod??"agent";!e.authMethod&&(null!=e.password?i="password":e.keyPath&&(i="keyfile"));let o=["reconnect","ServerAliveInterval=15","ServerAliveCountMax=3","compression=yes","cache=yes","kernel_cache","StrictHostKeyChecking=accept-new","BatchMode=yes"];if(e.readOnly&&o.push("ro"),"keyfile"===i&&e.keyPath&&(o.push(`IdentityFile=${e.keyPath}`),o.push("IdentitiesOnly=yes")),"password"===i){let e=o.indexOf("BatchMode=yes");e>=0&&o.splice(e,1),o.push("password_stdin"),o.push("PreferredAuthentications=password,keyboard-interactive"),o.push("PubkeyAuthentication=no"),o.push("NumberOfPasswordPrompts=1")}return e.extraOptions&&o.push(...e.extraOptions),n.push("-o",o.join(",")),n}e.s(["buildSshfsArgs",0,l,"isValidKeyPath",0,function(e){return!(!e||o.test(e)||e.includes(".."))&&(e.startsWith("/")||e.startsWith("~/"))},"parseSshTarget",0,function(e){let t;if(!e||o.test(e))return null;let r=e.trim(),s=r.indexOf(":");if(s<=0)return null;let a=r.slice(0,s),n=r.slice(s+1);if(!n.startsWith("/")||n.includes(".."))return null;let i=a,l=a.indexOf("@");return l>=0&&(t=a.slice(0,l),i=a.slice(l+1),!t)?null:i&&/^[a-zA-Z0-9.\-]+$/.test(i)&&(!t||/^[a-zA-Z0-9._\-]+$/.test(t))?{user:t,host:i,remotePath:n}:null}],296555);let u=(0,s.promisify)(r.execFile);function c(){return n.default.join(i.default.homedir(),".wiki-viewer","mounts")}async function d(){if(!0!==t)try{await u("sshfs",["--version"]),t=!0}catch{throw Error("sshfs binary not found. Install sshfs + FUSE (e.g. `apt install sshfs`, `brew install macfuse sshfs`) and ensure it is on PATH.")}}async function p(t){var r;let s=n.default.resolve(t),i=!1;try{i=(await (0,a.readFile)("/proc/mounts","utf8")).split("\n").some(e=>{let t=e.split(" ");return t[1]===s&&/fuse/.test(t[2]??"")})}catch{i=!1}return!!i&&(r=s,new Promise(t=>{let s=!1,a=setTimeout(()=>{s||(s=!0,t(!1))},4e3);e.A(687903).then(({readdir:e})=>e(r)).then(()=>{s||(s=!0,clearTimeout(a),t(!0))}).catch(()=>{s||(s=!0,clearTimeout(a),t(!1))})}))}async function h(e){await d(),await (0,a.mkdir)(e.mountpoint,{recursive:!0});let t=l(e);if(await new Promise((s,a)=>{let n=(0,r.spawn)("sshfs",t,{stdio:["pipe","ignore","pipe"]}),i="",o=setTimeout(()=>{n.kill("SIGKILL"),a(Error("sshfs mount timed out after 25s."))},25e3);n.stderr?.on("data",e=>{i+=e.toString()}),n.on("error",e=>{clearTimeout(o),a(e.message.includes("ENOENT")?Error("sshfs binary not found on PATH."):e)}),n.on("close",e=>{clearTimeout(o),0===e?s():a(Error(`sshfs exited ${e}: ${i.trim()||"mount failed"}`))}),"password"===e.authMethod&&n.stdin?.write((e.password??"")+"\n"),n.stdin?.end()}),!await p(e.mountpoint))throw Error("sshfs reported success but the mount is not live.")}async function f(e){let t=n.default.resolve(e);for(let[e,r]of[["fusermount",["-u","-z",t]],["umount",[t]]])try{await u(e,r);break}catch{}try{await (0,a.rmdir)(t)}catch{}}e.s(["assertSshfsAvailable",0,d,"isMounted",0,p,"mountSshfs",0,h,"mountpointFor",0,function(e){return n.default.join(c(),e)},"mountsDir",0,c,"unmountSshfs",0,f],256294)},536654,e=>{"use strict";var t=e.i(912714),r=e.i(750227);function s(e){return!!(r.default.isAbsolute(e)||".."===e||e.startsWith(".."+r.default.sep)||e.startsWith("../"))}async function a(e,n,i={}){let o;if(!e)return null;let l=function(e){if(e.includes("\0")||r.default.isAbsolute(e))return null;let t=e.replace(/\\/g,"/");return(("."===(t=r.default.posix.normalize(t))||"./"===t)&&(t=""),".."===t||t.startsWith("../")||/^[a-zA-Z]:\//.test(t)||t.startsWith("/"))?null:t}(n);if(null===l)return null;if(i.deniedSegments?.length){for(let e of l.split("/").filter(Boolean))if(i.deniedSegments.includes(e))return null}try{o=await (0,t.realpath)(e)}catch{return null}let u=l?r.default.join(o,l):o;try{let e=await (0,t.realpath)(u),a=r.default.relative(o,e);if(s(a))return null;return{relPath:l,absolutePath:e}}catch{if(!i.allowMissing)return null;let e=u;for(;;){let a=r.default.dirname(e);if(a===e)break;try{let e=await (0,t.realpath)(a),n=r.default.relative(o,e);if(s(n))return null;return{relPath:l,absolutePath:u}}catch{e=a}}return null}}e.s(["resolveWorkspacePath",0,a])},402662,e=>{"use strict";var t=e.i(351216);e.s(["checkOrigin",0,function(e){let r=e.method.toUpperCase();if("GET"===r||"HEAD"===r||"OPTIONS"===r)return null;let s=e.headers.get("origin"),a=e.headers.get("referer");if(!s&&!a)return null;let n=function(e){let t=Array.from(new Set(["localhost","127.0.0.1",e.split(":")[0],...(process.env.WIKI_OWNER_HOSTS??"").split(",").map(e=>e.trim()).filter(Boolean)])),r=["",":3000",":3003"];e.includes(":")&&r.push(":"+e.split(":")[1]);let s=new Set;for(let e of t)for(let t of["http","https"])for(let a of r)s.add(`${t}://${e}${a}`);return s}(e.headers.get("host")??"");if(s)return n.has(s)?null:t.NextResponse.json({error:"FORBIDDEN",message:"Bad origin"},{status:403});if(a){try{let{protocol:e,host:t}=new URL(a);if(n.has(`${e}//${t}`))return null}catch{}return t.NextResponse.json({error:"FORBIDDEN",message:"Bad referer"},{status:403})}return null}])},848475,e=>{"use strict";var t=e.i(750227);let r={".md":"text/markdown; charset=utf-8",".markdown":"text/markdown; charset=utf-8",".txt":"text/plain; charset=utf-8",".json":"application/json; charset=utf-8",".jsonc":"application/json; charset=utf-8",".ts":"text/typescript; charset=utf-8",".tsx":"text/typescript; charset=utf-8",".mts":"text/typescript; charset=utf-8",".js":"text/javascript; charset=utf-8",".jsx":"text/javascript; charset=utf-8",".mjs":"text/javascript; charset=utf-8",".html":"text/html; charset=utf-8",".htm":"text/html; charset=utf-8",".css":"text/css; charset=utf-8",".yaml":"text/yaml; charset=utf-8",".yml":"text/yaml; charset=utf-8",".toml":"text/toml; charset=utf-8",".xml":"application/xml; charset=utf-8",".svg":"image/svg+xml",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".ico":"image/x-icon",".bmp":"image/bmp",".pdf":"application/pdf",".zip":"application/zip",".tar":"application/x-tar",".gz":"application/gzip",".py":"text/x-python; charset=utf-8",".rs":"text/x-rustsrc; charset=utf-8",".go":"text/x-go; charset=utf-8",".sh":"text/x-shellscript; charset=utf-8",".csv":"text/csv; charset=utf-8",".tsv":"text/tab-separated-values; charset=utf-8",".env":"text/plain; charset=utf-8",".log":"text/plain; charset=utf-8",".ini":"text/plain; charset=utf-8",".conf":"text/plain; charset=utf-8",".mmd":"text/plain; charset=utf-8",".ipynb":"application/json; charset=utf-8",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".doc":"application/msword",".xls":"application/vnd.ms-excel",".ppt":"application/vnd.ms-powerpoint",".mp4":"video/mp4",".webm":"video/webm",".mov":"video/quicktime",".m4v":"video/mp4",".mp3":"audio/mpeg",".wav":"audio/wav",".ogg":"audio/ogg",".m4a":"audio/mp4",".aac":"audio/aac"};e.s(["contentTypeForPath",0,function(e){return r[t.default.extname(e).toLowerCase()]??"application/octet-stream"}])},719126,e=>{"use strict";var t=e.i(666680),r=e.i(912714),s=e.i(750227),a=e.i(716234),n=e.i(536654),i=e.i(848475);async function o(e,t){if(!e)return null;let r=await (0,n.resolveWorkspacePath)(e,t,{allowMissing:!0,deniedSegments:a.DENIED_SEGMENTS});return r?.absolutePath??null}async function l(e,t){let s=420;try{let t=await (0,r.stat)(e);s=511&t.mode}catch{}let a=e+".~"+process.pid+"."+Date.now()+".tmp",n=await (0,r.open)(a,"w",s);try{await n.write(t),await n.datasync()}finally{await n.close()}await (0,r.rename)(a,e)}async function u(e,t){let a=s.default.dirname(e);if(t)return await (0,r.mkdir)(a,{recursive:!0}),!0;try{return await (0,r.stat)(a),!0}catch{return!1}}e.s(["atomicWrite",0,l,"ensureParentDir",0,u,"extractShaHex",0,function(e){return e.replace(/^"/,"").replace(/"$/,"").replace(/^sha256:/,"")},"isDeniedRelPath",0,function(e){let t=e.replace(/\\/g,"/");return a.DENIED_SEGMENTS.some(e=>t===e||t.startsWith(e+"/"))},"isMarkdown",0,function(e){return e.endsWith(".md")||e.endsWith(".markdown")},"looksLikeBinary",0,function(e){return e.slice(0,Math.min(e.length,8192)).includes(0)},"mimeByExt",0,function(e){return(0,i.contentTypeForPath)(e)},"safeAbsPath",0,o,"sha256ofBuf",0,function(e){return"sha256:"+(0,t.createHash)("sha256").update(e).digest("hex")}])},487018,e=>{"use strict";var t=e.x("node:sqlite",()=>require("node:sqlite"),!0);function r(e){return 1===e.length&&Array.isArray(e[0])?e[0]:e}class s{stmt;constructor(e){this.stmt=e}get reader(){return this.stmt.columns().length>0}all(...e){let t=r(e);return this.stmt.all(...t)}get(...e){let t=r(e);return this.stmt.get(...t)}run(...e){let t=r(e),s=this.stmt.run(...t);return{changes:Number(s.changes),lastInsertRowid:Number(s.lastInsertRowid)}}iterate(...e){let t=r(e);return this.stmt.iterate(...t)}}class a{db;constructor(e){this.db=new t.DatabaseSync(e),this.db.exec("PRAGMA busy_timeout = 5000"),this.db.exec("PRAGMA journal_mode = WAL")}prepare(e){return new s(this.db.prepare(e))}exec(e){this.db.exec(e)}close(){this.db.close()}pragma(e){this.db.exec(`PRAGMA ${e}`)}}e.s(["default",()=>a])},97082,e=>{"use strict";var t=e.i(487018),r=e.i(750227),s=e.i(660526),a=e.i(902157),n=e.i(666680);let i=null;function o(){if(i)return i;let e=r.default.join(process.env.HOME??s.default.homedir(),".wiki-viewer");return(0,a.mkdirSync)(e,{recursive:!0}),(i=new t.default(r.default.join(e,"shared.db"))).pragma("journal_mode = WAL"),i.pragma("synchronous = NORMAL"),i.exec(`
|
|
2
|
-
CREATE TABLE IF NOT EXISTS shared_docs (
|
|
3
|
-
id TEXT PRIMARY KEY,
|
|
4
|
-
workspace_id TEXT NOT NULL,
|
|
5
|
-
file_path TEXT NOT NULL,
|
|
6
|
-
token TEXT NOT NULL UNIQUE,
|
|
7
|
-
password_hash TEXT,
|
|
8
|
-
expires_at TEXT,
|
|
9
|
-
created_by TEXT NOT NULL,
|
|
10
|
-
created_at TEXT NOT NULL,
|
|
11
|
-
view_count INTEGER NOT NULL DEFAULT 0,
|
|
12
|
-
is_revoked INTEGER NOT NULL DEFAULT 0
|
|
13
|
-
);
|
|
14
|
-
CREATE INDEX IF NOT EXISTS shared_docs_token_idx ON shared_docs(token);
|
|
15
|
-
CREATE INDEX IF NOT EXISTS shared_docs_file_idx ON shared_docs(workspace_id, file_path);
|
|
16
|
-
`),i}function l(e){return{id:e.id,workspaceId:e.workspace_id,filePath:e.file_path,token:e.token,passwordHash:e.password_hash??null,expiresAt:e.expires_at??null,createdBy:e.created_by,createdAt:e.created_at,viewCount:e.view_count??0,isRevoked:1===e.is_revoked}}e.s(["createShare",0,function(e){var t;let r,s,a=o(),i="shr_"+(0,n.randomBytes)(8).toString("base64url"),l=(0,n.randomBytes)(16).toString("base64url"),u=e.password?(t=e.password,r=(0,n.randomBytes)(16).toString("hex"),s=(0,n.scryptSync)(t,r,64).toString("hex"),`${r}:${s}`):null,c={id:i,workspaceId:e.workspaceId,filePath:e.filePath,token:l,passwordHash:u,expiresAt:e.expiresAt??null,createdBy:e.createdBy,createdAt:new Date().toISOString(),viewCount:0,isRevoked:!1},d={...c,isRevoked:+!!c.isRevoked};return a.prepare(`INSERT INTO shared_docs
|
|
17
|
-
(id, workspace_id, file_path, token, password_hash, expires_at, created_by, created_at, view_count, is_revoked)
|
|
18
|
-
VALUES (@id, @workspaceId, @filePath, @token, @passwordHash, @expiresAt, @createdBy, @createdAt, @viewCount, @isRevoked)`).run(d),c},"getShareByToken",0,function(e){let t=o().prepare("SELECT * FROM shared_docs WHERE token = ?").get(e);return t?l(t):null},"incrementViewCount",0,function(e){o().prepare("UPDATE shared_docs SET view_count = view_count + 1 WHERE token = ?").run(e)},"isExpired",0,function(e){return!!e.expiresAt&&new Date(e.expiresAt)<new Date},"listSharesForFile",0,function(e,t){return o().prepare("SELECT * FROM shared_docs WHERE workspace_id = ? AND file_path = ? AND is_revoked = 0 ORDER BY created_at DESC").all(e,t).map(l)},"revokeShare",0,function(e){o().prepare("UPDATE shared_docs SET is_revoked = 1 WHERE id = ?").run(e)},"verifyPassword",0,function(e,t){let[r,s]=t.split(":"),a=(0,n.scryptSync)(e,r,64),i=Buffer.from(s,"hex");return a.length===i.length&&(0,n.timingSafeEqual)(a,i)}])},794776,e=>{"use strict";let t,r=Number.isFinite(t=parseInt(process.env.AGENT_RATE_LIMIT??"",10))&&t>0?t:60;e.s(["OPS_PER_MINUTE",0,r,"SIDECAR_EVENT_TRIM_SIZE",0,1e3,"SIDECAR_TRIM_EVERY_N_MUTATIONS",0,100])},517387,e=>{"use strict";var t=e.i(794776);let r=new Map;e.s(["checkAndConsume",0,function(e,s=1){let a=Date.now(),n=t.OPS_PER_MINUTE,i=r.get(e);i||(i={tokens:n,lastRefill:a},r.set(e,i));let o=Math.floor((a-i.lastRefill)/1e3);return(o>0&&(i.tokens=Math.min(n,i.tokens+o),i.lastRefill=i.lastRefill+1e3*o),i.tokens<s)?{ok:!1,retryAfterMs:Math.max(1,1e3*(s-i.tokens)-(a-i.lastRefill))}:(i.tokens-=s,{ok:!0})}])},211451,63467,e=>{"use strict";var t=e.i(351216),r=e.i(912714),s=e.i(97082),a=e.i(359211),n=e.i(719126);async function i(e){let i,o=(0,s.getShareByToken)(e);if(!o)return{ok:!1,response:t.NextResponse.json({error:"not_found",message:"Share link not found"},{status:404})};if(o.isRevoked)return{ok:!1,response:t.NextResponse.json({error:"revoked",message:"Share link has been revoked"},{status:410})};if((0,s.isExpired)(o))return{ok:!1,response:t.NextResponse.json({error:"expired",message:"Share link has expired"},{status:410})};let l=await (0,a.getWorkspace)(o.workspaceId);if(!l)return{ok:!1,response:t.NextResponse.json({error:"workspace_gone",message:"Workspace no longer exists"},{status:410})};let u=await (0,n.safeAbsPath)(l.rootDir,o.filePath);if(!u)return{ok:!1,response:t.NextResponse.json({error:"path_invalid",message:"Invalid file path"},{status:400})};try{i=await (0,r.stat)(u)}catch{return{ok:!1,response:t.NextResponse.json({error:"file_gone",message:"File no longer exists"},{status:410})}}if(i.isDirectory())return{ok:!1,response:t.NextResponse.json({error:"path_invalid",message:"Directories cannot be shared"},{status:400})};let c=o.filePath.split("/").pop()??o.filePath;return{ok:!0,target:{share:o,absPath:u,filename:c}}}e.s(["resolveShareTarget",0,i],211451);var o=e.i(666680);function l(e){let t=(0,o.createHash)("sha256").update(e).digest("hex").slice(0,24);return`wv_share_${t}`}function u(e,t){let r=`${e.e}|${e.t}`;return(0,o.createHmac)("sha256",t).update(r).digest("hex")}e.s(["inlineContentDisposition",0,function(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"").replace(/\\/g,"\\\\").replace(/"/g,'\\"');return`inline; filename="${t}"`},"isUnlocked",0,function(e,t,r){let s=function(e,t){let r=e.headers.get("cookie")??"",s=l(t);for(let e of r.split(";")){let t=e.indexOf("=");if(!(t<=0)&&e.slice(0,t).trim()===s)return e.slice(t+1).trim()}}(e,t);return!!s&&function(e,t,r){let s,a=t.indexOf(".");if(-1===a)return!1;let n=t.slice(0,a),i=t.slice(a+1);try{s=JSON.parse(Buffer.from(n,"base64url").toString("utf8"))}catch{return!1}if(s.t!==e||"number"!=typeof s.e||s.e<=Date.now())return!1;let l=u(s,r),c=Buffer.from(l,"hex"),d=Buffer.from(i,"hex");return c.length===d.length&&(0,o.timingSafeEqual)(c,d)}(t,s,r)},"serializeUnlockCookie",0,function(e,t,r){let s,a,n,{name:i,value:o}=(a=u(s={t:t,e:Date.now()+9e5},r),n=`${Buffer.from(JSON.stringify(s)).toString("base64url")}.${a}`,{name:l(t),value:n}),c=new URL(e.url),d=[`${i}=${o}`,"HttpOnly","SameSite=Strict",`Path=${c.pathname}`,"Max-Age=900"];return"https:"===c.protocol&&d.push("Secure"),d.join("; ")}],63467)},843749,e=>{"use strict";var t=e.i(985426),r=e.i(257574),s=e.i(507835),a=e.i(457789),n=e.i(119791),i=e.i(141062),o=e.i(957291),l=e.i(535899),u=e.i(610241),c=e.i(62749),d=e.i(624891),p=e.i(725836),h=e.i(532736),f=e.i(257858),m=e.i(487476),w=e.i(193695);e.i(484264);var g=e.i(315709),v=e.i(351216),x=e.i(750227),_=e.i(402662),k=e.i(254226),y=e.i(517387),R=e.i(97082),E=e.i(211451),T=e.i(63467);let N={"Cache-Control":"private, no-store"};async function S(t){let{readFile:r,stat:s}=await e.A(687903);try{let e=await s(t),a=".excalidraw"===x.default.extname(t).toLowerCase()?0xa00000:1048576;if(e.size>a)return null;return(await r(t)).toString("utf-8")}catch(e){return console.error("[share] readFile(%s) %s",t,e instanceof Error?e.message:String(e)),null}}async function A(e,{params:t}){let{token:r}=await t,s=(0,y.checkAndConsume)(`share:${r}`,1);if(!s.ok)return v.NextResponse.json({error:"rate_limited",message:"Too many requests"},{status:429,headers:{"Retry-After":String(Math.ceil(s.retryAfterMs/1e3))}});let a=(0,R.getShareByToken)(r);if(!a)return v.NextResponse.json({error:"not_found",message:"Share link not found"},{status:404,headers:N});if(a.isRevoked)return v.NextResponse.json({error:"revoked",message:"Share link has been revoked"},{status:410,headers:N});if((0,R.isExpired)(a))return v.NextResponse.json({error:"expired",message:"Share link has expired"},{status:410,headers:N});if(a.passwordHash&&!(0,T.isUnlocked)(e,r,a.passwordHash))return v.NextResponse.json({protected:!0,message:"This document is password-protected"},{status:401,headers:N});let n=await (0,E.resolveShareTarget)(r);if(!n.ok)return n.response;let i=await S(n.target.absPath);return null===i?v.NextResponse.json({error:"read_error",message:"Failed to read file"},{status:500,headers:N}):((0,R.incrementViewCount)(r),v.NextResponse.json({content:i,filename:n.target.filename,filePath:n.target.share.filePath,viewCount:n.target.share.viewCount+1},{headers:a.passwordHash?N:void 0}))}async function P(e,{params:t}){let{token:r}=await t,s=(0,R.getShareByToken)(r);if(!s)return v.NextResponse.json({error:"not_found"},{status:404});if(s.isRevoked)return v.NextResponse.json({error:"revoked"},{status:410});if((0,R.isExpired)(s))return v.NextResponse.json({error:"expired"},{status:410});if(!s.passwordHash)return v.NextResponse.json({error:"not_protected"},{status:400});let a=(0,y.checkAndConsume)(`share-pwd:${r}`,1);if(!a.ok)return v.NextResponse.json({error:"rate_limited",message:"Too many attempts. Try again later."},{status:429,headers:{"Retry-After":String(Math.ceil(a.retryAfterMs/1e3))}});let n=await e.json();if(!n.password||"string"!=typeof n.password)return v.NextResponse.json({error:"missing_password"},{status:400});if(!(0,R.verifyPassword)(n.password,s.passwordHash))return v.NextResponse.json({error:"wrong_password",message:"Incorrect password"},{status:403,headers:N});let i=await (0,E.resolveShareTarget)(r);if(!i.ok)return i.response;let o=await S(i.target.absPath);if(null===o)return v.NextResponse.json({error:"read_error",message:"Failed to read file"},{status:500,headers:N});(0,R.incrementViewCount)(r);let l=(0,T.serializeUnlockCookie)(e,r,s.passwordHash);return v.NextResponse.json({content:o,filename:i.target.filename,filePath:i.target.share.filePath,viewCount:i.target.share.viewCount+1},{headers:{...N,"Set-Cookie":l}})}async function b(t,{params:r}){let{token:s}=await r,a=(0,_.checkOrigin)(t);if(a)return a;let n=await (0,k.requireUser)(t);if(!n.ok)return v.NextResponse.json({error:"UNAUTHORIZED"},{status:401});let i=(0,R.getShareByToken)(s);if(!i)return v.NextResponse.json({error:"not_found"},{status:404});if(i.createdBy!==n.user.id){let{isAdmin:t}=await e.A(919623);if(!await t(n.user.id,n.user.email))return v.NextResponse.json({error:"FORBIDDEN"},{status:403})}return(0,R.revokeShare)(i.id),v.NextResponse.json({ok:!0})}e.s(["DELETE",0,b,"GET",0,A,"POST",0,P],998553);var j=e.i(998553);let C=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/share/[token]/route",pathname:"/api/share/[token]",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/share/[token]/route.ts",nextConfigOutput:"standalone",userland:j,...{}}),{workAsyncStorage:O,workUnitAsyncStorage:I,serverHooks:D}=C;async function M(e,t,s){s.requestMeta&&(0,a.setRequestMeta)(e,s.requestMeta),C.isDev&&(0,a.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let v="/api/share/[token]/route";v=v.replace(/\/index$/,"")||"/";let x=await C.prepare(e,t,{srcPage:v,multiZoneDraftMode:!1});if(!x)return t.statusCode=400,t.end("Bad Request"),null==s.waitUntil||s.waitUntil.call(s,Promise.resolve()),null;let{buildId:_,params:k,nextConfig:y,parsedUrl:R,isDraftMode:E,prerenderManifest:T,routerServerContext:N,isOnDemandRevalidate:S,revalidateOnlyGenerated:A,resolvedPathname:P,clientReferenceManifest:b,serverActionsManifest:j}=x,O=(0,o.normalizeAppPath)(v),I=!!(T.dynamicRoutes[O]||T.routes[P]),D=async()=>((null==N?void 0:N.render404)?await N.render404(e,t,R,!1):t.end("This page could not be found"),null);if(I&&!E){let e=!!T.routes[P],t=T.dynamicRoutes[O];if(t&&!1===t.fallback&&!e){if(y.adapterPath)return await D();throw new w.NoFallbackError}}let M=null;!I||C.isDev||E||(M="/index"===(M=P)?"/":M);let U=!0===C.isDev||!I,H=I&&!U;j&&b&&(0,i.setManifestsSingleton)({page:v,clientReferenceManifest:b,serverActionsManifest:j});let B=e.method||"GET",$=(0,n.getTracer)(),L=$.getActiveScopeSpan(),q=!!(null==N?void 0:N.isWrappedByNextServer),F=!!(0,a.getRequestMeta)(e,"minimalMode"),W=(0,a.getRequestMeta)(e,"incrementalCache")||await C.getIncrementalCache(e,y,T,F);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let z={params:k,previewProps:T.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts},cacheComponents:!!y.cacheComponents,supportsDynamicResponse:U,incrementalCache:W,cacheLifeProfiles:y.cacheLife,waitUntil:s.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,s,a)=>C.onRequestError(e,t,s,a,N)},sharedContext:{buildId:_}},X=new l.NodeNextRequest(e),G=new l.NodeNextResponse(t),K=u.NextRequestAdapter.fromNodeNextRequest(X,(0,u.signalFromNodeResponse)(t));try{let a,i=async e=>C.handle(K,z).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=$.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==c.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let s=r.get("next.route");if(s){let t=`${B} ${s}`;e.setAttributes({"next.route":s,"http.route":s,"next.span_name":t}),e.updateName(t),a&&a!==e&&(a.setAttribute("http.route",s),a.updateName(t))}else e.updateName(`${B} ${v}`)}),o=async a=>{var n,o;let l=async({previousCacheEntry:r})=>{try{if(!F&&S&&A&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await i(a);e.fetchMetrics=z.renderOpts.fetchMetrics;let o=z.renderOpts.pendingWaitUntil;o&&s.waitUntil&&(s.waitUntil(o),o=void 0);let l=z.renderOpts.collectedTags;if(!I)return await (0,p.sendResponse)(X,G,n,z.renderOpts.pendingWaitUntil),null;{let e=await n.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(n.headers);l&&(t[m.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==z.renderOpts.collectedRevalidate&&!(z.renderOpts.collectedRevalidate>=m.INFINITE_CACHE)&&z.renderOpts.collectedRevalidate,s=void 0===z.renderOpts.collectedExpire||z.renderOpts.collectedExpire>=m.INFINITE_CACHE?void 0:z.renderOpts.collectedExpire;return{value:{kind:g.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:s}}}}catch(t){throw(null==r?void 0:r.isStale)&&await C.onRequestError(e,t,{routerKind:"App Router",routePath:v,routeType:"route",revalidateReason:(0,d.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:S})},!1,N),t}},u=await C.handleResponse({req:e,nextConfig:y,cacheKey:M,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:T,isRoutePPREnabled:!1,isOnDemandRevalidate:S,revalidateOnlyGenerated:A,responseGenerator:l,waitUntil:s.waitUntil,isMinimalMode:F});if(!I)return null;if((null==u||null==(n=u.value)?void 0:n.kind)!==g.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(o=u.value)?void 0:o.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});F||t.setHeader("x-nextjs-cache",S?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),E&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let c=(0,h.fromNodeOutgoingHttpHeaders)(u.value.headers);return F&&I||c.delete(m.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||c.get("Cache-Control")||c.set("Cache-Control",(0,f.getCacheControlHeader)(u.cacheControl)),await (0,p.sendResponse)(X,G,new Response(u.value.body,{headers:c,status:u.value.status||200})),null};q&&L?await o(L):(a=$.getActiveScopeSpan(),await $.withPropagatedContext(e.headers,()=>$.trace(c.BaseServerSpan.handleRequest,{spanName:`${B} ${v}`,kind:n.SpanKind.SERVER,attributes:{"http.method":B,"http.target":e.url}},o),void 0,!q))}catch(t){if(t instanceof w.NoFallbackError||await C.onRequestError(e,t,{routerKind:"App Router",routePath:O,routeType:"route",revalidateReason:(0,d.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:S})},!1,N),I)throw t;return await (0,p.sendResponse)(X,G,new Response(null,{status:500})),null}}e.s(["handler",0,M,"patchFetch",0,function(){return(0,s.patchFetch)({workAsyncStorage:O,workUnitAsyncStorage:I})},"routeModule",0,C,"serverHooks",0,D,"workAsyncStorage",0,O,"workUnitAsyncStorage",0,I],843749)},168315,e=>{e.v(t=>Promise.all(["server/chunks/0sag_@better-auth_memory-adapter_dist_index_mjs_0pvj6im._.js"].map(t=>e.l(t))).then(()=>t(862112)))},769787,e=>{e.v(t=>Promise.all(["server/chunks/01er_better-auth_dist_adapters_kysely-adapter_index_mjs_0s~-4gu._.js"].map(t=>e.l(t))).then(()=>t(717789)))},580632,e=>{e.v(e=>Promise.resolve().then(()=>e(270406)))},947559,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_bun-sqlite-dialect-DzNwOpKv_mjs_0z1z6m4._.js"].map(t=>e.l(t))).then(()=>t(495181)))},715018,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_node-sqlite-dialect_mjs_0qqlvhl._.js"].map(t=>e.l(t))).then(()=>t(698370)))},146843,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_d1-sqlite-dialect-C2B7YsIT_mjs_0wynrz3._.js"].map(t=>e.l(t))).then(()=>t(143740)))},697743,e=>{e.v(t=>Promise.all(["server/chunks/0.u4_next_05jevxw._.js"].map(t=>e.l(t))).then(()=>t(428325)))},99243,e=>{e.v(e=>Promise.resolve().then(()=>e(313414)))},893412,e=>{e.v(t=>Promise.all(["server/chunks/src_lib_auth_api-key_ts_0t_ma-t._.js"].map(t=>e.l(t))).then(()=>t(499465)))},687903,e=>{e.v(e=>Promise.resolve().then(()=>e(912714)))},919623,e=>{e.v(t=>Promise.all(["server/chunks/src_lib_auth_admin_ts_0g4i6v_._.js"].map(t=>e.l(t))).then(()=>t(583627)))}];
|
|
19
|
-
|
|
20
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__05qoy-2._.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
module.exports=[857764,(e,t,r)=>{t.exports=e.x("node:url",()=>require("node:url"))},727028,(e,t,r)=>{t.exports=e.x("node:zlib",()=>require("node:zlib"))},81111,(e,t,r)=>{t.exports=e.x("node:stream",()=>require("node:stream"))},687769,(e,t,r)=>{t.exports=e.x("node:events",()=>require("node:events"))},761095,(e,t,r)=>{t.exports=e.x("node:net",()=>require("node:net"))},345212,e=>{"use strict";var t=e.i(874533),r=e.i(902157),n=e.i(761095),s=e.i(750227);let o=new Map;function i(e){return`${e.workspaceId}\0${e.relPath}`}function l(e,t){return new Promise(r=>{let s=(0,n.createConnection)(e,t);s.setTimeout(800),s.on("connect",()=>{s.destroy(),r(!0)}),s.on("error",()=>{s.destroy(),r(!1)}),s.on("timeout",()=>{s.destroy(),r(!1)})})}async function a(e){let[t,r]=await Promise.all([l(e,"127.0.0.1"),l(e,"::1")]);return t||r}async function u(e,t=3e4){let r=Date.now()+t;for(;Date.now()<r&&!e.abort.signal.aborted;){if(await a(e.port))return e.port;await new Promise(e=>setTimeout(e,400))}return null}function c(e){let t=s.default.join(e,"package.json");if(!(0,r.existsSync)(t))return null;try{return JSON.parse((0,r.readFileSync)(t,"utf-8"))}catch{return null}}function d(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function p(e,t){return d(t,"start")?"start":d(t,"preview")&&(0,r.existsSync)(s.default.join(e,"dist"))?"preview":d(t,"dev")?"dev":null}function m(){let e=s.default.dirname(process.execPath),t=process.env.PATH??"";return t.split(s.default.delimiter).includes(e)?t:`${e}${s.default.delimiter}${t}`}async function v(e,l,a,v){var f;let g=i({workspaceId:e,relPath:l}),h=o.get(g);if(h&&"stopped"!==h.status&&"error"!==h.status&&h.process)return{port:h.port};h&&(h.abort.abort(),o.delete(g));let _=await new Promise((e,t)=>{let r=(0,n.createServer)();r.listen(0,"127.0.0.1",()=>{let t=r.address(),n="object"==typeof t&&t?t.port:0;r.close(()=>e(n))}),r.on("error",t)}),b=(0,r.existsSync)(s.default.join(a,"pnpm-lock.yaml"))?"pnpm":(0,r.existsSync)(s.default.join(a,"yarn.lock"))?"yarn":(0,r.existsSync)(s.default.join(a,"bun.lockb"))||(0,r.existsSync)(s.default.join(a,"bun.lock"))?"bun":"npm",y=function(e,t,r,n){let s=c(e);if(!s)return null;let o=s.scripts??{},i=Object.keys({...s.dependencies,...s.devDependencies}).some(e=>"vite"===e||e.includes("vite")),l=["--port",String(r)],a=e=>({bin:t,args:"npm"===t?["run",e,"--",...l]:["run",e,...l],isVite:i});if(n)return d(o,n)?a(n):null;let u=p(e,o);return u?a(u):s.main?{bin:"node",args:[s.main,...l],isVite:!1}:null}(a,b,_,v);if(!y)throw Error("No runnable script found in package.json (need start, preview, or dev)");let w={workspaceId:e,relPath:l,port:_,process:null,status:"installing",logs:[],generation:1,abort:new AbortController};o.set(g,w);let j=e=>{w.logs.push(e),w.logs.length>200&&w.logs.shift()};try{(0,r.existsSync)(s.default.join(a,"node_modules"))||(j(`[wiki-viewer] Running ${b} install…`),await (f=w.abort.signal,new Promise((e,r)=>{if(f.aborted)return void r(Error("Install aborted"));let n=[],s=e=>{j(e),n.push(e)},o=(0,t.spawn)(b,["install"],{cwd:a,stdio:"pipe",env:{...process.env,PATH:m()}}),i=()=>{try{o.kill("SIGTERM")}catch{}};f.addEventListener("abort",i,{once:!0});let l=e=>{for(let t of e.toString().split("\n")){let e=t.trim();e&&s(e)}};o.stdout?.on("data",l),o.stderr?.on("data",l),o.on("error",e=>{f.removeEventListener("abort",i),r(e)}),o.on("exit",t=>{if(f.removeEventListener("abort",i),0===t)e();else{let e=n.slice(-20).join("\n");r(Error(`${b} install failed (exit ${t}):
|
|
2
|
-
${e}`))}})}))),w.status="starting",j(`[wiki-viewer] Starting on port ${_}: ${y.bin} ${y.args.join(" ")}`);let e=(0,t.spawn)(y.bin,y.args,{cwd:a,stdio:"pipe",env:{...process.env,PATH:m(),PORT:String(_),VITE_PORT:String(_)}});w.process=e;let n=e=>{for(let t of e.toString().split("\n")){let e=t.trim();e&&j(e)}};return e.stdout?.on("data",n),e.stderr?.on("data",n),e.on("exit",e=>{o.get(g)!==w||"stopped"!==w.status&&(w.process=null,w.status=0===e||null===e?"stopped":"error",w.error=e?`Process exited with code ${e}`:void 0)}),u(w).then(t=>{if(o.get(g)===w&&!w.abort.signal.aborted)if(t)w.status="running";else{w.status="error",w.error="Port never became reachable (30 s timeout)";try{e.kill("SIGTERM")}catch{}}}),{port:_}}catch(e){throw o.get(g)===w&&(w.status="error",w.error=e instanceof Error?e.message:String(e)),e}}e.s(["getScripts",0,function(e){let t=c(e);if(!t)return{scripts:[],defaultScript:null};let r=t.scripts??{};return{scripts:Object.keys(r),defaultScript:p(e,r)}},"getStatus",0,function(e,t){let r=o.get(i({workspaceId:e,relPath:t}));return r?{status:r.status,port:r.port||void 0,error:r.error,logs:r.logs}:{status:"stopped",logs:[]}},"resolveByPrefix",0,function(e,t){for(let r=t.length;r>0;r--){let n=t.slice(0,r).join("/"),s=o.get(i({workspaceId:e,relPath:n}));if(s&&"running"===s.status&&s.port){let e="/"+t.slice(r).join("/");return{relPath:n,port:s.port,rest:e}}}return null},"startApp",0,v,"stopApp",0,function(e,t){let r=i({workspaceId:e,relPath:t}),n=o.get(r);if(!n)return;n.abort.abort();let s=n.process;if(n.process=null,o.delete(r),!s)return;let l=setTimeout(()=>{try{!s.killed&&s.pid&&s.kill("SIGKILL")}catch{}},2e3);s.once("exit",()=>clearTimeout(l));try{!s.killed&&s.pid&&s.kill("SIGTERM")}catch{}}])},168315,e=>{e.v(t=>Promise.all(["server/chunks/0sag_@better-auth_memory-adapter_dist_index_mjs_0pvj6im._.js"].map(t=>e.l(t))).then(()=>t(862112)))},769787,e=>{e.v(t=>Promise.all(["server/chunks/01er_better-auth_dist_adapters_kysely-adapter_index_mjs_0s~-4gu._.js"].map(t=>e.l(t))).then(()=>t(717789)))},580632,e=>{e.v(e=>Promise.resolve().then(()=>e(270406)))},947559,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_bun-sqlite-dialect-DzNwOpKv_mjs_0z1z6m4._.js"].map(t=>e.l(t))).then(()=>t(495181)))},715018,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_node-sqlite-dialect_mjs_0qqlvhl._.js"].map(t=>e.l(t))).then(()=>t(698370)))},146843,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_d1-sqlite-dialect-C2B7YsIT_mjs_0wynrz3._.js"].map(t=>e.l(t))).then(()=>t(143740)))},697743,e=>{e.v(t=>Promise.all(["server/chunks/0.u4_next_05jevxw._.js"].map(t=>e.l(t))).then(()=>t(428325)))},99243,e=>{e.v(e=>Promise.resolve().then(()=>e(313414)))},893412,e=>{e.v(e=>Promise.resolve().then(()=>e(499465)))},687903,e=>{e.v(e=>Promise.resolve().then(()=>e(912714)))}];
|
|
3
|
-
|
|
4
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__0h.0l-2._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[583627,e=>{"use strict";var t=e.i(798003),r=e.i(254226);function s(){return(process.env.WIKI_ADMIN_EMAILS??"").split(",").map(e=>e.trim().toLowerCase()).filter(Boolean)}async function i(e,r){if(r){let e=s();if(e.length>0&&e.includes(r.toLowerCase()))return!0}return((await (0,t.readConfig)()).adminUserIds??[]).includes(e)}async function n(){return(await (0,t.readConfig)()).adminUserIds??[]}async function o(e){await (0,t.updateConfig)(t=>{let r=t.adminUserIds??[];return r.includes(e)?t:{...t,adminUserIds:[...r,e]}})}async function a(e){let r=s().length>0,i=!1;if(await (0,t.updateConfig)(t=>{let s=(t.adminUserIds??[]).filter(t=>t!==e);return 0!==s.length||r?{...t,adminUserIds:s}:(i=!0,t)}),i)throw Error("LAST_ADMIN: cannot remove the last admin with no WIKI_ADMIN_EMAILS configured")}async function u(e){if(s().length>0||r.SYNTHETIC_USER_IDS.has(e)||((await (0,t.readConfig)()).adminUserIds??[]).length>0)return;let i=!1;await (0,t.updateConfig)(t=>(t.adminUserIds??[]).length>0?t:(i=!0,{...t,adminUserIds:[e]})),i&&console.log(`[wiki-viewer] Bootstrap: first user ${e} promoted to admin`)}async function l(e){if("1"===process.env.WIKI_NO_AUTH)return{ok:!0,user:{id:"local",email:"local@localhost",name:"local"}};let t=await (0,r.requireUser)(e);return t.ok?await i(t.user.id,t.user.email)?{ok:!0,user:t.user}:{ok:!1,status:403,code:"ADMIN_REQUIRED"}:{ok:!1,status:401,code:"UNAUTHORIZED"}}e.s(["addAdmin",0,o,"ensureBootstrapAdmin",0,u,"isAdmin",0,i,"listAdmins",0,n,"removeAdmin",0,a,"requireAdmin",0,l])},812057,(e,t,r)=>{t.exports=e.x("node:util",()=>require("node:util"))},874533,(e,t,r)=>{t.exports=e.x("node:child_process",()=>require("node:child_process"))},256294,296555,e=>{"use strict";let t;var r=e.i(874533),s=e.i(812057),i=e.i(912714),n=e.i(750227),o=e.i(660526);e.i(902157);let a=RegExp("[;|&$`<>(){}\\n\\r\\0]");function u(e){let{target:t,mountpoint:r,port:s}=e,i=t.user?`${t.user}@`:"",n=[`${i}${t.host}:${t.remotePath}`,r];s&&Number.isInteger(Number(s))&&Number(s)>0&&65536>Number(s)&&n.push("-p",String(s));let o=e.authMethod??"agent";!e.authMethod&&(null!=e.password?o="password":e.keyPath&&(o="keyfile"));let a=["reconnect","ServerAliveInterval=15","ServerAliveCountMax=3","compression=yes","cache=yes","kernel_cache","StrictHostKeyChecking=accept-new","BatchMode=yes"];if(e.readOnly&&a.push("ro"),"keyfile"===o&&e.keyPath&&(a.push(`IdentityFile=${e.keyPath}`),a.push("IdentitiesOnly=yes")),"password"===o){let e=a.indexOf("BatchMode=yes");e>=0&&a.splice(e,1),a.push("password_stdin"),a.push("PreferredAuthentications=password,keyboard-interactive"),a.push("PubkeyAuthentication=no"),a.push("NumberOfPasswordPrompts=1")}return e.extraOptions&&a.push(...e.extraOptions),n.push("-o",a.join(",")),n}e.s(["buildSshfsArgs",0,u,"isValidKeyPath",0,function(e){return!(!e||a.test(e)||e.includes(".."))&&(e.startsWith("/")||e.startsWith("~/"))},"parseSshTarget",0,function(e){let t;if(!e||a.test(e))return null;let r=e.trim(),s=r.indexOf(":");if(s<=0)return null;let i=r.slice(0,s),n=r.slice(s+1);if(!n.startsWith("/")||n.includes(".."))return null;let o=i,u=i.indexOf("@");return u>=0&&(t=i.slice(0,u),o=i.slice(u+1),!t)?null:o&&/^[a-zA-Z0-9.\-]+$/.test(o)&&(!t||/^[a-zA-Z0-9._\-]+$/.test(t))?{user:t,host:o,remotePath:n}:null}],296555);let l=(0,s.promisify)(r.execFile);function c(){return n.default.join(o.default.homedir(),".wiki-viewer","mounts")}async function d(){if(!0!==t)try{await l("sshfs",["--version"]),t=!0}catch{throw Error("sshfs binary not found. Install sshfs + FUSE (e.g. `apt install sshfs`, `brew install macfuse sshfs`) and ensure it is on PATH.")}}async function f(t){var r;let s=n.default.resolve(t),o=!1;try{o=(await (0,i.readFile)("/proc/mounts","utf8")).split("\n").some(e=>{let t=e.split(" ");return t[1]===s&&/fuse/.test(t[2]??"")})}catch{o=!1}return!!o&&(r=s,new Promise(t=>{let s=!1,i=setTimeout(()=>{s||(s=!0,t(!1))},4e3);e.A(687903).then(({readdir:e})=>e(r)).then(()=>{s||(s=!0,clearTimeout(i),t(!0))}).catch(()=>{s||(s=!0,clearTimeout(i),t(!1))})}))}async function h(e){await d(),await (0,i.mkdir)(e.mountpoint,{recursive:!0});let t=u(e);if(await new Promise((s,i)=>{let n=(0,r.spawn)("sshfs",t,{stdio:["pipe","ignore","pipe"]}),o="",a=setTimeout(()=>{n.kill("SIGKILL"),i(Error("sshfs mount timed out after 25s."))},25e3);n.stderr?.on("data",e=>{o+=e.toString()}),n.on("error",e=>{clearTimeout(a),i(e.message.includes("ENOENT")?Error("sshfs binary not found on PATH."):e)}),n.on("close",e=>{clearTimeout(a),0===e?s():i(Error(`sshfs exited ${e}: ${o.trim()||"mount failed"}`))}),"password"===e.authMethod&&n.stdin?.write((e.password??"")+"\n"),n.stdin?.end()}),!await f(e.mountpoint))throw Error("sshfs reported success but the mount is not live.")}async function m(e){let t=n.default.resolve(e);for(let[e,r]of[["fusermount",["-u","-z",t]],["umount",[t]]])try{await l(e,r);break}catch{}try{await (0,i.rmdir)(t)}catch{}}e.s(["assertSshfsAvailable",0,d,"isMounted",0,f,"mountSshfs",0,h,"mountpointFor",0,function(e){return n.default.join(c(),e)},"mountsDir",0,c,"unmountSshfs",0,m],256294)},499465,e=>{"use strict";var t=e.i(750227),r=e.i(660526),s=e.i(902157),i=e.i(666680);let n=t.default.join(process.env.HOME??r.default.homedir(),".wiki-viewer"),o=t.default.join(n,"api-key");function a(){return(0,s.existsSync)(o)?(0,s.readFileSync)(o,"utf-8").trim():""}e.s(["getApiKey",0,a,"isApiKeyRequest",0,function(e){return(function(e){let t=[],r=e.headers.get("authorization")??"";if(r.startsWith("Bearer ")){let e=r.slice(7).trim();e&&t.push(e)}return t})(e).some(e=>(function(e){let t=a();if(!t||!e||t.length!==e.length)return!1;try{return(0,i.timingSafeEqual)(Buffer.from(t,"utf-8"),Buffer.from(e,"utf-8"))}catch{return!1}})(e))},"rotateApiKey",0,function(){(0,s.mkdirSync)(n,{recursive:!0});let e=(0,i.randomBytes)(32).toString("hex");(0,s.writeFileSync)(o,e,{mode:384});try{(0,s.chmodSync)(o,384)}catch{}return e}])},660038,e=>{"use strict";var t=e.i(750227),r=e.i(666680),s=e.i(902157),i=e.i(254226),n=e.i(499465),o=e.i(583627),a=e.i(359211);async function u(e,i){var o;let a;if(!("1"===process.env.WIKI_NO_AUTH||(0,n.isApiKeyRequest)(e)))return{ok:!1,status:400,code:"root_requires_api_key"};let u=function(e){let r,i=t.default.resolve(e);try{r=(0,s.statSync)(i)}catch{return{ok:!1,code:"root_not_found"}}return r.isDirectory()?{ok:!0,rootDir:i}:{ok:!1,code:"root_not_a_directory"}}(i);return u.ok?{ok:!0,ws:(o=u.rootDir,a=(0,r.createHash)("sha256").update(o).digest("hex").slice(0,12),{id:`ws_eph_${a}`,name:t.default.basename(o)||"workspace",rootDir:o,createdAt:new Date(0).toISOString(),ephemeral:!0})}:{ok:!1,status:400,code:u.code}}async function l(e){let t,r=new URL(e.url);if("1"===process.env.WIKI_LITE){let t=r.searchParams.get("root");return t?u(e,t):{ok:!1,status:400,code:"root_required"}}await (0,a.migrateConfigToWorkspaces)();let s=r.searchParams.get("root");if(s)return u(e,s);let i=r.searchParams.get("ws")??e.headers.get("x-workspace")??null;if(i)t=await (0,a.getWorkspace)(i)??null;else{let e=await (0,a.listWorkspaces)();if(0===e.length)return{ok:!1,status:400,code:"WORKSPACE_REQUIRED"};t=e.slice().sort((e,t)=>{let r=e.lastOpenedAt?new Date(e.lastOpenedAt).getTime():0,s=t.lastOpenedAt?new Date(t.lastOpenedAt).getTime():0;return s!==r?s-r:e.id<t.id?-1:+(e.id>t.id)})[0]}return t?(t.ssh&&await (0,a.ensureWorkspaceMounted)(t),{ok:!0,ws:t}):{ok:!1,status:i?404:400,code:i?"WORKSPACE_NOT_FOUND":"WORKSPACE_REQUIRED"}}async function c(e,t="read"){if("1"===process.env.WIKI_NO_AUTH){let r=await l(e);if(!r.ok)return r;let{ws:s}=r;return"write"===t&&s.readOnly?{ok:!1,status:403,code:"WORKSPACE_READ_ONLY"}:{ok:!0,ws:s,rootDir:s.rootDir,userId:"local",isAdmin:!0}}let r=await (0,i.requireUser)(e);if(!r.ok)return{ok:!1,status:401,code:"UNAUTHORIZED"};let s=await (0,o.isAdmin)(r.user.id,r.user.email),n=await l(e);if(!n.ok)return n;let{ws:u}=n;return u.ephemeral||(0,a.userCanAccess)(u,r.user.id,s)?"write"===t&&u.readOnly?{ok:!1,status:403,code:"WORKSPACE_READ_ONLY"}:{ok:!0,ws:u,rootDir:u.rootDir,userId:r.user.id,isAdmin:s}:{ok:!1,status:403,code:"WORKSPACE_FORBIDDEN"}}async function d(e,t="read"){let r=await l(e);if(!r.ok)return r;let{ws:s}=r;return"write"===t&&s.readOnly?{ok:!1,status:403,code:"WORKSPACE_READ_ONLY"}:{ok:!0,ws:s,rootDir:s.rootDir}}e.s(["resolveWorkspaceForAgent",0,d,"resolveWorkspaceForUser",0,c],660038)}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__0ou7hai._.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
module.exports=[402662,e=>{"use strict";var t=e.i(351216);e.s(["checkOrigin",0,function(e){let r=e.method.toUpperCase();if("GET"===r||"HEAD"===r||"OPTIONS"===r)return null;let n=e.headers.get("origin"),s=e.headers.get("referer");if(!n&&!s)return null;let a=function(e){let t=Array.from(new Set(["localhost","127.0.0.1",e.split(":")[0],...(process.env.WIKI_OWNER_HOSTS??"").split(",").map(e=>e.trim()).filter(Boolean)])),r=["",":3000",":3003"];e.includes(":")&&r.push(":"+e.split(":")[1]);let n=new Set;for(let e of t)for(let t of["http","https"])for(let s of r)n.add(`${t}://${e}${s}`);return n}(e.headers.get("host")??"");if(n)return a.has(n)?null:t.NextResponse.json({error:"FORBIDDEN",message:"Bad origin"},{status:403});if(s){try{let{protocol:e,host:t}=new URL(s);if(a.has(`${e}//${t}`))return null}catch{}return t.NextResponse.json({error:"FORBIDDEN",message:"Bad referer"},{status:403})}return null}])},761095,(e,t,r)=>{t.exports=e.x("node:net",()=>require("node:net"))},345212,e=>{"use strict";var t=e.i(874533),r=e.i(902157),n=e.i(761095),s=e.i(750227);let a=new Map;function o(e){return`${e.workspaceId}\0${e.relPath}`}function i(e,t){return new Promise(r=>{let s=(0,n.createConnection)(e,t);s.setTimeout(800),s.on("connect",()=>{s.destroy(),r(!0)}),s.on("error",()=>{s.destroy(),r(!1)}),s.on("timeout",()=>{s.destroy(),r(!1)})})}async function l(e){let[t,r]=await Promise.all([i(e,"127.0.0.1"),i(e,"::1")]);return t||r}async function u(e,t=3e4){let r=Date.now()+t;for(;Date.now()<r&&!e.abort.signal.aborted;){if(await l(e.port))return e.port;await new Promise(e=>setTimeout(e,400))}return null}function p(e){let t=s.default.join(e,"package.json");if(!(0,r.existsSync)(t))return null;try{return JSON.parse((0,r.readFileSync)(t,"utf-8"))}catch{return null}}function c(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function d(e,t){return c(t,"start")?"start":c(t,"preview")&&(0,r.existsSync)(s.default.join(e,"dist"))?"preview":c(t,"dev")?"dev":null}function h(){let e=s.default.dirname(process.execPath),t=process.env.PATH??"";return t.split(s.default.delimiter).includes(e)?t:`${e}${s.default.delimiter}${t}`}async function f(e,i,l,f){var v;let g=o({workspaceId:e,relPath:i}),m=a.get(g);if(m&&"stopped"!==m.status&&"error"!==m.status&&m.process)return{port:m.port};m&&(m.abort.abort(),a.delete(g));let w=await new Promise((e,t)=>{let r=(0,n.createServer)();r.listen(0,"127.0.0.1",()=>{let t=r.address(),n="object"==typeof t&&t?t.port:0;r.close(()=>e(n))}),r.on("error",t)}),R=(0,r.existsSync)(s.default.join(l,"pnpm-lock.yaml"))?"pnpm":(0,r.existsSync)(s.default.join(l,"yarn.lock"))?"yarn":(0,r.existsSync)(s.default.join(l,"bun.lockb"))||(0,r.existsSync)(s.default.join(l,"bun.lock"))?"bun":"npm",y=function(e,t,r,n){let s=p(e);if(!s)return null;let a=s.scripts??{},o=Object.keys({...s.dependencies,...s.devDependencies}).some(e=>"vite"===e||e.includes("vite")),i=["--port",String(r)],l=e=>({bin:t,args:"npm"===t?["run",e,"--",...i]:["run",e,...i],isVite:o});if(n)return c(a,n)?l(n):null;let u=d(e,a);return u?l(u):s.main?{bin:"node",args:[s.main,...i],isVite:!1}:null}(l,R,w,f);if(!y)throw Error("No runnable script found in package.json (need start, preview, or dev)");let _={workspaceId:e,relPath:i,port:w,process:null,status:"installing",logs:[],generation:1,abort:new AbortController};a.set(g,_);let E=e=>{_.logs.push(e),_.logs.length>200&&_.logs.shift()};try{(0,r.existsSync)(s.default.join(l,"node_modules"))||(E(`[wiki-viewer] Running ${R} install…`),await (v=_.abort.signal,new Promise((e,r)=>{if(v.aborted)return void r(Error("Install aborted"));let n=[],s=e=>{E(e),n.push(e)},a=(0,t.spawn)(R,["install"],{cwd:l,stdio:"pipe",env:{...process.env,PATH:h()}}),o=()=>{try{a.kill("SIGTERM")}catch{}};v.addEventListener("abort",o,{once:!0});let i=e=>{for(let t of e.toString().split("\n")){let e=t.trim();e&&s(e)}};a.stdout?.on("data",i),a.stderr?.on("data",i),a.on("error",e=>{v.removeEventListener("abort",o),r(e)}),a.on("exit",t=>{if(v.removeEventListener("abort",o),0===t)e();else{let e=n.slice(-20).join("\n");r(Error(`${R} install failed (exit ${t}):
|
|
2
|
-
${e}`))}})}))),_.status="starting",E(`[wiki-viewer] Starting on port ${w}: ${y.bin} ${y.args.join(" ")}`);let e=(0,t.spawn)(y.bin,y.args,{cwd:l,stdio:"pipe",env:{...process.env,PATH:h(),PORT:String(w),VITE_PORT:String(w)}});_.process=e;let n=e=>{for(let t of e.toString().split("\n")){let e=t.trim();e&&E(e)}};return e.stdout?.on("data",n),e.stderr?.on("data",n),e.on("exit",e=>{a.get(g)!==_||"stopped"!==_.status&&(_.process=null,_.status=0===e||null===e?"stopped":"error",_.error=e?`Process exited with code ${e}`:void 0)}),u(_).then(t=>{if(a.get(g)===_&&!_.abort.signal.aborted)if(t)_.status="running";else{_.status="error",_.error="Port never became reachable (30 s timeout)";try{e.kill("SIGTERM")}catch{}}}),{port:w}}catch(e){throw a.get(g)===_&&(_.status="error",_.error=e instanceof Error?e.message:String(e)),e}}e.s(["getScripts",0,function(e){let t=p(e);if(!t)return{scripts:[],defaultScript:null};let r=t.scripts??{};return{scripts:Object.keys(r),defaultScript:d(e,r)}},"getStatus",0,function(e,t){let r=a.get(o({workspaceId:e,relPath:t}));return r?{status:r.status,port:r.port||void 0,error:r.error,logs:r.logs}:{status:"stopped",logs:[]}},"resolveByPrefix",0,function(e,t){for(let r=t.length;r>0;r--){let n=t.slice(0,r).join("/"),s=a.get(o({workspaceId:e,relPath:n}));if(s&&"running"===s.status&&s.port){let e="/"+t.slice(r).join("/");return{relPath:n,port:s.port,rest:e}}}return null},"startApp",0,f,"stopApp",0,function(e,t){let r=o({workspaceId:e,relPath:t}),n=a.get(r);if(!n)return;n.abort.abort();let s=n.process;if(n.process=null,a.delete(r),!s)return;let i=setTimeout(()=>{try{!s.killed&&s.pid&&s.kill("SIGKILL")}catch{}},2e3);s.once("exit",()=>clearTimeout(i));try{!s.killed&&s.pid&&s.kill("SIGTERM")}catch{}}])},711376,e=>{"use strict";var t=e.i(985426),r=e.i(257574),n=e.i(507835),s=e.i(457789),a=e.i(119791),o=e.i(141062),i=e.i(957291),l=e.i(535899),u=e.i(610241),p=e.i(62749),c=e.i(624891),d=e.i(725836),h=e.i(532736),f=e.i(257858),v=e.i(487476),g=e.i(193695);e.i(484264);var m=e.i(315709),w=e.i(351216),R=e.i(402662),y=e.i(660038),_=e.i(359211),E=e.i(345212);function x(e){return"1"===process.env.WIKI_NO_AUTH||"1"===process.env.WIKI_ALLOW_APP_RUNNER||e.isAdmin}async function b(e){let t=await (0,y.resolveWorkspaceForUser)(e);if(!t.ok)return w.NextResponse.json({error:t.code},{status:t.status});let{searchParams:r}=new URL(e.url),n=r.get("path")??"",s=(0,E.getStatus)(t.ws.id,n),a=(0,_.safeWorkspacePath)(t.rootDir,n),o=a?(0,E.getScripts)(a):{scripts:[],defaultScript:null};return w.NextResponse.json({...s,...o})}async function S(e){let t=(0,R.checkOrigin)(e);if(t)return t;let r=await (0,y.resolveWorkspaceForUser)(e,"write");if(!r.ok)return w.NextResponse.json({error:r.code},{status:r.status});let{rootDir:n}=r;if(!x(r))return w.NextResponse.json({error:"ADMIN_REQUIRED"},{status:403});let s=await e.json(),a=s.path;if(!a||"string"!=typeof a)return w.NextResponse.json({error:"Missing path"},{status:400});let o=(0,_.safeWorkspacePath)(n,a);if(!o)return w.NextResponse.json({error:"Invalid path"},{status:400});let i="string"==typeof s.script?s.script:void 0;try{let e=await (0,E.startApp)(r.ws.id,a,o,i);return w.NextResponse.json(e)}catch(e){return w.NextResponse.json({error:String(e)},{status:500})}}async function k(e){let t=(0,R.checkOrigin)(e);if(t)return t;let r=await (0,y.resolveWorkspaceForUser)(e,"write");if(!r.ok)return w.NextResponse.json({error:r.code},{status:r.status});if(!x(r))return w.NextResponse.json({error:"ADMIN_REQUIRED"},{status:403});let n=(await e.json()).path;return n&&"string"==typeof n?((0,E.stopApp)(r.ws.id,n),w.NextResponse.json({ok:!0})):w.NextResponse.json({error:"Missing path"},{status:400})}e.s(["DELETE",0,k,"GET",0,b,"POST",0,S],41743);var P=e.i(41743);let j=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/wiki/app/route",pathname:"/api/wiki/app",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/wiki/app/route.ts",nextConfigOutput:"standalone",userland:P,...{}}),{workAsyncStorage:N,workUnitAsyncStorage:A,serverHooks:T}=j;async function C(e,t,n){n.requestMeta&&(0,s.setRequestMeta)(e,n.requestMeta),j.isDev&&(0,s.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let w="/api/wiki/app/route";w=w.replace(/\/index$/,"")||"/";let R=await j.prepare(e,t,{srcPage:w,multiZoneDraftMode:!1});if(!R)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:y,params:_,nextConfig:E,parsedUrl:x,isDraftMode:b,prerenderManifest:S,routerServerContext:k,isOnDemandRevalidate:P,revalidateOnlyGenerated:N,resolvedPathname:A,clientReferenceManifest:T,serverActionsManifest:C}=R,O=(0,i.normalizeAppPath)(w),I=!!(S.dynamicRoutes[O]||S.routes[A]),D=async()=>((null==k?void 0:k.render404)?await k.render404(e,t,x,!1):t.end("This page could not be found"),null);if(I&&!b){let e=!!S.routes[A],t=S.dynamicRoutes[O];if(t&&!1===t.fallback&&!e){if(E.adapterPath)return await D();throw new g.NoFallbackError}}let q=null;!I||j.isDev||b||(q="/index"===(q=A)?"/":q);let $=!0===j.isDev||!I,U=I&&!$;C&&T&&(0,o.setManifestsSingleton)({page:w,clientReferenceManifest:T,serverActionsManifest:C});let H=e.method||"GET",M=(0,a.getTracer)(),L=M.getActiveScopeSpan(),F=!!(null==k?void 0:k.isWrappedByNextServer),B=!!(0,s.getRequestMeta)(e,"minimalMode"),K=(0,s.getRequestMeta)(e,"incrementalCache")||await j.getIncrementalCache(e,E,S,B);null==K||K.resetRequestCache(),globalThis.__incrementalCache=K;let W={params:_,previewProps:S.preview,renderOpts:{experimental:{authInterrupts:!!E.experimental.authInterrupts},cacheComponents:!!E.cacheComponents,supportsDynamicResponse:$,incrementalCache:K,cacheLifeProfiles:E.cacheLife,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,s)=>j.onRequestError(e,t,n,s,k)},sharedContext:{buildId:y}},G=new l.NodeNextRequest(e),V=new l.NodeNextResponse(t),z=u.NextRequestAdapter.fromNodeNextRequest(G,(0,u.signalFromNodeResponse)(t));try{let s,o=async e=>j.handle(z,W).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=M.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==p.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let n=r.get("next.route");if(n){let t=`${H} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t),s&&s!==e&&(s.setAttribute("http.route",n),s.updateName(t))}else e.updateName(`${H} ${w}`)}),i=async s=>{var a,i;let l=async({previousCacheEntry:r})=>{try{if(!B&&P&&N&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let a=await o(s);e.fetchMetrics=W.renderOpts.fetchMetrics;let i=W.renderOpts.pendingWaitUntil;i&&n.waitUntil&&(n.waitUntil(i),i=void 0);let l=W.renderOpts.collectedTags;if(!I)return await (0,d.sendResponse)(G,V,a,W.renderOpts.pendingWaitUntil),null;{let e=await a.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(a.headers);l&&(t[v.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==W.renderOpts.collectedRevalidate&&!(W.renderOpts.collectedRevalidate>=v.INFINITE_CACHE)&&W.renderOpts.collectedRevalidate,n=void 0===W.renderOpts.collectedExpire||W.renderOpts.collectedExpire>=v.INFINITE_CACHE?void 0:W.renderOpts.collectedExpire;return{value:{kind:m.CachedRouteKind.APP_ROUTE,status:a.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==r?void 0:r.isStale)&&await j.onRequestError(e,t,{routerKind:"App Router",routePath:w,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:P})},!1,k),t}},u=await j.handleResponse({req:e,nextConfig:E,cacheKey:q,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:S,isRoutePPREnabled:!1,isOnDemandRevalidate:P,revalidateOnlyGenerated:N,responseGenerator:l,waitUntil:n.waitUntil,isMinimalMode:B});if(!I)return null;if((null==u||null==(a=u.value)?void 0:a.kind)!==m.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(i=u.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});B||t.setHeader("x-nextjs-cache",P?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),b&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let p=(0,h.fromNodeOutgoingHttpHeaders)(u.value.headers);return B&&I||p.delete(v.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||p.get("Cache-Control")||p.set("Cache-Control",(0,f.getCacheControlHeader)(u.cacheControl)),await (0,d.sendResponse)(G,V,new Response(u.value.body,{headers:p,status:u.value.status||200})),null};F&&L?await i(L):(s=M.getActiveScopeSpan(),await M.withPropagatedContext(e.headers,()=>M.trace(p.BaseServerSpan.handleRequest,{spanName:`${H} ${w}`,kind:a.SpanKind.SERVER,attributes:{"http.method":H,"http.target":e.url}},i),void 0,!F))}catch(t){if(t instanceof g.NoFallbackError||await j.onRequestError(e,t,{routerKind:"App Router",routePath:O,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:P})},!1,k),I)throw t;return await (0,d.sendResponse)(G,V,new Response(null,{status:500})),null}}e.s(["handler",0,C,"patchFetch",0,function(){return(0,n.patchFetch)({workAsyncStorage:N,workUnitAsyncStorage:A})},"routeModule",0,j,"serverHooks",0,T,"workAsyncStorage",0,N,"workUnitAsyncStorage",0,A],711376)},168315,e=>{e.v(t=>Promise.all(["server/chunks/0sag_@better-auth_memory-adapter_dist_index_mjs_0pvj6im._.js"].map(t=>e.l(t))).then(()=>t(862112)))},769787,e=>{e.v(t=>Promise.all(["server/chunks/01er_better-auth_dist_adapters_kysely-adapter_index_mjs_0s~-4gu._.js"].map(t=>e.l(t))).then(()=>t(717789)))},580632,e=>{e.v(e=>Promise.resolve().then(()=>e(270406)))},947559,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_bun-sqlite-dialect-DzNwOpKv_mjs_0z1z6m4._.js"].map(t=>e.l(t))).then(()=>t(495181)))},715018,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_node-sqlite-dialect_mjs_0qqlvhl._.js"].map(t=>e.l(t))).then(()=>t(698370)))},146843,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_d1-sqlite-dialect-C2B7YsIT_mjs_0wynrz3._.js"].map(t=>e.l(t))).then(()=>t(143740)))},697743,e=>{e.v(t=>Promise.all(["server/chunks/0.u4_next_05jevxw._.js"].map(t=>e.l(t))).then(()=>t(428325)))},99243,e=>{e.v(e=>Promise.resolve().then(()=>e(313414)))},893412,e=>{e.v(e=>Promise.resolve().then(()=>e(499465)))},687903,e=>{e.v(e=>Promise.resolve().then(()=>e(912714)))}];
|
|
3
|
-
|
|
4
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__12x8v2r._.js.map
|