@rexvane/piweb 0.3.19 → 0.3.20
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/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +4 -4
- package/.next/build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/react-loadable-manifest.json +1 -1
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +1 -1
- package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/api/remote/route.js +2 -2
- package/.next/server/app/api/update/route.js +1 -1
- package/.next/server/app/api/version/route.js +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +3 -3
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
- package/.next/server/app/index.segments/_full.segment.rsc +3 -3
- package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/login.html +1 -1
- package/.next/server/app/login.rsc +2 -2
- package/.next/server/app/login.segments/_full.segment.rsc +2 -2
- package/.next/server/app/login.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +4 -4
- package/.next/server/chunks/496.js +1 -1
- package/.next/server/chunks/924.js +2 -2
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/4686-b1e9fa876d0ea671.js +1 -0
- package/.next/static/chunks/839.d3fe337a9117c325.js +1 -0
- package/.next/static/chunks/webpack-3614a8337843456b.js +1 -0
- package/package.json +1 -1
- package/src/app/api/remote/route.ts +12 -2
- package/src/components/RemoteSection.tsx +41 -8
- package/src/i18n.tsx +8 -6
- package/src/lib/remote/mobile-proxy.ts +8 -2
- package/src/lib/remote/supervisor.ts +18 -8
- package/.next/static/chunks/4686-e3825f3b6a384aa1.js +0 -1
- package/.next/static/chunks/839.7403c6bdace4c56c.js +0 -1
- package/.next/static/chunks/webpack-bd2b9202ecbcdcaa.js +0 -1
- /package/.next/static/{JDGSR-TIbk9qZWcUNYIX3 → _Y3Lq0lI5RJ1tFSOnDi0L}/_buildManifest.js +0 -0
- /package/.next/static/{JDGSR-TIbk9qZWcUNYIX3 → _Y3Lq0lI5RJ1tFSOnDi0L}/_ssgManifest.js +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(()=>{var a={};a.id=844,a.ids=[844],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},26412:(a,b,c)=>{"use strict";c.d(b,{Fu:()=>m,JK:()=>q,Qx:()=>u,VR:()=>x,tR:()=>w});var d=c(77598),e=c(73024),f=c.n(e),g=c(48161),h=c.n(g),i=c(76760),j=c.n(i);let k=/^[A-Za-z0-9_-]+$/;function l(a){return"~"===a?h().homedir():a.startsWith("~/")||a.startsWith("~\\")?j().join(h().homedir(),a.slice(2)):a}function m(){let a=process.env.PI_CODING_AGENT_DIR;return a?l(a):j().join(h().homedir(),".pi","agent")}function n(a){let b=a.trim();if(!k.test(b)||b.length%4==1)return;let c="=".repeat((4-b.length%4)%4),d=Buffer.from(b.replace(/-/g,"+").replace(/_/g,"/")+c,"base64");return 32===d.byteLength?d:void 0}let o=new Map;function p(a){try{return n(f().readFileSync(a,"utf8"))}catch{return}}function q(){let a,b=process.env.PI_WEB_SECRET;if(b){let a=n(b);if(!a)throw Error("PI_WEB_SECRET must be 32 base64url-encoded bytes");return a}let c=(a=process.env.PI_WEB_SECRET_FILE)?l(a):j().join(m(),"web-secret"),e=o.get(c);if(e)return e;let g=p(c)??function(a){let b=(0,d.randomBytes)(32);f().mkdirSync(j().dirname(a),{recursive:!0});try{return f().writeFileSync(a,`${b.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}
|
|
2
2
|
`,{flag:"wx",mode:384}),b}catch(c){if("EEXIST"!==c?.code)throw c;let b=p(a);if(!b)throw Error(`web-secret file exists but is not a valid 32-byte key: ${a}`);return b}}(c);return o.set(c,g),g}let r={notBefore:0,revoked:new Map},s=null;function t(){return j().join(m(),"web-revocations.json")}function u(){let a,b=t();try{let c=f().statSync(b);a=`${c.mtimeMs}:${c.ctimeMs}:${c.size}`}catch{return r}if(s?.file===b&&s.stamp===a)return s.value;let c=r;try{let a=JSON.parse(f().readFileSync(b,"utf8")),d=new Map;if(a.revoked&&"object"==typeof a.revoked)for(let[b,c]of Object.entries(a.revoked))"number"==typeof c&&Number.isFinite(c)&&d.set(b,c);c={notBefore:"number"==typeof a.notBefore&&Number.isFinite(a.notBefore)?a.notBefore:0,revoked:d}}catch{}return s={file:b,stamp:a,value:c},c}function v(a){let b=t();f().mkdirSync(j().dirname(b),{recursive:!0});let c=`${b}.${process.pid}.${(0,d.randomBytes)(6).toString("hex")}.tmp`;try{f().writeFileSync(c,`${JSON.stringify({notBefore:a.notBefore,revoked:Object.fromEntries(a.revoked)},null,2)}
|
|
3
|
-
`,{flag:"wx",mode:384}),f().renameSync(c,b)}finally{f().rmSync(c,{force:!0}),s=null}}function w(a,b,c=Date.now()){let d=u(),e=new Map([...d.revoked].filter(([,a])=>a>c));e.set(a,b),v({notBefore:d.notBefore,revoked:e})}function x(a=Date.now()){v({notBefore:Math.max(a,u().notBefore),revoked:new Map})}},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},31421:a=>{"use strict";a.exports=require("node:child_process")},37067:a=>{"use strict";a.exports=require("node:http")},38522:a=>{"use strict";a.exports=require("node:zlib")},44708:a=>{"use strict";a.exports=require("node:https")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{"use strict";a.exports=require("node:os")},54528:(a,b,c)=>{"use strict";c.d(b,{mW:()=>h,C0:()=>m,LR:()=>n,qd:()=>k,BY:()=>l});var d=c(77598);let e="piweb_session_",f=/^[A-Za-z0-9_-]*$/;function g(a){if(!f.test(a)||a.length%4==1)return;let b=Buffer.from(a.replace(/-/g,"+").replace(/_/g,"/"),"base64");return b.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")===a?b:void 0}function h(a=process.env){let b=(a.PI_WEB_AUTH??"").trim().toLowerCase();return"1"===b||"true"===b||"on"===b||"yes"===b}function i(a){let b=a.headers.get("host")||new URL(a.url).host;if(b)try{let a=new URL(`http://${b}`);if(a.username||a.password)return;return a.host.toLowerCase()}catch{return}}function j(a){return e+(0,d.createHash)("sha256").update(a).digest("base64url")}function k(a,b){let c=i(a);if(!c)return;let e=function(a,b){if(a)for(let c of a.split(";")){let a=c.indexOf("=");if(!(a<0)&&c.slice(0,a).trim()===b)try{return decodeURIComponent(c.slice(a+1).trim())}catch{break}}}(a.headers.get("cookie"),j(c));if(!e)return;let f=function(a,b){let c,e=a.split(".");if(3!==e.length||"v1"!==e[0])return;let f=e[1],h=e[2];if(!f||!h)return;let i=g(h);if(!i)return;let j=(0,d.createHmac)("sha256",b).update(f).digest();if(i.byteLength!==j.byteLength||!(0,d.timingSafeEqual)(i,j))return;let k=g(f);if(!k)return;try{c=JSON.parse(k.toString("utf8"))}catch{return}if("object"!=typeof c||null===c||Array.isArray(c))return;let l=c;if(1===l.version&&"string"==typeof l.authority&&Number.isSafeInteger(l.issuedAt)&&Number.isSafeInteger(l.expiresAt))return l}(e,b);if(f&&f.authority===c)return{id:(0,d.createHash)("sha256").update(e).digest("base64url"),payload:f}}function l(a,b,c=Date.now(),d){let e=k(a,b);if(!e)return!1;let{payload:f}=e;return!(d&&(f.issuedAt<d.notBefore||d.revoked.has(e.id)))&&f.issuedAt<=c&&f.expiresAt>c&&f.expiresAt>f.issuedAt&&f.expiresAt-f.issuedAt<=2592e6}function m(a){let b=i(a);return{name:b?j(b):e,value:""}}function n(a){return{...{httpOnly:!0,sameSite:"strict",secure:"https:"===new URL(a.url).protocol||"https"===(a.headers.get("x-forwarded-proto")??"").split(",")[0].trim(),path:"/",maxAge:2592e3},maxAge:0}}},57075:a=>{"use strict";a.exports=require("node:stream")},61073:(a,b,c)=>{"use strict";c.r(b),c.d(b,{DELETE:()=>T,GET:()=>R,POST:()=>S,dynamic:()=>N});var d=c(23211),e=c(31421),f=c(73024),g=c.n(f),h=c(44708),i=c.n(h),j=c(48161),k=c.n(j),l=c(76760),m=c.n(l),n=c(54528),o=c(26412),p=c(37067),q=c.n(p),r=c(57075),s=c(38522),t=c.n(s),u=c(75587);let v=JSON.parse('{"A":"/*\\n * 手机端适配。不改 PiWeb,只在经代理的远程页面上生效\\n * (本机直连 127.0.0.1:30141 的桌面页面完全不加载它)。\\n *\\n * 取值参照 dsh-remote 为 DSH 定的那套移动适配(同作者),并针对 PiWeb 的实测问题:\\n * 390px 下输入框 304px、markdown 表格 442px 超出视口、底部统计行被截断。\\n */\\n@media (max-width: 840px) {\\n\\t/* 1) 输入框自适应高度失控。\\n\\t 实测:视口 390 → 304px,500 → 43px,700+ → 22px;而自然内容高始终 22px。\\n\\t 原因在 ChatInput 的 autoSize():它把\\"被 flex 拉伸后\\"的 scrollHeight 写进了\\n\\t inline height,写回后又把自己撑住,形成自锁。inline 样式不是 important,\\n\\t 所以这里用 max-height !important 把它夹住。 */\\n\\ttextarea {\\n\\t\\tmax-height: 132px !important;\\n\\t\\toverflow-y: auto !important;\\n\\t}\\n\\n\\t/* 2) Markdown 宽表格超出视口被裁掉(实测 442 > 390,body 又是 overflow-x:hidden,\\n\\t 等于右侧内容既看不到也滑不到)。让表格自己横向滚动。 */\\n\\t.md table {\\n\\t\\tdisplay: block !important;\\n\\t\\tmax-width: 100% !important;\\n\\t\\toverflow-x: auto !important;\\n\\t\\t-webkit-overflow-scrolling: touch;\\n\\t}\\n\\n\\t/* 3) 全局溢出护栏(dsh-remote 同款):任何一块都不许把文档撑宽 */\\n\\thtml,\\n\\tbody {\\n\\t\\tmax-width: 100vw !important;\\n\\t\\toverflow-x: hidden !important;\\n\\t}\\n\\tpre {\\n\\t\\tmax-width: 100% !important;\\n\\t\\toverflow-x: auto !important;\\n\\t\\t-webkit-overflow-scrolling: touch;\\n\\t}\\n\\timg,\\n\\tsvg,\\n\\tvideo,\\n\\tcanvas {\\n\\t\\tmax-width: 100% !important;\\n\\t}\\n\\n\\t/* 4) 底部统计行原本 nowrap + ellipsis,手机上「| 输入 2…」之后永远看不到。\\n\\t 改成可横向滑动,滚动条隐藏,信息不再丢。 */\\n\\tdiv.text-center > div.overflow-hidden.text-ellipsis.whitespace-nowrap {\\n\\t\\toverflow-x: auto !important;\\n\\t\\toverflow-y: hidden !important;\\n\\t\\ttext-overflow: clip !important;\\n\\t\\t-webkit-overflow-scrolling: touch;\\n\\t\\tscrollbar-width: none;\\n\\t}\\n\\tdiv.text-center > div.overflow-hidden.text-ellipsis.whitespace-nowrap::-webkit-scrollbar {\\n\\t\\tdisplay: none;\\n\\t}\\n\\n\\t/* 5) 给手机的手势条留位置(没有 insets 的设备 env() 为 0,等于没写) */\\n\\t.pi-main {\\n\\t\\tpadding-bottom: env(safe-area-inset-bottom) !important;\\n\\t}\\n\\n\\t/* 6) 左上角的抽屉按钮。原来是个悬浮的圆角方块(12px/12px、34px),盖在内容上、\\n\\t 和右边那排图标也不在一条水平线上。按 dsh-remote 对 DSH 左侧的做法收成贴角圆形,\\n\\t 尺寸和位置改成与右侧图标完全一致(实测右侧图标是 top 12 / 30\xd730,中心 y=27),\\n\\t 这样整行对齐,按钮底边 42 也在头部分隔线(y=43)之上,不会压住那条线。 */\\n\\t.pi-mobile-menu {\\n\\t\\twidth: 30px !important;\\n\\t\\theight: 30px !important;\\n\\t\\tborder-radius: 999px !important;\\n\\t\\tleft: calc(env(safe-area-inset-left) + 12px) !important;\\n\\t\\ttop: calc(env(safe-area-inset-top) + 12px) !important;\\n\\t}\\n\\t.pi-main > .hairline-b {\\n\\t\\tpadding-left: 52px !important;\\n\\t}\\n\\n\\t/* 7) 右侧大纲导轨是绝对定位的(right-2 + 约 34px 宽的竖条),正文和用户气泡\\n\\t 会从它下面穿过去。不动条宽——那是层级信息——而是把导轨贴边收窄,\\n\\t 再给滚动区留出它实际占的宽度。 */\\n\\t.outline-rail {\\n\\t\\tright: 2px !important;\\n\\t}\\n\\t.outline-rail > div {\\n\\t\\tpadding-left: 6px !important;\\n\\t\\tpadding-right: 2px !important;\\n\\t}\\n\\t.pi-main div.min-h-0.flex-1.overflow-y-auto {\\n\\t\\tpadding-right: 30px !important;\\n\\t}\\n\\n\\t/* 8) 设置弹窗:高度用 100vh(移动端的大视口),内容列又没有 min-height:0\\n\\t 也没有 overflow-y,于是 1986px 的内容被 overflow:hidden 裁在 828px 里,\\n\\t 手机上完全滑不动。实测 client=828 / scroll=1986。 */\\n\\t.settings-dialog {\\n\\t\\theight: calc(100vh - 16px) !important;\\n\\t}\\n\\t.settings-dialog > div:not(.settings-nav) {\\n\\t\\tmin-height: 0 !important;\\n\\t\\toverflow-y: auto !important;\\n\\t\\t-webkit-overflow-scrolling: touch;\\n\\t}\\n\\n\\t/* 9) 模型 / 思考等级浮层锚在胶囊自己的 relative 容器上,right-0 是**胶囊**右缘,\\n\\t 312px 往左展开就顶出屏幕左边(实测 left 为负)。把胶囊容器解除定位,\\n\\t 浮层改用整张输入卡(上一层 relative)做定位父级,right-0 落在卡片右缘就装得下。\\n\\t :has() 在移动端 Safari 15.4+ / Chrome 105+ 都可用。 */\\n\\tdiv.relative:has(> button.chip[aria-haspopup=\\"menu\\"]) {\\n\\t\\tposition: static !important;\\n\\t}\\n\\n\\t/* 10) 设置→模型 的提供方卡片:那一行是 nowrap,中间的名字列被右侧一串按钮挤成\\n\\t 0 宽(实测 w=0),于是「凭据: auth.json」竖着拆行、「编辑」拆成「编/辑」、\\n\\t 右侧的按钮还被裁掉。手机上让这行能换行,并给名字列一个真实的最小宽度。 */\\n\\t.settings-dialog div.flex.items-center.gap-3:has(> div.min-w-0.flex-1) {\\n\\t\\tflex-wrap: wrap !important;\\n\\t\\trow-gap: 8px !important;\\n\\t}\\n\\t.settings-dialog div.flex.items-center.gap-3:has(> div.min-w-0.flex-1) > div.min-w-0.flex-1 {\\n\\t\\tflex: 1 1 140px !important;\\n\\t\\tmin-width: 140px !important;\\n\\t}\\n\\n\\t/* 11) 设置里 Row 那一套([文字列][控件列] 两栏)。控件列是 flex-none,\\n\\t 有的行右侧很宽(「开关 + 两个数字输入框」≈272px、「繁忙时 Enter」的下拉≈233px),\\n\\t 于是 390px 下文字列只剩 70px 左右,中文按每行一两字竖排,行高被撑到\\n\\t 122px / 218px(实测 70\xd7122、69\xd7218)。\\n\\t 试过的几种写法与实测结论:\\n\\t - 只给文字列 flex 增长权重:完全没用(那行没有空闲空间)\\n\\t - 只缩小 gap:只能缓解(70\xd7122 → 86\xd798)\\n\\t - 让所有 Row 都上下排(flex:1 1 100%):能修好,但把本来正常的行也撑高\\n\\t (界面语言 53→85、字体步进 95→105),是密度回退\\n\\t - 正解:文字列 flex-basis 设 0、只留 min-width 当\\"不许被压到多窄\\"的下限。\\n\\t 换行判断用的是 flex-basis(max-content 会很大,所以上一版全换行了),\\n\\t 设成 0 之后判断就只看 min-width:\\n\\t 控件窄的行(界面语言 77px、字体步进 116px)→ 仍并排,保持紧凑\\n\\t 控件宽的行(272px / 233px)→ 控件换到下一行,文字拿满 326px\\n\\t 实测:界面语言 53 不变、界面字体 95→71、繁忙时Enter 239→135、\\n\\t 自动压缩 143→111、自动重试 119→111,全部不再竖排。 */\\n\\t.settings-dialog div.hairline-b.gap-6 {\\n\\t\\tflex-wrap: wrap !important;\\n\\t\\tgap: 8px !important;\\n\\t}\\n\\t.settings-dialog div.hairline-b.gap-6 > div.min-w-0 {\\n\\t\\tflex: 1 1 0 !important;\\n\\t\\tmin-width: 45% !important;\\n\\t}\\n\\t.settings-dialog div.hairline-b.gap-6 > div.flex-none > div.flex.items-center {\\n\\t\\tflex-wrap: wrap !important;\\n\\t\\tjustify-content: flex-end !important;\\n\\t\\trow-gap: 6px !important;\\n\\t}\\n\\n\\t/* 12) 外观主题卡片。卡片是 flex: 1 1 150px 的两列网格,但左右各留 32px 内边距,\\n\\t 159px 的卡片只剩 95px 给标题,于是「石灰与煤炭」「亚麻与苔绿」掉到第二行,\\n\\t 卡片高度变成 110px 而其余是 88px,网格参差(实测 6 张卡:4 张 88 / 2 张 110)。\\n\\t 把左右内边距收到 10px,6 张卡全部回到 88px,标题一行放得下。 */\\n\\t.settings-dialog button[aria-pressed] {\\n\\t\\tpadding-left: 10px !important;\\n\\t\\tpadding-right: 10px !important;\\n\\t}\\n\\n\\t/* 13) 可点目标偏小(实测:字体步进器 26\xd726、reset 48\xd724、开关 36\xd720)。\\n\\t 只扩**热区**,绝不改可见尺寸:开关的滑块位置在 PiWeb 里是写死的\\n\\t (left: 18px / 2px),把开关拉宽会让滑块错位、变成被拉长的怪药丸\\n\\t —— 我第一版写的 min-width:44px 就是这个后果,用户报了\\"启动按钮好丑\\"。\\n\\t 另外这里只做**纵向**扩张(左右不扩):字体步进器 −/+/ 之间只有 8px,\\n\\t 横向扩到 44px 会让两个按钮的热区重叠约 10px,点 − 反而命中 +。 */\\n\\t.settings-dialog .icon-btn,\\n\\t.settings-dialog button.h-6,\\n\\t.settings-dialog button.h-5,\\n\\t.settings-dialog [role=\\"switch\\"] {\\n\\t\\tposition: relative !important;\\n\\t}\\n\\t.settings-dialog .icon-btn::after,\\n\\t.settings-dialog button.h-6::after,\\n\\t.settings-dialog button.h-5::after,\\n\\t.settings-dialog [role=\\"switch\\"]::after {\\n\\t\\tcontent: \\"\\" !important;\\n\\t\\tposition: absolute !important;\\n\\t\\tleft: 0 !important;\\n\\t\\tright: 0 !important;\\n\\t\\ttop: 50% !important;\\n\\t\\theight: max(100%, 44px) !important;\\n\\t\\ttransform: translateY(-50%) !important;\\n\\t\\tborder-radius: 999px !important;\\n\\t}\\n}\\n\\n/* 手机上的浮层统一兜底:不许比屏幕宽,不许比屏幕高,超出就自己滚。 */\\n@media (max-width: 840px) {\\n\\t.popover {\\n\\t\\tmax-width: calc(100vw - 16px) !important;\\n\\t\\tmax-height: 420px !important;\\n\\t\\toverflow-y: auto !important;\\n\\t\\t-webkit-overflow-scrolling: touch;\\n\\t}\\n}\\n\\n/* 11) 模型名太长时跑马灯。取值与做法照搬 dsh-remote 对 DSH 的:\\n\\t 名字窗口固定 28vw 并允许被压缩,装得下就完全不动;装不下时由注入的\\n\\t mobile-fit.js 打上 data-piweb-marquee,再由这里的两份伪元素首尾相接匀速左移。\\n\\t 一份走完另一份正好接上(travel 已含间隔),所以循环处看不出接缝。 */\\n@media (max-width: 840px) {\\n\\tbutton.chip[aria-haspopup=\\"menu\\"] > span.truncate {\\n\\t\\tmin-width: 0 !important;\\n\\t\\tmax-width: 28vw !important;\\n\\t}\\n\\t[data-piweb-marquee] {\\n\\t\\tposition: relative !important;\\n\\t\\tdisplay: block !important;\\n\\t\\twidth: 28vw !important;\\n\\t\\tflex: none !important;\\n\\t\\ttext-overflow: clip !important;\\n\\t\\twhite-space: nowrap !important;\\n\\t\\toverflow: hidden !important;\\n\\t\\ttext-indent: 0 !important;\\n\\t\\tcontain: layout paint !important;\\n\\t\\tcolor: transparent !important;\\n\\t\\tline-height: 20px !important;\\n\\t}\\n\\t[data-piweb-marquee]::before,\\n\\t[data-piweb-marquee]::after {\\n\\t\\tcontent: attr(data-piweb-text);\\n\\t\\tposition: absolute;\\n\\t\\ttop: 0;\\n\\t\\tleft: 0;\\n\\t\\tcolor: var(--piweb-marquee-color, var(--dsw-label-primary));\\n\\t\\tfont-size: 13px;\\n\\t\\tline-height: 20px;\\n\\t\\twhite-space: nowrap;\\n\\t\\twill-change: transform;\\n\\t\\ttransform: translate3d(0, 0, 0);\\n\\t\\tanimation: piweb-mfit-marquee var(--piweb-marquee-duration, 8s) linear infinite both;\\n\\t}\\n\\t[data-piweb-marquee]::after {\\n\\t\\tleft: var(--piweb-marquee-text, 0px);\\n\\t}\\n\\t@keyframes piweb-mfit-marquee {\\n\\t\\tfrom { transform: translate3d(0, 0, 0); }\\n\\t\\tto { transform: translate3d(calc(-1 * var(--piweb-marquee-text, 0px)), 0, 0); }\\n\\t}\\n}\\n\\n/* dvh 是\\"实际可见高度\\",比 100vh(移动 Chrome 的大视口)可靠;\\n 不支持时上面那两条固定值兜底。 */\\n@supports (height: 100dvh) {\\n\\t@media (max-width: 840px) {\\n\\t\\ttextarea {\\n\\t\\t\\tmax-height: min(132px, 26dvh) !important;\\n\\t\\t}\\n\\t\\t.popover {\\n\\t\\t\\tmax-height: min(60dvh, 420px) !important;\\n\\t\\t}\\n\\t\\t.settings-dialog {\\n\\t\\t\\theight: calc(100dvh - 16px) !important;\\n\\t\\t}\\n\\t}\\n}\\n","js":"/*\\n * 手机端脚本(配合 mobile-fit.css)。\\n *\\n * 做两件事:\\n * 1) 模型名太长时改成「跑马灯」。做法照搬 dsh-remote 对 DSH 的处理——\\n * 名字窗口固定 28vw,装得下就完全不动;装不下时才把两份文本首尾相接匀速左移,\\n * 一份走完另一份正好接上,循环没有空档。CSS 负责动画,这里只负责\\"量\\"和\\"打标记\\"。\\n * 为什么必须用 JS 量:纯 CSS 判断不了\\"是否真的被截断\\",只能用省略号一裁了之,\\n * 名字的尾巴就永远看不到了。\\n * 2) 设置里「文字 + 开关」那种行,手机上点文字也能切开关。\\n * 手机断点下这行是上下排(见 mobile-fit.css 第 11 条),文字占满一行、开关缩在下面,\\n * 而 PiWeb 只让那个 36\xd720 的小开关可点 —— 用户点最显眼的标题文字毫无反应,\\n * 看起来就是\\"这个开关坏了\\"。实测:点文字 0 次请求,点开关才发请求。\\n */\\n(function () {\\n\\t\\"use strict\\";\\n\\n\\tvar ATTR = \\"data-piweb-marquee\\";\\n\\tvar TEXT_ATTR = \\"data-piweb-text\\";\\n\\tvar TEXT_VAR = \\"--piweb-marquee-text\\";\\n\\tvar DURATION_VAR = \\"--piweb-marquee-duration\\";\\n\\tvar COLOR_VAR = \\"--piweb-marquee-color\\";\\n\\tvar /** 两份文本之间留的间隔,也是 travel 里多出来的那一段 */\\n\\t\\tGAP = 40;\\n\\tvar /** 每秒移动多少像素,太长就慢一点 */\\n\\t\\tSPEED = 22;\\n\\tvar MIN_CYCLE = 6;\\n\\tvar ROW_BOUND_ATTR = \\"data-piweb-row-bound\\";\\n\\n\\t/** 模型胶囊里的名字(ModelSelector 里那个 span.truncate) */\\n\\tfunction label() {\\n\\t\\treturn document.querySelector(\'button.chip[aria-haspopup=\\"menu\\"] > span.truncate\');\\n\\t}\\n\\n\\tfunction apply() {\\n\\t\\tvar el = label();\\n\\t\\tif (!el) return;\\n\\t\\tvar text = el.textContent || \\"\\";\\n\\t\\tif (!text) return;\\n\\n\\t\\t// 同一个名字已经标过就别再动它:重设属性会把 CSS 动画从头开始,看起来是\\"一直重启\\"\\n\\t\\tif (el.hasAttribute(ATTR) && el.getAttribute(TEXT_ATTR) === text) return;\\n\\n\\t\\t// 量必须在\\"静止态\\"下做:先摘掉标记,否则量到的是被 28vw 框死之后的宽度\\n\\t\\tif (el.hasAttribute(ATTR)) el.removeAttribute(ATTR);\\n\\t\\tvar natural = el.scrollWidth;\\n\\t\\tvar windowWidth = el.clientWidth;\\n\\t\\tif (!windowWidth || natural <= windowWidth + 1) return; // 装得下,什么都不做\\n\\n\\t\\tel.style.setProperty(COLOR_VAR, getComputedStyle(el).color);\\n\\t\\tel.style.setProperty(TEXT_VAR, natural + GAP + \\"px\\");\\n\\t\\tel.style.setProperty(DURATION_VAR, Math.max(MIN_CYCLE, (natural + GAP) / SPEED).toFixed(1) + \\"s\\");\\n\\t\\tel.setAttribute(TEXT_ATTR, text);\\n\\t\\tel.setAttribute(ATTR, \\"\\");\\n\\t}\\n\\n\\t/**\\n\\t * 设置里「文字 + 开关」的行:把文字列变成开关的\\"大号按钮\\"。\\n\\t *\\n\\t * 只绑文字列(Row 里那个 min-w-0 的直系子元素),不碰控件列:\\n\\t * 控件列里有数字输入框,整行可点会把\\"点输入框\\"也变成切开关。\\n\\t * React 重渲染会换掉节点,所以每次轮询都重查;用属性做幂等标记,重复绑不会叠加。\\n\\t */\\n\\tfunction bindSwitchRows() {\\n\\t\\tvar switches = document.querySelectorAll(\'.settings-dialog [role=\\"switch\\"]\');\\n\\t\\tfor (var i = 0; i < switches.length; i++) {\\n\\t\\t\\tvar sw = switches[i];\\n\\t\\t\\tvar row = sw.closest(\\".hairline-b\\");\\n\\t\\t\\tif (!row || row.getAttribute(ROW_BOUND_ATTR) === \\"1\\") continue;\\n\\t\\t\\t// Row 的文字列:hairline-b 的直系子元素里带 min-w-0 的那个\\n\\t\\t\\tvar label = null;\\n\\t\\t\\tfor (var c = 0; c < row.children.length; c += 1) {\\n\\t\\t\\t\\tif (row.children[c].classList.contains(\\"min-w-0\\")) { label = row.children[c]; break; }\\n\\t\\t\\t}\\n\\t\\t\\tif (!label) continue;\\n\\t\\t\\trow.setAttribute(ROW_BOUND_ATTR, \\"1\\");\\n\\t\\t\\t(function (button, labelEl) {\\n\\t\\t\\t\\tlabelEl.style.cursor = \\"pointer\\";\\n\\t\\t\\t\\tlabelEl.addEventListener(\\"click\\", function (event) {\\n\\t\\t\\t\\t\\t// 文字里可能有链接/按钮,别抢它们\\n\\t\\t\\t\\t\\tif (event.target.closest(\\"a, button, input, select, textarea\\")) return;\\n\\t\\t\\t\\t\\tif (button.disabled) return;\\n\\t\\t\\t\\t\\tevent.preventDefault();\\n\\t\\t\\t\\t\\tbutton.click();\\n\\t\\t\\t\\t});\\n\\t\\t\\t})(sw, label);\\n\\t\\t}\\n\\t}\\n\\n\\t// 模型名会随会话/选择变化,输入卡也会整体重挂载;轮询最省事,且因为有上面的\\n\\t// 提前返回,稳态下每次只花一个 querySelector。\\n\\tfunction start() {\\n\\t\\tapply();\\n\\t\\tbindSwitchRows();\\n\\t\\tsetInterval(function () { apply(); bindSwitchRows(); }, 800);\\n\\t\\twindow.addEventListener(\\"resize\\", apply, { passive: true });\\n\\t\\twindow.addEventListener(\\"orientationchange\\", apply, { passive: true });\\n\\t}\\n\\n\\tif (document.readyState === \\"loading\\") document.addEventListener(\\"DOMContentLoaded\\", start, { once: true });\\n\\telse start();\\n})();"}'),w="piweb-mobile-fit",x=v.A,y=v.js,z=/https:\/\/[a-z0-9][a-z0-9-]*\.trycloudflare\.com/;async function A(a,b){let c=Date.now()+6e4;for(;;){if(!b())return!1;if(await function(a){return new Promise(b=>{let c=new URL(a),d=i().request({host:c.hostname,path:"/api/health",method:"HEAD",timeout:8e3},a=>{a.resume(),b(!0)});d.on("timeout",()=>{d.destroy(),b(!1)}),d.on("error",()=>b(!1)),d.end()})}(a))return!0;if(Date.now()>=c)return!1;await new Promise(a=>setTimeout(a,2500))}}function B(a=process.env){return(0,n.mW)(a)?"development"===a.NODE_ENV?"dev":null:"auth"}function C(a){let b;if(!a)return;try{b=new URL(a).hostname.toLowerCase()}catch{return}let c=(process.env.PI_WEB_TRUSTED_HOSTS??"").split(",").map(a=>a.trim().toLowerCase()).filter(a=>a&&a!==b);process.env.PI_WEB_TRUSTED_HOSTS=c.join(",")}function D(){let a=globalThis,b=Symbol.for("piweb:remote-supervisor"),c=a[b];if(c)return c;let d={lan:null,tunnel:null,lanError:null,publicError:null,enginePath:null,engineChecked:!1};return a[b]=d,d}function E(a=process.env){for(let b of[a.PIWEB_PORT,a.PORT]){let a=Number(b);if(Number.isInteger(a)&&a>=1&&a<=65535)return a}return 30141}function F(){let a=D(),b=a.lan?.port??null;return{plugin:"builtin-remote",targetPort:E(),blocked:B(),lan:{running:!!a.lan,port:b,urls:b?(function(){let a=[];for(let b of Object.values(k().networkInterfaces()))for(let c of b??[])"IPv4"!==c.family||c.internal||c.address.startsWith("169.254.")||a.push(c.address);return a})().map(a=>`http://${a}:${b}`):[],error:a.lanError},public:{running:!!a.tunnel,url:a.tunnel?.url??null,ready:!!a.tunnel?.ready,engine:a.tunnel?"cloudflared":null,engineAvailable:!a.engineChecked||null!==a.enginePath,error:a.publicError}}}function G(a=function(a=process.env){let b=Number(a.PIWEB_REMOTE_LAN_PORT);return Number.isInteger(b)&&b>=1&&b<=65535?b:30142}(),b="0.0.0.0",c=E()){let d=D();if(d.lan)return Promise.resolve(F().lan);if(d.lanStarting)return d.lanStarting;let e=H(a,b,c).finally(()=>{d.lanStarting===e&&(d.lanStarting=null)});return d.lanStarting=e,e}async function H(a,b,c){let d=D();d.lanError=null;let e=function({targetPort:a,targetHost:b="127.0.0.1",css:c=null,js:d=null,log:e=()=>{}}){return q().createServer((f,g)=>{var h;let i={...f.headers},j=!!(c||d)&&(h=i.host,!(0,u.pq)(function(a){let b=String(a??"").trim().toLowerCase();if(b.startsWith("[")){let a=b.indexOf("]");return a>=0?b.slice(1,a):b.slice(1)}return 1===(b.match(/:/g)??[]).length?b.slice(0,b.indexOf(":")):b}(h)));j&&String(i.accept??"").includes("text/html")&&(i["accept-encoding"]="identity");let k=q().request({host:b,port:a,method:f.method,path:f.url??"/",headers:i},a=>{let b=String(a.headers["content-type"]??"");if(!j||!b.includes("text/html")){g.writeHead(a.statusCode??502,a.headers),(0,r.pipeline)(a,g,()=>void 0);return}let f=[];a.on("error",a=>{e(`[远程连接] 上游中途断开:${a.message}`),g.destroy()}),a.on("data",a=>f.push(a)),a.on("end",()=>{let b,h=Buffer.concat(f);try{b=Buffer.from(function(a,{css:b=null,js:c=null}={}){if(!b&&!c||a.includes(`id="${w}"`))return a;let d=[];b&&d.push(`<style id="${w}">
|
|
3
|
+
`,{flag:"wx",mode:384}),f().renameSync(c,b)}finally{f().rmSync(c,{force:!0}),s=null}}function w(a,b,c=Date.now()){let d=u(),e=new Map([...d.revoked].filter(([,a])=>a>c));e.set(a,b),v({notBefore:d.notBefore,revoked:e})}function x(a=Date.now()){v({notBefore:Math.max(a,u().notBefore),revoked:new Map})}},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},31421:a=>{"use strict";a.exports=require("node:child_process")},37067:a=>{"use strict";a.exports=require("node:http")},38522:a=>{"use strict";a.exports=require("node:zlib")},44708:a=>{"use strict";a.exports=require("node:https")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{"use strict";a.exports=require("node:os")},54528:(a,b,c)=>{"use strict";c.d(b,{mW:()=>h,C0:()=>m,LR:()=>n,qd:()=>k,BY:()=>l});var d=c(77598);let e="piweb_session_",f=/^[A-Za-z0-9_-]*$/;function g(a){if(!f.test(a)||a.length%4==1)return;let b=Buffer.from(a.replace(/-/g,"+").replace(/_/g,"/"),"base64");return b.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")===a?b:void 0}function h(a=process.env){let b=(a.PI_WEB_AUTH??"").trim().toLowerCase();return"1"===b||"true"===b||"on"===b||"yes"===b}function i(a){let b=a.headers.get("host")||new URL(a.url).host;if(b)try{let a=new URL(`http://${b}`);if(a.username||a.password)return;return a.host.toLowerCase()}catch{return}}function j(a){return e+(0,d.createHash)("sha256").update(a).digest("base64url")}function k(a,b){let c=i(a);if(!c)return;let e=function(a,b){if(a)for(let c of a.split(";")){let a=c.indexOf("=");if(!(a<0)&&c.slice(0,a).trim()===b)try{return decodeURIComponent(c.slice(a+1).trim())}catch{break}}}(a.headers.get("cookie"),j(c));if(!e)return;let f=function(a,b){let c,e=a.split(".");if(3!==e.length||"v1"!==e[0])return;let f=e[1],h=e[2];if(!f||!h)return;let i=g(h);if(!i)return;let j=(0,d.createHmac)("sha256",b).update(f).digest();if(i.byteLength!==j.byteLength||!(0,d.timingSafeEqual)(i,j))return;let k=g(f);if(!k)return;try{c=JSON.parse(k.toString("utf8"))}catch{return}if("object"!=typeof c||null===c||Array.isArray(c))return;let l=c;if(1===l.version&&"string"==typeof l.authority&&Number.isSafeInteger(l.issuedAt)&&Number.isSafeInteger(l.expiresAt))return l}(e,b);if(f&&f.authority===c)return{id:(0,d.createHash)("sha256").update(e).digest("base64url"),payload:f}}function l(a,b,c=Date.now(),d){let e=k(a,b);if(!e)return!1;let{payload:f}=e;return!(d&&(f.issuedAt<d.notBefore||d.revoked.has(e.id)))&&f.issuedAt<=c&&f.expiresAt>c&&f.expiresAt>f.issuedAt&&f.expiresAt-f.issuedAt<=2592e6}function m(a){let b=i(a);return{name:b?j(b):e,value:""}}function n(a){return{...{httpOnly:!0,sameSite:"strict",secure:"https:"===new URL(a.url).protocol||"https"===(a.headers.get("x-forwarded-proto")??"").split(",")[0].trim(),path:"/",maxAge:2592e3},maxAge:0}}},57075:a=>{"use strict";a.exports=require("node:stream")},61073:(a,b,c)=>{"use strict";c.r(b),c.d(b,{DELETE:()=>U,GET:()=>S,POST:()=>T,dynamic:()=>O});var d=c(23211),e=c(31421),f=c(73024),g=c.n(f),h=c(44708),i=c.n(h),j=c(48161),k=c.n(j),l=c(76760),m=c.n(l),n=c(54528),o=c(26412),p=c(37067),q=c.n(p),r=c(57075),s=c(38522),t=c.n(s),u=c(75587);let v=JSON.parse('{"A":"/*\\n * 手机端适配。不改 PiWeb,只在经代理的远程页面上生效\\n * (本机直连 127.0.0.1:30141 的桌面页面完全不加载它)。\\n *\\n * 取值参照 dsh-remote 为 DSH 定的那套移动适配(同作者),并针对 PiWeb 的实测问题:\\n * 390px 下输入框 304px、markdown 表格 442px 超出视口、底部统计行被截断。\\n */\\n@media (max-width: 840px) {\\n\\t/* 1) 输入框自适应高度失控。\\n\\t 实测:视口 390 → 304px,500 → 43px,700+ → 22px;而自然内容高始终 22px。\\n\\t 原因在 ChatInput 的 autoSize():它把\\"被 flex 拉伸后\\"的 scrollHeight 写进了\\n\\t inline height,写回后又把自己撑住,形成自锁。inline 样式不是 important,\\n\\t 所以这里用 max-height !important 把它夹住。 */\\n\\ttextarea {\\n\\t\\tmax-height: 132px !important;\\n\\t\\toverflow-y: auto !important;\\n\\t}\\n\\n\\t/* 2) Markdown 宽表格超出视口被裁掉(实测 442 > 390,body 又是 overflow-x:hidden,\\n\\t 等于右侧内容既看不到也滑不到)。让表格自己横向滚动。 */\\n\\t.md table {\\n\\t\\tdisplay: block !important;\\n\\t\\tmax-width: 100% !important;\\n\\t\\toverflow-x: auto !important;\\n\\t\\t-webkit-overflow-scrolling: touch;\\n\\t}\\n\\n\\t/* 3) 全局溢出护栏(dsh-remote 同款):任何一块都不许把文档撑宽 */\\n\\thtml,\\n\\tbody {\\n\\t\\tmax-width: 100vw !important;\\n\\t\\toverflow-x: hidden !important;\\n\\t}\\n\\tpre {\\n\\t\\tmax-width: 100% !important;\\n\\t\\toverflow-x: auto !important;\\n\\t\\t-webkit-overflow-scrolling: touch;\\n\\t}\\n\\timg,\\n\\tsvg,\\n\\tvideo,\\n\\tcanvas {\\n\\t\\tmax-width: 100% !important;\\n\\t}\\n\\n\\t/* 4) 底部统计行原本 nowrap + ellipsis,手机上「| 输入 2…」之后永远看不到。\\n\\t 改成可横向滑动,滚动条隐藏,信息不再丢。 */\\n\\tdiv.text-center > div.overflow-hidden.text-ellipsis.whitespace-nowrap {\\n\\t\\toverflow-x: auto !important;\\n\\t\\toverflow-y: hidden !important;\\n\\t\\ttext-overflow: clip !important;\\n\\t\\t-webkit-overflow-scrolling: touch;\\n\\t\\tscrollbar-width: none;\\n\\t}\\n\\tdiv.text-center > div.overflow-hidden.text-ellipsis.whitespace-nowrap::-webkit-scrollbar {\\n\\t\\tdisplay: none;\\n\\t}\\n\\n\\t/* 5) 给手机的手势条留位置(没有 insets 的设备 env() 为 0,等于没写) */\\n\\t.pi-main {\\n\\t\\tpadding-bottom: env(safe-area-inset-bottom) !important;\\n\\t}\\n\\n\\t/* 6) 左上角的抽屉按钮。原来是个悬浮的圆角方块(12px/12px、34px),盖在内容上、\\n\\t 和右边那排图标也不在一条水平线上。按 dsh-remote 对 DSH 左侧的做法收成贴角圆形,\\n\\t 尺寸和位置改成与右侧图标完全一致(实测右侧图标是 top 12 / 30\xd730,中心 y=27),\\n\\t 这样整行对齐,按钮底边 42 也在头部分隔线(y=43)之上,不会压住那条线。 */\\n\\t.pi-mobile-menu {\\n\\t\\twidth: 30px !important;\\n\\t\\theight: 30px !important;\\n\\t\\tborder-radius: 999px !important;\\n\\t\\tleft: calc(env(safe-area-inset-left) + 12px) !important;\\n\\t\\ttop: calc(env(safe-area-inset-top) + 12px) !important;\\n\\t}\\n\\t.pi-main > .hairline-b {\\n\\t\\tpadding-left: 52px !important;\\n\\t}\\n\\n\\t/* 7) 右侧大纲导轨是绝对定位的(right-2 + 约 34px 宽的竖条),正文和用户气泡\\n\\t 会从它下面穿过去。不动条宽——那是层级信息——而是把导轨贴边收窄,\\n\\t 再给滚动区留出它实际占的宽度。 */\\n\\t.outline-rail {\\n\\t\\tright: 2px !important;\\n\\t}\\n\\t.outline-rail > div {\\n\\t\\tpadding-left: 6px !important;\\n\\t\\tpadding-right: 2px !important;\\n\\t}\\n\\t.pi-main div.min-h-0.flex-1.overflow-y-auto {\\n\\t\\tpadding-right: 30px !important;\\n\\t}\\n\\n\\t/* 8) 设置弹窗:高度用 100vh(移动端的大视口),内容列又没有 min-height:0\\n\\t 也没有 overflow-y,于是 1986px 的内容被 overflow:hidden 裁在 828px 里,\\n\\t 手机上完全滑不动。实测 client=828 / scroll=1986。 */\\n\\t.settings-dialog {\\n\\t\\theight: calc(100vh - 16px) !important;\\n\\t}\\n\\t.settings-dialog > div:not(.settings-nav) {\\n\\t\\tmin-height: 0 !important;\\n\\t\\toverflow-y: auto !important;\\n\\t\\t-webkit-overflow-scrolling: touch;\\n\\t}\\n\\n\\t/* 9) 模型 / 思考等级浮层锚在胶囊自己的 relative 容器上,right-0 是**胶囊**右缘,\\n\\t 312px 往左展开就顶出屏幕左边(实测 left 为负)。把胶囊容器解除定位,\\n\\t 浮层改用整张输入卡(上一层 relative)做定位父级,right-0 落在卡片右缘就装得下。\\n\\t :has() 在移动端 Safari 15.4+ / Chrome 105+ 都可用。 */\\n\\tdiv.relative:has(> button.chip[aria-haspopup=\\"menu\\"]) {\\n\\t\\tposition: static !important;\\n\\t}\\n\\n\\t/* 10) 设置→模型 的提供方卡片:那一行是 nowrap,中间的名字列被右侧一串按钮挤成\\n\\t 0 宽(实测 w=0),于是「凭据: auth.json」竖着拆行、「编辑」拆成「编/辑」、\\n\\t 右侧的按钮还被裁掉。手机上让这行能换行,并给名字列一个真实的最小宽度。 */\\n\\t.settings-dialog div.flex.items-center.gap-3:has(> div.min-w-0.flex-1) {\\n\\t\\tflex-wrap: wrap !important;\\n\\t\\trow-gap: 8px !important;\\n\\t}\\n\\t.settings-dialog div.flex.items-center.gap-3:has(> div.min-w-0.flex-1) > div.min-w-0.flex-1 {\\n\\t\\tflex: 1 1 140px !important;\\n\\t\\tmin-width: 140px !important;\\n\\t}\\n\\n\\t/* 11) 设置里 Row 那一套([文字列][控件列] 两栏)。控件列是 flex-none,\\n\\t 有的行右侧很宽(「开关 + 两个数字输入框」≈272px、「繁忙时 Enter」的下拉≈233px),\\n\\t 于是 390px 下文字列只剩 70px 左右,中文按每行一两字竖排,行高被撑到\\n\\t 122px / 218px(实测 70\xd7122、69\xd7218)。\\n\\t 试过的几种写法与实测结论:\\n\\t - 只给文字列 flex 增长权重:完全没用(那行没有空闲空间)\\n\\t - 只缩小 gap:只能缓解(70\xd7122 → 86\xd798)\\n\\t - 让所有 Row 都上下排(flex:1 1 100%):能修好,但把本来正常的行也撑高\\n\\t (界面语言 53→85、字体步进 95→105),是密度回退\\n\\t - 正解:文字列 flex-basis 设 0、只留 min-width 当\\"不许被压到多窄\\"的下限。\\n\\t 换行判断用的是 flex-basis(max-content 会很大,所以上一版全换行了),\\n\\t 设成 0 之后判断就只看 min-width:\\n\\t 控件窄的行(界面语言 77px、字体步进 116px)→ 仍并排,保持紧凑\\n\\t 控件宽的行(272px / 233px)→ 控件换到下一行,文字拿满 326px\\n\\t 实测:界面语言 53 不变、界面字体 95→71、繁忙时Enter 239→135、\\n\\t 自动压缩 143→111、自动重试 119→111,全部不再竖排。 */\\n\\t.settings-dialog div.hairline-b.gap-6 {\\n\\t\\tflex-wrap: wrap !important;\\n\\t\\tgap: 8px !important;\\n\\t}\\n\\t.settings-dialog div.hairline-b.gap-6 > div.min-w-0 {\\n\\t\\tflex: 1 1 0 !important;\\n\\t\\tmin-width: 45% !important;\\n\\t}\\n\\t.settings-dialog div.hairline-b.gap-6 > div.flex-none > div.flex.items-center {\\n\\t\\tflex-wrap: wrap !important;\\n\\t\\tjustify-content: flex-end !important;\\n\\t\\trow-gap: 6px !important;\\n\\t}\\n\\n\\t/* 12) 外观主题卡片。卡片是 flex: 1 1 150px 的两列网格,但左右各留 32px 内边距,\\n\\t 159px 的卡片只剩 95px 给标题,于是「石灰与煤炭」「亚麻与苔绿」掉到第二行,\\n\\t 卡片高度变成 110px 而其余是 88px,网格参差(实测 6 张卡:4 张 88 / 2 张 110)。\\n\\t 把左右内边距收到 10px,6 张卡全部回到 88px,标题一行放得下。 */\\n\\t.settings-dialog button[aria-pressed] {\\n\\t\\tpadding-left: 10px !important;\\n\\t\\tpadding-right: 10px !important;\\n\\t}\\n\\n\\t/* 13) 可点目标偏小(实测:字体步进器 26\xd726、reset 48\xd724、开关 36\xd720)。\\n\\t 只扩**热区**,绝不改可见尺寸:开关的滑块位置在 PiWeb 里是写死的\\n\\t (left: 18px / 2px),把开关拉宽会让滑块错位、变成被拉长的怪药丸\\n\\t —— 我第一版写的 min-width:44px 就是这个后果,用户报了\\"启动按钮好丑\\"。\\n\\t 另外这里只做**纵向**扩张(左右不扩):字体步进器 −/+/ 之间只有 8px,\\n\\t 横向扩到 44px 会让两个按钮的热区重叠约 10px,点 − 反而命中 +。 */\\n\\t.settings-dialog .icon-btn,\\n\\t.settings-dialog button.h-6,\\n\\t.settings-dialog button.h-5,\\n\\t.settings-dialog [role=\\"switch\\"] {\\n\\t\\tposition: relative !important;\\n\\t}\\n\\t.settings-dialog .icon-btn::after,\\n\\t.settings-dialog button.h-6::after,\\n\\t.settings-dialog button.h-5::after,\\n\\t.settings-dialog [role=\\"switch\\"]::after {\\n\\t\\tcontent: \\"\\" !important;\\n\\t\\tposition: absolute !important;\\n\\t\\tleft: 0 !important;\\n\\t\\tright: 0 !important;\\n\\t\\ttop: 50% !important;\\n\\t\\theight: max(100%, 44px) !important;\\n\\t\\ttransform: translateY(-50%) !important;\\n\\t\\tborder-radius: 999px !important;\\n\\t}\\n}\\n\\n/* 手机上的浮层统一兜底:不许比屏幕宽,不许比屏幕高,超出就自己滚。 */\\n@media (max-width: 840px) {\\n\\t.popover {\\n\\t\\tmax-width: calc(100vw - 16px) !important;\\n\\t\\tmax-height: 420px !important;\\n\\t\\toverflow-y: auto !important;\\n\\t\\t-webkit-overflow-scrolling: touch;\\n\\t}\\n}\\n\\n/* 11) 模型名太长时跑马灯。取值与做法照搬 dsh-remote 对 DSH 的:\\n\\t 名字窗口固定 28vw 并允许被压缩,装得下就完全不动;装不下时由注入的\\n\\t mobile-fit.js 打上 data-piweb-marquee,再由这里的两份伪元素首尾相接匀速左移。\\n\\t 一份走完另一份正好接上(travel 已含间隔),所以循环处看不出接缝。 */\\n@media (max-width: 840px) {\\n\\tbutton.chip[aria-haspopup=\\"menu\\"] > span.truncate {\\n\\t\\tmin-width: 0 !important;\\n\\t\\tmax-width: 28vw !important;\\n\\t}\\n\\t[data-piweb-marquee] {\\n\\t\\tposition: relative !important;\\n\\t\\tdisplay: block !important;\\n\\t\\twidth: 28vw !important;\\n\\t\\tflex: none !important;\\n\\t\\ttext-overflow: clip !important;\\n\\t\\twhite-space: nowrap !important;\\n\\t\\toverflow: hidden !important;\\n\\t\\ttext-indent: 0 !important;\\n\\t\\tcontain: layout paint !important;\\n\\t\\tcolor: transparent !important;\\n\\t\\tline-height: 20px !important;\\n\\t}\\n\\t[data-piweb-marquee]::before,\\n\\t[data-piweb-marquee]::after {\\n\\t\\tcontent: attr(data-piweb-text);\\n\\t\\tposition: absolute;\\n\\t\\ttop: 0;\\n\\t\\tleft: 0;\\n\\t\\tcolor: var(--piweb-marquee-color, var(--dsw-label-primary));\\n\\t\\tfont-size: 13px;\\n\\t\\tline-height: 20px;\\n\\t\\twhite-space: nowrap;\\n\\t\\twill-change: transform;\\n\\t\\ttransform: translate3d(0, 0, 0);\\n\\t\\tanimation: piweb-mfit-marquee var(--piweb-marquee-duration, 8s) linear infinite both;\\n\\t}\\n\\t[data-piweb-marquee]::after {\\n\\t\\tleft: var(--piweb-marquee-text, 0px);\\n\\t}\\n\\t@keyframes piweb-mfit-marquee {\\n\\t\\tfrom { transform: translate3d(0, 0, 0); }\\n\\t\\tto { transform: translate3d(calc(-1 * var(--piweb-marquee-text, 0px)), 0, 0); }\\n\\t}\\n}\\n\\n/* dvh 是\\"实际可见高度\\",比 100vh(移动 Chrome 的大视口)可靠;\\n 不支持时上面那两条固定值兜底。 */\\n@supports (height: 100dvh) {\\n\\t@media (max-width: 840px) {\\n\\t\\ttextarea {\\n\\t\\t\\tmax-height: min(132px, 26dvh) !important;\\n\\t\\t}\\n\\t\\t.popover {\\n\\t\\t\\tmax-height: min(60dvh, 420px) !important;\\n\\t\\t}\\n\\t\\t.settings-dialog {\\n\\t\\t\\theight: calc(100dvh - 16px) !important;\\n\\t\\t}\\n\\t}\\n}\\n","js":"/*\\n * 手机端脚本(配合 mobile-fit.css)。\\n *\\n * 做两件事:\\n * 1) 模型名太长时改成「跑马灯」。做法照搬 dsh-remote 对 DSH 的处理——\\n * 名字窗口固定 28vw,装得下就完全不动;装不下时才把两份文本首尾相接匀速左移,\\n * 一份走完另一份正好接上,循环没有空档。CSS 负责动画,这里只负责\\"量\\"和\\"打标记\\"。\\n * 为什么必须用 JS 量:纯 CSS 判断不了\\"是否真的被截断\\",只能用省略号一裁了之,\\n * 名字的尾巴就永远看不到了。\\n * 2) 设置里「文字 + 开关」那种行,手机上点文字也能切开关。\\n * 手机断点下这行是上下排(见 mobile-fit.css 第 11 条),文字占满一行、开关缩在下面,\\n * 而 PiWeb 只让那个 36\xd720 的小开关可点 —— 用户点最显眼的标题文字毫无反应,\\n * 看起来就是\\"这个开关坏了\\"。实测:点文字 0 次请求,点开关才发请求。\\n */\\n(function () {\\n\\t\\"use strict\\";\\n\\n\\tvar ATTR = \\"data-piweb-marquee\\";\\n\\tvar TEXT_ATTR = \\"data-piweb-text\\";\\n\\tvar TEXT_VAR = \\"--piweb-marquee-text\\";\\n\\tvar DURATION_VAR = \\"--piweb-marquee-duration\\";\\n\\tvar COLOR_VAR = \\"--piweb-marquee-color\\";\\n\\tvar /** 两份文本之间留的间隔,也是 travel 里多出来的那一段 */\\n\\t\\tGAP = 40;\\n\\tvar /** 每秒移动多少像素,太长就慢一点 */\\n\\t\\tSPEED = 22;\\n\\tvar MIN_CYCLE = 6;\\n\\tvar ROW_BOUND_ATTR = \\"data-piweb-row-bound\\";\\n\\n\\t/** 模型胶囊里的名字(ModelSelector 里那个 span.truncate) */\\n\\tfunction label() {\\n\\t\\treturn document.querySelector(\'button.chip[aria-haspopup=\\"menu\\"] > span.truncate\');\\n\\t}\\n\\n\\tfunction apply() {\\n\\t\\tvar el = label();\\n\\t\\tif (!el) return;\\n\\t\\tvar text = el.textContent || \\"\\";\\n\\t\\tif (!text) return;\\n\\n\\t\\t// 同一个名字已经标过就别再动它:重设属性会把 CSS 动画从头开始,看起来是\\"一直重启\\"\\n\\t\\tif (el.hasAttribute(ATTR) && el.getAttribute(TEXT_ATTR) === text) return;\\n\\n\\t\\t// 量必须在\\"静止态\\"下做:先摘掉标记,否则量到的是被 28vw 框死之后的宽度\\n\\t\\tif (el.hasAttribute(ATTR)) el.removeAttribute(ATTR);\\n\\t\\tvar natural = el.scrollWidth;\\n\\t\\tvar windowWidth = el.clientWidth;\\n\\t\\tif (!windowWidth || natural <= windowWidth + 1) return; // 装得下,什么都不做\\n\\n\\t\\tel.style.setProperty(COLOR_VAR, getComputedStyle(el).color);\\n\\t\\tel.style.setProperty(TEXT_VAR, natural + GAP + \\"px\\");\\n\\t\\tel.style.setProperty(DURATION_VAR, Math.max(MIN_CYCLE, (natural + GAP) / SPEED).toFixed(1) + \\"s\\");\\n\\t\\tel.setAttribute(TEXT_ATTR, text);\\n\\t\\tel.setAttribute(ATTR, \\"\\");\\n\\t}\\n\\n\\t/**\\n\\t * 设置里「文字 + 开关」的行:把文字列变成开关的\\"大号按钮\\"。\\n\\t *\\n\\t * 只绑文字列(Row 里那个 min-w-0 的直系子元素),不碰控件列:\\n\\t * 控件列里有数字输入框,整行可点会把\\"点输入框\\"也变成切开关。\\n\\t * React 重渲染会换掉节点,所以每次轮询都重查;用属性做幂等标记,重复绑不会叠加。\\n\\t */\\n\\tfunction bindSwitchRows() {\\n\\t\\tvar switches = document.querySelectorAll(\'.settings-dialog [role=\\"switch\\"]\');\\n\\t\\tfor (var i = 0; i < switches.length; i++) {\\n\\t\\t\\tvar sw = switches[i];\\n\\t\\t\\tvar row = sw.closest(\\".hairline-b\\");\\n\\t\\t\\tif (!row || row.getAttribute(ROW_BOUND_ATTR) === \\"1\\") continue;\\n\\t\\t\\t// Row 的文字列:hairline-b 的直系子元素里带 min-w-0 的那个\\n\\t\\t\\tvar label = null;\\n\\t\\t\\tfor (var c = 0; c < row.children.length; c += 1) {\\n\\t\\t\\t\\tif (row.children[c].classList.contains(\\"min-w-0\\")) { label = row.children[c]; break; }\\n\\t\\t\\t}\\n\\t\\t\\tif (!label) continue;\\n\\t\\t\\trow.setAttribute(ROW_BOUND_ATTR, \\"1\\");\\n\\t\\t\\t(function (button, labelEl) {\\n\\t\\t\\t\\tlabelEl.style.cursor = \\"pointer\\";\\n\\t\\t\\t\\tlabelEl.addEventListener(\\"click\\", function (event) {\\n\\t\\t\\t\\t\\t// 文字里可能有链接/按钮,别抢它们\\n\\t\\t\\t\\t\\tif (event.target.closest(\\"a, button, input, select, textarea\\")) return;\\n\\t\\t\\t\\t\\tif (button.disabled) return;\\n\\t\\t\\t\\t\\tevent.preventDefault();\\n\\t\\t\\t\\t\\tbutton.click();\\n\\t\\t\\t\\t});\\n\\t\\t\\t})(sw, label);\\n\\t\\t}\\n\\t}\\n\\n\\t// 模型名会随会话/选择变化,输入卡也会整体重挂载;轮询最省事,且因为有上面的\\n\\t// 提前返回,稳态下每次只花一个 querySelector。\\n\\tfunction start() {\\n\\t\\tapply();\\n\\t\\tbindSwitchRows();\\n\\t\\tsetInterval(function () { apply(); bindSwitchRows(); }, 800);\\n\\t\\twindow.addEventListener(\\"resize\\", apply, { passive: true });\\n\\t\\twindow.addEventListener(\\"orientationchange\\", apply, { passive: true });\\n\\t}\\n\\n\\tif (document.readyState === \\"loading\\") document.addEventListener(\\"DOMContentLoaded\\", start, { once: true });\\n\\telse start();\\n})();"}'),w="piweb-mobile-fit",x=v.A,y=v.js,z=/https:\/\/[a-z0-9][a-z0-9-]*\.trycloudflare\.com/;async function A(a,b){let c=Date.now()+6e4;for(;;){if(!b())return!1;if(await function(a){return new Promise(b=>{let c=new URL(a),d=i().request({host:c.hostname,path:"/api/health",method:"HEAD",timeout:8e3},a=>{a.resume(),b((a.statusCode??0)<500)});d.on("timeout",()=>{d.destroy(),b(!1)}),d.on("error",()=>b(!1)),d.end()})}(a))return!0;if(Date.now()>=c)return!1;await new Promise(a=>setTimeout(a,2500))}}function B(a=process.env){return(0,n.mW)(a)?"development"===a.NODE_ENV?"dev":null:"auth"}function C(a){let b;if(!a)return;try{b=new URL(a).hostname.toLowerCase()}catch{return}let c=(process.env.PI_WEB_TRUSTED_HOSTS??"").split(",").map(a=>a.trim().toLowerCase()).filter(a=>a&&a!==b);process.env.PI_WEB_TRUSTED_HOSTS=c.join(",")}function D(){let a=globalThis,b=Symbol.for("piweb:remote-supervisor"),c=a[b];if(c)return c;let d={lan:null,tunnel:null,lanError:null,publicError:null,enginePath:null,engineChecked:!1};return a[b]=d,d}function E(a=process.env){for(let b of[a.PIWEB_PORT,a.PORT]){let a=Number(b);if(Number.isInteger(a)&&a>=1&&a<=65535)return a}return 30141}let F=/vmware|virtualbox|vboxnet|vethernet|hyper-v|wsl|docker|^br-|^veth/i;function G(){let a=D(),b=a.lan?.port??null;return{plugin:"builtin-remote",targetPort:E(),blocked:B(),lan:{running:!!a.lan,port:b,urls:b?(function(a=k().networkInterfaces()){let b=[],c=[];for(let[d,e]of Object.entries(a))for(let a of e??[])!("IPv4"!==a.family||a.internal||a.address.startsWith("169.254."))&&(/^198\.1[89]\./.test(a.address)||(F.test(d)?c:b).push(a.address));return[...b,...c]})().map(a=>`http://${a}:${b}`):[],error:a.lanError},public:{running:!!a.tunnel,url:a.tunnel?.url??null,ready:!!a.tunnel?.ready,engine:a.tunnel?"cloudflared":null,engineAvailable:!a.engineChecked||null!==a.enginePath,error:a.publicError}}}function H(a=function(a=process.env){let b=Number(a.PIWEB_REMOTE_LAN_PORT);return Number.isInteger(b)&&b>=1&&b<=65535?b:30142}(),b="0.0.0.0",c=E()){let d=D();if(d.lan)return Promise.resolve(G().lan);if(d.lanStarting)return d.lanStarting;let e=I(a,b,c).finally(()=>{d.lanStarting===e&&(d.lanStarting=null)});return d.lanStarting=e,e}async function I(a,b,c){let d=D();d.lanError=null;let e=function({targetPort:a,targetHost:b="127.0.0.1",css:c=null,js:d=null,log:e=()=>{}}){let f=new(q()).Agent({keepAlive:!0,scheduling:"lifo",timeout:5e3}),g=q().createServer((g,h)=>{var i;let j={...g.headers},k=!!(c||d)&&(i=j.host,!(0,u.pq)(function(a){let b=String(a??"").trim().toLowerCase();if(b.startsWith("[")){let a=b.indexOf("]");return a>=0?b.slice(1,a):b.slice(1)}return 1===(b.match(/:/g)??[]).length?b.slice(0,b.indexOf(":")):b}(i)));k&&String(j.accept??"").includes("text/html")&&(j["accept-encoding"]="identity");let l=q().request({host:b,port:a,method:g.method,path:g.url??"/",headers:j,agent:f},a=>{let b=String(a.headers["content-type"]??"");if(!k||!b.includes("text/html")){h.writeHead(a.statusCode??502,a.headers),(0,r.pipeline)(a,h,()=>void 0);return}let f=[];a.on("error",a=>{e(`[远程连接] 上游中途断开:${a.message}`),h.destroy()}),a.on("data",a=>f.push(a)),a.on("end",()=>{let b,g=Buffer.concat(f);try{b=Buffer.from(function(a,{css:b=null,js:c=null}={}){if(!b&&!c||a.includes(`id="${w}"`))return a;let d=[];b&&d.push(`<style id="${w}">
|
|
4
4
|
${b}
|
|
5
5
|
</style>`),c&&d.push(`<script id="${w}-js">
|
|
6
6
|
${c}
|
|
7
7
|
</script>`);let e=d.join("\n"),f=a.indexOf("</head>");if(f>=0)return`${a.slice(0,f)}${e}
|
|
8
|
-
${a.slice(f)}`;let g=a.indexOf("<body");if(g>=0){let b=a.indexOf(">",g);if(b>=0)return`${a.slice(0,b+1)}${e}${a.slice(b+1)}`}return e+a}((function(a,b){let c=String(b??"").toLowerCase();if(!c||"identity"===c)return a;if("gzip"===c||"x-gzip"===c)return t().gunzipSync(a);if("deflate"===c)return t().inflateSync(a);if("br"===c)return t().brotliDecompressSync(a);throw Error(`不支持的 content-encoding:${b}`)})(h,a.headers["content-encoding"]).toString("utf8"),{css:c,js:d}),"utf8")}catch(c){e(`[远程连接] 注入失败,原样返回:${c instanceof Error?c.message:String(c)}`);let b={...a.headers};delete b["content-encoding"],delete b["content-length"],g.writeHead(a.statusCode??200,b),g.end(h);return}let i={...a.headers};delete i["content-encoding"],delete i["transfer-encoding"],delete i.etag,i["content-length"]=String(b.byteLength),i["cache-control"]="no-store",g.writeHead(a.statusCode??200,i),g.end(b)})}),l=!1;k.on("error",a=>{l||(e(`[远程连接] 代理连不上 PiWeb:${a.message}`),g.headersSent||g.writeHead(502,{"content-type":"text/plain; charset=utf-8"}),g.end(`[远程连接] 连不上 PiWeb(${a.message})`))}),g.on("close",()=>{g.writableFinished||(l=!0,k.destroy())}),f.pipe(k)})}({targetPort:c,css:x,js:y,log:a=>console.warn(a)});try{await new Promise((c,d)=>{e.once("error",d),e.listen(a,b,c)})}catch(a){return d.lanError=a instanceof Error?a.message:String(a),e.close(),F().lan}return d.lan={server:e,port:a},F().lan}async function I(){let a=D(),b=a.lan;a.lan=null,b&&(b.server.closeAllConnections?.(),await new Promise(a=>b.server.close(()=>a())))}function J(a){let b=D(),c=b.tunnel;c?.child===a&&(C(c.url),b.tunnel=null),null!==a.exitCode||a.killed||a.kill()}async function K(){let a,b=D();b.publicError=null,b.lan||await G();let c=F().lan;if(!c.running||null===c.port)return b.publicError=c.error??"局域网入口没能启动,公网入口无从转发",F().public;let d=((a=D()).engineChecked||(a.engineChecked=!0,a.enginePath=function(){let a=process.env.PIWEB_CLOUDFLARED?.trim();if(a)return a;let b=m().join((0,o.Fu)(),"web-bin","win32"===process.platform?"cloudflared.exe":"cloudflared");try{if(g().existsSync(b))return b}catch{}return"cloudflared"}()),a.enginePath);if(!d)return b.publicError="找不到 cloudflared",F().public;let f=(0,e.spawn)(d,["tunnel","--no-autoupdate","--url",`http://127.0.0.1:${c.port}`],{stdio:["ignore","pipe","pipe"],windowsHide:!0});b.tunnel={child:f,url:null,ready:!1},await new Promise(a=>{let c=!1,d=d=>{c||(c=!0,clearTimeout(e),d&&(b.publicError=d),a())},e=setTimeout(()=>{J(f),d("启动隧道超时:cloudflared 没有在 45 秒内给出地址")},45e3),g=function(a=z){let b=null,c="";return{feed(d){if(b)return null;c+=d;let e=a.exec(c);return e?(b=e[0],c="",b):(c.length>4096&&(c=c.slice(-4096)),null)},get url(){return b}}}(),h=a=>{let c=g.feed(a.toString("utf8"));c&&b.tunnel&&(b.tunnel.url=c,function(a){let b;try{b=new URL(a).hostname.toLowerCase()}catch{return}let c=(process.env.PI_WEB_TRUSTED_HOSTS??"").split(",").map(a=>a.trim().toLowerCase()).filter(Boolean);c.includes(b)||c.push(b),process.env.PI_WEB_TRUSTED_HOSTS=c.join(",")}(c),f.stdout?.off("data",h),f.stderr?.off("data",h),d())};f.stdout?.on("data",h),f.stderr?.on("data",h),f.once("error",a=>{if(J(f),"ENOENT"===a.code){let a;(a=D()).engineChecked=!0,a.enginePath=null,d("找不到 cloudflared:请先安装它(https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/)");return}d(a.message)}),f.once("exit",a=>{let c=b.tunnel;c?.child===f?(C(c.url),b.tunnel=null,d(`cloudflared 退出了(code ${a??"?"})`)):d()})});let h=b.tunnel;if(h?.url){let a=await A(h.url,()=>b.tunnel===h);b.tunnel===h&&(h.ready=a)}return F().public}async function L(){let a=D(),b=a.tunnel;a.tunnel=null,b&&(C(b.url),await new Promise(a=>{b.child.once("exit",()=>a()),b.child.kill(),setTimeout(a,3e3).unref()}))}async function M(){await L(),await I()}let N="force-dynamic",O={"Cache-Control":"no-store"};function P(){return d.NextResponse.json({success:!0,data:F()},{headers:O})}function Q(a,b=400){return d.NextResponse.json({success:!1,error:a},{status:b,headers:O})}async function R(){return P()}async function S(a){let b;try{b=await a.json()}catch{return Q("invalid JSON body")}let c="object"!=typeof b||null===b||Array.isArray(b)?void 0:b.action;if("start"===c||"start-lan"===c){let a=B();if("auth"===a)return Q("remote access requires authentication (PI_WEB_AUTH=1)",409);if("dev"===a)return Q("remote access is disabled in development mode",409)}switch(c){case"start":return await G(),await function(){let a=D();if(a.tunnel)return Promise.resolve(F().public);if(a.publicStarting)return a.publicStarting;let b=K().finally(()=>{a.publicStarting===b&&(a.publicStarting=null)});return a.publicStarting=b,b}(),P();case"stop":return await L(),P();case"start-lan":return await G(),P();case"stop-lan":return await M(),P();default:return Q("unknown action")}}async function T(){return await M(),P()}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{"use strict";a.exports=require("node:fs")},75587:(a,b,c)=>{"use strict";c.d(b,{Aw:()=>h,MC:()=>e,pq:()=>i,zM:()=>g});var d=c(77030);function e(a){if("cross-site"===a.headers.get("sec-fetch-site"))return!1;let b=a.headers.get("origin");if(!b)return!0;try{let c=new URL(b),d=a.headers.get("host")||new URL(a.url).host;return c.host.toLowerCase()===d.toLowerCase()}catch{return!1}}function f(a){return(a??"").split(",").map(a=>a.trim().toLowerCase()).filter(Boolean)}function g(a=process.env){return[...f(a.PI_WEB_TRUSTED_HOSTS),...f(a.PI_WEB_ALLOWED_HOSTS)]}function h(a,b=[]){try{let c=a.headers.get("host")||new URL(a.url).host,e=new URL(`http://${c}`);if(e.username||e.password||e.host.toLowerCase()!==c.toLowerCase())return!1;let f=e.hostname.toLowerCase();if(i(f)||0!==(0,d.isIP)(f.replace(/^\[(.*)\]$/,"$1")))return!0;return b.includes(f)}catch{return!1}}function i(a){let b=a.trim().toLowerCase().replace(/^\[|\]$/g,"");return!!("localhost"===b||b.endsWith(".localhost"))||"::1"===b||"0:0:0:0:0:0:0:1"===b||/^127(?:\.\d{1,3}){3}$/.test(b)}},76760:a=>{"use strict";a.exports=require("node:path")},77030:a=>{"use strict";a.exports=require("node:net")},77598:a=>{"use strict";a.exports=require("node:crypto")},78335:()=>{},84452:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/remote/route",pathname:"/api/remote",filename:"route",bundlePath:"app/api/remote/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/PiWeb/PiWeb/src/app/api/remote/route.ts",nextConfigOutput:"",userland:()=>c(61073),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/remote/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[741,813],()=>b(b.s=84452));module.exports=c})();
|
|
8
|
+
${a.slice(f)}`;let g=a.indexOf("<body");if(g>=0){let b=a.indexOf(">",g);if(b>=0)return`${a.slice(0,b+1)}${e}${a.slice(b+1)}`}return e+a}((function(a,b){let c=String(b??"").toLowerCase();if(!c||"identity"===c)return a;if("gzip"===c||"x-gzip"===c)return t().gunzipSync(a);if("deflate"===c)return t().inflateSync(a);if("br"===c)return t().brotliDecompressSync(a);throw Error(`不支持的 content-encoding:${b}`)})(g,a.headers["content-encoding"]).toString("utf8"),{css:c,js:d}),"utf8")}catch(c){e(`[远程连接] 注入失败,原样返回:${c instanceof Error?c.message:String(c)}`);let b={...a.headers};delete b["content-encoding"],delete b["content-length"],h.writeHead(a.statusCode??200,b),h.end(g);return}let i={...a.headers};delete i["content-encoding"],delete i["transfer-encoding"],delete i.etag,i["content-length"]=String(b.byteLength),i["cache-control"]="no-store",h.writeHead(a.statusCode??200,i),h.end(b)})}),m=!1;l.on("error",a=>{m||(e(`[远程连接] 代理连不上 PiWeb:${a.message}`),h.headersSent||h.writeHead(502,{"content-type":"text/plain; charset=utf-8"}),h.end(`[远程连接] 连不上 PiWeb(${a.message})`))}),h.on("close",()=>{h.writableFinished||(m=!0,l.destroy())}),g.pipe(l)});return g.on("close",()=>f.destroy()),g}({targetPort:c,css:x,js:y,log:a=>console.warn(a)});try{await new Promise((c,d)=>{e.once("error",d),e.listen(a,b,c)})}catch(a){return d.lanError=a instanceof Error?a.message:String(a),e.close(),G().lan}return d.lan={server:e,port:a},G().lan}async function J(){let a=D(),b=a.lan;a.lan=null,b&&(b.server.closeAllConnections?.(),await new Promise(a=>b.server.close(()=>a())))}function K(a){let b=D(),c=b.tunnel;c?.child===a&&(C(c.url),b.tunnel=null),null!==a.exitCode||a.killed||a.kill()}async function L(){let a,b=D();b.publicError=null,b.lan||await H();let c=G().lan;if(!c.running||null===c.port)return b.publicError=c.error??"局域网入口没能启动,公网入口无从转发",G().public;let d=((a=D()).engineChecked||(a.engineChecked=!0,a.enginePath=function(){let a=process.env.PIWEB_CLOUDFLARED?.trim();if(a)return a;let b=m().join((0,o.Fu)(),"web-bin","win32"===process.platform?"cloudflared.exe":"cloudflared");try{if(g().existsSync(b))return b}catch{}return"cloudflared"}()),a.enginePath);if(!d)return b.publicError="找不到 cloudflared",G().public;let f=(0,e.spawn)(d,["tunnel","--no-autoupdate","--url",`http://127.0.0.1:${c.port}`],{stdio:["ignore","pipe","pipe"],windowsHide:!0});b.tunnel={child:f,url:null,ready:!1},await new Promise(a=>{let c=!1,d=d=>{c||(c=!0,clearTimeout(e),d&&(b.publicError=d),a())},e=setTimeout(()=>{K(f),d("启动隧道超时:cloudflared 没有在 45 秒内给出地址")},45e3),g=function(a=z){let b=null,c="";return{feed(d){if(b)return null;c+=d;let e=a.exec(c);return e?(b=e[0],c="",b):(c.length>4096&&(c=c.slice(-4096)),null)},get url(){return b}}}(),h=a=>{let c=g.feed(a.toString("utf8"));c&&b.tunnel&&(b.tunnel.url=c,function(a){let b;try{b=new URL(a).hostname.toLowerCase()}catch{return}let c=(process.env.PI_WEB_TRUSTED_HOSTS??"").split(",").map(a=>a.trim().toLowerCase()).filter(Boolean);c.includes(b)||c.push(b),process.env.PI_WEB_TRUSTED_HOSTS=c.join(",")}(c),f.stdout?.off("data",h),f.stderr?.off("data",h),d())};f.stdout?.on("data",h),f.stderr?.on("data",h),f.once("error",a=>{if(K(f),"ENOENT"===a.code){let a;(a=D()).engineChecked=!0,a.enginePath=null,d("找不到 cloudflared:请先安装它(https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/)");return}d(a.message)}),f.once("exit",a=>{let c=b.tunnel;c?.child===f?(C(c.url),b.tunnel=null,d(`cloudflared 退出了(code ${a??"?"})`)):d()})});let h=b.tunnel;if(h?.url){let a=await A(h.url,()=>b.tunnel===h);b.tunnel===h&&(h.ready=a)}return G().public}async function M(){let a=D(),b=a.tunnel;a.tunnel=null,b&&(C(b.url),await new Promise(a=>{b.child.once("exit",()=>a()),b.child.kill(),setTimeout(a,3e3).unref()}))}async function N(){await M(),await J()}let O="force-dynamic",P={"Cache-Control":"no-store"};function Q(){return d.NextResponse.json({success:!0,data:{...G(),loginToken:(0,n.mW)()&&process.env.PI_WEB_LAUNCH_TOKEN||null}},{headers:P})}function R(a,b=400){return d.NextResponse.json({success:!1,error:a},{status:b,headers:P})}async function S(){return Q()}async function T(a){let b;try{b=await a.json()}catch{return R("invalid JSON body")}let c="object"!=typeof b||null===b||Array.isArray(b)?void 0:b.action;if("start"===c||"start-lan"===c){let a=B();if("auth"===a)return R("remote access requires authentication (PI_WEB_AUTH=1)",409);if("dev"===a)return R("remote access is disabled in development mode",409)}switch(c){case"start":return await H(),await function(){let a=D();if(a.tunnel)return Promise.resolve(G().public);if(a.publicStarting)return a.publicStarting;let b=L().finally(()=>{a.publicStarting===b&&(a.publicStarting=null)});return a.publicStarting=b,b}(),Q();case"stop":return await M(),Q();case"start-lan":return await H(),Q();case"stop-lan":return await N(),Q();default:return R("unknown action")}}async function U(){return await N(),Q()}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{"use strict";a.exports=require("node:fs")},75587:(a,b,c)=>{"use strict";c.d(b,{Aw:()=>h,MC:()=>e,pq:()=>i,zM:()=>g});var d=c(77030);function e(a){if("cross-site"===a.headers.get("sec-fetch-site"))return!1;let b=a.headers.get("origin");if(!b)return!0;try{let c=new URL(b),d=a.headers.get("host")||new URL(a.url).host;return c.host.toLowerCase()===d.toLowerCase()}catch{return!1}}function f(a){return(a??"").split(",").map(a=>a.trim().toLowerCase()).filter(Boolean)}function g(a=process.env){return[...f(a.PI_WEB_TRUSTED_HOSTS),...f(a.PI_WEB_ALLOWED_HOSTS)]}function h(a,b=[]){try{let c=a.headers.get("host")||new URL(a.url).host,e=new URL(`http://${c}`);if(e.username||e.password||e.host.toLowerCase()!==c.toLowerCase())return!1;let f=e.hostname.toLowerCase();if(i(f)||0!==(0,d.isIP)(f.replace(/^\[(.*)\]$/,"$1")))return!0;return b.includes(f)}catch{return!1}}function i(a){let b=a.trim().toLowerCase().replace(/^\[|\]$/g,"");return!!("localhost"===b||b.endsWith(".localhost"))||"::1"===b||"0:0:0:0:0:0:0:1"===b||/^127(?:\.\d{1,3}){3}$/.test(b)}},76760:a=>{"use strict";a.exports=require("node:path")},77030:a=>{"use strict";a.exports=require("node:net")},77598:a=>{"use strict";a.exports=require("node:crypto")},78335:()=>{},84452:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/remote/route",pathname:"/api/remote",filename:"route",bundlePath:"app/api/remote/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/PiWeb/PiWeb/src/app/api/remote/route.ts",nextConfigOutput:"",userland:()=>c(61073),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/remote/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[741,813],()=>b(b.s=84452));module.exports=c})();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(()=>{var a={};a.id=437,a.ids=[437],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},7371:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>i,dynamic:()=>j});var e=c(23211),f=c(66562),g=c(28686),h=a([f,g]);[f,g]=h.then?(await h)():h;let j="force-dynamic";async function i(a){let b;try{b=await a.json()}catch{return e.NextResponse.json({success:!1,error:"invalid JSON body"},{status:400})}if(!b||"object"!=typeof b||Array.isArray(b))return e.NextResponse.json({success:!1,error:"expected an object body"},{status:400});let{target:c,action:d}=b;if("piweb"!==c&&"pi"!==c)return e.NextResponse.json({success:!1,error:"unknown target"},{status:400});if("check"!==d&&"update"!==d)return e.NextResponse.json({success:!1,error:"unknown action"},{status:400});try{if("check"===d)return e.NextResponse.json({success:!0,data:await (0,f.lX)(c)});let a=async()=>{if(Object.values((0,g.Rq)()).some(a=>a.streaming))throw new f.TR("An agent session is running. Wait for it to finish and update in a maintenance window; do not start new sessions until the release is ready.")};return await a(),e.NextResponse.json({success:!0,data:await (0,f.PG)(c,{assertIdle:a})})}catch(a){return e.NextResponse.json({success:!1,error:a instanceof Error?a.message:String(a)},{status:a instanceof f.TR?409:500})}}d()}catch(a){d(a)}})},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{"use strict";a.exports=require("assert")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},24446:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/update/route",pathname:"/api/update",filename:"route",bundlePath:"app/api/update/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/PiWeb/PiWeb/src/app/api/update/route.ts",nextConfigOutput:"",userland:()=>c(7371),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/update/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},31421:a=>{"use strict";a.exports=require("node:child_process")},33873:a=>{"use strict";a.exports=require("path")},39006:a=>{"use strict";a.exports={rE:"0.3.19"}},41300:(a,b,c)=>{"use strict";c.d(b,{e:()=>f});var d=c(73024),e=c(73136);function f(a){if(!process.argv[1])return!1;try{return d.realpathSync(process.argv[1])===d.realpathSync((0,e.fileURLToPath)(a))}catch{return!1}}},41948:(a,b,c)=>{"use strict";c.d(b,{d:()=>f});var d=c(31421);async function e(a){if(!a.pid)return void a.kill();if("win32"!==process.platform){try{process.kill(-a.pid,"SIGKILL")}catch{a.kill("SIGKILL")}return}await new Promise(b=>{let c=(0,d.spawn)("taskkill",["/PID",String(a.pid),"/T","/F"],{stdio:"ignore",windowsHide:!0}),e=setTimeout(()=>{a.kill(),c.kill(),b()},1e4),f=()=>{clearTimeout(e),b()};c.once("error",()=>{a.kill(),f()}),c.once("close",f)})}function f(a,b,{cwd:c,env:g=process.env,timeoutMs:h=6e5,signal:i}){return new Promise((f,j)=>{if(i?.aborted)return void j(Error("release cancelled"));let k="win32"===process.platform&&"npm"===a,l=(0,d.spawn)(k?g.ComSpec||"cmd.exe":a,k?["/d","/c","npm",...b]:b,{cwd:c,env:g,windowsHide:!0,detached:"win32"!==process.platform,stdio:["ignore","pipe","pipe"]}),m="",n="",o=!1,p=!1,q=()=>{clearTimeout(u),i?.removeEventListener("abort",t)},r=a=>{p||(p=!0,q(),j(a))},s=a=>{p||o||(o=!0,e(l).then(()=>r(Error(a)),r))},t=()=>s("release cancelled; command process tree terminated"),u=setTimeout(()=>s(`timeout after ${Math.round(h/1e3)}s: ${a} ${b.join(" ")}`),h);i?.addEventListener("abort",t,{once:!0}),i?.aborted&&t(),l.stdout.on("data",a=>{m=(m+a).slice(-262144)}),l.stderr.on("data",a=>{n=(n+a).slice(-262144)}),l.once("error",a=>{o||r(a)}),l.once("close",a=>{if(!o&&!p){if(0!==a)return void r(Error((n||m||`exit code ${a}`).trim().slice(-1e3)));p=!0,q(),f(m)}})})}},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46193:a=>{"use strict";a.exports=require("node:string_decoder")},48161:a=>{"use strict";a.exports=require("node:os")},48379:a=>{function b(a){return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b})}b.keys=()=>[],b.resolve=b,b.id=48379,a.exports=b},51455:a=>{"use strict";a.exports=require("node:fs/promises")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66562:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{PG:()=>z,TR:()=>u,lX:()=>y});var e=c(51455),f=c.n(e),g=c(76760),h=c.n(g),i=c(72053),j=c(93340),k=c(41948),l=c(68293),m=c(62433),n=c(75717),o=c(92584),p=a([i,m,n]);[i,m,n]=p.then?(await p)():p;class u extends Error{}function q(a){if("piweb"!==a&&"pi"!==a)throw Error("unknown target")}let v="@rexvane/piweb";function r(a){return h().resolve(a).split(/[\\/]/).includes("node_modules")}function s(a=process.platform){return"win32"!==a}let w=`npm install -g ${v}@latest`;async function t(a){let b=JSON.parse(await f().readFile(a,"utf8"));if("string"!=typeof b.version||!b.version)throw Error(`no version field in ${a}`);return b.version}let x=function({root:a=o.V,run:b=k.d,versions:c=n.Y,env:d=process.env,platform:e=process.platform}={}){let g=!1,p={...d};async function x(){return(0,j.f6)(a)}async function y(a,c){if(!s(e))throw Error(`Windows cannot replace a running PiWeb. Stop piweb, then run: ${w}`);await c();let d=(c,d)=>b("npm",c,{cwd:a,env:p,timeoutMs:d}),f=h().join(a,"package.json"),g=await t(f);await d(["install","-g",`${v}@latest`,"--no-audit","--no-fund"],6e5),await c(),(0,j.f6)(a);let i=await t(f);if(i===g){let a=(await d(["view",`${v}@latest`,"version"],3e4)).trim().split(/\r?\n/)[0];if((0,l.U)(a,g))throw Error(`npm updated a different copy of ${v}; this installation is not the global package. Update it the way it was installed.`)}return{...(0,j.kI)(a,".next"),version:i,needsRestart:!0}}async function z(a,{assertIdle:c=async()=>{}}={}){if(q(a),g)throw new u("an update is already running");g=!0;try{let e=await x();if("piweb"===a&&r(e))return await y(e,c);let g="";return{...await (0,i.vn)({root:e,env:d,run:b,beforePrepare:async()=>{if(await c(),"piweb"===a){let a=a=>b("git",a,{cwd:e,env:p,timeoutMs:15e3}),c=(await a(["rev-parse","--show-toplevel"])).trim(),d=await f().realpath(c).catch(()=>h().resolve(c));if(!(0,m.Eb)(d,e))throw Error("refusing to update: PiWeb is not the Git installation root");if((await a(["status","--porcelain","--untracked-files=no"])).trim())throw Error("PiWeb has local tracked changes; preserve them before updating (no files were reset)")}await c()},prepare:async d=>{let{env:f,signal:k}=d,l=(a,c,d)=>b(a,c,{cwd:e,env:f,timeoutMs:d,signal:k});"pi"===a?g=await (0,i.eh)(d,c):(await c(),await l("git",["pull","--ff-only","origin","main"],12e4),(0,j.f6)(e),await c(),await l("npm",["install","--no-audit","--no-fund"],6e5),g=await t(h().join(e,"package.json")))}}),version:g,needsRestart:!0}}finally{g=!1}}return{checkForUpdate:async function(a){if(q(a),g)throw new u("an update is already running");let d=await x(),f=(a,c,e)=>b(a,c,{cwd:d,env:p,timeoutMs:e}),{piWeb:h,piEngine:j}=await c();if("pi"===a){let a=(await f("npm",["view",i.V0,"version"],3e4)).trim().split(/\r?\n/)[0];return{current:j,latest:a,canUpdate:(0,l.U)(a,j),selfUpdate:!0}}if(r(d)){let a=(await f("npm",["view",v,"version"],3e4)).trim().split(/\r?\n/)[0];if(!a)throw Error(`cannot read the published version of ${v}`);let b=s(e);return{current:h,latest:a,canUpdate:(0,l.U)(a,h),selfUpdate:b,...b?{}:{command:w}}}await f("git",["fetch","origin","main","--tags"],3e4);let k=Number((await f("git",["rev-list","--count","HEAD..origin/main"],15e3)).trim());if(!Number.isSafeInteger(k)||k<0)throw Error("invalid upstream commit count");let m=JSON.parse(await f("git",["show","origin/main:package.json"],15e3));if(!["piweb","pi-web","@rexvane/piweb"].includes(String(m.name))||"string"!=typeof m.version||!m.version)throw Error("upstream is not a PiWeb package");return{current:h,latest:m.version,behind:k,canUpdate:(0,l.U)(m.version,h)||k>0,selfUpdate:!0}},runUpdate:z}}(),y=x.checkForUpdate,z=x.runUpdate;d()}catch(a){d(a)}})},68293:(a,b,c)=>{"use strict";function d(a){let b=a.trim().replace(/^v/i,"").match(/^(\d+)\.(\d+)(?:\.(\d+))?(?:-([0-9A-Za-z.-]+))?/);return b?{nums:[Number(b[1]),Number(b[2]),Number(b[3]??0)],pre:b[4]?b[4].split("."):[]}:null}function e(a,b){let c=d(a),e=d(b);if(!c||!e)return!1;for(let a=0;a<3;a+=1)if(c.nums[a]!==e.nums[a])return c.nums[a]>e.nums[a];if(!c.pre.length||!e.pre.length)return 0===c.pre.length&&e.pre.length>0;let f=Math.max(c.pre.length,e.pre.length);for(let a=0;a<f;a+=1){let b=c.pre[a],d=e.pre[a];if(void 0===b)break;if(void 0===d)return!0;let f=/^\d+$/.test(b),g=/^\d+$/.test(d);if(f&&g){if(Number(b)!==Number(d))return Number(b)>Number(d);continue}if(f!==g)return g;if(b!==d)return b>d}return!1}c.d(b,{U:()=>e})},72053:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{V0:()=>v,eh:()=>r,vn:()=>s});var e=c(51455),f=c(73024),g=c(76760),h=c(77598),i=c(98995),j=c(73136),k=c(93340),l=c(41948),m=c(41300);let a=function({env:a=process.env,cwd:b=process.cwd(),moduleUrl:c}={}){if(a.PI_WEB_ROOT)return g.resolve(a.PI_WEB_ROOT);if("string"==typeof c)try{let a=g.resolve(g.dirname((0,j.fileURLToPath)(c)),"..");if((0,f.existsSync)(g.join(a,"scripts","release.mjs")))return a}catch{}return g.resolve(b)}({moduleUrl:"file:///home/runner/work/PiWeb/PiWeb/scripts/release.mjs"}),t=`${k.Dy}/update.lock`,u=`${k.Dy}/tsconfig.json`;async function n(a,b,c){let d=(0,k.V6)(a,b),f=(0,k.V6)(a,`${b}.${(0,h.randomUUID)()}.tmp`),g=await e.open(f,"wx",384);try{try{await g.writeFile(`${JSON.stringify(c,null,2)}
|
|
1
|
+
(()=>{var a={};a.id=437,a.ids=[437],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},7371:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>i,dynamic:()=>j});var e=c(23211),f=c(66562),g=c(28686),h=a([f,g]);[f,g]=h.then?(await h)():h;let j="force-dynamic";async function i(a){let b;try{b=await a.json()}catch{return e.NextResponse.json({success:!1,error:"invalid JSON body"},{status:400})}if(!b||"object"!=typeof b||Array.isArray(b))return e.NextResponse.json({success:!1,error:"expected an object body"},{status:400});let{target:c,action:d}=b;if("piweb"!==c&&"pi"!==c)return e.NextResponse.json({success:!1,error:"unknown target"},{status:400});if("check"!==d&&"update"!==d)return e.NextResponse.json({success:!1,error:"unknown action"},{status:400});try{if("check"===d)return e.NextResponse.json({success:!0,data:await (0,f.lX)(c)});let a=async()=>{if(Object.values((0,g.Rq)()).some(a=>a.streaming))throw new f.TR("An agent session is running. Wait for it to finish and update in a maintenance window; do not start new sessions until the release is ready.")};return await a(),e.NextResponse.json({success:!0,data:await (0,f.PG)(c,{assertIdle:a})})}catch(a){return e.NextResponse.json({success:!1,error:a instanceof Error?a.message:String(a)},{status:a instanceof f.TR?409:500})}}d()}catch(a){d(a)}})},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{"use strict";a.exports=require("assert")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},24446:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/update/route",pathname:"/api/update",filename:"route",bundlePath:"app/api/update/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/PiWeb/PiWeb/src/app/api/update/route.ts",nextConfigOutput:"",userland:()=>c(7371),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/update/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},31421:a=>{"use strict";a.exports=require("node:child_process")},33873:a=>{"use strict";a.exports=require("path")},39006:a=>{"use strict";a.exports={rE:"0.3.20"}},41300:(a,b,c)=>{"use strict";c.d(b,{e:()=>f});var d=c(73024),e=c(73136);function f(a){if(!process.argv[1])return!1;try{return d.realpathSync(process.argv[1])===d.realpathSync((0,e.fileURLToPath)(a))}catch{return!1}}},41948:(a,b,c)=>{"use strict";c.d(b,{d:()=>f});var d=c(31421);async function e(a){if(!a.pid)return void a.kill();if("win32"!==process.platform){try{process.kill(-a.pid,"SIGKILL")}catch{a.kill("SIGKILL")}return}await new Promise(b=>{let c=(0,d.spawn)("taskkill",["/PID",String(a.pid),"/T","/F"],{stdio:"ignore",windowsHide:!0}),e=setTimeout(()=>{a.kill(),c.kill(),b()},1e4),f=()=>{clearTimeout(e),b()};c.once("error",()=>{a.kill(),f()}),c.once("close",f)})}function f(a,b,{cwd:c,env:g=process.env,timeoutMs:h=6e5,signal:i}){return new Promise((f,j)=>{if(i?.aborted)return void j(Error("release cancelled"));let k="win32"===process.platform&&"npm"===a,l=(0,d.spawn)(k?g.ComSpec||"cmd.exe":a,k?["/d","/c","npm",...b]:b,{cwd:c,env:g,windowsHide:!0,detached:"win32"!==process.platform,stdio:["ignore","pipe","pipe"]}),m="",n="",o=!1,p=!1,q=()=>{clearTimeout(u),i?.removeEventListener("abort",t)},r=a=>{p||(p=!0,q(),j(a))},s=a=>{p||o||(o=!0,e(l).then(()=>r(Error(a)),r))},t=()=>s("release cancelled; command process tree terminated"),u=setTimeout(()=>s(`timeout after ${Math.round(h/1e3)}s: ${a} ${b.join(" ")}`),h);i?.addEventListener("abort",t,{once:!0}),i?.aborted&&t(),l.stdout.on("data",a=>{m=(m+a).slice(-262144)}),l.stderr.on("data",a=>{n=(n+a).slice(-262144)}),l.once("error",a=>{o||r(a)}),l.once("close",a=>{if(!o&&!p){if(0!==a)return void r(Error((n||m||`exit code ${a}`).trim().slice(-1e3)));p=!0,q(),f(m)}})})}},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46193:a=>{"use strict";a.exports=require("node:string_decoder")},48161:a=>{"use strict";a.exports=require("node:os")},48379:a=>{function b(a){return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b})}b.keys=()=>[],b.resolve=b,b.id=48379,a.exports=b},51455:a=>{"use strict";a.exports=require("node:fs/promises")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66562:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{PG:()=>z,TR:()=>u,lX:()=>y});var e=c(51455),f=c.n(e),g=c(76760),h=c.n(g),i=c(72053),j=c(93340),k=c(41948),l=c(68293),m=c(62433),n=c(75717),o=c(92584),p=a([i,m,n]);[i,m,n]=p.then?(await p)():p;class u extends Error{}function q(a){if("piweb"!==a&&"pi"!==a)throw Error("unknown target")}let v="@rexvane/piweb";function r(a){return h().resolve(a).split(/[\\/]/).includes("node_modules")}function s(a=process.platform){return"win32"!==a}let w=`npm install -g ${v}@latest`;async function t(a){let b=JSON.parse(await f().readFile(a,"utf8"));if("string"!=typeof b.version||!b.version)throw Error(`no version field in ${a}`);return b.version}let x=function({root:a=o.V,run:b=k.d,versions:c=n.Y,env:d=process.env,platform:e=process.platform}={}){let g=!1,p={...d};async function x(){return(0,j.f6)(a)}async function y(a,c){if(!s(e))throw Error(`Windows cannot replace a running PiWeb. Stop piweb, then run: ${w}`);await c();let d=(c,d)=>b("npm",c,{cwd:a,env:p,timeoutMs:d}),f=h().join(a,"package.json"),g=await t(f);await d(["install","-g",`${v}@latest`,"--no-audit","--no-fund"],6e5),await c(),(0,j.f6)(a);let i=await t(f);if(i===g){let a=(await d(["view",`${v}@latest`,"version"],3e4)).trim().split(/\r?\n/)[0];if((0,l.U)(a,g))throw Error(`npm updated a different copy of ${v}; this installation is not the global package. Update it the way it was installed.`)}return{...(0,j.kI)(a,".next"),version:i,needsRestart:!0}}async function z(a,{assertIdle:c=async()=>{}}={}){if(q(a),g)throw new u("an update is already running");g=!0;try{let e=await x();if("piweb"===a&&r(e))return await y(e,c);let g="";return{...await (0,i.vn)({root:e,env:d,run:b,beforePrepare:async()=>{if(await c(),"piweb"===a){let a=a=>b("git",a,{cwd:e,env:p,timeoutMs:15e3}),c=(await a(["rev-parse","--show-toplevel"])).trim(),d=await f().realpath(c).catch(()=>h().resolve(c));if(!(0,m.Eb)(d,e))throw Error("refusing to update: PiWeb is not the Git installation root");if((await a(["status","--porcelain","--untracked-files=no"])).trim())throw Error("PiWeb has local tracked changes; preserve them before updating (no files were reset)")}await c()},prepare:async d=>{let{env:f,signal:k}=d,l=(a,c,d)=>b(a,c,{cwd:e,env:f,timeoutMs:d,signal:k});"pi"===a?g=await (0,i.eh)(d,c):(await c(),await l("git",["pull","--ff-only","origin","main"],12e4),(0,j.f6)(e),await c(),await l("npm",["install","--no-audit","--no-fund"],6e5),g=await t(h().join(e,"package.json")))}}),version:g,needsRestart:!0}}finally{g=!1}}return{checkForUpdate:async function(a){if(q(a),g)throw new u("an update is already running");let d=await x(),f=(a,c,e)=>b(a,c,{cwd:d,env:p,timeoutMs:e}),{piWeb:h,piEngine:j}=await c();if("pi"===a){let a=(await f("npm",["view",i.V0,"version"],3e4)).trim().split(/\r?\n/)[0];return{current:j,latest:a,canUpdate:(0,l.U)(a,j),selfUpdate:!0}}if(r(d)){let a=(await f("npm",["view",v,"version"],3e4)).trim().split(/\r?\n/)[0];if(!a)throw Error(`cannot read the published version of ${v}`);let b=s(e);return{current:h,latest:a,canUpdate:(0,l.U)(a,h),selfUpdate:b,...b?{}:{command:w}}}await f("git",["fetch","origin","main","--tags"],3e4);let k=Number((await f("git",["rev-list","--count","HEAD..origin/main"],15e3)).trim());if(!Number.isSafeInteger(k)||k<0)throw Error("invalid upstream commit count");let m=JSON.parse(await f("git",["show","origin/main:package.json"],15e3));if(!["piweb","pi-web","@rexvane/piweb"].includes(String(m.name))||"string"!=typeof m.version||!m.version)throw Error("upstream is not a PiWeb package");return{current:h,latest:m.version,behind:k,canUpdate:(0,l.U)(m.version,h)||k>0,selfUpdate:!0}},runUpdate:z}}(),y=x.checkForUpdate,z=x.runUpdate;d()}catch(a){d(a)}})},68293:(a,b,c)=>{"use strict";function d(a){let b=a.trim().replace(/^v/i,"").match(/^(\d+)\.(\d+)(?:\.(\d+))?(?:-([0-9A-Za-z.-]+))?/);return b?{nums:[Number(b[1]),Number(b[2]),Number(b[3]??0)],pre:b[4]?b[4].split("."):[]}:null}function e(a,b){let c=d(a),e=d(b);if(!c||!e)return!1;for(let a=0;a<3;a+=1)if(c.nums[a]!==e.nums[a])return c.nums[a]>e.nums[a];if(!c.pre.length||!e.pre.length)return 0===c.pre.length&&e.pre.length>0;let f=Math.max(c.pre.length,e.pre.length);for(let a=0;a<f;a+=1){let b=c.pre[a],d=e.pre[a];if(void 0===b)break;if(void 0===d)return!0;let f=/^\d+$/.test(b),g=/^\d+$/.test(d);if(f&&g){if(Number(b)!==Number(d))return Number(b)>Number(d);continue}if(f!==g)return g;if(b!==d)return b>d}return!1}c.d(b,{U:()=>e})},72053:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{V0:()=>v,eh:()=>r,vn:()=>s});var e=c(51455),f=c(73024),g=c(76760),h=c(77598),i=c(98995),j=c(73136),k=c(93340),l=c(41948),m=c(41300);let a=function({env:a=process.env,cwd:b=process.cwd(),moduleUrl:c}={}){if(a.PI_WEB_ROOT)return g.resolve(a.PI_WEB_ROOT);if("string"==typeof c)try{let a=g.resolve(g.dirname((0,j.fileURLToPath)(c)),"..");if((0,f.existsSync)(g.join(a,"scripts","release.mjs")))return a}catch{}return g.resolve(b)}({moduleUrl:"file:///home/runner/work/PiWeb/PiWeb/scripts/release.mjs"}),t=`${k.Dy}/update.lock`,u=`${k.Dy}/tsconfig.json`;async function n(a,b,c){let d=(0,k.V6)(a,b),f=(0,k.V6)(a,`${b}.${(0,h.randomUUID)()}.tmp`),g=await e.open(f,"wx",384);try{try{await g.writeFile(`${JSON.stringify(c,null,2)}
|
|
2
2
|
`,"utf8"),await g.sync()}finally{await g.close()}await e.rename(f,d)}finally{await e.rm(f,{force:!0})}}async function o(a){let b,c=(0,k.V6)(a,t);try{b=await e.open(c,"wx",384)}catch(a){if("EEXIST"===a.code)throw Error(`an update/build is already running (${c}); after an interrupted build, confirm its process tree has stopped before removing this lock and retrying npm run build:release`);throw a}try{await b.writeFile(JSON.stringify({pid:process.pid,startedAt:new Date().toISOString()}))}catch(a){throw await b.close(),await e.unlink(c),a}return async()=>{await b.close(),await e.unlink(c)}}async function p(a,b){let c=b.slice(`${k.Dy}/`.length);await n(a,u,{extends:"../tsconfig.json",compilerOptions:{tsBuildInfoFile:`./${c}.tsbuildinfo`},include:["../next-env.d.ts","../*.ts","../*.mts","../src/**/*.ts","../src/**/*.tsx","../tests/**/*.ts","../tests/**/*.tsx",`./${c}/types/**/*.ts`,`./${c}/dev/types/**/*.ts`],exclude:["../node_modules","../pi","../dsh","../bin"]})}async function q(a=process.cwd(),b=process.env){let d=(0,k.f6)(a),e=(0,k.Qz)(d,b.PIWEB_BUILD_DIR);if(!e.startsWith(`${k.Dy}/`))throw Error("release requires an isolated build output");let f=(0,i.createRequire)(g.join(d,"package.json")),h=await c(48379)((0,j.pathToFileURL)(f.resolve("next/dist/server/config.js")).href),l="function"==typeof h.default?h.default:h.default.default,{PHASE_PRODUCTION_BUILD:m}=f("next/constants"),n=await l(m,d,{silent:!0});if(n.distDir!==e||n.typescript?.tsconfigPath!==u||n.typescript?.ignoreBuildErrors)throw Error("Next config does not honor the isolated release directory/typecheck; refusing to build over the serving output")}let v="@earendil-works/pi-coding-agent";async function r({root:a,env:b,run:c,signal:d},f=async()=>{}){await f(),await c("npm",["install","--save-exact",`${v}@latest`,"@earendil-works/pi-ai@latest","--no-audit","--no-fund"],{cwd:a,env:b,timeoutMs:6e5,signal:d}),await c("npm",["run","sync:provider-icons"],{cwd:a,env:b,timeoutMs:6e4,signal:d});let h=JSON.parse(await e.readFile(g.join(a,"node_modules",v,"package.json"),"utf8"));if("string"!=typeof h.version||!h.version)throw Error("Pi engine package version is missing");return h.version}async function s({root:b=a,env:c=process.env,run:d=l.d,beforePrepare:f,prepare:i,signal:j}={}){let m,q=(0,k.f6)(b),r=(0,k.V6)(q,k.Dy);await e.mkdir(r,{recursive:!0}),(0,k.V6)(q,k.Dy);let t=await o(q),u=!1;try{await f?.(),j?.throwIfAborted();let a=(0,k.Qz)(q,`${k.Dy}/${Date.now().toString(36)}-${(0,h.randomUUID)()}`);await e.mkdir((0,k.V6)(q,a)),m={schema:1,state:"building",buildDir:a,startedAt:new Date().toISOString()},await n(q,k.Op,m),u=!0;let b={...c,PI_WEB_ROOT:q,PIWEB_BUILD_DIR:a,PYTHONUTF8:c.PYTHONUTF8??"1",PYTHONIOENCODING:c.PYTHONIOENCODING??"utf-8"};delete b.PI_WEB_DEV,delete b.NODE_ENV,await i?.({root:q,buildDir:a,env:b,run:d,signal:j}),j?.throwIfAborted(),(0,k.f6)(q),await p(q,a),await d(process.execPath,[g.join(q,"scripts","release.mjs"),"--verify-config"],{cwd:q,env:b,timeoutMs:6e4,signal:j}),await d("npm",["run","check"],{cwd:q,env:b,timeoutMs:6e5,signal:j}),j?.throwIfAborted();let l=(0,k.kI)(q,a),o=JSON.parse(await e.readFile(g.join(q,"package.json"),"utf8")).version;if("string"!=typeof o||!o)throw Error("PiWeb package version is missing");return await n(q,k.Op,{...m,...l,state:"ready",version:o,finishedAt:new Date().toISOString()}),{...l,version:o,needsRestart:!0}}catch(a){if(u)try{await n(q,k.Op,{...m,state:"failed",finishedAt:new Date().toISOString()})}catch{}throw a}finally{await t()}}if((0,m.e)("file:///home/runner/work/PiWeb/PiWeb/scripts/release.mjs")){let a=new AbortController,b=()=>a.abort();process.once("SIGINT",b),process.once("SIGTERM",b);try{if(3===process.argv.length&&"--verify-config"===process.argv[2])await q();else{let b=3===process.argv.length&&"--update-pi"===process.argv[2];if(process.argv.length>2&&!b)throw Error("Usage: node scripts/release.mjs [--update-pi]");console.log("[piweb] Checking and building an isolated release; the existing server is not restarted."),b&&console.log("[piweb] Pi dependency update: use a maintenance window with no active sessions; node_modules is shared.");let c=await s({signal:a.signal,prepare:b?async a=>{await r(a)}:void 0});console.log(`[piweb] Release ready: ${c.buildDir} (${c.buildId}). Restart PiWeb manually when idle to use it.`)}}catch(a){console.error(`[piweb] Release failed: ${a instanceof Error?a.message:a}`),process.exitCode=1}finally{process.off("SIGINT",b),process.off("SIGTERM",b)}}d()}catch(a){d(a)}},1)},73024:a=>{"use strict";a.exports=require("node:fs")},73136:a=>{"use strict";a.exports=require("node:url")},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},75717:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{Y:()=>h});var e=c(75430),f=c(39006),g=a([e]);function h(){return Promise.resolve({piWeb:f.rE,piEngine:e.VERSION})}e=(g.then?(await g)():g)[0],d()}catch(a){d(a)}})},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},80481:a=>{"use strict";a.exports=require("node:readline")},81115:a=>{"use strict";a.exports=require("constants")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},93340:(a,b,c)=>{"use strict";c.d(b,{Dy:()=>f,Op:()=>g,Qz:()=>i,V6:()=>j,f6:()=>k,kI:()=>m});var d=c(73024),e=c(76760);let f=".next-releases",g=`${f}/active.json`,h=/^\.next-releases\/[A-Za-z0-9_-]{1,100}$/;function i(a,b){let c=void 0===b?".next":b;if("string"!=typeof c||".next"!==c&&!h.test(c))throw Error("PIWEB_BUILD_DIR must be .next or .next-releases/<safe-id>");return j(a,c),c}function j(a,b){if("string"!=typeof b||!b||b.includes("\\")||b.includes(":"))throw Error("invalid project-relative path");let c=b.split("/");if(c.some(a=>!a||"."===a||".."===a))throw Error("invalid project-relative path");let f=d.realpathSync(a),g=f;for(let a of c){let c;g=e.join(g,a);try{c=d.lstatSync(g)}catch(a){if("ENOENT"===a.code)break;throw a}if(c.isSymbolicLink())throw Error(`refusing linked deployment path: ${b}`);let h=d.realpathSync(g),i=e.relative(f,h);if(".."===i||i.startsWith(`..${e.sep}`)||e.isAbsolute(i))throw Error(`deployment path escapes installation: ${b}`)}return e.join(f,...c)}function k(a){let b=d.realpathSync(a),c=j(b,"package.json"),e=JSON.parse(d.readFileSync(c,"utf8"));if(!["piweb","pi-web","@rexvane/piweb"].includes(e?.name))throw Error(`refusing to update outside the PiWeb installation: ${b}`);return b}function l(a,b,c=1048576){let e=j(a,b),f=d.statSync(e);if(!f.isFile()||f.size>c)throw Error(`invalid deployment file: ${b}`);return d.readFileSync(e,"utf8")}function m(a,b){let c=i(a,b),e=l(a,`${c}/BUILD_ID`,1024).trim();if(!e||/\s/.test(e))throw Error(`invalid BUILD_ID in ${c}`);let f=JSON.parse(function(a,b){try{return l(a,`${b}/required-server-files.json`)}catch(a){if("ENOENT"===a.code)throw Error(function(a,b="required-server-files.json"){return`incomplete production build in ${a}: ${b} is missing. Reinstall with \`npm install -g @rexvane/piweb@latest\`, or rebuild this installation with \`npm rebuild -g piweb\`.`}(b));throw a}}(a,c));if(f?.version!==1||f.config?.distDir?.replaceAll("\\","/")!==c)throw Error(`build output does not match ${c}`);if(!Array.isArray(f.files)||!f.files.length)throw Error(`incomplete build in ${c}`);let g=new Set(f.files.map(a=>"string"==typeof a?a.replaceAll("\\","/"):""));for(let a of["BUILD_ID","routes-manifest.json","build-manifest.json","prerender-manifest.json","server/app-paths-manifest.json"])g.add(`${c}/${a}`);for(let b of g){if(!b.startsWith(`${c}/`))throw Error(`invalid required build file: ${b}`);let e=j(a,b);if(!d.statSync(e).isFile())throw Error(`missing required build file: ${b}`)}return{buildDir:c,buildId:e}}},94735:a=>{"use strict";a.exports=require("events")},98995:a=>{"use strict";a.exports=require("node:module")}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[741,813,593,131,538,920,686],()=>b(b.s=24446));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=922,a.ids=[922],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3376:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>h,dynamic:()=>i});var e=c(23211),f=c(75717),g=a([f]);f=(g.then?(await g)():g)[0];let i="force-dynamic";async function h(){return e.NextResponse.json({success:!0,data:{...await (0,f.Y)(),node:process.version}},{headers:{"Cache-Control":"no-store"}})}d()}catch(a){d(a)}})},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},24938:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/version/route",pathname:"/api/version",filename:"route",bundlePath:"app/api/version/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/PiWeb/PiWeb/src/app/api/version/route.ts",nextConfigOutput:"",userland:()=>c(3376),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/version/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},39006:a=>{"use strict";a.exports={rE:"0.3.
|
|
1
|
+
(()=>{var a={};a.id=922,a.ids=[922],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3376:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>h,dynamic:()=>i});var e=c(23211),f=c(75717),g=a([f]);f=(g.then?(await g)():g)[0];let i="force-dynamic";async function h(){return e.NextResponse.json({success:!0,data:{...await (0,f.Y)(),node:process.version}},{headers:{"Cache-Control":"no-store"}})}d()}catch(a){d(a)}})},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},24938:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/version/route",pathname:"/api/version",filename:"route",bundlePath:"app/api/version/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/PiWeb/PiWeb/src/app/api/version/route.ts",nextConfigOutput:"",userland:()=>c(3376),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/version/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},39006:a=>{"use strict";a.exports={rE:"0.3.20"}},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},75717:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{Y:()=>h});var e=c(75430),f=c(39006),g=a([e]);function h(){return Promise.resolve({piWeb:f.rE,piEngine:e.VERSION})}e=(g.then?(await g)():g)[0],d()}catch(a){d(a)}})},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[741,813],()=>b(b.s=24938));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="zh-CN"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/459a9ed40847a72f.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/6ba662805d17ffc2.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/7391c42e1ae617f9.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-bd2b9202ecbcdcaa.js"/><script src="/_next/static/chunks/4bd1b696-93bf506b236d6248.js" async=""></script><script src="/_next/static/chunks/3794-3679f1c05160977c.js" async=""></script><script src="/_next/static/chunks/main-app-e9b53f0e1c6591b2.js" async=""></script><script src="/_next/static/chunks/316-5ea443ee6b512aa9.js" async=""></script><script src="/_next/static/chunks/4686-e3825f3b6a384aa1.js" async=""></script><script src="/_next/static/chunks/app/page-2e425ef83fba0782.js" async=""></script><meta name="theme-color" content="#fcfbf9" media="(prefers-color-scheme: light)"/><meta name="theme-color" content="#2e3440" media="(prefers-color-scheme: dark)"/><title>pi</title><meta name="description" content="Web UI for the pi coding agent"/><link rel="icon" href="/icon.svg?779ce17318f43f72" type="image/svg+xml" sizes="any"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div class="grid h-screen w-screen overflow-hidden" style="grid-template-columns:280px minmax(0,1fr) 0px;background:var(--dsw-bg-base)"><div class="min-h-0 overflow-hidden" style="background:var(--dsw-sidebar-fill)"><div class="flex h-full min-h-0 flex-col"><div class="flex items-center gap-1 px-4 pb-2 pt-4"><div class="inline-flex items-center select-none" style="color:var(--dsw-label-primary);gap:6px"><svg width="17" height="17" viewBox="165.29 165.29 469.43 469.43" aria-hidden="true" style="color:var(--dsw-label-primary);display:block;flex:none"><path fill="currentColor" fill-rule="evenodd" d="M165.29 165.29 H517.36 V400 H400 V517.36 H282.65 V634.72 H165.29 Z M282.65 282.65 V400 H400 V282.65 Z"></path><path fill="currentColor" d="M517.36 400 H634.72 V634.72 H517.36 Z"></path></svg><span class="inline-flex items-center" style="font-size:16.5px;font-weight:600;letter-spacing:-0.02em;color:var(--dsw-label-primary);line-height:1">pi</span><span class="inline-flex items-center justify-center font-bold" style="font-size:9.5px;letter-spacing:0.06em;height:15px;padding-left:4.5px;padding-right:4.5px;border-radius:4px;background:var(--dsw-label-primary);color:var(--dsw-bg-base);line-height:1;text-transform:uppercase">HARNESS</span></div><div class="flex-1"></div><button class="icon-btn" title="«"><svg width="15" height="15" viewBox="0 0 16 16" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.67272 0.522841C10.8339 0.522841 11.76 0.522714 12.4963 0.602493C13.2453 0.683657 13.8789 0.854248 14.4264 1.25197C14.7504 1.48739 15.0355 1.77247 15.2709 2.0965C15.6686 2.64394 15.8392 3.27758 15.9204 4.02655C16.0002 4.7629 16 5.68895 16 6.85014V9.14986C16 10.3111 16.0002 11.2371 15.9204 11.9735C15.8392 12.7224 15.6686 13.3561 15.2709 13.9035C15.0355 14.2275 14.7504 14.5126 14.4264 14.748C13.8789 15.1458 13.2453 15.3163 12.4963 15.3975C11.76 15.4773 10.8339 15.4772 9.67272 15.4772H6.3273C5.16611 15.4772 4.24006 15.4773 3.50371 15.3975C2.75474 15.3163 2.1211 15.1458 1.57366 14.748C1.24963 14.5126 0.964549 14.2275 0.729131 13.9035C0.331407 13.3561 0.160817 12.7224 0.0796529 11.9735C-0.000126137 11.2371 1.25338e-09 10.3111 1.25338e-09 9.14986V6.85014C1.25329e-09 5.68895 -0.000126137 4.7629 0.0796529 4.02655C0.160817 3.27758 0.331407 2.64394 0.729131 2.0965C0.964549 1.77247 1.24963 1.48739 1.57366 1.25197C2.1211 0.854248 2.75474 0.683657 3.50371 0.602493C4.24006 0.522714 5.16611 0.522841 6.3273 0.522841H9.67272ZM5.54303 1.88715V14.1118C5.78636 14.1128 6.04709 14.1169 6.3273 14.1169H9.67272C10.8639 14.1169 11.7032 14.1164 12.3493 14.0465C12.9824 13.9779 13.3497 13.8494 13.6268 13.6482C13.8354 13.4966 14.0195 13.3125 14.1711 13.1039C14.3723 12.8268 14.5007 12.4595 14.5693 11.8264C14.6393 11.1803 14.6398 10.341 14.6398 9.14986V6.85014C14.6398 5.65896 14.6393 4.81967 14.5693 4.1736C14.5007 3.54048 14.3723 3.17318 14.1711 2.89609C14.0195 2.68747 13.8354 2.50337 13.6268 2.35179C13.3497 2.1506 12.9824 2.02212 12.3493 1.95353C11.7032 1.88358 10.8639 1.88307 9.67272 1.88307H6.3273C6.04709 1.88307 5.78636 1.8862 5.54303 1.88715ZM4.1828 1.91166C3.99125 1.9216 3.8148 1.93577 3.65076 1.95353C3.01764 2.02212 2.65034 2.1506 2.37325 2.35179C2.16463 2.50337 1.98052 2.68747 1.82895 2.89609C1.62776 3.17318 1.49928 3.54048 1.43069 4.1736C1.36074 4.81967 1.36023 5.65896 1.36023 6.85014V9.14986C1.36023 10.341 1.36074 11.1803 1.43069 11.8264C1.49928 12.4595 1.62776 12.8268 1.82895 13.1039C1.98052 13.3125 2.16463 13.4966 2.37325 13.6482C2.65034 13.8494 3.01764 13.9779 3.65076 14.0465C3.81478 14.0642 3.99127 14.0774 4.1828 14.0873V1.91166Z" fill="currentColor"></path></svg></button></div><div class="px-3 pt-1"><button class="btn-new-session w-full"><svg width="14" height="14" viewBox="0 0 16 16" fill="none"><path d="M8.00003 0.3237C3.76075 0.3237 0.32373 3.76072 0.32373 8C0.32373 9.17603 0.589121 10.2922 1.0632 11.2901L1.35291 11.8989L2.5705 11.3205L2.28079 10.7117C1.89079 9.89074 1.67301 8.97167 1.67301 8C1.67301 4.50546 4.50549 1.67298 8.00003 1.67298C11.4946 1.67298 14.3271 4.50546 14.3271 8C14.3271 11.4945 11.4946 14.327 8.00003 14.327C7.28473 14.327 6.76077 14.277 6.29621 14.1487C5.83857 14.0224 5.40441 13.8109 4.88514 13.4488C4.12569 12.919 3.03778 12.7316 2.141 13.2978L2.12682 13.307L2.11264 13.3171L1.34886 13.854L1.79659 15.188L2.86122 14.4384C3.19068 14.2305 3.68325 14.2542 4.11326 14.5539C4.72789 14.9826 5.30042 15.2724 5.93762 15.4484C6.56803 15.6224 7.22776 15.6763 8.00003 15.6763C12.2393 15.6763 15.6763 12.2393 15.6763 8C15.6763 3.76072 12.2393 0.3237 8.00003 0.3237ZM7.32033 4.82535V7.32536H4.82538V8.67464H7.32033V11.1747H8.6696V8.67464H11.1747V7.32536H8.6696V4.82535H7.32033Z" fill="currentColor"></path></svg>新会话</button></div><div class="flex items-center gap-0.5 px-4 pb-1 pt-3"><span style="font-size:13px;color:var(--dsw-label-primary)">工作区</span><div class="flex-1"></div><button class="icon-btn" style="width:26px;height:26px" title="搜索"><svg width="14" height="14" viewBox="0 0 16 16" fill="none"><path d="M11.894845 6.647401C11.894845 3.725463 9.534486 1.356779 6.623219 1.35657C3.711786 1.35657 1.351635 3.725338 1.351635 6.647401C1.351843 9.569296 3.711911 11.938273 6.623219 11.938273C9.534361 11.938064 11.894637 9.569171 11.894845 6.647401ZM13.245462 6.647401C13.245254 10.317935 10.280401 13.293613 6.623219 13.293821C2.965871 13.293821 0.000204 10.31806 0 6.647401C0 2.976574 2.965746 0 6.623219 0C10.280526 0.000205 13.245462 2.9767 13.245462 6.647401Z" fill="currentColor"></path><path d="M16.000417 15.041079L15.044449 16.000433L11.530434 12.473588L12.486298 11.514234L16.000417 15.041079Z" fill="currentColor"></path></svg></button><div class="relative"><button class="icon-btn" style="width:26px;height:26px;border-radius:8px" title="分组方式"><svg width="14" height="14" viewBox="0 0 16 16" fill="none"><path transform="translate(1.292 1.3)" d="M10.3232 9.18164C11.2868 9.18164 12.0985 9.82833 12.3506 10.7109L13.415 10.7109L13.415 11.8711L12.3496 11.8711C12.0971 12.7532 11.2864 13.3994 10.3232 13.3994C9.36031 13.3992 8.55012 12.7531 8.29785 11.8711L0 11.8711L0 10.7109L8.29688 10.7109C8.54876 9.82845 9.35988 9.18186 10.3232 9.18164ZM10.3232 10.3418C9.7999 10.3421 9.37534 10.7667 9.375 11.29C9.375 11.8137 9.79969 12.239 10.3232 12.2393C10.847 12.2393 11.2725 11.8138 11.2725 11.29C11.2721 10.7666 10.8468 10.3418 10.3232 10.3418ZM3.08301 4.59082C4.04605 4.59095 4.85696 5.23717 5.10938 6.11914L13.415 6.11914L13.415 7.2793L5.11035 7.2793C4.85833 8.16202 4.04648 8.80846 3.08301 8.80859C2.11972 8.80843 1.30963 8.16179 1.05762 7.2793L0 7.2793L0 6.11914L1.05762 6.11914C1.30994 5.23728 2.12006 4.59098 3.08301 4.59082ZM3.08301 5.75098C2.55962 5.75117 2.13512 6.17587 2.13477 6.69922C2.13477 7.22287 2.5594 7.64824 3.08301 7.64844C3.60665 7.64828 4.03223 7.2229 4.03223 6.69922C4.03187 6.17585 3.60643 5.75113 3.08301 5.75098ZM10.3232 0C11.2869 0 12.0986 0.646596 12.3506 1.5293L13.415 1.5293L13.415 2.68945L12.3496 2.68945C12.363 2.64266 12.3754 2.59488 12.3857 2.54688C12.1838 3.50118 11.3376 4.21777 10.3232 4.21777C9.36037 4.21756 8.55018 3.57139 8.29785 2.68945L0 2.68945L0 1.5293L8.29688 1.5293C8.5487 0.646717 9.35981 0.00021854 10.3232 0ZM10.3232 1.16016C9.79984 1.16042 9.37524 1.58499 9.375 2.1084C9.375 2.63201 9.79969 3.05735 10.3232 3.05762C10.847 3.05762 11.2725 2.63217 11.2725 2.1084C11.2722 1.58483 10.8469 1.16016 10.3232 1.16016Z" fill="currentColor"></path></svg></button></div><button class="icon-btn" style="width:26px;height:26px" title="添加工作区"><svg width="14" height="14" viewBox="0 0 16 16" fill="none"><path transform="translate(9.52 2.52)" d="M3.55246 0L3.55246 2.44252L6 2.44252L6 3.55748L3.55246 3.55748L3.55246 6L2.43834 6L2.43834 3.55748L0 3.55748L0 2.44252L2.43834 2.44252L2.43834 0L3.55246 0Z" fill="currentColor"></path><path transform="translate(0.3496 2.35)" d="M4.76367 0C5.36861 1.80598e-05 5.93113 0.310294 6.25488 0.821289L6.78027 1.64941C6.79685 1.67558 6.81791 1.69775 6.83887 1.71973C6.72186 2.15521 6.65702 2.61192 6.65137 3.08301C6.25601 2.96045 5.90909 2.70478 5.68164 2.3457L5.15723 1.5166C5.07183 1.38189 4.92318 1.3008 4.76367 1.30078L2.32422 1.30078C1.7589 1.30078 1.30078 1.7589 1.30078 2.32422L1.30078 10.1338C1.30078 10.6991 1.7589 11.1572 2.32422 11.1572L11.9766 11.1572C12.5419 11.1572 13 10.6991 13 10.1338L13 8.58398C13.4545 8.5135 13.8903 8.38748 14.3008 8.21289L14.3008 10.1338C14.3008 11.4171 13.2598 12.458 11.9766 12.458L2.32422 12.458C1.04093 12.458 0 11.4171 0 10.1338L0 2.32422C0 1.04093 1.04093 0 2.32422 0L4.76367 0Z" fill="currentColor"></path></svg></button></div><div class="min-h-0 flex-1 overflow-y-auto px-3 pb-3"><div class="px-2 py-6 text-center" style="font-size:12.5px;color:var(--dsw-label-caption)">暂无会话</div></div><div class="px-3 py-2.5"><button class="flex w-full items-center gap-2.5 rounded-xl px-4 py-2 text-left transition-colors" style="color:var(--dsw-label-secondary)"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M14.0861 5.51366C13.8717 5.0575 13.588 4.58542 13.2889 4.18108C13.208 4.07172 13.1596 4.04373 13.0243 4.03054C12.4277 3.97255 11.8245 4.05527 11.2269 3.9972C10.7224 3.94816 10.3133 3.71661 10.0115 3.30919C9.66986 2.84777 9.43973 2.31343 9.09824 1.85234C9.01771 1.74365 8.96805 1.71589 8.83354 1.70282C8.29432 1.65044 7.70402 1.65061 7.16656 1.70282C7.03205 1.71589 6.98239 1.74365 6.90186 1.85234C6.56067 2.31303 6.33025 2.84774 5.98855 3.30919C5.68681 3.71661 5.27774 3.94816 4.77317 3.9972C4.17564 4.05527 3.57239 3.97255 2.97585 4.03054C2.84046 4.04373 2.79208 4.07172 2.71115 4.18108C2.41212 4.58542 2.12835 5.0575 1.91403 5.51366C1.85299 5.64359 1.85286 5.7018 1.91403 5.8319C2.14865 6.33077 2.49748 6.76892 2.73237 7.26854C2.9594 7.7515 2.96041 8.24717 2.73338 8.73044C2.49837 9.23061 2.14891 9.66837 1.91403 10.1681C1.85291 10.2982 1.85299 10.3564 1.91403 10.4863C2.12856 10.9429 2.41185 11.4142 2.71115 11.8189C2.79208 11.9283 2.84046 11.9563 2.97585 11.9694C3.57239 12.0274 4.17564 11.9447 4.77317 12.0028C5.27774 12.0518 5.68681 12.2834 5.98855 12.6908C6.33024 13.1522 6.56037 13.6866 6.90186 14.1476C6.98239 14.2563 7.03205 14.2841 7.16656 14.2972C7.70402 14.3494 8.29432 14.3495 8.83354 14.2972C8.96805 14.2841 9.01771 14.2563 9.09824 14.1476C9.43944 13.687 9.66985 13.1522 10.0115 12.6908C10.3133 12.2834 10.7224 12.0518 11.2269 12.0028C11.8244 11.9447 12.4271 12.0275 13.0243 11.9694C13.1596 11.9563 13.208 11.9283 13.2889 11.8189C13.5891 11.4131 13.872 10.942 14.0861 10.4863C14.1471 10.3564 14.1472 10.2982 14.0861 10.1681C13.8513 9.66861 13.5017 9.23061 13.2667 8.73044C13.0397 8.24717 13.0407 7.7515 13.2677 7.26854C13.5026 6.7689 13.8513 6.33106 14.0861 5.8319C14.1472 5.7018 14.1471 5.64359 14.0861 5.51366ZM15.3035 6.40373C15.0685 6.90359 14.7188 7.34119 14.4841 7.84037C14.4231 7.97025 14.423 8.02855 14.4841 8.15861C14.7189 8.65833 15.0685 9.09611 15.3035 9.59626C15.5308 10.0801 15.5308 10.5744 15.3035 11.0582C15.052 11.5933 14.7225 12.1426 14.37 12.6191C14.0685 13.0265 13.6581 13.259 13.1536 13.3081C12.5566 13.366 11.9541 13.2835 11.3573 13.3414C11.2228 13.3545 11.1731 13.3823 11.0926 13.491C10.7511 13.9521 10.521 14.4864 10.1793 14.9478C9.87828 15.3542 9.46719 15.5869 8.96387 15.6358C8.34008 15.6964 7.66194 15.6966 7.03623 15.6358C6.53291 15.5869 6.12182 15.3542 5.82084 14.9478C5.47911 14.4863 5.24878 13.9517 4.90753 13.491C4.82701 13.3823 4.77734 13.3545 4.64284 13.3414C4.04647 13.2835 3.44373 13.366 2.84653 13.3081C2.34201 13.259 1.93164 13.0265 1.63013 12.6191C1.27867 12.144 0.948453 11.5941 0.696621 11.0582C0.469315 10.5744 0.469279 10.0801 0.696621 9.59626C0.931628 9.09613 1.2813 8.65807 1.51597 8.15861C1.57708 8.02855 1.57702 7.97025 1.51597 7.84037C1.28117 7.34095 0.931635 6.9036 0.696621 6.40373C0.469213 5.91992 0.469367 5.42562 0.696621 4.94183C0.948441 4.40587 1.27868 3.85598 1.63013 3.38092C1.93164 2.97349 2.34201 2.74095 2.84653 2.6919C3.44353 2.63397 4.04599 2.71649 4.64284 2.65856C4.77734 2.64549 4.82701 2.61774 4.90753 2.50904C5.24905 2.04792 5.47913 1.51362 5.82084 1.05219C6.12182 0.645806 6.53291 0.413119 7.03623 0.364178C7.66002 0.303556 8.33816 0.303369 8.96387 0.364178C9.46719 0.413119 9.87828 0.645806 10.1793 1.05219C10.521 1.51365 10.7513 2.04828 11.0926 2.50904C11.1731 2.61774 11.2228 2.64549 11.3573 2.65856C11.9541 2.71649 12.5566 2.63397 13.1536 2.6919C13.6581 2.74095 14.0685 2.97349 14.37 3.38092C14.7214 3.85598 15.0517 4.40587 15.3035 4.94183C15.5307 5.42562 15.5309 5.91992 15.3035 6.40373Z" fill="currentColor"></path><path d="M9.13764 7.99999C9.13764 7.3715 8.62855 6.8624 8.00005 6.8624C7.37155 6.8624 6.86246 7.3715 6.86246 7.99999C6.86246 8.62849 7.37155 9.13759 8.00005 9.13759C8.62855 9.13759 9.13764 8.62849 9.13764 7.99999ZM10.4834 7.99999C10.4834 9.37126 9.37132 10.4833 8.00005 10.4833C6.62878 10.4833 5.51674 9.37126 5.51674 7.99999C5.51674 6.62873 6.62878 5.51669 8.00005 5.51669C9.37132 5.51669 10.4834 6.62873 10.4834 7.99999Z" fill="currentColor"></path></svg><span style="font-size:var(--dsh-content-font-size)">设置</span></button></div></div></div><div class="pi-main flex min-h-0 min-w-0 flex-col"><div class="flex min-h-0 flex-1 flex-col"><div class="flex h-full min-h-0 flex-col items-center justify-center px-6"><div class="mb-5 flex items-center justify-center gap-3"><svg width="40" height="40" viewBox="165.29 165.29 469.43 469.43" aria-hidden="true" style="color:var(--dsw-label-primary);display:block;flex:none"><path fill="currentColor" fill-rule="evenodd" d="M165.29 165.29 H517.36 V400 H400 V517.36 H282.65 V634.72 H165.29 Z M282.65 282.65 V400 H400 V282.65 Z"></path><path fill="currentColor" d="M517.36 400 H634.72 V634.72 H517.36 Z"></path></svg></div><div class="w-full flex flex-col items-stretch mx-auto" style="max-width:var(--dsh-composer-card-max-width)"><div class="mb-3 flex items-center gap-3" style="padding-left:7px"><div class="relative"><button class="hero-chip" data-open="false"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" class="hero-chip-icon"><path transform="translate(1.5 2.429)" d="M5.05582 0.518756L4.50669 0.86654L5.05582 0.518756ZM13 9.4837L13.65 9.4837L13.65 3.53962L13 3.53962L12.35 3.53962L12.35 9.4837L13 9.4837ZM11.3264 1.86603L11.3264 1.21603L6.52313 1.21603L6.52313 1.86603L6.52313 2.51603L11.3264 2.51603L11.3264 1.86603ZM5.58054 1.34727L6.12968 0.999489L5.60495 0.170972L5.05582 0.518756L4.50669 0.86654L5.03141 1.69506L5.58054 1.34727ZM4.11323 1.23058e-13L4.11323 -0.65L1.67359 -0.65L1.67359 5.00699e-14L1.67359 0.65L4.11323 0.65L4.11323 1.23058e-13ZM0 1.67359L-0.65 1.67359L-0.65 9.4837L0 9.4837L0.65 9.4837L0.65 1.67359L0 1.67359ZM11.3264 11.1573L11.3264 10.5073L1.67359 10.5073L1.67359 11.1573L1.67359 11.8073L11.3264 11.8073L11.3264 11.1573ZM0 9.4837L-0.65 9.4837C-0.65 10.767 0.390308 11.8073 1.67359 11.8073L1.67359 11.1573L1.67359 10.5073C1.10828 10.5073 0.65 10.049 0.65 9.4837L0 9.4837ZM1.67359 5.00699e-14L1.67359 -0.65C0.390307 -0.65 -0.65 0.390309 -0.65 1.67359L0 1.67359L0.65 1.67359C0.65 1.10828 1.10828 0.65 1.67359 0.65L1.67359 5.00699e-14ZM5.05582 0.518756L5.60495 0.170972C5.28121 -0.340193 4.71829 -0.65 4.11323 -0.65L4.11323 1.23058e-13L4.11323 0.65C4.27282 0.65 4.4213 0.731715 4.50669 0.86654L5.05582 0.518756ZM6.52313 1.86603L6.52313 1.21603C6.36354 1.21603 6.21507 1.13431 6.12968 0.999489L5.58054 1.34727L5.03141 1.69506C5.35515 2.20622 5.91808 2.51603 6.52313 2.51603L6.52313 1.86603ZM13 3.53962L13.65 3.53962C13.65 2.25634 12.6097 1.21603 11.3264 1.21603L11.3264 1.86603L11.3264 2.51603C11.8917 2.51603 12.35 2.97431 12.35 3.53962L13 3.53962ZM13 9.4837L12.35 9.4837C12.35 10.049 11.8917 10.5073 11.3264 10.5073L11.3264 11.1573L11.3264 11.8073C12.6097 11.8073 13.65 10.767 13.65 9.4837L13 9.4837Z" fill="currentColor"></path></svg><span class="max-w-[220px] truncate">新建工作区</span><span class="chevron"><svg width="14" height="14" viewBox="0 0 14 14" fill="none"><path d="M11.8486 5.5L11.4238 5.92383L8.69727 8.65137C8.44157 8.90706 8.21562 9.13382 8.01172 9.29785C7.79912 9.46883 7.55595 9.61756 7.25 9.66602C7.08435 9.69222 6.91565 9.69222 6.75 9.66602C6.44405 9.61756 6.20088 9.46883 5.98828 9.29785C5.78438 9.13382 5.55843 8.90706 5.30273 8.65137L2.57617 5.92383L2.15137 5.5L3 4.65137L3.42383 5.07617L6.15137 7.80273C6.42595 8.07732 6.59876 8.24849 6.74023 8.3623C6.87291 8.46904 6.92272 8.47813 6.9375 8.48047C6.97895 8.48703 7.02105 8.48703 7.0625 8.48047C7.07728 8.47813 7.12709 8.46904 7.25977 8.3623C7.40124 8.24849 7.57405 8.07732 7.84863 7.80273L10.5762 5.07617L11 4.65137L11.8486 5.5Z" fill="currentColor"></path></svg></span></button></div></div><div class="relative w-full" data-testid="composer"><div class="relative w-full" style="border-radius:22px;background:var(--dsw-input-major);box-shadow:var(--dsw-elevation-soft);border:0.5px solid var(--dsw-border-l1)"><div class="px-4 pt-3 flex items-start gap-1.5"><textarea disabled="" rows="1" placeholder="当前模型不可用,请先选择模型" class="min-w-0 flex-1 resize-none" style="font-size:var(--piweb-chat-font-size, var(--dsh-content-font-size));line-height:1.55"></textarea></div><div class="flex items-center gap-2" style="padding-left:8px;padding-right:12px;padding-bottom:8px;padding-top:4px;height:40px;container-type:inline-size"><div class="flex-1"></div><div class="relative"><button type="button" class="chip" data-open="false" title="选择模型" aria-label="选择模型" aria-haspopup="menu" aria-expanded="false"><span class="max-w-[220px] truncate">选择模型</span><span class="chevron"><svg width="14" height="14" viewBox="0 0 14 14" fill="none"><path d="M11.8486 5.5L11.4238 5.92383L8.69727 8.65137C8.44157 8.90706 8.21562 9.13382 8.01172 9.29785C7.79912 9.46883 7.55595 9.61756 7.25 9.66602C7.08435 9.69222 6.91565 9.69222 6.75 9.66602C6.44405 9.61756 6.20088 9.46883 5.98828 9.29785C5.78438 9.13382 5.55843 8.90706 5.30273 8.65137L2.57617 5.92383L2.15137 5.5L3 4.65137L3.42383 5.07617L6.15137 7.80273C6.42595 8.07732 6.59876 8.24849 6.74023 8.3623C6.87291 8.46904 6.92272 8.47813 6.9375 8.48047C6.97895 8.48703 7.02105 8.48703 7.0625 8.48047C7.07728 8.47813 7.12709 8.46904 7.25977 8.3623C7.40124 8.24849 7.57405 8.07732 7.84863 7.80273L10.5762 5.07617L11 4.65137L11.8486 5.5Z" fill="currentColor"></path></svg></span></button></div><button class="btn-primary-circle" title="发送" disabled=""><svg width="16" height="16" viewBox="0 0 14 14" fill="none"><path d="M7.24707 1.01771C7.52897 1.07653 7.77619 1.19694 8.00391 1.38001C8.19202 1.53136 8.39884 1.73784 8.61914 1.95814L12.6396 5.9806L11.6299 6.99134L7.71484 3.0763V13.0001H6.28516V3.0763L2.36914 6.99134L1.35938 5.9806L5.38086 1.95814C5.60116 1.73784 5.80798 1.53136 5.99609 1.38001C6.19476 1.22027 6.4385 1.06739 6.75195 1.01771C6.91296 0.992304 7.07471 0.997504 7.24707 1.01771Z" fill="currentColor"></path></svg></button></div></div></div></div></div></div></div><div aria-hidden="true"></div><div class="fixed top-0 h-full w-2 cursor-col-resize" style="left:276px;z-index:40"></div><!--$!--><template data-dgst="BAILOUT_TO_CLIENT_SIDE_RENDERING"></template><!--/$--></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-bd2b9202ecbcdcaa.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[7121,[],\"\"]\n3:I[4581,[],\"\"]\n4:I[1859,[\"316\",\"static/chunks/316-5ea443ee6b512aa9.js\",\"4686\",\"static/chunks/4686-e3825f3b6a384aa1.js\",\"8974\",\"static/chunks/app/page-2e425ef83fba0782.js\"],\"I18nProvider\"]\n5:I[6517,[\"316\",\"static/chunks/316-5ea443ee6b512aa9.js\",\"4686\",\"static/chunks/4686-e3825f3b6a384aa1.js\",\"8974\",\"static/chunks/app/page-2e425ef83fba0782.js\"],\"AppShell\"]\n6:I[484,[],\"OutletBoundary\"]\n7:\"$Sreact.suspense\"\n9:I[484,[],\"ViewportBoundary\"]\nb:I[484,[],\"MetadataBoundary\"]\nd:I[7123,[],\"default\",1]\n:HL[\"/_next/static/css/459a9ed40847a72f.css\",\"style\"]\n:HL[\"/_next/static/css/6ba662805d17ffc2.css\",\"style\"]\n:HL[\"/_next/static/css/7391c42e1ae617f9.css\",\"style\"]\n0:{\"P\":null,\"c\":[\"\",\"\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{},\"$undefined\",\"$undefined\",4608]},\"$undefined\",\"$undefined\",4624],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/459a9ed40847a72f.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/6ba662805d17ffc2.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"2\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/7391c42e1ae617f9.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"zh-CN\",\"suppressHydrationWarning\":true,\"children\":[\"$\",\"body\",null,{\"suppressHydrationWarning\":true,\"children\":[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$L5\",null,{}]}],null,[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$7\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@8\"}]}]]}],{},null,false,null]},null,false,null],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L9\",null,{\"children\":\"$La\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$Lb\",null,{\"children\":[\"$\",\"$7\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lc\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$d\",[]],\"S\":true,\"h\":null,\"r\":\"$undefined\",\"s\":\"$undefined\",\"a\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"JDGSR-TIbk9qZWcUNYIX3\"}\na:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"2\",{\"name\":\"theme-color\",\"content\":\"#fcfbf9\",\"media\":\"(prefers-color-scheme: light)\"}],[\"$\",\"meta\",\"3\",{\"name\":\"theme-color\",\"content\":\"#2e3440\",\"media\":\"(prefers-color-scheme: dark)\"}]]\ne:I[6869,[],\"IconMark\"]\n8:null\nc:[[\"$\",\"title\",\"0\",{\"children\":\"pi\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Web UI for the pi coding agent\"}],[\"$\",\"link\",\"2\",{\"rel\":\"icon\",\"href\":\"/icon.svg?779ce17318f43f72\",\"type\":\"image/svg+xml\",\"sizes\":\"any\"}],[\"$\",\"$Le\",\"3\",{}]]\n"])</script></body></html>
|
|
1
|
+
<!DOCTYPE html><html lang="zh-CN"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/459a9ed40847a72f.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/6ba662805d17ffc2.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/7391c42e1ae617f9.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-3614a8337843456b.js"/><script src="/_next/static/chunks/4bd1b696-93bf506b236d6248.js" async=""></script><script src="/_next/static/chunks/3794-3679f1c05160977c.js" async=""></script><script src="/_next/static/chunks/main-app-e9b53f0e1c6591b2.js" async=""></script><script src="/_next/static/chunks/316-5ea443ee6b512aa9.js" async=""></script><script src="/_next/static/chunks/4686-b1e9fa876d0ea671.js" async=""></script><script src="/_next/static/chunks/app/page-2e425ef83fba0782.js" async=""></script><meta name="theme-color" content="#fcfbf9" media="(prefers-color-scheme: light)"/><meta name="theme-color" content="#2e3440" media="(prefers-color-scheme: dark)"/><title>pi</title><meta name="description" content="Web UI for the pi coding agent"/><link rel="icon" href="/icon.svg?779ce17318f43f72" type="image/svg+xml" sizes="any"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div class="grid h-screen w-screen overflow-hidden" style="grid-template-columns:280px minmax(0,1fr) 0px;background:var(--dsw-bg-base)"><div class="min-h-0 overflow-hidden" style="background:var(--dsw-sidebar-fill)"><div class="flex h-full min-h-0 flex-col"><div class="flex items-center gap-1 px-4 pb-2 pt-4"><div class="inline-flex items-center select-none" style="color:var(--dsw-label-primary);gap:6px"><svg width="17" height="17" viewBox="165.29 165.29 469.43 469.43" aria-hidden="true" style="color:var(--dsw-label-primary);display:block;flex:none"><path fill="currentColor" fill-rule="evenodd" d="M165.29 165.29 H517.36 V400 H400 V517.36 H282.65 V634.72 H165.29 Z M282.65 282.65 V400 H400 V282.65 Z"></path><path fill="currentColor" d="M517.36 400 H634.72 V634.72 H517.36 Z"></path></svg><span class="inline-flex items-center" style="font-size:16.5px;font-weight:600;letter-spacing:-0.02em;color:var(--dsw-label-primary);line-height:1">pi</span><span class="inline-flex items-center justify-center font-bold" style="font-size:9.5px;letter-spacing:0.06em;height:15px;padding-left:4.5px;padding-right:4.5px;border-radius:4px;background:var(--dsw-label-primary);color:var(--dsw-bg-base);line-height:1;text-transform:uppercase">HARNESS</span></div><div class="flex-1"></div><button class="icon-btn" title="«"><svg width="15" height="15" viewBox="0 0 16 16" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.67272 0.522841C10.8339 0.522841 11.76 0.522714 12.4963 0.602493C13.2453 0.683657 13.8789 0.854248 14.4264 1.25197C14.7504 1.48739 15.0355 1.77247 15.2709 2.0965C15.6686 2.64394 15.8392 3.27758 15.9204 4.02655C16.0002 4.7629 16 5.68895 16 6.85014V9.14986C16 10.3111 16.0002 11.2371 15.9204 11.9735C15.8392 12.7224 15.6686 13.3561 15.2709 13.9035C15.0355 14.2275 14.7504 14.5126 14.4264 14.748C13.8789 15.1458 13.2453 15.3163 12.4963 15.3975C11.76 15.4773 10.8339 15.4772 9.67272 15.4772H6.3273C5.16611 15.4772 4.24006 15.4773 3.50371 15.3975C2.75474 15.3163 2.1211 15.1458 1.57366 14.748C1.24963 14.5126 0.964549 14.2275 0.729131 13.9035C0.331407 13.3561 0.160817 12.7224 0.0796529 11.9735C-0.000126137 11.2371 1.25338e-09 10.3111 1.25338e-09 9.14986V6.85014C1.25329e-09 5.68895 -0.000126137 4.7629 0.0796529 4.02655C0.160817 3.27758 0.331407 2.64394 0.729131 2.0965C0.964549 1.77247 1.24963 1.48739 1.57366 1.25197C2.1211 0.854248 2.75474 0.683657 3.50371 0.602493C4.24006 0.522714 5.16611 0.522841 6.3273 0.522841H9.67272ZM5.54303 1.88715V14.1118C5.78636 14.1128 6.04709 14.1169 6.3273 14.1169H9.67272C10.8639 14.1169 11.7032 14.1164 12.3493 14.0465C12.9824 13.9779 13.3497 13.8494 13.6268 13.6482C13.8354 13.4966 14.0195 13.3125 14.1711 13.1039C14.3723 12.8268 14.5007 12.4595 14.5693 11.8264C14.6393 11.1803 14.6398 10.341 14.6398 9.14986V6.85014C14.6398 5.65896 14.6393 4.81967 14.5693 4.1736C14.5007 3.54048 14.3723 3.17318 14.1711 2.89609C14.0195 2.68747 13.8354 2.50337 13.6268 2.35179C13.3497 2.1506 12.9824 2.02212 12.3493 1.95353C11.7032 1.88358 10.8639 1.88307 9.67272 1.88307H6.3273C6.04709 1.88307 5.78636 1.8862 5.54303 1.88715ZM4.1828 1.91166C3.99125 1.9216 3.8148 1.93577 3.65076 1.95353C3.01764 2.02212 2.65034 2.1506 2.37325 2.35179C2.16463 2.50337 1.98052 2.68747 1.82895 2.89609C1.62776 3.17318 1.49928 3.54048 1.43069 4.1736C1.36074 4.81967 1.36023 5.65896 1.36023 6.85014V9.14986C1.36023 10.341 1.36074 11.1803 1.43069 11.8264C1.49928 12.4595 1.62776 12.8268 1.82895 13.1039C1.98052 13.3125 2.16463 13.4966 2.37325 13.6482C2.65034 13.8494 3.01764 13.9779 3.65076 14.0465C3.81478 14.0642 3.99127 14.0774 4.1828 14.0873V1.91166Z" fill="currentColor"></path></svg></button></div><div class="px-3 pt-1"><button class="btn-new-session w-full"><svg width="14" height="14" viewBox="0 0 16 16" fill="none"><path d="M8.00003 0.3237C3.76075 0.3237 0.32373 3.76072 0.32373 8C0.32373 9.17603 0.589121 10.2922 1.0632 11.2901L1.35291 11.8989L2.5705 11.3205L2.28079 10.7117C1.89079 9.89074 1.67301 8.97167 1.67301 8C1.67301 4.50546 4.50549 1.67298 8.00003 1.67298C11.4946 1.67298 14.3271 4.50546 14.3271 8C14.3271 11.4945 11.4946 14.327 8.00003 14.327C7.28473 14.327 6.76077 14.277 6.29621 14.1487C5.83857 14.0224 5.40441 13.8109 4.88514 13.4488C4.12569 12.919 3.03778 12.7316 2.141 13.2978L2.12682 13.307L2.11264 13.3171L1.34886 13.854L1.79659 15.188L2.86122 14.4384C3.19068 14.2305 3.68325 14.2542 4.11326 14.5539C4.72789 14.9826 5.30042 15.2724 5.93762 15.4484C6.56803 15.6224 7.22776 15.6763 8.00003 15.6763C12.2393 15.6763 15.6763 12.2393 15.6763 8C15.6763 3.76072 12.2393 0.3237 8.00003 0.3237ZM7.32033 4.82535V7.32536H4.82538V8.67464H7.32033V11.1747H8.6696V8.67464H11.1747V7.32536H8.6696V4.82535H7.32033Z" fill="currentColor"></path></svg>新会话</button></div><div class="flex items-center gap-0.5 px-4 pb-1 pt-3"><span style="font-size:13px;color:var(--dsw-label-primary)">工作区</span><div class="flex-1"></div><button class="icon-btn" style="width:26px;height:26px" title="搜索"><svg width="14" height="14" viewBox="0 0 16 16" fill="none"><path d="M11.894845 6.647401C11.894845 3.725463 9.534486 1.356779 6.623219 1.35657C3.711786 1.35657 1.351635 3.725338 1.351635 6.647401C1.351843 9.569296 3.711911 11.938273 6.623219 11.938273C9.534361 11.938064 11.894637 9.569171 11.894845 6.647401ZM13.245462 6.647401C13.245254 10.317935 10.280401 13.293613 6.623219 13.293821C2.965871 13.293821 0.000204 10.31806 0 6.647401C0 2.976574 2.965746 0 6.623219 0C10.280526 0.000205 13.245462 2.9767 13.245462 6.647401Z" fill="currentColor"></path><path d="M16.000417 15.041079L15.044449 16.000433L11.530434 12.473588L12.486298 11.514234L16.000417 15.041079Z" fill="currentColor"></path></svg></button><div class="relative"><button class="icon-btn" style="width:26px;height:26px;border-radius:8px" title="分组方式"><svg width="14" height="14" viewBox="0 0 16 16" fill="none"><path transform="translate(1.292 1.3)" d="M10.3232 9.18164C11.2868 9.18164 12.0985 9.82833 12.3506 10.7109L13.415 10.7109L13.415 11.8711L12.3496 11.8711C12.0971 12.7532 11.2864 13.3994 10.3232 13.3994C9.36031 13.3992 8.55012 12.7531 8.29785 11.8711L0 11.8711L0 10.7109L8.29688 10.7109C8.54876 9.82845 9.35988 9.18186 10.3232 9.18164ZM10.3232 10.3418C9.7999 10.3421 9.37534 10.7667 9.375 11.29C9.375 11.8137 9.79969 12.239 10.3232 12.2393C10.847 12.2393 11.2725 11.8138 11.2725 11.29C11.2721 10.7666 10.8468 10.3418 10.3232 10.3418ZM3.08301 4.59082C4.04605 4.59095 4.85696 5.23717 5.10938 6.11914L13.415 6.11914L13.415 7.2793L5.11035 7.2793C4.85833 8.16202 4.04648 8.80846 3.08301 8.80859C2.11972 8.80843 1.30963 8.16179 1.05762 7.2793L0 7.2793L0 6.11914L1.05762 6.11914C1.30994 5.23728 2.12006 4.59098 3.08301 4.59082ZM3.08301 5.75098C2.55962 5.75117 2.13512 6.17587 2.13477 6.69922C2.13477 7.22287 2.5594 7.64824 3.08301 7.64844C3.60665 7.64828 4.03223 7.2229 4.03223 6.69922C4.03187 6.17585 3.60643 5.75113 3.08301 5.75098ZM10.3232 0C11.2869 0 12.0986 0.646596 12.3506 1.5293L13.415 1.5293L13.415 2.68945L12.3496 2.68945C12.363 2.64266 12.3754 2.59488 12.3857 2.54688C12.1838 3.50118 11.3376 4.21777 10.3232 4.21777C9.36037 4.21756 8.55018 3.57139 8.29785 2.68945L0 2.68945L0 1.5293L8.29688 1.5293C8.5487 0.646717 9.35981 0.00021854 10.3232 0ZM10.3232 1.16016C9.79984 1.16042 9.37524 1.58499 9.375 2.1084C9.375 2.63201 9.79969 3.05735 10.3232 3.05762C10.847 3.05762 11.2725 2.63217 11.2725 2.1084C11.2722 1.58483 10.8469 1.16016 10.3232 1.16016Z" fill="currentColor"></path></svg></button></div><button class="icon-btn" style="width:26px;height:26px" title="添加工作区"><svg width="14" height="14" viewBox="0 0 16 16" fill="none"><path transform="translate(9.52 2.52)" d="M3.55246 0L3.55246 2.44252L6 2.44252L6 3.55748L3.55246 3.55748L3.55246 6L2.43834 6L2.43834 3.55748L0 3.55748L0 2.44252L2.43834 2.44252L2.43834 0L3.55246 0Z" fill="currentColor"></path><path transform="translate(0.3496 2.35)" d="M4.76367 0C5.36861 1.80598e-05 5.93113 0.310294 6.25488 0.821289L6.78027 1.64941C6.79685 1.67558 6.81791 1.69775 6.83887 1.71973C6.72186 2.15521 6.65702 2.61192 6.65137 3.08301C6.25601 2.96045 5.90909 2.70478 5.68164 2.3457L5.15723 1.5166C5.07183 1.38189 4.92318 1.3008 4.76367 1.30078L2.32422 1.30078C1.7589 1.30078 1.30078 1.7589 1.30078 2.32422L1.30078 10.1338C1.30078 10.6991 1.7589 11.1572 2.32422 11.1572L11.9766 11.1572C12.5419 11.1572 13 10.6991 13 10.1338L13 8.58398C13.4545 8.5135 13.8903 8.38748 14.3008 8.21289L14.3008 10.1338C14.3008 11.4171 13.2598 12.458 11.9766 12.458L2.32422 12.458C1.04093 12.458 0 11.4171 0 10.1338L0 2.32422C0 1.04093 1.04093 0 2.32422 0L4.76367 0Z" fill="currentColor"></path></svg></button></div><div class="min-h-0 flex-1 overflow-y-auto px-3 pb-3"><div class="px-2 py-6 text-center" style="font-size:12.5px;color:var(--dsw-label-caption)">暂无会话</div></div><div class="px-3 py-2.5"><button class="flex w-full items-center gap-2.5 rounded-xl px-4 py-2 text-left transition-colors" style="color:var(--dsw-label-secondary)"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M14.0861 5.51366C13.8717 5.0575 13.588 4.58542 13.2889 4.18108C13.208 4.07172 13.1596 4.04373 13.0243 4.03054C12.4277 3.97255 11.8245 4.05527 11.2269 3.9972C10.7224 3.94816 10.3133 3.71661 10.0115 3.30919C9.66986 2.84777 9.43973 2.31343 9.09824 1.85234C9.01771 1.74365 8.96805 1.71589 8.83354 1.70282C8.29432 1.65044 7.70402 1.65061 7.16656 1.70282C7.03205 1.71589 6.98239 1.74365 6.90186 1.85234C6.56067 2.31303 6.33025 2.84774 5.98855 3.30919C5.68681 3.71661 5.27774 3.94816 4.77317 3.9972C4.17564 4.05527 3.57239 3.97255 2.97585 4.03054C2.84046 4.04373 2.79208 4.07172 2.71115 4.18108C2.41212 4.58542 2.12835 5.0575 1.91403 5.51366C1.85299 5.64359 1.85286 5.7018 1.91403 5.8319C2.14865 6.33077 2.49748 6.76892 2.73237 7.26854C2.9594 7.7515 2.96041 8.24717 2.73338 8.73044C2.49837 9.23061 2.14891 9.66837 1.91403 10.1681C1.85291 10.2982 1.85299 10.3564 1.91403 10.4863C2.12856 10.9429 2.41185 11.4142 2.71115 11.8189C2.79208 11.9283 2.84046 11.9563 2.97585 11.9694C3.57239 12.0274 4.17564 11.9447 4.77317 12.0028C5.27774 12.0518 5.68681 12.2834 5.98855 12.6908C6.33024 13.1522 6.56037 13.6866 6.90186 14.1476C6.98239 14.2563 7.03205 14.2841 7.16656 14.2972C7.70402 14.3494 8.29432 14.3495 8.83354 14.2972C8.96805 14.2841 9.01771 14.2563 9.09824 14.1476C9.43944 13.687 9.66985 13.1522 10.0115 12.6908C10.3133 12.2834 10.7224 12.0518 11.2269 12.0028C11.8244 11.9447 12.4271 12.0275 13.0243 11.9694C13.1596 11.9563 13.208 11.9283 13.2889 11.8189C13.5891 11.4131 13.872 10.942 14.0861 10.4863C14.1471 10.3564 14.1472 10.2982 14.0861 10.1681C13.8513 9.66861 13.5017 9.23061 13.2667 8.73044C13.0397 8.24717 13.0407 7.7515 13.2677 7.26854C13.5026 6.7689 13.8513 6.33106 14.0861 5.8319C14.1472 5.7018 14.1471 5.64359 14.0861 5.51366ZM15.3035 6.40373C15.0685 6.90359 14.7188 7.34119 14.4841 7.84037C14.4231 7.97025 14.423 8.02855 14.4841 8.15861C14.7189 8.65833 15.0685 9.09611 15.3035 9.59626C15.5308 10.0801 15.5308 10.5744 15.3035 11.0582C15.052 11.5933 14.7225 12.1426 14.37 12.6191C14.0685 13.0265 13.6581 13.259 13.1536 13.3081C12.5566 13.366 11.9541 13.2835 11.3573 13.3414C11.2228 13.3545 11.1731 13.3823 11.0926 13.491C10.7511 13.9521 10.521 14.4864 10.1793 14.9478C9.87828 15.3542 9.46719 15.5869 8.96387 15.6358C8.34008 15.6964 7.66194 15.6966 7.03623 15.6358C6.53291 15.5869 6.12182 15.3542 5.82084 14.9478C5.47911 14.4863 5.24878 13.9517 4.90753 13.491C4.82701 13.3823 4.77734 13.3545 4.64284 13.3414C4.04647 13.2835 3.44373 13.366 2.84653 13.3081C2.34201 13.259 1.93164 13.0265 1.63013 12.6191C1.27867 12.144 0.948453 11.5941 0.696621 11.0582C0.469315 10.5744 0.469279 10.0801 0.696621 9.59626C0.931628 9.09613 1.2813 8.65807 1.51597 8.15861C1.57708 8.02855 1.57702 7.97025 1.51597 7.84037C1.28117 7.34095 0.931635 6.9036 0.696621 6.40373C0.469213 5.91992 0.469367 5.42562 0.696621 4.94183C0.948441 4.40587 1.27868 3.85598 1.63013 3.38092C1.93164 2.97349 2.34201 2.74095 2.84653 2.6919C3.44353 2.63397 4.04599 2.71649 4.64284 2.65856C4.77734 2.64549 4.82701 2.61774 4.90753 2.50904C5.24905 2.04792 5.47913 1.51362 5.82084 1.05219C6.12182 0.645806 6.53291 0.413119 7.03623 0.364178C7.66002 0.303556 8.33816 0.303369 8.96387 0.364178C9.46719 0.413119 9.87828 0.645806 10.1793 1.05219C10.521 1.51365 10.7513 2.04828 11.0926 2.50904C11.1731 2.61774 11.2228 2.64549 11.3573 2.65856C11.9541 2.71649 12.5566 2.63397 13.1536 2.6919C13.6581 2.74095 14.0685 2.97349 14.37 3.38092C14.7214 3.85598 15.0517 4.40587 15.3035 4.94183C15.5307 5.42562 15.5309 5.91992 15.3035 6.40373Z" fill="currentColor"></path><path d="M9.13764 7.99999C9.13764 7.3715 8.62855 6.8624 8.00005 6.8624C7.37155 6.8624 6.86246 7.3715 6.86246 7.99999C6.86246 8.62849 7.37155 9.13759 8.00005 9.13759C8.62855 9.13759 9.13764 8.62849 9.13764 7.99999ZM10.4834 7.99999C10.4834 9.37126 9.37132 10.4833 8.00005 10.4833C6.62878 10.4833 5.51674 9.37126 5.51674 7.99999C5.51674 6.62873 6.62878 5.51669 8.00005 5.51669C9.37132 5.51669 10.4834 6.62873 10.4834 7.99999Z" fill="currentColor"></path></svg><span style="font-size:var(--dsh-content-font-size)">设置</span></button></div></div></div><div class="pi-main flex min-h-0 min-w-0 flex-col"><div class="flex min-h-0 flex-1 flex-col"><div class="flex h-full min-h-0 flex-col items-center justify-center px-6"><div class="mb-5 flex items-center justify-center gap-3"><svg width="40" height="40" viewBox="165.29 165.29 469.43 469.43" aria-hidden="true" style="color:var(--dsw-label-primary);display:block;flex:none"><path fill="currentColor" fill-rule="evenodd" d="M165.29 165.29 H517.36 V400 H400 V517.36 H282.65 V634.72 H165.29 Z M282.65 282.65 V400 H400 V282.65 Z"></path><path fill="currentColor" d="M517.36 400 H634.72 V634.72 H517.36 Z"></path></svg></div><div class="w-full flex flex-col items-stretch mx-auto" style="max-width:var(--dsh-composer-card-max-width)"><div class="mb-3 flex items-center gap-3" style="padding-left:7px"><div class="relative"><button class="hero-chip" data-open="false"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" class="hero-chip-icon"><path transform="translate(1.5 2.429)" d="M5.05582 0.518756L4.50669 0.86654L5.05582 0.518756ZM13 9.4837L13.65 9.4837L13.65 3.53962L13 3.53962L12.35 3.53962L12.35 9.4837L13 9.4837ZM11.3264 1.86603L11.3264 1.21603L6.52313 1.21603L6.52313 1.86603L6.52313 2.51603L11.3264 2.51603L11.3264 1.86603ZM5.58054 1.34727L6.12968 0.999489L5.60495 0.170972L5.05582 0.518756L4.50669 0.86654L5.03141 1.69506L5.58054 1.34727ZM4.11323 1.23058e-13L4.11323 -0.65L1.67359 -0.65L1.67359 5.00699e-14L1.67359 0.65L4.11323 0.65L4.11323 1.23058e-13ZM0 1.67359L-0.65 1.67359L-0.65 9.4837L0 9.4837L0.65 9.4837L0.65 1.67359L0 1.67359ZM11.3264 11.1573L11.3264 10.5073L1.67359 10.5073L1.67359 11.1573L1.67359 11.8073L11.3264 11.8073L11.3264 11.1573ZM0 9.4837L-0.65 9.4837C-0.65 10.767 0.390308 11.8073 1.67359 11.8073L1.67359 11.1573L1.67359 10.5073C1.10828 10.5073 0.65 10.049 0.65 9.4837L0 9.4837ZM1.67359 5.00699e-14L1.67359 -0.65C0.390307 -0.65 -0.65 0.390309 -0.65 1.67359L0 1.67359L0.65 1.67359C0.65 1.10828 1.10828 0.65 1.67359 0.65L1.67359 5.00699e-14ZM5.05582 0.518756L5.60495 0.170972C5.28121 -0.340193 4.71829 -0.65 4.11323 -0.65L4.11323 1.23058e-13L4.11323 0.65C4.27282 0.65 4.4213 0.731715 4.50669 0.86654L5.05582 0.518756ZM6.52313 1.86603L6.52313 1.21603C6.36354 1.21603 6.21507 1.13431 6.12968 0.999489L5.58054 1.34727L5.03141 1.69506C5.35515 2.20622 5.91808 2.51603 6.52313 2.51603L6.52313 1.86603ZM13 3.53962L13.65 3.53962C13.65 2.25634 12.6097 1.21603 11.3264 1.21603L11.3264 1.86603L11.3264 2.51603C11.8917 2.51603 12.35 2.97431 12.35 3.53962L13 3.53962ZM13 9.4837L12.35 9.4837C12.35 10.049 11.8917 10.5073 11.3264 10.5073L11.3264 11.1573L11.3264 11.8073C12.6097 11.8073 13.65 10.767 13.65 9.4837L13 9.4837Z" fill="currentColor"></path></svg><span class="max-w-[220px] truncate">新建工作区</span><span class="chevron"><svg width="14" height="14" viewBox="0 0 14 14" fill="none"><path d="M11.8486 5.5L11.4238 5.92383L8.69727 8.65137C8.44157 8.90706 8.21562 9.13382 8.01172 9.29785C7.79912 9.46883 7.55595 9.61756 7.25 9.66602C7.08435 9.69222 6.91565 9.69222 6.75 9.66602C6.44405 9.61756 6.20088 9.46883 5.98828 9.29785C5.78438 9.13382 5.55843 8.90706 5.30273 8.65137L2.57617 5.92383L2.15137 5.5L3 4.65137L3.42383 5.07617L6.15137 7.80273C6.42595 8.07732 6.59876 8.24849 6.74023 8.3623C6.87291 8.46904 6.92272 8.47813 6.9375 8.48047C6.97895 8.48703 7.02105 8.48703 7.0625 8.48047C7.07728 8.47813 7.12709 8.46904 7.25977 8.3623C7.40124 8.24849 7.57405 8.07732 7.84863 7.80273L10.5762 5.07617L11 4.65137L11.8486 5.5Z" fill="currentColor"></path></svg></span></button></div></div><div class="relative w-full" data-testid="composer"><div class="relative w-full" style="border-radius:22px;background:var(--dsw-input-major);box-shadow:var(--dsw-elevation-soft);border:0.5px solid var(--dsw-border-l1)"><div class="px-4 pt-3 flex items-start gap-1.5"><textarea disabled="" rows="1" placeholder="当前模型不可用,请先选择模型" class="min-w-0 flex-1 resize-none" style="font-size:var(--piweb-chat-font-size, var(--dsh-content-font-size));line-height:1.55"></textarea></div><div class="flex items-center gap-2" style="padding-left:8px;padding-right:12px;padding-bottom:8px;padding-top:4px;height:40px;container-type:inline-size"><div class="flex-1"></div><div class="relative"><button type="button" class="chip" data-open="false" title="选择模型" aria-label="选择模型" aria-haspopup="menu" aria-expanded="false"><span class="max-w-[220px] truncate">选择模型</span><span class="chevron"><svg width="14" height="14" viewBox="0 0 14 14" fill="none"><path d="M11.8486 5.5L11.4238 5.92383L8.69727 8.65137C8.44157 8.90706 8.21562 9.13382 8.01172 9.29785C7.79912 9.46883 7.55595 9.61756 7.25 9.66602C7.08435 9.69222 6.91565 9.69222 6.75 9.66602C6.44405 9.61756 6.20088 9.46883 5.98828 9.29785C5.78438 9.13382 5.55843 8.90706 5.30273 8.65137L2.57617 5.92383L2.15137 5.5L3 4.65137L3.42383 5.07617L6.15137 7.80273C6.42595 8.07732 6.59876 8.24849 6.74023 8.3623C6.87291 8.46904 6.92272 8.47813 6.9375 8.48047C6.97895 8.48703 7.02105 8.48703 7.0625 8.48047C7.07728 8.47813 7.12709 8.46904 7.25977 8.3623C7.40124 8.24849 7.57405 8.07732 7.84863 7.80273L10.5762 5.07617L11 4.65137L11.8486 5.5Z" fill="currentColor"></path></svg></span></button></div><button class="btn-primary-circle" title="发送" disabled=""><svg width="16" height="16" viewBox="0 0 14 14" fill="none"><path d="M7.24707 1.01771C7.52897 1.07653 7.77619 1.19694 8.00391 1.38001C8.19202 1.53136 8.39884 1.73784 8.61914 1.95814L12.6396 5.9806L11.6299 6.99134L7.71484 3.0763V13.0001H6.28516V3.0763L2.36914 6.99134L1.35938 5.9806L5.38086 1.95814C5.60116 1.73784 5.80798 1.53136 5.99609 1.38001C6.19476 1.22027 6.4385 1.06739 6.75195 1.01771C6.91296 0.992304 7.07471 0.997504 7.24707 1.01771Z" fill="currentColor"></path></svg></button></div></div></div></div></div></div></div><div aria-hidden="true"></div><div class="fixed top-0 h-full w-2 cursor-col-resize" style="left:276px;z-index:40"></div><!--$!--><template data-dgst="BAILOUT_TO_CLIENT_SIDE_RENDERING"></template><!--/$--></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-3614a8337843456b.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[7121,[],\"\"]\n3:I[4581,[],\"\"]\n4:I[1859,[\"316\",\"static/chunks/316-5ea443ee6b512aa9.js\",\"4686\",\"static/chunks/4686-b1e9fa876d0ea671.js\",\"8974\",\"static/chunks/app/page-2e425ef83fba0782.js\"],\"I18nProvider\"]\n5:I[6517,[\"316\",\"static/chunks/316-5ea443ee6b512aa9.js\",\"4686\",\"static/chunks/4686-b1e9fa876d0ea671.js\",\"8974\",\"static/chunks/app/page-2e425ef83fba0782.js\"],\"AppShell\"]\n6:I[484,[],\"OutletBoundary\"]\n7:\"$Sreact.suspense\"\n9:I[484,[],\"ViewportBoundary\"]\nb:I[484,[],\"MetadataBoundary\"]\nd:I[7123,[],\"default\",1]\n:HL[\"/_next/static/css/459a9ed40847a72f.css\",\"style\"]\n:HL[\"/_next/static/css/6ba662805d17ffc2.css\",\"style\"]\n:HL[\"/_next/static/css/7391c42e1ae617f9.css\",\"style\"]\n0:{\"P\":null,\"c\":[\"\",\"\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{},\"$undefined\",\"$undefined\",4608]},\"$undefined\",\"$undefined\",4624],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/459a9ed40847a72f.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/6ba662805d17ffc2.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"2\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/7391c42e1ae617f9.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"zh-CN\",\"suppressHydrationWarning\":true,\"children\":[\"$\",\"body\",null,{\"suppressHydrationWarning\":true,\"children\":[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$L5\",null,{}]}],null,[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$7\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@8\"}]}]]}],{},null,false,null]},null,false,null],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L9\",null,{\"children\":\"$La\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$Lb\",null,{\"children\":[\"$\",\"$7\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lc\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$d\",[]],\"S\":true,\"h\":null,\"r\":\"$undefined\",\"s\":\"$undefined\",\"a\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"_Y3Lq0lI5RJ1tFSOnDi0L\"}\na:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"2\",{\"name\":\"theme-color\",\"content\":\"#fcfbf9\",\"media\":\"(prefers-color-scheme: light)\"}],[\"$\",\"meta\",\"3\",{\"name\":\"theme-color\",\"content\":\"#2e3440\",\"media\":\"(prefers-color-scheme: dark)\"}]]\ne:I[6869,[],\"IconMark\"]\n8:null\nc:[[\"$\",\"title\",\"0\",{\"children\":\"pi\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Web UI for the pi coding agent\"}],[\"$\",\"link\",\"2\",{\"rel\":\"icon\",\"href\":\"/icon.svg?779ce17318f43f72\",\"type\":\"image/svg+xml\",\"sizes\":\"any\"}],[\"$\",\"$Le\",\"3\",{}]]\n"])</script></body></html>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
1:"$Sreact.fragment"
|
|
2
2
|
2:I[7121,[],""]
|
|
3
3
|
3:I[4581,[],""]
|
|
4
|
-
4:I[1859,["316","static/chunks/316-5ea443ee6b512aa9.js","4686","static/chunks/4686-
|
|
5
|
-
5:I[6517,["316","static/chunks/316-5ea443ee6b512aa9.js","4686","static/chunks/4686-
|
|
4
|
+
4:I[1859,["316","static/chunks/316-5ea443ee6b512aa9.js","4686","static/chunks/4686-b1e9fa876d0ea671.js","8974","static/chunks/app/page-2e425ef83fba0782.js"],"I18nProvider"]
|
|
5
|
+
5:I[6517,["316","static/chunks/316-5ea443ee6b512aa9.js","4686","static/chunks/4686-b1e9fa876d0ea671.js","8974","static/chunks/app/page-2e425ef83fba0782.js"],"AppShell"]
|
|
6
6
|
6:I[484,[],"OutletBoundary"]
|
|
7
7
|
7:"$Sreact.suspense"
|
|
8
8
|
9:I[484,[],"ViewportBoundary"]
|
|
@@ -11,7 +11,7 @@ d:I[7123,[],"default",1]
|
|
|
11
11
|
:HL["/_next/static/css/459a9ed40847a72f.css","style"]
|
|
12
12
|
:HL["/_next/static/css/6ba662805d17ffc2.css","style"]
|
|
13
13
|
:HL["/_next/static/css/7391c42e1ae617f9.css","style"]
|
|
14
|
-
0:{"P":null,"c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{},"$undefined","$undefined",4608]},"$undefined","$undefined",4624],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/459a9ed40847a72f.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/css/6ba662805d17ffc2.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","2",{"rel":"stylesheet","href":"/_next/static/css/7391c42e1ae617f9.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"zh-CN","suppressHydrationWarning":true,"children":["$","body",null,{"suppressHydrationWarning":true,"children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]]}],{"children":[["$","$1","c",{"children":[["$","$L4",null,{"children":["$","$L5",null,{}]}],null,["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],{},null,false,null]},null,false,null],["$","$1","h",{"children":[null,["$","$L9",null,{"children":"$La"}],["$","div",null,{"hidden":true,"children":["$","$Lb",null,{"children":["$","$7",null,{"name":"Next.Metadata","children":"$Lc"}]}]}],null]}],false]],"m":"$undefined","G":["$d",[]],"S":true,"h":null,"r":"$undefined","s":"$undefined","a":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"
|
|
14
|
+
0:{"P":null,"c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{},"$undefined","$undefined",4608]},"$undefined","$undefined",4624],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/459a9ed40847a72f.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/css/6ba662805d17ffc2.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","2",{"rel":"stylesheet","href":"/_next/static/css/7391c42e1ae617f9.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"zh-CN","suppressHydrationWarning":true,"children":["$","body",null,{"suppressHydrationWarning":true,"children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]]}],{"children":[["$","$1","c",{"children":[["$","$L4",null,{"children":["$","$L5",null,{}]}],null,["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],{},null,false,null]},null,false,null],["$","$1","h",{"children":[null,["$","$L9",null,{"children":"$La"}],["$","div",null,{"hidden":true,"children":["$","$Lb",null,{"children":["$","$7",null,{"name":"Next.Metadata","children":"$Lc"}]}]}],null]}],false]],"m":"$undefined","G":["$d",[]],"S":true,"h":null,"r":"$undefined","s":"$undefined","a":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"_Y3Lq0lI5RJ1tFSOnDi0L"}
|
|
15
15
|
a:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","2",{"name":"theme-color","content":"#fcfbf9","media":"(prefers-color-scheme: light)"}],["$","meta","3",{"name":"theme-color","content":"#2e3440","media":"(prefers-color-scheme: dark)"}]]
|
|
16
16
|
e:I[6869,[],"IconMark"]
|
|
17
17
|
8:null
|